/*
 * Surfaces, the way round the design has them: the working area is the light one and the rail
 * beside it is sunken.
 *
 * It used to be the other way — a grey page with a white sidebar — which made the sidebar the
 * brightest thing on screen and every card on the page a white block floating on grey. Reading
 * matter belongs on the lighter surface; navigation is furniture and can recede.
 *
 * Tokenised rather than the hardcoded rgb(243,243,243) this replaced, so dark mode is the same
 * two rules with the tokens swapped rather than a third set of colours.
 */
body {
    background-color: var(--surface);
}

/* !important because the theme paints the rail with a .bg-white utility, which carries one. */
#sidebar {
    background-color: var(--surface-sunken) !important;
}

/*
 * With the page itself white, a white card no longer has an edge. The design gives every panel a
 * hairline for exactly this reason; the theme's cards were relying on the grey behind them.
 */
.card {
    border: 1px solid var(--hairline);
}

main {
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 20px;
    min-height: calc(100vh - 50px);
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

footer {
    margin-top: 20px;
    display: none;
    height: auto;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6, p {
    -webkit-font-smoothing: antialiased;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-weight: 600;
    letter-spacing: -.01em;
}

p {
    font-weight: 400;
}

/*
 * Brand tokens.
 *
 * Every accent on the node derives from --brand, which the page overrides per reseller from their
 * configured colour. It used to be #1B9CE5 written out in the stylesheet, three templates and the
 * chart scripts, so "white label" stopped at the wordmark and every reseller's customers saw Talos
 * blue under someone else's name.
 *
 * --brand-deep is derived rather than configured: asking a reseller for two colours that have to
 * relate correctly is asking them to do a designer's job. colour-mix darkens whatever they pick.
 */
:root {
    --brand: #1b9ce5;
    --brand-deep: color-mix(in srgb, var(--brand) 70%, #000);
    /* Brand-as-text. Computed server-side against each surface — see SettingsAdmin#getBrandInk.
       These fallbacks only apply if the inline per-node <style> is missing. */
    --brand-ink: var(--brand);
    --brand-ink-dark: var(--brand);
    /* The focus ring's translucent halo. The theme hardcodes rgba(92, 96, 245, .25) — its own
       indigo — in fourteen places rather than deriving it, so none of it followed the brand. */
    --brand-glow: color-mix(in srgb, var(--brand) 25%, transparent);
    --brand-contrast: #fff;

    --surface: #fff;
    --surface-sunken: #f8f9fa;
    --ink: #16192c;
    --ink-muted: #5a6577;
    --hairline: rgba(0, 0, 0, .08);
    --hairline-strong: rgba(0, 0, 0, .15);

    --ok: #0e7a4f;
    --warn: #9a5b00;
    --danger: #b42318;

    /* The whole type scale. Anything between two steps is one of them. */
    --text-2xs: 11px;
    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 14px;
    --text-md: 16px;
    --text-lg: 18px;
    --text-xl: 24px;
    --text-2xl: 28px;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    --control-height: 38px;
    --shadow-pop: 0 12px 32px rgba(16, 20, 35, .16);
}

/*
 * Typography.
 *
 * Self-hosted rather than loaded from Google's CDN: a third-party request on every page is a
 * first-paint dependency we do not control and a GDPR exposure for EU customers.
 *
 * Public Sans ships as one variable file. It was first added as four — 400, 500, 600 and 700 —
 * which turned out to be byte-identical copies of that same file under four names, because the
 * CDN answers every weight request with the variable font. Three of the four could never be
 * matched by a selector and were 78 KB of dead weight in the artifact.
 *
 * Lives here beside the colour tokens rather than in a page stylesheet: a token declared on :root
 * inside a sheet only one page links is global in scope and conditional in existence, which is the
 * kind of thing that gets copied into the next page's sheet instead of shared.
 */
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/public-sans.woff2') format('woff2-variations'),
         url('/fonts/public-sans.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-400.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-600.woff2') format('woff2');
}

/* One family for everything the product says; mono is kept for code and nothing else. */
:root {
    --font-sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: var(--font-sans);
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --x-font-sans-serif: var(--font-sans);
    --x-font-display: var(--font-sans);
    --x-body-font-family: var(--font-sans);
    --x-body-font-size: var(--text-base);
    --x-body-line-height: 1.55;
    --x-body-color: var(--ink-muted);
}

/* Tabular numerals, so a column of figures lines up on the digit. */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Small uppercase label above a section. Sets a heading apart without another font size. */
.eyebrow {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

/*
 * A real dark palette, not an inversion.
 *
 * This was `filter: invert(100%)` on the whole page. That inverted meaning along with colour: the
 * customer's avatar and every stored company logo rendered as photographic negatives, the
 * destructive "Stop" button turned green, and the brand blue turned orange. Any new saturated
 * element or image inherited the same bug, so it could not survive a redesign either.
 */
.dark-mode {
    --brand-ink: var(--brand-ink-dark);
    --surface: #1c1f26;
    --surface-sunken: #15171d;
    --ink: #e7e9ee;
    --ink-muted: #98a1b3;
    --hairline: rgba(255, 255, 255, .1);
    --hairline-strong: rgba(255, 255, 255, .2);
    --ok: #3ddc97;
    --warn: #ffca7a;
    --danger: #ff9d94;

    /* The page, not the rail — same relationship as the light theme. */
    background-color: var(--surface);
    color: var(--ink);
}

.dark-mode .card,
.dark-mode .modal {
    background-color: var(--surface);
    color: var(--ink);
    border-color: var(--hairline);
}

.dark-mode .navbar {
    background-color: var(--surface) !important;
    border-color: var(--hairline) !important;
}

/* Same relationship as the light theme: the rail is the sunken surface, the page is the lighter. */
.dark-mode #sidebar {
    background-color: var(--surface-sunken) !important;
    border-color: var(--hairline) !important;
}


.dark-mode .text-muted,
.dark-mode .text-sm {
    color: var(--ink-muted) !important;
}

.dark-mode .table > :not(caption) > * > * {
    background-color: var(--surface);
    color: var(--ink);
}

/*
 * The theme's own text colours, which are dark and not token-driven. The old whole-page invert
 * flipped these for free, which is why removing it left 21 element styles below 4.5:1 — headings,
 * nav links and the follower figures all reading dark-on-dark.
 *
 * Excludes the hero: it paints its own background and sets its own contrast colour.
 */
.dark-mode :where(h1, h2, h3, h4, h5, h6, p, span, li, td, th, label, dt, dd) {
    color: var(--ink);
}

/*
 * Anything painting its own ground owns the ink on it, descendants included. The rule above is
 * :where(), so it carries no specificity and a component's own colour already beats it — but a
 * bare <span> inside a button or a pill has no colour of its own and would take the page's ink
 * on a brand ground. Inheriting from the painted parent is what it did before.
 *
 * This replaced a :not() chain on the rule above, which needed two terms per component and had to
 * be edited from a distance every time a painted one was added.
 */
.dark-mode :is(.btn, .badge, .alert, .status-pill, .chip-brand) * {
    color: inherit;
}

/*
 * Alerts keep their own colours. They are deliberately light callouts — the action band's amber
 * is carrying meaning — so recolouring only their text put light ink on a cream ground at
 * 1.12:1. Same trap as the company chips: anything painting its own background has to be left
 * alone or recoloured as a pair, never re-inked on its own.
 */
/*
 * Dark mode gets a dark amber rather than the light one. Keeping the cream ground was readable but
 * put a full-width bright slab across a dark dashboard — the band is meant to draw the eye, not to
 * be the brightest thing on the page. Same hue, inverted ground, so it still reads as a warning.
 */
.dark-mode .alert-warning {
    background-color: #33260f;
    border-color: #5c451f;
    color: #ffca7a;
}

/*
 * Anything painting its own background has to be recoloured, not just re-inked. The company chips
 * carry Bootstrap's bg-light, so inheriting the dark theme's light text put light on light —
 * 1.21:1, the worst contrast on the page and worse than before the theme existed.
 */
/*
 * Bootstrap's bg-* utilities are literal colours, not tokens, so they stay light in dark mode and
 * put light text on a white ground. The footer strip is the one on every page; the chips below
 * are the other. Both are recoloured rather than re-inked — the text was already correct.
 */
.dark-mode .bg-light {
    background-color: var(--surface-sunken) !important;
    color: var(--ink) !important;
}

.dark-mode :is(.text-muted, .text-sm, small, .form-text):not(.reach-hero *):not(.alert *) {
    color: var(--ink-muted) !important;
}

/* Secondary text inside an alert, muted against the alert's own ground rather than the page's. */
.dark-mode .alert-warning :is(.text-muted, .text-sm, small) {
    color: #d9a94f !important;
}

/*
 * Scoped to the sidebar, and without !important.
 *
 * Unscoped it also claimed the carousel's pill tabs, and the !important beat the rule that gives
 * a brand-filled pill its readable text — putting light ink on a light brand colour at 1.22:1.
 * The id carries enough specificity on its own to beat the theme's .nav-link.
 */
.dark-mode #sidebar .navbar-brand,
.dark-mode #sidebar .nav-link {
    color: var(--ink);
}

/* Tabs and pills elsewhere. Lower specificity than the active/filled rules, so a selected pill
   keeps its derived contrast while its unselected siblings stay legible. */
.dark-mode .nav-link {
    color: var(--ink-muted);
}

.dark-mode a:not(.btn):not(.nav-link):not(.navbar-brand):not(.reach-hero *) {
    color: var(--brand-ink);
}

.dark-mode :is(.form-control, .form-select) {
    background-color: var(--surface-sunken);
    color: var(--ink);
    border-color: var(--hairline);
}

/*
 * The hero's own text, which the theme's heading colour was overriding — including the headline
 * number, the single largest thing on the page, which measured 1.03:1 against its own gradient in
 * both themes. The band sets a contrast colour; everything inside it has to actually use it.
 */
.reach-hero :is(h1, h2, h3, h4, p, span, strong, a) {
    color: var(--brand-contrast);
}

.reach-hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: var(--brand-contrast);
}

.reach-hero-eyebrow {
    font-size: var(--text-md);
    opacity: .85;
}

.reach-hero-number {
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 1;
    /* The digits are animated, so proportional figures would make the number jitter. */
    font-variant-numeric: tabular-nums;
}

.reach-hero-lead {
    font-size: var(--text-lg);
    opacity: .95;
}

.reach-hero-projection {
    font-size: var(--text-lg);
}

.reach-hero-footnote {
    font-size: var(--text-sm);
    opacity: .75;
    max-width: 70ch;
}

@media (max-width: 575px) {
    .reach-hero-number {
        font-size: 2.25rem;
    }
}

table {
    background-color: rgb(255, 255, 255);
}

.alert {
    width: 100%;
    text-align: center;
    z-index: 2;
}

.card-title {
    margin-top: 10px;
}

/*
 * The floor is what decides how many fit per row, and this panel is no longer full width — it
 * shares a row with the status card, giving it 552px. At the old 190px each tile claimed 219px
 * once padding and margin were counted, so three needed 657px and the third wrapped onto its own
 * line at 1440. 150px lets three fit with room to spare, and .col still grows them to fill
 * whatever space there is on wider screens and on the trial-expired page, where this runs alone.
 */
.card-followed {
    border: 1px solid var(--hairline);
    margin-right: 5px;
    min-width: 150px;
}

.multi-selected {
    background-color: var(--brand) !important;
}

.icon-followed {
    font-size: 3vw;
    color: #247c27;
}

.nav-link {
    font-weight: bold;
}

@media (max-width: 767px) {
    li.paginate_button.previous {
        display: inline !important;
    }

    li.paginate_button.next {
        display: inline !important;
    }

    li.paginate_button {
        display: none;
    }
}

.limited-table:after {
    z-index: 10;
    content: '';
    position: absolute;
    left: 0px;
    right: 0px;
    height: 200px;
    bottom: 0px;
    background: linear-gradient(180deg, rgba(139, 167, 32, 0) 0%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

.form-control.select-input.placeholder-active {
    background-color: rgba(255, 255, 255, 0);
}



/* Hashtag chips are links dressed as badges, so nothing about them says "clickable" until the
   pointer is on one. Bootstrap's .text-dark sets colour with !important, hence the override. */
/* Holds each chart's height so the two sit level regardless of their axis label widths. */
.reach-chart-frame {
    position: relative;
    /* A definite height: the chart fills this rather than deriving its own from a ratio. */
    height: 260px;
}

@media (max-width: 991.98px) {
    .reach-chart-frame {
        height: 230px;
    }
}

@media (max-width: 575.98px) {
    .reach-chart-frame {
        height: 200px;
    }
}

/* These panels cap their width so a line of text never runs the full width of an ultrawide
   monitor. Left-aligned inside a much wider column that left a growing band of dead space to
   their right — 619px at 2560 — so they centre instead. Applied to every capped panel rather
   than one, or the centred card's left edge would no longer line up with the cards above it. */
.dashboard-panel {
    margin: auto;
    min-width: 300px;
    max-width: 1720px;
}

/* Names each half of the pair. Deliberately quiet — the card already carries a heading, and a
   second bold title under it would read as two sections rather than one split in two. Outside
   the canvas rather than as a Chart.js title so both charts keep an identical plot area. */
/* Lets a panel's card grow to whatever it shares a row with.
   h-100 on the card cannot do this: the panel's height comes from the row's flex stretch, so its
   CSS height is still `auto`, and a percentage height resolves against that rather than against
   the 415px the panel actually occupies. Making the panel a flex column gives the card a real
   box to grow into. Scoped to the panels that share a row, not applied to every panel. */
.dashboard-panel-fill {
    display: flex;
    flex-direction: column;
}

.dashboard-panel-fill > .card {
    flex: 1 1 auto;
}

/*
 * The theme's own primary, re-pointed at the brand token.
 *
 * main.css defines --x-primary in :root and then writes #1b9ce5 as a literal in 39 rules rather
 * than using it, so overriding the variable alone changes nothing. These are those rules: links,
 * buttons, focus rings, checkboxes, tabs, pagination, popovers and the date picker. Without them
 * a reseller who picks lime green still gets a blue "Save" button and blue links on every form.
 *
 * Kept as one block, matching the theme's own selectors, so the next theme update is a diff
 * against a single list rather than a hunt.
 */
:root {
    --x-primary: var(--brand);
    --x-indigo-500: var(--brand);
}

a,
.btn-link,
.dropdown-group:hover .dropdown-heading,
.nav-link:focus,
.nav-link:hover,
.navbar-vertical.navbar-light .navbar-nav .nav-link i,
.navbar-vertical.navbar-light .navbar-nav .nav-link svg,
.pagination-tabs .page-link:hover,
.flatpickr-day.today {
    color: var(--brand-ink);
}

.btn-primary,
.btn-primary.disabled,
.btn-primary:disabled,
.btn-outline-primary:hover,
.btn-check:active + .btn-outline-primary,
.btn-check:checked + .btn-outline-primary,
.form-check-input:checked,
.form-check-input[type=checkbox]:indeterminate,
.nav-pills .nav-link.active,
.page-item.active .page-link,
.modal-primary .modal-content,
.popover-primary,
.popover-primary .popover-header,
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background-color: var(--brand);
    border-color: var(--brand);
}

/*
 * One rule each, never in the list above: a vendor pseudo-element the browser does not recognise
 * invalidates the whole comma-separated rule it appears in. ::-moz-range-thumb took the entire
 * button, checkbox and tab block with it in Chrome, which is why none of them followed the brand.
 */
.form-range::-webkit-slider-thumb {
    background-color: var(--brand);
}

.form-range::-moz-range-thumb {
    background-color: var(--brand);
}

.btn-outline-primary,
.btn-outline-primary.disabled,
.btn-outline-primary:disabled {
    color: var(--brand-ink);
    border-color: var(--brand);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control,
.form-item-check:checked + .form-item .form-item-click,
.form-item-check:hover + .form-item .form-item-click,
.pagination-tabs .page-item.active .page-link {
    border-color: var(--brand);
}

.nav-tabs .nav-item.show .nav-link,
.nav-tabs .nav-link.active,
.card-header-tabs .nav-link.active {
    color: var(--brand-ink);
    border-bottom-color: var(--brand);
}

/* Hover, focus and active use the theme's deeper blue; without these a brand-coloured button
   reverts to blue the moment the pointer touches it. */
.btn-check:focus + .btn-primary,
.btn-primary:focus,
.btn-primary:hover,
.btn-check:active + .btn-primary,
.btn-check:checked + .btn-primary,
.btn-primary:active {
    background-color: var(--brand-deep);
    border-color: var(--brand-deep);
}

/*
 * FontAwesome's script replaces every <i> with an <svg class="svg-inline--fa">, so any theme rule
 * written for `i` stops matching the moment the icons load — including the sidebar icon colour.
 * The svg inherits `currentColor` from its link instead, which is how the product blue survived
 * everywhere else being re-pointed at the brand.
 */
.svg-inline--fa {
    color: inherit;
}

/*
 * The last one the sweep found.
 *
 * The range buttons carry Bootstrap's plain .active rather than a :checked sibling, so the
 * btn-check selectors above never reached them.
 */
.btn-outline-primary.active,
.btn-outline-primary:active {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}


/* Text on brand-filled surfaces, derived from the brand's luminance rather than assumed white.
   A light brand colour otherwise gave white-on-light buttons across every form. */
.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-outline-primary:hover,
.btn-outline-primary.active,
.nav-pills .nav-link.active,
.page-item.active .page-link {
    color: var(--brand-contrast);
}

/*
 * DataTables and pagination in dark mode.
 *
 * Both ship their own light colours and neither reads the theme, so the liked-posts table kept
 * black headers and cells on a dark surface — 1.21:1 — and pagination links were invisible.
 * Scoped to .dark-mode so light mode keeps the vendors' own styling untouched.
 */
.dark-mode :is(table.dataTable, table.dataTable td, table.dataTable th),
.dark-mode :is(.dataTables_wrapper, .dataTables_info, .dataTables_length, .dataTables_filter) {
    color: var(--ink);
}

.dark-mode table.dataTable :is(thead th, thead td, tbody td, tbody th) {
    background-color: var(--surface);
    border-color: var(--hairline);
}

.dark-mode table.dataTable tbody tr:hover > * {
    background-color: var(--surface-sunken);
}

.dark-mode :is(.dataTables_wrapper .dataTables_paginate .paginate_button, .page-link) {
    background-color: var(--surface);
    color: var(--ink) !important;
    border-color: var(--hairline);
}

.dark-mode :is(.page-item.active .page-link, .dataTables_wrapper .dataTables_paginate .paginate_button.current) {
    background-color: var(--brand);
    color: var(--brand-contrast) !important;
    border-color: var(--brand);
}

.dark-mode :is(.dataTables_filter input, .dataTables_length select) {
    background-color: var(--surface-sunken);
    color: var(--ink);
    border-color: var(--hairline);
}

/* Unfilled tab strips take the brand as their active colour; filled pills take the derived
   contrast, which the brand-fill rules above already give them. */
.dark-mode .nav-tabs .nav-link.active,
.dark-mode .card-header-tabs .nav-link.active {
    color: var(--brand-ink);
}

/*
 * Bootstrap's .badge sets a background but never a colour, so a badge has always taken whatever
 * text colour it inherited — dark ink on #198754 at 3.0:1 in light mode, and worse once dark mode
 * gave it a different parent. The background is the thing that has to be read against, so pair
 * each one with its own contrast rather than letting the page decide.
 */
.badge:is(.bg-danger, .bg-secondary, .bg-dark),
.dark-mode .badge:is(.bg-danger, .bg-secondary, .bg-dark) {
    color: #fff;
}

/*
 * .bg-success is this product's own mint (#00cc88), not Bootstrap's darker #198754, and it is far
 * too light to carry white text — that pairing read at 2.1:1. Grouped by what the colour actually
 * is rather than by what the class is called.
 */
.badge:is(.bg-warning, .bg-info, .bg-light, .bg-success),
.dark-mode .badge:is(.bg-warning, .bg-info, .bg-light, .bg-success) {
    color: #16192c;
}

/* The brand-filled badge follows the reseller's colour, so it needs the matching contrast. */
.badge.bg-primary,
.dark-mode .badge.bg-primary {
    background-color: var(--brand) !important;
    color: var(--brand-contrast);
}

/*
 * Bootstrap's own .text-muted is #6c757d, which reads 4.3:1 on white — just under AA for body
 * text, and this is real copy rather than decoration. Carries !important because Bootstrap's
 * utility does. Same two exclusions as the dark-mode rule: the hero and alerts paint their own
 * ground and have to be muted against that, not against the page.
 */
:is(.text-muted, .form-text):not(.reach-hero *):not(.alert *) {
    color: var(--ink-muted) !important;
}

/*
 * The amber the theme gives .alert-warning (#e67e00) sits on its own #fff4e6 ground at 2.6:1 —
 * the action band's headline is the one line on the dashboard a customer most needs to read.
 * Darkened to the same hue rather than swapped for grey, so the band still reads as a warning.
 */
.alert-warning {
    color: #8a4b00;
}

/*
 * Link hover. The theme hardcodes a:hover to #0074E1, which is the one place the product's blue
 * survived the palette work — the rest-state scan never sees it because it only ever samples an
 * unhovered page.
 *
 * Hover shifts toward the surface's far end rather than to a fixed colour: darker on the light
 * theme, lighter on the dark one. Both directions move away from the background, so a hover can
 * only ever be more readable than the resting link, whatever colour the reseller picked.
 */
a:hover:not(.btn):not(.nav-link):not(.navbar-brand):not(.page-link):not(.reach-hero *),
a:focus:not(.btn):not(.nav-link):not(.navbar-brand):not(.page-link):not(.reach-hero *) {
    color: color-mix(in srgb, var(--brand-ink) 75%, #000);
}

.dark-mode a:hover:not(.btn):not(.nav-link):not(.navbar-brand):not(.page-link):not(.reach-hero *),
.dark-mode a:focus:not(.btn):not(.nav-link):not(.navbar-brand):not(.page-link):not(.reach-hero *) {
    color: color-mix(in srgb, var(--brand-ink) 75%, #fff);
}

/* Icons inside a link follow the link rather than keeping a resting colour under the pointer. */
a:hover:not(.btn):not(.nav-link):not(.navbar-brand):not(.reach-hero *) :is(i, svg, .svg-inline--fa) {
    color: inherit;
}

/*
 * Sidebar hover. The theme answers .navbar-light .navbar-nav .nav-link:hover with a hardcoded
 * #495392, which outranks the plain .nav-link:hover above it — so the most-used hover in the app
 * stayed off-brand while everything around it followed the reseller. Matched at the same depth
 * rather than forced with !important.
 */
.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    color: var(--brand-ink);
}

/* Carries #sidebar because the dark-mode resting colour above does, and an ID outranks any
   number of classes — without it the sidebar is the one place dark mode has no hover at all. */
.dark-mode #sidebar .nav-link:hover,
.dark-mode #sidebar .nav-link:focus,
.dark-mode .navbar-light .navbar-nav .nav-link:hover,
.dark-mode .navbar-light .navbar-nav .nav-link:focus {
    color: var(--brand-ink);
}

/*
 * The sidebar's hover and active rows wash to #f5f9fc, which is near-white — correct on the light
 * theme, a bright bar across a dark sidebar on the other one, and the brand green sat on it at
 * 1.6:1. Dark mode lifts off its own surface instead of painting a light one.
 */
.dark-mode .navbar-vertical.navbar-light .navbar-nav > .nav-item > .nav-link:hover,
.dark-mode .navbar-vertical.navbar-light .navbar-nav > .nav-item > .nav-link.active {
    background-color: rgba(255, 255, 255, .07);
}

/*
 * MDB's searchable select. It drives everything through --mdb-* custom properties, so the whole
 * widget can be re-pointed at the palette by redefining tokens rather than by out-specifying each
 * of its rules.
 *
 * Four of them are hardcoded #3b71ca — MDB's own blue, not the theme's, which is why it survived
 * both the palette work and the blue sweep: they only ever painted a focused control, and a scan
 * of a resting page never focuses anything.
 */
.form-outline,
.select-wrapper {
    --mdb-form-outline-select-notch-border-color: var(--brand);
    --mdb-form-outline-select-label-color: var(--brand-ink);
    --mdb-form-outline-select-input-focused-arrow-color: var(--brand-ink);
    --mdb-form-outline-select-clear-btn-focus-color: var(--brand-ink);
}

/*
 * The dropdown is portalled to the end of <body>, so it inherits .dark-mode but none of the page's
 * card styling — it stayed a white slab, and the broad dark-mode ink rule then re-inked its option
 * labels to near-white on it. Recolouring the ground and the text together, as everywhere else
 * that paints its own background.
 */
.dark-mode .select-dropdown {
    --mdb-form-outline-select-dropdown-bg: var(--surface);
    --mdb-form-outline-select-option-color: var(--ink);
    --mdb-form-outline-select-option-secondary-text-color: var(--ink-muted);
    --mdb-form-outline-select-option-group-label-color: var(--ink-muted);
    --mdb-form-outline-select-option-disabled-color: var(--ink-muted);
    --mdb-form-outline-select-option-hover-not-disabled-bg: rgba(255, 255, 255, .07);
    --mdb-form-outline-select-option-active-bg: rgba(255, 255, 255, .1);
    --mdb-form-outline-select-option-selected-bg: rgba(255, 255, 255, .1);
    --mdb-form-outline-select-option-selected-active-bg: rgba(255, 255, 255, .14);
    background-color: var(--surface);
    border: 1px solid var(--hairline);
}

.dark-mode :is(.select-option-text, .select-no-results, .select-option-group-label) {
    color: var(--ink);
}

.dark-mode .select-no-results {
    color: var(--ink-muted);
}

/*
 * The focus ring, app-wide. Every form control, button and accordion drew a #5c60f5 halo — the
 * single most-seen accent in the product after the buttons themselves, and it stayed indigo on a
 * green node. It only paints while an element has focus, which is why a scan of resting pages
 * never saw it.
 */
:is(.form-control, .form-select, .form-check-input, .accordion-button, .btn-close):focus,
.input-group:focus-within,
.btn:focus,
.btn-check:focus + .btn,
.btn-check:active + .btn:focus,
.btn-check:checked + .btn:focus,
.btn.active:focus,
.btn:active:focus,
.btn-check:focus + .btn-outline-primary,
.btn-outline-primary:focus,
.btn-check:active + .btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary:focus,
.btn-outline-primary.active:focus {
    box-shadow: 0 1px 2px rgba(50, 50, 71, .08), 0 0 0 3px var(--brand-glow);
}

/* Kept apart, one vendor pseudo-element per rule — a browser that does not know one of these
   throws away every selector sharing the rule with it. */
.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--brand-glow);
}

.form-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--brand-glow);
}

.text-highlight-primary {
    background-image: linear-gradient(transparent 66%, color-mix(in srgb, var(--brand) 15%, transparent) 0);
}

/*
 * Bootstrap's unchecked checkbox is a white chip with a black-alpha border — five white squares
 * down the country list in dark mode. The checked state already fills with the brand, so only the
 * empty one needs saying.
 */
.dark-mode .form-check-input:not(:checked) {
    background-color: transparent;
    border-color: rgba(255, 255, 255, .3);
}

/* ---- panels and chips ------------------------------------------------------------------- */

/*
 * A panel is a titled region with its own border, used where a page needs several of them side by
 * side inside one column. Lives here rather than in a page stylesheet because the dashboard round
 * needs the same thing, and the alternative is a second copy under a different name.
 */
.panel {
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
}

.panel-title {
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    margin: 0;
}

.panel-subtitle {
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ink-muted);
    margin: 0;
}

/*
 * Sits directly under a panel's content rather than being pushed to the bottom of a stretched one.
 * Matching a neighbour's height left a void of a couple of hundred pixels between the last row and
 * its own footnote.
 */
.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--hairline);
    padding-top: 12px;
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

/*
 * One pill, three grounds. These began as three rules differing only in background — a hashtag, an
 * active filter and a matched keyword are the same object wearing different paint, and keeping
 * them apart is how two of them end up with different padding a month later.
 */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--ink);
    background: var(--surface-sunken);
    border: 1px solid var(--hairline);
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    white-space: nowrap;
}

/* Raised off the page's own ground, for a chip sitting on a sunken toolbar. */
.chip-raised {
    background: var(--surface);
}

/* Brand-tinted, for a value the page is keyed on. Borderless: the tint is the boundary. */
.chip-brand {
    background: var(--brand-glow);
    border-color: transparent;
}

a.chip:hover,
a.chip:focus {
    border-color: var(--brand);
    color: var(--brand-ink);
}

a.chip-brand:hover,
a.chip-brand:focus {
    border-color: transparent;
    background: color-mix(in srgb, var(--brand) 26%, transparent);
}

.chip-count {
    font-variant-numeric: tabular-nums;
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

a.chip:hover .chip-count,
a.chip:focus .chip-count {
    color: inherit;
}

/* A tick marking a chip we already target, so an "add one of these" hint can exclude it. */
.chip-check {
    font-size: var(--text-2xs);
    color: var(--brand-ink);
}

/* ---- sidebar utility group ---------------------------------------------------------------- */

/*
 * Logging out and switching theme, set apart from the five destinations above them.
 *
 * Separated by a rule rather than by distance: the sidebar is a scrolling column on a short
 * viewport, so anything relying on empty space to read as "not part of the list" loses that
 * distinction exactly when the list is longest.
 */
.sidebar-utility {
    margin: 0 1.5rem 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--hairline);
}

.sidebar-utility .nav-link {
    font-size: var(--text-base);
}

/* ---- page footer -------------------------------------------------------------------------- */

/*
 * A quiet strip, not a panel. It used to be .bg-light with right-aligned italic text, which in dark
 * mode meant a pale band across the bottom of every page and one more surface to keep in step.
 */
.page-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 1.5rem .75rem;
    padding-top: .75rem;
    border-top: 1px solid var(--hairline);
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.page-footer a {
    color: var(--ink-muted);
}

.page-footer a:hover,
.page-footer a:focus {
    color: var(--brand-ink);
}

/* ---- keyword outcomes ------------------------------------------------------------------- */

/* A display rule beats the hidden attribute, so paged-out rows kept their space and the panel
   grew to the full list. Anything with an explicit display needs this said back. */
.kw-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 3px 0;
}

.kw-name {
    width: 168px;
    flex: none;
    font-size: var(--text-base);
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The one row in the ranking that is not a keyword. It reads as its neighbours do — a blue
   underlined link beside plain names would announce itself as the important row, which it is not —
   and only picks up an underline on hover, where the pointer has already asked. */
.kw-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--hairline);
}

.kw-link:hover,
.kw-link:focus-visible {
    color: var(--brand-ink);
    border-bottom-color: currentColor;
}

.kw-track {
    flex: 1;
    height: 10px;
    min-width: 40px;
    border-radius: 3px;
    background: var(--surface-sunken);
    overflow: hidden;
}

.kw-bar {
    height: 100%;
    border-radius: 3px;
    background: var(--brand);
}

.kw-posts {
    width: 74px;
    flex: none;
    text-align: right;
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.kw-reach {
    width: 58px;
    flex: none;
    text-align: right;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink);
}

.kw-delta {
    width: 62px;
    flex: none;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

/* Up is the only direction worth colouring. A fall is stated, not accused. */
.kw-delta-up {
    color: var(--brand-ink);
    font-weight: 600;
}

/* A keyword that found nothing this week. Dimmed rather than hidden — it is the actionable row. */
.kw-row-idle .kw-name,
.kw-row-idle .kw-reach {
    color: var(--ink-muted);
    font-weight: 400;
}

/* Earned its reach under a keyword since removed. Stated, not styled as a warning. */
.kw-retired {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-muted);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: 1px;
}

/* ---- dashboard ----------------------------------------------------------------------------- */

/* The sentence the figure is. Reads as one line with it, so it sits on the same baseline. */
.lede-caption {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--ink);
}

/*
 * The figure a page opens with. Clamped so it does not wrap on a phone, and tabular so it does not
 * jitter if it ever animates.
 */
.lede-figure {
    font-family: var(--font-display);
    font-size: clamp(38px, 6vw, 60px);
    font-weight: 600;
    letter-spacing: -.035em;
    line-height: .95;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.dashboard-stat {
    font-variant-numeric: tabular-nums;
    font-size: var(--text-2xl);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: var(--ink);
    margin: 0;
}

/* The unit sits beside the figure rather than above it, at the weight of the sentence below. */
.dashboard-stat-unit {
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--ink-muted);
}

@media (max-width: 767.98px) {
    /*
     * Same reasoning as the analytics page: on a phone the keyword name and its figure are what is
     * being read, and a 40px track between them communicates nothing while costing the name width.
     */
    .kw-track,
    .kw-posts {
        display: none;
    }

    .kw-name {
        width: auto;
        flex: 1;
        min-width: 0;
    }
}

/* ---- companies ----------------------------------------------------------------------------- */

/* ---- dashboard lede and range switch -------------------------------------------------------- */

/*
 * The lede: how every page opens.
 *
 * An eyebrow naming the window, one figure, the sentence that figure is, and a note under it —
 * with the page's own scope control on the right (the range switch on the dashboard, the export on
 * analytics). Generic because the two pages were drifting: the dashboard's was a bare row and the
 * analytics one a bordered card, which read as two products.
 *
 * Not a card, deliberately. A bordered white box around the largest type on the page makes the
 * number look like a widget rather than the page's argument.
 */
.page-lede {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

/*
 * The note in the lede's right-hand slot.
 *
 * Sunken and hairlined rather than tinted with the accent: the brand colour on this page means a
 * figure the customer earned, and spending it on a housekeeping notice would be the loudest thing
 * above the fold arguing for the least. `flex: none` with a cap keeps it from stretching to meet
 * the headline on a wide monitor, and it drops below the figure on its own once the row wraps.
 */
.lede-note {
    flex: none;
    max-width: 270px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--surface-sunken);
}

.lede-note-text {
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--ink-muted);
}

/*
 * A segmented control, not a button group. Bootstrap's btn-group draws three outlined buttons in
 * the accent, which competes with the primary action elsewhere on the page for something that only
 * changes what a chart is showing. This recedes until you look for it.
 */
.range-switch {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--surface-sunken);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    flex: none;
}

.range-option {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-muted);
    background: none;
    border: 1px solid transparent;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    cursor: pointer;
}

.range-option:hover {
    color: var(--ink);
}

/* The selected window is lifted onto the surface rather than filled with the accent. */
.range-option.is-active {
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border-color: var(--hairline);
}

/* ---- chart panels --------------------------------------------------------------------------- */

/* The window control, sitting on the charts it drives rather than in a card of its own. Right
   aligned so it reads as a setting on the pair below, and wraps to the left edge on narrow screens
   where there is no pair to align to. */
.chart-range-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

@media (max-width: 767.98px) {
    .chart-range-bar {
        justify-content: flex-start;
    }
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.chart-title {
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
    margin: 0;
}

/* The current figure sits with the chart it belongs to, right-aligned against the title. */
.chart-figure {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.chart-figure-value {
    font-variant-numeric: tabular-nums;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--ink);
}

.chart-figure-note {
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

.chart-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

/* Swatches shaped like the marks they stand for: a bar is a block, a series is a line. */
.legend-bar {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--ink-muted);
    opacity: .28;
}

.legend-line {
    width: 14px;
    height: 2.5px;
    border-radius: 2px;
    background: var(--brand-ink);
}

/*
 * The basis, in the same mono the eyebrows use. It says how much of the chart was measured and how
 * much is a projection — the one thing a reader has to know before trusting the right-hand half.
 */
.chart-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

@media (max-width: 991.98px) {
    /* Side by side stops being a comparison once each chart is too narrow to read. */
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .page-lede {
        align-items: flex-start;
    }
}

/* ---- account panel ------------------------------------------------------------------------- */

/*
 * The account and what it needs from you, as one object.
 *
 * A grid whose 1px gap shows the border colour through, rather than two cards side by side: they
 * are two halves of one statement — who this runs as, and what is stopping it — and two separate
 * bordered boxes read as two unrelated panels that happen to be adjacent.
 */
.account-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1px;
    background: var(--hairline);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.account-card,
.attention-card {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    gap: 14px;
}

.account-header {
    height: 92px;
    background-color: var(--surface-sunken);
    background-size: cover;
    background-position: center;
}

/* The avatar laps over the header, the way a profile does everywhere the customer already knows. */
.account-body {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: -30px;
}

.account-avatar-link {
    align-self: flex-start;
    line-height: 0;
}

.account-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 3px solid var(--surface);
    object-fit: cover;
    background: var(--surface-sunken);
}

.account-name {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--ink);
}

.account-headline {
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--ink-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.account-state {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.account-meta {
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--ink-muted);
}

/*
 * Whether it is running, as a state rather than a sentence. The accent fill is doing the work an
 * amber banner used to: it is the one thing on the page a customer checks at a glance.
 */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--brand-glow);
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
}

/* The state arrives as a lower-case phrase from the status endpoint. */
.status-pill > span {
    display: inline-block;
}

.status-pill > span::first-letter {
    text-transform: uppercase;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    flex: none;
}

/*
 * A quiet button: an outline in the hairline, not the accent. Stopping the service and the
 * secondary fixes are not what the page wants you to do, so they do not wear the accent.
 */
.btn-quiet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--control-height);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--hairline-strong);
    padding: 8px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
}

/* Nothing to do, and the control says so rather than accepting a click that changes nothing. */
.btn-quiet:disabled {
    opacity: .45;
    cursor: default;
}

.btn-quiet:disabled:hover {
    color: var(--ink);
    border-color: var(--hairline);
}

.btn-quiet:hover,
.btn-quiet:focus {
    color: var(--brand-ink);
    border-color: var(--brand);
}

/* ---- attention list ------------------------------------------------------------------------ */

.attention-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* In the accent, in mono: it is a label for the section, not a heading competing with the lede. */
.attention-label {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand-ink);
}

.attention-note {
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.attention-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hairline);
}

.attention-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.attention-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.attention-title {
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink);
}

.attention-detail {
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--ink-muted);
}

/*
 * A dot, not a colour-coded badge. Only the blocking item is filled — everything here is worth
 * doing, and painting them all amber makes the one that stops the machine indistinguishable from
 * the one that would merely help.
 */
.attention-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex: none;
    margin-top: 8px;
    border: 1px solid var(--ink-muted);
}

.attention-dot-blocking {
    background: var(--brand);
    border-color: var(--brand);
}

.attention-cost {
    margin-top: 2px;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--brand-ink);
}

/*
 * The healthy state is a schedule, not a congratulation.
 *
 * It is the state a working node sits in for months, so it has to be worth looking at. "All
 * systems running" is a badge asking to be read; a list of what happens next is the strongest
 * thing a service running in the background can offer — it says what it will do, and then does it.
 */
.attention-clear {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

/* The label loses the accent here: with nothing to act on, it is not calling for attention. */
.attention-label-quiet {
    color: var(--ink-muted);
}

.attention-lede {
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.35;
    color: var(--ink);
}

.schedule {
    display: flex;
    flex-direction: column;
}

.schedule-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--hairline);
}

.schedule-row:last-child {
    border-bottom: 0;
}

/*
 * A fixed column so the whens line up as a timeline rather than ragging against the text. In the
 * accent because the timing is the point — the what is ordinary prose.
 */
.schedule-when {
    width: 80px;
    flex: none;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--brand-ink);
}

.schedule-what {
    font-size: var(--text-base);
    line-height: 1.45;
    color: var(--ink);
}

@media (max-width: 575.98px) {
    /* The timing stacks above its line rather than squeezing the sentence into a gutter. */
    .schedule-row {
        flex-direction: column;
        gap: 2px;
    }

    .schedule-when {
        width: auto;
    }
}

@media (max-width: 991.98px) {
    /* The seam becomes a horizontal one; 400px of profile beside a list stops fitting. */
    .account-grid {
        grid-template-columns: 1fr;
    }

    .attention-item {
        flex-wrap: wrap;
    }

    .attention-item .btn,
    .attention-item .btn-quiet {
        margin-left: 21px;
    }
}

/* ---- view-as switcher ----------------------------------------------------------------------- */

/*
 * Previewing the product as another role. Only a real admin ever sees it.
 *
 * It lives below the five destinations because it is a tool, not a place. The state it creates is
 * sticky in the session and this control is the only way out of it, so the control has to say which
 * role is active — a preview you cannot see you are in is a support ticket waiting to happen.
 */
.view-as {
    margin: 1rem 1.5rem 0;
    padding-top: .75rem;
    border-top: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.view-as-label {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

/* While a preview is active the label takes the accent and the control is ringed: this is the one
   state where the product is lying to you on purpose, and it should be impossible to forget. */
.view-as-previewing .view-as-label {
    color: var(--brand-ink);
}

.view-as-previewing .range-switch {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* The sidebar is narrow, so the shared switch tightens rather than getting its own component. */
.range-switch-sm .range-option {
    font-size: var(--text-xs);
    padding: 4px 9px;
}

.range-switch-sm form {
    display: contents;
}

/* ---- insight row ---------------------------------------------------------------------------- */

/*
 * The keyword ranking beside where the name landed. Proportioned 1.1fr to 1fr as the design has
 * them: the ranking carries four figures and a bar per row, the company list carries two.
 *
 * A grid rather than two Bootstrap columns because grid items stretch to the tallest by default.
 * The same result with columns needs height:100% resolved down every nesting level — and a
 * percentage height under `align-items: stretch` does not resolve, because stretching sets a used
 * height while the computed height stays auto. That trap has cost this codebase a day already.
 */
.insight-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

/*
 * The cell fills its track, and the panel inside fills the cell — so the two cards end level
 * whichever has more rows. Their own footers stay pinned to their own bottoms.
 */
.insight-cell {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.insight-cell > .panel {
    flex: 1 1 auto;
}

/* The trailing note under the keyword panel sits outside it, so it must not stretch. */
.insight-cell > .panel-subtitle {
    flex: none;
}

@media (max-width: 991.98px) {
    /* Stacked, and equal height stops meaning anything. */
    .insight-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- collapsible admin sections -------------------------------------------------------------- */

/*
 * Operator instrumentation, collapsed by default.
 *
 * Both of these are readouts for whoever runs the node — the sampling ladder and the scraper feed.
 * Expanded they occupied two screens between the customer's own figures and the foot of the page,
 * which is the wrong weight for something no customer sees.
 *
 * A button rather than a link so it is keyboard-operable and announces its expanded state, which
 * Bootstrap keeps in sync through aria-expanded.
 */
.section-toggle,
.admin-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
}

.section-toggle-icon,
.admin-toggle-icon {
    font-size: var(--text-lg);
    color: var(--ink-muted);
    flex: none;
}

.section-toggle-title,
.admin-toggle-title {
    font-size: var(--text-md);
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

/* Points down when closed and up when open, so the control says which way it will move. */
.section-chevron,
.admin-chevron {
    font-size: var(--text-xs);
    color: var(--ink-muted);
    flex: none;
    transition: transform .15s ease;
}

.section-toggle:not(.collapsed) .section-chevron,
.admin-toggle:not(.collapsed) .admin-chevron {
    transform: rotate(180deg);
}

.section-toggle:hover .section-toggle-title,
.section-toggle:focus-visible .section-toggle-title,
.admin-toggle:hover .admin-toggle-title,
.admin-toggle:focus-visible .admin-toggle-title {
    color: var(--brand-ink);
}

/* Space only once open — a collapsed header should not carry the body's top margin. */
.section-toggle:not(.collapsed),
.admin-toggle:not(.collapsed) {
    margin-bottom: 1.5rem;
}

/*
 * A page of keywords is a fixed number of rows, so the panel keeps its height whichever page you
 * are on — the column beside it is two stacked panels, and a list that shrank on the last page
 * would stop matching them.
 */
.kw-list {
    /* A page's worth of rows at ~29px each, so paging never shortens the panel. The panel's full
       height comes from the grid it sits in; this only floors it. */
    min-height: 348px;
    flex: 1 1 auto;
}

.kw-pager {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.kw-page-btn {
    border: 1px solid var(--hairline-strong);
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius-sm);
    padding: 2px 9px;
    font-size: var(--text-xs);
    cursor: pointer;
}

.kw-page-btn:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand-ink);
}

.kw-page-btn:disabled {
    opacity: .4;
    cursor: default;
}

.kw-page-label {
    font-size: var(--text-xs);
    color: var(--ink-muted);
}

/* The analytics ranking is wider than the dashboard's: it carries a bar and four figures a row. */
.insight-grid-wide {
    grid-template-columns: 1.4fr 1fr;
}

/*
 * A cell holding two stacked panels rather than one, spaced like the grid's own gap.
 *
 * Scoped to .panel deliberately. A universal child selector here set display:flex on the chart
 * fragment's own <script> element — scripts are display:none by default, so that made it visible
 * and it rendered 754px of its own source into the page.
 */
.insight-cell-stack {
    gap: 20px;
}

.insight-cell-stack > .panel {
    flex: 0 0 auto;
}

@media (max-width: 991.98px) {
    .insight-grid-wide {
        grid-template-columns: 1fr;
    }
}


/*
  The page head shared by settings and help. Here rather than in a page sheet because two unrelated
  page groups draw it — it lived in settings.css and the help page was reaching across for it.
*/
.settings-title {
    font-size: var(--text-xl);
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.25;
    color: var(--ink);
}

.settings-lede {
    font-size: var(--text-base);
    color: var(--ink-muted);
    line-height: 1.55;
    max-width: 620px;
}

/* ---- one scale for the theme's own components -------------------------------------------- */

h1, .h1 {
    font-size: var(--text-xl);
}

h2, .h2 {
    font-size: var(--text-lg);
}

h3, .h3,
h4, .h4 {
    font-size: var(--text-md);
}

h5, .h5,
h6, .h6 {
    font-size: var(--text-base);
}

.lead {
    font-size: var(--text-md);
}

small,
.small,
.text-sm {
    font-size: var(--text-sm);
}

.form-label,
.col-form-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}

.form-text {
    font-size: var(--text-xs);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--control-height);
    padding: 8px 16px;
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.25;
    border-radius: var(--radius);
    box-shadow: none;
}

.btn-sm,
.btn-group-sm > .btn {
    min-height: 32px;
    padding: 5px 12px;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
}

.btn-close {
    min-height: 0;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-secondary,
.btn-neutral {
    color: var(--ink);
    background-color: var(--surface);
    border-color: var(--hairline-strong);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-neutral:hover,
.btn-neutral:focus {
    color: var(--brand-ink);
    background-color: var(--surface);
    border-color: var(--brand);
}

.btn:disabled,
.btn.disabled {
    opacity: .5;
}

.form-control,
.form-select {
    min-height: var(--control-height);
    padding: 8px 12px;
    font-size: var(--text-base);
    line-height: 1.4;
    color: var(--ink);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius);
    box-shadow: none;
}

.form-select {
    padding-right: 36px;
    background-position: right 12px center;
}

textarea.form-control {
    min-height: 0;
}

.form-control::placeholder {
    color: var(--ink-muted);
    opacity: .7;
}

.input-group-text {
    font-size: var(--text-base);
    border-color: var(--hairline-strong);
}

.card {
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.card-header,
.card-footer {
    background-color: transparent;
    border-color: var(--hairline);
}

.modal-content {
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
}

.modal-title {
    font-size: var(--text-md);
    font-weight: 600;
}

.accordion-button {
    font-size: var(--text-base);
    font-weight: 600;
    box-shadow: none;
}

.badge {
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-pill);
    padding: 3px 9px;
}

.alert {
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.table thead th {
    font-size: var(--text-2xs);
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--ink-muted);
}

.table tbody th,
.table td {
    font-size: var(--text-sm);
}

.dataTables_wrapper :is(.dataTables_info, .dataTables_length, .dataTables_filter),
.page-link {
    font-size: var(--text-sm);
}

.page-link {
    border-color: var(--hairline);
}

/* Warnings as a tint rather than a slab of the theme's orange. */
.badge.bg-warning,
.dark-mode .badge.bg-warning {
    background-color: color-mix(in srgb, var(--warn) 14%, transparent) !important;
    color: var(--warn);
}

/* ---- sidebar ------------------------------------------------------------------------------ */

#sidebar .navbar-brand h5 {
    font-size: var(--text-md);
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ink);
}

#sidebar .nav-link {
    font-size: var(--text-base);
    font-weight: 500;
}

#sidebar .nav-sm .nav-link {
    font-size: var(--text-sm);
}

/* ---- trial countdown ---------------------------------------------------------------------- */

.trial-countdown {
    margin: 1rem 1.5rem 0;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--warn) 12%, transparent);
    color: var(--warn);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
}

/* ---- carousel slide ---------------------------------------------------------------------- */

/* The slide is exported as the customer's post, so it keeps its own type rather than the app's. */
.card.background h1 {
    font-size: 2.25rem;
}

.card.background h3 {
    font-size: 1.375rem;
}
