/* pipeline — the Chief of Staff funnel board. 2026.
   Shares the Love & Maneuver heart mark; its OWN palette: a dark command-room
   with a single electric-yellow accent. Dark-only by design (the icon is a
   yellow heart on black). */

:root {
  color-scheme: dark;

  --bg: #0b0b0c;
  --bg-grad:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 214, 10, 0.06) 0%, rgba(11, 11, 12, 0) 42%),
    radial-gradient(90% 60% at 100% 0%, rgba(120, 120, 255, 0.05) 0%, rgba(11, 11, 12, 0) 50%);
  --dots: radial-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);

  --surface: #131316;
  --surface-2: #17171b;
  --surface-3: #1f1f25;
  --surface-glass: rgba(20, 20, 24, 0.72);

  --ink: #f4f4f3;
  --ink-soft: #a4a4ad;
  --ink-faint: #6c6c76;
  --line: #26262c;
  --line-strong: #34343c;

  --accent: #ffd60a;
  --accent-2: #ffe24d;
  --accent-dim: rgba(255, 214, 10, 0.16);
  --accent-faint: rgba(255, 214, 10, 0.08);
  --accent-ink: #161200;
  --ring: rgba(255, 214, 10, 0.40);

  /* whose-move */
  --you: #ff5f57;
  --machine: #ffd60a;
  --external: #c4c4cf;
  --cold: #5b5b66;

  /* slice rollup / CI */
  --ok: #36d399;
  --warn: #fbbf24;
  --bad: #f87171;

  --danger: #f8716b;

  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 14px 36px -12px rgba(0, 0, 0, 0.72);
  --shadow-lg: 0 40px 90px -28px rgba(0, 0, 0, 0.86);
  --shadow-accent: 0 6px 22px -6px rgba(255, 214, 10, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--ui);
  color: var(--ink);
  background:
    var(--bg-grad),
    var(--dots) 0 0 / 22px 22px,
    var(--bg);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-soft); font-size: 0.9rem; }
.mono { font-family: var(--mono); }
.empty-hint { padding: 3rem 1rem; line-height: 1.7; max-width: 52ch; margin: 0 auto; color: var(--ink-soft); text-align: center; }

/* ── header ── */
.chrome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem clamp(1rem, 4vw, 2.25rem);
  background: var(--surface-glass);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.mark { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--accent); }
.heart { width: 1.4rem; height: 1.4rem; filter: drop-shadow(0 0 10px rgba(255, 214, 10, 0.45)); }
.mark-word {
  font-family: var(--mono);
  font-size: 1.02rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink);
}
.chrome-nav { display: flex; align-items: center; gap: 1rem; }
.who { color: var(--ink-faint); font-size: 0.74rem; font-family: var(--mono); }

/* ── control bar ── */
.control-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem clamp(1rem, 4vw, 2.25rem);
  max-width: 1500px; margin: 0 auto; width: 100%;
}
.lanes { display: inline-flex; gap: 3px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.lane {
  font-family: var(--ui); font-size: 0.84rem; font-weight: 600;
  padding: 0.42rem 0.95rem; border: none; border-radius: 999px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: background 0.15s, color 0.15s;
}
.lane:hover { color: var(--ink); }
.lane .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lane-color, var(--ink-faint)); box-shadow: 0 0 7px var(--lane-color, transparent); }
.lane.active { background: var(--surface-3); color: var(--ink); }
.lane.active .dot { transform: scale(1.15); }

.controls-right { display: inline-flex; align-items: center; gap: 0.6rem; }
.filter { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.pill-filter {
  font-family: var(--mono); font-size: 0.72rem; line-height: 1;
  padding: 0.34rem 0.5rem; border: none; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-soft); transition: background 0.14s;
}
.pill-filter:hover { background: var(--surface-3); }
.pill-filter.active { background: var(--accent-dim); color: var(--accent); }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.seg button {
  font-family: var(--ui); font-size: 0.8rem; font-weight: 600;
  padding: 0.4rem 0.85rem; border: none; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink-soft); transition: background 0.14s, color 0.14s;
}
.seg button.active { background: var(--surface-3); color: var(--ink); }

.pill-toggle {
  font-family: var(--ui); font-size: 0.8rem; font-weight: 600;
  padding: 0.42rem 0.85rem; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.pill-toggle:hover { color: var(--ink); }
.pill-toggle.active { background: var(--accent-dim); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

main { max-width: 1500px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.25rem) 5rem; width: 100%; }

/* ── buttons ── */
.btn {
  font-family: var(--ui); font-size: 0.86rem; font-weight: 550;
  padding: 0.55rem 1rem; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
  cursor: pointer; transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.08s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; box-shadow: var(--shadow-accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line); color: var(--ink); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 0.34rem 0.7rem; font-size: 0.78rem; }
.btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* ── kanban board ── */
/* `.board`/`.listview` set display, which would override the `hidden` attribute
   (equal specificity, author rule wins) — restore hiding explicitly. */
.board[hidden], .listview[hidden] { display: none; }
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 0.9rem;
  overflow-x: auto;
  padding: 0.5rem 0.2rem 1rem;
  scroll-snap-type: x proximity;
}
.column { scroll-snap-align: start; display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.col-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.2rem 0.35rem; position: sticky; top: 0;
}
.col-name { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); }
.col-count { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.45rem; }
.col-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.col-cards { display: flex; flex-direction: column; gap: 0.6rem; min-height: 8px; }

/* ── card ── */
.card {
  position: relative; text-align: left; font-family: var(--ui);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 0.8rem 0.85rem 0.7rem; cursor: pointer; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 0.5rem; width: 100%;
  transition: transform 0.13s, box-shadow 0.13s, border-color 0.13s;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0.7rem; bottom: 0.7rem; width: 3px;
  border-radius: 3px; background: var(--card-accent, transparent); transition: background 0.13s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card:hover::before { background: var(--accent); }
.card.parked { opacity: 0.52; filter: saturate(0.5); }
.card.parked:hover { opacity: 0.85; }

.card-top { display: flex; align-items: flex-start; gap: 0.5rem; }
.card-type { font-size: 0.95rem; line-height: 1.1; flex: 0 0 auto; filter: grayscale(0.2); }
.card-title { font-size: 0.92rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; flex: 1; }
.card-badge { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; margin-top: 0.28rem; }
.card-badge.you { background: var(--you); box-shadow: 0 0 8px var(--you); }
.card-badge.machine { background: var(--machine); box-shadow: 0 0 8px var(--machine); }
.card-badge.external { background: var(--external); }
.card-badge.cold { background: var(--cold); }

.card-slug { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card-foot { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.slice-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600;
  padding: 0.16rem 0.45rem; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-soft);
}
.slice-chip .sdot { width: 6px; height: 6px; border-radius: 50%; }
.sdot.ok { background: var(--ok); } .sdot.warn { background: var(--warn); } .sdot.bad { background: var(--bad); } .sdot.none { background: var(--ink-faint); }
.stale { margin-left: auto; font-family: var(--mono); font-size: 0.64rem; color: var(--ink-faint); }
.stale.old { color: var(--warn); }

.col-empty { font-size: 0.75rem; color: var(--ink-faint); padding: 0.5rem 0.35rem; border: 1px dashed var(--line); border-radius: var(--r-md); text-align: center; }

/* ── list view ── */
.listview { display: flex; flex-direction: column; gap: 4px; padding: 0.5rem 0; }
.lrow {
  display: grid; grid-template-columns: 1.4rem 1fr auto auto auto; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.lrow:hover { border-color: var(--line-strong); background: var(--surface-3); }
.lrow.parked { opacity: 0.55; }
.lrow .l-title { font-weight: 550; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .l-meta { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); }
.lrow .l-stage { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.lrow .l-chips { display: inline-flex; gap: 0.3rem; }

/* ── FAB ── */
.fab {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 25;
  width: 3.4rem; height: 3.4rem; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-size: 1.7rem; line-height: 1;
  box-shadow: var(--shadow-accent), var(--shadow-md);
  transition: transform 0.12s, background 0.14s;
}
.fab:hover { background: var(--accent-2); transform: scale(1.05); }
.fab:active { transform: scale(0.97); }

/* ── dialog ── */
.dialog {
  border: 1px solid var(--line-strong); border-radius: var(--r-xl); padding: 0; margin: auto;
  width: min(460px, 94vw); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg);
  animation: dialog-in 0.18s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.dialog::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.dialog form { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.dialog h2 { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }

.field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.76rem; color: var(--ink-soft); font-weight: 550; }
.field-row { display: flex; gap: 0.7rem; }
.field-row .field { flex: 1; }
.field input, .field select {
  font-family: var(--ui); font-size: 0.92rem; padding: 0.58rem 0.7rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink);
  transition: border-color 0.14s, box-shadow 0.14s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.form-error { color: var(--danger); font-size: 0.8rem; min-height: 1em; }
.dialog-actions { display: flex; gap: 0.6rem; align-items: center; list-style: none; padding: 0; margin: 0; }
.dialog-actions .spacer { flex: 1; }

/* ── detail slide-over ── */
.detail-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 30; }
.detail-backdrop[hidden] { display: none; }
.detail {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31;
  width: min(480px, 100vw); background: var(--surface);
  border-left: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  overflow-y: auto; animation: slide-in 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.detail[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
.detail-inner { padding: 1.3rem 1.4rem 3rem; display: flex; flex-direction: column; gap: 1.1rem; }

.d-head { display: flex; align-items: flex-start; gap: 0.6rem; }
.d-type { font-size: 1.3rem; }
.d-titlewrap { flex: 1; min-width: 0; }
.d-title { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.d-slug { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); margin-top: 0.2rem; }
.d-close { background: none; border: none; color: var(--ink-faint); font-size: 1.1rem; cursor: pointer; padding: 0.3rem; border-radius: var(--r-sm); }
.d-close:hover { background: var(--surface-3); color: var(--ink); }

.d-meta-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.tag {
  font-family: var(--mono); font-size: 0.66rem; font-weight: 600;
  padding: 0.18rem 0.5rem; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-soft);
}
.tag.lane { color: var(--lane-color, var(--ink)); border-color: color-mix(in srgb, var(--lane-color, var(--line)) 40%, var(--line)); }
.tag.parked { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }

.d-section { display: flex; flex-direction: column; gap: 0.5rem; }
.d-section h3 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); font-weight: 700; }
.d-text { font-size: 0.88rem; line-height: 1.55; color: var(--ink-soft); white-space: pre-wrap; }

.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.ctrl { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.ctrl select, .ctrl input {
  font-family: var(--ui); font-size: 0.85rem; padding: 0.45rem 0.55rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink);
}
.ctrl select:focus { outline: none; border-color: var(--accent); }
.ctrl-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.toggle-row { display: flex; align-items: center; gap: 0.6rem; }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.85rem; color: var(--ink); }
.switch input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }

.slice-row {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
}
.slice-row .sr-top { display: flex; align-items: center; gap: 0.5rem; }
.sr-repo { font-family: var(--mono); font-weight: 600; font-size: 0.82rem; }
.sr-state { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-soft); }
.sr-branch { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-link { margin-left: auto; font-size: 0.72rem; color: var(--accent); text-decoration: none; }
.sr-link:hover { text-decoration: underline; }

.link-row, .item-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; padding: 0.35rem 0; }
.link-row a { color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row a:hover { text-decoration: underline; }
.link-kind { font-family: var(--mono); font-size: 0.62rem; text-transform: uppercase; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.4rem; flex: 0 0 auto; }
.link-ref { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row input { width: 1rem; height: 1rem; accent-color: var(--accent); }
.item-row.done span { text-decoration: line-through; color: var(--ink-faint); }
.item-add { display: flex; gap: 0.4rem; }
.item-add input { flex: 1; font-family: var(--ui); font-size: 0.82rem; padding: 0.4rem 0.55rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); }
.item-add input:focus { outline: none; border-color: var(--accent); }

.exec-box { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-md); padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.45rem; }
.exec-box .cmd { font-family: var(--mono); font-size: 0.74rem; color: var(--accent-2); word-break: break-all; line-height: 1.5; }
.exec-box .cmd-row { display: flex; align-items: center; gap: 0.5rem; }
.copy-btn { font-family: var(--mono); font-size: 0.66rem; background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-soft); border-radius: var(--r-sm); padding: 0.2rem 0.5rem; cursor: pointer; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.preamble {
  font-family: var(--mono); font-size: 0.72rem; line-height: 1.6; color: var(--ink-soft);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 0.8rem; white-space: pre-wrap; max-height: 320px; overflow-y: auto;
}
details > summary { cursor: pointer; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); font-weight: 700; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; color: var(--accent); }
details[open] > summary::before { content: "▾ "; }

/* ── mobile ── */
@media (max-width: 720px) {
  .board { grid-auto-columns: 86vw; }
  .control-bar { gap: 0.6rem; }
  .lanes { order: 1; width: 100%; justify-content: space-between; }
  .controls-right { order: 2; width: 100%; justify-content: space-between; }
  .fab { width: 3.6rem; height: 3.6rem; right: 1.1rem; bottom: 1.1rem; }
  .detail { width: 100vw; }
}
