/* Libya Flights. One accent (airport board amber), semantic status colours, one radius scale:
   12px for surfaces, full pill for chips and segmented controls. Logical properties throughout
   so the same rules serve Arabic (RTL) and English or French (LTR). */

:root {
  color-scheme: light;
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #EBEFF4;
  --line: #DCE2EA;
  --text: #0E141B;
  --text-2: #3F4A58;
  --text-3: #5E6979;
  --accent: #F5B027;
  --accent-ink: #855600;
  --accent-soft: #FFF1D1;
  --on-accent: #1C1405;
  --ok: #0E7A43;     --ok-bg: #DFF3E8;
  --info: #1A62C2;   --info-bg: #E2ECFA;
  --warn: #A54F05;   --warn-bg: #FCEBD9;
  --bad: #B42323;    --bad-bg: #FBE3E3;
  --done: #4F5A69;   --done-bg: #E6EAF0;
  --shadow: 0 1px 2px rgb(20 30 45 / .06), 0 8px 24px rgb(20 30 45 / .06);
  --radius: 12px;
  --tile: #161C24; --tile-ink: #FFC043; --tile-dim: #8C96A3;
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

:root[data-theme="dark"], :root[data-theme="auto"].sys-dark {
  color-scheme: dark;
  --bg: #0B0F14;
  --surface: #121821;
  --surface-2: #1A222D;
  --line: #253041;
  --text: #EEF2F7;
  --text-2: #B3BDCA;
  --text-3: #8592A3;
  --accent: #FFB627;
  --accent-ink: #FFC452;
  --accent-soft: rgb(255 182 39 / .12);
  --on-accent: #1C1405;
  --ok: #52CF8C;     --ok-bg: rgb(82 207 140 / .13);
  --info: #74AEFF;   --info-bg: rgb(116 174 255 / .13);
  --warn: #FFA552;   --warn-bg: rgb(255 165 82 / .14);
  --bad: #FF7474;    --bad-bg: rgb(255 116 116 / .14);
  --done: #95A1B1;   --done-bg: rgb(149 161 177 / .12);
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px rgb(0 0 0 / .35);
  --tile: #05080C; --tile-ink: #FFC043; --tile-dim: #7A8594;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1, "zero" 0; letter-spacing: 0; }
.wrap { width: 100%; max-width: 920px; margin-inline: auto; padding-inline: 16px; }
.i { width: 20px; height: 20px; fill: currentColor; flex: none; }
[dir="rtl"] .dirflip { transform: scaleX(-1); }
[hidden] { display: none !important; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 12px 16px; border-radius: 999px; z-index: 50; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------------------------------------------------------------- header */
/* The brand row and airport switch scroll away; tabs and search stay pinned (--stick is set
   from the tabs' offset in app.js, so it follows the real layout at every width). */
.top {
  position: sticky; top: var(--stick, 0px); z-index: 10;
  background: var(--bg); /* solid: a see-through blur let scrolled rows show through */
  border-block-end: 1px solid var(--line);
  padding-block-end: 10px;
}
.top-row { display: flex; align-items: center; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 700; font-size: 18px; white-space: nowrap; }
.clock { display: inline-flex; align-items: baseline; gap: 6px; }
.clock-time { font-size: 15px; font-weight: 600; color: var(--text); }
.tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
/* Every button is a full 44 px target; the selected pill is drawn smaller inside it. */
.lang { display: flex; background: var(--surface-2); border-radius: 999px; padding-inline: 2px; }
.lang button {
  position: relative; isolation: isolate; border: 0; background: transparent; color: var(--text-2);
  min-width: 44px; height: 44px; padding-inline: 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
}
.lang button[aria-pressed="true"] { color: var(--text); }
.lang button[aria-pressed="true"]::before { content: ""; position: absolute; inset: 5px 1px; z-index: -1; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 0; background: transparent; color: var(--text-2);
}
#theme .i-sun { display: none; }
:root[data-theme="dark"] #theme .i-moon, :root.sys-dark[data-theme="auto"] #theme .i-moon { display: none; }
:root[data-theme="dark"] #theme .i-sun, :root.sys-dark[data-theme="auto"] #theme .i-sun { display: block; }

/* airport switch: three big thirds, the active one carries the accent */
.airports {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-block: 4px 10px;
}
.airports button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  text-align: start; padding: 10px 12px; border-radius: var(--radius); min-width: 0;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out), transform .12s var(--ease-out);
}
.airports button:active { transform: scale(.98); }
.ap-name { font-size: 18px; font-weight: 700; line-height: 1.25; }
.ap-city { font-size: 12px; color: var(--text-3); display: flex; flex-wrap: wrap; column-gap: 6px; align-items: baseline; }
.ap-city .mono { font-size: 12px; letter-spacing: .04em; }
.airports button[aria-checked="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
.airports button[aria-checked="true"] .ap-city { color: color-mix(in srgb, var(--on-accent) 72%, transparent); }

/* departures / arrivals tabs with a sliding ink bar */
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; border-block-end: 1px solid var(--line); }
.tabs button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; border: 0; background: transparent; color: var(--text-3); font-weight: 500; font-size: 16px;
}
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 700; }
.tabs .count { font-size: 12px; color: var(--text-3); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; min-width: 26px; }
.tabs .count:empty { display: none; }
.tab-ink {
  position: absolute; inset-block-end: -1px; inset-inline-start: 0; width: 50%; height: 3px;
  background: var(--accent); border-radius: 3px 3px 0 0;
  transition: transform .25s var(--ease-out);
}
.tabs[data-active="dep"] .tab-ink { transform: translateX(100%); }
[dir="rtl"] .tabs[data-active="dep"] .tab-ink { transform: translateX(-100%); }

.search { position: relative; margin-block-start: 10px; }
.search > .i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 46px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); padding-inline: 42px 44px; font-size: 16px; color: var(--text);
}
.search input::placeholder { color: var(--text-3); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .clear { position: absolute; inset-inline-end: 4px; top: 3px; }

/* ---------------------------------------------------------------- status line and banners */
.status-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px 8px; font-size: 13px; color: var(--text-3); }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 500; }
.live .updated { color: var(--text-3); font-weight: 400; }
.live .updated::before { content: "·"; margin-inline-end: 7px; color: var(--text-3); }
.live .updated:empty::before { content: none; }
.sh-tz { margin: -4px 0 0; font-size: 12px; color: var(--text-3); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-bar.is-stale .live { color: var(--warn); }
.status-bar.is-off .live { color: var(--text-3); }
.banner { padding: 12px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: 14px; margin-block-end: 10px; }
.banner.is-bad { background: var(--bad-bg); color: var(--bad); }
.banner.is-info { background: var(--info-bg); color: var(--info); }

/* ---------------------------------------------------------------- the board */
.board, .mine-list { list-style: none; margin: 0; padding: 0; }
.board { display: flex; flex-direction: column; padding-block-end: 24px; }
.row {
  position: relative; display: grid; background: var(--surface);
  border-inline: 1px solid var(--line); border-block-start: 1px solid var(--line);
}
/* rows sit on one board surface: the first and last of each run get the rounded corners */
.board > .row:first-child, .board > :not(.row) + .row, .mine-list > .row:first-child { border-start-start-radius: var(--radius); border-start-end-radius: var(--radius); }
.board > .row:last-child, .board > .row:has(+ :not(.row)), .mine-list > .row:last-child { border-end-start-radius: var(--radius); border-end-end-radius: var(--radius); border-block-end: 1px solid var(--line); }
.board > .row + .row { border-block-start-color: color-mix(in srgb, var(--line) 70%, transparent); }
.row-main {
  display: grid; grid-template-columns: 76px 1fr auto; column-gap: 12px; align-items: center;
  width: 100%; text-align: start; background: transparent; border: 0; padding: 10px 12px; padding-inline-end: 50px;
  border-radius: inherit; min-height: 70px; color: var(--text);
  transition: background-color .15s var(--ease-out), transform .12s var(--ease-out);
}
.row-main:active { transform: scale(.992); }
.t { display: flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1; }
.t-main {
  position: relative; display: block; width: 100%; text-align: center;
  font-family: var(--mono); font-weight: 600; font-size: 20px; font-feature-settings: "tnum" 1;
  padding: 7px 0 6px; border-radius: 7px; background: var(--tile); color: var(--tile-ink);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .04), inset 0 -2px 0 rgb(0 0 0 / .25);
}
/* The seam across a split-flap tile runs behind the digits, so a dimmed time never reads as crossed out. */
.t-main::after { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: rgb(0 0 0 / .55); box-shadow: 0 1px 0 rgb(255 255 255 / .05); z-index: 0; }
.t-main > bdi { position: relative; z-index: 1; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.t-old { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.t.is-done .t-main { color: var(--tile-dim); }
.row.is-cancelled .t-main { color: var(--tile-dim); text-decoration: line-through; text-decoration-color: var(--bad); }
.what { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* A long place name wraps to a second line rather than losing its end. */
.city { font-size: 17px; font-weight: 700; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); min-width: 0; white-space: nowrap; overflow: hidden; }
.sub .code { font-family: var(--mono); font-weight: 600; color: var(--text-2); font-size: 13px; letter-spacing: .02em; }
.sub .al { overflow: hidden; text-overflow: ellipsis; }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding-inline: 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; background: var(--done-bg); color: var(--done);
}
.chip.s-ontime, .chip.s-arrived { background: var(--ok-bg); color: var(--ok); }
.chip.s-checkin, .chip.s-enroute { background: var(--info-bg); color: var(--info); }
.chip.s-boarding { background: var(--accent); color: var(--on-accent); }
.chip.s-gate_closed, .chip.s-delayed { background: var(--warn-bg); color: var(--warn); }
.chip.s-cancelled, .chip.s-diverted { background: var(--bad-bg); color: var(--bad); }
.chip.s-noupdate { background: transparent; color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn-bg); }
.chip.s-scheduled, .chip.s-unknown { background: transparent; color: var(--text-3); padding-inline: 2px; font-weight: 500; }
.chip.s-departed, .chip.s-landed { background: var(--done-bg); color: var(--done); }
.side-note { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.side-note.desks { color: var(--info); font-weight: 600; }
.far-line { display: block; font-size: 12px; font-weight: 600; color: var(--info); line-height: 1.4; margin-block-start: 2px; }
.star {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text-3); border-radius: 999px;
}
.star[aria-pressed="true"] { color: var(--accent); }
.star .on { display: none; }
.star[aria-pressed="true"] .on { display: block; }
.star[aria-pressed="true"] .off { display: none; }
.star:active svg { transform: scale(.85); }
.star svg { transition: transform .15s var(--ease-out); }

.calc-line {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px;
  margin: 0 14px 12px; padding: 7px 10px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 500;
  border: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent);
}
.calc-line .mono { font-weight: 600; }
.calc-line .i { width: 16px; height: 16px; }

.row.is-past { opacity: .72; }
/* Direction on every row (15 Oct): icon plus "from" or "to", so a row reads right without the tabs. */
.dirlead { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; line-height: 1.2; color: var(--text-2); }
.dirlead .dir-i { width: 15px; height: 15px; flex: none; color: var(--accent); fill: currentColor; }
.row.is-cancelled .city { text-decoration: line-through; text-decoration-color: var(--bad); text-decoration-thickness: 2px; }
.row.is-starred::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: -1px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
[dir="rtl"] .row.is-starred::before { border-radius: 3px 0 0 3px; }

/* a row whose time or status just changed glows once, so a live change is noticed */
@media (prefers-reduced-motion: no-preference) {
  .row.changed { animation: changed 2.6s var(--ease-out) 1; }
  @keyframes changed { 0%, 25% { background: var(--accent-soft); } 100% { background: var(--surface); } }
  .live-dot { animation: pulse 2s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 60% { box-shadow: 0 0 0 6px transparent; } }
  .status-bar.is-stale .live-dot, .status-bar.is-off .live-dot { animation: none; }
}

.day {
  display: flex; align-items: center; gap: 10px; margin-block: 18px 8px; font-size: 13px; font-weight: 600; color: var(--text-2);
}
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.nowline { display: flex; align-items: center; gap: 10px; color: var(--accent-ink); font-size: 12px; font-weight: 600; margin-block: 10px; }
.nowline::before, .nowline::after { content: ""; flex: 1; height: 2px; background: var(--accent); border-radius: 2px; }
.nowline .mono { font-size: 13px; }
.earlier {
  margin-block-end: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; width: 100%;
  border: 1px dashed var(--line); background: transparent; border-radius: var(--radius); color: var(--text-2); font-size: 14px; font-weight: 500;
}
.empty { text-align: center; padding: 48px 16px; color: var(--text-3); }
.empty strong { display: block; color: var(--text); font-size: 17px; margin-block-end: 6px; }

.skel { height: 72px; border: 0; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .skel { animation: shimmer 1.4s linear infinite; } @keyframes shimmer { to { background-position: -200% 0; } } }

/* my flights */
.mine { margin-block-end: 12px; }
.mine h2 { font-size: 14px; font-weight: 700; color: var(--text-2); margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.mine-list { display: flex; flex-direction: column; }

/* Hover only where there is a real pointer: on phones a tap leaves :hover stuck on the row
   (seen 15 Oct, the tapped row stayed lit after the sheet closed). */
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }
  .row-main:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
  .star:hover { color: var(--text); background: var(--surface-2); }
  .earlier:hover { background: var(--surface); }
}

/* ---------------------------------------------------------------- footer */
.foot { padding-block: 8px 40px; color: var(--text-3); font-size: 13px; }
.foot p { margin: 0 0 8px; max-width: 70ch; }
.noscript { padding: 24px; }

/* ---------------------------------------------------------------- detail sheet */
.sheet {
  padding: 0; border: 0; margin: 0; max-width: none; max-height: none;
  width: 100%; inset-block: auto 0; inset-inline: 0; position: fixed;
  background: transparent; color: var(--text);
}
.sheet::backdrop { background: rgb(5 8 12 / .5); }
.sheet-body {
  background: var(--surface); border-radius: 18px 18px 0 0; height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
  /* One fixed height (15 Oct): the history arrives after the sheet opens, and a sheet sized to its
     content moved a second time when it did. Now the content fills in and the sheet stays put;
     the Follow and Share buttons sit at the bottom when there is room to spare. */
  display: flex; flex-direction: column;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); max-width: 640px; margin-inline: auto;
  box-shadow: 0 -10px 40px rgb(0 0 0 / .25);
}
@media (prefers-reduced-motion: no-preference) {
  /* The sheet itself is animated from app.js (openSheet, closeSheet); only the backdrop is here. */
  .sheet[open]::backdrop { animation: fade-in .42s cubic-bezier(0, 0, .58, 1); }
  .sheet.closing::backdrop { animation: fade-out .22s cubic-bezier(0, 0, .58, 1) forwards; }
  @keyframes fade-in { from { opacity: 0; } }
  @keyframes fade-out { to { opacity: 0; } }
}
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sh-head { display: flex; align-items: flex-start; gap: 12px; }
.sh-head .close { margin-inline-start: auto; }
.sh-code { font-family: var(--mono); font-weight: 600; font-size: 26px; line-height: 1.1; }
.sh-airline { color: var(--text-2); font-size: 14px; }
.sh-route { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-block: 18px 6px; }
.sh-end { display: flex; flex-direction: column; min-width: 0; }
.sh-end:last-child { align-items: flex-end; text-align: end; }
.sh-city { font-size: 20px; font-weight: 700; line-height: 1.25; }
.sh-iata { font-family: var(--mono); font-size: 13px; color: var(--text-3); }
.sh-plane { color: var(--text-3); }
.sh-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-block: 14px; }
.sh-times.one { grid-template-columns: 1fr; }
.sh-far { margin-block-start: 10px; font-size: 14px; font-weight: 600; color: var(--info); }
.sh-time { background: var(--surface-2); border-radius: var(--radius); padding: 12px; }
.sh-time .lbl { font-size: 12px; color: var(--text-3); }
.sh-time .val { font-family: var(--mono); font-weight: 600; font-size: 22px; }
.sh-time .val.new { color: var(--accent-ink); }
.sh-time .old { font-family: var(--mono); font-size: 13px; color: var(--text-3); text-decoration: line-through; }
.sh-time .note { font-size: 12px; color: var(--text-2); margin-block-start: 2px; }
.sh-unofficial { color: var(--warn); }
.sh-quiet { margin-block-start: 10px; font-size: 14px; line-height: 1.6; color: var(--warn); }
.sh-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-block-start: 12px; }
.sh-status .chip { height: 30px; font-size: 14px; padding-inline: 12px; }
.sh-badge { font-size: 12px; color: var(--ok); display: inline-flex; align-items: center; gap: 4px; }
.calc-box { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; margin-block: 12px; }
.calc-box h3 { margin: 0 0 4px; font-size: 15px; color: var(--accent-ink); display: flex; align-items: center; gap: 8px; }
.calc-box h3 .mono { font-size: 18px; }
.calc-box p { margin: 6px 0 0; font-size: 14px; color: var(--text); }
.calc-box .fine { font-size: 12px; color: var(--text-2); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; font-size: 14px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; font-weight: 500; }

/* punctuality and history */
.hist h3 { font-size: 14px; margin: 18px 0 8px; color: var(--text-2); }
.hist .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hist .stat { background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist .stat b { font-size: 22px; font-weight: 600; line-height: 1.2; }
.hist .stat b small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--text-2); }
.hist .stat span { font-size: 12px; color: var(--text-3); }
.hist .stat.rate { grid-column: 1 / -1; }
.hist .bar { display: block; height: 6px; border-radius: 3px; background: var(--line); margin-block-start: 6px; overflow: hidden; }
.hist .bar > i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.hist .days { list-style: none; margin: 0; padding: 0; }
.hist .days li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "d s . tag" "o o o tag"; column-gap: 8px; row-gap: 1px; align-items: center; padding: 9px 2px; border-block-end: 1px solid var(--line); font-size: 13px; }
.hist .days .d { grid-area: d; color: var(--text); font-weight: 500; }
.hist .days .s { grid-area: s; color: var(--text-3); }
.hist .days .o { grid-area: o; color: var(--ok); }
.hist .days li.bad .o { color: var(--bad); }
.hist .days li.none .o { color: var(--text-3); }
.hist .tag { grid-area: tag; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.hist .tag.ok { background: var(--ok-bg); color: var(--ok); }
.hist .tag.late { background: var(--warn-bg); color: var(--warn); }
.hist .earlier { margin-block-start: 8px; }
.hist .fine, .hist-wait, .hist-empty { font-size: 12px; color: var(--text-3); line-height: 1.6; margin: 8px 0 0; }
.hist-empty { font-size: 13px; color: var(--text-2); }
.sheet-body > * { flex-shrink: 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-block-start: auto; padding-block-start: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding-inline: 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px;
  text-decoration: none; transition: transform .12s var(--ease-out), background-color .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn .i { width: 18px; height: 18px; }

.toast {
  position: fixed; inset-inline: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  max-width: 420px; margin-inline: auto; background: var(--text); color: var(--bg);
  padding: 12px 16px; border-radius: var(--radius); font-weight: 500; box-shadow: var(--shadow); text-align: center;
}
@media (prefers-reduced-motion: no-preference) { .toast:not([hidden]) { animation: toast-in .3s var(--ease-out); } @keyframes toast-in { from { transform: translateY(12px); opacity: 0; } } }

/* ---------------------------------------------------------------- wider screens */
@media (min-width: 720px) {
  .wrap { padding-inline: 24px; }
  .top-row { height: 64px; }
  .brand-name { font-size: 20px; }
  .top-grid { display: grid; }
  .airports { margin-block: 6px 12px; }
  .row-main { grid-template-columns: 88px 1fr auto; padding: 12px 16px; padding-inline-end: 60px; min-height: 76px; }
  .t-main { font-size: 22px; }
  .city { font-size: 18px; }
  .sheet { inset-block: 0; display: none; place-items: center; }
  .sheet[open] { display: grid; }
  .sheet-body { border-radius: 18px; height: min(86dvh, 760px); width: min(600px, calc(100% - 32px)); padding: 18px 22px 22px; }
  .grab { display: none; }
}
@media (max-width: 380px) {
  .row-main { grid-template-columns: 66px 1fr auto; column-gap: 10px; padding-inline: 10px 46px; }
  .t-main { font-size: 18px; }
  .city { font-size: 16px; }
  .brand-name { font-size: 16px; }
  .clock-label { display: none; }
  .wrap { padding-inline: 12px; }
  .top-row { gap: 8px; }
  .tools { gap: 2px; }
  .chip { padding-inline: 8px; font-size: 12.5px; }
}
