/* ============================================================
   Latch & Lantern :: THE POLISH LAYER

   Loaded after app.css. It changes how the deck is PRESENTED — type scale,
   spacing, surfaces, controls — and nothing about how it works: no selector
   here hides, moves or re-orders a control, and no colour is written down.
   Every colour is a theme.css token or an rgba() over a token triplet, so all
   twenty-nine skins pick it up for free and keep their own personality.

   What it fixes, in the order a visitor notices:
     1. Type. The shell was set at 9-11px with wide tracking and capitals on
        sentences. Body is now 15px, card subtitles 13px in sentence case,
        micro-labels 11px, and numbers sit in --font-data with tabular figures.
        font-synthesis is off so a single-weight face (Pacifico, Limelight,
        Black Ops One) is never smeared into a fake bold.
     2. Nesting. The dashboard was a card holding cards holding boxes; the
        inner boxes are now rows on hairlines.
     3. Side stripes. 2-4px coloured left borders on every message, list row
        and nav item are gone; state is carried by a tint instead.
     4. Controls. Primary actions are a filled accent button, inputs are
        roomier, placeholders are no longer shouted.
     5. Browser surfaces. Thin rounded scrollbars inside cards, tabular data.

   The hard skins (camo and the four that inherit its capitals, plus orbit,
   neon, harbor, voyage, speakeasy) keep capitals on labels and nav, at a size
   you can read. See HARD below.
   ============================================================ */

html {
    font-synthesis-weight: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-size: 15px;
    line-height: 1.5;
}

/* ---------- numbers ---------- */
.stat-value,
.stat-item-value,
.readout b,
.nav-group-count,
.login-time,
.login-ip {
    font-family: var(--font-data);
    font-variant-numeric: tabular-nums;
}

/* ---------- small type that was too small ---------- */
.tag { font-size: max(.68rem, var(--fs-min)); letter-spacing: .08em; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-logo { padding: 22px 18px 18px; }

.sidebar-logo .logo-glyph { font-size: 2rem; margin-bottom: 10px; }

.sidebar-logo .logo-name {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: var(--tracking-h2, .3px);
    line-height: 1.2;
}

.sidebar-logo .logo-sub {
    margin-top: 8px;
    font-size: max(.68rem, var(--fs-min));
    letter-spacing: .1em;
}

.nav-heading {
    padding: 18px 20px 8px;
    font-size: max(.75rem, var(--fs-min));
    font-weight: 500;
    /* The skin's own case and tracking: sentence case on the soft skins, capitals on the
       hard ones (--case-heads / --tracking-h2 are theme.css tokens). */
    letter-spacing: calc(var(--tracking-h2, 0px) * .5);
    text-transform: var(--case-heads, uppercase);
}

.nav-list { padding: 0 10px 10px; }

.nav-item,
.nav-group-toggle {
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border: 0;
    border-radius: var(--radius-control, 6px);
    font-family: var(--font-mono);
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-dim);
}

.nav-item .nav-icon { filter: none; opacity: .85; }

.nav-item:hover,
.nav-item:focus-visible,
.nav-group-toggle:hover,
.nav-group-toggle:focus-visible {
    background: rgba(var(--toxic-rgb), .09);
    color: var(--text);
    box-shadow: none;
}

/* keep the keyboard ring: the tint alone is not a visible focus indicator */
.nav-item:focus-visible,
.nav-group-toggle:focus-visible {
    outline: 2px solid var(--toxic);
    outline-offset: 2px;
}

.nav-item.active {
    background: rgba(var(--toxic-rgb), .16);
    color: var(--selected-ink);   /* the accent, a step darker where it is too light on its own tint (theme.css) */
    font-weight: 700;
    text-shadow: none;
}

.nav-group-caret { font-size: .62rem; }

.nav-group-count {
    font-size: max(.75rem, var(--fs-min));
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--text-dim);
    opacity: 1;
}

.nav-sublist { padding-left: 14px; }
.nav-sublist .nav-item { font-size: .86rem; padding: 7px 12px; }

/* ============================================================
   HEADER + DAILY QUOTE
   ============================================================ */
.main-area { padding: 22px 26px 64px; }

.hub-header {
    border-radius: var(--radius-card, 0);
    margin-bottom: 18px;
}

.hub-header-inner { padding: 22px 26px; gap: 20px; }

.hub-title {
    font-size: clamp(1.55rem, 1.05rem + 1.3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.08;
}

.hub-subline {
    margin-top: 8px;
    font-size: max(.74rem, var(--fs-min));
    letter-spacing: calc(var(--tracking-h2, 0px) * .6);
}

.hub-readouts { gap: 8px; }

.readout {
    font-size: max(.75rem, var(--fs-min));
    font-weight: 500;
    letter-spacing: calc(var(--tracking-h2, 0px) * .5);
    line-height: 1.3;
}

.readout b {
    margin-top: 3px;
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.daily-quote-header { margin-bottom: 22px; }

.quote-display-header {
    padding: 20px 24px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card, 0);
    background:
        linear-gradient(100deg, rgba(var(--toxic-rgb), .11) 0%, rgba(var(--toxic-rgb), 0) 55%),
        var(--bg-panel);
}

.quote-display-header::before {
    left: 18px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: max(.62rem, var(--fs-min));
    font-weight: 600;
    letter-spacing: .1em;
}

.quote-display-header::after { bottom: 6px; right: 14px; font-size: max(.58rem, var(--fs-min)); letter-spacing: .12em; }

.quote-text-header {
    font-size: 1.12rem;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: -.005em;
}

.quote-author-header { font-size: .78rem; font-weight: 700; }

/* ============================================================
   CARDS
   ============================================================ */
.section { padding: 26px 20px 16px; }

.section::before { height: 3px; }

.section h2 {
    margin: 0 0 4px;
    padding-bottom: 0;
    border-bottom: 0;
    font-size: 1.14rem;
    font-weight: 700;
    line-height: 1.25;
    gap: 9px;
}

.section h2::before { font-size: .95em; }

.section > p {
    margin-bottom: 16px;
    font-size: .82rem;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.45;
}

.section-body { gap: 10px; }

/* Card chrome: quiet at rest, full strength when the card is pointed at. It is never
   hidden: a pointer sees it at a lighter value (so a person finds out a card can be moved,
   shrunk or minimised), and a touch screen, which has no hover, keeps app.css's resting
   value always. The glyph is --text-dim, which clears 4.5:1 on every skin. */
@media (hover: hover) {
    .widget-chrome { opacity: .72; }
    .section:hover .widget-chrome,
    .widget-chrome:focus-within { opacity: 1; }
}

.widget-btn {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: var(--radius-control, 0);
    background: var(--overlay-1);
    color: var(--text-dim);
    font-size: .82rem;
}

.widget-btn:hover { background: rgba(var(--toxic-rgb), .14); box-shadow: none; }

/* Thin, quiet scrollbars inside a card: the deck's own scrollbar stays the skin's. */
.section ::-webkit-scrollbar { width: 6px; height: 6px; }
.section ::-webkit-scrollbar-track { background: transparent; border: 0; }
.section ::-webkit-scrollbar-thumb { background: var(--line); border: 0; border-radius: 999px; }
.section ::-webkit-scrollbar-thumb:hover { background: var(--toxic-dim); }
.section * { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ---------- list rows: a tint, not a stripe ---------- */
.section ul li {
    padding: 9px 12px;
    margin-bottom: 6px;
    border-left: 0;
    border-radius: var(--radius-control, 0);
    background: rgba(var(--toxic-rgb), .05);
    font-size: .875rem;
    line-height: 1.45;
}

.section ul li:hover { background: rgba(var(--toxic-rgb), .08); }

/* ============================================================
   CONTROLS
   ============================================================ */
button, input, select, textarea { font-size: .875rem; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="time"],
textarea,
select {
    padding: 10px 12px;
    line-height: 1.3;
}

input::placeholder,
textarea::placeholder {
    font-size: inherit;
    letter-spacing: 0;
    text-transform: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--toxic);
    box-shadow: 0 0 0 3px rgba(var(--toxic-rgb), .18);
}

.upload-btn,
.video-btn,
.recipe-btn,
.add-message-btn,
.add-symbol-btn,
.refresh-tickers-btn,
.view-more-btn,
.project-add-btn,
.project-cancel-btn,
.add-project-btn,
.youtube-add-btn,
.youtube-cancel-btn,
.add-youtube-btn,
.discord-open-btn,
.discord-save-btn,
.discord-send-btn,
.playlist-action-btn,
.add-to-playlist-btn,
.play-btn,
.new-quote-btn,
.btn-affirm {
    padding: 9px 15px;
    border-radius: var(--radius-control, 0);
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: calc(var(--tracking-h2, .3px) * .5);
    transition: background .18s ease, border-color .18s ease, color .18s ease,
        box-shadow .18s ease, transform .18s ease, filter .18s ease;
}

/* The affirmative action is a filled accent, so the one thing to press on a card
   is the one thing that looks pressable. */
.add-message-btn,
.add-symbol-btn,
.project-add-btn,
.youtube-add-btn,
.discord-open-btn,
.discord-send-btn,
.discord-save-btn,
.add-project-btn,
.add-youtube-btn,
.play-btn,
.btn-affirm {
    background: var(--toxic);
    border: 1px solid var(--toxic);
    color: var(--on-accent);
    text-shadow: none;
}

.add-message-btn:hover,
.add-symbol-btn:hover,
.project-add-btn:hover,
.youtube-add-btn:hover,
.discord-open-btn:hover,
.discord-send-btn:hover,
.discord-save-btn:hover,
.add-project-btn:hover,
.add-youtube-btn:hover,
.play-btn:hover,
.btn-affirm:hover {
    color: var(--on-accent);
    border-color: var(--toxic);
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -6px rgba(var(--toxic-rgb), .6);
}

/* ============================================================
   DASHBOARD — a stat is a number and its breakdown, not a box of boxes
   ============================================================ */
.dashboard-content { gap: 12px; padding-right: 2px; }
/* On the deck the tiles are one row: a flex row that wraps only when it must (about 190px a
   tile), so every tile shares the width (a grid's auto-fit counts the full-width note under
   the tiles as a track and leaves a gap). Opened, the card keeps its own grid. */
.dashboard-section:not(.expanded) .dashboard-content { display: flex; flex-wrap: wrap; align-content: flex-start; }
.dashboard-section:not(.expanded) .dashboard-content > .dashboard-stat { flex: 1 1 190px; min-width: 0; }
.dashboard-section:not(.expanded) .dashboard-content > :not(.dashboard-stat) { flex: 1 1 100%; }

.dashboard-stat {
    padding: 8px 14px 2px;
    border: 1px solid var(--line);
    border-radius: min(var(--radius-card, 0px), 8px);
    background: var(--bg-panel);
}

.dashboard-stat:hover { border-color: var(--line-strong); box-shadow: none; }

.stat-label {
    margin-bottom: 6px;
    font-size: max(.75rem, var(--fs-min));
    font-weight: 500;
    letter-spacing: calc(var(--tracking-h2, 0px) * .5);
    text-transform: var(--case-heads, uppercase);
}

.stat-value {
    font-family: var(--font-stencil);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.01em;
}

/* the one-line caption beside the number ("people in this hub"): figure and caption share a
   line, which is what lets three tiles and every row of their breakdown fit one card row */
.stat-value + div {
    margin-top: 4px;
    font-size: .8rem;
    color: var(--text-dim);
}

/* a tile is a small grid: label across the top, then the figure with its caption beside it
   on one line (the caption is cut with an ellipsis rather than wrapping onto a second line),
   then whatever else the tile carries across the full width */
.dashboard-stat {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 8px;
    align-content: start;
    align-items: baseline;
}
.dashboard-stat > :not(.stat-value):not(.stat-sub) { grid-column: 1 / -1; }
.dashboard-stat .stat-value + .stat-sub { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-stat .stat-empty { font-size: 1rem; margin: 2px 0 6px; }

.stat-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
    row-gap: 0;
    margin-top: 6px;
}

.stat-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    flex-wrap: nowrap;
}
/* an odd last figure takes the whole row, so a long value ("12 MB / 20 GB") has room */
.stat-grid > .stat-item:last-child:nth-child(odd) { grid-column: 1 / -1; }

.stat-item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .76rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text-dim);
}

.stat-item-value {
    margin-top: 0;
    margin-left: auto;
    white-space: nowrap;
    font-size: .88rem;
    font-weight: 700;
    text-align: right;
}

.security-alert {
    border: 1px solid rgba(var(--toxic-rgb), .35);
    border-radius: var(--radius-control, 0);
    font-size: .78rem;
    letter-spacing: 0;
}

.recent-logins { border-radius: var(--radius-control, 0); }
.login-entry { font-size: .78rem; }

/* ============================================================
   HARD — the skins whose identity is capitals keep them, readably
   (camo is :root; onyx and steel inherit its capitals)
   ============================================================ */
html:not([data-theme]) .nav-item, html:not([data-theme]) .nav-group-toggle {
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
}

/* ============================================================
   CARD FINE PRINT — the drop zone and the "visible to" pickers
   ============================================================ */
.upload-area {
    padding: 16px;
    border-radius: var(--radius-control, 0);
    border-color: rgba(var(--toxic-rgb), .3);
    background: rgba(var(--toxic-rgb), .04);
}

.upload-area p {
    margin-bottom: 10px;
    font-size: .8rem;
    letter-spacing: 0;
    text-transform: none;
}

/* ...and their buttons keep the stencil voice; everywhere else a button is the body
   face in bold, because a script or hairline display face cannot carry "Add" at 13px. */
html:not([data-theme]) :is(.upload-btn, .video-btn, .recipe-btn, .add-message-btn, .btn-affirm, .view-more-btn, .add-symbol-btn, .project-add-btn, .youtube-add-btn),
html[data-theme="camo"] :is(.upload-btn, .video-btn, .recipe-btn, .add-message-btn, .btn-affirm, .view-more-btn, .add-symbol-btn, .project-add-btn, .youtube-add-btn),
html[data-theme="biohazard"] :is(.upload-btn, .video-btn, .recipe-btn, .add-message-btn, .btn-affirm, .view-more-btn, .add-symbol-btn, .project-add-btn, .youtube-add-btn),
html[data-theme="tribal"] :is(.upload-btn, .video-btn, .recipe-btn, .add-message-btn, .btn-affirm, .view-more-btn, .add-symbol-btn, .project-add-btn, .youtube-add-btn) {
    font-family: var(--font-stencil);
    font-weight: 400;
    font-size: max(.74rem, var(--fs-min));
}

/* ============================================================
   BANNERS (billing notices, the demo ribbon) — they wrap instead of
   crushing the sentence to one word a line on a phone, and carry their
   state as a tint rather than a 4px stripe.
   ============================================================ */
.fc-banner:not(:empty) {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 16px;
    border-width: 1px;
    border-radius: var(--radius-card, 0);
    font-size: .84rem;
    letter-spacing: 0;
}

.fc-banner.info { border-color: rgba(var(--hazard-rgb), .45); background: rgba(var(--hazard-rgb), .08); }
.fc-banner.warn { border-color: rgba(var(--toxic-rgb), .45); background: rgba(var(--toxic-rgb), .08); }
.fc-banner.danger { border-color: rgba(var(--danger-rgb), .5); }

.fc-banner-text { flex: 1 1 240px; }

.fc-banner-action,
.fc-banner-link {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: max(.74rem, var(--fs-min));
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}

/* ============================================================
   PHONES — the same deck with less air round the edges
   ============================================================ */
@media (max-width: 700px) {
    .main-area { padding: 14px 12px 56px; }
    .hub-header-inner { padding: 18px 18px; }
    .quote-display-header { padding: 18px 16px 16px; }
    .section { padding: 24px 16px 14px; }
    .stat-value { font-size: 2rem; }
}

/* ============================================================
   UNSTYLED BUTTONS — several widgets build small buttons (‹ › week arrows,
   a "+" on an add row, Send) with no class rule behind them, so they wore the
   browser's grey bevel on every skin. This gives them the skin's tint. It is
   wrapped in :where() so its specificity is zero: any button that does have
   a rule of its own keeps every property that rule sets.
   ============================================================ */
:where(.section-body button) {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(var(--toxic-rgb), .1);
    border: 1px solid rgba(var(--toxic-rgb), .28);
    border-radius: var(--radius-control, 0);
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

:where(.section-body button:hover) {
    background: rgba(var(--toxic-rgb), .18);
    border-color: var(--toxic);
}

/* ============================================================
   THE LAST SIDE STRIPES — the rows and panels the first pass did not reach.
   Each keeps its meaning (a recipe, a warning, an overdue task, the chosen
   skin) through a tint and a hairline instead of a 3px coloured edge.
   ============================================================ */
.quote-display,
.youtube-video-item,
.recipe-item,
.fr-made-row {
    border: 1px solid transparent;
    border-radius: var(--radius-control, 0);
    background: rgba(var(--toxic-rgb), .05);
}

.youtube-video-item:hover,
.recipe-item:hover { background: rgba(var(--toxic-rgb), .09); }

.discord-instructions {
    border: 1px solid rgba(var(--hazard-rgb), .35);
    border-radius: var(--radius-control, 0);
    background: rgba(var(--hazard-rgb), .07);
}

.discord-status:not(:empty) {
    border: 1px solid var(--line);
    border-radius: var(--radius-control, 0);
}

/* Overdue homework: the row turns the danger colour's tint, not a red edge. */
.homework-overdue {
    border-left: 0;
    padding-left: 10px;
    border-radius: var(--radius-control, 0);
    background: rgba(var(--danger-rgb), .09);
    box-shadow: inset 0 0 0 1px rgba(var(--danger-rgb), .3);
}

/* Settings › Theme: the chosen skin is ringed in the accent. */
.theme-swatch,
.theme-swatch:focus-visible,
.theme-swatch.active { border-left-width: 1px; border-radius: var(--radius-control, 0); }
.theme-swatch:focus-visible,
.theme-swatch.active { border-left-color: var(--toxic); box-shadow: 0 0 0 2px rgba(var(--toxic-rgb), .35); }

.first-run-dialog { border-top-width: 1px; }

/* ============================================================
   ICONS — one drawn set (js/icons.js, Lucide, ISC) in place of emoji.
   They take the text colour, so every skin tints them for free.
   ============================================================ */
.ico {
    width: 1.1em;
    height: 1.1em;
    flex: none;
    display: inline-block;
    vertical-align: -.18em;
    stroke-width: 2;
}

.nav-item .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex: 0 0 20px;
    font-size: 1.05rem;
    filter: none;
    opacity: .8;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

.stat-label .ico { width: 1.2em; height: 1.2em; margin-right: 6px; color: var(--toxic); vertical-align: -.3em; }

/* A button with an icon and a word: the two sit on one line with a small gap. */
button:has(> .ico) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

button > .ico { width: 1.05em; height: 1.05em; stroke-width: 2.4; }

/* An icon placed before a word in running text (Family Setup's card list, the recipe
   photo prompt) needs its own breathing room; inside a button or the nav the flex
   gap already provides it, so the margin is taken back there. */
.ico:not(:only-child) { margin-inline-end: .45em; }
button > .ico,
.nav-icon > .ico,
.stat-label > .ico { margin-inline-end: 0; }
.stat-label > .ico { margin-right: 6px; }

/* The empty-poster placeholders (a clip with no poster, a show with no art, a TV
   channel) draw their icon large and quiet. */
.clip-poster-empty .ico,
.pod-art-empty .ico,
.tv-placeholder-icon .ico { width: 1.6em; height: 1.6em; opacity: .55; stroke-width: 1.6; }

/* ============================================================
   Settings controls: one button system and matching selects
   ============================================================
   Three kinds, all 36px tall (--btn-h) with a 12px+ label, the skin's radius and a clear
   focus ring; on a touch screen 44px. Depth comes from the --btn-* tokens in css/theme.css,
   so a flat or glowing skin keeps its own character.
     primary    .set-btn-primary: the section's main action. Filled with the accent.
     secondary  everything else: a tinted surface, the text colour, a quiet shadow.
     danger     .danger / .set-btn-danger: Remove, Delete, Take off, Revoke. Tinted red.
   Specificity matches the older .settings-section .set-btn rules in app.css and comes after
   them, so these win without !important. */
.settings-section .set-btn,
.settings-section .set-btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--btn-h);
    padding: 0 14px;
    font-family: var(--font-stencil);
    font-size: max(.78rem, var(--fs-min));
    font-weight: 600;
    letter-spacing: .08em;
    line-height: 1.2;
    text-transform: var(--case-heads, uppercase);
    color: var(--text);
    background: linear-gradient(180deg, rgba(var(--toxic-rgb), .12), rgba(var(--toxic-rgb), .06));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control, 0);
    box-shadow: var(--btn-shadow);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.settings-section .set-btn:hover,
.settings-section .set-btn-sm:hover {
    background: linear-gradient(180deg, rgba(var(--toxic-rgb), .2), rgba(var(--toxic-rgb), .1));
    border-color: var(--toxic-dim);
    box-shadow: var(--btn-shadow-hover);
    transform: translateY(var(--btn-lift));
}
.settings-section .set-btn:active,
.settings-section .set-btn-sm:active {
    transform: translateY(0);
    box-shadow: var(--btn-shadow-press);
}
.settings-section .set-btn:focus-visible,
.settings-section .set-btn-sm:focus-visible,
.settings-section select:focus-visible {
    outline: 2px solid var(--toxic);
    outline-offset: 2px;
}

/* primary: the accent, filled */
.settings-section .set-btn.set-btn-primary,
.settings-section .set-btn-sm.set-btn-primary {
    color: var(--on-accent);
    background: var(--toxic);
    border-color: var(--toxic);
}
.settings-section .set-btn.set-btn-primary:hover,
.settings-section .set-btn-sm.set-btn-primary:hover {
    color: var(--on-accent);
    background: var(--toxic);
    border-color: var(--toxic);
    filter: brightness(1.08);
}

/* danger: tinted red, text in the danger tone */
.settings-section .set-btn.danger,
.settings-section .set-btn-sm.danger,
.settings-section .set-btn.set-btn-danger,
.settings-section .set-btn-sm.set-btn-danger {
    color: var(--danger);
    background: rgba(var(--danger-rgb), .09);
    border-color: rgba(var(--danger-rgb), .55);
}
.settings-section .set-btn.danger:hover,
.settings-section .set-btn-sm.danger:hover,
.settings-section .set-btn.set-btn-danger:hover,
.settings-section .set-btn-sm.set-btn-danger:hover {
    background: rgba(var(--danger-rgb), .2);
    border-color: var(--danger);
}

.settings-section .set-btn[disabled],
.settings-section .set-btn-sm[disabled] {
    opacity: .45;
    box-shadow: none;
    transform: none;
    filter: none;
}

/* a finger: 44px each way (min-width keeps the glyph-only ✕ and +/- buttons a real target) */
@media (pointer: coarse) {
    .settings-section .set-btn,
    .settings-section .set-btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 0 16px;
    }
}

/* ---- selects: the same height and radius, a drawn chevron, never cut off ----
   The chevron is two gradients in currentColor, so it takes whatever the skin makes the text. */
.settings-section select {
    -webkit-appearance: none;
    appearance: none;
    min-height: var(--btn-h);
    padding: 0 38px 0 12px;
    font-size: max(.82rem, var(--fs-min));
    line-height: 1.3;
    color: var(--text);
    background-color: var(--modal-fill);
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 19px) 50%, calc(100% - 13px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control, 0);
    box-shadow: var(--btn-shadow);
    max-width: 100%;
    cursor: pointer;
}
.settings-section select:hover { border-color: var(--toxic-dim); }
.settings-section select:disabled { opacity: .55; cursor: not-allowed; }
/* The Sharing selects: wide enough for "Not chosen — the card remembers your last choice". */
.settings-section select.set-select {
    flex: 0 1 auto;
    width: min(100%, 26rem);
}
@media (pointer: coarse) {
    .settings-section select { min-height: 44px; }
}

/* ============================================================
   THE DECK LOOK

   Quieter and denser: about eight cards above the fold at 1568x752 instead of four.
   Everything here is shared chrome written against skin tokens only (--text, --text-dim,
   --toxic, --line, --bg-panel, --radius-card, ...), at the same low specificity as the rules
   above, so a skin's own rule in theme.css (uppercase titles on Orbit, a script face on
   Neon) still wins and keeps its voice. No selector below hides a control or moves one: the
   card controls are shown or hidden by Edit layout in app.css.

   What changes, and where the old value was:
     header band   one ~56px line (title, tagline, readouts, the Edit layout button), no
                   box, no stripe, a hairline under it; was a ~112px boxed hero
     quote         one line, no box, no pill; was a ~70px washed box with a pill badge
     card titles   the text colour and no glyph (the skin's glyph stays in the logo, the
                   hub title and the sidebar heading); were the accent with a glyph each
     card padding  14/16/12; was 26/20/16
     sidebar       compact identity block, 36px rows, counts as plain figures
   Geometry (padding, the control cluster's position, the sidebar) is for the desktop
   deck only: a phone and the two wall frames keep their own tuned spacing.
   ============================================================ */

/* ---- card titles: the text colour, no glyph in front ---- */
.section h2 { color: var(--text); font-size: 1rem; margin: 0; }
.section h2::before { content: none; }
.section > p { font-size: max(.8125rem, var(--fs-min)); line-height: 1.3; margin: 2px 0 10px; }
.section .section-body { font-variant-numeric: tabular-nums; }

/* ---- header band: title, tagline and readouts on one line ---- */
.main-area { padding: 12px 20px 56px; }

.hub-header {
    margin: 0 0 6px;
    padding: 0 2px 8px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    clip-path: none;
    overflow: visible;
}
.hub-header::before,
.hub-header::after { display: none; }

.hub-header-inner {
    padding: 0;
    gap: 16px;
    flex-wrap: nowrap;
    align-items: center;
}
.hub-header-inner > div:first-child {
    display: flex;
    flex: 1 1 auto;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 14px;
    min-width: 0;
}
.hub-title { font-size: 1.5rem; line-height: 1.2; margin: 0; }
.hub-title [id="hub-title-word"] { color: var(--toxic); }
.hub-subline { margin: 0; font-size: max(.8125rem, var(--fs-min)); }
.hub-readouts { gap: 20px; flex-wrap: nowrap; }
.readout {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    padding: 0;
    white-space: nowrap;
}
.readout b { display: inline; margin-top: 0; font-size: max(.875rem, var(--fs-min)); color: var(--text); }
.readout.warn b { color: var(--hazard-text, var(--hazard)); }

/* ---- the quote: one line, quote left, author and the existing hint right ---- */
.daily-quote-header { margin: 0 0 12px; padding: 0 2px; }
.quote-display-header {
    padding: 0;
    min-height: 0;
    gap: 10px;
    align-items: baseline;
    flex-wrap: nowrap;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.quote-display-header::before { content: none; }
.quote-display-header::after {
    position: static;
    order: 3;
    margin-left: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: max(.75rem, var(--fs-min));
    letter-spacing: 0;
    text-transform: none;
}
.quote-text-header {
    min-width: 0;
    padding-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: max(.875rem, var(--fs-min));
    font-weight: 400;
    line-height: 1.4;
}
.quote-author-header {
    order: 2;
    flex: 0 0 auto;
    font-size: max(.8125rem, var(--fs-min));
    font-weight: 500;
    letter-spacing: calc(var(--tracking-h2, 0px) * .5);
    color: var(--text-dim);
}

/* ---- desktop geometry: tight cards, the control cluster on the title's line, a compact
   sidebar. :where() keeps the guard at zero specificity. ---- */
@media (min-width: 901px) {
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .section {
        padding: 14px 16px 12px;
    }
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .widget-chrome {
        top: 10px;
        right: 8px;
    }
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .section.widget-half:not(.expanded) {
        padding: 12px 14px 8px;
    }

    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .sidebar-logo {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 10px;
        align-items: center;
        padding: 14px 16px 10px;
    }
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .sidebar-logo .logo-glyph {
        grid-row: span 2;
        margin: 0;
        font-size: 1.25rem;
    }
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .sidebar-logo .logo-name { font-size: .9375rem; }
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .sidebar-logo .logo-sub {
        margin-top: 0;
        letter-spacing: calc(var(--tracking-h2, 0px) * .5);
        text-transform: none;
    }
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .nav-heading { padding: 14px 16px 6px; }
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .nav-item,
    :where(html:not([data-display="frame10"]):not([data-display="frame15"]):not([data-display="phone"])) .nav-group-toggle {
        min-height: 36px;
        padding-top: 0;
        padding-bottom: 0;
        align-items: center;
    }
}

/* ---- review fixes (Opus, 2026-11-07) ----
   Contrast: the quote author, the sidebar counts and the readout labels sat at 4.0-4.4:1 in
   harbor, hearts, daisy and dune on --text-dim, and 1.9:1 for the quote author over the
   New Year confetti. They take the text colour; size and weight keep them quiet.
   Narrow decks: two dashboard tiles per row instead of one, and the header title no longer
   breaks its family name across two lines (the readouts move under it instead). */
.quote-author-header { color: var(--text); }
.nav-group-count { color: var(--text); opacity: 1; }
.readout { color: var(--text); }
:where(html[data-theme="newyear"]) .daily-quote-header {
    background: color-mix(in srgb, var(--bg-panel) 82%, transparent);
    border-radius: 8px;
    padding: 4px 10px;
}
.dashboard-section:not(.expanded) .dashboard-content > .dashboard-stat { flex-basis: 140px; }
.hub-title { white-space: nowrap; }
@media (max-width: 1280px) {
    .hub-header-inner { flex-wrap: wrap; row-gap: 6px; }
}
/* Dune's status word ("Warm") was 4.3:1 on its sand header: the text colour instead. */
html[data-theme="dune"] .hub-readouts .readout b { color: var(--text); }
