/* Dutified app shell, on the approved prototype's tokens (design/proto-part-a-css.css; UX round 1, M19): one
   accent (#d4521f), serif display headings and a sans body (Newsreader and Libre Franklin, with Georgia and Arial
   standing in until their files are added; IBM Plex Mono is self-hosted), 16px minimum body text, grey never
   lighter than #5d6878 (4.9:1 on the page colour), visible focus on everything, and a phone menu on every screen.
   The old names (--orange...) are kept as aliases so older rules pick up the accent. */
@font-face{font-family:"IBM Plex Mono";src:url("/static/fonts/IBMPlexMono-Regular.ttf") format("truetype");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"IBM Plex Mono";src:url("/static/fonts/IBMPlexMono-Bold.ttf") format("truetype");font-weight:700;font-style:normal;font-display:swap}

:root{
  --bg:#eef1f4; --paper:#fff; --ink:#0f1c2e; --fg:#1a2433; --mute:#5d6878; --soft:#5d6878;
  --line:#d6dce3; --line-2:#e9edf1; --side:#0f1c2e;
  --accent:#d4521f; --accent-dark:#b54318; --accentbg:#fff3ec;
  --orange:#d4521f; --orange-dark:#b54318; --orange-soft:#fff3ec;
  --acc:#18794e; --acc-soft:#e7f5ee; --aqua:#18794e;
  --fail:#b42318; --fail-soft:#fdecea; --warn:#8a4b08; --warn-soft:#fff4e5;
  --focus:#d4521f;
  --display:"Newsreader",Georgia,"Times New Roman",serif;
  --sans:"Libre Franklin","Helvetica Neue",Arial,system-ui,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,"SFMono-Regular",Menlo,monospace;
}
*,*:before,*:after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--fg);
  font:16px/1.6 var(--sans);
  -webkit-font-smoothing:antialiased}
a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
a:hover{color:var(--ink)}
h1,h2,h3{font-weight:600;letter-spacing:0;margin:0 0 8px;color:var(--ink)}
h1,h2{font-family:var(--display);text-wrap:balance}
h1{font-size:30px;line-height:1.15}
h2{font-size:22px;line-height:1.25}
h3{font-size:17px;font-family:var(--sans);font-weight:700}
p{margin:0 0 12px}
.mute{color:var(--mute)}
.soft{color:var(--soft)}
small,.small{font-size:16px}
/* jump links land with the heading clear of the phone's sticky top bar */
html{scroll-padding-top:84px}

/* focus: always visible, never removed */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,
textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible{
  outline:3px solid var(--focus);outline-offset:2px;border-radius:4px}

.skip{position:absolute;left:-9999px;top:0;z-index:100;background:var(--ink);color:#fff;
  padding:12px 18px;border-radius:0 0 8px 0;font-weight:700}
.skip:focus{left:0}

.logo{display:inline-flex;align-items:center;gap:10px;color:inherit;font-weight:600;font-size:22px;line-height:1;font-family:var(--display);
  letter-spacing:0;text-decoration:none}
.logo i{background:var(--accent);border-radius:8px;width:28px;height:28px;display:flex;
  align-items:center;justify-content:center;flex:none}
.logo i:after{content:"";width:10px;height:10px;border:3px solid #fff;border-radius:50%}

/* shell */
.shell{display:grid;grid-template-columns:248px 1fr;min-height:100vh}
.side{background:var(--side);padding:20px 14px;display:flex;flex-direction:column;gap:2px}
.side .logo{color:#fff;padding:4px 10px 20px}
.side .who{margin:0 8px 16px;padding:12px;background:rgba(255,255,255,.09);border-radius:10px;
  font-size:14px;color:#fff}
.side .who b{display:block;font-size:15px}
.side .who span{color:#c3cbe0;font-size:13px}
.side a.nav{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:10px 12px;border-radius:8px;color:#dbe1f0;font-weight:600;text-decoration:none}
.side a.nav:hover{background:rgba(255,255,255,.1);color:#fff}
.side a.nav[aria-current="page"]{background:var(--accent);color:#fff}
.side a.nav em{font-style:normal;font-size:12px;background:#fff;color:var(--ink);
  border-radius:99px;padding:1px 8px;font-weight:700}
.side .grp{font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:#aab3cc;
  font-weight:700;padding:16px 12px 6px}
.side .foot{margin-top:auto;font-size:13px;padding:12px}
.side .foot a{color:#c3cbe0}
.main{min-width:0;display:flex;flex-direction:column}
.top{display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:16px 32px;border-bottom:1px solid var(--line);background:#fff}
.top h1{font-size:30px;margin:2px 0 0;font-family:var(--display);font-weight:600}
.crumb{font-size:15px;color:var(--mute)}
.page{padding:26px 32px 90px;max-width:1200px;width:100%}

/* phone menu, on every screen */
.mobiletop{display:none;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 16px;background:var(--side);color:#fff;position:sticky;top:0;z-index:20}
.mobiletop .logo{color:#fff;font-size:19px}
.menubtn{background:rgba(255,255,255,.14);color:#fff;border:0;border-radius:8px;
  padding:10px 14px;font-weight:700;font-size:16px;line-height:1;font-family:inherit;cursor:pointer;min-height:44px}
#mobilenav{display:none;background:var(--side);padding:8px 12px 18px}
#mobilenav.open{display:block}
#mobilenav a{display:block;padding:13px 12px;color:#dbe1f0;font-weight:600;
  border-radius:8px;text-decoration:none}
#mobilenav a[aria-current="page"]{background:var(--accent);color:#fff}
@media(max-width:900px){
  .shell{grid-template-columns:1fr}
  .side{display:none}
  .mobiletop{display:flex}
  .page,.top{padding-left:16px;padding-right:16px}
  .top{flex-wrap:wrap}
}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;
  background:var(--accent);color:#fff;font-weight:600;font-size:16px;line-height:1.2;font-family:var(--sans);padding:11px 18px;
  border-radius:6px;border:1.5px solid var(--accent);cursor:pointer;text-decoration:none;
  min-height:44px}
.btn:hover{background:var(--accent-dark);border-color:var(--accent-dark);color:#fff}
.btn.line{background:#fff;color:var(--ink);border-color:#8792a2}
.btn.line:hover{background:var(--accentbg);color:var(--ink);border-color:var(--ink)}
.btn.quiet{background:#fff;color:var(--ink);border-color:var(--line)}
.btn.quiet:hover{background:var(--bg);color:var(--ink);border-color:var(--ink)}
.btn.sm{padding:8px 12px;font-size:14px;min-height:38px}
.btn[disabled],.btn[aria-disabled="true"]{opacity:.55;cursor:not-allowed}
.btnrow{display:flex;flex-wrap:wrap;gap:10px}

/* cards, tables. Radius and shadow from tokens.css (NOTE 74b/74c, design lock): flatter, sharper than the first cut. */
.card{background:var(--paper);border:1px solid var(--line);border-radius:var(--r-card,14px);padding:20px;box-shadow:var(--shadow-card,0 20px 50px rgba(11,22,54,.10))}
.card.tight{padding:14px}
.grid{display:grid;gap:14px}
.g2{grid-template-columns:1fr 1fr}.g3{grid-template-columns:repeat(3,1fr)}
.g4{grid-template-columns:repeat(4,1fr)}.g21{grid-template-columns:2fr 1fr}
@media(max-width:1000px){.g4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:900px){.g2,.g3,.g4,.g21{grid-template-columns:1fr}}
.kpi .k{font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:var(--mute);font-weight:700}
.kpi .v{font-weight:800;font-size:34px;letter-spacing:-.03em;margin-top:6px;line-height:1.1}
.kpi .n{font-size:16px;color:var(--mute);margin-top:6px}
.v.f{color:var(--fail)}.v.a{color:var(--acc)}.v.w{color:var(--warn)}
.sec{margin-top:26px}
.stack>*+*{margin-top:14px}
.row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.sp{justify-content:space-between}

table{width:100%;border-collapse:collapse}
caption{text-align:left;font-weight:700;padding:0 0 10px}
th{font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:var(--mute);
  font-weight:700;text-align:left;padding:10px 12px;border-bottom:2px solid var(--line)}
td{padding:13px 12px;border-bottom:1px solid var(--line-2);vertical-align:top}
tbody tr:last-child td{border-bottom:0}
.tablewrap{overflow-x:auto}

/* status: always a label as well as a colour */
.chip{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:700;
  padding:4px 10px;border-radius:5px;background:var(--line-2);color:var(--ink);white-space:nowrap}
.chip:before{content:"";width:9px;height:9px;border-radius:2px;background:currentColor;flex:none}
.chip.red{background:var(--fail-soft);color:#7c2a13}
.chip.amber{background:var(--warn-soft);color:#6b4600}
.chip.green{background:var(--acc-soft);color:#075048}
.chip.none{background:var(--line-2);color:var(--mute)}
.chip.plain:before{display:none}

.bar{height:12px;border-radius:6px;background:var(--line-2);overflow:hidden;min-width:90px}
.bar i{display:block;height:100%;border-radius:6px;background:var(--aqua)}
.bar i.red{background:var(--orange)}.bar i.amber{background:#c98a00}.bar i.green{background:var(--aqua)}

.note{font-size:15px;color:var(--ink);padding:14px 16px;border-left:4px solid var(--acc);
  background:var(--acc-soft);border-radius:0 8px 8px 0}
.note.red{border-color:var(--fail);background:var(--fail-soft)}
.note.amber{border-color:var(--warn);background:var(--warn-soft)}
.note.plain{border-color:var(--line);background:var(--bg)}
.note h3{margin-top:0}

/* forms */
label.f{display:block;margin-bottom:16px}
label.f>span,.flabel{display:block;font-size:15px;color:var(--ink);margin-bottom:6px;font-weight:700}
.hint{display:block;font-size:16px;color:var(--mute);margin-bottom:6px;font-weight:400}
input,select,textarea{width:100%;font:inherit;font-size:16px;padding:12px 13px;
  border:2px solid var(--line);border-radius:8px;background:#fff;color:var(--ink)}
input:focus,select:focus,textarea:focus{border-color:var(--ink)}
textarea{min-height:140px;resize:vertical}
fieldset{border:2px solid var(--line);border-radius:10px;padding:14px 16px;margin:0 0 16px}
legend{font-weight:700;padding:0 6px}
.radio,.check{display:flex;gap:10px;align-items:flex-start;padding:10px 0;font-weight:500}
.radio input,.check input{width:22px;height:22px;flex:none;margin-top:2px}
.err{color:#7c2a13;font-weight:700}
.field-error{border-color:var(--fail)}

/* the marked up communication */
.doc{font-size:17px;line-height:1.85;background:#fff;border:1px solid var(--line);
  border-radius:12px;padding:24px;white-space:pre-wrap}
.doc mark{background:var(--orange-soft);box-shadow:inset 0 -3px 0 var(--orange);
  color:var(--ink);padding:1px 0;border-radius:2px}
.doc mark.amber{background:var(--warn-soft);box-shadow:inset 0 -3px 0 #c98a00}
button.sentence{font:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;
  text-align:left;color:inherit;border-bottom:3px solid var(--orange)}
button.sentence.amber{border-bottom-color:#c98a00}
button.sentence:hover{background:var(--orange-soft)}

/* the AI customers grid */
.agents{display:grid;grid-template-columns:repeat(auto-fill,minmax(18px,1fr));gap:3px}
.agents button{width:100%;aspect-ratio:1;border:1px solid rgba(11,22,54,.18);border-radius:3px;
  padding:0;cursor:pointer;background:var(--line-2)}
.agents button.green{background:#7fd3c8}
.agents button.amber{background:#f0c34a}

.agents button.red{background:#e08a68}
.agents button.none{background:#cfd5e4}
.agents button[aria-pressed="true"]{outline:3px solid var(--ink);outline-offset:1px}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:14px;margin:10px 0}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:14px;height:14px;border-radius:3px;display:inline-block;border:1px solid rgba(11,22,54,.2)}

/* progress */
.prog{height:12px;background:var(--line-2);border-radius:6px;overflow:hidden}
.prog i{display:block;height:100%;background:var(--orange);transition:width .4s ease}
.steps{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.st{display:flex;align-items:center;gap:8px;padding:9px 13px;border-radius:6px;
  border:2px solid var(--line);background:#fff;font-size:14px;color:var(--mute);font-weight:600}
.st i{width:22px;height:22px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-weight:700;font-size:12px;line-height:1;font-family:inherit;font-style:normal;background:var(--line-2);color:var(--ink)}
.st.done{border-color:var(--acc);color:var(--ink)}.st.done i{background:var(--acc);color:#fff}
.st.now{border-color:var(--orange);color:var(--ink)}.st.now i{background:var(--orange);color:#fff}

/* timeline */
.tl{position:relative;padding-left:24px;margin:0}
.tl:before{content:"";position:absolute;left:7px;top:6px;bottom:6px;width:2px;background:var(--line)}
.tl .e{position:relative;margin-bottom:16px;font-size:15px}
.tl .e:before{content:"";position:absolute;left:-23px;top:6px;width:12px;height:12px;
  border-radius:50%;background:#fff;border:3px solid var(--acc)}
.tl .e.red:before{border-color:var(--fail)}.tl .e.amber:before{border-color:var(--warn)}
.tl .e span{display:block;font-size:16px;color:var(--mute)}

/* tabs */
.tabs{display:flex;gap:4px;border-bottom:2px solid var(--line);margin-bottom:20px;flex-wrap:wrap}
.tabs a{padding:11px 15px;color:var(--mute);font-weight:700;border-bottom:3px solid transparent;
  margin-bottom:-2px;text-decoration:none}
.tabs a[aria-current="page"]{color:var(--ink);border-color:var(--accent)}

/* empty states, never a blank table */
.empty{text-align:center;padding:38px 20px;border:1.5px dashed #b9c2cd;border-radius:8px;
  background:#fff}
.empty h3{margin-bottom:6px}
.empty p{color:var(--mute);max-width:46ch;margin:0 auto 16px}

/* flashes */
.flash{padding:14px 16px;border-radius:8px;margin-bottom:18px;font-weight:600;
  border:2px solid var(--acc);background:var(--acc-soft)}
.flash.bad{border-color:var(--fail);background:var(--fail-soft);color:#7c2a13}

.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}

.grid-table td.cell{padding:6px;text-align:center;font-weight:700;font-size:14px}
.grid-table td.cell a{display:block;padding:8px 4px;border-radius:6px;text-decoration:none;color:inherit}
.grid-table td.cell a:hover{outline:2px solid var(--ink)}
.cell.red a{background:var(--fail-soft);color:#7c2a13}
.cell.amber a{background:var(--warn-soft);color:#6b4600}
.cell.green a{background:var(--acc-soft);color:#075048}
.cell.none a{background:var(--line-2);color:var(--mute)}

@media print{
  .side,.mobiletop,.btnrow,.tabs,.skip{display:none!important}
  .shell{display:block}.page{padding:0}.card{break-inside:avoid}
  body{background:#fff;font-size:12pt}
}

/* signed-out pages: no side menu, so the page uses the full width, with a simple top bar */
.shell.out{display:block}
.shell.out .page{margin:0 auto}
.shell.out .top{max-width:1200px;width:100%;margin:0 auto;border-bottom:0;background:transparent}
.publictop{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
  padding:12px 32px;background:var(--side);color:#fff}
.publictop .logo{color:#fff;font-size:19px;text-decoration:none;font-weight:700}
.publicnav{display:flex;gap:6px;flex-wrap:wrap}
.publicnav a{color:#fff;font-weight:600;padding:10px 12px;border-radius:8px;text-decoration:none;min-height:44px;
  display:inline-flex;align-items:center}
.publicnav a:hover{background:rgba(255,255,255,.12)}
@media(max-width:900px){.publictop{padding:10px 16px}}
.intro{max-width:720px}
.intro p{font-size:17px}

/* focus on the dark menus: white ring, high contrast on navy and on the orange current item */
.side a:focus-visible,.side button:focus-visible,.mobiletop a:focus-visible,.mobiletop button:focus-visible,
#mobilenav a:focus-visible,.publictop a:focus-visible{outline:3px solid #fff;outline-offset:2px}

/* sign out is a form (POST) that looks like the links beside it */
form.signout{display:inline;margin:0}
.linkbtn{background:none;border:0;padding:0;font:inherit;color:inherit;text-decoration:underline;cursor:pointer}
.side .foot .linkbtn{color:#c3cbe0}
#mobilenav form.signout{display:block}
#mobilenav .linkbtn{display:block;width:100%;text-align:left;padding:13px 12px;color:#dbe1f0;font-weight:600;
  border-radius:8px;text-decoration:none}
.linkbtn:focus-visible{outline:3px solid #fff;outline-offset:2px}
.card.narrow{max-width:640px}
.flash.bad ul{margin:0;padding-left:20px}
.flash.bad ul a{color:inherit}
textarea.short{min-height:100px}
p.gap{margin-top:18px}
label.f .err{display:block;color:#a3200f;font-weight:700;margin:4px 0}
/* phone: the public header is the logo on one line and the three links on one line, nothing more */
@media(max-width:600px){
  .publictop{gap:4px;padding:8px 12px}
  .publicnav{width:100%;flex-wrap:nowrap;justify-content:space-between;gap:0}
  .publicnav a{font-size:15px;padding:8px 8px;white-space:nowrap}
}
/* sidebar footer: readable and big enough to tap (WCAG 2.5.8) */
.side .foot{font-size:15px}
.side .foot a,.side .foot .linkbtn{display:inline-block;min-height:28px;padding:4px 0}
main.main:focus{outline:none}
/* reflow at 320px (WCAG 2.2 1.4.10, round 13 screen reader F1): grid columns may shrink below their content, and
   the public header's links wrap instead of running off the edge */
.grid>*{min-width:0}
.card{overflow-wrap:break-word}
@media(max-width:360px){
  .publicnav{flex-wrap:wrap;justify-content:flex-start;gap:0 4px}
  .publicnav a{padding:6px 6px}
}
/* Deputy Duty (section 21) */
.reglist{list-style:none;padding:0;margin:0 0 12px}
.reglist li{padding:10px 0;border-bottom:1px solid #e3e6ee}
.reglist li:last-child{border-bottom:0}
.reglist form.inline{margin-top:8px}
.ai-dialog{max-width:600px;border:0;border-radius:16px;padding:24px;box-shadow:0 20px 60px rgba(0,0,0,.35)}.ai-dialog::backdrop{background:rgba(11,22,54,.55)}.ai-dialog h2{font-size:18px;margin:0 0 6px}

/* --- the prototype's shared pieces for the older pages (UX round 1, M19) ------------------------------------------ */
/* filter chips: links (or submit buttons), so filters work without JavaScript; the chosen one is dark */
.fchips{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0;padding:0;list-style:none}
.fchips-label{font-family:var(--mono);font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;
  color:var(--mute);min-width:6.5em}
.fchip{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:8px 16px;border-radius:22px;
  border:1px solid var(--line);background:var(--paper);color:var(--fg);font:inherit;font-size:15px;font-weight:500;
  text-decoration:none;cursor:pointer;white-space:nowrap}
.fchip:hover{border-color:var(--ink);color:var(--ink)}
.fchip[aria-current="true"],.fchip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.fchip .n{font-family:var(--mono);font-size:13px}
.filterbar{display:grid;gap:10px;background:var(--paper);border:1px solid var(--line);border-radius:8px;padding:14px 18px}
.filterrow{display:flex;gap:10px 14px;flex-wrap:wrap;align-items:center}
.searchrow{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.searchrow input{flex:1 1 220px;max-width:420px;padding:9px 12px;border-width:1.5px;border-color:#8792a2;border-radius:6px}
.fchips-label{flex:none}
@media(max-width:620px){
  .filterbar{padding:12px 14px}
  .filterrow{flex-direction:column;align-items:stretch;gap:4px}
  .fchips{flex-wrap:nowrap;overflow-x:auto;margin-inline:-14px;padding:0 14px 4px;scrollbar-width:thin}
  .fchip{flex:none}
}
/* small uppercase labels (the prototype's .sec>h3 and .kicker) */
.kicker{font-family:var(--mono);font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.1em;color:var(--mute);margin:0}
/* list cards: one card per item where a table reads worse */
.lcards{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.lcard{background:var(--paper);border:1px solid var(--line);border-radius:8px;padding:16px 18px;display:grid;gap:8px}
.lcard-top{display:flex;justify-content:space-between;gap:8px 16px;flex-wrap:wrap;align-items:baseline}
.lcard h2,.lcard h3{margin:0;font-family:var(--display);font-weight:600;font-size:20px;line-height:1.3}
.lcard h2 a,.lcard h3 a{color:var(--ink);text-decoration:none}
.lcard h2 a:hover,.lcard h3 a:hover{color:var(--accent);text-decoration:underline}
.lcard .meta{color:var(--mute);font-size:15px}
.lcard .meta b{color:var(--fg);font-weight:600}
.lcard-row{display:flex;gap:8px 12px;flex-wrap:wrap;align-items:center}
.lcard-act{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.chip{border-radius:4px}
/* during setup the menu is hidden (UX round 1, m5) */
.side-bare .bare-note{color:#c3cbe0;font-size:15px;margin:0 10px}
.mobiletop form.signout{display:block}
.lcard p{margin:0}
.lcard .actions{margin-top:2px}

/* Getting started: a skipped optional step says so, never a tick (round 2, ops F18, busy F11) */
.steps .step.skipped .step-mark{background:#fff;color:var(--mute)}
.step-skipped{display:inline-block;font-size:14px;font-weight:600;color:var(--mute);border:1px solid var(--line);border-radius:4px;padding:1px 8px;margin-left:6px}
.step-undo{font-size:14px;margin-left:6px}
