/* Den Hub. Tokens, fonts, base rules and the global shell (top bar, rail, ☰ drawer, Report, the
   version chip, What's new, the update pill, the working pop-up) are Den's UI kit (den-ui, linked
   before this file, #97, Hub 0.2.0); nothing here defines a kit token or draws a kit part. Hub's
   own rules only, and the CSS of Hub's own parts in the kit's top-bar slots. */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
a { color: var(--accent-text); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; white-space: nowrap; color: var(--text); text-decoration: none; }
/* Hub's mark, "H" on the bar's disc: on the sign-in pages (.mark) and in the kit's brand slot
   (shellHtml's product.mark, den-ui 0.6.2; the slot is the product's to fill). */
.mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bar); color: #fff; font: 700 11px var(--mono); }
.crumb { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; }
.crumb .sep { color: var(--faint); }
/* "Open <install> ↗": back to the person's own Den. */
.den { font-size: 13px; color: var(--accent-text); white-space: nowrap; text-decoration: none; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--r-btn); }
.den:hover, .den:focus-visible { background: var(--sunken); }
.den:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.denin { font-size: 12px; color: var(--accent-text); white-space: nowrap; }
a.agent { color: inherit; text-underline-offset: 2px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }

.bdg { margin-left: auto; font: 11px var(--mono); padding: 0 6px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.tagx { font: 10px var(--mono); color: var(--faint); border: 1px dashed var(--border-strong); border-radius: 4px; padding: 0 4px; text-transform: none; letter-spacing: 0; }

.main { min-width: 0; padding: 20px 24px 40px; }
.ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ph h1 { font-weight: 600; font-size: 22px; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.ph .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.ph .act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
h2.sec { font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; }
h2.sec .r { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; font-family: var(--sans); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.c7 { grid-column: span 7; } .c5 { grid-column: span 5; } .c12 { grid-column: span 12; }
.empty { color: var(--muted); font-size: 13px; margin: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .hint { color: var(--muted); font-style: italic; } .mono { font-family: var(--mono); } .bad-t { color: var(--bad); }
fieldset { border: 0; margin: 0; padding: 0; }

.btn { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-btn); padding: 6px 12px; cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--text); display: inline-flex; gap: 6px; align-items: center; }
.btn:hover { border-color: var(--border-strong); }
.btn.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
/* #90 J5b: a step that takes something away (Remove group): red text, away from Save. */
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.btn.sm { padding: 2px 9px; font-size: 12.5px; }

.src { display: inline-flex; align-items: center; gap: 4px; font: 10.5px var(--mono); border-radius: 4px; padding: 0 5px; border: 1px solid; white-space: nowrap; line-height: 17px; }
.src::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: currentColor; }
.src.s-gh { color: var(--text); border-color: var(--border-strong); }
.src.s-docs { color: var(--remote); border-color: color-mix(in srgb, var(--remote) 50%, var(--border)); }
.pill { font: 11px var(--mono); padding: 1px 7px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
/* A status pill is in the sans face (2b sign-off: Japanese falls back badly in Space Mono). */
.pill.st { font: 500 12px var(--sans); }
/* A carried approval's short visible word (Vision 11-13): same colour as the label, for contrast. */
.pill .pill-note { font-weight: 400; font-size: 11px; margin-left: 2px; padding-left: 5px; border-left: 1px solid currentColor; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.go { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.pill.ds { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.pill.off { color: var(--muted); border-color: var(--border); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); white-space: normal; }

.list { list-style: none; margin: 0; padding: 0; }
/* #97: one column that may shrink below its content. den-ui's base.css keeps Japanese words whole in
   WebKit (word-break: keep-all), so a long ja run's min-content is the whole run; an auto track
   grew to it and the page scrolled sideways at 390 (Settings, ja). Same for .set-body. */
.list > li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 8px 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
/* A list drawn as a panel (records, issues, search) keeps the panel's side padding. */
.list.panel { padding: 4px 16px; }
.row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.row .t { font-weight: 500; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.row .t:hover { color: var(--accent-text); text-decoration: underline; }
.row .end { margin-left: auto; }
/* A form's fields, one under another: label above its input. */
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 32rem; }
.stack > input:not([type=checkbox]):not([type=radio]), .stack > select { width: 100%; }
.stack > .btn { margin-top: 4px; }
.stack fieldset { border: 0; padding: 0; margin: 4px 0; }
.stack fieldset > label { display: block; margin: 4px 0; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.prow.head { color: var(--muted); font-size: .85em; }
.prow > .prow-h { margin: 0; font-size: .85em; }
@media (max-width: 560px) { .prow { grid-template-columns: minmax(0, 1fr) auto; } .prow > :first-child { grid-column: 1 / -1; } .prow.head { display: none; } .prow > .prow-h { grid-column: 1 / -1; } }
.ptr { font: 11px var(--mono); color: var(--faint); overflow-wrap: anywhere; }
.snip { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.snip mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); border-radius: 2px; }

/* Filter groups: a label, then one segmented control; the chosen one is filled. G0 (Hub Design
   mock G): 10px from each label to its buttons, 20px between groups, across or wrapped. */
.filterbar { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin: 4px 0 16px; }
.seg { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.seg-l { font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.segs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: var(--r-btn); background: var(--surface); min-width: 0; }
.segs a { padding: 4px 11px; font-size: 13px; line-height: 20px; color: var(--text); text-decoration: none; border-left: 1px solid var(--border); white-space: nowrap; }
.segs a:first-child { border-left: 0; }
.segs a:hover { background: var(--sunken); }
.segs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.segs a[aria-current="page"] { background: var(--accent-fill); color: var(--on-accent); font-weight: 500; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input[type=search] { flex: 1 1 240px; }
.filters input, .filters select, textarea { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-btn); padding: 6px 9px; min-width: 0; }
/* /a's find (Ward 11-15): the Search page's form, the box as wide as its words want, never the whole row. */
.afind input[type=search] { max-width: 480px; }

.rec { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.lives { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
ol.lines { margin: 0; padding: 0; list-style: none; font: 12.5px/1.7 var(--mono); overflow-x: auto; }
ol.lines li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
ol.lines .ln { color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
ol.lines .lt { white-space: pre-wrap; overflow-wrap: anywhere; }
ol.lines li:target { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.side { display: grid; gap: 12px; min-width: 0; }
.th { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); display: grid; gap: 10px; padding: 10px 12px; }
.th.resolved { background: var(--sunken); }
/* Thread bleed (Ward 11-14, Hub Design's spec; UK-1 tokens only, so it moves to the kit as is): a
   divider between messages; each one the disc's 20px column, then the name with the body under it;
   the name 13px/600; an agent's Agent badge; the byline wraps (never cut), its install on hover. */
.msg { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; row-gap: 2px; font-size: 13px; }
.msg + .msg { border-top: 1px solid var(--border); padding-top: 10px; }
.msg > .mh, .msg > .body { grid-column: 2; }
.msg .ini { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; line-height: 1; grid-column: 1; grid-row: 1; align-self: center; }
.msg.ag .ini { color: var(--remote); background: color-mix(in srgb, var(--remote) 16%, transparent); }
.msg.pe .ini { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.msg .mh { display: block; overflow-wrap: anywhere; font-size: 12px; color: var(--faint); }
.msg .mh b { color: var(--text); font-weight: 600; font-size: 13px; }
.msg .kb { display: inline-block; font-size: 11px; font-weight: 500; line-height: 1.4; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border); vertical-align: 1px; }
.msg .kb.ag { color: var(--remote); border-color: color-mix(in srgb, var(--remote) 45%, transparent); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.tact { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
textarea { width: 100%; resize: vertical; min-height: 54px; }
label.fl { display: grid; gap: 4px; font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.notice { border: 1px dashed var(--border-strong); border-radius: var(--r); padding: 8px 12px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.notice.bad { border-color: var(--bad); color: var(--bad); }
.notice.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-style: solid; color: var(--text); }
.notice.banner a { color: var(--accent-text); font-weight: 600; }

.solo { max-width: 440px; margin: 12vh auto; padding: 0 16px; }
.solo .panel { display: grid; gap: 12px; }

@media (max-width: 1000px) { .rec { grid-template-columns: 1fr; } .c7, .c5 { grid-column: span 12; } }
@media (max-width: 720px) {
  .crumb { display: none; }
  .main { padding: 16px 16px 32px; }
}
h3.lh { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 2px; font-weight: 400; }
h3.lh:first-of-type { margin-top: 0; }
.chg { color: var(--text); font-weight: 500; }

/* Settings: one table per GitHub App installation. Wide tables scroll inside their own box. */
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.inst { display: grid; gap: 8px; margin-bottom: 18px; }
.inst h3 { margin: 0; font-size: 15px; }
.tablewrap { overflow-x: auto; max-width: 100%; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl thead th { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.tbl tbody th { font-weight: 500; white-space: nowrap; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.addp { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.addp select { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-btn); padding: 2px 6px; }

/* HUB-1.1 artifacts */
.stage { position: relative; border: 1px solid var(--border); border-radius: var(--r); background: #fff; overflow: hidden; }
.mockframe { display: block; width: 100%; height: 70vh; min-height: 420px; border: 0; background: #fff; }
.shield { position: absolute; inset: 0; display: none; cursor: crosshair; background: rgb(255 115 0 / 6%); }
.stage.pinning .shield { display: block; }
.stage.shot { background: var(--sunken); }
.stage.shot img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.drop { border: 2px dashed var(--border); border-radius: var(--r); padding: 14px; display: grid; gap: 6px; background: var(--surface); }
.drop.over { border-color: var(--accent); background: var(--sunken); }
.drop input[type="file"] { max-width: 100%; }
.drop .folder { margin-top: 4px; }
.picked { margin: 0; padding-left: 18px; font: 12px var(--mono); overflow-wrap: anywhere; }
.picked:empty { display: none; }
.pin { position: absolute; transform: translate(-50%, -50%); min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-fill); color: var(--on-accent); font: 700 12px var(--mono); text-decoration: none; box-shadow: 0 0 0 2px #fff; z-index: 2; }
.pin.resolved { background: var(--faint); }
.pin.draft { background: var(--violet); color: #fff; }
.pin[hidden] { display: none; }
/* Reading width, the person's own (Ward 2026-11-12): Comfortable (about 90ch) or Wide (the panel). */
.doc { line-height: 1.6; max-width: 90ch; overflow-wrap: anywhere; min-width: 0; }
body[data-reading="wide"] .doc { max-width: none; }
.doc pre, .tokens { background: var(--sunken); padding: 10px; border-radius: var(--r); overflow: auto; font: 12px/1.5 var(--mono); }
.doc pre { max-width: 100%; overflow-wrap: normal; }
/* #76: a drawn Mermaid diagram (its source pre is hidden once drawn), and one that wasn't. */
.doc .mermaid-fig { margin: 12px 0; overflow-x: auto; }
/* Mermaid draws here, out of sight but laid out (a display: none frame measures nothing). */
.mmd-frame { position: absolute; left: -10000px; top: 0; width: 1200px; height: 900px; border: 0; visibility: hidden; }
.doc .mermaid-err { margin: -4px 0 12px; color: var(--bad); font-size: 13px; overflow-wrap: anywhere; }
.doc code { font-family: var(--mono); font-size: 0.92em; }
/* A table scrolls inside its own box, never the page. */
.doc .tw { max-width: 100%; overflow-x: auto; margin: 0 0 1em; }
.doc table { border-collapse: collapse; }
.doc .tw th, .doc .tw td { overflow-wrap: normal; }
.doc th, .doc td { border: 1px solid var(--border); padding: 4px 8px; }
/* A rendered record: #L<n> marks the block holding line n (CSS for a block's first line, hub.js for the rest). */
.md [data-line] { scroll-margin-top: 64px; }
.md [data-line]:target, .md .at-line { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 2px; }
.viewbar { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 0 0 12px; }
.viewbar .seg { gap: 6px 10px; flex-wrap: wrap; }
.segs button { padding: 4px 11px; font-size: 13px; line-height: 20px; color: var(--text); background: none; border: 0; border-left: 1px solid var(--border); white-space: nowrap; cursor: pointer; font-family: inherit; }
.segs button:first-child { border-left: 0; }
.segs button:hover { background: var(--sunken); }
.segs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.segs button[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); font-weight: 500; }
.doc img { max-width: 100%; }
.aq { margin: 0 0 6px; padding: 4px 8px; border-left: 3px solid var(--accent); color: var(--muted); font-size: 13px; }
.pinset { display: grid; gap: 6px; }
.pinset input { width: 6em; }
.wide { width: 100%; }

/* A value to copy (a new invite link): fills its row, never wider than the page. */
.copy { width: 100%; max-width: 44rem; box-sizing: border-box; }
/* HUB-1 C: a design system's Inspect */
.toks { list-style: none; margin: 0 0 12px; padding: 0; }
.toks li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.toks li.focus { background: var(--sunken); }
.toks .tk { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.sw { flex: 0 0 28px; color: var(--text); }
.sw.none { display: inline-block; width: 28px; height: 28px; }
.lc { margin: 8px 0; }
.lc summary { cursor: pointer; }
.warnline { color: var(--warn); }
.diff { border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; margin: 8px 0; }
h4.lh.sec { text-transform: capitalize; }

/* HUB T3: the filter bar's save link. */
.saveview { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-left: auto; }
@media (max-width: 720px) { .saveview { margin-left: 0; } }
/* HUB-1.13 13.4: a held action's dry run / result. */
.report { width: 100%; border-collapse: collapse; font-size: 13px; }
.report th { text-align: left; font: 500 12px var(--mono); color: var(--muted); padding: 6px 12px 6px 0; width: 9rem; vertical-align: top; white-space: nowrap; }
.report td { padding: 6px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.report tr:first-child td { border-top: 0; }
.report ul { margin: 0; padding-left: 18px; }
.held { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
/* H3: the ⌘K palette, Den's R17 design (den-pal) on Hub's tokens. */
.pal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 0; background: rgb(0 0 0 / 0.35); font: 14px/1.45 var(--sans); color: var(--text); }
.pal { width: min(620px, 100%); box-sizing: content-box; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 6px 24px rgb(0 0 0 / .18); overflow: hidden; }
.pal input { width: 100%; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 14px 16px; font-family: var(--sans); font-size: 16px; line-height: normal; color: var(--text); outline: none; margin: 0; }
.pal ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.pal li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.pal li[aria-selected="true"] { background: var(--sunken); }
.pal .pal-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal li > kbd { margin-left: auto; flex: none; }
.pal .pal-kind { margin-left: auto; font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.pal li.pal-empty { cursor: default; color: var(--muted); }
.pal li.pal-sec { cursor: default; padding: 8px 10px 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pal .pal-sub { color: var(--faint); font: 12px var(--mono); }
.pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; flex-wrap: wrap; }
/* SHELL-HARMONY H2: Settings like Den's (R21a). The header with its search stays put while the
   sections scroll; so does the section list, below it (--set-top: the header's height, from
   hub.js). At phone width the list is a picker. */
.set-ph { position: sticky; top: var(--den-top-h); z-index: 4; background: var(--bg); padding-top: 4px; box-shadow: 0 -20px 0 0 var(--bg), 0 12px 0 0 var(--bg); }
.set-ph .act { align-items: center; }
.set-ph input[type="search"] { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-btn); padding: 6px 10px; min-width: 0; width: 240px; color: var(--text); font: inherit; }
.set-count { margin: -8px 0 12px; font-size: 13px; }
.set-count:empty { display: none; }
.set-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-side { position: sticky; top: var(--set-top, 0px); }
.set-nav { display: grid; gap: 2px; }
.set-ni { display: block; padding: 6px 10px; border-radius: var(--r-btn); color: var(--muted); text-decoration: none; position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-ni:hover { background: var(--sunken); color: var(--text); }
.set-ni[aria-current] { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--text); font-weight: 500; }
.set-ni[aria-current]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--accent); }
.set-pick-l, .set-pick { display: none; }
.set-ni[hidden], .set-sec[hidden], .set-none[hidden] { display: none; }
.set-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.set-sec { scroll-margin-top: var(--set-top, 0px); }
.set-sec > .panel { margin: 0; }
.set-sec [id] { scroll-margin-top: var(--set-top, 0px); }
.set-meta { margin: 6px 2px 0; font-size: 12px; }
table.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
table.audit th, table.audit td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
table.audit th { color: var(--muted); font-weight: 500; }
.set-hit { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 2px; }
.set-sec:target > .panel, .set-sec > .panel:target { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The arrived-at heading takes focus for screen readers; the card's outline already shows it. */
.set-sec h2[tabindex="-1"]:focus { outline: none; }
@media (max-width: 720px) {
  .set-ph .act { flex: 1 1 100%; margin-left: 0; }
  .set-ph input[type="search"] { width: 100%; }
  .set-ph kbd { display: none; }
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .set-side { position: static; display: flex; align-items: center; gap: 8px; }
  .set-nav { display: flex; flex-wrap: wrap; }
  .set-side.has-pick .set-nav { display: none; }
  .set-side.has-pick .set-pick-l { display: block; color: var(--muted); font-size: 13px; }
  .set-side.has-pick .set-pick { display: block; flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--r-btn); padding: 6px 8px; font: inherit; }
}
/* C8: the frame's language and theme, above the preview. */
.viewopts { gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.viewopts input, .viewopts select { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--r-btn); padding: 4px 8px; font: inherit; }
.viewopts input { width: 7ch; }

/* C3: a project's board. The areas as anchors along the top; each area's edit form folded away. */
.board { display: grid; gap: 16px; }
.board-nav { flex-wrap: wrap; gap: 6px 8px; margin-bottom: 4px; }
.board-nav a { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; color: var(--text); text-decoration: none; border: 1px solid var(--border); border-radius: var(--r-btn); padding: 2px 8px; }
.board-nav a:hover { border-color: var(--border-strong); }
.board-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.area-edit { margin-top: 10px; }
.area-edit > summary { cursor: pointer; color: var(--muted); width: fit-content; }
.area-edit > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.area-edit[open] > summary { margin-bottom: 8px; }

/* CX (Vision 11-12): comment at the point of use. A mock's page is the preview at full width with
   its comments beside it; pins sit on their elements (the frame's script says where). */
.seg .btn { border-radius: 0; }
.seg .btn:first-child { border-radius: var(--r-btn) 0 0 var(--r-btn); }
.seg .btn:last-child { border-radius: 0 var(--r-btn) var(--r-btn) 0; margin-left: -1px; }
.seg .btn[aria-pressed="true"] { background: var(--sunken); font-weight: 600; }
.cx-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.cx-bar .btn kbd { font: 11px var(--mono); border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; }
.cx-bar .btn[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.stage.cx-on { outline: 2px solid var(--accent); outline-offset: -2px; }
.cx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.epin { position: absolute; pointer-events: auto; width: 26px; height: 26px; border-radius: 50% 50% 50% 3px; display: grid; place-items: center;
  background: var(--accent-fill); color: var(--on-accent); font: 600 12px var(--sans); text-decoration: none; border: 2px solid var(--surface); box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.epin.resolved { background: var(--faint); color: var(--surface); }
.epin.on { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 40%, transparent); }
.epin[hidden], .cx-hl[hidden], .cx-tag[hidden] { display: none; }
.stage.cx-on .epin { opacity: .35; pointer-events: none; }
.cx-hl { position: absolute; border: 2px solid var(--accent); border-radius: 4px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cx-hl.flash { animation: cx-flash 1.2s ease-out 1; }
@keyframes cx-flash { 0%, 40% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .cx-hl.flash { animation: none; } }
.cx-tag { position: absolute; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px var(--mono); background: var(--text); color: var(--bg); padding: 2px 6px; border-radius: 3px; }
.cx-panel { overflow-x: hidden; }
.cx-panel .th > *, .cx-panel .aq { min-width: 0; max-width: 100%; }
/* Review A b: "Moved or removed" is a plain note, sans 12px, muted. */
.cx-panel .cx-missing { font: 12px var(--sans); color: var(--muted); margin: 0; }
/* With script, only the chosen thread shows its reply box (click a thread, a pin, or J/K). */
.cx-js article.th:not(.sel) form[action$="/reply"] { display: none; }
.th-top { display: flex; gap: 8px; align-items: flex-start; }
.th-top > :not(.tno) { flex: 1; min-width: 0; }
.tno { flex: none; width: 22px; height: 22px; border-radius: 50% 50% 50% 3px; background: var(--accent-fill); color: var(--on-accent); font: 600 11px var(--sans); display: grid; place-items: center; }
.th.resolved .tno { background: var(--faint); color: var(--surface); }
.th.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.th[hidden] { display: none; }
/* The composer's layer (hub.js composeAt): on <body>, above the page, so no stage or frame
   edge clips it. Its own box is the form; the layer takes no room and no clicks. */
.cx-pop { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 40; }
form.cx-float { position: absolute; z-index: 5; width: min(340px, calc(100vw - 16px)); box-sizing: border-box; overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); padding: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .25); }
/* Send stays in view when the composer is taller than the window and scrolls inside. */
form.cx-float .cx-acts, form.cx-float .cx-ask { position: sticky; bottom: -12px; margin: 0 -12px -12px; padding: 8px 12px 12px; background: var(--surface); }
form.cx-float .pinset, form.cx-float #tok-target { display: none; }
/* .btn, .pinset and .warnline set display; hidden must still hide them. */
.cx-bar .cx-say { flex: 1 1 20em; min-width: 0; /* one basis for both hints: pressing C never re-wraps the bar */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-bar .viewopts { margin: 0; gap: 6px; }
.cx-bar .viewopts label { font-size: 13px; color: var(--muted); }
.cx-bar .viewopts input, .cx-bar .viewopts select { font-size: 13px; padding: 2px 6px; }
.cx-anchor { margin: 0; font-size: 13px; min-width: 0; }
/* Review A b: the quote clamps to 2 lines, the ellipsis inside the quote. */
.cx-anchor q.aq-q { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; overflow-wrap: anywhere; }
.cx-anchor q { color: var(--text); }
.th-reply textarea { min-height: 54px; }
.cx-quote[hidden], .cx-selbtn[hidden], .gm[hidden], [data-cx-mode][hidden], [data-show-opts][hidden], .pinset[hidden], [data-cx-cancel][hidden], .cx-hint[hidden], .cx-on[hidden], .cx-missing[hidden], [data-cx-filter][hidden], [data-cx-bar][hidden] { display: none; }
.aq-path { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px var(--mono); }
.cx-acts { justify-content: flex-end; align-items: center; }
.cx-acts .cx-hint { margin-right: auto; font-size: 12px; }
.cx-ask { justify-content: flex-end; align-items: center; }
.cx-ask span { margin-right: auto; font-weight: 600; }
.cx-acts[hidden], .cx-ask[hidden] { display: none; }

/* Mock E (Ward 11-13): the artifact page is one doc and one side panel. The header has what it is,
   the version, where it stands and the one next step; nothing sits under the doc. */
.art-ph { align-items: flex-start; }
.art-hl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; min-width: 0; flex: 1 1 380px; }
/* The column never grows past the header: a long name (an unbreakable login) ellipsizes in
   .art-byl instead of scrolling the page sideways at 390 (report R1, 0.2.2). */
.art-hl .lives { margin-top: 0; }
.art-act { align-items: flex-start; }
.vpick { position: relative; display: inline-flex; }
.vbtn { font-weight: 600; }
.art-st:focus { outline: none; }
.art-st .pill { font: 500 12px var(--sans); padding: 1px 8px; }
.okw { color: var(--ok); } .badw { color: var(--bad); }
.art-rec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 16px; align-items: start; }
/* Mock O (#57): Wide or a dragged width sets --sw (hub.js), never the grid's own rule, so a drag
   doesn't jump; Reading hides the doc (not unloaded) and gives the panel the record column. */
.art-rec[data-pw="wide"], .art-rec[data-pw="px"] { grid-template-columns: minmax(0, 1fr) var(--sw, 600px); }
.art-rec[data-pw="reading"] { grid-template-columns: minmax(0, 1fr); }
.art-rec[data-pw="reading"] > .art-main { display: none; }
.art-main { min-width: 0; }
/* mo-den-hub#2: as tall as the window less its 12px top gap and .main's 40px bottom padding, so
   scrolled to the end the panel still sits at its stuck place, never under the top bar. */
.art-side { position: sticky; top: calc(var(--den-top-h) + 12px); min-width: 0; max-height: calc(100vh - var(--den-top-h) - 52px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 6px 14px 14px; }
.art-tabs { display: flex; gap: 2px; flex: none; border-bottom: 1px solid var(--border); margin: 0 -6px 12px; overflow-x: auto; }
.art-tabs [role="tab"] { padding: 8px 10px 7px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.art-tabs [role="tab"]:hover { color: var(--text); }
.art-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.art-tabs [role="tab"]:focus-visible { outline-offset: -2px; }
.art-tabs .n { font: 11px var(--mono); color: var(--faint); }
/* mo-den-hub#2: the panel that scrolls is the containing block of anything absolute inside it
   (the .sr labels), so it clips them; else they hang off the sticky .art-side at the end of a
   long list and Chromium makes the page that much taller, blank past Hub. */
.art-side [role="tabpanel"] { position: relative; overflow: auto; min-height: 0; display: grid; gap: 12px; align-content: start; }
.art-side [role="tabpanel"]:focus-visible { outline-offset: -2px; }
.art-side [role="tabpanel"][hidden] { display: none; }
.art-side [role="tabpanel"] .panel { border: 0; border-radius: 0; padding: 0; background: none; }
.art-side .blk, .art-side [role="tabpanel"] > .panel:not(.cx-panel) { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.art-side .blk:last-child { border-bottom: 0; padding-bottom: 0; }
.blk { display: grid; gap: 6px; }
.blk p { margin: 0; }
.blk .lives { margin-top: 0; }
/* History: each version with what happened to it, newest first. */
.hv { border: 1px solid var(--border); border-radius: var(--r); padding: 8px 10px; display: grid; gap: 6px; background: var(--surface); min-width: 0; }
.hv.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hv-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.hv-h h3 { margin: 0; font-size: 14px; font-weight: 600; }
.hv-h .end { margin-left: auto; }
.hv .note { font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.ev { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--border); display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ev s { color: var(--faint); }
/* Details: label and value rows. */
.kv { display: grid; gap: 6px; margin: 0; font-size: 13px; }
.kv > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 8px; align-items: baseline; }
.kv dt { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv select { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-btn); padding: 2px 6px; max-width: 100%; }
.art-ptr { margin: 6px 0 0; font-size: 12.5px; overflow-wrap: anywhere; }
.addlink { margin-top: 8px; }
.addlink > summary { list-style: none; width: fit-content; cursor: pointer; }
.addlink > summary::-webkit-details-marker { display: none; }
.addlink[open] > summary { margin-bottom: 8px; }
.linkform select, .linkform input { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-btn); padding: 4px 8px; max-width: 100%; }
/* Menus: More, the v list, Jump to. */
.art-more, .jump { position: relative; }
.art-more > summary, .jump > summary { list-style: none; }
.art-more > summary::-webkit-details-marker, .jump > summary::-webkit-details-marker { display: none; }
.art-menu, .vmenu, .jump .menu { position: absolute; z-index: 12; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; display: grid;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: 0 8px 24px rgb(0 0 0 / .18); font-size: 13px; }
.art-menu { right: 0; width: max-content; min-width: 220px; max-width: calc(100vw - 32px); }
.art-menu .mi { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: var(--r-btn); color: var(--text); text-decoration: none; font: inherit; cursor: pointer; white-space: nowrap; }
.art-menu .mi:hover, .art-menu .mi:focus-visible { background: var(--sunken); }
.art-menu .mi[hidden], .art-menu .mi.art-narrow { display: none; }
/* A step in More is a form holding its button: the button is the item, so the form adds no padding. */
.art-menu form.mi { padding: 0; }
.art-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.art-menu hr:last-child { display: none; }
.vmenu { left: 0; min-width: 260px; max-width: min(360px, calc(100vw - 32px)); max-height: min(360px, 50vh); overflow-y: auto; overscroll-behavior: contain; }
/* #166: many versions scroll inside the list (hub.js moves the list's own scroll, never the page). */
.vmenu[hidden] { display: none; }
.vmenu:focus { outline: none; }
.vmenu [role="option"] { padding: 6px 10px; border-radius: var(--r-btn); cursor: pointer; }
.vmenu [role="option"][aria-selected="true"] { background: var(--sunken); }
.vmenu [role="option"].on { background: color-mix(in srgb, var(--accent) 16%, transparent); outline: 2px solid var(--accent); outline-offset: -2px; }
.vmenu .faint { font-size: 12px; }
.vmenu .vnote { display: block; overflow-wrap: anywhere; }
.vmenu [data-all], .vmenu [data-cmp] { border-top: 1px solid var(--border); border-radius: 0; margin-top: 4px; padding-top: 8px; color: var(--accent-text); }
/* #128/#166: Compare versions… and All history are one group after the versions. */
.vmenu [data-cmp] + [data-all] { border-top: 0; margin-top: 0; padding-top: 6px; }
.hv-cmp { margin: 0 0 10px; }
.jump .menu { left: 0; min-width: 200px; }
.jump .menu a { display: block; padding: 6px 10px; border-radius: var(--r-btn); color: var(--text); text-decoration: none; }
.jump .menu a:hover, .jump .menu a:focus-visible { background: var(--sunken); }
.art-width { margin-left: auto; }
.art-narrow { display: none; }
/* Approve waits for checks: the reason under the button, linked to Details › Checks. */
.art-wait { display: inline-grid; justify-items: end; gap: 2px; }
.art-wait .btn[aria-disabled="true"] { background: var(--sunken); border-color: var(--border-strong); border-style: dashed; color: var(--muted); cursor: not-allowed; }
.art-why { font-size: 12px; }
/* A step that needs words: a small dialog. With no script it's part of the page (?do=). */
dialog.dlg { border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text); box-shadow: 0 16px 40px rgb(0 0 0 / .25); padding: 16px; width: min(420px, calc(100vw - 32px)); }
dialog.dlg-wide { width: min(560px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgb(0 0 0 / .35); }
/* Every open dialog is as tall as its content (Ward 11-15, iPad Safari). A modal one is placed by
   den-ui's base.css (#97); one open in place without script (?do=, not modal) the same way here. */
dialog.dlg[open]:not(:modal) { position: fixed; inset: auto 0; top: 50%; bottom: auto; margin: 0 auto; transform: translateY(-50%); height: auto; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
dialog.dlg[open]:not(:modal) { z-index: 40; }
.dlg-f { display: grid; gap: 10px; }
.dlg h2 { margin: 0; font-size: 15px; }
.dlg label:not(.fl) { font-size: 13px; font-weight: 500; }
.dlg input:not([type="file"]), .dlg textarea, .dlg select { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--r-btn); padding: 6px 9px; width: 100%; }
.dlg .foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg-err { color: var(--bad); margin: 0; font-size: 13px; }
/* A held decision that failed: the error colour and the warning icon (hub.js), never a plain line. */
.dlg-err[hidden] { display: none; }
.dlg .faint { margin: 0; font-size: 12.5px; }
.rp-list { position: static; box-shadow: none; max-width: none; width: 100%; margin-top: 4px; }
/* After a step: a toast, with Undo when Hub has the step back. */
.art-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 45; max-width: calc(100vw - 32px); }
.art-toast:empty { display: none; }
.art-toast .toast { max-width: min(560px, calc(100vw - 32px)); display: flex; gap: 12px; align-items: center; background: var(--text); color: var(--bg); border-radius: var(--r); padding: 8px 14px; font-size: 13px; box-shadow: 0 6px 24px rgb(0 0 0 / .2); }
.art-toast .linkbtn { color: var(--bg); font-weight: 600; }
/* #90 J5b: Remove group's toast is a sentence or two: it wraps at 390, Undo beside it or below. */
.grp-toast { width: max-content; }
.grp-toast .toast { flex-wrap: wrap; }
.grp-toast .toast > span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
/* E17: Edit's placeholder, a plain Markdown box until mock C's editor. */
.art-editor { display: grid; gap: 8px; }
.art-editor p { margin: 0; }
.art-editor textarea { min-height: 50vh; font: 13px/1.55 var(--mono); border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-btn); padding: 8px 10px; }
.art-editor input { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-btn); padding: 6px 9px; }
/* At 1000 and under, the side panel comes right after the doc (Vision 11-13). */
/* #2, #70: stacked, the panel is never taller than the window under the top bar (less 16px above
   it and .main's bottom padding, 40px or 32px at 720 and under), so its tab scrolls inside it
   instead of running the page on past the window. 100vh first for a browser without dvh. */
@media (max-width: 1000px) { .art-rec { grid-template-columns: minmax(0, 1fr); } .art-side { position: static; max-height: calc(100vh - var(--den-top-h) - 56px); max-height: calc(100dvh - var(--den-top-h) - 56px); } }
/* #70 and #2's repeat (Ward 11-15, Safari): on a desktop an artifact page fits the window. The
   header keeps its height; the record row takes the rest. The side panel fills the row on every
   tab and its tab panel scrolls inside; the doc (or the mock's frame) fills the row too and
   scrolls inside. Nothing runs past the window's bottom, and nothing stops short of it. */
@media (min-width: 1001px) {
  /* #2, #70: the window's visible height. Safari's 100vh is its largest viewport (iPad, iPhone:
     the toolbar hidden), so with the toolbar showing the panel's bottom sat behind the window's. */
  body.den-has-shell:has(.art-rec) { height: 100vh; height: 100dvh; min-height: 0; }
  .main:has(> .art-rec) { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding-bottom: 16px; }
  .main:has(> .art-rec) > * { flex: none; }
  .main > .art-rec { flex: 1 1 0; min-height: 0; align-items: stretch; }
  .art-rec > .art-main { min-height: 0; display: flex; flex-direction: column; }
  .art-main > .art-doc { flex: 1 1 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
  .art-doc > * { flex: none; }
  .art-doc > .stage { flex: 1 1 auto; min-height: 420px; display: flex; flex-direction: column; }
  .art-doc > .stage > .mockframe { flex: 1 1 auto; height: auto; }
  .art-side { position: relative; top: auto; max-height: none; min-height: 0; }
}
/* Stacked (≤1000px), the page scrolls as one: the panel row takes what's left of the window, so a
   short doc with few comments still reaches the bottom. */
@media (max-width: 1000px) {
  .main:has(> .art-rec) { display: flex; flex-direction: column; }
  .main:has(> .art-rec) > * { flex: none; }
  .main > .art-rec { flex: 1 0 auto; grid-template-rows: auto 1fr; align-items: stretch; }
}
@media (max-width: 720px) {
  .art-wide { display: none; }
  .art-menu .mi.art-narrow { display: block; }
  .art-hl { flex-basis: 100%; }
  .art-act { margin-left: 0; }
  /* A phone shows the doc at its full width: no reading width to pick. */
  .art-width { display: none; }
}
:lang(ja) .art-ph, :lang(ja) .art-side { word-break: keep-all; overflow-wrap: anywhere; }

/* CX on docs: highlights with numbered margin markers; select text and a Comment button appears. */
.cx-docbox { position: relative; }
.cx-docbox > article.doc { padding-right: 44px; }
mark.cxq { background: color-mix(in srgb, var(--accent) 16%, transparent); color: inherit; border-bottom: 2px solid var(--accent); padding: 0; cursor: pointer; }
mark.cxq.off { background: none; border-bottom: 0; cursor: auto; }
mark.cxq.on { background: color-mix(in srgb, var(--accent) 34%, transparent); }
mark.cxq.flash { animation: cx-flash 1.2s ease-out 1; }
@media (prefers-reduced-motion: reduce) { mark.cxq.flash { animation: none; } }
.gm { position: absolute; right: 8px; width: 24px; height: 24px; border: 0; border-radius: 4px; background: var(--accent-fill); color: var(--on-accent); font: 600 11px var(--sans); display: grid; place-items: center; cursor: pointer; padding: 0; }
.gm.resolved { background: var(--faint); color: var(--surface); }
.gm.on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.cx-selbtn { position: absolute; z-index: 4; box-shadow: 0 4px 14px rgb(0 0 0 / .2); }

/* H4 (Den's D61): "Hub was updated · Reload · Later". A wide pill, centred at the top over the
   global nav, on a semi-transparent strip the height of the bar. Ward 11-15 on mock I's "Today"
   figure: "SHIP THIS! THIS IS WHAT I WANTED." Restored as it was before f1467f6 (mock I withdrawn). */
/* The update pill is den-ui's (update-pill.css, #97). */

/* C7c Agents who may approve: long agent and project names wrap; nothing widens the page. */
.approvers {
  min-width: 0;
}
.approvers .row > span,
.approvers fieldset > label {
  min-width: 0;
  overflow-wrap: anywhere;
}
/* Reply in place (Ward 2026-11-12): threads carry forward, a reply stays in its thread, mentions are tokens. */
.pill.cx-from { color: var(--muted); border-color: var(--border); }
.pill.agentb { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); }
.notice.cx-oldv { position: sticky; top: var(--den-top-h); z-index: 4; background: var(--bg); border-style: solid; color: var(--text); }
.cx-res, .cx-new { display: grid; gap: 8px; margin-top: 12px; }
.cx-res .lh, .cx-new .lh { margin: 0; }
/* Slice 1b: the closed New comment control is a button (dashed, with its key), never a field. */
.cx-newbtn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 12px; border: 1px dashed var(--border-strong);
  border-radius: var(--r-btn); background: transparent; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.cx-newbtn:hover { color: var(--text); border-color: var(--accent); }
span.mention { border-radius: 4px; padding: 0 4px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); font-weight: 600; white-space: nowrap; }
/* An agent mention: one violet chip with a small square mark, by the agent's name. */
span.mention.agent { color: var(--violet); background: color-mix(in srgb, var(--violet) 14%, transparent); }
span.mention.agent::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 1px; background: currentColor; vertical-align: 0.1em; }
.cx-mwrap { position: relative; }
.cx-mwrap textarea { position: relative; z-index: 1; background: transparent; display: block; }
/* The side panel scrolls (overflow), which would cut a ring drawn outside a full-width field: draw it
   inside, all the way round (Hub Design 11-14). */
.cx-panel :is(textarea, input, select):focus-visible { outline-offset: -2px; }
.cx-mirror { position: absolute; inset: 0; z-index: 0; box-sizing: border-box; border: 1px solid transparent; padding: 6px 9px; border-radius: var(--r-btn); background: var(--surface);
  white-space: pre-wrap; overflow-wrap: break-word; overflow: hidden; color: transparent; pointer-events: none; font: inherit; }
.cx-mirror mark { color: transparent; border-radius: 3px; background: color-mix(in srgb, var(--accent) 24%, transparent); }
.cx-mirror mark.agent { background: color-mix(in srgb, var(--violet) 26%, transparent); }
/* The square sits in the space before the chip, out of the flow, so the mirror stays in step with the box. */
.cx-mirror mark.agent { position: relative; }
.cx-mirror mark.agent::before { content: ""; position: absolute; left: -8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 1px; background: var(--violet); }
/* Review A 9: the pill reaches 10px left of the "@", so the square sits inside it; drawn as a shadow
   (opaque, so the two never double up), never as padding, which would push the text off the box's. */
.cx-mirror mark.agent { --chip: color-mix(in srgb, var(--violet) 26%, var(--surface)); background: var(--chip); box-shadow: -10px 0 0 0 var(--chip); }
.cx-lb { position: fixed; inset: auto; z-index: 60; margin: 0; padding: 4px; list-style: none; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); box-shadow: 0 6px 18px rgb(0 0 0 / 0.15); max-height: 240px; overflow: auto; box-sizing: border-box; }
.cx-lb [role="option"] { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; justify-content: space-between; align-items: baseline; }
.cx-lb [role="option"][aria-selected="true"] { background: var(--sunken); }
/* Review A 8: the list's two groups, each under its heading. */
.cx-lb [role="group"] + [role="group"] { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.cx-lbh { padding: 4px 8px 2px; font: 600 11.5px var(--sans); color: var(--muted); }
.cx-lb .faint { font-size: 12px; }
.cx-err { color: var(--bad); font-size: 13px; margin: 0; }
.cx-panel [hidden] { display: none !important; }
.th-top .th-res { margin-left: auto; }
.th-top > .pill, .th-top > .th-res { flex: 0 0 auto; align-self: center; }
/* "Send to <agent>" under each comment box (Ward 11-13: a checkbox, not a typed @agent). */
.cx-send { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.cx-send input { margin: 0; accent-color: var(--violet); }
/* S3 (mock B v7 §2b): the agent's name is a menu button; the list opens in the flow under the box. */
.cx-route { flex-wrap: wrap; cursor: default; }
.cx-route label { cursor: pointer; }
.route { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-weight: 500; color: var(--violet); background: color-mix(in srgb, var(--violet) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--violet) 35%, transparent); border-radius: var(--r-btn); padding: 1px 6px; cursor: pointer; min-height: 24px; }
.route:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.cx-pick { margin: -6px 0 0; padding: 4px; width: min(300px, 100%); box-sizing: border-box; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); box-shadow: 0 8px 24px rgb(0 0 0 / .18); font-size: 13px; }
.cx-pick [role="listbox"]:focus { outline: none; }
.cx-pick [role="option"] { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: var(--r-btn); cursor: pointer; }
.cx-pick [role="option"].on { background: color-mix(in srgb, var(--violet) 14%, transparent); outline: 2px solid var(--violet); outline-offset: -2px; }
.cx-pick .tick { width: 1em; flex: none; color: var(--violet); }
.cx-pick [aria-selected="true"] .tick::before { content: "\2713"; }
.cx-pick .why { margin-left: auto; font-size: 11.5px; color: var(--muted); }
/* L1: links in comment bodies; long ones wrap. */
.th .body a.lk { text-decoration: underline; overflow-wrap: anywhere; }
/* Review A 6: the S1b hint sits right under its checkbox (2px), not a form row away. */
.cx-send-hint { margin: -10px 0 0; font-size: 12.5px; }
/* Review A 2: "Reply to @sam" over each reply box, close to it. */
.th-reply .cx-rl { margin-bottom: -8px; font-size: 12.5px; color: var(--muted); }
/* Review A 7: no "⌘↵ to send" at phone width. */
@media (max-width: 375px) { .cx-acts .cx-hint { display: none; } }
/* The status line of a thread sent to you (S1d, mock B status j): "Sent to you" + "Send to <agent>", then "Waiting for <agent>". */
.cx-st { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 0; }

/* ── Mock B's held UI (Hub Design 11-13) ──────────────────────────────────────────────────── */
/* §1: each thread's status line, in its own polite region; empty, it takes no room. */
.cx-stl:empty { display: none; }
.cx-st .cx-why { font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.cx-st form, form.cx-reopen { display: inline; margin: 0; }
.pill .dot, .cx-sl .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; animation: cx-pulse 1.6s ease-in-out infinite; }
/* Sign-off S1: working is the info tone (neutral grey-blue) in both themes; red is for failures. */
.pill.info { color: var(--info); background: color-mix(in srgb, var(--info) 13%, transparent); }
.cx-sl .dot { color: var(--info); }
/* Call 2: "Not delivered to Scribe: the tool crashed." is one sentence; it may wrap. */
.cx-st .pill.bad { white-space: normal; }
.cx-st-who { flex-direction: column; align-items: flex-start; gap: 4px; }
.cx-st .cx-who { margin: 0; font: 12px var(--sans); color: var(--muted); }
/* M2: on the diff, a quote only in the removed text. */
.cx-panel .cx-changed { font: 12px var(--sans); color: var(--muted); margin: 0; }
/* NIT: "Show resolved (n)" is a sans small button. */
.cx-res .lh { font: inherit; text-transform: none; letter-spacing: normal; margin: 8px 0; }
/* S4: a History card's byline on one line. */
.hv-by { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hv-by a.agent { color: inherit; text-decoration: none; }
.hv-by a.agent:hover { text-decoration: underline; }
@keyframes cx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
/* A1: with reduced motion the dot stays, still. */
@media (prefers-reduced-motion: reduce) { .pill .dot, .cx-sl .dot { animation: none; } }
/* §3: the agent strip, at the top of the panel; keyboard-reachable; empty, no room. */
.cx-strip { display: grid; gap: 4px; margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--sunken); font-size: 13px; }
.cx-strip:not(:has(.cx-sl)) { display: none; }
.cx-strip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cx-sl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; min-width: 0; }
.cx-sl > span:first-of-type:not(.dot) { flex: 1 1 12em; min-width: 0; }
.cx-sl .end { margin-left: auto; font-size: 12px; }
.cx-sl.warn { color: var(--warn); }
/* R3: all done. */
.cx-alldone:empty { display: none; }
.cx-alldone { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.cx-alldone p { margin: 0; color: var(--muted); }
/* The tabs and the "?" keys popover on one row. */
.art-tabsrow { display: flex; align-items: flex-end; gap: 8px; border-bottom: 1px solid var(--border); margin: 0 -6px 12px; }
.art-tabsrow .art-tabs { border-bottom: 0; margin: 0; flex: 1 1 auto; min-width: 0; }
/* Mock O (#57): Widen/Narrow and Reading at the tab row's end; the edge on the panel's left. */
.art-tabsrow { align-items: center; }
.art-tabsrow .art-tabs { flex: 0 1 auto; }
.pw-sp { flex: 1 1 0; }
.wbtn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--r-btn); min-height: 26px; padding: 0 7px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; white-space: nowrap; flex: none; }
.wbtn:hover { border-color: var(--border-strong); }
.wbtn[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 13%, transparent); border-color: var(--accent); }
.wbtn .ic { width: 14px; height: 14px; }
/* The header's More menu opens over the panel's top row: while it is open the width buttons step
   out, so no sliver of one is left as a too-small target beside the menu (axe target-size). */
body:has(.art-more[open]) .art-side .wbtn { visibility: hidden; }
/* At Normal (380px) the three tabs need the row: the buttons show their icons, their words stay
   their names (and their tooltips). Wide and Reading have room for the words. */
.art-rec:not([data-pw]) .wbtn .pw-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.pw-edge { position: absolute; left: -13px; top: 0; bottom: 0; width: 10px; cursor: col-resize; display: grid; place-items: center; z-index: 2; touch-action: none; }
.pw-edge::before { content: ""; width: 4px; height: 36px; border-radius: 2px; background: var(--border-strong); }
.pw-edge:hover::before, .pw-edge:focus-visible::before, .pw-edge.on::before { background: var(--accent); }
.pw-edge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.pw-back { display: none; font-size: 12.5px; color: var(--accent-text); }
.art-rec[data-pw="reading"] .pw-back { display: inline-flex; }
.cx-anchor .onl { display: none; }
.art-rec[data-pw="reading"] .cx-anchor .onl { display: inline; color: var(--faint); }
.art-rec[data-pw="reading"] .cx-anchor { cursor: pointer; }
/* Comments in Markdown (mock O): 13.5px at 1.5, so 13.5em is 9 lines; a long one folds (hub.js). */
.msg .body.cb { white-space: normal; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
:lang(ja) .msg .body.cb { overflow-wrap: break-word; }
.cb p { margin: 0 0 8px; }
.cb > :last-child { margin-bottom: 0; }
.cb ul, .cb ol { margin: 0 0 8px; padding-left: 20px; }
.cb li { margin: 2px 0; }
.cb code { font: 12px var(--mono); background: var(--sunken); padding: 0 4px; border-radius: 3px; }
.cb pre { font: 12px/1.5 var(--mono); background: var(--sunken); padding: 8px 10px; border-radius: 4px; overflow: auto; margin: 0 0 8px; white-space: pre; }
.cb pre code { background: none; padding: 0; }
.cb blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.cb .tw { overflow: auto; margin: 0 0 8px; }
.cb.folded { max-height: 13.5em; overflow: hidden; position: relative; }
.cb.folded::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.th.resolved .cb.folded::after { background: linear-gradient(transparent, var(--sunken)); }
.cx-more { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; grid-column: 2; }
.cx-more[hidden] { display: none; }
@media (max-width: 1000px) { .wbtn, .pw-edge, .pw-sp, .cx-rw { display: none; } .art-rec[data-pw] { grid-template-columns: minmax(0, 1fr); } .art-rec[data-pw="reading"] > .art-main { display: block; } }
/* ==== #237: mock E v2 E14's bottom dock and sheet on a doc page. ==== */

/* -- Hub-only (Vision 11-18 split b): kit data-only shape. The bottom dock and sheet: at 720px and under, on a panel
   script marks with data-sheet: closed, the tabs in a dock fixed at the bottom (E's .dock:
   border-top, surface, 8px 12px); open, a sheet over the page from 140px down (E's .sheet: radius
   14px, shadow, 10px 14px; E's .grab bar), Close at its end. The safe area pads the bottom.
   Without script there is no data-sheet and none of this applies. -- */
.sheet-grab, .sheet-end { display: none; }
@media (max-width: 720px) {
  [data-sheet] { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; max-height: none; margin: 0; border: 0; border-top: 1px solid var(--border-strong); border-radius: 0;
    background: var(--surface); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  [data-sheet] [role="tab"] { min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; }
  [data-sheet="open"] { top: 140px; border-radius: 14px 14px 0 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgb(0 0 0 / .2); display: flex; flex-direction: column; gap: 10px; }
  [data-sheet="open"] > [role="tabpanel"] { flex: 1 1 auto; }
  /* Hub Design 11-18 22:00: a deep link's sheet is half height, its top below the page header
     (hub.js sets --sheet-top). */
  [data-sheet="open"][data-sheet-half] { top: var(--sheet-top, 50%); }
  [data-sheet="open"] .sheet-grab { display: block; flex: none; width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 0 auto; }
  [data-sheet="open"] .sheet-end { display: flex; flex: none; justify-content: flex-end; }
  [data-sheet="open"] .sheet-end .btn { min-height: 44px; }
}

/* -- Hub's doc page with it: the doc ends above the dock, the tab row is the dock's one row when
   closed (the content hidden), and the toast sits above the dock. -- */
@media (max-width: 720px) {
  /* The dock's height (8px, a 44px tab, 8px, its 1px border) and the safe area: the doc's last
     line ends above the dock. */
  .art-rec:has(> .art-side[data-sheet]) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .art-side[data-sheet] .art-tabsrow { margin: 0; flex: none; }
  /* #50 wraps the tab row so the keys button gets its own line in a narrow side panel; in the dock
     that second line made the dock taller than the doc's padding (the doc's end went under it).
     The dock is one row: no wrap; the tabs take what's left beside the keys button and scroll
     inside themselves if a language's words don't fit (the page never scrolls sideways). The keys
     button stays: its popover works at 375 (held-ui). */
  .art-side[data-sheet] .art-tabsrow { flex-wrap: nowrap; padding-bottom: 0; }
  .art-side[data-sheet] .art-tabsrow .art-tabs { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
  .art-side[data-sheet] .art-tabsrow .cx-keys { flex: none; }
  .art-side[data-sheet="closed"] .art-tabsrow { border-bottom: 0; }
  .art-side[data-sheet="closed"] > :not(.art-tabsrow) { display: none; }
  body:has(.art-side[data-sheet="closed"]) .art-toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

.cx-keys { position: relative; flex: none; margin: 0 6px 6px 0; }
.cx-keys > summary { list-style: none; cursor: pointer; min-width: 28px; justify-content: center; }
.cx-keys > summary::-webkit-details-marker { display: none; }
.cx-keys-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(300px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r); padding: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .2); font-size: 13px; }
.cx-keys-h { margin: 0 0 8px; font-weight: 600; }
.cx-kl { display: grid; gap: 4px; margin: 0 0 10px; }
.cx-kl > div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: baseline; }
.cx-kl dt, .cx-kl dd { margin: 0; }
.cx-keys-f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; border-top: 1px solid var(--border); padding-top: 10px; }
.cx-keys-f label { display: inline-flex; gap: 6px; align-items: center; }
.cx-keys-f [data-keys-save][hidden] { display: none; }
/* K2: shortcuts off: no letter hints. */
[data-keys="off"] [data-cx-mode] kbd, [data-keys="off"] [data-cx-new] kbd { display: none; }
/* §6, D2: the doc as a diff. Added and removed text each say so to a screen reader; never colour alone. */
.cx-diffh { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--sunken); }
.cx-diffh p { margin: 0; min-width: 0; }
/* #128/#166: the two versions to compare, as the page's other pickers (.linkform). */
.cx-diffh select { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--r-btn); padding: 2px 6px; font: inherit; max-width: 100%; }
/* #128: .btn's inline-flex beats the browser's [hidden], so with script Compare stayed visible. */
.cx-diffh [data-cmp-show][hidden] { display: none; }
article.cx-diff ins { text-decoration: underline 2px; text-decoration-color: var(--ok); text-underline-offset: 3px; background: color-mix(in srgb, var(--ok) 12%, transparent); color: inherit; }
article.cx-diff del { text-decoration: line-through; text-decoration-color: var(--bad); color: var(--muted); background: color-mix(in srgb, var(--bad) 8%, transparent); }
article.cx-diff ins.blk, article.cx-diff del.blk { display: block; text-decoration-thickness: 1px; }
/* F3 (Hub Design 11-13): a change's comment number in the diff's right margin, on its block's first line. */
article.cx-diff { padding-right: 30px; }
article.cx-diff > :has(> .cx-dno) { position: relative; }
.cx-dno { position: absolute; right: -30px; top: 3px; display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 50% 50% 50% 3px; background: var(--accent-fill); color: var(--on-accent); font: 600 11px/1 var(--sans); }
/* H1: History's done event, a row per comment. */
.ev-done .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.ev-done .row > a { margin-left: auto; }
.ev-rows { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.ev-rows li { overflow-wrap: anywhere; }
/* Review A a: the header byline is one line. */
.art-byl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; }
.art-by { flex-wrap: wrap; align-items: center; }
/* Target size (WCAG 2.2 SC 2.5.8) at phone width: the keys switch and a thread's Reply. */
.cx-keys-f input[type="checkbox"] { width: 18px; height: 18px; margin: 3px; }
.tact .linkbtn { min-height: 24px; display: inline-flex; align-items: center; }

/* Report (FB-SPEC, Hub Design's mock H): den-ui's button, in the kit's top bar on every page and at
   the start of every pop-up's footer, opposite its own buttons: where it sits is Hub's footer's. */
.dlg .foot > [data-den-report], .cx-keys-ft > [data-den-report], .pal-foot > [data-den-report], dialog.pop .ft > [data-den-report], .dpk-ft > :first-child[data-den-report] { margin-right: auto; }
/* #90 J5b: Remove group sits on the left, after Report (den-ui's, Hub 0.2.0; or first, with no Report). */
.dlg .foot .btn.danger { margin-right: auto; }
.dlg .foot > [data-den-report]:has(+ .btn.danger) { margin-right: 0; }
.cx-acts > [data-den-report] { display: none; }
form.cx-float .cx-acts > [data-den-report] { display: inline-flex; margin-right: auto; }
form.cx-float .cx-acts .cx-hint { margin-right: 0; }
.cx-keys-ft { display: flex; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.pal-foot { align-items: center; }
.pal-hints { display: flex; gap: 14px; flex-wrap: wrap; }
/* The floating comment box keeps one row, Report · Cancel · Comment; the ⌘↵ hint sits above it.
   order -2: the kit's footer Report (.den-rb-in) is order -1 and comes first in the markup, so a tied
   hint would wrap below it and leave Report alone on the top row. */
form.cx-float .cx-acts { flex-wrap: wrap; row-gap: 4px; }
form.cx-float .cx-acts .cx-hint { order: -2; flex: 1 0 100%; text-align: right; margin: 0; }
form.cx-float .cx-acts .btn { flex: none; }
@media (max-width: 359px) { form.cx-float .cx-acts .cx-hint { display: none; } }

/* BUSY-1: the working pop-up is den-ui's (<den-busy>, busy.css, #97). */

/* Resolve all (Vision 11-13): a box per imported thread; the count and the button above. */
.list li.wait-pick { display: flex; gap: 10px; align-items: flex-start; }
.list li.wait-pick > div { min-width: 0; flex: 1; }
/* Hub operator: a refused decision's words, then its Report, top-aligned (Hub Design 11-14). */
.list > li.op-ratchet { grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; }
.list > li.op-ratchet > .row { flex-wrap: wrap; min-width: 0; }
/* Hub settings: each one's name, state, then what it does. */
.op-set { margin: 0; display: grid; gap: 10px; }
.op-set > div { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline; }
.op-set dd { margin: 0; }
.op-set dd.muted { grid-column: 1 / -1; font-size: 13px; }
.wait-pick input[type="checkbox"], .wait-all input { accent-color: var(--accent); margin-top: 3px; flex: none; }
.wait-acts { justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.wait-acts .btn { margin-left: auto; }
/* #81 (Ward 11-15: "I'd expect the actions to be pulled to the right"): each Approvals row is its
   box, the item, and its own Decline and Approve at the right, on the item's line; on a phone they
   wrap under it, still at the right. The bar above: Select all, then the bulk buttons, Approve all last. */
.list li.hl { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.list li.hl > .hl-main { min-width: 0; flex: 1 1 320px; }
.list li.hl > input[type="checkbox"] { accent-color: var(--accent); margin-top: 4px; flex: none; }
.hl-acts { display: flex; gap: 8px; flex: none; margin-left: auto; justify-content: flex-end; flex-wrap: wrap; }
.held-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 0; padding: 0; margin: 0 0 10px; min-width: 0; }
.held-bar .hb-gap { flex: 1; }
.held-bar .hb-all input { accent-color: var(--accent); }
.held-bar .btn[aria-disabled="true"] { opacity: 0.55; }
.held-why { margin: 6px 0 0; }
.held-err { margin: 6px 0 0; color: var(--bad); }
/* An install ask's lines (Hub Design 11-18): one block, the held summary's spacing. */
.held-sum { display: grid; gap: 6px; }
.held-sum p { margin: 0; }
/* #81 on Artifacts: what the batch did, with its Undo beside it. */
.notice-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.notice-row .notice { margin: 0; }
.notice-row form { margin: 0; }
@media (max-width: 600px) {
  .list li.hl > .hl-main { flex-basis: calc(100% - 30px); }
  .hl-acts { flex-basis: 100%; }
}
#ra-open[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.wait-done ul { margin: 4px 0 8px 18px; padding: 0; }
.wait-done p { margin: 0 0 6px; }
#dlg-resolve p { margin: 0; overflow-wrap: anywhere; }

/* Hub Design 11-14: a mock frame whose links went out of date. The What's new bar's look, solid,
   no blur, across the top of the frame: just above it, joined to it, so it covers none of the
   mock (its links stay clickable, pins stay put). One Reload at the end. */
.frame-stale { position: relative; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 10px 16px; margin-bottom: 3px; box-sizing: border-box; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r) var(--r) 0 0; box-shadow: 0 6px 18px color-mix(in srgb, var(--text) 14%, transparent); font-size: 14px; }
.frame-stale::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--bar); }
.frame-stale > span { flex: 1 1 16em; min-width: 0; }
.frame-stale .btn { margin-left: auto; padding: 7px 14px; }
.frame-stale[hidden] { display: none; }
.frame-stale:not([hidden]) + .stage { border-top-left-radius: 0; border-top-right-radius: 0; }
/* Resolve all (Hub Design 11-14): Select all on one row, its box in line with the rows' boxes, the
   button at the row's end; the pop-up lists the ones left open under its title, Done last. */
.wait-acts { align-items: center; flex-wrap: nowrap; }
.wait-acts .wait-all { display: flex; align-items: center; gap: 10px; margin: 0; min-width: 0; cursor: pointer; }
.wait-pick > input[type="checkbox"], .wait-acts .wait-all input { margin-inline: 0; }
.wait-acts .wait-all input { margin-block: 0; }
.wait-acts .wait-all[hidden] { display: none; }
.bz-dlg .busy-rest { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bz-dlg .busy-rest li { overflow-wrap: anywhere; }
.bz-dlg .busy-more { margin: 8px 0 0; }

/* #90 Groups (Hub Design's mock J v3): Settings › Groups (J1), one group's graph and list (J2), the
   company map (J2b) and "Who do I ask?" (J3). Classes only: Hub's CSP is style-src 'self'. */
.grp { container-type: inline-size; display: grid; gap: 12px; min-width: 0; }
.grp .chip, dialog.pop .chip { font: 11.5px var(--mono); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 6px; white-space: nowrap; display: inline-block; line-height: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.grp .chip.more, dialog.pop .chip.more { border-style: dashed; color: var(--muted); }
.grp .chips, dialog.pop .chips { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; min-width: 0; }
.grp .ini, dialog.pop .ini { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 11px var(--sans); flex: none; border: 1px solid var(--border-strong); background: var(--sunken); }
.grp .ini.ag, dialog.pop .ini.ag { background: color-mix(in srgb, var(--remote) 14%, var(--surface)); color: var(--remote); }
.grp .ini.pe, dialog.pop .ini.pe { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent-text); }
.grp .kb, dialog.pop .kb { font: 500 11px var(--sans); padding: 0 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; line-height: 17px; }
.grp .kb.ag, dialog.pop .kb.ag { color: var(--remote); border-color: color-mix(in srgb, var(--remote) 45%, transparent); }
.grp .kb.pe, dialog.pop .kb.pe { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.gw { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; min-width: 0; }
.stt { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; display: inline-block; }
.sdot.off { background: transparent; border: 2px solid var(--faint); }
.grp .sub2 { display: block; font-size: 12px; color: var(--faint); margin-top: 2px; }
.grp .panel.tight { padding: 4px 10px; }
.gt { border-collapse: collapse; width: 100%; font-size: 13px; }
.gt th, .gt td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.gt td { overflow-wrap: anywhere; }
/* #183: a long owned path or address wraps inside its chip, so the table fits its panel at 1280 (it
   was cut off on the right) and a card at 390 shows the whole path, never an ellipsis. */
.gt .chip { white-space: normal; overflow-wrap: anywhere; }
.gt thead th { overflow-wrap: normal; word-break: normal; font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.gt tbody th { white-space: nowrap; min-width: 96px; font-weight: 600; word-break: keep-all; }
.gt td.num, .gt th.num { text-align: right; }
.gt .lab { display: none; }
.gt tr.ext td, .gt tr.ext th { color: var(--muted); }
.gt tr:last-child td, .gt tr:last-child th { border-bottom: 0; }
.grp .sec2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.grp .m0 { margin: 0; }
.grp .radios { display: grid; gap: 10px; margin: 6px 0 0; padding: 0; border: 0; min-width: 0; }
.grp .radio { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.grp .radio > span:last-child { min-width: 0; display: grid; gap: 2px; }
.grp .radio input { margin-top: 3px; accent-color: var(--accent-fill); }
.grp .emptyc { display: grid; gap: 10px; justify-items: start; padding: 20px; }
.grp .emptyc p { margin: 0; max-width: 52ch; }
.set-own { margin-left: auto; align-items: center; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
/* #108: the group page's View toggle (in the header, outside .grp) shows only while the graph can:
   .gframe spans the header and .set-layout, whose sidebar column and gap (180px + 24px) sit
   beside .grp, so .gframe <= 924px is .grp <= 720px, the query below that hides the graph. */
.gframe { container: gframe / inline-size; }
@container gframe (max-width: 924px) { .gframe .set-ph .seg { display: none; } }
.grp .lv { display: none; }
.grp[data-view="list"] .lv, .grp.cm .lv { display: block; }
.grp.cm .lv { margin-top: 12px; }
svg.g { display: block; width: 100%; height: auto; max-width: 900px; margin: 0 auto; }
svg.g text { font-family: var(--sans); fill: var(--text); }
svg.g .t1 { font-size: 12.5px; font-weight: 600; }
svg.g .t1.s { font-size: 11px; }
svg.g .t2 { font: 10.5px var(--mono); fill: var(--muted); }
svg.g .t3 { font-size: 10.5px; fill: var(--muted); }
svg.g .t3.f { fill: var(--faint); }
svg.g .ag-t { fill: var(--remote); font-weight: 600; }
svg.g .pe-t { fill: var(--accent-text); font-weight: 600; }
svg.g .it { font-size: 11px; font-weight: 600; }
svg.g .gbox { fill: color-mix(in srgb, var(--sunken) 55%, transparent); stroke: var(--border-strong); stroke-width: 1.2; }
svg.g .gbox.dash { stroke-dasharray: 5 4; fill: none; stroke: var(--violet); }
svg.g .nr { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1; }
svg.g .nr.dash { stroke-dasharray: 4 3; }
svg.g .nd.sel .nr { stroke: var(--accent); stroke-width: 2.5; }
svg.g a:focus-visible .nr { stroke: var(--accent); stroke-width: 2.5; }
svg.g .ci { stroke-width: 1; }
svg.g .ci.a { fill: color-mix(in srgb, var(--remote) 16%, var(--surface)); stroke: var(--remote); }
svg.g .ci.p { fill: color-mix(in srgb, var(--accent) 16%, var(--surface)); stroke: var(--accent-text); }
svg.g .sd { fill: var(--ok); }
svg.g .sd.off { fill: none; stroke: var(--faint); stroke-width: 1.6; }
svg.g .e-talk { fill: none; stroke: var(--muted); stroke-width: 1.5; }
svg.g .e-peer { stroke: var(--border-strong); stroke-width: 1.4; opacity: .7; }
svg.g .e-esc { fill: none; stroke: var(--accent-text); stroke-width: 1.7; stroke-dasharray: 6 4; }
svg.g .e-x { fill: none; stroke: var(--violet); stroke-width: 2; stroke-dasharray: 1.5 5; stroke-linecap: round; }
.mkr-e { fill: var(--accent-text); } .mkr-x { fill: var(--violet); }
.leg { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--muted); margin-top: 10px; align-items: center; }
.leg > span { display: inline-flex; gap: 6px; align-items: center; }
.leg svg { width: 30px; height: 8px; flex: none; }
.leg .lg-talk { stroke: var(--muted); stroke-width: 1.5; }
.leg .lg-esc { stroke: var(--accent-text); stroke-width: 1.7; stroke-dasharray: 6 4; }
.leg .lg-x { stroke: var(--violet); stroke-width: 2; stroke-dasharray: 1.5 5; stroke-linecap: round; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin: 2px 0 0 12px; padding-left: 14px; border-left: 1px solid var(--border-strong); }
.tree li { margin: 2px 0; }
.tn { display: flex; gap: 4px 8px; align-items: center; flex-wrap: wrap; padding: 4px 6px; border-radius: 4px; min-width: 0; }
.tn.sel { background: color-mix(in srgb, var(--accent) 13%, transparent); outline: 1px solid var(--accent); }
.tn b { font-weight: 600; }
.tn .role { font-size: 12px; color: var(--muted); }
.grp .two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.sp-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-h h3 { margin: 0; font-size: 16px; }
.gkv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 10px; margin: 10px 0; font-size: 13px; }
.gkv dt { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding-top: 3px; }
.gkv dd { margin: 0; min-width: 0; }
.grp .small, dialog.pop .small { font-size: 12.5px; margin: 8px 0 0; }
.cmlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cmlist li { border: 1px solid var(--border); border-radius: var(--r); padding: 8px 10px; display: grid; gap: 4px; background: var(--surface); }
.cmlist li.ext { border-style: dashed; }
@container (max-width: 720px) {
  .gt thead { display: none; }
  .gt, .gt tbody, .gt tr, .gt td, .gt th { display: block; }
  .gt tr { display: grid; gap: 6px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
  .gt tr:last-child { border-bottom: 0; }
  .gt td, .gt th { border: 0; padding: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: baseline; }
  .gt tbody th { display: block; font-size: 15px; }
  .gt td.num { text-align: left; }
  .gt .lab { display: block; font: 11px var(--mono); color: var(--faint); text-transform: uppercase; }
  .grp .gv { display: none; }
  .grp .lv { display: block; }
  .grp .two { grid-template-columns: minmax(0, 1fr); }
  .gkv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gkv dd { margin-bottom: 6px; }
}
/* J3: the popover (Hub's dialog.dlg, narrow). */
dialog.dlg.pop { width: min(360px, calc(100vw - 32px)); padding: 12px; }
dialog.pop .dlg-h { display: flex; align-items: flex-start; gap: 8px; }
dialog.pop .dlg-h h2 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
dialog.pop .x { font-size: 18px; line-height: 1; padding: 2px 4px; color: var(--muted); flex: none; text-decoration: none; }
dialog.pop .goes { font-size: 12.5px; color: var(--muted); margin: 0; }
dialog.pop .pr { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
dialog.pop .pl { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
dialog.pop .pr .row { align-items: center; }
dialog.pop details summary { cursor: pointer; }
dialog.pop details .chips { margin-top: 6px; }
dialog.pop .ft { justify-content: flex-end; }

/* J5, J6: add or edit a group (dialog.dlg-wide #dlg-group). */
#dlg-group .dlg-h, dialog.pop .dlg-h { display: flex; align-items: flex-start; gap: 8px; }
#dlg-group .dlg-h h2 { margin: 0; font-size: 15px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
#dlg-group .x { font-size: 18px; line-height: 1; padding: 2px 4px; color: var(--muted); flex: none; text-decoration: none; background: none; border: 0; cursor: pointer; }
#dlg-group .goes, #dlg-group .hintt { font-size: 12.5px; color: var(--muted); margin: 0; font-weight: 400; }
#dlg-group .inp.err, #dlg-group select[aria-invalid="true"] { border-color: var(--bad); }
#dlg-group .errt { color: var(--bad); margin: 0; font-size: 13px; }
#dlg-group fieldset.rows { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 0; }
#dlg-group fieldset.rows legend { font-size: 13px; font-weight: 500; padding: 0; margin-bottom: 4px; }
#dlg-group .mrow, #dlg-group .orow { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
#dlg-group .mrow .x[hidden], #dlg-group .orow .x[hidden] { display: none; }
#dlg-group .mrow:has(.x[hidden]), #dlg-group .orow:has(.x[hidden]) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
#dlg-group .row [hidden] { display: none; }
@media (max-width: 480px) { #dlg-group .mrow, #dlg-group .orow { grid-template-columns: minmax(0, 1fr) auto; } #dlg-group .mrow > :nth-child(2), #dlg-group .orow > :nth-child(2) { grid-column: 1; } }
[data-send-to][hidden] { display: none; }
dialog.pop .goes.strong { color: var(--text); font-weight: 500; }

/* Hub 0.2.0, as in Den: ☆ beside a project's or an artifact's title pins it to the rail. */
.ph-title { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.pin-tg { vertical-align: middle; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: var(--radius-button); background: none; color: var(--muted); font: 18px/1 var(--sans); cursor: pointer; }
.pin-tg:hover { background: var(--sunken); border-color: var(--border); color: var(--text); }
.pin-tg[aria-pressed="true"] { color: var(--accent-text); }
.pin-msg { margin-left: 6px; font-size: 13px; color: var(--muted); vertical-align: middle; }
.pin-msg:empty { display: none; }
/* #150 (Ward 11-16, Hub Design's audit): Hub on a phone. */
@media (pointer: coarse) {
  /* iOS zooms in on a field under 16px, then the page scrolls sideways. */
  input, select, textarea { font-size: 16px; }
  /* What a finger taps is at least 44px. */
  .btn, .btn.sm, .cx-newbtn, .pin-tg, .art-tabs [role="tab"], .cx-keys > summary { min-height: 44px; box-sizing: border-box; }
  .art-tabs [role="tab"] { display: inline-flex; align-items: center; }
  /* A thread's Reply / Resolve and a toast's Undo are text buttons: their row gives them height. */
  .tact .linkbtn, .toast .linkbtn { min-height: 44px; display: inline-flex; align-items: center; }
  /* A menu's items (More, and the menus like it). */
  .menu .mi, .menu form.mi > button { min-height: 44px; box-sizing: border-box; padding-block: 12px; }
  .pin-tg { min-width: 44px; }
}
@media (hover: none) and (pointer: coarse) {
  /* Keyboard-only hints mean nothing on a phone. */
  .cx-bar kbd, .cx-newbtn kbd, .cx-keys, .cx-acts .cx-hint { display: none !important; }
}
@media (max-width: 720px) {
  /* The doc reads full width; the comment markers sit over its edge. */
  .cx-docbox > article.doc { padding-right: 0; }
  /* A dialog opens at the top: the keyboard takes the bottom of the screen. den-ui's base.css
     centres a modal (top 50%, translateY(-50%)); a sheet's own rules win over it. */
  dialog.dlg[open] { top: 8px; bottom: auto; transform: none; margin: 0 auto; }
}
/* #182 S1 (mock U, approved 11-18): New doc's editor page (U2), the Drafts list and the project
   page's Docs panel (U1). The editor and its save-state line are den-ui's (markdown-editor.css,
   savestate.css: their toolbar taps and 16px text on a phone are the kit's); Hub sets the page
   around them, with the mock's values. Rules that reach CodeMirror's own elements outrank its base
   theme (a constructed sheet, after this one: den-ui-editor.ts) by one more class. */
.ed-page { display: flex; flex-direction: column; gap: 12px; min-height: calc(100dvh - var(--den-top-h, 48px) - 40px); max-width: 920px; width: 100%; }
.ed-form { display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-width: 0; }
.ed-crumbs { margin-bottom: 0; align-items: center; }
.ed-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
.ed-up { font-size: 13px; color: var(--muted); margin-left: auto; }
.ed-crumbs a { display: inline-flex; align-items: center; }
.ed-title { display: flex; align-items: baseline; gap: 6px 16px; }
.ed-t { flex: 1 1 auto; min-width: 0; font: 600 24px/1.3 var(--sans); color: var(--text); background: transparent; border: 0; border-bottom: 1px solid transparent; border-radius: 0; padding: 4px 0; outline: none; }
.ed-t:hover { border-bottom-color: var(--border); }
.ed-t:focus { border-bottom-color: var(--accent); }
.ed-t::placeholder { color: var(--faint); }
.ed-ss { flex: none; margin: 0; }
.ed-box { flex: 1 1 auto; min-height: 420px; display: flex; flex-direction: column; min-width: 0; }
.ed-box .md-field { flex: 1 1 auto; --md-min-height: 420px; --md-max-height: none; }
/* With no script (and until the editor arrives): the page's own textarea, in the editor's box. */
.ed-box > .ed-fallback { flex: 1 1 auto; width: 100%; box-sizing: border-box; min-height: 420px; padding: 10px 12px; font: 15px/1.5 var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); resize: vertical; }
.ed-box > .ed-fallback:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.ed-page .ed-box .cm-editor { flex: 1; }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 4px 0 0; }
.ed-line { margin: 0; font-size: 13px; flex: 1 1 260px; min-width: 0; }
.ed-acts { display: flex; gap: 8px; margin-left: auto; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { border-color: var(--border); }
.panel.ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); border-left: 4px solid var(--ok); margin-bottom: 12px; display: grid; gap: 4px; }
.panel.ok p { margin: 0; }
.docs-new { margin: 10px 0 0; }
.list li.hl.hl1 > .hl-main { padding-left: 0; flex-basis: 100%; }
/* #120 clause 1 (mock P v3): Edit on a Hub Markdown doc: the editor, then the save bar. */
.ebar { display: flex; gap: 10px; flex-wrap: wrap; padding: 6px 0 10px; margin-bottom: 12px; font-size: 13px; }
.ed-md { display: flex; flex-direction: column; min-width: 0; }
.ed-md .md-field { --md-min-height: 280px; --md-max-height: none; }
.art-editor .ed-md > textarea { width: 100%; box-sizing: border-box; min-height: 280px; font: 14px/1.6 var(--sans); }
@media (min-width: 721px) and (pointer: fine) {
  .ed-md .md-field .md-editor-host, .ed-md .md-field .md-fallback { font-size: 14px; line-height: 1.6; }
}
.savebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); padding: 8px 12px; margin-top: 12px; box-shadow: 0 -4px 18px rgb(0 0 0 / .08); font-size: 13px; }
.savebar .grow { flex: 1 1 14em; min-width: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.art-editor .savebar input { flex: 1 1 12em; min-width: 0; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-btn); padding: 4px 8px; }
.udot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.udot[hidden], .savebar [data-unsaved][hidden] { display: none; }
/* #150 on these parts: every field 16px, every tap 44px, no sideways scroll. */
@media (max-width: 480px), (pointer: coarse) {
  .ed-t { font-size: 22px; min-height: 44px; }
  .ed-title { flex-direction: column; align-items: stretch; gap: 0; }
  .ed-crumbs, .ed-crumbs a, .ed-up { min-height: 44px; }
  .ed-up { display: inline-flex; align-items: center; }
  .den-savestate .linkbtn, .den-savestate button { min-height: 44px; display: inline-flex; align-items: center; }
  .ed-box > .ed-fallback, .art-editor .ed-md > textarea, .art-editor .savebar input { font-size: 16px; }
  .ed-bar { position: sticky; bottom: 0; z-index: 3; background: var(--bg); border-top: 1px solid var(--border); margin: 0 calc(-1 * var(--space-4, 16px)); padding: 10px var(--space-4, 16px) calc(10px + env(safe-area-inset-bottom)); }
  .ed-acts { width: 100%; }
  .ed-acts .btn { flex: 1 1 0; justify-content: center; min-height: 44px; }
  .ed-line { flex-basis: 100%; }
  .docs-new .btn, .ph .act .btn { min-height: 44px; }
  .segs a { min-height: 44px; display: inline-flex; align-items: center; }
  .list li.hl.hl1 a.t, .docs-panel a { min-height: 44px; display: inline-flex; align-items: center; }
  .art-editor .savebar input { min-height: 44px; box-sizing: border-box; }
  .savebar .btn { min-height: 44px; }
}
/* #47 (mock V v5, V2): the find. A KIND item's count, the scope line, and one list of every kind:
   each row is one link (its title's link covers the row), a comment's tag is its own colour. */
.segs .cnt { font: 11px var(--mono); opacity: .75; margin-left: 4px; }
.scope { margin: 0 0 8px; }
.list > li.sr-row { position: relative; padding: 10px 6px; border-radius: 6px; min-height: 44px; box-sizing: border-box; }
.sr-row:hover { background: var(--sunken); }
.sr-row .t::after { content: ""; position: absolute; inset: 0; }
.src.s-cm { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
@media (max-width: 720px) {
  /* The KIND seg scrolls sideways inside itself; a snippet keeps to two lines. */
  .segs.scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .seg:has(.segs.scroll) { flex-wrap: nowrap; max-width: 100%; }
  .sr-row .snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (pointer: coarse) {
  .segs.scroll a { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; }
  .list > li.sr-row { padding-block: 12px; }
}

/* #50 (mock V v5): Related, the side panel's fourth tab. Four tabs don't fit the 380px panel beside
   Widen, Reading and "?": the tabs take the row, the buttons sit on a thin row under them. Under
   1000px Widen and Reading are gone, and the tabs and "?" share one row as before. */
.art-tabsrow { flex-wrap: wrap; padding-bottom: 6px; }
.art-tabsrow .art-tabs { flex: 1 1 100%; }
@media (max-width: 1000px) { .art-tabsrow { padding-bottom: 0; } .art-tabsrow .cx-keys { margin-left: auto; } .art-tabs [role="tab"] { padding-inline: 6px; } }
/* "N related" right after the bar's words ("1 open · 7 related"); those words shrink first. */
.cx-bar .cx-says { flex: 1 1 20em; min-width: 0; display: flex; align-items: baseline; gap: 4px; }
.cx-bar .cx-says .cx-say { flex: 0 1 auto; }
.cx-bar .cx-rel { flex: none; white-space: nowrap; }
/* Each heading the live mono kicker with a count; each row one link (whole row opens), the live
   .src kind tag, status pill, "by" or "in its text", warning lines and Remove above the link. */
.rel-sec { margin: 0 0 14px; }
.rel-sec .lab { font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 6px; }
.rel-sec .lab .n { color: var(--faint); font-weight: 400; margin-left: 4px; }
.rel-list { list-style: none; margin: 0; padding: 0; }
.rel-row { position: relative; border-top: 1px solid var(--border); }
.rel-row:first-child { border-top: 0; }
.rel-a { display: flex; flex-direction: column; gap: 2px; min-height: 44px; box-sizing: border-box; padding: 8px 6px; margin: 0 -6px; color: var(--text); text-decoration: none; border-radius: 6px; }
.rel-a::after { content: ""; position: absolute; inset: 0; }
.rel-a:hover { background: var(--sunken); }
.rel-a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rel-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rel-t { font-weight: 600; min-width: 0; overflow-wrap: anywhere; flex: 1 1 auto; }
.rel-top .end { margin-left: auto; flex: none; }
.rel-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; }
.rel-warn, .rel-more { font-size: 12.5px; }
.rel-more { margin: 4px 0 0; }
.rel-all { margin: 4px 0 0; }
.rel-all a { display: inline-flex; align-items: center; min-height: 44px; }
.rel-empty { margin: 0 0 14px; }
.rel-rm { position: absolute; z-index: 1; right: 0; top: 30px; margin: 0; }
.rel-rm .linkbtn { font-size: 12.5px; padding: 0 2px; min-height: 24px; min-width: 24px; display: inline-flex; align-items: center; justify-content: center; }
.rel-row:has(.rel-rm) .rel-sub, .rel-row:has(.rel-rm) .rel-warn { padding-right: 64px; }
@media (pointer: coarse) { .rel-rm .linkbtn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; } .rel-sec .addlink > summary.btn { min-height: 44px; } }
/* #238 (Harmony H1): a Settings save's line is den-ui's save-state line (savestate.css), under the
   form's buttons; hub.js mounts it. Hub's own words about what a save does next (.ss-after) show
   beside the kit's Saved only. */
.set-ss { margin: 8px 0 0; min-height: 20px; }
.ss-after { display: none; margin: 2px 0 0; font-size: 13px; }
.set-ss[data-state="saved"] ~ .ss-after { display: block; }
/* The line belongs to its Save: whatever follows the form in its section (the next block's heading)
   keeps a section's gap below it, so the line never reads as that heading's caption (Hub Design 11-19). */
form[data-ss-form]:not(:last-child) { margin-bottom: 24px; }
