/* The Anti-Plug · center layout only.
   Reuses every token and class from app-base.css (header, panels, tiles,
   badges, tables, ledger, footer, focus rings). This file adds only the
   distinct mechanic: the PLUG BAND with its named-approver gate, the
   suspense ghost journal, the residual register with age bars, and the
   trust-boundary strip. Colours come from the base custom properties. */

main.wrap { max-width: 1140px; }

.synline { margin: 14px 0 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.syn.pub { color: var(--accent-d); background: #EEF3FD; border-color: #C9D8F5; }

/* ---- the plug band (the hero mechanic) ---- */
.plugband {
  border: 1px solid var(--line); border-left: 5px solid var(--danger);
  border-radius: 8px; background: var(--surface); margin-bottom: 22px; overflow: hidden;
}
.plugband.plugged { border-left-color: var(--ok); }
.pb-top { display: flex; justify-content: space-between; gap: 24px; padding: 20px 22px; flex-wrap: wrap; }
.pb-kick {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--danger); margin-bottom: 6px;
}
.plugband.plugged .pb-kick { color: var(--ok); }
.pb-amt { font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.pb-sub { font-size: 12.5px; color: var(--body); margin-top: 7px; max-width: 52ch; line-height: 1.55; }
.pb-sub b { color: var(--ink); }
.pb-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; justify-content: center; }
.btn.plug {
  background: var(--danger); border-color: var(--danger); font-size: 15px; padding: 14px 26px;
}
.btn.plug:hover { background: #A32B22; border-color: #A32B22; }
.btn.plug:disabled { background: var(--wash); border-color: var(--line); color: var(--cap); }
.btn.ghost[aria-pressed="true"] { background: var(--wash); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pb-hint { margin: 0; font-family: var(--mono); font-size: 10.5px; color: var(--cap); text-align: right; }

/* the named-approver gate */
.gate { border-top: 1px dashed var(--faint); padding: 16px 22px 18px; background: #FCFCFB; }
.gate .g-head { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.gate .g-body { margin: 0 0 12px; font-size: 13px; color: var(--body); max-width: 70ch; }
.gate .g-body b { color: var(--ink); }
.gate .g-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gate .sel { max-width: 320px; }
.sel {
  font-family: var(--sans); font-size: 13.5px; color: var(--ink);
  padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238A8D94' stroke-width='1.4' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,98,217,.12); }

/* the approved plug: an owned, aged open item on the face of the dashboard */
.plugcard { border-top: 1px solid var(--line); padding: 16px 22px; background: var(--allow-bg); }
.plugcard .pc-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.plugcard .pc-id { font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--ink); }
.plugcard .pc-amt { font-weight: 600; font-size: 15px; }
.plugcard .pc-meta { font-family: var(--mono); font-size: 11px; color: var(--body2); }
.plugcard .pc-note { margin: 8px 0 0; font-size: 12.5px; color: var(--body2); max-width: 84ch; }
.plugcard .pc-note b { color: var(--ink); }

/* the suspense ghost (the anti-pattern, never executed) */
.suspense { border-top: 1px dashed var(--faint); padding: 16px 22px 18px; background: var(--wash); }
.suspense .s-head { font-family: var(--mono); font-size: 11px; color: var(--body2); display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.suspense .s-je {
  margin: 0; font-family: var(--mono); font-size: 12px; line-height: 1.8; color: var(--cap);
  border: 1px dashed var(--faint); border-radius: 6px; padding: 12px 14px;
  background: repeating-linear-gradient(-45deg, transparent 0 9px, rgba(0,0,0,.022) 9px 18px);
  overflow-x: auto;
}
.suspense .s-note { margin: 10px 0 0; font-size: 12.5px; color: var(--body); max-width: 90ch; }

/* ---- summary tiles ---- */
.summary { margin-bottom: 22px; }
.tiles .t .v .u { font-size: 14px; color: var(--cap); font-weight: 500; }

/* ---- chart ---- */
.chartpanel { margin-bottom: 22px; }
.chartpanel .pb { padding: 18px 18px 12px; }
.chartpanel svg { width: 100%; height: auto; display: block; }

/* ---- residual register ---- */
.tblpanel { margin-bottom: 22px; }
.residual th.num, .residual td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.residual td.docref { font-weight: 500; }
.residual td.docref .mid { font-family: var(--mono); font-size: 10px; color: var(--cap); display: block; }
.residual tr.active { background: var(--wash); }
.residual tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.badge.b-timing { background: var(--esc-bg); color: var(--warn); }
.badge.b-rate { background: var(--block-bg); color: var(--danger); }
.badge.b-missing { background: var(--rev-bg); color: var(--review); }
.badge.b-plugged { background: var(--allow-bg); color: var(--ok); }

/* age bar: track scaled to 90 days, with the day count always in text */
.agebar { position: relative; width: 120px; height: 18px; display: inline-block; vertical-align: middle; }
.agebar .track { position: absolute; top: 8px; left: 0; right: 0; height: 3px; background: var(--line2); border-radius: 2px; }
.agebar .fill { position: absolute; top: 6px; left: 0; height: 7px; border-radius: 2px; background: var(--warn); opacity: .85; }
.agebar .fill.old { background: var(--danger); }
.agedays { font-family: var(--mono); font-size: 10.5px; color: var(--body2); margin-left: 8px; }
.bookdate { font-family: var(--mono); font-size: 11px; color: var(--body2); display: block; margin-bottom: 2px; }

/* ---- trace panel ---- */
.tracepanel .trace-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.trace-step { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.trace-step .sh {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--cap); padding: 9px 13px; border-bottom: 1px solid var(--line2); background: #FCFCFB;
}
.trace-step .sb { padding: 12px 13px; }
.trace-step .calc { font-family: var(--mono); font-size: 12px; color: var(--body2); line-height: 1.9; }
.trace-step .calc b { color: var(--ink); }
.trace-step .calc .eq { color: var(--accent); }
.trace-step .calc .miss { color: var(--review); font-weight: 600; }
.trace-step .calc .off { color: var(--danger); font-weight: 600; }
.cite { display: inline-block; font-family: var(--mono); font-size: 10px; background: var(--wash); border-radius: 30px; padding: 2px 9px; color: var(--body2); margin: 2px 4px 2px 0; }
.cite.src { background: #EEF3FD; color: var(--accent-d); }
.trace-draft { border: 1px solid var(--line); border-radius: 7px; padding: 14px 15px; background: #FCFCFB; margin-top: 16px; }
.trace-draft .dh { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); margin-bottom: 8px; }
.trace-draft .dh::before { content: "✎ "; }
.trace-draft p { margin: 0; font-size: 13.5px; color: var(--body2); line-height: 1.7; }
.trace-draft p b { color: var(--ink); }
.trace-draft .abstain { color: var(--warn); font-weight: 600; }

/* ---- run summary + ledger ---- */
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 26px; align-items: start; }
.runlist { list-style: none; padding: 0; margin: 0 0 12px; }
.runlist li { display: grid; grid-template-columns: 118px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line2); font-size: 12.5px; color: var(--body2); }
.runlist li:first-child { border-top: none; }
.runlist li .k { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--cap); padding-top: 2px; }
.runlist li b { color: var(--ink); }
.attrib { margin: 0; font-family: var(--mono); font-size: 10.5px; color: var(--cap); line-height: 1.6; border-top: 1px solid var(--line2); padding-top: 10px; }

/* ---- trust-boundary strip ---- */
.trustline {
  display: flex; align-items: stretch; flex-wrap: wrap; gap: 0; margin: 8px 0 40px;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-family: var(--mono); font-size: 11px;
}
.trustline span { padding: 12px 16px; line-height: 1.5; }
.tb-code { flex: 1 1 320px; background: var(--allow-bg); color: var(--ok); }
.tb-sep { display: flex; align-items: center; background: var(--ink); color: #fff; letter-spacing: .04em; white-space: nowrap; }
.tb-llm { flex: 1 1 320px; background: var(--esc-bg); color: var(--warn); }

@media (max-width: 900px) {
  .pb-top { flex-direction: column; }
  .pb-actions { align-items: flex-start; }
  .pb-hint { text-align: left; }
  .twocol { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pb-amt { font-size: 30px; }
  .agebar { width: 70px; }
}
