/* HIKO Flight Wall — prototipin renkleri; LCD paneli, LED düzeni, mobil */
:root {
  --bg: #07101c; --bg2: #0b1829; --fg: #f2f6ff; --panel: #101e30; --border: #253b55; --stat: #15283f;
  --muted: #9aaec5; --red: #d6283f; --red2: #e63946; --blue: #58b9f5; --green: #4ade80; --amber: #fbbf24; --bad: #f87171;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--fg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
main { max-width: 1180px; margin: auto; }
.hidden { display: none !important; }
.red { color: var(--red2); }
.tnum { font-variant-numeric: tabular-nums; }
h2 { font-size: 15px; letter-spacing: 1px; color: var(--muted); margin: 18px 0 12px; text-transform: uppercase; }
h2:first-child { margin-top: 0; }

.top { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-bottom: 2px solid var(--red); padding-bottom: 14px; }
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.brand { font-size: clamp(20px, 4vw, 36px); font-weight: 800; letter-spacing: 2px; }
.sub { color: var(--muted); font-size: 13px; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.pill { border: 1px solid var(--border); padding: 7px 12px; border-radius: 20px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pill.demo { color: #fca5a5; border-color: #e11d48; }
.pill.live { color: var(--green); border-color: #16a34a; }
.pill.err { color: var(--amber); border-color: var(--amber); }
.demo-banner { margin-top: 14px; background: repeating-linear-gradient(45deg, #3b0a14, #3b0a14 12px, #4c0d1a 12px, #4c0d1a 24px);
  border: 1px solid #e11d48; color: #fecdd3; padding: 9px 14px; border-radius: 10px; font-weight: 700; text-align: center; font-size: 14px; }

/* ---------------- Uçuş paneli ---------------- */
.dash { margin-top: 14px; background: linear-gradient(160deg, #0f2036 0%, #0a1626 60%, #08121f 100%);
  border: 1px solid var(--border); border-radius: 18px; padding: 18px; position: relative; overflow: hidden; }
.dash-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-brand { font-weight: 800; letter-spacing: 2px; font-size: 18px; margin-right: auto; }
.dash-clock { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; font-weight: 600; }
.chip { padding: 5px 11px; border-radius: 999px; background: #18304c; color: var(--fg); font-weight: 700; font-size: 12px; letter-spacing: .5px; }
.chip.ok { background: rgba(74,222,128,.14); color: var(--green); }
.chip.warn { background: rgba(251,191,36,.14); color: var(--amber); }
.chip.landed { background: rgba(88,185,245,.15); color: var(--blue); }
.fresh { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted); }
.fresh .dot { width: 10px; height: 10px; border-radius: 50%; background: #475569; }
.fresh.LIVE .dot { background: var(--green); box-shadow: 0 0 0 0 rgba(74,222,128,.6); animation: pulse 2s infinite; }
.fresh.LIVE { color: var(--green); }
.fresh.RECENT .dot { background: var(--amber); } .fresh.RECENT { color: var(--amber); }
.fresh.STALE .dot { background: var(--bad); } .fresh.STALE { color: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.55); } 70% { box-shadow: 0 0 0 9px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
@media (prefers-reduced-motion: reduce) { .fresh.LIVE .dot { animation: none; } }

/* Boşta */
.idle { text-align: center; padding: 34px 10px 26px; }
.idle-clock { font-size: clamp(64px, 16vw, 168px); font-weight: 200; letter-spacing: 2px; font-variant-numeric: tabular-nums; line-height: 1; }
.idle-date { color: var(--muted); margin-top: 8px; font-size: clamp(14px, 2vw, 20px); letter-spacing: 1px; }
.idle-card { display: inline-block; margin-top: 28px; padding: 18px 26px; border: 1px solid var(--border); border-radius: 16px;
  background: rgba(16,30,48,.7); min-width: min(100%, 420px); }
.idle-flight { font-size: clamp(26px, 5vw, 44px); font-weight: 800; margin-top: 6px; }
.idle-route { color: var(--blue); font-weight: 700; }
.idle-when { color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.idle-countdown { font-size: clamp(30px, 6vw, 56px); font-weight: 300; margin-top: 10px; font-variant-numeric: tabular-nums; color: var(--fg); }
.idle-empty { color: var(--muted); margin-top: 26px; font-size: 16px; }

/* Aktif */
.route { display: grid; grid-template-columns: minmax(0, auto) minmax(80px, 1fr) minmax(0, auto); align-items: center; gap: 14px; text-align: center; margin: 18px 0 14px; }
.airport { font-size: clamp(38px, 7vw, 76px); font-weight: 800; line-height: 1; letter-spacing: 1px; }
.ap .sub { font-size: 12px; margin-top: 3px; }
.line { min-width: 0; }
.flightno { font-weight: 800; font-size: clamp(16px, 2.4vw, 24px); letter-spacing: 1px; }
.status { margin-top: 6px; font-weight: 700; font-size: clamp(12px, 1.6vw, 15px); color: var(--green); }
.status.warn { color: var(--amber); } .status.muted { color: var(--muted); } .status.landed { color: var(--blue); }
.track { position: relative; height: 28px; margin: 6px 4px 0; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; border-top: 3px dashed #2e4a6a; }
.track-fill { position: absolute; left: 0; top: 12px; height: 5px; width: 0; background: var(--blue); border-radius: 3px; transition: width .8s; }
.plane-icon { position: absolute; top: -2px; left: 0; font-size: 24px; color: var(--blue); transform: translateX(-50%); transition: left .8s; }
.plane-icon.unknown { left: 50% !important; opacity: .35; }

.dash-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 14px; }
.map-wrap { position: relative; min-height: 320px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: #0b1626; }
.map { position: absolute; inset: 0; }
.map .leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(.82) contrast(.9) saturate(.6); }
.map-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; text-align: center; }
.map-fallback svg { display: block; }
.map-btn { position: absolute; right: 10px; bottom: 10px; z-index: 500; font-size: 13px; padding: 9px 12px; background: rgba(7,16,28,.85); border-color: var(--border); }
.plane-marker { display: block; width: 50px; height: 50px; fill: #fff; filter: drop-shadow(0 1px 3px #000); }
.plane-marker.demo { fill: #fca5a5; }
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.photo-card { margin: 0; background: var(--stat); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.photo-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #0b1626; }
.photo-card figcaption { padding: 10px 12px; }
.photo-title { font-weight: 800; font-size: 16px; }
.photo-model { color: var(--muted); font-weight: 600; font-size: 13px; }
.photo-badge { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.photo-badge.exact { background: rgba(74,222,128,.14); color: var(--green); }
.photo-badge.generic { background: rgba(251,191,36,.14); color: var(--amber); }
.photo-credit { color: var(--muted); font-size: 11px; margin-top: 5px; }
.photo-credit a { color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--stat); padding: 11px 12px; border-radius: 10px; min-width: 0; }
.tele-card.has-primary-countdown .tele-grid { order: -1; }
.tele-grid .stat.primary-countdown { grid-column: 1 / -1; order: -1; }
.tele-grid .stat.primary-countdown .v { font-size: clamp(26px, 3vw, 42px); line-height: 1.1; font-weight: 700; }
.k { font-size: 11px; color: #9bb0c9; letter-spacing: .5px; text-transform: uppercase; }
.v { font-size: clamp(17px, 2.2vw, 24px); font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stale { color: var(--amber); }
.last-known { display: none; color: var(--amber); text-transform: none; }
.stats.is-stale .last-known { display: inline; }
.stats.is-stale #sAlt, .stats.is-stale #sGs { color: var(--muted); }
.warnings { margin: 12px 0 0; padding-left: 20px; color: var(--amber); font-size: 14px; line-height: 1.5; }
.warnings:empty { display: none; }

/* ---------------- LED düzeni ---------------- */
.led-wrap { margin-top: 14px; display: flex; flex-direction: column; align-items: center; }
.led-panel { position: relative; width: min(100%, 1100px); aspect-ratio: 2 / 1; background: #000; border-radius: 10px;
  padding: 5% 5% 4%; display: flex; flex-direction: column; justify-content: center; gap: 4%;
  box-shadow: 0 0 0 10px #1a1410, 0 0 0 12px #2b2118, 0 20px 50px rgba(0,0,0,.6); }
.led-panel::after { content: ""; position: absolute; inset: 0; border-radius: 10px; pointer-events: none;
  background: radial-gradient(circle, transparent 55%, rgba(0,0,0,.55) 56%) 0 0 / 7px 7px; }
.led-line { font-family: "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace; font-weight: 800; color: #ffd27a;
  font-size: clamp(16px, 5.4vw, 64px); letter-spacing: .06em; white-space: pre; overflow: hidden; line-height: 1.05;
  text-shadow: 0 0 6px rgba(255,190,80,.75), 0 0 18px rgba(255,150,40,.35); min-height: 1.05em; }
.led-line:first-of-type { color: #fff; text-shadow: 0 0 6px rgba(255,255,255,.7); }
.led-badge { position: absolute; top: 5%; right: 5%; color: #ff4d5e; font-family: monospace; font-weight: 800; font-size: clamp(10px, 2.4vw, 28px);
  text-shadow: 0 0 8px rgba(255,60,80,.8); z-index: 1; }
.led-progress { height: clamp(6px, 1.4vw, 16px); background: #1d1408; border-radius: 3px; overflow: hidden; }
.led-progress-fill { height: 100%; width: 0; background: #ffb340; box-shadow: 0 0 10px rgba(255,170,60,.8); transition: width .8s; }
.led-note { color: var(--muted); font-size: 12px; margin-top: 18px; text-align: center; max-width: 720px; }

/* ---------------- Formlar / paneller ---------------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-top: 16px; }
.row-between { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
input, button, .btn, select, textarea { font: inherit; font-size: 16px; padding: 10px; border-radius: 8px; border: 1px solid #52637a; } /* 16px: iOS yakınlaştırmasın */
input, select, textarea { background: #081422; color: white; width: 100%; }
textarea { resize: vertical; }
input[type=checkbox] { width: auto; }
input[type=range] { padding: 0; accent-color: var(--red); }
button, .btn { background: var(--red); color: white; cursor: pointer; text-decoration: none; display: inline-block; border-color: var(--red); min-height: 44px; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost, .btn.ghost { background: transparent; border-color: #52637a; color: var(--fg); }
button.small { padding: 4px 10px; font-size: 13px; min-height: 32px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 15px; color: var(--fg); min-height: 36px; }
label.inline { flex-direction: row; align-items: center; gap: 10px; }
label.inline select { width: auto; }
.controls { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.controls label { min-width: 150px; flex: 1; }
.grid-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.grid-form .wide { grid-column: span 3; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
legend { color: var(--fg); font-weight: 700; padding: 0 6px; }
.note { color: #a5b4c7; font-size: 13px; line-height: 1.5; white-space: pre-wrap; margin: 6px 0; }
.note.err { color: #fca5a5; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tr.current td { background: #16304d; }
tr.clickable { cursor: pointer; }
table.review input { min-width: 70px; padding: 6px; font-size: 15px; }
table.review td.ok { color: var(--green); white-space: normal; }
table.review td.bad { color: #fca5a5; white-space: normal; }
.detail { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--stat); font-size: 14px; line-height: 1.6; }
.token-list { list-style: none; padding: 0; margin: 0; }
.token-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.token-once { background: #081422; padding: 10px; border-radius: 8px; color: var(--amber); white-space: pre-wrap; word-break: break-all; font-size: 12px; }
.file-btn { cursor: pointer; }
.footer { text-align: center; margin-top: 20px; }
.dim-overlay { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 2000; transition: opacity 2s; }

/* ---------------- Duyarlı yerleşim ---------------- */
@media (max-width: 900px) {
  .dash-main { grid-template-columns: 1fr; }
  .map-wrap { min-height: 260px; }
  .side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .settings-grid { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: repeat(2, 1fr); } .grid-form .wide { grid-column: span 2; }
}
@media (max-width: 600px) {
  body { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .dash { padding: 12px; border-radius: 14px; }
  .side { display: flex; }
  .route { gap: 8px; }
  .ap .sub { font-size: 11px; }
  .map-wrap { min-height: 240px; }
  .controls label { min-width: 0; }
  .panel { padding: 14px; }
}

/* ---------------- Mod sınıfları ---------------- */
body:not(.mode-wall) .only-wall { display: none !important; }
body.mode-deriko .only-pilot, body.role-viewer .only-pilot { display: none !important; }

/* LCD duvar: ekranın tamamı, kaydırma yok */
body.mode-wall { padding: 1.4vw 1.8vw; overflow: hidden; cursor: none; }
body.mode-wall.show-cursor { cursor: auto; }
body.mode-wall main { max-width: none; }
body.mode-wall .top, body.mode-wall .not-wall, body.mode-wall .footer { display: none !important; }
body.mode-wall .dash { margin-top: 0; height: calc(100vh - 2.8vw - 56px); display: flex; flex-direction: column; padding: 1.4vw 1.6vw; }
body.mode-wall .demo-banner { margin: 0 0 .8vw; padding: .5vw; font-size: max(12px, 1vw); }
body.mode-wall .live { flex: 1; display: flex; flex-direction: column; min-height: 0; }
body.mode-wall .live.hidden { display: none; }
body.mode-wall .dash-main { flex: 1; min-height: 0; }
body.mode-wall .map-wrap { min-height: 0; }
body.mode-wall .idle { flex: 1; display: flex; flex-direction: column; justify-content: center; }
body.mode-wall .idle.hidden { display: none; }
body.mode-wall .dash-head { font-size: max(13px, 1.1vw); }
body.mode-wall .chip, body.mode-wall .fresh, body.mode-wall .dash-clock { font-size: max(12px, 1.05vw); }
body.mode-wall .wall-controls { position: fixed; left: 1.8vw; bottom: 1vw; opacity: 0; transition: opacity .3s; }
body.mode-wall.show-cursor .wall-controls { opacity: 1; }
@media (max-height: 560px) and (orientation: landscape) {
  body.mode-wall .route { margin: 8px 0; }
  body.mode-wall .airport { font-size: 9vh; }
  body.mode-wall .photo-card img { aspect-ratio: 16 / 9; }
  body.mode-wall .stat { padding: 6px 8px; }
}
@media (orientation: portrait) {
  body.mode-wall { overflow: auto; }
  body.mode-wall .dash { height: auto; }
  body.mode-wall .dash-main { grid-template-columns: 1fr; }
  body.mode-wall .map-wrap { min-height: 40vh; }
}
/* LED önizleme */
body.layout-led .dash { display: none !important; }
body.layout-led { background: #050505; }

/* Duvar modunda sağ sütun ekrana sığsın: kompakt fotoğraf + 3 sütunlu istatistik */
body.mode-wall .side { min-height: 0; overflow: hidden; }
body.mode-wall .photo-card { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
body.mode-wall .photo-card a { flex: 1 1 auto; min-height: 0; display: block; }
body.mode-wall .photo-card img { aspect-ratio: auto; height: 100%; max-height: 34vh; }
body.mode-wall .stats { grid-template-columns: repeat(3, 1fr); flex: 0 0 auto; gap: .6vw; }
body.mode-wall .stat { padding: .7vw .8vw; }
body.mode-wall .v { font-size: max(16px, 1.55vw); }
body.mode-wall .k { font-size: max(10px, .72vw); }
.photo-card img.generic { object-fit: contain; }

/* ---------- Havayolu logosu ve teması ---------- */
.airline { display: flex; justify-content: center; align-items: center; min-height: 22px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.airline img { max-height: 30px; max-width: 160px; object-fit: contain; }
.idle-card .airline img { max-height: 36px; }
body.mode-wall .airline img { max-height: 3.4vh; }
/* Vurgu rengi temaya göre değişir. Tonlar yaklaşık; logo dosyanıza göre ayarlayın. */
body.airline-thy { --accent: #d6283f; }
body.airline-ajet { --accent: #2e6bd8; }
body.airline-thy .top, body.airline-ajet .top { border-bottom-color: var(--accent); }
body.airline-ajet .track-fill { background: var(--accent); }
body.airline-ajet .plane-icon { color: var(--accent); }

/* =====================================================================
   v0.4 görsel katman: temalar, tabela efekti, harita, not, hava, iniş anı
   ===================================================================== */
:root { --map-bg: #0b1626; --map-grid: #16283e; --map-route: #58b9f5; --map-trail: #e63946; --map-label: #9aaec5;
  --map-night: rgba(0, 4, 14, .42); --plane: #ffffff; --accent: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* SVG harita sınıfları (CSP: satır içi stil yok) */
.m-bg { fill: var(--map-bg); }
.m-land { fill: #263746; stroke: #52687b; stroke-width: .8; }
.m-grid { stroke: var(--map-grid); stroke-width: 1; }
.m-night { fill: var(--map-night); }
.m-route { fill: none; stroke: var(--map-route); stroke-width: 2; stroke-dasharray: 6 8; opacity: .9; }
.m-route-glow { fill: none; stroke: var(--map-route); stroke-width: 10; opacity: .14; stroke-linecap: round; }
.m-trail { fill: none; stroke: var(--map-trail); stroke-width: 3; stroke-linecap: round; }
.m-ap { fill: var(--map-bg); stroke: var(--map-route); stroke-width: 2; }
.m-label { fill: var(--map-label); font-size: 14px; font-weight: 700; }
.m-note { fill: var(--map-label); font-size: 11px; paint-order: stroke; stroke: var(--map-bg); stroke-width: 2px; }
.m-plane { fill: var(--plane); filter: drop-shadow(0 1px 3px #000); }
.m-plane.demo { fill: #fca5a5; }
.leaflet-container .route-line { stroke: var(--map-route); }
.leaflet-container .route-glow { stroke: var(--map-route); stroke-linecap: round; }

/* Havalimanı tabelası karakterleri */
.flap-char { display: inline-block; }
.flap-char.flip { animation: flip-in .55s cubic-bezier(.3, .7, .3, 1) both; transform-origin: 50% 50%; }
@keyframes flip-in { 0% { transform: rotateX(90deg); opacity: .2; } 60% { transform: rotateX(-12deg); opacity: 1; } 100% { transform: rotateX(0); } }

/* Not şeridi */
.note-ribbon { margin-top: 12px; display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border); font-size: clamp(15px, 1.6vw, 20px); }
.note-icon { color: var(--accent); }
.note-author { color: var(--muted); font-size: .8em; margin-left: auto; white-space: nowrap; }

/* Hava durumu */
.wx { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; color: var(--fg); }
.wx-main { font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.wx-desc { color: var(--muted); font-size: 13px; }
.wx-src { color: var(--muted); font-size: 10px; opacity: .7; margin-left: auto; }
.wx-card { background: var(--stat); border-radius: 10px; padding: 9px 12px; }
.idle-card .wx { justify-content: center; margin-top: 12px; }
.idle-card .wx-src { margin-left: 0; }

/* İniş anı */
.landed-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 900;
  background: radial-gradient(circle at center, rgba(7, 16, 28, .82), rgba(7, 16, 28, .94)); cursor: pointer; }
.landed-card { text-align: center; padding: 24px; }
.landed-check { width: clamp(80px, 14vw, 150px); height: auto; }
.landed-check circle { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; }
.landed-check path { fill: none; stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.landed-overlay.show .landed-check circle { animation: draw 1s ease-out forwards; }
.landed-overlay.show .landed-check path { animation: draw .6s .9s ease-out forwards; }
.landed-title { font-size: clamp(30px, 5vw, 60px); font-weight: 800; margin-top: 14px; opacity: 0; }
.landed-sub { color: var(--muted); font-size: clamp(16px, 2vw, 24px); margin-top: 8px; opacity: 0; font-variant-numeric: tabular-nums; }
.landed-overlay.show .landed-title { animation: rise .8s 1.3s ease-out forwards; }
.landed-overlay.show .landed-sub { animation: rise .8s 1.6s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .landed-overlay.show * { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; }
  .flap-char.flip { animation: none; }
}

/* LED tuvali */
.led-panel { padding: 0; display: block; }
.led-panel::after { display: none; }
.led-canvas { display: block; width: 100%; height: 100%; border-radius: 10px; }

/* ---------------- Tema: Havalimanı tabelası ---------------- */
body.theme-board { --bg: #0a0a0a; --panel: #131313; --stat: #1a1a1a; --border: #2a2a2a; --fg: #f4f1e8; --muted: #a39f94;
  --blue: #ffcc00; --accent: #ffcc00; --map-bg: #0e0e0e; --map-grid: #1f1f1f; --map-route: #ffcc00; --map-label: #c9c4b6;
  --map-trail: #ff8c1a; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
body.theme-board .dash { background: #0d0d0d; border-color: #262626; }
body.theme-board .airport .flap-char, body.theme-board .flightno .flap-char, body.theme-board #nextFlight .flap-char,
body.theme-board #idleClock .flap-char {
  background: linear-gradient(#1d1d1d 0 49%, #000 49% 51%, #171717 51%); color: #f4f1e8; border-radius: 4px;
  padding: 0 .08em; margin: 0 .03em; min-width: .72em; text-align: center; box-shadow: inset 0 0 0 1px #2c2c2c; }
body.theme-board .airport { font-weight: 700; }
body.theme-board .idle-clock { font-weight: 600; }
body.theme-board .chip { background: #1f1a05; color: #ffcc00; border-radius: 4px; letter-spacing: 1.5px; }
body.theme-board .status, body.theme-board .idle-route { color: #ffcc00; }
body.theme-board .track-fill { background: #ffcc00; }
body.theme-board .plane-icon { color: #ffcc00; }
body.theme-board .stat { border-radius: 4px; }
body.theme-board .v { font-family: "SF Mono", Menlo, Consolas, monospace; }

/* ---------------- Tema: Minimal premium ---------------- */
body.theme-minimal { --bg: #0c0e12; --panel: #111419; --stat: transparent; --border: #1d2129; --fg: #eef1f6; --muted: #8a93a3;
  --blue: #9fb7ff; --accent: #9fb7ff; --map-bg: #0f1217; --map-grid: #161a21; --map-route: #9fb7ff; --map-trail: #e7e9ee; --map-label: #8a93a3; }
body.theme-minimal .dash { background: #0c0e12; border-color: transparent; }
body.theme-minimal .airport, body.theme-minimal .idle-flight { font-weight: 300; letter-spacing: 3px; }
body.theme-minimal .idle-clock { font-weight: 100; }
body.theme-minimal .stat { border-top: 1px solid var(--border); border-radius: 0; padding-left: 0; }
body.theme-minimal .v { font-weight: 400; }
body.theme-minimal .chip { background: transparent; border: 1px solid var(--border); }
body.theme-minimal .photo-card, body.theme-minimal .map-wrap { border-color: transparent; }
body.theme-minimal .track::before { border-top: 1px solid #2a303b; }
body.theme-minimal .track-fill { height: 2px; top: 13px; background: var(--accent); }
body.theme-minimal .plane-icon { color: var(--accent); }
body.theme-minimal .demo-banner { background: transparent; border-color: #5b1d2a; }

/* ---------------- Tema: Sıcak gece ---------------- */
body.theme-warm { --bg: #120c08; --panel: #1a120c; --stat: #22170f; --border: #3a2a1d; --fg: #f6e7d3; --muted: #b39b84;
  --blue: #f2a65a; --green: #e9c46a; --accent: #f2a65a; --map-bg: #1a120c; --map-grid: #2a1d13; --map-route: #f2a65a;
  --map-trail: #e76f51; --map-label: #c8ad92; --map-night: rgba(10, 4, 0, .45); --plane: #ffe8c7; }
body.theme-warm .dash { background: linear-gradient(160deg, #22160d 0%, #160e08 70%); border-color: #3a2a1d; }
body.theme-warm .map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) sepia(.6) brightness(.7) contrast(.9); }
body.theme-warm .chip.ok, body.theme-warm .fresh.LIVE { color: #e9c46a; }
body.theme-warm .fresh.LIVE .dot { background: #e9c46a; }
body.theme-warm .idle-clock { font-weight: 200; color: #ffe8c7; }
body.theme-warm .track-fill { background: var(--accent); }
body.theme-warm .plane-icon { color: var(--accent); }
body.theme-warm .top { border-bottom-color: #c2683a; }
body.theme-board .status.warn, body.theme-board .chip.warn { color: #ff8c1a; }
body.theme-board .chip.warn { background: #241302; }
body.theme-warm .status.warn, body.theme-warm .chip.warn { color: #ff9b6b; }
.map-wrap { background: var(--map-bg); }

/* ---------------- Premium tema (DeepSeek önerisinden uyarlandı; tüm güvenlik kuralları korunarak) ---------------- */
@font-face { font-family: 'HikoInter'; font-style: normal; font-weight: 300; font-display: swap; src: url('/static/vendor/fonts/inter-latin-300-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'HikoInter'; font-style: normal; font-weight: 300; font-display: swap; src: url('/static/vendor/fonts/inter-latin-ext-300-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'HikoInter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/vendor/fonts/inter-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'HikoInter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/vendor/fonts/inter-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'HikoInter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/vendor/fonts/inter-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'HikoInter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/vendor/fonts/inter-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'HikoInter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/static/vendor/fonts/inter-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'HikoInter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/static/vendor/fonts/inter-latin-ext-800-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'HikoMono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/vendor/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'HikoMono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/vendor/fonts/jetbrains-mono-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'HikoMono'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/vendor/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'HikoMono'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/vendor/fonts/jetbrains-mono-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
.dash-date { display: none; }
body.theme-premium { --bg: #0a0c0f; --panel: #11151a; --stat: rgba(24, 30, 37, .62); --border: #232a33; --fg: #f5f5f5; --muted: #8a94a6;
  --blue: #c8102e; --accent: #c8102e; --amber: #e0a458; --map-bg: #0d1014; --map-grid: #171c23; --map-route: #e8eef7;
  --map-trail: #c8102e; --map-label: #8a94a6; --plane: #ffffff;
  font-family: "HikoInter", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
body.theme-premium .dash { background: radial-gradient(120% 90% at 10% 0%, #151a21 0%, #0a0c0f 60%); border-color: #1b2129; border-radius: 16px; }
body.theme-premium .dash-head { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
body.theme-premium .dash-clock { display: flex; align-items: baseline; gap: 14px; color: var(--fg); }
body.theme-premium #dashClock { font-family: "HikoMono", "SF Mono", Menlo, monospace; font-size: clamp(22px, 2.6vw, 40px); font-weight: 700; }
body.theme-premium .dash-date { display: inline; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-size: clamp(11px, .9vw, 14px); }
body.theme-premium .flightno .flap-char, body.theme-premium .airport .flap-char {
  background: linear-gradient(180deg, #ffffff 0%, #b0b8c4 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.theme-premium .flightno, body.theme-premium .airport, body.theme-premium .v, body.theme-premium .idle-clock,
body.theme-premium #nextFlight { font-family: "HikoMono", "SF Mono", Menlo, Consolas, monospace; }
body.theme-premium .flightno { font-size: clamp(22px, 3.2vw, 46px); font-weight: 700; }
body.theme-premium .airport { font-weight: 700; letter-spacing: 0; }
body.theme-premium .chip { background: rgba(200, 16, 46, .1); color: #ff5a6e; border: 1px solid rgba(200, 16, 46, .7); border-radius: 4px; }
body.theme-premium .chip.ok { background: rgba(46, 125, 50, .14); color: #6fdc8c; border-color: rgba(46, 125, 50, .7); }
body.theme-premium .chip.warn { background: rgba(224, 164, 88, .12); color: #e0a458; border-color: rgba(224, 164, 88, .7); }
body.theme-premium .status { color: var(--fg); }
body.theme-premium .status.warn { color: #e0a458; }
body.theme-premium .track::before { border-top: 4px solid #232a33; top: 12px; border-radius: 2px; }
body.theme-premium .track-fill { height: 4px; top: 12px; background: linear-gradient(90deg, #c8102e 0%, #ff4d4d 100%); box-shadow: 0 0 15px rgba(200, 16, 46, .6); }
body.theme-premium .plane-icon { color: #fff; text-shadow: 0 0 10px #c8102e; }
/* İki eşit sütun: harita | büyük fotoğraf + kartlar */
body.theme-premium .dash-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
body.theme-premium .photo-card { background: var(--panel); border-color: var(--border); }
body.theme-premium .stat { background: var(--stat); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .05); border-radius: 8px; }
body.theme-premium .k { letter-spacing: 1px; }
body.theme-premium .map-wrap { border-color: var(--border); box-shadow: inset 0 0 50px rgba(0, 0, 0, .8), 0 10px 30px rgba(0, 0, 0, .5); }
body.theme-premium .idle-clock { font-weight: 700; letter-spacing: -2px; }
body.theme-premium .idle-card { background: var(--stat); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-color: rgba(255,255,255,.06); }
body.theme-premium .note-ribbon { background: rgba(200, 16, 46, .06); border-color: rgba(200, 16, 46, .35); }
body.theme-premium .top { border-bottom-color: #c8102e; }
/* CARTO karoları zaten koyu: ters çevirme filtresi uygulanmaz */
.map.carto .leaflet-tile-pane { filter: none !important; }
body.theme-warm .map.carto .leaflet-tile-pane { filter: sepia(.45) brightness(.95) !important; }
@media (max-width: 900px) { body.theme-premium .dash-main { grid-template-columns: 1fr; } }
/* Premium duvar: fotoğraf öne çıksın, kartlar kompakt */
body.theme-premium.mode-wall .route { margin: 10px 0 8px; }
body.theme-premium.mode-wall .photo-card a { min-height: 24vh; overflow: hidden; }
body.theme-premium.mode-wall .photo-card img { height: 100%; max-height: none; }
.photo-card figcaption { position: relative; z-index: 1; background: inherit; }
body.theme-premium.mode-wall .photo-card figcaption { padding: 7px 10px; }
body.theme-premium.mode-wall .stat { padding: .45vw .7vw; }
body.theme-premium.mode-wall .v { font-size: max(15px, 1.35vw); }
body.theme-premium.mode-wall .wx-card { padding: 6px 10px; }
body.theme-premium.mode-wall .side { gap: 8px; }
@media (max-height: 650px) { body.theme-premium.mode-wall .photo-card a { min-height: 18vh; } }

/* ---------- R4 Smart Roster inceleme ---------- */
#smartRoster .sr-duty { border: 1px solid var(--line, #2a3340); border-radius: 12px; padding: 10px; margin: 10px 0; }
#smartRoster .sr-duty header, #smartRoster .sr-leg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#smartRoster .sr-leg { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line, #2a3340); }
#smartRoster .sr-f { display: inline-flex; flex-direction: column; padding: 4px 8px; border-radius: 8px; border: 2px solid transparent; min-width: 64px; }
#smartRoster .sr-f small { font-size: 11px; opacity: .75; }
#smartRoster .sr-f b { font-size: 16px; }
#smartRoster .conf-high { background: rgba(60, 160, 90, .16); border-color: rgba(60, 160, 90, .55); }
#smartRoster .conf-confirmed { background: rgba(70, 130, 220, .16); border-color: rgba(70, 130, 220, .6); }
#smartRoster .conf-medium { background: rgba(230, 170, 40, .18); border-color: rgba(230, 170, 40, .75); }
#smartRoster .conf-low { background: rgba(220, 70, 60, .18); border-color: rgba(220, 70, 60, .8); }
#smartRoster .sr-legend { display: flex; gap: 6px; flex-wrap: wrap; }
#smartRoster .sr-issue { color: #e07a6e; font-size: 13px; margin: 2px 0; width: 100%; }
#smartRoster .sr-src { font-size: 12px; opacity: .7; margin: 4px 0; word-break: break-word; }
#smartRoster .sr-acts { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; margin-top: 6px; }
#smartRoster .sr-edit { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 6px; }
#smartRoster .sr-edit input { width: 96px; }
#smartRoster .sr-change { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-left: 4px solid #6b7a8c; margin: 6px 0; overflow-wrap: anywhere; }
#smartRoster .sr-change-entry { display: grid; gap: 3px; padding: 8px; border: 1px solid var(--line, #2a3340); border-radius: 6px; }
#smartRoster .sr-change-entry span { font-variant-numeric: tabular-nums; }
#smartRoster .sr-change button { min-height: 44px; }
#smartRoster .sr-change.need { border-left-color: #e6aa28; background: rgba(230, 170, 40, .08); }
#smartRoster .sr-ver { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
#smartRoster .st-rejected, #smartRoster .st-superseded, #smartRoster .st-reverted { opacity: .55; }
#smartRoster pre { white-space: pre-wrap; font-size: 12px; max-height: 280px; overflow: auto; }

.m-track-start { fill: var(--map-bg, #0b1320); stroke: #fff; stroke-width: 2; }
.map-legend { flex-wrap: wrap; max-width: calc(100% - 24px); }
#mapStatus:not(:empty) { flex-basis: 100%; }
.aircraft-illustration { display: grid; justify-items: center; gap: .25rem; color: var(--muted); font-size: .75rem; }
.aircraft-illustration svg { width: min(78%, 320px); height: clamp(40px, 7vw, 110px); }
.aircraft-illustration[data-family="unknown"] svg { display: none; }
