/* ==========================================================================
   Altier design system — tokens, base, chrome, controls, motion.
   One accent (cobalt), one line motif (the route arc), day and night.
   ========================================================================== */

@font-face {
  font-family: "Instrument Sans";
  src: url("./fonts/instrument-sans-latin-wght.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("./fonts/instrument-sans-latin-ext-wght.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  /* Surfaces */
  --bg: #f4f7fb;
  --bg-deep: #e9eff7;
  --surface: #ffffff;
  --surface-2: #eef3f9;
  --surface-3: #e4ecf6;
  --glass: rgba(246, 250, 255, .74);
  --glass-strong: rgba(250, 252, 255, .9);
  --glass-line: rgba(255, 255, 255, .7);
  /* Ink */
  --ink: #0a1b33;
  --ink-2: #344a64;
  --ink-3: #66798f;
  --ink-inverse: #f3f8ff;
  /* Lines */
  --line: #dce5ef;
  --line-strong: #c4d2e2;
  /* Brand */
  --accent: #1265ee;
  --accent-ink: #0a4fc4;
  --accent-soft: #e5efff;
  --accent-tint: rgba(18, 101, 238, .1);
  --accent-glow: rgba(18, 101, 238, .32);
  --sky: #7ab3ff;
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --night: #050e1b;
  /* Status */
  --success: #0c8a5b; --success-soft: #e3f5ec;
  --warn: #9a6512; --warn-soft: #fbf1df;
  --danger: #c93445; --danger-soft: #fdebed;
  /* Shape */
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 30px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(10, 27, 51, .05), 0 4px 14px rgba(10, 27, 51, .04);
  --shadow-2: 0 2px 6px rgba(10, 27, 51, .05), 0 18px 44px -18px rgba(10, 27, 51, .2);
  --shadow-3: 0 30px 90px -28px rgba(8, 26, 54, .38), 0 8px 24px -12px rgba(8, 26, 54, .16);
  /* Type */
  --font: "Instrument Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-zh: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Instrument Sans", sans-serif;
  --fs-xs: .78rem; --fs-sm: .875rem; --fs-base: 1rem; --fs-md: 1.125rem; --fs-lg: 1.375rem;
  --fs-xl: clamp(1.6rem, 2.6vw, 2rem); --fs-2xl: clamp(2.1rem, 4vw, 3.1rem);
  --fs-display: clamp(3rem, 7vw, 6.6rem);
  /* Motion: press feels instant, everything else glides. */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --ease-soft: cubic-bezier(.22, 1, .36, 1);
  --d-press: 140ms; --d-quick: 260ms; --d-ui: 480ms; --d-step: 820ms; --d-scene: 1400ms;
  /* Layout */
  --gutter: clamp(16px, 3.4vw, 40px);
  --max: 1400px;
  --header-h: 76px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050d19;
  --bg-deep: #030912;
  --surface: #0b1728;
  --surface-2: #0f1f35;
  --surface-3: #152a45;
  --glass: rgba(10, 22, 40, .66);
  --glass-strong: rgba(11, 23, 42, .9);
  --glass-line: rgba(140, 180, 235, .16);
  --ink: #eaf1fb;
  --ink-2: #b5c5d9;
  --ink-3: #8597ae;
  --ink-inverse: #071224;
  --line: #1b2d46;
  --line-strong: #29425f;
  --accent: #4b92ff;
  --accent-ink: #8bbcff;
  --accent-soft: rgba(75, 146, 255, .14);
  --accent-tint: rgba(75, 146, 255, .12);
  --accent-glow: rgba(75, 146, 255, .42);
  --sky: #9cc7ff;
  --success: #4fd29b; --success-soft: rgba(79, 210, 155, .12);
  --warn: #f0bd62; --warn-soft: rgba(240, 189, 98, .12);
  --danger: #ff7a87; --danger-soft: rgba(255, 122, 135, .12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .2);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 18px 44px -18px rgba(0, 0, 0, .6);
  --shadow-3: 0 30px 90px -28px rgba(0, 0, 0, .75), 0 8px 24px -12px rgba(0, 0, 0, .5);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; overflow-x: clip;
  color: var(--ink); background: var(--bg);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.55;
  font-feature-settings: "ss01", "cv11"; font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--d-ui) var(--ease-soft), color var(--d-ui) var(--ease-soft);
}
html[lang="zh-CN"] body { font-family: var(--font-zh); line-height: 1.7; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
button, a, input, select, textarea, label { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.028em; line-height: 1.08; text-wrap: balance; }
html[lang="zh-CN"] h1, html[lang="zh-CN"] h2, html[lang="zh-CN"] h3 { letter-spacing: 0; line-height: 1.22; font-weight: 600; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--accent-glow); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand-word { font-family: "Bangla MN", var(--font); font-weight: 600; letter-spacing: -.02em; }
.skip-link {
  position: fixed; z-index: 400; top: 10px; left: 10px; padding: .7rem 1rem; border-radius: var(--r-sm);
  color: var(--ink-inverse); background: var(--ink); text-decoration: none; transform: translateY(-160%);
  transition: transform var(--d-quick) var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 1.5rem;
  height: var(--header-h); padding: 0 var(--gutter);
  transition: background-color var(--d-ui) var(--ease-soft), box-shadow var(--d-ui) var(--ease-soft), height var(--d-ui) var(--ease-soft);
}
.site-header.is-condensed {
  --header-h: 64px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px);
}
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; text-decoration: none; }
/* Only the header logo is shared across pages; names must be unique per page. */
.site-header .brand, .planner-bar .brand { view-transition-name: altier-brand; }
.brand-logo { width: 112px; height: 56px; object-fit: contain; transition: width var(--d-ui) var(--ease-soft); }
.site-header.is-condensed .brand-logo { width: 98px; }
.logo-night { display: none; }
html[data-theme="dark"] .logo-day { display: none; }
html[data-theme="dark"] .logo-night { display: block; }
.site-nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.site-nav a {
  position: relative; padding: .55rem .85rem; border-radius: var(--r-pill);
  color: var(--ink-2); font-size: var(--fs-sm); font-weight: 560; text-decoration: none; white-space: nowrap;
  transition: color var(--d-quick) ease, background-color var(--d-quick) ease;
}
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .site-nav a:hover { color: var(--ink); background: var(--accent-tint); } }
.header-tools { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.site-nav + .header-tools { margin-left: .5rem; }
.header-tools:first-child, .brand + .header-tools { margin-left: auto; }

/* Language toggle: a two-position switch with a sliding thumb. */
.language-button {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; align-items: center;
  width: 78px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); font-size: .78rem; font-weight: 650; line-height: 1; isolation: isolate;
  transition: border-color var(--d-quick) ease, background-color var(--d-ui) var(--ease-soft);
}
.language-button span { position: relative; z-index: 1; display: grid; place-items: center; height: 100%; color: var(--ink-3); transition: color var(--d-ui) var(--ease-out); }
.language-button span:last-child { font-family: var(--font-zh); }
.language-button::before {
  content: ""; position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: var(--r-pill); background: var(--ink); box-shadow: 0 2px 8px rgba(10, 27, 51, .18);
  transition: transform var(--d-ui) var(--ease-out), background-color var(--d-ui) ease;
}
.language-button[data-lang="en"] span:first-child, .language-button[data-lang="zh"] span:last-child { color: var(--ink-inverse); }
.language-button[data-lang="zh"]::before { transform: translateX(100%); }
.language-button:active::before { transform: scaleX(.92); }
.language-button[data-lang="zh"]:active::before { transform: translateX(100%) scaleX(.92); }

/* Theme toggle: the sun's rays retract and a shadow slides across to make the moon. */
.theme-toggle, .icon-button {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  transition: border-color var(--d-quick) ease, background-color var(--d-ui) var(--ease-soft), transform var(--d-press) var(--ease-out);
}
.theme-toggle:active, .icon-button:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover, .icon-button:hover, .language-button:hover { border-color: var(--line-strong); }
}
.theme-icon { width: 20px; height: 20px; overflow: visible; }
.theme-icon .sun-core { transition: r var(--d-step) var(--ease-out); }
.theme-icon .sun-rays { transform-origin: 12px 12px; transition: transform var(--d-step) var(--ease-out), opacity var(--d-ui) var(--ease-out); }
.theme-icon .moon-shadow { transition: cx var(--d-step) var(--ease-out), cy var(--d-step) var(--ease-out); }
html[data-theme="dark"] .theme-icon .sun-core { r: 8px; }
html[data-theme="dark"] .theme-icon .sun-rays { transform: rotate(90deg) scale(.4); opacity: 0; }
html[data-theme="dark"] .theme-icon .moon-shadow { cx: 17px; cy: 7px; }

/* Mobile menu */
.menu-button { display: none; }
.menu-button svg line { transform-origin: 12px 12px; transition: transform var(--d-ui) var(--ease-out), opacity var(--d-quick) ease; }
.menu-button[aria-expanded="true"] svg line:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-button[aria-expanded="true"] svg line:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
.mobile-menu {
  position: fixed; z-index: 190; inset: 0; display: flex; flex-direction: column; gap: .25rem;
  padding: calc(var(--header-h) + 12px) var(--gutter) 2rem; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
}
.mobile-menu a {
  padding: .9rem .25rem; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 1.6rem; font-weight: 560;
  letter-spacing: -.02em; text-decoration: none;
}
html.motion-ok .mobile-menu:not([hidden]) { animation: menu-in var(--d-ui) var(--ease-out) both; }
html.motion-ok .mobile-menu:not([hidden]) a { animation: rise-in var(--d-step) var(--ease-out) both; }
html.motion-ok .mobile-menu a:nth-child(2) { animation-delay: 50ms; }
html.motion-ok .mobile-menu a:nth-child(3) { animation-delay: 100ms; }
html.motion-ok .mobile-menu a:nth-child(4) { animation-delay: 150ms; }
html.motion-ok .mobile-menu a:nth-child(5) { animation-delay: 200ms; }
@keyframes menu-in { from { opacity: 0; } }

/* ---------- Account menu ---------- */
.account-menu { position: relative; }
.account-trigger {
  display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 .9rem 0 .7rem;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  font-size: var(--fs-sm); font-weight: 600;
  transition: border-color var(--d-quick) ease, background-color var(--d-ui) var(--ease-soft), transform var(--d-press) var(--ease-out);
}
.account-trigger:active { transform: scale(.96); }
.account-trigger svg { width: 18px; height: 18px; }
.account-avatar {
  display: grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), #6aa8ff); color: #fff; font-size: .7rem; font-weight: 700;
}
.account-trigger .account-avatar { margin-left: -.3rem; }
@media (hover: hover) and (pointer: fine) { .account-trigger:hover { border-color: var(--line-strong); } }
.account-dropdown {
  position: absolute; z-index: 260; top: calc(100% + 10px); right: 0; width: min(290px, calc(100vw - 24px));
  padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: var(--shadow-3); transform-origin: top right;
  transition: opacity var(--d-quick) var(--ease-out), transform var(--d-ui) var(--ease-out), visibility 0s linear var(--d-ui);
}
.account-dropdown[data-state="closed"] { opacity: 0; transform: translateY(-6px) scale(.96); visibility: hidden; pointer-events: none; }
.account-dropdown[data-state="open"] { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.account-dropdown a, .account-dropdown button {
  display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 40px; padding: .5rem .7rem;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); text-align: left; text-decoration: none;
  font-size: var(--fs-sm); font-weight: 520; transition: background-color 160ms ease, color 160ms ease;
}
.account-dropdown a svg, .account-dropdown button svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .account-dropdown a:hover, .account-dropdown button:hover { background: var(--accent-tint); color: var(--ink); } }
.account-kicker { display: flex; align-items: center; gap: .7rem; padding: .7rem .7rem .8rem; }
.account-kicker strong { display: block; font-size: var(--fs-sm); }
.account-kicker small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }
.account-kicker .account-avatar { width: 34px; height: 34px; margin: 0; font-size: .82rem; }
.account-separator { height: 1px; margin: 5px 8px; background: var(--line); }
html.motion-ok .account-dropdown[data-state="open"] > * { animation: rise-in var(--d-ui) var(--ease-out) both; }
html.motion-ok .account-dropdown[data-state="open"] > :nth-child(n+2) { animation-delay: 30ms; }
html.motion-ok .account-dropdown[data-state="open"] > :nth-child(n+5) { animation-delay: 60ms; }
html.motion-ok .account-dropdown[data-state="open"] > :nth-child(n+8) { animation-delay: 90ms; }

/* ---------- Buttons ---------- */
.button {
  --button-bg: var(--accent); --button-ink: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: 0 1.35rem; border: 0; border-radius: var(--r-pill);
  background: var(--button-bg); color: var(--button-ink); font-size: .95rem; font-weight: 600; letter-spacing: -.005em;
  text-decoration: none; white-space: nowrap; isolation: isolate; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 10px 26px -10px var(--accent-glow);
  transition: transform var(--d-press) var(--ease-out), box-shadow var(--d-ui) var(--ease-soft), background-color var(--d-quick) ease, opacity var(--d-quick) ease;
}
.button::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .26) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 900ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .button:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 16px 34px -12px var(--accent-glow); }
  .button:hover::after { transform: translateX(120%); }
}
.button:active:not(:disabled) { transform: scale(.97); }
.button:disabled { opacity: .5; box-shadow: none; }
.button svg { width: 18px; height: 18px; flex: 0 0 18px; }
.button-ghost {
  --button-bg: transparent; --button-ink: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
@media (hover: hover) and (pointer: fine) { .button-ghost:hover { --button-bg: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--line-strong); } }
.button-dark { --button-bg: var(--ink); --button-ink: var(--ink-inverse); box-shadow: 0 12px 28px -14px rgba(5, 14, 27, .55); }
.button-small { min-height: 38px; padding: 0 1rem; font-size: var(--fs-sm); }
.button-large { min-height: 56px; padding: 0 1.75rem; font-size: 1.02rem; }
.link-button {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: 0 .3rem; border: 0; background: none;
  color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 600; text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 calc(100% - 9px);
  transition: background-size var(--d-ui) var(--ease-out), color var(--d-quick) ease;
}
@media (hover: hover) and (pointer: fine) { .link-button:hover { background-size: 100% 1px; } }
.link-button:disabled { color: var(--ink-3); }

/* ---------- Form controls ---------- */
.field { display: grid; align-content: start; gap: .4rem; min-width: 0; }
.field > span, .field-label, .field > label {
  color: var(--ink-2); font-size: .82rem; font-weight: 600; letter-spacing: .005em;
}
.field small, .field-hint { color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.5; }
.field-error { margin: 0; color: var(--danger); font-size: var(--fs-xs); font-weight: 600; }
html.motion-ok .field-error { animation: rise-in var(--d-ui) var(--ease-out) both; }
.input, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; min-height: 50px; padding: .75rem .95rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 1rem; outline: none;
  transition: border-color var(--d-quick) ease, box-shadow var(--d-ui) var(--ease-out), background-color var(--d-ui) var(--ease-soft);
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.field select {
  appearance: none; padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2366798f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 18px;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint);
}
.field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .85; }
input[type="date"] { min-height: 50px; }
.check-field { display: flex; align-items: flex-start; gap: .75rem; color: var(--ink-2); font-size: var(--fs-sm); cursor: pointer; }
.check-field input {
  appearance: none; flex: 0 0 22px; width: 22px; height: 22px; margin: 1px 0 0; border: 1.5px solid var(--line-strong); border-radius: 7px;
  background: var(--surface); display: grid; place-items: center; cursor: pointer;
  transition: background-color var(--d-quick) ease, border-color var(--d-quick) ease, transform var(--d-press) var(--ease-out);
}
.check-field input::after {
  content: ""; width: 11px; height: 6px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(.4); opacity: 0;
  transition: transform var(--d-ui) var(--ease-out), opacity var(--d-quick) ease;
}
.check-field input:checked { background: var(--accent); border-color: var(--accent); }
.check-field input:checked::after { opacity: 1; transform: translateY(-1px) rotate(-45deg) scale(1); }
.check-field input:active { transform: scale(.9); }

/* ---------- Chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice-button, .chip {
  position: relative; display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: 0 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 560; white-space: nowrap;
  transition: background-color var(--d-ui) var(--ease-out), border-color var(--d-ui) var(--ease-out), color var(--d-ui) var(--ease-out),
    box-shadow var(--d-ui) var(--ease-out), transform var(--d-press) var(--ease-out);
}
.choice-button::before {
  content: ""; width: 0; height: 7px; border-radius: 50%; background: currentColor; opacity: 0; margin-right: -.45rem;
  transition: width var(--d-ui) var(--ease-out), opacity var(--d-ui) var(--ease-out), margin var(--d-ui) var(--ease-out);
}
.choice-button[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent); color: #fff;
  box-shadow: 0 8px 20px -10px var(--accent-glow);
}
.choice-button[aria-pressed="true"]::before { width: 7px; opacity: 1; margin-right: 0; }
.choice-button:active:not(:disabled) { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) {
  .choice-button:not([aria-pressed="true"]):hover { border-color: var(--accent); color: var(--ink); background: var(--accent-tint); }
}
.choice-button.is-primary { background: var(--ink); border-color: var(--ink); color: var(--ink-inverse); }

/* ---------- Notices ---------- */
.notice {
  display: grid; gap: .3rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-sm);
}
.notice strong { color: var(--ink); }
.notice ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.notice.is-error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.notice.is-error strong { color: var(--danger); }
.notice.is-warning { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.notice.is-success { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-soft); }
html.motion-ok .notice { animation: rise-in var(--d-ui) var(--ease-out) both; }
html.motion-ok .notice.is-error { animation: rise-in var(--d-ui) var(--ease-out) both, nudge 420ms var(--ease-out) 120ms; }
@keyframes nudge { 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }

/* ---------- Footer ---------- */
.site-footer {
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; align-items: end;
  padding: 3.5rem var(--gutter) 2.5rem; border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--fs-sm);
}
.site-footer .brand-logo { width: 104px; height: 52px; }
.site-footer p { max-width: 46ch; margin-top: .6rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .footer-links a:hover { color: var(--accent-ink); } }
.footer-legal { grid-column: 1 / -1; font-size: var(--fs-xs); }

/* ---------- Shared motifs ---------- */
.star-mark { display: inline-block; width: 1em; height: 1em; color: var(--accent); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.1rem;
  color: var(--accent-ink); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em;
}
.eyebrow .star-mark { width: 14px; height: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 28px; padding: 0 .7rem; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 650;
}

/* ---------- Motion primitives ---------- */
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.72) rotate(45deg); opacity: .7; } }

/* Elements that enter on load or scroll. Hidden only when motion is on and JS is booting. */
html.motion-ok [data-enter] { opacity: 0; transform: translateY(18px); filter: blur(8px); }
html.motion-ok [data-enter].is-in {
  opacity: 1; transform: none; filter: none;
  transition: opacity 900ms var(--ease-out), transform 1100ms var(--ease-out), filter 900ms var(--ease-out);
  transition-delay: var(--enter-delay, 0ms);
}
html:not(.is-booting).motion-ok [data-enter]:not(.is-in) { animation: enter-failsafe 0s 2.4s forwards; }
@keyframes enter-failsafe { to { opacity: 1; transform: none; filter: none; } }

/* Cross-document page transitions (Chromium, Safari 18.2+). */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 760ms; animation-timing-function: var(--ease-soft); }
::view-transition-old(root) { animation: vt-out 420ms var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in 760ms var(--ease-out) 80ms both; }
::view-transition-group(altier-prompt) { animation-duration: 900ms; animation-timing-function: var(--ease-in-out); }
::view-transition-old(altier-prompt), ::view-transition-new(altier-prompt) { animation-duration: 900ms; height: 100%; object-fit: cover; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
/* Same-document transitions: theme grows as a circle from the toggle; language crossfades. */
html.vt-theme *, html.vt-theme *::before, html.vt-theme *::after { transition: none !important; }
html:is(.vt-theme, .vt-lang) :is(.brand, .prompt-box, .planner-stage) { view-transition-name: none !important; }
html.vt-theme::view-transition-old(root) { animation: none; }
html.vt-theme::view-transition-new(root) { animation: theme-reveal 980ms var(--ease-in-out) both; }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--vt-x, 90%) var(--vt-y, 0)); }
  to { clip-path: circle(150vmax at var(--vt-x, 90%) var(--vt-y, 0)); }
}
html.vt-lang::view-transition-old(root) { animation: lang-out 360ms ease both; }
html.vt-lang::view-transition-new(root) { animation: lang-in 640ms var(--ease-out) 80ms both; }
@keyframes lang-out { to { opacity: 0; filter: blur(6px); } }
@keyframes lang-in { from { opacity: 0; filter: blur(6px); } }
html.page-leaving body { opacity: 0; transform: translateY(-6px); transition: opacity 260ms ease, transform 260ms ease; }

/* ---------- Responsive chrome ---------- */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .menu-button { display: grid; }
  .header-tools { margin-left: auto; }
}
@media (max-width: 520px) {
  :root { --header-h: 64px; }
  .brand-logo { width: 92px; height: 46px; }
  .header-tools { gap: .35rem; }
  .account-trigger { width: 38px; padding: 0; justify-content: center; }
  .account-trigger .account-trigger-label { display: none; }
  .account-trigger .account-avatar { margin: 0; }
  .language-button { width: 68px; }
  .site-footer { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion: keep fades that explain change, drop travel. ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 200ms !important; animation-delay: 0ms !important; transition-duration: 160ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 200ms !important; }
  .button::after { display: none; }
}

@keyframes draw-line { to { stroke-dashoffset: 0; } }

/* ---------- Boarding pass (My trips, receipt) ---------- */
.pass {
  --notch: 14px;
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 180px;
  border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-3); overflow: hidden;
  -webkit-mask: radial-gradient(circle var(--notch) at calc(100% - 180px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at calc(100% - 180px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle var(--notch) at calc(100% - 180px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at calc(100% - 180px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.pass-main { padding: clamp(1.4rem, 3vw, 2.2rem); }
.pass-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pass-brand { color: var(--accent-ink); font-family: "Bangla MN", var(--font); font-size: 1.15rem; font-weight: 650; }
.pass-tag { padding: .25rem .65rem; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 650; }
.pass-route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(.8rem, 2vw, 1.6rem); margin: 1.6rem 0 1.4rem; }
.pass-city b { display: block; font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 650; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.pass-city small { display: block; margin-top: .35rem; color: var(--ink-3); font-size: var(--fs-sm); }
.pass-city-end { text-align: right; }
.pass-path svg { width: 100%; height: auto; overflow: visible; }
.pass-path path:first-child { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: .015 .02; }
.pass-plane { fill: var(--accent); transform-box: fill-box; transform-origin: center; }
html.motion-ok .pass.is-in .pass-plane, html.motion-ok .pass.is-printed .pass-plane { animation: twinkle 4.8s var(--ease-in-out) infinite; }
.pass-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; padding-top: 1.2rem; border-top: 1px dashed var(--line-strong); }
.pass-meta dt { color: var(--ink-3); font-size: var(--fs-xs); }
.pass-meta dd { margin: .2rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pass-notice { margin-top: 1.2rem; color: var(--ink-3); font-size: var(--fs-xs); }
.pass-stub {
  display: grid; align-content: center; justify-items: center; gap: .8rem; padding: 1.4rem;
  border-left: 2px dashed var(--line-strong); background: linear-gradient(180deg, var(--accent-soft), transparent);
}
.pass-barcode {
  width: 100%; height: 86px; border-radius: 6px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 13px);
  opacity: .82;
}
.pass-stub-ref { font-size: var(--fs-sm); font-weight: 650; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
@media (max-width: 680px) {
  .pass { grid-template-columns: 1fr; -webkit-mask: none; mask: none; }
  .pass-stub { grid-template-columns: 1fr auto; border-left: 0; border-top: 2px dashed var(--line-strong); }
  .pass-barcode { height: 44px; }
  .pass-meta { grid-template-columns: 1fr 1fr; }
}
