/* Alterra portal design system v6 (1 Dec 2026): the v3 site's material on the v4 class names (portal-lab/v3-portal,
   BRIEF.md and REFS.md). Plates (lit top edge, contact shadow, r22-26) hold content; wells (sunk, inner shadow) hold
   what you type into or scan; keys are pills that lift 1px and sink 1px; one orange key per view (.is-primary); rows
   lift like light keys on hover between 0.07 hairlines; menus are opaque porcelain plates. Tokens live in portal.css
   (--plate, --well, --key, --held, --lift, --menu, --tray, --kr-*, --ember). Inter only, sentence case, no mono caps,
   no ruled boxes, no gauges. Markup helpers live in src/views.ts next to teamHome (dsHead, dsStage, dsBtn, dsStat,
   dsCard, dsTile, dsChip, dsSegs, dsEmpty, dsSh). Linked after portal.css, so a ds- class wins over an older rule of
   the same weight. */

/* Page wrapper: blocks 16 apart, Inter, and the older global label styles (.mono, .tag, h2) in sentence case inside it,
   so shared fragments (forms, password box) read right on a ds page without being rewritten. */
.ds { display: grid; gap: 16px; font-family: var(--text); }
.ds > * { min-width: 0; }
.ds :is(b, strong) { font-family: var(--text); font-weight: 500; }
.ds .ic { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.75; }
.ds h2, .ds h3 { display: block; margin: 0; font: 500 17px/1.3 var(--text); letter-spacing: -.016em; text-transform: none; color: var(--ink); }
.ds :is(.mono, .tag) { font: 400 13.5px/1.45 var(--text); letter-spacing: 0; text-transform: none; color: var(--muted); }
.ds p { font-size: 15px; line-height: 1.5; }
.ds ul { font-size: 15px; }

/* Page header (v3 .v-head): the H1 at v3's section scale, Inter 400, -0.025em, a grey second clause in a <span>
   ("Files <span>for Northwind.</span>"); keys right on the baseline. Date line on homes only. */
.ds-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin: 4px 0 8px; }
.ds-date { margin: 0 0 12px; font: 400 14px/1.4 var(--text); color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-h1, .ds h1.ds-h1 { margin: 0; max-width: 24em; font: 400 clamp(30px, calc(1.9 * min(1vw, 14.4px)) + 13px, 42px)/1.08 var(--head); letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.ds-h1 > span { color: var(--muted); }
.ds-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Stage (homes, BRIEF §10): v3's black stage set into the porcelain, r28, the Relief dots lit inside it (relief.js),
   the date line, a white Inter 400 greeting with a grey clause, ghost keys and the one orange key. One per page. */
.ds-stage { position: relative; isolation: isolate; overflow: clip; display: grid; align-content: end; min-height: 340px; padding: clamp(28px, 3.6vw, 56px); border-radius: 28px; background: var(--stage); color: var(--on1);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .06), 0 0 0 1px rgb(11 12 14 / .2), 0 30px 60px -32px rgb(11 12 14 / .55); }
[data-theme="night"] .ds-stage { box-shadow: 0 0 0 1px rgb(255 255 255 / .08); }
.ds-stage canvas.relief.is-stage { z-index: -1; color: #fff; --relief-k: .95; --relief-size: 1.45; -webkit-mask-image: radial-gradient(75% 150% at 100% 60%, #000 12%, rgb(0 0 0 / .5) 42%, transparent 74%); mask-image: radial-gradient(75% 150% at 100% 60%, #000 12%, rgb(0 0 0 / .5) 42%, transparent 74%); }
.ds-stage-in { display: grid; justify-items: start; }
.ds-stage .ds-date { color: var(--on3); }
.ds-stage h1.ds-h1 { max-width: 15.4em; color: var(--on1); font-size: clamp(38px, min(calc(3.15 * min(1vw, 14.4px)) + 15px, calc(5.4 * min(1vw, 14.4px)) - 20px), 64px); line-height: 1.03; letter-spacing: -.026em; }
.ds-stage .ds-h1 > span { color: var(--on3); }
.ds-stage .ds-acts { margin-top: 30px; }
/* Ghost keys on the stage: smoked glass. */
.ds-stage .ds-btn:not(.is-primary) { background: linear-gradient(180deg, rgb(255 255 255 / .13), rgb(255 255 255 / .05)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--on1);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), inset 0 0 0 1px rgb(255 255 255 / .08), 0 4px 10px -4px rgb(0 0 0 / .8); }
.ds-stage .ds-btn:not(.is-primary):hover { background: linear-gradient(180deg, rgb(255 255 255 / .18), rgb(255 255 255 / .08)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .28), inset 0 0 0 1px rgb(255 255 255 / .1), 0 10px 18px -8px rgb(0 0 0 / .9); }
.ds-stage .ds-btn:not(.is-primary):active { box-shadow: inset 0 1px 2px rgb(0 0 0 / .6), inset 0 0 0 1px rgb(255 255 255 / .08); }
.ds-stage .ds-btn .ic { color: currentColor; }
.ds-stage .ds-btn.is-primary { box-shadow: inset 0 1px 0 rgb(255 196 170 / .42), inset 0 -1px 0 rgb(70 12 0 / .32), 0 0 0 1px #a52600, 0 6px 16px -6px rgb(0 0 0 / .8); }

/* Keys (v3): a 40px pill (34 in rows, 44 on phones), white gradient, lit edge; hover lifts 1px, press sinks 1px.
   .is-primary is the page's one orange key; .is-danger keeps the key with red words; older .btn inside a ds page match. */
.ds-btn, .ds .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; margin: 0; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--key); box-shadow: var(--key-sh); transform: none; color: var(--ink); font: 500 15px/1 var(--text); letter-spacing: -.01em; text-transform: none; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .18s var(--v-e), box-shadow .18s var(--v-e), background .18s var(--v-e); }
.ds-btn:hover, .ds .btn:hover { transform: translateY(-1px); background: var(--key); box-shadow: var(--key-up); }
.ds-btn:active, .ds .btn:active { transform: translateY(1px); box-shadow: var(--key-down); transition-duration: .06s; }
.ds-btn .ic { width: 16px; height: 16px; margin-left: -3px; color: currentColor; stroke-width: 1.9; }
.ds-btn.is-primary, .ds .btn.is-go { background: var(--ember) #c93003; color: #fff; text-shadow: 0 -1px 0 rgb(90 16 0 / .3); box-shadow: var(--ember-sh); }
.ds-btn.is-primary:hover, .ds .btn.is-go:hover { background: var(--ember-hi); box-shadow: var(--ember-up); }
.ds-btn.is-primary:active, .ds .btn.is-go:active { background: var(--ember-down); box-shadow: var(--ember-press); transform: translateY(1.5px); }
.ds-btn.is-primary .ic { color: #fff; }
.ds .btn.ghost { background: var(--key); box-shadow: var(--key-sh); color: var(--ink); }
.ds-btn.is-sm, .ds .btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.ds-btn.is-danger { color: #b42318; }
[data-theme="night"] .ds-btn.is-danger { color: #ff8b7e; }
.ds .link { border: 0; padding: 0; background: none; cursor: pointer; font: 400 14px/1.4 var(--text); letter-spacing: -.01em; text-transform: none; color: var(--body); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ds .link:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Results row (v3 hero stats): plain big numbers, a short line under each, no boxed cells, no gauges. The number comes
   first (order), a 7px orange LED marks a late one (.is-hot); cells are links when they go somewhere. */
.ds-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 28px; padding: 14px 6px 10px; }
.ds-stats.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-stat { display: grid; gap: 8px; align-content: start; color: var(--ink); }
.ds-stat > span { font: 400 14px/1.4 var(--text); color: var(--body); transition: color .18s var(--v-e); }
a.ds-stat:hover > span { color: var(--ink); }
.ds-stat > b { order: -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font: 400 clamp(28px, 1.4vw + 10px, 36px)/1 var(--head); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ds-stat > b > * { font-family: var(--text); letter-spacing: 0; } /* chips and pills beside the value */
.ds-stat.is-hot > span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--signal); vertical-align: 1px; }
.ds-pill { align-self: center; display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--well); box-shadow: var(--well-sh); font: 400 13px/1 var(--text); font-style: normal; letter-spacing: 0; color: var(--body); }

/* Layout: two columns (stacked on phones) and an auto-fit row of small plates. */
.ds-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ds-two.is-even { align-items: stretch; }
.ds-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }

/* Card = a v3 plate: lit top edge, 5.5% ring, contact shadow, r26; title 500 17 + an optional round arrow key; an
   optional sub line ("To do 12"). .is-slim is a one-line strip (coordinator, notices). */
.ds-card { min-width: 0; padding: 20px 22px 22px; border: 0; border-radius: 26px; background: var(--plate); box-shadow: var(--plate-sh); }
.ds-ch { display: flex; align-items: center; gap: 8px; min-height: 32px; margin-bottom: 8px; }
.ds-ch h2 { flex: 1; min-width: 0; }
.ds-ch .ds-n { margin-left: -2px; }
.ds-up { margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; margin-right: -6px; border-radius: 50%; color: var(--body); transition: background .18s var(--v-e), box-shadow .18s var(--v-e), transform .18s var(--v-e); }
.ds-up:hover { background: var(--key); box-shadow: var(--key-sh); color: var(--ink); transform: translateY(-1px); }
.ds-sub { margin: 0 0 8px; font: 400 14px/1.3 var(--text); color: var(--muted); }
.ds-sub span { margin-left: 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ds-card.is-slim { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 16px 22px; border-radius: 22px; }
.ds-card.is-slim > h2, .ds-card.is-slim > .ds-ch { flex: none; margin: 0; }
.ds-card.is-slim > p { flex: 1; min-width: 200px; margin: 0; color: var(--body); }
.ds-card.is-slim form { margin: 0; }
.ds-card > p:last-child, .ds-card > ul:last-child { margin-bottom: 0; }
.ds-card > ul { padding-left: 1.1em; }
.ds-card > ul li { margin: 0 0 6px; }

/* Rows (v3 .v-mi / .v-rows): no fill and no bars; a 0.07 hairline between rows; on hover a row lifts as a light key
   (white gradient, ring, short shadow) over its neighbours' lines. Title 500 15, note 13.5 grey; at the right one verb
   with an arrow, one chip or one small key. <ol class="ds-rows"> with <li class="ds-row"> or <a class="ds-row">. */
.ds-rows { list-style: none; padding: 0; margin: 0; display: grid; }
.ds-rows > li { margin: 0; }
.ds-row { position: relative; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: center; min-height: 60px; padding: 11px 14px; border-radius: 14px; background: none; color: var(--ink);
  transition: background .15s var(--v-e), box-shadow .15s var(--v-e); }
.ds-rows > li + li > .ds-row, .ds-rows > li + li > details > .ds-row, .ds-rows > .ds-row + .ds-row { box-shadow: inset 0 1px 0 var(--line); }
.ds-rows > li:hover + li > .ds-row, .ds-rows > li:hover + li > details > .ds-row, .ds-rows > .ds-row:hover + .ds-row { box-shadow: none; }
.ds-rows .ds-row:hover, a.ds-row:hover, .ds-rows > li > .ds-row:hover { background: var(--lift); box-shadow: var(--lift-sh); }
.ds-row.is-bar { padding-left: 14px; }
.ds-row.is-bar::before { content: none; } /* the old left bars are gone; urgency is the chip's LED */
.ds-rb { min-width: 0; display: grid; gap: 2px; }
.ds-rt { font: 500 15px/1.35 var(--text); letter-spacing: -.012em; color: var(--ink); }
a.ds-rt:hover { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ds-rs { margin: 0; font: 400 13.5px/1.4 var(--text); color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-rs > b { font-weight: 400; } /* a client's name in its colour (.ds-cN on the b) */
.ds-rr { display: flex; align-items: center; gap: 12px; }
.ds-rr form { margin: 0; }
.ds-rw { display: inline-flex; align-items: center; gap: 6px; font: 500 14.5px/1.4 var(--text); letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.ds-rw::after { content: "→"; transition: transform .2s var(--v-e); }
.ds-rw:hover::after, a.ds-row:hover .ds-rw::after, .ds-row:hover a.ds-rw::after { transform: translateX(3px); }
.ds-grp-n.ds-rw::after, .ds-rw.is-out::after { content: none; } /* "Show 4" opens in place; "Opens ↗" already points out */

/* Table / list on a page: rows split by 0.07 hairlines, a 13.5px grey sentence-case header; a row lifts on hover. */
.ds-table { display: grid; }
.ds-tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; min-height: 56px; padding: 10px 12px; margin: 0 -12px; border-top: 0; border-radius: 14px; box-shadow: inset 0 1px 0 var(--line); color: var(--ink);
  transition: background .15s var(--v-e), box-shadow .15s var(--v-e); }
.ds-table > .ds-tr:first-child { box-shadow: none; }
.ds-table.is-4 .ds-tr { grid-template-columns: minmax(0, 1fr) minmax(0, 160px) 96px 132px; }
a.ds-tr:hover { background: var(--lift); box-shadow: var(--lift-sh); }
a.ds-tr:hover + .ds-tr, .ds-tr:hover + .ds-tr { box-shadow: none; }
.ds-th { min-height: 36px; font: 400 13.5px/1.3 var(--text); color: var(--muted); }
.ds-th:hover { background: none !important; box-shadow: none !important; }
.ds-th + .ds-tr { box-shadow: inset 0 1px 0 var(--line); }
.ds-tr > * { min-width: 0; }
.ds-td { font: 400 13.5px/1.4 var(--text); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ds-td.is-end { text-align: right; justify-self: end; }
.ds-tr form { margin: 0; }

/* Chip (v3 tag): sunk, 26px pill in a well, 13px grey. .is-urg: ink words and a 7px orange LED (overdue, due within a
   day, blocked); .is-done: grey with a check, no well; .is-int: team-only, a dashed edge (never orange). Keep data-help. */
.ds-chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--well); box-shadow: var(--well-sh); font: 400 13px/1 var(--text); font-style: normal; letter-spacing: 0; text-transform: none; color: var(--body); white-space: nowrap; vertical-align: 1px; }
.ds-chip.is-urg { color: var(--ink); }
.ds-chip.is-urg::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.ds-chip.is-done { background: none; box-shadow: none; padding: 0; color: var(--muted); }
.ds-chip.is-done::before { content: "✓"; font-size: 12px; }
.ds-chip.is-int { background: none; box-shadow: none; border: 1px dashed color-mix(in srgb, var(--ink) 22%, transparent); color: var(--muted); }
.ds-rt .ds-chip, .ds-tr .ds-chip.is-int { margin-left: 8px; }

/* Fields are v3 wells: 44px, r12, an inner shadow from the top light, 15px ink; labels 500 14 grey above, sentence
   case. Focus: a 2px ink outline 3px out (never orange). Applies to <label>Text<input></label> in .ds-form and to the
   older .reply forms inside a ds page. */
.ds-form, .ds form.reply { display: grid; gap: 16px; max-width: none; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.ds-form label, .ds form.reply label { display: grid; gap: 8px; font: 500 14px/1.3 var(--text); letter-spacing: -.01em; text-transform: none; color: var(--body); }
.ds :is(input:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=range], [type=color]), select, textarea) { width: 100%; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--field); box-shadow: var(--field-sh); color: var(--ink); font: 400 15px/1.4 var(--text); letter-spacing: -.011em; transition: box-shadow .18s var(--v-e); }
.ds textarea:not([hidden]) { min-height: 104px; padding: 12px 14px; resize: vertical; } /* :not() lifts it over the 44px :is() rule above */
.ds :is(input:not([type=checkbox], [type=radio], [type=file], [type=range], [type=color]), select, textarea):hover { box-shadow: var(--field-hi); }
.ds :is(input, select, textarea):focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: var(--field-hi); }
.ds :is(input, textarea)::placeholder { color: var(--muted); }
.ds select { appearance: none; padding-right: 38px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238e9096' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 15px center / 10px 6px, var(--field); }
.ds-pair, .ds form .pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.ds fieldset { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.ds legend { margin-bottom: 8px; padding: 0; font: 500 14px/1.3 var(--text); letter-spacing: -.01em; text-transform: none; color: var(--body); }
.ds label.chk { display: flex; align-items: flex-start; gap: 10px; font: 400 15px/1.4 var(--text); color: var(--ink); cursor: pointer; }
.ds label.chk input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ink); }
@media (max-width: 640px) { .ds label.chk { min-height: 40px; align-items: center; } .ds label.chk:has(small) { align-items: flex-start; } } /* the whole line is the 40px target */
.ds label.chk small { display: block; font-size: 13.5px; color: var(--muted); }
.ds fieldset:has(> label.chk:nth-of-type(6)) { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); column-gap: 20px; } /* a long checklist (a contractor's clients) in columns */
.ds-form .ds-btn, .ds form.reply > .btn { justify-self: start; }
.ds :is(.form-ok, .form-err) { margin: 0; padding: 14px 20px; border: 0; border-radius: 18px; background: var(--plate); box-shadow: var(--plate-sh); font-size: 15px; color: var(--ink); }
.ds .form-err { color: var(--ink); }
.ds .form-err::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 10px; border-radius: 50%; background: var(--signal); vertical-align: 1px; }
.ds form.reply > b { font: 500 15px/1.4 var(--text); color: var(--ink); }
.ds form.reply > b + :is(p, .mono) { margin-top: -10px; }

/* Segmented control (v3 .v-seg): a raised tray, 4px in; the chosen one is the raised knob (white, ringed, short
   shadow). Filters, All / Email, the New item types. */
.ds-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 0; border-radius: 999px; background: var(--tray); box-shadow: var(--tray-sh); max-width: 100%; }
.ds-seg a, .ds-seg button { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: none; font: 500 14px/1 var(--text); letter-spacing: -.01em; color: var(--body); white-space: nowrap; cursor: pointer;
  transition: background .18s var(--v-e), box-shadow .18s var(--v-e), color .18s var(--v-e); }
.ds-seg a:hover, .ds-seg button:hover { color: var(--ink); }
.ds-seg .on, .ds-seg [aria-current] { background: var(--held); box-shadow: 0 0 0 .5px rgb(11 12 14 / .2), var(--held-sh); color: var(--ink); }

/* Date tile + dated row (Coming up): grey group heads, a 44px tile sunk in a well (day number, weekday in sentence
   case), title and line, the kind at the right; the row lifts. */
.ds-g { margin: 10px 0 2px; font: 500 13.5px/1.3 var(--text); letter-spacing: -.005em; color: var(--muted); }
.ds-ch + .ds-g { margin-top: 12px; }
.ds-cu { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 64px; padding: 10px; margin: 0 -10px; border-radius: 14px; color: var(--ink); transition: background .15s var(--v-e), box-shadow .15s var(--v-e); }
a.ds-cu:hover { background: var(--lift); box-shadow: var(--lift-sh); }
.ds-g + .ds-cu { margin-top: 0; }
.ds-tile { display: grid; justify-items: center; align-content: center; gap: 3px; width: 44px; height: 44px; border: 0; border-radius: 13px; background: var(--well); box-shadow: var(--well-sh); }
.ds-tile b { font: 500 15px/1 var(--ui); font-variant-numeric: tabular-nums; }
.ds-tile span { font: 400 11px/1 var(--text); letter-spacing: 0; text-transform: none; color: var(--muted); }
.ds-cu-b { min-width: 0; display: grid; }
.ds-cu-b > :first-child { font: 500 15px/1.35 var(--text); letter-spacing: -.012em; color: var(--ink); }
.ds-cu-b > span { font: 400 13.5px/1.4 var(--text); color: var(--muted); }
.ds-cu-b > a:hover { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ds-cu-k { display: flex; align-items: center; gap: 8px; font: 400 13.5px/1 var(--text); color: var(--muted); white-space: nowrap; }

/* Section heading over a grid ("Clients 16"): v3's h2 at a smaller step + a grey count. */
.ds-sh { display: flex; align-items: baseline; gap: 10px; margin: 24px 4px 0; }
.ds-sh h2 { font: 400 clamp(24px, 1vw + 14px, 30px)/1.1 var(--head); letter-spacing: -.025em; }
.ds-n { font: 400 15px/1 var(--text); font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Entity row (clients, projects): a plate row, r22, the 44px tile, name + kind, the stage at the right, quiet
   segments under the name; lifts 1px on hover. Two to a row in .ds-ents (one alone fills it). */
.ds-ents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ds-ents > :only-child { grid-column: 1 / -1; }
.ds-ent { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 18px; row-gap: 10px; align-content: center; min-height: 84px; padding: 14px 20px 14px 14px; border: 0; border-radius: 22px; background: var(--plate); box-shadow: var(--plate-sh); color: var(--ink);
  transition: transform .2s var(--v-e), box-shadow .2s var(--v-e); }
a.ds-ent:hover { transform: translateY(-1px); box-shadow: var(--plate-up); }
.ds-ent-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-ent-n b { margin-right: 10px; font: 500 16px/1.3 var(--text); letter-spacing: -.012em; }
.ds-ent-n span { font: 400 14px/1.3 var(--text); color: var(--muted); }
.ds-ent-st { display: flex; align-items: center; gap: 10px; font: 400 14px/1.3 var(--text); color: var(--body); text-align: right; white-space: nowrap; }
.ds-ent > .ds-mono { grid-row: 1 / span 2; align-self: center; }
.ds-ent > .ds-segs { grid-column: 2 / -1; }

/* Monogram tile (a raised key in the client's tint) and the quiet segment track: done segments in ink (or the
   client's text colour), the current one at 40%, later ones grey. */
.ds-mono { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border-radius: 13px; background: var(--cl, var(--ink)); color: var(--cl-ink, var(--bg)); box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 0 0 1px rgb(11 12 14 / .08), 0 1px 2px rgb(11 12 14 / .2); font: 500 17px/1 var(--ui); }
.ds-mono.is-sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
/* .ds-segs: the milestone hairlines, styled with .hm-seg in portal.css (run 2). */

/* Client tints: the rail's ten tile fills (--cl, --cl-ink; every letter-on-fill pair at 4.5:1 or more since run D) and a text colour of the same hue that reads at 4.5:1 on a
   card or row in each theme (--cl-text), for a client's name under a row and its segments. Picked by tint(id). */
.ds-c0 { --cl: #c8f055; --cl-ink: #10200a; --cl-text: #4d6f0e; } .ds-c1 { --cl: #f4f2ec; --cl-ink: #0f4a44; --cl-text: #2f6b63; }
.ds-c2 { --cl: #ff5ca8; --cl-ink: #2b0616; --cl-text: #c2286f; } .ds-c3 { --cl: #f2d64b; --cl-ink: #17150a; --cl-text: #7a6600; }
.ds-c4 { --cl: #ff5a1f; --cl-ink: #2a0b00; --cl-text: #b8380a; } .ds-c5 { --cl: #ece4d4; --cl-ink: #a82c15; --cl-text: #b0321b; }
.ds-c6 { --cl: #3ddc6a; --cl-ink: #0b2614; --cl-text: #1d7a3c; } .ds-c7 { --cl: #2d5bff; --cl-ink: #fff; --cl-text: #2a4fd6; }
.ds-c8 { --cl: #0e3b36; --cl-ink: #c8f055; --cl-text: #0e5a50; } .ds-c9 { --cl: #fff; --cl-ink: #111; --cl-text: #4a4a4a; }
[data-theme="night"] .ds-c0 { --cl-text: #b5d94c; } [data-theme="night"] .ds-c1 { --cl-text: #6f9a92; }
[data-theme="night"] .ds-c2 { --cl-text: #ff7ab8; } [data-theme="night"] .ds-c3 { --cl-text: #e6c844; }
[data-theme="night"] .ds-c4 { --cl-text: #ff7a4a; } [data-theme="night"] .ds-c5 { --cl-text: #e8735c; }
[data-theme="night"] .ds-c6 { --cl-text: #5fd884; } [data-theme="night"] .ds-c7 { --cl-text: #8aa2ff; }
[data-theme="night"] .ds-c8 { --cl-text: #6fb3a2; } [data-theme="night"] .ds-c9 { --cl-text: #c8c8c8; }
:is(b, span, a).ds-c0, :is(b, span, a).ds-c1, :is(b, span, a).ds-c2, :is(b, span, a).ds-c3, :is(b, span, a).ds-c4,
:is(b, span, a).ds-c5, :is(b, span, a).ds-c6, :is(b, span, a).ds-c7, :is(b, span, a).ds-c8, :is(b, span, a).ds-c9 { color: var(--cl-text); }
:is(.ds-ent, .ds-row, .ds-cu)[class*="ds-c"] { color: var(--ink); } /* on a row the tint only colours its tile and segments */

/* Empty state: one sentence inside the plate it belongs to (v3: a grey line; no illustrations, no "00" readouts). */
.ds-empty { margin: 0; padding: 4px 0 6px; font: 400 15px/1.5 var(--text); color: var(--muted); text-wrap: pretty; }

/* Label / value facts (the detail page's right column): 12 muted label, 13 value, hairlines between. */
.ds-facts { display: grid; margin: 0; }
.ds-facts > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 11px 0; box-shadow: inset 0 1px 0 var(--line); }
.ds-facts > div:first-child { box-shadow: none; padding-top: 0; }
.ds-facts dt { font: 400 14px/1.4 var(--text); color: var(--muted); }
.ds-facts dd { margin: 0; font: 400 15px/1.4 var(--text); color: var(--ink); min-width: 0; }

/* Detail page: the main column and a 300px right column on desktop, stacked on phones. */
.ds-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.ds-detail > * { min-width: 0; display: grid; gap: 16px; }

/* Chat bubbles (Messages, Ada): theirs --cell, mine --on, radius 12, 13px. */
.ds-bubble { max-width: 75%; padding: 10px 14px; border-radius: 18px; background: var(--well); box-shadow: var(--well-sh); font: 400 15px/1.45 var(--text); color: var(--ink); }
.ds-bubble.is-mine { justify-self: end; background: var(--held); box-shadow: var(--held-sh); }

/* An email or message shown as it will be sent (the coordinator's exact emails). */
.ds-mail { display: grid; gap: 6px; padding: 16px 18px; border-radius: 18px; background: var(--well); box-shadow: var(--well-sh); }
.ds-mail > span { font: 400 13.5px/1.3 var(--text); color: var(--muted); }
.ds-mail > b { font: 500 15px/1.4 var(--text); }
.ds-mail > p { margin: 0; white-space: pre-line; color: var(--body); }

/* ---- Added in run B (the client's project and item pages). ---- */

/* Header with a status chip beside the H1 (detail pages): the chips sit on the H1's centre line. */
.ds-head-t { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

/* Page bar trail (c.crumbs in views.ts): every step but the last is a link in the bar's own colours. */
.pagebar a { color: inherit; text-decoration: none; }
.pagebar a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.pagebar a:focus-visible { outline: 2px solid color-mix(in srgb, var(--ink) 35%, transparent); outline-offset: 2px; border-radius: 3px; }

/* Text blocks inside a card: Markdown bodies (.ds-prose), plain lists, numbered steps, a stack of blocks 12 apart.
   Headings inside Markdown read as card group labels (13/500), never as page headings. */
.ds-prose { font: 400 15px/1.55 var(--text); color: var(--body); }
.ds-prose :is(p, ul, ol) { margin: 0 0 10px; font-size: 15px; }
.ds-prose > :last-child { margin-bottom: 0; }
.ds-prose :is(h1, h2, h3, h4) { margin: 16px 0 6px; font: 500 15px/1.4 var(--text); letter-spacing: -.012em; color: var(--ink); }
.ds-prose :is(ul, ol), .ds-list, .ds-steps { padding-left: 1.2em; }
.ds-prose li, .ds-list li, .ds-steps li { margin: 0 0 4px; }
.ds-prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ds-list, .ds-steps { margin: 0; font: 400 15px/1.5 var(--text); color: var(--body); }
.ds-stack, .ds-panel { display: grid; gap: 12px; align-content: start; }
.ds-card.ds-stack { gap: 12px; }
.ds-scroll { max-height: 480px; overflow: auto; margin-top: 4px; }
.ds-warn { color: var(--signal-ink); }
.ds-hint { padding: 0 2px; }
.ds-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ds-link:hover { text-decoration-color: currentColor; }
.ds-facts dd .ds-rs { display: block; }
.ds .st-why { margin: 0; font-size: 14px; line-height: 1.5; color: var(--body); }
.ds-card.is-slim > .st-why { flex: 1; }

/* A boxed block inside a card (receipt, price, what approving means, an earlier version, passkey, devices): v3's
   readout, a sunk window lit from the top (run 2: lighter than the well); grey label, 15/500 line, grey line. .ds-big
   is a price in display type. */
.ds-box { display: grid; gap: 6px; margin: 0; padding: 18px 20px; border-radius: 20px; background: var(--readout); box-shadow: var(--readout-sh); }
.ds-box > span { font: 400 13.5px/1.3 var(--text); color: var(--muted); }
.ds-box > b { font: 500 15px/1.4 var(--text); color: var(--ink); }
.ds-box > b.ds-big { font: 400 clamp(32px, 1.4vw + 14px, 40px)/1.05 var(--text); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ds-box .ds-acts { margin-top: 6px; }
.ds-box > p { margin: 0; color: var(--body); }

/* Disclosure (Earlier versions, History, Transcript): a quiet 13px line with a chevron. .is-title makes the summary
   the card's title row (Team tools, Pass to a colleague), the chevron at the right. */
.ds-more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; list-style: none; font: 500 14px/1.3 var(--text); color: var(--body); }
.ds-more > summary::-webkit-details-marker { display: none; }
.ds-more > summary::before { content: ""; width: 5px; height: 5px; margin: 0 1px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .12s var(--e-std); }
.ds-more[open] > summary::before { transform: rotate(45deg); margin-bottom: 4px; }
.ds-more > summary:hover, .ds-more[open] > summary { color: var(--ink); }
.ds-more[open] > summary { margin-bottom: 10px; }
.ds-more > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.ds-more.is-title { display: block; }
.ds-more.is-title > summary { display: flex; min-height: 22px; color: var(--ink); }
.ds-more.is-title > summary::before { order: 2; margin-left: auto; color: var(--muted); }
.ds-more.is-title[open] > summary { margin-bottom: 8px; }

/* Media inside a card: page pictures, previews, video and embeds sit on a radius-8 frame with the card line. */
/* v3: pictures sit in wells (6px in, r20 outside, r14 inside). */
.ds .fp-img, .ds .fp-pdf, .ds .video, .ds .design-embed { margin: 0; padding: 6px; border: 0; border-radius: 20px; background: var(--well); box-shadow: var(--well-sh); overflow: hidden; }
.ds .fp-img img, .ds .fp-pdf > *, .ds .design-embed iframe { border-radius: 14px; }
.ds .fp-img img { background: #f7f7f8; } /* a picture may be transparent: it sits on paper, so a black logo reads at night too */
.ds .video { padding: 0; }
.ds .fp-img img { max-height: 520px; }
.ds .video { display: block; background: #000; }
.ds .pinboard { margin: 0; padding: 6px; border: 0; border-radius: 20px; background: var(--well); box-shadow: var(--well-sh); }
.ds .pinboard img { border-radius: 14px; }
.ds .pin-form .btns { gap: 8px; align-items: center; }

/* Pinned notes under a page picture: list rows with the pin's number in the same orange disc as on the picture. */
.ds-row.ds-pinrow { grid-template-columns: 20px minmax(0, 1fr) auto; align-items: start; gap: 2px 12px; padding-top: 10px; padding-bottom: 10px; }
.ds-pin-n { display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50% 50% 50% 0; background: var(--ink); color: var(--bg); font: 600 11px/1 var(--text); font-variant-numeric: tabular-nums; }
.ds-pinrow.is-done { opacity: .6; }
.ds-pinrow.is-done .ds-pin-n { background: var(--muted); }
.ds-pinrow .ds-prose { color: var(--ink); }

/* Upload row (input items): the button and its status line, which upload.js rewrites ([data-note]). */
.ds-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }

/* Messages on an item page (run 2): the conversation's bubbles. Each message a raised white bubble (r18, its corner
   tucked); internal notes and drafts an ink ring with no fill (the internal layer, never orange). */
.ds-ask .msgs { max-width: none; gap: 10px; }
.ds-ask .msg { padding: 12px 16px 13px; border: 0; border-radius: 18px 18px 18px 6px; background: var(--bub); box-shadow: var(--bub-sh); font-size: 15px; }
.ds-ask .msg::before { content: none; }
.ds-ask .msg p { font-size: 15px; color: var(--ink); }
.ds-ask .msg.internal, .ds-ask .msg.draft { background: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 26%, transparent); }
.ds-ask .msg .mono { margin-bottom: 4px; font-size: 13px; }
.ds-ask form.ask, .ds-ask .ds-form { margin-top: 4px; }

/* Board (website pages): a grid of page cards, thumbnail 16:10 radius 8, title + one chip, the path under it.
   The next page for the client leads in .ds-next: a big thumbnail beside what to do and the one primary button. */
.ds-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ds-pg { display: grid; gap: 12px; align-content: start; padding: 8px 8px 16px; border: 0; border-radius: 24px; background: var(--plate); box-shadow: var(--plate-sh); color: var(--ink); transition: transform .2s var(--v-e), box-shadow .2s var(--v-e); }
a.ds-pg:hover { transform: translateY(-2px); box-shadow: var(--plate-up); }
a.ds-pg:hover .ds-rt { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ds-thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 17px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line), var(--well-sh); }
.ds-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ds-pg-b { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 0 8px; }
.ds-pg-b > .ds-rs { grid-column: 1 / -1; }
.ds-next { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 8px 24px 8px 8px; }
.ds-next-b { display: grid; gap: 4px; justify-items: start; }
.ds-next-b > .ds-ch { width: 100%; margin-bottom: 10px; }
.ds-next-t { font: 400 clamp(22px, 1vw + 12px, 28px)/1.15 var(--text); letter-spacing: -.02em; color: var(--ink); }
.ds-next-b > p { margin: 12px 0 16px; color: var(--body); max-width: 46ch; }

/* The one-page summary and the handover print as documents: no chrome, cards keep their lines, columns stay. */
.ds-sum-foot { margin-top: 8px; }
.ds-total { margin: 10px 0 0; text-align: right; color: var(--ink); }
@media print {
  .ds { gap: 10px; }
  .ds-card, .ds-stats, .ds-box { break-inside: avoid; box-shadow: none; }
  .ds-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-detail { grid-template-columns: minmax(0, 1fr) 220px; }
  .ds-stats.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ds-stats.is-3 > .ds-stat + .ds-stat { border: 0; }
  .nav, .pagebar, .help-fab, .rail, .tabbar, .top { display: none !important; }
  .ds-card, .ds-ent, .ds-pg { box-shadow: inset 0 0 0 1px #ddd; }
  .ds-stage { background: #fff; color: #000; box-shadow: inset 0 0 0 1px #ddd; } .ds-stage canvas { display: none; } .ds-stage .ds-h1 { color: #000; }
  :root { --pill: #ececea; --pill-ink: #333; --cell: #f6f6f4; }
}

@media (max-width: 999px) {
  .ds-two, .ds-ents, .ds-detail { grid-template-columns: minmax(0, 1fr); }
  .ds-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-stats.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ds { gap: 12px; }
  .ds-acts { width: 100%; }
  .ds-acts > .ds-btn { flex: 1 1 auto; }
  .ds-btn, .ds .btn { height: 44px; padding: 0 18px; font-size: 15px; } /* v3's phone keys */
  .ds-btn.is-sm, .ds .btn.sm { height: 40px; padding: 0 14px; font-size: 14px; }
  .ds-seg a, .ds-seg button { height: 40px; }
  a.ds-rw { padding: 12px 0; margin: -12px 0; } /* the hit area grows, the look does not */
  .ds-up { width: 40px; height: 40px; margin: -4px -8px -4px auto; }
  .ds .link { padding: 10px 0; }
  .ds-stats { gap: 22px 20px; padding: 6px 4px; }
  .ds-stats.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-card { padding: 16px 14px; border-radius: 22px; }
  .ds-row { grid-template-columns: minmax(0, 1fr); padding: 12px 10px; }
  .ds-row.is-bar { padding-left: 10px; }
  .ds-row > .ds-rr { justify-content: space-between; margin-top: 8px; } /* the chip left, the verb right, under the words */
  .ds-tr, .ds-table.is-4 .ds-tr { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px; }
  .ds-tr > :first-child { grid-column: 1 / -1; }
  .ds-table.is-4 .ds-tr { grid-template-columns: minmax(0, 1fr) auto auto; }
  .ds-th { display: none; }
  .ds-th + .ds-tr { border-top: 0; }
  .ds-ent { padding: 14px; column-gap: 14px; grid-template-columns: 44px minmax(0, 1fr); }
  .ds-ent-st { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; text-align: left; font-size: 12px; color: var(--muted); }
  .ds-ent > .ds-segs { grid-row: 3; }
  .ds-ent > .ds-mono { grid-row: 1 / span 3; align-self: start; }
  .ds :is(input:not([type=checkbox], [type=radio], [type=file], [type=hidden]), select) { min-height: 46px; font-size: 16px; }
  .ds textarea { font-size: 16px; }
  .ds-card.is-slim { display: grid; justify-items: start; padding: 16px; }
  .ds-bubble { max-width: 88%; }
  .ds-next { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 7px 7px 14px; }
  .ds-next-b { padding: 0 6px; }
  .ds-next-b > .ds-btn { width: 100%; }
  .ds-board { grid-template-columns: minmax(0, 1fr); }
  .ds-more > summary, .ds-more.is-title > summary { min-height: 40px; }
  .ds-more.is-title > summary { margin: -9px 0; }
  .ds-more.is-title[open] > summary { margin-bottom: -1px; }
  .ds-row.ds-pinrow { grid-template-columns: 20px minmax(0, 1fr); }
  .ds-row.ds-pinrow > form { grid-column: 2; }
}

/* ---- Added in run C (the client's remaining pages, sign-in, Messages). ---- */

/* Detail page with an action card in the right column (review, sign-off): the column sticks under the page bar while
   the page picture scrolls (Fix 0). On stacked layouts the action card moves above the picture, and on phones its
   buttons (.ds-revbar) are fixed above the tab bar. */
.ds-how { margin: 0; font: 400 13px/1.5 var(--text); color: var(--ink); }
.ds-rev .ds-form { gap: 10px; }
.ds-rev textarea:not([hidden]) { min-height: 72px; }
.ds-rev .ds-revbar { margin: 2px 0 0; }
@media (min-width: 1000px) {
  .ds-detail.is-side > :last-child { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
@media (max-width: 999px) {
  .ds-detail.is-side { display: flex; flex-direction: column; }
  .ds-detail.is-side > :last-child { display: contents; }
  .ds-detail.is-side .ds-rev { order: -1; }
  .ds-detail.is-side > :last-child > :not(.ds-rev) { order: 1; }
}
@media (max-width: 860px) {
  .ds-rev .ds-revbar { position: fixed; z-index: 19; left: var(--dock-gap); right: var(--dock-gap); bottom: calc(var(--dock-top) + 8px); display: flex; gap: 8px; margin: 0; padding: 8px; border-radius: 18px; } /* the dock's glass (portal.css), floating just above it */
  .ds-rev .ds-revbar { width: auto; } /* .ds-acts is 100% wide on phones; fixed between 12px gutters it must not be */
  .ds-rev .ds-revbar > .ds-btn { height: 40px; border-radius: 12px; }
  .ds-rev .ds-revbar > .ds-btn { flex: 1 1 0; min-width: 0; }
  body:has(.ds-revbar) { padding-bottom: calc(var(--dock-top) + 76px); }
}

/* Hidden means hidden, even on a flex or grid component (install strip, passkey button, push box, pass tick). */
.ds [hidden] { display: none !important; }

/* Legend tables (How this works): the label column, then what it means. */
.ds-table.is-legend .ds-tr { grid-template-columns: 200px minmax(0, 1fr); }
.ds-table.is-legend .ds-rs { white-space: normal; }

/* Activity log: day labels inside the table, rows under them without a line. */
.ds-act > .ds-g { margin: 16px 0 4px; }
.ds-act > .ds-g:first-child { margin-top: 0; }
.ds-act > .ds-g + .ds-tr { border-top: 0; }
.ds-act .ds-rt b { font-weight: 500; }

/* A person: avatar beside the name (People, Settings). */
.ds-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ds-person .av { width: 28px; height: 28px; flex: none; border-radius: 50%; font: 500 11px/1 var(--text); }
.ds-person.is-lg { gap: 16px; }
.ds-person.is-lg .av { width: 48px; height: 48px; font-size: 15px; }
.ds-person .ds-acts { margin: 0; }

/* A one-line form: the field and its button side by side (Your name). */
.ds-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.ds-inline > label { flex: 1 1 240px; }
.ds-inline > .ds-btn { height: 32px; }
.ds-pw-note { margin: -8px 0 0; }
.ds-settings .set-nav { justify-self: start; }
.ds-settings .ds-card { scroll-margin-top: 80px; }

/* Billing: the amount column lines up across tables. */
.ds-bill .ds-tr { grid-template-columns: minmax(0, 1fr) 96px 150px; }
.ds-amt { text-align: right; color: var(--ink); font-size: 13px; }
.ds-bill .ds-rr { justify-content: flex-end; }

/* Search: one field and its button. */
.ds-search { display: flex; gap: 8px; margin: 0; max-width: 640px; }
.ds-search input { flex: 1; }
.ds-search .ds-btn { height: 32px; }
.ds .snip mark { padding: 0 1px; border-radius: 2px; background: var(--pill); color: var(--ink); }

/* A narrow form card (New message). */
.ds-narrow { max-width: 640px; }

/* Sign-offs list: what you are approving beside the answer. */
.ds-so { margin-top: 4px; gap: 24px; }

/* Get the app: the QR code on a white tile so phones can read it in either theme. */
.ds-getapp .ds-qr { width: 196px; padding: 12px; margin: 4px 0 12px; border-radius: 8px; background: #fff; }
.ds-getapp .ds-qr svg { display: block; width: 100%; height: auto; }
.ds-getapp .ds-steps li { margin-bottom: 8px; }
.ds-getapp .ds-steps .ic { width: 14px; height: 14px; vertical-align: -2px; }
.ds-getapp form.inline { display: inline; }
.ds-appicon img { border-radius: 8px; }
html[data-os="ios"] .ds-getapp [data-os="android"], html[data-os="ios"] .ds-getapp [data-os="desktop"],
html[data-os="android"] .ds-getapp [data-os="ios"], html[data-os="android"] .ds-getapp [data-os="desktop"],
html[data-os="ios"] .getapp-qr, html[data-os="android"] .getapp-qr { display: none; }
.cal-link .cal-url { font-size: 12px; color: var(--body); }

/* Meetings: the booking card (book.js fills the day strip and the times) as v3's booking device. Days and times are
   dished keys standing on a 3px skirt; the chosen one sinks onto it and lights a 5px ink LED (run 2). */
.ds .book { position: static; display: block; margin: 0; padding: 20px 22px 22px; border: 0; border-radius: 26px; background: var(--plate); box-shadow: var(--plate-sh); }
.ds .book .ds-ch .av { width: 36px; height: 36px; border: 0; border-radius: 12px; box-shadow: 0 0 0 1px rgb(11 12 14 / .08), 0 6px 12px -8px rgb(11 12 14 / .5); filter: none; }
.ds .book .days { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 14px -6px 0; padding: 4px 6px 10px; }
.ds .book :is(.days, .times) button { position: relative; border: 0; border-radius: 12px; background: var(--dish); box-shadow: var(--dish-sh); color: var(--ink); cursor: pointer; transition: transform .16s var(--v-e), box-shadow .16s var(--v-e); }
.ds .book :is(.days, .times) button:hover { transform: translateY(-1px); }
.ds .book :is(.days, .times) button:active, .ds .book :is(.days, .times) button.on { transform: translateY(2px); box-shadow: var(--dish-on-sh); transition-duration: .06s; }
.ds .book :is(.days, .times) button.on::after { content: ""; position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.ds .book .days button { flex: none; display: grid; gap: 4px; justify-items: center; align-content: center; min-width: 68px; min-height: 60px; padding: 8px 10px; }
.ds .book .days button span { font: 400 12.5px/1 var(--text); color: var(--muted); }
.ds .book .days button b { font: 500 15px/1.2 var(--text); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ds .book .times { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ds .book .times:empty { display: none; }
.ds .book .times button { height: 42px; padding: 0 16px; font: 500 14.5px/1 var(--text); font-variant-numeric: tabular-nums; }
.ds .book .pick { max-width: 520px; margin-top: 14px; gap: 10px; }
.ds .book .pick .ds-btn { justify-self: start; }
.ds .book .pick a { color: var(--ink); text-decoration: underline; }
.ds .hm-ada .ada { margin: 0; }

/* Files (run 2): each folder is a plate; its head is a 44px row (folder in a small well, the name 500 16, the count
   grey, the ··· key); files are v3 cards: the picture in a well (6px in, r16), the name and one grey line under it,
   lifting 2px as a plate on hover. The ··· keys are round white keys. Dragging lights the drop target with an ink
   ring (never orange). The menus and the drag states keep files.js's classes. */
.ds-files .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 12px; padding: 0; }
.ds-files .folder { margin: 0; padding: 14px 16px 18px; border: 0; border-radius: 26px; background: var(--plate); box-shadow: var(--plate-sh); transition: box-shadow .18s var(--v-e); }
.ds-files .folder.over, .ds-files .gallery.loose.over { outline: 0; border: 0; background: var(--plate); box-shadow: 0 0 0 2px var(--ink), var(--plate-up); }
.ds-files .folder > .gallery { padding-top: 0; }
.ds-files .is-loose:not(.empty) > .ds-empty { display: none; }
.ds-files .is-loose.empty > .gallery { min-height: 0; }
.is-dragging .ds-files .is-loose.empty > .gallery { min-height: 72px; border: 0; border-radius: 18px; background: var(--readout); box-shadow: var(--readout-sh); }
.ds-files .folder-h { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0 0 12px; }
.ds-files .folder.empty .folder-h { margin-bottom: 0; }
.ds-files .folder-h .ic { box-sizing: content-box; width: 18px; height: 18px; padding: 8px; border-radius: 12px; background: var(--well); box-shadow: var(--well-sh); color: var(--body); }
.ds-files .folder-h b { font: 500 16px/1.3 var(--text); letter-spacing: -.012em; color: var(--ink); }
.ds-files .folder-h [data-count] { font-size: 15px; color: var(--muted); }
.ds-files .fwrap { border-radius: 20px; }
.ds-files .fcard { display: grid; gap: 10px; align-content: start; padding: 6px 6px 12px; border: 0; border-radius: 20px; background: none; color: var(--ink); transform: none; transition: transform .2s var(--v-e), background .2s var(--v-e), box-shadow .2s var(--v-e); }
.ds-files .fcard:hover { transform: translateY(-2px); background: var(--lift); box-shadow: var(--lift-sh); }
.ds-files .fthumb { aspect-ratio: 16 / 10; border: 0; border-radius: 15px; background: var(--well); box-shadow: var(--well-sh); overflow: hidden; }
.ds-files .fthumb.alpha:has(> img) { background: #f7f7f8; }
.ds-files .fthumb img { padding: 10px; }
.ds-files .fext { font: 500 13px/1 var(--text); letter-spacing: 0; color: var(--muted); }
.ds-files .fmeta { padding: 0 6px; gap: 2px; }
.ds-files .fmeta b { font: 500 14.5px/1.35 var(--text); letter-spacing: -.01em; }
.ds-files .fsub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 13px/1.4 var(--text); color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-files .fmenu > summary { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--key); box-shadow: var(--key-sh); font: 600 13px/1 var(--text); letter-spacing: 1px; color: var(--body); transition: transform .18s var(--v-e), box-shadow .18s var(--v-e); }
.ds-files .fmenu > summary:hover, .ds-files .fmenu[open] > summary { transform: translateY(-1px); box-shadow: var(--key-up); color: var(--ink); border: 0; }
.ds-files .fwrap > .fmenu > summary { top: 12px; right: 12px; }
.ds-files .fmenu-p { padding: 8px; background: var(--menu); border: 0; border-radius: 22px; box-shadow: var(--menu-sh); }
.ds-files .fmenu-l { padding: 8px 12px 4px; font: 500 13px/1.3 var(--text); color: var(--muted); }
.ds-files .fmenu-p .fmove button, .ds-files .fmenu-p .fdel button { min-height: 40px; padding: 9px 12px; border-radius: 12px; font: 500 15px/1.3 var(--text); letter-spacing: -.012em; transition: background .15s var(--v-e), box-shadow .15s var(--v-e); }
.ds-files .fmenu-p button:hover { background: var(--lift); box-shadow: var(--lift-sh); }
.ds-files .fmenu-p .fdel { border-top: 0; box-shadow: inset 0 1px 0 var(--line); margin-top: 4px; padding-top: 4px; }
.ds-files .fmenu-p .fdel button { color: #b42318; }
[data-theme="night"] .ds-files .fmenu-p .fdel button { color: #ff8b7e; }
.ds-files .fmenu-p form:has(input[name=name]) { display: flex; gap: 6px; padding: 4px; }
.ds-files .fmenu-p input { margin: 0; }
.ds-files .fmenu-p .link { padding: 9px 12px; }
.ds-files .drop-hint { padding: 16px; border: 0; border-radius: 16px; background: var(--readout); box-shadow: var(--readout-sh); font: 400 13.5px/1.3 var(--text); color: var(--muted); }
.ds-files .fnew { position: relative; margin: 0; }
.ds-files .fnew > summary { list-style: none; }
.ds-files .fnew > summary::-webkit-details-marker { display: none; }
.ds-files .fnew-p { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; display: flex; gap: 8px; align-items: center; width: min(320px, calc(100vw - 32px)); max-width: none; margin: 0; padding: 8px;
  border: 0; border-radius: 20px; background: var(--menu); box-shadow: var(--menu-sh); }
.ds-files .fnew-p input { flex: 1; }


/* Messages (run 2): the chat app as one v3 plate. The list on the left: rows that lift, the open one the raised held
   key, unread in ink (no orange). The All / Email switch is v3's segmented tray; its held option is the raised key.
   The conversation sits in a sunk readout window: their words on raised white bubbles, yours on the Ask dock's black;
   reactions are sunk chips; the box is a field pill with round keys and a black send key. chat.js, attach.js and
   lightbox.js keep their classes; this only restyles them. */
.ds-msgs { gap: 0; }
.ds-msgs .msgr { margin-top: 0; border: 0; border-radius: 26px; background: var(--plate); box-shadow: var(--plate-sh); overflow: hidden; grid-template-columns: 344px minmax(0, 1fr); }
.ds-msgs .convos { border-right: 0; padding: 4px 0 0; }
.ds-msgs .convos-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 18px 14px 20px; }
.ds-msgs .convos-h .ds-h1 { font-size: 30px; }
.ds-msgs .cv-filter { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-self: stretch; margin: 0 16px 12px; padding: 4px; }
.ds-msgs .cv-filter a { justify-content: center; height: 40px; }
.ds-msgs .cv-filter .on { box-shadow: 0 0 0 .5px rgb(11 12 14 / .2), inset 0 1px 0 #fff, inset 0 -1px 1px rgb(11 12 14 / .05), 0 1px 1px rgb(11 12 14 / .18), 0 3px 6px rgb(11 12 14 / .12), 0 8px 14px -6px rgb(11 12 14 / .2); }
[data-theme="night"] .ds-msgs .cv-filter .on { box-shadow: var(--held-sh); }
.ds-msgs .inbox { margin: 0; padding: 0 20px 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.ds-msgs .inbox b { color: var(--ink); font-weight: 500; word-break: break-all; }
.ds-msgs .convo-list { padding: 4px 0 10px; }
.ds-msgs .convo, .ds-msgs .convo-list .convo { margin: 0 10px; padding: 10px; border-top: 0; border-radius: 14px; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; transition: background .15s var(--v-e), box-shadow .15s var(--v-e); }
.ds-msgs .convo + .convo { margin-top: 2px; }
.ds-msgs .convo:hover { background: var(--lift); box-shadow: var(--lift-sh); }
.ds-msgs .convo.on { background: var(--held); box-shadow: var(--held-sh); }
.ds-msgs .cv-top b { font: 500 15px/1.3 var(--text); letter-spacing: -.012em; color: var(--ink); }
.ds-msgs .convo.unread .cv-top b { font-weight: 600; }
.ds-msgs .cv-t { flex: none; font: 400 12.5px/1.3 var(--text); color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-msgs .cv-last { font: 400 13.5px/1.4 var(--text); color: var(--muted); }
.ds-msgs .convo.unread .cv-last { color: var(--ink); font-weight: 400; }
.ds-msgs .dot-new { width: 7px; height: 7px; right: 16px; bottom: 17px; background: var(--ink); }
.cv-tag { display: inline-flex; align-items: center; height: 20px; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: var(--sunk); box-shadow: var(--sunk-sh); font: 400 12px/1 var(--text); font-style: normal; color: var(--body); vertical-align: 1px; }
.ds-msgs .av { width: 36px; height: 36px; border: 0; background: var(--key); box-shadow: 0 0 0 1px rgb(11 12 14 / .08), 0 1px 2px rgb(11 12 14 / .12); font: 500 12px/1 var(--text); color: var(--body); filter: none; }
.ds-msgs img.av { background: var(--well); }
.ds-msgs .av.group { background: var(--ink); color: var(--bg); box-shadow: 0 1px 2px rgb(11 12 14 / .2); font: 500 12px/1 var(--text); }
.ds-msgs .av.ai { font: 500 10.5px/1 var(--text); }
.ds-msgs .av.internal, .ds-msgs .av.ai { box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent); }
.ds-msgs .av-gap { width: 36px; }
.ds-msgs .convo-pane { background: none; padding: 0 10px 10px 0; }
.ds-msgs .pane-h { min-height: 68px; padding: 14px 10px 12px 14px; border-bottom: 0; background: none; gap: 12px; }
.ds-msgs .pane-h b { font: 500 16px/1.3 var(--text); letter-spacing: -.012em; }
.ds-msgs .pane-h .ds-rs { font-size: 13.5px; }
.ds-msgs .pane-h .back { font: 500 14px/1 var(--text); color: var(--ink); }
.ds-msgs .convo-pane .chat-log { padding: 18px 20px 22px; gap: 6px; border-radius: 22px; background: var(--readout); box-shadow: var(--readout-sh); }
.ds-msgs .daysep { margin: 16px 0 10px; }
.ds-msgs .daysep span { display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border: 0; border-radius: 999px; background: var(--sunk); box-shadow: var(--sunk-sh); font: 400 12.5px/1 var(--text); letter-spacing: 0; text-transform: none; color: var(--body); }
.ds-msgs .line { gap: 10px; }
.ds-msgs .line .bub { gap: 4px; padding: 10px 14px 9px; border: 0; border-radius: 18px 18px 18px 6px; background: var(--bub); box-shadow: var(--bub-sh); font: 400 15px/1.45 var(--text); }
.ds-msgs .line .bub p { font-size: 15px; line-height: 1.45; color: var(--ink); }
.ds-msgs .line .bub a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ds-msgs .line.me .bub { border-radius: 18px 18px 6px 18px; background: var(--bub-me); box-shadow: var(--bub-me-sh); }
.ds-msgs .line.me .bub :is(p, a, li, b, strong) { color: var(--bub-me-ink); }
.ds-msgs .line.me .bub a { text-decoration-color: rgb(244 244 246 / .4); }
.ds-msgs .line .bub.team:not(.internal) { box-shadow: var(--bub-sh); }
.ds-msgs .line.me .bub.team:not(.internal) { box-shadow: var(--bub-me-sh); }
.ds-msgs .line .bub.internal, .ds-msgs .line.me .bub.internal { border: 0; background: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 26%, transparent); }
.ds-msgs .line.me .bub.internal :is(p, a, .when2) { color: var(--ink); }
.ds-msgs .line .bub.deleted:not(.internal) { padding: 4px 6px; border: 0; background: none; box-shadow: none; }
.ds-msgs .line .bub.deleted .gone { font-size: 14px; font-style: normal; color: var(--muted); }
.ds-msgs .bub .who { font: 500 13px/1.3 var(--text); color: var(--body); }
.ds-msgs .bub .when2 { font: 400 12px/1.2 var(--text); color: var(--muted); font-variant-numeric: tabular-nums; }
.ds-msgs .line.me .bub .when2 { color: var(--bub-me-2); }
.ds-msgs .line.me .bub .when2 .link { color: inherit; }
.ds-msgs .bub .btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.ds-msgs .bub .edit textarea:not([hidden]) { min-height: 72px; margin: 4px 0 8px; }
.ds-msgs .reacts { gap: 6px; margin: 4px 0 0; }
.ds-msgs .reacts .chip { height: 28px; padding: 0 10px; gap: 6px; border: 0; border-radius: 999px; background: var(--sunk); box-shadow: var(--sunk-sh); font-size: 14px; }
.ds-msgs .reacts .chip span { font: 500 12.5px/1 var(--text); color: var(--body); }
.ds-msgs .reacts .chip.mine { background: var(--held); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent), var(--held-sh); }
.ds-msgs .reacts .chip.mine span { color: var(--ink); }
.ds-msgs .line.me .reacts .chip { background: rgb(255 255 255 / .1); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); color: var(--bub-me-ink); }
.ds-msgs .line.me .reacts .chip span { color: var(--bub-me-2); }
.ds-msgs .line.me .reacts .chip.mine { background: rgb(255 255 255 / .2); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .4); }
.ds-msgs .line.me .reacts .chip.mine span { color: var(--bub-me-ink); }
.ds-msgs .react-add > summary { width: 32px; height: 32px; transition: background .15s var(--v-e), box-shadow .15s var(--v-e); }
.ds-msgs .react-add > summary:hover, .ds-msgs .react-add[open] > summary { background: var(--key); box-shadow: var(--key-sh); }
.ds-msgs .react-pick { padding: 5px; border: 0; border-radius: 999px; background: var(--menu); box-shadow: var(--menu-sh); }
.ds-msgs .react-pick button:hover, .ds-msgs .react-pick button:focus-visible { background: var(--lift); box-shadow: var(--lift-sh); transform: none; }
.ds-msgs .react-who { border-radius: 12px; padding: 8px 12px; font: 400 13px/1.4 var(--text); }
.ds-msgs .earlier { align-self: center; display: inline-flex; align-items: center; height: 34px; margin: 2px 0 12px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--key); box-shadow: var(--key-sh); font: 500 13.5px/1 var(--text); letter-spacing: -.01em; text-transform: none; color: var(--ink); }
.ds-msgs .jump { padding: 0 16px; height: 36px; background: var(--bub-me); box-shadow: var(--bub-me-sh); color: var(--bub-me-ink); font: 500 13.5px/1 var(--text); }
.ds-msgs .composer { gap: 6px; padding: 12px 0 0; border-top: 0; background: none; align-items: flex-end; }
.ds-msgs .composer textarea, .ds-msgs .composer textarea:not([hidden]) { min-height: 44px; max-height: 160px; padding: 11px 18px; border-radius: 22px; resize: none; font-size: 15px; line-height: 1.4; }
.ds-msgs .composer .send { width: 44px; height: 44px; border-radius: 50%; background: var(--send); box-shadow: var(--send-sh); color: var(--send-ink); font: 500 18px/1 var(--text); transition: transform .18s var(--v-e); }
.ds-msgs .composer .send:hover { transform: translateY(-1px); }
.ds-msgs .composer .send:active { transform: translateY(1px); transition-duration: .06s; }
.ds-msgs .composer .attach, .ds-msgs .composer .emoji-btn { width: 44px; height: 44px; border-radius: 50%; color: var(--body); transition: background .18s var(--v-e), box-shadow .18s var(--v-e); }
.ds-msgs .composer .attach:hover, .ds-msgs .composer .emoji-btn:hover, .ds-msgs .composer .emoji-btn[aria-expanded=true] { background: var(--key); box-shadow: var(--key-sh); color: var(--ink); }
.ds-msgs .composer .note-toggle, .ds-msgs .composer .team-only { padding-bottom: 13px; font: 400 13.5px/1.3 var(--text); letter-spacing: 0; text-transform: none; color: var(--body); }
.ds-msgs .composer.disabled { padding: 12px 0 0; }
.ds-msgs .att-list { gap: 8px; padding: 12px 0 0; background: none; }
.ds-msgs .att-chip { border: 0; border-radius: 16px; background: var(--well); box-shadow: var(--well-sh); }
.ds-msgs .att-chip .kind { padding: 2px 6px; border-radius: 999px; font: 500 11px/1.3 var(--text); letter-spacing: 0; text-transform: none; }
.ds-msgs .att-img, .ds-msgs .att-vid { border-radius: 12px; }
.ds-msgs .att-file { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 12px; background: var(--sunk); box-shadow: var(--sunk-sh); font: 500 14px/1.3 var(--text); color: var(--ink); text-decoration: none; }
.ds-msgs .line.me .att-file { background: rgb(255 255 255 / .1); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); color: var(--bub-me-ink); }
.ds-msgs .att-wait { border: 0; border-radius: 12px; background: var(--sunk); box-shadow: var(--sunk-sh); font-size: 13.5px; }
.ds-msgs .convo-pane .typing { margin-left: 46px; background: none; font: 400 13px/1 var(--text); }
.ds-msgs .dots3 { padding: 10px 12px; border: 0; border-radius: 18px 18px 18px 6px; background: var(--bub); box-shadow: var(--bub-sh); }
.ds-msgs .empty { margin: 0; padding: 20px; font: 400 15px/1.5 var(--text); color: var(--muted); }
.ds-msgs .convo-pane > .empty { align-self: center; justify-self: center; }
@media (max-width: 860px) {
  .ds-msgs .msgr { margin: 0; border-radius: 22px; grid-template-columns: minmax(0, 1fr); }
  .ds-msgs .msgr.at-list { height: auto; min-height: 0; }
  .ds-msgs .msgr.at-convo { border-radius: 0; background: none; box-shadow: none; }
  .ds-msgs .msgr.at-convo .convo-pane { padding: 0; }
  .ds-msgs .msgr.at-convo .chat-log { margin: 0 -10px; padding: 16px 14px 20px; border-radius: 22px; }
  .ds-msgs .msgr.at-convo .composer { padding: 10px 0 0; }
  /* reactions: the pill keeps its 28px look; the button is a 40px target (the pill is drawn in ::before) */
  .ds-msgs .reacts { margin: -2px 0 -6px; }
  .ds-msgs .reacts .chip, .ds-msgs .line.me .reacts .chip, .ds-msgs .reacts .chip.mine, .ds-msgs .line.me .reacts .chip.mine { position: relative; isolation: isolate; height: 40px; background: none; box-shadow: none; }
  .ds-msgs .reacts .chip::before { content: ""; position: absolute; z-index: -1; inset: 6px 0; border-radius: 999px; background: var(--sunk); box-shadow: var(--sunk-sh); }
  .ds-msgs .reacts .chip.mine::before { background: var(--held); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 40%, transparent), var(--held-sh); }
  .ds-msgs .line.me .reacts .chip::before { background: rgb(255 255 255 / .1); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); }
  .ds-msgs .line.me .reacts .chip.mine::before { background: rgb(255 255 255 / .2); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .4); }
}

/* Signed-out pages (BRIEF §9): v3's hero. Porcelain with the Relief terrain rising from the foot, the wordmark top
   left, a large Inter 400 headline with its grey clause on the left, and a plate holding the form on the right
   (stacked on phones). Sign in is the orange key; the other ways in are white keys. The client's logo door keeps
   their logo over the headline. The guest page (.is-guest) is one wide plate. */
body.bare { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; align-items: center; justify-items: center; padding: 0; background: var(--bg); }
.bare-top { position: relative; z-index: 1; justify-self: stretch; display: flex; align-items: center; justify-content: space-between; width: var(--v-frame); margin: 0 auto; padding: 28px 0 0; }
.bare-wm { display: inline-flex; padding: 8px 0; }
.bare-wm .wm { width: 148px; }
.bare-theme { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--key); box-shadow: var(--key-sh); color: var(--body); cursor: pointer; transition: transform .18s var(--v-e), box-shadow .18s var(--v-e); }
.bare-theme:hover { transform: translateY(-1px); box-shadow: var(--key-up); color: var(--ink); }
.bare-theme .ic { width: 18px; height: 18px; stroke: currentColor; }
.ds-door { position: relative; z-index: 1; width: var(--v-frame); max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 40px clamp(40px, 7vw, 120px); align-items: center; padding: 48px 0 64px; border: 0; background: none; }
.door-lead { display: grid; gap: 18px; align-content: center; min-width: 0; }
.door-lead:only-child { grid-column: 1 / -1; max-width: 760px; }
.ds-door h1 { margin: 0; max-width: 13em; font: 400 clamp(38px, min(calc(3.15 * min(1vw, 14.4px)) + 15px, calc(5.4 * min(1vw, 14.4px)) - 20px), 64px)/1.03 var(--head); letter-spacing: -.026em; color: var(--ink); text-wrap: balance; }
.ds-door h1 > span { color: var(--muted); }
.door-lead > p { max-width: 40ch; margin: 0; font-size: clamp(16px, .5vw + 11px, 19px); line-height: 1.5; color: var(--body); text-wrap: pretty; }
.door-lead > p.mono { font-size: 15px; }
.door-lead a:not(.ds-btn, .btn), .door-plate a:not(.ds-btn, .btn) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.door-plate { display: grid; gap: 14px; padding: 28px; border-radius: 30px; background: var(--plate); box-shadow: var(--plate-up); }
.door-plate > h1 { font-size: clamp(30px, 2vw + 14px, 40px); }
.ds-door-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ds-door-mark { display: block; width: 28px; height: 28px; border-radius: 7px; }
.ds-door-x { font: 400 13px/1 var(--text); color: var(--faint); }
.ds-door .door-logo { display: block; max-width: 200px; max-height: 44px; width: auto; margin: 0; }
.door-plate > p { margin: 0; color: var(--body); }
.door-plate > form, .ds-door .ds-form { margin: 0; }
.ds-door .ds-form { gap: 14px; }
.ds-door .ds-form .ds-btn, .door-plate > form > .ds-btn, .ds-door .btn { width: 100%; height: 44px; justify-content: center; }
.door-plate > form > .btn:not(.ghost), .door-plate > .btn:not(.ghost) { background: var(--ember) #c93003; color: #fff; text-shadow: 0 -1px 0 rgb(90 16 0 / .3); box-shadow: var(--ember-sh); } /* the page's one action: Continue, Send a new one */
.door-plate > form > .btn:not(.ghost):hover, .door-plate > .btn:not(.ghost):hover { background: var(--ember-hi); box-shadow: var(--ember-up); }
.ds-door.is-guest { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.ds-door.is-guest .door-plate { padding: 28px 30px; }
.ds-door.is-guest .gbody .ds-btn, .ds-door.is-guest .gbody .btn { width: auto; height: 40px; }
.ds-door form.stack { display: grid; gap: 10px; }
.ds-door .first-time { justify-self: center; text-align: center; margin-top: 2px; }
.ds-or { display: flex; align-items: center; gap: 12px; font: 400 13.5px/1 var(--text); color: var(--muted); }
.ds-or::before, .ds-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.ds-door-addr { margin: 0; }
.ds-door-addr a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ds-door .form-err { padding: 12px 16px; border-radius: 14px; background: var(--well); box-shadow: var(--well-sh); }
.ds-door .gnote { margin: 0; border: 0; white-space: pre-wrap; font-size: 15px; color: var(--ink); } /* the sender's note: a readout, no orange bar */
@media (max-width: 860px) { .ds-door .ds-rev .ds-revbar { position: static; padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; } body.bare:has(.ds-revbar) { padding-bottom: 0; } } /* no dock on a guest page: the keys stay in their card */
.ds-door .glead { color: var(--body); }
.ds-door .gbody { gap: 10px; }
.bare-foot { position: relative; z-index: 1; justify-self: stretch; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; width: var(--v-frame); margin: 0 auto; padding: 18px 0 26px; box-shadow: inset 0 1px 0 var(--line); font: 400 13px/1.5 var(--text); color: var(--muted); }
.bare-foot a:hover { color: var(--ink); }
body.bare > main > p:last-child:not(.door-plate) { grid-column: 1 / -1; } /* the dev sign-in link */
@media (max-width: 900px) {
  .ds-door { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 28px; padding: 36px 0 48px; }
  .door-plate { padding: 22px 18px; border-radius: 26px; }
}
@media (max-width: 860px) {
  body.bare { --v-frame: calc(100% - 40px); }
  .bare-top { padding-top: 16px; }
  .bare-wm .wm { width: 128px; }
  .ds-door h1 { font-size: clamp(32px, 8.6vw, 40px); line-height: 1.06; }
  .bare-foot { flex-direction: column; }
}
@media (max-width: 640px) {
  .ds-table.is-legend .ds-tr { grid-template-columns: minmax(0, 1fr); }
  .ds-bill .ds-tr { grid-template-columns: minmax(0, 1fr) auto; }
  .ds-bill .ds-rr { grid-column: 1 / -1; justify-content: flex-start; }
  .ds-person .av { width: 32px; height: 32px; }
  .ds-search { flex-wrap: wrap; }
  .ds-search .ds-btn { height: 40px; }
  .ds-inline > .ds-btn { height: 40px; }
  .ds-files .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-files .fmenu > summary { width: 40px; height: 40px; }
  .ds-files .gallery { gap: 8px; }
  .ds-files .folder { padding: 12px 12px 14px; border-radius: 22px; }
  .ds-files .fcard { padding: 4px 4px 10px; border-radius: 16px; }
  .ds-files .fthumb { border-radius: 12px; }
  .ds-files .fmeta { padding: 0 4px; }
  .ds-files .fwrap > .fmenu > summary { top: 8px; right: 8px; }
  .ds .book .days button { min-height: 52px; }
  .ds .book .times button { height: 40px; padding: 0 14px; }
  .ds-msgs .convos-h { padding: 16px 14px 12px 16px; }
  .ds-msgs .convos-h .ds-h1 { font-size: 28px; }
  .ds-msgs .cv-filter { margin: 0 12px 10px; }
  .ds-msgs .inbox { padding: 0 16px 10px; }
  .ds-msgs .convo, .ds-msgs .convo-list .convo { margin: 0 6px; }
}
.ds-files .fnew > summary.ds-btn { display: inline-flex; }
.ds .book .days button.on b { color: var(--ink); }
.ds-ch h2 .ds-n { margin-left: 4px; }
.ds-settings > .ds-card, .ds-settings > .form-ok { max-width: 760px; }
/* Run 2, wide screens: the section switch stands as a vertical tray at the left and stays in view; the cards beside it,
   so the page no longer leaves its right half empty. */
@media (min-width: 1100px) {
  .ds-settings { grid-template-columns: 232px minmax(0, 760px); column-gap: 40px; }
  .ds-settings > * { grid-column: 2; }
  .ds-settings > .ds-head { grid-column: 1 / -1; }
  .ds-settings > .set-nav { grid-column: 1; grid-row: 2 / span 6; align-self: start; position: sticky; top: 92px; display: grid; gap: 2px; justify-self: stretch; border-radius: 22px; }
  .ds-settings > .set-nav a { height: 40px; padding: 0 16px; border-radius: 16px; }
}
.ds-msgs .cv-filter { padding: 2px; }
body.bare { box-sizing: border-box; }
html:has(body.bare) { background: var(--bg); }
@media (max-width: 640px) { .ds-settings .set-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; } }
.ds-files .is-loose .ds-ch h2 { flex: none; }
/* Phone tap targets for run C's small controls: the hit area grows to 40px, the look stays. */
@media (max-width: 640px) {
  .ds-files .fmenu-p .fmove button, .ds-files .fmenu-p .fdel button, .ds-files .fnew-p input, .ds-files .fnew-p .ds-btn { min-height: 40px; }
  .ds-cu-b > a, .ds-bill a.ds-rt { padding: 11px 0; margin: -11px 0; }
  .ds-msgs .pane-h .back { padding: 13px 10px 13px 0; }
  .ds-msgs .react-pick button, .ds-msgs .react-add > summary { width: 40px; height: 40px; }
}
/* Run D: the conversation box's buttons are 40px targets on phones (after the Messages rules above, so it wins). */
@media (max-width: 860px) {
  .ds-msgs .composer .send, .ds-msgs .composer .attach, .ds-msgs .composer .emoji-btn { width: 40px; height: 40px; }
  .ds-msgs .composer textarea, .ds-msgs .composer textarea:not([hidden]) { min-height: 40px; }
}

/* ---------------------------------------------------------------------------------------------------------------
   Portal v5 run F (SPEC-v5.md): wide monitors, the shell's quick panels, grouped needs, project covers, page motion.
   Tokens only; the accent and the face come from portal.css. */

/* Wide monitors: from 1600px the content grows to 1,320px and centres beside the sidebar (Ryan's wide screen showed
   the column hugging the left). */


/* Page motion on desktop: the rail, sidebar and page bar stay put; only the content cross-fades (portal.css keeps its
   120/240ms fade). Everything else swaps at once. Reduced motion: no transition at all (portal.css gates the opt-in). */
@media (prefers-reduced-motion: no-preference) {
  .nav { view-transition-name: nav; }
  .rail { view-transition-name: rail; }
  .pagebar { view-transition-name: pagebar; }
  ::view-transition-old(root), ::view-transition-new(root),
  ::view-transition-old(nav), ::view-transition-new(nav),
  ::view-transition-old(rail), ::view-transition-new(rail),
  ::view-transition-old(pagebar), ::view-transition-new(pagebar) { animation: none; }
}

html:not(.js) button[data-find] { display: none; } /* the studio sidebar's palette button needs shell.js */

/* Find anything (Ctrl K): a native modal dialog as a v3 menu plate (r22, silver hairline), its search field a sunk
   well, results as rows that lift; it rises 6px from .97 in 180ms. */
.cmdk { width: min(640px, calc(100vw - 32px)); max-width: none; max-height: none; margin: 14vh auto 0; padding: 8px; overflow: hidden; border: 0; border-radius: 24px;
  background: var(--menu); color: var(--ink); box-shadow: var(--menu-sh); font: 400 15px/1.4 var(--text); transition: opacity .18s var(--v-e), transform .18s var(--v-e); }
@starting-style { .cmdk[open] { opacity: 0; transform: translateY(6px) scale(.97); } }
.cmdk::backdrop { background: rgb(11 12 14 / .4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.cmdk .ic { width: 18px; height: 18px; flex: none; stroke: currentColor; stroke-width: 1.75; fill: none; color: var(--muted); }
.cmdk-in { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 10px 0 16px; border-radius: 16px; background: var(--field); box-shadow: var(--field-sh); }
.cmdk-in input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: 400 16px/1 var(--text); color: var(--ink); }
.cmdk-in input::placeholder { color: var(--muted); }
.cmdk kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border: 0; border-radius: 8px; background: var(--key); box-shadow: var(--key-sh); font: 500 12px/1 var(--text); color: var(--body); }
.cmdk-list { max-height: min(440px, 56vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px 2px 4px; scroll-padding: 6px; }
.cmdk-g { margin: 0; padding: 12px 12px 4px; font: 500 13px/1.3 var(--text); color: var(--muted); }
.cmdk-list [role=option] { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 12px; font-weight: 500; letter-spacing: -.012em; color: var(--ink); }
.cmdk-list [role=option] span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-list [role=option] em { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 13px/1 var(--text); font-style: normal; color: var(--muted); }
.cmdk-list [role=option][aria-selected=true] { background: var(--lift); box-shadow: var(--lift-sh); }
.cmdk-none { margin: 0; padding: 18px 12px; font-size: 15px; color: var(--muted); }
.cmdk-foot { display: flex; gap: 16px; height: 44px; align-items: center; margin-top: 4px; padding: 0 14px; border-radius: 14px; background: var(--sunk); box-shadow: var(--sunk-sh); font: 400 13px/1 var(--text); color: var(--muted); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 5px; }
.cmdk-foot kbd { min-width: 22px; height: 22px; }
@media (max-width: 760px) { .cmdk { margin-top: 12px; width: calc(100vw - 24px); } .cmdk-foot { display: none; } .cmdk-list [role=option] { min-height: 48px; } }

/* The bell's panel: what changed since the last visit, a menu plate under the bell; rows lift and arrive 20ms apart. */
.bell-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 2px var(--raised); }
.top-ic .bell-dot { top: 9px; right: 9px; }
.bellpop { position: fixed; z-index: 40; max-height: min(480px, calc(100vh - 90px)); display: flex; flex-direction: column; padding: 8px; border: 0; border-radius: 22px;
  background: var(--menu); color: var(--ink); box-shadow: var(--menu-sh); font: 400 15px/1.4 var(--text);
  transition: opacity .18s var(--v-e), transform .18s var(--v-e); }
@starting-style { .bellpop { opacity: 0; transform: translateY(6px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .bellpop, .cmdk, .me-panel, .more-sheet { transition: none; } @starting-style { .bellpop, .cmdk[open] { opacity: 1; transform: none; } } }
.bell-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; }
.bell-h h2 { flex: 1; margin: 0; font: 500 16px/1.3 var(--text); color: var(--ink); }
.bell-seen { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--key); box-shadow: var(--key-sh); font: 500 13px/1 var(--text); color: var(--ink); cursor: pointer; }
.bell-seen:hover { box-shadow: var(--key-up); }
.bell-rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; }
.bell-rows li { margin: 0; animation: v-row .2s var(--v-e) both; }
.bell-rows li:nth-child(2) { animation-delay: 20ms; } .bell-rows li:nth-child(3) { animation-delay: 40ms; } .bell-rows li:nth-child(4) { animation-delay: 60ms; } .bell-rows li:nth-child(n+5) { animation-delay: 80ms; }
@keyframes v-row { from { opacity: 0; translate: 0 4px; } }
@media (prefers-reduced-motion: reduce) { .bell-rows li { animation: none; } }
.bell-rows a { display: grid; gap: 2px; padding: 9px 12px 10px; border-radius: 12px; transition: background .15s var(--v-e), box-shadow .15s var(--v-e); }
.bell-rows a:hover, .bell-rows a:focus-visible { outline: 0; background: var(--lift); box-shadow: var(--lift-sh); }
.bell-rows b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 15px/1.3 var(--text); letter-spacing: -.012em; }
.bell-rows span { font: 400 13px/1.3 var(--text); color: var(--muted); }
.bell-none { margin: 0; padding: 8px 12px 12px; font-size: 15px; color: var(--muted); }
.bell-all { display: block; margin-top: 6px; padding: 12px 16px; border-radius: 16px; background: var(--sunk); box-shadow: var(--sunk-sh); font: 500 14px/1 var(--text); color: var(--ink); }
.bell-all::after { content: " →"; }

/* "Needs the team", grouped: one row per kind that opens to its rows (the summary is a ds-row; the why lines stay). */
.ds-grp { margin: 0; }
.ds-grp > details > summary { list-style: none; cursor: pointer; }
.ds-grp > details > summary::-webkit-details-marker { display: none; }
.ds-grp > details > summary:focus-visible { outline: 1.5px solid var(--signal-ink); outline-offset: 2px; }
.ds-grp .ds-rr > .ic { color: var(--muted); transition: transform .16s cubic-bezier(.23, 1, .32, 1); }
.ds-grp details[open] .ds-rr > .ic { transform: rotate(180deg); }
.ds-grp details[open] .ds-grp-n { display: none; }
.ds-grp summary:hover .ds-rw { color: var(--ink); }
.ds-grp-rows { margin-top: 6px; padding-left: 12px; }
@media (prefers-reduced-motion: reduce) { .ds-grp .ds-rr > .ic { transition: none; } }

/* Project covers: the top of the first website page, in the tile's place on project rows and as a band on the
   project page. Cropped from the top so the page's header reads. */
.ds-ent.has-cover, .hm-pr.has-cover { grid-template-columns: 72px minmax(0, 1fr) auto; }
.ds-cover { grid-row: 1 / span 2; align-self: center; display: block; width: 72px; height: 50px; padding: 4px; overflow: hidden; border: 0; border-radius: 12px; background: var(--well); box-shadow: var(--well-sh); }
.ds-cover img { border-radius: 8px; }
.ds-cover img, .ds-pcover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.ds-pcover { display: block; aspect-ratio: 16 / 5; padding: 6px; overflow: hidden; border: 0; border-radius: 22px; background: var(--well); box-shadow: var(--well-sh); }
.ds-pcover img { border-radius: 16px; }
@media (max-width: 760px) { .ds-pcover { aspect-ratio: 16 / 7; } }
@media (max-width: 640px) { .ds-ent.has-cover { grid-template-columns: 72px minmax(0, 1fr); } .ds-ent-st { flex-wrap: wrap; row-gap: 6px; white-space: normal; } } /* phones: the stage wraps under the name instead of running past the plate */
/* Resets for the older global input and h2 styles (portal.css) inside the shell panels. */
.cmdk .cmdk-in input, .cmdk .cmdk-in input:focus, .cmdk .cmdk-in input:focus-visible { width: auto; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: 0; font: 400 16px/1 var(--text); }
.bellpop .bell-h h2 { display: block; flex: 1; margin: 0; font: 500 16px/1.3 var(--text); letter-spacing: -.012em; text-transform: none; color: var(--ink); }
button.side-ic { padding: 0; border: 0; background: none; cursor: pointer; } /* the studio sidebar's palette button looks like the bell and search links */
