:root {
  --ink: #100d0e; --muted: #6e7278; --line: #e6e7e9; --mist: #f3f4f5; --paper: #ffffff;
  --cyan: #71d8de; --orange: #fe8050; --ok: #0fa3ab; --warn: #e8552f;
  --radius: 12px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--paper); display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); font-weight: 400; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 650; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.mark { position: relative; width: 18px; height: 18px; display: inline-block; }
.mark i { position: absolute; width: 10px; height: 18px; border-radius: 5px; }
.mark .c { background: var(--cyan); left: 7px; }
.mark .o { background: var(--orange); left: 1px; top: 4px; height: 14px; opacity: .9; }
.save-state { font-size: 13px; color: var(--muted); transition: color .2s; }
.save-state.saved { color: var(--ok); }
.save-state.error { color: var(--warn); }

.layout { flex: 1; display: grid; grid-template-columns: 240px 360px 1fr; min-height: 0; }
.standards { border-right: 1px solid var(--line); padding: 12px; overflow: auto; background: #fbfbfc; }
.std { width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: var(--radius); cursor: pointer; margin-bottom: 4px; }
.std:hover { background: var(--mist); }
.std.active { background: var(--ink); color: #fff; }
.std .name { font-weight: 600; }
.std .meta { font-size: 12px; opacity: .7; margin-top: 2px; }
.progress { height: 6px; background: rgba(110,114,120,.18); border-radius: 3px; margin-top: 8px; overflow: hidden; display: flex; }
.progress span { height: 100%; transition: width .4s ease; }
.progress .done { background: var(--ok); }
.progress .na { background: #b9bcc1; }
.progress .prog { background: var(--orange); }
.std.active .progress { background: rgba(255,255,255,.2); }

.list-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list-tools { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.list-tools input { flex: 1; min-width: 0; }
input[type=search], input[type=text], select, textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
.standard-info { padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.standard-info .notice { color: var(--ink); background: rgba(254,128,80,.12); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.requirements { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.req { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.req:hover { background: var(--mist); }
.req.active { background: rgba(113,216,222,.22); }
.req .id { font-weight: 600; min-width: 44px; font-variant-numeric: tabular-nums; }
.req .title { flex: 1; }
.req .chev { width: 18px; height: 18px; margin-top: 1px; flex: none; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 16px; line-height: 16px; padding: 0; border-radius: 6px; transition: transform .15s ease; }
.req .chev:hover { background: rgba(16,13,14,.08); color: var(--ink); }
.req .chev.open { transform: rotate(90deg); }
.req .dot { margin-left: 5px; margin-right: 4px; }
.req .id:empty { display: none; }
.req.kind-module .title, .req.kind-group .title { font-weight: 650; }
.req.kind-section .title { font-weight: 600; }
.req .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 1px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
.req .count.settled { color: var(--ink); }
.mini-bar { display: flex; width: 44px; height: 4px; border-radius: 2px; overflow: hidden; background: #e4e6e9; margin-top: 4px; }
.mini-bar .done { background: var(--ok); }
.mini-bar .not-applicable { background: #9ea2a8; }
.mini-bar .in-progress { background: var(--orange); }
.req .title .dot { display: inline-block; margin: 0 0 1px 7px; vertical-align: middle; }
.req.status-not-applicable:not(.active) .title, .req.status-not-applicable:not(.active) .id { color: var(--muted); }
.nav-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; background: #d4d6d9; }
.dot.in-progress { background: var(--orange); }
.dot.done { background: var(--ok); }
.dot.not-applicable { background: #9ea2a8; }

.detail { overflow: auto; padding: 22px 28px 40px; }
.empty { color: var(--muted); margin-top: 20vh; text-align: center; }
.detail h1 { font-size: 22px; margin: 0 0 4px; }
.detail .sub { color: var(--muted); margin-bottom: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.link-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.link-btn:hover { border-color: var(--ink); }
.pdf { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.segmented { display: inline-flex; background: var(--mist); border-radius: 999px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.segmented button.active { background: #fff; box-shadow: 0 1px 3px rgba(16,13,14,.12); font-weight: 600; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea { width: 100%; resize: vertical; }
textarea.body { min-height: 280px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; }
textarea.evidence { min-height: 80px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 10px; align-items: center; }
.primary { background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 10px 22px; font-weight: 600; cursor: pointer; }
.primary:disabled { opacity: .35; cursor: default; }

.text-block { margin: 4px 0 22px; }
.text-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.text-head label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.text-head .link-btn { margin-left: auto; }
.link-btn.small { padding: 3px 10px; font-size: 12.5px; }
.req-text { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: #fcfcfd;
  font-size: 13.5px; line-height: 1.55; max-height: none; overflow: hidden; position: relative; }
.req-text.collapsed { max-height: 42vh; overflow: auto; }
.req-text p { margin: 0 0 8px; }
.req-text p:first-child { font-weight: 600; font-size: 14.5px; }
.req-text .t-bullet { padding-left: 18px; position: relative; }
.req-text .t-bullet::before { content: "•"; position: absolute; left: 4px; color: var(--muted); }
.req-text .t-test { border-left: 3px solid var(--cyan); padding-left: 10px; color: #33373c; }
.req-text .t-label { margin-top: 14px; }
.req-text .t-label strong { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--orange); margin-bottom: 2px; }
.text-missing { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.inherited { color: var(--ink); background: rgba(254,128,80,.12); border-radius: 10px; padding: 8px 10px; margin-bottom: 18px; font-size: 14px; }

.todo-nav { border: 1px dashed var(--line); margin-bottom: 6px; }
.todo { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; cursor: pointer; list-style: none; }
.todo:hover { background: var(--mist); }
.todo.active { background: rgba(113,216,222,.22); }
.todo input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ok); flex: none; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-weight: 500; }
.todo.done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.todo-meta .overdue { color: var(--warn); font-weight: 600; }
.chip { background: var(--mist); border-radius: 999px; padding: 1px 8px; font-size: 12px; border: 0; }
.chip.link { cursor: pointer; }
.chip.link:hover { background: rgba(113,216,222,.35); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 16px; }
.todos-inline { margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.empty-list { color: var(--muted); padding: 16px; list-style: none; }
.title-input { width: 100%; font-size: 16px; font-weight: 600; }
.field input[type=date], .field select { width: 100%; }

.doc-folder { list-style: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 4px; }
.doc-icon { color: var(--muted); width: 14px; flex: none; }
.doc-path { font-size: 12px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-bottom: 10px; }
.evidence-links { margin: 8px 0 0; }
.markdown { max-width: 860px; font-size: 14.5px; line-height: 1.6; }
.markdown h1 { font-size: 24px; margin: 0 0 14px; }
.markdown h2 { font-size: 18px; margin: 28px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.markdown h3 { font-size: 15.5px; margin: 20px 0 8px; }
.markdown h4 { font-size: 14px; margin: 16px 0 6px; }
.markdown p { margin: 0 0 12px; }
.markdown ul, .markdown ol { margin: 0 0 12px; padding-left: 22px; }
.markdown li { margin: 3px 0; }
.markdown li.nested { margin-left: 18px; }
.markdown code { background: var(--mist); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
.markdown pre { background: var(--mist); border-radius: 10px; padding: 12px 14px; overflow: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown pre.mermaid { background: none; text-align: center; overflow-x: auto; }
.markdown pre.mermaid svg { max-width: none !important; } /* natural size; the block scrolls */
.markdown pre.mermaid-failed { background: var(--mist); text-align: left; white-space: pre; }
.markdown .md-image { overflow-x: auto; margin: 0 0 14px; }
.markdown .md-image img { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.markdown blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--cyan); background: #fbfcfc; }
.markdown a { color: var(--ok); }
.md-table { overflow-x: auto; margin: 0 0 14px; }
.markdown table { border-collapse: collapse; font-size: 13.5px; width: 100%; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.markdown th { background: var(--mist); font-weight: 600; }
.notes-view { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: #fff; font-size: 14px; }
.notes-view h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 0; padding: 0; margin: 18px 0 6px; }
.notes-view h2:first-child { margin-top: 0; }
.notes-view > :last-child { margin-bottom: 0; }
.notes-empty { color: var(--muted); font-size: 14px; }

/* Periodic tasks and the compliance site's read-only views */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.due-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 5px; background: var(--line); }
.due-dot.ok { background: var(--ok); }
.due-dot.soon { background: var(--orange); }
.due-dot.overdue { background: var(--warn); box-shadow: 0 0 0 3px rgba(232,85,47,.18); }
.due-banner { display: inline-block; border-radius: 10px; padding: 6px 12px; margin-bottom: 14px; background: var(--mist); font-weight: 600; }
.due-banner.ok { background: rgba(15,163,171,.12); }
.due-banner.soon { background: rgba(254,128,80,.16); }
.due-banner.overdue { background: rgba(232,85,47,.16); color: var(--warn); }
.todo-notes { white-space: pre-wrap; margin: 4px 0 0; }
.record-form .comment { min-height: 90px; width: 100%; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { border-top: 1px solid var(--line); padding: 10px 0; }
.history li:first-child { border-top: 0; }
.history-head { display: flex; gap: 10px; align-items: baseline; }
.history-comment { white-space: pre-wrap; margin-top: 4px; }
.status-view { display: flex; align-items: center; gap: 8px; }
.evidence-view { margin: 4px 0; padding-left: 18px; word-break: break-all; }
.signed-out { margin: 20vh auto; text-align: center; grid-column: 1 / -1; }
.record-form .comment { font: inherit; }
.record-form .actions .primary { white-space: nowrap; flex: none; }

/* Requirement text read from the standards' tables: requirement first, the rest on demand. */
.req-text.structured.collapsed { max-height: none; overflow: visible; }
.req-text.structured.collapsed .t-more { display: none; }
.req-text .t-statement { font-weight: 600; font-size: 14.5px; }
.req-text.structured p:first-child { font-weight: inherit; font-size: inherit; }
.req-text.structured .t-statement:first-child { font-weight: 600; font-size: 14.5px; }
.req-text .t-part + .t-part, .req-text .t-more .t-part { margin-top: 16px; }
.req-text .t-part-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--orange); margin-bottom: 6px; font-weight: 600; }
.req-text .t-tests .t-test { border-left: 3px solid var(--cyan); padding-left: 10px; color: #33373c; }
.req-text .t-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.req-text .t-guidance { color: #33373c; }
.req-text .t-guidance .t-label strong { color: var(--muted); }
