/* =========================================================
   Right to Rest — styles
   1. Theme colours (Passport, Horizon, Night Map)
   2. Base
   3. Screen 1: choose your style
   4. Screen 2: ask about your trip
   5. Phone layout
   ========================================================= */

/* ---------- 1. Themes: each theme only changes these variables ---------- */
:root,
[data-theme="passport"] {
  --bg: #F3ECDD;
  --bg-image:
    repeating-radial-gradient(circle at 0 0, transparent 0, transparent 30px, rgba(44,90,95,.05) 31px, transparent 32px),
    repeating-radial-gradient(circle at 100% 100%, transparent 0, transparent 30px, rgba(166,61,38,.04) 31px, transparent 32px);
  --ink: #1F2A36;
  --muted: #4E535A;
  --faint: #5B5F66;
  --line: #CDBF9F;
  --line-soft: #D9CCAE;
  --card: #FBF7EE;
  --accent: #A63D26;
  --btn-bg: #1F2A36;
  --btn-ink: #F3ECDD;
  --panel-bg: #1F2A36;
  --panel-ink: #F3ECDD;
  --panel-muted: #B9BEC6;
  --panel-accent: #E9C987;
  --mrz: #B8A983;
  --font-display: 'Fraunces', Georgia, serif;
  --font-text: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 14px;
  --stamp-todo: #A63D26;
  --stamp-ok: #2C5A5F;
  --stamp-check: #85600F;
}

[data-theme="horizon"] {
  /* Sea Sunrise: dawn sky, a sun on the horizon, a pale turquoise sea, foam-white page */
  --bg: #EEF6F8;
  --bg-image: none; /* the sea scene is drawn on body below */
  --ink: #14384F;
  --muted: #3F5B6B;
  --faint: #4A6676;
  --line: #C9DDE5;
  --line-soft: #DCEAF0;
  --card: #FFFFFF;
  --accent: #B4472A;
  --btn-bg: #1D5B78;
  --btn-ink: #FFFFFF;
  --panel-bg: #1B4E6A;
  --panel-ink: #F4FAFC;
  --panel-muted: #C3DAE5;
  --panel-accent: #FFD39A;
  --mrz: transparent;
  --radius: 22px;
  --stamp-todo: #B4472A;
  --stamp-ok: #1F6F68;
  --stamp-check: #85600F;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-mono: 'IBM Plex Sans', system-ui, sans-serif; /* labels in clean sans, not typewriter */
}

[data-theme="night"] {
  --bg: #0A1020;
  --bg-image: radial-gradient(rgba(140,170,230,.16) 1px, transparent 1.5px);
  --bg-size: 18px 18px;
  --ink: #E6ECF5;
  --muted: #AEB9CC;
  --faint: #9AA6BA;
  --line: #2A3652;
  --line-soft: #1E2840;
  --card: #111A2E;
  --accent: #7FD4FF;
  --btn-bg: #7FD4FF;
  --btn-ink: #0A1020;
  --panel-bg: #111A2E;
  --panel-ink: #E6ECF5;
  --panel-muted: #9AA6BA;
  --panel-accent: #FFC86B;
  --mrz: #2A3652;
  --radius: 12px;
  --stamp-todo: #FF9A8A;
  --stamp-ok: #6FE0C8;
  --stamp-check: #FFC86B;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-text);
  color: var(--ink);
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: var(--bg-size, auto);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}
[data-theme="passport"] body, [data-theme="night"] body { background-repeat: repeat; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand__icon { width: 28px; height: 28px; stroke: var(--accent); }
.brand__name { font-family: var(--font-display); font-size: 22px; }

.langs { display: flex; gap: 4px; flex-wrap: wrap; }
.lang {
  min-width: 44px; height: 44px; padding: 0 8px;
  border-radius: 6px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font-family: var(--font-mono); font-size: 13px;
}
.lang[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- 3. Screen 1: choose your style (always dark) ---------- */
.choose {
  min-height: 100vh; display: flex; flex-direction: column;
  background: #0F1216; color: #F2EFE8;
}
.choose__top, .choose__main, .choose__foot { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }
.choose__top { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.choose .brand__icon { stroke: #E9C987; }
.langs--dark .lang { color: #A7ADB5; border-color: #343A43; border-radius: 22px; }
.langs--dark .lang[aria-pressed="true"] { background: transparent; color: #F2EFE8; border-color: #E9C987; }

.choose__main { flex-grow: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px; padding-top: 24px; padding-bottom: 48px; }
.choose__kicker { margin: 0; font-family: var(--font-mono); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: #E9C987; }
.choose__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(44px, 7vw, 76px); line-height: 1.02; letter-spacing: -.02em; max-width: 900px; }
.choose__title em { color: #E9C987; }
.choose__lead { margin: 0; font-size: 19px; line-height: 1.55; color: #C4C8CE; max-width: 640px; }
.choose__subtitle { margin: 36px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; }
.choose__hint { margin: 0; font-size: 15px; color: #A7ADB5; }
.choose__foot { padding-top: 16px; padding-bottom: 32px; text-align: center; font-size: 13px; color: #8F959D; }

.windows { display: flex; flex-wrap: wrap; justify-content: center; gap: 48px; margin-top: 20px; }
.window { display: flex; flex-direction: column; align-items: center; gap: 18px; background: none; border: 0; padding: 0; color: #F2EFE8; transition: transform .35s ease; }
.window:hover { transform: translateY(-8px); }
.window:focus-visible { outline-color: #E9C987; outline-offset: 8px; border-radius: 24px; }
.window__frame { display: block; width: 236px; height: 320px; border-radius: 118px; padding: 12px; background: #262B33; box-shadow: inset 0 0 0 1px #3A414B; }
.window__view { display: block; position: relative; width: 100%; height: 100%; border-radius: 108px; overflow: hidden; }
.window__name { font-family: var(--font-display); font-size: 24px; }
.window__desc { font-size: 14px; color: #A7ADB5; margin-top: -12px; }

.window__view--horizon { background: linear-gradient(180deg, #F4C9C4 0%, #FBDDC6 30%, #FFE6C2 52%, #7FB8CB 52.5%, #A9D3DF 72%, #D5EBF0 100%); }
.window__view--horizon .sun { background: radial-gradient(circle, #FFE3A8 0 55%, #FFC98A 100%); box-shadow: 0 0 30px 10px rgba(255,205,140,.6); }
.sun { position: absolute; left: 50%; top: 44%; width: 64px; height: 64px; margin-left: -32px; border-radius: 50%; background: #FBF1E6; opacity: .9; animation: rise 9s ease-in-out infinite alternate; }
.wave { position: absolute; height: 2px; background: rgba(255,255,255,.45); }
.wave--1 { left: 18%; right: 18%; top: 62%; }
.wave--2 { left: 28%; right: 28%; top: 70%; opacity: .7; }
@keyframes rise { from { transform: translateY(6px); } to { transform: translateY(-6px); } }

.window__view--passport {
  background-color: #F3ECDD;
  background-image:
    repeating-radial-gradient(circle at 0 0, transparent 0, transparent 14px, rgba(44,90,95,.10) 15px, transparent 16px),
    repeating-radial-gradient(circle at 100% 100%, transparent 0, transparent 14px, rgba(166,61,38,.08) 15px, transparent 16px);
}
.pp-kicker { position: absolute; inset: 74px 0 auto; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .2em; color: #5B5F66; }
.pp-country { position: absolute; inset: 92px 0 auto; font-family: 'Fraunces', serif; font-size: 30px; color: #1F2A36; }
.pp-stamp { position: absolute; left: 50%; top: 148px; width: 116px; margin-left: -58px; padding: 6px 0; border: 2px solid #A63D26; border-radius: 6px; transform: rotate(-8deg); font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; letter-spacing: .12em; color: #A63D26; }
.pp-round { position: absolute; left: 50%; top: 196px; width: 68px; height: 68px; margin-left: -34px; border: 2px dashed #2C5A5F; border-radius: 50%; transform: rotate(10deg); display: flex; align-items: center; justify-content: center; font-family: 'IBM Plex Mono', monospace; font-size: 9px; font-weight: 600; color: #2C5A5F; }

.window__view--night { background-color: #0A1020; background-image: radial-gradient(rgba(140,170,230,.22) 1px, transparent 1.5px); background-size: 14px 14px; }
.window__view--night svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.route { stroke: #7FD4FF; stroke-width: 2; stroke-dasharray: 4 6; animation: travel 3s linear infinite; }
.dot { fill: #7FD4FF; stroke: none; }
.dot--mid { fill: #FFC86B; }
.halo { stroke: #7FD4FF; stroke-opacity: .35; stroke-width: 2; }
@keyframes travel { to { stroke-dashoffset: -20; } }

@media (prefers-reduced-motion: reduce) {
  .sun, .route { animation: none; }
  .window { transition: none; }
  .cases__toggle, .cases__toggle::after { transition: none; }
}

/* ---------- 4. Screen 2: ask about your trip ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar, .ask, .app__foot { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }
.topbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.topbar__right { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.style-switch { position: relative; }
.style-button { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 1.5px solid var(--accent); border-radius: 22px; background: transparent; color: var(--accent); font-size: 14px; font-weight: 500; }
.style-button svg { width: 16px; height: 16px; }
.style-menu { position: absolute; right: 0; top: 52px; min-width: 180px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.15); z-index: 10; display: flex; flex-direction: column; }
.style-menu button { min-height: 44px; padding: 0 14px; text-align: left; background: transparent; border: 0; border-radius: 8px; }
.style-menu button:hover, .style-menu button[aria-current="true"] { background: var(--line-soft); }

.hint { position: absolute; right: 0; top: 56px; width: 280px; padding: 16px 18px; background: #1F2A36; color: #F3ECDD; border-radius: 10px; box-shadow: 0 12px 32px rgba(31,42,54,.25); z-index: 9; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.45; }
.hint::before { content: ""; position: absolute; right: 40px; top: -7px; width: 14px; height: 14px; background: #1F2A36; transform: rotate(45deg); }
.hint__ok { align-self: flex-end; height: 44px; padding: 0 18px; border: 1px solid #E9C987; border-radius: 22px; background: transparent; color: #E9C987; }

.ask { flex-grow: 1; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-top: 56px; padding-bottom: 40px; }
.ask__main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.eyebrow { margin: 0; font-family: var(--font-mono); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.ask__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 5.5vw, 60px); line-height: 1.05; letter-spacing: -.015em; }
.ask__lead { margin: 0; font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 560px; }

.trip { margin-top: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(31,42,54,.06); display: flex; flex-direction: column; }
.trip__label { padding: 18px 22px 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.trip textarea { padding: 10px 22px 18px; border: 0; background: transparent; resize: vertical; min-height: 110px; font-family: var(--font-display); font-size: 22px; line-height: 1.45; color: var(--ink); outline: none; }
.trip textarea::placeholder { color: var(--faint); opacity: .85; }
.trip__bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; border-top: 1px dashed var(--line); }
.spacer { flex-grow: 1; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: transparent; display: flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 18px; height: 18px; }
.ghost-btn { height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: transparent; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.ghost-btn svg { width: 16px; height: 16px; }
.primary-btn { height: 48px; padding: 0 24px; border-radius: 24px; border: 0; background: var(--btn-bg); color: var(--btn-ink); display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; }
.primary-btn svg { width: 16px; height: 16px; stroke-width: 1.6; }
.wait-note { margin: -8px 0 0; display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.wait-note svg { flex: none; width: 16px; height: 16px; margin-top: 2px; stroke: var(--accent); }
.soon { margin: 0; margin-top: 14px; padding: 12px 16px; border: 1.5px dashed var(--accent); border-radius: 10px; font-size: 15px; color: var(--ink); }

.examples { display: flex; flex-direction: column; gap: 12px; }
.examples__label { font-size: 14px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: transparent; font-size: 14px; text-align: left; }
.chip:hover { background: var(--line-soft); }

.traveller { flex: 1 1 340px; min-width: 0; position: relative; overflow: hidden; background: var(--panel-bg); color: var(--panel-ink); border-radius: calc(var(--radius) + 2px); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.traveller::before, .traveller::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid var(--panel-accent); opacity: .25; }
.traveller::before { right: -40px; top: -40px; width: 160px; height: 160px; }
.traveller::after { right: -10px; top: -10px; width: 100px; height: 100px; }
.traveller__kicker { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--panel-accent); }
.traveller__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.25; }
.traveller__grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.traveller__grid div { display: flex; flex-direction: column; gap: 4px; }
.traveller__grid dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--panel-muted); }
.traveller__grid dd { margin: 0; font-size: 16px; }
.outline-btn { align-self: flex-start; height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--panel-accent); background: transparent; color: var(--panel-accent); font-size: 14px; font-weight: 500; }
.traveller__note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--panel-muted); }
.traveller__view { display: flex; flex-direction: column; gap: 20px; }
.traveller__grid dd { overflow-wrap: anywhere; }
.traveller__grid dd.is-empty { color: var(--panel-muted); }
.traveller__saved { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--panel-accent); }
.traveller__saved svg { flex: none; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; }
.traveller__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.traveller__actions .outline-btn { align-self: auto; }
.link-btn { min-height: 44px; padding: 0 2px; border: 0; background: transparent; color: var(--panel-ink); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.solid-btn { height: 44px; padding: 0 22px; border-radius: 22px; border: 0; background: var(--panel-accent); color: var(--panel-bg); font-size: 14px; font-weight: 600; }

/* Traveller details form, inside the dark panel */
.tform { position: relative; display: flex; flex-direction: column; gap: 14px; }
.tform__row { display: flex; gap: 12px; }
.tform__row > .tform__field { flex: 1 1 0; min-width: 0; }
.tform__row > .tform__field--small { flex: 0 0 92px; }
.tform__field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.tform__field:not(.tform__choice) > label, .tform__field > legend { padding: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--panel-muted); }
.tform input[type=text], .tform input[type=number], .tform select {
  width: 100%; height: 44px; padding: 0 12px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--panel-ink) 35%, transparent);
  background: color-mix(in srgb, var(--panel-ink) 8%, transparent);
  color: var(--panel-ink); font-family: var(--font-text); font-size: 16px; /* 16px stops iPhone zooming in */
}
.tform select option { color: #1F2A36; background: #FFFFFF; }
.tform input::placeholder { color: var(--panel-muted); opacity: .8; }
.tform input:focus, .tform select:focus { outline: 2px solid var(--panel-accent); outline-offset: 1px; border-color: transparent; }
.tform__choice { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.tform__choice legend { width: 100%; margin-bottom: 6px; }
.tform__choice label { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--panel-ink) 35%, transparent); font-size: 14px; cursor: pointer; }
.tform__choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tform__choice label:has(input:checked) { background: var(--panel-accent); border-color: var(--panel-accent); color: var(--panel-bg); font-weight: 600; }
.tform__choice label:has(input:focus-visible) { outline: 2px solid var(--panel-accent); outline-offset: 2px; }
.tform__hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--panel-muted); }

/* Optional account (after the demo, phase 1) — inside the Traveller panel */
.acct { position: relative; display: flex; flex-direction: column; gap: 14px; padding-top: 20px; border-top: 1px solid color-mix(in srgb, var(--panel-ink) 22%, transparent); }
.acct__kicker { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--panel-accent); }
.acct__part { display: flex; flex-direction: column; gap: 14px; }
.acct__text, .acct__box p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--panel-ink); }
.acct__email { font-weight: 600; overflow-wrap: anywhere; }
.acct__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--panel-ink); cursor: pointer; }
.acct__consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--panel-accent); }
.acct__consent a { color: var(--panel-accent); }
.acct input[type=email], .acct .acct__code {
  height: 44px; padding: 0 12px; border-radius: 8px; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--panel-ink) 35%, transparent);
  background: color-mix(in srgb, var(--panel-ink) 8%, transparent);
  color: var(--panel-ink); font-family: var(--font-text); font-size: 16px;
}
.acct .acct__code { max-width: 180px; font-family: var(--font-mono); font-size: 20px; letter-spacing: .3em; }
.acct input:focus { outline: 2px solid var(--panel-accent); outline-offset: 1px; border-color: transparent; }
.acct input::placeholder { color: var(--panel-muted); opacity: .8; }
.acct__who { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--panel-accent); }
.acct__who > span { color: var(--panel-ink); }
.acct__who svg { flex: none; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; }
.acct__links { gap: 4px 18px; }
.acct__links .link-btn { font-size: 13px; }
.acct__box { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--panel-accent) 60%, transparent); background: color-mix(in srgb, var(--panel-accent) 10%, transparent); }
.acct__box--danger { border-color: #E07A62; background: rgba(224, 122, 98, .12); }
.danger-btn { height: 44px; padding: 0 20px; border-radius: 22px; border: 0; background: #C4492F; color: #FFFFFF; font-size: 14px; font-weight: 600; }
.acct__status { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45; color: var(--panel-ink); background: color-mix(in srgb, var(--panel-ink) 10%, transparent); }
.acct button:disabled { opacity: .55; cursor: wait; }

.app__foot { padding-bottom: 28px; display: flex; flex-direction: column; gap: 14px; }
.app__foot p { margin: 0; font-size: 13px; color: var(--faint); }
.app__foot .mrz { font-family: var(--font-mono); font-size: 15px; letter-spacing: .22em; color: var(--mrz); white-space: nowrap; overflow: hidden; }

/* ---------- 5. Phone layout ---------- */
/* Answer: a Passport page with stamps */
.answer { margin-top: 18px; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px 22px; box-shadow: 0 18px 40px rgba(31,42,54,.06); }
.answer__head { padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.answer__kicker { margin: 0 0 8px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.answer__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 3.4vw, 34px); line-height: 1.15; }
.answer__summary { margin: 12px 0 0; font-size: 18px; line-height: 1.55; color: var(--ink); }
.answer__body { font-size: 17px; line-height: 1.6; color: var(--ink); }
.answer__body > p:first-child { margin-top: 18px; }
.answer__body p { margin: 0 0 12px; }
.answer__body ol:not(.steps), .answer__body ul { margin: 0 0 12px; padding-left: 22px; }
.answer__body li { margin-bottom: 6px; }
.answer__body a { color: var(--accent); }
.answer__body h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 16px 0 8px; }

.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 18px; padding: 20px 0; border-bottom: 1px dashed var(--line); }
.step__stamp-wrap { padding-top: 2px; }
.stamp { display: inline-block; padding: 6px 10px; border: 2px solid currentColor; border-radius: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1.2; text-align: center; transform: rotate(-5deg); opacity: .92; }
.step--to_do .stamp { color: var(--stamp-todo); }
.step--not_needed .stamp { color: var(--stamp-ok); border-style: dashed; border-radius: 999px; transform: rotate(4deg); }
.step--check .stamp { color: var(--stamp-check); border-style: double; border-width: 3px; }
.step__title { margin: 0 0 6px !important; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.3; }
.step__details { margin: 0 0 8px; }
.step__source { margin: 0 !important; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.step__source a { color: var(--accent); word-break: break-word; }
/* Day 10 (F5): sources under text / refusal answers, same mono style as step sources */
.answer__sources { margin-top: 16px; }
.answer__sources ul { margin: 6px 0 0; padding-left: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.answer__sources li { margin: 2px 0; }
.answer__sources a { color: var(--accent); word-break: break-word; }
.app__foot .foot__links a, .choose__foot a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.note { margin-top: 18px; padding: 14px 18px; border-radius: 10px; background: color-mix(in srgb, var(--line-soft) 50%, transparent); border: 1px solid var(--line-soft); font-size: 15px; }
.note__label { margin: 0 0 6px !important; font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.note ul { margin: 0 !important; }
/* Similar situations: a bold coloured "case file" bar, folded by default,
   with past cases as archive-stamp cards inside */
.cases { margin-top: 26px; border-radius: 14px; border: 2px solid var(--stamp-ok); background: color-mix(in srgb, var(--stamp-ok) 6%, var(--card)); box-shadow: 0 10px 28px color-mix(in srgb, var(--stamp-ok) 22%, transparent); overflow: hidden; }
.cases__summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px 18px; cursor: pointer; list-style: none; background: var(--stamp-ok); color: var(--card); }
.cases__summary::-webkit-details-marker { display: none; }
.cases__summary:hover .cases__toggle { background: var(--card); color: var(--stamp-ok); }
.cases__summary:focus-visible { outline: 3px solid var(--accent); outline-offset: -5px; }
.cases__icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border: 3px double currentColor; border-radius: 50%; transform: rotate(-8deg); }
.cases__icon svg { width: 30px; height: 30px; }
.cases__head { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cases__label { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 23px; line-height: 1.2; }
.cases__count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--card); color: var(--stamp-ok); font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.cases__sub { font-size: 15px; line-height: 1.4; opacity: .92; }
.cases__minis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cases__mini { padding: 2px 8px; border: 1.5px dashed currentColor; border-radius: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; transform: rotate(-2deg); opacity: .9; }
.cases__mini:nth-child(2n) { transform: rotate(2deg); }
.cases__toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid currentColor; border-radius: 22px; font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.cases__toggle::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.cases[open] .cases__toggle::after { transform: rotate(-135deg) translate(-2px, -2px); }
.cases__hide, .cases[open] .cases__show { display: none; }
.cases[open] .cases__hide { display: inline; }
.cases[open] .cases__minis { display: none; }
.cases__body { padding: 16px 18px 6px; }
.cases__list { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 14px; }
.case { position: relative; margin: 0 !important; padding: 16px 92px 14px 18px; border: 1.5px solid color-mix(in srgb, var(--stamp-ok) 55%, transparent); border-radius: 10px; background: var(--card); font-size: 15px; line-height: 1.55; }
.case__stamp { position: absolute; top: 12px; right: 12px; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; border: 3px double var(--stamp-ok); border-radius: 50%; transform: rotate(-9deg); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em; line-height: 1.25; color: var(--stamp-ok); opacity: .85; }
.case__meta { margin: 0 0 4px !important; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.case__title { margin: 0 0 6px !important; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.3; }
.case__text, .case__line { margin: 0 0 6px !important; }
.case__key { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.case__link { margin: 8px 0 0 !important; font-family: var(--font-mono); font-size: 13px; }
.case__link a { color: var(--accent); word-break: break-word; }
.cases__note { margin: 14px 0 10px !important; font-size: 14px; font-style: italic; color: var(--muted); }
.answer .chips { margin-top: 8px; }
.answer__next { margin-top: 20px; }

.answer__foot { margin-top: 20px; padding-top: 14px; border-top: 1px dashed var(--line); }
.answer__disclaimer { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.answer__meta { margin: 8px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }

/* Conversation (Day 6 part B): question bubbles + answer cards, follow-up box */
.start, .conversation { display: flex; flex-direction: column; gap: 24px; }
.start[hidden], .conversation[hidden] { display: none; }
.conversation__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.conversation__label { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.conversation__bar .ghost-btn { color: var(--ink); }
.thread { display: flex; flex-direction: column; gap: 36px; }
.turn { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 16px; }
.turn .answer { margin-top: 0; }
.turn__q { align-self: flex-end; max-width: min(560px, 92%); padding: 12px 18px 14px; border-radius: 18px 18px 4px 18px; background: var(--btn-bg); color: var(--btn-ink); box-shadow: 0 8px 22px rgba(31,42,54,.10); }
.turn__label { margin: 0 0 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.turn__text { margin: 0; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.followup { margin-top: 4px; border-width: 1.5px; border-color: var(--accent); }
.followup textarea { min-height: 72px; font-size: 19px; }
.followup__tip { font-size: 13px; color: var(--faint); padding-left: 8px; }
#followup[hidden], #fu-wait[hidden] { display: none; }

/* Install the app (Day 8) */
.install { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-bottom: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 10px 28px rgba(31,42,54,.06); }
.install[hidden] { display: none; }
.install__icon { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.install__text { flex: 1 1 260px; min-width: 0; }
.app__foot .install__title { margin: 0 0 4px; font-family: var(--font-display); font-size: 20px; color: var(--ink); }
.app__foot .install__how { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.install__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.install__actions [hidden] { display: none; }
.install__actions .ghost-btn { text-decoration: none; }
/* Installed app on phones with a notch: keep content clear of the edges */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .app__foot { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
}

/* Voice input + file upload (Day 7) */
.icon-btn { position: relative; color: var(--ink); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.icon-btn.is-recording { width: auto; padding: 0 14px 0 12px; gap: 6px; border-color: var(--stamp-todo); background: var(--stamp-todo); color: #fff; }
.icon-btn.is-recording::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: rec-pulse 1s ease-in-out infinite; }
.rec-time { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.rec-time:empty { display: none; }
@keyframes rec-pulse { 50% { opacity: .25; } }
.ghost-btn { color: var(--ink); }
.ghost-btn svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.attachment { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 14px 12px; padding: 8px 8px 8px 12px; border: 1px dashed var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 6%, transparent); font-size: 14px; color: var(--ink); }
.attachment[hidden] { display: none; }
.attachment svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.4; }
.attachment__name { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }
.attachment__note { flex: 1 1 180px; font-size: 12px; color: var(--muted); }
.attachment__remove { width: 36px; height: 36px; border: 0; border-radius: 18px; background: transparent; color: var(--ink); font-size: 22px; line-height: 1; }
.attachment__remove:hover { background: var(--line-soft); }
.turn__file { margin: 6px 0 0; font-family: var(--font-mono); font-size: 12px; opacity: .8; overflow-wrap: anywhere; }

/* Night Map (Day 7, simple version): the steps become a glowing route with checkpoints */
[data-theme="night"] .steps { position: relative; }
[data-theme="night"] .steps::before { content: ""; position: absolute; left: 6px; top: 26px; bottom: 26px; width: 2px; background: linear-gradient(180deg, var(--accent), var(--stamp-ok) 60%, var(--stamp-check)); box-shadow: 0 0 10px rgba(127,212,255,.6); border-radius: 2px; }
[data-theme="night"] .step { position: relative; padding-left: 28px; }
[data-theme="night"] .step::before { content: ""; position: absolute; left: 0; top: 26px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bg); background: currentColor; color: var(--stamp-check); box-shadow: 0 0 0 3px rgba(255,200,107,.18), 0 0 12px currentColor; }
[data-theme="night"] .step--to_do::before { color: var(--stamp-todo); box-shadow: 0 0 0 3px rgba(255,154,138,.18), 0 0 12px currentColor; }
[data-theme="night"] .step--not_needed::before { color: var(--stamp-ok); box-shadow: 0 0 0 3px rgba(111,224,200,.18), 0 0 12px currentColor; }
[data-theme="night"] .answer { box-shadow: 0 0 0 1px rgba(127,212,255,.08), 0 24px 60px rgba(0,0,0,.45); }
[data-theme="night"] .stamp { transform: none; border-radius: 999px; box-shadow: 0 0 12px color-mix(in srgb, currentColor 35%, transparent); }

/* Horizon = Sea Sunrise (Day 7): the scene at the top of the page, light glassy cards, sea-blue panel.
   The sea is pale, so dark text stays readable on top of it (also on phones). */
[data-theme="horizon"] body {
  --sun-x: 58%; /* over the main column, clear of the Traveller page panel */
  background-color: #EEF6F8;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(ellipse 70px 150px at var(--sun-x) 345px, rgba(255,232,190,.85), rgba(255,232,190,0) 70%), /* sun path on the water */
    repeating-linear-gradient(180deg, rgba(255,255,255,0) 0 13px, rgba(255,255,255,.28) 13px 14px), /* shimmer lines */
    linear-gradient(180deg, rgba(0,0,0,0) 0 300px, #9ACCDA 300px, #B9DDE6 400px, #DCEEF2 520px, #EEF6F8 640px), /* sea */
    radial-gradient(circle at var(--sun-x) 300px, #FFF3D6 0 34px, #FFD99A 35px 46px, rgba(255,205,140,.55) 47px, rgba(255,190,140,0) 190px), /* sun */
    linear-gradient(180deg, #F3CFCB 0, #F9DDD0 140px, #FDE8D2 260px, #FFEFD6 300px); /* dawn sky */
  background-size: 100% 640px, 100% 150px, 100% 640px, 100% 300px, 100% 300px;
  background-position: 0 0, 0 310px, 0 0, 0 0, 0 0;
}
[data-theme="horizon"] .topbar { border-bottom-color: rgba(20,56,79,.12); }
[data-theme="horizon"] .ask__title, [data-theme="horizon"] .choose__title { font-weight: 500; letter-spacing: -.005em; }
[data-theme="horizon"] .ask__title em { color: var(--accent); }
[data-theme="horizon"] .eyebrow, [data-theme="horizon"] .answer__kicker, [data-theme="horizon"] .conversation__label { letter-spacing: .2em; font-weight: 600; }
[data-theme="horizon"] .trip, [data-theme="horizon"] .answer {
  background: rgba(255,255,255,.88); border-color: rgba(29,91,120,.16);
  box-shadow: 0 20px 50px rgba(20,56,79,.10); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
[data-theme="horizon"] .trip textarea { font-size: 25px; }
[data-theme="horizon"] .traveller { background: linear-gradient(170deg, #2A6F8F 0%, #1B4E6A 55%, #143C53 100%); box-shadow: 0 24px 60px rgba(20,56,79,.25); }
[data-theme="horizon"] .traveller::before, [data-theme="horizon"] .traveller::after { border-color: #FFD39A; opacity: .35; }
[data-theme="horizon"] .turn__q { background: #1D5B78; border-radius: 20px 20px 6px 20px; }
[data-theme="horizon"] .answer { overflow: hidden; }
[data-theme="horizon"] .answer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, #F2B6A6, #FFD39A 35%, #9ACCDA 70%, #1D5B78); }
[data-theme="horizon"] .answer__head { padding-top: 6px; }
[data-theme="horizon"] .answer__title { font-weight: 600; font-size: clamp(28px, 3.6vw, 38px); }
[data-theme="horizon"] .step__title { font-weight: 700; font-size: 21px; }
[data-theme="horizon"] .stamp { transform: none; border-width: 1.5px; border-radius: 999px; letter-spacing: .1em; }
[data-theme="horizon"] .step--not_needed .stamp { border-style: solid; background: rgba(31,111,104,.07); }
[data-theme="horizon"] .step--to_do .stamp { background: rgba(180,71,42,.07); }
[data-theme="horizon"] .step--check .stamp { border-style: solid; background: rgba(133,96,15,.07); }
[data-theme="horizon"] .step { border-bottom-style: solid; border-bottom-color: var(--line-soft); }
[data-theme="horizon"] .note { background: #F1F8FA; border-color: #D3E6EC; }
[data-theme="horizon"] .chip { background: rgba(255,255,255,.7); border-color: #C9DDE5; }
[data-theme="horizon"] .chip:hover { background: #FFFFFF; }

@media (prefers-reduced-motion: reduce) {
  .icon-btn.is-recording::before { animation: none; }
}
.primary-btn[disabled] { opacity: .6; cursor: wait; }

@media (max-width: 640px) {
  .choose__top, .choose__main, .choose__foot,
  .topbar, .ask, .app__foot { padding-left: 16px; padding-right: 16px; }
  .windows { gap: 24px; }
  .window__frame { width: 156px; height: 212px; border-radius: 78px; padding: 8px; }
  .window__view { border-radius: 70px; }
  .window__view--passport .pp-kicker { top: 44px; }
  .window__view--passport .pp-country { top: 58px; font-size: 22px; }
  .window__view--passport .pp-stamp { top: 98px; width: 96px; margin-left: -48px; font-size: 10px; }
  .window__view--passport .pp-round { top: 134px; width: 50px; height: 50px; margin-left: -25px; font-size: 7px; }
  .brand__name { font-size: 19px; }
  .topbar { padding-top: 12px; padding-bottom: 12px; }
  .ask { padding-top: 28px; gap: 28px; }
  .trip textarea { font-size: 19px; }
  .primary-btn { width: 100%; justify-content: center; }
  .answer { padding: 22px 18px 18px; }
  .turn__q { max-width: 100%; }
  [data-theme="horizon"] body { --sun-x: 80%; }
  [data-theme="horizon"] .trip textarea { font-size: 21px; }
  .followup__tip { display: none; }
  .conversation__bar .ghost-btn { min-height: 44px; }
  .step { grid-template-columns: 1fr; gap: 10px; }
  .case { padding: 14px 14px 12px; }
  .cases__summary { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; }
  .cases__icon { width: 46px; height: 46px; }
  .cases__icon svg { width: 24px; height: 24px; }
  .cases__label { font-size: 20px; }
  .cases__toggle { grid-column: 1 / -1; justify-content: center; }
  .cases__body { padding: 12px 12px 4px; }
  .case__stamp { position: static; float: right; width: 52px; height: 52px; margin: 0 0 6px 10px; font-size: 10px; }
  .hint { left: 0; right: auto; width: min(280px, calc(100vw - 32px)); }
  .hint::before { left: 40px; right: auto; }
  .style-menu { left: 0; right: auto; }
}
