:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --border-strong: #cdd3da;
  --text: #16202b;
  --muted: #667585;
  --accent: #1f6feb;
  --accent-dark: #1758bd;
  --ok-bg: #e7f6ed;
  --ok-text: #14603a;
  --warn-bg: #fdf3e2;
  --warn-text: #7a4c05;
  --err-bg: #fdeaea;
  --err-text: #8c1d1d;
  --approve: #15803d;
  --decline: #b42318;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.45rem; margin: 0 0 .2rem; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 0; letter-spacing: -.005em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code.code { background: #eef1f4; padding: .15rem .4rem; border-radius: 5px; font-size: .9em; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.num { text-align: right; }
.danger { color: var(--decline); font-weight: 600; }
.pad { padding: .9rem 1.1rem; }
.hint { font-size: .82rem; color: var(--muted); margin: .35rem 0 0; }
.border-top { border-top: 1px solid var(--border); }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: .55rem 1.1rem;
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
}
.brand { font-weight: 650; color: var(--text); display: flex; align-items: center; gap: .4rem; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.1rem; }
.brand-mark.big { font-size: 2rem; display: block; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.nav a {
  padding: .35rem .6rem; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: .92rem;
}
.nav a:hover { background: #f0f2f5; color: var(--text); text-decoration: none; }
.nav a.active { background: #e8eefc; color: var(--accent-dark); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
/* Every page that matters already has its own call to action, so drop the
   duplicate from the header once the bar starts wrapping. */
@media (max-width: 720px) { .topbar-right .btn-primary { display: none; } }

.menu { position: relative; }
.menu summary {
  cursor: pointer; list-style: none; font-size: .9rem; color: var(--muted);
  padding: .35rem .55rem; border-radius: 7px; border: 1px solid var(--border);
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: #f0f2f5; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + .4rem); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 220px; padding: .5rem; display: grid; gap: .15rem; z-index: 30;
}
.menu-meta { padding: .4rem .5rem .6rem; font-size: .85rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu-panel a, .linklike {
  display: block; width: 100%; text-align: left; padding: .4rem .5rem; border-radius: 6px;
  background: none; border: 0; font: inherit; color: var(--text); cursor: pointer;
}
.menu-panel a:hover, .linklike:hover { background: #f0f2f5; text-decoration: none; }

/* ---------- layout ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 1.4rem 1.1rem 2.5rem; }
.narrow { max-width: 720px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head p { margin: 0; font-size: .9rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

.foot {
  max-width: 1180px; margin: 0 auto; padding: 1rem 1.1rem 2rem;
  color: var(--muted); font-size: .82rem; display: flex; gap: 1rem;
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--border); }
.card-head:last-child { border-bottom: 0; }
.empty-state { padding: 2.2rem 1.1rem; text-align: center; }
.empty-state h1, .empty-state h2 { margin-bottom: .4rem; }

.banner {
  display: block; background: #e8eefc; border: 1px solid #c7d7f7; color: var(--accent-dark);
  border-radius: var(--radius); padding: .75rem 1.1rem; margin-bottom: 1rem; font-size: .93rem;
}
.banner:hover { text-decoration: none; background: #dfe8fb; }

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stat-row.inset { margin: 0; padding: .9rem 1.1rem; }
.stat-row.inset .stat { background: #f8f9fb; }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .85rem 1rem;
}
.stat-label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.stat-value { display: block; font-size: 1.8rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.stat-unit { font-size: .78rem; color: var(--muted); }
.stat-accent { border-color: #bcd0f5; background: #f4f8ff; }
.stat-accent .stat-value { color: var(--accent-dark); }
.stat-danger { border-color: #f2c4c0; background: #fdf5f4; }
.stat-danger .stat-value { color: var(--decline); }

/* ---------- lists & tables ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .65rem 1.1rem; border-bottom: 1px solid var(--border);
}
.list li:last-child { border-bottom: 0; }
.list-main { display: flex; align-items: center; gap: .6rem; color: var(--text); min-width: 0; }
.list-main:hover { text-decoration: none; }
a.list-main:hover strong { text-decoration: underline; }
.list-main .block { font-size: .84rem; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
/* Editable rows have too many columns to compress — scroll them instead. */
.table-wide { min-width: 1040px; }
.table th {
  text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: .6rem 1.1rem; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: .55rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfc; }
.row-muted td { opacity: .6; }
.actions { white-space: nowrap; display: flex; gap: .3rem; justify-content: flex-end; }
.inline { display: inline; }

.detail { margin: 0; display: grid; }
.detail > div { display: grid; grid-template-columns: 170px 1fr; gap: 1rem; padding: .65rem 1.1rem; border-bottom: 1px solid var(--border); }
.detail > div:last-child { border-bottom: 0; }
.detail dt { color: var(--muted); font-size: .85rem; }
.detail dd { margin: 0; }
@media (max-width: 560px) { .detail > div { grid-template-columns: 1fr; gap: .15rem; } }

/* ---------- pills, swatches ---------- */
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

.pill {
  display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: .18rem .45rem; border-radius: 999px; white-space: nowrap;
}





/* ---------- forms ---------- */
label { display: block; font-size: .88rem; font-weight: 550; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=month],
input[type=number], input[type=search], select, textarea {
  width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd0f5; outline-offset: 0; border-color: var(--accent); }
textarea { resize: vertical; }
input[type=color] { width: 46px; height: 34px; padding: 2px; margin-top: .25rem; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
label.check { display: flex; align-items: center; gap: .45rem; font-weight: 500; }
label.check input { width: auto; margin: 0; }

.stack { display: grid; gap: .85rem; }
form.card.stack, .card .stack.pad { padding: 1.1rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } }

.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; align-items: end; }
.grid-form-actions { display: flex; align-items: end; }

.filters { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; padding: .9rem 1.1rem; }
.filters label { font-size: .82rem; }
.filters input, .filters select { min-width: 150px; }
/* The min-width above must not stretch a checkbox away from its own label. */
.filters input[type=checkbox] { min-width: 0; width: auto; }
.filters label.check { padding-bottom: .45rem; }

.inline-input { margin-top: 0; padding: .3rem .4rem; font-size: .88rem; min-width: 90px; }
.inline-input.num { text-align: right; width: 80px; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .48rem .85rem; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 550; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: .3rem .55rem; font-size: .83rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: #f0f2f5; }
.btn-approve { background: var(--approve); color: #fff; }
.btn-approve:hover { filter: brightness(.93); }
.btn-decline { background: var(--surface); border-color: #e5b4af; color: var(--decline); }
.btn-decline:hover { background: #fdf1f0; }
.btn-danger-text { color: var(--decline); }
.cancel-row { margin-top: -.4rem; }

/* ---------- flashes ---------- */
.flash { border-radius: var(--radius); padding: .7rem .95rem; margin-bottom: 1rem; font-size: .92rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); border-color: #bfe3cd; }
.flash-warn { background: var(--warn-bg); color: var(--warn-text); border-color: #f0d9ab; }
.flash-error { background: var(--err-bg); color: var(--err-text); border-color: #f0c0bd; }
.inset-flash { margin: 0 1.1rem 1.1rem; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; margin-bottom: .9rem; }
.tabs a {
  padding: .32rem .6rem; border-radius: 7px; font-size: .87rem; color: var(--muted);
  text-transform: capitalize; border: 1px solid transparent;
}
.tabs a:hover { background: #f0f2f5; text-decoration: none; }
.tabs a.active { background: var(--surface); border-color: var(--border-strong); color: var(--text); font-weight: 550; }
.tab-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 .4rem; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 88vh; display: grid; place-items: center; padding: 2rem 1.1rem; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 4px 20px rgba(16, 24, 40, .07); padding: 1.8rem;
}
.auth-head { text-align: center; margin-bottom: 1.3rem; }
.auth-head h1 { margin: .5rem 0 .3rem; }
.auth-head p { margin: 0; font-size: .9rem; }
.auth-alt { text-align: center; font-size: .88rem; color: var(--muted); margin: 1.1rem 0 0; }


/* =====================================================================
   Feature requests
   ===================================================================== */
:root {
  --need-now-bg: #fde8e6;    --need-now-fg: #8c1d1d;    --need-now-line: #e88a83;
  --need-next-bg: #fdefd2;  --need-next-fg: #7a4c05;  --need-next-line: #e0a63a;
  --need-paid-bg: #ece8fb; --need-paid-fg: #45359b; --need-paid-line: #9b8de0;
  --need-notdoing-bg: #e6e9ed;    --need-notdoing-fg: #3d4852;    --need-notdoing-line: #8a96a3;
  --need-none-bg: #f1f3f5;    --need-none-fg: #667585;    --need-none-line: #b5bec8;
}

/* Need: the decision this app exists to capture */
.need { display: inline-block; font-size: .78rem; font-weight: 600; padding: .16rem .55rem; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.need-now    { background: var(--need-now-bg);    color: var(--need-now-fg);    border-color: var(--need-now-line); }
.need-next  { background: var(--need-next-bg);  color: var(--need-next-fg);  border-color: var(--need-next-line); }
.need-paid { background: var(--need-paid-bg); color: var(--need-paid-fg); border-color: var(--need-paid-line); }
.need-notdoing    { background: var(--need-notdoing-bg);    color: var(--need-notdoing-fg);    border-color: var(--need-notdoing-line); }
.need-none, .need-untriaged { background: var(--need-none-bg); color: var(--need-none-fg); border: 1px dashed var(--need-none-line); }

select.need-select {
  margin: 0; width: auto; min-width: 128px; padding: .28rem 1.4rem .28rem .55rem; font-size: .82rem; font-weight: 600;
  border-radius: 999px; cursor: pointer;
}
select.need-select.need-none { font-weight: 500; }
select.need-select.busy { opacity: .55; pointer-events: none; }
select.need-select.failed { outline: 2px solid var(--decline); }

/* Status pills */
.status { display: inline-block; font-size: .72rem; font-weight: 600; padding: .16rem .5rem; border-radius: 6px; white-space: nowrap; background: #eef1f4; color: #465565; }
.status-launched { background: var(--ok-bg); color: var(--ok-text); }
.status-in-progress, .status-in-progress-partnership { background: #e3edfd; color: #1a4fa8; }
.status-up-next { background: #e0f0f6; color: #135a75; }
.status-pending { background: var(--warn-bg); color: var(--warn-text); }
.status-follow-up { background: #ece8fb; color: #45359b; }
.status-under-consideration { background: #f3e9f6; color: #6b2a80; }
.status-in-backlog { background: #eef1f4; color: #465565; }
.status-deferred { background: #e9ecef; color: #56616d; }
.status-declined { background: var(--err-bg); color: var(--err-text); }

.tag { display: inline-block; font-size: .72rem; padding: .08rem .4rem; border-radius: 5px; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.tag-prospect { background: #fdf3e2; color: #7a4c05; }
.tag-partner { background: #ece8fb; color: #45359b; }
.blocker { display: inline-block; font-size: .72rem; font-weight: 650; padding: .08rem .4rem; border-radius: 5px; background: #b42318; color: #fff; white-space: nowrap; }
.prio { font-size: .82rem; }
.prio-Critical { color: var(--decline); font-weight: 700; }
.prio-High { color: #b54708; font-weight: 600; }
.size-chip { display: inline-block; min-width: 2.1rem; text-align: center; font-size: .78rem; font-weight: 600; padding: .08rem .35rem; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); }
.overdue { color: var(--decline); font-weight: 600; }

/* Nav badge */
.nav-badge { display: inline-block; margin-left: .3rem; min-width: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 650; text-align: center; line-height: 1.35rem; }

/* Dashboard */
a.stat { color: inherit; display: block; }
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat-row.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .stat-row.five { grid-template-columns: repeat(2, 1fr); } }
.cta-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: #e8eefc; border: 1px solid #c7d7f7; border-radius: var(--radius); padding: .9rem 1.1rem; margin-bottom: 1rem; }
.cta-banner p { margin: 0; }
.cta-banner strong { color: var(--accent-dark); }
.bars { display: grid; gap: .55rem; padding: .9rem 1.1rem 1.1rem; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 40px; gap: .7rem; align-items: center; font-size: .88rem; color: var(--text); }
.bar-row:hover { text-decoration: none; }
.bar-row:hover .bar-fill { filter: brightness(.94); }
.bar-track { background: #eef1f4; border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; min-width: 2px; }
.bar-fill.need-now { background: var(--need-now-line); }
.bar-fill.need-next { background: var(--need-next-line); }
.bar-fill.need-paid { background: var(--need-paid-line); }
.bar-fill.need-notdoing { background: var(--need-notdoing-line); }
.bar-fill.need-untriaged { background: var(--need-none-line); border: 0; }
.bar-fill.plain { background: #8aa4d6; }
.bar-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 96px 1fr 32px; } }

.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem 1.1rem; border-bottom: 1px solid var(--border); }
.item-list li:last-child { border-bottom: 0; }
.item-main { min-width: 0; }
.item-main a { font-weight: 550; color: var(--text); }
.item-main a:hover { color: var(--accent-dark); }
.item-sub { display: block; font-size: .82rem; color: var(--muted); }
.card-empty { padding: 1.2rem 1.1rem; color: var(--muted); font-size: .9rem; }

/* Toolbar (list + board) */
.toolbar { padding: .85rem 1.1rem; display: grid; gap: .75rem; }
.toolbar-main { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.toolbar-main .search { flex: 1 1 260px; margin: 0; }
.toolbar-filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.toolbar-filters label { font-size: .76rem; color: var(--muted); font-weight: 550; }
.toolbar-filters select { min-width: 130px; max-width: 200px; padding: .36rem .5rem; font-size: .86rem; margin-top: .15rem; }
.toolbar-filters label.check { padding-bottom: .4rem; color: var(--text); font-size: .86rem; }
.toolbar .clear { font-size: .86rem; padding-bottom: .4rem; }

.count-line { font-size: .88rem; color: var(--muted); margin: 0 0 .5rem; }

.bulk-bar { display: none; position: sticky; bottom: .8rem; z-index: 15; margin: .8rem 0 0; background: #16202b; color: #fff; border-radius: 12px; padding: .65rem .9rem; box-shadow: 0 6px 24px rgba(16,24,40,.28); align-items: center; gap: .6rem; flex-wrap: wrap; }
.bulk-bar.show { display: flex; }
.bulk-bar .btn { border-color: transparent; }
.bulk-bar .btn-ghost { background: #2a3746; color: #fff; }
.bulk-bar .btn-ghost:hover { background: #3a4a5c; }
.bulk-count { font-weight: 600; margin-right: .3rem; }

.table-req { min-width: 900px; }
.table-req th, .table-req td { padding-left: .75rem; padding-right: .75rem; }
.table-req th:first-child, .table-req td:first-child { width: 34px; padding-right: 0; }
.table-req td.title-cell { min-width: 300px; max-width: 460px; }
.title-cell a.title { font-weight: 600; color: var(--text); }
.title-cell a.title:hover { color: var(--accent-dark); }
.title-cell .sub { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.table-req input[type=checkbox] { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.table-req tr.selected td { background: #f2f6fe; }

/* Board */
.board { display: grid; grid-template-columns: repeat(5, minmax(205px, 1fr)); gap: .8rem; align-items: start; overflow-x: auto; padding-bottom: .8rem; }
.lane { background: #eceff3; border-radius: var(--radius); border: 2px solid transparent; min-height: 140px; }
.lane.over { border-color: var(--accent); background: #e3ecfb; }
.lane-head { padding: .7rem .8rem .3rem; }
.lane-head h2 { display: flex; justify-content: space-between; align-items: center; }
.lane-head p { margin: .15rem 0 0; font-size: .78rem; color: var(--muted); line-height: 1.3; }
.lane-count { font-size: .8rem; font-weight: 650; color: var(--muted); }
.lane-cards { padding: .5rem .55rem .7rem; display: grid; gap: .5rem; }
.lane-top { height: 4px; border-radius: 8px 8px 0 0; }
.lane-now .lane-top { background: var(--need-now-line); }
.lane-next .lane-top { background: var(--need-next-line); }
.lane-paid .lane-top { background: var(--need-paid-line); }
.lane-notdoing .lane-top { background: var(--need-notdoing-line); }
.lane-untriaged .lane-top { background: var(--need-none-line); }
.card-item { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: .6rem .65rem; box-shadow: var(--shadow); cursor: grab; }
.card-item.dragging { opacity: .45; }
.card-item a.title { font-weight: 600; font-size: .9rem; color: var(--text); display: block; line-height: 1.3; }
.card-item a.title:hover { color: var(--accent-dark); }
.card-item .who { font-size: .8rem; color: var(--muted); margin: .15rem 0 .4rem; }
.card-item .chips { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.card-item select.need-select { margin-top: .5rem; min-width: 0; width: 100%; border-radius: 8px; font-size: .78rem; }

/* Triage */
.triage-wrap { max-width: 860px; margin: 0 auto; }
.progress { height: 8px; background: #e3e7ec; border-radius: 999px; overflow: hidden; margin: .4rem 0 .2rem; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.triage-card { padding: 1.3rem 1.4rem; }
.triage-card h1 { font-size: 1.35rem; line-height: 1.3; margin-bottom: .5rem; }
.triage-meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; font-size: .9rem; }
.triage-notes { background: #f8f9fb; border: 1px solid var(--border); border-radius: 9px; padding: .8rem .95rem; font-size: .92rem; white-space: pre-wrap; max-height: 260px; overflow: auto; margin: 0 0 1rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem 1rem; margin: 0 0 1.1rem; }
.facts div { font-size: .88rem; }
.facts dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.facts dd { margin: 0; }
.decide { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0; }
@media (max-width: 700px) { .decide { grid-template-columns: repeat(2, 1fr); } }
.decide button { text-align: left; border-radius: 10px; padding: .7rem .8rem; cursor: pointer; font: inherit; border: 2px solid; display: grid; gap: .15rem; }
.decide button:hover { filter: brightness(.96); transform: translateY(-1px); }
.decide button strong { font-size: .98rem; }
.decide button small { font-size: .76rem; line-height: 1.3; opacity: .9; }
.decide kbd { font: 600 .72rem/1 ui-monospace, Menlo, Consolas, monospace; background: rgba(255,255,255,.75); border: 1px solid currentColor; border-radius: 4px; padding: .12rem .3rem; float: right; opacity: .8; }
.decide .need-now { border-color: var(--need-now-line); }
.decide .need-next { border-color: var(--need-next-line); }
.decide .need-paid { border-color: var(--need-paid-line); }
.decide .need-notdoing { border-color: var(--need-notdoing-line); }
.triage-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.shortcuts { font-size: .8rem; color: var(--muted); }

/* Detail */
.need-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; padding: 0 1.1rem 1rem; }
.need-picker label { position: relative; cursor: pointer; }
.need-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.need-picker span { display: block; padding: .6rem .7rem; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); font-weight: 600; font-size: .9rem; }
.need-picker span small { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); line-height: 1.3; margin-top: .1rem; }
.need-picker input:checked + span.need-now { background: var(--need-now-bg); border-color: var(--need-now-line); color: var(--need-now-fg); }
.need-picker input:checked + span.need-next { background: var(--need-next-bg); border-color: var(--need-next-line); color: var(--need-next-fg); }
.need-picker input:checked + span.need-paid { background: var(--need-paid-bg); border-color: var(--need-paid-line); color: var(--need-paid-fg); }
.need-picker input:checked + span.need-notdoing { background: var(--need-notdoing-bg); border-color: var(--need-notdoing-line); color: var(--need-notdoing-fg); }
.need-picker input:checked + span.need-none { background: var(--need-none-bg); border-color: var(--need-none-line); color: var(--need-none-fg); }
.need-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .85rem; padding: 1rem 1.1rem; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: 0 1.1rem 1.1rem; }
.form-actions .spacer { flex: 1; }
.meta-line { font-size: .84rem; color: var(--muted); }
.sibling-list { list-style: none; margin: 0; padding: 0; }
.sibling-list li { display: flex; justify-content: space-between; gap: .6rem; padding: .45rem 1.1rem; border-top: 1px solid var(--border); font-size: .88rem; align-items: center; }
.link-chip { display: inline-block; font-size: .78rem; padding: .1rem .45rem; border-radius: 5px; background: #e8eefc; color: var(--accent-dark); }

.created-box { background: var(--ok-bg); color: var(--ok-text); border: 1px solid #bfe3cd; border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; }
.created-box code { background: #fff; padding: .1rem .4rem; border-radius: 5px; font-size: .95em; user-select: all; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: #16202b; color: #fff; padding: .55rem .95rem; border-radius: 10px; font-size: .88rem; box-shadow: 0 6px 24px rgba(16,24,40,.3); z-index: 50; }
.toast.error { background: var(--decline); }
.kbd { font: 600 .72rem/1 ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--border-strong); border-radius: 4px; padding: .1rem .3rem; background: var(--surface); }
.toolbar-filters label { display: grid; gap: .15rem; }
.toolbar-filters label.check { display: flex; }
.toolbar-filters select { margin-top: 0; }

/* Board grouped by status: up to ten columns, so they wrap to fit */
.board-status { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.lane-status .lane-top { background: #8aa4d6; }
select.status-select { margin: .5rem 0 0; width: 100%; padding: .28rem .5rem; font-size: .78rem; font-weight: 600; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
select.status-select.busy { opacity: .55; pointer-events: none; }
select.status-select.failed { outline: 2px solid var(--decline); }
tr.group-row td { background: #f1f4f8; font-size: .86rem; padding-top: .45rem; padding-bottom: .45rem; border-bottom: 1px solid var(--border-strong); }
tr.group-row:hover td { background: #f1f4f8; }

/* ---------- SOP: discovery, scoring, deadlines ---------- */
.steps { display: grid; gap: 0; }
.step-head { display: flex; align-items: center; gap: .6rem; }
.step-no { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .78rem; font-weight: 700; flex: none; }
.step-note { font-size: .84rem; color: var(--muted); padding: .7rem 1.1rem 0; margin: 0; }
.lock-note { font-size: .82rem; color: var(--warn-text); background: var(--warn-bg); border-radius: 8px; padding: .4rem .65rem; margin: .7rem 1.1rem 0; }
.error-list { margin: 0 0 1rem; padding: .7rem .95rem .7rem 1.8rem; background: var(--err-bg); color: var(--err-text); border: 1px solid #f0c0bd; border-radius: var(--radius); font-size: .92rem; }
.req { color: var(--decline); font-weight: 700; }
.field-err input, .field-err select, .field-err textarea { border-color: var(--decline); }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; padding: 1rem 1.1rem 0; }
.score-grid label small { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; line-height: 1.3; }
.score-total { display: flex; align-items: baseline; gap: .6rem; padding: .8rem 1.1rem 1rem; }
.score-total strong { font-size: 1.7rem; letter-spacing: -.02em; }
.score-chip { display: inline-block; min-width: 2.4rem; text-align: center; font-size: .78rem; font-weight: 700; padding: .08rem .4rem; border-radius: 5px; background: #e8eefc; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.score-chip.zero { background: #eef1f4; color: var(--muted); font-weight: 500; }
.tag-legacy { background: #eef1f4; color: var(--muted); }
.tag-late { background: var(--warn-bg); color: var(--warn-text); }
.tag-overdue { background: var(--err-bg); color: var(--err-text); font-weight: 600; }
.tag-ok { background: var(--ok-bg); color: var(--ok-text); }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; }
.clock.late { color: var(--decline); }
.attention-row { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; }
.attention-row form { display: inline; }
.sub-panel { margin: .9rem 1.1rem 1.1rem; padding: .8rem .95rem; border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; }
.sub-panel h3 { margin: 0 0 .5rem; font-size: .92rem; }
.checklist { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .3rem; font-size: .88rem; }
.checklist li::before { content: "CB"; margin-right: .45rem; color: var(--muted); }
.checklist li.done::before { content: "¹3"; color: var(--approve); font-weight: 700; }
.triage-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin: .5rem 0 1rem; }
.discovery { display: grid; gap: .5rem; margin: 0 0 1.1rem; }
.discovery div { font-size: .9rem; }
.discovery dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.discovery dd { margin: 0; white-space: pre-wrap; }

/* ---------- wider pages, so tables have room ---------- */
.page { max-width: 1480px; }
.topbar-inner { max-width: 1480px; }
.foot { max-width: 1480px; }
.narrow { max-width: 760px; }

/* ---------- grid: sort, resize, move, hide ---------- */
.table.grid { table-layout: fixed; width: 100%; min-width: 0; }
.grid th, .grid td { overflow-wrap: anywhere; }
.grid th { position: relative; cursor: pointer; user-select: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 1.1rem; }
.grid th.sel, .grid td.sel { cursor: default; width: 40px; padding: .55rem 0 .55rem .75rem; }
.grid th:hover { background: #f3f5f8; color: var(--text); }
.grid th:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid th.dragging { opacity: .45; }
.grid th.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
.grid th.drop-after { box-shadow: inset -3px 0 0 var(--accent); }
.grid .col-off { display: none; }
.grid .sort-ind { display: inline-block; margin-left: .3rem; font-size: .7rem; color: var(--accent-dark); }
.grid th[data-sorted="asc"] .sort-ind::after { content: "\25B2"; }
.grid th[data-sorted="desc"] .sort-ind::after { content: "\25BC"; }
.grid th[data-sorted] { color: var(--accent-dark); background: #eef3fd; }
.grid .resizer { position: absolute; top: 0; right: 0; width: 9px; height: 100%; cursor: col-resize; touch-action: none; }
.grid .resizer::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 3px; width: 2px; border-radius: 2px; background: var(--border-strong); }
.grid th:hover .resizer::after, .grid .resizer:hover::after { background: var(--accent); }
body.grid-resizing, body.grid-resizing * { cursor: col-resize !important; user-select: none !important; }
.grid td { vertical-align: top; }
.grid td.num, .grid th.num { text-align: right; }
.grid td .need-select, .grid td .status-select { max-width: 100%; }
.grid td.cell-feature .title { font-weight: 600; color: var(--text); }
.grid td.cell-feature .title:hover { color: var(--accent-dark); }
.grid td.cell-feature .sub { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.grid select.need-select { min-width: 0; width: 100%; }
.grid select.status-select { margin-top: 0; }

.grid-menu summary { list-style: none; cursor: pointer; }
.grid-menu summary::-webkit-details-marker { display: none; }
.grid-panel { min-width: 300px; max-height: 70vh; overflow: auto; right: 0; left: auto; }
.grid-cols { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.grid-cols li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .15rem .4rem; border-radius: 6px; }
.grid-cols li:hover { background: #f0f2f5; }
.grid-cols label.check { font-weight: 500; font-size: .88rem; flex: 1; }
.grid-move { display: flex; gap: .15rem; }
.grid-move .btn { padding: .1rem .4rem; font-size: .8rem; }

.bulk-sep { width: 1px; height: 1.4rem; background: #3a4a5c; margin: 0 .3rem; }
.bulk-select { width: auto; margin: 0; padding: .25rem .5rem; font-size: .85rem; background: #2a3746; color: #fff; border-color: #3a4a5c; }
