/* ProjectHub — minimal. Light/dark via tokens. */

/* Palette: teal (accent: buttons, current page, highlights) and light blue (links), on cool neutrals. */
:root {
    --bg: #f3f8f9;
    --surface: #ffffff;
    --surface-2: #e8f3f5;
    --text: #102a2e;
    --muted: #5b7277;
    --border: #d3e4e8;
    --accent: #0b6f78;
    --accent-text: #ffffff;
    --accent-soft: #d6eef0;
    --guides-bg: #8fd8d3; /* the Guides button (HUB-0102): a lighter teal than + New, with dark text */
    --guides-text: #05363a;
    --link: #0369a1;
    --brand-grad: linear-gradient(90deg, #0b6f78, #0ea5c6 55%, #7dd3fc);
    --danger: #c92a2a;
    --success: #2b8a3e;
    --warning: #b35c00;
    --focus: #0b6f7855;
    /* Palette for priority, status and type chips (always shown with a word, never colour alone). */
    --c-red: #e03131;
    --c-orange: #d9480f;
    --c-amber: #b35c00;
    --c-yellow: #946c00;
    --c-green: #2b8a3e;
    --c-teal: #0b7285;
    --c-blue: #1971c2;
    --c-violet: #6741d9;
    --c-slate: #495057;
    --c-grey: #868e96;
    --on-solid: #ffffff;
    --solid-hover: brightness(.92); /* solid buttons on hover: darker under white text, lighter under dark text */
    /* Mark done on hover: a lighter green in both themes, with text that stays readable on it (HUB-0092). */
    --done-hover-bg: color-mix(in srgb, var(--c-green) 22%, var(--surface)); --done-hover-fg: color-mix(in srgb, var(--c-green) 70%, var(--text));
    --tint: 11%;
    --p-blue: #1c7ed6; --p-teal: #0ca678; --p-violet: #7950f2; --p-orange: #f76707; --p-green: #37b24d; --p-pink: #d6336c;
    --p-cyan: #1098ad; --p-amber: #f59f00; --p-indigo: #4263eb; --p-lime: #74b816; --p-rose: #e03131; --p-brown: #a0522d;
    --ptint: 7%;
    --radius: 8px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0e1a1d;
        --surface: #142428;
        --surface-2: #1b3136;
        --text: #e3f1f3;
        --muted: #93adb2;
        --border: #28434a;
        --accent: #4fd1c5;
        --accent-text: #04201d;
        --accent-soft: #173f42;
        --guides-bg: #a8ece6;
        --guides-text: #04201d;
        --link: #7dd3fc;
        --brand-grad: linear-gradient(90deg, #2bb3a8, #38bdf8 55%, #a5f3fc);
        --danger: #ff8787;
        --success: #69db7c;
        --warning: #ffa94d;
        --focus: #4fd1c566;
        --c-red: #ff8787;
        --c-orange: #ffa94d;
        --c-amber: #ffc078;
        --c-yellow: #ffe066;
        --c-green: #69db7c;
        --c-teal: #66d9e8;
        --c-blue: #74c0fc;
        --c-violet: #b197fc;
        --c-slate: #ced4da;
        --c-grey: #909296;
        --on-solid: #0e1a1d;
        --solid-hover: brightness(1.1);
        --done-hover-bg: color-mix(in srgb, var(--c-green) 65%, #fff); --done-hover-fg: var(--on-solid);
        --tint: 18%;
        --p-blue: #4dabf7; --p-teal: #38d9a9; --p-violet: #9775fa; --p-orange: #ff922b; --p-green: #69db7c; --p-pink: #f783ac;
        --p-cyan: #3bc9db; --p-amber: #fcc419; --p-indigo: #748ffc; --p-lime: #a9e34b; --p-rose: #ff8787; --p-brown: #d9a27a;
        --ptint: 11%;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0e1a1d;
    --surface: #142428;
    --surface-2: #1b3136;
    --text: #e3f1f3;
    --muted: #93adb2;
    --border: #28434a;
    --accent: #4fd1c5;
    --accent-text: #04201d;
    --accent-soft: #173f42;
    --guides-bg: #a8ece6;
    --guides-text: #04201d;
    --link: #7dd3fc;
    --brand-grad: linear-gradient(90deg, #2bb3a8, #38bdf8 55%, #a5f3fc);
    --danger: #ff8787;
    --success: #69db7c;
    --warning: #ffa94d;
    --focus: #4fd1c566;
    --c-red: #ff8787;
    --c-orange: #ffa94d;
    --c-amber: #ffc078;
    --c-yellow: #ffe066;
    --c-green: #69db7c;
    --c-teal: #66d9e8;
    --c-blue: #74c0fc;
    --c-violet: #b197fc;
    --c-slate: #ced4da;
    --c-grey: #909296;
    --on-solid: #0e1a1d;
    --solid-hover: brightness(1.1);
    --done-hover-bg: color-mix(in srgb, var(--c-green) 65%, #fff); --done-hover-fg: var(--on-solid);
    --tint: 18%;
    --p-blue: #4dabf7; --p-teal: #38d9a9; --p-violet: #9775fa; --p-orange: #ff922b; --p-green: #69db7c; --p-pink: #f783ac;
    --p-cyan: #3bc9db; --p-amber: #fcc419; --p-indigo: #748ffc; --p-lime: #a9e34b; --p-rose: #ff8787; --p-brown: #d9a27a;
    --ptint: 11%;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    -webkit-text-size-adjust: 100%;
}

/* One link style (HUB-0093): link colour and a thin, lighter underline that is always on (so a link never depends on
   colour alone), full strength on hover and focus. Visited links keep the colour. `.link` gives the same look to things
   that act like links but aren't <a> (a <summary>); `.item-key` makes item keys alike everywhere. The exceptions are
   styled as what they are: buttons (.btn), the main nav and project view buttons, whole-card links, and title links. */
a, .link {
    color: var(--link);
    text-decoration: underline 1px color-mix(in srgb, currentColor 40%, transparent);
    text-underline-offset: 2px;
}
a:hover, a:focus-visible, .link:hover, .link:focus-visible { text-decoration-color: currentColor; }
.item-key { font-family: var(--mono); font-size: .9em; white-space: nowrap; }
/* Titles that link, in rows and cards: the text colour, underlined on hover and focus. */
.item-title, .board-card-title, .portal-item-title, .decision-title a:not(.item-key) { color: var(--text); text-decoration: none; }
.item-title:is(:hover, :focus-visible), .board-card-title:is(:hover, :focus-visible), .portal-item-title:is(:hover, :focus-visible),
.decision-title a:not(.item-key):is(:hover, :focus-visible) { text-decoration: underline 1px currentColor; text-underline-offset: 2px; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
code, pre { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }

.container { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }

/* Top bar */
.topbar {
    display: flex; align-items: center; gap: 1rem;
    padding: calc(.5rem + 3px) 1rem .5rem; border-bottom: 1px solid var(--border);
    background: var(--brand-grad) top / 100% 3px no-repeat, var(--surface);
    position: sticky; top: 0; z-index: 10;
}
.brand { flex: none; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
/* The main nav takes what's left of the one row (HUB-0106). app.js moves the links that don't fit into "More", from the
   end; without JavaScript they wrap instead, so none is ever cut off. */
.mainnav { display: flex; align-items: center; gap: .25rem; flex: 1 1 0; min-width: 0; }
.mainnav-links { display: flex; flex-wrap: wrap; gap: .25rem; min-width: 0; }
.js .mainnav-links { flex-wrap: nowrap; overflow: hidden; }
.mainnav a {
    color: var(--muted); text-decoration: none; padding: .35rem .6rem; border-radius: 6px; white-space: nowrap;
}
.mainnav a:hover { color: var(--text); background: var(--surface-2); }
.mainnav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.nav-more { position: relative; flex: none; }
.nav-more > summary { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem; border-radius: 6px;
    color: var(--muted); cursor: pointer; white-space: nowrap; }
.nav-more > summary:hover, .nav-more[open] > summary { color: var(--text); background: var(--surface-2); }
.nav-more.is-current > summary { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.nav-more-list { position: absolute; left: 0; top: calc(100% + .35rem); z-index: 30; display: flex; flex-direction: column; gap: .1rem;
    min-width: 12rem; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.topbar-actions { flex: none; display: flex; gap: .5rem; align-items: center; }
.topbar-actions form { margin: 0; }
.sign-out { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }

/* "Go to item" box (HUB-0060) */
.lookup { position: relative; display: flex; gap: .25rem; align-items: center; }
.workspace-switch { display: flex; align-items: center; gap: .4rem; }
.workspace-switch label { margin: 0; font-size: .875rem; color: var(--muted); }
.workspace-switch select { min-width: 8rem; max-width: 12rem; padding: .25rem .5rem; font-size: .875rem; }
.topbar-actions .lookup-input { width: 9.5rem; padding: .3rem .55rem; font-size: .9rem; font-family: var(--mono); }
.lookup-input::placeholder { font-family: var(--font); }
.lookup-list { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 30; list-style: none; margin: 0; padding: .3rem;
    width: min(26rem, calc(100vw - 2rem)); background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.lookup-list li { display: flex; gap: .6rem; align-items: baseline; padding: .35rem .5rem; border-radius: 6px; cursor: pointer; }
.lookup-list li[aria-selected="true"], .lookup-list li:hover { background: var(--accent-soft); }
.lookup-list .lookup-key { font-family: var(--mono); font-size: .85rem; white-space: nowrap; color: var(--accent); }
.lookup-list .lookup-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lookup-list .lookup-status { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.lookup-list .lookup-empty { color: var(--muted); cursor: default; }
.lookup-list .lookup-empty:hover { background: none; }
/* The same lookup inside a form field (New Item's "Can start after"): a stacked field, list under the box. */
.lookup.lookup-field { display: block; position: relative; }
.lookup-field .lookup-list { left: 0; right: auto; top: auto; margin-top: .2rem; min-width: 100%; }
.lookup-picked { color: var(--success); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Narrower windows: the nav folds first (app.js); then "Go" goes (Return does the same) and the box narrows; on a phone
   the logo stands alone, "+ New" is just "+" and the icons close up. The row wraps only as a last resort. */
@media (max-width: 1240px) {
    .topbar-actions .lookup-input { width: 7.5rem; }
    .lookup .lookup-go { display: none; }
}
@media (max-width: 720px) {
    .topbar { gap: .3rem; padding-left: .5rem; padding-right: .5rem; flex-wrap: wrap; }
    .brand-name { display: none; }
    .topbar-actions { gap: .2rem; white-space: nowrap; margin-left: auto; }
    .topbar-actions .lookup-input { width: 4.1rem; padding: .3rem .25rem; font-size: .85rem; }
    .topbar-actions .lookup-input::placeholder { font-size: .72rem; }
    .topbar-actions .bell { width: 1.6rem; }
    .topbar-actions .theme-toggle { padding: .3rem .3rem; }
    .topbar-actions .btn-guides { padding-left: .4rem; padding-right: .4rem; font-size: .8rem; }
    .new-label { display: none; }
    .nav-more > summary { padding: .35rem .3rem; gap: .25rem; }
    .nav-more-label { display: none; }
    .workspace-switch select { min-width: 0; max-width: 7rem; }
    /* The list hangs from the (sticky, so positioned) top bar, full width, instead of off the box's right edge. */
    .lookup { position: static; }
    .lookup-list { left: .5rem; right: .5rem; top: calc(100% - .25rem); width: auto; }
}

/* Cards and forms */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem;
}
/* Settings → Agents & tokens: the set-up options for each kind of agent, spaced apart. */
.agents-snippet + .agents-snippet { margin-top: .75rem; }
.agents-snippet > summary { cursor: pointer; }
.agents-snippet[open] > summary { margin-bottom: .5rem; }
.narrow { max-width: 420px; margin: 3rem auto; }
/* The beta agreement (HUB-0023): two cards at reading width. */
.agreement { max-width: 680px; margin: 2rem auto; }

label { display: block; font-weight: 500; margin: 0 0 .3rem; }
.field { margin-bottom: 1rem; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .25rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], input[type="url"], input[type="number"], select, textarea {
    width: 100%; padding: .55rem .7rem; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent);
}
.password-wrap { position: relative; display: block; font-weight: 400; }
.password-wrap input { padding-right: 4.2rem; }
.password-toggle {
    position: absolute; top: 50%; right: .35rem; transform: translateY(-50%);
    padding: .2rem .55rem; font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer;
    background: transparent; border: 1px solid transparent; border-radius: 4px;
}
.password-toggle:hover { color: var(--text); border-color: var(--border); }
input.code-input { font-family: var(--mono); font-size: 1.25rem; letter-spacing: .2em; text-align: center; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .5rem .9rem; font: inherit; font-weight: 500; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
/* Solid buttons keep their colour on hover and focus (HUB-0092); .btn:hover would make them pale. */
.btn-primary:hover, .btn-primary:focus-visible { background: var(--accent); border-color: var(--accent); filter: var(--solid-hover); }
.btn-guides, .btn-guides:hover, .btn-guides:focus-visible { background: var(--guides-bg); border-color: var(--guides-bg); color: var(--guides-text); }
.btn-guides:hover, .btn-guides:focus-visible { filter: var(--solid-hover); }
.btn-guides[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--guides-text); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-block { width: 100%; }

/* Flash messages */
.flash { padding: .65rem .9rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid var(--border); background: var(--surface); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.flash-success { border-color: var(--success); color: var(--success); }
.flash-warning { border-color: var(--warning); }

.error-detail { white-space: pre-wrap; overflow-x: auto; background: var(--surface-2); padding: .75rem; border-radius: 6px; font-size: .8rem; }

/* MFA */
.qr { background: #fff; padding: .75rem; border-radius: var(--radius); width: 220px; margin: 0 auto 1rem; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-family: var(--mono); word-break: break-all; background: var(--surface-2); padding: .5rem; border-radius: 6px; }
.recovery-codes { columns: 2; font-family: var(--mono); background: var(--surface-2); padding: .75rem 1rem; border-radius: 6px; list-style: none; }

.mt { margin-top: .75rem; }

/* Page structure */
.page-head, .section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.page-head { margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.section-head h2 { margin-bottom: .5rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.eyebrow { margin: 0 0 .25rem; color: var(--muted); font-size: .85rem; }
.mono { font-family: var(--mono); }
.small { font-size: .85rem; }
.empty { text-align: center; color: var(--muted); }
.stack > * + * { margin-top: .75rem; }
.stack label { font-weight: 500; }
.stack label input { margin-top: .25rem; font-weight: 400; }
.form-card { max-width: 760px; }
.form-card + .form-card { margin-top: 1rem; }
.form-card > h2:first-child { margin-top: 0; }
.form-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.field-error { color: var(--danger); font-size: .85rem; margin: .25rem 0 0; }
.field-warning { border-left: 3px solid var(--warning); padding: .35rem .6rem; font-size: .85rem; margin: .35rem 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 0 1rem; }
.grid-even { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-even { grid-template-columns: 1fr; } }
/* A project's Settings (HUB-0091): as wide as the other project views; the cards below go two-up on wide screens. */
.form-card.is-wide { max-width: none; }
.settings-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1rem; margin-top: 1rem; align-items: start; }
.settings-cards > .form-card { max-width: none; margin: 0; }
.btn-sm { padding: .25rem .55rem; font-size: .85rem; }
.badge {
    display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: .75rem; font-weight: 500;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); vertical-align: middle; white-space: nowrap;
}
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: .3rem 0; }

/* Projects */
.project-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem; }
.project-link { text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.project-link .code { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.project-link .name { font-weight: 600; font-size: 1.05rem; }
.project-link:hover .name { color: var(--accent); }
.brief-editor { min-height: 60vh; font-size: .9rem; line-height: 1.55; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-weight: 500; color: var(--muted); font-size: .85rem; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .row-actions { text-align: right; white-space: nowrap; }
.is-archived td { color: var(--muted); }
/* Every collapsible (HUB-0095): a chevron at the start of its summary, right when closed and down when open. It is
   inline-block, so a link-like summary's underline stays under the words. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
    content: ""; display: inline-block; flex: none; width: .42em; height: .42em; margin: 0 .55em 0 .1em; vertical-align: .18em;
    border: solid currentColor; border-width: 0 .13em .13em 0; transform: rotate(-45deg); transition: transform .15s;
}
details[open] > summary::before { transform: rotate(45deg); vertical-align: .3em; }
details > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { details > summary::before { transition: none; } }
.inline-edit[open] form, .add-component[open] form { margin-top: .5rem; text-align: left; min-width: 260px; }
.add-component { margin-top: 1rem; max-width: 520px; }

/* Rendered Markdown */
.prose { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose pre { background: var(--surface-2); padding: .75rem; border-radius: 6px; overflow-x: auto; }
.prose code { background: var(--surface-2); padding: .1rem .3rem; border-radius: 4px; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--border); padding: .3rem .5rem; }
.prose blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--border); color: var(--muted); }
.prose img { max-width: 100%; }
.criteria-count { font-weight: 400; margin-left: .4rem; }
/* HUB-0121: a criterion's box is a button (works without JS); drawn like a checkbox. */
.criterion-box { display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; padding: 0; margin: 0 .2rem 0 0;
    vertical-align: -.15rem; border: 1.5px solid var(--muted); border-radius: 3px; background: var(--surface); cursor: pointer; }
.criterion-box:hover, .criterion-box:focus-visible { border-color: var(--accent); }
.criterion-box[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.criterion-box[aria-pressed="true"]::after { content: ''; width: .3rem; height: .55rem; margin-top: -.1rem;
    border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.criterion-box[aria-busy="true"] { opacity: .5; }
.criterion-by { margin-left: .35rem; white-space: nowrap; }
/* A criterion's number replaces its list marker, so "criterion 3" is easy to find. */
.criteria li:has(> .criterion-num, > p > .criterion-num) { list-style: none; }
.criterion-num { display: inline-block; min-width: 1.6em; margin-left: -1.6em; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Quick capture */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.capture-card { max-width: 760px; }
.capture-dialog {
    width: min(720px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 1rem 1.25rem 1.25rem;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.capture-dialog::backdrop { background: rgba(10, 10, 15, .45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.dialog-head h2 { margin: 0; font-size: 1.1rem; }
.capture-text { min-height: 9rem; font-size: 1rem; }
/* HUB-0056: dictation into the description. */
.capture-dictate { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .35rem; }
.capture-dictate .hint { margin: 0; }
.capture-dictate [data-dictate][aria-pressed="true"] { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 .25rem; }
.chip {
    display: inline-flex; align-items: center; gap: .25rem; margin: 0; padding: .1rem .2rem .1rem .65rem;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-weight: 400; font-size: .85rem;
}
.chip .chip-label { color: var(--muted); }
.chip select { width: auto; border: 0; background: transparent; padding: .25rem 1.4rem .25rem .2rem; font-size: .85rem; font-weight: 500; }
.chip.is-suggested { border-style: dashed; border-color: var(--accent); }
.chip-reasons { min-height: 1.2em; margin: .1rem 0 .6rem; }
.capture-more { margin-bottom: .75rem; }
.capture-more summary { display: inline-block; padding: .3rem .7rem; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--accent); font-weight: 500; }
.capture-more summary:hover { border-color: var(--accent); background: var(--accent-soft); }
.capture-more[open] summary { margin-bottom: .5rem; }
.capture-more-hint { margin: 0 0 .5rem; }
.capture-more .field .hint { margin: .2rem 0 0; }
.dropzone { border: 1px dashed var(--border); border-radius: 8px; padding: .6rem .75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.dropzone.is-over { border-color: var(--accent); background: var(--surface-2); }
.dropzone .hint { flex-basis: 100%; margin: 0; }
.file-list { list-style: none; margin: 0; padding: 0; flex-basis: 100%; font-size: .85rem; }
.file-list:empty { display: none; }
.capture-actions { margin-top: 1rem; }
/* HUB-0065: the way to the Assistant stands out, in violet with its ✨. */
.capture-assistant, .assistant-cta { border-color: color-mix(in srgb, var(--c-violet) 45%, var(--border));
    background: color-mix(in srgb, var(--c-violet) 10%, var(--surface)); color: var(--c-violet); white-space: normal; text-align: left; }
/* HUB-0098: its own line under the buttons, shown only to someone with an assistant. */
.capture-assistant { display: block; width: 100%; margin-top: .75rem; }
.capture-assistant:hover, .assistant-cta:hover { border-color: var(--c-violet); background: color-mix(in srgb, var(--c-violet) 18%, var(--surface)); color: var(--c-violet); }

/* HUB-0065: the ? next to a page title, and the short guide it opens (a native popover, centred like a small dialog). */
.help-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; padding: 0;
    margin-left: .35rem; vertical-align: .15em; border: 1px solid var(--border); border-radius: 50%; background: var(--surface);
    color: var(--muted); font: 600 .8rem/1 var(--font); cursor: pointer; flex: none; }
.help-btn:hover, .help-btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.help-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.help-pop { width: min(26rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; margin: auto; padding: 1rem 1.1rem;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
    box-shadow: 0 12px 40px rgb(0 0 0 / .25); font-size: .95rem; line-height: 1.45; }
.help-pop::backdrop { background: rgb(0 0 0 / .25); }
.help-pop-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.help-pop-head h2 { margin: 0; font-size: 1.05rem; }
.help-pop p { margin: .4rem 0; }
.help-pop ul { margin: .4rem 0; padding-left: 1.2rem; }
.help-pop li { margin: .2rem 0; }
.help-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; }
.help-pop-foot .small { margin-left: auto; }
/* A view's name sits in a fixed-width box (HUB-0061): the name shortens, the ? stays visible. */
.view-head .view-title:has(.help-btn) { display: flex; align-items: center; }
.view-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.capture-assistant-star { font-size: 1.05em; }
kbd { font-family: var(--mono); font-size: .75rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; }
@media (max-width: 600px) {
    .capture-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
    .keyboard-hint { display: none; }
    .capture-actions .btn { flex: 1; }
}

/* Toasts */
.toasts { position: fixed; bottom: 1rem; right: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; max-width: calc(100vw - 2rem); }
.toast {
    background: var(--text); color: var(--bg); padding: .6rem .9rem; border-radius: 8px; text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .2); transition: opacity .5s; font-size: .9rem;
}
.toast-hide { opacity: 0; }

/* Item detail */
.item-head h1 { margin: .1rem 0 .5rem; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: 1.25rem; }
.badge-client { color: var(--accent); border-color: var(--accent); }
.badge-warn { color: var(--warning); border-color: var(--warning); }
.badge-tag { background: transparent; }

/* Colour chips: --c picks the colour; the chip is a light tint of it with coloured text. */
.prio-P0, .prio-P1, .prio-P2, .prio-P3, .prio-P4, .type,
.status-inbox, .status-triaged, .status-ready, .status-in_progress, .status-awaiting_review,
.status-blocked, .status-completed, .status-deferred, .status-cancelled {
    color: var(--c, var(--c-grey)); border-color: color-mix(in srgb, var(--c, var(--c-grey)) 40%, transparent);
    background: color-mix(in srgb, var(--c, var(--c-grey)) var(--tint), var(--surface));
}
.prio-P0 { --c: var(--c-red); background: var(--c); color: var(--on-solid); font-weight: 600; }
.prio-P1 { --c: var(--c-orange); background: var(--c); color: var(--on-solid); font-weight: 600; }
.prio-P2 { --c: var(--c-blue); }
.prio-P3 { --c: var(--c-slate); }
.prio-P4 { --c: var(--c-grey); background: transparent; border-style: dashed; }

.status-inbox { --c: var(--c-grey); }
.status-triaged { --c: var(--c-slate); }
.status-ready { --c: var(--c-blue); }
.status-in_progress { --c: var(--c-violet); }
.status-awaiting_review { --c: var(--c-amber); font-weight: 600; }
.status-blocked { --c: var(--c-red); font-weight: 600; }
.status-completed { --c: var(--c-green); }
.status-deferred { --c: var(--c-yellow); }
.status-cancelled { --c: var(--c-grey); text-decoration: line-through; }

.type { --c: var(--c-grey); }
.type-bug { --c: var(--c-red); }
.type-issue { --c: var(--c-orange); }
.type-feature { --c: var(--c-violet); }
.type-improvement { --c: var(--c-teal); }
.type-task { --c: var(--c-slate); }
.type-idea { --c: var(--c-yellow); }
.type-request { --c: var(--c-blue); }
.type-decision { --c: var(--c-grey); }

/* Attention: overdue dates, P0/P1 edges on cards and list rows. */
.overdue { color: var(--c-red); font-weight: 600; }
.edge-P0 { box-shadow: inset 4px 0 0 var(--c-red); }
.edge-P1 { box-shadow: inset 4px 0 0 var(--c-orange); }
tr.edge-P0 > td:first-child { box-shadow: inset 3px 0 0 var(--c-red); }
tr.edge-P1 > td:first-child { box-shadow: inset 3px 0 0 var(--c-orange); }
tr.edge-P0, tr.edge-P1 { box-shadow: none; }
.item-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .item-layout { grid-template-columns: 1fr; } }
.item-main > section + section { margin-top: 1.5rem; }
/* Wide content (code blocks, long URLs) scrolls inside its card instead of pushing under the sidebar (HUB-0025). */
.item-main, .item-main .card, .comment, .timeline { min-width: 0; }
.item-side { display: flex; flex-direction: column; gap: 1rem; }
.item-side h2 { font-size: 1rem; margin: 0 0 .5rem; }
.side-form label { display: block; font-size: .85rem; margin-bottom: .6rem; }
.side-form label select, .side-form label input, .side-form label textarea { margin-top: .2rem; font-size: .9rem; }
.side-form fieldset { border: 1px solid var(--border); border-radius: 6px; padding: .5rem .75rem; margin: .25rem 0 .75rem; }
.side-form legend { font-size: .8rem; color: var(--muted); padding: 0 .25rem; }
.side-form .checkbox { display: flex; gap: .4rem; align-items: center; }
.side-form .checkbox input { width: auto; margin: 0; }
.edit-text { margin-top: 1rem; }
.edit-text[open] form { margin-top: .75rem; }
.edit-text label { display: block; }
.attachments { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
.attachment { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .75rem; }
.attachment > div:nth-child(2), .attachment > div:first-child:not(.attachment-actions) { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.attachment > div > .badge { align-self: flex-start; margin-top: .2rem; }
.attachment-actions { display: flex; gap: .25rem; }
.attachment-actions form, .comment-delete, form.inline { display: inline; margin: 0; }
.thumb { max-width: 160px; max-height: 120px; border-radius: 6px; border: 1px solid var(--border); display: block; }
.inline-upload { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-upload select { width: auto; }
.inline-upload .hint { flex-basis: 100%; margin: 0; }
/* HUB-0073: links to files kept elsewhere */
.file-link { overflow-wrap: anywhere; }
.badge-provider { margin-left: .25rem; font-weight: normal; }
.file-link-note { margin: .2rem 0 0; color: var(--muted); }
.file-link-add { margin-top: .5rem; }
.file-link-add summary, .comment-link summary { font-size: .9rem; }
.file-link-add form { margin-top: .5rem; }
.comment-link .form-actions { margin-top: .4rem; }
.comment-link input { flex: 1 1 12rem; min-width: 0; }
.comments { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
.comment { padding: .75rem 1rem; }
.comment-client { border-left: 3px solid var(--accent); }
.comment-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.comment-delete { margin-left: auto; }
/* HUB-0113: the comment or request number agents cite, linked to itself; one click selects it to copy. */
.ref-num { user-select: all; }
.comment-file { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.comment-form select { width: auto; }
/* HUB-0123: the toggle beside the heading, "＋ New comment" opening the form at the top, and arrows that follow the order. */
.comments-bar { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: baseline; justify-content: space-between; }
.comment-new { margin-bottom: 1rem; }
.comment-new > summary.btn::before { display: none; }
.comment-new[open] > summary { margin-bottom: .6rem; }
#comments[data-order=newest] .arrow-later::after, #comments[data-order=oldest] .arrow-earlier::after { content: "↑"; }
#comments[data-order=newest] .arrow-earlier::after, #comments[data-order=oldest] .arrow-later::after { content: "↓"; }
/* HUB-0097: clarification requests stay visibly open until answered; the answer and the question link to each other. */
.comment-question-open { border-left: 3px solid var(--warning); }
.comment-answered, .comment-reply-to { margin: .4rem 0 0; }
.comment-reply-to { margin: 0 0 .4rem; }
.comment-respond { margin-top: .5rem; }
.comment-respond[open] > summary { margin-bottom: .5rem; }
.comment-respond select { width: auto; }
/* HUB-0111: who a comment @mentions and how they answered; the @ picker; My Work's "Waiting on you". */
.comment-mentions { margin-top: .5rem; padding-top: .4rem; border-top: 1px dashed var(--border); }
.comment-mentions p { margin: .2rem 0; }
.mention-open strong { color: var(--warning); }
.mention-answer { margin-top: .4rem; align-items: flex-start; }
.mention-answer .comment-respond { margin-top: 0; flex-basis: 100%; }
.mention-answer .comment-respond:not([open]) { flex-basis: auto; }
.dropdown.mention-picker { position: static; margin-top: .25rem; max-width: 320px; }
.mention-picker li { cursor: pointer; justify-content: flex-start; border-radius: 4px; }
.mention-picker li.is-active { background: var(--accent-soft, rgba(0,0,0,.06)); }
.waiting { margin-bottom: 1rem; }
.waiting h2 { font-size: 1rem; margin: 0 0 .5rem; }
.waiting-list { list-style: none; margin: 0; padding: 0; }
.waiting-row { display: flex; gap: .6rem; align-items: flex-start; padding: .4rem 0; border-top: 1px solid var(--border); }
.waiting-row:first-child { border-top: 0; }
.waiting-row .badge-waiting { flex: 0 0 6.5rem; text-align: center; }
.badge-waiting-question, .badge-waiting-permission, .badge-waiting-criteria { color: var(--warning); border-color: var(--warning); }
.badge-waiting-mention { color: var(--accent); border-color: var(--accent); }
.waiting-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.waiting-link { font-weight: 600; }
.waiting-excerpt { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waiting-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
    .waiting-row { flex-wrap: wrap; }
    .waiting-row .badge-waiting { flex-basis: auto; }
    .waiting-actions { flex-basis: 100%; justify-content: flex-start; }
}
.comment-form input[type=file] { max-width: 220px; font-size: .85rem; }
.link-row { display: flex; gap: .35rem; align-items: baseline; flex-wrap: wrap; }
.link-form { display: flex; gap: .35rem; margin-top: .5rem; }
.link-form select { width: auto; font-size: .85rem; }
.link-form input { min-width: 0; }
.meta p { margin: 0 0 .5rem; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { padding: .3rem 0 .3rem .9rem; position: relative; font-size: .9rem; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: .75rem; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.timeline-when { margin-left: .35rem; }
.timeline-diff summary { display: inline; }
.diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .4rem; }
.diff-cols pre { white-space: pre-wrap; background: var(--surface-2); padding: .5rem; border-radius: 6px; font-size: .8rem; max-height: 240px; overflow: auto; margin: 0; }
@media (max-width: 600px) { .diff-cols { grid-template-columns: 1fr; } }

/* Item lists */
.count { font-weight: 400; font-size: 1rem; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: 1rem; }
.filter-bar input[type=search] { width: 220px; }
.filter-bar select, .filter-bar input { width: auto; font-size: .85rem; padding: .4rem .5rem; }
.more-filters { display: inline-block; }
.more-filters[open] { flex-basis: 100%; order: 10; }
.more-filters-body { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.tag-input { width: 120px !important; }
.table-wrap { overflow-x: auto; }
.item-table td { vertical-align: middle; }
.item-table th a { color: inherit; text-decoration: none; }
.item-table th a[aria-sort] { color: var(--text); }
.item-title { font-weight: 500; }
.nowrap { white-space: nowrap; }
.pager { display: flex; gap: .75rem; align-items: center; justify-content: center; margin-top: 1rem; }
.save-filter { display: flex; gap: .4rem; margin-top: 1rem; max-width: 420px; }
.saved-filters { position: relative; }
.dropdown { position: absolute; right: 0; top: 2.2rem; z-index: 20; list-style: none; margin: 0; padding: .35rem; min-width: 220px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.dropdown li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .15rem .35rem; }
.show-sm { display: none; }
@media (max-width: 720px) {
    .hide-sm { display: none; }
    .show-sm { display: block; }
    .filter-bar input[type=search] { width: 100%; }
    .item-table td, .item-table th { padding: .5rem .45rem; }
}

/* Inbox */
.keyboard-legend { margin: .25rem 0 0; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .6rem .75rem; margin-bottom: .75rem; position: sticky;
    top: calc(var(--topbar-h, 3.1rem) + var(--page-top-h, 0px)); z-index: 5; } /* under the page head (HUB-0106) */
.bulk-bar select { width: auto; font-size: .85rem; padding: .35rem .5rem; }
.bulk-bar.has-selection { border-color: var(--accent); }
.checkbox-label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; margin: 0 .5rem 0 0; font-size: .9rem; }
.inbox-table td { vertical-align: middle; }
.inbox-table select { font-size: .85rem; padding: .3rem .4rem; min-width: 7rem; }
.inbox-table select.is-suggested { border-style: dashed; border-color: var(--accent); }
.inbox-table select:disabled { opacity: .5; }
.inbox-item { min-width: 220px; }
.inbox-table tr.is-active { box-shadow: inset 3px 0 0 var(--accent); background: var(--surface-2); }
.inbox-table tr.is-selected td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.inbox-table tr:focus { outline: none; }

/* Board */
.view-toggle { display: inline-flex; }
.view-toggle .btn { border-radius: 0; }
.view-toggle .btn:first-child { border-radius: 6px 0 0 6px; }
.view-toggle .btn:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.view-toggle .is-current { background: var(--surface-2); font-weight: 600; cursor: default; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .75rem; align-items: start; }
.board-col {
    --c: var(--c-grey);
    background: color-mix(in srgb, var(--c) 6%, var(--surface-2)); border: 1px solid var(--border);
    border-top: 3px solid var(--c); border-radius: var(--radius); padding: .5rem; min-height: 8rem;
}
.board-col[data-status="triaged"] { --c: var(--c-slate); }
.board-col[data-status="ready"] { --c: var(--c-blue); }
.board-col[data-status="in_progress"] { --c: var(--c-violet); }
.board-col[data-status="awaiting_review"] { --c: var(--c-amber); }
.board-col[data-status="blocked"] { --c: var(--c-red); }
.board-col[data-status="completed"] { --c: var(--c-green); }
.board-col[data-status="deferred"] { --c: var(--c-yellow); }
.board-col[data-status="cancelled"] { --c: var(--c-grey); }
.board-col-head { display: flex; justify-content: space-between; align-items: center; padding: .15rem .25rem .5rem; }
.board-col-title { font-weight: 600; color: var(--c); text-decoration: none; font-size: .9rem; }
.board-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; min-height: 3rem; border-radius: 6px; }
.board-cards.is-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.board-card { padding: .6rem .7rem; }
.board-card[draggable="true"] { cursor: grab; }
.board-card.is-dragging { opacity: .45; }
.board-card.is-saving { opacity: .6; }
.board-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .2rem; }
.board-card-title { display: block; font-weight: 500; overflow-wrap: anywhere; }
.board-card-meta { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.board-move { margin-top: .4rem; display: flex; gap: .35rem; align-items: center; }
/* The Move button is the no-JavaScript fallback; working JavaScript saves on change and hides it. */
.board.js-ready .board-move-save { display: none; }
.board-move select { font-size: .8rem; padding: .2rem .35rem; }
.board-more { display: block; padding: .5rem .25rem 0; }
@media (hover: hover) and (pointer: fine) {
    /* With a mouse (and working JavaScript), drag is the main control; the picker appears on hover/focus. */
    .board.js-ready .board-move { display: none; }
    .board.js-ready .board-card:hover .board-move,
    .board.js-ready .board-card:focus-within .board-move { display: flex; }
}

/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.tile {
    display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; text-decoration: none; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius);
}
.tile:hover { border-color: var(--accent); }
.tile-count { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile-label { color: var(--muted); font-size: .85rem; }
.tile-danger:not(.is-zero) { border-left-color: var(--c-red); background: color-mix(in srgb, var(--c-red) 8%, var(--surface)); }
.tile-danger:not(.is-zero) .tile-count { color: var(--c-red); }
.tile-warning:not(.is-zero) { border-left-color: var(--c-amber); background: color-mix(in srgb, var(--c-amber) 8%, var(--surface)); }
.tile-warning:not(.is-zero) .tile-count { color: var(--c-amber); }
.tile-accent:not(.is-zero) { border-left-color: var(--c-violet); }
.tile.is-zero .tile-count { color: var(--muted); }
.matrix td, .matrix th { white-space: nowrap; }
.matrix .num a { font-weight: 500; }
.matrix .zero { color: var(--border); }
.matrix .strong a { font-weight: 700; }
.matrix tfoot th { background: var(--surface-2); color: var(--text); }
.matrix-status { border-left: 1px solid var(--border); }
.matrix-status ~ .matrix-status { border-left: 0; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.dash-grid h2 { margin: 0 0 .5rem; font-size: 1rem; }
@media (max-width: 760px) { .dash-grid { grid-template-columns: 1fr; } }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.queue li { overflow-wrap: anywhere; }
.timeline-context { font-size: .85rem; }

/* Search */
.search-form { display: flex; gap: .5rem; max-width: 680px; }
.search-form input { font-size: 1rem; }
.search-results { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .6rem; }
.search-results li { padding: .75rem 1rem; }
.search-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.snippet { margin: .35rem 0 .2rem; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
mark { background: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--text); border-radius: 2px; padding: 0 .1em; }

/* Export */
.tab-bar { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .5rem; }
.tab-bar .is-current { background: var(--surface-2); font-weight: 600; }
.tab-actions { margin-left: auto; display: flex; gap: .35rem; flex-wrap: wrap; }
.export-text { min-height: 60vh; font-size: .8rem; line-height: 1.45; white-space: pre; overflow: auto; }
.list-select { width: 1.5rem; }

.theme-toggle { font-size: 1rem; line-height: 1; padding: .3rem .5rem; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.settings-grid h2 { margin-top: 0; }
.settings-grid + .card, .card + .settings-grid { margin-top: 1rem; }
.settings-grid + .card > h2:first-child { margin-top: 0; }
.settings-grid + .card + .card { margin-top: 1rem; }
.settings-grid + .card + .card > h2:first-child { margin-top: 0; }
/* The Settings page (HUB-0090): cards grouped under You and Workspace, in two heights. A link card (icon, title, a line
   or two, a button at the foot) takes one row and a form card two, so rows line up. One column on phones. */
.settings-group { margin: 1.75rem 0 .75rem; }
h1 + .settings-group { margin-top: 0; }
.settings-home { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); grid-auto-rows: minmax(11.5rem, auto); align-items: stretch; }
.settings-home > .card { display: flex; flex-direction: column; min-width: 0; }
.settings-home > .card > p { margin: 0 0 .75rem; }
.settings-home > .card > .btn:last-child { margin-top: auto; align-self: flex-start; }
.settings-home > .settings-card-form { grid-row: span 2; }
.settings-home h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: 1.05rem; }
.settings-icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); }
@media (max-width: 640px) {
    .settings-home { grid-auto-rows: auto; }
    .settings-home > .settings-card-form { grid-row: auto; }
}
.support-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; padding: .45rem 1rem;
    background: var(--surface); color: var(--text); border-bottom: 3px solid var(--warning); font-size: .9rem; text-align: center;
}
.support-banner form { margin: 0; }
.access-detail { overflow-wrap: anywhere; font-family: var(--mono); font-size: .8rem; }
.table .clip-cell { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-code { font-size: 1.35rem; margin: 0 0 .5rem; }
.radio-row { border: 0; padding: 0; margin: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.radio-row label { display: inline-flex; gap: .35rem; align-items: center; font-weight: 400; }
.radio-row input { width: auto; }
.amounts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.amounts th { text-align: left; font-weight: 400; color: var(--muted); padding: .3rem 1rem .3rem 0; }
.amounts td { text-align: right; white-space: nowrap; padding: .3rem 0 .3rem .75rem; }
.amounts .amounts-total > * { border-top: 1px solid var(--border); padding-top: .5rem; }
.amount-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.amount-list li > span { white-space: nowrap; font-size: .875rem; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Environment banner (APP_BANNER), e.g. on staging */
.env-banner {
    background: var(--warning); color: #fff; text-align: center; font-size: .8rem; font-weight: 600;
    padding: .2rem 1rem; letter-spacing: .02em;
}
:root[data-theme="dark"] .env-banner { color: #1b1b1f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .env-banner { color: #1b1b1f; } }

/* Key (priorities and statuses) */
.key { margin: 0 0 1.5rem; padding: .75rem 1rem; }
.key[open] summary { margin-bottom: .6rem; }
.key-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem 2rem; }
@media (max-width: 760px) { .key-grid { grid-template-columns: 1fr; } }
.key dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem .75rem; margin: 0; align-items: baseline; }
.key dt { white-space: nowrap; font-size: .85rem; }
.key dd { margin: 0; font-size: .85rem; color: var(--muted); }
.key .hint { margin: .6rem 0 0; }

/* Settings → Agents & tokens */
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
fieldset.field legend { font-weight: 500; padding: 0; margin-bottom: .3rem; }
fieldset.field > label { font-weight: normal; }
.check-list { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; }
.check-list label { display: flex; align-items: center; gap: .35rem; font-weight: normal; }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.token-box { display: flex; gap: .5rem; margin: 1rem 0; }
.token-box input { flex: 1; min-width: 0; }
/* HUB-0086: the AGENTS.md lines, with Copy under them. */
.snippet-box { flex-direction: column; align-items: flex-start; max-width: 52rem; }
.snippet-box textarea { width: 100%; resize: vertical; font-size: .85rem; }
details.section { margin-top: 1.5rem; }
details.section > summary { margin-bottom: .5rem; }

/* Project colours: a subtle tint per project (projects page, list rows, board cards) and a dot as a key. */
.proj-blue { --pc: var(--p-blue); } .proj-teal { --pc: var(--p-teal); } .proj-violet { --pc: var(--p-violet); }
.proj-orange { --pc: var(--p-orange); } .proj-green { --pc: var(--p-green); } .proj-pink { --pc: var(--p-pink); }
.proj-cyan { --pc: var(--p-cyan); } .proj-amber { --pc: var(--p-amber); } .proj-indigo { --pc: var(--p-indigo); }
.proj-lime { --pc: var(--p-lime); } .proj-rose { --pc: var(--p-rose); } .proj-brown { --pc: var(--p-brown); }
.proj-tint { background-color: color-mix(in srgb, var(--pc, transparent) var(--ptint), var(--surface)); }
tr.proj-tint > td { background-color: color-mix(in srgb, var(--pc, transparent) var(--ptint), var(--surface)); }
.proj-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--pc, var(--border)); margin-right: .35rem; vertical-align: baseline; }
.project-card.proj-tint { border-left: 4px solid var(--pc, var(--border)); }
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch { width: 2rem; height: 2rem; border-radius: 50%; background: var(--pc); cursor: pointer; position: relative; margin: 0; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Full width (board, list and timeline) on big screens, switched per device with the "Full width" button. */
@media (min-width: 1300px) {
    :root[data-wide="1"] main.container:has(.board, .item-table, .tl-scroll) { max-width: none; padding-left: 1.5rem; padding-right: 1.5rem; }
}

.timeline-more > summary { margin: .25rem 0 .5rem; }
.timeline-more[open] > summary { margin-bottom: .25rem; }

/* Assistant */
.assistant-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .assistant-layout { grid-template-columns: minmax(0, 1fr); } .assistant-side { order: 2; position: static; } }
.assistant-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
/* Long titles are cut off with … instead of widening the column over the conversation (HUB-0030). */
.assistant-history, .assistant-history li, .assistant-history a { min-width: 0; max-width: 100%; }
.assistant-side-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0; }
.assistant-head h1 { margin: 0; }
.assistant-history a { display: flex; flex-direction: column; padding: .4rem .5rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.assistant-history a:hover, .assistant-history a[aria-current="page"] { background: var(--surface-2); }
.assistant-history-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-history-project { font-size: .75rem; padding: 0 .3rem; border-radius: 4px; background: var(--surface-2); }
.assistant-filter { display: flex; flex-direction: column; gap: .4rem; }
.assistant-filter select { width: 100%; }
/* Who answers (HUB-0074): a line above the thread, a picker in the composer, rows in Settings → Assistants. */
.assistant-answering { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin: 0 0 .75rem; }
.assistant-answering a { margin-left: auto; }
.assistant-picker { display: flex; align-items: center; gap: .4rem; align-self: flex-start; }
.assistant-picker select { width: auto; }
.assistant-rows { display: flex; flex-direction: column; gap: .75rem; }
.assistant-row { padding: 1rem 1.25rem; }
.assistant-row-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.assistant-row-title { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.assistant-row-meta { margin: .3rem 0 0; }
.assistant-row .hint { margin: .3rem 0 0; }
.assistant-row details { margin-top: .5rem; }
.assistant-row details > form { margin-top: .75rem; }
.assistant-agent-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.assistant-agent-form select { width: auto; min-width: 14rem; max-width: 100%; }
.assistant-endpoint { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.assistant-card > :first-child, .assistant-card > input[type="hidden"]:first-child + * { margin-top: 0; }
.assistant-card > :last-child, .assistant-card > p { margin-bottom: 0; }
.assistant-waiting { border-left: 4px solid var(--accent); }
.assistant-waiting p { margin: 0 0 .3rem; }
.assistant-main h1 { margin-top: 0; }
.assistant-thread { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.assistant-msg-user { align-self: flex-end; max-width: 80%; display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.assistant-bubble { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); padding: .6rem .8rem; border-radius: 12px 12px 2px 12px; overflow-wrap: anywhere; }
.assistant-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.assistant-files li { display: flex; flex-direction: column; align-items: flex-end; }
.assistant-msg-assistant { display: flex; flex-direction: column; gap: .75rem; }
.assistant-reply > :first-child { margin-top: 0; }
.assistant-reply > :last-child { margin-bottom: 0; }
.proposal { display: flex; flex-direction: column; gap: .6rem; padding: .9rem 1rem; border-left: 4px solid var(--pc, var(--border)); }
.proposal.is-created { flex-direction: row; gap: .4rem; align-items: baseline; opacity: .85; }
.proposal-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.proposal-title { font-weight: 600; font-size: 1.05rem; }
.proposal-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.proposal label { font-weight: 500; font-size: .85rem; }
.proposal-files { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.proposal-file { display: flex; align-items: center; gap: .4rem; font-weight: normal; }
.thumb-sm { max-width: 64px; max-height: 48px; border-radius: 4px; border: 1px solid var(--border); }
.assistant-composer { display: flex; flex-direction: column; gap: .5rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .08); }
.assistant-composer.is-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.assistant-composer.is-sending { opacity: .7; pointer-events: none; }
.assistant-composer [data-mic][aria-pressed="true"] { background: color-mix(in srgb, var(--c-red) 15%, var(--surface)); border-color: var(--c-red); color: var(--c-red); }

/* Project page: long briefs and component lists scroll inside their panel ("Show all" expands them). */
.scroll-panel { max-height: 34rem; overflow: auto; overscroll-behavior: contain; }
.scroll-panel.is-expanded { max-height: none; }
.scroll-panel .table { overflow: visible; }
.scroll-panel thead th { position: sticky; top: 0; z-index: 1; }
.scroll-toggle { margin-top: .4rem; }
.component-edit:not(:target) { display: none; }
.component-edit > td { background: var(--surface-2); }
.component-edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; padding: .25rem 0; }
.component-edit-form .span-2 { grid-column: 1 / -1; }
.component-edit-form label { font-weight: 500; font-size: .85rem; }
@media (max-width: 600px) { .component-edit-form { grid-template-columns: 1fr; } }

/* Public front page */
.brand img { vertical-align: -5px; margin-right: .25rem; }
.landing { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 2.5rem; }
.landing-head { display: flex; justify-content: space-between; align-items: center; }
.landing-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.25rem; }
.landing-hero { text-align: center; padding: 2rem 0 .5rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.landing-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.15; margin: 0; max-width: 18em; text-wrap: balance; }
.landing-lead { font-size: 1.1rem; color: var(--muted); max-width: 38em; margin: 0; }
.landing-badge { --c: var(--c-violet); color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); }
.landing-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
/* Four across, or a centred two by two once four no longer fit (never three and one); one column on a phone. */
@media (max-width: 900px) { .landing-features { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; width: 100%; margin-inline: auto; } }
@media (max-width: 520px) { .landing-features { grid-template-columns: 1fr; } }
.landing-feature { border-top: 4px solid var(--fc); }
.landing-feature h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
.landing-feature p { margin: 0; color: var(--muted); }
.f-capture { --fc: var(--c-amber); } .f-attention { --fc: var(--c-red); } .f-agents { --fc: var(--c-violet); } .f-clients { --fc: var(--c-green); }
.landing-beta { max-width: 640px; width: 100%; margin: 0 auto; }
.landing-beta h2 { margin-top: 0; }
/* The button on a line of its own, centred, with its note underneath (not wrapped beside it). */
.landing-beta .form-actions { flex-direction: column; align-items: center; text-align: center; gap: .5rem; }
.landing-beta > .hint { text-align: center; }
.landing-form { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
.landing-form .span-2 { grid-column: 1 / -1; }
.landing-form label { font-weight: 500; }
.landing-website { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.landing-foot { text-align: center; padding-bottom: 1rem; }
.landing-brand { color: inherit; text-decoration: none; }
/* HUB-0012: public /plans. The table scrolls inside its own box on a phone; the page never does. */
.plans-wrap { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.plans-table { margin: 0; }
.plans-table th[scope="row"] { font-weight: 500; min-width: 9em; }
.plans-table thead th { vertical-align: top; min-width: 8em; text-align: center; }
.plans-table td { text-align: center; }
.plans-name { display: block; font-size: 1.15rem; font-weight: 700; }
.plans-price { display: block; font-size: 1.1rem; margin-top: .3rem; }
.plans-billed { display: block; font-weight: 400; }
.plans-soon { margin-top: .4rem; --c: var(--c-violet); color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); font-weight: 500; }
.plans-notes { max-width: 720px; width: 100%; margin: 0 auto; }
.plans-notes h2 { margin-top: 0; }
.plans-notes ul { padding-left: 1.2rem; display: grid; gap: .35rem; }
.plans-selfhost { text-align: center; margin: 0; }
@media (max-width: 600px) {
    .plans-table { font-size: .85rem; }
    .plans-table th, .plans-table td { padding: .45rem .3rem; }
    .plans-table th[scope="row"], .plans-table thead th { min-width: 0; }
    .plans-name, .plans-price { font-size: 1rem; }
    .plans-soon { font-size: .7rem; padding: 0 .35rem; }
}
.upgrade-form { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .75rem; }
.upgrade-form h3 { margin: 0 0 .25rem; font-size: 1rem; }
.upgrade-form label.radio { display: flex; gap: .45rem; align-items: baseline; margin-bottom: .3rem; }
.upgrade-form label.radio input { width: auto; }
@media (max-width: 600px) { .landing-form { grid-template-columns: 1fr; } }

/* Client portal: plain words, lots of colour, clear at first glance */
.portal { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.5rem; }
.portal h1 { margin: 0; }
.portal-org { color: var(--muted); font-weight: 500; }
.portal-block h2 { margin: 0 0 .6rem; }
.portal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.portal-list li { border-left: 4px solid var(--pc, var(--border)); display: flex; flex-direction: column; gap: .35rem; }
.portal-item-title { font-weight: 600; font-size: 1.05rem; }
.portal-item-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.portal-please-check { padding: 1rem; border-radius: var(--radius); background: color-mix(in srgb, var(--c-amber) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-amber) 40%, transparent); }
.portal-please-check h2 { color: var(--c-amber); }
.portal-summaries { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.portal-summary { display: flex; flex-direction: column; gap: .2rem; border-left: 4px solid var(--pc, var(--border)); }
.portal-summary-numbers strong { font-size: 1.3rem; }
.portal-item { border-left: 4px solid var(--pc, var(--border)); display: flex; flex-direction: column; gap: .6rem; }
.portal-item h1 { font-size: 1.5rem; }
.portal-files { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.portal-links { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .25rem; }
.portal-comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.portal-finished > summary { margin: .6rem 0; }
.portal-key dl { margin-top: .6rem; }
.cs, .cp { --c: var(--c-grey); color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); font-weight: 600; font-size: .8rem; padding: .1rem .55rem; }
.cs-received { --c: var(--c-slate); } .cs-planned { --c: var(--c-blue); } .cs-in_progress { --c: var(--c-violet); }
.cs-please_check { --c: var(--c-amber); background: var(--c); color: var(--on-solid); }
.cs-done { --c: var(--c-green); background: var(--c); color: var(--on-solid); } .cs-on_hold { --c: var(--c-orange); } .cs-not_planned { --c: var(--c-grey); }
.cp-P0 { --c: var(--c-red); background: var(--c); color: var(--on-solid); } .cp-P1 { --c: var(--c-orange); }
.cp-P2 { --c: var(--c-blue); } .cp-P3 { --c: var(--c-slate); } .cp-P4 { --c: var(--c-grey); }

.portal .page-head { align-items: center; }
.portal-report-btn { font-size: 1rem; padding: .55rem 1rem; }
.portal-urgency { display: flex; flex-direction: column; gap: .4rem; }
.portal-urgency-option { display: flex; align-items: center; gap: .5rem; font-weight: normal; }
.portal-reply { margin: 0 0 .75rem; }

/* ---- Notifications ---------------------------------------------------------------------------- */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
    border-radius: var(--radius); color: var(--muted); text-decoration: none; }
.bell:hover, .bell[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.bell.has-unread { color: var(--text); }
.bell-count { position: absolute; top: -2px; right: -4px; min-width: 1.1rem; padding: 0 .25rem; border-radius: 999px;
    background: var(--danger); color: var(--on-solid); font-size: .68rem; font-weight: 600; line-height: 1.1rem; text-align: center; }
.page-head:has(form), .page-head:has(> .btn) { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.notification-list { list-style: none; margin: 0; padding: 0; }
.notification { display: flex; align-items: center; gap: .25rem; padding-left: .75rem; }
.notification + .notification { border-top: 1px solid var(--border); }
.notification form { margin: 0; }
.notification.is-unread { box-shadow: inset 3px 0 0 var(--accent); }
.notification-tick { flex: none; }
.notification-main { flex: 1; min-width: 0; }
.notification-action { flex: none; padding-right: .75rem; }
/* The kind column fits "Agent finished a request"; a longer label wraps inside its badge (HUB-0094). */
.notification-open { display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: baseline; width: 100%;
    padding: .7rem .5rem; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.notification-open:hover { background: var(--surface-2); }
.notification-kind { justify-self: start; max-width: 100%; white-space: normal; border-radius: .6rem; }
.notification-item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-text { grid-column: 2; }
.notification time { grid-row: 1; grid-column: 3; white-space: nowrap; }
.notification:not(.is-unread) .notification-item { color: var(--muted); }
.notification-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.notification-tools .filter-bar { margin: 0; }
@media (max-width: 600px) {
    .notification { align-items: flex-start; padding-top: .55rem; }
    .notification-open { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
    .notification-item { white-space: normal; }
    .notification-text, .notification time { grid-column: 1; grid-row: auto; }
}
.check-list-column { flex-direction: column; border: 0; padding: 0; margin: 0; }

/* ---- Import ------------------------------------------------------------------------------------ */
.import-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem 1rem; }
.import-map label, .import-pair { display: flex; flex-direction: column; gap: .25rem; }
.import-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.import-values fieldset { margin: 0; display: grid; gap: .5rem; }
.import-values legend { font-weight: 600; padding: 0 .25rem; }
.import-pair { flex-direction: row; align-items: center; justify-content: space-between; gap: .75rem; }
.import-pair > span { overflow-wrap: anywhere; }
.import-pair select { max-width: 60%; }
.import-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.import-bar > span:first-child { margin-right: auto; }
.import-table tr.is-duplicate td { background: color-mix(in srgb, var(--warning) 8%, transparent); }
.import-table tr.is-error td { opacity: .6; }
.import-cell { max-width: 22rem; overflow-wrap: anywhere; }
.import-batch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }

/* ---- Board columns picker ---------------------------------------------------------------------- */
.board-columns-picker { position: relative; }
.board-columns-picker[open] > summary { background: var(--accent-soft); color: var(--accent); }
/* Icon only (HUB-0096), so no line of text to give it height: as tall as the buttons beside it. */
.board-columns-picker > summary.btn-sm { min-height: calc(1.5em + .5rem + 2px); }
.board-columns-picker > form { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; width: 17rem; margin: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.board-columns-picker .check-list label { gap: .5rem; }
.row-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
/* On a phone the panel hangs from the right edge of the action buttons, so it stays on screen (HUB-0096). */
@media (max-width: 600px) { .view-head .actions { position: relative; } .board-columns-picker { position: static; } }

/* ---- Item page: back / board / list links -------------------------------------------------------- */
.item-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }

/* ---- Jump targets: a notification opens the item at the comment or part it's about, which flashes ---------- */
#description, #testing-notes, .comment { scroll-margin-top: 5rem; }
.target-block { border-radius: var(--radius); }
#description:target, #testing-notes:target, .comment:target { animation: hub-flash 1.1s ease-in-out 3; }
@keyframes hub-flash {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 55%, transparent); background-color: var(--accent-soft); }
}
@media (prefers-reduced-motion: reduce) {
    #description:target, #testing-notes:target, .comment:target { animation: none; box-shadow: 0 0 0 3px var(--accent); }
}

/* ---- Handover notes (HUB-0018) --------------------------------------------------------------------- */
.handover-pin { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.handover-pin h2 { margin: 0; font-size: 1rem; }
.handover-pin .comment-head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; margin-bottom: .5rem; }
.handover-older { margin-top: .75rem; font-size: .9rem; }
.handover-older ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.comment-handover { border-left: 3px solid var(--accent); }
.note-form { margin-bottom: 1rem; }
.note-form select { width: auto; }
.rules-scope { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.rules-revision { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }

/* ---- Item page sidebar: groups and colour-coded actions (HUB-0025) ---------------------------------- */
.side-group { margin: .9rem 0 .1rem; padding-top: .7rem; border-top: 1px solid var(--border); font-size: .75rem; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.side-form > .side-group:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.side-more { border-top: 1px solid var(--border); padding-top: .6rem; margin-top: .6rem; }
.side-more > summary { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.side-more[open] > summary { margin-bottom: .5rem; }
.side-more > label { display: block; margin-top: .5rem; }
.btn-info { color: var(--link); border-color: color-mix(in srgb, var(--link) 45%, var(--border)); background: color-mix(in srgb, var(--link) 6%, var(--surface)); }
.btn-info:hover { background: color-mix(in srgb, var(--link) 12%, var(--surface)); }
.btn-danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--surface); }
.btn-danger-outline:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.input-narrow { width: 5.5rem; }

/* ---- Front page: one request's journey (HUB-0028). CSS only, 10 s loop; the steps light up in time. ------- */
.hero-journey { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.25rem; align-items: center;
    text-align: left; margin: .25rem 0 .5rem; }
.journey-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: .55rem; }
.journey-step { counter-increment: step; position: relative; padding: .45rem .6rem .45rem 2.4rem; border-radius: 10px;
    color: var(--muted); font-size: .92rem; line-height: 1.4; border: 1px solid var(--border); background: transparent; }
.journey-step::before { content: counter(step); position: absolute; left: .6rem; top: .5rem; width: 1.3rem; height: 1.3rem;
    border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700;
    background: var(--surface-2); color: var(--muted); }
.journey-step strong { display: block; color: var(--text); }
.journey-step.s1 { animation: journey-s1 10s ease infinite; }
.journey-step.s2 { animation: journey-s2 10s ease infinite; }
.journey-step.s3 { animation: journey-s3 10s ease infinite; }
.journey-step.s4 { animation: journey-s4 10s ease infinite; }
.journey-step.s1::before { animation: journey-n1 10s ease infinite; }
.journey-step.s2::before { animation: journey-n2 10s ease infinite; }
.journey-step.s3::before { animation: journey-n3 10s ease infinite; }
.journey-step.s4::before { animation: journey-n4 10s ease infinite; }

.demo-board { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; height: 10rem;
    padding: .5rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 10%, transparent); }
.demo-col { border-radius: 8px; background: var(--surface-2); padding: .35rem; font-size: .7rem; }
.demo-col .badge { font-size: .62rem; white-space: nowrap; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.demo-msg { position: absolute; left: .9rem; top: 2.6rem; max-width: 70%; padding: .45rem .65rem; border-radius: 12px 12px 12px 2px;
    background: var(--accent-soft); color: var(--text); font-size: .78rem; box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    animation: demo-msg 10s ease-in-out infinite; }
.demo-card { position: absolute; top: 2.4rem; left: calc(.5rem + 2px); width: calc((100% - 1rem - 1.2rem) / 4 - 4px);
    display: flex; flex-direction: column; gap: .2rem; padding: .4rem .45rem; border-radius: 8px; font-size: .68rem;
    background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c-red);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1); animation: demo-card 10s cubic-bezier(.45, 0, .2, 1) infinite; }
.demo-key { color: var(--link); font-size: .62rem; }
.demo-title { font-weight: 600; line-height: 1.2; }
.demo-tags .badge { font-size: .58rem; padding: 0 .3rem; }
.demo-tags .prio-P1 { animation: demo-prio 10s ease infinite; }
.demo-bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.demo-bar > span { display: block; height: 100%; width: 0; background: var(--c-violet); animation: demo-bar 10s linear infinite; }
.demo-who { position: absolute; left: .45rem; bottom: calc(100% + .3rem); font-size: .62rem; padding: .05rem .4rem; border-radius: 999px;
    white-space: nowrap; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 3px 8px rgba(0, 0, 0, .08); opacity: 0; }
.demo-who-ok { color: var(--accent); animation: demo-ok 10s ease infinite; }
.demo-who-agent { animation: demo-agent 10s ease infinite; }
.demo-who-note { animation: demo-note 10s ease infinite; }
.demo-who-client { color: var(--link); animation: demo-client 10s ease infinite; }
.demo-who-you { color: var(--c-green); font-weight: 700; animation: demo-you 10s ease infinite; }

.j-icons { display: inline-flex; gap: .2rem; margin-left: .4rem; vertical-align: -5px; color: var(--accent); }
.j-icons .j-icon { width: 20px; height: 20px; }
.demo-msg { display: flex; align-items: center; gap: .35rem; }
.demo-msg .j-icon { flex: none; color: var(--accent); }
.landing-sub { font-size: clamp(1.2rem, 2.6vw, 1.6rem); margin: 1.25rem 0 0; max-width: 26em; }
.landing-sub-lead { margin: 0; max-width: 40em; color: var(--muted); font-size: 1.02rem; line-height: 1.55; }
.landing-sub-lead + .landing-sub-lead { margin-top: .9rem; }
.landing-sub-lead strong { color: var(--text); }

/* Card left edge for each column: Up next, In progress, Waiting for review, Done. */
@keyframes demo-card {
    0%, 19% { opacity: 0; transform: translateY(6px) scale(.96); left: calc(.5rem + 2px); }
    24%, 40% { opacity: 1; transform: none; left: calc(.5rem + 2px); }
    46%, 62% { left: calc(.5rem + 2px + (100% - 1rem + .4rem) / 4); border-left-color: var(--c-red); }
    68%, 82% { left: calc(.5rem + 2px + (100% - 1rem + .4rem) / 2); border-left-color: var(--c-amber); }
    88%, 96% { opacity: 1; left: calc(.5rem + 2px + (100% - 1rem + .4rem) * 3 / 4); border-left-color: var(--c-green); transform: none; }
    100% { opacity: 0; left: calc(.5rem + 2px + (100% - 1rem + .4rem) * 3 / 4); border-left-color: var(--c-green); }
}
@keyframes demo-msg { 0% { opacity: 0; transform: translateY(8px); } 3%, 17% { opacity: 1; transform: none; } 22%, 100% { opacity: 0; transform: translateY(-6px) scale(.9); } }
@keyframes demo-prio { 0%, 23% { transform: scale(.4); opacity: 0; } 27% { transform: scale(1.25); opacity: 1; } 30%, 100% { transform: none; opacity: 1; } }
@keyframes demo-bar { 0%, 46% { width: 0; } 62%, 100% { width: 100%; } }
@keyframes demo-ok { 0%, 27% { opacity: 0; } 29%, 35% { opacity: 1; } 37%, 100% { opacity: 0; } }
@keyframes demo-agent { 0%, 36% { opacity: 0; } 38%, 61% { opacity: 1; } 63%, 100% { opacity: 0; } }
@keyframes demo-note { 0%, 62% { opacity: 0; } 64%, 71% { opacity: 1; } 73%, 100% { opacity: 0; } }
@keyframes demo-client { 0%, 72% { opacity: 0; } 74%, 81% { opacity: 1; } 83%, 100% { opacity: 0; } }
@keyframes demo-you { 0%, 82% { opacity: 0; } 84%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes journey-s1 { 0%, 25% { color: var(--text); border-color: var(--accent); background: var(--surface); } 28%, 100% { color: var(--muted); border-color: var(--border); background: transparent; } }
@keyframes journey-s2 { 0%, 26% { color: var(--muted); border-color: var(--border); background: transparent; } 29%, 45% { color: var(--text); border-color: var(--accent); background: var(--surface); } 48%, 100% { color: var(--muted); border-color: var(--border); background: transparent; } }
@keyframes journey-s3 { 0%, 45% { color: var(--muted); border-color: var(--border); background: transparent; } 48%, 68% { color: var(--text); border-color: var(--accent); background: var(--surface); } 71%, 100% { color: var(--muted); border-color: var(--border); background: transparent; } }
@keyframes journey-s4 { 0%, 68% { color: var(--muted); border-color: var(--border); background: transparent; } 71%, 97% { color: var(--text); border-color: var(--c-green); background: var(--surface); } 100% { color: var(--muted); border-color: var(--border); background: transparent; } }
@keyframes journey-n1 { 0%, 25% { background: var(--accent); color: var(--accent-text); } 28%, 100% { background: var(--surface-2); } }
@keyframes journey-n2 { 0%, 26% { background: var(--surface-2); } 29%, 45% { background: var(--accent); color: var(--accent-text); } 48%, 100% { background: var(--surface-2); } }
@keyframes journey-n3 { 0%, 45% { background: var(--surface-2); } 48%, 68% { background: var(--accent); color: var(--accent-text); } 71%, 100% { background: var(--surface-2); } }
@keyframes journey-n4 { 0%, 68% { background: var(--surface-2); } 71%, 97% { background: var(--c-green); color: var(--on-solid); } 100% { background: var(--surface-2); } }

/* Reduced motion: a still frame (waiting for your review) and all four steps readable. */
@media (prefers-reduced-motion: reduce) {
    .demo-msg, .demo-who-ok, .demo-who-agent, .demo-who-client, .demo-who-you { display: none; }
    .demo-card, .demo-bar > span, .demo-who-note, .demo-tags .prio-P1, .hero-journey .journey-step, .hero-journey .journey-step::before { animation: none; }
    .demo-card { left: calc(.5rem + 2px + (100% - 1rem + .4rem) / 2); border-left-color: var(--c-amber); }
    .demo-bar > span { width: 100%; }
    .demo-who-note { opacity: 1; }
    .journey-step { color: var(--text); }
}
@media (max-width: 760px) {
    .hero-journey { grid-template-columns: minmax(0, 1fr); }
    .demo-board { height: 9.6rem; padding: .35rem; gap: .25rem; }
    .demo-col .badge { font-size: .52rem; padding: 0 .2rem; }
    .demo-card { font-size: .6rem; padding: .3rem; top: 3.1rem; }
    .demo-tags { display: none; }
    .demo-who { font-size: .54rem; left: .2rem; }
}

/* ---- Front page: the same request on a small Timeline (HUB-0063). Same 10 s loop as the board. -------------
   Ten days across; each bar's left and width are in tenths. WEB-0042 lands, pushes the retest out by three days and
   takes over the critical path from the docs; when it's done the path is just the retest and the release. */
.demo-side { display: grid; gap: .6rem; min-width: 0; }
.demo-tl { --tl-l: 9rem; padding: .45rem .5rem .55rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 10%, transparent); font-size: .68rem; }
.demo-tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem; margin-bottom: .4rem; }
.demo-tl-name { font-weight: 600; }
.demo-tl-head .tl-cp-chip { font-size: .6rem; }
.demo-cp { display: grid; color: var(--muted); font-size: .64rem; }
.demo-cp > span { grid-area: 1 / 1; white-space: nowrap; }
.demo-cp-a { animation: demo-cp-a 10s ease infinite; }
.demo-cp-b { animation: demo-cp-b 10s ease infinite; }
.demo-cp-c { animation: demo-cp-c 10s ease infinite; }
.demo-tl-rows { position: relative; display: grid; grid-template-columns: var(--tl-l) minmax(0, 1fr); align-items: center; row-gap: .3rem; }
.demo-tl-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: .4rem; }
.demo-tl-key { color: var(--link); font-size: .62rem; }
/* Days 6 and 7 are a weekend, shaded like the real Timeline. */
.demo-tl-track { position: relative; height: 14px;
    background: linear-gradient(90deg, transparent 50%, var(--surface-2) 50% 70%, transparent 70%); }
.demo-tl-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; background: var(--c-blue); }
/* Bars with a blocker get the Timeline's small arrow in front. */
.demo-tl-bar::before { content: ""; position: absolute; left: -7px; top: 50%; transform: translateY(-50%);
    border: 4px solid transparent; border-left: 5px solid var(--text); }
.d-design .demo-tl-bar { left: 0; width: 20%; background: var(--c-grey); opacity: .55; }
.d-design .demo-tl-bar::before { content: none; }
.d-docs .demo-tl-bar { left: 20%; width: 40%; animation: demo-docs 10s ease infinite; }
.d-fix { animation: demo-fix-row 10s ease infinite; }
.d-fix .demo-tl-bar { left: 20%; width: 30%; overflow: visible; border: 2px dashed var(--c-violet);
    background: color-mix(in srgb, var(--c-violet) 22%, transparent); animation: demo-fix-done 10s ease infinite; }
/* The fill covers the dashed edge, so a finished bar reads as solid. */
.demo-tl-fill { position: absolute; left: -2px; top: -2px; bottom: -2px; width: 0; border-radius: 4px; background: var(--c-violet);
    animation: demo-fill 10s linear infinite; }
.d-retest .demo-tl-bar { left: 20%; width: 30%; animation: demo-retest 10s cubic-bezier(.45, 0, .2, 1) infinite; }
.demo-tl-ms { position: absolute; top: 50%; left: 60%; width: 10px; height: 10px; transform: translate(-50%, -50%) rotate(45deg);
    background: var(--c-violet); animation: demo-release 10s cubic-bezier(.45, 0, .2, 1) infinite; }
.demo-tl-today { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--c-red); pointer-events: none;
    left: calc(var(--tl-l) + (100% - var(--tl-l)) * .12); animation: demo-today 10s linear infinite; }

@keyframes demo-cp-a { 0%, 22% { opacity: 1; } 25%, 97% { opacity: 0; } 100% { opacity: 1; } }
@keyframes demo-cp-b { 0%, 22% { opacity: 0; } 25%, 86% { opacity: 1; } 89%, 100% { opacity: 0; } }
@keyframes demo-cp-c { 0%, 86% { opacity: 0; } 89%, 97% { opacity: 1; } 100% { opacity: 0; } }
@keyframes demo-docs { 0%, 22% { background: var(--c-violet); } 26%, 97% { background: var(--c-blue); } 100% { background: var(--c-violet); } }
@keyframes demo-fill { 0%, 46% { width: 0; } 62%, 100% { width: calc(100% + 4px); } }
@keyframes demo-fix-row { 0%, 21% { opacity: 0; } 25%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes demo-fix-done { 0%, 86% { filter: none; opacity: 1; } 89%, 100% { filter: grayscale(1); opacity: .55; } }
@keyframes demo-retest { 0%, 22% { left: 20%; background: var(--c-blue); } 28%, 97% { left: 50%; background: var(--c-violet); } 100% { left: 20%; background: var(--c-blue); } }
@keyframes demo-release { 0%, 22% { left: 60%; } 28%, 97% { left: 80%; } 100% { left: 60%; } }
@keyframes demo-today { from { left: calc(var(--tl-l) + (100% - var(--tl-l)) * .12); } to { left: calc(var(--tl-l) + (100% - var(--tl-l)) * .58); } }

/* Reduced motion: the same still frame as the board (waiting for review), with WEB-0042 on the critical path. */
@media (prefers-reduced-motion: reduce) {
    .demo-cp > span, .d-docs .demo-tl-bar, .d-fix, .d-fix .demo-tl-bar, .demo-tl-fill, .d-retest .demo-tl-bar, .demo-tl-ms, .demo-tl-today { animation: none; }
    .demo-cp-a, .demo-cp-c { opacity: 0; }
    .demo-tl-fill { width: calc(100% + 4px); }
    .d-retest .demo-tl-bar { left: 50%; background: var(--c-violet); }
    .demo-tl-ms { left: 80%; }
    .demo-tl-today { left: calc(var(--tl-l) + (100% - var(--tl-l)) * .46); }
}
@media (max-width: 760px) {
    .demo-tl { --tl-l: 6.5rem; padding: .35rem; font-size: .62rem; }
    .demo-tl-key { display: none; }
}

/* ---- Item sidebar: Mark done and coloured selects (HUB-0029) ------------------------------------------- */
.btn-done { background: var(--c-green); border-color: var(--c-green); color: var(--on-solid); font-size: 1.02rem; padding: .7rem 1rem; }
/* On hover and focus it turns a lighter green, with text that stays readable on it (HUB-0092). */
.btn-done:hover, .btn-done:focus-visible { background: var(--done-hover-bg); border-color: var(--c-green); color: var(--done-hover-fg); }
.mark-done { margin: 0; }
.done-note { display: flex; align-items: center; justify-content: center; gap: .35rem; margin: 0; padding: .6rem; border-radius: var(--radius);
    color: var(--c-green); font-weight: 600; background: color-mix(in srgb, var(--c-green) 10%, var(--surface)); }
.side-form select.tone-select { font-weight: 600; border-width: 1px; border-style: solid; }
.side-group svg { vertical-align: -2px; margin-right: .15rem; color: var(--accent); }

/* ---- A project's button bar with its default view (HUB-0032) ------------------------------------------- */
.project-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 1rem; }
/* One frame in the project's colour around its code and buttons (HUB-0089); neutral when it has no colour. */
.project-nav.proj-tint { width: fit-content; max-width: 100%; padding: .3rem; border-radius: calc(var(--radius) + .3rem);
    border: 1px solid color-mix(in srgb, var(--pc, var(--border)) 45%, var(--border)); }
.project-code { padding: 0 .3rem 0 .35rem; font-family: var(--mono); font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.project-code:hover { text-decoration: underline; }
.project-tab { display: inline-flex; align-items: center; padding: .4rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; }
.project-tab.is-current { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
/* The view the project opens in is underlined; press and hold a button to change it (no ★ or extra links). A thin
   dotted line in the text colour, so only the current view looks selected (HUB-0091). */
.project-tab { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.project-tab.is-default { text-decoration: underline 1px dotted var(--muted); text-underline-offset: 5px; }
.project-tab.is-setting { animation: tab-hold .6s ease-in-out infinite alternate; }
@keyframes tab-hold { to { background: var(--accent-soft); } }
/* For keyboard users only: shown when tabbed to. */
.project-make-default { border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: .2rem .5rem;
    color: var(--accent); font: inherit; font-size: .85rem; cursor: pointer; }
.project-make-default:not(:focus-visible) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.project-settings { font-weight: 400; }
/* The hidden "Make default" form must not take a gap in the bar, or Settings shifts between views (HUB-0061). */
.project-nav > form.inline { display: contents; }

/* ---- Board and list header: one compact row, buttons in the same place on every view (HUB-0040) ---- */
.page-head.view-head { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: .4rem .9rem; margin-bottom: .5rem;
    min-height: 2rem; /* as tall as the tallest actions, so the row sits at the same height on every view */ }
.view-head h1 { font-size: 1.2rem; white-space: nowrap; }
/* The page name comes first, in a fixed-width box, so the view buttons after it never move (HUB-0061). */
.view-head .view-title { flex: 0 0 10.5rem; margin: 0; font-size: 1.2rem; font-weight: 600; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .view-head .view-title { flex-basis: 100%; } }
.view-head .actions { margin-left: auto; gap: .35rem; }
/* A project's buttons get a centred line of their own above the page name and its actions, on every project page, on
   one line (only a very long project code would wrap them); below tablet width, three even rows of three (HUB-0096). */
.page-head.view-head:has(> .project-nav) { display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(1.875rem, auto); /* as tall as the actions, with or without them */
    grid-template-areas: "nav nav" "title actions"; row-gap: .45rem; }
.view-head:has(> .project-nav) > .view-title { grid-area: title; }
.view-head:has(> .project-nav) > .project-nav { grid-area: nav; justify-self: center; }
.view-head:has(> .project-nav) > .actions { grid-area: actions; justify-self: end; margin-left: 0; }
@media (max-width: 760px) {
    /* Phones and narrow windows: three even rows of three, the code first, rather than ragged rows. */
    .view-head:has(> .project-nav) > .project-nav { display: grid; grid-template-columns: repeat(3, auto); gap: .25rem; }
    .view-head .project-tab { justify-content: center; }
}
@media (max-width: 600px) {
    /* The page name is never cut short: it keeps its width and the actions wrap beside it. */
    .page-head.view-head:has(> .project-nav) { grid-template-columns: auto minmax(0, 1fr); }
    .view-head:has(> .project-nav) > .view-title { flex-basis: auto; }
    .view-head:has(> .project-nav) > .actions { justify-content: flex-end; }
}
.view-head .project-nav { margin: 0; gap: .3rem; }
.view-head .project-nav.proj-tint { padding: .2rem; }
.view-head .project-code { font-size: .85rem; }
.view-head .project-tab { padding: .2rem .55rem; font-size: .85rem; }

/* The page's head (name, project buttons, actions, and the filters or intro line under them) stays under the top bar
   while the page scrolls, so you never lose the buttons or what page you're on (HUB-0106). app.js measures the top bar
   (--topbar-h) and this block (--page-top-h, for links to anchors), and marks it stuck to draw its edge. Not on a
   phone, where it would take a third of the screen. */
.container:has(> .page-top) { padding-top: .4rem; }
.page-top { position: sticky; top: var(--topbar-h, 3.4rem); z-index: 9; background: var(--bg); padding: .5rem 0 .4rem; margin-bottom: .6rem; }
.page-top.is-stuck { box-shadow: 0 1px 0 var(--border); }
.page-top > .page-head.view-head:last-child, .page-top > .view-tools:last-child, .page-top > .hint:last-child { margin-bottom: 0; }
html { scroll-padding-top: calc(var(--topbar-h, 3.4rem) + var(--page-top-h, 0px) + .5rem); }
@media (max-width: 760px) { .page-top { position: static; } }

.view-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-bottom: .75rem; }
.view-tools .filter-bar { margin: 0; flex: 0 1 auto; }
.view-tools-end { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-left: auto; }
/* Filters and the list's bulk and export tools: in the row while they fit on one line; when they would wrap, app.js
   adds .is-folded and each folds into a button that opens a panel under the row (HUB-0096). */
.view-tools { position: relative; }
.fold, .fold-body { display: contents; }
.fold-toggle { display: none; }
.view-tools.is-folded { flex-wrap: nowrap; }
.view-tools.is-folded .filter-bar { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
.view-tools.is-folded .filter-bar input[type=search] { flex: 1 1 auto; width: auto; min-width: 0; }
.is-folded .fold-toggle { display: inline-flex; white-space: nowrap; }
.is-folded .fold-end .fold-toggle { margin-left: auto; }
.is-folded .fold-body, .is-folded .view-tools-end.fold-body { display: none; position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + .35rem);
    margin: 0; padding: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.is-folded .fold.is-open .fold-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .5rem; align-items: center; }
.is-folded .fold.is-open .view-tools-end.fold-body { display: flex; flex-wrap: wrap; }
.view-tools.is-folded .fold-body select { width: 100%; max-width: none; }
.is-folded .fold-body > .btn { justify-self: start; }
.is-folded .fold-body .more-filters { grid-column: 1 / -1; }
.is-folded .fold-body .more-filters-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .5rem; }
.is-folded .fold-body .more-filters-body > * { width: 100%; }
.fold-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.view-tools .filter-bar input[type=search] { width: 150px; }
.view-tools .filter-bar select { max-width: 9.5rem; }
/* List / Board are icons (HUB-0101), named on hover; as tall as the buttons beside them, like Columns (HUB-0096). */
.view-head .view-toggle .btn { min-width: 2.2rem; min-height: calc(1.5em + .5rem + 2px); justify-content: center; text-align: center; }
.view-head .view-toggle .btn .icon { display: block; }
.view-head .view-toggle .is-current { color: var(--accent); }

/* ---- Agent requests on the item page (HUB-0031) ---- */
.agent-requests { display: flex; flex-direction: column; gap: .6rem; }
.agent-requests h2 { margin: 0; }
.agent-request-list { display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.agent-request-list > .agent-request { border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .9rem .7rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.agent-request-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.agent-request-ask { margin: 0; white-space: pre-line; }
.agent-request .hint { margin: 0; }
.agent-request.state-asked { border-color: var(--warning); }
.agent-request.state-in_progress { border-color: var(--accent); }
.badge-request { border-color: var(--accent); }
.ask-agent > summary { width: max-content; }
.ask-agent[open] > summary { margin-bottom: .5rem; }
.autowork-form { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.autowork-form select { width: auto; font-size: .85rem; }
.ask-agent .form-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: flex-start; }
.ask-agent .field label { display: block; }
.permission-banner { border: 2px solid var(--warning); background: color-mix(in srgb, var(--warning) 9%, var(--surface)); }
.permission-banner p { margin: 0 0 .6rem; }
.agent-request.state-asked { border-width: 2px; background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.badge-decide { background: var(--warning); border-color: var(--warning); color: #fff; font-weight: 600; }

/* ---- Board: cards past the per-column limit fold away (HUB-0041) ---- */
.board-card.is-folded { display: none; }
.board-col-toggle { width: 100%; justify-content: center; margin-top: .25rem; }
.board-columns-picker .card-limit { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .9rem; }
.board-columns-picker .card-limit select { width: auto; }
.board-columns-picker .card-limit .hint { flex-basis: 100%; margin: 0; }

/* ---- Agent requests: delivery and whether the agent is listening (HUB-0042) ---- */
.request-steps { display: flex; flex-wrap: wrap; gap: .25rem .9rem; list-style: none; margin: 0; padding: 0; }
.request-steps li::before { content: "○ "; color: var(--muted); }
.request-steps li.done::before { content: "● "; color: var(--accent); }
.request-steps li.todo { color: var(--muted); }
.agent-listening { margin: 0; }
.agent-listening.listening-ok::before { content: "● "; color: var(--c-green, #2b8a3e); }
.agent-listening.listening-stale::before, .agent-listening.listening-never::before { content: "● "; color: var(--warning); }
.agent-waiting, .agent-silent { margin: 0; color: var(--warning); font-weight: 600; }
.dash-agent-requests { margin: 1.75rem 0 1.25rem; }
.dash-agent-requests h2 { margin: 0 0 .5rem; }
.dash-agent-requests h2 .muted { font-weight: 400; font-size: .85rem; margin-left: .4rem; }
.dash-agent-requests li { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; padding: .3rem 0; border-bottom: 1px solid var(--border); }
.dash-agent-requests li:last-child { border-bottom: 0; }
.agent-waiting-row { border-left: 3px solid var(--warning); padding-left: .5rem !important; }
/* The request's body sits under the "→ Agent" line, not flush with it (HUB-0042 polish). */
.agent-request > :not(.agent-request-head) { margin-left: 1.15rem; }

/* ---- Team page (HUB-0043) ---- */
.team-section { margin-bottom: 1.75rem; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1rem; }
.team-card { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.team-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .6rem; }
.team-card-head h3 { margin: 0; font-size: 1.05rem; }
.team-card h4 { margin: .5rem 0 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.team-card p { margin: 0; }
.team-list li { border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.team-list li:last-child { border-bottom: 0; }
.team-list .small { display: block; }
.team-card-attention { border-color: var(--warning); border-width: 2px; }

/* ---- People and agents on a project's Overview, and on the portal (HUB-0084) ---- */
.people-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: .75rem 1.5rem; }
.people-group { min-width: 0; }
.people-group h3 { margin: 0 0 .25rem; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.people-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; overflow-wrap: anywhere; }
.project-agents { padding: .25rem 1rem; }
.project-agents li { border-bottom: 1px solid var(--border); padding: .35rem 0; }
.project-agents li:last-child { border-bottom: 0; }
.project-agents .btn { margin-left: auto; }
.agent-message-form { margin-top: 1rem; }
.agent-message-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .5rem 1rem; }
.agent-message-fields select { width: 100%; margin-top: .25rem; font-weight: 400; }

/* ---- Agent schedules (HUB-0044) ---- */
.schedule-table select, .schedule-table input[type=time] { width: auto; font-size: .85rem; }
.schedule-table .hours .hint { display: block; margin: .15rem 0 0; }
.session-title-form { margin-top: 1rem; max-width: 46rem; }
.agent-request-wait { color: var(--accent); font-weight: 600; }

/* ---- Guides (HUB-0046) ---- */
.guide, .guide-back, .guides { max-width: 52rem; margin-left: auto; margin-right: auto; }
.guide-back { margin-bottom: .5rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; }
/* HUB-0086, HUB-0102: the prompt for your own AI app, above every guide. */
.guide-assistant { max-width: 52rem; margin: 0 auto 1rem; }
.guide-assistant-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; }
.guide-assistant h2 { margin: 0; font-size: 1.05rem; }
.guide-assistant .hint { margin: .35rem 0 .6rem; }
.guide-prompt { margin: 0; padding: .6rem .8rem; background: var(--surface-2); border-radius: 6px; white-space: pre-line;
    overflow-wrap: anywhere; max-height: 12rem; overflow-y: auto; font-size: .9rem; }
.guides ul { list-style: none; }
.guides li + li { margin-top: .9rem; }
.guide h1 { margin-top: 0; }
.guide h2 { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.guide pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.guide .guide-copy { float: right; margin: .35rem .35rem 0 .5rem; position: relative; z-index: 1; }

/* ---- List: status from the row, bulk status (HUB-0047) ---- */
.status-pick { cursor: pointer; font: inherit; font-size: .75rem; }
.status-pick:hover, .status-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.status-pick-select { width: auto; font-size: .8rem; padding: .2rem .3rem; }
.bulk-status { display: inline-flex; gap: .3rem; align-items: center; }
.bulk-status select { width: auto; font-size: .85rem; padding: .3rem .4rem; }

/* Timeline (HUB-0026): a table whose bars are cells spanning day columns. Only .tl-scroll scrolls sideways. */
.tl-zoom { display: flex; gap: .25rem; }
.tl-zoom .is-current { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.tl-plan { margin: 0 0 1rem; }
.tl-plan p { margin: .25rem 0; }
.tl-cp { line-height: 1.8; }
.tl-cp-chip, .tl-late-chip { display: inline-block; font-size: .68rem; font-weight: 600; padding: 0 .3rem; border-radius: 4px; vertical-align: 1px;
    color: var(--on-solid); background: var(--c-violet); }
.tl-late-chip { background: var(--c-red); }
.tl-warnings { list-style: none; padding: .5rem .75rem; margin: .5rem 0; border: 1px solid var(--warning); border-radius: var(--radius);
    color: var(--text); background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.tl-warnings li { padding: .15rem 0; }
.tl-plan-details summary { margin: .25rem 0; }
.tl-plan-table { font-size: .85rem; }
.tl-plan-table tr.is-critical td:first-child { box-shadow: inset 3px 0 0 var(--c-violet); }
.tl-plan-title { color: var(--muted); }
.tl-plan-table a, .tl-cp a { white-space: nowrap; }

.tl-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
/* Weekends: a stripe every 7 day columns (the range starts on a Monday), offset by the label column + its border. */
.tl { --tl-label: 240px; --tl-day: 28px; border-collapse: separate; border-spacing: 0; width: max-content; font-size: .8rem; }
.tl.tl-zoom-month { --tl-day: 8px; }
.tl col.tl-day { width: var(--tl-day); }
.tl tbody { background-image: repeating-linear-gradient(90deg, transparent 0 calc(5 * var(--tl-day)), var(--surface-2) calc(5 * var(--tl-day)) calc(7 * var(--tl-day)));
    background-position: calc(var(--tl-label) + 1px) 0; }
.tl td.tl-today { background: linear-gradient(90deg, transparent calc(50% - 1px), var(--c-red) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)); }
.tl thead th.tl-sub.is-today { color: var(--c-red); font-weight: 700; }
.tl th, .tl td { padding: 0; height: 30px; border-bottom: 1px solid var(--border); }
.tl thead th { height: auto; padding: .2rem .25rem; font-size: .7rem; font-weight: 500; color: var(--muted); text-align: left; white-space: nowrap;
    border-left: 1px solid var(--border); background: var(--surface); }
.tl thead th.tl-sub { text-align: center; padding: .15rem 0; }
.tl thead th.tl-sub.is-weekend { background: var(--surface-2); }
.tl col.tl-label-col { width: var(--tl-label); }
.tl .tl-label { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; font-weight: 400; padding: 0 .5rem;
    border-right: 1px solid var(--border); border-left: 0; }
/* The label column's width follows --tl-label, which the reader can drag (HUB-0062, remembered in the browser). */
.tl-label-in { width: calc(var(--tl-label) - 1rem); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tl-row .tl-label-in { display: flex; align-items: baseline; gap: .3rem; }
.tl-row .tl-label-in > * { flex: none; }
.tl-resize { position: absolute; top: 0; bottom: 0; right: -4px; width: 8px; z-index: 3; cursor: col-resize; touch-action: none; }
.tl-resize::after { content: ""; position: absolute; top: 20%; bottom: 20%; left: 3px; width: 2px; border-radius: 1px; background: var(--border); }
.tl-resize:hover::after, .tl-resize:focus-visible::after, .tl-resize.is-active::after { background: var(--accent); top: 0; bottom: 0; }
.tl-resize:focus-visible { outline: none; }
@media (pointer: coarse) { .tl-resize { width: 22px; right: -11px; } .tl-resize::after { left: 10px; } }
/* A long title stays in its box; on hover or focus it scrolls slowly across (app.js sets the distance and time). */
.tl-row .tl-label-in > .tl-title { flex: 1 1 auto; min-width: 2rem; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.tl-title.is-scrolling { text-overflow: clip; }
.tl-title.is-scrolling .tl-title-text { display: inline-block; }
.tl-title.is-scrolling .tl-title-text { animation: tl-marquee var(--tl-marquee-time, 6s) linear 1s infinite alternate; }
@keyframes tl-marquee { 0%, 12% { transform: translateX(0); } 88%, 100% { transform: translateX(var(--tl-marquee-shift, 0)); } }
.tl-row .tl-label-in > .tl-deps { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .72rem; }
/* Reduced motion: no scrolling; the full title wraps instead (the row grows while you point at it). */
@media (prefers-reduced-motion: reduce) {
    .tl-title.is-scrolling .tl-title-text { animation: none; }
    .tl-row .tl-label-in:is(:hover, :focus-within) { flex-wrap: wrap; white-space: normal; padding: .3rem 0; }
    .tl-row .tl-label-in:is(:hover, :focus-within) > .tl-title { overflow: visible; white-space: normal; flex-basis: 100%; }
}
.tl-group th.tl-label { font-weight: 600; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); }
.tl-row.is-done .tl-title, .tl-row.is-done .tl-label a { color: var(--muted); }
.tl-cell { position: relative; }
.tl-bar { position: relative; display: block; height: 14px; margin: 0 1px; border-radius: 4px; background: var(--c-blue); }
.tl-bar.is-planned { height: 10px; background: color-mix(in srgb, var(--c-blue) 18%, transparent); border: 2px dashed var(--c-blue); }
.tl-bar.is-critical { background: var(--c-violet); }
.tl-bar.is-critical.is-planned { background: color-mix(in srgb, var(--c-violet) 22%, transparent); border-color: var(--c-violet); }
.tl-bar.is-overdue { background: var(--c-red); border-color: var(--c-red); }
/* Length from a suggested estimate (HUB-0052): striped and dotted, like a guess, until a person confirms it. */
.tl-bar.is-suggested { border: 2px dotted var(--text); height: 10px;
    background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--surface) 55%, transparent) 4px 8px); }
.tl-bar.is-done { background: var(--c-grey); border-color: var(--c-grey); opacity: .55; }
.tl-bar.cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tl-bar.cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-bar.has-blockers::before { content: ""; position: absolute; left: -7px; top: 50%; transform: translateY(-50%);
    border: 5px solid transparent; border-left: 6px solid var(--text); }
.tl-ms { position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; transform: translate(-50%, -50%) rotate(45deg); background: var(--c-slate); }
.tl-ms.is-critical { background: var(--c-violet); }
.tl-ms.is-overdue { background: var(--c-red); }
.tl-ms.is-done { background: var(--c-grey); opacity: .55; }
.tl-due { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: 0; height: 0;
    border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 11px solid var(--c-amber); }
.tl-due.is-overdue { border-top-color: var(--c-red); }
.tl-due.is-done { border-top-color: var(--c-grey); }
.tl-bar:focus-visible, .tl-ms:focus-visible, .tl-due:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Drag and drop (HUB-0053). Bars don't scroll the chart on touch while dragging; empty space still does. */
.tl-drag-help { margin: .25rem 0; }
.tl-drag-hint { position: sticky; top: .5rem; z-index: 5; display: inline-block; margin: 0 0 .4rem; padding: .25rem .6rem; border-radius: var(--radius);
    background: var(--text); color: var(--surface); font-size: .85rem; }
.tl-drag-hint[hidden] { display: none; }
[data-move-url] [data-drag] { cursor: grab; touch-action: none; }
[data-move-url] [data-drag].is-dragging { cursor: grabbing; opacity: .85; z-index: 3; box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.tl-grip { position: absolute; right: -2px; top: -3px; bottom: -3px; width: 10px; cursor: ew-resize; touch-action: none; }
.tl-grip::after { content: ""; position: absolute; right: 3px; top: 25%; bottom: 25%; width: 2px; border-radius: 1px; background: var(--surface); opacity: .8; }
.tl-place-grip { display: inline-block; padding: 0 .3rem; cursor: grab; touch-action: none; color: var(--muted); user-select: none; }
.tl-place-ghost { position: fixed; z-index: 50; pointer-events: none; padding: .2rem .5rem; border-radius: var(--radius); background: var(--c-blue);
    color: var(--on-solid); font-size: .8rem; box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.tl-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; margin: .5rem 0 1rem; }
.tl-key { display: inline-block; width: 18px; height: 10px; border-radius: 3px; vertical-align: -1px; background: var(--c-blue); }
.tl-key-planned { background: transparent; border: 2px dashed var(--c-blue); height: 8px; }
.tl-key-critical { background: var(--c-violet); }
.tl-key-overdue { background: var(--c-red); }
.tl-key-done { background: var(--c-grey); opacity: .55; }
.tl-key-suggested { border: 2px dotted var(--text); height: 8px;
    background-image: repeating-linear-gradient(135deg, transparent 0 3px, color-mix(in srgb, var(--surface) 55%, transparent) 3px 6px); }
input.is-suggested { border-style: dotted; border-width: 2px; }
.field-inline label { display: inline-flex; align-items: center; gap: .35rem; }
.tl-guess { color: var(--warning); font-weight: 700; cursor: help; }
.tl-plan-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .4rem 0; }
.tl-plan-tools form { display: flex; align-items: center; gap: .4rem; margin: 0; }
.tl-lanes label { display: flex; align-items: center; gap: .35rem; font-size: .9rem; white-space: nowrap; margin: 0; }
.tl-lanes input { padding: .25rem .4rem; }
.tl-key-today { width: 2px; height: 14px; background: var(--c-red); }
@media (max-width: 600px) {
    .tl { --tl-label: 130px; }
    .tl-deps { display: none; }
    .tl-plan-table .tl-wide, .tl-plan-title { display: none; }
    .tl-plan-table th, .tl-plan-table td { padding: .4rem .45rem; }
}

/* Planning assistant (HUB-0026 part D, HUB-0057). */
.ask-estimate { margin: -.25rem 0 .5rem; }
.plan-note { margin: .5rem 0 1rem; }
.plan-table input[type="text"] { padding: .3rem .45rem; }
.plan-table .plan-after { min-width: 9rem; }
.plan-table td { vertical-align: middle; }

/* ---- Decision log (HUB-0077): a timeline of a project's decisions ---------------------------------------- */
.decision-log { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--border); display: grid; gap: 1rem; }
.decision { position: relative; }
.decision::before { content: ""; position: absolute; left: calc(-1.1rem - 6px); top: .35rem; width: 10px; height: 10px;
    border-radius: 50%; background: var(--accent); }
.decision-date { margin: 0 0 .3rem; }
.decision-title { font-size: 1.05rem; margin: 0 0 .2rem; }
.decision-items { margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.decision:target .card { border-color: var(--accent); }
/* Items of type Decision: minor decisions, smaller and quieter, with a hollow dot. */
.decision-minor .card { padding-top: .5rem; padding-bottom: .5rem; background: transparent; box-shadow: none; }
.decision-minor .decision-title { font-size: .95rem; font-weight: 500; display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.decision-minor::before { background: var(--bg); border: 2px solid var(--accent); box-sizing: border-box; }

/* ---- Log a decision (HUB-0078) ---------------------------------------------------------------------------- */
.decision-form { max-width: 44rem; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.label-row label { margin: 0; }
.decision-picked:empty { display: none; }
.decision-picked { margin-bottom: .4rem; }
.decision .prose h3 { font-size: .95rem; margin: .6rem 0 .3rem; }

/* ---- Project history (HUB-0079): a month of what happened, by day ------------------------------------------ */
.history-day { margin: 1.4rem 0 0; }
.history-day > h2 { font-size: 1rem; margin: 0 0 .5rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.history-entry { display: flex; gap: .6rem; align-items: baseline; line-height: 1.45; }
.history-entry { min-width: 0; }
.history-entry > :last-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.history-time { font-size: .8rem; font-variant-numeric: tabular-nums; flex: 0 0 2.6rem; }
.history-block { display: block; margin: .3rem 0; }
.history-block .card { padding-top: .7rem; padding-bottom: .7rem; }
.history-block .decision-title { margin: .2rem 0; }
.history-comment[open] summary { margin-bottom: .3rem; }
.history-comment .prose { font-size: .92rem; }
.badge-decision { background: var(--accent); color: #fff; border-color: transparent; }
.history-months { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 .5rem; }
.history-next { margin-left: auto; }
.history-run ul { margin: .3rem 0 0; display: grid; gap: .25rem; }
.history-excerpt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; }
.history-comment { min-width: 0; }

/* ---- Item sidebar boxes: a light tint and an icon each, so you can tell where you are ------------------------ */
.side-fields { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.side-decisions { --box: var(--c-violet); }
.side-related { --box: var(--c-blue); }
.side-decisions, .side-related { border-left: 3px solid var(--box); background: color-mix(in srgb, var(--box) 6%, var(--surface)); }
.side-decisions h2, .side-related h2 { display: flex; align-items: center; gap: .4rem; }
.side-decisions h2 .icon, .side-related h2 .icon { color: var(--box); }

/* Phone: jump links under the item's title, and Decisions and Related before the long field list. */
.item-jump { display: none; }
@media (max-width: 900px) {
    .item-jump { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
    .item-jump a { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border: 1px solid var(--border);
        border-radius: 999px; background: var(--surface); color: var(--text); text-decoration: none; font-size: .85rem; }
    .item-jump .count { color: var(--muted); font-size: .8rem; }
    .item-jump .jump-decisions .icon { color: var(--c-violet); }
    .item-jump .jump-related .icon { color: var(--c-blue); }
    .item-jump .jump-details .icon { color: var(--accent); }
    .item-side > .mark-done, .item-side > .done-note { order: -3; }
    .item-side > #decisions { order: -2; }
    .item-side > #related { order: -1; }
    .item-side > section, .item-side > form, #comments { scroll-margin-top: 10rem; } /* below the taller phone header */
}
.decision-dictate { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.page-head .btn .icon { vertical-align: -3px; }

/* Settings → People: per-account actions (HUB-0081) */
.action-stack { display: inline-flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.account-actions[open] > summary { margin-bottom: .35rem; }
.account-actions .action-stack { flex-direction: column; align-items: flex-end; }

/* Agent usage windows (HUB-0068) */
.agent-usage .usage-value.is-stale { color: var(--muted); text-decoration: line-through dotted; }
.usage-form { margin-top: .5rem; }
.usage-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem .75rem; }
.usage-fields input { width: 100%; }
.usage-agent { margin: 0; font-size: 1.05rem; }
.badge.forecast-fits { color: var(--success); border-color: var(--success); }
.badge.forecast-spills { color: var(--warning); border-color: var(--warning); }
.badge.downtime-safe { color: var(--success); border-color: var(--success); }
.badge.downtime-wait { color: var(--warning); border-color: var(--warning); }
.flash-info { border-color: var(--accent); }
/* The downtime label says why, so it may wrap on a phone. */
.badge.downtime-safe, .badge.downtime-wait { white-space: normal; border-radius: .6rem; max-width: 100%; }

/* ---- Report a bug or suggest an idea (HUB-0100) ------------------------------------------------ */
/* The bug icon sits before the bell, with the actions' gap between them, so the bell's count never covers it. */
.feedback-to { margin: 0 0 .4rem; }
.feedback-kinds { border: 0; padding: 0; margin: 0 0 .6rem; }
.feedback-kind { padding: .3rem .75rem; cursor: pointer; }
.feedback-kind input { width: auto; margin: 0 .2rem 0 0; accent-color: var(--accent); }
.feedback-kind:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.feedback-kind:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.feedback-note { margin: .75rem 0 0; }
.feedback-note code { overflow-wrap: anywhere; }
.feedback-mine { margin-left: auto; }
.feedback-list { list-style: none; margin: 0; padding: 0; }
.feedback-row + .feedback-row { border-top: 1px solid var(--border); }
.feedback-row a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .2rem .75rem; align-items: baseline;
    padding: .7rem .9rem; color: inherit; text-decoration: none; }
.feedback-row a:hover { background: var(--surface-2); }
.feedback-row.is-unread { box-shadow: inset 3px 0 0 var(--accent); }
.feedback-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.feedback-state { justify-self: start; font-size: .8rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; white-space: nowrap;
    background: var(--surface-2); color: var(--muted); }
.feedback-state-being { background: color-mix(in srgb, var(--c-blue) 15%, var(--surface)); color: var(--c-blue); }
.feedback-state-done { background: color-mix(in srgb, var(--success) 15%, var(--surface)); color: var(--success); }
.feedback-report h1 { margin: .4rem 0 .6rem; font-size: 1.35rem; }
.feedback-from-team { box-shadow: inset 3px 0 0 var(--accent); }
.feedback-banner { margin-bottom: 1rem; }
.feedback-banner p { margin: .2rem 0; }
.comment-to-reporter { box-shadow: inset 3px 0 0 var(--accent); }
@media (max-width: 600px) {
    .feedback-row a { grid-template-columns: auto minmax(0, 1fr); }
    .feedback-title { white-space: normal; }
    .feedback-row .small { grid-column: 1 / -1; }
}

/* HUB-0048: Getting started, the first-run tutorial (a modal dialog, one card at a time) and its page. */
.tutorial { width: min(44rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; overflow: auto;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
.tutorial::backdrop { background: rgb(10 10 15 / .5); }
.tutorial-card img, .tutorial-list img { display: block; width: 100%; height: auto; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tutorial-media { position: relative; }
.tutorial-play { position: absolute; right: .6rem; bottom: .6rem; padding: .2rem .65rem; border: 0; border-radius: 999px;
    background: rgb(17 24 39 / .72); color: #fff; font-size: .8rem; cursor: pointer; }
.tutorial-play:hover { background: rgb(17 24 39 / .9); }
.tutorial-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tutorial-card h2, .tutorial-card h3 { margin: 1rem 1.25rem .35rem; font-size: 1.15rem; }
.tutorial-card p { margin: 0 1.25rem .5rem; line-height: 1.45; }
.tutorial-card .tutorial-link { font-size: .9rem; }
.tutorial-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; padding: .75rem 1.25rem 1rem; }
.tutorial-foot [data-tutorial-skip] { justify-self: start; }
.tutorial-nav { justify-self: end; display: flex; gap: .4rem; }
.tutorial-nav [data-tutorial-next] { min-width: 4.5rem; justify-content: center; }
.tutorial-nav [data-tutorial-back]:disabled { visibility: hidden; }
.tutorial-dots { display: flex; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.tutorial-dots li { width: .5rem; height: .5rem; border-radius: 50%; background: var(--border); }
.tutorial-dots li.is-current { background: var(--accent); }
.tutorial-list { list-style: none; padding: 0; display: grid; gap: 1rem; max-width: 44rem; }
.tutorial-list .card { padding: 0; overflow: hidden; }
.tutorial-list h2 { margin: .9rem 1rem .3rem; font-size: 1.05rem; }
.tutorial-list p { margin: 0 1rem .8rem; }
@media (max-width: 600px) {
    .tutorial { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: 12px 12px 0 0; }
    .tutorial-foot { grid-template-columns: auto 1fr auto; }
    .tutorial-dots { justify-content: center; }
}
/* HUB-0104: the same cards in the page (the beta pages). The cards share one grid cell, so Back and Next stay put. */
.tutorial.tutorial-inline { display: grid; width: auto; max-width: none; max-height: none; margin: 0; overflow: hidden;
    border-radius: 12px; box-shadow: none; }
.tutorial-inline .tutorial-card { grid-area: 1 / 1; min-width: 0; }
.tutorial-inline .tutorial-card[hidden] { display: block; visibility: hidden; }
.tutorial-inline .tutorial-dots { grid-column: 2; }
.agreement-intro { margin: 1rem 0 0; }
/* HUB-0048: the card just marked done, back on the board: a green glow and a tick that pops in, once. */
.board-card.just-done { position: relative; animation: just-done 2.4s ease-out; }
.board-card.just-done::after { content: "✓"; position: absolute; top: -.6rem; right: -.6rem; width: 1.9rem; height: 1.9rem;
    display: grid; place-items: center; border-radius: 50%; background: var(--success); color: #fff; font-weight: 700;
    box-shadow: 0 2px 6px rgb(0 0 0 / .2); animation: just-done-tick 2.4s ease-out forwards; }
@keyframes just-done { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); }
    25% { box-shadow: 0 0 0 .5rem color-mix(in srgb, var(--success) 25%, transparent); } 100% { box-shadow: 0 0 0 1rem transparent; } }
@keyframes just-done-tick { 0% { transform: scale(0); } 15% { transform: scale(1.25); } 25%, 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .board-card.just-done, .board-card.just-done::after { animation-duration: 3s; animation-name: just-done-still; }
    @keyframes just-done-still { 0%, 90% { opacity: 1; } 100% { opacity: 1; } }
}

/* HUB-0023: the CSV export under each log */
.log-export { margin-top: 1rem; }
.btn[disabled], .log-export input:disabled { opacity: .5; cursor: not-allowed; }

/* Connect an agent (HUB-0118) */
.connect-choices { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.connect-choices .is-current { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.connect-list { padding-left: 1.25rem; max-width: 52rem; }
.connect-list li { margin-bottom: .75rem; }
.connect-list li p { margin: 0 0 .25rem; }
.connect-list .token-box { margin: .25rem 0 0; }
.connect-progress { margin-top: 1.5rem; max-width: 52rem; }
.connect-follow { display: flex; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.connect-follow select { max-width: 100%; }
.connect-progress-steps li { margin: 0 0 .6rem; }
.connect-mark { display: inline-block; width: 1.25rem; font-weight: 700; }
.connect-progress-steps .is-done .connect-mark { color: var(--c-green, #2b8a3e); }
.connect-progress-steps .is-waiting .connect-mark { color: var(--muted); }
.connect-fix { margin: .2rem 0 0 1.25rem; color: var(--warning); }

/* HUB-0122: changes to the acceptance criteria. */
.criteria-changes { margin: .75rem 0; padding: 0; list-style: none; }
.criteria-change-ops { gap: .4rem; }
.criteria-change-op { display: flex; flex-direction: column; gap: .2rem; }
.criteria-change-list { margin: .25rem 0; padding-left: 1.2rem; }
.criteria-propose { margin-top: .75rem; }
.criteria-propose[open] form { margin-top: .5rem; }
.criteria-edit-row { display: flex; align-items: center; gap: .5rem; }
.criteria-edit-row input[type="text"] { flex: 1; min-width: 0; }
.criteria-edit-row label { white-space: nowrap; }
.criteria-history { margin-top: .75rem; }
.criteria-history > ul > li { margin-bottom: .5rem; }

/* Suggested updates to the rules for agents (HUB-0124) */
.nav-count { margin-left: .25rem; font-size: .7rem; padding: 0 .35rem; color: var(--accent); border-color: var(--accent); }
.rule-updates { margin-bottom: 1.25rem; }
.rule-updates > h2:first-child { margin-top: 0; }
.rule-updates > .rule-update { margin-top: 1.25rem; }
.rule-update { border-top: 1px solid var(--border); padding-top: 1.25rem; display: grid; gap: .6rem; }
/* The rules form starts with hidden inputs: no stack gap above its first visible line. */
.rules-form > input[type="hidden"] + p { margin-top: 0; }
.rule-update p { margin: 0; }
.rule-update-text { width: 100%; font-size: .85rem; resize: vertical; white-space: pre; overflow-x: auto; }
