/* Swapped — styles. System fonts only, no external assets. */
:root {
  --x-bg: #f5f5f7; --x-card: #fff; --x-text: #1d1d1f; --x-muted: #6e6e73; --x-line: rgba(0,0,0,.1);
  --x-blue: #0066cc; --x-red: #ff3b30; --x-orange: #ff9500; --x-green: #34c759;
  --x-red-ink: #b8000d; --x-orange-ink: #8f4000; --x-green-ink: #1a6b2e; --x-grey-ink: #515154; --x-hero-ink: #c93400;
  --x-red-tint: #ffe5e3; --x-orange-tint: #fff0db; --x-green-tint: #e3f7e8; --x-grey-tint: #e8e8ed; --x-tab-on: #e8e8ed;
  --x-head: rgba(245,245,247,.72); --x-seg: rgba(118,118,128,.12);
  --x-shadow: none;
  --x-r: 12px; --x-ease: cubic-bezier(.25,.1,.25,1);
  --x-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --x-bg: #000; --x-card: #1c1c1e; --x-text: #f5f5f7; --x-muted: #98989d; --x-line: rgba(255,255,255,.1);
    --x-blue: #2997ff; --x-red-ink: #ff8a82; --x-orange-ink: #ffc066; --x-green-ink: #5fe07a; --x-grey-ink: #c7c7cc; --x-hero-ink: #ff9f0a;
    --x-red-tint: #3a1715; --x-orange-tint: #3a2a10; --x-green-tint: #15301c; --x-grey-tint: #2c2c2e; --x-tab-on: #3a3a3c;
    --x-head: rgba(22,22,23,.72); --x-seg: rgba(118,118,128,.24); --x-shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--x-bg); color: var(--x-text); font-family: var(--x-font); font-size: 17px; line-height: 1.47; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--x-blue); outline-offset: 2px; border-radius: 10px; }
a { color: var(--x-blue); text-decoration: none; }
svg { display: block; }

/* header */
.x-head { position: sticky; top: 0; z-index: 20; background: var(--x-head); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--x-line); }
.x-head__in { max-width: 1000px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; min-height: 52px; }
.x-brand { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; }
.x-logo { width: 30px; height: 30px; border-radius: 8px; background: var(--x-text); color: var(--x-bg); display: grid; place-items: center; flex: none; }
.x-brand b { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.x-brand small { display: block; font-size: 12px; color: var(--x-muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* nav: bottom tabs on mobile, top on desktop */
.x-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--x-head); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--x-line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.x-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--x-muted); min-height: 48px; justify-content: center; transition: color .2s var(--x-ease); }
.x-tab[aria-current="page"] { color: var(--x-blue); }
@media (min-width: 760px) {
  .x-tabs { position: static; background: none; border: 0; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; gap: 4px; margin-left: auto; }
  .x-tab { flex: none; flex-direction: row; gap: 6px; font-size: 14px; font-weight: 400; padding: 0 12px; min-height: 44px; color: var(--x-text); }
  .x-tab svg { display: none; }
  .x-tab[aria-current="page"] { color: var(--x-blue); font-weight: 600; }
  .x-tab:hover { color: var(--x-blue); }
  }

/* layout */
.x-main { max-width: 1000px; margin: 0 auto; padding: 20px 20px calc(110px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) { .x-main { padding: 36px 24px 80px; } }
.x-view { display: none; animation: x-in .35s var(--x-ease); }
.x-view.is-on { display: block; }
@keyframes x-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .x-view, .x-card, .x-toast, .x-sheet__panel { animation: none !important; transition: none !important; } }
.x-h1 { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; margin: 0 0 6px; }
.x-h2 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; margin: 32px 0 12px; }
.x-sub { color: var(--x-muted); margin: 0 0 20px; font-size: 15px; }
.x-section-label { font-size: 15px; font-weight: 600; color: var(--x-text); margin: 28px 4px 8px; }

/* search */
.x-search { position: relative; margin-bottom: 18px; }
.x-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--x-muted); pointer-events: none; }
.x-search input { width: 100%; font: inherit; font-size: 17px; color: var(--x-text); background: var(--x-seg); border: 0; border-radius: 10px; padding: 13px 44px 13px 42px; min-height: 48px; outline: none; transition: background .2s var(--x-ease), box-shadow .2s var(--x-ease); -webkit-appearance: none; }
.x-search input::placeholder { color: var(--x-muted); }
.x-search input:focus { background: var(--x-card); box-shadow: 0 0 0 3px rgba(0,113,227,.35); }
.x-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: none; place-items: center; color: var(--x-muted); }
.x-clear.is-on { display: grid; }

/* location + hero stat */
.x-loc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--x-muted); margin: 0 0 14px; }
.x-loc svg { color: var(--x-blue); }
.x-loc strong { color: var(--x-text); font-weight: 500; }
.x-link { color: var(--x-blue); font-size: 15px; min-height: 44px; padding: 0 4px; }
.x-link:hover { text-decoration: underline; }
.x-hero__text { font-size: 28px; line-height: 1.18; font-weight: 700; letter-spacing: -.022em; margin: 4px 0 8px; max-width: 26ch; }
@media (min-width: 760px) { .x-hero__text { font-size: 34px; } }

/* cards */
.x-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .x-grid { grid-template-columns: 1fr 1fr; gap: 18px; } }
.x-card { display: block; width: 100%; background: var(--x-card); border-radius: var(--x-r); box-shadow: var(--x-shadow); padding: 18px 20px; transition: box-shadow .15s var(--x-ease); }
button.x-card:hover { box-shadow: inset 0 0 0 999px rgba(118,118,128,.05); }
button.x-card:active { box-shadow: inset 0 0 0 999px rgba(118,118,128,.12); }
.x-cc__top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--x-muted); margin-bottom: 14px; }
.x-cc__top b { color: var(--x-text); font-weight: 600; }
.x-cc__row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; }
.x-cc__no { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.x-cc__route { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; white-space: nowrap; }
.x-cc__time { font-size: 13px; color: var(--x-muted); }
.x-off .x-cc__no, .x-off .x-cc__route { text-decoration: line-through; text-decoration-color: var(--x-red); text-decoration-thickness: 2px; color: var(--x-muted); }
.x-cc__arrow { color: var(--x-muted); padding-top: 34px; }
.x-cc__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--x-line); margin-top: 16px; padding-top: 12px; font-size: 13px; color: var(--x-muted); }
.x-cc__foot svg { color: var(--x-muted); }
@media (max-width: 380px) { .x-cc__route { font-size: 21px; } }

/* inline status text with glyph */
.x-st { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 1.3; }
.x-st svg { flex: none; }
.x-st + .x-st { margin-left: 8px; }
.x-st--red { color: var(--x-red-ink); }
.x-st--orange { color: var(--x-orange-ink); }
.x-st--green { color: var(--x-green-ink); }
.x-st--grey { color: var(--x-muted); }
.x-stline { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 2px 0; }

/* segmented control + date strip */
.x-seg { display: flex; max-width: 320px; background: var(--x-seg); border-radius: 8px; padding: 2px; margin: 4px 0 14px; }
.x-seg button { flex: 1; text-align: center; min-height: 32px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 500; transition: background .2s var(--x-ease); }
.x-seg button[aria-pressed="true"] { background: var(--x-card); font-weight: 600; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
@media (prefers-color-scheme: dark) { .x-seg button[aria-pressed="true"] { background: #636366; } }
.x-dates { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 8px; padding: 4px 20px 10px; scroll-snap-type: x mandatory; border-bottom: 1px solid var(--x-line); }
.x-dates::-webkit-scrollbar { display: none; }
.x-date { flex: none; scroll-snap-align: start; min-width: 48px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px 6px; }
.x-date small { font-size: 12px; color: var(--x-muted); font-weight: 400; }
.x-date b { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; font-weight: 400; transition: background .2s var(--x-ease), color .2s var(--x-ease); }
.x-date[aria-pressed="true"] b { background: var(--x-blue); color: #fff; font-weight: 600; }
.x-date[aria-pressed="true"] small { color: var(--x-text); font-weight: 600; }

/* grouped list (iOS inset style) */
.x-list { background: var(--x-card); border-radius: var(--x-r); box-shadow: var(--x-shadow); overflow: hidden; }
.x-row { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; min-height: 60px; transition: background .15s var(--x-ease); }
.x-row + .x-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--x-line); transform: scaleY(.5); transform-origin: top; }
button.x-row:hover { background: rgba(118,118,128,.06); }
.x-row__code { font-size: 17px; font-weight: 700; width: 46px; flex: none; }
.x-row__main { flex: 1; min-width: 0; }
.x-row__main b { font-weight: 600; display: block; }
.x-row__main small { display: block; font-size: 13px; color: var(--x-muted); }
.x-row__time { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; width: 48px; flex: none; }
.x-row__end { display: flex; align-items: center; gap: 8px; flex: none; color: var(--x-muted); }
.x-row__end svg { color: rgba(60,60,67,.3); }
@media (prefers-color-scheme: dark) { .x-row__end svg { color: rgba(235,235,245,.3); } }
.x-row__end .x-st svg { color: currentColor; }
.x-row__end .x-sel svg { color: var(--x-blue); }
.x-count { font-size: 17px; color: var(--x-muted); font-variant-numeric: tabular-nums; min-width: 16px; text-align: right; }
.x-row.is-flag .x-row__main b { font-weight: 700; }
@media (max-width: 520px) { .x-row { flex-wrap: wrap; row-gap: 4px; } .x-row .x-chip-wrap { width: 100%; padding-left: 62px; } }

.x-back { display: inline-flex; align-items: center; gap: 4px; color: var(--x-blue); font-size: 17px; min-height: 44px; margin: -8px 0 6px -6px; padding: 0 6px; }
.x-empty { background: var(--x-card); border-radius: var(--x-r); box-shadow: var(--x-shadow); padding: 40px 24px; text-align: center; }
.x-empty b { display: block; font-size: 20px; font-weight: 600; }
.x-empty p { color: var(--x-muted); font-size: 15px; margin: 6px auto 0; max-width: 36ch; }
.x-note { font-size: 13px; color: var(--x-muted); margin: 12px 4px 0; }

/* case detail */
.x-detail-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.x-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--x-line); border-radius: var(--x-r); overflow: hidden; box-shadow: var(--x-shadow); margin: 18px 0; }
.x-facts div { background: var(--x-card); padding: 14px 16px; }
.x-facts small { display: block; font-size: 12px; color: var(--x-muted); }
.x-facts b { font-weight: 600; font-size: 16px; }
.x-summary { display: grid; gap: 12px; }
@media (min-width: 760px) { .x-summary { grid-template-columns: 1fr 1fr; } }
.x-sum { border-radius: var(--x-r); padding: 16px 18px; background: var(--x-card); box-shadow: var(--x-shadow); }
.x-sum small { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.x-sum--off small { color: var(--x-red-ink); }
.x-sum--on small { color: var(--x-orange-ink); }
.x-sum p { margin: 0; font-size: 17px; font-weight: 600; }
.x-explain { font-size: 21px; line-height: 1.35; font-weight: 500; letter-spacing: -.01em; margin: 24px 0; }
.x-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.x-actions { align-items: center; gap: 8px 20px; }
.x-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 20px; border-radius: 10px; font-size: 17px; font-weight: 600; background: var(--x-blue); color: #fff; transition: opacity .2s var(--x-ease); }
.x-btn:hover { opacity: .88; }
.x-btn:active { opacity: .7; }
.x-btn--ghost { background: none; color: var(--x-blue); padding: 0 4px; font-weight: 400; }

/* safety reports (CADORS) */
.x-safe { background: var(--x-card); border-radius: var(--x-r); padding: 14px 16px; margin: 0 0 18px; }
.x-safe b { display: block; font-size: 17px; font-weight: 600; line-height: 1.35; margin-top: 6px; }
.x-safe p { margin: 4px 0 0; font-size: 15px; color: var(--x-muted); }
.x-safe small { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--x-line); font-size: 12px; color: var(--x-muted); }
.x-cc__foot .x-st { margin-top: 4px; }
.x-cc__meta { display: flex; flex-direction: column; align-items: flex-start; }

/* plane's day timeline */
.x-tl { list-style: none; margin: 0; padding: 6px 16px; position: relative; background: var(--x-card); border-radius: var(--x-r); }
.x-tl li { position: relative; padding: 10px 0 10px 24px; }
.x-tl li::before { content: ""; position: absolute; left: 3.5px; top: 24px; bottom: -20px; width: 1px; background: var(--x-line); }
.x-tl li:last-child::before { display: none; }
.x-tl__dot { position: absolute; left: 0; top: 20px; width: 8px; height: 8px; border-radius: 50%; background: rgba(118,118,128,.45); }
.x-leg { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.x-leg__route { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.x-leg__no { font-weight: 500; color: var(--x-muted); font-size: 15px; }
.x-leg__meta { font-size: 13px; color: var(--x-muted); width: 100%; }
.x-leg__chip { margin-left: auto; }
.is-cancel .x-tl__dot { background: var(--x-red); }
.is-cancel .x-leg__route, .is-cancel .x-leg__no { text-decoration: line-through; text-decoration-color: var(--x-red); text-decoration-thickness: 2px; color: var(--x-muted); }
.is-instead .x-tl__dot { background: var(--x-orange); }
.is-instead .x-leg__route { font-weight: 700; }

/* about */
.x-prose { max-width: 62ch; }
.x-prose p { margin: 0 0 14px; }
.x-prose h3 { font-size: 19px; font-weight: 600; margin: 0 0 8px; }

/* sheet + toast */
.x-sheet { position: fixed; inset: 0; z-index: 40; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.35); }
.x-sheet.is-on { display: flex; }
.x-sheet__panel { width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--x-bg); border-radius: 22px 22px 0 0; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); animation: x-up .3s var(--x-ease); }
@media (min-width: 760px) { .x-sheet { align-items: center; } .x-sheet__panel { border-radius: 22px; } }
@keyframes x-up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.x-sheet__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.x-sheet__top h2 { margin: 0; font-size: 20px; font-weight: 600; }
.x-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 50; background: rgba(29,29,31,.92); color: #fff; font-size: 15px; font-weight: 500; padding: 10px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .25s var(--x-ease), transform .25s var(--x-ease); }
.x-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 760px) { .x-toast { bottom: 32px; } }
.x-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    

/* ---------- production additions ---------- */
/* Navigation uses real links (shareable, middle-click, screen readers); keep them looking like the prototype's buttons. */
a.x-brand, a.x-tab, a.x-card, a.x-row { color: inherit; text-decoration: none; }
a.x-tab { color: var(--x-muted); }
a.x-tab[aria-current="page"] { color: var(--x-blue); }
@media (min-width: 760px) { a.x-tab { color: var(--x-text); } a.x-tab[aria-current="page"], a.x-tab:hover { color: var(--x-blue); } }
a.x-card:hover { box-shadow: inset 0 0 0 999px rgba(118,118,128,.05); }
a.x-card:active { box-shadow: inset 0 0 0 999px rgba(118,118,128,.12); }
a.x-row:hover { background: rgba(118,118,128,.06); }
a.x-back, a.x-link { text-decoration: none; display: inline-flex; align-items: center; }
.x-h1:focus, .x-h2:focus, .x-hero__text:focus { outline: none; }
.x-row__glyph { width: 46px; flex: none; display: grid; place-items: start; color: var(--x-blue); }
.x-row--action .x-row__main b { color: var(--x-blue); font-weight: 400; }

/* loading: native-style activity indicator */
.x-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 140px; color: var(--x-muted); font-size: 15px; }
.x-spin { animation: x-spin 1s steps(8) infinite; }
@keyframes x-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .x-spin { animation: none; } }
.x-empty .x-link { margin-top: 10px; }
.x-loc .x-st { font-weight: 400; }
.x-safe ul { margin: 8px 0 0; padding-left: 18px; font-size: 15px; }
.x-safe li + li { margin-top: 4px; }
/* segmented control + date strip as links */
.x-seg a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--x-text); text-decoration: none; transition: background .2s var(--x-ease); }
.x-seg a[aria-pressed="true"] { background: var(--x-card); font-weight: 600; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
@media (prefers-color-scheme: dark) { .x-seg a[aria-pressed="true"] { background: #636366; } }
a.x-date { color: var(--x-text); text-decoration: none; }
/* skip link becomes visible on keyboard focus */
#skip:focus { position: fixed; left: 12px; top: 12px; z-index: 60; width: auto; height: auto; clip: auto; padding: 10px 14px; background: var(--x-card); color: var(--x-blue); border-radius: 10px; }
