/* The components of Flight Monitor (js/components.js, js/flight.js, js/contact.js, js/calendar.js, js/daypick.js).
   Materials come from base.css (.glass, .frost) and tokens.css; nothing here has a raw colour except white highlights inside glass. Targets are 44 px or more,
   :hover only inside (hover: hover), springs only on presses, chips and the segmented lens. */

/* ---- segmented control: glass, a lens that slides with the spring (--i index, --n count) */
.segmented { --n: 2; --i: 0; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 4px; border-radius: var(--r-pill); }
.segmented > button { position: relative; z-index: 1; min-height: var(--hit); padding: 0 var(--s2); border-radius: var(--r-pill); font-size: var(--t-sm); font-weight: 600;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--d2) var(--ease); }
.segmented > button[aria-pressed="true"] { color: var(--text); }
.seg-lens { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n)); border-radius: var(--r-pill); background: var(--glass-lens);
  box-shadow: inset 0 0 0 .5px var(--glass-edge), inset 0 1px 0 var(--glass-rim), 0 4px 12px -4px rgba(0, 0, 0, .22);
  transform: translateX(calc(var(--i) * 100%)); transition: transform var(--d4) var(--spring); }
:root[data-fx="lite"] .segmented { background: var(--surface-2); }

/* Every grid of content has a column that may shrink below its min-content (an ellipsis or a long word inside must never widen a card or the page). */
.fcard, .hero, .dhead, .cards, .skel-list, .skel-card, .cands, .readlist, .cand, .readrow, .contact, .group, .cal, .reading-main, .land { grid-template-columns: minmax(0, 1fr); }

/* ---- chips */
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--t-meta); font-weight: 650;
  line-height: 1.15; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.chip svg { flex: none; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.ok.solid { background: var(--ok); color: var(--ok-contrast); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.danger.solid { background: var(--danger); color: var(--danger-contrast); }
.chip.live { background: var(--accent-soft); color: var(--accent); }
.chip.neutral { background: var(--surface-2); color: var(--muted); }
.chip.glass { color: var(--text); background: var(--glass-sheen), var(--glass-thin); box-shadow: inset 0 0 0 .5px var(--glass-edge), inset 0 1px 0 var(--glass-rim); }
.chip.solid { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: blink 2.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---- a flight card (frosted: content) */
.fcard { position: relative; display: grid; gap: 10px; padding: 16px 16px 14px; border-radius: var(--r-card); transition: transform var(--d3) var(--spring); }
.fcard:has(.card-open:active), .hero:has(.card-open:active) { transform: scale(.985); transition-duration: 90ms; transition-timing-function: var(--ease); }
.fcard-top, .hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }
.fcard-top .chips { flex: 1 1 auto; min-width: 0; }
.fcard-id { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; min-width: 0; }
.fcard-flight { font: 700 var(--t-headline)/1.2 var(--font-display); letter-spacing: -.01em; white-space: nowrap; }
.fcard-airline { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-meta); color: var(--muted); }
.route { display: flex; align-items: center; flex-wrap: wrap; column-gap: 4px; min-width: 0; font-size: var(--t-sm); line-height: 1.35; }
.route .city { font-weight: 550; overflow-wrap: anywhere; }
.route .iata { color: var(--muted); font-weight: 650; letter-spacing: .03em; }
.route-arrow { display: inline-flex; color: var(--muted); margin: 0 3px; }
.fcard-mid { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.land { display: grid; gap: 3px; min-width: 0; }
.land-label { font-size: var(--t-cap); font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.land-row { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 10px; }
.land-time { font: 700 var(--t-time)/1.04 var(--font-display); letter-spacing: -.025em; }
.land-was { font-size: var(--t-sm); font-weight: 550; color: var(--muted); text-decoration-thickness: 1.5px; }
.land.off .land-time { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.info-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fcard-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.fcard-foot .leave { margin-left: auto; }
.client { flex: 1 1 140px; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--t-sm); font-weight: 600; }
.client-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-ic, .client-mark { display: inline-flex; flex: none; color: var(--muted); }
.client-pax { flex: none; color: var(--muted); font-weight: 650; }
.muted-mark { display: inline-flex; color: var(--muted); }
.card-open { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.card-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- "Parti entro 19:00 · tra 1 h 20" */
.leave { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px 4px 9px; border-radius: var(--r-pill);
  font-size: var(--t-meta); font-weight: 600; line-height: 1.2; white-space: nowrap; background: var(--surface-2); color: var(--text); }
.leave-ic { display: inline-flex; }
.leave-sep { opacity: .55; }
.leave b { font-weight: 750; }
.leave.calm { background: var(--accent-soft); color: var(--accent); }
.leave.soon { background: var(--warn-soft); color: var(--warn); }
.leave.urgent { background: var(--danger-soft); color: var(--danger); }
.leave.late { background: var(--danger); color: var(--danger-contrast); }
.leave.done { background: var(--ok-soft); color: var(--ok); }
.leave.big { display: flex; width: 100%; min-height: 56px; margin: 0; padding: 8px 18px 8px 14px; gap: 10px; border-radius: 18px; font-size: var(--t-headline); font-weight: 650; }
.leave.big .leave-sep { display: none; }
.leave.big .leave-rel { margin-left: auto; font: 750 var(--t-title)/1.1 var(--font-display); letter-spacing: -.01em; }
.leave.big { flex-wrap: wrap; row-gap: 0; }                      /* 320 px: the countdown goes under «Parti entro», on the right, instead of out of the card */
.leave.big .leave-label, .leave.big .leave-rel { white-space: nowrap; }

/* ---- the track: IATA — plane — IATA */
.track { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: var(--t-cap); font-weight: 750; letter-spacing: .05em; color: var(--muted); }
.track-line { position: relative; height: 22px; }
.track-line::before { content: ''; position: absolute; left: calc(var(--p, 0) * 100%); right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px; opacity: .6;
  background: repeating-linear-gradient(90deg, var(--border) 0 5px, transparent 5px 10px); }      /* the dashes only ahead of the plane */
.track-fill { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; width: calc(var(--p, 0) * 100%); border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.track-plane { position: absolute; top: 50%; left: calc(var(--p, 0) * 100%); transform: translate(-50%, -50%); display: grid; place-items: center; color: var(--accent); }
.track-plane svg { fill: currentColor; stroke: none; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .25)); }
.track.landed .track-fill { background: var(--ok); }
.track.landed .track-plane { color: var(--ok); }
.track.landed .track-line::before { opacity: 0; }
.track.off .track-line::before { opacity: .35; }
.track.off .track-fill, .track.idle .track-fill { display: none; }

/* ---- the hero: the next pickup, on real glass (the only card with a blur) */
.hero { position: relative; display: grid; gap: 12px; padding: 18px 18px 16px; border-radius: 30px; transition: transform var(--d3) var(--spring);
  background: radial-gradient(120% 90% at 100% 0%, var(--hero-glow) 0, transparent 62%), var(--glass-sheen), var(--hero-fill);
  -webkit-backdrop-filter: var(--glass-filter-strong); backdrop-filter: var(--glass-filter-strong);
  box-shadow: inset 0 0 0 .5px var(--glass-edge), inset 0 1px 0 var(--glass-rim), inset 0 -1px 0 var(--glass-shade), var(--glass-shadow); }
.hero .fcard-flight { font-size: var(--t-title2); }
.hero .land-time { font-size: var(--t-hero); letter-spacing: -.03em; }
.hero .client { flex: none; }
.hero-top { flex-wrap: wrap; }                                    /* on a narrow phone the chips go under the eyebrow instead of squeezing it */
.hero-top .chips { flex: 1 1 auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; white-space: nowrap; font-size: var(--t-cap); font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }

/* ---- the glass orb of empty states and gates */
.mark.orb { --size: 96px; color: var(--accent);
  background: radial-gradient(100% 100% at 30% 16%, var(--glass-rim) 0, transparent 44%), radial-gradient(80% 80% at 70% 108%, var(--hero-glow) 0, transparent 72%), var(--glass-thin);
  -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  box-shadow: inset 0 0 0 .5px var(--glass-edge), inset 0 2px 1px var(--glass-rim), inset 0 -4px 12px var(--glass-shade), 0 18px 38px -16px rgba(0, 0, 0, .32); }

/* ---- loading cards */
.skel-list { display: grid; gap: var(--s3); }
.skel-card { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-card); }
.skel-card.big { gap: 14px; padding: 20px; border-radius: 30px; }
.skel-top { display: flex; justify-content: space-between; gap: 12px; }
.skel-card .skeleton { display: block; border-radius: 8px; }
.s-id { width: 40%; height: 18px; }
.skel-card .s-chip { width: 22%; height: 24px; border-radius: var(--r-pill); }
.s-route { width: 62%; height: 14px; }
.s-time { width: 32%; height: 30px; }
.skel-card.big .s-time { width: 46%; height: 44px; }
.s-track { width: 100%; height: 6px; }

/* ---- list section heading ("Oggi · 3 voli") */
.sect { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: var(--s2) 4px 0; }
.sect h2 { font: 700 var(--t-title)/1.2 var(--font-display); letter-spacing: -.01em; }
.sect span { color: var(--muted); font-size: var(--t-sm); font-weight: 550; }
.cards { display: grid; gap: var(--s3); }

/* ---- the day strip (inside the opaque sheet of "Nuovo volo"): a horizontal scroller ON PURPOSE */
.daystrip { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 4px 0 12px; margin-bottom: -8px; -webkit-overflow-scrolling: touch; }      /* room for the glow of the chosen chip (a scroller clips both ways) */
.daystrip::-webkit-scrollbar { display: none; }
.sheet-body .daystrip { margin: 0 calc(-1 * var(--s5)); padding-left: var(--s5); padding-right: var(--s5); scroll-padding-inline: var(--s5); }
.daychip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--hit); padding: 0 16px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text);
  font-size: var(--t-sm); font-weight: 600; white-space: nowrap; transition: background-color var(--d2), color var(--d2), transform var(--d3) var(--spring); }
.daychip:active { transform: scale(.94); transition-duration: 90ms; }
.daychip[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); box-shadow: 0 5px 12px -7px var(--accent); }
.daychip.other { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--border); }

/* ---- the month calendar (in a glass sheet) */
.cal { display: grid; gap: 6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 0 2px 4px; }
.cal-title { font: 650 var(--t-title)/1.2 var(--font-display); letter-spacing: -.01em; }
.cal-nav { display: flex; gap: var(--s2); }
.cal-nav .icon-btn[disabled] { opacity: .35; pointer-events: none; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 calc(-1 * var(--s3)); }
.cal-week span { padding: 4px 0; text-align: center; font-size: var(--t-cap); font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cal-day { display: grid; place-items: center; min-height: var(--hit); color: var(--text); font-size: var(--t-headline); font-weight: 500; font-variant-numeric: tabular-nums; }
.cal-day span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; transition: background-color var(--d2), transform var(--d3) var(--spring); }
.cal-day.today span { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day[aria-pressed="true"] span { background: var(--accent); color: var(--accent-contrast); font-weight: 650; box-shadow: 0 6px 14px -6px var(--accent); }
.cal-day:disabled { color: var(--muted); opacity: .38; cursor: default; }
.cal-day:active:not(:disabled) span { transform: scale(.9); transition-duration: 90ms; }
.cal-day:focus-visible { outline: none; }
.cal-day:focus-visible span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .cal-day:not(:disabled):not([aria-pressed="true"]):hover span { background: var(--line); } }

/* ---- candidates of a search and legs read from a ticket (inside the opaque sheet) */
.cands, .readlist { display: grid; gap: 10px; }
.cand, .readrow { position: relative; display: grid; gap: 6px; width: 100%; padding: 14px 16px; border-radius: 20px; text-align: left; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .05); transition: box-shadow var(--d2), transform var(--d3) var(--spring); }
.cand:active, .readrow:active { transform: scale(.985); transition-duration: 90ms; }
.cand[aria-pressed="true"], .readrow[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent), 0 10px 22px -14px var(--accent); }
.cand-top, .readrow-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding-right: 34px; }
.cand-flight { font: 700 var(--t-headline)/1.2 var(--font-display); white-space: nowrap; }
.cand-airline { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--t-meta); color: var(--muted); }
.cand-op { font-size: var(--t-meta); color: var(--muted); }
.cand-check { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: transparent; box-shadow: inset 0 0 0 1.5px var(--border); }
[aria-pressed="true"] > .cand-top .cand-check, [aria-pressed="true"] > .readrow-top .cand-check { background: var(--accent); color: var(--accent-contrast); box-shadow: none; }
.cand-when { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--t-sm); font-weight: 600; }
.cand-when svg { color: var(--muted); }
.cand-term { color: var(--muted); font-weight: 500; }
.cand-term::before { content: '· '; }
.cand-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.readrow.past { opacity: .55; cursor: default; }
.readrow-date { font-size: var(--t-meta); color: var(--muted); }
.readrow-route { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; font-size: var(--t-sm); font-weight: 650; letter-spacing: .03em; }
.readrow-times { margin-left: auto; color: var(--muted); font-weight: 550; letter-spacing: 0; }

/* ---- "Sto leggendo il biglietto…" */
.reading { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 14px; padding: 14px; border-radius: 20px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.reading-thumb { width: 56px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--surface-2); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .35); }
.reading-thumb.ph { display: grid; place-items: center; color: var(--muted); }
.reading-main { display: grid; gap: 4px; min-width: 0; }
.reading-title { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.reading-title .spinner { color: var(--accent); }
.reading-sub { font-size: var(--t-meta); color: var(--muted); }
.reading-bar { display: block; height: 4px; margin-top: 4px; border-radius: 2px; overflow: hidden; background: var(--line); }
.reading-bar i { display: block; width: 38%; height: 100%; border-radius: 2px; background: var(--accent); animation: indeterminate 1.5s var(--ease) infinite; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(270%); } }
.reading > .btn { grid-column: 1 / -1; justify-self: end; }

/* ---- the contact card (frosted) */
.contact { display: grid; gap: 14px; padding: 16px; border-radius: var(--r-card); }
.contact-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.contact-avatar { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 50%; font: 700 var(--t-headline)/1 var(--font-display);
  color: var(--accent-contrast); background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .32), transparent 58%), var(--accent); }
.contact-avatar.ph { color: var(--muted); background: var(--surface-2); }
.contact-id { display: grid; gap: 2px; min-width: 0; }
.contact-name { font: 650 var(--t-headline)/1.25 var(--font-display); }
.contact-phone { font-size: var(--t-sm); color: var(--muted); overflow-wrap: anywhere; }
.contact-note { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 14px; font-size: var(--t-meta); line-height: 1.35; color: var(--warn); background: var(--warn-soft); }
.contact-note svg { margin-top: 1px; }
.contact-actions { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.contact-act { display: grid; justify-items: center; align-content: center; gap: 5px; min-height: 68px; padding: 10px 6px 8px; border-radius: 18px; font-size: var(--t-meta); font-weight: 650;
  background: var(--accent-soft); color: var(--accent); transition: transform var(--d3) var(--spring); }
.contact-act:active { transform: scale(.95); transition-duration: 90ms; }
.contact-act-ic { display: inline-flex; }
.contact-act.call { background: var(--accent); color: var(--accent-contrast); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 18px -10px var(--accent); }
.contact-act.wa { background: var(--ok-soft); color: var(--ok); }
.contact-more { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- settings: grouped rows on frosted panels */
.group { display: grid; gap: 6px; }
.group-title { padding: 0 14px; font-size: var(--t-meta); font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.group-body { border-radius: var(--r-group); overflow: hidden; background: var(--card-fill); box-shadow: inset 0 0 0 .5px var(--card-edge), var(--card-shadow); }
.group-foot { padding: 0 14px; font-size: var(--t-meta); line-height: 1.4; color: var(--muted); }
.srow { position: relative; display: flex; align-items: center; gap: 8px 12px; width: 100%; min-height: 52px; padding: 8px 14px; text-align: left; color: var(--text); }
.srow:has(> .stepper) { flex-wrap: wrap; }                       /* only a stepper may drop under its label, on a narrow phone */
.srow + .srow::before { content: ''; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); transform: scaleY(.5); transform-origin: top; }
.group-body:has(.srow-ic) .srow + .srow::before { left: 56px; }
.srow-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--accent); color: var(--accent-contrast); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.srow-ic.ok { background: var(--ok); color: var(--ok-contrast); }
.srow-ic.warn { background: var(--warn); color: var(--warn-contrast); }
.srow-ic.danger { background: var(--danger); color: var(--danger-contrast); }
.srow-ic.neutral { background: var(--muted); color: var(--bg); }
.srow-main { flex: 1 1 96px; display: grid; gap: 1px; min-width: 0; }
.srow-label { font-size: var(--t-body); line-height: 1.3; overflow-wrap: anywhere; }
.srow-hint { font-size: var(--t-meta); line-height: 1.3; color: var(--muted); }
.srow-value { flex: 0 1 auto; min-width: 0; margin-left: auto; text-align: right; font-size: var(--t-sm); color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.srow-value.mono { font-family: var(--mono); font-size: var(--t-meta); }
.srow-chev { display: inline-flex; color: var(--muted); opacity: .75; }
.srow.stack { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
.srow-top { display: flex; align-items: center; gap: 12px; }
.srow .stepper { margin-left: auto; }
.srow.action { justify-content: center; gap: 8px; font-weight: 600; }
.srow.action.accent { color: var(--accent); }
.srow.action.danger { color: var(--danger); }
button.srow { transition: background-color var(--d1); }
button.srow:active { background: var(--line); }
@media (hover: hover) { button.srow:hover { background: var(--line); } }

/* the switch: the whole row is the control (role="switch"), this is only its picture */
.switch { position: relative; flex: none; width: 51px; height: 31px; margin-left: auto; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color var(--d2) var(--ease), box-shadow var(--d2); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--knob);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18), 0 1px 1px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .06); transition: transform var(--d3) var(--spring); }
[aria-checked="true"] > .switch { background: var(--ok); box-shadow: none; }
[aria-checked="true"] > .switch::after { transform: translateX(20px); }

/* the stepper: − value + */
.stepper { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.step { width: var(--hit); height: var(--hit); display: grid; place-items: center; border-radius: 50%; color: var(--text); background: var(--surface-2);
  transition: transform var(--d3) var(--spring), opacity var(--d2); }
.step:active { transform: scale(.88); transition-duration: 90ms; }
.step[aria-disabled="true"] { opacity: .35; cursor: default; }
.step[aria-disabled="true"]:active { transform: none; }
.stepper-value { min-width: 58px; text-align: center; font-size: var(--t-body); font-weight: 650; }

/* choice chips (a short select) */
.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { min-height: var(--hit); min-width: 58px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums;
  transition: background-color var(--d2), color var(--d2), transform var(--d3) var(--spring); }
.pick:active { transform: scale(.94); transition-duration: 90ms; }
.pick[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); }

/* ---- "Nuovo volo": the flight-number field with the camera button beside it (the field is never replaced while it has the focus: results go in their own box) */
.field-inline { display: flex; gap: var(--s2); }
.field-inline .input { flex: 1; min-width: 0; }
.field-btn { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent);
  transition: transform var(--d3) var(--spring); }
.field-btn:active { transform: scale(.92); transition-duration: 90ms; }
.results { display: grid; gap: var(--s3); }
.results:empty { display: none; }

/* ---- the detail: the head, four times, the history */
.dhead { display: grid; gap: 12px; padding: 18px; border-radius: 28px; }
.dhead .fcard-flight { font-size: var(--t-title2); }
.dhead .land-time { font-size: var(--t-hero); letter-spacing: -.03em; }
.chips.start { justify-content: flex-start; }
.trows { padding: 4px 0; border-radius: var(--r-group); }
.trow { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 16px; }
.trow + .trow::before { content: ''; position: absolute; top: 0; left: 46px; right: 0; height: 1px; background: var(--line); transform: scaleY(.5); transform-origin: top; }
.trow-ic { display: inline-flex; color: var(--muted); }
.trow-label { flex: 1; min-width: 0; font-size: var(--t-body); }
.trow-time { font: 650 var(--t-title)/1 var(--font-display); letter-spacing: -.01em; }
.trow.strong .trow-ic, .trow.strong .trow-label, .trow.strong .trow-time { color: var(--accent); font-weight: 700; }
.trow.strong .trow-time { font-size: var(--t-large); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 9px 0 9px 22px; font-size: var(--t-sm); line-height: 1.4; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline li + li::after { content: ''; position: absolute; left: 7px; top: -9px; height: 24px; width: 2px; border-radius: 1px; background: var(--line); }
.tl-time { color: var(--muted); font-weight: 650; }
.tl-text { overflow-wrap: anywhere; }

/* ---- sheets: the confirmation centres its sentence; the calendar sheet is a little tighter */
.sheet.confirm .sheet-body p { text-align: center; font-size: var(--t-body); }
.calendar-sheet .sheet-body { padding-bottom: var(--s4); }

/* ---- reduced effects: the bar becomes the page colour with a hairline (it meets Telegram's header, also --bg) */
:root[data-fx="lite"] .bar::before { background: var(--bg); box-shadow: inset 0 -1px 0 var(--line); }
:root[data-fx="lite"] .bar::after { display: none; }
@media (prefers-reduced-motion: reduce) { .chip-dot, .reading-bar i { animation: none; } }

/* ---- phase 2: the screens wired to the server */
.banners { display: grid; gap: var(--s2); }
.group-slot:empty { display: none; }
.group-slot { display: grid; }
.is-new { animation: arrive 2.4s var(--ease-out); }
@keyframes arrive { 0%, 30% { box-shadow: 0 0 0 3px var(--accent), var(--card-shadow); } 100% { box-shadow: inset 0 0 0 .5px var(--card-edge), var(--card-shadow); } }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); padding: var(--s2) 0; }
.history { padding: 6px 16px; border-radius: var(--r-group); }
.results-wait { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) 2px; font-size: var(--t-sm); }
.reading-thumb.small { width: 44px; height: 56px; border-radius: 10px; justify-self: start; }
.field-btn.off { background: var(--surface-2); color: var(--muted); }
.textarea.short { min-height: 92px; }
.nf-summary { display: grid; gap: 4px; padding: 12px 14px; border-radius: 18px; font-size: var(--t-sm); }
.nf-summary .cand-flight { font-size: var(--t-headline); }
.newflight .sheet-body { gap: var(--s4); }
.check-item { display: flex; gap: 12px; align-items: flex-start; }
.check-item b { display: block; font-weight: 650; }
.check-item p { font-size: var(--t-sm); line-height: 1.4; }
.link-box { display: grid; gap: var(--s3); }
.link-state { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--ok-soft); color: var(--ok); }
.link-state b { color: var(--text); }
.link-state .muted { font-size: var(--t-sm); }
.link-code { padding: 18px 12px; border-radius: 18px; text-align: center; font: 700 34px/1.1 var(--mono); letter-spacing: .12em; color: var(--text); background: var(--surface-2);
  user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
.link-actions { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }
.link-actions .btn { flex: 1 1 140px; }
.meter-row { display: grid; gap: 6px; font-size: var(--t-sm); }
.meter { height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .is-new { animation: none; } }
