:root {
  --bg: #f4f1ec;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #6b7280;
  --line: #e7e2da;
  --accent: #ff7a59;
  --accent-soft: #ffe8e1;
  --sky: #1f6feb;
  --sky-soft: #e3eefe;
  --ok: #18a058;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="dark"] {
  --bg: #0f1217; --card: #1a1e26; --ink: #eef1f6; --muted: #98a2b3; --line: #2a303b;
  --accent: #ff7a5c; --accent-soft: #3a2420; --sky: #5b9dff; --sky-soft: #1a2a44;
  color-scheme: dark;
}
:root[data-theme="dark"] .card, :root[data-theme="dark"] .quick button { box-shadow: none; border: 1px solid #232833; }
:root[data-theme="dark"] .btn.danger { background: #3b1d1d; color: #ff8a80; }
:root[data-theme="dark"] .check .box { border-color: #3a414e; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, sans-serif;
  font-size: 16px; line-height: 1.45; direction: rtl;
  min-height: 100dvh; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); font-size: 16px; /* 16px avoids iOS zoom */
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sky); outline-offset: -1px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 2px 6px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.hidden { display: none !important; }

/* ===== Layout ===== */
#app { max-width: 560px; margin: 0 auto; padding-bottom: calc(84px + var(--safe-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 10; padding: calc(var(--safe-top) + 12px) 18px 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); display: flex; align-items: center; gap: 10px;
}
.topbar h1 { font-size: 26px; font-weight: 800; flex: 1; }
.icon-btn { width: 40px; height: 40px; padding: 0; line-height: 1; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 19px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.view { padding: 4px 16px 20px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); display: flex; justify-content: center;
  padding: 6px 4px calc(6px + var(--safe-bottom));
}
.tabbar-inner { display: flex; width: 100%; max-width: 560px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: 11px; color: var(--muted); }
.tab .ti { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: .65; }
.tab.active { color: var(--accent); font-weight: 700; }
.tab.active .ti { filter: none; opacity: 1; }

/* ===== Cards ===== */
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card h3 { font-size: 17px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; margin: 18px 4px 8px; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid2 > * { min-width: 0; }
input { min-width: 0; }
input[type="date"], input[type="datetime-local"], input[type="time"] { -webkit-appearance: none; appearance: none; min-height: 48px; text-align: right; }

.hero {
  border-radius: 24px; padding: 22px 20px; color: #fff; margin-bottom: 14px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #ff6b4a 0%, #ff9a5a 45%, #1f6feb 140%);
}
.hero .flag { font-size: 40px; }
.hero h2 { font-size: 30px; font-weight: 800; margin-top: 6px; }
.hero .sub { opacity: .92; font-size: 15px; }
.hero .count { margin-top: 14px; display: flex; gap: 10px; align-items: baseline; }
.hero .count b { font-size: 46px; font-weight: 800; line-height: 1; }
.hero .plane { position: absolute; left: -10px; top: 10px; font-size: 90px; opacity: .18; transform: rotate(-15deg); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.quick button { background: var(--card); border-radius: 16px; padding: 12px 2px; font-size: 12px !important; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.quick button span { font-size: 26px; }

.weather { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.weather::-webkit-scrollbar { display: none; }
.wday { min-width: 62px; text-align: center; background: var(--bg); border-radius: 14px; padding: 8px 4px; font-size: 13px; }
.wday .wi { font-size: 22px; }

/* ===== Buttons & chips ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 13px 18px; border-radius: 14px; font-weight: 700; background: var(--accent); color: #fff; width: 100%; font-size: 16px; }
.btn.secondary { background: var(--sky-soft); color: var(--sky); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.btn.danger { background: #fde2e2; color: #c62828; }
.btn:active, .quick button:active, .chip:active { transform: scale(.97); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 14px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-weight: 600; font-size: 15px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 8px 4px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

/* ===== Onboarding ===== */
.ob { min-height: 100dvh; padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px); max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }
.ob .steps { display: flex; gap: 6px; margin-bottom: 26px; }
.ob .steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.ob .steps i.on { background: var(--accent); }
.ob h1 { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.ob .lead { color: var(--muted); margin-bottom: 20px; }
.ob .body { flex: 1; }
.ob .nav { display: flex; gap: 10px; margin-top: 20px; }
.dest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dest { background: var(--card); border: 2px solid transparent; border-radius: 16px; padding: 12px 4px; text-align: center; font-weight: 700; font-size: 14px; }
.dest .f { font-size: 32px; display: block; }
.dest.on { border-color: var(--accent); background: var(--accent-soft); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 10px 0 20px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; background: var(--card); font-size: 26px; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stepper b { font-size: 44px; min-width: 60px; text-align: center; }
.welcome-emoji { font-size: 72px; margin: 20px 0 10px; }

/* ===== Itinerary ===== */
.day { margin-bottom: 14px; }
.day-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 4px 8px; }
.day-head h3 { font-size: 18px; }
.day-head .muted { font-size: 13px; }
.item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .time { font-size: 13px; font-weight: 700; color: var(--sky); min-width: 46px; padding-top: 2px; }
.item .what { flex: 1; }
.item .what b { font-weight: 600; display: block; }
.item .what small { color: var(--muted); font-size: 13px; }
.item.done .what b { text-decoration: line-through; color: var(--muted); }
.item .acts { display: flex; gap: 2px; }
.item .acts button { width: 32px; height: 32px; border-radius: 8px; font-size: 15px; color: var(--muted); }
.add-line { display: flex; gap: 8px; margin-top: 8px; }
.add-line input { padding: 10px 12px; }
.add-line .time-in { width: 92px; flex: none; }

/* ===== Checklist ===== */
.check { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; color: #fff; font-size: 14px; }
.check.on .box { background: var(--ok); border-color: var(--ok); }
.check.on .lbl { color: var(--muted); text-decoration: line-through; }
.check .lbl { flex: 1; }
.check .del { color: var(--muted); font-size: 15px; width: 30px; height: 30px; }
.progress { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; margin: 6px 0 2px; }
.progress i { display: block; height: 100%; background: var(--ok); transition: width .3s; }

/* ===== Docs ===== */
.docs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.doc { aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; background: var(--bg); position: relative; display: grid; place-items: center; font-size: 34px; }
.doc img { width: 100%; height: 100%; object-fit: cover; }
.doc span { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; font-size: 11px; padding: 14px 6px 5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload { border: 2px dashed var(--line); border-radius: 12px; aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.upload b { font-size: 30px; color: var(--accent); }

.viewer { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; }
.viewer .vbar { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-top) + 10px) 14px 10px; color: #fff; gap: 10px; }
.viewer .vbar button { color: #fff; font-weight: 700; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.15); }
.viewer .vbody { flex: 1; display: grid; place-items: center; overflow: auto; background: #fff; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer iframe { width: 100%; height: 100%; border: 0; background: #fff; }

.taxi { position: fixed; inset: 0; z-index: 60; background: #fff; color: #000; display: flex; flex-direction: column; justify-content: center; padding: 30px; text-align: center; }
.taxi .t1 { font-size: 18px; color: #555; }
.taxi .t2 { font-size: 36px; font-weight: 800; margin: 14px 0; line-height: 1.25; direction: ltr; }
.taxi .t3 { font-size: 22px; font-weight: 600; direction: ltr; }

/* ===== Money ===== */
.conv-amount { font-size: 34px; font-weight: 800; text-align: center; padding: 14px; direction: ltr; }
.conv-result { text-align: center; font-size: 40px; font-weight: 800; color: var(--accent); margin: 8px 0 2px; direction: ltr; }
.swap { display: block; margin: 8px auto; width: 44px; height: 44px; border-radius: 50%; background: var(--sky-soft); color: var(--sky); font-size: 20px; }
.rate-table { width: 100%; border-collapse: collapse; font-size: 15px; direction: ltr; }
.rate-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.rate-table td:last-child { text-align: right; font-weight: 700; }
.exp { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.exp:last-child { border-bottom: 0; }
.exp .amt { font-weight: 700; direction: ltr; text-align: left; }
.exp .amt small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; }

/* ===== Guide ===== */
.tip { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tip:last-child { border-bottom: 0; }
.tip .e { font-size: 18px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.fact small { color: var(--muted); font-size: 12px; display: block; }
.fact b { font-size: 15px; }
.fact.wide { grid-column: span 2; }
.app-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.app-row:last-child { border-bottom: 0; }
.app-ic { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 18px; flex: none; }
.app-row .grow { flex: 1; }
.app-row a { color: var(--sky); font-weight: 700; font-size: 14px; text-decoration: none; padding: 6px 12px; background: var(--sky-soft); border-radius: 999px; }
.phrase { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.phrase:last-child { border-bottom: 0; }
.phrase .grow { flex: 1; }
.phrase .he { font-size: 13px; color: var(--muted); }
.phrase .loc { font-size: 18px; font-weight: 700; direction: ltr; text-align: right; }
.phrase .pr { font-size: 15px; color: var(--accent); }
.speak { width: 40px; height: 40px; border-radius: 50%; background: var(--sky-soft); font-size: 18px; flex: none; }

.toast { position: fixed; bottom: calc(96px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 70; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.on { opacity: 1; }

.install-hint { background: var(--sky-soft); color: var(--ink); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.install-hint b { color: var(--sky); }
.install-hint .x { margin-inline-start: auto; color: var(--muted); font-size: 18px; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 18px 16px calc(var(--safe-bottom) + 18px); max-height: 90dvh; overflow-y: auto; }
.sheet h2 { font-size: 20px; margin-bottom: 6px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: -6px auto 12px; }

/* ===== Gallery ===== */
.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 14px; overflow: hidden; }
.gal { aspect-ratio: 1; padding: 0; position: relative; background: var(--line); }
.gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal i { position: absolute; top: 4px; left: 4px; font-style: normal; font-size: 14px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.viewer .vbar { flex-wrap: wrap; }
.viewer .vbar button { font-size: 14px; }

/* ===== Expense split ===== */
.small-chip { padding: 6px 12px; font-size: 14px; }
.tog { display: flex; align-items: center; gap: 6px; margin: 0; flex: none !important; font-size: 14px; color: var(--ink); white-space: nowrap; }
.tog input { width: 20px; height: 20px; accent-color: var(--accent); }
.cmp { padding: 8px 0; }
.bar { height: 10px; border-radius: 10px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 10px; transition: width .3s; }
.topbar .icon-btn + .icon-btn { margin-inline-start: -2px; }

/* ===== "Did you know" pop-up ===== */
.dyk { position: fixed; left: 12px; right: 12px; bottom: calc(78px + var(--safe-bottom)); z-index: 30; max-width: 536px; margin: 0 auto;
  background: var(--ink); color: var(--bg); border-radius: 18px; padding: 12px 14px 8px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transform: translateY(140%); opacity: 0; transition: transform .45s cubic-bezier(.2,.9,.3,1.2), opacity .3s; pointer-events: none; }
.dyk.on { transform: none; opacity: 1; pointer-events: auto; }
.dyk-t { font-size: 12px; font-weight: 800; color: var(--accent); letter-spacing: .02em; }
.dyk-x { font-size: 15px; line-height: 1.45; margin-top: 2px; }
.dyk-b { display: flex; justify-content: space-between; margin-top: 4px; }
.dyk-b button { color: inherit; opacity: .75; font-size: 13px; font-weight: 700; padding: 6px 2px; }

/* ===== Colorful background (instead of plain white / black) ===== */
:root {
  --glass: rgba(255, 255, 255, .66);
  --glass-border: rgba(255, 255, 255, .85);
  --tint-1: rgba(255, 107, 74, .10);
  --tint-2: rgba(31, 111, 235, .09);
  --tint-3: rgba(142, 68, 173, .09);
  --bg-art:
    radial-gradient(75% 50% at 108% -8%, rgba(255, 120, 80, .62), transparent 70%),
    radial-gradient(60% 45% at -12% 20%, rgba(80, 145, 255, .50), transparent 70%),
    radial-gradient(65% 45% at 112% 58%, rgba(255, 190, 100, .48), transparent 70%),
    radial-gradient(70% 50% at -8% 102%, rgba(170, 120, 255, .50), transparent 70%),
    linear-gradient(170deg, #ffe9dc 0%, #f3e9fb 55%, #e4edff 100%);
}
:root[data-theme="dark"] {
  --glass: rgba(24, 28, 42, .66);
  --glass-border: rgba(255, 255, 255, .08);
  --tint-1: rgba(255, 107, 74, .14);
  --tint-2: rgba(91, 157, 255, .13);
  --tint-3: rgba(170, 110, 255, .14);
  --bg-art:
    radial-gradient(75% 50% at 108% -8%, rgba(255, 100, 70, .42), transparent 70%),
    radial-gradient(60% 45% at -12% 22%, rgba(50, 110, 255, .40), transparent 70%),
    radial-gradient(65% 45% at 112% 62%, rgba(255, 150, 60, .20), transparent 70%),
    radial-gradient(70% 50% at -8% 102%, rgba(140, 80, 255, .42), transparent 70%),
    linear-gradient(170deg, #11132a 0%, #160f2c 55%, #0b1630 100%);
}
html { background: var(--bg); }
body { background: transparent; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg-art); }
.card, .quick button, .stepper button, .dest, .chip:not(.on), .icon-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 6px 22px -8px rgba(70, 40, 110, .22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
:root[data-theme="dark"] .card, :root[data-theme="dark"] .quick button { box-shadow: 0 8px 26px -10px rgba(0, 0, 0, .7); }
.dest.on { border-color: var(--accent); background: var(--accent-soft); }
/* quick buttons get soft rotating color tints */
.quick button:nth-child(4n+1) { background-image: linear-gradient(160deg, var(--tint-1), transparent); }
.quick button:nth-child(4n+2) { background-image: linear-gradient(160deg, var(--tint-2), transparent); }
.quick button:nth-child(4n+3) { background-image: linear-gradient(160deg, var(--tint-3), transparent); }
.quick button:nth-child(4n+4) { background-image: linear-gradient(160deg, rgba(24, 160, 88, .10), transparent); }
.topbar { background: transparent; -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
.tabbar { background: var(--glass); border-top: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6); }
.seg { background: rgba(110, 90, 160, .16); }
:root[data-theme="dark"] .seg { background: rgba(255, 255, 255, .08); }
.wday { background: linear-gradient(170deg, var(--tint-2), var(--tint-3)); }
.fact { background: linear-gradient(160deg, var(--tint-1), var(--tint-3)); }
.section-title { color: color-mix(in srgb, var(--ink) 62%, transparent); }
.hero { box-shadow: 0 18px 40px -16px rgba(255, 107, 74, .75); }
.sheet { background: var(--bg); background-image: var(--bg-art); }
input, select, textarea { background: rgba(255, 255, 255, .8); }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: rgba(10, 12, 20, .45); }

/* ===== Faint landmark photo of the destination ===== */
#bgimg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-size: cover; background-position: center 30%;
  mix-blend-mode: luminosity; opacity: 0; transition: opacity 1.2s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, rgba(0,0,0,.35) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, rgba(0,0,0,.35) 100%);
}
#bgimg.on { opacity: .16; }
:root[data-theme="dark"] #bgimg.on { opacity: .2; }

/* ===== Hero card: real airplane photo instead of the orange gradient ===== */
.hero {
  background:
    linear-gradient(to left, rgba(10, 20, 42, .84) 0%, rgba(10, 20, 42, .58) 50%, rgba(10, 20, 42, .2) 100%),
    url(img/plane.jpg) center 45% / cover no-repeat,
    #33445e;
  box-shadow: 0 18px 40px -18px rgba(20, 40, 90, .55);
  border: 1px solid rgba(255, 255, 255, .25);
}
.hero h2, .hero .count b { text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .hero {
  background:
    linear-gradient(to left, rgba(6, 10, 24, .86) 0%, rgba(6, 10, 24, .6) 45%, rgba(6, 10, 24, .25) 100%),
    url(img/plane.jpg) center 45% / cover no-repeat,
    #1a2238;
  border-color: rgba(255, 255, 255, .08);
}

/* ===== "Are you sure?" dialog ===== */
.ask-bg { position: fixed; inset: 0; z-index: 90; background: rgba(15, 18, 30, .45); display: grid; place-items: center; padding: 24px;
  opacity: 0; transition: opacity .18s; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ask-bg.on { opacity: 1; }
.ask { width: 100%; max-width: 340px; background: var(--bg); background-image: var(--bg-art); border-radius: 24px; padding: 22px 18px 16px; text-align: center;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45); transform: scale(.94); transition: transform .18s; border: 1px solid var(--glass-border); }
.ask-bg.on .ask { transform: none; }
.ask-ic { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.ask h3 { font-size: 19px; margin: 0 0 6px; }
.ask p { color: var(--muted); font-size: 15px; margin: 0 0 4px; word-break: break-word; }
.ask-b { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.btn.danger-solid { background: #e5484d; color: #fff; }
.btn.danger-text { color: #d93a3f; font-weight: 600; font-size: 15px; }
:root[data-theme="dark"] .btn.danger-text { color: #ff8a80; }

/* ===== Undo bar ===== */
.undo { position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-bottom)); z-index: 80; max-width: 536px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: var(--bg);
  padding: 10px 10px 10px 16px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transform: translateY(160%); opacity: 0; transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), opacity .25s; pointer-events: none; }
.undo.on { transform: none; opacity: 1; pointer-events: auto; }
.undo span { font-weight: 600; font-size: 15px; }
.undo button { color: var(--accent); font-weight: 800; font-size: 15px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .08); }

/* ===== Trip switcher ===== */
.topbar h1 { font-size: 24px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-pill { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 12px; border-radius: 999px; font-size: 15px;
  background: var(--glass); border: 1px solid var(--glass-border); box-shadow: 0 4px 14px -6px rgba(70, 40, 110, .25);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: 46vw; }
.trip-pill b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-pill i { font-style: normal; font-size: 11px; font-weight: 800; background: var(--accent); color: #fff; border-radius: 99px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.trip-pill span { color: var(--muted); font-size: 12px; }
.trip-row { display: flex; align-items: stretch; gap: 8px; margin-bottom: 8px; }
.trip-main { flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; text-align: right;
  background: var(--glass); border: 1.5px solid var(--glass-border); }
.trip-row.cur .trip-main { border-color: var(--accent); background: var(--accent-soft); }
.trip-flag { font-size: 30px; }
.trip-main .grow { flex: 1; display: flex; flex-direction: column; }
.trip-main b { font-size: 17px; }
.trip-main small { color: var(--muted); font-size: 13px; }
.trip-cur { color: var(--accent); font-weight: 800; font-size: 13px; }
.trip-go { color: var(--muted); font-size: 18px; }
.trip-del { width: 48px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); font-size: 18px; }

/* ===== Logo ===== */
.ob-logo { text-align: center; margin: 4px 0 14px; }
.ob-logo .lm { width: 168px; clip-path: inset(0 0 8% 0); }
.ob-logo .lw { width: 220px; display: block; margin: -6px auto 0; }
.set-logo { text-align: center; margin: 18px 0 4px; }
.set-logo img { width: 54px; clip-path: inset(0 0 8% 0); }
.set-logo .lw { width: 120px; display: block; margin: 0 auto; }
:root[data-theme="dark"] .ob-logo .lw, :root[data-theme="dark"] .set-logo .lw { filter: brightness(0) invert(1) opacity(.9); }

/* ===== Brand bar: logo + name always at the top ===== */
.topbar { padding-top: calc(var(--safe-top) + 10px); padding-bottom: 10px; gap: 8px; }
.topbar .grow { flex: 1; }
.brand { display: flex; align-items: center; gap: 8px; flex: none; padding: 0; }
.brand-ic { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 4px 12px -4px rgba(43, 179, 168, .6); }
.brand-name { height: 19px; width: auto; }
:root[data-theme="dark"] .brand-name { filter: brightness(0) invert(1) opacity(.92); }
.page-title { padding: 2px 18px 8px; }
.page-title h1 { font-size: 28px; font-weight: 800; margin: 0; }
.trip-pill { height: 38px; font-size: 14px; max-width: 40vw; }
.topbar .icon-btn { width: 38px; height: 38px; font-size: 18px; flex: none; }
.ob-brand { margin: -8px 0 14px; }
@media (max-width: 360px) { .brand-name { height: 16px; } .trip-pill b { display: none; } }

/* ===== Editable people chips ===== */
.person-chip .pen { opacity: .5; font-size: 12px; margin-inline-start: 2px; }
.person-chip.off { opacity: .55; text-decoration: line-through; }
.diner-name { flex: .6; text-align: right; font-weight: 700; font-size: 16px; padding: 8px 0; display: flex; align-items: center; gap: 4px; }
.diner-name .pen { opacity: .5; font-size: 12px; font-weight: 400; }
.row > .chip { flex: none; white-space: nowrap; }

.recv-link { display: block; text-align: center; margin: 18px 0 0; padding: 12px; border-radius: 14px; border: 1.5px dashed var(--line, rgba(127,127,127,.35)); font-weight: 700; color: var(--accent); cursor: pointer; }

/* places */
.place .place-top { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.place-ic { width: 58px; height: 58px; border-radius: 16px; background: var(--accent-soft, #fff1ec); display: grid; place-items: center; font-size: 27px; overflow: hidden; flex: none; }
.place-ic img { width: 100%; height: 100%; object-fit: cover; }
.place .what { flex: 1; min-width: 0; }
.place .what b { display: block; font-size: 16px; line-height: 1.3; }
.place .what small { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.place q { display: block; font-size: 14px; margin-top: 4px; color: var(--ink); font-style: italic; quotes: '"' '"'; }
.place.visited { box-shadow: inset -4px 0 0 #22c55e, 0 1px 3px rgba(0,0,0,.05); }
.place-acts { display: flex; gap: 6px; margin-top: 10px; }
.place-acts > * { flex: 1; padding: 9px 4px; border-radius: 12px; background: var(--bg); font-size: 13px; font-weight: 700; text-align: center; margin: 0; color: var(--ink); cursor: pointer; border: 0; }
.place-acts .go { background: #22c55e; color: #fff; }
.summary-cta { display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, #2BB3A8, #1f6feb); color: #fff; cursor: pointer; }
.summary-cta b { display: block; font-size: 17px; } .summary-cta small { opacity: .92; font-size: 13px; line-height: 1.35; display: block; margin-top: 2px; }
.summary-cta span { margin-inline-start: auto; font-size: 22px; }

/* no double-tap zoom anywhere */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* accessibility */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
:root[data-contrast="high"] { --muted: #374151; --line: #8b929e; }
:root[data-contrast="high"][data-theme="dark"] { --muted: #d4d8e0; --line: #6b7280; }
:root[data-contrast="high"] #bgimg { display: none; }
:root[data-contrast="high"] body { background-image: none !important; }
:root[data-contrast="high"] .card, :root[data-contrast="high"] .sheet, :root[data-contrast="high"] input, :root[data-contrast="high"] textarea, :root[data-contrast="high"] select { border: 1.5px solid var(--line); }
:root[data-contrast="high"] .tab { color: var(--ink); }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; } }
.viewer .vbody { overflow: hidden; }
.fb-link{display:block;margin:6px auto 18px;background:none;border:0;color:var(--muted,#6b7280);font:inherit;font-size:14px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}

/* currency picker */
.cur-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font: inherit; color: var(--ink); text-align: start; min-width: 0; }
.cur-btn span { font-size: 20px; flex: none; }
.cur-btn b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.cur-btn small { color: var(--muted); font-weight: 700; direction: ltr; flex: none; }
.cur-btn i { font-style: normal; color: var(--muted); flex: none; }
#cur-q { margin-bottom: 10px; }
.cur-letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.cur-letters button { min-width: 34px; height: 34px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-weight: 800; color: var(--ink); }
.cur-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: start; color: var(--ink); font: inherit; }
.cur-row.on { background: var(--accent-soft); border-radius: 12px; }
.cur-row .cf { font-size: 26px; flex: none; }
.cur-row .cn { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cur-row .cn small { color: var(--muted); font-size: 13px; }
.cur-row .cc { flex: none; font-weight: 800; color: var(--muted); direction: ltr; font-size: 13px; }
#cur-list .section-title { scroll-margin-top: 8px; }

/* connecting flights */
.conn { border: 1.5px dashed var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0 4px; }
.conn-add { margin-top: 8px; }
.leg-sep { height: 1px; background: var(--line); margin: 14px 0 4px; }
.legs-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; direction: ltr; justify-content: flex-end; }
.legs-chain span { padding: 4px 10px; border-radius: 999px; background: var(--line); font-weight: 700; font-size: 13px; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.legs-chain span small { font-size: 10px; font-weight: 600; color: var(--muted); }
.legs-chain span.on { background: var(--accent-soft); color: var(--accent); }
.legs-chain i { font-style: normal; color: var(--muted); }

/* getting to the airport */
.ap-flight { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 4px; font-size: 15px; }
.ap-flight.warn { background: var(--accent-soft); border-color: transparent; }
.ap-time { display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-top: 12px; }
.ap-time small { color: var(--muted); font-weight: 700; }
.ap-time > b { font-size: 34px; line-height: 1.1; margin: 2px 0 6px; direction: ltr; }
.ap-time.leave > b { color: var(--accent); }
.ap-chips { justify-content: center; gap: 6px; margin-top: 6px; }
.ap-chips .chip { padding: 6px 11px; font-size: 13px; }
.ap-tip { font-size: 13px; margin: 10px 0 0; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* Google account */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1.5px solid #dadce0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.google-btn svg { flex: none; }
.acct-mini { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 14px; font-size: 14px; }
.acct-mini img, .acct-ph { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--line); }
.acct .acct-ph { width: 46px; height: 46px; font-size: 22px; flex: none; }

/* packing: category picker + rename */
.pack-cat-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; }
.pack-cat-line select { flex: 1; padding: 8px 10px; }
.pack-cat-h { display: flex; align-items: center; justify-content: space-between; }
.pack-cat-h .cat-edit { background: none; border: 0; font-size: 14px; padding: 4px 8px; cursor: pointer; opacity: .7; }
.pack-cat-h .cat-edit:active { opacity: 1; transform: scale(.9); }

/* the Apple gear emoji is drawn slightly left/up inside its box — nudge it to the true centre */
.icon-btn .gear { display: block; transform: translate(1.5px, .6px); }

/* ---------- highlights (story circles on the home screen) ---------- */
.hl-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px 4px 4px; margin: 0 -4px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hl-row::-webkit-scrollbar { display: none; }
.hl { flex: none; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; padding: 0; color: var(--ink); }
.hl .ring { width: 66px; height: 66px; border-radius: 50%; padding: 2.5px; background: conic-gradient(from 210deg, #ff7a59, #ffb347, #ff4f8b, #8a5cff, #ff7a59); display: block; box-sizing: border-box; }
.hl .ring img, .hl .ring em { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--card); box-sizing: border-box; object-fit: cover; display: grid; place-items: center; font-style: normal; font-size: 27px; line-height: 1; background: var(--card); }
.hl.empty .ring, .hl.add .ring { background: none; border: 2px dashed color-mix(in srgb, var(--muted) 55%, transparent); padding: 2px; }
.hl.empty .ring em, .hl.add .ring em { border: 0; background: color-mix(in srgb, var(--card) 85%, transparent); }
.hl.add .ring em { font-size: 30px; font-weight: 300; color: var(--muted); }
.hl b { font-size: 12px; font-weight: 600; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl:active .ring { transform: scale(.94); }
.hl-hint { font-size: 12.5px; color: var(--muted); margin: -4px 4px 12px; }
.hl-emojis { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.hl-emojis button { width: 40px; height: 40px; border-radius: 12px; font-size: 21px; line-height: 1; background: var(--bg); padding: 0; display: grid; place-items: center; }
.hl-emojis button.on { outline: 2px solid var(--accent); background: var(--accent-soft); }
.hl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 8px; max-height: 46vh; overflow-y: auto; }
.hl-th { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--line); padding: 0; }
.hl-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hl-th.cover { box-shadow: inset 0 0 0 3px var(--accent); }
.hl-th.cover img { opacity: .92; }
.hl-th .x { position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 0; display: grid; place-items: center; }
.hl-th.pick.on::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,122,89,.5); color: #fff; font-size: 28px; font-weight: 800; }
.hl-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--bg); margin-bottom: 8px; font-size: 16px; text-align: start; }
.hl-opt span { font-size: 22px; } .hl-opt b { flex: 1; } .hl-opt i { font-style: normal; color: var(--accent); font-weight: 800; }
.hl-opt.on { background: var(--accent-soft); }
.sheet-bg.over-viewer { z-index: 55; }

.story { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; animation: stIn .22s ease-out; }
.story.out { animation: stOut .18s ease-in forwards; }
@keyframes stIn { from { opacity: 0; transform: scale(.94); } }
@keyframes stOut { to { opacity: 0; transform: scale(.94); } }
.story .st-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) brightness(.5); }
.story .st-img { position: absolute; inset: 0; display: grid; place-items: center; }
.story .st-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.story .st-bars { position: absolute; top: calc(var(--safe-top) + 8px); left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.story .st-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.story .st-bars b { display: block; height: 100%; width: 0; background: #fff; }
.story .st-top { position: absolute; top: calc(var(--safe-top) + 18px); left: 8px; right: 12px; display: flex; align-items: center; gap: 8px; z-index: 4; text-shadow: 0 1px 3px rgba(0,0,0,.5); font-size: 15px; }
.story .st-av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,.2); font-size: 16px; flex: none; }
.story .st-av img { width: 100%; height: 100%; object-fit: cover; }
.story .st-date { opacity: .75; font-size: 13px; }
.story .st-top button { color: #fff; font-size: 19px; width: 40px; height: 40px; background: none; padding: 0; }
.story .st-cap { position: absolute; bottom: calc(var(--safe-bottom) + 28px); left: 16px; right: 16px; text-align: center; z-index: 3; pointer-events: none; }
.story .st-cap span { display: inline-block; background: rgba(0,0,0,.5); padding: 7px 14px; border-radius: 14px; font-size: 16px; font-weight: 600; }
.story .st-prev, .story .st-next { position: absolute; top: calc(var(--safe-top) + 66px); bottom: 0; width: 50%; background: none; z-index: 2; padding: 0; }
.story .st-prev { right: 0; } .story .st-next { left: 0; }
.hl-src { width: 100%; height: 46px; margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.hl-th.cover::after { content: '★'; position: absolute; inset: 0; border: 3px solid var(--accent); border-radius: 12px; display: flex; align-items: flex-end; justify-content: flex-end; padding: 3px 6px; color: #fff; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.6); pointer-events: none; }
.story .st-edit { margin-inline-start: auto; }
