/* Audit log, chain check, exports and the print/PDF report (M6). Uses the tokens in tokens.css; no new colors. */
.chainbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-radius:14px;padding:12px 16px;margin:0 0 16px;font-size:15px;border:1px solid var(--line)}
.chainbar>svg{flex:none;width:1.4em;height:1.4em}
.chainbar.ok{background:var(--okbg);color:var(--ok);border-color:transparent}
.chainbar.bad{background:var(--badbg);color:var(--bad);border-color:transparent;font-weight:500}
.chainbar.bad b{font-size:16.5px}
.chainbar.info{background:var(--infobg);color:var(--ink);border-color:transparent}
.chainbar.warn{background:var(--warnbg);color:var(--warn);border-color:transparent}
.chainbar.anchor{font-size:14px;padding:9px 14px}
.chainbar .btn{margin-left:auto}
.chainbar>span:not(.spin){flex:1 1 280px;min-width:0}

.audit-lead{margin:-6px 0 16px;color:var(--mute);font-size:14px;max-width:70ch}
.auditcard{overflow:visible}
.audit-top{display:flex;gap:10px 18px;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:14px 18px;border-bottom:1px solid var(--line)}
.exportbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.exportbar .btns{display:flex;gap:8px;flex-wrap:wrap}
.headline{margin:0;max-width:60ch}
#export-notice .outcome{margin:12px 18px 0}
.pagehead-acts{display:flex;gap:8px;flex-wrap:wrap}

/* metrics */
.metrics{margin-bottom:16px}
.mgrid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-top:10px}
.mcell{border:1px solid var(--line);border-radius:12px;padding:8px 12px;background:var(--panel2)}
.mcell small{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--mute);font-weight:700}
.mcell strong{font-size:20px;letter-spacing:-.01em}

/* the table */
table.autable{min-width:880px}
table.autable td.wide{min-width:260px;max-width:520px}
table.autable.audit-t td:nth-child(2),table.autable.audit-t td:nth-child(4),table.autable.audit-t td:nth-child(5){white-space:nowrap}
table.cfglog td:nth-child(3){white-space:nowrap}
table.autable td .au-x{padding:6px 4px}
.au-x{display:inline-flex;align-items:center;gap:4px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;min-height:44px;min-width:44px;text-decoration:none;color:var(--info)}
.au-x svg{width:.9em;height:.9em}
.au-x:hover{text-decoration:underline}
tr.au-open td{background:var(--panel2);border-bottom:1px solid var(--line)}
.au-detail{padding:4px 2px 10px}
.au-detail .kv{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin-top:4px}
.au-detail .code{max-height:320px}
tr.untrusted td,li.untrusted{background:var(--badbg)}
tr.untrusted td:first-child,li.untrusted{box-shadow:inset 3px 0 0 var(--bad)}
.morerow{display:flex;gap:12px;align-items:center;justify-content:center;padding:14px;border-top:1px solid var(--line2)}
.aucards .fc{gap:6px}
.aucards .l3{align-items:center}

/* ---- the report (screen preview of the print page) */
.report-bar{display:flex;gap:10px;justify-content:space-between;align-items:center;flex-wrap:wrap}
.report{background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:28px 32px;max-width:980px;margin:6px auto 0}
.rep-head{border-bottom:2px solid var(--ink);padding-bottom:10px;margin-bottom:14px}
.report h1{font-size:25px;margin:0}
.rep-sub{margin:4px 0 0;color:var(--mute);font-size:13.5px}
.report h2{font-size:16px;margin:22px 0 8px;letter-spacing:-.005em}
.rep-kv{grid-template-columns:repeat(2,minmax(0,1fr))}
.rep-kv dd.bad{color:var(--bad);font-weight:700}
.rtable{width:100%;border-collapse:collapse;min-width:0;font-size:12.5px;margin-top:4px}
.rtable th{background:var(--panel2);padding:6px 8px;border-bottom:1px solid var(--line);text-align:left;font-size:10.5px}
.rtable td{padding:6px 8px;border-bottom:1px solid var(--line2);vertical-align:top}
.rtable tbody tr:hover td{background:none}
.rtable .nw{white-space:nowrap}
.report section{overflow-x:auto}

@media (max-width:1023px){.mgrid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:720px){
  .mgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .audit-top{padding:12px 14px}
  .exportbar .btn{flex:1 1 auto}
  .report{padding:18px 14px}
  .rep-kv{grid-template-columns:1fr}
  .chainbar{padding:8px 12px;gap:6px 10px;font-size:13.5px;line-height:1.35}
  .chainbar.bad b{font-size:14.5px}
  .audit-lead{display:none}
  .chainbar .btn{margin-left:auto;flex:none}
  .audit-page h1{font-size:19px}
}

/* ---- print: the page is the report and nothing else */
@page{margin:14mm 12mm}
@media print{
  html:root:not([data-x]):not([data-y]){
    --bg:#fff;--panel:#fff;--panel2:#f3f4f6;--ink:#000;--mute:#374151;--line:#9ca3af;--line2:#d1d5db;--info:#1d3a9e;--ok:#065f46;--bad:#991b1b;--warn:#7a4a00;
    --okbg:#fff;--badbg:#fff;--infobg:#fff;--warnbg:#fff;--shadow:none;color-scheme:light;
  }
  body{background:#fff!important;color:#000;font-size:11pt;display:block;min-height:0}
  header.top,.banners,footer.foot,#dev,.skip,.noprint,.dock,.devpanel{display:none!important}
  main{padding:0;max-width:none}
  .report{border:0;box-shadow:none;padding:0;max-width:none;margin:0;border-radius:0}
  .report section{overflow:visible}
  .report h2{break-after:avoid;margin-top:16pt}
  .rtable{font-size:9pt}
  .rtable thead{display:table-header-group}
  .rtable tr{break-inside:avoid}
  .rtable th{background:#e5e7eb!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .msg.bad{border:1px solid #991b1b;color:#991b1b;background:#fff}
  a{color:#000;text-decoration:none}
}
