:root {
  color-scheme: light;
  --ink: #172b31;
  --muted: #56666a;
  --line: #d5dedc;
  --accent: #006650;
  --navy: #102127;
  --amber: #ffd375;
  --mono: "IBM Plex Mono", Consolas, ui-monospace, monospace;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #f1f4f2;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select, input[type=radio] { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #008780; outline-offset: 3px; }
.mast { background: var(--navy); border-bottom: 3px solid #e4b65b; color: white; }
.mast-inner, main { width: min(1304px, 100%); margin: auto; padding-inline: clamp(16px, 3.6vw, 58px); }
.mast-inner { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .clock { display: flex; align-items: center; gap: 10px; }
.brand img { object-fit: contain; }
.brand strong { font-size: 1.22rem; letter-spacing: -.05em; }
.brand-divider { margin-inline: 5px; height: 21px; width: 1px; background: #64716f; }
.brand-section { color: #c4d3d3; font-size: .875rem; font-weight: 600; }
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .95rem; }
.clock span { font-size: .75rem; color: var(--amber); font-weight: bold; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: clamp(26px, 4vw, 52px) 0 25px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.3rem, 4.5vw, 3.55rem); line-height: 1; font-weight: 730; letter-spacing: -.065em; }
.page-head p { color: var(--muted); margin-top: 10px; line-height: 1.5; }
.refresh { background: white; border: 1px solid #acbcba; color: var(--ink); border-radius: 7px; padding: 9px 15px; font-size: .875rem; font-weight: 650; flex: none; }
.refresh:hover { background: #e4edeb; }
.refresh:disabled { opacity: .65; }
#feed-message:not(:empty) { background: #fff2d3; border: 1px solid #dfc586; color: #654d18; border-radius: 7px; padding: 12px 16px; margin-bottom: 16px; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(285px, .43fr); gap: clamp(16px, 2vw, 28px); align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #10212708; min-width: 0; }
.panel-head, .planner-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head { padding: 20px 22px 15px; }
h2 { font-size: 1.33rem; line-height: 1.15; font-weight: 720; letter-spacing: -.035em; }
.count { font-size: .8rem; font-weight: 630; color: var(--muted); }
.filters { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 9px; padding: 0 22px 20px; }
.filters label, legend { font-size: .875rem; font-weight: 650; }
.filters label { display: grid; gap: 6px; }
.filters input, .filters select { min-width: 0; width: 100%; height: 42px; background-color: white; color: var(--ink); border: 1px solid #aebcb9; border-radius: 6px; padding: 0 10px; font-weight: 450; }
.filters select { appearance: none; padding-right: 25px; background-image: linear-gradient(45deg,transparent 50%,#50645f 50%), linear-gradient(135deg,#50645f 50%,transparent 50%); background-position: calc(100% - 14px) 52%, calc(100% - 10px) 52%; background-size: 4px 4px; background-repeat: no-repeat; }
.stock-grid { display: grid; grid-template-columns: minmax(0, 1.43fr) minmax(95px, .9fr) minmax(92px, 1fr); gap: 12px; align-items: center; }
.board-head { padding: 10px 22px; background: #e9efec; border-block: 1px solid var(--line); font-size: .76rem; color: #344b47; font-weight: 680; }
.stock-row { width: 100%; text-align: left; color: var(--ink); padding: 12px 22px; border: none; border-bottom: 1px solid #e2e8e5; background: white; min-height: 62px; }
.stock-row:last-child { border-bottom: 0; border-radius: 0 0 12px 12px; }
.stock-row:hover { background: #f4f8f5; }
.stock-row[aria-pressed=true] { background: #e6f2ec; box-shadow: inset 4px 0 var(--accent); }
.stock-row:focus-visible { position: relative; outline-offset: -3px; }
.stock-row span { min-width: 0; overflow-wrap: anywhere; }
.item-name { font-size: .96rem; font-weight: 690; line-height: 1.28; }
.sub { font-size: .78rem; color: var(--muted); line-height: 1.4; display: block; margin-top: 3px; }
.quantity { display: block; color: var(--accent); font-family: var(--mono); font-weight: bold; font-size: .95rem; }
.sold { color: #983e28; }
.muted { color: var(--muted); }
.row-window { font-size: .85rem; }
.empty { padding: 28px 22px; color: var(--muted); line-height: 1.5; }
.planner { position: sticky; top: 14px; overflow: hidden; }
.planner-title { background: var(--navy); color: white; padding: 17px 20px; }
.plane { font-size: 1.55rem; color: var(--amber); line-height: 1; }
#plan-toggle { display: none; }
.flight-controls { margin: 18px 18px 14px; padding: 0; min-width: 0; border: 0; }
legend { margin-bottom: 8px; padding: 0; }
.flight-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.flight-options label { position: relative; }
.flight-options input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; }
.flight-options span { min-height: 35px; border-radius: 5px; border: 1px solid #bdcac6; display: grid; place-items: center; font-size: .845rem; font-weight: 600; }
.flight-options input:checked + span { border-color: var(--accent); color: #00513f; background: #deeee6; box-shadow: inset 0 0 0 1px var(--accent); }
.flight-options input:focus-visible + span { outline: 3px solid #008780; outline-offset: 2px; }
#plan { padding: 0 18px 19px; outline-offset: -3px; }
.plan-empty { padding-top: 12px; color: var(--muted); line-height: 1.5; }
.ticket { border-top: 1px dashed #a9b9b4; padding-top: 17px; }
.ticket h3 { font-size: 1.23rem; letter-spacing: -.035em; overflow-wrap: anywhere; }
.route { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .875rem; line-height: 1.4; margin: 5px 0 14px; }
.route-mark { color: #57736c; }
.guidance { background: #19353a; color: white; border-radius: 7px; padding: 13px 14px; }
.guidance h4 { color: var(--amber); font-size: .82rem; margin: 0 0 5px; font-weight: 650; }
.target { display: block; font-size: 1.22rem; font-weight: 680; letter-spacing: -.02em; }
.guidance p { color: #d5e5e3; font-size: .855rem; line-height: 1.45; margin-top: 7px; }
.facts { margin: 12px 0 0; }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid #e3e9e6; }
.facts > div:last-child { border-bottom: 0; }
.facts dt, .facts dd { margin: 0; font-size: .85rem; line-height: 1.4; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; font-weight: 630; }
.back-to-board { display: none; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 12px; margin: 18px 0 26px; color: var(--muted); font-size: .8rem; }
a { color: var(--accent); text-underline-offset: 2px; }
@media(min-width: 861px) {
  #rows { max-height: min(70vh, 850px); overflow-y: auto; scrollbar-color: #adbfba transparent; }
}
@media(max-width: 860px) {
  .workbench { grid-template-columns: minmax(0,1fr); }
  .planner { grid-row: 1; position: static; }
  .planner-title { padding: 13px 18px; }
  .planner .plane { display: none; }
  #plan-toggle { display: block; color: var(--amber); background: transparent; border: 1px solid #75847b; border-radius: 5px; padding: 6px 10px; font-size: .835rem; font-weight: 650; }
  .planner[data-open=false] #planner-body { display: none; }
  .flight-options { grid-template-columns: repeat(4,1fr); }
  .back-to-board { display: block; margin: -5px 18px 14px; width: fit-content; font-size: .82rem; }
  .stock-panel { scroll-margin-top: 8px; }
}
@media(max-width: 550px) {
  .mast-inner { height: 56px; }
  .brand { gap: 6px; }
  .brand img { width: 30px; height: 30px; }
  .brand-section { font-size: .78rem; }
  .clock { font-size: .82rem; gap: 5px; }
  .page-head { align-items: start; margin-bottom: 18px; flex-wrap: wrap; }
  .page-head p { font-size: .94rem; }
  .refresh { padding: 7px 11px; }
  .panel-head { padding: 16px 14px 13px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 0 14px 16px; }
  .filters label:first-child { grid-column: span 2; }
  .board-head, .stock-row { padding-inline: 12px; }
  .stock-grid { grid-template-columns: 1.25fr .95fr .98fr; gap: 6px; }
  .board-head { font-size: .72rem; }
  .stock-row { padding-block: 10px; }
  .quantity,.item-name { font-size: .87rem; }
  .row-window,.sub { font-size: .75rem; }
  .flight-options { grid-template-columns: repeat(2, 1fr); }
}
