:root {
  --bg: #ffffff; --fg: #1d1d1f; --muted: #5f6368; --line: #d0d4d9; --panel: #f6f7f9;
  --on: #ffe08a; --on-fg: #1d1d1f; --off: #e9ecef; --flag: #ffc9c9; --flag-line: #c92a2a;
  --manual: #c5f6fa; --accent: #1c5fb8; --tag: #6b4e00; --on-accent: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18191b; --fg: #e8e8ea; --muted: #a0a4aa; --line: #3a3d42; --panel: #222428;
    --on: #6b5a1e; --on-fg: #fff6d6; --off: #2e3136; --flag: #6b2626; --flag-line: #ff8787;
    --manual: #155b63; --accent: #4d8eff; --tag: #ffe08a; --on-accent: #ffffff;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
main { max-width: 860px; margin: 0 auto; padding: 16px 16px 64px; }
h1 { margin-top: 8px; }
h2 { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 24px; }
.lead { font-size: 1.05em; }
.muted { color: var(--muted); }
.error { color: var(--flag-line); }
.sr { position: absolute; left: -9999px; }
textarea, input[type=text], select {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
button, .file { font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: inherit; cursor: pointer; margin: 4px 4px 4px 0; display: inline-block; }
.file input { display: none; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; margin: 8px 0; }
th, td { text-align: left; padding: 4px 6px 4px 0; vertical-align: top; }
#people td:nth-child(2) { width: 160px; }
#people td:nth-child(3) { width: 90px; }
#key td { border-top: 1px solid var(--line); padding: 4px 8px 4px 0; }
#summary ul { columns: 2; padding-left: 20px; }
#warnings p { background: var(--flag); padding: 8px 12px; border-radius: 6px; }
#flags-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 16px 12px; margin: 16px 0; }
#flags { padding-left: 24px; max-height: 420px; overflow-y: auto; }
#flags li { margin: 6px 0; }
#flags li.done { color: var(--muted); }
#flags .ctx { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
#flags .ctx b { background: var(--flag); color: inherit; }
#flags li.done .ctx b { background: var(--off); }
#flags button { padding: 2px 10px; font-size: 14px; }
#flags button[aria-pressed=true] { background: var(--accent); color: #fff; border-color: var(--accent); }
#preview, #swap-view { white-space: pre-wrap; word-wrap: break-word; border: 1px solid var(--line); border-radius: 8px;
  padding: 16px; max-height: 70vh; overflow-y: auto; font-size: 15px; background: var(--bg); }
.hl { border-radius: 3px; padding: 0 2px; cursor: pointer; color: inherit; }
.hl.on { background: var(--on); color: var(--on-fg); }
.hl.off { background: var(--off); text-decoration: line-through; text-decoration-color: var(--muted); }
.hl.flag { background: var(--flag); outline: 1px dashed var(--flag-line); }
.hl.manual { background: var(--manual); }
#preview .hl.on::after, #preview .hl.flag::after { content: " \2192 " attr(data-label); font-size: 12px;
  font-weight: 600; color: var(--tag); }
#preview .hl.focus { outline: 2px solid var(--accent); }
.legend .hl { cursor: default; margin-right: 8px; }
#edit-warning { background: var(--flag); border-radius: 6px; padding: 4px 12px; margin: 8px 0; }
#edit-warning p { margin: 6px 0; }
#manual-person { width: auto; display: inline-block; padding: 5px 8px; }
.version { font-size: .5em; font-weight: 500; color: var(--muted); vertical-align: middle; }
#suggest-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 16px 12px; margin: 12px 0; }
#suggestions, .chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; }
#suggestions li, .chips li { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 4px 2px 10px; }
#suggestions button, .chips button { margin: 0; padding: 2px 10px; font-size: 14px; }
.found { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -6px 0 14px; }
.found .chips { margin: 0; }
.found[hidden], #suggest-box[hidden] { display: none; }
[hidden] { display: none !important; }
section { scroll-margin-top: 72px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 6px var(--accent); } }
.pulse { animation: pulse 1s ease-in-out 2; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; outline: 3px solid var(--accent); } }
#flags details { margin: 4px 0 2px; }
#flags details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
#flags details ol { padding-left: 20px; }
#details-found { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 16px 12px; margin: 12px 0; }
.plain-list { list-style: none; padding: 0; margin: 8px 0; }
.plain-list li { margin: 3px 0; }
.plain-list .kind { color: var(--muted); display: inline-block; min-width: 9em; }
.next-note { color: var(--muted); margin-top: 16px; }
/* Steps 4 and 5 show a short placeholder until they open, so the numbering never jumps */
#step-output:not([hidden]) + .placeholder { display: none; }
.placeholder h2 { color: var(--muted); }

#swap-view .hl { cursor: default; }
#swap-view.show-labels .hl::after { content: " [was " attr(data-label) "]"; font-size: 12px; font-weight: 600; color: var(--tag); }
#swap-checks .note { border-left: 4px solid var(--flag-line); background: var(--flag); border-radius: 6px; padding: 4px 12px; margin: 8px 0; }
#swap-checks .note.warn { border-left-color: var(--accent); background: transparent; border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.swap-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
#swap-view .hl { color: inherit; }
#swap-view .hl.on { color: var(--on-fg); }
.hl-menu { position: absolute; z-index: 50; max-width: min(560px, calc(100vw - 16px)); background: var(--panel, var(--bg));
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.hl-menu .menu-head { margin: 2px 0 8px; font-size: 15px; word-break: break-word; }
.hl-menu .menu-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.hl-menu button { padding: 4px 10px; font-size: 14px; }
.hl-menu button[aria-pressed=true] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.hl-menu button.m-on::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--on); margin-right: 6px; }
.hl-menu button.m-off::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--off); border: 1px solid var(--line); margin-right: 6px; }
.hl-menu button.m-flag::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--flag); outline: 1px dashed var(--flag-line); margin-right: 6px; }
.hl-menu label { display: block; font-size: 14px; margin-top: 4px; }
#preview mark.hl:focus-visible { outline: 2px solid var(--accent); }
.role-guess { font-size: 13px; margin-left: 2px; }
.guide { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 10px 16px; margin: 8px 0 16px; }
.guide p { margin: 6px 0; }
.guide ol, .guide ul { margin: 6px 0; padding-left: 22px; }
.guide li { margin: 3px 0; }
.guide details { margin-top: 6px; }
.guide summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.guide code { font-size: 13px; }
.guide table.roles { border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.guide table.roles th, .guide table.roles td { text-align: left; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; }

/* ---- version 2 additions */
.profiles { border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px 10px; margin: 8px 0 14px; }
.profiles label { display: block; margin: 4px 0; cursor: pointer; }
.profiles .muted { font-size: 14px; }
#people td { padding: 6px 8px 6px 0; border-top: 1px solid var(--line); }
#people td:nth-child(1) { width: 110px; white-space: nowrap; }
#people td:nth-child(2) { width: 190px; }
#people td:nth-child(3) { width: 170px; }
#people td:nth-child(5) { width: 170px; }
.chips li.check { background: #fff1cc; border-color: #d9a400; }
@media (prefers-color-scheme: dark) { .chips li.check { background: #4a3a08; border-color: #d9a400; } }
.chips .why { font-size: 12px; }
.chip-demo { border-radius: 4px; padding: 0 6px; border: 1px solid var(--line); }
.chip-demo.check { background: #fff1cc; border-color: #d9a400; color: #1d1d1f; }
input.short { width: 14em; display: inline-block; padding: 4px 8px; }
.add-person input { width: 22em; display: inline-block; }
#places li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
#places button { padding: 2px 10px; font-size: 14px; }
#final-box { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--flag-line); border-radius: 8px; padding: 4px 16px 12px; margin: 12px 0; }
#final-box.clear { border-left-color: var(--ok, #3fa66a); }
#final-items { padding-left: 24px; }
#final-box h2 { border-top: 0; margin-top: 8px; padding-top: 0; }
#final-words .words button { margin: 2px 4px 2px 0; }
#final-items .hide-as { margin-left: 8px; }
#final-kept .kept-word { margin-right: 12px; white-space: nowrap; }
#final-items li { margin: 8px 0; }
#final-items .ctx { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
#final-items .ctx b { background: var(--flag); }
#final-items select { width: auto; display: inline-block; padding: 3px 6px; margin-right: 6px; }
#final-items button { padding: 2px 10px; font-size: 14px; }
h3 { margin-top: 24px; }
#people td:nth-child(2) { width: 170px; }
#people td:nth-child(3), #people td:nth-child(5) { width: 150px; }
#people td:nth-child(4) .chips { margin: 0; gap: 4px 6px; }
.chips li, .chips li button, .chips .why { white-space: nowrap; }
.chips li.check button { font-size: 12px; padding: 1px 6px; }

/* ---- version 3: the helpp layout (actions left, work centre, reference right) */
body { margin: 0; }
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr) 300px; min-height: 100vh; }
.left, .right { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel); border-color: var(--line); padding: 14px 14px 20px; }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); }
.centre { padding: 0 28px 64px; max-width: 980px; }
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.logo { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; }
.small { font-size: 13px; }
.navhead { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--text, inherit); margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.nav { display: block; padding: 5px 8px; border-radius: 6px; color: inherit; text-decoration: none; }
a.nav:hover { background: var(--bg); }
.nav.active { background: var(--accent); color: #fff; }
.nav.soon { color: var(--muted); }
.nav.soon em { font-style: normal; font-size: 10px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.left-foot { margin-top: 24px; }
.rhead { font-weight: 700; margin: 4px 0 10px; }
.rsub { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; color: var(--muted); margin: 14px 0 4px; }
.rlist { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.rlist li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.rlist .tick { color: #2f9e44; font-weight: 700; }
.warn-dot { display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; background: #f08c00; color: #fff; font-size: 11px; font-weight: 700; }
.rnote { margin-top: 18px; }
@media (max-width: 1150px) { .shell { grid-template-columns: 200px minmax(0, 1fr); } .right { grid-column: 2; position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); } }
@media (max-width: 760px) { .shell { grid-template-columns: 1fr; } .left { position: static; height: auto; } .right { grid-column: 1; } }

/* people cards */
.person { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0; background: var(--bg); }
.phead { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.plabel { min-width: 74px; }
.pname { width: 220px !important; display: inline-block; }
.page { width: 70px !important; display: inline-block; padding: 4px 6px !important; }
.roles { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 8px 0 4px; }
.role { border: 1px solid var(--line); border-radius: 14px; padding: 1px 10px 1px 6px; font-size: 13px; cursor: pointer; }
.role.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.role input { margin: 0 2px 0 0; vertical-align: -1px; }
.written { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.written .chips { margin: 4px 0; }
.details li { margin: 2px 0; }
.details select, #loose-details select { width: auto; display: inline-block; padding: 2px 6px; }
.join select { width: auto; display: inline-block; padding: 2px 6px; }
.roles-help { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.roles-help dt { font-weight: 600; }
.roles-help dd { margin: 0; }

/* step 4: the checking view */
#out-view { white-space: pre-wrap; word-wrap: break-word; border: 1px solid var(--line); border-radius: 8px; padding: 16px; max-height: 70vh; overflow-y: auto; font-size: 15px; }
.lab { border-radius: 4px; padding: 0 4px; font-weight: 600; cursor: help; }
.lab.k-person { background: #d0ebff; color: #0b3d6b; }
.lab.k-org { background: #d3f9d8; color: #135c22; }
.lab.k-detail { background: #ffe3e3; color: #7a1f1f; }
.realname { color: var(--muted); font-size: 12px; margin-left: 3px; }
.realname::before { content: "("; } .realname::after { content: ")"; }
.view-tools { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.legend .lab { cursor: default; margin-right: 4px; font-size: 13px; }
.guide-steps li { margin: 8px 0; }

/* ---- M2: policy library, reading view, right panel links */
.rlist a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.rlist a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.rlist li.cited { background: linear-gradient(90deg, rgba(47,158,68,.08), transparent); }
.rlist .secs { margin: 2px 0 0 16px; color: var(--muted); }
.rlist .secs a { color: var(--accent); border-bottom: 0; }
.rlist .warn-dot { margin-left: 3px; transform: scale(.85); }
.flagnote { color: #b35c00; }
@media (prefers-color-scheme: dark) { .flagnote { color: #ffb366; } }
.flagnote button { color: inherit; }
#pol-found h3 { margin: 4px 0; }
#pol-check > h3 { margin-top: 18px; }
.pol-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; margin: 12px 0; }
.pol-meta label { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); }
.pol-meta input, .pol-meta select { margin-top: 2px; color: var(--fg); }
.docview { white-space: pre-wrap; border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 50vh; overflow-y: auto; font-size: 14px; }
.secrow { padding: 4px 0; border-bottom: 1px solid var(--line); }
.sec-num { display: inline-block; min-width: 3.2em; font-weight: 700; color: var(--accent); }
.small-btn { font-size: 12px; padding: 1px 8px; }
.pcard { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; margin: 10px 0; }
.pcard h3 { margin: 4px 0; }
.src-head h1 { margin-bottom: 4px; }
.sections-view .sec { padding: 6px 10px; border-left: 3px solid transparent; border-radius: 4px; }
.sections-view .sec.hit, .law-line.hit { background: var(--on); color: var(--on-fg); border-left-color: #f08c00; }
.sec-text { white-space: pre-wrap; }
.sections-view .sec > .sec-text { margin-top: 2px; }
.law-text { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: 15px; }
.law-line { padding: 2px 6px; border-left: 3px solid transparent; }
.law-h { margin-top: 12px; border-top: 0; padding-top: 0; }
.law-lookup input { width: 90px; display: inline-block; padding: 3px 6px; }
.acas-h { margin: 18px 0 4px; font-size: 16px; }
.status-current { color: #2f9e44; } .status-old { color: #b35c00; }
.note { border-left: 4px solid var(--accent); background: var(--panel); padding: 6px 12px; border-radius: 6px; }
.hide-tick { font-size: 13px; color: var(--muted); margin-right: 4px; }
.details li.kept, #loose-details li.kept { color: var(--muted); }
.details li.kept .kind, #loose-details li.kept .kind { text-decoration: line-through; }
.secrow .small-btn { opacity: 0; } .secrow:hover .small-btn, .secrow .small-btn:focus { opacity: 1; }
.centre a, .rlist .secs a { color: var(--accent); }

/* M2.5: wording for the double-click file (local server) or the hosted site */
html[data-hosted="1"] .local-only, html:not([data-hosted="1"]) .hosted-only { display: none; }

/* M2.6: onboarding and case start */
.ob-progress { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; }
.ob-step { border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 16px; padding: 5px 12px; cursor: pointer; }
.ob-step.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ob-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px; margin: 8px 0 16px; }
.ob-choice { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.ob-choice.on { border-color: var(--accent); }
.ob-field { display: block; margin: 10px 0; }
.ob-field input, .ob-field textarea { display: block; width: 100%; max-width: 480px; margin-top: 4px; box-sizing: border-box; }
.ob-nav { margin-top: 20px; }
.ob-policies li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.code { font-family: Consolas, Menlo, monospace; font-size: 17px; letter-spacing: .5px; overflow-wrap: anywhere; }
.likely { color: var(--accent); margin-left: 4px; }
.note.alert { border-left: 4px solid #d33; }

.danger-zone { margin-top: 18px; border: 1px solid #d33; border-radius: 8px; padding: 10px 14px; }
.danger-zone summary { cursor: pointer; font-weight: 600; }
button.danger { background: #c62828; border-color: #c62828; color: #fff; }
button.danger:disabled { opacity: .45; cursor: not-allowed; }

/* requests 12 and 13 */
.where { margin: 8px 0 0; }
.where dt { font-weight: 600; margin-top: 8px; }
.where dd { margin: 2px 0 0; }
.where-table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; }
.where-table th, .where-table td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
@media (max-width: 760px) { .where-table { display: block; overflow-x: auto; } }

/* request 15: the welcome screen */
.lead { font-size: 19px; margin-top: 0; }
.welcome { margin: 16px 0; }
.welcome dt { font-weight: 700; margin-top: 16px; }
.welcome dd { margin: 3px 0 0; max-width: 72ch; }
.why { max-width: 72ch; }

/* requests 17 to 20 */
#profile-list label { display: block; margin: 4px 0; cursor: pointer; }
.doc-list li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.doc-list select { margin: 0 6px; }

/* requests 21 and 23 */
.pol-tags { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 12px 0; }
#pol-tags, .tag-edit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-choice { border: 1px solid var(--line); border-radius: 16px; padding: 4px 10px; cursor: pointer; font-size: 14px; }
.tag-choice.on { border-color: var(--accent); }
.tag-edit p { flex-basis: 100%; margin: 6px 0 0; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* requests 24 to 26 */
.left .nav { margin-left: 6px; }
.file.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }
.drop-zone { border: 2px dashed var(--line); border-radius: 10px; padding: 26px 16px; margin: 14px 0; text-align: center; }
.drop-zone.compact { padding: 12px 16px; }
.drop-zone.over { border-color: var(--accent); }
.drop-zone p { margin: 8px 0 0; }
.big-file { font-size: 18px; padding: 12px 22px; }

/* test round: one column while setting up, compact document rows, a phone menu */
@media (min-width: 761px) { .shell.no-right { grid-template-columns: 230px minmax(0, 1fr); } .shell.no-right .right { display: none; } }
@media (max-width: 760px) { .shell.no-right .right { display: none; } }
.doc-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doc-list li .doc-name { flex: 1 1 240px; overflow-wrap: anywhere; }
.doc-list li .doc-name span { display: block; }
.doc-list li.is-complaint { border-left: 4px solid var(--accent); }
#drop label.file { display: inline-block; }
.doc-list select { width: auto; margin: 0; }
.doc-list .flagnote { flex-basis: 100%; }
.test-tools { margin-top: 26px; color: var(--muted); }
.test-tools summary { cursor: pointer; font-size: 13px; }
#menu-toggle { display: none; margin-left: auto; }
.brand { position: relative; }
@media (max-width: 760px) {
  .left { padding-bottom: 10px; }
  .brand { margin-bottom: 0; }
  #menu-toggle { display: inline-block; }
  #menu-links { display: none; margin-top: 10px; }
  #menu-links.open { display: block; }
}

/* helpp's AI agent (M3) */
#ai-box { margin-top: 24px; border-top: 1px solid var(--line, #3334); padding-top: 8px; }
.verdict { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 0.85em; font-weight: 600; }
.verdict.good { background: #2e7d3226; color: #2e7d32; }
.verdict.bad { background: #c6282826; color: #c62828; }
.verdict.none { background: #7772; color: inherit; }
.ai-point { border: 1px solid #7774; border-radius: 8px; padding: 8px 14px; margin: 12px 0; }
.ai-point h4 { margin: 6px 0; }
.ai-check { margin: 10px 0 10px 8px; }
.ai-check p { margin: 4px 0; }
.ai-check blockquote, .ai-answer blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid #7779; font-size: 0.95em; }
.quotes { margin: 4px 0; font-style: italic; }
.chip { font-size: 0.85em; padding: 2px 8px; margin: 2px 0; border-radius: 12px; }
.ai-answer { border-top: 1px solid #7774; padding-top: 6px; margin-top: 10px; }
.note { border: 1px solid #7776; border-radius: 8px; padding: 6px 12px; }

/* M3.1 assessment screens (from archive/mock-ups/mockup-understand.html, draft 4) */
:is(#step-ai, #step-actions, #ex-body) .card { border: 1px solid #7774; border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
:is(#step-ai, #step-actions, #ex-body) .card.confirm-box { border: 2px solid var(--accent); }
:is(#step-ai, #step-actions, #ex-body) .card h3 { margin: 0 0 6px; }
:is(#step-ai, #step-actions, #ex-body) .item { border-top: 1px solid #7773; padding: 8px 0; }
:is(#step-ai, #step-actions, #ex-body) .item:first-of-type { border-top: 0; }
:is(#step-ai, #step-actions, #ex-body) .notice { background: #7771; border-radius: 6px; padding: 6px 10px; }
:is(#step-ai, #step-actions, #ex-body) .warn { color: #a3262a; font-weight: 600; }
:is(#step-ai, #step-actions, #ex-body) .confirm { display: inline-flex; gap: 6px; flex-wrap: wrap; }
:is(#step-ai, #step-actions, #ex-body) .confirm button { font: inherit; font-size: 13px; padding: 2px 10px; border: 1px solid #7776; border-radius: 14px; background: transparent; color: inherit; cursor: pointer; }
:is(#step-ai, #step-actions, #ex-body) .confirm button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
:is(#step-ai, #step-actions, #ex-body) .flaggroup { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .75; margin: 10px 0 4px; }
:is(#step-ai, #step-actions, #ex-body) .flag { border: 1px solid #7776; border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
:is(#step-ai, #step-actions, #ex-body) .flag.urgent { border-color: #c62828; background: #c628280f; }
:is(#step-ai, #step-actions, #ex-body) .flag.hit { border-color: #b26a00; background: #b26a000d; }
:is(#step-ai, #step-actions, #ex-body) .quote { opacity: .8; font-size: 13px; border-left: 3px solid #7776; padding-left: 8px; margin: 4px 0; }
:is(#step-ai, #step-actions, #ex-body) .fq { font-size: 14px; margin-top: 4px; }
:is(#step-ai, #step-actions, #ex-body) .fix { margin-top: 8px; padding: 8px 12px; background: #1c5fb812; border: 1px solid #1c5fb840; border-radius: 6px; font-size: 14px; }
:is(#step-ai, #step-actions, #ex-body) .fix label, :is(#step-ai, #step-actions, #ex-body) .item label { margin-right: 12px; }
:is(#step-ai, #step-actions, #ex-body) textarea#as-notes { width: 100%; }
:is(#step-ai, #step-actions, #ex-body) .standing { background: #7771; border-left: 3px solid var(--accent); padding: 6px 10px; }
:is(#step-ai, #step-actions, #ex-body) .tag { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 4px; padding: 1px 7px; margin-left: 4px; color: #fff; }
:is(#step-ai, #step-actions, #ex-body) .tag.legal { background: #7a2e8f; } :is(#step-ai, #step-actions, #ex-body) .tag.policy { background: #1c5fb8; } :is(#step-ai, #step-actions, #ex-body) .tag.workplace, :is(#step-ai, #step-actions, #ex-body) .tag.service { background: #2f7d4f; }
:is(#step-ai, #step-actions, #ex-body) .prio { color: #b26a00; }
:is(#step-ai, #step-actions, #ex-body) .boxes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 8px 0; font-size: 13px; }
:is(#step-ai, #step-actions, #ex-body) .boxes div { border-radius: 6px; padding: 6px 9px; background: #7771; }
:is(#step-ai, #step-actions, #ex-body) .boxes b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
:is(#step-ai, #step-actions, #ex-body) details.chk { margin: 4px 0 4px 4px; font-size: 14px; }
:is(#step-ai, #step-actions, #ex-body) .action { border: 1px solid #7774; border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
:is(#step-ai, #step-actions, #ex-body) .action.urgent { border-left: 5px solid #c62828; }
:is(#step-ai, #step-actions, #ex-body) .action h4 { margin: 0 0 2px; }
:is(#step-ai, #step-actions, #ex-body) .src { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; border-radius: 3px; padding: 0 5px; margin-right: 6px; background: #7772; }
:is(#step-ai, #step-actions, #ex-body) table.dates { border-collapse: collapse; width: 100%; font-size: 14px; }
:is(#step-ai, #step-actions, #ex-body) table.dates td { border-top: 1px solid #7774; padding: 6px 8px; vertical-align: top; }
:is(#step-ai, #step-actions, #ex-body) table.dates td.d { font-weight: 600; white-space: nowrap; }
:is(#step-ai, #step-actions, #ex-body) .past { color: #c62828; font-weight: 600; font-size: 12px; }
:is(#step-ai, #step-actions, #ex-body) .kind { font-size: 12px; opacity: .75; }
@media (max-width: 820px) { :is(#step-ai, #step-actions, #ex-body) .boxes { grid-template-columns: 1fr; } }

/* guidance sheets on flags and actions (M3.1) */
:is(#step-ai, #step-actions, #ex-body) .gsheet { margin: 6px 0; }
:is(#step-ai, #step-actions, #ex-body) .gsheet summary { cursor: pointer; color: var(--accent); }
:is(#step-ai, #step-actions, #ex-body) .gsheet p { margin: 4px 0 4px 14px; }
:is(#step-ai, #step-actions, #ex-body) .judgment-passage { margin: 6px 0; }

/* M4a: signed out, only the front page, the examples, About and signing in show */
body.signed-out nav.left, body.signed-out aside.right, body.signed-out main.centre > :not(.out):not(#not-started) { display: none !important; }
body.signed-out .shell { grid-template-columns: minmax(0, 1fr); }
body.signed-out main.centre { margin: 0 auto; width: 100%; max-width: 980px; padding-top: 20px; }
.si-form { max-width: 28rem; }
#si-message.ok { color: var(--ok, #1d6b3a); }
.case-row { display: flex; gap: .75rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--line, #ddd); }
.case-row .ref { font-weight: 600; min-width: 5rem; }
.case-row .grow { flex: 1; }
.case-row .grow .muted { display: block; }
#unlock-bar label { margin: 0 .5rem; }

/* 4.3: set-up shows alone until the passphrase is chosen */
body.setting-up #menu-links, body.setting-up aside.right, body.setting-up main.centre > :not(#view-onboarding):not(#not-started) { display: none !important; }
body.setting-up .test-tools { display: none; }

/* 4.3: cards, the front page, the frozen bar and its stages */
input[type=email], input[type=password], input[type=date] { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.card { border: 1px solid #7774; border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.card.tint { background: #1c5fb814; border-color: transparent; }
.card h3 { margin: 0 0 6px; }
h2.plain { border: 0; padding: 0; margin: 0 0 6px; }
.wordmark { font-weight: 700; color: var(--accent); text-decoration: none; }
#view-front h1 { margin-top: 28px; line-height: 1.2; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.three .card { margin: 0; }
.front-table th { width: 30%; font-weight: 600; }
.front-table th, .front-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.front-foot { margin-top: 30px; }
@media (max-width: 820px) { .three { grid-template-columns: 1fr; } }
#case-bar, .frozen { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
#case-bar .case-id { font-size: 14px; margin-bottom: 6px; }
#case-bar #next-hint { margin: 6px 0 0; }
#cb-saved.saved { color: #2f9e44; margin-left: 8px; }
.stages { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stages button { flex: 1 1 auto; margin: 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 8px 4px; font-size: 13px; white-space: nowrap; }
.stages button:last-child { border-right: 0; }
.stages button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.stages button.done { color: #2f9e44; }
#view-case [data-stage]:not(.on-stage) { display: none !important; }
#view-case [data-stage] > h1 { margin: 4px 0 10px; }
.stage-next { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 14px; }
section { scroll-margin-top: 130px; }
@media (max-width: 760px) { #case-bar, .frozen { position: static; } }
.urgent-strip { border-color: #c62828 !important; background: #c6282818; }
table.glance td { border-top: 1px solid #7774; padding: 6px 8px 6px 0; }
.verdict { white-space: nowrap; }
.rp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.rp-tabs button { margin: 0; text-align: left; }
.rp-tabs button.on { border-color: var(--accent); background: #1c5fb81f; }
.rp-point { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 0; }
.rp-point .grow { flex: 1 1 260px; }
.rp-point select { width: auto; }
textarea.letter { font: inherit; line-height: 1.55; padding: 18px 22px; }
.letter-view { white-space: pre-wrap; border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
#view-case #ai-status:not(:empty) { display: block; margin-top: 8px; }
main.centre { width: 100%; }
.shell.no-right main.centre { margin: 0; }
@media (prefers-color-scheme: dark) { .verdict.good { background: #1d3a28; color: #7ddba0; } .verdict.bad { background: #4a2020; color: #ff9a9a; } .stages button.done, #cb-saved.saved { color: #7ddba0; } }
#out-nav { position: sticky; top: 0; z-index: 25; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 0; margin-bottom: 14px; }
#out-nav .wordmark { font-size: 1.25em; }
#out-nav .out-links { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 4px 18px; }
#out-nav a:not(.wordmark) { text-decoration: none; color: inherit; padding: 4px 0; }
#out-nav a[aria-current]:not(.wordmark) { border-bottom: 2px solid var(--accent); font-weight: 600; }
#out-nav button { margin: 0; }
#ex-body .frozen { top: 58px; }
@media (max-width: 760px) { #out-nav { position: static; } }

/* the public site's colours and header */
:root { --accent: #0f5c6e; --bg: #fbfcfc; --fg: #1b2328; --muted: #55636b; --line: #dfe5e7; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --accent: #6cc0d1; --on-accent: #0f1416; --bg: #0f1416; --fg: #e6ecee; --muted: #9aa8ae; --line: #33424b; color-scheme: dark; } }
main { max-width: 56rem; padding: 1rem 1.25rem 2rem; }
.top, .foot { max-width: 56rem; margin: 0 auto; padding: 1.5rem 1.25rem .5rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.25rem; }
.top .home { display: flex; align-items: center; gap: .6rem; margin-right: auto; text-decoration: none; color: var(--fg); font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.top a, .foot a, #ex-body a { color: var(--accent); }
.top a.home { color: var(--fg); }
.top .reg { font-weight: 650; padding: .55rem 1.1rem; border-radius: 6px; background: var(--accent); color: var(--on-accent); text-decoration: none; }
.foot { justify-content: space-between; color: var(--muted); font-size: .9rem; padding-bottom: 2rem; }
#ex-body .frozen { top: 0; }
.letter-view { overflow-wrap: anywhere; }
.mock { background: #3a2d00; color: #fff3c4; font-size: .88rem; padding: .5rem 1rem; }
