:root {
  --bg: #0c0a08;
  --card: #15120e;
  --card-2: #1b1712;
  --line: #2d271f;
  --gold: #f1b33b;
  --gold-text: #eaa93a;
  --cream: #efe7da;
  --muted: #a39a8c;
  --dim: #6f675c;
  --blue: #6f9ee0;
  --note: linear-gradient(135deg, #3a6ee0 0%, #2a55c4 100%);
  --cond: 'Barlow Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Jost', 'Avenir Next', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #000; color: var(--cream); font-family: var(--body); }
body { min-height: 100dvh; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
input, textarea { font: inherit; color: var(--cream); }
#app { max-width: 440px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; overflow-x: hidden; }
@media (min-width: 520px) { #app { border-left: 1px solid #1d1914; border-right: 1px solid #1d1914; } }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 6px 0 0; }
.error { color: #ff8f7a; font-size: 14px; }
.link { color: var(--gold); font-size: 15px; cursor: pointer; }
.link.danger { color: #ff8f7a; }

/* ---------- buttons ---------- */
.btn { display: block; width: 100%; padding: 17px 20px; border-radius: 16px; font-size: 20px; font-weight: 400; text-align: center; letter-spacing: .2px; }
.btn.gold { background: var(--gold); color: #1b130a; }
.btn.outline { border: 1.5px solid #8a6626; color: var(--gold); margin-top: 14px; }
.btn:active { transform: scale(.99); opacity: .92; }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: var(--cream); background: var(--card-2); border: 1px solid var(--line); }

/* ---------- welcome ---------- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; position: relative; background: radial-gradient(120% 60% at 50% 100%, #3b2416 0%, #1c130d 45%, #0c0a08 75%); }
.welcome-logo { padding: calc(70px + var(--safe-t)) 24px 0; position: relative; z-index: 2; }
.logo-full { display: flex; flex-direction: column; align-items: center; }
.logo-full .logo-mark { width: 82%; max-width: 300px; height: auto; margin-left: 4%; }
.wordmark { font-family: var(--body); font-weight: 300; color: var(--gold-text); letter-spacing: .48em; font-size: clamp(26px, 8.2vw, 38px); margin: 18px 0 0; padding-left: .48em; line-height: 1; white-space: nowrap; }
.logo-divider { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.logo-divider span { width: 76px; height: 1px; background: #a77a2c; }
.tagline { font-family: var(--body); color: #e2c79a; font-weight: 300; letter-spacing: .16em; font-size: 15px; margin-top: 10px; }
.sunset { position: absolute; inset: 44% 0 0 0; overflow: hidden; background: linear-gradient(to bottom, rgba(12,10,8,0) 0%, #2a1a10 30%, #7a4320 55%, #c9782f 70%, #f0a94a 78%, #5a3a26 86%, #241a15 100%); }
.sunset .sun { position: absolute; left: 36%; top: 74%; width: 240px; height: 240px; margin: -120px; border-radius: 50%; background: radial-gradient(circle, #fff1c9 0%, #ffd38a 18%, #f6b65b 38%, rgba(232, 150, 60, .55) 60%, rgba(200, 110, 50, 0) 75%); filter: blur(4px); }
.sunset .haze { position: absolute; left: -10%; right: -10%; top: 62%; height: 26%; background: radial-gradient(60% 50% at 40% 40%, rgba(247, 182, 92, .85), rgba(196, 108, 48, .45) 55%, rgba(60, 35, 22, 0) 80%); filter: blur(8px); }
.sunset::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: linear-gradient(to bottom, rgba(36, 26, 21, 0), #1f1714 50%, #160f0c 100%); }
.sunset .wing { position: absolute; left: 0; top: 40%; width: 100%; height: 30%; z-index: 1; }
.welcome-actions { margin-top: auto; padding: 0 24px calc(28px + var(--safe-b)); position: relative; z-index: 3; }

/* ---------- pages / setup ---------- */
.page { padding: calc(22px + var(--safe-t)) 20px calc(40px + var(--safe-b)); }
.page-title { font-family: var(--cond); font-weight: 600; color: var(--gold-text); letter-spacing: .12em; font-size: 26px; margin: 14px 0 18px; }
.setup .back { margin-bottom: 8px; }
.setup p { line-height: 1.5; margin: 0 0 22px; }
.choice { display: flex; gap: 16px; align-items: center; width: 100%; background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 14px; color: var(--gold); }
.choice.on { border-color: var(--gold); }
.choice div { display: flex; flex-direction: column; gap: 4px; color: var(--cream); }
.choice b { font-weight: 500; font-size: 19px; }
.choice span { color: var(--muted); font-size: 14px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-family: var(--cond); letter-spacing: .12em; text-transform: uppercase; font-size: 13px; color: var(--blue); margin-bottom: 8px; }
.field input { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; font-size: 18px; outline: none; }
.field input:focus, textarea:focus { border-color: #8a6626; }
.field.big input { font-family: var(--cond); font-size: 30px; letter-spacing: .08em; text-transform: uppercase; padding: 16px 18px; }
.field.inline { margin: 14px 0 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .field input { text-transform: uppercase; font-family: var(--cond); font-size: 22px; letter-spacing: .1em; }

/* ---------- tab body ---------- */
.tab-body { padding: calc(18px + var(--safe-t)) 18px calc(130px + var(--safe-b)); }
.section { font-family: var(--cond); font-weight: 500; letter-spacing: .2em; color: var(--gold-text); font-size: 15px; margin: 28px 2px 12px; }

/* flight */
.flight-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.headline { font-family: var(--cond); font-weight: 600; color: var(--gold-text); letter-spacing: .08em; font-size: 23px; margin: 4px 0 0; line-height: 1.15; }
.date { font-family: var(--cond); color: var(--muted); letter-spacing: .08em; font-size: 14px; white-space: nowrap; }
.pill-row { display: flex; gap: 8px; align-items: center; margin: 10px 0 14px; }
.phase-pill { font-family: var(--cond); font-weight: 500; letter-spacing: .1em; font-size: 13px; color: var(--gold-text); border: 1px solid #8a6626; padding: 3px 10px; border-radius: 999px; }
.tag { font-family: var(--cond); letter-spacing: .14em; font-size: 12px; color: var(--muted); border: 1px solid #3c352c; padding: 2px 9px; border-radius: 999px; vertical-align: middle; }
.tag.live { color: #7be0a0; border-color: #2f6b45; }
.plane-pic { border-radius: 16px; overflow: hidden; aspect-ratio: 2.35 / 1; background: #8ea2b5; }
.plane-pic svg, .plane-pic img { width: 100%; height: 100%; display: block; object-fit: cover; }
.airline-row { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 2px 10px; }
.airline { font-family: var(--cond); font-weight: 600; font-size: 20px; letter-spacing: .06em; }
.aircraft { font-family: var(--cond); color: var(--blue); letter-spacing: .1em; font-size: 13px; }
.route { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 12px; margin: 0 2px 16px; }
.route .end { display: flex; flex-direction: column; }
.route .end.right { text-align: right; }
.route .city { font-family: var(--cond); color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.route .code { font-family: var(--cond); font-weight: 600; font-size: 30px; letter-spacing: .04em; line-height: 1.05; }
.route-line { position: relative; height: 22px; margin-bottom: 6px; }
.route-line .dots { position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dotted #b98a33; }
.route-plane { position: absolute; top: 0; transform: translateX(-50%); color: var(--gold); background: var(--bg); padding: 0 4px; line-height: 0; }

.note-card { border-radius: 16px; padding: 14px 16px 16px; background: var(--note); color: #fff; margin: 4px 0 6px; box-shadow: 0 8px 30px -12px rgba(50, 100, 230, .6); }
.note-card.home { background: linear-gradient(135deg, #3a2b19, #2a2015); border: 1px solid #6b5126; box-shadow: none; }
.note-card.home .note-meta { color: var(--gold-text); }
.note-meta { display: flex; align-items: center; gap: 8px; font-family: var(--cond); letter-spacing: .1em; font-size: 13px; color: #dce6ff; margin-bottom: 6px; }
.new-tag { margin-left: auto; font-size: 11px; background: #ffd27a; color: #2a1a05; padding: 1px 7px; border-radius: 999px; letter-spacing: .12em; box-shadow: 0 0 12px rgba(255, 210, 122, .8); }
.note-body { display: flex; gap: 12px; align-items: flex-start; }
.note-body p { margin: 0; font-size: 18px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.note-photo { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; flex: none; }
.note-photo svg, .note-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.note-empty { display: flex; gap: 10px; align-items: center; width: 100%; border: 1.5px dashed #5a4521; color: var(--gold-text); border-radius: 16px; padding: 16px; font-size: 16px; }
.note-list .note-card { margin-bottom: 10px; }

.progress { margin: 18px 2px 14px; }
.progress-head, .progress-foot { display: flex; justify-content: space-between; font-family: var(--cond); letter-spacing: .14em; }
.progress-head .label { color: var(--gold-text); font-size: 14px; }
.progress-head .pct { font-weight: 600; font-size: 15px; }
.progress-foot { color: var(--muted); font-size: 11.5px; margin-top: 8px; }
.bar { position: relative; height: 4px; border-radius: 2px; background: #3a332a; margin-top: 10px; }
.bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: linear-gradient(90deg, #a87420, var(--gold)); }
.bar .knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(241, 179, 59, .7); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.tiles .tile { background: var(--card); padding: 12px 8px 12px; text-align: center; min-height: 82px; display: flex; flex-direction: column; justify-content: center; }
.tile-label { font-family: var(--cond); color: var(--blue); letter-spacing: .1em; font-size: 10.5px; margin-bottom: 6px; }
.tile-value { font-family: var(--cond); font-weight: 600; font-size: 19px; line-height: 1.15; }
.tile-value .unit { display: block; font-weight: 500; font-size: 10px; letter-spacing: .1em; color: var(--muted); margin-top: 2px; }
.tile.stack .tile-value .unit { font-size: 9.5px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-grid .tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; text-align: left; }
.info-grid .tile-label { font-size: 13px; letter-spacing: .14em; margin-bottom: 5px; }
.info-grid .tile-value { font-size: 19px; font-weight: 500; }

/* no flight */
.no-flight { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 70px 10px 0; }
.no-flight h2 { font-family: var(--cond); letter-spacing: .2em; color: var(--gold-text); font-weight: 500; margin: 26px 0 8px; }
.no-flight p { margin: 0 0 26px; line-height: 1.5; }
.no-flight .btn.outline { margin-top: 12px; }

/* map */
.map-card { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 380 / 300; background: #0a0e15; }
.map-card.small { aspect-ratio: 380 / 220; margin-bottom: 16px; }
.map-svg { width: 100%; height: 100%; display: block; }
.map-label .code { font-family: var(--cond); font-weight: 600; font-size: 13px; fill: #f4e3c0; letter-spacing: .05em; }
.map-label .city { font-family: var(--cond); font-size: 10px; fill: #a39a8c; }
.map-where { position: absolute; left: 12px; bottom: 12px; font-family: var(--cond); letter-spacing: .14em; font-size: 12.5px; color: var(--gold-text); background: rgba(10, 10, 12, .72); border: 1px solid #3b3123; padding: 5px 10px; border-radius: 8px; }

.wx-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin-bottom: 16px; }
.wx-title { font-family: var(--cond); letter-spacing: .16em; color: var(--muted); font-size: 14px; }
.wx-main { display: flex; align-items: center; gap: 22px; margin: 14px 0 4px; }
.wx-temp { font-family: var(--cond); font-weight: 400; font-size: 68px; line-height: 1; }
.wx-text { font-family: var(--cond); font-weight: 600; font-size: 24px; margin-bottom: 12px; }
.wx-loading { color: var(--muted); padding: 18px 0; }
.wx-rows { margin: 0; }
.wx-rows div { display: flex; justify-content: space-between; padding: 6px 0; font-family: var(--cond); font-size: 17px; }
.wx-rows dt { color: var(--muted); }
.wx-rows dd { margin: 0; }

/* flight log */
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0 16px; color: var(--muted); }
.search input { flex: 1; background: none; border: 0; outline: none; padding: 16px 0; font-size: 18px; }
.sample-note { display: flex; gap: 14px; align-items: center; margin: 18px 2px; }
.sample-note p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.sample-note .link { white-space: nowrap; }
.log-card { display: flex; gap: 12px; align-items: center; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; }
.log-card.now { border: 1.5px solid #8a6626; display: block; }
.log-main { flex: 1; min-width: 0; }
.log-date { font-family: var(--cond); color: var(--blue); letter-spacing: .12em; font-size: 13.5px; display: flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; }
.log-date.gold { color: var(--gold-text); }
.log-date .tag { margin-left: 6px; }
.log-route { font-family: var(--cond); font-weight: 600; font-size: 28px; letter-spacing: .03em; margin: 4px 0 2px; white-space: nowrap; }
.log-route .arrow { font-weight: 500; margin: 0 2px; }
.log-route .fn, .fn { font-weight: 400; font-size: 19px; color: var(--muted); margin-left: 6px; letter-spacing: .02em; }
.log-sub { color: var(--muted); font-size: 15.5px; line-height: 1.45; }
.log-thumb { width: 62px; height: 62px; border-radius: 10px; overflow: hidden; flex: none; align-self: flex-start; }
.log-thumb svg, .log-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.phase-list { list-style: none; counter-reset: ph; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.phase-list li { counter-increment: ph; display: flex; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--line); font-family: var(--cond); font-size: 16px; }
.phase-list li:last-child { border-bottom: 0; }
.phase-list li span:first-child::before { content: counter(ph) '. '; color: var(--dim); }
.phase-list li span:last-child { color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid .photo, .photo-pick .photo { aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 2px solid transparent; }
.photo svg, .photo img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* settings */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.card .field:last-of-type { margin-bottom: 4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; font-size: 16px; }
.row + .row { border-top: 1px solid var(--line); }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 12px 8px; border-radius: 10px; text-align: center; color: var(--muted); font-size: 15px; }
.seg button.on { background: var(--gold); color: #1b130a; }
.toggle { width: 50px; height: 30px; border-radius: 15px; background: #3a332a; position: relative; flex: none; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #d8d0c4; transition: left .15s; }
.toggle.on { background: var(--gold); }
.toggle.on i { left: 23px; background: #fff; }

/* tab bar */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 440px; display: grid; grid-template-columns: 1fr 1fr 92px 1fr 1fr; align-items: end; padding: 10px 6px calc(12px + var(--safe-b)); background: linear-gradient(to bottom, rgba(12, 10, 8, .86), #0c0a08 40%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 20; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #c9c0b3; font-family: var(--cond); letter-spacing: .14em; font-size: 12.5px; text-align: center; line-height: 1.2; padding-bottom: 2px; }
.tab.on { color: var(--gold); }
.heart-btn { justify-self: center; width: 74px; height: 74px; border-radius: 50%; background: var(--gold); color: #120d07; display: grid; place-items: center; box-shadow: 0 0 26px rgba(241, 179, 59, .55); margin-bottom: 4px; }

/* overlays */
.overlay { position: fixed; inset: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 440px; background: var(--bg); z-index: 30; overflow-y: auto; }
.overlay-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; text-align: center; font-family: var(--cond); letter-spacing: .16em; color: var(--cream); font-size: 17px; margin-bottom: 22px; }
.compose .btn { margin-top: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 1px solid #8a6626; color: var(--gold-text); border-radius: 999px; padding: 9px 14px; font-size: 15px; }
.textarea-wrap { position: relative; }
textarea { width: 100%; min-height: 170px; resize: none; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 30px; font-size: 19px; line-height: 1.4; outline: none; }
.count { position: absolute; right: 14px; bottom: 12px; color: var(--dim); font-family: var(--cond); font-size: 13px; }
.photo-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.photo-pick .photo.on { border-color: var(--gold); }
.photo-pick .photo.add { display: grid; place-items: center; border: 1.5px dashed #5a4521; color: var(--gold-text); cursor: pointer; aspect-ratio: 1; border-radius: 12px; }
.lookup-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-top: 4px; }
.lookup-card .field input[type=time] { font-family: var(--cond); font-size: 20px; color-scheme: dark; }
.preview-flight { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 12px; }
.preview-flight .log-route { font-size: 22px; }
.sent { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.sent-heart { width: 130px; height: 130px; display: grid; place-items: center; color: var(--gold); filter: drop-shadow(0 0 30px rgba(241, 179, 59, .45)); }
.sent-heart svg { width: 130px; height: 130px; }
.sent h2 { font-family: var(--cond); font-weight: 500; letter-spacing: .1em; font-size: 30px; margin: 10px 0; }
.sent p { color: var(--muted); font-size: 18px; line-height: 1.5; margin: 0 0 30px; }
.sent .btn { max-width: 320px; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .92); z-index: 50; display: grid; place-items: center; padding: 20px; }
.lightbox svg, .lightbox img { max-width: 100%; max-height: 90dvh; width: 400px; height: auto; border-radius: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(120px + var(--safe-b)); transform: translateX(-50%); background: #2a2216; border: 1px solid #8a6626; color: var(--cream); padding: 12px 18px; border-radius: 14px; z-index: 60; font-size: 15px; white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.photo-pick .photo.add svg { width: 30px; height: 30px; }
.log-date .tag { font-size: 10.5px; padding: 1px 7px; }
.log-main { overflow: hidden; }
.log-card .log-route { text-overflow: ellipsis; overflow: hidden; }
.pair-code { font-family: var(--cond); font-weight: 600; font-size: 46px; letter-spacing: .12em; text-align: center; color: var(--gold-text); background: var(--card); border: 1.5px solid #8a6626; border-radius: 18px; padding: 22px 10px; margin: 10px 0 4px; }
.code-chip { font-family: var(--cond); font-weight: 600; letter-spacing: .14em; color: var(--gold-text); border: 1px solid #8a6626; border-radius: 8px; padding: 3px 8px; }
.btn[disabled] { opacity: .6; }
form .btn { margin-top: 6px; }

/* ================= Display mode (tablet / laptop / TV) ================= */
body.display-mode { background: #000; }
body.display-mode #app { max-width: none; border: 0; }
.display { height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; gap: 1.6vh; padding: calc(2vh + var(--safe-t)) 2.4vw calc(1.4vh + var(--safe-b)); filter: brightness(var(--dim, 1)); transition: filter .6s; overflow: hidden;
  --d-fs: clamp(12px, 1.05vw + .5vh, 22px); font-size: var(--d-fs); }
.d-head { display: flex; justify-content: space-between; align-items: center; gap: 2vw; }
.d-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.d-title h1 { font-family: var(--cond); font-weight: 600; color: var(--gold-text); letter-spacing: .09em; font-size: clamp(22px, 2.2vw + .6vh, 48px); margin: 0; line-height: 1.05; }
.d-title .phase-pill, .d-title .tag { font-size: calc(var(--d-fs) * .8); }
.d-clock { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--cond); letter-spacing: .12em; color: var(--muted); font-size: calc(var(--d-fs) * .95); white-space: nowrap; }
.d-clock b { color: var(--blue); font-weight: 600; font-size: 1.15em; }
.d-body { min-height: 0; }

.d-flight { height: 100%; display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.4fr); gap: 2vw; }
.d-left { display: flex; flex-direction: column; gap: 1.4vh; min-height: 0; }
.d-plane .plane-pic { aspect-ratio: 2.2 / 1; border-radius: 18px; }
.d-airline { display: flex; justify-content: space-between; align-items: baseline; }
.d-airline .airline { font-size: 1.45em; }
.d-airline .aircraft { font-size: .85em; }
.d-route { margin: 0; }
.d-route .code { font-size: 2.6em; }
.d-route .city { font-size: .78em; }
.d-route .route-line { height: 30px; }
.d-route .route-plane svg { width: 30px; height: 30px; }
.d-note .note-card { padding: 1.6vh 1.4vw; border-radius: 18px; margin: 0; }
.d-note .note-meta { font-size: .9em; }
.d-note .note-body p { font-size: 1.55em; line-height: 1.3; }
.d-note .note-photo { width: 11vh; height: 11vh; }
.d-note.fresh .note-card { animation: d-glow 2.4s ease-in-out infinite; }
@keyframes d-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 122, .0), 0 10px 40px -14px rgba(50, 100, 230, .7); } 50% { box-shadow: 0 0 0 3px rgba(255, 210, 122, .55), 0 0 40px 6px rgba(255, 210, 122, .35); } }
.d-note-empty { display: flex; gap: 12px; align-items: center; border: 1.5px dashed #5a4521; color: var(--gold-text); border-radius: 18px; padding: 2vh 1.4vw; font-size: 1.1em; }
.d-left .progress { margin: auto 0 0; }
.d-left .progress-head .label, .d-left .progress-head .pct { font-size: 1em; }
.d-left .progress-foot { font-size: .8em; }
.d-left .bar { height: 6px; }

.d-right { display: flex; flex-direction: column; gap: 1.6vh; min-height: 0; }
.d-map { position: relative; flex: 1; min-height: 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #0a0e15; }
.d-map .map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.d-map .map-where { font-size: .9em; left: 16px; bottom: 16px; }
.d-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.d-tile { background: var(--card); padding: 1.4vh .6vw; text-align: center; }
.d-tile-label { font-family: var(--cond); color: var(--blue); letter-spacing: .1em; font-size: .72em; }
.d-tile-value { font-family: var(--cond); font-weight: 600; font-size: 1.7em; line-height: 1.15; margin-top: .2em; }
.d-tile-unit { font-family: var(--cond); color: var(--muted); letter-spacing: .1em; font-size: .68em; }

.d-mapfull { height: 100%; display: flex; flex-direction: column; gap: 1.6vh; }
.d-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }

.d-weather { height: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 2vw; align-content: center; }
.d-wx { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 3vh 2.4vw; }
.d-wx .wx-title { font-size: 1em; }
.d-wx .wx-temp { font-size: 5.5em; }
.d-wx .wx-text { font-size: 1.7em; }
.d-wx .wx-rows div { font-size: 1.15em; padding: .5vh 0; }

.d-idle { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1vh; }
.d-idle .logo-mark { width: min(34vw, 420px); height: auto; }
.d-idle .wordmark { font-size: clamp(28px, 3vw, 60px); }
.d-idle .tagline { font-size: clamp(14px, 1.2vw, 24px); }
.d-idle-state { font-family: var(--cond); letter-spacing: .3em; color: var(--gold-text); font-size: 1.3em; margin: 4vh 0 0; }
.d-idle .d-note { width: min(560px, 80vw); text-align: left; margin-top: 1vh; }
.d-idle .d-sample { width: auto; display: inline-block; padding: 12px 28px; font-size: 1em; margin-top: 2vh; }

.d-log { height: 100%; overflow-y: auto; padding-right: 6px; }
.d-log-head { display: flex; align-items: center; justify-content: space-between; gap: 2vw; margin-bottom: 2vh; }
.d-log-head .page-title { margin: 0; }
.d-log-head .search { width: min(480px, 50%); }
.d-log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.d-log-grid .log-card { margin: 0; }

.d-settings { max-width: 760px; margin: 0 auto; height: 100%; overflow-y: auto; }
.d-settings input[type=range] { width: 50%; accent-color: var(--gold); }

.d-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2vw; border-top: 1px solid var(--line); padding-top: 1.2vh; }
.d-brand { display: flex; align-items: center; gap: 10px; color: var(--gold-text); font-family: var(--body); font-weight: 300; letter-spacing: .2em; font-size: 1.1em; }
.d-nav-tabs { display: flex; justify-content: center; gap: 3vw; }
.d-nav-btn { display: flex; align-items: center; gap: 8px; font-family: var(--cond); letter-spacing: .14em; font-size: .85em; color: #c9c0b3; padding: 6px 4px; }
.d-nav-btn svg { width: 22px; height: 22px; }
.d-nav-btn.on { color: var(--gold); }
.d-heart { width: 54px; height: 54px; border-radius: 50%; background: var(--gold); color: #120d07; display: grid; place-items: center; box-shadow: 0 0 20px rgba(241, 179, 59, .5); }
.d-heart svg { width: 26px; }
body.display-mode .overlay { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .7); }

/* Portrait tablets: stack the two columns */
@media (max-aspect-ratio: 1/1) {
  .display { overflow-y: auto; height: auto; min-height: 100dvh; }
  .d-head { flex-wrap: wrap; }
  .d-clock { align-items: flex-start; }
  .d-flight { grid-template-columns: minmax(0, 1fr); }
  .d-strip { grid-template-columns: repeat(3, 1fr); }
  .d-map { min-height: 40vh; }
  .d-weather { grid-template-columns: 1fr; }
  .d-nav-btn span { display: none; }
}
.d-log-grid .log-route { font-size: 1.9em; }
.d-log-grid .log-date { font-size: .8em; }
.d-log-grid .log-sub { font-size: .9em; }
.d-log-grid .log-thumb { width: 5em; height: 5em; }
.d-log-head .search input { font-size: 1em; }

/* install + notification prompts */
.prompt-card { background: linear-gradient(135deg, #241b10, #17120c); border: 1px solid #6b5126; border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; }
.prompt-head { display: flex; gap: 14px; align-items: center; color: var(--gold); }
.prompt-head > svg { flex: none; }
.prompt-head div { display: flex; flex-direction: column; gap: 3px; color: var(--cream); }
.prompt-head b { font-weight: 500; font-size: 17px; }
.prompt-head span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.prompt-card .howto { margin: 12px 0 4px; font-size: 15px; line-height: 1.5; color: var(--cream); }
.prompt-card .small-btn { padding: 12px 16px; font-size: 17px; margin-top: 14px; }
.prompt-card .link.small { display: block; margin: 10px auto 0; font-size: 14px; color: var(--muted); }
