/* Enhaus design system (claude.ai artifact "Enhaus", 2026-11-10): navy, paper and mint; DM Sans for headings,
   Epilogue for text; dark by default, light when chosen (theme.js, data-theme on <html>). A client's branding.yml
   colours override the brand ones (/brand.css). Fonts: SIL Open Font License, fonts/OFL-*.txt. */
@font-face { font-family: "DM Sans"; font-weight: 600; font-display: swap; src: url(/fonts/dm-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Sans"; font-weight: 700; font-display: swap; src: url(/fonts/dm-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Epilogue"; font-weight: 400; font-display: swap; src: url(/fonts/epilogue-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Epilogue"; font-weight: 600; font-display: swap; src: url(/fonts/epilogue-latin-600-normal.woff2) format("woff2"); }
:root {
  color-scheme: dark;
  --navy: #141833; --paper: #f6f7fb; --mint: #3bdfa8;
  --bg: #141833; --panel: #1c2143; --ink: #f6f7fb; --muted: #a9aecb; --line: #2c3358;
  --fill: #3bdfa8; --on-fill: #141833; --accent: #3bdfa8; --accent-soft: #1a3645; --mark: #1d444d;
  --warn: #f2c26b; --warn-soft: #3a3326; --ok: #3bdfa8; --ok-soft: #1a3645;
  --bad: #f08a9a; --bad-soft: #3a2340; --cite-box: rgba(59, 223, 168, 0.28);
  --btn2: transparent; --btn2-line: #a9aecb; --btn2-hover: rgba(246, 247, 251, 0.07);
  --font-head: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-text: "Epilogue", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px; --space-5: 32px; --space-6: 48px;
  --radius-sm: 6px; --radius-md: 12px; --radius-pill: 999px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb; --panel: #ffffff; --ink: #141833; --muted: #545a78; --line: #e2e5ef;
  --fill: #3bdfa8; --on-fill: #141833; --accent: #0b6e4d; --accent-soft: #ddf8ee; --mark: #c6f3e2;
  --warn: #8a5a00; --warn-soft: #fbefd9; --ok: #0b6e4d; --ok-soft: #ddf8ee;
  --bad: #b3364a; --bad-soft: #fbe4e8; --cite-box: rgba(11, 110, 77, 0.22);
  --btn2: transparent; --btn2-line: #545a78; --btn2-hover: rgba(20, 24, 51, 0.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-text); }
/* One width for every app page, so the top bar and panels stay put when moving between pages; review is wider
   (page image and fields side by side), sign-in narrower (login.html). */
main { max-width: 1200px; margin: 0 auto; padding: 0 16px 48px; }
main.wide { max-width: 1440px; }
h1 { font: 700 26px/1.15 var(--font-head); letter-spacing: -0.01em; margin: 0; }
h2 { font: 700 19px/1.2 var(--font-head); margin: 0 0 10px; }
h3 { font: 600 12px/1.4 var(--font-text); margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
a { color: var(--accent); text-underline-offset: 2px; }
/* A link handled by script (no href) still looks and acts like one. */
a:not([href]) { cursor: pointer; text-decoration: underline; }
/* Action buttons in the side panel (watches, collections): equal width, a grid that fills the row. */
.row.watch-actions, .watch-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; margin-top: 6px; }
.watch-actions button.small { width: 100%; margin: 0; padding: 3px 8px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { color: var(--muted); font-size: 13px; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=number], input:not([type]), select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; }
button { border: 0; border-radius: var(--radius-pill); padding: 7px 18px; background: var(--fill); color: var(--on-fill);
         font-family: var(--font-head); font-weight: 600; cursor: pointer; }
button:not(:disabled):hover { filter: brightness(1.06); }
button.secondary { background: var(--btn2); color: var(--ink); border: 1px solid var(--btn2-line); }
button.secondary:not(:disabled):hover { background: var(--btn2-hover); }
button.danger { background: var(--bad); color: var(--bg); }
button.small { padding: 3px 12px; min-height: 28px; font-size: 13px; }
td button.small, .row button.small { margin: 2px 4px 2px 0; }
button.armed { background: var(--bad); color: var(--bg); border-color: var(--bad); }
button.link { background: none; color: var(--accent); padding: 0; border-radius: 0; font-family: var(--font-text); font-weight: 400; }
button:disabled { opacity: .5; cursor: default; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) 20px; margin-top: var(--space-3); }
/* CHAT-11: claims shown while the answer is still being written. */
.panel.streaming { border-style: dashed; }
/* UI-15: hidden values on the review screens. */
.reveal { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.reveal input { flex: 1 1 200px; }
/* CHAT-15/16/17: one action line under an answer: feedback left, export and watch right. */
.answer-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: nowrap;
  margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--line); }
.answer-actions .group { display: flex; gap: 6px; align-items: center; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; min-height: 26px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 12px;
  line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: none; }
.pill:hover { color: var(--ink); border-color: var(--muted); background: transparent; }
.icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.answer-actions .thanks { font-size: 12px; }
@media (max-width: 520px) { .pill span { display: none; } .pill { padding: 3px 8px; } }
/* "Report a wrong value": a small flag after the citations, clearer on hover. */
.flag-btn { background: none; border: 0; padding: 0 2px; margin-left: 4px; min-height: 0; color: var(--muted); opacity: .45;
  cursor: pointer; vertical-align: middle; box-shadow: none; }
.flag-btn .icon { width: 12px; height: 12px; }
.claim:hover .flag-btn, .answer-table tr:hover .flag-btn, .flag-btn:focus-visible { opacity: 1; }
.flag-btn:hover { color: var(--bad, #d9534f); background: none; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; }
.inline-form input { flex: 1 1 160px; min-width: 0; }
.inline-form input[type=number] { flex: 0 0 7ch; }
/* CHAT-17: alerts and watches in the side panel. */
.watchbox { margin-top: var(--space-3); }
.watchbox summary { cursor: pointer; font-weight: 600; }
.watchbox ul { list-style: none; margin: 6px 0; padding: 0; }
.watchbox li { margin: 6px 0; }
.watchbox li.new a { font-weight: 600; }
.watchbox .small, .note .small { font-size: 0.85em; }
/* CHAT-14: what a question without an answer looked for. */
.searched { margin-top: var(--space-2); }
.searched .nearest { margin: 4px 0 0; padding-left: 18px; }
.searched .nearest li { margin: 4px 0; font-size: 0.92em; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--bad); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
       padding: 2px 10px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--ink);
       margin: 0 4px 2px 0; white-space: nowrap; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.new { background: var(--fill); color: var(--on-fill); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
nav.top { display: flex; align-items: center; gap: 18px; padding: 14px 0; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
nav.top .brand { font: 700 21px/1 var(--font-head); letter-spacing: -0.02em; margin-right: 8px; display: flex; align-items: center; gap: 10px; }
nav.top .brand .wordmark { height: 30px; width: auto; display: block; }
/* The built-in wordmark: white on the dark theme, navy on the light one. */
.logo-on-light { display: none !important; }
:root[data-theme="light"] .logo-on-light { display: block !important; }
:root[data-theme="light"] .logo-on-dark { display: none !important; }
.brand-heading img { max-width: 100%; display: block; }
.brand-heading { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); letter-spacing: -0.02em; }
.brand-heading .wordmark { height: 40px; width: auto; display: block; }
.brand-tagline { margin: 4px 0 0; color: var(--muted); }
.brand-company { margin: 2px 0 0; }
nav.top a { text-decoration: none; color: var(--muted); }
nav.top a.on { color: var(--ink); font-weight: 600; }
nav.top .who { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
nav.top .who .tag { margin: 0; padding: 3px 10px; }
nav.top .who .tag-sub { opacity: .75; }
nav.top .who .signout { margin-left: 6px; padding: 4px 12px; min-height: 30px; font-size: 13px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg);
         padding: 8px 18px; border-radius: var(--radius-pill); font-size: 14px; display: none; z-index: 10; max-width: 90vw; }
.toast.show { display: block; }
.page { position: relative; }
.page img { width: 100%; display: block; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.box { position: absolute; border-radius: 2px; }
.box.cite { background: var(--cite-box); outline: 2px solid var(--fill); }
@media (max-width: 700px) { nav.top { gap: 12px; flex-wrap: wrap; } nav.top .who { margin-left: 0; width: 100%; justify-content: flex-start; } }

pre.codes { font: 15px/1.7 ui-monospace, Menlo, monospace; background: var(--bg); border: 1px solid var(--line);
            border-radius: var(--radius-sm); padding: 10px 14px; columns: 2; user-select: all; }
.stack { display: grid; gap: 10px; }
.stack input:not([type=checkbox]):not([type=radio]) { width: 100%; }
button, .tap { min-height: 36px; }
/* Page numbers of a document (review, processing result): compact, so a long document fits in few rows. */
.pagenums { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 8px; }
.pagenums button { min-width: 30px; min-height: 28px; padding: 2px 5px; font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; }   /* no zoom-on-focus on iOS */
  table { display: block; overflow-x: auto; }
  .panel { padding: 12px; }
  pre.codes { columns: 1; }
}
.groups { display: flex; flex-wrap: wrap; gap: 2px 10px; min-width: 220px; }
.groups label { color: var(--ink); font-size: 13px; white-space: nowrap; }

/* Side menu: a rail of icons when closed, icon and text when open (app.js boot). */
body.has-sidenav { padding-left: 60px; }
body.nav-anim { transition: padding-left .15s ease; }
body.has-sidenav.nav-open { padding-left: 196px; }
.sidenav { position: fixed; top: 0; left: 0; bottom: 0; width: 60px; z-index: 4; display: flex; flex-direction: column;
           gap: 4px; padding: 12px 10px; background: var(--panel); border-right: 1px solid var(--line);
           overflow: hidden; }
.nav-anim .sidenav { transition: width .15s ease; }
.nav-open .sidenav { width: 196px; }
.sidenav a, .sidenav button.toggle, .sidenav button.theme { display: flex; align-items: center; gap: 12px; height: 40px; min-height: 40px;
           padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); text-decoration: none;
           white-space: nowrap; font: 400 14px var(--font-text); cursor: pointer; }
.sidenav button.theme { margin-top: auto; }
.sidenav button.toggle { margin-bottom: 8px; }
.sidenav a:hover, .sidenav button.toggle:hover, .sidenav button.theme:hover { background: var(--bg); color: var(--ink); filter: none; }
.sidenav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidenav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
               stroke-linecap: round; stroke-linejoin: round; }
.sidenav .label { opacity: 0; transition: opacity .1s ease; }
.nav-open .sidenav .label { opacity: 1; }
@media (max-width: 700px) {
  /* Phones: the open menu lies over the page instead of pushing it aside. */
  body.has-sidenav, body.has-sidenav.nav-open { padding-left: 52px; }
  .sidenav { width: 52px; padding: 10px 6px; }
  .nav-open .sidenav { width: 196px; box-shadow: 4px 0 24px rgba(0, 0, 0, .18); }
}

/* Processing time per phase (review page, result popup). */
.timing { display: grid; gap: 4px; font-size: 13px; max-width: 420px; }
.timing .trow { display: grid; grid-template-columns: 64px 84px 1fr 40px; align-items: center; gap: 8px; }
.timing .tms { text-align: right; font-variant-numeric: tabular-nums; }
.timing .tpct { text-align: right; font-variant-numeric: tabular-nums; }
.timing .tbar { height: 6px; border-radius: 3px; background: var(--line, rgba(127,127,127,.2)); overflow: hidden; }
.timing .tbar > span { display: block; height: 100%; background: var(--accent); }
.timing .slow { font-weight: 600; }
.timing .slow .tbar > span { background: var(--warn); }
.timing .total { border-top: 1px solid var(--line, rgba(127,127,127,.25)); padding-top: 4px; font-weight: 600; }
th.took, td.took { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag.cat { background: transparent; border: 1px solid var(--line, #ccc); color: inherit; }
.cats { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 12px; padding: 2px 10px; border-radius: var(--radius-pill); font-family: var(--font-text); font-weight: 400; border: 1px solid var(--line, #ccc); background: transparent; color: inherit; cursor: pointer; }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.chip:disabled { cursor: default; opacity: .8; }
.taxgrid { display: grid; grid-template-columns: 1fr; gap: 16px; }
table.tax { width: 100%; }
table.tax td { vertical-align: middle; }
table.tax td:nth-child(1) { width: 16%; }
table.tax td:nth-child(2) { width: 52%; }
table.tax td:nth-child(3) { width: 14%; }
table.tax td:nth-child(4) { white-space: nowrap; }
table.tax td:nth-child(4) > * { margin-right: 6px; }
table.tax input { width: 100%; box-sizing: border-box; }
table.tax td:first-child input { width: 9em; }
table.tax tr.muted td { color: var(--muted); }
@media (max-width: 640px) { table.tax td:nth-child(4) { white-space: normal; } }
table.tax label.sub { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
table.tax label.sub > span { flex: 0 0 11em; font-size: 12px; }
table.tax div.sub { margin-top: 4px; font-size: 12px; gap: 12px; }
table.tax.types td { vertical-align: top; }
table.tax input[type=checkbox] { width: auto; margin: 0 4px 0 0; }
table.tax input::placeholder { color: var(--muted); opacity: .5; font-style: italic; }
table.tax div.sub label { display: inline-flex; align-items: center; white-space: nowrap; }
/* Paged tables (UI-11): sortable headers and page controls. */
th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
th[data-sort]:hover, th.sorted { color: var(--accent); }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.pager[hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.sigs .sig { margin: 4px 0 8px; }

/* UI-14 presentation mode: no processing or elapsed times in demo captures */
body.presenting .took, body.presenting .since, body.presenting .timing { display: none; }

/* UI-13 list, count and total answers as a table */
.answer-table { overflow-x: auto; margin: var(--space-2, 8px) 0; }
.answer-table table.list { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.answer-table th, .answer-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.answer-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.answer-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.answer-table td.cites { white-space: nowrap; }
.answer-table tfoot td { font-weight: 600; border-bottom: none; border-top: 2px solid var(--line); }

/* MKT-04: who may see a masked type. */
.mask-edit { display: grid; gap: 8px; }
.mask-edit .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mask-edit .users { max-height: 160px; overflow: auto; display: flex; flex-wrap: wrap; gap: 6px; }

/* COL-01: collections in the Ask side panel and the answer's "Collection" form. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
label.check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.watchbox li.collection { padding: 8px 0; border-top: 1px solid var(--line); }
.watchbox li.collection > a { font-weight: 600; }
.watchbox ul.members { margin: 8px 0 0; font-size: 0.9em; display: grid; gap: 6px; }
.watchbox ul.members li { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: start;
  padding: 6px 8px; border-radius: var(--radius-sm); background: var(--panel); }
.watchbox ul.members li > a { color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.watchbox ul.members li > a:hover { color: var(--accent); }
.watchbox ul.members li .muted { grid-column: 1 / -1; }
.watchbox ul.members li button.small { margin: 0; }

/* HR-10: notes on a document (Review, result popup) and under answers that cite it. */
.doc-notes { display: grid; gap: 8px; }
.doc-notes textarea { width: 100%; min-height: 48px; }
.doc-notes-list { display: grid; gap: 6px; }
.doc-note { border-left: 3px solid var(--accent); padding: 4px 10px; background: var(--panel); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.doc-notes .doc-note { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: start; }
.doc-notes .doc-note .doc-note-text { grid-column: 1; white-space: pre-wrap; }
.doc-notes .doc-note .muted { grid-column: 1; }
.doc-notes .doc-note button { grid-column: 2; grid-row: 1 / span 2; }
.panel .note.doc-note { margin-top: 6px; }

/* OPS-05: answers in the readiness report wrap but stay short. */
td.rd-answer { max-width: 40ch; white-space: pre-wrap; font-size: 0.9em; }

/* DQ-01: field coverage cells. */
table.coverage td.cov.hi { color: var(--ok, #3bdfa8); }
table.coverage td.cov.mid { color: var(--warn, #e8b44a); }
table.coverage td.cov.lo { color: var(--bad); font-weight: 600; }
table.coverage td.cov.none { color: var(--muted); }

/* DOC-06: other versions of a document. */
.doc-links { display: grid; gap: 8px; }
.doc-link { display: grid; gap: 4px; padding: 6px 10px; background: var(--panel); border-radius: var(--radius-sm); color: var(--ink); }
