/*
  Design seed 6ed82e6a-80f6-4759-8812-5c375b59e448 (shared with website/styles.css)

  Colour is read straight out of the hex, six characters at a time:
    6ed82e  leaf     live, done, in sync
    6a80f6  sky      focus rings, secondary accent
    475988  slate    secondary text, neutral marks
    125c37  forest   success text
    5b59e4  indigo   primary actions, links, selection
    e4486e  rose     needs attention (the tail wraps to the head)
  Shape: version nibble 4 -> 4px grid; "8812" -> 8px and 12px radii;
  the 8-4-4-4-12 grouping -> an 8:4 main/rail split on a 12-column page.
*/
:root {
  --seed-leaf: #6ed82e;
  --seed-sky: #6a80f6;
  --seed-slate: #475988;
  --seed-forest: #125c37;
  --seed-indigo: #5b59e4;
  --seed-rose: #e4486e;
  --pc-base: #f6f7fc;
  --pc-panel: #ffffff;
  --pc-raised: #eef0f9;
  --pc-rule: #e1e4f1;
  --pc-input-rule: #c9cee3;
  --pc-ink: #161a2e;
  --pc-muted: #475988;
  --pc-accent: #5b59e4;
  --pc-accent-hover: #4543c4;
  --pc-selected: #ecedfd;
  --pc-on-accent: #ffffff;
  --pc-focus: #6a80f6;
  --pc-success: #125c37;
  --pc-success-tint: #e7f8dc;
  --pc-live: #4fb516;
  --pc-attn: #b82850;
  --pc-attn-tint: #fdecf1;
  --pc-attn-rule: #f5bccb;
  --pc-shadow: 0 1px 2px #161a2e0f, 0 8px 24px -12px #161a2e2e;
  --pc-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --pc-mono: ui-monospace, "SF Mono", SFMono-Regular, Consolas, monospace;
  --pc-gutter: clamp(16px, 3.2vw, 40px);
  --pc-radius: 12px;
  --pc-radius-sm: 8px;
  /* One control height for buttons, inputs and selects; one compact size. */
  --pc-control: 36px;
  --pc-control-sm: 30px;
  --pc-control-shadow: 0 1px 2px color-mix(in srgb, var(--pc-ink) 8%, transparent);
  --pc-action-gap: 8px;
  /* Type scale: meta, small, body-small, body, card title. */
  --pc-text-xs: 12px;
  --pc-text-sm: 13px;
  --pc-text-md: 14px;
  --pc-text-base: 15px;
  --pc-text-lg: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pc-base: #0d101e;
    --pc-panel: #151930;
    --pc-raised: #1d2240;
    --pc-rule: #272d50;
    --pc-input-rule: #3a4170;
    --pc-ink: #eceefa;
    --pc-muted: #a4add6;
    --pc-accent: #98a3ff;
    --pc-accent-hover: #b5bdff;
    --pc-selected: #222850;
    --pc-on-accent: #0d101e;
    --pc-focus: #98a3ff;
    --pc-success: #8be552;
    --pc-success-tint: #17301a;
    --pc-live: #6ed82e;
    --pc-attn: #ff8aa5;
    --pc-attn-tint: #381624;
    --pc-attn-rule: #6b2a40;
    --pc-shadow: 0 1px 2px #0006, 0 12px 28px -14px #000c;
  }
}

body:has(> #app), body.dashboard-active { margin: 0; background: var(--pc-base); }
#hosted-dashboard { min-height: 100vh; }
#hosted-dashboard[hidden] { display: none; }
body.dashboard-active > .header, body.dashboard-active > #main, body.dashboard-active > footer { display: none; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 20; padding: 8px 12px; border-radius: var(--pc-radius-sm); background: var(--pc-accent); color: var(--pc-on-accent); font: 600 14px var(--pc-ui); }
.skip-link:focus { top: 12px; }

.pc {
  color-scheme: light dark;
  color: var(--pc-ink);
  font: var(--pc-text-base)/1.5 var(--pc-ui);
  -webkit-font-smoothing: antialiased;

  &, & *, & *::before, & *::after { box-sizing: border-box; }
  & :is(h1, h2, h3, p, ul, ol, pre) { margin: 0; }
  & :is(button, input, select, textarea) { font: inherit; color: inherit; }
  & button { cursor: pointer; }
  & button:disabled { cursor: default; opacity: .55; }
  & :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--pc-focus); outline-offset: 2px; }
  & code { font: var(--pc-text-xs)/1.5 var(--pc-mono); overflow-wrap: anywhere; }
  & .muted { color: var(--pc-muted); }
  & .small-text { font-size: var(--pc-text-sm); }
  & .fine-print { color: var(--pc-muted); font-size: var(--pc-text-sm); }
  & .error-text { color: var(--pc-attn); }
  & .inline-note { margin-top: 12px; }

  /* Controls share geometry; action rows can wrap without shrinking labels. */
  & .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 auto; min-height: var(--pc-control); max-width: 100%; padding: 7px 14px; border: 1px solid transparent; border-radius: var(--pc-radius-sm); background: none; font-size: var(--pc-text-md); font-weight: 600; line-height: 20px; text-align: center; text-decoration: none; white-space: normal; overflow-wrap: anywhere; transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
  & .button.small { min-height: var(--pc-control-sm); padding: 4px 10px; font-size: var(--pc-text-sm); }
  & .button.wide { width: 100%; }
  & .button.primary { border-color: color-mix(in srgb, var(--pc-accent) 82%, var(--pc-ink)); background: var(--pc-accent); color: var(--pc-on-accent); box-shadow: inset 0 1px 0 #ffffff1a, var(--pc-control-shadow); }
  & .button.primary:hover:not(:disabled) { border-color: var(--pc-accent-hover); background: var(--pc-accent-hover); }
  & .button.secondary { border-color: var(--pc-input-rule); background: var(--pc-panel); box-shadow: var(--pc-control-shadow); }
  & .button.secondary:hover:not(:disabled) { border-color: color-mix(in srgb, var(--pc-accent) 55%, var(--pc-input-rule)); background: var(--pc-raised); }
  & .button.quiet { color: var(--pc-muted); }
  & .button.quiet:hover:not(:disabled) { background: var(--pc-raised); color: var(--pc-ink); }
  & .button.danger { border-color: var(--pc-attn-rule); color: var(--pc-attn); background: var(--pc-panel); box-shadow: var(--pc-control-shadow); }
  & .button.danger:hover:not(:disabled) { border-color: var(--pc-attn); background: var(--pc-attn-tint); }
  & .button:active:not(:disabled) { box-shadow: inset 0 1px 3px color-mix(in srgb, var(--pc-ink) 14%, transparent); }
  & .button:disabled { box-shadow: none; }
  & .text-button { display: inline-flex; align-items: center; justify-content: flex-start; min-height: var(--pc-control-sm); padding: 4px 0; border: 0; border-radius: 4px; background: none; color: var(--pc-accent); font-weight: 600; font-size: var(--pc-text-sm); line-height: 20px; text-align: left; text-underline-offset: 3px; }
  & .text-button:hover:not(:disabled) { color: var(--pc-accent-hover); text-decoration: underline; }
  & .text-button:active:not(:disabled) { color: var(--pc-ink); }
  & .icon-button { display: inline-flex; align-items: center; justify-content: center; min-height: var(--pc-control-sm); padding: 4px 8px; border: 1px solid transparent; border-radius: var(--pc-radius-sm); background: none; color: var(--pc-muted); font-size: var(--pc-text-sm); font-weight: 600; line-height: 20px; }
  & .icon-button:hover:not(:disabled) { border-color: var(--pc-rule); background: var(--pc-raised); color: var(--pc-ink); }

  /* Fields */
  & .stack { display: grid; gap: 14px; }
  & .field { display: grid; min-width: 0; gap: 6px; font-size: var(--pc-text-sm); font-weight: 600; }
  & :is(input:not([type="checkbox"]), select, textarea) { width: 100%; min-width: 0; min-height: var(--pc-control); padding: 7px 10px; line-height: 20px; border: 1px solid var(--pc-input-rule); border-radius: var(--pc-radius-sm); background: var(--pc-panel); font-weight: 400; font-size: var(--pc-text-md); }
  & :is(input, select, textarea):focus { border-color: var(--pc-accent); outline: 2px solid color-mix(in srgb, var(--pc-focus) 35%, transparent); outline-offset: 0; }
  & textarea { resize: vertical; line-height: 1.55; }
  & .check-field { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: var(--pc-text-md); }
  & .check-field input { width: 18px; height: 18px; accent-color: var(--pc-accent); }

  /* Small parts */
  & .pill { display: inline-flex; align-items: center; flex: none; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--pc-raised); color: var(--pc-muted); font-size: var(--pc-text-xs); font-weight: 600; white-space: nowrap; }
  & .pill.accent { background: var(--pc-selected); color: var(--pc-accent); }
  & .pill.live { background: var(--pc-success-tint); color: var(--pc-success); }
  & .pill:is(.warning, .attention) { background: var(--pc-attn-tint); color: var(--pc-attn); }
  & .avatar { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: var(--pc-text-sm); font-weight: 700; }
  & .avatar.tone-0 { background: var(--seed-indigo); }
  & .avatar.tone-1 { background: var(--seed-forest); }
  & .avatar.tone-2 { background: var(--seed-rose); }
  & .avatar.tone-3 { background: var(--seed-slate); }
  & .avatar.tone-4 { background: var(--seed-sky); color: #10132a; }
  & .avatar.tone-5 { background: var(--seed-leaf); color: #10240a; }
  & .status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--seed-slate); }
  & .status-dot.online { background: var(--pc-live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-live) 22%, transparent); }
  & .status-dot.warning { background: var(--seed-rose); }
  & .status-dot.demo { background: var(--seed-sky); }
  & .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--pc-ink); font-weight: 700; font-size: var(--pc-text-lg); letter-spacing: -.01em; text-decoration: none; }
  & .brand-mark { position: relative; flex: none; width: 34px; height: 22px; }
  & .brand-mark::before, & .brand-mark::after { content: ""; position: absolute; top: 0; width: 22px; height: 22px; border-radius: 50%; }
  & .brand-mark::before { left: 0; background: var(--seed-indigo); }
  & .brand-mark::after { right: 0; background: var(--seed-leaf); mix-blend-mode: multiply; }
  & .brand-mark.small { width: 28px; height: 18px; }
  & .brand-mark.small::before, & .brand-mark.small::after { width: 18px; height: 18px; }
  & .message { margin: 16px var(--pc-gutter) 0; padding: 10px 14px; border-radius: var(--pc-radius-sm); background: var(--pc-selected); font-size: var(--pc-text-md); }
  & .message.success { background: var(--pc-success-tint); color: var(--pc-success); }
  & .message:is(.error, .warning) { background: var(--pc-attn-tint); color: var(--pc-attn); }
  & .message ul { margin-top: 6px; padding-left: 18px; }
  & .view .message, & .modal-content .message { margin: 0; }
  & .empty-inline { padding: 14px 0; color: var(--pc-muted); font-size: var(--pc-text-md); }
  & .empty-state { display: grid; justify-items: start; gap: 6px; padding: 28px; border: 1px dashed var(--pc-input-rule); border-radius: var(--pc-radius); color: var(--pc-muted); }
  & .empty-state strong { color: var(--pc-ink); font-size: var(--pc-text-lg); }
  & .empty-state .button { margin-top: 8px; }
  & .disclosure > summary, & .source-details > summary, & details.branch > summary { width: fit-content; color: var(--pc-muted); font-size: var(--pc-text-sm); font-weight: 600; cursor: pointer; }
  & .disclosure > summary:hover { color: var(--pc-accent); }
  & .disclosure[open] > summary { margin-bottom: 8px; }
  & .disclosure.fingerprint code { display: block; padding: 6px 8px; border-radius: 6px; background: var(--pc-raised); }
  & .disclosure.fingerprint code + code { margin-top: 4px; }

  /* Shell */
  &.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: var(--pc-base); }
  & .sidebar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 20px; height: 100vh; padding: 20px 12px; overflow-y: auto; border-right: 1px solid var(--pc-rule); background: var(--pc-panel); }
  & .sidebar .brand { padding: 0 8px; }
  & .team-picker { display: grid; gap: 4px; padding: 0 8px; }
  & .team-picker select { font-weight: 600; }
    & .team-picker .team-manage { color: var(--pc-muted); }
  & .main-nav { display: grid; gap: 2px; }
  & .workspace-nav-label, & .member-heading h2 { margin: 14px 8px 4px; color: var(--pc-muted); font-size: var(--pc-text-xs); font-weight: 600; letter-spacing: .02em; }
  & .nav-button { display: flex; align-items: center; justify-content: space-between; min-height: var(--pc-control); padding: 0 10px; border: 0; border-radius: var(--pc-radius-sm); background: none; color: var(--pc-muted); font-weight: 600; font-size: var(--pc-text-md); text-align: left; }
  & .nav-button:hover { background: var(--pc-raised); color: var(--pc-ink); }
  & .nav-button.active { background: var(--pc-selected); color: var(--pc-accent); }
  & .nav-button[data-count]::after { content: attr(data-count); min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--pc-raised); color: var(--pc-muted); font-size: var(--pc-text-xs); line-height: 20px; text-align: center; }
  & .nav-button[data-view="Team"][data-count]::after, & .nav-button[data-view="This computer"][data-count]::after { background: var(--seed-rose); color: #fff; }
  & .member-list { display: grid; gap: 2px; margin-top: auto; }
  & .member-heading h2 { margin-top: 0; }
  & .member-row, & .person-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--pc-radius-sm); background: none; text-align: left; }
  & .member-row:hover, & .member-row.active, & .person-link:hover { background: var(--pc-raised); }
  & .member-row .avatar { width: 28px; height: 28px; font-size: var(--pc-text-xs); }
  & .member-copy { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
  & .member-copy strong { overflow: hidden; font-size: var(--pc-text-md); text-overflow: ellipsis; white-space: nowrap; }
  & .member-copy span { color: var(--pc-muted); font-size: var(--pc-text-xs); }
  & .main-column { min-width: 0; padding-bottom: 64px; }
  & .topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 8px var(--pc-gutter); border-bottom: 1px solid var(--pc-rule); background: color-mix(in srgb, var(--pc-base) 88%, transparent); backdrop-filter: blur(10px); }
  & .breadcrumb { overflow: hidden; color: var(--pc-muted); font-weight: 600; font-size: var(--pc-text-md); text-overflow: ellipsis; white-space: nowrap; }
  & .topbar-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
  & .profile-prompt { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 20px var(--pc-gutter) 0; padding: 16px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius-sm); }
  & .profile-prompt p { margin: 4px 0 0; }
  & .top-search { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; width: clamp(150px, 24vw, 280px); min-height: var(--pc-control); padding: 0 10px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius-sm); background: var(--pc-panel); color: var(--pc-muted); font-size: var(--pc-text-md); }
  & .top-search:hover { border-color: var(--pc-accent); }
  & .top-search kbd { font: var(--pc-text-xs) var(--pc-ui); opacity: .8; }
  & .connection { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; border: 0; background: none; color: var(--pc-muted); font-size: var(--pc-text-sm); font-weight: 500; white-space: nowrap; }
  & .connection:hover { color: var(--pc-ink); }
  & .connection.attention { color: var(--pc-attn); }
  & .account-exit { color: var(--pc-muted); font-weight: 500; white-space: nowrap; }

  /* Views */
  & .view { display: grid; align-content: start; gap: 24px; max-width: 1180px; padding: 32px var(--pc-gutter) 0; }
  & .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  & .section-heading h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
  & .section-heading p { margin-top: 6px; color: var(--pc-muted); font-size: var(--pc-text-lg); }
  & :is(.heading-actions, .toolbar-actions, .member-actions, .readiness-actions, .demo-actions) { display: flex; align-items: center; flex-wrap: wrap; gap: var(--pc-action-gap); min-width: 0; max-width: 100%; }
  & .heading-actions { align-self: center; }
  & .workspace-summary { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: -8px; color: var(--pc-muted); font-size: var(--pc-text-md); }
  & .workspace-summary strong { color: var(--pc-ink); font-size: var(--pc-text-base); }
  & .demo-guide { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--pc-radius-sm); background: var(--pc-selected); font-size: var(--pc-text-md); }
  & .panel { display: grid; align-content: start; gap: 4px; padding: 20px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius); background: var(--pc-panel); box-shadow: var(--pc-shadow); }
  & .panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
  & .panel-heading h2 { display: flex; min-width: 0; overflow-wrap: anywhere; align-items: center; gap: 8px; font-size: var(--pc-text-lg); font-weight: 700; letter-spacing: -.01em; }
  & .count { flex: none; padding: 0 7px; border-radius: 999px; background: var(--pc-raised); color: var(--pc-muted); font-size: var(--pc-text-xs); font-weight: 600; line-height: 20px; }
  & section.attention { display: grid; gap: 0; padding: 16px 20px; border: 1px solid var(--pc-attn-rule); border-radius: var(--pc-radius); background: var(--pc-attn-tint); }
  & section.attention > h2 { color: var(--pc-attn); font-size: var(--pc-text-md); font-weight: 700; }
  & .attention-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; }
  & .attention-item + .attention-item { border-top: 1px solid var(--pc-attn-rule); }
  & .attention-item:last-child { padding-bottom: 0; }
  & .attention-item strong { font-size: var(--pc-text-base); }
  & .attention-item p { color: var(--pc-muted); font-size: var(--pc-text-md); }

  /* Home */
  & .home-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px; align-items: start; }
  & .home-main, & .home-rail { display: grid; gap: 24px; min-width: 0; }
  & .people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
  & .person-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius-sm); background: var(--pc-base); }
  & .person-card .person-link { margin: -4px -4px 0; padding: 4px; width: auto; }
  & .person-focus { display: grid; gap: 2px; padding: 6px 8px; margin: 0 -8px; border: 0; border-radius: 6px; background: none; text-align: left; }
  & .person-focus:hover { background: var(--pc-selected); }
  & .person-focus strong { font-size: var(--pc-text-base); line-height: 1.35; }
  & .person-focus span { display: -webkit-box; overflow: hidden; color: var(--pc-muted); font-size: var(--pc-text-md); line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  & .person-focus.secondary strong { color: var(--pc-muted); font-size: var(--pc-text-md); font-weight: 600; }
  & .person-quiet { padding: 6px 0; color: var(--pc-muted); font-size: var(--pc-text-md); }
  & .person-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 6px; color: var(--pc-muted); font-size: var(--pc-text-xs); }
  & .person-meta.quiet span:first-child { color: var(--pc-attn); }
  & .overview-plain { grid-column: 1 / -1; color: var(--pc-muted); }

  /* Note rows */
  & .doc-list { display: grid; }
  & .doc-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px 8px; margin: 0 -8px; width: calc(100% + 16px); border: 0; border-radius: var(--pc-radius-sm); background: none; text-align: left; }
  & .doc-row + .doc-row { box-shadow: 0 -1px 0 var(--pc-rule); }
  & .doc-row:hover { background: var(--pc-selected); box-shadow: none; }
  & .doc-row:hover + .doc-row { box-shadow: none; }
  & .doc-row-copy { display: grid; flex: 1; gap: 1px; min-width: 0; }
  & .doc-row-copy strong { overflow-wrap: anywhere; font-size: var(--pc-text-base); font-weight: 600; line-height: 1.4; }
  & .doc-row-summary { display: -webkit-box; overflow: hidden; color: var(--pc-muted); font-size: var(--pc-text-md); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  & .document-context { color: var(--pc-muted); font-size: var(--pc-text-xs); }
  & .doc-row .pill { margin-top: 1px; }
  & .kind-mark { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 3px; background: var(--seed-slate); opacity: .55; }
  & .kind-mark.kind-update { border-radius: 50%; background: var(--seed-indigo); opacity: 1; }
  & .kind-mark.kind-decision { background: var(--seed-rose); opacity: 1; transform: rotate(45deg) scale(.86); }
  & .kind-mark.kind-task { width: 16px; height: 16px; margin: 3px -3px 0; border: 2px solid var(--pc-input-rule); border-radius: 50%; background: none; opacity: 1; }
  & .kind-mark.kind-task[data-state="progress"] { border-color: var(--seed-indigo); background: conic-gradient(var(--seed-indigo) 50%, transparent 0); }
  & .kind-mark.kind-task[data-state="done"] { border-color: var(--pc-live); background: var(--pc-live); }
  & .doc-row[data-kind="task"]:has([data-state="done"]) strong { color: var(--pc-muted); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--pc-input-rule); }
  & .feed { display: grid; }
  & .feed-day { margin: 14px 0 2px; color: var(--pc-muted); font-size: var(--pc-text-xs); font-weight: 600; }
  & .feed-day:first-child { margin-top: 0; }
  & .filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -8px; }
  & .filter-chip { min-height: var(--pc-control-sm); padding: 0 12px; border: 1px solid var(--pc-rule); border-radius: 999px; background: var(--pc-panel); color: var(--pc-muted); font-size: var(--pc-text-sm); font-weight: 600; }
  & .filter-chip:hover { border-color: var(--pc-accent); color: var(--pc-accent); }
  & .filter-chip.active { border-color: var(--pc-accent); background: var(--pc-accent); color: var(--pc-on-accent); }
  & .view > .recent-section, & .timeline { padding: 20px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius); background: var(--pc-panel); box-shadow: var(--pc-shadow); }
  & .timeline { display: grid; gap: 4px; }
  & .timeline-entry { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: start; }
  & .timeline-entry + .timeline-entry { border-top: 1px solid var(--pc-rule); }
  & .timeline-date { padding-top: 12px; color: var(--pc-muted); font-size: var(--pc-text-sm); font-variant-numeric: tabular-nums; }
  & .done-tasks { padding: 0 4px; }
  & .tasks-important { border-color: var(--pc-attn-rule); }
  & .person-title { display: flex; align-items: center; gap: 16px; }
  & .person-title .avatar { width: 56px; height: 56px; font-size: 22px; }

  /* Team and this computer */
  & .team-list { display: grid; gap: 12px; }
  & .member-card { display: grid; gap: 12px; padding: 16px 20px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius); background: var(--pc-panel); box-shadow: var(--pc-shadow); }
  & .member-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
  & .member-card-head .person-link { flex: 1 1 160px; min-width: 0; width: auto; margin-left: -8px; }
  & .member-card-head .member-copy strong { font-size: var(--pc-text-lg); }
  & .device-list, & .token-list { display: grid; gap: 8px; }
  & .member-card .device-list { padding-left: 42px; }
  & .device-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--pc-radius-sm); background: var(--pc-base); }
  & .device-row.pending { background: var(--pc-attn-tint); }
  & .device-row.revoked { opacity: .6; }
  & .workflow-row { flex-wrap: wrap; }
  & .workflow-row .device-details { flex: 1 1 180px; }
  & .workflow-row .member-actions { flex-wrap: wrap; justify-content: flex-end; }
  & .device-symbol { position: relative; flex: none; width: 22px; height: 15px; margin-top: 3px; border: 2px solid var(--seed-slate); border-radius: 3px; }
  & .device-symbol::after { content: ""; position: absolute; left: -5px; right: -5px; bottom: -6px; height: 2px; border-radius: 2px; background: var(--seed-slate); }
  & .device-symbol.agent { width: 18px; height: 18px; margin-top: 2px; border-color: var(--seed-indigo); border-radius: 50%; }
  & .device-symbol.agent::after { inset: 4px; height: auto; border-radius: 50%; background: var(--seed-indigo); }
  & .device-symbol.draft { width: 16px; height: 20px; border-color: var(--seed-rose); }
  & .device-symbol.draft::after { display: none; }
  & .device-details { display: grid; flex: 1; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
  & .device-details strong { font-size: var(--pc-text-md); }
  & .device-details > span { color: var(--pc-muted); font-size: var(--pc-text-sm); }
  & .team-security { color: var(--pc-muted); font-size: var(--pc-text-md); }
  & .team-security p + p { margin-top: 6px; }
  & .sync-card, & .readiness, & .recovery-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius); background: var(--pc-panel); box-shadow: var(--pc-shadow); flex-wrap: wrap; }
  & .sync-card .status-dot { width: 10px; height: 10px; margin-top: 8px; }
  & .sync-copy, & .readiness-copy, & .recovery-card > div { display: grid; flex: 1 1 280px; gap: 4px; min-width: 0; }
  & :is(.sync-card, .readiness, .recovery-card) h2 { font-size: var(--pc-text-lg); font-weight: 700; }
  & :is(.sync-card, .readiness, .recovery-card) p { color: var(--pc-muted); font-size: var(--pc-text-md); overflow-wrap: anywhere; }
  & .sync-copy .disclosure { margin-top: 6px; }
  & .readiness-actions .text-button { padding-inline: 4px; }
  & .readiness.pending { border-color: var(--pc-attn-rule); background: var(--pc-attn-tint); }
  & .fingerprint-inline { flex-basis: 100%; font: var(--pc-text-xs) var(--pc-mono); overflow-wrap: anywhere; }
  & .setup-detail { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 4px 0; font-size: var(--pc-text-sm); color: var(--pc-muted); }
  & .two-column { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; }
  & .setup-card { padding: 24px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius); background: var(--pc-panel); box-shadow: var(--pc-shadow); }
  & .setup-card h2 { font-size: 18px; }
  & .main-column > .setup-card { margin: 24px var(--pc-gutter) 0; max-width: 560px; }
  & .invite-code { min-height: 84px; font: var(--pc-text-xs)/1.5 var(--pc-mono); }

  /* Reader */
  & .view-reader { max-width: 1040px; gap: 12px; }
  & .reader-back { width: fit-content; color: var(--pc-muted); }
  & .editor-panel { display: grid; gap: 20px; padding: clamp(20px, 3vw, 36px); border: 1px solid var(--pc-rule); border-radius: var(--pc-radius); background: var(--pc-panel); box-shadow: var(--pc-shadow); }
  & .editor-panel:focus { outline: none; }
  & .editor-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--pc-rule); }
  & .editor-heading { display: grid; gap: 8px; flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
  & .toolbar-actions > .pill { flex: 0 1 auto; height: auto; min-height: 22px; padding-block: 2px; white-space: normal; overflow-wrap: anywhere; }
  & .editor-heading h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
  & .note-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--pc-muted); font-size: var(--pc-text-md); }
  & .note-byline .avatar { width: 22px; height: 22px; font-size: 11px; }
  & .note-location summary { width: fit-content; color: var(--pc-muted); font-size: var(--pc-text-xs); cursor: pointer; }
  & .note-location code { display: block; margin-top: 4px; color: var(--pc-muted); }
  & .path-label { color: var(--pc-muted); font-size: var(--pc-text-xs); }
  & .rendered-markdown { max-width: 72ch; font-size: var(--pc-text-lg); line-height: 1.65; overflow-wrap: anywhere; }
  & .rendered-markdown a { color: var(--pc-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
  & .rendered-markdown a:hover { color: var(--pc-accent-hover); }
  & .rendered-markdown > * + * { margin-top: 12px; }
  & .rendered-markdown :is(h1, h2, h3) { margin-top: 24px; line-height: 1.25; letter-spacing: -.015em; }
  & .rendered-markdown > :first-child { margin-top: 0; }
  & .rendered-markdown h1 { font-size: 22px; }
  & .rendered-markdown h2 { font-size: 19px; }
  & .rendered-markdown h3 { font-size: var(--pc-text-lg); }
  & .rendered-markdown ul, & .rendered-markdown ol { padding-left: 22px; }
  & .rendered-markdown li + li { margin-top: 4px; }
  & .rendered-markdown li:has(> input[type="checkbox"]) { margin-left: -22px; list-style: none; }
  & .rendered-markdown input[type="checkbox"] { width: 15px; height: 15px; margin: 0 8px 0 0; vertical-align: -2px; accent-color: var(--pc-accent); }
  & .rendered-markdown code { padding: 1px 5px; border-radius: 5px; background: var(--pc-raised); font-size: var(--pc-text-sm); }
  & .rendered-markdown pre, & .source-details pre, & .branch pre, & .branch-draft pre, & .draft-content, & .command-block { padding: 12px 14px; overflow: auto; border-radius: var(--pc-radius-sm); background: var(--pc-raised); font: var(--pc-text-sm)/1.55 var(--pc-mono); white-space: pre-wrap; }
  & .demo-link { padding: 0; border: 0; background: none; color: var(--pc-accent); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--pc-accent) 40%, transparent); text-underline-offset: 3px; }
  & .reading-wrap { display: grid; gap: 20px; }
  & .source-details pre { margin-top: 8px; }
  & .conflict-box { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--pc-attn-rule); border-radius: var(--pc-radius-sm); background: var(--pc-attn-tint); }
  & .conflict-heading p { color: var(--pc-muted); font-size: var(--pc-text-md); }
  & .conflict-box .button { justify-self: start; }
  & .branch pre, & .branch-draft pre { margin-top: 6px; background: var(--pc-panel); }

  /* Dialogs */
  &.modal { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--pc-rule); border-radius: 16px; background: var(--pc-panel); box-shadow: 0 24px 64px -16px #0d101e80; }
  &.modal::backdrop { background: #0d101e73; backdrop-filter: blur(2px); }
  &.modal.search-modal { width: min(680px, calc(100vw - 24px)); margin-top: 10vh; }
  & .modal-card { display: grid; gap: 16px; padding: 24px; }
  & .modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  & .modal-heading h2 { font-size: 20px; letter-spacing: -.015em; }
  & .modal-content { display: grid; gap: 14px; }
  & .modal-content h3 { font-size: var(--pc-text-base); }
  & .modal-content ol { display: grid; gap: 4px; padding-left: 20px; font-size: var(--pc-text-md); }
  & .modal-content form + form { padding-top: 16px; border-top: 1px solid var(--pc-rule); }
  & .fingerprint-box { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--pc-radius-sm); background: var(--pc-raised); }
  & .fingerprint-box span { color: var(--pc-muted); font-size: var(--pc-text-xs); font-weight: 600; }
  & .fingerprint-box code { font-size: var(--pc-text-md); user-select: all; }
  & .search-form { display: grid; gap: 10px; }
  & .search-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  & .search-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  & .search-filters select { min-height: var(--pc-control-sm); padding: 4px 8px; line-height: 20px; font-size: var(--pc-text-sm); color: var(--pc-muted); }
  & .search-status { color: var(--pc-muted); font-size: var(--pc-text-sm); }
  & .search-dialog-results { max-height: 46vh; overflow-y: auto; }
  & .search-results { display: grid; }
  & .result-row { display: grid; gap: 2px; padding: 10px 8px; border: 0; border-radius: var(--pc-radius-sm); background: none; text-align: left; }
  & .result-row + .result-row { box-shadow: 0 -1px 0 var(--pc-rule); }
  & .result-row:hover { background: var(--pc-selected); box-shadow: none; }
  & .result-row strong { font-size: var(--pc-text-base); }
  & .result-path { color: var(--pc-muted); font-size: var(--pc-text-xs); }
  & .result-excerpt { color: var(--pc-muted); font-size: var(--pc-text-md); }

  /* Sign in */
  &.auth-page { display: grid; align-content: center; justify-items: center; gap: 20px; min-height: 100vh; padding: 40px 20px; background: radial-gradient(900px 480px at 15% -10%, color-mix(in srgb, var(--seed-sky) 22%, transparent), transparent 70%), radial-gradient(700px 420px at 95% 0%, color-mix(in srgb, var(--seed-leaf) 16%, transparent), transparent 70%), var(--pc-base); }
  & .welcome-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 24px 56px; align-items: center; width: min(980px, 100%); }
  & .welcome-intro { display: grid; gap: 16px; }
  & .welcome-intro h1 { font-size: clamp(32px, 4.6vw, 48px); font-weight: 750; line-height: 1.08; letter-spacing: -.035em; }
  & .welcome-lede { font-size: 18px; line-height: 1.5; }
  & .auth-card { display: grid; gap: 14px; padding: 28px; border: 1px solid var(--pc-rule); border-radius: 16px; background: var(--pc-panel); box-shadow: var(--pc-shadow); }
  & .auth-card h2 { font-size: 20px; letter-spacing: -.015em; }
  & .auth-card .message { margin: 0; }
  & .code-sent { color: var(--pc-muted); font-size: var(--pc-text-md); }
  & .auth-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
  & .welcome-secondary { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--pc-rule); text-align: center; }
  & .install-steps { display: grid; gap: 8px; grid-column: 1 / -1; padding: 20px 24px; border: 1px solid var(--pc-rule); border-radius: var(--pc-radius); background: color-mix(in srgb, var(--pc-panel) 70%, transparent); }
  & .install-steps h2 { font-size: var(--pc-text-lg); }
  & .welcome-recovery { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
}

/* The demo dialog on the website scrolls inside its own box. */
#demo-content { container-type: size; }
#demo-content .pc.app-shell { min-height: 100cqh; }
#demo-content .pc .sidebar { height: 100cqh; }
#demo-content .pc .topbar { top: 0; }

@media (max-width: 1080px) {
  .pc .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .pc.app-shell { grid-template-columns: minmax(0, 1fr); }
  .pc .sidebar, #demo-content .pc .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--pc-rule); }
  .pc .sidebar .brand { padding: 0; }
  .pc .sidebar .brand span:last-child { display: none; }
  .pc .team-picker { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; padding: 0; }
  .pc .team-picker select { flex: 1; min-width: 0; }
  .pc .team-picker .team-manage { display: none; }
  .pc .main-nav { display: flex; flex-basis: 100%; gap: 4px; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
  .pc .nav-button { flex: none; gap: 6px; }
  .pc .workspace-nav-label, .pc .member-list { display: none; }
  .pc .topbar { position: static; min-height: 48px; }
  .pc .breadcrumb { display: none; }
  .pc .topbar-right { flex: 1; justify-content: space-between; }
  .pc .top-search { flex: 1; width: auto; }
  .pc .top-search kbd { display: none; }
  .pc .view { padding-top: 20px; gap: 20px; }
  .pc .panel, .pc .member-card, .pc .timeline, .pc .view > .recent-section { padding: 16px; }
  .pc .member-card .device-list { padding-left: 0; }
  .pc .timeline-entry { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pc .timeline-date { padding-top: 10px; }
  .pc .welcome-layout { grid-template-columns: minmax(0, 1fr); }
  .pc .search-filters { grid-template-columns: minmax(0, 1fr); }
  .pc .attention-item { align-items: flex-start; flex-direction: column; gap: 8px; }
}
/* Keep touch controls generous without changing desktop density. */
@media (max-width: 570px) {
  .pc { --pc-control: 44px; --pc-control-sm: 44px; }
  .pc .topbar-right { flex-wrap: wrap; gap: 8px 12px; }
  .pc .top-search { flex: 1 1 140px; }
  .pc .connection { order: 3; flex-basis: 100%; min-height: 44px; }
  .pc .section-heading { align-items: flex-start; }
  .pc .section-heading > div:first-child { min-width: 0; }
  .pc .heading-actions { width: 100%; }
  .pc .panel-heading { align-items: flex-start; }
  .pc .panel-heading h2 { align-self: center; }
  .pc .device-row { flex-wrap: wrap; }
  .pc .device-details { flex-basis: calc(100% - 46px); }
  .pc .device-row > .button { margin-left: 34px; }
  .pc :is(.sync-card, .readiness, .recovery-card) { gap: 12px; padding: 16px; }
  .pc .sync-copy { flex-basis: calc(100% - 26px); }
  .pc .sync-card > .button { margin-left: 26px; }
  .pc .readiness-actions { width: 100%; }
  .pc .editor-panel { padding: 16px; }
  .pc .editor-heading { flex-basis: 100%; }
  .pc .toolbar-actions { width: 100%; }
  .pc .modal-card { padding: 20px; }
  .pc .auth-card { min-width: 0; padding: 20px; }
  .pc :is(input:not([type="checkbox"]), select, textarea) { font-size: 16px; }
}
@media (prefers-color-scheme: dark) {
  .pc .brand-mark::after { mix-blend-mode: screen; }
}
@media (prefers-reduced-motion: reduce) {
  .pc * { transition: none !important; }
}
