@font-face {
  font-family: "Space Grotesk";
  src: url("assets/space-grotesk.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #191b1a;
  --paper: #e9e5dc;
  --paper-light: #f8f5ed;
  --rail: #20221f;
  --lime: #c6f43d;
  --purple: #826cff;
  --red: #ee5c4d;
  --blue: #429dd3;
  --muted: #6c6d65;
  --line: rgba(25, 27, 26, .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Space Grotesk", Arial, sans-serif;
  min-width: 320px;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

.app-shell { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: 245px;
  color: #f6f3eb;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 100% 26px,
    var(--rail);
  padding: 34px 24px 24px;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.brand-block { display: flex; align-items: flex-start; gap: 14px; }
.brand-mark { display: flex; gap: 3px; height: 45px; align-items: flex-end; }
.brand-mark span { display: block; width: 5px; border-radius: 4px; background: var(--lime); }
.brand-mark span:nth-child(1) { height: 16px; }
.brand-mark span:nth-child(2) { height: 35px; }
.brand-mark span:nth-child(3) { height: 24px; }
.eyebrow, .section-label, .field-label {
  margin: 0;
  text-transform: uppercase;
  font: 600 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .13em;
}
.brand-block .eyebrow { color: #999b92; margin: 0 0 6px; }
.brand { color: inherit; text-decoration: none; text-transform: uppercase; font-size: 28px; font-weight: 650; line-height: .82; letter-spacing: -.08em; }

.shift-card { margin-top: 54px; border: 1px solid #50524c; border-radius: 4px; padding: 14px; background: #282a27; }
.shift-label { color: #999b92; margin: 0 0 5px; font: 10px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .1em; }
.shift-value { margin: 0; font-size: 14px; }
.on-air { display: flex; align-items: center; gap: 7px; margin-top: 14px; color: var(--lime); font: 10px "IBM Plex Mono", monospace; text-transform: uppercase; }
.on-air i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(198,244,61,.12); }

.status-board { margin-top: 42px; }
.section-label { color: #85877f; margin: 0 0 12px 8px; }
.status-jump {
  width: 100%; border: 0; border-bottom: 1px solid #383a36; color: #c4c5bf; background: transparent;
  padding: 13px 8px; display: flex; justify-content: space-between; align-items: center; text-align: left; font-size: 12px;
}
.status-jump:first-of-type { border-top: 1px solid #383a36; }
.status-jump span { display: flex; align-items: center; gap: 8px; }
.status-jump strong { font: 11px "IBM Plex Mono", monospace; color: #777970; }
.status-jump:hover, .status-jump.active { color: white; background: #2c2e2a; }
.status-jump.active strong { color: var(--lime); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.status-dot.in-progress { background: var(--purple); }
.status-dot.blocked { background: var(--red); }
.status-dot.done { background: var(--blue); }
.rail-note { margin: auto 0 0; color: #72746d; font: 10px/1.7 "IBM Plex Mono", monospace; text-transform: uppercase; }

.workspace { grid-column: 2; padding: 39px 48px 72px; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--ink); padding-bottom: 24px; }
.topbar .eyebrow { color: var(--muted); margin-bottom: 7px; }
h1 { margin: 0; font-size: clamp(38px, 4vw, 62px); line-height: .92; letter-spacing: -.065em; font-weight: 560; }
.header-meta { display: flex; align-items: center; gap: 0; font: 10px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.header-meta span { padding: 7px 10px; border: 1px solid var(--ink); }
.header-meta span + span { border-left: 0; background: var(--ink); color: var(--paper); }

.control-deck { display: grid; grid-template-columns: minmax(300px, 1fr) 230px; gap: 20px; padding: 23px 0 25px; border-bottom: 1px solid var(--ink); }
.field-label { display: block; color: var(--muted); margin-bottom: 8px; }
.search-field, .select-field { height: 52px; border: 1px solid var(--ink); background: var(--paper-light); display: flex; align-items: center; }
.search-field:focus-within, .select-field:focus-within { box-shadow: 4px 4px 0 var(--ink); }
.search-field svg { margin-left: 16px; width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.search-field input { width: 100%; height: 100%; border: 0; padding: 0 12px; background: transparent; color: inherit; font-size: 15px; outline: 0; }
.search-field kbd { margin-right: 12px; padding: 4px 6px; border: 1px solid #a7a59d; border-radius: 3px; color: #77766f; background: #ece9e1; font: 10px "IBM Plex Mono", monospace; white-space: nowrap; }
.select-field { position: relative; }
.select-field:after { content: "↓"; position: absolute; right: 16px; pointer-events: none; font: 14px "IBM Plex Mono", monospace; }
.select-field select { appearance: none; width: 100%; height: 100%; padding: 0 44px 0 15px; border: 0; outline: 0; background: transparent; color: inherit; font-size: 14px; }

.list-heading { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 13px; padding: 20px 0 13px; }
.list-heading p { margin: 0; color: var(--muted); font: 10px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.heading-rule { display: flex; gap: 3px; align-items: flex-end; }
.heading-rule span { height: 3px; flex: 1; background: var(--ink); }
.heading-rule span:nth-child(2) { height: 7px; }
.heading-rule span:nth-child(3) { height: 11px; }

.task-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.task-card {
  position: relative; overflow: hidden; min-height: 250px; background: var(--paper-light); border: 1px solid var(--ink); padding: 18px 18px 14px;
  display: flex; flex-direction: column; transition: transform .16s ease, box-shadow .16s ease;
}
.task-card:before { content: ""; position: absolute; left: -5px; top: 13px; bottom: 13px; width: 9px; background: radial-gradient(circle, var(--paper) 3px, transparent 3.5px) center top / 9px 15px; }
.task-card:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); z-index: 1; }
.task-card.status-blocked { background: #f7e5df; }
.task-card.status-done { background: #e2ebe9; }
.task-card.status-in-progress { background: #eeeafa; }
.card-index { display: flex; align-items: center; justify-content: space-between; }
.route-code { font: 10px "IBM Plex Mono", monospace; letter-spacing: .1em; }
.priority { border: 1px solid currentColor; border-radius: 20px; padding: 4px 7px; text-transform: uppercase; font: 9px "IBM Plex Mono", monospace; letter-spacing: .08em; }
.priority-high { color: #bd3128; }
.priority-medium { color: #6b5ad8; }
.priority-low { color: #557168; }
.card-project { color: var(--muted); margin: 23px 0 7px; font: 10px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .1em; }
.task-card h2 { margin: 0; font-size: 21px; line-height: 1.08; letter-spacing: -.04em; font-weight: 600; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 22px; border-bottom: 1px dashed #9e9e96; padding-bottom: 11px; font: 10px "IBM Plex Mono", monospace; color: var(--muted); }
.card-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; }
.card-status { display: flex; align-items: center; gap: 7px; font: 10px "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .05em; }
.open-item { border: 0; background: transparent; padding: 5px 0 5px 8px; font-size: 12px; font-weight: 650; }
.open-item span { display: inline-block; transition: transform .16s ease; }
.open-item:hover span { transform: translateX(4px); }

.empty-state { text-align: center; border: 1px solid var(--ink); background: var(--paper-light); padding: 70px 20px; }
.empty-state[hidden] { display: none; }
.empty-signal { height: 45px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; margin-bottom: 20px; }
.empty-signal span { width: 7px; background: var(--ink); }
.empty-signal span:nth-child(1) { height: 13px; }.empty-signal span:nth-child(2) { height: 42px; }.empty-signal span:nth-child(3) { height: 25px; }
.empty-state h2 { font-size: 36px; letter-spacing: -.05em; margin: 8px 0; }
.empty-state > p:not(.eyebrow) { color: var(--muted); margin: 0 0 22px; }
.empty-state button { border: 1px solid var(--ink); background: var(--lime); padding: 13px 18px; box-shadow: 4px 4px 0 var(--ink); }

.scrim { position: fixed; inset: 0; background: rgba(22,23,21,.66); backdrop-filter: blur(2px); z-index: 10; opacity: 0; transition: opacity .22s ease; }
.scrim.visible { opacity: 1; }
.detail-panel {
  position: fixed; z-index: 11; right: 0; top: 0; bottom: 0; width: min(590px, 100vw); overflow-y: auto;
  background: var(--paper-light); border-left: 1px solid var(--ink); box-shadow: -16px 0 35px rgba(0,0,0,.2);
  padding: 27px 34px 42px; transform: translateX(100%); transition: transform .28s cubic-bezier(.22,.8,.22,1);
}
.detail-panel.open { transform: translateX(0); }
.detail-panel[hidden], .scrim[hidden] { display: none; }
.detail-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.detail-top .eyebrow span { color: var(--muted); margin-left: 8px; }
.close-button { border: 0; background: transparent; display: flex; align-items: center; gap: 9px; text-transform: uppercase; font: 10px "IBM Plex Mono", monospace; }
.close-button i { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid var(--ink); border-radius: 50%; font: normal 19px Arial; }
.manifest-stamp { display: flex; align-items: center; gap: 8px; margin: 26px 0 16px; color: var(--muted); font: 10px "IBM Plex Mono", monospace; text-transform: uppercase; }
.manifest-stamp:before { content: ""; width: 30px; height: 8px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px); }
.detail-panel h2 { margin: 0; max-width: 480px; font-size: clamp(34px, 4vw, 51px); line-height: .98; letter-spacing: -.06em; font-weight: 570; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 29px; }
.detail-tags span { padding: 5px 8px; background: var(--ink); color: white; border-radius: 2px; font: 9px "IBM Plex Mono", monospace; text-transform: uppercase; }
.manifest-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); margin-bottom: 28px; }
.manifest-cell { padding: 14px; min-height: 67px; border-bottom: 1px solid var(--ink); }
.manifest-cell:nth-child(odd) { border-right: 1px solid var(--ink); }
.manifest-cell:nth-last-child(-n+2) { border-bottom: 0; }
.manifest-cell small { display: block; color: var(--muted); text-transform: uppercase; font: 9px "IBM Plex Mono", monospace; letter-spacing: .1em; margin-bottom: 5px; }
.manifest-cell strong { font-size: 13px; font-weight: 550; }
.detail-copy { margin-bottom: 30px; }
.detail-copy p { margin: 0; font-size: 16px; line-height: 1.55; }
.detail-copy p + p { margin-top: 17px; padding: 16px; border-left: 4px solid var(--purple); background: #eeebf8; }
.routing-box { position: relative; border: 1px solid var(--ink); background: #e7e2d5; padding: 18px; box-shadow: 6px 6px 0 var(--ink); }
.routing-box:before { content: "REROUTE"; position: absolute; right: 15px; top: 15px; color: #87877e; font: 9px "IBM Plex Mono", monospace; letter-spacing: .1em; }
.routing-box label { display: block; }
.routing-box .field-label { margin-bottom: 9px; color: var(--ink); }
.routing-box select { width: 100%; height: 50px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper-light); padding: 0 12px; }
.status-feedback { min-height: 18px; margin: 12px 0 0; color: #3d641f; font: 10px "IBM Plex Mono", monospace; text-transform: uppercase; }

.toast { position: fixed; z-index: 20; left: 50%; bottom: 25px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: white; border: 1px solid #fff; padding: 12px 18px; box-shadow: 5px 5px 0 var(--lime); font: 11px "IBM Plex Mono", monospace; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.detail-open { overflow: hidden; }

@media (max-width: 1080px) {
  .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .rail { position: relative; inset: auto; width: auto; height: auto; padding: 18px 18px 15px; display: block; }
  .brand-block { align-items: center; }
  .brand { font-size: 23px; line-height: .85; }
  .shift-card, .rail-note, .section-label { display: none; }
  .status-board { margin-top: 18px; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .status-jump { flex: 0 0 auto; width: auto; border: 1px solid #4a4c46 !important; border-radius: 99px; padding: 8px 11px; gap: 9px; }
  .status-jump strong { margin-left: 8px; }
  .status-jump:first-of-type span { padding-left: 0; }
  .workspace { padding: 26px 16px 52px; }
  .topbar { align-items: flex-start; padding-bottom: 18px; }
  h1 { font-size: 42px; }
  .header-meta span:first-child { display: none; }
  .header-meta span + span { border-left: 1px solid var(--ink); }
  .control-deck { grid-template-columns: 1fr; gap: 13px; padding: 18px 0; }
  .search-field, .select-field { height: 48px; }
  .list-heading { grid-template-columns: 48px 1fr; padding-top: 17px; }
  .list-heading p:last-child { display: none; }
  .task-grid { grid-template-columns: 1fr; }
  .task-card { min-height: 225px; padding-left: 20px; }
  .detail-panel { width: 100%; padding: 20px 18px 40px; border-left: 0; }
  .detail-panel h2 { font-size: 38px; }
  .manifest-grid { grid-template-columns: 1fr 1fr; }
  .toast { width: calc(100% - 32px); text-align: center; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
