/* claude_code_planner board — plan task 4.1.
   Structure first; colours and spacing live in the tokens below so they can be tuned to the screenshots later. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1b1f24;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #2563eb;
  --build: #3b82f6;
  --review: #8b5cf6;
  --approve: #16a34a;
  --riaz: #f59e0b;
  --cross: #dc2626;
  --bar-track: #e9ecf0;
  --radius: 6px;
  --gap: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); }
body { margin: 0; padding: 0 var(--gap) 48px; max-width: 1280px; margin-inline: auto; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 600; }
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.page-header { padding: 20px 0 8px; }
.page-header__row { display: flex; align-items: center; justify-content: space-between; }
.page-header h1 { font-size: 22px; letter-spacing: .02em; }
.legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 12.5px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.icon-button { background: none; border: 1px solid transparent; border-radius: var(--radius); padding: 6px; cursor: pointer; color: var(--muted); line-height: 0; font-size: 20px; }
.icon-button:hover { color: var(--ink); border-color: var(--line); background: var(--panel); }

/* Panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: var(--gap); }
.notice { color: var(--muted); margin: 24px 0; }
.error { color: var(--cross); background: var(--panel); border: 1px solid var(--cross); border-radius: var(--radius); padding: 12px 16px; margin: 24px 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* Project row */
.project { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(320px, 3fr) 72px; gap: 18px; align-items: center; }
.project__name { font-weight: 600; font-size: 16px; word-break: break-word; }
.project__current { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.money { display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: 12px; }
.money dt { color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; align-self: end; }
.money dd { margin: 0; font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.money__sub { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px 14px; }
.bar { display: block; font-size: 11.5px; }
.bar__label { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); }
.bar__figure { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar__track { height: 4px; background: var(--bar-track); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--accent); width: 0; }
.bar--build .bar__fill { background: var(--build); }
.bar--review .bar__fill { background: var(--review); }
.bar--approve .bar__fill { background: var(--approve); }
.bar__note { color: var(--muted); font-size: 11px; margin-top: 2px; }
.percent { text-align: right; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.percent small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }

/* Coders strip */
.coders { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.coder { padding: 10px 14px; border-right: 1px solid var(--line); min-width: 0; }
.coder:last-child { border-right: 0; }
.coder__slot { color: var(--muted); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.coder__name { font-weight: 600; }
.coder__state { font-size: 12px; color: var(--muted); }
.coder__task { font-size: 12.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coder__queue { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.coder--planner .coder__name { color: var(--muted); letter-spacing: .06em; font-size: 12px; }

/* Phase block */
.phase__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; }
.phase__title { font-size: 15px; }
.phase__title .muted { font-weight: 400; margin-left: 8px; font-size: 12px; }
.phase__bars { display: grid; grid-template-columns: repeat(3, 110px); gap: 14px; }
.phase--parked .phase__title, .phase--parked .tasks { opacity: .6; }
.phase--struck .phase__title { text-decoration: line-through; }
.phase__attachments { font-size: 12px; margin-top: 4px; }

/* Task table */
.table-scroll { overflow-x: auto; margin-top: 10px; -webkit-overflow-scrolling: touch; }
.tasks { width: 100%; border-collapse: collapse; min-width: 860px; font-size: 13px; }
.tasks th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tasks td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tasks tr.task--reason td { border-bottom: 0; padding-bottom: 2px; }
.tasks tr.reason td { padding-top: 0; color: var(--cross); font-size: 12.5px; }
.tasks .col-num { width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tasks .col-text { min-width: 280px; }
.tasks .col-num-right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tasks .col-chip { width: 44px; text-align: center; }
.tasks .col-link { white-space: nowrap; }
.task--struck .col-text, .task--struck .col-num { text-decoration: line-through; color: var(--muted); }
.task--parked td { color: var(--muted); }
.task__attachments { margin-top: 3px; font-size: 12px; }
.task__attachments a + a::before { content: " · "; color: var(--muted); }
.task__note { font-size: 12px; color: var(--muted); }

/* Chips */
.chip { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line); background: transparent; vertical-align: middle; padding: 0; line-height: 0; }
.chip--build.chip--on { background: var(--build); border-color: var(--build); }
.chip--review.chip--on { background: var(--review); border-color: var(--review); }
.chip--approve.chip--on { background: var(--approve); border-color: var(--approve); }
.chip--riaz { border-color: var(--riaz); border-style: dashed; }
.chip--cross { border-color: var(--cross); color: var(--cross); font-weight: 700; font-size: 13px; line-height: 13px; text-align: center; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--approve); }
button.chip[disabled] { cursor: not-allowed; }
.chip--pending { opacity: .5; }

/* Add rows */
.add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.add-row input[type="text"] { flex: 1 1 260px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: var(--panel); color: var(--ink); }
.add-row input.short { flex: 0 0 90px; }
.add-row .status { flex-basis: 100%; font-size: 12.5px; color: var(--muted); min-height: 1em; }
.add-row .status--error { color: var(--cross); }
.button { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.button:hover { border-color: var(--ink); }
.button--danger { border-color: var(--cross); color: var(--cross); }
.button[disabled] { opacity: .5; cursor: not-allowed; }

/* Brief panel */
.brief__title { font-size: 13px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.08); z-index: 10; display: flex; flex-direction: column; }
.drawer[hidden] { display: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 16px; }
.drawer__body { overflow-y: auto; padding: 8px 16px 32px; }
.drawer section { padding: 12px 0; border-bottom: 1px solid var(--line); }
.drawer section:last-child { border-bottom: 0; }
.drawer h3 { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.drawer dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.drawer dt { color: var(--muted); }
.drawer dd { margin: 0; word-break: break-all; }
.field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.field label { flex: 0 0 110px; color: var(--muted); }
.field input { flex: 1 1 120px; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: var(--panel); color: var(--ink); }
.doors { list-style: none; margin: 0; padding: 0; }
.door { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; }
.door__label { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.door__address { grid-column: 1 / -1; padding: 6px 8px; border: 1px dashed var(--riaz); border-radius: var(--radius); word-break: break-all; }
.door__warning { grid-column: 1 / -1; color: var(--riaz); font-size: 12px; }
.unmatched { margin: 0; padding-left: 18px; font-size: 12.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.drawer .status { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.drawer .status--error { color: var(--cross); }

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr 1fr; }
  .project__bars { grid-column: 1 / -1; }
  .percent { text-align: left; }
  .phase__bars { grid-template-columns: repeat(3, minmax(80px, 1fr)); width: 100%; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --panel: #191d23; --ink: #e6e8eb; --muted: #8b93a1; --line: #2a3038; --bar-track: #2a3038;
  }
  .drawer { box-shadow: -8px 0 24px rgba(0,0,0,.5); }
}

#board-status { min-height: 1.2em; margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
#board-status.status--error { color: var(--cross); }
