:root {
  --navy: #16324f;
  --navy-2: #1e4468;
  --teal: #1a7a74;
  --teal-d: #14645f;
  --coral: #e06c4f;
  --coral-d: #c4573d;
  --gold: #c9a227;
  --cream: #f6f3ec;
  --cream-2: #efe9dc;
  --paper: #fffcf7;
  --ink: #1b2430;
  --muted: #5b6572;
  --line: #e4ddd0;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --ok: #2f7d4a;
  --ok-bg: #e8f6ed;
  --shadow: 0 8px 28px rgba(22, 50, 79, 0.10);
  --shadow-sm: 0 2px 10px rgba(22, 50, 79, 0.07);
  --radius: 16px;
  --nav-h: 64px;
  --header-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Heebo", "Assistant", "Segoe UI", "Noto Sans Hebrew", "Arial Hebrew", Tahoma, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--safe-t) + 8px);
}
html, body, #app, .app-shell, .page, .timeline, .week-table-wrap {
  /* Explicitly allow pinch-zoom; overflow scrollers can otherwise steal the gesture. */
  touch-action: pan-x pan-y pinch-zoom;
}
body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  direction: rtl;
  line-height: 1.5;
  min-height: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--teal-d); }
img { max-width: 100%; display: block; }

#app { min-height: 100%; }

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(26, 122, 116, 0.22), transparent 55%),
    radial-gradient(800px 500px at 0% 100%, rgba(224, 108, 79, 0.16), transparent 50%),
    var(--cream);
}
.login-card {
  width: min(420px, 100%);
  background: var(--paper);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 36px 28px 28px;
  text-align: center;
}
.brand-mark {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.login-card h1 { font-size: 28px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.login-card .sub { color: var(--muted); margin: 6px 0 22px; }
.login-card form { text-align: right; }
.login-card label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.login-card input[type="password"],
.login-card input[type="email"],
.login-card input[type="tel"],
.login-card input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 14px;
}
.login-error { color: var(--danger); font-size: 14px; margin-bottom: 10px; min-height: 1.2em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: transform .08s ease, background .15s ease, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #fff; width: 100%; padding: 12px 16px; }
.btn-primary:hover { background: var(--teal-d); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--cream-2); }
.btn-outline { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-maps {
  background: #e8f4f3;
  color: var(--teal-d);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-maps:hover { background: #d5eeec; }
.btn-waze {
  background: #e6f7fc;
  color: #0a6e8a;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-waze:hover { background: #cceef8; }
.place-link {
  color: var(--teal-d);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.place-link:hover { color: var(--teal); }
.maps-live-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-d);
  text-decoration: none;
}
.maps-live-link[hidden] { display: none !important; }
.maps-live-link:hover { text-decoration: underline; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--navy);
}
.icon-btn:hover { background: var(--cream-2); }

/* ---------- Banners ---------- */
.banner {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.banner-warn { background: #f8ecd0; color: #6b4e12; }
.banner-off { background: #16324f; color: #fff; }
.banner-off a, .banner a { color: inherit; text-decoration: underline; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy);
  color: #fff;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  min-height: calc(var(--header-h) + var(--safe-t));
  display: flex; align-items: center; gap: 8px;
}
.topbar h1, .topbar .title {
  flex: 1; font-size: 18px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.topbar .brand img {
  width: 36px; height: 36px; border-radius: 10px;
}
.topbar .brand span { font-size: 20px; font-weight: 800; }
.topbar .icon-btn { color: #fff; }
.topbar .icon-btn:hover { background: rgba(255,255,255,.12); }
.topbar .meta {
  display: none;
  font-size: 13px;
  opacity: .85;
  font-weight: 500;
}

.page {
  flex: 1;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 20px);
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Trip list ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.page-head h2 { font-size: 22px; color: var(--navy); font-weight: 800; }
.page-head-timeline {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.page-head-timeline .tl-title {
  margin: 0 auto;
  display: inline-block;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: var(--navy);
  background: linear-gradient(180deg, #fffdf8 0%, #f4ebdd 100%);
  border: 1.5px solid #d7c4a8;
  border-radius: 999px;
  padding: 10px 36px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 2px 8px rgba(15, 39, 68, .07);
}
.page-head-timeline .tl-head-actions {
  justify-content: center;
  width: 100%;
}
@media (max-width: 799px) {
  .tl-pdf-export { display: none !important; }
  .page-head-timeline .tl-title {
    font-size: 24px;
    padding: 8px 26px;
  }
}

.trip-grid { display: grid; gap: 14px; }
.trip-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
  text-align: right;
  border: 2.5px solid var(--trip-color, var(--teal));
  border-right-width: 6px;
  width: 100%;
  transition: box-shadow .15s, border-color .15s, transform .12s;
}
.trip-card:hover { box-shadow: var(--shadow); border-color: var(--trip-color, var(--teal)); transform: translateY(-2px); }
.trip-card .dest { color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.trip-card h3 { font-size: 20px; color: var(--navy); margin: 2px 0 6px; font-weight: 800; }
.trip-card .dates { color: var(--muted); font-size: 14px; }
.badge {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: #f8ecd0; color: #6b4e12;
  margin-top: 8px;
}
.empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty h3 { color: var(--navy); margin-bottom: 6px; }

/* ---------- Tabs (desktop) + bottom nav (mobile) ---------- */
.tabs-desktop { display: none; }
.bottom-nav {
  position: fixed; bottom: 0; right: 0; left: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 4px 4px var(--safe-b);
  height: calc(var(--nav-h) + var(--safe-b));
  z-index: 25;
}
.nav-item, .tab-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  padding: 6px 0;
  min-width: 0;
}
.nav-item svg, .tab-btn svg { width: 22px; height: 22px; }
.bottom-nav .nav-item { font-size: 10px; padding: 4px 0; gap: 1px; }
.bottom-nav .nav-item svg { width: 18px; height: 18px; }
.bottom-nav .nav-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 399px) {
  .bottom-nav .nav-item { font-size: 9px; }
}
.nav-item.active, .tab-btn.active { color: var(--teal-d); }
.nav-item.active { background: #e8f4f3; }

/* ---------- Cards / lists ---------- */
.section {
  margin-bottom: 28px;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.section-head h2 { font-size: 18px; color: var(--navy); font-weight: 800; }
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(228, 221, 208, .7);
}
.card h3 { font-size: 17px; color: var(--navy); font-weight: 800; }
.card .row { color: var(--muted); font-size: 14px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card .row b { color: var(--ink); font-weight: 600; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 14px; margin-top: 8px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; }

.card.hotel-card-overlap,
.tl-card.tl-card-overlap {
  border: 2px dashed #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, .08);
}
.hotel-overlap-note {
  margin: 8px 0 6px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  background: #fef2f2;
  border-radius: 8px;
  padding: 8px 10px;
}
.hotel-overlap-note bdi { unicode-bidi: isolate; }

.hotel-overlap-lead,
.hotel-overlap-sub {
  display: block;
}
.hotel-overlap-name {
  display: block;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
  font-weight: 700;
  margin-top: 2px;
}


.week-ev.week-ev-overlap {
  border: 1.5px dashed #dc2626;
  background: #fef2f2;
  border-radius: 10px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .hotel-overlap-note { font-size: 12px; padding: 6px 8px; margin: 6px 0 4px; }
}

.hotel-card-body {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
}
.hotel-card-details { flex: 1; min-width: 0; }
.hotel-card-photo {
  flex: 0 0 200px;
  width: 200px;
  align-self: stretch;
}
.hotel-card-photo img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  background: #eee8dc;
  display: block;
}
.itin-cat-card { cursor: pointer; }

/* ---------- Timeline ---------- */
.day-block { margin-bottom: 28px; }
.day-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--navy);
}
.day-head h2 { font-size: 17px; color: var(--navy); font-weight: 800; margin: 0; }
.day-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.day-weather {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: #eef3f7;
  border: 1px solid #d5dee7;
  line-height: 1.1;
}
.day-weather-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.day-weather-icon svg { width: 30px; height: 30px; display: block; }
.day-weather-meta { display: flex; flex-direction: column; gap: 1px; }
.day-weather-temps {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  font-size: 13px;
  letter-spacing: -0.02em;
}
.day-weather-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
}
.day-weather.wx-sunny { background: #fff6d8; border-color: #f3d37a; }
.day-weather.wx-partly_cloudy { background: #eef6ff; border-color: #c5d8ef; }
.day-weather.wx-cloudy { background: #eef1f5; border-color: #cfd6de; }
.day-weather.wx-rainy { background: #e6f3fb; border-color: #aad0ea; }
.day-weather.wx-snowy { background: #eef8ff; border-color: #b8dff7; }
.day-weather.wx-stormy { background: #ece7f7; border-color: #c5b8e0; }
.day-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.timeline { position: relative; padding-right: 0; }
.tl-item {
  display: grid;
  grid-template-columns: 58px 18px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
  position: relative;
}
.tl-time {
  text-align: left;
  font-weight: 800;
  font-size: 13px;
  color: var(--navy);
  padding-top: 14px;
  font-variant-numeric: tabular-nums;
}
.tl-time small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.tl-rail { position: relative; height: 100%; }
.tl-rail::before {
  content: "";
  position: absolute;
  top: 0; bottom: -10px;
  right: 7px;
  width: 2px;
  background: var(--line);
}
.tl-item:last-child .tl-rail::before { bottom: auto; height: 22px; }
.tl-dot {
  position: absolute;
  top: 16px; right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--teal);
  z-index: 1;
}
.tl-dot.flight { background: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.tl-dot.hotel { background: var(--coral); box-shadow: 0 0 0 2px var(--coral); }
.tl-dot.car { background: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.tl-dot.transit { background: #3b6ea5; box-shadow: 0 0 0 2px #3b6ea5; }
.tl-card {
  background: var(--paper);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(228, 221, 208, .7);
}
.tl-card .kind {
  font-size: 11px; font-weight: 700; color: var(--teal);
  letter-spacing: .02em;
  margin-bottom: 2px;
}
.tl-card h3 { font-size: 15px; font-weight: 800; color: var(--navy); }
.tl-card .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tl-card .maps-row { margin-top: 8px; }

/* ---------- Attachments ---------- */
.atts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.att {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream);
  border-radius: 12px;
  padding: 8px;
}
.att-thumb {
  width: 48px; height: 48px; border-radius: 8px;
  object-fit: cover; background: #ddd; flex-shrink: 0;
}
.att-icon {
  width: 48px; height: 48px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.att .name { flex: 1; font-size: 13px; font-weight: 600; word-break: break-word; }
.att-actions { display: flex; gap: 4px; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(22, 50, 79, .45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal {
  background: var(--paper);
  width: min(560px, 100%);
  max-height: min(92vh, 900px);
  border-radius: 20px 20px 0 0;
  overflow: auto;
  padding: 18px 18px calc(18px + var(--safe-b));
  box-shadow: var(--shadow);
}
.modal h2 { font-size: 20px; color: var(--navy); margin-bottom: 14px; font-weight: 800; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.field textarea { min-height: 80px; resize: vertical; }
.modal-actions {
  display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.modal-actions .btn { flex: 1; min-width: 110px; }
.modal-actions .btn-danger { flex: 0 0 auto; }

.file-input {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  background: var(--cream);
  font-size: 13px;
  color: var(--muted);
}
.file-input input { display: block; margin: 8px auto 0; }

/* ---------- Settings / more ---------- */
.settings-card .hint { font-size: 14px; color: var(--muted); margin-top: 6px; }

.settings-sec { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.settings-sec:last-of-type { border-bottom: 0; margin-bottom: 8px; }
.settings-sec h3 { margin: 0 0 6px; font-size: 15px; color: var(--navy); font-weight: 800; }
.settings-sec .hint { margin: 0 0 10px; }
.settings-danger h3 { color: #b42318; }

.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: #f8ecd0; color: #6b4e12; }

/* ---------- Desktop ---------- */
@media (min-width: 800px) {
  .bottom-nav { display: none; }
  html { scroll-padding-top: calc(var(--header-h) + var(--safe-t) + 56px); }
  .day-block { scroll-margin-top: calc(var(--header-h) + var(--safe-t) + 56px); }
  .tabs-desktop {
    display: flex;
    gap: 2px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0 12px;
    position: sticky;
    top: calc(var(--header-h) + var(--safe-t));
    z-index: 15;
    max-width: 980px;
    margin: 0 auto;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }
  .tab-btn {
    flex: 1 0 auto;
    flex-direction: row;
    gap: 6px;
    padding: 12px 10px;
    font-size: 13px;
    border-radius: 0;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
  }
  .tab-btn svg { width: 20px; height: 20px; }
  .tab-btn.active {
    border-bottom-color: var(--teal);
    background: transparent;
    color: var(--navy);
  }
  .page { padding-bottom: 40px; }
  .topbar .meta { display: block; }
  .trip-grid { grid-template-columns: 1fr 1fr; }
  .modal-back { align-items: center; padding: 24px; }
  .modal { border-radius: 20px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 799px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .tl-item { grid-template-columns: 50px 16px 1fr; gap: 8px; }
  .tl-time { font-size: 12px; }
  .bottom-nav {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 1 0 auto;
    min-width: 3.2rem;
    padding: 4px 3px;
    font-size: 9.5px;
    gap: 1px;
    border-radius: 10px;
  }
  .nav-item svg { width: 18px; height: 18px; }
  .hotel-card-photo { flex: 0 0 120px; width: 120px; }
  .hotel-card-photo img { min-height: 100px; max-height: 160px; }
}
@media (max-width: 520px) {
  .hotel-card-body { flex-direction: column-reverse; gap: 12px; }
  .hotel-card-photo { flex: 0 0 auto; width: 100%; }
  .hotel-card-photo img { height: 160px; max-height: 180px; min-height: 140px; }
}

/* Keep long Hebrew words from overflowing cards */
h1, h2, h3, p, .sub, .dest, .name, .title { overflow-wrap: anywhere; }


/* ---------- Auth tabs / user chip / sharing ---------- */
.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--cream);
  border-radius: 12px;
  padding: 4px;
  margin: 0 0 18px;
}
.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 700;
  color: var(--muted);
}
.auth-tab.active {
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.auth-form { text-align: right; }
.login-card .auth-form label { margin-top: 4px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 50%;
}
.user-chip .user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .92;
}
.user-chip .btn { color: #fff; border: 1px solid rgba(255,255,255,.25); padding: 5px 10px; }
.user-chip .btn:hover { background: rgba(255,255,255,.12); }
.user-chip { position: relative; }
.user-name-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  max-width: 100%;
}
.user-name-btn:hover, .user-chip.open .user-name-btn {
  background: rgba(255,255,255,.18);
}
.user-caret { font-size: 11px; opacity: .85; }
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: min(320px, calc(100vw - 24px));
  background: #fff;
  color: var(--navy);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 14px 8px;
  z-index: 40;
  text-align: right;
}
.account-menu-head {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 8px;
}
.account-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.account-row span { color: var(--muted); flex-shrink: 0; }
.account-row strong { font-weight: 650; overflow-wrap: anywhere; text-align: left; }
.account-menu-item {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  text-align: right;
  padding: 10px 4px;
  margin-top: 4px;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  border-radius: 10px;
}
.account-menu-item:hover { background: var(--cream); }
.account-menu-item.danger { color: var(--danger); }
.admin-users-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
table.admin-users {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.admin-users th, table.admin-users td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.admin-users th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  background: var(--cream);
}
table.admin-users tr:last-child td { border-bottom: 0; }

.topbar .title-block { flex: 1; min-width: 0; }
.topbar .title-block .title {
  flex: none;
  display: block;
}
.topbar .title-sub { margin-top: 2px; }
.topbar .title-sub .badge { margin-top: 0; background: rgba(255,255,255,.16); color: #fff; }

.badge-share { background: #e8f4f3; color: var(--teal-d); }
.banner-readonly { background: #e8f4f3; color: var(--teal-d); }

.share-add {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}
.share-add .btn { height: 42px; }
.share-list-title { font-size: 15px; color: var(--navy); margin: 16px 0 8px; font-weight: 800; }
.share-row {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
  align-items: center;
  background: var(--cream);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.share-who b { display: block; color: var(--navy); }
.share-who .hint, .hint { font-size: 13px; color: var(--muted); }

@media (max-width: 799px) {
  .share-add, .share-row { grid-template-columns: 1fr; }
  .user-chip .user-name { max-width: 28vw; }
}

@media (min-width: 768px) {
  .brand-mark { width: 94px; height: 94px; border-radius: 24px; }
  .topbar .brand img { width: 47px; height: 47px; border-radius: 12px; }
}

.trip-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.trip-card-body { flex: 1; min-width: 0; }
.trip-flag {
  width: 48px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(15, 41, 66, 0.22);
  border: 1px solid rgba(15, 41, 66, 0.08);
  flex-shrink: 0;
}


/* ---------- Itinerary travel / flight ---------- */
.form-grid .field[hidden] { display: none !important; }
.subcat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  background: #e8f4f3;
  color: var(--teal-d);
  vertical-align: middle;
}
.subcat-badge.subcat-flight { background: #e8eef6; color: var(--navy); }
.subcat-badge.subcat-car { background: #f8ecd0; color: #6b4e12; }
.subcat-badge.subcat-train { background: #e4eef8; color: #3b6ea5; }
.subcat-badge.subcat-ferry { background: #cffafe; color: #0e7490; }
.subcat-badge.subcat-taxi { background: #fef9c3; color: #854d0e; }
.subcat-badge.subcat-bus { background: #fef3c7; color: #92400e; }
.tl-card .kind { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.doc-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.btn-doc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-doc:hover { background: #d5eeec; }
.att-label { font-size: 11px; font-weight: 700; color: var(--teal-d); }
.itin-existing-docs { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.tl-card .maps-row, .card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }


/* ---------- Itinerary category picker ---------- */
#itin-step-1[hidden], #itin-step-2[hidden] { display: none !important; }
.itin-cat-step .hint {
  font-size: 14px;
  color: var(--muted);
  margin: -4px 0 14px;
}
.cat-picker {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
}
.cat-pick {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: right;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--cream);
  color: var(--navy);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s, background .15s, transform .12s;
}
.cat-pick:hover, .cat-pick:focus {
  border-color: var(--teal);
  background: #e8f4f3;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  outline: none;
}
.cat-pick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--teal-d);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 41, 66, 0.08);
}
.cat-pick-icon svg { width: 24px; height: 24px; }
.btn-back-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  color: var(--teal-d);
  font-size: 13px;
  font-weight: 700;
  padding: 0 0 10px;
  cursor: pointer;
}
.btn-back-cat:hover { text-decoration: underline; }

.route-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  direction: rtl;
}
.route-arrow {
  color: var(--muted);
  font-weight: 700;
  direction: rtl;
  unicode-bidi: isolate;
}

/* ---------- Timeline activity type icon (left side in RTL) ---------- */
.tl-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.tl-card-main {
  flex: 1;
  min-width: 0;
}
.tl-type-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  border: 0;
}
.tl-type-icon svg {
  width: 40px;
  height: 40px;
}
.tl-type-icon.tl-big-flight     { background: linear-gradient(160deg, #e0f2fe, #bae6fd); }
.tl-type-icon.tl-big-car        { background: linear-gradient(160deg, #eff6ff, #dbeafe); }
.tl-type-icon.tl-big-taxi       { background: linear-gradient(160deg, #fefce8, #fef08a); }
.tl-type-icon.tl-big-train      { background: linear-gradient(160deg, #fef2f2, #fee2e2); }
.tl-type-icon.tl-big-ferry      { background: linear-gradient(160deg, #f0fdfa, #ccfbf1); }
.tl-type-icon.tl-big-bus        { background: linear-gradient(160deg, #fffbeb, #fef3c7); }
.tl-type-icon.tl-big-hotel      { background: linear-gradient(160deg, #f5f3ff, #ede9fe); }
.tl-type-icon.tl-big-restaurant { background: linear-gradient(160deg, #fff1f2, #ffe4e6); }
.tl-type-icon.tl-big-concert    { background: linear-gradient(160deg, #fdf4ff, #fae8ff); }
.tl-type-icon.tl-big-play       { background: linear-gradient(160deg, #eef2ff, #e0e7ff); }
.tl-type-icon.tl-big-museum     { background: linear-gradient(160deg, #ecfdf5, #d1fae5); }
.tl-type-icon.tl-big-tour       { background: linear-gradient(160deg, #f7fee7, #ecfccb); }
.tl-type-icon.tl-big-walk       { background: linear-gradient(160deg, #ecfdf5, #d1fae5); }
.tl-type-icon.tl-big-activity,
.tl-type-icon.tl-big-attraction { background: linear-gradient(160deg, #fff7ed, #ffedd5); }
.tl-type-icon.tl-big-other      { background: linear-gradient(160deg, #f8fafc, #e2e8f0); }

.week-ev.tl-chip-flight     { background: #e0f2fe; border-color: #bae6fd; }
.week-ev.tl-chip-car        { background: #dbeafe; border-color: #bfdbfe; }
.week-ev.tl-chip-taxi       { background: #fef9c3; border-color: #fde047; }
.week-ev.tl-chip-train      { background: #fee2e2; border-color: #fecaca; }
.week-ev.tl-chip-ferry      { background: #ccfbf1; border-color: #99f6e4; }
.week-ev.tl-chip-bus        { background: #fef3c7; border-color: #fde68a; }
.week-ev.tl-chip-hotel      { background: #ede9fe; border-color: #ddd6fe; }
.week-ev.tl-chip-restaurant { background: #ffe4e6; border-color: #fecdd3; }
.week-ev.tl-chip-concert    { background: #fae8ff; border-color: #f5d0fe; }
.week-ev.tl-chip-play       { background: #e0e7ff; border-color: #c7d2fe; }
.week-ev.tl-chip-museum     { background: #d1fae5; border-color: #a7f3d0; }
.week-ev.tl-chip-tour       { background: #ecfccb; border-color: #d9f99d; }
.week-ev.tl-chip-walk       { background: #d1fae5; border-color: #a7f3d0; }
.week-ev.tl-chip-activity,
.week-ev.tl-chip-attraction { background: #ffedd5; border-color: #fed7aa; }
.week-ev.tl-chip-other      { background: #f1f5f9; border-color: #e2e8f0; }

@media (max-width: 799px) {
  .tl-type-icon { width: 44px; height: 44px; border-radius: 12px; }
  .tl-type-icon svg { width: 34px; height: 34px; }
}

/* Timeline view toggle & weekly summary table */
.tl-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.view-toggle {
  display: inline-flex;
  background: #e9eef4;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.view-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.view-toggle-btn:hover {
  color: var(--navy);
}
.view-toggle-btn.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(15, 39, 68, .12);
}

.week-table-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.week-table-sizer {
  position: relative;
}
.week-table-scale {
  transform-origin: top right;
  will-change: transform;
}
.week-land-hint {
  margin: 8px 10px 4px;
  padding: 8px 12px;
  border: 1px dashed var(--danger);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
}
.week-table {
  border-collapse: collapse;
  table-layout: fixed;
  direction: rtl;
  width: 100%;
  min-width: 720px;
}
.week-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2px 4px;
}
.week-zoom-btn {
  min-width: 36px;
  min-height: 32px;
  padding: 4px 8px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.week-zoom-label {
  min-width: 3.2em;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-family: inherit;
  padding: 4px 2px;
  border-radius: 8px;
}
.week-zoom-label:hover { background: var(--cream-2); }
.week-table thead th {
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 8px;
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, .14);
}
.week-table thead th:last-child {
  border-left: 0;
}
.week-cell {
  vertical-align: top;
  padding: 7px 6px 8px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: #fff;
  min-height: 92px;
  height: 104px;
}
.week-table tbody tr td:last-child {
  border-left: 0;
}
.week-cell-out {
  background: #f8fafc;
}
.week-cell-out .week-day-num {
  color: #94a3b8;
}
.week-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.week-day-num {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  padding: 2px 5px;
  border-radius: 6px;
  cursor: pointer;
}
.week-day-num:hover {
  background: #e9eef4;
}
.week-day-add {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  opacity: .55;
}
.week-day-add:hover {
  opacity: 1;
  background: #e9eef4;
  color: var(--navy);
}
.week-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.week-ev {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-size: 11.5px;
  line-height: 1.25;
  cursor: pointer;
  transition: filter .12s, transform .12s;
}
.week-ev:hover {
  filter: brightness(.96);
}
.week-ev-ico {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,.45);
}
.week-ev-ico svg {
  width: 18px;
  height: 18px;
}
.week-ev-txt {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.week-ev-time {
  font-weight: 800;
  margin-left: 4px;
  opacity: .88;
  font-variant-numeric: tabular-nums;
}
.week-ev-title {
  font-weight: 600;
}

/* Desktop: weekly table 30% larger (v30) */
@media (min-width: 1024px) and (hover: hover) {
  .week-table-wrap {
    --week-w: min(1274px, calc(100vw - 32px));
    width: var(--week-w);
    max-width: none;
    margin-inline: calc((100% - var(--week-w)) / 2);
    position: relative;
  }
  .week-table { min-width: 936px; }
  .week-table thead th { font-size: 17px; padding: 13px 10px; }
  .week-cell { padding: 9px 8px 10px; min-height: 120px; height: 135px; }
  .week-day-num { font-size: 15.5px; padding: 3px 7px; }
  .week-day-add { font-size: 19.5px; width: 29px; height: 29px; }
  .week-items { gap: 5px; }
  .week-ev { font-size: 15px; padding: 5px 8px; gap: 6px; border-radius: 9px; }
  .week-ev-ico { flex-basis: 24px; width: 24px; height: 24px; border-radius: 7px; }
  .week-ev-ico svg { width: 20px; height: 20px; }
}

/* Checkbox fields (v33) */
.field-check .check-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-weight: 600; color: var(--navy);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.field-check .check-row input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); flex: 0 0 auto; }

/* Transport card corner icon (v35) — left side in RTL */
.card.tr-card { position: relative; padding-left: 70px; }
.card.tr-card .tr-corner-icon { position: absolute; left: 14px; top: 14px; }
@media (max-width: 480px) {
  .card.tr-card { padding-left: 60px; }
  .card.tr-card .tr-corner-icon { width: 38px; height: 38px; left: 10px; top: 12px; }
}

/* Transport corner icon x4, vertically centered (v36) */
.card.tr-card { padding-left: 200px; min-height: 196px; }
.card.tr-card .tr-corner-icon {
  left: 12px; top: 50%; transform: translateY(-50%);
  width: 176px; height: 176px; border-radius: 28px;
}
.card.tr-card .tr-corner-icon svg { width: 96px; height: 96px; }
@media (max-width: 600px) {
  .card.tr-card { padding-left: 128px; min-height: 128px; }
  .card.tr-card .tr-corner-icon { width: 108px; height: 108px; left: 10px; top: 50%; border-radius: 20px; }
  .card.tr-card .tr-corner-icon svg { width: 60px; height: 60px; }
}

/* Transport icons — filled colorful style (v37) */
.card.tr-card .tr-corner-icon {
  position: absolute; display: grid; place-items: center;
  background: linear-gradient(160deg, #f8fafc, #e2e8f0);
  border: 1px solid #e2e8f0; box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(15, 39, 68, .08);
}
.card.tr-card .tr-corner-icon svg { width: 120px; height: 120px; }
.card.tr-card .tr-big-car   { background: linear-gradient(160deg, #eff6ff, #dbeafe); }
.card.tr-card .tr-big-taxi  { background: linear-gradient(160deg, #fefce8, #fef08a); }
.card.tr-card .tr-big-train { background: linear-gradient(160deg, #fef2f2, #fee2e2); }
.card.tr-card .tr-big-bus   { background: linear-gradient(160deg, #fffbeb, #fef3c7); }
.card.tr-card .tr-big-ferry { background: linear-gradient(160deg, #f0fdfa, #ccfbf1); }
.card.tr-card .tr-big-hike  { background: linear-gradient(160deg, #ecfdf5, #d1fae5); }
.card.tr-card .tr-big-tour  { background: linear-gradient(160deg, #fff7ed, #ffedd5); }
.card.tr-card .tr-big-museum { background: linear-gradient(160deg, #f0fdfa, #ccfbf1); }
@media (max-width: 600px) {
  .card.tr-card .tr-corner-icon svg { width: 76px; height: 76px; }
}

.hike-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.hike-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  line-height: 1.3;
}
.hike-chip.hike-easy { background: #dcfce7; color: #166534; }
.hike-chip.hike-mid { background: #fef3c7; color: #92400e; }
.hike-chip.hike-hard { background: #fee2e2; color: #991b1b; }
.hike-chip.hike-loop { background: #cffafe; color: #0e7490; }
.sub .hike-chips { display: inline-flex; margin: 0 6px; vertical-align: middle; }

.title-dest {
  font-size: 12px;
  font-weight: 650;
  opacity: .88;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.trip-flags {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}
.countries-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.countries-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.country-row {
  background: var(--cream);
  border: 1px solid #e7ded0;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.country-row-head {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.country-row-head .field.grow,
.country-row-head .field { flex: 1; min-width: 0; }
.btn-row-remove {
  border: 0;
  background: transparent;
  color: #b42318;
  font-weight: 700;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 6px;
  white-space: nowrap;
}
.btn-row-remove:hover { text-decoration: underline; }
.country-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.country-dates[hidden] { display: none; }

.share-via {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}
.share-via-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}
.share-add-form { display: flex; flex-direction: column; gap: 10px; }
.share-add-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.share-add-actions .btn { height: 42px; }
.share-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
}
.share-mail-fallback {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  color: var(--navy);
}
.share-mail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.share-pending { opacity: .92; }
.invite-banner {
  background: #e8f4f3;
  color: var(--teal-d);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}
.invite-banner-error { background: #fef2f2; color: #b42318; }

@media (max-width: 799px) {
  .share-add-actions { grid-template-columns: 1fr; }
}

.drive-nav-links { margin-top: 2px; }
.drive-nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Confirm dialog — stacked above an open form, centered for mobile */
.confirm-back {
  z-index: 60;
  align-items: center;
  padding: 24px;
}
.confirm-modal {
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  max-height: none;
  overflow: visible;
  padding: 22px 18px calc(18px + var(--safe-b));
}
.confirm-msg {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin: 0 0 18px;
  line-height: 1.45;
}
.confirm-modal .modal-actions { margin-top: 0; }

/* Home header: Travel [globe] Plans centered on mobile and desktop */
.topbar-home {
  position: relative;
  justify-content: space-between;
  min-height: calc(72px + var(--safe-t));
}
.topbar-home .brand {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex: none;
  pointer-events: none;
  direction: ltr;
}
.topbar-home .brand img {
  width: 52px;
  height: 52px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  flex-shrink: 0;
}
.topbar-home .brand span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
}
.topbar-home-start,
.topbar-home-end {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.topbar-home-end { margin-inline-start: auto; }
.topbar-home .user-chip {
  max-width: none;
}
.topbar-home .user-chip .user-name {
  max-width: none;
  overflow: visible;
  text-overflow: unset;
}

@media (max-width: 799px) {
  .topbar-home {
    min-height: calc(82px + var(--safe-t));
  }
  .topbar-home .brand { gap: 6px; }
  .topbar-home .brand img {
    width: 62px;
    height: 62px;
  }
  .topbar-home .brand span { font-size: 24px; }
  .topbar-home .icon-btn {
    width: 36px;
    height: 36px;
  }
  .topbar-home .user-chip .user-name {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
  }
}

.app-invite-link {
  font-size: 13px;
  word-break: break-all;
  background: var(--cream-2, #f6f3ec);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 8px 0 14px;
  color: var(--navy);
  font-weight: 600;
}
.app-invite-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.users-hint {
  margin: -4px 0 14px;
  max-width: 52rem;
}

/* Trip card trash + archive actions */
.trip-card {
  position: relative;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.trip-card-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  padding-top: 32px;
}
.trip-card-trash {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  z-index: 2;
}
.trip-card h3 {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.trip-card-trash:hover,
.trip-card-trash:focus-visible {
  background: var(--danger-bg);
}
.trip-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.confirm-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-actions-stack .btn { width: 100%; }
.banner-link {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}


.section-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* Phone landscape: unlock rotation (manifest orientation:any) and keep a usable timeline */
@media (orientation: landscape) and (max-height: 620px) {
  .tabs-desktop { display: none !important; }
  .bottom-nav {
    display: flex !important;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 1 0 auto;
    min-width: 3.2rem;
  }
  .tl-pdf-export { display: none !important; }
  .page-head-timeline .tl-title {
    font-size: 20px;
    padding: 6px 22px;
  }
  .tl-item { grid-template-columns: 50px 16px 1fr; gap: 8px; }
  .tl-time { font-size: 12px; }
  .tl-type-icon { width: 40px; height: 40px; }
  .tl-card { max-width: 100%; }
  .timeline, .page { max-width: 100%; }
  /* Keep overflow visible on .page so pinch-zoom is not captured by a full-width scroller.
     Horizontal fallback for the table stays on .week-table-wrap. */
  .week-table {
    min-width: 0;
    width: 100%;
  }
  .week-table thead th {
    font-size: 11px;
    padding: 6px 3px;
    line-height: 1.25;
  }
  .week-cell {
    padding: 4px 3px;
    min-height: 0;
    height: auto;
  }
  .week-ev {
    font-size: 10px;
    padding: 2px 4px;
    gap: 3px;
  }
  .week-ev-time { font-size: 9px; }
  .week-more { font-size: 10px; padding: 1px 4px; }
  .topbar-home { min-height: calc(58px + var(--safe-t)); }
  .topbar-home .brand img { width: 48px; height: 48px; }
  .topbar-home .brand span { font-size: 18px; }
}

/* Installed-PWA fallback: fullscreen + locked landscape weekly table */
body.week-fs-landscape .bottom-nav { display: none !important; }
body.week-fs-landscape .page {
  padding-bottom: 12px;
  max-width: 100%;
}
body.week-fs-landscape .topbar {
  min-height: 44px;
  padding-top: calc(4px + env(safe-area-inset-top, 0px));
  padding-bottom: 4px;
}
body.week-fs-landscape .header-logo { height: 40px; }
body.week-fs-landscape .header-word { font-size: 20px; }
body.week-fs-landscape .week-table {
  min-width: 0;
  width: 100%;
}
body.week-fs-landscape .week-table thead th {
  font-size: 11px;
  padding: 6px 3px;
  line-height: 1.25;
}
body.week-fs-landscape .week-cell {
  padding: 4px 3px;
  min-height: 0;
  height: auto;
}
body.week-fs-landscape .week-ev {
  font-size: 10px;
  padding: 2px 4px;
}


/* ---------- Budget ---------- */
.budget-page { padding-bottom: 12px; }
.budget-summary {
  padding: 16px;
  margin-bottom: 14px;
}
.budget-totals {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
  margin-bottom: 16px;
}
.budget-totals div {
  background: var(--cream-2, #f6f3ec);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: center;
}
.budget-totals span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.budget-totals strong { display: block; font-size: 18px; color: var(--navy); margin-top: 2px; }
.budget-grand { background: #e8f4f3 !important; }
.budget-grand strong { color: var(--teal-d, #1b6b66); }
.budget-bar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 7px;
}
.budget-bar-label { font-size: 13px; font-weight: 650; color: var(--navy); }
.budget-bar-track {
  height: 10px;
  background: #ece7de;
  border-radius: 999px;
  overflow: hidden;
}
.budget-bar-fill { height: 100%; border-radius: 999px; }
.budget-bar-amt { font-size: 13px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.budget-source, .budget-warn { margin: 10px 0 0; }
.budget-warn { color: #9a4b16; }
.budget-rates { padding: 12px 16px; margin-bottom: 16px; }
.budget-rates summary { cursor: pointer; font-weight: 800; color: var(--navy); }
.budget-rates-form { margin-top: 10px; display: grid; gap: 8px; }
.budget-rate { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.budget-rate input { width: 7.5rem; }
.budget-h { font-size: 16px; color: var(--navy); margin: 18px 0 8px; }
.budget-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.budget-item-main { flex: 1; min-width: 0; }
.budget-item-name { font-weight: 800; color: var(--navy); }
.budget-item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.budget-item-amt { text-align: left; }
.budget-item-amt strong { display: block; color: var(--navy); }
.budget-item-amt span { font-size: 12px; color: var(--muted); }
.budget-include-toolbar {
  position: sticky;
  top: calc(var(--header-h) + var(--safe-t));
  z-index: 15;
  background: var(--paper);
  border: 1px solid var(--navy);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 12px 0 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.budget-include-toolbar + .budget-h { margin-top: 8px; }
.budget-include-count {
  font-size: 12px;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
}
.budget-include-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.budget-include-actions .btn {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 13px;
  border-radius: 10px;
}
.sw-update-banner {
  position: fixed;
  right: 12px;
  left: 12px;
  bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--navy);
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 700;
}
.sw-update-banner .btn { flex: 0 0 auto; }
.budget-ccy { margin: 8px 0 0; }
.budget-ccy-item { unicode-bidi: isolate; direction: ltr; display: inline-block; }
.budget-check {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 4px 6px 2px;
  margin: -4px 0 -4px -2px;
  cursor: pointer;
}
.budget-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--teal-d, #1b6b66);
  cursor: pointer;
}
.budget-item-excluded { opacity: 0.55; }
.budget-item-excluded .budget-item-name,
.budget-item-excluded .budget-item-amt strong,
.budget-item-excluded .budget-item-amt span {
  text-decoration: line-through;
}
.budget-item-overlap {
  border: 1.5px dashed #dc2626;
  background: #fff8f8;
}
.budget-overlap-note {
  margin-top: 4px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.budget-overlap-note .hotel-overlap-name {
  display: block;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
  margin-top: 1px;
}
@media (orientation: landscape) and (max-height: 500px) {
  .budget-totals { grid-template-columns: repeat(3, 1fr); }
  .budget-summary { padding: 12px; }
  .budget-bar-row { grid-template-columns: 4.5rem 1fr auto; }
  .budget-include-toolbar { padding: 6px 8px; margin: 8px 0 6px; }
  .budget-include-actions .btn { min-height: 32px; font-size: 12px; }
  .sw-update-banner { bottom: 12px; }
}
@media print {
  .budget-rates, #btn-add-expense, .budget-include-actions, .budget-check, .sw-update-banner, .budget-include-toolbar { display: none !important; }
}


/* ---------- Destination videos ---------- */
.vid-page { padding-bottom: 12px; }
.vid-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.vid-title-block h2 { font-size: 22px; color: var(--navy); font-weight: 800; margin: 0; }
.vid-title-block .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.vid-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  height: 1.4em;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.day-videos-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.day-videos-chip:hover { background: var(--cream-2); }
.vid-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.vid-filter {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.vid-filter.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.vid-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .vid-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .vid-grid { grid-template-columns: 1fr 1fr 1fr; }
}
.vid-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.vid-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--navy);
  cursor: pointer;
  overflow: hidden;
}
.vid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vid-thumb.no-img img { display: none; }
.vid-thumb-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.vid-thumb.no-img .vid-thumb-fallback,
.vid-thumb:not(:has(img[src])) .vid-thumb-fallback { display: flex; }
.vid-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(15,39,68,.45), transparent 55%);
  color: #fff;
  pointer-events: none;
}
.vid-play svg { width: 48px; height: 48px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.vid-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.vid-card-body h3 { font-size: 16px; color: var(--navy); font-weight: 800; margin: 0; line-height: 1.35; }
.vid-card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vid-plat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.vid-plat-youtube { background: #c4302b; }
.vid-plat-tiktok { background: #111; }
.vid-plat-instagram { background: #c13584; }
.vid-plat-facebook { background: #1877f3; }
.vid-plat-vimeo { background: #1ab7ea; }
.vid-plat-other { background: var(--navy); }
.vid-tag {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.vid-notes { font-size: 13px; color: var(--ink); margin: 0; }
.vid-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.vid-preview-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
  padding: 8px;
  background: var(--cream);
  border-radius: 12px;
}
.vid-preview-row img {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--navy);
  flex: 0 0 auto;
}
.vid-preview-row .meta { font-size: 13px; color: var(--muted); }
.vid-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 18, 30, .86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 12px;
}
.vid-lightbox-frame {
  width: min(960px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.vid-lightbox-frame iframe,
.vid-lightbox-frame video {
  width: 100%;
  height: 100%;
  border: 0;
}
.vid-lightbox-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
#btn-trip-videos {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.social-media-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}
.day-videos-chip .social-media-icon {
  width: 16px;
  height: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: right;
}
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 14px 16px;
  background: var(--cream, #f6f1e8);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.profile-section h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.profile-form .field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profile-form .field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin: 0;
}
.profile-form .field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--navy);
}
.profile-form .field input:focus {
  outline: 2px solid rgba(15, 39, 68, .18);
  border-color: var(--navy);
}
.profile-form .field input[readonly] {
  background: #f3f0ea;
  color: var(--navy);
  opacity: .9;
  cursor: default;
}
.profile-form .field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.profile-form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.profile-form-actions .btn {
  width: 100%;
}
@media (min-width: 800px) {
  .profile-form-actions {
    flex-direction: row-reverse;
    justify-content: stretch;
  }
  .profile-form-actions .btn { width: auto; flex: 1; }
}


/* ---------- Passwords ---------- */
.pw-field { margin-bottom: 0; }
.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  padding-inline-end: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 0;
}
.login-card .pw-wrap input,
.profile-form .pw-wrap input {
  margin-bottom: 0;
}
.pw-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}
.pw-toggle:hover, .pw-toggle.is-on { color: var(--navy); background: var(--cream-2); }
.forgot-pw-link {
  display: block;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.forgot-pw-msg {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--navy);
  font-size: 13px;
  line-height: 1.45;
}
.set-pw-title {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
}
.auth-form .field { margin-bottom: 14px; text-align: right; }
.auth-form .field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
#password-form .btn { width: 100%; margin-top: 4px; }
