:root {
  --bg: #101410;
  --raise: #181d19;
  --field: #101510;
  --ink: #eef3ea;
  --muted: #a9baac;
  --line: #314038;
  --accent: #def66a;
  --accent-hover: #e9ff8a;
  --accent-ink: #17200a;
  --ring: #def66a;
  --tier-0: #9ecbff;
  --tier-1: #def66a;
  --tier-2: #ffc45c;
  --tier-3: #ff8a6a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --serif: C059, "Century Schoolbook", "Liberation Serif", Georgia, serif;
  --sans: "Adwaita Sans", "Avenir Next", "Segoe UI", "Liberation Sans", sans-serif;
  --mono: "iA Writer Mono S", "JetBrains Mono", "Liberation Mono", ui-monospace, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f0e4;
    --raise: #fffdf8;
    --field: #fff;
    --ink: #1c2418;
    --muted: #4c5a4e;
    --line: #ddd4c2;
    --accent: #d5ee4e;
    --accent-hover: #e4f77a;
    --accent-ink: #17200a;
    --ring: #1f4d22;
    --tier-0: #1d4e89;
    --tier-1: #3f5c00;
    --tier-2: #8a5a00;
    --tier-3: #a33b16;
    --shadow: 0 16px 40px rgba(40, 36, 20, 0.08);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 68%),
    var(--bg);
}

.skip {
  position: absolute;
  left: 16px;
  top: 0;
  transform: translateY(-120%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 999px;
  z-index: 3;
}

.skip:focus { transform: none; top: 12px; }

.top, .desk {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.top { padding: 28px 0 8px; }

.top-row, .board-head, .actions, .controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.top-row { justify-content: space-between; }

.kicker, .stats, .lifecycle, .hint, .notice, .idx {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.kicker, .stats, .lifecycle, .hint, .notice { color: var(--muted); }

.kicker { display: flex; align-items: center; gap: 8px; text-transform: uppercase; margin: 0; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent);
}

.stats { margin: 0; }

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 3.15rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 8px 0 0;
}

.lede {
  max-width: 62ch;
  margin: 8px 0 14px;
  line-height: 1.45;
}

.bar {
  height: 8px;
  border-radius: 99px;
  background: color-mix(in oklab, var(--line) 80%, transparent);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
}

.desk {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 18px;
  padding: 14px 0 36px;
  align-items: start;
}

.panel {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.editor label, .board h2 {
  display: block;
  font-size: 0.92rem;
  margin: 0 0 8px;
}

textarea, select, input, button { font: inherit; }

textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.45;
}

.actions { margin-top: 10px; }

button, select, .n {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

button {
  padding: 0 14px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 650;
}

button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

button.primary:hover { background: var(--accent-hover); }
button:hover { border-color: var(--muted); }
button:disabled { opacity: 0.38; cursor: not-allowed; }

.hint, .notice, .lifecycle { line-height: 1.4; }
.hint { margin: 10px 0 0; }
.notice { min-height: 1.2em; margin: 8px 0 0; }
.notice.bad { color: var(--tier-3); }

.board-head { justify-content: space-between; }
.board-head h2 { margin: 0; }
.lifecycle { margin: 4px 0 8px; }

.job {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.mark {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--mark, var(--line));
}

.t0 { --mark: var(--tier-0); }
.t1 { --mark: var(--tier-1); }
.t2 { --mark: var(--tier-2); }
.t3 { --mark: var(--tier-3); }

.job-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.idx { color: var(--muted); margin-right: 4px; }

.meter {
  display: flex;
  gap: 4px;
  height: 6px;
  margin: 8px 0;
}

.meter i {
  flex: 1;
  border-radius: 99px;
  background: var(--line);
}

.meter i.on { background: color-mix(in oklab, var(--accent) 42%, var(--line)); }
.meter i.now { background: var(--accent); }

.controls select, .n {
  background: var(--field);
  font-size: 16px;
}

select {
  max-width: 100%;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 16px;
}

.n {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px 0 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.n input {
  width: 3rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  padding: 8px 0;
}

select[data-field="tier"] { color: var(--mark, var(--ink)); }
.job select[data-field="tier"] { color: var(--mark); }

.empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 22px 16px;
  margin-top: 8px;
}

.empty strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.empty p { margin: 0; color: var(--muted); line-height: 1.45; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (min-width: 801px) {
  .editor { position: sticky; top: 16px; }
}

@media (min-width: 1100px) {
  .controls { flex-wrap: nowrap; }
  .controls select { flex: 0 1 auto; }
}

@media (max-width: 800px) {
  .top, .desk { width: min(1120px, calc(100% - 24px)); }
  .top { padding-top: 20px; }
  .desk { grid-template-columns: 1fr; }
  textarea { min-height: 200px; }
  .controls select { flex: 1 1 9rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
