:root {
  color-scheme: light;
  --navy: #0b3b60;
  --navy-strong: #072e4c;
  --teal: #0b8b87;
  --teal-soft: #dff4f1;
  --sand: #f7f3eb;
  --paper: #ffffff;
  --ink: #17212b;
  --muted: #687481;
  --line: #dce3e8;
  --danger: #b42318;
  --warning: #9a6700;
  --shadow: 0 16px 42px rgba(11, 59, 96, 0.08);
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 4%, rgba(11, 139, 135, 0.1), transparent 28rem),
    linear-gradient(180deg, #f8fafb 0, var(--sand) 100%);
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.6; }

.hero {
  color: #fff;
  background:
    linear-gradient(115deg, rgba(11, 139, 135, 0.38), transparent 48%),
    var(--navy);
  border-bottom: 4px solid #e2b85b;
}

.hero__inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 196px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.brand-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  color: #9fe2dc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
}
.brand-mark svg { width: 52px; height: 52px; }
.eyebrow, .section-kicker { margin: 0 0 5px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.eyebrow { color: #9fe2dc; }
.hero h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; }
.hero__subtitle { margin: 10px 0 0; color: #d9e8f2; font-size: 1.05rem; }
.maps-badge { align-self: start; margin-top: 34px; padding: 9px 13px; color: #d8f4f1; border: 1px solid rgba(159, 226, 220, 0.35); border-radius: 999px; background: rgba(0, 0, 0, 0.12); font-size: 0.86rem; }
.maps-badge--error { color: #ffe9ad; border-color: rgba(255, 233, 173, 0.4); }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: -30px auto 64px; position: relative; }
.card { background: var(--paper); border: 1px solid rgba(11, 59, 96, 0.08); border-radius: 20px; box-shadow: var(--shadow); }
.details-card { padding: 28px; }
.travel-card { margin-top: 22px; overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.travel-heading { padding: 28px 28px 0; }
.section-heading h2 { margin: 0; color: var(--navy-strong); font-size: 1.45rem; }
.section-kicker { color: var(--teal); }
.save-indicator { color: var(--muted); font-size: 0.88rem; }
.save-indicator--dirty { color: var(--warning); }
.save-indicator--saved { color: #067647; }

.form-grid { display: grid; grid-template-columns: 0.8fr 1.4fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; font-weight: 700; color: var(--navy-strong); }
.field input, .field select, .place-select, .place-search-input {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid #cbd5dc;
  border-radius: 10px;
  outline: none;
  font-weight: 400;
}
.field input:focus, .field select:focus, .place-select:focus, .place-search-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11, 139, 135, 0.14); }

.button { min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button--primary { color: #fff; background: var(--teal); box-shadow: 0 7px 18px rgba(11, 139, 135, 0.2); }
.button--primary:hover:not(:disabled) { background: #077773; }
.button--secondary { color: var(--navy); background: #fff; border-color: #aab9c4; }
.button--dark { color: #fff; background: var(--navy); }
.button--danger { color: #8f2720; background: #fff6f5; border-color: #e8aaa5; }
.button--danger:hover:not(:disabled) { color: #fff; background: var(--danger); border-color: var(--danger); }
.button--small { min-height: 34px; padding: 6px 10px; font-size: 0.84rem; }
.icon-button { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.icon-button:hover:not(:disabled) { color: var(--navy); border-color: #9aabb7; }
.icon-button--danger:hover:not(:disabled) { color: var(--danger); border-color: #f0b6b1; background: #fff6f5; }

.trip-list { padding: 4px 28px 28px; display: grid; gap: 16px; }
.travel-card__bottom-actions { padding: 0 28px 24px; display: flex; justify-content: center; }
.travel-card__bottom-actions .button { min-width: min(100%, 260px); }
.empty-state { padding: 56px 24px; text-align: center; border: 1px dashed #bac8d1; border-radius: 15px; background: #fbfcfd; }
.empty-state__icon { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 50%; font-size: 1.8rem; }
.empty-state h3 { margin: 0; color: var(--navy-strong); }
.empty-state p { margin: 8px 0 0; color: var(--muted); }

.trip { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.trip__header { min-height: 58px; padding: 11px 16px; display: grid; grid-template-columns: minmax(170px, 0.7fr) 1fr auto; align-items: center; gap: 16px; background: linear-gradient(90deg, #f4f9fa, #fbfcfd); border-bottom: 1px solid var(--line); }
.trip__date { display: flex; align-items: center; gap: 10px; }
.trip__date label { color: var(--navy-strong); font-weight: 700; }
.trip__date input { min-height: 38px; padding: 7px 9px; border: 1px solid #bdcad2; border-radius: 9px; background: #fff; }
.trip__distance { justify-self: end; color: var(--muted); }
.trip__distance strong { color: var(--navy); font-size: 1.2rem; }
.trip__distance--pending strong { color: var(--warning); font-size: 0.95rem; }
.trip__body { padding: 18px; }
.route-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 22px; }
.route-column { min-width: 0; }
.route-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--navy-strong); font-weight: 700; }
.route-index { width: 25px; height: 25px; display: inline-grid; place-items: center; flex: 0 0 auto; color: #fff; background: var(--teal); border-radius: 50%; font-size: 0.78rem; }
.destinations { display: grid; gap: 10px; }
.destination-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.destination-actions { display: flex; gap: 5px; }
.place-slot { min-width: 0; }
.place-selected { min-height: 48px; padding: 8px 11px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; background: #f8fbfb; border: 1px solid #b7d8d4; border-radius: 10px; }
.place-selected strong, .place-selected small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.place-selected strong { color: var(--navy-strong); }
.place-selected small { margin-top: 3px; color: var(--muted); }
.place-change { color: var(--teal); background: transparent; border: 0; font-size: 0.82rem; font-weight: 700; }
.place-placeholder { min-height: 48px; display: grid; align-items: center; }
.place-autocomplete { width: 100%; }
.place-search-input { appearance: none; }
.place-results { margin-top: 5px; overflow: hidden; background: #fff; border: 1px solid #b9c7d0; border-radius: 10px; box-shadow: 0 12px 26px rgba(11, 59, 96, 0.12); }
.place-result { width: 100%; padding: 9px 12px; display: block; color: var(--ink); background: #fff; border: 0; border-bottom: 1px solid #edf1f3; text-align: right; }
.place-result:last-child { border-bottom: 0; }
.place-result:hover, .place-result[aria-selected="true"] { background: var(--teal-soft); }
.place-result strong, .place-result small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.place-result strong { color: var(--navy-strong); }
.place-result small { margin-top: 3px; color: var(--muted); }
.place-search-status { padding: 11px 12px; color: var(--muted); font-size: 0.84rem; }
.route-footer { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.return-check { display: inline-flex; align-items: center; gap: 9px; color: var(--navy-strong); font-weight: 700; }
.return-check input { width: 18px; height: 18px; accent-color: var(--teal); }
.route-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.auto-calculate-note { align-self: center; color: var(--muted); font-size: 0.82rem; }
.attribution { margin: 13px 0 0; color: var(--muted); font-size: 0.76rem; }
.attribution a { color: var(--teal); }

.month-summary { min-height: 88px; padding: 18px 28px; display: flex; justify-content: space-between; align-items: center; color: #fff; background: var(--navy); }
.month-summary span, .month-summary small { display: block; }
.month-summary small { margin-top: 5px; color: #bcd0de; }
.month-summary strong { font-size: clamp(1.55rem, 3vw, 2.15rem); }
.month-summary strong span { display: inline; }

.action-bar { margin-top: 20px; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: rgba(255, 255, 255, 0.74); border: 1px solid rgba(11, 59, 96, 0.1); border-radius: 16px; backdrop-filter: blur(10px); }
.action-bar p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.action-bar__buttons { display: flex; gap: 10px; }
.alert { margin: 0 0 18px; padding: 14px 18px; display: flex; gap: 12px; border-radius: 12px; }
.alert--warning { color: #684b00; background: #fff3cc; border: 1px solid #f4d776; }
.toast { position: fixed; z-index: 20; inset-inline-start: 24px; bottom: 24px; max-width: min(420px, calc(100% - 48px)); padding: 13px 18px; color: #fff; background: #263746; border-radius: 11px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); }
.toast--error { background: var(--danger); }

@media (max-width: 820px) {
  .hero__inner { min-height: 174px; grid-template-columns: auto 1fr; }
  .maps-badge { grid-column: 1 / -1; margin: -12px 0 22px; justify-self: start; }
  .form-grid, .route-grid { grid-template-columns: 1fr; }
  .trip__header { grid-template-columns: 1fr auto; }
  .trip__distance { grid-row: 2; justify-self: start; }
  .trip__header > .icon-button { grid-column: 2; grid-row: 1; }
}

@media (max-width: 580px) {
  .hero__inner, .page-shell { width: min(100% - 20px, 1180px); }
  .brand-mark { width: 58px; height: 58px; border-radius: 18px; }
  .brand-mark svg { width: 42px; height: 42px; }
  .hero h1 { font-size: 1.8rem; }
  .hero__subtitle { font-size: 0.92rem; }
  .details-card, .travel-heading { padding: 21px; }
  .trip-list { padding: 4px 12px 18px; }
  .travel-card__bottom-actions { padding: 0 12px 18px; }
  .travel-card__bottom-actions .button { width: 100%; }
  .section-heading, .travel-heading, .action-bar { align-items: stretch; flex-direction: column; }
  .travel-heading .button { width: 100%; }
  .trip__header { grid-template-columns: 1fr auto; padding: 11px; }
  .trip__date { align-items: stretch; flex-direction: column; gap: 4px; }
  .trip__body { padding: 13px; }
  .destination-row { grid-template-columns: 1fr; }
  .destination-actions { justify-content: flex-start; }
  .route-footer { align-items: stretch; flex-direction: column; }
  .route-buttons, .action-bar__buttons { display: grid; grid-template-columns: 1fr; }
  .month-summary { padding: 16px 18px; }
}
