/* ==========================================================================
   Jet, Set, Go — app-specific components. Only references tokens from
   styles.css plus the event-type tokens below (light + dark).
   ========================================================================== */
:root {
  --ev-sleep: #4f46e5; --ev-light: #d97706; --ev-dark: #475569; --ev-caffeine: #92400e;
  --ev-meal: #047857; --ev-move: #0e7490; --ev-wind: #be185d; --ev-med: #1d5fb3;
  --ev-flight: #6d28d9; --ev-anchor: #b42318; --ev-prep: #5b5977;
  --sky-night: #312e81; --sky-dawn: #f9a8d4; --sky-day: #7dd3fc;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ev-sleep: #a5b4fc; --ev-light: #fbbf24; --ev-dark: #cbd5e1; --ev-caffeine: #e0b083;
    --ev-meal: #6ee7b7; --ev-move: #67e8f9; --ev-wind: #f9a8d4; --ev-med: #7cb3f5;
    --ev-flight: #c4b5fd; --ev-anchor: #f59494; --ev-prep: #b8b6d6;
    --sky-night: #1e1b4b; --sky-dawn: #be185d; --sky-day: #0e7490;
  }
}
:root[data-theme="dark"] {
  --ev-sleep: #a5b4fc; --ev-light: #fbbf24; --ev-dark: #cbd5e1; --ev-caffeine: #e0b083;
  --ev-meal: #6ee7b7; --ev-move: #67e8f9; --ev-wind: #f9a8d4; --ev-med: #7cb3f5;
  --ev-flight: #c4b5fd; --ev-anchor: #f59494; --ev-prep: #b8b6d6;
  --sky-night: #1e1b4b; --sky-dawn: #be185d; --sky-day: #0e7490;
}

/* event type → colour */
.t-sleep, .t-nap { --ev: var(--ev-sleep); }
.t-light { --ev: var(--ev-light); }
.t-dark, .t-awake { --ev: var(--ev-dark); }
.t-caffeine, .t-cutoff { --ev: var(--ev-caffeine); }
.t-meal, .t-fast, .t-hydrate { --ev: var(--ev-meal); }
.t-move { --ev: var(--ev-move); }
.t-winddown, .t-prayer { --ev: var(--ev-wind); }
.t-medicine, .t-melatonin { --ev: var(--ev-med); }
.t-flight, .t-board, .t-travel, .t-layover, .t-landed { --ev: var(--ev-flight); }
.t-anchor, .t-nodrive { --ev: var(--ev-anchor); }
.t-prep { --ev: var(--ev-prep); }
.t-hydrate { --ev: var(--ev-move); }

.ev-icon {
  display: inline-grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 14px;
  background: color-mix(in srgb, var(--ev, var(--accent-1)) 15%, transparent);
  color: var(--ev, var(--accent-1));
  border: 1px solid color-mix(in srgb, var(--ev, var(--accent-1)) 22%, transparent);
}
.ev-icon .i { width: 20px; height: 20px; }

/* ---------- topbar extras ---------- */
.top-actions { display: flex; gap: 8px; }
.brand-mark { display: block; }

/* ---------- hero (welcome + today) ---------- */
.hero-art img { max-height: 340px; object-fit: contain; }
.intro h1 { text-wrap: balance; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- dual clock strip ---------- */
.clock-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.clock { min-width: 0; padding: 12px 12px 11px; border-radius: 18px; background: var(--card-bg); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-hi); }
.clock-label { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock-label .i { width: 13px; height: 13px; color: var(--accent-1); }
.clock-time { margin-top: 3px; font-size: clamp(17px, 5.2vw, 22px); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock.body .clock-time { background: var(--hero-ink); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- next-up card ---------- */
.next-card { border-radius: 26px; padding: 20px; }
.next-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.next-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.next-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.next-hero .ev-icon { width: 56px; height: 56px; border-radius: 18px; }
.next-hero .ev-icon .i { width: 26px; height: 26px; }
.next-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere; }
.next-when { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.next-why { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.next-detail { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.countdown { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--info-bg); color: var(--accent-1); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.countdown.live { background: var(--ok-bg); color: var(--ok-ink); }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.big-actions .btn, .big-actions .btn-ghost { min-height: 52px; font-size: 15px; border-radius: 16px; }

/* ---------- event rows ---------- */
.ev-list { display: grid; gap: 8px; }
.ev-row {
  position: relative; display: grid; grid-template-columns: 62px auto minmax(0, 1fr); gap: 12px; align-items: start;
  width: 100%; padding: 12px 14px 12px 12px; border-radius: 18px; text-align: left; cursor: pointer;
  border: 1px solid var(--glass-border); background: var(--card-bg); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-hi);
  touch-action: manipulation; transition: transform 0.15s, border-color 0.2s;
}
.ev-row:hover { border-color: color-mix(in srgb, var(--accent-1) 40%, var(--glass-border)); }
.ev-row:active { transform: scale(0.99); }
.ev-row .ev-icon { width: 38px; height: 38px; border-radius: 12px; }
.ev-row .ev-icon .i { width: 18px; height: 18px; }
.ev-time { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.2; padding-top: 2px; }
.ev-time small { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.ev-main { min-width: 0; }
.ev-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.ev-why { margin-top: 3px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.ev-row.done { opacity: 0.6; }
.ev-row.done .ev-title > span:first-child { text-decoration: line-through; text-decoration-thickness: 2px; }
.ev-row.skipped { opacity: 0.55; }
.ev-row.now { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--focus), var(--shadow-sm); }
.ev-row::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ev, transparent); }

.pri { font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.pri.must { background: var(--info-bg); color: var(--accent-1); }
.pri.should { background: var(--chip-bg); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hairline); }
.pri.nice { color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hairline); }
.status-tag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.status-tag.done { background: var(--ok-bg); color: var(--ok-ink); }
.status-tag.skipped { background: var(--warn-bg); color: var(--warn-ink); }
.where-tag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--ev-flight) 14%, transparent); color: var(--accent-1); }

/* ---------- plan: day cards + sky band ---------- */
.day-card { border-radius: 24px; padding: 18px 16px; }
.day-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 0 4px; }
.day-label { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.day-date { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.day-meta { font-size: 12px; color: var(--ink-3); text-align: right; white-space: nowrap; }
.sky { position: relative; height: 34px; margin: 4px 4px 6px; border-radius: 12px; overflow: hidden; border: 1px solid var(--hairline); }
.sky-mark { position: absolute; height: 8px; border-radius: 4px; }
.sky-mark.sleep { top: 4px; background: #fff; opacity: 0.85; }
.sky-mark.light { bottom: 4px; background: #fbbf24; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
.sky-mark.dark { bottom: 4px; background: #0f172a; opacity: 0.75; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4); }
.sky-axis { display: flex; justify-content: space-between; margin: 0 6px 12px; font-size: 10.5px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sky-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); }
.sky-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sky-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 4px; }
.day-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.day-nav::-webkit-scrollbar { display: none; }
.day-pill { flex: none; display: grid; justify-items: center; gap: 1px; min-width: 64px; min-height: 52px; padding: 7px 10px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--chip-bg); color: var(--ink-2); font-weight: 700; cursor: pointer; text-decoration: none; }
.day-pill b { font-size: 13.5px; color: var(--ink); }
.day-pill small { font-size: 11px; color: var(--ink-3); }
.day-pill[aria-current="true"] { background: var(--btn-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.8); }
.day-pill[aria-current="true"] b, .day-pill[aria-current="true"] small { color: #fff; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-row .chip { min-height: 40px; font-size: 13px; }

/* ---------- summary / direction card ---------- */
.route { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.route .i { width: 22px; height: 22px; color: var(--accent-1); }
.route small { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.02em; }
.dir-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.dir-opt { padding: 12px 14px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--field-bg); }
.dir-opt.picked { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--focus); background: var(--seg-active); }
.dir-opt b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dir-opt span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.badge-pick { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); vertical-align: 2px; }

/* ---------- meter (recovery) ---------- */
.meter { height: 12px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--btn-grad); }
.meter-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.meter-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ring { --p: 0; position: relative; width: 112px; height: 112px; flex: none; border-radius: 50%; background: conic-gradient(#7c3aed calc(var(--p) * 0.5%), #2563eb calc(var(--p) * 1%), var(--track) 0); }
.ring::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.ring-val { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.ring-val small { display: block; font-size: 10.5px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.recovery { display: flex; align-items: center; gap: 18px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 8px; height: 120px; margin-top: 10px; padding-top: 8px; border-bottom: 1px solid var(--axis); }
.bars .bar { display: grid; justify-items: center; align-content: end; gap: 4px; height: 100%; font-size: 11px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bars .bar i { display: block; width: 100%; max-width: 26px; border-radius: 6px 6px 2px 2px; background: var(--rank1); }
.bars-x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 4px; font-size: 11px; color: var(--ink-3); text-align: center; }

/* ---------- forms ---------- */
.input, .field input[type="text"], .field input[type="time"], .field input[type="date"], .field input[type="datetime-local"], .field input[type="number"], .field input[type="tel"], .field textarea {
  width: 100%; min-width: 0; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--hairline);
  background: var(--field-bg); color: var(--ink); font-size: 16px; font-weight: 600; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s; -webkit-appearance: none; appearance: none;
}
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .field input:focus, .field textarea:focus { border-color: var(--accent-1); box-shadow: 0 0 0 4px var(--focus); }
.field input::placeholder { color: var(--ink-3); opacity: 0.8; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.form-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.opt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-radius: 16px;
  border: 1px solid var(--hairline); background: var(--chip-bg); color: var(--ink-2); font-size: 14px; font-weight: 700;
  text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
}
.opt:hover { border-color: var(--accent-1); color: var(--ink); }
.opt:active { transform: scale(0.98); }
.opt[aria-pressed="true"] { color: #fff; background: var(--btn-grad); border-color: transparent; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.8); }
.opt .i { width: 18px; height: 18px; flex: none; }
.opt small { display: block; font-size: 11.5px; font-weight: 600; opacity: 0.8; }
.opt-grid.one { grid-template-columns: minmax(0, 1fr); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--hairline); }
.switch-row:first-child { border-top: 0; }
.switch-row > div { min-width: 0; }
.switch-row b { display: block; font-size: 14.5px; }
.switch-row span { display: block; font-size: 12.5px; color: var(--ink-3); }
.switch { position: relative; flex: none; width: 52px; height: 32px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--track); cursor: pointer; transition: background 0.2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.switch[aria-checked="true"] { background: var(--btn-grad); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
input[type="range"] { width: 100%; accent-color: #7c3aed; height: 32px; }

/* ---------- onboarding ---------- */
.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--track); }
.steps i.on { background: var(--btn-grad); }
.step-q { font-size: 15px; font-weight: 700; margin: 14px 0 8px; }
.step-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.step-actions .btn { flex: 1; }

/* ---------- legs editor ---------- */
.leg { padding: 14px; border-radius: 18px; border: 1px solid var(--hairline); background: var(--field-bg); display: grid; gap: 10px; }
.leg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.flight-lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.lookup-note { font-size: 12.5px; color: var(--ink-3); }
.lookup-note.ok { color: var(--ok-ink); }
.lookup-note.warn { color: var(--warn-ink); }

/* ---------- trips list ---------- */
.trip-card { display: grid; gap: 10px; padding: 16px; border-radius: 20px; text-align: left; width: 100%; cursor: pointer; border: 1px solid var(--glass-border); background: var(--card-bg); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--glass-hi); color: inherit; }
.trip-card:hover { border-color: var(--accent-1); }
.trip-card.active { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--focus), var(--shadow-sm); }
.trip-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.trip-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 800; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--hairline); color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.tag.info { background: var(--info-bg); color: var(--accent-1); border-color: transparent; }

/* ---------- coach chat ---------- */
.chat { display: grid; gap: 10px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.bot { justify-self: start; background: var(--card-bg); border: 1px solid var(--glass-border); border-bottom-left-radius: 6px; box-shadow: var(--shadow-sm); }
.msg.me { justify-self: end; color: #fff; background: var(--btn-grad); border-bottom-right-radius: 6px; }
.msg b { font-weight: 800; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.msg .msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg .msg-actions .chip { min-height: 36px; font-size: 12.5px; padding: 0 12px; }
.chat-form { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 8px; border-radius: 20px; background: var(--bar-bg); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); }
.chat-form input { height: 46px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--field-bg); color: var(--ink); font-size: 16px; outline: none; min-width: 0; }
.chat-form input:focus { box-shadow: 0 0 0 3px var(--focus); }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }
.suggest .chip { min-height: 38px; font-size: 13px; flex: none; }

/* ---------- me hub ---------- */
.menu-list { display: grid; gap: 0; }
.menu-item { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 4px; border-top: 1px solid var(--hairline); color: var(--ink); text-decoration: none; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer; font-size: 15px; font-weight: 700; }
.menu-item:first-child { border-top: 0; }
.menu-item > span:not(.card-icon) { flex: 1; min-width: 0; }
.menu-item small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
.menu-item > .i { width: 18px; height: 18px; color: var(--ink-3); }

/* ---------- family ---------- */
.member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border-radius: 20px; border: 1px solid var(--glass-border); background: var(--card-bg); box-shadow: var(--shadow-sm); }
.avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent-grad); color: #fff; font-weight: 800; font-size: 17px; }
.member b { display: block; font-size: 15px; }
.member small { display: block; font-size: 12.5px; color: var(--ink-3); }

/* ---------- pricing ---------- */
.price-grid { display: grid; gap: 10px; }
.price { padding: 16px; border-radius: 20px; border: 1px solid var(--hairline); background: var(--field-bg); }
.price.best { border-color: var(--accent-1); box-shadow: 0 0 0 3px var(--focus); background: var(--seg-active); }
.price-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.price-top b { font-size: 16px; }
.price-amt { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price-amt small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.price p { margin-top: 4px; font-size: 13px; color: var(--ink-2); }

/* ---------- check-in ---------- */
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.scale button { min-height: 52px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--chip-bg); color: var(--ink-2); font-size: 16px; font-weight: 800; cursor: pointer; display: grid; place-items: center; gap: 0; line-height: 1.1; }
.scale button small { font-size: 10px; font-weight: 700; color: inherit; opacity: 0.85; }
.scale button[aria-pressed="true"] { color: #fff; background: var(--btn-grad); border-color: transparent; }

/* ---------- in-flight view (always dark) ---------- */
.inflight-view {
  --ink: #f4f3ff; --ink-2: #c6c4e2; --ink-3: #b8b6d6; --card-bg: linear-gradient(150deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  --glass: linear-gradient(150deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)); --glass-border: rgba(255,255,255,0.13); --glass-hi: rgba(255,255,255,0.12);
  --hairline: rgba(255,255,255,0.1); --chip-bg: rgba(255,255,255,0.06); --track: rgba(255,255,255,0.12); --accent-1: #b4a0fb; --info-bg: rgba(167,139,250,0.12);
  --ok-ink: #6ee7b7; --ok-bg: rgba(52,211,153,0.13); --seg-active: rgba(255,255,255,0.14); --field-bg: rgba(255,255,255,0.05); --surface: #1c1b33;
  --ev-sleep: #a5b4fc; --ev-light: #fbbf24; --ev-dark: #cbd5e1; --ev-meal: #6ee7b7; --ev-flight: #c4b5fd; --ev-move: #67e8f9; --ev-caffeine: #e0b083;
  color: var(--ink); background: radial-gradient(120% 60% at 50% 0%, #1b1747, #07061a 70%);
  border-radius: 28px; padding: 20px 16px; border: 1px solid rgba(255,255,255,0.08);
}
.inflight-view h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.flight-track { position: relative; height: 54px; margin: 18px 4px 6px; }
.flight-track .line { position: absolute; left: 0; right: 0; top: 26px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.15); }
.flight-track .seg-sleep { position: absolute; top: 20px; height: 15px; border-radius: 8px; background: #6366f1; opacity: 0.9; }
.flight-track .seg-awake { position: absolute; top: 24px; height: 7px; border-radius: 4px; background: #fbbf24; opacity: 0.8; }
.flight-track .plane { position: absolute; top: 12px; width: 30px; height: 30px; margin-left: -15px; color: #fff; filter: drop-shadow(0 0 8px rgba(167,139,250,0.9)); }
.flight-track .plane .i { width: 30px; height: 30px; transform: rotate(45deg); }
.flight-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); font-weight: 700; }
.flight-ends b { display: block; font-size: 18px; color: var(--ink); font-weight: 800; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 10px; max-width: min(440px, calc(100% - 32px)); padding: 12px 16px; border-radius: 16px;
  background: var(--glass-solid); border: 1px solid var(--glass-border); box-shadow: var(--shadow); color: var(--ink); font-size: 14px; font-weight: 700;
  width: max-content; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .i { width: 18px; height: 18px; color: var(--ok-ink); flex: none; }
@media (min-width: 1000px) { .toast { bottom: 28px; } .chat-form { bottom: 16px; } }

/* ---------- misc ---------- */
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 2px 0; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 26px 10px; }
.empty .ev-icon { width: 60px; height: 60px; border-radius: 20px; }
.empty .ev-icon .i { width: 28px; height: 28px; }
.empty b { font-size: 17px; }
.empty p { color: var(--ink-2); font-size: 14px; max-width: 30em; }
.two-col { display: grid; gap: 16px; }
.view-enter { animation: view-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 13.5px; }
.danger-btn { color: var(--danger); }
.sheet-body .form-grid + .step-actions { margin-top: 18px; }
.ev-detail-time { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.print-only { display: none; }

/* desktop sidebar (simplified flat nav) */
@media (min-width: 1000px) {
  .two-col { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .next-card { padding: 26px; }
  .opt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 559px) { .dt-pair { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 359px) {
  .clock-strip { gap: 6px; }
  .clock { padding: 10px 9px; }
  .ev-row { grid-template-columns: 54px auto minmax(0, 1fr); gap: 9px; }
  .opt-grid { grid-template-columns: minmax(0, 1fr); }
}

/* elder mode (IN-18): larger text everywhere, fewer actions per day */
html.elder body { zoom: 1.18; }
html.elder .ev-why { font-size: 14px; }

/* print: one-page plan for elders and family (IN-18) */
@media print {
  .backdrop, .topbar, .tabbar, .sidebar, .no-print, .footer, .toast { display: none !important; }
  body { background: #fff; color: #000; zoom: 1 !important; }
  .layout { padding: 0; max-width: none; }
  .glass, .ev-row, .day-card { box-shadow: none !important; background: #fff !important; border: 1px solid #ccc !important; }
  .print-only { display: block; }
  .ev-row { break-inside: avoid; padding: 6px 10px; }
  .day-card { break-inside: auto; padding: 10px; }
  .sky, .sky-axis { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  h1 { color: #000 !important; background: none !important; -webkit-text-fill-color: #000; }
}

/* 3-option switches wrap their labels on small phones */
.seg-wrap > button { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.15; padding: 4px 8px; min-height: 44px; text-align: center; }
