/* Root Hub. Shared tokens, controls, layout, profile and motion. */

@font-face {
    font-family: "Work Sans";
    src: url("/assets/fonts/work-sans-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #08090b;
    --surface: #101113;
    --raised: #191b1e;
    --field: #151719;
    --hover: #202327;
    --line: #2f3336;
    --line-strong: #495057;
    --line-hover: #626a73;
    --text: #eff3f4;
    --muted: #a0a8b0;
    --dim: #89949e;
    --accent: #e5e5e5;
    --accent-strong: #f5f5f5;
    --accent-ink: #151515;
    --accent-wash: #ffffff15;
    --good: #55d7a3;
    --brand-node: #55d7a3;
    --official: #3b6af8;
    --good-wash: #75dfa917;
    --good-line: #325d50;
    --bad: #f2777a;
    --warn: #e5b567;
    --series-1: #ededed;
    --series-2: #3cc79a;
    --chart-tooltip: #1f1b2d;
    --placeholder-sheen: #ffffff0d;
    --spark-bg: #ffffff08;
    --spark-bg-hover: #ffffff0f;
    --header-bg: #101115e0;
    --field-border: transparent;
    --primary-bg: #f4f5f6;
    --primary-hover: #dfe3e6;
    --primary-border: transparent;
    --primary-ink: #14171a;
    --secondary-bg: #eff3f40d;
    --segmented-bg: #0c111c6b;
    --segmented-active: var(--raised);
    --choice-active: #303030;
    --error-text: #f6b3b5;
    --error-border: #6f383a;
    --error-bg: #f2777a12;
    --notice-text: #edcf98;
    --notice-border: #5f4d2c;
    --notice-bg: #e5b56710;
    --card-shadow: none;
    --card-hover-shadow: 0 6px 22px #080d1866;
    --radius: 12px;
    --radius-control: 8px;
    --radius-tag: 5px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --shadow: 0 10px 30px #00000066;
    font: 400 15px/1.55 "Work Sans", "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f8f9fb;
    --surface: #fff;
    --raised: #eef1f5;
    --field: #fff;
    --hover: #e6ebf2;
    --line: #d9dfe6;
    --line-strong: #a8b3c0;
    --line-hover: #8190a2;
    --text: #14191f;
    --muted: #495461;
    --dim: #526072;
    --accent: #494949;
    --accent-strong: #272727;
    --accent-ink: #fff;
    --accent-wash: #00000010;
    --good: #147252;
    --brand-node: #1fa774;
    --official: #2f5ce8;
    --good-wash: #14725212;
    --good-line: #82b7a5;
    --bad: #a22839;
    --warn: #815113;
    --series-1: #313131;
    --series-2: #147252;
    --chart-tooltip: #fff;
    --placeholder-sheen: #ffffffb3;
    --spark-bg: #14191f08;
    --spark-bg-hover: #14191f0f;
    --header-bg: #ffffffed;
    --field-border: #b5c0cd;
    --primary-bg: #fff;
    --primary-hover: #edf1f6;
    --primary-border: #8c9aab;
    --secondary-bg: #e9edf3;
    --segmented-bg: #e6ebf2;
    --segmented-active: var(--surface);
    --choice-active: #e4e4e4;
    --error-text: #932938;
    --error-border: #e2aab2;
    --error-bg: #fcecef;
    --notice-text: #66400e;
    --notice-border: #e0c99e;
    --notice-bg: #fff6e5;
    --shadow: 0 10px 30px #23354b26;
    --card-shadow: 0 0 0 1px #172e4814, 0 2px 6px #172e4808;
    --card-hover-shadow: 0 0 0 1px #172e4826, 0 6px 18px #172e4814;
}

/* ---- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; background: var(--bg); overflow-x: clip; -webkit-font-smoothing: antialiased; }
main { flex: 1; width: 100%; min-width: 0; padding-block: 34px 72px; outline: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 620; line-height: 1.2; letter-spacing: -.015em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.55rem, 3vw, 1.95rem); letter-spacing: -.025em; }
h2 { font-size: 1.02rem; }
h3 { font-size: 1rem; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
b, strong { font-weight: 620; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

.shell { width: min(1120px, 100% - 48px); margin-inline: auto; }
.sr, .trap { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: 12px; z-index: 50; padding: 8px 14px; border-radius: var(--radius-control); background: var(--accent); color: var(--accent-ink); font-weight: 600; transform: translateY(-200%); }
.skip:focus { transform: none; }
.sprite { position: absolute; }
.icon { flex: 0 0 auto; width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted, .quiet { color: var(--muted); }
.quiet { font-size: .88rem; }
.lead { color: var(--muted); }
.noscript { margin: 0; padding: 10px 16px; background: var(--raised); color: var(--warn); text-align: center; font-size: .9rem; }

/*
 * A banner or avatar that has not been set: a plain tile with a slow sheen.
 * The sheen is fixed to the window, so every empty tile shares one calm sweep
 * instead of each card flickering on its own.
 */
.card-cover:not(:has(img)), .cover:not(:has(img)), .avatar:not(:has(img)) {
    background: var(--raised) linear-gradient(100deg, transparent 35%, var(--placeholder-sheen) 50%, transparent 65%) 0 0 / 200vw 100% fixed;
    animation: sheen-window 3.6s ease-in-out infinite;
}
.skeleton, .chart-box:not(.is-ready)::before {
    background: linear-gradient(100deg, var(--surface) 38%, var(--raised) 50%, var(--surface) 62%) 0 0 / 240% 100%;
    animation: sheen 2.6s ease-in-out infinite;
}

/* ---- Controls ------------------------------------------------------------ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius-control);
    background: none;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color .16s, color .16s, transform .12s;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary-bg); color: var(--primary-ink); box-shadow: inset 0 0 0 1px var(--primary-border); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary-bg); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--raised); color: var(--text); }
.btn-danger { background: var(--error-bg); color: var(--error-text); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 16%, var(--surface)); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: .85rem; }
.btn-lg { min-height: 44px; padding: 0 20px; font-size: .95rem; }
.btn.is-busy { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary.is-busy::after { border-color: var(--primary-ink); border-top-color: transparent; }

.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-control); background: none; color: var(--muted); transition: color .16s, background-color .16s; }
.icon-btn:hover { color: var(--text); background: var(--raised); }
.link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; margin-left: -6px; border: 0; border-radius: 6px; background: none; color: var(--dim); font-size: .82rem; font-weight: 600; transition: color .16s, background-color .16s; }
.link-btn:hover { color: var(--text); background: var(--raised); }
.link-btn.danger:hover { color: var(--bad); }
.text-link, .inline-link { color: var(--muted); font-size: .88rem; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: color .16s; }
.text-link:hover, .inline-link:hover { color: var(--text); text-decoration-color: currentColor; }
.inline-link { padding: 0; border: 0; background: none; font-size: inherit; color: inherit; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--radius-tag); background: var(--raised); color: var(--muted); font-size: .76rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
a.tag:hover { color: var(--text); background: var(--hover); }
.tag.accent { background: var(--accent-wash); color: var(--accent-strong); }
.tag.good { background: var(--good-wash); color: var(--good); }
.tag.bad { background: var(--error-bg); color: var(--bad); }
.tag.removable .icon { width: .9em; height: .9em; }
.count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: var(--radius-tag); background: var(--raised); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: center; letter-spacing: 0; vertical-align: middle; }
.count:empty { display: none; }

.segmented { display: inline-flex; padding: 3px; border-radius: var(--radius-control); background: var(--segmented-bg); }
.segmented > * { padding: 3px 11px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: .85rem; font-weight: 550; white-space: nowrap; transition: color .16s, background-color .16s; }
.segmented > :hover { color: var(--text); }
.segmented > [aria-current], .segmented > [aria-pressed="true"] { background: var(--segmented-active); color: var(--text); }
.segmented.sm > * { padding: 2px 9px; font-size: .8rem; }

.field { display: grid; gap: 8px; min-width: 0; }
.label { color: var(--text); font-size: .86rem; font-weight: 600; }
.optional { color: var(--dim); font-weight: 400; }
.hint { color: var(--dim); font-size: .82rem; }
.hint.good { color: var(--good); }
.hint.bad { color: var(--bad); }
input:not([type="radio"], [type="file"], [type="color"]), textarea, select {
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--field-border);
    border-radius: var(--radius-control);
    background: var(--field);
    font-size: .94rem;
    transition: border-color .16s, box-shadow .16s;
}
input:not([type="radio"], [type="file"], [type="color"]) { min-height: 43px; }
:is(.wizard, .manage) input[name="name"][readonly] { color: var(--text); background: transparent; border-color: var(--line); }
textarea { display: block; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); border-radius: var(--radius-control); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.affix { display: flex; align-items: stretch; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--field); transition: border-color .16s, box-shadow .16s; }
.affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.affix > span { display: flex; align-items: center; padding-left: 12px; color: var(--dim); font-size: .92rem; white-space: nowrap; }
.affix > input { border: 0 !important; box-shadow: none !important; background: none; padding-left: 2px; }
.copy-row { display: flex; gap: 8px; }
.copy-row > input { flex: 1; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .84rem; }
.form-error { display: flex; gap: 8px; padding: 9px 12px; border: 1px solid var(--error-border); border-radius: var(--radius-control); background: var(--error-bg); color: var(--error-text); font-size: .88rem; animation: nudge .3s var(--ease); }
.field-error { display: block; margin-block-start: 4px; color: var(--error-text); font-size: .83rem; line-height: 1.4; overflow-wrap: anywhere; }
.step > .field-error, .form-stack > .field-error { margin-block-start: -10px; }
:is(input, select, textarea)[aria-invalid="true"],
:is(.editor, .affix, .tags-input, .drop):has([aria-invalid="true"]),
.choice input[aria-invalid="true"] + span { border-color: var(--bad); }
.choice input[aria-invalid="true"] + span { box-shadow: inset 0 0 0 1px var(--bad); }
.discussion .composer .editor:has(textarea[aria-invalid="true"]) { border-block-end-color: var(--bad); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--notice-border); border-radius: var(--radius-control); background: var(--notice-bg); color: var(--notice-text); font-size: .9rem; }
.notice .icon { margin-top: 3px; color: var(--warn); }
.notice a { text-decoration: underline; text-underline-offset: 3px; }

/* A select styled like the Hub (js/select-search.js): a button shows the pick and opens a panel, long lists get a search box. */
.select-search { position: relative; min-width: 0; }
.select-search-trigger { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 43px; padding: 9px 12px; border: 1px solid var(--field-border); border-radius: var(--radius-control); background: var(--field); font-size: .94rem; text-align: left; transition: border-color .16s, box-shadow .16s; }
.select-search-trigger:hover { border-color: var(--line-strong); }
.select-search-trigger:focus-visible, .select-search.is-open .select-search-trigger { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.select-search-trigger[aria-invalid="true"] { border-color: var(--bad); }
.select-search-trigger:disabled { cursor: default; opacity: .55; }
.select-search-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-search-meta { flex: 0 1 auto; max-width: 45%; overflow: hidden; color: var(--dim); font: .78rem ui-monospace, "Cascadia Mono", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.select-search-chevron { flex: none; width: 15px; height: 15px; color: var(--dim); transition: transform .16s var(--ease); }
.select-search.is-open .select-search-chevron { transform: rotate(180deg); }
.select-search-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 100%; min-width: 200px; max-width: calc(100vw - 16px); overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); box-shadow: var(--shadow); animation: pop .12s var(--ease); }
.select-search-panel.up { top: auto; bottom: calc(100% + 6px); }
.select-search-find { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.select-search-find-icon { flex: none; width: 14px; height: 14px; color: var(--dim); }
.select-search .select-search-find > input.select-search-query { height: 30px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; font-size: .88rem; }
.select-search-list { display: grid; gap: 1px; max-height: min(300px, 60vh); padding: 5px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.select-search-option { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; font-size: .88rem; text-align: left; }
.select-search-option:hover, .select-search-option:focus-visible { outline: 0; background: var(--hover); }
.select-search-option:disabled { cursor: default; opacity: .5; }
.select-search-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-search-option-meta { overflow: hidden; color: var(--dim); font: .76rem ui-monospace, "Cascadia Mono", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.select-search-option:not(:has(.select-search-option-meta)) { grid-template-columns: minmax(0, 1fr) 14px; }
.select-search-check { width: 14px; height: 14px; color: var(--accent-strong); stroke-width: 2.6; visibility: hidden; }
.select-search-option[aria-selected="true"] { font-weight: 600; }
.select-search-option[aria-selected="true"] .select-search-check { visibility: visible; }
.select-search-empty { padding: 8px 10px; color: var(--dim); font-size: .84rem; }
.notice-title { display: block; font-weight: 650; }

.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices .choice { flex: 0 0 auto; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; min-height: 36px; padding: 7px 13px; border-radius: var(--radius-control); background: var(--field); color: var(--muted); font-size: .9rem; font-weight: 550; text-align: center; transition: color .16s, background-color .16s; }
.choice:hover span { color: var(--text); background: var(--hover); }
.choice input:checked + span { color: var(--accent-strong); background: var(--choice-active); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice:has(input:disabled) { cursor: default; pointer-events: none; }
.choice input:disabled:not(:checked) + span { opacity: .5; }

.tags-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--field-border); border-radius: var(--radius-control); background: var(--field); cursor: text; transition: border-color .16s, box-shadow .16s; }
.tags-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.tags-input input { flex: 1 1 120px; min-height: 29px !important; padding: 2px 6px !important; border: 0 !important; box-shadow: none !important; background: none; }
.tags-input .tag { padding-right: 3px; background: var(--raised); animation: pop .2s var(--ease); }
.tags-input .tag button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--dim); }
.tags-input .tag button:hover { color: var(--text); background: var(--line-strong); }

.avatar { display: grid; flex: 0 0 auto; place-items: center; overflow: hidden; width: 44px; height: 44px; border-radius: 10px; background: var(--raised); color: var(--muted); font-size: 1.05rem; font-weight: 620; text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; border-radius: 7px; font-size: .78rem; animation: none !important; background: var(--raised) !important; }
.avatar.lg { width: 54px; height: 54px; border-radius: 12px; font-size: 1.25rem; }
.avatar.xl { width: 92px; height: 92px; border-radius: 18px; font-size: 2.1rem; }

.panel { min-width: 0; }
.panel:where(.manage *, .wizard *):where(:not(.done)) { padding: 22px; }
.manage .done { padding-inline: 22px; }
:where(.wizard) .done { padding-inline: 22px; }
.panel > h2 { margin-bottom: 12px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.form-stack { display: grid; gap: 20px; }
.form-stack > h2 { margin: 0; }
.step-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.step-actions > [data-back], .step-actions > a.btn-ghost:first-child { margin-right: auto; }
.step-actions.center { justify-content: center; }
.more { display: flex; justify-content: center; margin-top: 20px; }

.skeleton { border-radius: 8px; }
.skeleton.line { height: 22px; }
.skeleton.block { height: 220px; margin-top: 16px; }
.skeleton.w40 { width: 40%; }

.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 60; display: grid; gap: 8px; justify-items: center; width: min(92vw, 420px); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--raised); box-shadow: var(--shadow); font-size: .9rem; animation: toast-in .26s var(--ease); }
.toast .icon { color: var(--good); }
.toast.error .icon { color: var(--bad); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }

.dialog { width: min(92vw, 440px); padding: 22px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.dialog::backdrop { background: #080d17b8; }
.dialog[open] { animation: pop .2s var(--ease); }

.progress { position: fixed; inset: 0 auto auto 0; z-index: 70; width: 0; height: 2px; background: var(--accent); opacity: 0; transition: width .2s, opacity .3s; }
.progress.is-on { width: 78%; opacity: 1; transition: width 8s cubic-bezier(.05, .7, .1, 1), opacity .1s; }
.progress.is-done { width: 100%; opacity: 0; transition: width .18s, opacity .35s .15s; }

/* ---- Header and footer --------------------------------------------------- */

.site-header { position: sticky; z-index: 40; top: 0; border-bottom: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(16px); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; color: var(--text); }
/* A quiet line under ROOT HUB, beside the mark: the Hub is a community site, not Root's.
   33px is where the name starts in the 28px logo; 22px leaves room under its letters and lines the
   note's foot up with the foot of the bubble's tail. */
.brand-wrap { position: relative; }
.brand-note { position: absolute; top: 22px; left: 33px; color: var(--dim); font-size: .625rem; font-weight: 500; line-height: 1; letter-spacing: .02em; white-space: nowrap; pointer-events: none; }
/* The ROOT HUB logo: ink follows the text colour, the eye is the brand green of each theme. */
.brand-logo { display: block; width: auto; height: 28px; }
.brand-node { fill: var(--brand-node); }
.header-nav { display: flex; align-items: center; gap: 6px; }
/* The same room on both sides of My communities as the theme button leaves. */
.header-nav .menu + .btn { margin-left: 10px; }
.theme-toggle { flex: 0 0 36px; width: 36px; height: 36px; font-size: 1rem; }
.theme-toggle > span { display: grid; place-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--raised); color: var(--text); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); display: grid; min-width: 220px; max-width: min(320px, 80vw); padding: 5px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raised); box-shadow: var(--shadow); animation: pop .16s var(--ease); }
/* Five rows, then it scrolls: each row is 52 px with 2 px between, inside 6 px padding. */
.mine-list { gap: 2px; width: min(300px, calc(100vw - 32px)); max-height: min(calc(5 * 52px + 4 * 2px + 12px), 70vh); padding: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.mine-list::-webkit-scrollbar { width: 8px; }
.mine-list::-webkit-scrollbar-thumb { border: 2px solid var(--raised); border-radius: 8px; background: var(--line-strong); }
.mine-list .mine { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; height: 52px; padding: 8px; border-radius: 8px; transition: background-color .16s; }
.mine-list .mine:hover, .mine-list .mine:focus-visible { background: var(--hover); }
.mine-list .avatar { width: 36px; height: 36px; border-radius: 9px; font-size: .9rem; text-transform: uppercase; background: var(--field); }
.mine-text { display: grid; gap: 2px; min-width: 0; }
.mine-name { overflow: hidden; color: var(--text); font-size: .88rem; font-weight: 600; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.mine-stats { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; line-height: 1.2; }
.mine-stats .stat { gap: 5px; font-size: .76rem; }
.mine-stats .stat .icon { width: 13px; height: 13px; }
.mine-stats .live-dot { width: 6px; height: 6px; margin: 0 1px; }
.mine-slug { overflow: hidden; color: var(--dim); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }

.site-footer { border-top: 1px solid var(--line); color: var(--dim); font-size: .84rem; }

/* The privacy page: one readable column. */
.legal { display: grid; gap: 28px; max-width: 760px; margin: 0 auto; padding: 32px 0 56px; line-height: 1.6; }
.legal-head h1 { margin: 0 0 4px; }
.legal-head .quiet { margin: 0; }
.legal h2 { margin: 0 0 8px; font-size: 1.15rem; }
.legal h3 { margin: 16px 0 6px; font-size: .95rem; }
.legal p { margin: 0 0 10px; color: var(--muted); }
.legal ul { margin: 0 0 10px; padding-left: 20px; color: var(--muted); list-style: disc; }
.legal li::marker { color: var(--dim); }
.legal li + li { margin-top: 4px; }
.legal-summary { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.legal-summary ul { margin: 0; }
.legal-summary ul { color: var(--text); }
.legal code { padding: 1px 5px; border-radius: 4px; background: var(--raised); font: .86em ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* The about page: the privacy page's reading layout, with a few drawn pieces. */
.about :is(.about-stats, .about-flow, .tech-grid) { margin: 0; padding: 0; list-style: none; }
.about :is(.about-stats, .about-flow, .tech-grid) > li { margin: 0; }
.about-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.about-stats li { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.about-stats b { color: var(--text); font-size: 1.45rem; font-weight: 750; line-height: 1.2; font-variant-numeric: tabular-nums; }
.about-stats span { color: var(--muted); font-size: .86rem; }

/* How it works: four steps, and between them dashes that run on to the next, the way the numbers travel. */
.about-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.about-flow li { position: relative; display: grid; align-content: start; gap: 6px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.about-flow b { margin-top: 6px; color: var(--text); font-size: .95rem; line-height: 1.35; }
.flow-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--text); }
.flow-icon .icon { width: 20px; height: 20px; }
.about-flow li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 54px;
    right: -6px;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--line-strong) 0 6px, transparent 6px 12px);
    animation: about-flow-right 1.1s linear infinite;
}
@keyframes about-flow-right { to { background-position: 12px 0; } }
@keyframes about-flow-down { to { background-position: 0 12px; } }

/* What it's made with: one tile each, its mark in the colour the tool is known by and its name. */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.tech { display: grid; justify-items: center; gap: 10px; padding: 16px 6px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; transition: border-color .16s, transform .16s; }
.tech:hover { border-color: color-mix(in srgb, var(--tech) 55%, var(--line)); transform: translateY(-1px); }
.tech-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--tech) 15%, transparent); color: var(--tech); }
.tech-mark svg { width: 24px; height: 24px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; font-family: system-ui, sans-serif; }
.tech b { color: var(--text); font-size: .84rem; font-weight: 650; line-height: 1.3; }
.tech-php { --tech: #8892bf; }
.tech-python { --tech: #6aa6db; }
.tech-mariadb { --tech: #c49a6c; }
.tech-redis { --tech: #ff5a4e; }
.tech-cloudflare { --tech: #f6821f; }
.tech-js { --tech: #f0d22e; }
.tech-svg { --tech: #ffb13b; }
:root[data-theme="light"] .tech-php { --tech: #4f5b93; }
:root[data-theme="light"] .tech-python { --tech: #2f6aa1; }
:root[data-theme="light"] .tech-mariadb { --tech: #8a6232; }
:root[data-theme="light"] .tech-redis { --tech: #c6302b; }
:root[data-theme="light"] .tech-cloudflare { --tech: #c25a06; }
:root[data-theme="light"] .tech-js { --tech: #7d6a00; }
:root[data-theme="light"] .tech-svg { --tech: #a85f00; }

.about-community { display: grid; justify-items: start; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.about-community :is(h2, p) { margin: 0; }
.about-community .btn { margin: 4px 0; }
.about-foot { margin: 0; font-size: .86rem; }
.about-foot a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 720px) {
    .about-flow { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .about-flow li { grid-template-columns: 42px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; }
    .about-flow li > :not(.flow-icon) { grid-column: 2; }
    .about-flow .flow-icon { grid-row: 1 / span 2; }
    .about-flow b { margin-top: 0; }
    .about-flow li:not(:last-child)::after {
        top: 50px;
        bottom: -14px;
        left: 20px;
        right: auto;
        width: 2px;
        height: auto;
        background: repeating-linear-gradient(180deg, var(--line-strong) 0 6px, transparent 6px 12px);
        animation-name: about-flow-down;
    }
}
@media (prefers-reduced-motion: reduce) {
    .about-flow li::after { animation: none !important; }
    .tech, .tech:hover { transition: none; transform: none; }
}
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; min-height: 56px; }
.footer-row nav { display: flex; gap: 18px; }
.footer-row a:hover { color: var(--text); }

/* ---- Directory ----------------------------------------------------------- */

.page-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; color: var(--muted); font-size: .92rem; }
.page-sub b { color: var(--text); font-variant-numeric: tabular-nums; }
.page-sub i { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.results-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 30px; margin: 22px 0 12px; }
.results-head .text-link { margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
/* The plain list of communities for readers without script; the cards replace it (directory.js). */
.crawl-list { grid-column: 1 / -1; display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--muted); }
.crawl-list a { color: var(--text); font-weight: 600; }
:root.js .crawl-list { display: none; }
.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 46px 20px; color: var(--muted); text-align: center; }
.empty > .icon { width: 26px; height: 26px; color: var(--dim); }
.empty h3 { color: var(--text); }
.empty .btn { margin-top: 8px; }

/* Cards appear at once, with no entrance animation: redrawing the list must never blink. */
.card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); transition: background-color .18s, box-shadow .18s; }
a.card:hover { box-shadow: var(--card-hover-shadow); }
.card-cover, .cover { position: relative; display: block; overflow: hidden; }
.card-cover { aspect-ratio: 3 / 1; }
.card-cover > img, .cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-cover .tag { position: absolute; left: 10px; top: 10px; background: #101725e8; color: #eef3f8; }
.age-tag { display: inline-flex; align-items: center; min-height: 25px; padding-inline: 8px; border: 1px solid var(--notice-border); border-radius: var(--radius-tag); background: var(--surface); color: var(--notice-text); font-size: .76rem; font-weight: 650; line-height: 1; }
.card-cover .age-tag { position: absolute; top: 10px; right: 10px; }
/* Next to a community's name: centred on the capitals without making the title line taller.
   middle centres it on the lowercase letters, and the nudge lifts it the rest of the way. */
h1 .age-tag { position: relative; top: -.2em; vertical-align: middle; }
[data-card-age-avatar] { display: grid; place-items: center; color: var(--muted); }
.age-obscured { position: relative; isolation: isolate; overflow: hidden; }
.age-obscured::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -20px;
    background: radial-gradient(ellipse at 16% 8%, var(--line-strong), transparent 64%), radial-gradient(ellipse at 90% 100%, var(--line), transparent 70%), var(--field);
    filter: blur(18px);
}
.card-body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 0 16px 14px; }
.card-body .avatar { position: relative; margin-top: -22px; box-shadow: 0 0 0 3px var(--surface); transition: box-shadow .18s; }
.card-title { margin-top: 6px; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card-title:has(.card-name) { display: flex; align-items: center; gap: 5px; }
.card-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title .verified { flex: none; font-size: .95em; }
.community-owner { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.community-owner-text { min-width: 0; overflow-wrap: anywhere; }
.community-owner-text strong { color: var(--text); font-weight: 550; }
.card .community-owner-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-avatar { display: grid; flex: none; place-items: center; width: 20px; height: 20px; overflow: hidden; border-radius: 50%; background: var(--hover); color: var(--text); font-size: .68rem; font-weight: 620; line-height: 1; }
.owner-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* The owner leads to all their communities on the home page (/#owner=...). */
a.owner-link { display: inline-flex; align-items: center; gap: 6px; min-width: 0; border-radius: 4px; }
.owner-link[role="link"] { cursor: pointer; border-radius: 4px; }
a.owner-link[href]:hover strong, .owner-link[data-owner-key]:hover strong { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; }
/* The home page filtered to one owner: their picture and name are the heading. */
.results-title { display: grid; min-width: 0; }
.results-owner { width: 36px; height: 36px; font-size: .95rem; }
.owner-close { align-self: center; margin-left: 2px; }
.results-head.is-owner h2 { font-size: 1.15rem; }
.owner-note { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.card-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.card-foot { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-top: auto; padding-top: 10px; }
.stat { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; white-space: nowrap; }
.stat b { color: var(--text); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.spark { margin-left: auto; color: var(--series-1); overflow: visible; }
.spark polyline { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw .9s var(--ease) .2s forwards; }

/* ---- Community page ------------------------------------------------------ */

.age-gate { max-width: 600px; margin: clamp(16px, 5vw, 64px) auto 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); }
.age-gate-preview { display: grid; place-items: center; min-height: clamp(108px, 20vw, 160px); border-bottom: 1px solid var(--line); }
.age-gate-preview .age-tag { min-height: 42px; padding-inline: 14px; border-radius: var(--radius-control); font-size: 1.05rem; }
.age-gate-form { display: grid; justify-items: center; gap: 12px; padding: clamp(20px, 5vw, 42px); text-align: center; }
.age-gate-form h1 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.age-gate-form .lead { overflow-wrap: anywhere; }
.age-gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }

/* Root banners are 3:1 (1800 x 600), so the frame is too: the whole banner shows, as it does on Root. */
.cover { aspect-ratio: 3 / 1; width: 100%; border-radius: var(--radius); }
.cover:not(:has(img)) { aspect-ratio: 7 / 1; min-height: 110px; }
/*
 * Only the avatar reaches up over the banner, by the same amount on every page.
 * Everything is pinned to the top of the row, so extra lines under the name
 * (like the owner) grow the header downwards and never pull the avatar off the banner.
 */
.identity { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px 18px; padding: 0 clamp(12px, 2.2vw, 24px); position: relative; }
.identity .avatar { margin-top: -46px; box-shadow: 0 0 0 4px var(--bg); }
.identity-text { min-width: 0; padding-top: 12px; }
.identity-text > .community-owner { margin-top: 6px; font-size: .9rem; }
.verified { display: inline-flex; align-items: center; justify-content: center; color: var(--good); font-size: .66em; line-height: 1; vertical-align: .08em; }
.verified.official { color: var(--official); }
h1 .verified.official { font-size: .8em; vertical-align: -.02em; }
.verified .icon { width: 1em; height: 1em; }
.identity-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: .9rem; }
.identity-meta .icon-btn { width: 28px; height: 28px; }
.handle { color: var(--dim); overflow-wrap: anywhere; }
.identity-actions { display: flex; align-items: center; padding-top: 16px; }
/* For owners, quiet and small: it closes the listing facts in the side column, its icon lined up with their labels. */
.manage-link { display: inline-flex; justify-self: start; align-items: center; gap: 6px; min-height: 28px; margin: -4px 0 0 -8px; padding: 0 8px; border-radius: var(--radius-control); color: var(--muted); font-size: .82rem; font-weight: 550; transition: color .16s, background-color .16s; }
.manage-link:hover { background: var(--raised); color: var(--text); }
.manage-link .icon { width: 14px; height: 14px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 24px; }
.tile { display: grid; gap: 4px; min-width: 0; padding: 14px 16px; }
.community .tiles { gap: 0; border-block: 1px solid var(--line); }
.community .tile + .tile { border-inline-start: 1px solid var(--line); }
.tile-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 550; }
.tile-value { display: flex; align-items: center; gap: 7px; font-size: 1.5rem; font-weight: 620; letter-spacing: -.02em; line-height: 1.3; }
.tile-value.muted { font-size: 1rem; font-weight: 550; letter-spacing: 0; line-height: 1.95; }
.tile-value.delta { font-size: 1.25rem; }
.tile-note { color: var(--dim); font-size: .78rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }

.columns { display: grid; grid-template-columns: minmax(0, 1fr) 244px; align-items: start; gap: 28px; margin-top: 24px; }
.main-col { display: grid; gap: 22px; min-width: 0; }
.main-col > .panel + .panel { border-block-start: 1px solid var(--line); padding-block-start: 18px; }
.main-col > .discussion { --community-gutter: 0px; }
.main-col > .discussion > .panel-head { padding-block-start: 0; }
.side-col { position: sticky; top: 76px; display: grid; gap: 14px; padding-inline-start: 20px; border-inline-start: 1px solid var(--line); }
.facts { display: grid; gap: 12px; }
.facts > div { display: grid; gap: 4px; }
.facts dt { color: var(--dim); font-size: .78rem; font-weight: 550; }
.facts dd { font-size: .9rem; }
/* Created on Root: the numbers carry the line, the words step back; the exact day is in the tooltip. */
.age { color: var(--muted); font-variant-numeric: tabular-nums; }
.age b { color: var(--text); font-size: 1.06rem; font-weight: 650; letter-spacing: -.01em; }
.age-mark { display: inline-block; margin-left: 6px; padding: 1px 7px; border: 1px solid var(--good-line); border-radius: var(--radius-tag); background: var(--good-wash); color: var(--good); font-size: .74rem; font-weight: 600; vertical-align: 1px; }
.facts.plain { padding: 0; border: 0; }
.facts.plain > div { grid-template-columns: 110px 1fr; align-items: center; }
.facts.plain a { color: var(--accent-strong); overflow-wrap: anywhere; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
/* The community's Root id: the short form underlined with dots, opening a panel with both forms that stays open. */
.fact-id { position: relative; }
.id-toggle { padding: 0; border: 0; background: none; color: var(--text); font: .84rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: left; overflow-wrap: anywhere; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); text-underline-offset: 4px; transition: color .16s, text-decoration-color .16s; }
.id-toggle:hover, .id-toggle[aria-expanded="true"] { color: var(--accent-strong); text-decoration-color: currentColor; }
.id-panel { position: absolute; z-index: 30; top: calc(100% + 10px); left: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; width: max-content; max-width: min(420px, calc(100vw - 32px)); padding: 8px 6px 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--chart-tooltip); box-shadow: var(--shadow); animation: id-panel .14s var(--ease); }
/* Each row a real box (on the panel's own columns), so its tooltip has something to point at. */
.id-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
.id-label { color: var(--muted); font-size: 12px; font-weight: 500; }
.id-panel code { min-width: 0; color: var(--text); font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: nowrap; user-select: all; }
.id-panel .icon-btn { width: 28px; height: 28px; }
.id-panel .icon-btn .icon { width: 14px; height: 14px; }
.id-note { grid-column: 1 / -1; margin-top: 4px; color: var(--muted); font-size: 12px; }
/* The same arrow as the tooltips, pointing at the id; the panel opens upward when there is no room below. */
.id-panel::before { content: ""; position: absolute; top: -1px; left: var(--caret, 24px); width: 9px; height: 9px; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); background: var(--chart-tooltip); transform: translate(-50%, -50%) rotate(45deg); }
.id-panel.is-above { top: auto; bottom: calc(100% + 10px); animation-name: id-panel-up; }
.id-panel.is-above::before { top: auto; bottom: -1px; border: 0; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); transform: translate(-50%, 50%) rotate(45deg); }
@keyframes id-panel { from { opacity: 0; transform: translateY(-3px); } }
@keyframes id-panel-up { from { opacity: 0; transform: translateY(3px); } }
@media (max-width: 420px) {
    .id-panel code { white-space: normal; overflow-wrap: anywhere; }
}

.chart-box { position: relative; height: 240px; }
.chart-box canvas { max-inline-size: 100%; opacity: 0; transition: opacity .4s; }
.chart-box.is-ready canvas { opacity: 1; }
.chart-box:not(.is-ready)::before { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.chart-note { margin-top: 10px; color: var(--dim); font-size: .84rem; }
.swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--series-1); }
.swatch.joins { background: var(--series-2); }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: .82rem; }
.legend li { display: flex; align-items: center; gap: 6px; }

.role { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 550; overflow-wrap: anywhere; }
.role span { color: var(--dim); font-size: .78rem; font-weight: 500; }
.role-dot { flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--c, var(--dim)); }
.community-roles { padding-block-start: 14px; border-block-start: 1px solid var(--line); }
.community-roles h2 { margin-block-end: 6px; font-size: .95rem; }
.roles .role { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 9px; min-block-size: 32px; padding-block: 5px; }
.roles .role + .role { border-block-start: 1px solid var(--line); }
.roles .role-dot { height: 8px; }
.roles .role-name { color: var(--text); font: inherit; }
.roles .role-count { justify-self: end; font-variant-numeric: tabular-nums; white-space: nowrap; }

.md { color: var(--text); font-size: .95rem; line-height: 1.65; overflow-wrap: anywhere; }
.md > * + * { margin-top: .7em; }
.md h3, .md h4, .md h5 { color: var(--text); font-weight: 620; line-height: 1.3; margin-top: 1.2em; }
.md h3 { font-size: 1.1rem; } .md h4 { font-size: 1rem; } .md h5 { font-size: .92rem; }
.md > :first-child { margin-top: 0; }
.md a { color: var(--accent-strong); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-strong) 55%, transparent); text-underline-offset: 3px; }
.md a:hover { text-decoration-color: currentColor; }
.md ul, .md ol { padding-left: 1.4em; }
.md ul { list-style: disc; } .md ol { list-style: decimal; }
.md li + li { margin-top: .2em; }
.md blockquote { margin: 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); color: var(--muted); }
.md code { padding: 1px 5px; border-radius: 4px; background: var(--raised); font: .86em ui-monospace, "Cascadia Mono", Consolas, monospace; }
.md pre { overflow-x: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); }
.md pre code { padding: 0; background: none; }
.md hr { height: 1px; border: 0; background: var(--line); }
.md del { color: var(--dim); }
.spoiler { border-radius: 4px; background: var(--line-strong); color: transparent; cursor: pointer; transition: color .2s, background-color .2s; }
.spoiler:hover, .spoiler:focus, .spoiler.is-open { background: var(--raised); color: inherit; }

/* ---- Comments ------------------------------------------------------------ */

.editor { min-width: 0; border: 1px solid var(--field-border); border-radius: var(--radius-control); background: var(--field); transition: border-color .16s, box-shadow .16s; }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.editor-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.editor-tabs, .editor-tools { display: flex; flex-wrap: wrap; gap: 2px; }
.editor-tabs button, .tool { min-height: 30px; padding: 4px 9px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-size: .82rem; font-weight: 600; transition: color .16s, background-color .16s; }
.tool { display: grid; place-items: center; width: 30px; padding: 0; }
.editor-tabs button:hover, .tool:hover { color: var(--text); background: var(--raised); }
.editor-tabs button[aria-selected="true"] { color: var(--accent-strong); background: var(--accent-wash); }
.editor textarea { field-sizing: content; min-block-size: 84px; max-block-size: 420px; padding: 12px; border: 0 !important; box-shadow: none !important; background: none; border-radius: 0 0 8px 8px; }
.editor[data-rich] textarea, .editor[data-rich] .editor-preview { min-block-size: 156px; }
.editor-preview { min-block-size: 84px; padding: 12px; }
.editor.is-preview .editor-tools { visibility: hidden; }

.composer { display: grid; gap: 12px; margin-bottom: 6px; }
.composer:not(.is-open) .editor-bar { display: none; }
.composer:not(.is-open) textarea { block-size: 44px; min-block-size: 44px; max-block-size: 44px; resize: none; overflow: hidden; border-radius: 8px; }
.composer-more { display: grid; gap: 12px; animation: rise .22s var(--ease); }
/* The comment box under the text: one row per question, label on the left, like the banner maker. */
.composer-fields { display: grid; gap: 10px; }
.composer-field { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 40px; }
.composer-label { color: var(--muted); font-size: .85rem; font-weight: 550; }
.composer-field input { width: 100%; max-width: 300px; min-height: 40px; padding-block: 8px; border: 1px solid var(--line-strong); }
.owner-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: .92rem; }
.owner-chip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-chip .avatar { width: 28px; height: 28px; }
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.captcha-row img { width: auto; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--field); }
.captcha-row .captcha-new { width: 40px; height: 40px; }
.captcha-row input { width: 160px; max-width: 100%; }
/* Typed letters read like the picture; the hint stays in the normal font. */
.captcha-row input:not(:placeholder-shown) { font-family: ui-monospace, Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; }
.captcha.is-wrong input { animation: nudge .3s var(--ease); border-color: var(--bad); }
/* Turnstile keeps out of the layout (no row, no gap) until Cloudflare asks for a tick; then it is a row like the name. */
.human-check:not(.is-asking) { position: absolute; inline-size: 1px; block-size: 1px; min-height: 0; overflow: hidden; }
.human-check-box { min-width: 0; max-width: 100%; overflow-x: auto; }
@media (max-width: 540px) {
    .composer-field { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .composer-field input { max-width: none; }
}

.threads, .replies { display: grid; }
.threads { margin-top: 8px; }
.comment { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 0 10px; padding-top: 14px; scroll-margin-top: 76px; }
.comment-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.thread-line { flex: 1; width: 100%; min-height: 6px; padding: 0; border: 0; background: none; position: relative; }
.thread-line::before { content: ""; position: absolute; inset: 0 auto 0 50%; width: 2px; border-radius: 2px; background: var(--line); transform: translateX(-50%); transition: background-color .16s; }
.thread-line:hover::before { background: var(--accent); }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 28px; font-size: .88rem; }
.comment-head time { color: var(--dim); font-size: .8rem; }
.collapsed-note { padding: 1px 7px; border: 0; border-radius: var(--radius-tag); background: var(--raised); color: var(--muted); font-size: .76rem; font-weight: 600; }
.comment-content { padding-top: 2px; }
.comment-actions { display: flex; gap: 6px; margin-top: 4px; }
.comment.is-collapsed > .comment-main > .comment-content, .comment.is-collapsed > .comment-rail > .thread-line { display: none; }
.comment.is-collapsed { opacity: .75; }
.comment.is-new > .comment-main { animation: flash 1.6s var(--ease); border-radius: 8px; }
.comment.is-target > .comment-main > .comment-content > .md { box-shadow: -3px 0 0 var(--accent); padding-left: 10px; margin-left: -13px; }
[data-reply-slot]:not(:empty) { margin-top: 10px; }
[data-reply-slot] .composer { margin: 0; }

/* ---- Add ---------------------------------------------------------------- */

.wizard { max-width: 960px; margin-inline: auto; }
.wizard.narrow { max-width: 600px; }
.wizard-head { display: grid; gap: 6px; }
.stepper { display: flex; gap: 8px; margin-top: 22px; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 9px; padding-top: 12px; border-top: 2px solid var(--line); color: var(--dim); font-size: .88rem; font-weight: 600; transition: color .3s; position: relative; }
.stepper li::before { content: ""; position: absolute; top: -2px; left: 0; width: 0; height: 2px; background: var(--accent); transition: width .45s var(--ease); }
.stepper li.is-done::before, .stepper li[aria-current]::before { width: 100%; }
.stepper li[aria-current] { color: var(--text); }
.stepper li.is-done { color: var(--muted); }
.step-mark { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: .78rem; transition: background-color .3s, border-color .3s, color .3s; }
.stepper li[aria-current] .step-mark { border-color: var(--accent); color: var(--accent-strong); }
.stepper li.is-done .step-mark { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
.wizard-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 22px; }
.wizard-body:has(.wizard-side:not([hidden])) { grid-template-columns: minmax(0, 1fr) 290px; }
.wizard.narrow .wizard-main { margin-top: 20px; }
.wizard-side { position: sticky; top: 72px; display: grid; gap: 10px; align-self: start; animation: rise .35s var(--ease); }
.step { display: grid; gap: 18px; animation: step-in .24s var(--ease); }
.step > h2 { margin: 0; font-size: 1.15rem; }
.howto { color: var(--muted); font-size: .9rem; }
.howto summary { width: fit-content; color: var(--accent-strong); font-weight: 550; cursor: pointer; }
.howto ol, .steps-list { display: grid; gap: 6px; margin-top: 10px; padding-left: 1.3em; list-style: decimal; color: var(--muted); font-size: .92rem; }
.steps-list { margin-top: 0; }
.howto b, .steps-list b { color: var(--text); }
.found { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-control); background: var(--field); animation: rise .24s var(--ease); }
.found-text { display: grid; min-width: 0; flex: 1; }
.found-text b { overflow-wrap: anywhere; }
.found-text span { color: var(--muted); font-size: .86rem; }
.found-check { display: inline-flex; align-items: center; gap: 5px; color: var(--good); font-size: .84rem; font-weight: 600; white-space: nowrap; }
.code-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: var(--radius-control); background: var(--field); }
.code-box code { font: 620 1.4rem/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; color: var(--text); user-select: all; }
.watch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-control); background: var(--field); }
.watch-text { display: grid; flex: 1; min-width: 0; }
.watch-text span { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.pulse { position: relative; flex: 0 0 auto; width: 10px; height: 10px; margin: 0 6px; border-radius: 50%; background: var(--accent); }
.pulse::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: radar 1.8s ease-out infinite; }
.watch.is-found { background: var(--good-wash); }
.watch.is-found .pulse, .watch.is-found .pulse::before { background: var(--good); animation: none; }
.done { justify-items: center; text-align: center; padding-block: 28px; }
.done .key-box { width: 100%; display: grid; gap: 8px; text-align: left; }
.success-mark { width: 52px; height: 52px; fill: none; stroke: var(--good); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.success-mark circle { stroke-dasharray: 145; stroke-dashoffset: 145; animation: draw .55s var(--ease) forwards; }
.success-mark path { stroke-dasharray: 34; stroke-dashoffset: 34; animation: draw .3s var(--ease) .45s forwards; }

/* ---- Dashboard ----------------------------------------------------------- */

.manage { display: grid; gap: 16px; }
.manage [data-dashboard], .manage [role="tabpanel"] { display: grid; gap: 18px; }
.manage [role="tabpanel"] { animation: step-in .22s var(--ease); }
.manage [role="tabpanel"] .tiles { margin-top: 0; }
.manage [data-m-details] { width: min(100%, 780px); padding: 0; background: transparent; }
.manage-section-links { display: flex; flex-wrap: wrap; gap: 6px; }
.manage-section-links .text-link { display: inline-flex; align-items: center; min-height: 34px; padding-inline: 10px; border-radius: var(--radius-control); background: var(--secondary-bg); text-decoration: none; }
.manage-section-links .text-link:hover { background: var(--hover); }
.manage .manage-section { display: grid; min-width: 0; gap: 16px; padding: 16px 0 6px; }
.manage-section + .manage-section { border-block-start: 1px solid var(--line); }
.manage .manage-section > .panel { padding: 0; }
.manage .manage-section > .panel-head { margin-bottom: 0; }
.manage .danger-zone.manage-section { display: flex; padding: 16px; }
[data-manage-section] { scroll-margin-block-start: 52px; }
.manage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.manage-title { flex: 1 1 220px; min-width: 0; }
.manage-title h1 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.manage-title p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.manage .tabs { position: sticky; z-index: 4; top: 56px; background: var(--bg); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: .9rem; font-weight: 600; white-space: nowrap; transition: color .16s, border-color .16s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.access { display: grid; gap: 22px; width: 100%; max-width: 560px; margin: 24px auto 0; }
.access-head { display: grid; justify-items: center; gap: 8px; text-align: center; }
.access-head .avatar { margin-bottom: 4px; }
.access-head h1 { font-size: 1.35rem; overflow-wrap: anywhere; }
.access-start { display: grid; gap: 18px; }
.access-form { display: grid; gap: 8px; }
.access-form h2 { margin-bottom: 4px; font-size: 1.02rem; }
.access-form > .btn { justify-self: start; margin-top: 6px; }
.access-form .copy-row > input:placeholder-shown { font-family: inherit; font-size: .94rem; }
.access-or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: .8rem; }
.access-or::before, .access-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.inline-form > div:first-child { flex: 1 1 280px; }
.inline-form h2 { margin-bottom: 4px; }
.inline-form .member-report-field { flex: 0 1 260px; }
.inline-form .copy-row input { font-family: inherit; font-size: .94rem; }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, .4fr); gap: 20px; align-items: start; }
.manage .art-grid > .art { padding: 0; }
.art { margin: 0; }
.art figcaption { margin-bottom: 10px; font-weight: 600; }
.art-view { position: relative; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--field); }
.art[data-art="banner"] .art-view { aspect-ratio: 3 / 1; }
.art[data-art="avatar"] .art-view { width: min(100%, 200px); aspect-ratio: 1; border-radius: 16px; }
.art-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-view .quiet { padding: 12px; font-size: .86rem; text-align: center; }
.role-editor { display: grid; gap: 8px; }
.role-editor li { display: flex; align-items: center; gap: 8px; animation: rise .22s var(--ease); }
.role-editor .role { flex: 1; padding: 8px 12px; }
.split-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; background: var(--error-bg); }
.danger-zone h2 { margin-bottom: 4px; }
.error-page { display: grid; justify-items: center; gap: 16px; padding: 80px 20px; text-align: center; }
.error-page > .icon { width: 30px; height: 30px; color: var(--dim); }
.error-page h1 { font-size: 1.4rem; max-width: 520px; }

/* ---- API page (api-docs.php, api-docs.js) --------------------------------- */

.api-docs { display: grid; gap: 30px; }
.api-head { display: grid; gap: 6px; }
.api-head > .quiet { font-size: 1rem; }
.api-base { display: inline-flex; justify-self: start; align-items: center; gap: 6px; max-width: 100%; margin-top: 8px; padding: 3px 3px 3px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.api-base code { overflow-x: auto; font: 500 .88rem ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: nowrap; }
.api-layout { display: grid; grid-template-columns: 184px minmax(0, 1fr); align-items: start; gap: 44px; }
.api-nav { position: sticky; top: 80px; display: grid; gap: 1px; font-size: .87rem; }
.api-nav a { padding: 5px 10px; border-radius: var(--radius-control); color: var(--muted); transition: color .16s, background-color .16s; }
.api-nav a:hover { background: var(--raised); color: var(--text); }
.api-nav a[aria-current] { background: var(--raised); color: var(--text); font-weight: 550; }
.api-content { display: grid; gap: 46px; min-width: 0; }
.api-content > section { display: grid; align-content: start; gap: 12px; min-width: 0; scroll-margin-top: 76px; }
.api-content h2 { font-size: 1.2rem; }
.api-content h3 { font-size: 1rem; }
.api-content p, .api-list { max-width: 72ch; color: var(--muted); }
.api-content p b, .api-list b { color: var(--text); }
.api-content a:not(.btn) { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.api-content :is(p, li, td, dt) > code { padding: 1px 5px; border-radius: 4px; background: var(--raised); color: var(--text); font: .84em ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.api-list { display: grid; gap: 6px; padding-left: 20px; list-style: disc; }
.api-list li::marker { color: var(--dim); }
.api-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.api-access { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 28px !important; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.api-access h2 { margin-bottom: 6px; }
.api-access p + p { margin-top: 4px; }
.method { display: inline-block; padding: 2px 7px; border-radius: var(--radius-tag); background: var(--good-wash); color: var(--good); font: 700 .7rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }

/* The console: pick, fill, send; the answer under it. */
/* The card does not clip, so the endpoint menu can open past its edge; the address row rounds its own corners while it is last. */
.console { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.console > .console-url:nth-last-child(1 of :not([hidden])) { border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
.console-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.console-bar .select-search { flex: 1; }
.console-bar .select-search-trigger { min-height: 38px; padding-block: 0; }
.console-bar .btn { min-height: 38px; }
.console-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 14px; }
.console-params { display: contents; }
.console-fields .field { gap: 5px; }
.console-fields .label { font: 600 .78rem ui-monospace, "Cascadia Mono", Consolas, monospace; }
.console-fields :is(input, select) { min-height: 38px !important; padding-block: 0; font-size: .88rem; }
.console-key { grid-column: 1 / -1; }
.console-key input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.console-url { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-top: 1px solid var(--line); background: var(--bg); }
.console-url code { flex: 1; min-width: 0; overflow-x: auto; color: var(--muted); font: .8rem/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: nowrap; scrollbar-width: thin; }
.console-answer { border-top: 1px solid var(--line); }
.answer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 10px 6px 14px; color: var(--muted); font-size: .84rem; }
.answer-bar .icon-btn { margin-left: auto; }
.tag.warn { background: var(--notice-bg); color: var(--warn); }
.json { max-height: 460px; margin: 0; padding: 4px 14px 16px; overflow: auto; color: var(--text); font: .8rem/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; tab-size: 2; }
.j-key { color: var(--text); }
.j-str { color: var(--good); }
.j-num { color: var(--warn); }
.j-bool, .j-null { color: var(--official); }

.code-block { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.code-block pre { margin: 0; padding: 12px 48px 12px 14px; overflow-x: auto; font: .82rem/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.code-block .icon-btn { position: absolute; top: 6px; right: 6px; }

/* The test suite: one row per check, marked as it runs. */
.suite { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.case { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 32px; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; }
.case + .case { border-top: 1px solid var(--line); }
.case-main { display: grid; gap: 1px; min-width: 0; }
.case-main b { font-size: .9rem; font-weight: 600; }
.case-expect { color: var(--muted); font-size: .8rem; }
.case-path { overflow: hidden; color: var(--dim); font: .74rem ui-monospace, "Cascadia Mono", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.case-result { color: var(--muted); font-size: .8rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.case-mark { position: relative; width: 14px; height: 14px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.case[data-state="run"] .case-mark { border-color: var(--muted); border-top-color: transparent; animation: spin .7s linear infinite; }
.case[data-state="pass"] .case-mark { border-color: var(--good); background: var(--good); }
.case[data-state="fail"] .case-mark { border-color: var(--bad); background: var(--bad); }
.case[data-state="wait"] .case-mark { border-color: var(--warn); }
.case[data-state="pass"] .case-mark::after { content: ""; position: absolute; left: 3.5px; top: 1px; width: 3.5px; height: 7px; border: solid var(--surface); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.case[data-state="fail"] .case-result { color: var(--bad); }
.case[data-state="wait"] .case-result { color: var(--warn); }

/* The reference: endpoints, fields, scopes, headers and errors. */
.endpoint { display: grid; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); scroll-margin-top: 76px; }
.endpoint + .endpoint { margin-top: 6px; }
.endpoint .suite { margin-top: 4px; }
.suite:empty { display: none; }
.endpoint-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.endpoint-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.api-content .endpoint-line code { padding: 0; background: none; font-size: .92rem; }
.table-scroll { overflow-x: auto; }
.api-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.api-table th { padding: 6px 14px 6px 0; color: var(--dim); font-size: .76rem; font-weight: 600; text-align: left; white-space: nowrap; }
.api-table td { padding: 8px 14px 8px 0; border-top: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.api-table td:first-child { color: var(--text); white-space: nowrap; }
.api-table .dim { color: var(--dim); font-size: .8rem; }
.api-scope-group { margin-bottom: -4px; font-size: .92rem; }
.api-scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.api-scopes > div { display: grid; align-content: start; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); }
.api-scopes dt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; }
.api-scopes dd { margin: 0; color: var(--muted); font-size: .84rem; }

@media (max-width: 900px) {
    .api-layout { grid-template-columns: minmax(0, 1fr); }
    .api-nav { display: none; }
}

@media (max-width: 600px) {
    .api-access { grid-template-columns: minmax(0, 1fr); }
    .api-access .btn { justify-self: start; }
    .console-bar { flex-wrap: wrap; }
    .console-bar .select-search { flex-basis: calc(100% - 60px); }
    .console-bar .btn { flex: 1; justify-content: center; }
    .api-scopes { grid-template-columns: minmax(0, 1fr); }
    .case { grid-template-columns: 18px minmax(0, 1fr) 32px; }
    .case-result { grid-column: 2; grid-row: 2; text-align: left; }
}

/* ---- Motion -------------------------------------------------------------- */

@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
@keyframes step-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes sheen-window { from { background-position: 100vw 0; } to { background-position: -100vw 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes radar { from { opacity: .5; transform: scale(1); } to { opacity: 0; transform: scale(3); } }
@keyframes flash { from { background: var(--accent-wash); box-shadow: 0 0 0 6px var(--accent-wash); } to { background: transparent; box-shadow: 0 0 0 6px transparent; } }
/* Moving between pages: the old page stays as it is while the bar at the top loads, then the
   new one replaces it in one step, already drawn. No fade, no flash, nothing that blinks. */

/* ---- Small screens ------------------------------------------------------- */

@media (max-width: 900px) {
    .columns { grid-template-columns: minmax(0, 1fr); }
    .side-col { position: static; padding: 18px 0 0; border-inline-start: 0; border-block-start: 1px solid var(--line); }
    .wizard-body:has(.wizard-side:not([hidden])) { grid-template-columns: 1fr; }
    .wizard-side { position: static; max-width: 340px; }
    .art-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    :root { scroll-padding-top: 62px; }
    .shell { width: calc(100% - 32px); }
    main { padding-block: 18px 56px; }
    .header-row { min-height: 52px; }
    .manage .tabs { top: 52px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; overflow: visible; }
    .manage .tabs button { flex-direction: column; justify-content: center; gap: 4px; min-height: 48px; padding: 6px 4px; margin-bottom: 0; font-size: .8rem; }
    .manage .tabs .count { display: none; }
    [data-add-link] span { display: none; }
    [data-add-link] { padding: 0 10px; }
    .cards { grid-template-columns: 1fr; }
    .identity { grid-template-columns: auto minmax(0, 1fr); }
    .identity .avatar { margin-top: -36px; }
    .identity-text { padding-top: 8px; }
    .avatar.xl { width: 72px; height: 72px; border-radius: 15px; font-size: 1.7rem; }
    .identity-actions { grid-column: 1 / -1; padding-top: 0; }
    .identity-actions, .identity-actions .btn { width: 100%; }
    .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .community .tile { padding-inline: 12px; }
    .community .tile + .tile { border-inline-start: 0; }
    .community .tile:nth-child(2n of :not([hidden])) { border-inline-start: 1px solid var(--line); }
    .community .tile:nth-child(n + 3 of :not([hidden])) { border-block-start: 1px solid var(--line); }
    .tile-value { font-size: 1.25rem; }
    .tile-value.delta { font-size: 1.02rem; }
    .panel:where(.manage *, .wizard *) { padding: 16px; }
    .step-actions .btn { white-space: normal; }
    input:not([type="radio"], [type="file"], [type="color"]), textarea, select { font-size: 16px; }
    .editor-bar { gap: 4px; }
    .editor-tools .tool { width: 26px; }
    .chart-box { height: 200px; }
    .comment { grid-template-columns: 24px minmax(0, 1fr); gap: 0 8px; }
    .comment .avatar.sm { width: 24px; height: 24px; }
    .stepper li { font-size: .8rem; gap: 6px; }
    .code-box code { font-size: 1.2rem; }
    .watch { flex-wrap: wrap; }
    .facts.plain > div { grid-template-columns: 1fr; }
    .captcha-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    :root { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .spark polyline, .success-mark circle, .success-mark path { stroke-dashoffset: 0; }
    .card-cover:not(:has(img)), .cover:not(:has(img)), .avatar:not(:has(img)) { background-image: none; }
}

/* The list of Root calls. The server only sends it when env is not production. */
.debug-trace { position: fixed; left: 16px; bottom: 16px; z-index: 65; display: flex; flex-direction: column; width: min(calc(100vw - 32px), 440px); max-height: min(60vh, 520px); border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--surface); box-shadow: var(--shadow); font-size: .82rem; }
.debug-trace[hidden] { display: none; }
.debug-trace header { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--line); }
.debug-trace header span, .debug-trace code { color: var(--dim); font: .74rem ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.debug-close { display: grid; place-items: center; width: 26px; height: 26px; margin-left: auto; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.debug-close:hover { background: var(--hover); color: var(--text); }
.debug-trace ol { margin: 0; padding: 0; overflow: auto; list-style: none; }
.debug-trace li { padding: 6px 12px; }
.debug-trace li + li { border-top: 1px solid var(--line); }
.debug-trace li > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.debug-trace li b { font-weight: 600; color: var(--bad); }
.debug-trace li.is-ok b { color: var(--good); }
.debug-trace li.is-skipped b { color: var(--warn); }
.debug-trace p { margin: 2px 0 0; color: var(--muted); line-height: 1.4; overflow-wrap: anywhere; }

/* One tooltip look for the whole site, the same as the charts' (charts.js): the card graph's
   label (.spark-tip, placed in directory.css) and every title and alt text (.tip, placed by
   app.js). A muted 12 px title, the value in 13 px semibold, muted 12 px lines under it. */
.tip, .spark-tip, .chart-tip { padding: 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--chart-tooltip); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.35; pointer-events: none; }
.tip-title { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
/* The arrow, like the charts' caret: under the tooltip pointing down, or over it when the tooltip
   sits below its element. --caret is where along the tooltip the pointed-at thing is. */
.tip::after, .spark-tip::after, .chart-tip::after { content: ""; position: absolute; left: var(--caret, 50%); bottom: -1px; width: 9px; height: 9px; background: var(--chart-tooltip); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); transform: translate(-50%, 50%) rotate(45deg); }
.tip.is-below::after { top: -1px; bottom: auto; border: 0; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); transform: translate(-50%, -50%) rotate(45deg); }
.tip-foot { display: grid; gap: 2px; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.tip-title[hidden], .tip-foot[hidden], .tip-foot > [hidden] { display: none; }
/* In the lines under the value, only the numbers stand out: a gain green, a loss red, the rest white. */
.tip-foot b { color: var(--text); font-weight: 600; }
.tip-foot b.tip-up { color: var(--good); }
.tip-foot b.tip-down { color: var(--bad); }
/* The community chart's tooltip, placed by charts.js at the hovered day. It only fades, never slides. */
.chart-tip { position: absolute; z-index: 3; top: var(--y, 0); left: var(--x, 0); display: grid; justify-items: start; white-space: nowrap; opacity: 0; transform: translate(calc(-1 * var(--caret, 50%)), calc(-100% - 14px)); transition: opacity .12s; }
.chart-box.is-tipping .chart-tip { opacity: 1; }
/* Plain text by default; a tooltip with markup (data-tip-html) sets its own bold line, one part per line like the chart's. */
.tip { font-weight: 400; }
.tip:has(> .tip-title, > b) { display: grid; justify-items: start; }
.tip { position: fixed; top: 0; left: 0; z-index: 90; max-width: min(280px, calc(100vw - 16px)); overflow-wrap: anywhere; opacity: 0; transform: translateY(3px); transition: opacity .12s, transform .12s; }
.tip.is-below { transform: translateY(-3px); }
.tip.is-shown { opacity: 1; transform: none; }
.tip[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tip { transition: none; transform: none; } }

/* An on/off switch (role="switch"), used for the admin's Verified by Root badge. */
.switch-label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.switch { position: relative; flex: none; width: 40px; height: 24px; padding: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--field); cursor: pointer; transition: background-color .16s, border-color .16s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .16s var(--ease), background-color .16s; }
.switch[aria-checked="true"] { border-color: var(--official); background: var(--official); }
.switch[aria-checked="true"]::after { background: #fff; transform: translateX(16px); }
.switch:disabled { cursor: default; opacity: .6; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch-label .verified { font-size: 1em; }
.ban-effects { margin: 0; padding-left: 20px; color: var(--muted); list-style: disc; line-height: 1.5; }

/* The banner: a preview in a community page's side column, and the dialog that makes the embed code (banner.js). */
.banner-teaser, .join-teaser { display: grid; gap: 10px; margin-top: 20px; }
.banner-teaser h2, .join-teaser h2 { margin: 0; font-size: 1rem; }
.join-teaser .quiet, .join-teaser .identity-meta { margin: 0; }
.banner-thumb { display: block; width: 100%; height: auto; border-radius: 10px; }
.banner-teaser .btn { justify-self: start; }
.banner-dialog { width: min(94vw, 680px); max-height: 92vh; overflow: auto; }
.banner-dialog .panel-head { margin-bottom: 2px; }
.banner-dialog > .quiet { margin: 0 0 14px; }
.banner-stage { display: grid; place-items: center; min-height: 120px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.banner-stage img { display: block; max-width: 100%; height: auto; transition: opacity .16s; }
.banner-stage img.is-loading { opacity: .55; }
.banner-options { display: grid; gap: 10px; margin: 16px 0; }
.banner-option { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 30px; }
.banner-option > .segmented { justify-self: start; }
.banner-option-label { color: var(--muted); font-size: .85rem; }
.banner-art { display: flex; align-items: center; gap: 10px; min-width: 0; }
.banner-art label { margin: 0; font-size: .85rem; cursor: pointer; }
.banner-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.banner-swatch { position: relative; width: 26px; height: 26px; padding: 0; border: 2px solid transparent; border-radius: 5px; background: var(--swatch); box-shadow: inset 0 0 0 1px #ffffff26; cursor: pointer; transition: border-color .16s; }
.banner-swatch:hover { border-color: var(--line-hover); }
.banner-swatch[aria-pressed="true"], .banner-swatch.is-selected { border-color: var(--text); }
.banner-swatch:focus-visible, .banner-custom:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.banner-swatch[data-value="root"] { --swatch: #3b6af8; }
.banner-swatch[data-value="violet"] { --swatch: #8b5cf6; }
.banner-swatch[data-value="emerald"] { --swatch: #10b981; }
.banner-swatch[data-value="amber"] { --swatch: #f59e0b; }
.banner-swatch[data-value="rose"] { --swatch: #f43f5e; }
.banner-swatch[data-value="cyan"] { --swatch: #06b6d4; }
.banner-swatch[data-value="mono"] { --swatch: linear-gradient(135deg, var(--text) 50%, var(--raised) 50%); }
.banner-custom { --swatch: conic-gradient(#f43f5e, #f59e0b, #10b981, #06b6d4, #3b6af8, #8b5cf6, #f43f5e); overflow: hidden; }
.banner-custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.banner-code { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.banner-code .copy-row { align-items: center; }
/* Phones: each label sits above its choices so four buttons still fit. */
@media (max-width: 520px) {
    .banner-option { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}
.banner-code input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .8rem; }
.banner-hint { margin: 0; font-size: .82rem; }
.manage-banner { margin-top: 0; }
.manage-banner .quiet { margin: 0; }
.manage-banner .banner-thumb { max-width: 600px; }

/* ---- Community colours ----------------------------------------------------
   A community page takes its colours from its banner or picture (CommunityPalette, which
   links /colors/<hue>-<strength>.css): --cd-* for dark and --cl-* for light, used while
   <html> has data-community-theme. The whole page follows:
   background, surfaces, lines, text, links, buttons and the chart. Badges, growth and the
   live dot keep their own colours, since they mean the same on every page. */

:root[data-community-theme]:not([data-theme="light"]) {
    --bg: var(--cd-bg);
    --surface: var(--cd-surface);
    --field: var(--cd-field);
    --raised: var(--cd-raised);
    --hover: var(--cd-hover);
    --line: var(--cd-line);
    --line-strong: var(--cd-line-strong);
    --line-hover: var(--cd-line-hover);
    --text: var(--cd-text);
    --muted: var(--cd-muted);
    --dim: var(--cd-dim);
    --accent: var(--cd-accent);
    --accent-strong: var(--cd-accent-strong);
    --accent-ink: var(--cd-accent-ink);
    --accent-wash: var(--cd-accent-wash);
    --series-1: var(--cd-series-1);
    --chart-tooltip: var(--cd-chart-tooltip);
    --spark-bg: var(--cd-spark-bg);
    --spark-bg-hover: var(--cd-spark-bg-hover);
    --header-bg: var(--cd-header-bg);
    --primary-bg: var(--cd-primary-bg);
    --primary-hover: var(--cd-primary-hover);
    --primary-ink: var(--cd-primary-ink);
    --secondary-bg: var(--cd-secondary-bg);
    --segmented-bg: var(--cd-segmented-bg);
    --choice-active: var(--cd-choice-active);
}

:root[data-community-theme][data-theme="light"] {
    --bg: var(--cl-bg);
    --surface: var(--cl-surface);
    --field: var(--cl-field);
    --raised: var(--cl-raised);
    --hover: var(--cl-hover);
    --line: var(--cl-line);
    --line-strong: var(--cl-line-strong);
    --line-hover: var(--cl-line-hover);
    --text: var(--cl-text);
    --muted: var(--cl-muted);
    --dim: var(--cl-dim);
    --accent: var(--cl-accent);
    --accent-strong: var(--cl-accent-strong);
    --accent-ink: var(--cl-accent-ink);
    --accent-wash: var(--cl-accent-wash);
    --series-1: var(--cl-series-1);
    --chart-tooltip: var(--cl-chart-tooltip);
    --spark-bg: var(--cl-spark-bg);
    --spark-bg-hover: var(--cl-spark-bg-hover);
    --header-bg: var(--cl-header-bg);
    --primary-bg: var(--cl-primary-bg);
    --primary-hover: var(--cl-primary-hover);
    --primary-ink: var(--cl-primary-ink);
    --secondary-bg: var(--cl-secondary-bg);
    --segmented-bg: var(--cl-segmented-bg);
    --choice-active: var(--cl-choice-active);
    --primary-border: transparent;
}

/* The banner, blurred, behind the top of the page, fading into the dimmer background below. */
.community { position: relative; z-index: 0; }
.community-backdrop {
    position: absolute;
    z-index: -1;
    top: -120px;
    left: 50%;
    width: 100vw;
    height: clamp(560px, 92vh, 900px);
    overflow: hidden;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: .5;
    -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 20%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0, #000 20%, transparent 100%);
}
.community-backdrop img { position: absolute; inset: -12%; width: 124%; max-width: none; height: 124%; object-fit: cover; filter: blur(64px) saturate(1.3) brightness(.85); }
:root[data-theme="light"] .community-backdrop { opacity: .34; }
:root[data-theme="light"] .community-backdrop img { filter: blur(64px) saturate(1.4); }
@media (prefers-reduced-transparency: reduce) {
    .community-backdrop { display: none; }
}

/* ---- Holiday look (Config::holiday: 28 November to 15 January) ---------------
   A Santa hat on the logo, a little snow along the top of community banners, a Hub
   village in the snow above the footer and a cap on the main buttons. The snow has
   its own blue-grey edge, so it reads on the dark and light themes and on any banner. */
:root { --hat: #e5484d; --hat-fur: #fff; --hat-edge: #08090b; }
:root[data-theme="light"] { --hat-edge: #c3ccd6; }
.brand-logo { overflow: visible; }
.brand-hat .hat { fill: var(--hat); }
.brand-hat .fur { fill: var(--hat-fur); stroke: var(--hat-edge); stroke-width: .7; stroke-linejoin: round; }
/* The hat wiggles on hover, on keyboard focus, once a moment after the page opens, and on a
   click (holiday.js adds .is-jolly and throws the snow and confetti). */
.brand-hat, .brand-hat-sway, .brand-hat .pom, .brand-sparkle { transform-box: view-box; }
.brand-hat, .brand-hat-sway { transform-origin: 16px 2px; }
.brand-hat .pom { transform-origin: 34.4px -3.1px; }
.brand-sparkle { transform-origin: 145.6px -1.8px; }
/* A little decoration on the wordmark: snow on R, T, H and B, a holly sprig on the B and one
   sparkle. The snow is icy blue on the dark theme, where the letters are already white. */
:root { --logo-snow: #d3e9f8; --logo-snow-edge: transparent; }
:root[data-theme="light"] { --logo-snow: #fff; --logo-snow-edge: #b9c7d4; }
.brand-snow { fill: var(--logo-snow); stroke: var(--logo-snow-edge); stroke-width: .35; stroke-linejoin: round; }
.brand-leaf { fill: #2b8f64; }
.brand-berry { fill: var(--hat); }
.brand-sparkle { fill: #ffc83d; opacity: .9; }
@media (prefers-reduced-motion: no-preference) {
    .brand-hat-sway { animation: hat-sway 4.8s ease-in-out infinite alternate; }
    .brand-sparkle { animation: logo-sparkle 3.6s ease-in-out infinite; }
    .brand-hat { animation: hat-wiggle .9s ease-in-out 1.4s; }
    .brand:hover .brand-hat, .brand:focus-visible .brand-hat, .brand.is-jolly .brand-hat { animation: hat-wiggle .9s ease-in-out; }
    .brand:hover .brand-hat .pom, .brand.is-jolly .brand-hat .pom { animation: pom-bounce .9s ease-in-out; }
}
@keyframes hat-wiggle {
    0%, 100% { transform: rotate(0); }
    18% { transform: rotate(-9deg); }
    40% { transform: rotate(7deg); }
    62% { transform: rotate(-4deg); }
    82% { transform: rotate(2deg); }
}
@keyframes hat-sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2deg); } }
@keyframes logo-sparkle { 0%, 55%, 100% { opacity: 0; transform: scale(.3) rotate(0); } 70% { opacity: 1; transform: scale(1.15) rotate(45deg); } 85% { opacity: .8; transform: scale(.9) rotate(90deg); } }
@keyframes pom-bounce {
    0%, 100% { transform: translate(0, 0); }
    30% { transform: translate(1.2px, 2.2px); }
    60% { transform: translate(-.6px, -1px); }
}
.holiday-burst { position: fixed; inset: 0; z-index: 66; overflow: hidden; pointer-events: none; }
/* holiday.js: the falling snow, the piles on cards and buttons, and the snow coming off them. Above
   the header so the header button's snow can fall off too; the script clips other piles below it. */
.holiday-snow { position: fixed; inset: 0; z-index: 45; width: 100%; height: 100%; pointer-events: none; }
.holiday-bit { position: absolute; width: 7px; height: 7px; border-radius: 50%; }
.holiday-bit.snow { background: #f5f9fd; box-shadow: 0 0 0 1px #b4c6d6; }
.holiday-bit:not(.snow) { width: 9px; height: 4px; border-radius: 1px; }
.holiday-chip { position: absolute; padding: 4px 9px; border-radius: 5px; background: var(--hat); color: #fff; font-size: .78rem; font-weight: 700; line-height: 1.2; white-space: nowrap; box-shadow: 0 4px 14px #0004; transform-origin: 0 0; }

/* Still snow on banners and main buttons, for people who ask for less motion. Everyone else gets
   the real thing from holiday.js: snow that lands, piles up and comes off when touched. */
@media (prefers-reduced-motion: reduce) {
    [data-holiday] .card-cover::after, [data-holiday] .cover::after {
        content: ""; position: absolute; z-index: 1; inset: 0 0 auto; height: 8px; pointer-events: none;
        background: url("holiday/snow-drape.svg") repeat-x 0 0 / 91.4px 8px; /* the drape's own 160:14 shape */
        filter: drop-shadow(0 1px 1px #0003);
    }
    [data-holiday] .card-cover .tag, [data-holiday] .card-cover .age-tag, [data-holiday] .cover > .rank-emblem { z-index: 2; }
    [data-holiday] .btn-primary { position: relative; }
    [data-holiday] .btn-primary::before {
        content: ""; position: absolute; left: 7px; right: 7px; top: -5px; height: 8px; pointer-events: none;
        background: url("holiday/snow-cap.svg") no-repeat 0 0 / 100% 100%;
    }
}

/* The footer scene (views/_holiday_scene.php): night hills, then a little Hub village standing
   in a snow drift right on top of the footer. Clicks are handled in holiday.js. */
:root {
    --hs-hill-far: #121a26; --hs-hill-near: #182233; --hs-snow: #f5f9fd; --hs-snow-edge: #9fb4c7;
    --hs-pine: #2b8f64; --hs-pine-shade: #1f7350; --hs-ink: #0b0c0e;
}
:root[data-theme="light"] { --hs-hill-far: #e6eef6; --hs-hill-near: #dbe6f0; --hs-snow: #fbfdff; --hs-snow-edge: #a6bccf; }
[data-holiday] .site-footer { position: relative; margin-top: 128px; border-top-color: transparent; }
.holiday-scene { position: absolute; left: 0; right: 0; bottom: 100%; height: 120px; overflow: hidden; pointer-events: none;
    background:
        radial-gradient(ellipse 26% 70% at 10% 118%, var(--hs-hill-near) 0 60%, transparent 61%),
        radial-gradient(ellipse 34% 64% at 62% 120%, var(--hs-hill-near) 0 60%, transparent 61%),
        radial-gradient(ellipse 40% 88% at 34% 128%, var(--hs-hill-far) 0 60%, transparent 61%),
        radial-gradient(ellipse 38% 92% at 90% 128%, var(--hs-hill-far) 0 60%, transparent 61%); }
.holiday-scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: url("holiday/snow-drift.svg") repeat-x 0 100% / 240px 26px; }
:root[data-theme="light"] .holiday-scene::after { background-image: url("holiday/snow-drift-light.svg"); }
.holiday-scene svg { position: absolute; left: 50%; bottom: 0; width: 1200px; height: 120px; overflow: visible; transform: translateX(-50%); }
.holiday-scene [data-holiday] { pointer-events: visiblePainted; cursor: pointer; }
.hs-outline { fill: var(--hs-ink); stroke: var(--hs-ink); stroke-width: 2.4; stroke-linejoin: round; }
.hs-plate { fill: #17191d; }
.hs-frame, .hs-fill-white { fill: #fff; }
.hs-fill-node { fill: #55d7a3; }
.hs-fill-ink { fill: var(--hs-ink); }
.hs-tophat .hs-fill-ink { stroke: var(--hs-hat-edge, #5d6673); stroke-width: 1; }
:root[data-theme="light"] .hs-tophat .hs-fill-ink { stroke: none; }
.hs-fill-hat { fill: var(--hat); }
.hs-fill-gold { fill: #ffc83d; }
.hs-fill-scarf { fill: #55d7a3; }
.hs-fill-scarf-shade { fill: none; stroke: #2f9a6f; stroke-width: .9; }
.hs-fill-carrot { fill: #ff8a3d; }
.hs-fur { fill: #fff; stroke: var(--hs-ink); stroke-width: .7; stroke-linejoin: round; }
.hs-eye { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.hs-eye-node { stroke: #55d7a3; }
.hs-snow { fill: var(--hs-snow); stroke: var(--hs-snow-edge); stroke-width: 1.2; }
.hs-stick { fill: none; stroke: #7a5534; stroke-width: 2.2; stroke-linecap: round; }
.hs-trunk { fill: #7a5534; }
.hs-needles { fill: var(--hs-pine); }
.hs-needles-shade { fill: var(--hs-pine-shade); }
.hs-tip { fill: var(--hs-snow); }
.hs-star { fill: #ffc83d; stroke: #b07c10; stroke-width: .8; stroke-linejoin: round; }
.hs-bulb-0 { fill: #ff5c63; } .hs-bulb-1 { fill: #ffc83d; } .hs-bulb-2 { fill: #5bc0ff; } .hs-bulb-3 { fill: #fff; }
.hs-peeker .hs-hop { transform: translateY(15px); }
.hs-hop, .hs-idle, .hs-sway, .hs-wave, .hs-tophat, .hs-lid, .hs-star { transform-box: fill-box; transform-origin: 50% 100%; }
.hs-wave { transform-origin: 0 100%; }
.hs-santa .hs-face { transform: translateX(.7px); }   /* the two snowball players face each other */
.hs-scarf .hs-face { transform: translateX(-.7px); }
.hs-ball, .hs-splash { opacity: 0; }
.hs-splash { transform-box: fill-box; transform-origin: 50% 50%; }
/* Idle play, all on one slow 14 s round so it never gets busy: the Santa bubble throws a
   snowball, the scarf bubble flinches, the beanie bubble cheers, the snowman waves, the
   scarf bubble throws one back, the presents rattle and the bubble behind the pine peeks.
   The pines sway in a light breeze. Hovering anything gives it a little jiggle. */
@media (prefers-reduced-motion: no-preference) {
    .hs-pine .hs-idle { animation: hs-breeze 6.5s ease-in-out infinite alternate; }
    .hs-pine:nth-of-type(2n) .hs-idle { animation-duration: 7.8s; animation-delay: -2.4s; }
    .hs-santa .hs-idle { animation: hs-santa 14s ease-in-out infinite; }
    .hs-scarf .hs-idle { animation: hs-scarf 14s ease-in-out infinite; }
    .hs-beanie .hs-idle { animation: hs-cheer 14s ease-in-out infinite; }
    .hs-peeker .hs-idle { animation: hs-peek-idle 14s ease-in-out infinite; }
    .hs-snowman .hs-wave { animation: hs-wave-idle 14s ease-in-out infinite; }
    .hs-gift .hs-idle { animation: hs-rattle 14s ease-in-out infinite; }
    .hs-gift-small .hs-idle { animation-delay: -5s; }
    .hs-ball-santa { animation: hs-ball-santa 14s linear infinite; }
    .hs-ball-scarf { animation: hs-ball-scarf 14s linear infinite; }
    .hs-splash-scarf { animation: hs-splash-scarf 14s ease-out infinite; }
    .hs-splash-santa { animation: hs-splash-santa 14s ease-out infinite; }
    /* Hover, at the same weight as the click rules below so a click (.is-on) wins. */
    .hs-bubble:hover .hs-hop, .hs-gift:hover .hs-hop, .hs-snowman:hover .hs-hop { animation: hs-jiggle .55s ease-in-out; }
    .hs-pine:hover .hs-sway { animation: hs-shake .7s ease-in-out; }
    .hs-peeker:hover .hs-hop { animation: hs-peek 1.6s cubic-bezier(.3, .7, .4, 1); }
    .hs-bulb { animation: hs-twinkle 2.6s ease-in-out infinite alternate; }
    .hs-bulb:nth-of-type(3n) { animation-delay: -.9s; } .hs-bulb:nth-of-type(3n+1) { animation-delay: -1.7s; }
    .hs-star { animation: hs-glow 3.2s ease-in-out infinite alternate; }
    .hs-pine.is-on .hs-sway { animation: hs-shake .7s ease-in-out; }
    .hs-pine.is-on .hs-bulb { animation: hs-twinkle .22s steps(2) 6 alternate; }
    .hs-bubble.is-on .hs-hop, .hs-gift.is-on .hs-hop { animation: hs-hop .6s cubic-bezier(.3, .7, .4, 1); }
    .hs-peeker.is-on .hs-hop { animation: hs-peek 1.6s cubic-bezier(.3, .7, .4, 1); }
    .hs-gift.is-on .hs-lid { animation: hs-lid .8s cubic-bezier(.3, .7, .4, 1); }
    .hs-snowman.is-on .hs-wave { animation: hs-wave .9s ease-in-out; }
    .hs-snowman.is-on .hs-tophat { animation: hs-hop .7s cubic-bezier(.3, .7, .4, 1) .1s; }
}
@keyframes hs-twinkle { from { opacity: .45; } to { opacity: 1; } }
@keyframes hs-glow { from { transform: scale(.92); } to { transform: scale(1.06); } }
@keyframes hs-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-4deg); } 45% { transform: rotate(3deg); } 70% { transform: rotate(-1.5deg); } }
@keyframes hs-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.08, .9); } 45% { transform: translateY(-12px) scale(.96, 1.05); } 75% { transform: translateY(0) scale(1.05, .95); } }
@keyframes hs-peek { 0%, 100% { transform: translateY(15px); } 25%, 70% { transform: translateY(-4px); } }
@keyframes hs-lid { 0%, 100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-10px) rotate(-14deg); } 65% { transform: translateY(-4px) rotate(6deg); } }
@keyframes hs-wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-22deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-18deg); } }
@keyframes hs-jiggle { 0%, 100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-6deg) scale(1.04); } 50% { transform: rotate(5deg); } 75% { transform: rotate(-2deg); } }
@keyframes hs-breeze { from { transform: rotate(-1.3deg); } to { transform: rotate(1.3deg); } }
@keyframes hs-santa {
    0%, 10%, 20%, 63%, 78%, 100% { transform: none; }
    13% { transform: rotate(-7deg); }                       /* wind up */
    16% { transform: translateX(2px) rotate(6deg); }        /* throw */
    66% { transform: translateX(-3px) scale(1.07, .9); }    /* hit */
    69% { transform: translateX(-2px) rotate(-6deg); }
    73% { transform: rotate(3deg); }
}
@keyframes hs-scarf {
    0%, 22%, 36%, 52%, 63%, 100% { transform: none; }
    24% { transform: translateX(3px) scale(1.07, .9); }     /* hit */
    27% { transform: rotate(6deg); }
    31% { transform: rotate(-3deg); }
    55% { transform: rotate(7deg); }                        /* wind up */
    58% { transform: translateX(-2px) rotate(-6deg); }      /* throw */
}
@keyframes hs-cheer {
    0%, 24%, 30%, 35%, 66%, 72%, 100% { transform: none; }
    27% { transform: translateY(-9px); } 32% { transform: translateY(-5px); } 69% { transform: translateY(-9px); }
}
@keyframes hs-peek-idle { 0%, 80%, 97%, 100% { transform: none; } 85%, 93% { transform: translateY(-17px); } }
@keyframes hs-wave-idle { 0%, 40%, 52%, 100% { transform: rotate(0); } 43% { transform: rotate(-20deg); } 46% { transform: rotate(6deg); } 49% { transform: rotate(-16deg); } }
@keyframes hs-rattle { 0%, 86%, 91%, 100% { transform: none; } 87% { transform: rotate(-6deg); } 88% { transform: rotate(5deg); } 89% { transform: rotate(-4deg); } 90% { transform: rotate(3deg); } }
@keyframes hs-ball-santa {
    0%, 15.9% { opacity: 0; transform: translate(0, 0); }
    16% { opacity: 1; transform: translate(0, 0); }
    18% { transform: translate(35px, -22px); } 20% { transform: translate(70px, -31px); } 22% { transform: translate(105px, -24px); }
    24% { opacity: 1; transform: translate(138px, -8px); }
    24.4%, 100% { opacity: 0; transform: translate(138px, -8px); }
}
@keyframes hs-ball-scarf {
    0%, 57.9% { opacity: 0; transform: translate(0, 0); }
    58% { opacity: 1; transform: translate(0, 0); }
    60% { transform: translate(-43px, -24px); } 62% { transform: translate(-86px, -33px); } 64% { transform: translate(-129px, -26px); }
    66% { opacity: 1; transform: translate(-170px, -6px); }
    66.4%, 100% { opacity: 0; transform: translate(-170px, -6px); }
}
@keyframes hs-splash-scarf { 0%, 23.9% { opacity: 0; transform: scale(.4); } 24% { opacity: 1; transform: scale(.6); } 28%, 100% { opacity: 0; transform: scale(1.6); } }
@keyframes hs-splash-santa { 0%, 65.9% { opacity: 0; transform: scale(.4); } 66% { opacity: 1; transform: scale(.6); } 70%, 100% { opacity: 0; transform: scale(1.6); } }
.holiday-chip.is-centered { transform-origin: 50% 100%; }
.holiday-chip a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.holiday-burst:has(a) { pointer-events: none; }
.holiday-burst .holiday-chip:has(a) { pointer-events: auto; }

/* Christmas lights draped along the top of some cards' covers (holiday.js): small bulbs with a soft
   glow, like lights at night, twinkling slowly out of step. They hang under the tags and emblems. */
.holiday-lights { position: absolute; z-index: 1; top: 0; left: 0; pointer-events: none; overflow: visible; }
.hl-wire { fill: none; stroke: #4a5a50; stroke-width: 1; opacity: .8; }
:root[data-theme="light"] .hl-wire { stroke: #3f5246; }
.hl-cap { fill: #6b7076; }
.hl-glow { opacity: .7; mix-blend-mode: screen; }
:root[data-theme="light"] .hl-glow { mix-blend-mode: normal; opacity: .45; }
[data-lit="1"] .tag, [data-lit="1"] .age-tag, [data-lit="1"] .rank-emblem { z-index: 2; }
@media (prefers-reduced-motion: no-preference) {
    .hl-glow { animation: hl-twinkle 3.4s ease-in-out infinite alternate; }
    .hl-d1 .hl-glow { animation-delay: -.6s; animation-duration: 2.9s; } .hl-d2 .hl-glow { animation-delay: -1.3s; }
    .hl-d3 .hl-glow { animation-delay: -2.1s; animation-duration: 3.9s; } .hl-d4 .hl-glow { animation-delay: -.3s; animation-duration: 4.4s; }
    .hl-d5 .hl-glow { animation-delay: -2.7s; animation-duration: 3.1s; }
}
@keyframes hl-twinkle { from { opacity: .25; } to { opacity: .85; } }

/* A button gives a springy little shake when you point at it or press it; holiday.js throws its
   snow off at the same moment. */
@media (prefers-reduced-motion: no-preference) {
    [data-holiday] .btn.is-shaking { animation: btn-jiggle .5s cubic-bezier(.3, .7, .4, 1); }
}
/* Hover jiggle only where there is a real pointer: on phones a tap leaves :hover stuck. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
    [data-holiday] .btn-primary:hover, [data-holiday] .btn-secondary:hover { animation: btn-jiggle .5s cubic-bezier(.3, .7, .4, 1); }
}
@keyframes btn-jiggle {
    0%, 100% { transform: none; }
    14% { transform: scale(1.05, .92); }
    32% { transform: rotate(-3deg) scale(.97, 1.04); }
    52% { transform: rotate(2.5deg); }
    72% { transform: rotate(-1.2deg); }
}
/* Santa's sleigh (holiday.js) flies across now and then, behind the page, so it only shows in
   the empty space and never covers anything. */
[data-holiday] body { background: transparent; }   /* html paints the same colour, so the sleigh can show between them */
.holiday-sleigh { position: fixed; z-index: -1; top: 0; left: 0; width: 210px; height: 66px; pointer-events: none; color: #cfdeec; opacity: .55; }
:root[data-theme="light"] .holiday-sleigh { color: #8fa6bb; opacity: .6; }
.holiday-sleigh .nose { fill: #ff5c63; }
.holiday-sleigh .hat { fill: var(--hat); }
.holiday-sleigh .eye { fill: none; stroke: #0b0c0e; stroke-width: 1.2; stroke-linecap: round; }


/* The community's colour where the eye lands: the tile icons and the sidebar tags. */
:root[data-community-theme] .community .tile-label .icon { color: var(--accent); }
:root[data-community-theme] .community .facts .tag { background: var(--accent-wash); color: var(--accent-strong); }
:root[data-community-theme] .community .facts a.tag:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
