:root {
  --bg: #f6f7f5; --panel: #ffffff; --ink: #1d2733; --muted: #5a6b78; --line: #dfe4e2;
  --accent: #1f4e5f; --accent-ink: #ffffff; --accent-soft: #e3eef0;
  --good: #2f7a4f; --warn: #a3670f; --bad: #b3362f; --mist: #eef2f1;
  --radius: 8px; --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12171c; --panel: #1a2128; --ink: #e5eaee; --muted: #9aabb8; --line: #2c363f;
    --accent: #6fb0c2; --accent-ink: #0d1a20; --accent-soft: #1f3138; --mist: #172027;
    --good: #6cc392; --warn: #e0a64d; --bad: #f07a72; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
header.top { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.logo { font-weight: 700; letter-spacing: .02em; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo span { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
header nav { display: flex; gap: 16px; flex: 1; }
header nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
header nav a.on, header nav a:hover { color: var(--ink); }
.who { color: var(--muted); font-size: 13px; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 26px; margin: 4px 0 4px; font-weight: 650; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 15px; margin: 16px 0 8px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], textarea, select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
  color: var(--ink); font: inherit; }
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 14px; }
.check input { margin-top: 3px; }
button, .btn { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.small, .btn.small { padding: 4px 9px; font-size: 13px; }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
form.inline { display: inline; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--mist); color: var(--muted); }
.tag.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.tag.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.tag.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.flash { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.error { background: color-mix(in srgb, var(--bad) 12%, transparent); border-left: 3px solid var(--bad); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.step b { display: block; margin-bottom: 4px; }
.step .n { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  text-align: center; font-size: 12px; line-height: 22px; margin-right: 6px; }
.meter { height: 8px; background: var(--mist); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.score { font-size: 28px; font-weight: 650; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .v { font-size: 24px; font-weight: 650; }
.kpi .l { color: var(--muted); font-size: 13px; }
.section-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; background: var(--panel); }
.section-edit .row input[type=text] { flex: 1; font-weight: 600; }
/* QR on its own line, never squeezed or clipped: up to 280px, shrinks only to fit the screen. */
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { box-sizing: border-box; width: min(280px, 100%); height: auto; aspect-ratio: 1; flex-shrink: 0;
  background: #fff; padding: 12px; border-radius: 8px; }
code.secret { word-break: break-all; }
code { background: var(--mist); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.report { max-width: 780px; line-height: 1.6; }
.report h2 { margin-top: 28px; font-size: 20px; }
.report sup.cite { font-size: 11px; }
.report sup.cite a { text-decoration: none; }
.report table th { text-transform: none; font-size: 13px; color: var(--ink); }
.report ol.refs li { margin-bottom: 6px; font-size: 13px; word-break: break-word; }
details summary { cursor: pointer; color: var(--accent); }
.mistband { background: linear-gradient(180deg, var(--mist), transparent); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.center { max-width: 460px; margin: 48px auto; }
footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px; }
@media (max-width: 640px) { header.top { flex-wrap: wrap; gap: 8px; } header nav { order: 3; width: 100%; } }
.center.wide { max-width: 560px; }
meter { width: 100%; height: 10px; }

/* human-to-fill brackets and open items */
mark.fill { background: color-mix(in srgb, var(--warn) 30%, var(--panel)); color: var(--ink); padding: 0 3px; border-radius: 3px; font-weight: 600; }
.openitems { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); color: var(--ink); border-radius: 8px; padding: 8px 16px; margin: 12px 0; }
.openitems h2 { margin-top: 6px; }
/* app gallery */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 8px 0 18px; }
.appcard { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.appcard h3 { margin: 0; font-size: 15px; }
.appcard p { margin: 0; }
.appcard .chain { font-size: 12px; opacity: .75; }
.appcard form { margin-top: auto; }
.appcard.added { opacity: .65; }
.srcs { display: flex; flex-wrap: wrap; gap: 4px; }
.srcs .tag { font-size: 11px; }

/* project assistant */
.chatlog { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.msg { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); }
.msg.user { background: var(--mist); align-self: flex-end; max-width: 85%; }
.msg.assistant { background: var(--panel); max-width: 95%; }
.msg .refs { margin: 6px 0 0; padding-left: 20px; }
a.cite { text-decoration: none; font-weight: 600; font-size: 12px; }
#chat form.row input[type=text] { flex: 1; }

/* v0.7 online review */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.review .side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.review .side h3 { margin-top: 12px; }
.review .side ol, .review .side ul { padding-left: 18px; }
.review .fills li { margin-bottom: 6px; }
.toolbar { flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.report sup.cite a { text-decoration: none; }
details > summary { cursor: pointer; padding: 4px 0; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } .review .side { position: static; max-height: none; } }
@media print { header, nav, .toolbar, .review .side, .small a[href*="/r/"], .flash, .activity, .warnings { display: none !important; }
  .review { display: block; } .panel { box-shadow: none; border: 0; } }
.field { margin-bottom: 10px; }
.field .row.spread { align-items: end; }
.aidraft { background: color-mix(in srgb, var(--warn) 16%, var(--panel)); border-color: var(--warn); color: var(--ink); }
.drafted { margin-top: 2px; }

/* v0.8 shared spaces */
tr.theirs td { background: var(--mist); }
.msg .tag.good { font-weight: normal; }
#chatform { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
#chatform input[type=text] { flex: 1; min-width: 200px; }
#chatform select { width: auto; }

/* v0.8.1 project folder tree */
.tree details.fnode { margin: 6px 0 6px 0; padding-left: 14px; border-left: 2px solid var(--line); }
.tree details.org { padding-left: 0; border-left: 0; margin-top: 14px; }
.tree details.org > summary { font-size: 1.05em; }
.tree summary { cursor: pointer; padding: 6px 4px; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.tree summary .fname { font-weight: 600; }
.tree details.mine > summary { background: var(--accent-soft); border-radius: 6px; }
.tree table.files { margin: 4px 0 8px 0; }
.tree table.files td, .tree table.files th { padding: 4px 8px; }
.tree .w1 { width: 1%; white-space: nowrap; }
.tree .folderset { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 6px 4px; }
.tree .folderset select { width: auto; padding: 2px 6px; }
.tree .linkops { margin: 2px 0 4px 4px; }
.tree select { font-size: 0.9em; }

/* v0.9 chat */
.chatpanel .chatlog { max-height: 60vh; min-height: 160px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--mist); scroll-behavior: smooth; }
.chatpanel .msg { max-width: 85%; margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.chatpanel .msg.user { margin-left: auto; background: var(--accent-soft); }
.chatpanel .composer { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--panel); }
.chatpanel .composer textarea { width: 100%; border: 0; resize: none; outline: none; font: inherit; padding: 6px; box-sizing: border-box; background: transparent; color: var(--ink); }
.chatpanel .composer-bar { gap: 8px; align-items: center; flex-wrap: wrap; }
.chatpanel .composer-bar select { width: auto; padding: 4px 8px; }
.chatpanel .composer-bar .spacer { flex: 1; }
.chatpanel .attach { position: relative; }
.chatpanel .attach summary { list-style: none; cursor: pointer; display: inline-block; }
.chatpanel .attach summary::-webkit-details-marker { display: none; }
.chatpanel .attachlist { position: absolute; bottom: 36px; left: 0; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; width: min(520px, 90vw); max-height: 320px; overflow: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.chatpanel .attachlist label { display: block; padding: 2px 0; }
.chatpanel .attachlist label[hidden] { display: none; }
.chatpanel .attachlist #filesearch { width: 100%; margin: 4px 0 8px; }
.chatpanel .attachlist #fromdisk { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.chatpanel.dropping { outline: 2px dashed var(--accent); outline-offset: 4px; }
.chatpanel .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chatpanel .chip { background: var(--accent-soft); border-radius: 12px; padding: 2px 8px; font-size: 0.85em; }
.chatpanel .chip a { text-decoration: none; margin-left: 2px; }
.chatpanel .composer { display: flex; flex-direction: column; gap: 6px; }
.seclevel { border-left: 4px solid var(--line); padding: 6px 12px; margin: 8px 0; background: var(--mist); }
.seclevel.l3 { border-color: #cfa94a; } .seclevel.l4, .seclevel.l5 { border-color: #4c8a2a; }
.seclevel.l1, .seclevel.l2 { border-color: #d08a3a; }
.privacybox { border: 1px solid var(--line); background: var(--accent-soft); border-radius: var(--radius); padding: 8px 12px; margin: 10px 0; }
.chatpanel .msg.local { border-color: var(--good); background: var(--accent-soft); }
.tree summary .fold { margin-left: auto; display: inline-flex; gap: 4px; }
.tree summary .fold button { padding: 1px 7px; line-height: 1.3; }
.tree details.fnode > summary { list-style: none; }
.tree details.fnode > summary::-webkit-details-marker { display: none; }
.tree details.fnode > summary .chev::before { content: "▸"; display: inline-block; width: 1em; color: var(--accent); transition: transform .15s; }
.tree details.fnode[open] > summary .chev::before { transform: rotate(90deg); }
.tree .linkops { margin: 4px 0 6px 18px; }
code.key { font-size: 1.05em; user-select: all; padding: 4px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
a.btn { text-decoration: none; color: var(--accent-ink); }
a.btn.ghost { color: var(--accent); }
.enrol { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 10px; align-items: center; }
.enrol label { grid-column: 1 / 3; }
@media (max-width: 800px) { .enrol { grid-template-columns: 1fr; } .enrol label { grid-column: auto; } }
.hidden { display: none; }
/* v0.12 project tabs: a segmented bar */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; background: var(--mist); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 14px 0 14px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 500; line-height: 1.2; }
.tabs a:hover { color: var(--ink); background: var(--panel); }
.tabs a.on { color: var(--accent-ink); background: var(--accent); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tabs .ico { font-size: 15px; opacity: .9; }
.tabs .count { background: var(--panel); color: var(--ink); border-radius: 10px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.tabs a.on .count { background: rgba(255,255,255,.25); color: var(--accent-ink); }
.tabs .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.modelpick { max-width: 220px; }
/* warnings under the tabs */
.warnings { display: grid; gap: 6px; margin: 0 0 14px; }
.warnrow { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); border-left-width: 4px; }
.warnrow.bad { border-left-color: var(--bad); }
.warnrow.warn { border-left-color: var(--warn); }
.warnrow.info { border-left-color: var(--accent); }
.warnrow .wicon { font-size: 15px; }
.warnrow .btn { margin-left: auto; white-space: nowrap; }
/* new-project wizard */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 6px 0 18px; flex-wrap: wrap; }
.steps li { padding: 6px 14px; border-radius: 20px; background: var(--mist); color: var(--muted); font-size: 14px; }
.steps li.on { background: var(--accent); color: var(--accent-ink); }
.steps li.done { background: var(--accent-soft); color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cards .card { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; }
.cards .card:hover { border-color: var(--accent); }
.cards .card h3 { margin: 0 0 4px; }
.chatpanel .msg.pending .body { color: var(--muted); font-style: italic; }
.chatpanel .msg.pending .body::after { content: "…"; animation: pulse 1s infinite; }
.chatpanel .msg.bad { border-color: var(--bad); }
.tabs.subtabs { margin-top: 6px; }
.prose p { margin: 0 0 8px; }
#livedoc h3 { margin: 14px 0 4px; }
/* v0.13 roadmap */
.roadform textarea, .roadform input { width: 100%; }
table.plan td, table.plan th { vertical-align: top; }
table.plan tr.done td { opacity: .75; }
.qs { margin: 12px 0; }
.qs h3 { margin: 12px 0 4px; }
.qs textarea, .qs input { width: 100%; }
.review { border-left: 4px solid var(--accent); padding: 6px 12px; margin-top: 14px; background: var(--mist); }
button:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; }
button.armed { background: var(--warn); border-color: var(--warn); color: #fff; }
b.good { color: var(--good); } b.warn { color: var(--warn); } b.bad { color: var(--bad); }
/* v0.15 meetings */
.memoform textarea, .memoform input[name=title] { width: 100%; }
table.tasks tr.overdue td { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.improve summary { list-style: none; display: inline-block; }
.improve summary::-webkit-details-marker { display: none; }
.improveform { display: grid; gap: 6px; margin: 6px 0; min-width: 280px; }
/* v0.16 employees */
.emp { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.emp.paused { opacity: .7; }
.emp details { margin-top: 4px; }
.emp details > summary { display: inline-block; }
.empform label, .runform label { display: block; margin: 6px 0; }
.empform .row label { display: inline-block; margin-right: 12px; }
.empform textarea, .runform textarea { width: 100%; }
.roles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 10px; }
.roles .role { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; }
.roles .role:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.roles .role input { margin-right: 6px; }
.roles .role span { display: block; margin-top: 4px; }
.nowrap { white-space: nowrap; }
.side textarea { width: 100%; font-family: inherit; font-size: 12px; }
/* v0.16 edit online */
.report h2 .editbtn { margin-left: 10px; font-size: 12px; vertical-align: middle; }
form.secedit { margin: 8px 0 16px; }
form.secedit textarea { width: 100%; font-family: inherit; font-size: 14px; line-height: 1.5; }
.report mark.fill { cursor: pointer; }
.report h2 .presence { margin-left: 10px; font-size: 12px; font-weight: normal; vertical-align: middle; }
.secedit details.revise { margin-top: 6px; }
.secedit details.revise textarea { width: 100%; }

/* v0.19.2: answering the open details one at a time */
.openitems .detailnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 12px; }
.openitems .pill { min-width: 28px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--ink); cursor: pointer; font-size: .85em; }
.openitems .pill.done { background: var(--accent-soft); border-color: var(--accent); }
.openitems .pill.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.openitems .detail .ask { font-weight: 600; margin: 2px 0 8px; }
.openitems .detail textarea { width: 100%; }
.openitems .detail .files { min-height: 1.2em; }

/* v0.20: the beta feedback control, on every page for signed-in people */
.fb { position: fixed; right: 16px; bottom: 16px; z-index: 50; }
.fb > summary { list-style: none; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.fb > summary::-webkit-details-marker { display: none; }
.fb .panel { position: absolute; right: 0; bottom: 44px; width: min(420px, 92vw); max-height: 70vh; overflow: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,.22); }
.fb textarea { width: 100%; }
@media print { .fb { display: none; } }

.grouphead { margin: 18px 0 6px; font-size: 1.02rem; }
.grouphead a { font-weight: 400; margin-left: 8px; }

/* v0.20: the project overview's quick picks */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.qa { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  text-decoration: none; color: var(--ink); }
.qa:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.qa .ico { font-size: 1.3rem; display: block; margin-bottom: 4px; }
.qa b { display: block; margin-bottom: 2px; }
.qa .small { display: block; }
ul.waiting { margin: 6px 0 10px; }
ul.waiting li { margin: 4px 0; }

/* v0.20: what the project is doing right now, on every tab */
.activity { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px;
  background: var(--panel); padding: 8px 12px; margin: 10px 0; }
.activity.idle { border-left-color: var(--line); padding: 6px 12px; }
.actrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.actstage { flex: 1 1 320px; min-width: 220px; }
.activity .bar { display: inline-block; width: 120px; height: 7px; border-radius: 4px; background: var(--mist, #e8eef0); overflow: hidden; }
.activity .bar i { display: block; height: 100%; background: var(--accent); }

/* v0.21: answering a whole chain's open details in one place */
#chaindetails .chaindoc { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
#chaindetails .chaindoc > summary { cursor: pointer; }
#chaindetails .chaindetail { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
#chaindetails .chaindetail textarea { width: 100%; }
#chaindetails #rerunanswered { border-top: 2px solid var(--line); margin-top: 14px; padding-top: 10px; }
#chaindetails #rerunanswered label { display: block; margin: 3px 0; }

/* v0.21.1: settle an open detail in the preview's sidebar */
.sidedetails .chaindetail { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.sidedetails .chaindetail.done { border-color: var(--accent); background: var(--accent-soft); }
.sidedetails .chaindetail > summary { cursor: pointer; }
.sidedetails textarea { width: 100%; }

/* v0.22.3: an answer saved but not yet approved stands in the text where its bracket was, in green */
mark.fill.pending { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--ink); }
.sidedetails .approve { margin-top: 6px; }
.approveall { margin: 8px 0; }

/* v0.21.6: the bracket being answered, highlighted while its dialogue is open */
mark.fill.active { outline: 2px solid var(--accent); outline-offset: 2px; }

/* v0.22: three columns on the review page - the consultant's comments, the document, the details still needed.
   Each side column's width is the viewer's own choice (--notesw / --sidew, set by the Columns controls and kept in
   this browser); hiding one gives its space to the document. The page itself uses the whole window (body.wide). */
body.wide main { max-width: min(2200px, 100%); }
.review { --notesw: 320px; --sidew: 300px; }
.review > * { min-width: 0; }                       /* a wide table scrolls, it does not push the columns apart */
.review .tablewrap { overflow-x: auto; max-width: 100%; }
.review .report { max-width: none; }                /* grow with the window instead of stopping at 780px */
.review .report > p, .review .report > ul, .review .report > ol { max-width: 100ch; }   /* prose stays readable */
body.wide .review { border-left: 0; background: transparent; padding: 0; margin-top: 0; }
.review.threeup { grid-template-columns: var(--notesw) minmax(0, 1fr) var(--sidew); }
.review:not(.threeup) { grid-template-columns: minmax(0, 1fr) var(--sidew); }
.review.hide-notes .notes, .review.hide-side .side { display: none; }   /* its track is 0 wide, set from Columns */
.cols { margin: 2px 0 6px; align-items: baseline; }
.cols .colgrp { display: inline-flex; align-items: baseline; gap: 4px; color: var(--muted); }
.cols .colgrp button { padding: 1px 7px; }
.review .notes { max-height: calc(100vh - 24px); overflow: auto; position: sticky; top: 12px; font-size: 13px; }
/* v0.22.2: wide enough for three columns, each note floats level with the passage it was lifted out of */
.review .notes.floating { position: relative; top: 0; max-height: none; overflow: visible; }
.review .notes.floating .secnote { position: absolute; left: 16px; right: 16px; margin: 0; padding: 6px 0 22px;
  background: var(--panel); }   /* room at the foot for the More button, so no line hides under it */            /* opaque: nothing can ever read through another note */
/* v0.22.4: a note stops short of the next one's anchor and opens out on More */
.review .notes.floating .secnote.clipped { overflow: hidden; }
.review .notes.floating .secnote.clipped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 36px; background: linear-gradient(to bottom, transparent, var(--panel)); pointer-events: none; }
.review .notes .secnote .more { position: absolute; right: 2px; bottom: 0; padding: 0 6px; font-size: 12px;
  background: var(--panel); z-index: 1; }
.review .notes .secnote.open { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.report .noteat { display: block; height: 0; overflow: hidden; }
.review .notes h3 { margin-top: 0; }
.review .notes .secnote { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 12px; }
.review .notes .secnote h4 { margin: 0 0 4px; font-size: 13px; }
.review .notes .secnote h4 a { text-decoration: none; }
.review .notes .secnote h3 { font-size: 13px; margin: 10px 0 2px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: .04em; }
.review .notes .secnote p { margin: 4px 0; line-height: 1.5; }
.review .notes .secnote ol, .review .notes .secnote ul { padding-left: 18px; margin: 4px 0; }
.review .notes .secnote.here { background: var(--accent-soft); border-radius: 8px; padding: 8px; }
.review .notes .part + .part { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; }
.review .notes .part .lead { margin: 0 0 2px; color: var(--muted, #667); }
@media (max-width: 1280px) { .review.threeup { grid-template-columns: minmax(0, 1fr) var(--sidew); }
  .review .notes { grid-column: 1 / -1; position: static; max-height: 40vh; } }
@media (max-width: 900px) { .review.threeup { grid-template-columns: 1fr; } }
@media print { .review .notes { display: none !important; } }

/* v0.22.3: describe an employee in your own words and Usva fills the hire form */
.designbox { border: 1px dashed var(--accent); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px;
  background: var(--accent-soft); }
.designbox textarea { width: 100%; }

/* v0.22.6: who sees what - one row per folder, the team as ticks */
.accessrow { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; border-top: 1px solid var(--line);
  padding: 8px 0; }
.accessrow > b { flex: 0 0 180px; }
.accessrow label { display: inline-flex; gap: 4px; align-items: center; margin: 0; color: var(--ink); }

/* v0.22.7: documents written since you last looked */
.count.newdocs { background: var(--accent); color: var(--accent-ink); }

/* v0.22.8: a chat answer's list items become tasks */
.msg .msgtasks { margin-top: 4px; }
.msg .msgtasks button { padding: 1px 8px; font-size: 12px; }

/* v0.23.1: tables edited in place */
.tableedit { margin: 6px 0 16px; display: flex; gap: 6px; clear: both; }
.tablewrap.editing { outline: 2px solid var(--accent); border-radius: 4px; }
.tablewrap.editing td:focus, .tablewrap.editing th:focus { outline: 2px solid var(--accent); background: var(--panel); }

/* v0.24: a working panel with its list on the right (roadmaps, memos) */
.withside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.wside .panel { position: sticky; top: 12px; }
.sideitem { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sideitem.on { border-left: 3px solid var(--accent); padding-left: 8px; }
@media (max-width: 1000px) { .withside { grid-template-columns: 1fr; } .wside .panel { position: static; } }

/* v0.25: images drawn beside the sections */
.secimg { margin: 10px 0 18px; overflow-x: auto; }
.secimg svg { max-width: 100%; height: auto; }

/* v0.26.2: indented bullets (a decision tree written as a list) keep their level */
li.sub { margin-left: 1.1em; }
li.sub2 { margin-left: 2.2em; }

/* v0.28: the picture editor - preview, then the few lines that make it */
.imgedit .imgpreview { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; margin: 8px 0; }
.imgedit .imgpreview svg { max-width: 100%; height: auto; }
.imglines textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; }
figure.secimg { overflow-x: auto; margin: 10px 0; }
figure.secimg svg { max-width: 100%; height: auto; }

/* v0.29: the small bar under a drawn picture - show the numbers, edit them, download */
.picbar { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 10px; }
.picsource[hidden] { display: none; }

/* v0.29.1: a button that opens its own small form (no inline script, which the page's CSP forbids) */
.addbox { position: relative; }
.addbox > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.addbox > summary::-webkit-details-marker { display: none; }
.addbox[open] > summary { opacity: .75; }
.addbox > .addform, .addbox > form.row { margin-top: 8px; }
.addbox.renamebox { display: inline-block; margin: -6px 0 10px; }
@media (min-width: 900px) {
  .row.spread .addbox[open] > .addform { position: absolute; right: 0; z-index: 5; min-width: 36em; }
}

/* v0.31.1: the process form - room to write the goal, and labelled fields */
.procform label { display: block; margin: 8px 0 2px; font-size: .92rem; }
.procform input, .procform textarea { width: 100%; }
.procform textarea { min-height: 4.2em; }
.imglines textarea { min-height: 7em; }

/* v0.38.2: the data-flow picture on the guide - full width, scrolls sideways on a phone rather than shrinking
   to illegibility, and keeps its white plate on a dark page. */
figure.dataflow { margin: 18px 0 8px; padding: 0; overflow-x: auto; }
figure.dataflow img { display: block; width: 100%; min-width: 900px; height: auto;
                      background: #fff; border: 1px solid var(--line, #d2dae2); border-radius: 10px; }
figure.dataflow figcaption { margin-top: 8px; }


/* v0.45: the header's simple/full switch is a form button that must read as a plain header link */
.viewswitch { display: inline; }
.who .linklike { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer; }
.who .linklike:hover { opacity: .8; }


/* v0.47: AI ceiling meter on the billing page */
.meter { height: 8px; border-radius: 4px; background: rgba(127,127,127,.25); overflow: hidden; max-width: 420px; }
.meter > span { display: block; height: 100%; background: #3D78A8; }
.small.warn { color: #b8860b; }
.review.solo { grid-template-columns: minmax(0, 1fr); max-width: 980px; margin-inline: auto; }  /* v0.50.2 simple view */
[hidden] { display: none !important; }  /* v0.51.1: the hidden attribute must beat .btn and other display rules */
