/* Crew phone app. Theme colours come from CSS variables that crew.js sets per airline. */
:root {
    --hero: #0f1d2b; --hero2: #1c3550; --on-hero: #fff; --accent: #3ad1c6;
    --bg: #0b1118; --card: #141c25; --line: #243140; --text: #e8eef4; --muted: #8a9aab;
    --ok: #2ecc71; --warn: #f5a524;
    color-scheme: dark;
}
@media (prefers-color-scheme: light) {
    :root { --bg: #eef2f6; --card: #fff; --line: #dbe2ea; --text: #13202d; --muted: #66768a; color-scheme: light; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
    font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior-y: contain; }
body { min-height: 100vh; min-height: 100dvh; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button, .icon-btn { touch-action: manipulation; min-height: 44px; }
input, textarea { -webkit-user-select: text; user-select: text; font-size: 16px; }
main, .hero { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
@media (max-width: 360px) { html, body { font-size: 14px; } }

.hero { background: linear-gradient(160deg, var(--hero), var(--hero2)); color: var(--on-hero);
    padding: calc(env(safe-area-inset-top) + 12px) 20px 20px; border-radius: 0 0 24px 24px; }
.hero-top { display: flex; align-items: center; gap: 10px; }
.hero-flight { flex: 1; font-weight: 600; letter-spacing: .04em; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.conn.on { background: var(--ok); }
.icon-btn { background: rgba(255,255,255,.14); border: 0; color: inherit; width: 34px; height: 34px; border-radius: 50%; font-size: 17px; }
.hero-dest { font-size: 56px; font-weight: 700; letter-spacing: .02em; line-height: 1.05; margin-top: 14px; }
.hero-route { opacity: .9; }
.hero-meta { opacity: .75; font-size: 13px; margin-top: 2px; }
.hero-times { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; background: rgba(0,0,0,.18); border-radius: 14px; padding: 10px 4px; }
.hero-times div { text-align: center; }
.hero-times .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.hero-times .val { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }

main { padding: 14px 14px calc(env(safe-area-inset-bottom) + 24px); max-width: 560px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.card h2 { margin: 0 0 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

.phase-card { display: flex; align-items: center; gap: 14px; }
.phase-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); flex: none; }
.phase-dot.live { background: var(--accent); animation: pulse 1.6s infinite; }
.phase-dot.done { background: var(--ok); }
.phase-dot.warn { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.phase { font-size: 20px; font-weight: 700; }
.phase-sub { color: var(--muted); font-size: 13px; }

.rings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ring-box { position: relative; text-align: center; }
.ring { width: 100%; max-width: 150px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--ok); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .8s ease; }
.ring-txt { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1; max-width: 150px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-txt b { font-size: 28px; font-variant-numeric: tabular-nums; }
.ring-txt span { color: var(--muted); font-size: 13px; }
.ring-lbl { font-weight: 600; margin-top: 4px; }

.cabins { display: flex; gap: 8px; }
.cabin { flex: 1; text-align: center; background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 12px; padding: 8px 4px; }
.cabin b { display: block; font-size: 20px; }
.cabin span { color: var(--muted); font-size: 12px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 28px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); background: var(--card); }
.timeline li::after { content: ""; position: absolute; left: 11px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.active::before { border-color: var(--accent); background: var(--accent); }
.timeline .t { font-weight: 600; }
.timeline li:not(.done):not(.active) .t { color: var(--muted); font-weight: 500; }
.timeline .s { color: var(--muted); font-size: 13px; }

.wrow { margin-bottom: 10px; }
.wrow .top { display: flex; justify-content: space-between; font-size: 13px; }
.wrow .top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .8s ease; }
.bar i.hi { background: var(--warn); }

.foot { text-align: center; color: var(--muted); font-size: 12px; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; z-index: 10; }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; background: var(--card); border-radius: 22px 22px 0 0; padding: 20px 20px calc(env(safe-area-inset-bottom) + 20px); }
.sheet-card h2 { margin: 0 0 12px; }
.sheet-card label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.sheet-card input { width: 100%; font-size: 18px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.muted { color: var(--muted); }
.pair-msg { color: #ff6b6b; min-height: 20px; margin: 8px 0; font-size: 13px; }
.btn { width: 100%; padding: 13px; font-size: 16px; font-weight: 600; border: 0; border-radius: 12px; background: var(--accent); color: #fff; margin-top: 8px; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.theme-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
    background: transparent; color: var(--text); font-size: 15px; margin-bottom: 8px; text-align: left; }
.theme-opt.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.swatch { width: 28px; height: 28px; border-radius: 8px; flex: none; }
