/* Chancery UI — VoKol design system tokens + component classes distilled
   from the approved design (web/design/Chancery.dc.html). */

@font-face { font-family: 'Nunito'; font-weight: 400; src: url(/static/fonts/nunito-400.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 600; src: url(/static/fonts/nunito-600.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 700; src: url(/static/fonts/nunito-700.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 800; src: url(/static/fonts/nunito-800.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 900; src: url(/static/fonts/nunito-900.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Syncopate'; font-weight: 700; src: url(/static/fonts/syncopate-700.ttf) format('truetype'); font-display: swap; }

:root {
  /* Brand teal scale (VoKol tokens, verbatim) */
  --teal-50:#f0f8fa; --teal-100:#d9edf1; --teal-200:#b3dbe3; --teal-300:#7fc1cc;
  --teal-400:#4ba0b0; --teal-500:#2b8598; --teal-600:#11758c; --teal-700:#0d5e71;
  --teal-800:#0c4b5a; --teal-900:#0b3d49; --teal-950:#072731;
  --gray-0:#ffffff; --gray-50:#f7f9fa; --gray-100:#eef2f4; --gray-200:#e0e6e9;
  --gray-300:#cbd4d8; --gray-400:#9aa8ae; --gray-500:#6b7a80; --gray-600:#4d5a60;
  --gray-700:#384247; --gray-800:#262e32; --gray-900:#171d20;
  --green-500:#2f8a75; --green-100:#dcefe9; --amber-500:#b88a44; --amber-100:#f1ebdb;
  --red-500:#c0596a; --red-100:#f4e3e6; --blue-500:#3f86ab; --blue-100:#dce8f0;

  --brand:var(--teal-600); --brand-hover:var(--teal-700); --brand-active:var(--teal-800);
  --brand-soft:var(--teal-100); --brand-soft-hover:var(--teal-200); --accent:var(--teal-300);
  --surface-page:var(--gray-50); --surface-card:var(--gray-0); --surface-sunken:var(--gray-100);
  --surface-inverse:var(--teal-950); --surface-brand:var(--teal-600);
  --text-strong:var(--gray-900); --text-body:var(--gray-700); --text-muted:var(--gray-500);
  --text-subtle:var(--gray-400); --text-on-brand:var(--gray-0); --text-link:var(--teal-600);
  --border-subtle:var(--gray-200); --border-default:var(--gray-300); --border-strong:var(--gray-400);
  --border-brand:var(--teal-600); --focus-ring:var(--teal-300);
  --success:var(--green-500); --success-soft:var(--green-100);
  --warning:var(--amber-500); --warning-soft:var(--amber-100);
  --danger:var(--red-500);   --danger-soft:var(--red-100);
  --info:var(--blue-500);    --info-soft:var(--blue-100);

  --radius-sm:8px; --radius-md:12px; --radius-lg:16px;
  --shadow-sm:0 1px 3px rgba(11,61,73,.08), 0 1px 2px rgba(11,61,73,.05);
  --shadow-md:0 4px 12px rgba(11,61,73,.10);
  --shadow-lg:0 10px 28px rgba(11,61,73,.14);
  --dur-fast:120ms; --dur-base:200ms; --ease:cubic-bezier(.2,0,0,1);
}

* { box-sizing:border-box; }
body { margin:0; font-family:'Nunito',system-ui,sans-serif; color:var(--text-body);
       background:var(--surface-page); min-height:100vh; }
a { color:var(--text-link); text-decoration:none; }
a:hover { color:var(--brand-hover); text-decoration:underline; }

.eyebrow { letter-spacing:.08em; text-transform:uppercase; font-size:11px; font-weight:700; color:var(--text-muted); }
.wordmark { font-family:'Syncopate',sans-serif; letter-spacing:.18em; text-transform:uppercase; }
.mono { font-variant-numeric:tabular-nums; }

/* ---- App chrome ---- */
.topbar { position:sticky; top:0; z-index:40; height:64px; display:flex; align-items:center;
  gap:24px; padding:0 28px; background:var(--surface-card);
  border-bottom:1px solid var(--border-subtle); box-shadow:var(--shadow-sm); }
.topbar .brand { display:flex; align-items:center; gap:12px; }
.topbar .brand img { height:26px; display:block; }
.topbar .brand .sep { width:1px; height:26px; background:var(--border-default); }
.topbar .brand .name { font-family:'Syncopate',sans-serif; letter-spacing:.18em;
  text-transform:uppercase; font-size:15px; font-weight:700; color:var(--teal-800); }
.topnav { display:flex; align-items:stretch; gap:4px; height:100%; flex:1; }
.topnav a { display:flex; align-items:center; padding:0 14px; font-size:14px; font-weight:700;
  color:var(--text-muted); border-bottom:2.5px solid transparent; }
.topnav a:hover { color:var(--brand); text-decoration:none; }
.topnav a[aria-current="page"] { color:var(--brand); border-bottom-color:var(--brand); }
.topbar .me { display:flex; align-items:center; gap:10px; padding-left:14px;
  border-left:1px solid var(--border-subtle); line-height:1.15; }
.topbar .me .who { font-size:13px; font-weight:700; color:var(--text-strong); }
.topbar .me .role { font-size:11px; color:var(--text-muted); }
.avatar { width:34px; height:34px; border-radius:50%; background:var(--brand-soft); color:var(--teal-800);
  display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:800; }

main { max-width:1280px; margin:0 auto; padding:28px; }
main.narrow { max-width:1080px; }

/* ---- Page headers ---- */
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px;
  margin-bottom:8px; flex-wrap:wrap; }
h1 { margin:0; font-size:26px; font-weight:800; color:var(--text-strong); letter-spacing:-.01em; }
.page-sub { margin:6px 0 0; font-size:14px; color:var(--text-muted); max-width:560px; }

/* ---- Cards & notices ---- */
.card { background:var(--surface-card); border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); }
.card.pad { padding:22px; }
.audit-notice { display:flex; align-items:center; gap:10px; margin:14px 0 20px; padding:10px 14px;
  background:var(--brand-soft); border:1px solid var(--teal-200); border-radius:var(--radius-md);
  color:var(--teal-800); font-size:13px; font-weight:600; }
.warn-box { display:flex; gap:12px; align-items:flex-start; margin-bottom:14px; padding:14px 16px;
  background:var(--warning-soft); border:1px solid var(--amber-500); border-radius:var(--radius-md);
  font-size:13px; color:var(--gray-800); line-height:1.45; }
.danger-box { background:var(--danger-soft); border:1.5px solid var(--danger);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-md); padding:32px; }
.flash { margin-bottom:16px; padding:12px 16px; border-radius:var(--radius-md); font-size:13px;
  font-weight:600; background:var(--success-soft); color:var(--success);
  border:1px solid var(--green-500); }
.flash.err { background:var(--danger-soft); color:var(--danger); border-color:var(--danger); }

/* ---- Forms ---- */
label { display:block; font-size:13px; font-weight:700; color:var(--text-strong); margin-bottom:6px; }
.hint { font-size:12px; color:var(--text-muted); margin-top:6px; line-height:1.4; }
input, select, textarea { width:100%; font:inherit; font-size:14px; color:var(--text-strong);
  padding:9px 12px; background:var(--surface-card); border:1.5px solid var(--border-default);
  border-radius:var(--radius-md); transition:border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--border-brand);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--focus-ring) 45%, transparent); }
textarea { min-height:88px; resize:vertical; }
.field { display:flex; flex-direction:column; }
.field + .field, form .field { margin-top:0; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.content-search { margin-top:4px; padding:16px; border:1px dashed var(--amber-500);
  border-radius:var(--radius-md); background:var(--warning-soft); }
.content-search .label { text-transform:uppercase; letter-spacing:.08em; font-size:11px;
  font-weight:800; color:var(--amber-500); margin-bottom:8px; }

/* ---- Buttons ---- */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; font:inherit;
  font-size:14px; font-weight:700; padding:0 18px; height:44px; border-radius:999px;
  border:1.5px solid transparent; cursor:pointer; text-decoration:none;
  transition:background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.btn:hover { text-decoration:none; }
.btn:active { transform:scale(.99) translateY(1px); }
.btn.sm { height:36px; font-size:13px; padding:0 14px; }
.btn.block { width:100%; }
.btn.primary { background:var(--brand); color:var(--text-on-brand); }
.btn.primary:hover { background:var(--brand-hover); box-shadow:0 4px 14px rgba(17,117,140,.35); color:var(--text-on-brand); }
.btn.secondary { background:var(--surface-card); color:var(--brand); border-color:var(--border-default); }
.btn.secondary:hover { background:var(--brand-soft); color:var(--brand); }
.btn.ghost { background:transparent; color:var(--text-muted); }
.btn.ghost:hover { background:var(--surface-sunken); color:var(--text-body); }
.btn.danger { background:var(--danger); color:#fff; }
.btn.danger:hover { background:#a94b5b; color:#fff; }
.btn[disabled] { opacity:.5; cursor:not-allowed; pointer-events:none; }

/* ---- Data tables ---- */
.tbl { width:100%; border-collapse:collapse; font-size:13px; }
.tbl thead th { text-align:left; font-size:11px; font-weight:700; letter-spacing:.04em;
  text-transform:uppercase; color:var(--text-subtle); padding:10px 18px;
  border-bottom:1px solid var(--border-subtle); background:var(--surface-page); }
.tbl tbody td { padding:11px 18px; border-bottom:1px solid var(--border-subtle); vertical-align:middle; }
.tbl tbody tr.rowlink { cursor:pointer; }
.tbl tbody tr.rowlink:hover { background:var(--teal-50); }
.tbl .num { text-align:right; }
.tbl-head { display:flex; align-items:center; justify-content:space-between; padding:14px 18px;
  border-bottom:1px solid var(--border-subtle); flex-wrap:wrap; gap:8px; }
.tbl-head .count { font-size:14px; font-weight:800; color:var(--text-strong); }
.tbl-foot { padding:12px 18px; font-size:12px; color:var(--text-muted); background:var(--surface-page); }
.ts { line-height:1.25; }
.ts .loc { color:var(--text-body); font-weight:600; }
.ts .utc { color:var(--text-subtle); font-size:11px; }

/* ---- Badges, dots, chips ---- */
.badge { display:inline-flex; align-items:center; height:24px; padding:0 10px; font-size:12px;
  font-weight:700; border-radius:999px; }
.badge.warn { background:var(--warning-soft); color:var(--amber-500); }
.badge.ok { background:var(--success-soft); color:var(--success); }
.badge.danger { background:var(--danger-soft); color:var(--danger); }
.badge.neutral { background:transparent; color:var(--text-muted); border:1px solid var(--border-default); }
.badge.info { background:var(--info-soft); color:var(--info); }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; }
.dot.hold { background:var(--amber-500); } .dot.purged { background:var(--danger); }
.dot.ok { background:var(--green-500); }
.chip { display:inline-flex; align-items:center; height:28px; padding:0 10px; font-size:12px;
  font-weight:700; background:var(--brand-soft); color:var(--teal-800); border-radius:var(--radius-sm); }

/* ---- Detail grids (message metadata etc.) ---- */
.detail { display:grid; grid-template-columns:190px 1fr; row-gap:14px; column-gap:20px; font-size:14px; }
.detail .k { color:var(--text-muted); font-weight:600; }
.detail .v { color:var(--text-strong); font-weight:700; }
.detail .v.plain { color:var(--text-body); font-weight:400; }
.note { color:var(--text-muted); font-weight:600; font-size:12px; }
.note.warn { color:var(--amber-500); font-weight:700; }

/* ---- Centered state cards (content gate, purged, empty, busy) ---- */
.state-card { padding:40px 32px; text-align:center; }
.state-card .ico { width:52px; height:52px; border-radius:50%; background:var(--brand-soft);
  display:flex; align-items:center; justify-content:center; margin:0 auto 16px; color:var(--brand);
  font-size:24px; font-weight:800; }
.state-card .ico.muted { background:var(--surface-sunken); color:var(--text-subtle); }
.state-card .t { font-size:18px; font-weight:800; color:var(--text-strong); }
.state-card .d { font-size:14px; color:var(--text-muted); margin:8px auto 0; max-width:480px; }
.state-card .d + .btn { margin-top:22px; }
.spinner { width:44px; height:44px; margin:0 auto 18px; border:3px solid var(--teal-100);
  border-top-color:var(--brand); border-radius:50%; animation:chspin 900ms linear infinite; }
@keyframes chspin { to { transform:rotate(360deg); } }
.htmx-indicator { display:none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display:block; }
.htmx-request .htmx-hide { display:none; }

/* ---- Auth screens ---- */
.auth-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:var(--surface-page); padding:24px; }
.auth-card { width:400px; background:var(--surface-card); border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-md); padding:34px 32px; }
.auth-card h1 { text-align:center; font-size:22px; margin:14px 0 4px; }
.auth-card .sub { text-align:center; font-size:13px; color:var(--text-muted); margin:0 0 22px; }
.auth-card form { display:flex; flex-direction:column; gap:14px; }
.auth-brand { display:flex; align-items:center; justify-content:center; gap:12px; }
.auth-brand img { height:30px; }

/* ---- Search layout ---- */
.search-grid { display:grid; grid-template-columns:400px 1fr; gap:24px; align-items:start; }
.criteria { position:sticky; top:88px; display:flex; flex-direction:column; gap:16px; }
@media (max-width: 980px) { .search-grid { grid-template-columns:1fr; } .criteria { position:static; } }

/* ---- Report stat tiles ---- */
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; margin:18px 0; }
.stat { padding:18px 20px; }
.stat .n { font-size:28px; font-weight:900; color:var(--text-strong); font-variant-numeric:tabular-nums; }
.stat .l { font-size:12px; color:var(--text-muted); font-weight:700; margin-top:2px; }
.stat.alert .n { color:var(--danger); }

.txt-content { padding:24px 28px; font-size:14px; line-height:1.7; color:var(--text-body);
  max-width:70ch; white-space:pre-wrap; word-break:break-word; font-family:'Nunito',sans-serif; }
.dns-block { font-family:ui-monospace,monospace; font-size:13px; background:var(--surface-sunken);
  border:1px solid var(--border-subtle); border-radius:var(--radius-md); padding:14px 16px;
  word-break:break-all; }
