/* BDR HQ — one stylesheet. --brand is set per agency. */
:root {
  --brand: #0f5c6e;
  --ink: #15202b;
  --muted: #5b6875;
  --line: #e2e7ec;
  --bg: #f5f7f9;
  --card: #ffffff;
  --ok: #1f7a4d; --ok-bg: #e6f4ec;
  --warn: #8a5a00; --warn-bg: #fdf3dc;
  --bad: #a3262e; --bad-bg: #fbe9ea;
  --info: #1d5f99; --info-bg: #e7f0fa;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-underline-offset: 2px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .25rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .6rem; }
h2:first-child { margin-top: 0; }
h3 { margin: 0; font-size: 1rem; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.05rem; margin: .2rem 0 .8rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); margin: 0 0 .2rem; font-weight: 600; }

/* Header */
.top { display: flex; align-items: center; gap: 1.5rem; padding: 0 1.25rem; height: 56px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.mark { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.mark .dot { width: 12px; height: 12px; border-radius: 3px; background: var(--brand); }
.top nav { display: flex; gap: .15rem; overflow-x: auto; flex: 1; }
.top nav a { padding: .45rem .7rem; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.top nav a:hover { background: var(--bg); color: var(--ink); }
.top nav a.on { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.me { position: relative; }
.me summary { cursor: pointer; list-style: none; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; white-space: nowrap; }
.me summary::-webkit-details-marker { display: none; }
.me .menu { position: absolute; right: 0; top: 2.6rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; display: grid; gap: .3rem; min-width: 220px; box-shadow: 0 8px 24px rgba(16,24,40,.12); }
.me .menu a, .me .menu .link { padding: .3rem .4rem; text-align: left; }

main { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
main.wide { max-width: 1320px; }

/* Blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
details.card > summary { cursor: pointer; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 1rem; }
a.card { color: inherit; text-decoration: none; display: block; }
a.card:hover { border-color: var(--brand); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.tight { gap: .3rem; flex-wrap: nowrap; }
.row.spread { justify-content: space-between; }
.row.wrap { align-items: flex-end; }
.stack { display: grid; gap: .8rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; display: grid; gap: .1rem; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.stat .value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .note { color: var(--muted); font-size: .8rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { color: var(--ink); margin-bottom: .3rem; }
.empty ul { display: inline-block; text-align: left; }

/* Forms */
.field { display: grid; gap: .25rem; flex: 1; min-width: 160px; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: .78rem; }
.field.small { max-width: 200px; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid #cdd5dc; border-radius: 8px; padding: .5rem .65rem; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 1px; }
textarea { resize: vertical; width: 100%; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem .8rem; margin: 0; display: grid; gap: .6rem; }
legend { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 0 .3rem; }
.check { display: flex; gap: .5rem; align-items: flex-start; }
.check.required.needed { background: var(--warn-bg); border-radius: 8px; padding: .5rem .6rem; font-weight: 600; }
label.inline { display: flex; gap: .35rem; align-items: center; font-size: .85rem; color: var(--muted); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[name=q] { flex: 1; min-width: 220px; }

.btn { font: inherit; font-weight: 600; border: 1px solid #c5ced6; background: #fff; color: var(--ink); padding: .5rem .95rem; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { padding: .75rem 1.3rem; font-size: 1.05rem; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.danger { color: var(--bad); border-color: #e9b8bb; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brand); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger, a.danger { color: var(--bad); }

/* Status */
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; background: #eef1f4; color: var(--muted); text-transform: capitalize; white-space: nowrap; vertical-align: middle; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.flash { padding: .7rem .9rem; border-radius: 8px; margin: 0 0 1rem; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.callout { padding: .6rem .8rem; border-radius: 8px; background: var(--info-bg); margin: .4rem 0 .8rem; }
.callout.warn { background: var(--warn-bg); } .callout.bad { background: var(--bad-bg); color: var(--bad); } .callout.ok { background: var(--ok-bg); color: var(--ok); }
.callout code.key { display: block; margin-top: .4rem; padding: .5rem; background: #fff; word-break: break-all; user-select: all; }

/* Tables and lists */
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.card .table { margin: 0 -.2rem; width: calc(100% + .4rem); }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
.table td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table.num td:not(:first-child) { font-variant-numeric: tabular-nums; }
.table tr.dim { opacity: .55; }
.list, .plain { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.list li:last-child { border-bottom: 0; }
.plain li { padding: .25rem 0; }
.rules li { padding: .4rem 0; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.signals { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .6rem; }
.signals li { display: grid; gap: .15rem; padding: .7rem .85rem; border-radius: 8px; border-left: 4px solid var(--info); background: #f8fafc; }
.signals li.act { border-left-color: var(--bad); } .signals li.watch { border-left-color: #d29a1a; }
.signals .suggest { color: var(--muted); }
.signals li .pill { justify-self: start; }
.cadence { padding-left: 1.2rem; margin: 0; display: grid; gap: .25rem; }
.cadence li span { display: inline-block; min-width: 3.6rem; color: var(--muted); font-size: .85rem; }
.cadence li.done { color: var(--muted); text-decoration: line-through; }
.cadence li.now { font-weight: 600; }
.tabs { display: flex; gap: .2rem; background: #e9edf1; padding: .2rem; border-radius: 9px; }
.tabs a { padding: .35rem .75rem; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .9rem; }
.tabs a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.pager { display: flex; justify-content: space-between; margin-top: .8rem; }

/* The call panel */
.call { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 1rem; align-items: start; }
.call .who h1 { font-size: 1.9rem; }
.call .signal { background: var(--info-bg); padding: .45rem .7rem; border-radius: 8px; display: inline-block; }
.call .dial { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.call .facts { display: flex; gap: .9rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }
.call details { border-top: 1px solid var(--line); padding: .6rem 0; }
.call details summary { font-weight: 600; cursor: pointer; }
.pitch { white-space: pre-wrap; background: var(--bg); padding: .7rem .8rem; border-radius: 8px; margin-top: .5rem; }
.call .log { position: sticky; top: 72px; }
.outcomes { grid-template-columns: 1fr 1fr; }
.choice { display: flex; gap: .45rem; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .55rem; cursor: pointer; font-size: .92rem; }
.choice:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, white); font-weight: 600; }
.choice.connect { border-left: 3px solid var(--ok); }
.meeting .row.wrap { margin-top: .6rem; }

/* Auth */
.auth { max-width: 380px; margin: 9vh auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; box-shadow: 0 10px 30px rgba(16,24,40,.08); }

/* Reports */
.report-head { border-bottom: 3px solid var(--brand); padding-bottom: .8rem; margin-bottom: 1rem; }
.report h2 { margin-top: 1.4rem; }
.terms { margin-top: 1.5rem; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); padding-top: .8rem; }
input.copy { min-width: 280px; font-size: .85rem; color: var(--muted); }

/* Chart */
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line); }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .bar.dials { fill: color-mix(in srgb, var(--brand) 25%, white); }
.chart .bar.connects { fill: var(--brand); }
.chart .dot { fill: #d29a1a; }
.legend { display: flex; gap: 1rem; align-items: center; color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -.6rem; }
.legend .sw.dials { background: color-mix(in srgb, var(--brand) 25%, white); }
.legend .sw.connects { background: var(--brand); }
.legend .sw.dot { background: #d29a1a; border-radius: 50%; }

@media (max-width: 860px) {
  .call { grid-template-columns: 1fr; }
  .call .log { position: static; }
  .top { gap: .4rem .6rem; padding: .5rem .75rem 0; height: auto; flex-wrap: wrap; }
  .mark { font-size: .9rem; flex: 1; min-width: 0; }
  .mark .name { overflow: hidden; text-overflow: ellipsis; }
  .top nav { order: 3; flex-basis: 100%; margin: 0 -.75rem; padding: 0 .5rem .4rem; scrollbar-width: none; }
  .me .menu { right: 0; max-width: calc(100vw - 1.5rem); }
  main { padding: 1rem .8rem 3rem; }
  .table { display: block; overflow-x: auto; }
  .outcomes { grid-template-columns: 1fr; }
}
@media print {
  .top, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .stat, .card { box-shadow: none; }
}
[hidden] { display: none !important; }
.check input[type=checkbox] { width: 1.1rem; height: 1.1rem; margin-top: .15rem; flex: none; }
