/* The pages of the app. Every colour, font, corner and shadow here is a token of
   the Cadence design system, from tokens.css, which index.html loads first.
   Nothing in this file sets one of its own: test/styleguide.test.js fails if a
   colour is written here. /styleguide.html shows the tokens and the components
   these classes follow. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--surface-canvas); color: var(--ink-primary); font: 400 15px/23px var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; line-height: 28px; letter-spacing: -.015em; } h2 { font-size: 17px; line-height: 24px; } h3 { font-size: 15px; line-height: 20px; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-subtle); color: var(--ink-primary); }
/* One ring for everything that can be reached with the keyboard. */
:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-width); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.strong { font-weight: 600; }
.muted { color: var(--ink-secondary); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hidden { display: none !important; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain:disabled .option, fieldset.plain:disabled .switch, fieldset.plain:disabled .switch input { cursor: not-allowed; }
fieldset.plain:disabled .input, fieldset.plain:disabled .option { opacity: var(--opacity-disabled); }

/* buttons and inputs */
.btn { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); min-height: var(--control-md); border-radius: var(--radius-sm); border: 1px solid var(--border-default); background: var(--surface-raised); color: var(--ink-primary); cursor: pointer; font-size: 13px; line-height: 16px; font-weight: 500; white-space: nowrap; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn:active { background: var(--surface-active); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: var(--shadow-xs); }
.btn.primary:hover { background: var(--accent-hover); border-color: transparent; }
.btn.primary:active { background: var(--accent-active); }
.btn.danger { background: var(--danger); border-color: transparent; color: var(--ink-inverse); }
.btn.danger:hover { background: var(--danger-hover); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-secondary); }
.btn.ghost:hover { background: var(--surface-hover); border-color: transparent; color: var(--ink-primary); }
.btn.ghost:active { background: var(--surface-active); }
.btn.sm { padding: 0 var(--space-2); min-height: var(--control-sm); font-size: 12px; }
/* A control that cannot be used keeps its border and its label, and does not answer to the pointer. */
.btn:disabled { opacity: var(--opacity-disabled); cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface-raised); border-color: var(--border-default); }
.btn.primary:disabled:hover { background: var(--accent); border-color: transparent; }
.btn.danger:disabled:hover { background: var(--danger); border-color: transparent; }
.btn.ghost:disabled:hover { background: transparent; border-color: transparent; color: var(--ink-secondary); }
.input, .select, .textarea { width: 100%; min-height: var(--control-md); padding: 5px var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-raised); color: var(--ink-primary); font-size: 14px; line-height: 20px; transition: border-color 120ms ease; }
.input::placeholder, .textarea::placeholder { color: var(--ink-tertiary); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-tertiary); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--accent); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-sunken); color: var(--ink-tertiary); border-color: var(--border-default); cursor: not-allowed; }
.textarea { min-height: 84px; padding: var(--space-2) var(--space-3); resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 13px; line-height: 16px; }
label.field .hint { font-weight: 400; color: var(--ink-secondary); font-size: 12px; line-height: 16px; }
.switch { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-weight: 500; font-size: 14px; line-height: 20px; }
.switch input { appearance: none; -webkit-appearance: none; width: 32px; height: 18px; border-radius: var(--radius-full); border: 1px solid var(--border-strong); background: var(--surface-sunken); position: relative; cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: var(--radius-full); background: var(--border-strong); }
.switch input:checked { background: var(--ink-primary); border-color: var(--ink-primary); }
.switch input:checked::after { left: 16px; background: var(--surface-raised); }

/* chips */
.chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-2); min-height: 22px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); font-size: 12px; line-height: 16px; font-weight: 500; background: var(--surface-sunken); color: var(--ink-secondary); white-space: nowrap; }
.chip.good { background: var(--success-subtle); color: var(--success-text); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.chip.warn { background: var(--warning-subtle); color: var(--warning-text); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.chip.bad { background: var(--danger-subtle); color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.chip.info, .chip.accent { background: var(--accent-subtle); color: var(--accent-text); border-color: var(--accent-border); }
.chip.strong { background: var(--ink-primary); color: var(--ink-inverse); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-default); border-top-color: var(--ink-primary); animation: spin .8s linear infinite; flex: none; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2400ms; } }

/* shell */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface-canvas); border-bottom: 1px solid var(--border-subtle); }
.topbar-inner { display: flex; align-items: center; gap: 14px; padding: 10px 20px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.crumb { color: var(--ink-tertiary); }
.project-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* account menu */
.menu { position: relative; flex: none; }
.menu-button { list-style: none; cursor: pointer; border-radius: 50%; display: block; }
.menu-button::-webkit-details-marker { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-active); color: var(--ink-secondary); display: grid; place-items: center; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 30; }
.menu-who { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; overflow-wrap: anywhere; }
.menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; }
.menu-item:hover { background: var(--surface-hover); }
.menu-item:disabled { opacity: var(--opacity-disabled); cursor: not-allowed; }
.tabs { display: flex; gap: 2px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 9px 12px; border: 0; background: none; cursor: pointer; color: var(--ink-secondary); font-size: 13px; line-height: 16px; font-weight: 500; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink-primary); }
/* In a row that scrolls sideways the ring is drawn inside the control, where the row cannot cut it off. */
.tab:focus-visible, .column-tab:focus-visible { outline-offset: calc(0px - var(--focus-width)); }
.tab.active { color: var(--ink-primary); border-bottom-color: var(--accent); }
.tab .count { margin-left: 5px; font-size: 11.5px; color: var(--ink-tertiary); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: var(--radius-full); background: var(--surface-raised); border: 1px solid var(--border-subtle); font-size: 12.5px; max-width: 360px; cursor: pointer; }
.status-pill span.text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banner { padding: 9px 20px; font-size: 13px; line-height: 20px; border-bottom: 1px solid var(--border-subtle); background: var(--warning-subtle); color: var(--warning-text); }
.banner.demo { background: var(--accent-subtle); color: var(--ink-primary); border-bottom-color: var(--accent-border); }
.page { padding: 20px; max-width: 1180px; margin: 0 auto; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { color: var(--ink-secondary); max-width: 70ch; }
.panel { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; }
.panel h3 { margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.empty { border: 1px dashed var(--border-subtle); border-radius: var(--radius-lg); padding: 28px; text-align: center; color: var(--ink-secondary); }
.label { font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-secondary); font-weight: 600; }

/* login */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(380px, 100%); }
.login h1 { margin: 14px 0 4px; }

/* projects */
.project-card { display: block; text-decoration: none; background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; transition: border-color 120ms ease, box-shadow 120ms ease; }
/* what a product needs from a person: quiet when nothing does, dark when something waits */
.needs { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--ink-secondary); font-size: 14px; }
.needs.waits { background: var(--ink-primary); color: var(--ink-inverse); font-weight: 600; }
.project-card:hover { border-color: var(--border-default); box-shadow: var(--shadow-sm); }
.option-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.option { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 12px; cursor: pointer; background: var(--surface-raised); text-align: left; display: flex; flex-direction: column; gap: 4px; }
.option:hover { border-color: var(--border-strong); }
.option.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.option strong { font-size: 13.5px; }
.option span { color: var(--ink-secondary); font-size: 12.5px; line-height: 1.4; }

/* board */
.board-bar { display: flex; align-items: center; gap: 8px; padding: 14px 20px 6px; flex-wrap: wrap; }
.board-filters { display: flex; align-items: center; gap: 8px; padding: 4px 20px; flex-wrap: wrap; }
/* what is waiting for a person */
.needs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.needs-label { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.needs-label:only-child { font-weight: 500; font-size: 14px; color: var(--ink-secondary); }
.needs-item { padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); background: var(--warning-subtle); color: var(--warning-text); font-size: 13px; font-weight: 600; cursor: pointer; min-height: var(--control-md); }
.needs-item:hover { border-color: var(--warning); }
.needs-item.blocked { background: var(--danger-subtle); color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.needs-item.blocked:hover { border-color: var(--danger); }
/* column switcher, for a narrow screen */
.column-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px 2px; scrollbar-width: none; position: relative; }
.column-tab { flex: none; padding: 6px 12px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle); background: var(--surface-raised); color: var(--ink-secondary); font-weight: 600; font-size: 13px; cursor: pointer; min-height: 36px; }
.column-tab .n { margin-left: 6px; opacity: .7; }
.column-tab[aria-selected="true"] { background: var(--surface-active); color: var(--ink-primary); border-color: var(--border-strong); }
.filter { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle); background: var(--surface-raised); cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--ink-secondary); }
/* a filter that is a field to choose from carries the border of a field */
select.filter { border-color: var(--border-strong); }
.filter[aria-pressed="true"] { background: var(--surface-active); color: var(--ink-primary); border-color: var(--border-strong); }
.board { display: flex; gap: 12px; padding: 12px 20px 28px; overflow-x: auto; align-items: flex-start; min-height: calc(100vh - 190px); }
.column { flex: 1 0 264px; max-width: 360px; display: flex; flex-direction: column; gap: var(--space-3); border-radius: var(--radius-lg); padding: var(--space-2); background: var(--surface-sunken); border: 1px solid var(--border-subtle); }
.column.is-empty { flex: 0 1 200px; min-width: 170px; }
.column.over { background: var(--accent-subtle); border-color: var(--accent-border); }
.column.flash { animation: flash 1.1s ease-out; }
@keyframes flash { from { background: var(--accent-subtle); } }
@media (prefers-reduced-motion: reduce) { .column.flash { animation: none; } }
.column-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 6px 0; }
.column-head h3 { font-size: 11px; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-secondary); }
.column-head .n { color: var(--ink-secondary); font-size: 11px; font-weight: 600; }
.card { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-3); cursor: pointer; display: flex; flex-direction: column; gap: var(--space-2); box-shadow: var(--shadow-xs); text-align: left; width: 100%; position: relative; transition: box-shadow 120ms ease, border-color 120ms ease; }
.card:hover { border-color: var(--border-default); box-shadow: var(--shadow-sm); }
.card.dragging { opacity: .45; }
.card-top { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-tertiary); }
.card-title { font-weight: 600; font-size: 15px; line-height: 20px; }
.card-why { font-size: 13px; line-height: 20px; color: var(--ink-secondary); border-left: 2px solid var(--accent-border); padding-left: 8px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 5px 7px; align-items: center; }
.card-facts { font-size: 12px; color: var(--ink-secondary); }
.card-alert { font-size: 12px; color: var(--danger-text); background: var(--danger-subtle); border-radius: var(--radius-sm); padding: 4px 7px; line-height: 1.35; }
.card-actions { display: flex; gap: 6px; margin-top: 2px; }
.repo-tag { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); color: var(--ink-secondary); white-space: nowrap; }
.repo-row { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 12px; gap: 8px; }
.repo-add { border: 1px dashed var(--border-subtle); border-radius: var(--radius-lg); padding: 12px; }
.column-note { display: block; background: var(--warning-subtle); color: var(--warning-text); border-radius: var(--radius-lg); padding: 9px 11px; font-size: 12.5px; line-height: 1.45; text-decoration: none; }
a.column-note:hover { text-decoration: underline; }
.column-empty { border: 1px dashed var(--border-default); border-radius: var(--radius-md); padding: 16px 12px; text-align: center; color: var(--ink-secondary); font-size: 13px; line-height: 20px; }

/* drawer */
.scrim { position: fixed; inset: 0; background: var(--overlay-scrim); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1000px, 100vw); background: var(--surface-canvas); z-index: 41; box-shadow: var(--shadow-md); border-left: 1px solid var(--border-subtle); display: flex; flex-direction: column; }
.drawer-head { padding: 14px 20px; border-bottom: 1px solid var(--border-subtle); background: var(--surface-raised); display: flex; flex-direction: column; gap: 10px; }
.drawer-head:has(+ .drawer-actions) { border-bottom: 0; padding-bottom: 6px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 20px 14px; background: var(--surface-raised); border-bottom: 1px solid var(--border-subtle); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.drawer h2 { font-size: 19px; line-height: 1.3; }
.section h4 { font-size: 11px; line-height: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-secondary); margin-bottom: 6px; }
.section p, .section li { line-height: 1.55; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.section ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.evidence { display: flex; flex-direction: column; gap: 8px; }
.evidence-item { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 9px 11px; }
.evidence-item .ref { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-secondary); overflow-wrap: anywhere; }
.evidence-item .source { margin-top: 5px; font-size: 12px; color: var(--ink-tertiary); }
.evidence-item details.source > summary { cursor: pointer; list-style: none; display: inline; }
.evidence-item details.source > summary::-webkit-details-marker { display: none; }
.evidence-item details.source > summary:hover { color: var(--ink-primary); }
.evidence-item details.source .ref { display: block; margin-top: 5px; white-space: pre-wrap; }
.prose.lead { font-size: 15px; line-height: 1.6; }
.section ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.callout { border-radius: var(--radius-md); padding: 10px 12px; font-size: 13px; line-height: 1.45; }
.callout.bad { background: var(--danger-subtle); color: var(--danger-text); }
.callout.good { background: var(--success-subtle); color: var(--success-text); }
.callout.info { background: var(--accent-subtle); color: var(--accent-text); }
.callout.plain { background: var(--surface-sunken); color: var(--ink-primary); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.fact { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 8px 10px; }
.fact .v { font-weight: 600; }
details.fold { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
details.fold > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--ink-tertiary); font-size: 11px; }
details.fold[open] > summary::before { content: "▾"; }
details.fold > .fold-body { border-top: 1px solid var(--border-subtle); }
.diff { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; overflow-x: auto; max-height: 520px; overflow-y: auto; margin: 0; padding: 8px 0; }
.diff div { padding: 0 12px; white-space: pre; min-width: max-content; }
.diff .add { background: var(--success-subtle); color: var(--success-text); }
.diff .del { background: var(--danger-subtle); color: var(--danger-text); }
.diff .hunk { color: var(--accent-text); }
.diff .file { font-weight: 600; padding-top: 8px; }
.timeline { display: flex; flex-direction: column; gap: 9px; }
.event { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 13px; }
.event time { color: var(--ink-tertiary); font-size: 12px; }
.event .who { font-weight: 600; }
.event.comment .bubble { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 7px 10px; }

/* an open card, as a pitch from its team: three numbers, a discussion, detail at the side */
.card-lead { font-size: 15px; line-height: 23px; max-width: 62ch; }
.card-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.card-main, .card-side { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.card-side { gap: var(--space-4); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.tile-figure { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -.02em; }
.tile-title { font-size: 15px; line-height: 20px; font-weight: 600; }
.tile .kpi-bar { margin-top: var(--space-1); }
.tile .kpi-bar span { background: var(--accent); }
.tile .steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: var(--space-1); }
.tile .callout { margin-top: var(--space-1); }
.discussion { gap: var(--space-5); }
.voice { display: flex; gap: var(--space-3); }
.voice-mark { width: 28px; height: 28px; flex: none; border-radius: var(--radius-full); display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--surface-active); color: var(--ink-secondary); border: 1px solid var(--team, transparent); }
.drawer-head .voice-mark { width: 22px; height: 22px; font-size: 10px; }
.voice-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: var(--space-1); }
.voice-head { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; font-size: 13px; }
.voice-text { display: flex; flex-direction: column; gap: var(--space-2); }
.voice.agent .voice-text { background: var(--accent-subtle); border: 1px solid var(--accent-border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.side-block { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.ref-picture { display: block; max-width: 100%; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.side-block.quiet { background: var(--surface-sunken); }
.side-block .files { font-size: 11.5px; line-height: 18px; color: var(--ink-secondary); overflow-wrap: anywhere; }
.ticks, .evidence-lines, .happened { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: 13px; line-height: 20px; }
.ticks li { display: flex; gap: var(--space-2); color: var(--ink-secondary); }
.tick { flex: none; width: 14px; height: 14px; margin-top: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius-xs); display: inline-grid; place-items: center; font-size: 10px; line-height: 1; }
.ticks li.done .tick { background: var(--success); border-color: var(--success); color: var(--ink-inverse); }
.evidence-lines { gap: var(--space-3); }
.evidence-lines li { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; overflow-wrap: anywhere; }
/* the proposal as a short document: three labelled parts, each cut to a few lines */
.parts { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 0 var(--space-5); }
.part { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4) 0; }
.part + .part { border-top: 1px solid var(--border-subtle); }
.part-label { font-family: var(--font-mono); font-size: 12px; line-height: 22px; color: var(--ink-tertiary); }
.cut { display: flex; flex-direction: column; gap: var(--space-2); }
.cut > p { margin: 0; }
.cut.is-cut { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.cut.is-cut.two { -webkit-line-clamp: 2; line-clamp: 2; }
.cut.is-cut.three { -webkit-line-clamp: 3; line-clamp: 3; }
.cut.is-cut > * + * { margin-top: var(--space-2); }
.btn.cut-more { margin-left: calc(-1 * var(--space-2)); color: var(--accent-text); }
.btn.cut-more[hidden] { display: none; }
.plain-list { margin: 0; padding-left: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); overflow-wrap: anywhere; }
.cut.is-cut .plain-list { display: block; }
/* at the side: what is closed until opened, in one panel */
.side-folds { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); min-width: 0; }
.side-fold + .side-fold { border-top: 1px solid var(--border-subtle); }
.side-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-3) var(--space-4); font-size: 13px; font-weight: 600; }
.side-fold > summary::-webkit-details-marker { display: none; }
.side-fold > summary::after { content: "›"; margin-left: auto; color: var(--ink-tertiary); font-weight: 400; }
.side-fold[open] > summary::after { content: "⌄"; }
.side-fold-body { padding: 0 var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.evidence-lines .ref { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-secondary); white-space: pre-wrap; }
.happened { font-size: 12px; line-height: 16px; color: var(--ink-secondary); }
.happened time { white-space: nowrap; }
@media (max-width: 900px) {
  .card-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  /* on a narrow screen the side goes under the proposal and above the discussion */
  .card-main { display: contents; }
  .card-main > * { order: 1; }
  .card-layout > .card-side { order: 2; }
  .card-main > .discussion, .card-main > .discussion ~ * { order: 3; }
  .part { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .tiles, .tiles.two { grid-template-columns: minmax(0, 1fr); }
}

/* the overview: what needs a decision, in a reading column and a context column */
.overview-title { font-size: 30px; line-height: 36px; letter-spacing: -.02em; }
.overview-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.overview-main, .overview-side { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.overview .cd-approval__foot { flex-wrap: wrap; }
.overview .cd-approval__list code { overflow-wrap: anywhere; }
/* the board in one line: a count for each column, each a way in */
.board-line { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.board-cell { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; padding: var(--space-3) var(--space-4); background: none; border: 0; border-left: 1px solid var(--border-subtle); color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.board-cell:first-child { border-left: 0; }
.board-cell:hover { background: var(--surface-sunken); }
.board-count { font-family: var(--font-mono); font-size: 22px; line-height: 28px; }
.decided, .focus { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.decided li { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.decided li:first-child { border-top: 0; padding-top: 0; }
.decided-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font-size: 15px; line-height: 20px; color: var(--ink-primary); }
.decided-what strong { font-weight: 600; }
.decided-what:hover strong { text-decoration: underline; }
.decided-who { white-space: nowrap; }
.focus { gap: var(--space-3); }
.focus li { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 900px) {
  .overview-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .board-cell { padding: var(--space-3) var(--space-2); }
  .board-cell .small { font-size: 11px; line-height: 14px; overflow-wrap: anywhere; }
  .overview-title { font-size: 24px; line-height: 30px; }
  .decided li { flex-direction: column; gap: var(--space-1); }
}

/* teams */
.team { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; border-top: 3px solid var(--team, var(--border-subtle)); }
.team.inactive { opacity: .6; }
.team-mission { line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.kpi { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-head .btn { margin: -4px -6px 0 0; color: var(--ink-secondary); }
.kpi-name { font-weight: 600; font-size: 13px; }
.kpi-figure { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.kpi-about { font-size: 12.5px; color: var(--ink-secondary); line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.kpi-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--ink-tertiary); margin-top: 2px; }
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.kpi .value.none { font-size: 14px; font-weight: 500; color: var(--ink-secondary); line-height: 1.6; }
.kpi-target { display: flex; flex-direction: column; gap: 5px; margin: 2px 0 4px; }
.kpi-target-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-secondary); }
.kpi-target-line strong { color: var(--ink-primary); font-weight: 600; }
.kpi-target.reached .kpi-target-line span { color: var(--success); font-weight: 600; }
.kpi-bar { height: 5px; border-radius: var(--radius-sm); background: var(--surface-sunken); overflow: hidden; }
.kpi-bar span { display: block; height: 100%; border-radius: var(--radius-sm); background: var(--ink-primary); min-width: 3px; }
.kpi-target.reached .kpi-bar span { background: var(--success); }
.kpi-target-by { font-size: 12px; color: var(--ink-tertiary); }
.kpi-no-target { align-self: flex-start; border: 1px dashed var(--border-subtle); background: none; border-radius: var(--radius-full); padding: 3px 10px; font-size: 12px; color: var(--ink-secondary); cursor: pointer; margin: 2px 0; }
.kpi-no-target:hover { border-color: var(--border-strong); color: var(--ink-primary); }
.team-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle); background: var(--surface-raised); cursor: pointer; font-size: 12.5px; color: var(--ink-secondary); min-height: 32px; }
.team-stat:hover { border-color: var(--border-strong); }
.team-stat strong { color: var(--ink-primary); font-size: 14px; }
.team-stat.waiting { background: var(--warning-subtle); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--warning-text); font-weight: 600; }
.team-stat.waiting strong { color: inherit; }
.team-about { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.team-about p { margin-top: 2px; line-height: 1.5; }
.notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
.kpi .value small { font-size: 12px; font-weight: 500; color: var(--ink-secondary); margin-left: 3px; }
.kpi svg { display: block; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-family: var(--font-mono); font-size: 11.5px; background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 1px 6px; color: var(--ink-secondary); }

/* feedback */
.feedback-item { display: flex; flex-direction: column; gap: 8px; }
.feedback-item .prose { line-height: 1.55; }

/* activity */
.table { width: 100%; border-collapse: collapse; background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-secondary); padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); font-weight: 600; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-hover); }
.table-wrap { overflow-x: auto; }
.log { font-family: var(--font-mono); font-size: 12px; line-height: 1.55; display: flex; flex-direction: column; gap: 3px; }
.log .line { display: grid; grid-template-columns: 62px 1fr; gap: 10px; overflow-wrap: anywhere; }
.log time { color: var(--ink-tertiary); }
.log .tool { color: var(--accent-text); }
.log .say { color: var(--ink-primary); font-family: var(--font-sans); font-size: 13px; }
.log .error { color: var(--danger); }
.log .info { color: var(--ink-secondary); }

/* modal and toast */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: var(--overlay-scrim); }
.modal-box { background: var(--surface-raised); border-radius: var(--radius-xl); width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-overlay); }
#toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink-primary); color: var(--ink-inverse); padding: 9px 14px; border-radius: var(--radius-md); box-shadow: var(--shadow-md); font-size: 13px; line-height: 20px; max-width: min(520px, 90vw); }
.toast.error { background: var(--danger); color: var(--ink-inverse); }

/* Signing in, creating the first account and joining: one raised panel on the page. */
.center:has(.login) .login { width: min(400px, 100%); background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-8) var(--space-6); }
.center:has(.login) .btn.primary { justify-content: center; min-height: var(--control-lg); }
.center:has(.login) .input { min-height: var(--control-lg); }
.sign-in-with { gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.sign-in-with .btn { justify-content: center; min-height: var(--control-lg); }

/* what a new installation still has to set up */
/* the first run: one question per screen, with what the step gives you beside it */
.first-run { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - 64px); }
.first-main { position: relative; display: flex; flex-direction: column; justify-content: center; padding: var(--space-10) var(--space-8) 72px; }
.first-form { width: 100%; max-width: 400px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-4); }
.first-form h1 { font-size: 24px; line-height: 30px; letter-spacing: -.02em; font-weight: 600; margin: 0; }
.first-form > p { margin: 0; }
.first-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; align-items: center; }
.first-dots { position: absolute; left: 0; right: 0; bottom: var(--space-6); display: flex; gap: var(--space-2); justify-content: center; }
.first-dots i { display: block; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--border-default); }
.first-dots i.on { width: 22px; background: var(--ink-primary); }
.first-side { background: var(--surface-sunken); border-left: 1px solid var(--border-subtle); display: grid; place-items: center; padding: var(--space-10) var(--space-8); }
.first-panel { width: 100%; max-width: 340px; background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.first-panel.plain { background: transparent; border: 0; padding: 0; }
.first-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-tertiary); overflow-wrap: anywhere; }
.first-line { display: flex; align-items: center; gap: var(--space-3); font-size: 13px; color: var(--ink-tertiary); }
.first-line.done { color: var(--ink-primary); }
.first-line.done .setup-mark { background: var(--success-subtle); border-color: var(--success); color: var(--success-text); }
.first-card { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1-5); font-size: 13px; line-height: 18px; }
.first-card-top { display: flex; justify-content: space-between; gap: var(--space-2); font-size: 11px; color: var(--ink-secondary); }
.first-reason { display: flex; flex-direction: column; padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); }
.first-reason:last-of-type { border-bottom: 1px solid var(--border-subtle); }
/* the sign-in and sign-up pages share that frame, on the whole screen */
.first-run.entry { min-height: 100vh; }
.entry .first-form .brand { align-self: flex-start; margin-bottom: var(--space-4); }
.entry .login { width: 100%; }
.entry .btn.primary, .entry .sign-in-with .btn { justify-content: center; min-height: var(--control-lg); }
.entry .input { min-height: var(--control-lg); }
.entry .sign-in-with { padding-top: 0; border-top: 0; }
.entry-or { display: flex; align-items: center; gap: var(--space-3); }
.entry-or::before, .entry-or::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
@media (max-width: 760px) {
  .first-run { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .first-run.entry { min-height: 100dvh; }
  .first-main { padding: var(--space-8) var(--space-4) 56px; }
  .first-side { border-left: 0; border-top: 1px solid var(--border-subtle); padding: var(--space-6) var(--space-4); }
}
.board-page > .setup { margin-top: var(--space-6); margin-bottom: var(--space-6); }
.setup { margin: 14px 20px 0; padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-raised); display: flex; flex-direction: column; gap: 10px; }
.setup-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.setup-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); text-decoration: none; }
.setup-step:hover { border-color: var(--border-strong); }
.setup-step > span:last-child { display: flex; flex-direction: column; }
.setup-label { font-weight: 600; font-size: 13px; }
.setup-mark { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; margin-top: 1px; }
.setup-step.done .setup-mark { background: var(--success); border-color: var(--success); color: var(--ink-inverse); }
.setup-step.done .setup-label { color: var(--ink-secondary); text-decoration: line-through; }

/* activity: the day in a sentence, and what shipped cards did */
.lead-line { font-size: 15px; margin-bottom: 14px; }
.result-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 9px 4px; border: 0; border-top: 1px solid var(--border-subtle); background: none; text-align: left; cursor: pointer; width: 100%; }
.result-row:hover { background: var(--surface-hover); }
.result-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-kpi { white-space: nowrap; }

/* connecting a product: the repositories Cadence was given on GitHub */
.field-title { font-size: 13px; font-weight: 600; }
.repo-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.repo-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-raised); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.repo-option[hidden] { display: none; }
.repo-option:hover { border-color: var(--border-strong); }
.repo-option[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.repo-name { font-weight: 600; overflow-wrap: anywhere; }

/* the product page: one sentence first, then what stood out, the parts, and how to steer the teams */
.product-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.product-main, .product-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.product-rail { position: sticky; top: 118px; }
.product-page h2 { font-size: 15px; }
.product-hero { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.product-lead { font-size: 21px; line-height: 1.35; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
.product-rest { font-size: 15px; line-height: 1.6; color: var(--ink-secondary); max-width: 68ch; }
.product-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.product-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle); background: var(--surface-raised); color: var(--ink-secondary); font-size: 12.5px; text-decoration: none; cursor: pointer; }
.product-stat strong { color: var(--ink-primary); font-size: 14px; }
.product-stat:hover { border-color: var(--border-strong); }
.product-stat.plain { border-color: transparent; padding-left: 4px; cursor: default; }
.product-nudge { display: block; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--accent-border); background: var(--accent-subtle); color: var(--ink-primary); font-size: 13px; line-height: 20px; text-decoration: none; }
.product-nudge:hover { border-color: var(--accent); }
.product-block { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 118px; }
.noticed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.noticed li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border-subtle); line-height: 1.5; }
.noticed li:first-child { border-top: 0; padding-top: 2px; }
.noticed li:last-child { padding-bottom: 2px; }
.noticed-n { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-subtle); border: 1px solid var(--accent-border); color: var(--accent-text); display: grid; place-items: center; font-size: 12px; font-weight: 600; margin-top: 1px; }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.area { border: 1px solid var(--border-subtle); border-left: 3px solid var(--team, var(--border-subtle)); border-radius: var(--radius-lg); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.area h3 { font-size: 14px; }
.area-about { color: var(--ink-secondary); font-size: 13px; line-height: 1.5; flex: 1; }
.area-foot { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.area-team { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; text-decoration: none; align-self: flex-start; }
.area-team:hover { text-decoration: underline; }
.area-none { font-size: 12px; color: var(--ink-tertiary); }
.area-code > summary { cursor: pointer; font-size: 12px; color: var(--ink-tertiary); list-style: none; }
.area-code > summary::-webkit-details-marker { display: none; }
.area-code > summary:hover { color: var(--ink-primary); }
.area-code .tags { margin-top: 6px; }
.area-code .tag { overflow-wrap: anywhere; }
.steer { background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.steer.empty { border-style: dashed; }
.steer.first { border-color: var(--accent-border); }
.steer-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
@media (max-width: 700px) { .steer-pair { grid-template-columns: minmax(0, 1fr); } }
.steer-item { display: flex; flex-direction: column; gap: 3px; }
.steer-item p { line-height: 1.5; }
.profile { margin: 0; display: flex; flex-direction: column; }
.profile-row { display: flex; flex-direction: column; gap: 3px; padding: 11px 0; border-top: 1px solid var(--border-subtle); }
.profile-row:first-child { border-top: 0; padding-top: 0; }
.profile-row:last-child { padding-bottom: 0; }
.profile dd { margin: 0; line-height: 1.5; }
@media (max-width: 980px) {
  /* one column: what it is, what stood out, how to steer, then the reference material */
  .product-layout { display: flex; flex-direction: column; }
  .product-main, .product-rail { display: contents; }
  .product-hero { order: 1; } .product-main > .product-block:not(.product-areas) { order: 2; } .steer { order: 3; } .product-rail > .product-block { order: 4; } .product-areas { order: 5; }
}

/* settings: when cycles run */
.schedule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.schedule .select, .schedule .input { width: auto; }
.schedule input[type="number"] { width: 84px; }
.schedule [hidden] { display: none; }
.schedule-hours { color: var(--ink-secondary); }
.notices { border-top: 1px solid var(--border-subtle); padding-top: 12px; }

/* settings: a service connected by signing in to it */
.service { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* settings: jump to a section */
.section-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.page .panel { scroll-margin-top: 110px; }

@media (min-width: 721px) { .narrow-only { display: none !important; } }

@media (max-width: 720px) {
  .wide-only { display: none !important; }
  .banner { padding: 7px 14px; font-size: 12px; line-height: 1.35; }
  /* one compact row: mark, product, status, account */
  .topbar-inner { padding: 8px 14px; gap: 10px; min-height: 50px; }
  .topbar-inner:has(.project-name) .brand-name, .topbar-inner:has(.project-name) .crumb { display: none; }
  .status-pill { min-width: 0; flex: 0 1 auto; padding: 5px 10px; }
  .tabs { padding: 0 8px; }
  .tab { padding: 9px 10px; }
  .page { padding: 14px; }
  .btn.sm, .filter { min-height: 36px; }
  /* the board shows one column at a time, chosen with the switcher */
  .board-bar { padding: 12px 14px 4px; flex-wrap: nowrap; }
  .needs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .needs-item { flex: none; min-height: 36px; }
  .needs-label:not(:only-child) { display: none; }
  /* adding a card stays within reach, clear of the list */
  .add-card { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 15; border-radius: var(--radius-full); min-height: 46px !important; padding: 0 18px; font-size: 14px !important; box-shadow: var(--shadow-md); }
  .board-filters { padding: 4px 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .board-filters .filter { flex: none; }
  .board-filters .grow { display: none; }
  .board { display: block; overflow: visible; padding: 8px 14px 90px; min-height: 0; }
  .board .column { display: none; max-width: none; padding: 0; background: none; border: 0; }
  .board .column-head { display: none; }
  .board[data-show="proposed"] .column[data-status="proposed"],
  .board[data-show="approved"] .column[data-status="approved"],
  .board[data-show="building"] .column[data-status="building"],
  .board[data-show="review"] .column[data-status="review"],
  .board[data-show="shipped"] .column[data-status="shipped"],
  .board[data-show="closed"] .column[data-status="closed"] { display: flex; }
  .card { padding: 13px 14px; }
  .card-title { font-size: 15px; }
  .card-actions .btn { flex: 1; justify-content: center; min-height: 40px; }
  /* a card's actions sit at the bottom, within reach of a thumb */
  .drawer-head { padding: 12px 14px; }
  .drawer-head:has(+ .drawer-actions) { border-bottom: 1px solid var(--border-subtle); padding-bottom: 12px; }
  .drawer-actions { order: 3; border-bottom: 0; border-top: 1px solid var(--border-subtle); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .drawer-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 42px; }
  .drawer-body { padding: 16px 14px 28px; }
  .event { grid-template-columns: 1fr; gap: 2px; }
  .modal { padding: 10px; }
}

@media (max-width: 720px) {
  /* on a phone the checklist is a short list of what is left, so the board stays on the first screen */
  .setup { margin: 12px 14px 0; padding: 12px 14px; }
  .setup-steps { grid-template-columns: 1fr; gap: 6px; }
  .setup-step { padding: 9px 12px; align-items: center; }
  .setup-step.done, .setup-step .small { display: none; }
  .result-row { grid-template-columns: auto 1fr auto; }
  .result-kpi { display: none; }
  .section-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .section-nav .filter { flex: none; }
}

/* ---- a wide screen: the pages in a rail at the side, the path and the page's actions in the bar on top ----
   The rail and its entries are the styleguide's cd-nav. Under 980px the frame is the header and its tabs, as before. */
.rail, .rail-only { display: none; }
@media (min-width: 980px) {
  .shell { display: flex; align-items: flex-start; }
  .shell-main { flex: 1; min-width: 0; }
  .rail { display: flex; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .rail .cd-nav__brand { text-decoration: none; color: var(--ink-primary); border-radius: var(--radius-sm); }
  .rail .cd-nav__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail .tab-icon { display: block; width: var(--icon-md); height: var(--icon-md); flex: none; }
  .rail .tab-icon svg { display: block; width: 100%; height: 100%; }
  /* the number is what waits for a decision, so it is not set in the faintest ink */
  .rail .cd-nav__count { color: var(--ink-secondary); }
  .rail-foot { margin-top: auto; }
  .rail .menu { margin-top: var(--space-2); }
  .rail .menu-button { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--ink-secondary); }
  .rail .menu-button:hover { background: var(--surface-hover); color: var(--ink-primary); }
  .rail .menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail .avatar { width: 22px; height: 22px; font-size: 10px; }
  .rail .menu-list { top: auto; bottom: calc(100% + 8px); right: auto; left: 0; }
  .shell .topbar .tabs, .shell .topbar .brand, .shell .topbar .brand + .crumb, .shell .topbar .menu, .shell .board-bar .add-card { display: none; }
  .shell .topbar-inner { min-height: 52px; padding: 0 var(--space-8); }
  .shell .project-name { font-weight: 400; color: var(--ink-tertiary); font-size: 13px; }
  .shell .page-name { font-weight: 500; font-size: 13px; }
  .shell .crumb { font-size: 13px; }
  .rail-only { display: inline-flex; }
  span.rail-only { display: inline; }
}

/* ---- shared by every width ---- */
a.btn { text-decoration: none; }
.tab-icon { display: none; }
.setup-toggle { display: inline-flex; align-items: baseline; gap: 5px; border: 0; background: none; padding: 0; text-align: left; cursor: default; }
.team-select { appearance: none; -webkit-appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

/* the record of changes to a product's settings: when, who, what */
.changes { list-style: none; margin: 0; padding: 0; }
.changes li { display: grid; grid-template-columns: 132px 150px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--border-subtle); font-size: 13px; }
.changes li strong { font-weight: 500; overflow-wrap: anywhere; }
.changes li span:last-child { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .changes li { grid-template-columns: 1fr 1fr; gap: 2px 12px; }
  .changes li span:last-child { grid-column: 1 / -1; }
}

/* ---- a phone ----
   Thumbs, not pointers: everything that can be touched is at least 44px tall,
   text that is typed is 16px (below that an iPhone zooms the page in), the
   pages of a product sit in a bar at the bottom, and each screen opens on its
   content instead of on rows of controls. */
@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; -webkit-tap-highlight-color: transparent; }
  button, a, summary, select, label { touch-action: manipulation; }
  h1 { font-size: 24px; letter-spacing: -.02em; }
  .small { font-size: 13px; }
  .mono { font-size: 12.5px; }
  .label, .section h4, .table th { font-size: 12px; }
  .chip { font-size: 12px; padding: 2px 9px; }
  .tag { font-size: 12px; }
  .center { min-height: 100dvh; }

  /* controls */
  .btn, .btn.sm { min-height: 44px; padding: 10px 16px; font-size: 15px; }
  .btn.sm { padding: 8px 14px; font-size: 14px; }
  .input, .select, .textarea { font-size: 16px; min-height: 46px; padding: 10px 12px; }
  .input.mono, .textarea.mono { font-size: 16px; }
  .textarea { min-height: 96px; }
  label.field { font-size: 14px; gap: 6px; }
  label.field .hint { font-size: 13px; }
  .filter { min-height: 40px; padding: 6px 14px; font-size: 14px; }
  .switch { gap: 12px; min-height: 44px; align-items: center; }
  .switch input { width: 46px; height: 28px; }
  .switch input::after { width: 22px; height: 22px; }
  .switch input:checked::after { left: 20px; }
  .option { padding: 14px; }
  .option strong { font-size: 15px; }
  .option span { font-size: 13.5px; }
  .panel { padding: 16px 14px; }
  .page { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; }
  .page-head .btn { width: 100%; justify-content: center; }
  .page .row.wrap > .btn:only-child, form.stack > .row > .btn.primary { flex: 1; justify-content: center; }

  /* the top of the page: product, status, account. It scrolls away with the page. */
  .topbar { position: static; padding-top: env(safe-area-inset-top); }
  .topbar-inner { padding: 8px 12px 8px 14px; min-height: 56px; }
  .brand-mark { width: 30px; height: 30px; border-radius: var(--radius-md); }
  /* the product's name keeps its room; the status gives way first */
  .project-name { font-size: 17px; flex: 0 1 auto; }
  .topbar-inner:has(.project-name) .status-pill { flex: 0 100 auto; }
  .status-pill { font-size: 13px; min-height: 36px; }
  .menu-button { padding: 6px; margin: -6px; }
  .avatar { width: 34px; height: 34px; font-size: 12.5px; }
  .menu-list { position: fixed; left: 10px; right: 10px; top: auto; margin-top: 8px; min-width: 0; padding: 8px; border-radius: var(--radius-lg); }
  .menu-item { padding: 13px 12px; font-size: 16px; border-radius: var(--radius-lg); }
  .menu-who { padding: 10px 12px 12px; }

  /* the pages of a product, in a bar at the bottom */
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); overflow: visible; background: var(--surface-raised); border-top: 1px solid var(--border-subtle); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border-bottom: 0; border-radius: var(--radius-lg); font-size: 11px; font-weight: 600; letter-spacing: .01em; min-width: 0; }
  .tab-icon { display: block; height: 22px; opacity: .75; }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .tab .count { display: none; }
  .tab.active { color: var(--accent-text); }
  .topbar .tab.active { border-bottom-color: transparent; }
  .tab.active .tab-icon { opacity: 1; }
  #toast-root { bottom: calc(84px + env(safe-area-inset-bottom)); width: calc(100vw - 28px); }
  .toast { font-size: 14px; padding: 12px 14px; width: 100%; max-width: none; }

  /* board: the column names first, saying where something waits, then the cards */
  .board-page { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .board-bar { padding: 0; min-height: 0; }
  .board-bar .needs { display: none; }
  .add-card { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 50px !important; padding: 0 20px !important; font-size: 15px !important; border-radius: var(--radius-full) !important; }
  .column-tabs { position: sticky; top: 0; z-index: 12; gap: 6px; padding: 10px 14px 8px; background: var(--surface-canvas); border-bottom: 1px solid transparent; }
  .column-tab { min-height: 40px; padding: 8px 14px; font-size: 14px; display: inline-flex; align-items: center; }
  .column-tab .n { margin-left: 7px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; opacity: 1; background: var(--surface-sunken); color: var(--ink-secondary); }
  .column-tab[aria-selected="true"] .n { background: var(--surface-raised); color: inherit; }
  .column-tab[data-signal="waiting"] .n { background: var(--warning-subtle); color: var(--warning-text); }
  .column-tab[data-signal="stuck"] .n { background: var(--danger); color: var(--ink-inverse); }
  .board-filters { padding: 2px 14px 4px; overflow: visible; }
  .board-filters .grow { display: block; }
  .board-filters .filter { min-height: 40px; font-size: 14px; padding: 4px 14px; }
  .board-filters .team-select { font-size: 16px; padding-right: 32px; max-width: 60vw; color: var(--ink-primary); }
  .board { padding: 8px 14px 0; }
  .column { gap: 10px; }
  .card { padding: 14px; gap: 8px; border-radius: var(--radius-lg); }
  .card-top { font-size: 12.5px; }
  .card-title { font-size: 16px; line-height: 1.3; }
  .card-why { font-size: 14px; line-height: 1.45; padding-left: 10px; }
  .card-facts { font-size: 13px; }
  .card-alert { font-size: 13px; padding: 7px 10px; border-radius: var(--radius-md); }
  .card-actions { gap: 8px; margin-top: 4px; }
  .card-actions .btn { min-height: 44px; }
  .column-empty { padding: 28px 14px; font-size: 14px; }
  .column-note { font-size: 14px; padding: 12px 14px; border-radius: var(--radius-lg); }

  /* the checklist is one line until it is opened */
  .setup { margin: 12px 14px 0; padding: 4px 6px 4px 14px; gap: 0; }
  .setup-toggle { min-height: 44px; align-items: center; flex: 1; cursor: pointer; }
  .setup-chevron { margin-left: 8px; color: var(--ink-tertiary); font-size: 18px; }
  .setup.open .setup-chevron { transform: rotate(90deg); }
  .setup:not(.open) .setup-steps { display: none; }
  .setup.open { padding-bottom: 12px; }
  .setup.open .setup-steps { padding-right: 8px; margin-top: 4px; }
  .setup-step { min-height: 46px; }
  .setup-label { font-size: 14px; }

  /* a card or a run fills the screen; what you can do with it stays at the bottom */
  .drawer { padding-top: env(safe-area-inset-top); }
  .drawer h2 { font-size: 20px; }
  .drawer-head .close { width: 44px; min-width: 44px; padding: 0; justify-content: center; font-size: 17px; margin: -6px -8px 0 0; }
  .drawer-actions { gap: 8px; }
  .drawer-actions .btn { min-height: 46px; }
  .drawer-body { gap: 18px; overscroll-behavior: contain; }
  .prose.lead { font-size: 16px; }
  .evidence-item { padding: 12px; border-radius: var(--radius-lg); }
  .evidence-item .source { font-size: 13px; }
  .evidence-item .ref { font-size: 12.5px; }
  details.fold > summary { min-height: 48px; padding: 10px 14px; }
  .callout { font-size: 14px; padding: 12px; border-radius: var(--radius-lg); }
  .diff { font-size: 12.5px; }
  .event time { font-size: 12.5px; }
  .log { font-size: 12.5px; gap: 8px; }
  .log .line { grid-template-columns: 1fr; gap: 1px; }
  .log time { font-size: 12px; }
  .evidence-item details.source > summary { display: inline-block; padding: 12px 0; margin: -10px 0; }
  .log .say { font-size: 14.5px; }
  /* a long step shows its first lines; a touch opens it */
  .log .line:not(.open) .tool, .log .line:not(.open) .info { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

  /* a form comes up from the bottom, with its buttons under the thumb */
  .modal { padding: 0; place-items: end stretch; }
  .modal-box { width: 100%; max-height: 92dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 20px 16px 0; gap: 16px; overscroll-behavior: contain; }
  .modal-box h2 { font-size: 19px; }
  .modal-actions { position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface-raised); border-top: 1px solid var(--border-subtle); flex-direction: row-reverse; }
  .modal-actions .btn { flex: 1; justify-content: center; min-height: 48px; }
  .modal-box .grid-2 { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* teams */
  .team { padding: 16px 14px; border-radius: var(--radius-lg); }
  .team-stats { gap: 8px; }
  .team-stat { min-height: 40px; padding: 6px 14px; font-size: 14px; }
  .kpis { grid-template-columns: 1fr; }
  .kpi { padding: 14px; border-radius: var(--radius-lg); }
  .kpi-name { font-size: 15px; }
  .kpi-target-line { font-size: 14px; }
  .kpi-target-by { font-size: 13px; }
  .kpi-no-target { min-height: 40px; padding: 6px 14px; font-size: 14px; }
  .kpi-about { font-size: 13.5px; }
  .kpi-foot { font-size: 13px; }
  .kpi .value { font-size: 32px; }

  /* numbers in pairs, and the list of runs as cards instead of a table that runs off the screen */
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .fact { padding: 10px 12px; border-radius: var(--radius-lg); }
  .lead-line { font-size: 16px; }
  .result-row { min-height: 48px; }
  .table-wrap { overflow: visible; }
  .table, .table tbody, .table td { display: block; }
  .table thead { display: none; }
  .table { border: 0; background: none; border-radius: 0; overflow: visible; }
  .table tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 14px; margin-bottom: 8px; background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
  .table td { padding: 0; border: 0; }
  .table td:nth-child(1) { flex: 1 1 0; min-width: 0; font-size: 15px; }
  .table td:nth-child(3) { flex: 0 0 100%; max-width: none !important; font-size: 14px; margin: 2px 0; overflow-wrap: anywhere; }
  .table td:nth-child(3):empty { display: none; }
  .table td:nth-child(n+4) { font-size: 12.5px; color: var(--ink-secondary); }
  .table td[data-label]::before { content: attr(data-label) " "; color: var(--ink-tertiary); }
  .table td:nth-child(n+4):not(:last-child)::after { content: " ·"; color: var(--ink-tertiary); }

  /* settings: the section names stay within reach while the page scrolls */
  .section-nav { position: sticky; top: 0; z-index: 12; margin: 0 -14px 10px; padding: 8px 14px; background: var(--surface-canvas); gap: 8px; }
  .page .panel { scroll-margin-top: 68px; }
  .product-hero { padding: 18px 16px; border-radius: var(--radius-lg); }
  .product-lead { font-size: 20px; }
  .product-rest { font-size: 15px; }
  .product-block, .steer { padding: 16px 14px; }
  .product-page h2 { font-size: 16px; }
  .product-stat { min-height: 40px; align-items: center; font-size: 14px; }
  .product-nudge { font-size: 14px; padding: 12px 14px; }
  .noticed li { font-size: 15px; }
  .areas { grid-template-columns: 1fr; }
  .area h3 { font-size: 15.5px; }
  .area-about { font-size: 14px; }
  .area-team { font-size: 14px; min-height: 32px; }
  .area-code > summary { font-size: 13px; padding: 8px 0; }
  .product-page .product-top .btn { width: auto; }
  .schedule .select, .schedule .btn { width: 100%; justify-content: center; }
  .schedule input[type="time"] { width: 100%; }
  .service { padding: 14px; border-radius: var(--radius-lg); }
  .service > .spread { flex-direction: column; align-items: stretch; }
  .service > .spread .btn { justify-content: center; }
  .repo-option { min-height: 52px; padding: 12px 14px; border-radius: var(--radius-lg); }
  .repo-list { max-height: 46dvh; }
  .project-card { padding: 16px 14px; border-radius: var(--radius-lg); }

  /* signing in */
  .center:has(.login) { padding: 16px; place-items: start center; padding-top: max(8dvh, 24px); }
  .center:has(.login) .login { padding: 24px 20px; }
  .center:has(.login) .btn.primary, .center:has(.login) .input { min-height: 50px; }
}

/* a small phone: the seven pages still fit */
@media (max-width: 360px) {
  .tab { font-size: 10.5px; }
  .status-pill span.text { max-width: 34vw; }
}
