:root { color-scheme:light; --bg:#fff; --fg:#111; --stripe:#ececec; --muted:#b6b6b6; --sub:#555; --warn:#a05a00; --error:#b00020; --input:#999; }
:root[data-theme="dark"] { color-scheme:dark; --bg:#151515; --fg:#eee; --stripe:#292929; --muted:#858585; --sub:#ccc; --warn:#ffc16a; --error:#ff8686; --input:#666; }
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font-family:Arial, Helvetica, sans-serif; font-size:15px; }
header { padding:5px 10px 0; }
.top { position:relative; min-height:37px; display:flex; justify-content:center; align-items:flex-start; }
.logo { width:178px; max-height:36px; object-fit:contain; }
[data-theme="dark"] .logo { background:#fff; padding:3px; border-radius:2px; }
#updated { position:absolute; right:0; top:0; color:var(--sub); font-size:14px; text-align:right; }
#updated[data-state="stale"] {color:var(--warn)} #updated[data-state="error"] {color:var(--error)}
.tools { display:flex; justify-content:space-between; align-items:center; gap:8px; min-height:33px; }
.all {display:flex; align-items:center; font-size:19px; font-weight:700; gap:5px; cursor:pointer; white-space:nowrap;}
.all input { width:21px; height:21px; margin:0; accent-color:#555; }
.right { display:flex; align-items:center; gap:9px; min-width:0; }
button { border:0; background:none; color:inherit; font:inherit; padding:0; cursor:pointer; }
button:focus-visible, input:focus-visible { outline:2px solid #417ac9; outline-offset:2px; }
#theme {font-size:22px; line-height:1; padding:4px;}
#search { font:inherit; font-size:13px; border:1px solid var(--input); border-radius:2px; background:var(--bg); color:var(--fg); width:210px; max-width:100%; padding:2px 4px; }
h1, .tabs { font-size:25px; text-align:center; margin:13px 0 14px; font-weight:bold; }
.tabs {display:none;} .tabs button[aria-pressed="false"] {color:var(--muted);}
#boards {display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; padding:0 5px; align-items:start; }
section {min-width:0;} table {border-collapse:separate; border-spacing:2px; width:100%; table-layout:auto;}
th,td {text-align:center; padding:4px 4px; line-height:1.15; white-space:nowrap; }
th {font-weight:700; vertical-align:bottom; padding:2px 3px 5px;} th button {font-weight:700; width:100%;}
.muted {color:var(--muted);} tbody tr:nth-child(odd) td {background:var(--stripe);}
td {user-select:text; -webkit-user-select:text; } td.city, td.status { white-space:normal; overflow-wrap:normal; word-break:normal; }
.compact-only {display:none;}
@media(max-width:1250px){
  .top {justify-content:flex-start; min-height:32px;} .logo {width:135px; max-height:30px;}
  .wide-title{display:none;} .tabs{display:block;}
  #boards{display:block;} #boards[data-view="A"] #dep,#boards[data-view="D"] #arr {display:none;}
  .wide-only {display:none;} .compact-only{display:table-cell;}
  .stack {display:block;line-height:1.15;}
  #search {width:180px;}
}
@media(max-width:600px){
 body{font-size:clamp(9px, 2.1vw, 13px);} header{padding:5px 4px 0;} #boards{padding:0 2px;}
 #updated{font-size:11px;} .logo{width:115px;max-height:25px;} .top{min-height:27px;}
 .all{font-size:14px;gap:3px;} .all input{width:17px;height:17px;} .right{gap:3px;}
 #search{width:135px;font-size:10px;} #theme{font-size:18px;}
 .tabs{font-size:21px;margin:12px 0 14px;}
 table{border-spacing:1px;} th,td{padding:4px 2px;} th{padding-bottom:5px;}
}

/* Entire interactive columns are clickable, while text remains selectable. */
th[data-action], td[data-action] { cursor:pointer; }
th, th button, td { user-select:text; -webkit-user-select:text; }

/* v0.4: aligned board titles, framed controls and persistent flight highlighting. */
:root { --highlight-orange:#ffe2c4; --highlight-blue:#d9eaff; --highlight-green:#dcefd8; --frame:#777; --frame-inactive:#bbb; --active-bg:#ededed; }
:root[data-theme="dark"] { --highlight-orange:#63442b; --highlight-blue:#25466a; --highlight-green:#304e32; --frame:#aaa; --frame-inactive:#666; --active-bg:#383838; }
.board-headings { position:relative; }
.wide-headings { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; padding:0 5px; }
.wide-headings h1 { margin:13px 0 14px; }
.board-headings #theme { position:absolute; right:10px; top:50%; transform:translateY(-50%); min-width:34px; min-height:32px; }

.sort-heading button { width:auto; padding:2px 5px; border:1px solid transparent; border-radius:3px; }
.sort-heading button.active-sort { border-color:var(--frame); }
tbody tr[data-highlight="orange"] td { background:var(--highlight-orange); }
tbody tr[data-highlight="blue"] td { background:var(--highlight-blue); }
tbody tr[data-highlight="green"] td { background:var(--highlight-green); }
tbody td[data-highlight-colour] { cursor:pointer; }
@media(max-width:1250px){
  .wide-headings{display:none;}
  .board-headings .tabs{padding:0 40px;}
  #boards,.board-headings { touch-action:pan-y pinch-zoom; }
}
@media(max-width:600px){
  .board-headings #theme {right:4px;min-width:28px;}
  .sort-heading button {padding:1px 2px;}
}

/* v0.6: clear saved highlights from both boards without changing the current view. */
#clear-colors { position:absolute; left:10px; top:50%; transform:translateY(-50%); padding:3px 6px; font-size:14px; font-weight:700; white-space:nowrap; }

@media(max-width:1250px){
  .board-headings { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:6px; padding:0 10px; }
  #clear-colors { position:static; transform:none; }
  .board-headings .tabs { padding:0; }
  .board-headings #theme { position:static; transform:none; }
}
@media(max-width:600px){
  .board-headings { padding:0 4px; gap:3px; }
  #clear-colors { font-size:11px; padding:3px 4px; }
  .board-headings .tabs { font-size:clamp(15px,4.6vw,21px); }
}

/* v0.8: registration is always visible; Gate/Type shares the compact column. */
@media(max-width:600px){
  th.registration, td.registration { padding-left:1px; padding-right:1px; }
}

/* v0.10: minimal switch and reset action, with large invisible hit areas. */
:root { --switch-off:#c5c5c5; --switch-on:#334c70; --control-disabled:#aaa; }
:root[data-theme="dark"] { --switch-off:#555; --switch-on:#628bc4; --control-disabled:#777; }
button.all { border:0; padding:3px 0; min-height:32px; font-size:15px; font-weight:400; gap:7px; }
.switch-track { display:block; position:relative; width:32px; height:18px; flex:none; border-radius:999px; background:var(--switch-off); }
.switch-track::after { content:""; position:absolute; width:13px; height:13px; top:2.5px; left:3px; border-radius:50%; background:#fff; transition:transform .15s ease; }
button.all[aria-checked="true"] .switch-track { background:var(--switch-on); }
button.all[aria-checked="true"] .switch-track::after { transform:translateX(13px); }
#clear-colors { display:flex; align-items:center; gap:5px; border:0; font-weight:400; font-size:14px; padding:3px 0; min-height:32px; color:var(--fg); }
#clear-colors .reset-icon { width:16px; height:16px; flex:none; }
#clear-colors:disabled { color:var(--control-disabled); cursor:default; }
@media(max-width:600px){
  button.all { font-size:12px; gap:5px; min-height:34px; }
  #clear-colors { font-size:11px; gap:3px; min-height:34px; }
  #clear-colors .reset-icon { width:13px; height:13px; }
}
@media(prefers-reduced-motion:reduce){.switch-track::after{transition:none;}}

/* v0.11: short search field aligned with the right edge, narrower than the normal update label. */
#search { width:112px; min-width:0; }
@media(max-width:600px){ #search { width:88px; } }

/* v0.13: improve cell readability on phones only; keep headers unchanged. */
@media (max-width:600px) {
  tbody td { font-size:clamp(12px, 2.875vw, 17.25px); padding-left:1px; padding-right:1px; }
}

@media (max-width:350px) {
  tbody td { font-size:clamp(10px, 3.25vw, 11.5px); }
}

/* v0.14: condensed font for phone-sized table cells only. */
@font-face {
  font-family: "FIDS Roboto Condensed";
  src: url("fonts/RobotoCondensed.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@media (max-width:600px) {
  tbody td { font-family:"FIDS Roboto Condensed", "Roboto Condensed", Arial, Helvetica, sans-serif; }
}

/* v0.16: optional row highlighting, using the existing switch style. */
.colors-tools { display:flex; align-items:center; }
#boards[data-colors="off"] td[data-highlight-colour] { cursor:auto; }
