/* The hub's design tokens, with neutral defaults: slate greys, an indigo brand, a blue accent and the device's own fonts. Rules use only
   these semantic names. An installation's palette file (/agency/palette.css, after this file) sets its own values for
   them, and the admin's night colour, accent and fonts come last. PaletteTokens.All in the Agency module lists the
   names a palette may set: keep it in step with this block. Text tokens meet WCAG AA (4.5:1) on the grounds they sit on. */
:root {
    /* Grounds */
    --bg: #F6F7FB;
    --surface: #FFFFFF;
    --surface-alt: #F1F5F9;
    --row-hover: #F8FAFC;        /* a table row under the pointer */
    --fill: #E2E8F0;             /* quiet blocks: tags, statuses, tracks, hovers, tab lines */
    --fill-strong: #CBD5E1;

    /* Text */
    --text: #0F172A;
    --text-muted: #475569;
    --text-subtle: #556274;
    --text-faint: #5F6B7E;       /* days outside the month */
    --heading: #0F172A;
    --link: #4338CA;

    /* Lines and focus */
    --border: #E2E8F0;
    --border-soft: #EEF2F6;      /* row rules inside a card */
    --border-mid: #CBD5E1;
    --border-strong: #8391A5;
    --focus: #4F46E5;
    --focus-on-night: #93C5FD;

    /* The brand ramp: the primary button, current tabs, done steps and soft chips */
    --brand-soft: #EEF2FF;
    --brand-light: #C7D2FE;
    --brand-mid: #A5B4FC;
    --brand: #4F46E5;
    --brand-strong: #4338CA;
    --on-brand: #FFFFFF;
    --on-strong: #FFFFFF;        /* text on a strong fill: a hovered button, a done step, the red button */

    /* The accent: one rule or marker per view, never a fill behind text. Its soft and strong shades mark warnings. */
    --accent: #2563EB;
    --accent-soft: #DBEAFE;
    --accent-strong: #1E40AF;

    /* States */
    --info: #1D4ED8;
    --info-bg: #E0E7FF;
    --on-info-bg: #1E3A8A;
    --success: #166534;
    --success-bg: #DCFCE7;
    --success-strong: #14532D;
    --on-success-bg: #14532D;
    --danger: #B91C1C;
    --danger-bg: #FEE2E2;
    --danger-strong: #991B1B;
    --on-danger-bg: #7F1D1D;

    /* Night: the sidebar, sign-in and map ground */
    --night: #0B1020;
    --night-mid: #111731;
    --night-raised: #182040;
    --night-active: #252E58;
    --on-night: #E2E8F0;
    --on-night-strong: #FFFFFF;
    --on-night-soft: #CBD5E1;
    --on-night-tint: #CBD5E1;
    --on-night-muted: #94A3B8;

    /* Shades */
    --scroll-shadow: rgba(15, 23, 42, 0.16);
    --backdrop: rgba(15, 23, 42, 0.55);

    --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* One spacing scale, on a 4px base. */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    /* One radius for cards and panels, a smaller one for controls inside them, and pills for status. */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 4px 10px -2px rgba(15, 23, 42, 0.08), 0 14px 30px -8px rgba(15, 23, 42, 0.14);
    --shadow-lg: 0 12px 24px -8px rgba(15, 23, 42, 0.18), 0 32px 64px -16px rgba(15, 23, 42, 0.30);

    /* Motion: one easing for things that arrive, and the soft ring a focused field or button wears. */
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ring: color-mix(in srgb, var(--focus) 22%, transparent);

    --sidebar: 248px;
    /* What a scroll box's edge cue fades into: the page, or the card it sits in. */
    --scroll-ground: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
code { font-size: 0.92em; }

/* Shell: a sidebar on wide screens, a top bar with a menu on phones and tablets. The sidebar's column is painted dark
   all the way down, so the sidebar never looks cut off however long the page, and the sidebar itself sticks to the top. */
.hub-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); background: linear-gradient(to right, var(--night) var(--sidebar), var(--bg) var(--sidebar)); }
.hub-topbar { display: none; }
.hub-brand { font-family: var(--font-heading); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--on-night-strong); text-decoration: none; white-space: nowrap; }
.hub-brand:hover { color: var(--on-night-strong); }

.hub-sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-5) var(--space-3) var(--space-4); background: var(--night); color: var(--on-night); scrollbar-width: thin; scrollbar-color: var(--night-active) transparent; }
.hub-sidebar :focus-visible { outline-color: var(--focus-on-night); }
.hub-sidebar-brand { display: flex; flex-direction: column; gap: 2px; padding: 0 12px 4px; }
/* The agency's logo, when it has one, in place of the brand text: 32px high in the sidebar, 48px on the sign-in pages. */
.hub-logo { display: block; max-width: 100%; max-height: 32px; width: auto; height: auto; }
.hub-account-brand .hub-logo { max-height: 48px; margin: 0 auto; }
.hub-sidebar-brand span { font-family: var(--font-body); font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-night-tint); }
.hub-nav-group { display: flex; flex-direction: column; gap: 2px; }
.hub-nav-label { padding: 0 12px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-night-muted); }
.hub-nav-group a { position: relative; display: block; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--on-night); font-size: 14px; font-weight: 500; text-decoration: none; }
.hub-nav-group a:hover { background: var(--night-raised); color: var(--on-night-strong); }
/* The current page: a raised block with an accent marker, the view's one accent. */
.hub-nav-group a.active { background: var(--night-active); color: var(--on-night-strong); font-weight: 600; }
.hub-nav-group a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--accent); }
.hub-nav-group.upcoming a { color: var(--on-night-muted); }
.hub-nav-group.upcoming a.active { color: var(--on-night-strong); }
.hub-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding: var(--space-4) 12px 0; border-top: 1px solid var(--night-raised); }
.hub-person { font-size: 13px; font-weight: 600; color: var(--on-night-strong); overflow-wrap: anywhere; }
a.hub-person { text-decoration: none; }
a.hub-person:hover, a.hub-person:focus-visible, a.hub-person.active { text-decoration: underline; }
.hub-signout { margin: 0; }
.hub-signout button { padding: 0; border: 0; background: none; color: var(--on-night-tint); font: 500 13px var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hub-signout button:hover { color: var(--on-night-strong); }

/* Positioned, so the picture of the last page (hubPage.js) can sit exactly over the page while the next one loads. */
.hub-main { position: relative; width: 100%; max-width: 1280px; padding: var(--space-6) 40px 64px; }

@media (max-width: 1023px) {
    .hub-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; background: var(--bg); }
    .hub-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--night); }
    .hub-topbar :focus-visible { outline-color: var(--focus-on-night); }
    .hub-menu { min-height: 40px; padding: 0 16px; border: 1px solid var(--night-active); border-radius: var(--radius-sm); background: var(--night-raised); color: var(--on-night-strong); font: 600 13.5px var(--font-body); cursor: pointer; }
    .hub-sidebar { display: none; position: fixed; inset: 60px 0 0 0; z-index: 19; height: auto; }
    .hub-sidebar-brand { display: none; }
    .menu-open .hub-sidebar { display: flex; }
    .hub-main { padding: var(--space-5) var(--space-4) var(--space-7); }
}

/* Page furniture */
.hub-h1 { margin: 0; font-family: var(--font-heading); font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--heading); }
.hub-h1:focus { outline: none; }
.hub-sub { margin: var(--space-2) 0 var(--space-6); max-width: 72ch; color: var(--text-muted); font-size: 15px; line-height: 1.6; }
/* On a client's page the client header already names the client and the tab, so the page's own title steps down to a
   section title and its intro to a quiet line. The layout draws the header above the page (.hub-page); a page drawn
   without that layout has it in place. */
.hub-client-head ~ .hub-h1, .hub-client-head ~ .hub-page > .hub-h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.hub-client-head ~ .hub-sub, .hub-client-head ~ .hub-page > .hub-sub { margin: 2px 0 var(--space-5); font-size: 14px; color: var(--text-subtle); }
.hub-client-head ~ .hub-crumbs + .hub-h1, .hub-client-head ~ .hub-page > .hub-crumbs + .hub-h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; }
.hub-h2 { margin: 0 0 var(--space-3); font-family: var(--font-heading); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; color: var(--heading); }
.hub-label { margin: 0 0 var(--space-3); font-family: var(--font-body); font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.hub-card { --scroll-ground: var(--surface); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px var(--space-5); }
.hub-section { margin-bottom: var(--space-5); }
/* A card's first and last parts don't add their own margins to its padding, so the space is the same at top and bottom. */
.hub-card > :first-child { margin-top: 0; }
.hub-card > :last-child { margin-bottom: 0; }
.hub-section-plain { margin-bottom: var(--space-6); }
/* A box that scrolls sideways, with a soft shadow at an edge while there's more to see that way. The covers move with the
   content (local) and the shadows stay put (scroll), so a shadow shows only where content is hidden. */
.hub-scroll {
    /* Positioned, so a visually hidden label in a scrolled-off column stays inside the box instead of widening the page. */
    position: relative; overflow-x: auto; overscroll-behavior-x: contain;
    background:
        linear-gradient(to right, var(--scroll-ground) 30%, transparent) left center / 40px 100% no-repeat local,
        linear-gradient(to left, var(--scroll-ground) 30%, transparent) right center / 40px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), transparent) left center / 14px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), transparent) right center / 14px 100% no-repeat scroll;
}
.hub-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.hub-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.hub-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4) var(--space-4); align-items: end; }
/* A form whose fields carry hints of different lengths: line the labels up, not the inputs. */
.hub-form-top { align-items: start; }

@media (max-width: 640px) {
    .hub-h1 { font-size: 28px; }
    .hub-card { padding: var(--space-4); }
    .hub-client-head ~ .hub-crumbs + .hub-h1, .hub-client-head ~ .hub-page > .hub-crumbs + .hub-h1 { font-size: 24px; }
}

/* Tables: label-type headers, one soft rule between rows, every cell centred on the row, numbers right-aligned. */
.hub-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hub-table th { text-align: left; padding: 0 var(--space-4) 10px 0; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; vertical-align: bottom; }
.hub-table td { padding: var(--space-3) var(--space-4) var(--space-3) 0; border-top: 1px solid var(--border-soft); vertical-align: middle; }
.hub-table tbody tr:first-child > * { border-top: 0; }
.hub-table tbody tr:last-child td { padding-bottom: var(--space-1); }
.hub-table th:last-child, .hub-table td:last-child { padding-right: 0; }
.hub-table tbody tr:hover td { background: var(--row-hover); }
.hub-grid select { height: 36px; min-width: 150px; padding: 0 6px; font-size: 13px; }
/* A name edited in place in a settings table: the grid select's size, with a field's edge. */
.hub-table input[type="text"] {
    min-height: 36px; width: 100%; min-width: 140px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); font: 400 13px var(--font-body); color: var(--text);
}
.hub-table input[type="text"]:hover { border-color: var(--brand-strong); }
.hub-table input[type="text"]:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 1px; }
.hub-table .hub-inline > input[type="text"] { width: auto; flex: 1 1 140px; }
.hub-table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.hub-grid th[scope="row"] { font-weight: 600; font-size: 13.5px; letter-spacing: 0; text-transform: none; color: var(--heading); white-space: nowrap; border-bottom: 0; border-top: 1px solid var(--border-soft); }
/* On a phone a table keeps readable columns and scrolls sideways in its card, with the edge shadow showing there's more. */
@media (max-width: 640px) {
    .hub-scroll > .hub-table:not(.hub-items) { min-width: 600px; }
}
/* Words wrap between words only. A cell that holds one long token (a handle, a web address, a key) adds .hub-break. */
.hub-table td { overflow-wrap: normal; }
.hub-break, .hub-table td.hub-break { overflow-wrap: anywhere; }
.hub-nowrap { white-space: nowrap; }
/* Stacked rows: under 600px a .hub-table-stack table is a list, each row a block and each cell under its own small label
   (the cell's data-label), so no column is ever off-screen. */
@media (max-width: 599px) {
    .hub-scroll > .hub-table.hub-table-stack { min-width: 0; }
    .hub-table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .hub-table-stack, .hub-table-stack tbody { display: block; }
    .hub-table-stack tr { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); }
    .hub-table-stack tbody tr:first-child { border-top: 0; padding-top: 0; }
    .hub-table-stack tbody tr:hover td { background: none; }
    .hub-table-stack td, .hub-table-stack tbody tr:last-child td { display: block; padding: 0; border: 0; text-align: left; }
    .hub-table-stack td:empty { display: none; }
    .hub-table-stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 1px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
    .hub-table.hub-table-stack td:last-child:has(> :is(a, button):only-child) { text-align: left; }
    .hub-table-stack .hub-actions { justify-content: flex-start; }
}
/* Row actions sit at the row's end. */
.hub-table td:last-child:has(> :is(a, button):only-child) { text-align: right; }

/* Form controls */
.hub-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--heading); min-width: 0; }
/* Control edges use --border-strong, about 3.4:1 on white, so a field's outline reaches the 3:1 a control needs. */
.hub-field input, .hub-field select, .hub-field textarea, .hub-grid select {
    min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
    font: 400 14px var(--font-body); color: var(--text); width: 100%; transition: border-color 0.12s;
}
.hub-field input:hover, .hub-field select:hover, .hub-field textarea:hover { border-color: var(--brand-strong); }
.hub-field input:focus-visible, .hub-field select:focus-visible, .hub-field textarea:focus-visible, .hub-grid select:focus-visible,
.hub-field input:focus, .hub-field select:focus, .hub-field textarea:focus, .hub-grid select:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 1px; }
.hub-field input::placeholder, .hub-field textarea::placeholder { color: var(--text-subtle); }
.hub-field input[type="file"] { padding: 8px 12px; }
.hub-inline .hub-field { min-width: 200px; }
/* Fields fill their column: in a row of fields each grows to an even share, up to a readable width; on a phone each takes
   the whole row. */
.hub-inline > .hub-field { flex: 1 1 220px; max-width: 360px; }
@media (max-width: 640px) {
    .hub-inline > .hub-field, .hub-toolbar > .hub-field, .hub-inline .hub-field { flex: 1 1 100%; max-width: none; min-width: 0; }
}
/* One error pattern: the message under its field, in red, with a red edge on the field (aria-invalid, and Blazor's
   .invalid), tied to it by aria-describedby (HubFieldError). A .hub-error box at the top is only for a server error that
   isn't about one field. */
.hub-field :is(input, select, textarea)[aria-invalid="true"], .hub-field :is(input, select, textarea).invalid { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.hub-field :is(input, select, textarea)[aria-invalid="true"]:focus, .hub-field :is(input, select, textarea).invalid:focus { border-color: var(--danger); outline-color: var(--danger); }
/* In a row of fields the button lines up with the inputs, not with a message under one of them. */
.hub-inline:has(.hub-field-error) { align-items: flex-start; }
.hub-inline:has(.hub-field-error) > :is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-check, .hub-actions) { margin-top: 28px; }
.hub-field-error, .hub-field .validation-message { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--danger); }
.hub-hint { font-weight: 400; color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }
.hub-check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; font-weight: 500; cursor: pointer; }
.hub-check input { width: 16px; height: 16px; accent-color: var(--brand); }
fieldset.hub-checks, .hub-checks { display: flex; flex-wrap: wrap; gap: 2px 20px; margin: 0; padding: 0; border: 0; min-width: 0; }
.hub-checks legend { width: 100%; padding: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--heading); }

/* Actions, in four kinds, all in sentence case. Every button looks like a button; bare bold or red text is never one.
   - primary (.hub-btn): the one main action in a view; a block in the brand colour.
   - secondary (.hub-btn-secondary): other actions beside it; white with a border.
   - quiet (.hub-btn-quiet): actions repeated on every row, and Cancel or Show more; a soft grey block with a light edge.
   - link (.hub-link, or a plain <a>): going somewhere, such as Set up or Open the report; underlined text.
   - destructive (.hub-btn-danger): Remove, Delete, Deactivate; a secondary button in red. One that can't be undone asks
     first in a HubDialog, whose confirm button is .hub-btn-danger-solid. */
.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 var(--space-4);
    border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
    font: 600 13.5px/1.2 var(--font-body); letter-spacing: 0.005em; text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background-color 0.12s, border-color 0.12s, color 0.12s, transform 0.12s;
}
.hub-btn { background: var(--brand); color: var(--on-brand); }
.hub-btn:hover { background: var(--brand-strong); color: var(--on-strong); }
.hub-btn-secondary { background: var(--surface); border-color: var(--border-mid); color: var(--heading); }
.hub-btn-secondary:hover { background: var(--surface-alt); border-color: var(--border-strong); color: var(--heading); }
.hub-btn-quiet { padding: 0 12px; background: var(--surface-alt); border-color: var(--border); color: var(--heading); }
.hub-btn-quiet:hover { background: var(--fill); border-color: var(--border-mid); color: var(--heading); }
.hub-btn-danger { padding: 0 12px; background: var(--surface); border-color: var(--border-mid); color: var(--danger); }
.hub-btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger-strong); }
.hub-btn-danger-solid { background: var(--danger); color: var(--on-strong); }
.hub-btn-danger-solid:hover { background: var(--danger-strong); color: var(--on-strong); }
.hub-btn:active:not(:disabled), .hub-btn-secondary:active:not(:disabled), .hub-btn-danger-solid:active:not(:disabled) { transform: scale(0.97); }
:is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid):disabled { opacity: 0.5; cursor: default; transform: none; }
.hub-btn-quiet:disabled:hover { background: var(--surface-alt); border-color: var(--border); }
.hub-btn-danger:disabled:hover { background: var(--surface); border-color: var(--border-mid); color: var(--danger); }
/* A button that reads as a link: going somewhere or a light aside, never the main action. */
.hub-link { display: inline; padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer; }
.hub-link:hover { color: var(--brand-strong); }
.hub-link:disabled { color: var(--text-muted); text-decoration: none; cursor: default; }
.hub-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* In rows and side panels, buttons are a size down. */
:is(.hub-table, .hub-step-row, .hub-note-list) :is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid) { min-height: 34px; font-size: 13px; }
.hub-table .hub-actions { justify-content: flex-end; }
@media (pointer: coarse) {
    :is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid) { min-height: 44px !important; }
}
@media (prefers-reduced-motion: reduce) {
    :is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid):active { transform: none; }
}

/* Messages, chips and small parts */
.hub-error { margin: 0 0 var(--space-4); padding: 11px 14px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--on-danger-bg); font-size: 14px; list-style: none; }
.hub-ok { margin: 0 0 var(--space-4); padding: 11px 14px; border-radius: var(--radius-sm); background: var(--success-bg); color: var(--on-success-bg); font-size: 14px; }
/* A quiet line that applies to everything under it, such as why the figures below aren't compared. */
.hub-info { position: relative; margin: 0 0 var(--space-3); padding: 9px 14px 9px 38px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--on-info-bg); font-size: 13.5px; line-height: 1.45; }
.hub-info::before { content: "i"; position: absolute; left: 14px; top: 11px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--info); color: var(--on-strong); font: italic 700 11px/1 Georgia, serif; }
.hub-info a { color: inherit; font-weight: 600; }
.hub-note { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; }
.hub-or { margin: 14px 0; text-align: center; color: var(--text-muted); font-size: 13px; }
.hub-key { margin: 4px 0 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-alt); font-size: 14px; overflow-wrap: anywhere; }
.hub-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-alt); list-style: none; }
/* Tags name a kind (a service, a format, Admin): small, flat, square-cut and never bold enough to pass for a button. */
.hub-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--fill); color: var(--brand-strong); font-size: 11px; font-weight: 600; vertical-align: 1px; }
/* Statuses say how something stands: a pill led by a dot in its colour. */
.hub-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--fill); color: var(--heading); }
.hub-status::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.75; }
.hub-status.ok { background: var(--success-bg); color: var(--success-strong); }
.hub-status.wait { background: var(--info-bg); color: var(--on-info-bg); }
.hub-status.warn { background: var(--accent-soft); color: var(--accent-strong); }
.hub-status.bad { background: var(--danger-bg); color: var(--danger-strong); }
a.hub-status { text-decoration: none; }
a.hub-status:hover { text-decoration: underline; }
.hub-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hub-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 4px; background: var(--brand-soft); color: var(--heading); font-size: 12px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
a.hub-chip { color: var(--link); background: transparent; box-shadow: inset 0 0 0 1px var(--border); text-decoration: underline; text-underline-offset: 2px; }
a.hub-chip:hover { color: var(--heading); background: var(--surface-alt); }
.hub-setup { display: flex; align-items: center; white-space: nowrap; }
.hub-setup + .hub-status { margin-top: 6px; }
.hub-grid th[scope="row"], .hub-grid th[scope="col"]:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.hub-progress { display: inline-block; width: 90px; height: 6px; margin-right: 8px; background: var(--fill); border-radius: 3px; vertical-align: middle; overflow: hidden; }
.hub-progress i { display: block; height: 100%; background: var(--brand); }
/* An empty state: what's missing, and the one thing to do about it. */
.hub-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-5); max-width: 760px; }
.hub-empty p { margin: 0; }
.hub-empty .hub-empty-title { font: 700 17px/1.3 var(--font-heading); color: var(--heading); }
.hub-details { margin-bottom: 16px; font-size: 14px; }
.hub-details summary { cursor: pointer; color: var(--link); font-weight: 500; padding: 6px 0; }
.hub-qr { display: block; margin: 0 auto 14px; width: 220px; height: 220px; max-width: 100%; }

/* Team home */
.hub-setup-steps { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.hub-setup-hide { margin: var(--space-4) 0 0; font-size: 13.5px; }
.hub-client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
/* A client card is one link to the client's summary: the name's link stretches over the whole card (its ::after), and
   Setup and connections sits above that layer as its own link, so no link is nested in another. */
.hub-client { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.hub-client:hover { border-color: var(--brand-mid); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.hub-client:has(.hub-client-open:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-client h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; font-family: var(--font-heading); font-size: 19px; font-weight: 700; letter-spacing: -0.015em; color: var(--heading); }
.hub-client .hub-note { margin: 0; }
.hub-client-open { color: inherit; text-decoration: none; }
.hub-client-open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; cursor: pointer; }
.hub-client-open:focus-visible { outline: none; }
.hub-client:hover .hub-client-open { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hub-client-go { flex: none; color: var(--border-mid); font-family: var(--font-body); font-size: 16px; font-weight: 500; transition: color 0.15s, transform 0.15s; }
.hub-client:hover .hub-client-go { color: var(--link); transform: translateX(3px); }
.hub-client-link { position: relative; z-index: 2; align-self: flex-start; margin-top: auto; padding-top: var(--space-1); font-size: 13px; font-weight: 600; color: var(--text-muted); }
.hub-client-link:hover { color: var(--heading); }
@media (prefers-reduced-motion: reduce) {
    .hub-client:hover { transform: none; }
    .hub-client:hover .hub-client-go { transform: none; }
}

/* Client header: the client's name, services, switcher and tabs, at the top of every client-scoped page. */
.hub-visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hub-client-head { margin: -6px 0 var(--space-5); }
.hub-client-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: var(--space-2); }
.hub-client-id { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.hub-client-name { margin: 0; font-family: var(--font-heading); font-size: 26px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; color: var(--heading); overflow-wrap: anywhere; }
.hub-chip-quiet { background: var(--fill); color: var(--text-muted); }
/* The switcher: a button that opens a list of links, laid over the page below it. */
.hub-client-switch { position: relative; }
.hub-client-switch:focus { outline: none; }
.hub-client-switch-button {
    position: relative; min-height: 38px; padding: 0 36px 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--heading); font: 600 13.5px var(--font-body); cursor: pointer; text-align: left;
}
/* The chevron is a mask filled with the theme's strong brand colour, so it follows the agency's palette. */
.hub-client-switch-button::after {
    content: ""; position: absolute; top: 50%; right: 12px; width: 12px; height: 8px; margin-top: -4px; pointer-events: none;
    background-color: var(--brand-strong);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat center / 12px 8px;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat center / 12px 8px;
}
.hub-client-switch-button[aria-expanded="true"]::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5l5-5 5 5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5l5-5 5 5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E");
}
.hub-client-switch-button:hover { border-color: var(--brand-strong); }
.hub-client-switch-button:focus-visible { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-client-list {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 20; min-width: 240px; max-width: min(340px, calc(100vw - 32px));
    max-height: min(60vh, 420px); overflow-y: auto; margin: 0; padding: 6px; list-style: none;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.hub-client-list[hidden] { display: none; }
.hub-client-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 0 10px;
    border-radius: var(--radius-sm); color: var(--heading); font-size: 14px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
}
a.hub-client-option:hover { background: var(--surface-alt); color: var(--link); }
a.hub-client-option:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.hub-client-option[aria-current] { color: var(--text-muted); cursor: default; }
.hub-client-option-note { flex: none; font-size: 12px; font-weight: 500; color: var(--text-muted); }

/* The bar scrolls sideways rather than wrapping. Its line is a shadow inside it, so nothing overflows downwards, and
   every tab keeps the same weight and a 2px border, so the current one changes colour, never size. */
.hub-client-tabs { position: relative; display: flex; gap: 2px; overflow-x: auto; overscroll-behavior-x: contain; box-shadow: inset 0 -1px 0 var(--fill); }
.hub-client-tab {
    flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 11px; border-bottom: 2px solid transparent;
    color: var(--text-muted); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.hub-client-tab:hover { color: var(--heading); border-bottom-color: var(--border-mid); }
.hub-client-tab[aria-current="page"] { color: var(--heading); border-bottom-color: var(--brand); }
.hub-client-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; border-radius: var(--radius-sm); }
@media (hover: none) { .hub-client-tabs { scrollbar-width: none; } .hub-client-tabs::-webkit-scrollbar { display: none; } }
/* At desktop every tab fits: the tabs that don't are hidden from the bar ([data-over], set by clientHeader.js) and listed
   under More instead, which shows only then. The current tab always stays in the bar. */
.hub-client-nav { display: flex; align-items: stretch; box-shadow: inset 0 -1px 0 var(--fill); }
.hub-client-nav > .hub-client-tabs { flex: 1 1 auto; min-width: 0; }
.hub-client-tab[data-over] { display: none; }
.hub-client-more { position: relative; flex: none; display: flex; }
.hub-client-more[hidden] { display: none; }
.hub-client-more-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 11px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); font: 600 14px var(--font-body); cursor: pointer; white-space: nowrap; }
.hub-client-more-button:hover, .hub-client-more-button[aria-expanded="true"] { color: var(--heading); border-bottom-color: var(--border-mid); }
.hub-client-more-button:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; border-radius: var(--radius-sm); }
.hub-client-more-list { position: absolute; top: calc(100% + 4px); right: 0; z-index: 20; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.hub-client-more-list[hidden], .hub-client-more-list li:not([data-over]) { display: none; }
.hub-client-more-list a { display: flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: var(--radius-sm); color: var(--heading); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.hub-client-more-list a:hover { background: var(--surface-alt); color: var(--link); }
.hub-client-more-list a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 1023px) {
    /* The bar runs to the screen's edges, so a tab cut off at the side shows there is more. */
    .hub-client-tabs { margin: 0 -16px; padding: 0 16px; scroll-padding-inline: 16px; }
    /* It fades out at both edges, over its own padding, so a tab running off the side reads as more to scroll to. */
    .hub-client-tabs { -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 28px), transparent); }
}
@media (max-width: 640px) {
    .hub-client-head { margin: -4px 0 24px; }
    .hub-client-name { font-size: 22px; }
    .hub-client-switch { flex: 1 1 100%; }
    .hub-client-switch-button { width: 100%; min-height: 44px; font-size: 16px; }
    .hub-client-list { left: 0; right: 0; min-width: 0; max-width: none; }
    .hub-client-option { min-height: 44px; font-size: 16px; }
}

/* Setup and connections */
.hub-steps { list-style: none; margin: 0; padding: 0; }
.hub-step { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) 0; border-top: 1px solid var(--border-soft); }
.hub-step:first-child { border-top: 0; padding-top: 0; }
.hub-step:last-child { padding-bottom: 0; }
.hub-step-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 24px; }
.hub-step-row > .hub-actions { flex: none; }
.hub-step-main { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hub-step-main p { margin: 0; }
.hub-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hub-step-head b { font-family: var(--font-heading); font-size: 16px; font-weight: 700; color: var(--heading); }
.hub-step-desc { color: var(--text-muted); font-size: 13.5px; }
.hub-step .hub-error, .hub-step .hub-ok { margin: 4px 0 0; }
.hub-step-form { padding: var(--space-4); border-radius: var(--radius); background: var(--surface-alt); display: flex; flex-direction: column; gap: var(--space-3); }

/* Sync: clients with nothing to sync yet, together in one short list. */
.hub-idle { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hub-idle li:not(:last-child)::after { content: "\00B7"; margin: 0 10px; color: var(--border-mid); }
.hub-idle .hub-hint { margin-left: 4px; }

/* Sign-in pages */
/* The card sits a little above the middle of a dark page, under the name and a short accent rule. */
.hub-account { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-5); min-height: 100vh; padding: var(--space-7) var(--space-4) 12vh; background: var(--night); }
.hub-account :focus-visible { outline-color: var(--focus-on-night); }
.hub-account-card :focus-visible { outline-color: var(--focus); }
.hub-account-brand { font-family: var(--font-heading); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--on-night-strong); text-align: center; }
.hub-account-brand span { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 10.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--on-night-tint); }
.hub-account-brand::after { content: ""; display: block; width: 28px; height: 2px; margin: 14px auto 0; background: var(--accent); }
.hub-account-card { width: 100%; max-width: 420px; padding: var(--space-6); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.hub-account-card .hub-h1 { font-size: 28px; margin-bottom: var(--space-5); }
.hub-account-card .hub-sub { margin: -12px 0 var(--space-5); font-size: 14px; }
.hub-account-card .hub-btn, .hub-account-card .hub-btn-secondary { width: 100%; min-height: 44px; }
.hub-account-card .hub-stack { gap: var(--space-4); }
.hub-account-card > .hub-note:last-child { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-soft); text-align: center; }
@media (max-width: 640px) {
    .hub-account { justify-content: flex-start; padding-top: var(--space-6); }
    .hub-account-card { padding: var(--space-5); }
}

/* Content board */
.hub-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-4); }
.hub-toolbar > .hub-field { min-width: 240px; }
.hub-board { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: var(--space-3); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.hub-column { display: flex; flex-direction: column; gap: 10px; min-height: 200px; padding: var(--space-3); border-radius: var(--radius); background: var(--surface-alt); scroll-snap-align: start; }
.hub-column header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 2px 4px 6px; }
.hub-column header b { font-family: var(--font-heading); font-size: 16px; color: var(--heading); }
.hub-column header .hub-hint { flex-basis: 100%; }
.hub-count { padding: 0 7px; border-radius: var(--radius-pill); background: var(--fill-strong); font-size: 11.5px; font-weight: 600; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.hub-tile { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s; }
.hub-tile:hover { border-color: var(--brand-mid); color: var(--text); box-shadow: var(--shadow-md); }
.hub-tile-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.hub-tile-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; color: var(--text-muted); font-size: 12.5px; }
.hub-tile-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-tile-due { flex: none; white-space: nowrap; }
/* A tile's chips wrap inside it: a long approval state breaks onto its own line rather than spilling out. */
.hub-tile .hub-chips { flex-wrap: wrap; min-width: 0; }
.hub-tile .hub-status { max-width: 100%; white-space: normal; text-align: left; border-radius: 10px; }
.hub-tile { min-width: 0; }
.hub-overdue { color: var(--danger); font-weight: 600; }

/* Card page */
.hub-crumbs { margin: 0 0 6px; font-size: 13px; color: var(--text-muted); }
.hub-under-title { margin: var(--space-3) 0 var(--space-5); }
.hub-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-4); align-items: start; }
.hub-split > .hub-stack { gap: var(--space-4); }
.hub-split .hub-section { margin-bottom: 0; }
/* The next card after a split keeps the same gap as any two cards. */
.hub-split + .hub-section { margin-top: var(--space-5); }
fieldset.hub-plain { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
.hub-field textarea { padding: 10px 12px; min-height: 96px; line-height: 1.5; resize: vertical; }
.hub-field input:disabled, .hub-field textarea:disabled, .hub-field select:disabled { background: var(--surface-alt); color: var(--text); }
/* The approval steps as a tracker: a numbered dot per step on one line, filled when done, ringed while it's that step's
   turn, in the warning shade when it sent the work back, and hollow while it waits its turn. Each says its state in words too. */
.hub-chain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 var(--space-4); padding: 0; list-style: none; counter-reset: step; }
.hub-chain li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 4px; text-align: center; counter-increment: step; }
.hub-chain li::before {
    content: counter(step); position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 6px;
    border: 2px solid var(--border-mid); border-radius: 50%; background: var(--surface); color: var(--text-muted); font: 700 12.5px/1 var(--font-body);
}
/* The line from each dot to the next. */
.hub-chain li:not(:last-child)::after { content: ""; position: absolute; top: 13px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; border-radius: 1px; background: var(--fill); }
.hub-chain li.done:not(:last-child)::after { background: var(--brand-mid); }
.hub-chain-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--heading); }
.hub-chain-state { font-size: 11.5px; line-height: 1.3; color: var(--text-subtle); }
.hub-chain li.done::before { content: "\2713"; border-color: var(--brand); background: var(--brand); color: var(--on-strong); }
.hub-chain li.done .hub-chain-state { color: var(--success); }
.hub-chain li.now::before { border-color: var(--info); color: var(--info); box-shadow: 0 0 0 4px var(--info-bg); }
.hub-chain li.now .hub-chain-state { color: var(--info); font-weight: 600; }
.hub-chain li.back::before { content: "!"; border-color: var(--accent-strong); background: var(--accent-soft); color: var(--accent-strong); }
.hub-chain li.back .hub-chain-state { color: var(--accent-strong); font-weight: 600; }
.hub-history { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.hub-history li { display: flex; flex-direction: column; gap: 2px; }
.hub-quote { margin-top: 4px; padding: 6px 10px; border-left: 3px solid var(--brand-light); background: var(--surface-alt); }
/* The card's step bar, above the idea: the approval tracker's look with four steps and, under it, what to do next. A
   step's name is a link to its part of the page, and the whole step is its target. */
.hub-cardsteps { margin: 0 0 var(--space-5); }
.hub-cardsteps .hub-chain { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--space-3); }
.hub-cardsteps > .hub-note { margin: 0; text-align: center; }
.hub-cardsteps a.hub-chain-name { color: var(--heading); text-decoration: none; }
.hub-cardsteps a.hub-chain-name::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.hub-cardsteps li:hover a.hub-chain-name { text-decoration: underline; }
/* A step's part of the page stops clear of the top bar when its link is followed. */
#card-idea, #card-files, #card-make, #card-next { scroll-margin-top: 72px; }
/* Make it on the post kit: its hint sits under the kit's buttons. */
.hub-kit .hub-kit-make { margin: var(--space-2) 0 0; }
/* The video's controls in plain view (the sound beside Make, then the music switch and Ask for a change under the
   player), and Advanced, which folds the rest away under a line. */
.hub-video-make { align-items: flex-end; }
.hub-video-make .hub-field { margin: 0; }
.hub-video-plain { display: flex; flex-direction: column; gap: var(--space-3); max-width: 640px; margin-top: var(--space-4); }
.hub-video-advanced { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.hub-video-advanced > summary .hub-label { margin: 0; }
.hub-video-advanced > .hub-motion { margin-top: 0; }

/* My work */
.hub-work { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.hub-work li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); }
.hub-work li:first-child { border-top: 0; padding-top: 0; }
.hub-work li:last-child { padding-bottom: 0; }
.hub-work a { font-weight: 600; }

/* Needs attention: Team home's lines for people who run clients, grouped under each kind's heading. */
.hub-oversight-kind { display: flex; align-items: center; margin: var(--space-5) 0 var(--space-2); font: 600 14px var(--font-body); color: var(--heading); }
.hub-oversight-kind:first-child { margin-top: 0; }
.hub-oversight .hub-status { max-width: 100%; white-space: normal; text-align: left; border-radius: 10px; }
.hub-oversight-more { display: flex; flex-wrap: wrap; gap: 4px var(--space-4); margin: var(--space-3) 0 0; }

/* System health: the row that joins Jobs and workers to Sync. A page's own tabs under it keep a clear gap, so the two never read as one strip. */
.hub-health-nav + .hub-page-tabs { margin-top: 0; }

@media (max-width: 1100px) {
    .hub-split { grid-template-columns: minmax(0, 1fr); }
}

/* Brand kits */
.hub-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 13px; }
.hub-swatches li { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.hub-swatch { grid-row: span 2; width: 26px; height: 26px; border-radius: var(--radius-sm); border: 1px solid rgba(0, 0, 0, 0.12); }
.hub-swatches code { color: var(--text-muted); font-size: 11.5px; }
.hub-pre { max-height: 420px; overflow: auto; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-alt); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }

/* Packages */
.hub-deliverables { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; }
.hub-deliverables b { font-family: var(--font-heading); font-size: 15px; color: var(--heading); }
.hub-deliverables .short b { color: var(--danger); }
.hub-edit-row td { background: transparent !important; border-top: 0; padding-top: 0; padding-right: 0; }
.hub-form-tight { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

/* Popups (HubDialog): a native modal dialog in the top layer, anchored near the top so it doesn't jump as its content
   changes, never touching the screen's edges. The head and foot stay put; the body scrolls. A full-height sheet on a phone. */
.hub-dlg {
    --dlg-top: min(8vh, 72px);
    width: min(640px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - var(--dlg-top) - 24px); margin: var(--dlg-top) auto auto;
    padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden;
}
.hub-dlg[open] { display: flex; flex-direction: column; }
.hub-dlg::backdrop { background: var(--backdrop); }
.hub-dlg-sm { width: min(480px, calc(100vw - 32px)); }
.hub-dlg-lg { width: min(960px, calc(100vw - 32px)); }
.hub-dlg-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px var(--space-5) 14px; border-bottom: 1px solid var(--border-soft); }
.hub-dlg-titles { min-width: 0; padding-top: 4px; }
.hub-dlg-titles .hub-h2 { margin: 0; overflow-wrap: anywhere; }
.hub-dlg-titles .hub-note { margin: 2px 0 0; }
.hub-dlg-body { --scroll-ground: var(--surface); flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-4) var(--space-5) var(--space-5); }
.hub-dlg-body > :first-child { margin-top: 0; }
.hub-dlg-body > :last-child { margin-bottom: 0; }
.hub-dlg-body > * + :is(.hub-stack, form, fieldset, section) { margin-top: var(--space-5); }
.hub-dlg-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 14px var(--space-5); border-top: 1px solid var(--border-soft); background: var(--surface); }
/* The page behind doesn't scroll while a popup is open. */
html:has(.hub-dlg[open]) { overflow: hidden; }
/* The catalog keeps one height across its tabs, so the popup doesn't jump as tabs change. */
.hub-catalog .hub-dlg-body { min-height: min(56vh, 520px); }
@media (max-width: 640px) { .hub-catalog .hub-dlg-body { min-height: 0; } }
.hub-dialog-close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--heading); font-size: 22px; line-height: 1; cursor: pointer; }
.hub-dialog-close:hover { background: var(--fill); }
.hub-dialog-close:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 640px) {
    .hub-dlg, .hub-dlg-sm, .hub-dlg-lg { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
    .hub-dlg-head { padding: 12px var(--space-4) 10px; }
    .hub-dlg-body { padding: var(--space-3) var(--space-4) var(--space-4); }
    .hub-dlg-foot { padding: 12px var(--space-4); }
    .hub-dlg-foot > :is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid) { flex: 1 1 auto; }
}
/* Second-level tabs (channel groups, catalog categories): the same underline as the client tabs, a little smaller. */
.hub-tabs { display: flex; gap: 2px; margin-bottom: var(--space-4); overflow-x: auto; box-shadow: inset 0 -1px 0 var(--fill); }
.hub-tab { flex: none; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-muted); font: 600 13.5px var(--font-body); cursor: pointer; }
.hub-tab:hover { color: var(--heading); border-bottom-color: var(--border-mid); }
.hub-tab:focus-visible { outline-offset: -4px; border-radius: var(--radius-sm); }
.hub-tab[aria-selected="true"], .hub-tab[aria-current="page"] { color: var(--heading); border-bottom-color: var(--brand); }
a.hub-tab { text-decoration: none; }
.hub-tabpanel .hub-step:first-child { border-top: 0; }

/* Connector guides: the small ⓘ next to an integration's name, and its popup (HubGuide). */
.hub-guide-btn { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1.5px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text-muted); font: italic 700 13px/1 Georgia, "Times New Roman", serif; cursor: pointer; vertical-align: middle; }
.hub-guide-btn:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--heading); }
.hub-guide-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-title-row { display: flex; align-items: center; gap: var(--space-2); }
.hub-setup-steps li { display: inline-flex; align-items: center; gap: 6px; }
.hub-guide { display: flex; flex-direction: column; gap: var(--space-4); font-size: 14px; line-height: 1.55; }
.hub-guide-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-3) var(--space-5); margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-alt); }
.hub-guide-facts dt { margin-bottom: 2px; color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.hub-guide-facts dd { margin: 0; }
.hub-guide-facts .hub-guide-list { margin: 0; }
.hub-guide-tabs { margin-bottom: 0; }
.hub-guide-method { display: flex; flex-direction: column; gap: var(--space-2); }
.hub-guide-h { margin: 0 0 var(--space-2); font: 700 15.5px/1.3 var(--font-heading); color: var(--heading); }
.hub-guide-sub { margin: var(--space-3) 0 var(--space-1); font: 700 13px/1.3 var(--font-heading); color: var(--heading); }
.hub-guide-summary { margin: 0; color: var(--text-muted); }
.hub-guide-list { margin: 0; padding-left: 20px; }
.hub-guide-list li + li { margin-top: 4px; }
.hub-guide-steps { counter-reset: guide; margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.hub-guide-steps > li { counter-increment: guide; position: relative; margin: 0 0 var(--space-2); padding: 8px 12px 8px 44px; border-radius: var(--radius-sm); }
.hub-guide-steps > li::before { content: counter(guide); position: absolute; left: 10px; top: 8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 700 12.5px/1 var(--font-body); }
.hub-guide-steps > li.hub-guide-theirs { border-left: 3px solid var(--info); background: var(--info-bg); color: var(--on-info-bg); }
.hub-guide-theirs .hub-guide-code { background: var(--surface); }
.hub-guide-who { display: block; width: fit-content; margin-bottom: 3px; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface); color: var(--on-info-bg); font-size: 12px; font-weight: 700; }
.hub-guide-code { padding: 1px 5px; border-radius: 4px; background: var(--surface-alt); color: var(--heading); font-size: 0.9em; overflow-wrap: anywhere; }
.hub-guide-value { font-weight: 600; overflow-wrap: anywhere; }
.hub-guide-pending { color: var(--text-muted); font-style: italic; }
.hub-guide-pending-box { margin: 6px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); }
.hub-guide-checks { padding: var(--space-3) var(--space-4); border-left: 3px solid var(--success); border-radius: var(--radius-sm); background: var(--success-bg); color: var(--on-success-bg); }
.hub-guide-checks .hub-guide-sub { margin-top: 0; color: var(--on-success-bg); }
.hub-guide-errors { display: grid; gap: var(--space-2); margin: 0; }
.hub-guide-errors > div { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.hub-guide-errors dt { font-weight: 600; color: var(--heading); }
.hub-guide-errors dd { margin: 2px 0 0; color: var(--text-muted); }
.hub-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4) var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-soft); }
.hub-guide-part { min-width: 0; }
.hub-guide-links { margin: 0; padding-left: 20px; }
.hub-guide-links li + li { margin-top: 4px; }
.hub-guide-links a { color: var(--link); overflow-wrap: anywhere; }
.hub-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--heading); }
.hub-copy-value { flex: 1 1 220px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.hub-copy-btn { flex: none; min-height: 32px; padding: 0 12px; font-size: 13px; }
.hub-copy-failed { flex-basis: 100%; }
@media (max-width: 640px) {
    .hub-guide-facts, .hub-guide-grid { grid-template-columns: minmax(0, 1fr); }
    .hub-guide-steps > li { padding-left: 40px; }
}

/* Performance */
.hub-perf-toolbar { justify-content: flex-start; }
.hub-perf-toolbar .hub-field { min-width: 180px; }
.hub-perf-toolbar .hub-actions { margin-left: auto; }
.hub-fresh { margin: 0 0 var(--space-4); }
/* Performance: the period heads the page, under the tabs; Top performers sit after the period's own figures. */
.hub-perf-period { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); margin: 0 0 var(--space-3); font-size: 15px; color: var(--heading); }
.hub-perf-period b { font-family: var(--font-heading); font-weight: 700; }
.hub-perf-winners { margin: var(--space-5) 0; }
.hub-perf-winners.hub-fold > summary .hub-h2 { font-size: 17px; }
.hub-perf-winners .hub-winner-strip:last-child { margin-bottom: 0; }
.hub-winners-slot:empty { display: none; }
/* Headline figures: --cols (set from the number of cards) a row at full width, so rows come out even, and as many as fit
   at 190px when narrower. A value stays on one line and scales with its card. */
.hub-cards { --cols: 4; display: grid; grid-template-columns: repeat(auto-fill, minmax(max(190px, calc((100% - (var(--cols) - 1) * 12px) / var(--cols))), 1fr)); gap: 12px; margin: var(--space-3) 0 var(--space-5); }
.hub-stat { container-type: inline-size; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.hub-stat-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); line-height: 1.35; }
.hub-stat-value { font: 700 clamp(18px, 12.5cqi, 26px)/1.2 var(--font-heading); letter-spacing: -0.015em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.hub-stat-change { display: inline-flex; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.hub-stat-vs { font-weight: 400; color: var(--text-subtle); }
.hub-stat-note { margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--text-muted); }
.hub-flag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 600; }

/* Trend chart: the reference palette (blue, orange; validated), thin marks, recessive grid, one axis */
.hub-chart-card { padding: var(--space-4) 20px; margin-bottom: var(--space-5); }
.hub-chart { --c-main: #2a78d6; --c-second: #eb6834; --c-grid: var(--fill); --c-ink: var(--text-muted); margin: 0; }
.hub-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin-bottom: 6px; }
.hub-chart-title { font: 600 15px var(--font-heading); color: var(--heading); }
.hub-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-muted); }
.hub-legend li { display: inline-flex; align-items: center; gap: 6px; }
.hub-key-line { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--c-main); }
.hub-key-line.prev { border-top-style: dashed; opacity: 0.5; }
.hub-key-line.second { border-top-color: var(--c-second); }
/* The legend's keys match what trendChart.js draws: a send is a short bar on the baseline, a note a dotted line. */
.hub-key-send { display: inline-block; width: 3px; height: 10px; background: var(--c-second); }
.hub-key-note { display: inline-block; width: 0; height: 12px; border-left: 1px dashed var(--c-ink); }
/* Chart.js sizes the canvas to this box. */
.hub-chart-canvas { position: relative; height: 260px; }
@media (max-width: 640px) {
    .hub-chart-canvas { height: 220px; }
}

/* Date notes, table and creatives */
.hub-notes { margin-bottom: var(--space-5); }
.hub-note-form { align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.hub-note-form .hub-field:nth-child(2) { flex: 1 1 240px; }
.hub-note-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hub-note-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.hub-note-date { font-weight: 600; min-width: 96px; }
.hub-note-text { flex: 1 1 200px; overflow-wrap: anywhere; }
.hub-note-who { color: var(--text-subtle); font-size: 12.5px; }
.hub-extras { margin: 6px 0 var(--space-3); justify-content: flex-start; }
/* A wide table scrolls sideways inside its own box on a phone, so neither its columns squash nor the page scrolls. */
.hub-items { min-width: 760px; }
.hub-items td.num, .hub-items th.num { text-align: right; }
.hub-items td { font-variant-numeric: tabular-nums; }
.hub-sort { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.hub-sort:hover { color: var(--heading); }
.hub-expand { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: var(--fill); color: var(--brand-strong); cursor: pointer; }
.hub-expand-gap { display: inline-block; width: 24px; }
.hub-indent { display: inline-flex; align-items: center; gap: 6px; }
/* A post's name is its whole caption: keep it to two lines, with the full text on hover, and keep the other cells on one line. */
.hub-items td.hub-lead { min-width: 220px; max-width: 320px; }
.hub-items td:not(.hub-lead) { white-space: nowrap; }
.hub-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hub-creatives { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: var(--space-4); }
.hub-creatives-more { justify-content: flex-start; margin: 0 0 var(--space-5); }
.hub-table-more { justify-content: flex-start; margin: var(--space-3) 0 var(--space-5); }
.hub-creative { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.hub-creative-name { margin: 0 0 6px; font: 600 14px var(--font-body); overflow-wrap: anywhere; }
.hub-creative .hub-flag { margin: 0 0 6px; }
/* A figure's value is never cut: its label gives way first, down to an ellipsis (its full text is in its title). The
   single column is minmax(0, 1fr) so a narrow card can shrink the rows at all. */
.hub-creative dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 6px 0 0; font-size: 13px; }
.hub-creative dl div { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.hub-creative dt { min-width: 0; color: var(--text-muted); }
.hub-creative dd { flex: none; margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
    .hub-perf-toolbar .hub-field, .hub-perf-toolbar > .hub-field { min-width: 0; flex: 1 1 140px; }
    .hub-perf-toolbar .hub-actions { margin-left: 0; }
    .hub-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hub-stat { padding: 12px; }
}

/* Top performers: at full width the five cards fit one row as a grid. Narrower, they scroll sideways with snap, fading
   out at the right edge so a cut card reads as more to scroll to; the row's end padding lets the last card clear the fade.
   The table scrolls in its own box, so the page never scrolls sideways. */
.hub-winner-section { container-type: inline-size; margin-bottom: var(--space-6); min-width: 0; }
.hub-winner-section .hub-h2 { margin-top: 0; }
.hub-winner-strip { margin: 0 0 var(--space-5); }
.hub-winner-row {
    display: flex; gap: 12px; overflow-x: auto; padding: 2px 32px 10px 2px; margin: -2px 0 var(--space-2) -2px; scroll-snap-type: x mandatory; scroll-padding-inline: 2px; overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}
.hub-winner-card { flex: 0 0 236px; display: flex; flex-direction: column; gap: 4px; scroll-snap-align: start; }
@container (min-width: 1000px) {
    .hub-winner-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; padding: 0 0 4px; margin: 0 0 var(--space-2); -webkit-mask-image: none; mask-image: none; }
    .hub-winner-card { min-width: 0; }
}
.hub-winner-card p { margin: 0; }
.hub-winner-preview { display: flex; align-items: center; justify-content: center; height: 140px; margin-bottom: 8px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); color: var(--text-muted); font-size: 12.5px; text-align: center; }
.hub-winner-preview img { width: 100%; height: 100%; object-fit: cover; }
.hub-winner-preview-text { padding: 8px 12px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.hub-winner-details { font-size: 12.5px; }
.hub-winner-headline { display: flex; flex-direction: column; margin-top: 6px !important; color: var(--heading); min-width: 0; }
.hub-winner-times { font: 600 24px/1.15 var(--font-heading); font-variant-numeric: tabular-nums; }
.hub-winner-measure { font-size: 12.5px; line-height: 1.35; color: var(--text-muted); }
/* Same room on every card: two lines of title, one line of details, three rows of figures. */
.hub-winner-title { line-height: 1.4; min-height: 2.8em; margin-bottom: 2px; }
/* A button is laid out as one block, so the two-line cut sits on the text inside it. */
.hub-winner-title-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-winner-details { display: flex; gap: 6px; white-space: nowrap; min-width: 0; }
.hub-winner-where { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hub-winner-details a { flex: none; }
/* A fact's label wraps rather than being cut ("Median views of earlier posts"), its value stays on one line beside it. */
.hub-winner-facts div { align-items: baseline; }
.hub-winner-facts dt { min-width: 0; line-height: 1.3; }
.hub-winner-facts dd { white-space: nowrap; }
.hub-winner-facts { min-height: 66px; align-content: start; }
.hub-winner-value { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hub-winner-facts { margin: 6px 0 4px; }
.hub-winner-why { margin-top: 6px !important; font-size: 13px; overflow-wrap: anywhere; }
.hub-winner-ai { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--heading); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.hub-winner-table { min-width: 640px; }
.hub-winner-section .hub-scroll { margin-bottom: 4px; }

/* A summaries run in progress on Top performers: a small turning ring beside the line, still for reduced motion. */
.hub-running { display: flex; align-items: center; gap: 8px; color: var(--text); }
.hub-spinner { width: 14px; height: 14px; flex: none; border: 2px solid var(--fill); border-top-color: var(--brand-strong); border-radius: 50%; animation: hub-spin 0.9s linear infinite; }
@keyframes hub-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hub-spinner { animation: none; border-color: var(--brand-strong); } }

/* Top performers: the overview, clickable cards and the dialog with everything about one post. */
.hub-winner-overview { margin-bottom: var(--space-5); }
.hub-winner-notice p { margin: 0; }
.hub-winner-notice ul { margin: 4px 0 0; padding-left: 18px; }
.hub-winner-notice li + li { margin-top: 2px; }
.hub-winner-overview .hub-h2 { margin: 0 0 6px; }
.hub-winner-overview p { margin: 0; max-width: 80ch; font-size: 15px; line-height: 1.6; }
.hub-winner-card { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.hub-winner-card:hover { border-color: var(--brand-mid); box-shadow: var(--shadow-md); }
.hub-winner-open { all: unset; display: block; width: 100%; cursor: pointer; }
.hub-winner-open:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.hub-winner-dialog-body { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.hub-winner-dialog-preview { display: flex; align-items: center; justify-content: center; min-height: 220px; border-radius: var(--radius); overflow: hidden; background: var(--surface-alt); color: var(--text-muted); text-align: center; }
.hub-winner-dialog-preview img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #000; }
.hub-winner-dialog-preview span { padding: 18px; overflow-wrap: anywhere; }
.hub-winner-dialog-text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hub-winner-dialog .hub-dlg-titles .hub-h2 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.hub-winner-dialog-caption { margin: 0; font-size: 14.5px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.hub-winner-dialog-text .hub-winner-measure { white-space: normal; }
.hub-winner-dialog-why h3 { margin: 0 0 4px; font: 600 12px var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.hub-winner-dialog-why p { margin: 0; font-size: 14.5px; line-height: 1.6; }
.hub-winner-dialog-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 18px; margin: 0; padding-top: 10px; border-top: 1px solid var(--border-soft); font-size: 13.5px; }
.hub-winner-dialog-facts div { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.hub-winner-dialog-facts dt { color: var(--text-muted); }
.hub-winner-dialog-facts dd { margin: 0; font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
    .hub-winner-dialog-body { grid-template-columns: 1fr; }
    .hub-winner-dialog-preview img { max-height: 45vh; }
}

/* Ranking settings: one group per channel, each rule with its default under it. */
.hub-settings-group { margin: 14px 0 0; padding: 12px 14px 14px; border: 1px solid var(--border); border-radius: var(--radius); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.hub-settings-group legend { padding: 0 6px; font: 600 12px var(--font-body); letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }

/* Client summary: the channel map. A dark ground in both themes; lines and particles glow in the client's accent,
   which the figure sets as --map-accent. The SVG scales with the page, so there's never a sideways scroll. */
.hub-summary-map { margin: 0 0 var(--space-5); }
.hub-summary-map > .hub-note { font-size: 12.5px; color: var(--text-subtle); }
.hub-map { margin: 0 0 var(--space-3); padding: 12px; border-radius: var(--radius); background: var(--night); color: var(--on-night-strong); }
.hub-map svg { display: block; width: 100%; height: auto; font-family: var(--font-body); }
.hub-map-node circle { fill: var(--night-raised); stroke: var(--map-accent); stroke-width: 1.5; }
.hub-map-node.centre circle { fill: var(--night-mid); stroke-width: 2.5; }
.hub-map-node.off circle { stroke: var(--on-night-soft); stroke-opacity: 0.4; stroke-dasharray: 4 4; }
a.hub-map-node:hover circle { stroke-width: 3; }
a.hub-map-node:focus { outline: none; }
a.hub-map-node:focus-visible circle { stroke: var(--on-night-strong); stroke-width: 3; }
.hub-map-title { fill: var(--on-night-strong); font: 700 12px var(--font-heading); }
.hub-map-node.centre .hub-map-title { font-size: 15px; }
.hub-map-caption, .hub-map-label, .hub-map-change, .hub-map-message { fill: var(--on-night-soft); }
.hub-map-caption { font-size: 11px; }
.hub-map-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.hub-map-figure { fill: var(--on-night-strong); font: 600 14px var(--font-heading); font-variant-numeric: tabular-nums; }
.hub-map-change { font-size: 11.5px; font-weight: 500; }
.hub-map-message { font-size: 12px; }
.hub-map a .hub-map-message { fill: var(--on-night-strong); text-decoration: underline; }
.hub-map-path { fill: none; stroke: var(--map-accent); stroke-width: 2.5; stroke-linecap: round; }
.hub-map-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; }
.hub-map-line.missing .hub-map-path { stroke-width: 1; stroke-opacity: 0.45; stroke-dasharray: 3 5; filter: none; }
.hub-map-particles { filter: url(#map-glow); }
.hub-map-particles circle, .hub-map-arrowhead { fill: var(--map-accent); }
.hub-map-value { fill: var(--on-night-strong); font: 700 15px var(--font-heading); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--night); stroke-width: 5px; stroke-linejoin: round; }
.hub-map-value-caption { fill: var(--on-night-soft); font-size: 10.5px; paint-order: stroke; stroke: var(--night); stroke-width: 4px; stroke-linejoin: round; }
.hub-map-line.missing .hub-map-value { fill: var(--on-night-soft); font: 500 12px var(--font-body); }
.hub-map-none { fill: var(--on-night-soft); font-size: 12px; }
.hub-map-mark { fill: var(--on-night-soft); font-size: 12px; font-weight: 600; }
.hub-map-line:focus { outline: none; }
.hub-map-line:focus-visible .hub-map-path { stroke: var(--on-night-strong); stroke-width: 3.5; }
/* The boxes are a layer after every line, so they paint above them: the nth box shows while the nth line is hovered or focused. A map has at most five lines. */
.hub-map-tip { display: none; pointer-events: none; }
.hub-map-lines:has(> .hub-map-line:nth-child(1):is(:hover, :focus-visible)) ~ .hub-map-tips > .hub-map-tip:nth-child(1),
.hub-map-lines:has(> .hub-map-line:nth-child(2):is(:hover, :focus-visible)) ~ .hub-map-tips > .hub-map-tip:nth-child(2),
.hub-map-lines:has(> .hub-map-line:nth-child(3):is(:hover, :focus-visible)) ~ .hub-map-tips > .hub-map-tip:nth-child(3),
.hub-map-lines:has(> .hub-map-line:nth-child(4):is(:hover, :focus-visible)) ~ .hub-map-tips > .hub-map-tip:nth-child(4),
.hub-map-lines:has(> .hub-map-line:nth-child(5):is(:hover, :focus-visible)) ~ .hub-map-tips > .hub-map-tip:nth-child(5) { display: inline; }
.hub-map-tip rect { fill: var(--night-raised); stroke: var(--map-accent); stroke-width: 1; }
.hub-map-tip text { fill: var(--on-night-soft); font-size: 12px; }
.hub-map-tip .hub-map-tip-label { fill: var(--on-night-strong); font-weight: 600; }
.hub-map-tip .hub-map-tip-value { fill: var(--on-night-strong); font: 700 17px var(--font-heading); }
.hub-map-list { display: none; margin: var(--space-2) 0 12px; padding: var(--space-3) var(--space-4) var(--space-3) 34px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 14px; line-height: 1.5; }
.hub-map-list li + li { margin-top: 6px; }
.hub-map-list b { color: var(--heading); }
/* Under 700px the map's words would be too small to read, so the list says what it shows instead. */
@media (max-width: 699px) {
    .hub-map { display: none; }
    .hub-map-list { display: block; }
}
/* The still version: no particles, and an arrowhead on each line to show its direction. */
.hub-map-arrows { display: none; }
@media (prefers-reduced-motion: reduce) { .hub-map-particles { display: none; } .hub-map-arrows { display: inline; } }
.hub-summary-winners { margin-bottom: var(--space-5); }
.hub-summary-winners:empty { display: none; }
.hub-summary-package { margin-bottom: var(--space-5); }
.hub-summary-package-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; }
.hub-summary-package-status .hub-note { margin: 0; }
.hub-summary-package .hub-deliverables .short { color: var(--danger); font-weight: 600; }
.hub-summary-package .hub-deliverables .hub-note { font-size: 12.5px; }

/* Briefs: the Monthly brief tab and the Calendar page. */
.hub-brief-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: var(--space-3) 0 var(--space-4); }
.hub-brief-months { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.hub-brief-month { padding: 0 var(--space-2); font: 700 16px/1.3 var(--font-heading); color: var(--heading); }
.hub-brief-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0; font-size: 14px; }
.hub-brief-state .hub-hint { font-size: 13px; }
/* Who saved or submitted: on a phone a line of its own, held even while empty, so a first save doesn't push the brief down. */
.hub-brief-who:empty { display: none; }
@media (max-width: 640px) {
    .hub-brief-who, .hub-brief-who:empty { display: block; flex-basis: 100%; min-height: 1.5em; }
}
.hub-brief-actions { margin-bottom: var(--space-4); }
.hub-brief-settings { display: flex; flex-direction: column; gap: var(--space-4); max-width: 560px; }
.hub-brief-settings .hub-field input { max-width: 120px; }
/* The form: one fieldset per section of the brief, with a soft rule between them; repeatable rows sit in quiet boxes. */
.hub-brief-form { display: flex; flex-direction: column; gap: var(--space-5); }
.hub-brief-part { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; margin: 0; padding: var(--space-5) 0 0; border: 0; border-top: 1px solid var(--border-soft); }
.hub-brief-part:first-child { padding-top: 0; border-top: 0; }
.hub-brief-part > legend { float: left; width: 100%; margin: 0; padding: 0; }
.hub-brief-row { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface-alt); }
.hub-brief-row > .hub-btn-danger { align-self: flex-start; }
.hub-brief-form .hub-field textarea { min-height: 64px; }
.hub-brief-wide { grid-column: 1 / -1; }
/* What the client told us: a block per section, its dated rows as a short list with their dates. */
.hub-brief-told { padding-top: var(--space-3); border-top: 1px solid var(--border-soft); }
.hub-brief-told + .hub-brief-told { margin-top: var(--space-3); }
.hub-brief-told h3 { margin: 0 0 var(--space-2); font: 700 15px/1.3 var(--font-heading); color: var(--heading); }
.hub-brief-told dl { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: var(--space-1) var(--space-4); margin: 0; font-size: 14px; }
.hub-brief-told dt { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.hub-brief-told dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.hub-brief-dated { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hub-brief-dated li { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr); gap: var(--space-3); }
.hub-brief-when { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hub-brief-detail { display: block; color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .hub-brief-told dl, .hub-brief-dated li { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .hub-brief-told dd { margin-bottom: var(--space-2); }
}
/* The month calendar: a block per week, a row per lane (Moments, then each channel the client has), a column per day.
   A moment spans its days; a plan entry is a small button, dashed while a draft, solid once accepted, struck through
   when removed, with an accent dot when it needs a check. Below 768px it is a list by date instead. */
.hub-cal { display: flex; flex-direction: column; gap: var(--space-3); }
.hub-cal-tools { display: flex; justify-content: flex-end; }
.hub-cal .hub-error, .hub-cal-lanenote { margin: 0; }
.hub-cal-panel { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-alt); }
.hub-cal-panel h3 { margin: 0; font: 700 15px/1.3 var(--font-heading); color: var(--heading); }
.hub-cal-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; font-size: 14px; }
.hub-cal-notes { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.hub-cal-panel :is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger) { min-height: 34px; font-size: 13px; }
.hub-cal-grid { display: flex; flex-direction: column; gap: var(--space-3); }
.hub-cal-week { display: grid; grid-template-columns: 88px repeat(7, minmax(0, 1fr)); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; }
.hub-cal-corner, .hub-cal-day { background: var(--surface-alt); }
.hub-cal-day { padding: 4px 6px; border-left: 1px solid var(--border-soft); font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.hub-cal-day.out { color: var(--text-faint); font-weight: 500; }
.hub-cal-day.today { color: var(--heading); box-shadow: inset 0 -2px 0 var(--brand); }
.hub-cal-lane { padding: 6px; border-top: 1px solid var(--border-soft); font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; overflow-wrap: normal; overflow: hidden; text-overflow: ellipsis; }
.hub-cal-moments { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-flow: row dense; align-content: start; gap: 3px 0; min-height: 30px; padding: 4px 0; border-top: 1px solid var(--border-soft); }
.hub-cal-moment { min-width: 0; margin: 0 3px; padding: 2px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--heading); font-size: 12px; font-weight: 600; line-height: 1.35; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
button.hub-cal-moment { border: 0; font-family: var(--font-body); text-align: left; cursor: pointer; }
button.hub-cal-moment:hover { box-shadow: inset 0 0 0 1px currentColor; }
button.hub-cal-moment[aria-expanded="true"] { outline: 2px solid var(--focus); outline-offset: 1px; }
.hub-cal-moment.offer { background: var(--accent-soft); color: var(--accent-strong); }
.hub-cal-moment.launch { background: var(--info-bg); color: var(--on-info-bg); }
.hub-cal-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 34px; padding: 3px; border-top: 1px solid var(--border-soft); border-left: 1px solid var(--border-soft); }
.hub-cal-cell.out { background: var(--surface-alt); }
/* An entry shows two lines of its title, so "Launch: Silk serum" reads; the whole of it is its title on hover. */
.hub-cal-entry { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; width: 100%; min-width: 0; padding: 2px 5px; border: 1px dashed var(--border-strong); border-radius: 4px; background: var(--surface); color: var(--text); font: 500 12px/1.35 var(--font-body); text-align: left; overflow: hidden; overflow-wrap: anywhere; }
button.hub-cal-entry { cursor: pointer; }
button.hub-cal-entry:hover { border-color: var(--brand-strong); background: var(--surface-alt); }
button.hub-cal-entry[aria-expanded="true"] { outline: 2px solid var(--focus); outline-offset: 1px; }
.hub-cal-entry.accepted { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.hub-cal-entry.removed { border-style: solid; border-color: var(--border); background: transparent; color: var(--text-subtle); text-decoration: line-through; }
.hub-cal-entry.check::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.hub-cal-entry small, .hub-cal-card small { margin-right: 4px; font-size: 11px; color: var(--text-muted); }
.hub-cal-card { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-width: 0; padding: 2px 5px; font-size: 12px; line-height: 1.35; overflow: hidden; overflow-wrap: anywhere; }
/* The key under the calendar's tools: a sample of each look with what it means. */
.hub-cal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-muted); }
.hub-cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.hub-cal-legend :is(.hub-cal-entry, .hub-cal-moment, .hub-cal-card) { display: inline-block; width: auto; margin: 0; white-space: nowrap; }
.hub-cal-legend .hub-cal-moment + .hub-cal-moment { margin-left: -2px; }
.hub-cal-card-sample { color: var(--link); text-decoration: underline; }
.hub-cal.compact .hub-cal-week { grid-template-columns: 84px repeat(7, minmax(0, 1fr)); }
.hub-cal.compact .hub-cal-cell { min-height: 26px; }
.hub-cal.compact .hub-cal-moments { min-height: 24px; }
.hub-cal-list { display: none; margin: 0; padding: 0; list-style: none; }
.hub-cal-list > li { padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); }
.hub-cal-list > li:first-child { padding-top: 0; border-top: 0; }
.hub-cal-date { margin: 0 0 var(--space-2); font: 700 14px/1.3 var(--font-heading); color: var(--heading); }
.hub-cal-list ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hub-cal-list ul > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.hub-cal-list .hub-tag { min-width: 64px; margin-left: 0; text-align: center; }
.hub-cal-list :is(.hub-cal-entry, .hub-cal-card, .hub-cal-moment) { flex: 1 1 0; width: auto; margin: 0; white-space: normal; }
.hub-cal-list .hub-cal-panel { margin-top: var(--space-2); }
@media (max-width: 767px) {
    .hub-cal-grid { display: none; }
    .hub-cal-list { display: block; }
}

/* Research: the Research tab, a breakdown, a report and the settings page. Below 640px the tables become stacked rows,
   each cell under its own small label, so nothing scrolls sideways. */
/* Research's run line: state, counts and Details on the left, Research now on the right; the skipped lines open under it. */
.hub-research-head { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); padding-bottom: var(--space-4); }
.hub-research-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.hub-research-line > .hub-research-state { flex: 1 1 320px; min-width: 0; }
.hub-research-head .hub-info, .hub-research-head .hub-research-message { margin: 0; }
.hub-research-more-lines { margin: 4px 0 0 18px; font-size: 13.5px; }
.hub-research-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0; }
.hub-research-state .hub-status { white-space: normal; }
.hub-research-figure { margin: 0 0 var(--space-2); font: 700 22px/1.2 var(--font-heading); color: var(--heading); }
.hub-research-lines { display: flex; flex-direction: column; gap: 2px; margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 13.5px; overflow-wrap: anywhere; }
.hub-research-message { margin: 0; }
.hub-note + .hub-research-table { margin-top: var(--space-3); }
.hub-research-sub { margin-top: var(--space-5); }
.hub-research-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.hub-research-name { display: block; overflow-wrap: anywhere; }
/* Ideas: cards in a grid that is one column on a phone. */
.hub-research-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-3); }
.hub-research-idea { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.hub-research-idea h3 { margin: 0; font: 700 16px/1.3 var(--font-heading); color: var(--heading); overflow-wrap: anywhere; }
.hub-research-idea .hub-note, .hub-research-idea .hub-details { margin: 0; }
.hub-research-idea > .hub-actions { margin-top: auto; padding-top: var(--space-2); }
.hub-research-hooks { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; }
.hub-research-hooks legend { padding: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--heading); }
.hub-research-hook { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; overflow-wrap: anywhere; }
.hub-research-hook:has(input:checked) { background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--border); }
.hub-research-hook input { flex: none; margin-top: 3px; accent-color: var(--brand); }
.hub-research-script ol { margin: var(--space-2) 0; padding-left: 20px; }
.hub-research-sources { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; font-size: 13px; color: var(--text-muted); }
.hub-research-sources a { overflow-wrap: anywhere; }
.hub-research-added { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hub-research-added li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; overflow-wrap: anywhere; }
/* Facts: label and value side by side, stacked on a phone. */
.hub-research-facts { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; font-size: 14px; }
.hub-research-facts > div { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); gap: var(--space-3); }
.hub-research-facts dt { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.hub-research-facts dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
/* What is working: a block per tag group, a compact row per value. */
.hub-research-new { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--surface-alt); font-size: 14px; white-space: pre-line; }
.hub-research-new .hub-label { display: block; margin-bottom: 4px; }
.hub-research-patterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: var(--space-4) var(--space-5); margin-bottom: var(--space-3); }
.hub-research-group h3 { margin-bottom: var(--space-2); }
.hub-research-group ul { margin: 0; padding: 0; list-style: none; }
.hub-research-group li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: var(--space-3); padding: 5px 0; border-top: 1px solid var(--border-soft); font-size: 14px; }
.hub-research-group li:first-child { border-top: 0; }
.hub-research-value { overflow-wrap: anywhere; }
.hub-research-times { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--heading); }
/* Ranked posts and the watchlist */
.hub-research-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.hub-research-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hub-research-thumb { width: 60px; }
/* A thumbnail sits on a neutral box with a picture outline, which shows when there's no image or it fails to load. */
.hub-thumb { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--border-soft); }
.hub-thumb::before { content: ""; width: 18px; height: 14px; border: 1.5px solid var(--border-strong); border-radius: 3px; background: linear-gradient(135deg, transparent 55%, var(--border-strong) 55% 62%, transparent 62%); }
.hub-thumb img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.hub-thumb img[hidden] { display: none; }
.hub-research-open { text-align: right; white-space: nowrap; }
.hub-research-watch .hub-research-open { white-space: normal; }
@media (min-width: 600px) { .hub-research-watch .hub-research-open .hub-actions { flex-wrap: nowrap; } }
.hub-research-watch .hub-research-open .hub-hint { margin: 4px 0 0; }
.hub-research-more { margin-top: var(--space-3); }
.hub-research-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--space-3); margin-top: var(--space-5); }
.hub-research-forms .hub-label, .hub-research-forms .hub-hint { margin: 0; }
.hub-research-pastes { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hub-research-pastes li { display: flex; align-items: flex-start; gap: 4px 10px; min-width: 0; }
.hub-research-pastes li > .hub-status { flex: none; min-width: 72px; justify-content: center; margin-top: 1px; }
.hub-research-paste { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hub-research-pastes a { min-width: 0; overflow-wrap: anywhere; }
/* The watchlist: a tidy row per account, handle and status, its facts under it, and its actions in the ⋯ menu. */
.hub-research-watch-note { margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
.hub-research-style { border-left: 3px solid var(--accent); padding: var(--space-2) var(--space-3); margin: 0 0 var(--space-4); background: var(--surface-2, transparent); }
.hub-research-style p { margin: 0 0 var(--space-2); }
.hub-research-style .hub-btn-quiet { margin-top: var(--space-1); }
.hub-research-watch .hub-step { gap: var(--space-2); padding: 10px 0; }
.hub-research-watch .hub-step:first-child { padding-top: 0; }
.hub-research-watch .hub-step-main { flex-basis: 300px; gap: 2px; }
.hub-research-handle { font-weight: 600; overflow-wrap: anywhere; }
.hub-research-why { overflow-wrap: anywhere; }
@media (max-width: 599px) {
    .hub-research-watch .hub-step-row { flex-wrap: nowrap; }
    .hub-research-watch .hub-conn .hub-step-row > .hub-actions { flex: none; }
}
@media (max-width: 599px) {
    .hub-research-table thead { display: none; }
    .hub-research-table, .hub-research-table tbody { display: block; }
    .hub-research-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); }
    .hub-research-table tbody tr:first-child { border-top: 0; padding-top: 0; }
    .hub-research-table tbody tr:hover td { background: none; }
    .hub-research-table td, .hub-research-table tbody tr:last-child td { display: block; padding: 0; border: 0; text-align: left; }
    .hub-research-table td[data-label]::before { content: attr(data-label); display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
    .hub-research-table td:first-child, .hub-research-table td[data-label="Account"], .hub-research-table td.hub-research-open { grid-column: 1 / -1; }
    .hub-research-table td.is-empty { display: none; }
    .hub-research-table td.hub-research-open, .hub-research-table td:last-child:has(> :is(a, button):only-child) { text-align: left; }
    .hub-research-table .hub-actions { justify-content: flex-start; }
    .hub-research-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
/* A breakdown and a report */
.hub-research-split { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1100px) {
    .hub-research-split { grid-template-columns: minmax(0, 1fr); }
}
.hub-research-beats { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hub-research-beats li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--space-2); overflow-wrap: anywhere; }
.hub-research-at { font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hub-research-preview.hub-thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 360px; margin-bottom: var(--space-3); }
.hub-research-preview.hub-thumb::before { width: 40px; height: 30px; }
/* A suggested tag is a dashed chip on the same line as the listed ones; a line under the tags says what dashed means. */
.hub-chip.hub-research-suggested { background: var(--surface); color: var(--heading); border: 1px dashed var(--accent-strong); }
.hub-research-tags .hub-chips { min-width: 0; }
.hub-research-tags .hub-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.hub-research-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: var(--space-3) 0 0; }
.hub-research-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--space-4); align-items: start; margin-bottom: var(--space-4); }
.hub-research-columns .hub-section { margin-bottom: 0; }
.hub-research-points { display: flex; flex-direction: column; gap: var(--space-4); margin: 0; padding-left: 20px; font-size: 14px; }
.hub-research-points p { margin: 4px 0 0; overflow-wrap: anywhere; }
.hub-research-evidence { font-weight: 600; }
/* Settings */
.hub-research-map select { min-width: 160px; }
.hub-note + .hub-research-taggroups { margin-top: var(--space-4); }
.hub-research-taggroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-5); }
.hub-research-taggroup { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.hub-research-taggroup .hub-label, .hub-research-taggroup .hub-error, .hub-research-taggroup .hub-ok { margin: 0; }
.hub-research-values { margin: 0; padding: 0; list-style: none; }
.hub-research-values .hub-chip { gap: 2px; padding-right: 2px; white-space: normal; }
.hub-research-remove { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--brand-strong); font-size: 15px; line-height: 1; cursor: pointer; }
.hub-research-remove:hover { background: var(--danger-bg); color: var(--danger); }
.hub-research-remove:disabled { opacity: 0.5; cursor: default; }

/* Page tabs (HubTabs), such as Agency settings': a strip under the title that scrolls sideways inside itself on a phone. */
.hub-page-tabs { margin: calc(-1 * var(--space-3)) 0 var(--space-5); scrollbar-width: none; }
.hub-page-tabs::-webkit-scrollbar { display: none; }
.hub-page-tabs .hub-tab { padding: 12px 14px; font-size: 14px; }
.hub-tabpanel:focus-visible { outline-offset: 4px; border-radius: var(--radius-sm); }
.hub-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.hub-card-head .hub-h2 { margin: 0; }

/* Settings lists: one row per item, laid out in a grid that stacks on a phone. */
.hub-setlist { margin: 0; padding: 0; list-style: none; }
.hub-setrow { display: grid; align-items: center; gap: var(--space-2) var(--space-3); padding: 10px 0; border-top: 1px solid var(--border-soft); font-size: 14px; }
.hub-setrow:first-child { border-top: 0; padding-top: 0; }
.hub-setrow:last-child { padding-bottom: 0; }
.hub-setinput { min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font: 400 14px var(--font-body); color: var(--text); width: 100%; min-width: 0; }
.hub-setinput:hover { border-color: var(--brand-strong); }
.hub-setinput:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 1px; }
/* Role names: "Role → [name] [offered]". */
.hub-roles .hub-setrow { grid-template-columns: minmax(150px, 220px) 16px minmax(0, 360px) minmax(120px, auto); justify-content: start; }
.hub-role-from { font-weight: 600; color: var(--heading); }
.hub-role-arrow { color: var(--text-muted); text-align: center; }
.hub-roles .hub-chip { justify-self: start; }
/* Sortable lists: Up and Down, the item, its controls and its menu. */
.hub-sortrow { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.hub-sort-move { display: flex; gap: 4px; }
.hub-sort-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.hub-sort-main b { color: var(--heading); font-weight: 600; }
.hub-sortrow .hub-check { min-height: 34px; font-size: 13.5px; }
.hub-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--border-mid); border-radius: var(--radius-sm); background: var(--surface); color: var(--heading); font: 700 17px/1 var(--font-body); cursor: pointer; }
.hub-icon-btn:hover:not(:disabled) { background: var(--surface-alt); border-color: var(--border-strong); }
.hub-icon-btn:disabled { opacity: 0.4; cursor: default; }
.hub-deliverable { grid-template-columns: auto minmax(140px, 200px) minmax(0, 1fr) auto; }
.hub-question { grid-template-columns: auto minmax(0, 1fr) auto; }
.hub-question-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.hub-sortrow .hub-btn-quiet { min-height: 34px; font-size: 13px; }
@media (pointer: coarse) {
    .hub-icon-btn { width: 44px; height: 44px; }
}
@media (max-width: 599px) {
    .hub-roles .hub-setrow { grid-template-columns: minmax(0, 1fr) auto; }
    .hub-role-from { grid-column: 1 / -1; }
    .hub-role-arrow { display: none; }
    /* The item and its menu (or Edit) on the first line, Up and Down with any switch under it, and chips across the row. */
    .hub-sortrow, .hub-question, .hub-deliverable { grid-template-columns: minmax(0, 1fr) auto; }
    .hub-sortrow > .hub-sort-main { grid-column: 1; grid-row: 1; }
    .hub-sortrow > .hub-menu-wrap, .hub-question > .hub-btn-quiet { grid-column: 2; grid-row: 1; justify-self: end; }
    .hub-sortrow > .hub-sort-move { grid-column: 1; grid-row: 2; }
    .hub-sortrow > .hub-check { grid-column: 2; grid-row: 2; justify-self: end; }
    .hub-deliverable > .hub-chip-checks { grid-column: 1 / -1; grid-row: 2; }
    .hub-deliverable > .hub-sort-move { grid-row: 3; }
}

/* A row's menu (HubMenu). */
.hub-menu-wrap { position: relative; justify-self: end; }
.hub-menu-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border-mid); border-radius: var(--radius-sm); background: var(--surface); color: var(--heading); font: 700 18px/1 var(--font-body); cursor: pointer; }
.hub-menu-btn:hover:not(:disabled), .hub-menu-btn[aria-expanded="true"] { background: var(--surface-alt); border-color: var(--border-strong); }
.hub-menu-btn:disabled { opacity: 0.5; cursor: default; }
.hub-menu-list { position: absolute; top: calc(100% + 4px); right: 0; z-index: 40; display: flex; flex-direction: column; min-width: 200px; max-width: min(280px, calc(100vw - 32px)); padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-md); }
.hub-menu-list[hidden] { display: none; }
.hub-menu-wrap.up .hub-menu-list { top: auto; bottom: calc(100% + 4px); }
.hub-menu-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: 4px; background: none; color: var(--heading); font: 500 14px/1.3 var(--font-body); text-align: left; cursor: pointer; }
.hub-menu-item:hover:not(:disabled), .hub-menu-item:focus-visible { background: var(--surface-alt); }
.hub-menu-item:focus-visible { outline-offset: -2px; }
.hub-menu-item.danger { color: var(--danger); }
.hub-menu-item:disabled { color: var(--text-muted); cursor: default; }
.hub-menu-reason { font-size: 12px; font-weight: 400; color: var(--text-muted); }
@media (pointer: coarse) {
    .hub-menu-btn { width: 44px; height: 44px; }
    .hub-menu-item { min-height: 44px; justify-content: center; }
}

/* Chips that tick on and off: a checkbox per chip, such as the formats a deliverable counts. */
.hub-chip-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.hub-chip-checks-label { margin-right: 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.hub-chip-check { position: relative; display: inline-flex; }
.hub-chip-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.hub-chip-check span { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 11px; border: 1px solid var(--border-mid); border-radius: var(--radius-pill); background: var(--surface); color: var(--heading); font-size: 13px; font-weight: 500; white-space: nowrap; }
.hub-chip-check input:hover:not(:disabled) + span { border-color: var(--border-strong); background: var(--surface-alt); }
.hub-chip-check input:checked + span { border-color: var(--brand); background: var(--brand); color: var(--on-brand); }
.hub-chip-check input:checked + span::before { content: "\2713"; font-weight: 700; }
.hub-chip-check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-chip-check input:disabled { cursor: not-allowed; }
.hub-chip-check input:disabled:not(:checked) + span { border-style: dashed; color: var(--text-muted); background: var(--surface-alt); }
@media (pointer: coarse) {
    .hub-chip-check span { min-height: 40px; }
}

/* Groups that fold, such as the brief's questions by section. */
.hub-groups { display: flex; flex-direction: column; gap: var(--space-3); }
.hub-group { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.hub-group > summary { display: flex; align-items: baseline; gap: var(--space-2); padding: 12px var(--space-4); cursor: pointer; list-style: none; }
.hub-group > summary::-webkit-details-marker { display: none; }
.hub-group > summary::before { content: "\25B8"; flex: none; width: 12px; color: var(--text-muted); transition: transform 0.12s; }
.hub-group[open] > summary::before { transform: rotate(90deg); }
.hub-group > summary:hover { background: var(--row-hover); }
.hub-group-name { font-weight: 600; color: var(--heading); }
.hub-group > .hub-setlist { padding: 0 var(--space-4) 12px; }
.hub-group[open] > summary { border-bottom: 1px solid var(--border-soft); margin-bottom: 10px; }
.hub-dlg-aside { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-soft); }
.hub-form-end { grid-column: 1 / -1; }
.hub-note + .hub-rules { margin-top: var(--space-4); }

/* Agency settings: Brand, with its live preview beside the form (under it on narrower screens). */
.hub-brand-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-5); align-items: start; }
.hub-brand-layout > .hub-section { margin-bottom: 0; }
.hub-brand-intro { margin: -6px 0 var(--space-5); }
.hub-fieldset { margin: 0 0 var(--space-5); padding: 0 0 var(--space-5); border: 0; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.hub-fieldset > legend { padding: 0; margin-bottom: var(--space-3); font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.hub-brand-save { gap: var(--space-3); }
.hub-saved { font-size: 13px; font-weight: 600; color: var(--success); }
.hub-logo-field { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4); }
.hub-logo-box { display: grid; place-items: center; width: 180px; height: 84px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-alt); text-align: center; }
.hub-logo-box img { display: block; max-width: 100%; max-height: 56px; }
.hub-logo-actions { flex: 1 1 220px; gap: var(--space-2); }
.hub-upload { position: relative; }
.hub-upload:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-colour { display: flex; gap: var(--space-2); }
.hub-colour input[type="color"] { flex: none; width: 52px; min-height: 44px; padding: 4px; cursor: pointer; }
.hub-colour input[type="text"] { flex: 1 1 auto; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.hub-colour input[type="text"]::placeholder { font-family: var(--font-body); font-style: italic; text-transform: none; }
.hub-colour-field > label { font-weight: 600; }
.hub-colour-field .hub-link { font-size: 12.5px; margin-left: 2px; }
.hub-brand-preview { position: sticky; top: var(--space-4); }
.hub-brand-preview .hub-label { margin-bottom: var(--space-3); }
.hub-preview { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.hub-preview-side, .hub-preview-signin { min-height: 220px; border-radius: var(--radius-sm); background: var(--night); color: var(--on-night); overflow: hidden; }
.hub-preview-side { display: flex; flex-direction: column; gap: 14px; padding: 14px 8px; }
.hub-preview-brand { padding: 0 6px; font-family: var(--font-heading); font-size: 13px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--on-night-strong); overflow-wrap: anywhere; }
.hub-preview-brand span { display: block; margin-top: 2px; font-family: var(--font-body); font-size: 7.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-night-tint); }
.hub-preview-brand.center { text-align: center; font-size: 15px; }
.hub-preview-logo { display: block; max-width: calc(100% - 12px); max-height: 24px; margin: 0 6px; }
.hub-preview-signin .hub-preview-logo { max-height: 30px; margin: 0 auto; }
.hub-preview-nav { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-body); font-size: 11px; }
.hub-preview-nav span { position: relative; padding: 4px 6px; border-radius: 4px; }
.hub-preview-nav .hub-preview-label { padding-bottom: 2px; font-size: 7.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-night-muted); }
.hub-preview-nav .active { background: var(--night-active); color: var(--on-night-strong); font-weight: 600; }
.hub-preview-nav .active::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; border-radius: 0 2px 2px 0; background: var(--accent); }
.hub-preview-signin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px 12px; }
.hub-preview-rule { display: block; width: 22px; height: 2px; background: var(--accent); }
.hub-preview-card { display: flex; flex-direction: column; gap: 4px; width: 100%; max-width: 170px; padding: 12px; border-radius: 6px; background: var(--surface); color: var(--text); font-family: var(--font-body); font-size: 10.5px; line-height: 1.35; overflow-wrap: anywhere; }
.hub-preview-card b { font-family: var(--font-heading); font-size: 14px; font-weight: 800; color: var(--heading); }
@media (max-width: 1100px) {
    .hub-brand-layout { grid-template-columns: minmax(0, 1fr); }
    .hub-brand-preview { position: static; }
    .hub-preview { max-width: 460px; }
}
@media (max-width: 599px) {
    .hub-preview { grid-template-columns: 104px minmax(0, 1fr); }
    .hub-logo-box { width: 100%; }
}

/* System: facts and the modules. */
.hub-tech { margin: var(--space-4) 0 0; }
.hub-tech[open] > summary { margin-bottom: var(--space-3); }
.hub-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--space-3) var(--space-5); margin: 0 0 var(--space-5); }
.hub-facts dt { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.hub-facts dd { margin: 2px 0 0; color: var(--heading); }
.hub-modules { margin-top: var(--space-3); }

/* AI prompts: one table, a group of rows per module, so the columns line up. */
.hub-prompts { table-layout: fixed; }
.hub-prompts-version { width: 140px; }
.hub-prompts-action { width: 96px; }
.hub-prompts .hub-group-row th { padding: var(--space-5) 0 6px; border-bottom: 1px solid var(--border); font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--heading); }
.hub-prompts tbody:first-of-type .hub-group-row th { padding-top: var(--space-3); }
.hub-prompts .hub-group-row + tr > * { border-top: 0; }
.hub-prompts td { overflow-wrap: anywhere; }
@media (max-width: 599px) {
    .hub-prompts { table-layout: auto; }
    .hub-prompts .hub-group-row { display: block; padding: var(--space-4) 0 0; border-top: 0; }
    .hub-prompts .hub-group-row th { display: block; padding: 0 0 6px; }
    .hub-prompts tr:not(.hub-group-row) { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .hub-prompts tr:not(.hub-group-row) td:first-child { flex: 1 1 100%; }
}
@media (max-width: 599px) {
    .hub-modules.hub-table-stack tr { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px var(--space-2); padding: var(--space-2) 0; }
    .hub-modules .hub-modules-needs { flex: 1 1 100%; color: var(--text-muted); font-size: 13px; }
}

/* Admin pages (part 3): folding cards, filters and pages, the Jobs page's attention list, connection rows, notices and
   the danger zone. */
/* A card that folds, such as Jobs' history or Clients' archived clients: its title is the summary, with a count. */
.hub-fold > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-2); cursor: pointer; list-style: none; }
.hub-fold > summary::-webkit-details-marker { display: none; }
.hub-fold > summary::before { content: "\25B8"; flex: none; width: 14px; color: var(--text-muted); transition: transform 0.12s; }
.hub-fold[open] > summary::before { transform: rotate(90deg); }
.hub-fold > summary .hub-h2 { margin: 0; }
.hub-fold > summary .hub-note { margin: 0; }
.hub-fold[open] > summary { margin-bottom: var(--space-4); }
.hub-fold > summary:focus-visible { outline-offset: 4px; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) { .hub-fold > summary::before { transition: none; } }
/* Filters above a list: fields of one width, and their buttons on the fields' line. */
.hub-filters { margin-bottom: var(--space-4); }
.hub-filters > .hub-field { flex: 1 1 200px; max-width: 280px; }
.hub-filters > .hub-field-narrow, .hub-inline > .hub-field-narrow { flex: 0 1 180px; min-width: 150px; }
.hub-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
.hub-pager .hub-note { margin: 0 auto 0 0; }
.hub-count { margin-left: 6px; font-family: var(--font-body); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
.hub-grid-intro { margin: -6px 0 var(--space-4); }

/* Jobs: what needs attention, one row per client and cause, with how many. */
.hub-attention-row { grid-template-columns: 64px minmax(0, 1fr) auto; }
.hub-attention-count { justify-self: start; min-width: 48px; padding: 3px 8px; border-radius: var(--radius-pill); text-align: center; font: 700 13.5px/1.3 var(--font-body); white-space: nowrap; }
.hub-attention-count.bad { background: var(--danger-bg); color: var(--danger-strong); }
.hub-attention-count.wait { background: var(--info-bg); color: var(--on-info-bg); }
.hub-attention-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hub-attention-main b { color: var(--heading); font-weight: 600; overflow-wrap: anywhere; }
.hub-attention-main .hub-note { margin: 0; }
.hub-attention-row .hub-actions { justify-content: flex-end; }
:is(.hub-attention-row, .hub-invites, .hub-archived) :is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger) { min-height: 34px; font-size: 13px; }
.hub-limit-form { margin: var(--space-4) 0; }
.hub-limits .hub-setrow { grid-template-columns: minmax(140px, 240px) minmax(90px, 140px) minmax(0, 1fr); }
.hub-invites .hub-setrow, .hub-archived .hub-setrow { grid-template-columns: minmax(0, 1fr) auto; }
.hub-ai-usage .hub-setrow { grid-template-columns: minmax(140px, 220px) minmax(140px, 1fr) minmax(140px, 1fr) minmax(110px, auto); align-items: start; }
.hub-ai-usage .hub-setrow > span:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.hub-ai-span { grid-column: span 2; }
.hub-ai-window, .hub-ai-read { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hub-ai-read { align-items: flex-end; }
.hub-ai-label { font-size: 12px; font-weight: 600; color: var(--heading); }
.hub-meter { display: block; height: 8px; border-radius: var(--radius-pill); background: var(--fill); overflow: hidden; }
.hub-meter > span { display: block; height: 100%; background: var(--success); }
.hub-meter.warn > span { background: var(--accent); }
.hub-meter.bad > span { background: var(--danger); }
@media (max-width: 599px) {
    .hub-ai-usage .hub-setrow { grid-template-columns: minmax(0, 1fr); }
    .hub-ai-span { grid-column: auto; }
    .hub-ai-read { align-items: flex-start; }
    .hub-attention-row { grid-template-columns: auto minmax(0, 1fr); }
    .hub-attention-row > .hub-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .hub-limits .hub-setrow { grid-template-columns: minmax(0, 1fr) auto; }
    .hub-limits .hub-setrow > :last-child { grid-column: 1 / -1; }
    .hub-invites .hub-setrow, .hub-archived .hub-setrow { grid-template-columns: minmax(0, 1fr); }
    .hub-pager { justify-content: flex-start; }
    .hub-pager .hub-note { flex: 1 1 100%; }
}

/* People: the person's name leads its row, and the row's ⋯ menu sits at its end. */
.hub-person-name { color: var(--heading); font-weight: 600; }
.hub-table td.hub-row-end { width: 1%; text-align: right; white-space: nowrap; }
@media (max-width: 599px) {
    .hub-table-stack td.hub-row-end { width: auto; text-align: left; }
    /* The menu sits beside the name, top right, rather than alone at the bottom of the block. */
    .hub-people tr { position: relative; }
    .hub-people td.hub-row-end { position: absolute; top: var(--space-3); right: 0; }
    .hub-people tbody tr:first-child td.hub-row-end { top: 0; }
    .hub-people td:first-child { padding-right: 52px; }
}

/* The allocation grid: names centred on their selects (V42). On a phone each person is a block, one line per client. */
.hub-grid th[scope="row"] { vertical-align: middle; padding: var(--space-3) var(--space-4) var(--space-3) 0; }
.hub-grid td { vertical-align: middle; }
.hub-grid-all { display: none; }
@media (max-width: 599px) {
    .hub-scroll > .hub-table.hub-grid-stack { min-width: 0; }
    .hub-grid-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .hub-grid-stack, .hub-grid-stack tbody, .hub-grid-stack tr { display: block; }
    .hub-grid-stack tr { padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); }
    .hub-grid-stack tbody tr:first-child { border-top: 0; padding-top: 0; }
    .hub-grid-stack tbody tr:hover td { background: none; }
    .hub-grid-stack th[scope="row"] { position: static; display: block; padding: 0 0 var(--space-2); border: 0; white-space: normal; background: none; }
    .hub-grid-stack td { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 4px 0; border: 0; }
    .hub-grid-stack td::before { content: attr(data-label); flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
    .hub-grid-stack td select { flex: 0 1 190px; min-width: 0; width: 190px; }
    .hub-grid-stack .hub-grid-admin td { display: none; }
    .hub-grid-stack .hub-grid-all { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--text-muted); }
}

/* Connection rows (Client setup, Connections, Sync): name and status on the left, one main action and the ⋯ menu right. */
.hub-conn .hub-step-head b { overflow-wrap: anywhere; }
.hub-conn-actions { flex-wrap: nowrap; }
@media (max-width: 599px) {
    .hub-conn .hub-step-row > .hub-actions { flex: 1 1 100%; }
}

/* A warning above a list: it applies to the list, so it sits apart from its rows. */
.hub-notice { margin: 0 0 var(--space-4); padding: 10px 14px; border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--heading); font-size: 13.5px; line-height: 1.45; }
.hub-notice p { margin: 0; }
.hub-notice ul { margin: 0; padding-left: 18px; }
.hub-notice li + li { margin-top: 4px; }

/* The danger zone: last on the page, set apart by a red edge. */
.hub-danger-zone { border-color: var(--danger-bg); box-shadow: inset 3px 0 0 var(--danger); }
.hub-danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); }
.hub-danger-row > div { flex: 1 1 380px; min-width: 0; }
.hub-danger-row b { color: var(--heading); font-weight: 600; }
.hub-danger-row .hub-note { margin-top: 2px; }

/* Research settings: a long tag with no spaces wraps inside its chip (R17). */
.hub-research-values .hub-chip { max-width: 100%; min-width: 0; }
/* A tight stack, for long lists such as Jobs: on a phone the short cells (client, status, attempts) share one line under
   the row's name, with no labels, and the long ones take the whole width. */
@media (max-width: 599px) {
    .hub-filters > .hub-field, .hub-filters > .hub-field-narrow, .hub-inline > .hub-field-narrow { flex: 1 1 100%; max-width: none; }
    .hub-table-tight tr { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
    .hub-table-tight td[data-label]::before { display: none; }
    .hub-table-tight td.hub-cell-full { flex: 1 1 100%; }
    .hub-table-tight td:not([data-label]) { flex: 1 1 100%; }
    .hub-table-tight td.hub-cell-full:first-child { font-weight: 600; color: var(--heading); }
    .hub-table-tight td.hub-cell-full:first-child .hub-note { font-weight: 400; }
}
/* Words a stacked row needs because its column heading is hidden. */
.hub-phone-only { display: none; }
@media (max-width: 599px) { .hub-phone-only { display: inline; } }
@media (max-width: 599px) {
    .hub-table-tight td.hub-note-phone { color: var(--text-muted); font-size: 13px; }
    .hub-grid-stack td::before { flex: 1 1 0; }
    .hub-grid-stack td select { flex: none; width: min(200px, 56%); }
}
/* Client setup's one form: its groups are ruled apart, and the last one runs straight into Save. */
.hub-setup-form > .hub-fieldset { margin-bottom: 0; }
.hub-setup-form > .hub-fieldset:last-of-type { padding-bottom: 0; border-bottom: 0; }
@media (max-width: 599px) {
    .hub-table-tight td.hub-cell-end { flex: 0 0 auto; margin-left: auto; }
}
/* Audit log: who stays on one line; what, about and client wrap between words, so the detail keeps a readable width
   inside the card instead of being pushed past its edge. */
@media (min-width: 600px) {
    .hub-audit td:nth-child(2) { white-space: nowrap; }
    .hub-audit td:last-child { width: 300px; }
}
@media (max-width: 599px) {
    .hub-audit td.hub-audit-what { order: -1; font-weight: 600; color: var(--heading); }
    .hub-audit td:empty { display: none; }
}
/* A connection's form: the fields line up by their labels, and the account picker and the buttons take their own rows. */
.hub-step-form .hub-form > :is(.hub-actions, fieldset) { grid-column: 1 / -1; }
.hub-step-form fieldset.hub-checks > .hub-hint { flex-basis: 100%; }

/* Part 4 of the redesign: the client pages and day-to-day work. */
.hub-board-add { flex: 1 1 auto; }
/* The card page: Next step's words, field and buttons each have room; helper text sits with its label, apart from the
   field. On a narrower screen the next step and approvals come before the long form. */
.hub-next { display: flex; flex-direction: column; gap: var(--space-3); }
.hub-next > p { margin: 0; }
.hub-next > .hub-actions { margin-top: 2px; }
.hub-card-split .hub-field > .hub-hint, .hub-brief-form .hub-field > .hub-hint { margin: -3px 0 2px; }
@media (max-width: 1100px) { .hub-card-split > aside { order: -1; } }
/* A heading that is a link keeps the heading's own face. */
.hub-h2 a { font: inherit; color: var(--heading); }
.hub-h2 a:hover { color: var(--link); }
/* Packages: the row's action sits at its end; the package popup groups its numbers and its dates. */
.hub-packages td:last-child { text-align: right; }
@media (max-width: 599px) { .hub-packages td:last-child { text-align: left; } }
/* The brief form: a tab a section, with Save draft and Submit kept at the foot of the screen while it is long. */
.hub-brief-form .hub-tabs { margin-bottom: var(--space-2); }
.hub-brief-form .hub-brief-part { padding-top: 0; border-top: 0; }
.hub-brief-bar { position: sticky; bottom: 0; z-index: 2; padding: var(--space-3) 0; border-top: 1px solid var(--border-soft); background: var(--surface); }
.hub-brief-close { margin-left: auto; }
/* Research's ranked posts on a phone: the thumbnail beside the post's facts rather than on a row of its own, and the
   filters two to a row. */
@media (max-width: 599px) {
    .hub-research-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hub-research-table tr { grid-template-columns: 48px repeat(3, minmax(0, 1fr)); }
    .hub-research-table td.hub-research-thumb { grid-column: 1; grid-row: 1 / span 3; width: auto; }
    .hub-research-table td[data-label="Account"], .hub-research-table td.hub-research-open { grid-column: 2 / -1; }
}
.hub-card-split .hub-section > .hub-note:first-of-type { margin: 0 0 var(--space-3); }

/* Final check: quiet text avoids leaving one word alone on its last line (the sign-in footer's "one.", a hint's "30"). */
.hub-sub, .hub-note, .hub-hint { text-wrap: pretty; }

/* Loading (HubLoad): the content's rough shape, in quiet blocks. It holds the content's place from the first moment, so
   nothing moves when the content arrives, but stays invisible for 300 ms, so a quick load shows nothing extra. */
.hub-load { display: block; }
.hub-skel-body { opacity: 0; animation: hub-skel-in 200ms ease-out 300ms forwards; }
.hub-skel { display: block; border-radius: var(--radius-sm); background: var(--fill); animation: hub-skel-pulse 1.6s ease-in-out 500ms infinite; }
.hub-skel-toolbar { display: flex; margin-bottom: var(--space-4); }
.hub-skel-field { width: 200px; height: 62px; }
.hub-skel-tabs { pointer-events: none; }
.hub-skel-tabs .hub-tab { cursor: default; }
.hub-skel-word { display: inline-block; border-radius: var(--radius-sm); background: var(--fill); color: transparent; line-height: 1.2; }
.hub-skel-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: var(--space-5); }
.hub-skel-title { width: 220px; max-width: 60%; height: 22px; }
.hub-skel-line { height: 14px; }
.hub-skel-line:nth-child(3n) { width: 82%; }
.hub-skel-line:nth-child(3n + 1) { width: 64%; }
.hub-skel-lines { display: flex; flex-direction: column; gap: 12px; padding: var(--space-2) 0; }
.hub-skel-head { height: 18px; opacity: 0.7; }
.hub-skel-row { height: 34px; opacity: 0.55; }
.hub-skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.hub-skel-tile { height: 180px; border-radius: var(--radius); }
.hub-skel-block { height: 100%; min-height: 240px; border-radius: var(--radius); margin-bottom: var(--space-5); }
.hub-load[style] > .hub-skel-body { min-height: inherit; display: flex; flex-direction: column; }
.hub-load[style] > .hub-skel-body > :last-child { flex: 1 1 auto; }
@keyframes hub-skel-in { to { opacity: 1; } }
@keyframes hub-skel-pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
    .hub-skel-body { animation: hub-skel-in 1ms linear 300ms forwards; }
    .hub-skel { animation: none; }
}

/* While the next page loads, the last one stays on screen as a still picture over it (hubPage.js), until the new one is
   ready or 300 ms have passed. */
.hub-page-snapshot { position: absolute; z-index: 1; pointer-events: none; }
html.hub-page-held .hub-main > .hub-page:not(.hub-page-snapshot) { opacity: 0; }

/* Files: the run line under the tabs, a grid of thumbnails (or a list), the content map, and the viewer popup. Every
   thumbnail sits on the neutral .hub-thumb box, which shows when there's no picture or it fails to load. */
.hub-files-head { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-4); padding-bottom: var(--space-4); }
.hub-files-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.hub-files-state { display: flex; flex: 1 1 320px; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); min-width: 0; margin: 0; }
.hub-files-state .hub-status { white-space: normal; }
.hub-files-message { margin: 0; }
.hub-files-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); max-width: 640px; padding: var(--space-3) 0; }
.hub-files-empty p { margin: 0; }
.hub-files-empty .hub-empty-title { font: 700 17px/1.3 var(--font-heading); color: var(--heading); overflow-wrap: anywhere; }
.hub-files-empty .hub-btn-secondary { margin-top: var(--space-2); }
.hub-files-filters { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); align-items: end; }
.hub-files-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-4); min-height: 44px; }
.hub-files-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.hub-files-bar .hub-hint { margin: 0; }
.hub-files-views { display: inline-flex; padding: 2px; border: 1px solid var(--border-mid); border-radius: var(--radius-sm); background: var(--surface-alt); }
.hub-files-views button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 4px; background: none; color: var(--text-muted); font: 600 13px var(--font-body); cursor: pointer; }
.hub-files-views button:hover { color: var(--heading); }
.hub-files-views button.is-on { background: var(--surface); color: var(--heading); box-shadow: 0 0 0 1px var(--border-mid); }
.hub-files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.hub-files-tile { display: flex; flex-direction: column; gap: 6px; width: 100%; height: 100%; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hub-files-tile:hover { border-color: var(--border-strong); background: var(--row-hover); }
.hub-files-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* A hidden file is greyed, not see-through, so the placeholder under it never shows. */
.hub-files-tile.is-hidden .hub-files-thumb img { filter: grayscale(1) contrast(0.55) brightness(1.2); }
.hub-files-thumb.hub-thumb { width: 100%; height: auto; aspect-ratio: 1; }
.hub-files-thumb.hub-thumb::before { width: 32px; height: 24px; }
.hub-files-kind { position: absolute; left: 6px; bottom: 6px; padding: 1px 7px; border-radius: 4px; background: var(--night); color: var(--on-night-strong); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hub-files-name { padding: 0 2px; font-size: 13px; font-weight: 600; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-files-tags { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 2px 2px; }
.hub-files-tags .hub-chip { min-height: 20px; padding: 0 6px; font-size: 11.5px; }
.hub-files-row-thumb { width: 60px; }
.hub-files-open { text-align: left; overflow-wrap: anywhere; }
.hub-files-sub { display: block; margin-top: 2px; }
.hub-files-score { white-space: nowrap; }
.hub-files-score .hub-files-sub { white-space: normal; max-width: 260px; }
.hub-files-table td[data-label="Description"] { max-width: 520px; }
.hub-files-more { margin-top: var(--space-3); }
.hub-files-counts { margin: 0 0 var(--space-3); font-size: 14px; }
.hub-files-counts .hub-hint { display: block; margin-top: 2px; }
.hub-files-sub-head { margin-top: var(--space-5); }
.hub-files-gaps { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.hub-files-gaps li { padding: 8px 12px; border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong); overflow-wrap: anywhere; }
.hub-files-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--space-3); }
.hub-files-group { min-width: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); }
.hub-files-group h4 { margin: 0; font: 700 15px/1.3 var(--font-heading); color: var(--heading); overflow-wrap: anywhere; }
.hub-files-group .hub-hint { margin: 2px 0 var(--space-2); }
.hub-files-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hub-files-mini.hub-thumb { width: 52px; height: 52px; padding: 0; border: 0; cursor: pointer; }
.hub-files-mini.hub-thumb:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-files-mini-score { position: absolute; right: 3px; bottom: 3px; min-width: 16px; padding: 0 4px; border-radius: 4px; background: var(--night); color: var(--on-night-strong); font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.hub-files-strip-more { font-size: 13px; }
.hub-files-sources { margin-bottom: var(--space-3); }
.hub-files-sources .hub-step { gap: 4px; padding: var(--space-3) 0; }
.hub-files-sources .hub-step:first-child { padding-top: 0; }
.hub-files-sources .hub-hint { margin: 0; }
@media (max-width: 599px) {
    .hub-files-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
    .hub-files-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); }
    .hub-files-checks { grid-column: 1 / -1; min-height: 36px; }
    .hub-files-head .hub-actions { width: 100%; }
    .hub-files-head .hub-actions > * { flex: 1 1 auto; }
    .hub-files-table td[data-label="Description"] { max-width: none; }
}
/* The viewer: the file large on the left, what the map says beside it; one column on a narrow screen. */
.hub-viewer .hub-dlg-body { min-height: min(62vh, 560px); }
.hub-viewer-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: var(--space-5); align-items: start; }
.hub-viewer-media { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.hub-viewer-media video { display: block; width: 100%; max-height: 62vh; border-radius: var(--radius); background: var(--night); }
.hub-viewer-picture.hub-thumb { width: 100%; height: min(62vh, 560px); border-radius: var(--radius); }
.hub-viewer-picture.hub-thumb::before { width: 48px; height: 36px; }
.hub-viewer-picture.hub-thumb img { object-fit: contain; }
.hub-viewer-media .hub-hint { margin: 0; }
.hub-viewer-facts { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; font-size: 14px; }
.hub-viewer-facts > p { margin: 0; }
.hub-viewer-description { color: var(--heading); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.hub-viewer-list { display: flex; flex-direction: column; gap: 6px; margin: var(--space-2) 0 0; }
.hub-viewer-list > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-2); }
.hub-viewer-list dt { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.hub-viewer-list dd { margin: 0; overflow-wrap: anywhere; }
.hub-viewer-used { margin: var(--space-3) 0 0; }
.hub-viewer-uses { margin: 0; padding-left: 18px; }
/* A video's moments in the viewer: each a row with its times, seeking the player. */
.hub-viewer-moments { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; max-height: 280px; overflow-y: auto; }
.hub-viewer-moment { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: var(--space-2); width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.hub-viewer-moment:hover { background: var(--row-hover); border-color: var(--border-mid); }
.hub-viewer-moment.is-on { border-color: var(--accent); background: var(--accent-soft); }
.hub-viewer-moment-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--heading); white-space: nowrap; }
.hub-viewer-moment-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.hub-viewer-moment-speech { font-style: italic; }
/* A video's moments under its description in the Files list: its times open the viewer there. */
.hub-files-moments { display: flex; flex-direction: column; gap: 2px; margin: var(--space-2) 0 0; padding: 0; list-style: none; font-size: 13px; }
.hub-files-moments li { display: flex; gap: var(--space-2); align-items: baseline; min-width: 0; }
.hub-files-moment { flex: 0 0 auto; min-height: 28px; font-variant-numeric: tabular-nums; }
.hub-files-moments .hub-hint { overflow-wrap: anywhere; }
.hub-viewer-score { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-3); }
/* Correct: the picture to click on for its subject, with the point and the subject's box over it. */
.hub-viewer-focus-wrap { display: flex; justify-content: center; align-items: center; min-height: min(62vh, 560px); border-radius: var(--radius); background: var(--night); }
.hub-viewer-focus { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.hub-viewer-focus img { display: block; max-width: 100%; max-height: min(62vh, 560px); cursor: crosshair; }
.hub-focus-box { position: absolute; border: 2px dashed #FFFFFF; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); border-radius: 4px; pointer-events: none; }
.hub-focus-mark { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid #FFFFFF; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent), 0 1px 6px rgba(0, 0, 0, .6); pointer-events: none; }
.hub-viewer-focus-fields { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.hub-viewer-focus-fields .hub-viewer-score { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hub-files-panel { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.hub-files-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: baseline; gap: var(--space-3); font-size: 14px; }
.hub-files-row > .hub-status { justify-self: start; max-width: 100%; white-space: normal; }
.hub-files-row-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); min-width: 0; overflow-wrap: anywhere; }
.hub-files-row-text .hub-btn-secondary { min-height: 32px; font-size: 13px; }
@media (max-width: 599px) {
    .hub-files-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
}
.hub-files-track-note { display: block; margin-top: 2px; }
.hub-files-tracks td[data-label="Tempo"], .hub-files-tracks td[data-label="Length"] { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* A card's video music: the switch, the track and its level. */
.hub-video-music { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: var(--space-3) 0 0; border: 0; border-top: 1px solid var(--border); min-width: 0; }
.hub-video-music .hub-field { min-width: 0; }
.hub-video-music select { max-width: 100%; }
.hub-viewer-form textarea { min-height: 96px; padding: 10px 12px; resize: vertical; }
.hub-viewer-steps { display: flex; align-items: center; gap: var(--space-2); margin-right: auto; }
.hub-viewer-steps .hub-btn-quiet { min-width: 44px; font-size: 16px; }
@media (max-width: 760px) {
    .hub-viewer-split { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
    .hub-viewer .hub-dlg-body { min-height: 0; }
    .hub-viewer-picture.hub-thumb { height: auto; aspect-ratio: 4 / 3; max-height: 52vh; }
    .hub-viewer-media video { max-height: 52vh; }
    .hub-viewer-focus-wrap { min-height: 0; }
    .hub-viewer-focus img { max-height: 52vh; }
}
@media (max-width: 640px) {
    .hub-viewer-steps { width: 100%; justify-content: space-between; margin-right: 0; }
    .hub-viewer-steps .hub-btn-quiet { flex: 0 0 auto; }
    .hub-viewer-score { grid-template-columns: minmax(0, 1fr); }
}
/* A card's post kit (Assets, in the card.kit slot): a row per shot, each a grid of the picked files' thumbnails with the
   reason under each, and the Add from files popup, which reuses the Files grid. */
.hub-kit { margin-top: var(--space-4); }
.hub-kit-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.hub-kit-titles { min-width: 0; flex: 1 1 320px; }
.hub-kit-titles .hub-note { margin: 2px 0 0; }
.hub-kit-head .hub-actions { margin: 0; }
.hub-kit-message, .hub-kit-building { margin: var(--space-3) 0 0; }
.hub-kit-message a { margin-left: 6px; }
.hub-kit-building { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.hub-kit-building .hub-hint { margin: 0; }
.hub-kit-empty { margin-top: var(--space-2); }
.hub-kit > .hub-hint, .hub-kit > .hub-note { margin: var(--space-2) 0 0; }
.hub-kit-shots { display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.hub-kit-shot { padding-top: var(--space-4); border-top: 1px solid var(--border-soft); }
.hub-kit-shot:first-child { padding-top: 0; border-top: 0; }
.hub-kit-shot-head { display: flex; align-items: flex-start; gap: var(--space-2); margin-bottom: var(--space-3); }
.hub-kit-num { display: inline-grid; flex: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 700; }
.hub-kit-shot-text { margin: 2px 0 0; color: var(--heading); font-weight: 600; overflow-wrap: anywhere; }
.hub-kit-none { margin: 0 0 0 34px; }
.hub-kit-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.hub-kit-pick { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hub-kit-thumb.hub-thumb { width: 100%; height: auto; aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--radius); cursor: pointer; }
.hub-kit-thumb.hub-thumb::before { width: 32px; height: 24px; }
.hub-kit-thumb:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-kit-thumb:disabled { cursor: default; }
.hub-kit-pick.is-gone .hub-kit-thumb { opacity: 0.6; }
.hub-kit-lock { position: absolute; top: 6px; left: 6px; padding: 1px 7px; border-radius: 4px; background: var(--night); color: var(--on-night-strong); font-size: 11.5px; font-weight: 600; }
.hub-kit-pick-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.hub-kit-name { min-width: 0; font-size: 13px; font-weight: 600; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-kit-reason { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.hub-kit-filters { margin-bottom: var(--space-3); }
.hub-kit-count { margin: 0 0 var(--space-2); }
.hub-kit-picker .hub-dlg-body { min-height: min(62vh, 560px); }
.hub-kit-picker-grid .hub-files-tile:disabled { cursor: default; opacity: 0.7; }
@media (max-width: 600px) {
    .hub-kit-head .hub-actions { width: 100%; }
    .hub-kit-head .hub-actions > * { flex: 1 1 auto; }
    .hub-kit-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
    .hub-kit-none { margin-left: 0; }
    .hub-kit-picker .hub-dlg-body { min-height: 0; }
}

/* Canva (Design module): the card's design with its preview beside what was made, and the client's brand templates. */
.hub-canva-design { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: var(--space-4); align-items: start; margin-top: var(--space-4); }
.hub-canva-preview.hub-thumb { width: 100%; height: auto; aspect-ratio: 9 / 16; max-height: 360px; border-radius: var(--radius); }
.hub-canva-preview img { width: 100%; height: 100%; object-fit: contain; }
.hub-canva-about { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); min-width: 0; }
.hub-canva-about p { margin: 0; overflow-wrap: anywhere; }
.hub-canva-made { margin: 0; }
.hub-canva-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-top: var(--space-3); }
.hub-canva-pick > .hub-hint { flex: 1 1 100%; margin: 0; }
.hub-canva-pick .hub-field { flex: 1 1 220px; margin: 0; }
.hub-canva-pick select { width: 100%; }
.hub-canva-fields { display: flex; flex-direction: column; gap: 4px; margin: var(--space-3) 0 0; padding-left: var(--space-4); }
.hub-canva-fields li { overflow-wrap: anywhere; }
.hub-canva-naming { margin-top: var(--space-4); }
.hub-canva-naming summary { cursor: pointer; color: var(--link); font-weight: 600; }
.hub-canva-naming ul { margin: var(--space-2) 0 0; padding-left: var(--space-4); }
@media (max-width: 600px) {
    .hub-canva-design { grid-template-columns: minmax(0, 1fr); }
    .hub-canva-preview.hub-thumb { max-width: 240px; }
    .hub-canva-pick .hub-btn { width: 100%; }
}

/* The post (Design module): the hub's finished image or carousel on a card, its styles, and Adjust. */
.hub-post-start { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4); margin-top: var(--space-4); }
.hub-post-styles { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.hub-post-styles legend { margin-bottom: var(--space-2); padding: 0; font-weight: 600; color: var(--heading); }
.hub-post-style { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 132px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; text-align: center; cursor: pointer; }
.hub-post-style input { position: absolute; opacity: 0; pointer-events: none; }
.hub-post-style:hover { border-color: var(--border-strong); }
.hub-post-style.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hub-post-style:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-post-mini { position: relative; display: block; width: 64px; height: 80px; border-radius: 4px; overflow: hidden; background: linear-gradient(160deg, var(--brand-light), var(--brand-mid)); }
.hub-post-mini i, .hub-post-mini b { position: absolute; display: block; }
.hub-post-mini-overlay::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); }
.hub-post-mini-overlay i { z-index: 1; left: 8px; right: 14px; bottom: 16px; height: 6px; border-radius: 2px; background: var(--on-night-strong); box-shadow: 0 -10px 0 var(--on-night-strong); }
.hub-post-mini-band::after { content: ""; position: absolute; inset: 62% 0 0; background: var(--night); }
.hub-post-mini-band i { z-index: 1; left: 8px; right: 14px; bottom: 12px; height: 5px; border-radius: 2px; background: var(--on-night-strong); box-shadow: 0 -9px 0 var(--on-night-strong); }
.hub-post-mini-card b { left: 6px; right: 6px; bottom: 6px; height: 28px; border-radius: 4px; background: var(--surface); box-shadow: 0 2px 6px rgb(0 0 0 / 0.2); }
.hub-post-mini-card i { z-index: 1; left: 12px; right: 18px; bottom: 15px; height: 5px; border-radius: 2px; background: var(--heading); box-shadow: 0 -8px 0 var(--heading); }
.hub-post-go { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.hub-post-go .hub-field { margin: 0; }
.hub-post-go .hub-hint { margin: 0; flex-basis: 100%; }
.hub-post-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.hub-post-slides.is-single { grid-template-columns: minmax(0, 320px); }
.hub-post-slides.is-story { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hub-post-slides.is-story.is-single { grid-template-columns: minmax(0, 260px); }
.hub-post-slide { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hub-post-image { display: block; width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--surface-alt); box-shadow: 0 0 0 1px var(--border-soft), 0 4px 14px rgb(0 0 0 / 0.08); }
.hub-post-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hub-post-image:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-post-slide-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hub-post-slide-foot .hub-hint { margin: 0; }
.hub-post-about { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.hub-post-about p { margin: 0; overflow-wrap: anywhere; }
.hub-post-about .hub-actions { margin: 0; align-items: flex-end; }
.hub-post-versions { margin: 0; }
.hub-post-caption { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border-soft); }
.hub-post-caption-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.hub-post-caption-head .hub-label { margin: 0; }
.hub-post-caption-text { margin: var(--space-2) 0; white-space: pre-line; overflow-wrap: anywhere; }
.hub-post-caption .hub-hint { margin: 0; }
.hub-post-edit { display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.hub-post-edit-slide { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border-soft); }
.hub-post-edit-slide .hub-label { margin: 0; }
.hub-post-edit-slide .hub-field { margin: 0; }
.hub-post-photos { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.hub-post-photos legend { margin-bottom: 4px; padding: 0; font-size: 13px; font-weight: 600; color: var(--heading); }
.hub-post-photo { position: relative; display: block; width: 72px; height: 72px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--border-soft); cursor: pointer; }
.hub-post-photo input { position: absolute; opacity: 0; pointer-events: none; }
.hub-post-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hub-post-photo.is-on { box-shadow: 0 0 0 3px var(--accent); }
.hub-post-photo:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.hub-post-adjust .hub-dlg-foot { flex-wrap: wrap; }
.hub-post-adjust .hub-dlg-foot .hub-btn-quiet { margin-right: auto; }
@media (max-width: 600px) {
    .hub-post-style { width: calc(33.333% - 8px); min-width: 0; padding: 8px 4px; font-size: 12px; }
    .hub-post-styles { width: 100%; gap: var(--space-2); }
    .hub-post-go, .hub-post-go .hub-field, .hub-post-go .hub-btn { width: 100%; }
    .hub-post-slides, .hub-post-slides.is-story { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
    .hub-post-slides.is-single, .hub-post-slides.is-story.is-single { grid-template-columns: minmax(0, 1fr); }
    .hub-post-photo { width: 60px; height: 60px; }
}
/* The card's finished video: the player beside its facts, and Adjust's segments with a preview frame each. */
.hub-video-start { flex-direction: column; align-items: stretch; gap: var(--space-3); }
.hub-video-start > .hub-hint { margin: 0; }
.hub-video-shown { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4); margin-top: var(--space-4); }
.hub-video-player { flex: 0 0 auto; width: min(100%, 300px); aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: var(--night); box-shadow: 0 0 0 1px var(--border-soft), 0 4px 14px rgb(0 0 0 / 0.08); }
.hub-video-player video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--night); }
.hub-video-about { flex: 1 1 260px; min-width: 0; margin-top: 0; }
.hub-video-facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-weight: 600; color: var(--heading); }
.hub-video-settings { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.hub-video-settings .hub-field { margin: 0; }
.hub-video-total { flex-basis: 100%; margin: 0; }
.hub-video-segment-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.hub-video-segment-head .hub-actions { margin: 0; gap: 4px; }
.hub-video-segment-body { display: flex; gap: var(--space-3); align-items: flex-start; }
.hub-video-preview { flex: 0 0 96px; aspect-ratio: 9 / 16; border-radius: var(--radius-sm); overflow: hidden; background: var(--night); box-shadow: inset 0 0 0 1px var(--border-soft); }
.hub-video-preview video, .hub-video-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hub-video-fields { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--space-2); min-width: 0; }
.hub-video-points { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.hub-video-points .hub-field { width: 9rem; margin: 0; }
.hub-video-points .hub-hint { margin: 0 0 8px; }
.hub-post-photo.is-clip::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--on-night-strong); filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.6)); }
@media (max-width: 600px) {
    .hub-video-player { width: 100%; max-width: 320px; margin: 0 auto; }
    .hub-video-segment-body { flex-direction: column; }
    .hub-video-preview { flex-basis: auto; width: 96px; }
    .hub-video-points .hub-field { width: calc(50% - 4px); }
    .hub-video-adjust .hub-dlg-foot .hub-btn, .hub-video-adjust .hub-dlg-foot .hub-btn-secondary { flex: 1 1 auto; }
}
/* The video's motion: the live preview (a sandboxed frame scaled to its box), the style, captions and changes in plain words. */
.hub-motion { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4); margin-top: var(--space-4); }
.hub-motion-preview { flex: 0 0 auto; width: min(100%, 300px); }
.hub-motion-preview > .hub-label { margin: 0 0 var(--space-2); }
.hub-motion-stage { position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: var(--night); box-shadow: 0 0 0 1px var(--border-soft), 0 4px 14px rgb(0 0 0 / 0.08); }
.hub-motion-stage iframe { position: absolute; left: 0; top: 0; width: 540px; height: 960px; border: 0; transform-origin: 0 0; background: var(--night); }
.hub-motion-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.hub-motion-controls input[type=range] { flex: 1 1 100%; order: -1; min-width: 0; margin: 0; accent-color: var(--accent); }
.hub-motion-controls [data-mute] { margin-left: auto; }
.hub-motion-controls [data-time] { font-variant-numeric: tabular-nums; }
.hub-motion-preview > .hub-hint { margin: var(--space-2) 0 0; }
.hub-motion-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.hub-motion-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.hub-motion-styles legend { margin-bottom: 4px; padding: 0; }
.hub-motion-style { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.hub-motion-style input { position: absolute; opacity: 0; pointer-events: none; }
.hub-motion-style.is-on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.hub-motion-style:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.hub-motion-name { font-weight: 600; color: var(--heading); }
.hub-motion-style .hub-hint { font-size: 13px; }
.hub-motion-ask .hub-field { margin: 0; }
.hub-motion-ask .hub-actions { margin-top: var(--space-2); }
.hub-motion-change { padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-alt); }
.hub-motion-change > p { margin: 0 0 var(--space-2); }
.hub-motion-lines { margin: 0 0 var(--space-2); padding-left: 1.2em; }
.hub-motion-settings .hub-motion-styles { margin-top: var(--space-2); }
/* The card's rewrite for a Reel or Story: each changed field, the card's words now beside the suggestion. */
.hub-video-rewrite { margin-top: var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-alt); }
.hub-video-rewrite > p, .hub-video-rewrite > h3 { margin: 0 0 var(--space-2); }
.hub-rewrite-field { margin: 0 0 var(--space-3); }
.hub-rewrite-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.hub-rewrite-pair > div { min-width: 0; padding: var(--space-2); border-radius: var(--radius-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.hub-rewrite-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
    .hub-motion-preview { width: 100%; max-width: 320px; margin: 0 auto; }
    .hub-motion-styles { grid-template-columns: 1fr; }
    .hub-rewrite-pair { grid-template-columns: 1fr; }
}

/* Motion styles on Agency settings: each style with a small looping preview, and the editor with its live preview. */
.hub-styles-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.hub-styles-tile { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-areas: "thumb about" "thumb actions"; align-items: start; gap: var(--space-2) var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.hub-styles-tile.is-hidden { background: var(--surface-alt); }
.hub-styles-tile.is-draft { grid-template-columns: minmax(0, 1fr); grid-template-areas: "about" "actions"; }
.hub-styles-thumb { grid-area: thumb; width: 92px; }
.hub-styles-about { grid-area: about; min-width: 0; }
.hub-styles-about p { margin: 0 0 4px; }
.hub-styles-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--heading); }
.hub-styles-tile > .hub-actions { grid-area: actions; flex-wrap: wrap; }
.hub-styles-edit { display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: start; gap: var(--space-4); }
.hub-styles-fields { min-width: 0; }
.hub-styles-live { position: sticky; top: 0; width: auto; }
.hub-styles-live .hub-field { margin-top: var(--space-3); }
.hub-styles-group { min-width: 0; margin: 0 0 var(--space-3); padding: 0 0 var(--space-3); border: 0; border-bottom: 1px solid var(--border-soft); }
.hub-styles-group > legend, .hub-styles-group > summary { margin-bottom: var(--space-2); padding: 0; }
.hub-styles-advanced > summary { cursor: pointer; }
.hub-styles-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.hub-styles-row > .hub-field { flex: 1 1 150px; min-width: 0; margin: 0; }
.hub-styles-row > .hub-styles-narrow, .hub-styles-group > .hub-styles-narrow { flex: 0 1 120px; }
.hub-styles-row > .hub-check { flex: 0 0 140px; margin: 0 0 8px; }
.hub-styles-row-label { flex: 1 1 100%; font-weight: 600; color: var(--heading); }
.hub-styles-css { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.hub-styles-dropped { margin-top: var(--space-2); }
.hub-styles-history { margin: 0; padding-left: 1.2em; }
.hub-styles-history li { margin-bottom: var(--space-2); }
.hub-styles-history li > span { margin-left: 6px; }
@media (max-width: 820px) {
    .hub-styles-edit { grid-template-columns: minmax(0, 1fr); }
    .hub-styles-live { position: static; order: -1; width: 100%; max-width: 300px; margin: 0 auto; }
}
@media (max-width: 600px) {
    .hub-styles-grid { grid-template-columns: minmax(0, 1fr); }
    .hub-styles-tile { grid-template-columns: 72px minmax(0, 1fr); }
    .hub-styles-thumb { width: 72px; }
    .hub-styles-row > .hub-check { flex-basis: 100%; }
}

/* A section's title with its one action beside it, such as Client portal's Invite a contact. */
.hub-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.hub-section-head .hub-h2 { margin: 0; }
.hub-actions-cell { white-space: nowrap; text-align: right; }
.hub-actions-cell > * + * { margin-left: var(--space-2); }
.hub-portal-link { margin-bottom: var(--space-4); }

/* A monthly report (Reports): parts the project manager left out show dimmed while editing. */
.hub-report { display: grid; gap: var(--space-4); }
.hub-report-note { margin: 0; white-space: pre-wrap; }
.hub-report-part { margin-top: var(--space-4); }
.hub-report-out { opacity: 0.5; }
.hub-report-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }

/* Your profile's enrolment code: the code and its one command, set apart from the workers listed under it. */
.hub-worker-code { margin: var(--space-3) 0 var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.hub-worker-code p { margin: 0; }
.hub-worker-code .hub-copy { margin-bottom: var(--space-3); }
.hub-worker-code .hub-copy:last-child { margin-bottom: 0; }

/* ==== The finish: depth, motion and icons, laid over everything above. =====================================================
   It uses only the tokens, so an agency's palette colours all of it. Every movement here is switched off at the end for
   people who ask for reduced motion. */

html { scrollbar-color: var(--fill-strong) transparent; }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }
a { transition: color 0.12s; }
.hub-h1, .hub-h2, .hub-client-name { text-wrap: balance; }
.hub-sub, .hub-hint, .hub-note { text-wrap: pretty; }

/* The page: a soft wash of the brand colour behind the top of it, so a page doesn't start on a flat sheet. */
.hub-main { background: radial-gradient(900px 300px at 28% -90px, color-mix(in srgb, var(--brand) 9%, transparent), transparent 72%) no-repeat; }
.hub-h1 { letter-spacing: -0.035em; }

/* The sidebar: a little light at the top, an icon per page, and the current page lit in the accent. */
.hub-sidebar { gap: var(--space-5); background: linear-gradient(180deg, var(--night-mid), var(--night) 45%); box-shadow: inset -1px 0 0 color-mix(in srgb, var(--on-night) 9%, transparent); }
.hub-nav-group a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; transition: background-color 0.15s, color 0.15s; }
.hub-nav-group a::before, .hub-nav-group a.active::before {
    content: ""; position: static; flex: none; width: 18px; height: 18px; border-radius: 0; background: currentColor; opacity: 0.7;
    -webkit-mask: var(--icon) center / 18px 18px no-repeat; mask: var(--icon) center / 18px 18px no-repeat; transition: opacity 0.15s, transform 0.2s var(--ease);
}
.hub-nav-group a { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6z'/%3E%3C/svg%3E"); }
.hub-nav-group a[href=""] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="clients"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 20v-1.5a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4V20'/%3E%3Cpath d='M9.5 10.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z'/%3E%3Cpath d='M21 20v-1.5a4 4 0 0 0-3-3.85'/%3E%3Cpath d='M15.5 3.7a3.5 3.5 0 0 1 0 6.6'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="board"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h4v14H4z'/%3E%3Cpath d='M10 4h4v9h-4z'/%3E%3Cpath d='M16 4h4v12h-4z'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="approvals"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z'/%3E%3Cpath d='M8.5 12.5l2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="brand"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3s6 6.2 6 10.5a6 6 0 0 1-12 0C6 9.2 12 3 12 3z'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="packages"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8l-9-5-9 5v8l9 5 9-5z'/%3E%3Cpath d='M3 8l9 5 9-5'/%3E%3Cpath d='M12 13v8'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="performance"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 15l4-5 3 3 5-7'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="winners"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.7 5.6 6.1.8-4.5 4.3 1.1 6.1L12 16.9 6.6 19.8l1.1-6.1L3.2 9.4l6.1-.8z'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="summary"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h7v7H4z'/%3E%3Cpath d='M13 4h7v4h-7z'/%3E%3Cpath d='M13 11h7v9h-7z'/%3E%3Cpath d='M4 14h7v6H4z'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="reports"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="calendar"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2z'/%3E%3Cpath d='M3 10h18'/%3E%3Cpath d='M8 3v4'/%3E%3Cpath d='M16 3v4'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="jobs"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h4l3-8 4 16 3-8h4'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="people"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 3v6c0 4.5-3.2 8-8 9-4.8-1-8-4.5-8-9V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="agency"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h9'/%3E%3Cpath d='M17 6h3'/%3E%3Cpath d='M4 12h3'/%3E%3Cpath d='M11 12h9'/%3E%3Cpath d='M4 18h11'/%3E%3Cpath d='M19 18h1'/%3E%3Cpath d='M15 4v4'/%3E%3Cpath d='M9 10v4'/%3E%3Cpath d='M17 16v4'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="connections"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1'/%3E%3Cpath d='M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="audit"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.hub-nav-group a[href="sync"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 0 0-14.3-4.3L4 8.5'/%3E%3Cpath d='M4 4v4.5h4.5'/%3E%3Cpath d='M4 13a8 8 0 0 0 14.3 4.3L20 15.5'/%3E%3Cpath d='M20 20v-4.5h-4.5'/%3E%3C/svg%3E"); }
.hub-nav-group a:hover::before { opacity: 1; transform: scale(1.08); }
.hub-nav-group a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, var(--night-active)), var(--night-active)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-night) 10%, transparent); }
.hub-nav-group a.active::before { opacity: 1; background: var(--on-night-strong); }
/* Who is signed in: their initial, their name and Sign out, as one block at the foot. */
.hub-sidebar { padding-bottom: 0; }
.hub-nav-group a { padding-block: 7px; }
/* It stays in view at the foot of the sidebar however many pages are listed above it. */
.hub-sidebar-foot { position: sticky; bottom: 0; z-index: 1; flex-direction: row; align-items: center; gap: 10px; margin: auto calc(-1 * var(--space-3)) 0; padding: 12px 20px 14px; background: var(--night); border-top-color: color-mix(in srgb, var(--on-night) 10%, transparent); }
.hub-sidebar-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hub-avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, var(--night-active)), var(--night-active)); color: var(--on-night-strong); font: 700 13px/1 var(--font-heading); text-transform: uppercase; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-night) 16%, transparent); }
@media (max-width: 1023px) {
    .hub-topbar { background: color-mix(in srgb, var(--night) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
    /* The open menu fills the screen under the top bar and scrolls inside itself, so its first and last lines are never cut. */
    .hub-sidebar { align-self: stretch; }
    .menu-open .hub-sidebar { animation: hub-drop 0.18s var(--ease); }
}

/* Cards sit a little above the page, on a softer edge. */
.hub-card { border-color: color-mix(in srgb, var(--border) 75%, transparent); box-shadow: var(--shadow-sm); }
.hub-card .hub-card { box-shadow: none; }
.hub-empty { align-items: center; max-width: none; padding: var(--space-6) var(--space-5); text-align: center; border: 1px dashed var(--border-mid); background: color-mix(in srgb, var(--surface-alt) 55%, var(--surface)); box-shadow: none; }
.hub-card:not(.hub-empty) .hub-empty { border-radius: var(--radius); }

/* Buttons: the main one has a little shine and lifts under the pointer; the others answer more quietly. */
.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid { transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s var(--ease); }
.hub-btn { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 90%, #fff), var(--brand)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px color-mix(in srgb, var(--brand-strong) 45%, transparent); }
.hub-btn:hover:not(:disabled) { background: var(--brand-strong); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 14px -4px color-mix(in srgb, var(--brand-strong) 55%, transparent); transform: translateY(-1px); }
.hub-btn-secondary, .hub-btn-danger { box-shadow: var(--shadow-sm); }
.hub-btn-secondary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.hub-btn-danger-solid { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px color-mix(in srgb, var(--danger-strong) 45%, transparent); }
:is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid):disabled { box-shadow: none; }
:is(.hub-btn, .hub-btn-secondary, .hub-btn-quiet, .hub-btn-danger, .hub-btn-danger-solid):active:not(:disabled) { transform: translateY(0) scale(0.97); }

/* Fields: a soft ring on focus, and the hub's own arrow on a dropdown in place of the browser's. */
.hub-field input, .hub-field select, .hub-field textarea, .hub-grid select, .hub-table input[type="text"] { transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s; }
.hub-field :is(input, select, textarea):focus, .hub-grid select:focus, .hub-table input[type="text"]:focus { box-shadow: 0 0 0 4px var(--ring); }
.hub-field select, .hub-grid select { -webkit-appearance: none; appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23647084' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; cursor: pointer; }
.hub-field select:disabled { background-image: none; cursor: default; }
.hub-grid select { padding-right: 28px; background-position: right 9px center; }
.hub-check input, .hub-table input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; }
.hub-client-switch-button { border-color: var(--border-mid); border-radius: var(--radius-pill); padding-left: 16px; box-shadow: var(--shadow-sm); transition: border-color 0.15s, box-shadow 0.15s; }
.hub-client-switch-button:hover { box-shadow: var(--shadow-md); }

/* Tabs: the line under the current tab grows from its middle, and a tab under the pointer gets a soft ground. */
.hub-client-tab, .hub-tab, .hub-client-more-button { position: relative; border-radius: var(--radius-sm) var(--radius-sm) 0 0; transition: color 0.15s, background-color 0.15s; }
.hub-client-tab:hover, .hub-tab:hover, .hub-client-more-button:hover, .hub-client-more-button[aria-expanded="true"] { border-bottom-color: transparent; background: color-mix(in srgb, var(--fill) 50%, transparent); }
.hub-client-tab[aria-current="page"], .hub-tab[aria-selected="true"], .hub-tab[aria-current="page"] { border-bottom-color: transparent; }
.hub-client-tab::after, .hub-tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); transform: scaleX(0); opacity: 0; transition: transform 0.25s var(--ease), opacity 0.15s; }
.hub-client-tab[aria-current="page"]::after, .hub-tab[aria-selected="true"]::after, .hub-tab[aria-current="page"]::after { transform: scaleX(1); opacity: 1; }
.hub-skel-tabs .hub-tab::after { display: none; }

/* A client's pages in two rows: the five groups as the main tabs, and under them the current group's own pages as pills.
   A group of one page has no second row. */
.hub-client-groups { display: flex; gap: 2px; overflow-x: auto; overscroll-behavior-x: contain; box-shadow: inset 0 -1px 0 var(--fill); scrollbar-width: none; }
.hub-client-groups::-webkit-scrollbar { display: none; }
.hub-client-group { position: relative; flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; color: var(--text-muted); font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: color 0.15s, background-color 0.15s; }
.hub-client-group:hover { color: var(--heading); background: color-mix(in srgb, var(--fill) 50%, transparent); }
.hub-client-group[aria-current] { color: var(--heading); }
.hub-client-group::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); transform: scaleX(0); opacity: 0; transition: transform 0.25s var(--ease), opacity 0.15s; }
.hub-client-group[aria-current]::after { transform: scaleX(1); opacity: 1; }
.hub-client-group:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.hub-client-nav { margin-top: var(--space-3); box-shadow: none; }
.hub-client-nav[hidden], .hub-client-tab[hidden] { display: none; }
.hub-client-nav .hub-client-tabs { gap: 6px; box-shadow: none; }
.hub-client-nav .hub-client-tab, .hub-client-nav .hub-client-more-button { min-height: 34px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius-pill); font-size: 13.5px; }
.hub-client-nav .hub-client-tab:hover, .hub-client-nav .hub-client-more-button:hover { border-color: transparent; background: var(--fill); }
.hub-client-nav .hub-client-tab[aria-current="page"] { border-color: color-mix(in srgb, var(--brand) 30%, transparent); background: var(--brand-soft); color: var(--heading); }
.hub-client-nav .hub-client-tab::after { display: none; }
.hub-client-nav .hub-client-tab:focus-visible { outline-offset: 2px; border-radius: var(--radius-pill); }
@media (max-width: 1023px) {
    .hub-client-groups { margin: 0 -16px; padding: 0 16px; }
}
@media (pointer: coarse) {
    .hub-client-nav .hub-client-tab { min-height: 40px; }
}

/* Small parts: a status that is waiting breathes; progress has a rounded, graded bar. */
.hub-status { padding: 3px 10px 3px 9px; }
.hub-status.wait::before { animation: hub-breathe 1.8s ease-in-out infinite; }
.hub-chip { border-radius: 6px; }
.hub-tag { border-radius: 5px; }
.hub-progress { height: 8px; border-radius: var(--radius-pill); }
.hub-progress i { border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--brand-mid), var(--brand)); transition: width 0.4s var(--ease); }
.hub-error, .hub-ok, .hub-info { border-radius: var(--radius-sm); }
.hub-error { box-shadow: inset 3px 0 0 var(--danger); }
.hub-ok { box-shadow: inset 3px 0 0 var(--success); animation: hub-rise 0.25s var(--ease); }
.hub-table tbody tr td { transition: background-color 0.12s; }
.hub-guide-btn, .hub-menu-btn, .hub-dialog-close { transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s var(--ease); }
.hub-dialog-close:hover { transform: rotate(90deg); }

/* The board: each stage has its own colour along the top of its column, and a card lifts as you reach for it. */
.hub-board { gap: var(--space-4); }
.hub-column { border: 1px solid var(--border-soft); border-top: 3px solid var(--fill-strong); background: color-mix(in srgb, var(--surface-alt) 75%, var(--bg)); }
.hub-column:nth-child(2) { border-top-color: var(--info); }
.hub-column:nth-child(3) { border-top-color: var(--success); }
.hub-column:nth-child(4) { border-top-color: var(--brand); }
.hub-count { padding: 1px 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.hub-tile { border-radius: 10px; transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s var(--ease); }
.hub-tile:hover { transform: translateY(-2px); }
.hub-tile:active { transform: translateY(0) scale(0.99); box-shadow: var(--shadow-sm); }
.hub-chain li.now::before { animation: hub-ring 2s ease-out infinite; }

/* Popups rise into place over a blurred page; menus and lists drop from their button. */
.hub-dlg[open] { animation: hub-pop 0.24s var(--ease); }
.hub-dlg::backdrop { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: hub-fade 0.2s ease-out; }
.hub-dlg-foot { background: color-mix(in srgb, var(--surface-alt) 60%, var(--surface)); }
.hub-menu-list, .hub-client-list, .hub-client-more-list { border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--text) 4%, transparent); transform-origin: top right; animation: hub-drop 0.16s var(--ease); }
.hub-menu-wrap.up .hub-menu-list { transform-origin: bottom right; }
.hub-menu-list { padding: 6px; }
.hub-menu-item { border-radius: 6px; transition: background-color 0.12s; }

/* Sign-in: the brand's colours glow behind the card, which rises in. */
.hub-account { background:
    radial-gradient(820px 480px at 12% -8%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 62%),
    radial-gradient(760px 520px at 100% 108%, color-mix(in srgb, var(--brand-mid) 30%, transparent), transparent 62%),
    var(--night); }
.hub-account-card { border-radius: 20px; animation: hub-pop 0.4s var(--ease); }

/* Loading: a light passes over the grey blocks. */
.hub-skel, .hub-skel-word { background: linear-gradient(90deg, var(--fill) 20%, color-mix(in srgb, var(--fill) 45%, var(--surface)) 50%, var(--fill) 80%) 0 0 / 200% 100%; animation: hub-shimmer 1.5s linear 300ms infinite; }

@keyframes hub-pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes hub-fade { from { opacity: 0; } }
@keyframes hub-drop { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
@keyframes hub-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes hub-breathe { 50% { opacity: 0.3; transform: scale(0.8); } }
@keyframes hub-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--info) 45%, transparent); } to { box-shadow: 0 0 0 9px transparent; } }
@keyframes hub-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    .hub-dlg[open], .hub-dlg::backdrop, .hub-menu-list, .hub-client-list, .hub-client-more-list, .hub-account-card, .hub-ok,
    .hub-status.wait::before, .hub-chain li.now::before, .hub-skel, .hub-skel-word, .menu-open .hub-sidebar { animation: none; }
    .hub-btn:hover:not(:disabled), .hub-btn-secondary:hover:not(:disabled), .hub-tile:hover, .hub-tile:active,
    .hub-nav-group a:hover::before, .hub-dialog-close:hover { transform: none; }
    .hub-client-tab::after, .hub-client-group::after, .hub-tab::after, .hub-progress i { transition: none; }
}
