.triage { background: var(--bg); }
.wrap.wide { width: min(100% - 2rem, 1320px); }
.hint-sm { font-size: .8rem; color: var(--ink-3); margin-top: .6rem; }

.gate { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 2rem 1rem; }
.gate-card { width: min(100%, 380px); display: grid; gap: .8rem; }
.gate-card h1 { font-size: 1.8rem; }
.gate-card p { color: var(--ink-2); font-size: var(--text-sm); }

.dash { padding: 1.6rem 0 4rem; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; }
.kpi span { display: block; line-height: 1.3; font-size: .78rem; color: var(--ink-3); letter-spacing: .04em; }
.kpi b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: .2rem; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } }

.filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.seg { display: flex; flex-wrap: wrap; gap: .3rem; background: var(--surface-2); padding: .25rem; border-radius: 8px; }
.seg button { font: 500 .82rem var(--font-body); border: 0; background: transparent; color: var(--ink-2); padding: .5rem .8rem; border-radius: 6px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sort { font-size: .82rem; color: var(--ink-3); display: flex; align-items: center; gap: .5rem; }
.sort select { width: auto; padding: .45rem .6rem; font-size: .85rem; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.2rem; align-items: start; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }
.list { display: grid; gap: .5rem; }
.row { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; gap: .9rem; align-items: center; text-align: left; width: 100%; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font: inherit; color: inherit; transition: border-color .15s; }
.row:hover { border-color: var(--ink-3); }
.row.sel { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.ring { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font: 600 1rem var(--font-body); font-variant-numeric: tabular-nums; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; }
.ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; }
.row h3 { font-family: var(--font-body); font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: .8rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { display: inline-block; font-size: .72rem; font-weight: 500; padding: .25rem .55rem; border-radius: 999px; white-space: nowrap; }
.pill.discovery, .pill.quote { background: #dfeadf; color: var(--good); }
.pill.phone, .pill.estimate, .pill.design { background: #f2e6cc; color: var(--warn); }
.pill.decline, .pill.notready, .pill.none { background: #f2dad5; color: var(--bad); }
.pill.status { background: var(--surface-2); color: var(--ink-2); }
.pill.sample { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }
.row .tags { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 8px; }

.detail { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.detail h2 { font-size: 1.6rem; }
.detail .sub { color: var(--ink-3); font-size: .85rem; margin-top: .2rem; }
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin: 1.2rem 0; }
.verdict > div { background: var(--bg); border-radius: 8px; padding: .9rem 1rem; }
.verdict span { font-size: .75rem; color: var(--ink-3); }
.verdict b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.verdict .pill { margin-top: .3rem; }
@media (max-width: 480px) { .verdict { grid-template-columns: 1fr; } }
.detail h4 { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin: 1.4rem 0 .6rem; }
.bars { display: grid; gap: .55rem; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; font-size: .84rem; }
.bar .track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar small { grid-column: 1 / -1; color: var(--ink-3); font-size: .76rem; }
.bar em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.flags { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.flags li { font-size: .84rem; padding: .5rem .7rem; border-radius: 6px; border-left: 3px solid; background: var(--bg); }
.flags .bad { border-color: var(--bad); }
.flags .warn { border-color: var(--warn); }
.flags .info { border-color: var(--ink-3); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .85rem; margin: 0; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; }
.brief { font-size: .9rem; background: var(--bg); padding: .8rem 1rem; border-radius: 6px; white-space: pre-wrap; }
.actions-row { display: grid; grid-template-columns: 1fr; gap: .6rem; }
.actions-row textarea { min-height: 90px; font-size: .9rem; }
.saved { font-size: .78rem; color: var(--good); min-height: 1em; }

dialog { border: 1px solid var(--line); border-radius: 10px; padding: 1.6rem; width: min(92vw, 440px); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(29,33,30,.35); }
dialog h2 { font-size: 1.5rem; margin-bottom: .6rem; }
dialog p { font-size: .88rem; color: var(--ink-2); }
dialog label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 500; margin-top: 1rem; }
dialog input { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.dlg-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.4rem; }

.decide { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1rem 0 .6rem; }
.dbtn { font: 600 1rem var(--font-body); padding: .95rem .6rem; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 52px; }
.dbtn:hover { border-color: var(--ink-3); }
.dbtn.on { color: #fff; border-color: transparent; }
.dbtn.phone.on { background: var(--warn); }
.dbtn.discovery.on, .dbtn.quoting.on { background: var(--good); }
.dbtn.declined.on { background: var(--bad); }
.btn.call { width: 100%; font-size: 1.05rem; padding: 1rem; margin-bottom: .6rem; }

.back-btn { display: none; font: 600 1rem var(--font-body); background: none; border: 0; color: var(--accent); padding: .2rem 0 1rem; cursor: pointer; }
@media (max-width: 979px) {
  .split .detail { display: none; }
  .split.show-detail .detail { display: block; }
  .split.show-detail .list, .split.show-detail ~ * { display: none; }
  .back-btn { display: block; }
  .detail { position: static; max-height: none; }
}
body:has(.split.show-detail) .kpis, body:has(.split.show-detail) .filters { display: none; }
/* Phone: bigger, simpler, one column */
@media (max-width: 700px) {
  .triage { font-size: 1.05rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .kpi b { font-size: 1.7rem; }
  .seg { overflow-x: auto; flex-wrap: nowrap; width: 100%; }
  .seg button { font-size: .95rem; padding: .65rem .9rem; white-space: nowrap; }
  .sort { width: 100%; }
  .sort select { flex: 1; font-size: 1rem; }
  .row { grid-template-columns: 56px minmax(0,1fr); padding: 1rem; }
  .row .tags { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .row h3 { font-size: 1.1rem; }
  .row .meta { font-size: .9rem; white-space: normal; }
  .pill { font-size: .82rem; padding: .3rem .65rem; }
  .detail { position: static; max-height: none; }
  .detail h2 { font-size: 1.8rem; }
  .bar, dl.facts, .flags li { font-size: .95rem; }
  .brief { font-size: 1rem; }
  #toolbar .btn { padding: .6rem .8rem; }
}
#toolbar .btn { font-size: .8rem; }
@media (max-width: 520px) { #export { display: none; } }

@media print {
  .site-header, .kpis, .filters, .list, .decide, .btn, .actions-row { display: none !important; }
  .split { display: block; }
  .detail { position: static; max-height: none; border: 0; padding: 0; }
}
.triage .btn { font-family: var(--font-body); font-size: .85rem; padding: .7rem 1rem; }
