/* Wordmark and local fonts recovered from archive/go-forum. */
@font-face {
    font-family: Figtree;
    src: url('/fonts/figtree.woff2') format('woff2');
    font-weight: 300 900;
    font-display: swap;
}

@font-face {
    font-family: Fredoka;
    src: url('/fonts/fredoka.woff2') format('woff2');
    font-weight: 300 700;
    font-display: swap;
}

/* `hidden` always hides, whatever display a class sets (the server's pages toggle it). */
[hidden] { display: none !important; }

/* shrine.party: a dark ground, panels a step lighter, one coral accent. Work mode (work.css)
   gives every token a light value. */
:root {
    color-scheme: dark;
    --bg: #1f2023;
    --panel: #2a2b2f;
    --hover: #34353a;
    --line: #393a40;
    --border: #3d3e45;
    --border-strong: #55565e;
    --ink: #d6d6d8;
    --ink-strong: #e4e4e7;
    --muted: #a3a4aa;
    --accent: #ee8887;
    --accent-hover: #f4a3a2;
    --accent-tint: #3a2e30;
    --selected: #46363a;
    --on-accent: #1f2023;
    --link: #ee8887;
    --danger: #ff6b6b;
    --danger-hover: #ff8f8f;
    --danger-tint: #4a2a2e;
    --danger-line: #7a3d42;
    --ok: #8fe0da;
    --ok-tint: #1f3a39;
    --gold: #f0c27a;
    --gold-line: #6b5530;
    --gold-tint: #3d3222;
    --focus-border: #ee8887;
    --focus-ring: 0 0 0 3px #ee888740;
    --radius-control: 4px;
    --radius-panel: 4px;
    --teal: #6fd3d6;
    /* The graph's dots, also under the editor's page and the banner preview. */
    --grid-dot: #2c2d32;
    --toolbar-height: 48px;
    font: 14px/1.5 Verdana, 'DejaVu Sans', Geneva, Tahoma, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
/* Not on link pills: a link that looks like a button takes the button's colours. */
a:where(:not(.pill)) { color: var(--link); }
a { text-underline-offset: 3px; }

/* Zero-specificity defaults let each component own its hover appearance. */
:where(button, .pill) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 40px;
    padding: .55rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background-color: var(--panel);
    color: var(--ink);
    font-weight: normal;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

:where(button, .pill):where(:hover:not(:disabled)) {
    background-color: var(--hover);
    border-color: var(--border-strong);
}

:where(button):disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--ink-strong); outline-offset: 3px; }

input:not([type='checkbox']), select, textarea {
    min-height: 42px;
    max-width: 100%;
    padding: .65rem .85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background-color: var(--bg);
    color: var(--ink);
}

input::placeholder { color: #8b8c92; }
textarea { min-height: 6rem; }
input[type='checkbox'] { accent-color: var(--accent); }
h1, h2, h3 { color: var(--ink-strong); line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 3vw, 2rem); }
h2 { font-size: 1.25rem; margin-top: 2rem; }
.shell { min-height: 100dvh; }

.site-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    height: var(--toolbar-height);
    padding: 0 1rem;
    border-bottom: 1px solid var(--line);
    background-color: var(--panel);
    color: var(--ink);
    font: 13px/20px Verdana, 'DejaVu Sans', Geneva, Tahoma, sans-serif;
}

/* The wordmark is text: "shrine" with ".party" in the accent. */
.brand { display: block; flex: none; line-height: 40px; color: var(--ink-strong); font-size: 15px; font-weight: bold; text-decoration: none; }
.brand-party { color: var(--accent); }
.primary-nav { display: flex; gap: .25rem; align-items: center; white-space: nowrap; }
.account-dropdown a { margin-bottom: .75rem; color: var(--ink); }
.account-dropdown :is(a, button) { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.account-dropdown :is(a, button):hover { color: var(--accent); }
.account-dropdown :is(a, button) .icon { width: 18px; height: 18px; font-size: 15px; color: var(--muted); }
.account-dropdown button { justify-content: flex-start; min-height: 0; padding: 0; border: 0; border-radius: 0; background-color: transparent; color: var(--ink); font-weight: inherit; }
.primary-nav a, .new-shrine { min-height: 36px; border-color: transparent; border-radius: 4px; background-color: transparent; color: #b9bac0; font-weight: inherit; }
.primary-nav a:hover, .new-shrine:hover { border-color: transparent; background-color: var(--hover); color: var(--accent); }
.primary-nav a { padding-inline: .6rem; }
.primary-nav a .icon { width: 16px; height: 16px; font-size: 13px; }
.primary-nav .nav-label { text-transform: lowercase; }
.primary-nav a.active { color: var(--ink-strong); font-weight: bold; }

@font-face { font-family: "Font Awesome Free"; src: url("/fa-solid-900.woff2") format("woff2"); font-weight: 900; font-display: block; }
.icon { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; flex: none; font: 900 18px/1 "Font Awesome Free"; }

.header-search, .new-shrine {
    flex: none;
    justify-content: center;
    gap: .5rem;
    width: 36px;
    padding: 0;
}
/* Looks like the search field it opens. */
.header-search { justify-content: flex-start; width: 240px; min-height: 36px; padding-inline: 10px; border-radius: 4px; border-color: var(--border); background-color: var(--bg); color: var(--muted); font-weight: normal; }
.header-search:hover { border-color: var(--border-strong); background-color: var(--bg); }
.header-search .icon { width: 16px; height: 16px; font-size: 13px; }
.header-search, .site-header > .account-menu { margin-left: auto; }
.header-search ~ .new-shrine { margin-left: -.75rem; }
.header-search ~ .account-menu { margin-left: 0; }
.beta-notice { margin: .25rem 0 1.5rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-control); background-color: var(--accent-tint); color: var(--ink-strong); font-size: 1.05rem; font-weight: 600; line-height: 1.45; text-align: left; }
.beta-notice a { color: inherit; text-decoration: underline; }
/* In the editor: where the author is, pushed to the right like the search it stands in for. */
.header-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; margin-left: auto; color: var(--muted); white-space: nowrap; }
.header-crumbs a { color: inherit; text-decoration: none; }
.header-crumbs a:hover { color: var(--accent); }
.header-crumbs .icon { width: 14px; height: 14px; font-size: 12px; }
.header-crumbs span { overflow: hidden; text-overflow: ellipsis; font-weight: bold; color: var(--ink-strong); }

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: .15rem .35rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--hover);
    color: var(--muted);
    font-size: .72rem;
    white-space: nowrap;
}

.pill.primary {
    border-color: var(--accent);
    background-color: var(--accent);
    color: var(--on-accent);
    font-weight: bold;
    white-space: nowrap;
}

.pill.primary:hover { border-color: var(--accent-hover); background-color: var(--accent-hover); color: var(--on-accent); }
/* One look for every destructive button, so it never reads as the coral primary: red text in a
   quiet red outline, never filled. */
.pill.danger { border-color: var(--danger-line); color: var(--danger); }
.pill.danger:where(:hover:not(:disabled)) { border-color: var(--danger); background-color: var(--danger-tint); color: var(--danger-hover); }
.account-menu { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.account-menu > .pill { padding-inline: .8rem; }
.account-menu details { position: relative; }
.account-menu summary { cursor: pointer; list-style: none; display: flex; align-items: center; color: #efe6ff; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-avatar { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #c3a6f0; border-radius: 50%; background-color: #4a3a5e; font-size: 11px; font-weight: bold; }
img.account-avatar { object-fit: cover; }
.account-dropdown { position: absolute; right: 0; top: 40px; width: 220px; padding: 1rem; border: 1px solid var(--border); border-radius: 4px; background-color: var(--panel); box-shadow: 0 8px 24px #00000066; }
.site-header .pill.primary { min-height: 36px; border-color: var(--accent); border-radius: 4px; background-color: var(--accent); color: var(--on-accent); font-weight: bold; }
.site-header .pill.primary:hover { border-color: var(--accent-hover); background-color: var(--accent-hover); color: var(--on-accent); }
.account-dropdown p { margin: 0 0 .75rem; }

.page-content { max-width: 1080px; margin: 2.5rem auto; padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background-color: var(--panel); }
.page-content:has(.explore-page, .shrine-view, .auth-page) { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background-color: transparent; }
.explore-page {
    position: relative;
    height: calc(100dvh - var(--toolbar-height));
    min-height: 480px;
    overflow: hidden;
    /* The graph renderer draws the grid, so it follows the camera. */
    background-color: var(--bg);
}

.graph { height: 100%; }
.graph-stage { position: relative; height: 100%; }
.graph canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.graph canvas.labels { position: absolute; inset: 0; pointer-events: none; }
.graph-feedback { position: absolute; z-index: 3; top: 24px; left: 28px; max-width: min(400px, calc(100% - 56px)); }
.graph-message { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100% - 40px)); padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background-color: var(--panel); text-align: center; }
.graph-message h2 { margin: 0 0 .75rem; font-size: 1.4rem; }
.graph-message p { color: var(--muted); font-size: .95rem; line-height: 1.6; }
.graph-controls { position: absolute; z-index: 4; left: 22px; bottom: 22px; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--border); border-radius: 4px; background-color: var(--panel); }
.graph-controls button { width: 38px; min-height: 36px; padding: 0; border-color: transparent; background-color: transparent; color: var(--muted); }
.graph-controls .fit-graph { width: auto; padding: 0 .7rem; font-size: .85rem; }
/* A shrine's card, opened from its node (static/app.js places it beside the pointer). */
.shrine-preview { position: absolute; z-index: 6; top: 24px; left: 24px; width: 284px; box-shadow: 0 8px 24px #00000066; }
/* Its own height, not a grid cell's. */
.shrine-card.shrine-preview { height: auto; }
/* A card's last row (card_actions): at the bottom, so cards in a grid line up. */
.shrine-card-last { display: grid; gap: 10px; margin-top: auto; }
.shrine-preview-updated { padding-top: 8px; border-top: 1px solid var(--line); }
.shrine-card-error { margin: 0; font-size: 12px; }
.shrine-preview-actions { display: flex; gap: 6px; }
.shrine-preview-actions .pill { min-height: 44px; }
.shrine-preview-visit { flex: 1; }
.shrine-preview-candle { gap: 6px; padding-inline: 12px; font-variant-numeric: tabular-nums; }
.shrine-preview-candle .icon { width: 16px; height: 16px; font-size: 15px; }
.shrine-preview-bookmark { width: 44px; padding: 0; }
/* The candle and bookmark are bare icons: a hover background, and coral once lit or bookmarked. */
.shrine-preview-actions .pill:not(.primary) { border-color: transparent; background-color: transparent; color: var(--muted); }
.shrine-preview-actions .pill:not(.primary):hover { background-color: var(--hover); }
.shrine-preview-actions .pill:not(.primary, [aria-pressed='true']):hover { color: var(--ink); }
.shrine-preview-actions .pill[aria-pressed='true'] { color: var(--accent); }
@media (max-width: 560px) {
    .shrine-preview { top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; }
}
.site-footer { display: flex; align-items: center; gap: 1rem; max-width: 1080px; padding: .75rem 2rem 1.5rem; margin: auto; font-size: .8rem; color: var(--muted); }
.footer-social { display: flex; gap: .9rem; margin-left: auto; }
.footer-social a { display: grid; place-items: center; width: 28px; height: 28px; color: inherit; }
.footer-social a:hover { color: var(--accent); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }
.shell:has(.explore-page, .shrine-view) .site-footer { display: none; }
.error { color: var(--danger); }
.loading { color: var(--muted); }
.shrine-frame { display: block; width: 100%; height: 80vh; margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); background: #fff; }

/* Native dialog supplies the inert background; search.rs manages keyboard selection. */
body:has(.search-palette[open]) { overflow: hidden; }
.search-palette {
    width: min(600px, calc(100vw - 32px));
    max-height: min(680px, calc(100dvh - 48px));
    margin: min(18vh, 140px) auto auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    background-color: var(--panel);
    color: var(--ink);
    box-shadow: 0 24px 80px #00000066;
    overflow: auto;
}

.search-palette::backdrop { background-color: #0000008c; }
.search-palette-input { display: flex; align-items: center; gap: .8rem; margin: .75rem; padding: .25rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-control); background-color: var(--bg); color: var(--accent); }
.search-palette-input input { flex: 1; width: 0; min-height: 40px; padding: .5rem 0; border: 0; border-radius: 0; background-color: transparent; font-size: 1rem; }
.search-palette-input input:focus-visible { outline: none; }
.search-palette-results { padding: 0 .75rem .75rem; }
.search-palette-results:has(ul:empty):not(:has(p, .error)) { display: none; }
.search-palette-results > p, .search-palette-results > .error { display: block; margin: 1rem; }
.search-palette-results ul { list-style: none; padding: 0; margin: 0; }
.search-palette-results a[role='option'] { display: flex; align-items: center; text-decoration: none; }
.search-palette-results button, .search-palette-results a[role='option'] { width: 100%; justify-content: start; gap: .85rem; padding: .85rem; border: 1px solid transparent; border-radius: var(--radius-control); background-color: transparent; color: var(--ink); text-align: left; font-weight: 450; }
.search-palette-results button:hover, .search-palette-results a[role='option']:hover { background-color: var(--hover); }
.search-palette-results button[aria-selected='true'], .search-palette-results a[role='option'][aria-selected='true'] { border-color: var(--border); background-color: var(--selected); }
.graph-controls button:hover:not(:disabled) { background-color: var(--hover); }
.search-result-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-control); background-color: var(--hover); color: var(--accent); font-size: 1.5rem; }
.search-palette-results strong, .search-palette-results small { display: block; overflow-wrap: anywhere; }
.search-palette-results small { margin-top: .2rem; color: var(--muted); }
.search-result-enter { margin-left: auto; color: var(--muted); }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 30; padding: .75rem 1rem; border: 2px solid var(--teal); border-radius: var(--radius-control); background-color: var(--panel); color: var(--danger); }
.skip-link:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 1200px) {
    .site-header { gap: .6rem; padding-inline: 1rem; }
    .primary-nav .pill { padding-inline: .65rem; }
}

@media (max-width: 820px) {
    .site-header { flex-wrap: nowrap; justify-content: space-between; align-content: center; gap: .4rem .6rem; padding: 0 .85rem; }
    .primary-nav { margin-left: auto; }
    .primary-nav .pill { min-height: 36px; width: 36px; padding: .4rem; }
    .primary-nav .nav-label, .search-label { display: none; }
    .header-search { justify-content: center; width: 36px; margin-left: 0; padding-inline: 0; }
    .header-search ~ .new-shrine { margin-left: 0; }
    .site-header > .primary { display: none; }
    .account-menu > .pill { font-size: .85rem; padding: .4rem .55rem; min-height: 36px; }
    .page-content { margin: 1rem; padding: 1.25rem; border-radius: var(--radius-panel); }
    .graph-controls { left: 14px; bottom: 16px; }
    .shrine-bar { padding: .4rem .85rem; }
    .shrine-bar-actions { position: fixed; right: .85rem; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 4; flex-direction: column; flex-wrap: nowrap; gap: .5rem; }
    .shrine-bar-actions :where(.pill) { width: 44px; min-height: 44px; justify-content: center; padding: .35rem; background-color: var(--panel); box-shadow: 0 2px 8px #00000066; }
    .shrine-bar-actions .pill.primary { background-color: var(--accent); }
    .shrine-bar-actions .action-label, .shrine-bar-actions .candle-count, .shrine-bar-actions .bookmark-count, .shrine-bar-actions > .pill > span:not(.icon) { display: none; }
}

@media (max-width: 560px) {
    .site-header { justify-content: flex-start; gap: .25rem; padding-inline: .5rem; }
    /* The compact wordmark: "s.p". */
    .brand-long { display: none; }
    .primary-nav { margin-left: 0; gap: .125rem; }
    .primary-nav .pill { width: 34px; padding-inline: 0; }
    .header-search { margin-left: auto; }
    .account-menu { gap: .25rem; }
    .site-header .account-menu .notification-bell { width: 36px; margin-right: 0; }
    .account-menu summary { width: 36px; min-height: 40px; justify-content: center; }
    .header-crumbs { gap: .25rem; }
    .header-crumbs a { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none; }
}

/* Account forms: one centered card on the page background. */
.auth-page { display: grid; place-items: center; min-height: calc(100dvh - var(--toolbar-height) - 6rem); padding: 2.5rem 1rem; }
.auth-card { width: min(420px, 100%); padding: 2.25rem 2rem 1.75rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background-color: var(--panel); box-shadow: 0 18px 50px #00000066; text-align: center; }
.auth-card h1 { margin: 0 0 1.75rem; font-size: 2rem; }
.auth-form, .modal-form { display: grid; gap: 1.1rem; text-align: left; }
.field { display: grid; gap: .4rem; }
.field > label { font-size: .92rem; color: var(--ink-strong); }
.field input { width: 100%; }
.field small { color: var(--muted); font-size: .82rem; }
.banner-rings legend { margin-bottom: .4rem; padding: 0; font-size: .92rem; color: var(--ink-strong); }
.auth-aside { justify-self: end; margin-top: -.5rem; font-size: .88rem; }
.auth-message { margin: 0; padding: .7rem .9rem; border-radius: var(--radius-control); background-color: var(--ok-tint); color: var(--ok); font-size: .92rem; }
.auth-message.error { background-color: var(--danger-tint); color: var(--danger); }
.auth-form button[type='submit'] { width: 100%; min-height: 46px; margin-top: .35rem; }
.auth-switch { margin: 1.5rem 0 0; color: var(--muted); font-size: .92rem; }

@media (max-width: 820px) {
    .auth-page { place-items: start center; padding: 1rem .85rem; }
    .auth-card { padding: 1.75rem 1.25rem 1.5rem; border-radius: var(--radius-panel); }
    .auth-card h1 { font-size: 1.75rem; }
}

/* My shrines: a grid of cards, each showing the shrine's node as the graph draws it. */
.node-preview { display: inline-block; flex: none; border-radius: 50%; }
.page-content:has(.my-shrines) { border: 0; background-color: transparent; }
.my-shrines-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.my-shrines-heading h1 { margin: 0; }
.my-shrines-heading .my-shrines-count { margin-right: auto; color: var(--muted); }
.shrine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
/* A shrine as a card (templates/parts.cold shrine_card): its banner over a strip of its colour,
   then title, owner, description, tags and each page's own last row. The front page's preview is
   the same card. */
.shrine-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-panel); background-color: var(--panel); font-size: 13px; line-height: 1.45; }
/* The cover, when the shrine has one, fills the strip. */
.shrine-card-cover { display: block; width: 100%; height: 100%; object-fit: cover; }
.shrine-card-strip { flex: none; height: 56px; background-color: color-mix(in srgb, var(--strip, var(--accent)) 28%, var(--panel)); background-image: radial-gradient(color-mix(in srgb, var(--strip, var(--accent)) 60%, var(--panel)) 1px, transparent 1px); background-size: 10px 10px; }
.shrine-card-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.shrine-card-head { display: flex; align-items: flex-end; gap: 10px; margin-top: -30px; }
/* The banner's circle is 84% of its image (BANNER_RADIUS in a BANNER_SIZE square, the rest room
   for the badge), so the cut-out from the strip is that circle plus 3px: the ring is the edge. */
.shrine-card-banner { flex: none; width: 64px; height: 64px; background: radial-gradient(circle closest-side, var(--panel) calc(84% + 3px), transparent calc(84% + 3.5px)); }
.shrine-card-name { min-width: 0; }
/* Styled as the shrine's name label (parts.cold label_css); the outline sits behind the letters as on the graph. */
.shrine-card-name h2 { margin: 0; color: var(--ink-strong); font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; paint-order: stroke fill; }
.shrine-card-name h2 a { color: inherit; text-decoration: none; }
.shrine-card-name h2 a:hover { text-decoration: underline; }
.shrine-card-name p { margin: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.shrine-card-owner { text-decoration: none; }
.shrine-card-description { margin: 0; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.shrine-card-tags { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 0; font-size: 12px; }
.shrine-card-when { margin: 0; color: var(--muted); font-size: 12px; }
/* The last row sits at the bottom, so cards in a grid line up. */
.shrine-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .8rem; margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 12px; }
.shrine-card-foot .badge, .profile-shrine-list :is(.tag, .badge) { padding: .1rem .55rem; border-radius: 999px; background-color: var(--hover); color: var(--ink); }
.shrine-card-foot .badge { background-color: var(--danger-tint); color: var(--danger); font-weight: 650; }
.shrine-card-count { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink); font-size: .9rem; font-weight: 650; }
.shrine-card-count .icon { width: 16px; height: 16px; font-size: 15px; color: var(--accent); }
.shrine-card-tools { display: inline-flex; gap: .6rem; margin-left: auto; }
.shrine-card-tool { display: inline-flex; padding: .2rem; border-radius: 4px; color: var(--link); text-decoration: none; }
.shrine-card-tool:hover { color: var(--accent-hover); }
.shrine-card-tool .icon { width: 16px; height: 16px; font-size: 15px; }
.shrines-empty { display: grid; justify-items: center; gap: .25rem; padding: 3rem 1rem; text-align: center; }
.shrines-empty h2 { margin: .75rem 0 0; }
.shrines-empty p { margin: 0 0 1rem; color: var(--muted); }

/* Modals share the search palette's frame. */
body:has(.modal[open]) { overflow: hidden; }
.modal { width: min(460px, calc(100vw - 32px)); margin: min(14vh, 120px) auto auto; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-panel); background-color: var(--panel); color: var(--ink); box-shadow: 0 24px 80px #00000066; }
.modal::backdrop { background-color: #0000008c; }
.modal-body { padding: 1.25rem 1.5rem 1.5rem; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-heading h2 { margin: 0; font-size: 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .25rem; }
.address-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-control); background-color: var(--bg); }
.address-input span { padding-left: .85rem; color: var(--muted); }
.address-input input { flex: 1; width: 0; padding-left: .15rem; border: 0; background-color: transparent; }
.address-input input:focus { box-shadow: none; }

/* Shrine settings header: node, title, byline, actions. */
.page-content:has(.shrine-settings) { max-width: 1040px; border: 0; background-color: transparent; }
.shrine-settings .settings-card { max-width: none; }
/* The danger zone (parts.cold danger_card), here boxed like the cards above it. */
.shrine-settings .danger-card { margin-top: 1.25rem; }
.danger-card p { margin: 0 0 1rem; }
/* Under its text, left, on every page. */
.danger-card .modal-actions { justify-content: flex-start; }
.shrine-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-bottom: 1.5rem; }
.shrine-header .node-preview { border: 3px solid var(--panel); box-sizing: content-box; box-shadow: 0 0 0 1px var(--line); }
.shrine-header-main { flex: 1; min-width: 200px; }
.shrine-header h1 { margin: 0; font-size: clamp(1.75rem, 3.5vw, 2.4rem); overflow-wrap: anywhere; }
.shrine-byline { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .35rem 0 0; color: var(--muted); }
.shrine-header-actions, .shrine-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

/* Public shrine: site header, one slim bar, then the page fills the rest of the viewport. */
.shrine-view { display: flex; flex-direction: column; height: calc(100dvh - var(--toolbar-height)); min-height: 360px; }
.shrine-bar { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; min-height: 52px; padding: .35rem 1.5rem; border-bottom: 1px solid var(--line); background-color: var(--panel); }
.shrine-bar-main { display: flex; align-items: center; gap: .6rem; flex: 1 1 260px; min-width: 0; }
.shrine-bar .node-preview { border: 2px solid var(--panel); box-sizing: content-box; box-shadow: 0 0 0 1px var(--line); }
.shrine-bar h1 { flex: 0 1 auto; min-width: 0; margin: 0; overflow: hidden; font-size: 1.15rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.shrine-bar .shrine-byline { display: flex; flex-wrap: nowrap; align-items: center; flex: 0 1 auto; min-width: 0; margin: 0; gap: .25ch; line-height: 1.4; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.shrine-bar .shrine-byline a { overflow: hidden; text-overflow: ellipsis; }
.shrine-bar .badge { flex: none; padding: .1rem .55rem; border-radius: 999px; background-color: var(--danger-tint); color: var(--danger); font-size: .8rem; font-weight: 650; }
.shrine-bar-actions .pill[aria-expanded='true'] { border-color: var(--border); background-color: var(--selected); }
@media (max-width: 820px) {
    /* Keep the toggle above the drawer while it covers the floating actions. */
    .shrine-bar:has(#comments-toggle[aria-expanded='true']) { flex-wrap: nowrap; }
    .shrine-bar-actions:has(#comments-toggle[aria-expanded='true']) { position: static; }
    .shrine-bar-actions:has(#comments-toggle[aria-expanded='true']) > :not(#comments-toggle) { display: none; }
}
.shrine-view .shrine-frame { flex: 1; min-height: 0; height: auto; margin: 0; border: 0; border-radius: 0; }
/* Under the bar: the frame, and beside it the comments drawer, which narrows the frame
   instead of covering it (a bottom sheet over the frame on phones). The drawer scrolls on
   its own; the page never does. */
.shrine-stage { position: relative; display: flex; flex: 1; min-height: 0; }
.shrine-stage > .shrine-frame { min-width: 0; }
.comments-drawer { position: relative; z-index: 5; flex: 0 0 min(420px, 50%); overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); background-color: var(--panel); }
.comments-drawer .comments { max-width: none; margin: 0; padding: 1.1rem 1.25rem 2rem; }
.comments-drawer .comments h2 { min-height: 36px; margin-bottom: .75rem; line-height: 36px; }
.comments-drawer .comment-linked { scroll-margin-top: 1rem; }
/* In the heading's row and scrolling with it: a sticky button would sit over the cards. */
.comments-close { float: right; min-height: 36px; margin: 1.1rem 1.25rem 0 0; padding: .25rem .8rem; font-size: .88rem; }
@media (max-width: 640px) {
    .comments-drawer { position: absolute; right: 0; bottom: 0; left: 0; height: 70dvh; max-height: 100%; border-top: 1px solid var(--line); border-left: 0; border-radius: var(--radius-panel) var(--radius-panel) 0 0; box-shadow: 0 -12px 36px #00000066; }
    .comments-drawer .comments { padding: .9rem 1rem 1.5rem; }
    .comments-close { margin: .9rem 1rem 0 0; }
}
.shrine-notice { padding: 1.5rem; }
.candles { display: flex; align-items: center; gap: .5rem; }
.candle-button[aria-pressed='true'] { border-color: var(--gold); background-color: var(--gold-tint); color: var(--gold); }
.candle-count { min-width: 1.6rem; padding: .05rem .45rem; border-radius: 999px; background-color: var(--hover); color: var(--ink); font-size: .85rem; text-align: center; }
.candle-button[aria-pressed='true'] .candle-count { background-color: var(--gold-tint); color: var(--gold); }
.back-link { display: inline-flex; align-items: center; gap: .25rem; margin-bottom: 1rem; text-decoration: none; }
.back-link .icon { width: 18px; height: 18px; }
.settings-card { max-width: 640px; padding: 1.75rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background-color: var(--panel); }
.settings-card h2 { margin: 0 0 .25rem; font-size: 1.1rem; }
.check-field { display: flex; align-items: flex-start; gap: .75rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); cursor: pointer; }
.check-field input { width: 18px; height: 18px; margin-top: .15rem; }
.check-field span { display: grid; gap: .2rem; }
.check-field strong { color: var(--ink-strong); font-weight: normal; }
.check-field small { color: var(--muted); font-size: .85rem; }
.modal-form select, .modal-form textarea { width: 100%; }
/* The shrine bar's ⋯ menu: a round button the height of the pills beside it. */
.shrine-menu { margin-left: 0; }
.shrine-menu .comment-menu-button { width: 40px; height: 40px; border: 1px solid var(--line); background-color: var(--panel); }
.shrine-menu .comment-menu-list { top: 46px; min-width: 12rem; }
@media (max-width: 820px) {
    .shrine-menu .comment-menu-button { width: 44px; height: 44px; box-shadow: 0 2px 8px #00000066; }
    .shrine-menu .comment-menu-list { top: auto; right: 52px; bottom: 0; }
}
.block-effects { display: grid; gap: .45rem; margin: 0 0 1rem; padding-left: 1.2rem; }
.block-lede { margin: 0 0 1.25rem; color: var(--muted); font-size: .95rem; }
.page-content:has(.blocked-accounts) { max-width: 720px; }
.blocked-accounts h1 { margin: 0 0 .5rem; }
.blocked-lede { max-width: 60ch; margin: 0 0 1.75rem; color: var(--muted); }
.blocked-list { margin: 0; padding: 0; list-style: none; }
.blocked-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem .25rem; }
.blocked-name { min-width: 0; margin-right: auto; font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.blocked-row.unblocked .blocked-name { color: var(--muted); }
.blocked-state { color: var(--teal); font-size: .9rem; }
.blocked-row .pill { min-height: 34px; padding: .25rem .85rem; }
.blocked-row .error { flex-basis: 100%; }
.blocked-empty { padding: 1.5rem 0; color: var(--muted); }
.blocked-empty p { margin: 0 0 .25rem; }
.blocked-empty p:first-child { color: var(--ink); font-weight: 650; }

/* Account settings: one card per part, the storage table first. */
.page-content:has(.account-settings) { border: 0; background-color: transparent; }
.account-settings { display: grid; gap: 0; }
.account-settings h1 { margin: 0 0 .25rem; }
.account-settings .settings-card { display: grid; gap: .6rem; max-width: none; padding: 1.1rem 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background-color: transparent; }
.account-settings .settings-lede { margin-bottom: 1rem; }
.account-settings .settings-card :is(input:not([type=checkbox], [type=radio]), select, textarea) { max-width: 26rem; }
.account-settings .settings-card h2, .account-settings .settings-card p { margin: 0; }
.account-settings .settings-card h2 { font-size: 1.6rem; line-height: 1.2; }
.account-settings .settings-card { padding-block: 1.5rem; }
.settings-lede { margin: 0; color: var(--muted); }
.settings-heading { display: flex; align-items: center; gap: .75rem; }
/* The link an invite made, set apart from the form that made it. */
.invite-page { max-width: 36rem; }
.invite-page h1 { margin: 0; }
.invite-result { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.invite-result p[role=status]:empty { display: none; }
.settings-hint { color: var(--muted); font-size: .9rem; }
.account-settings .modal-actions { justify-content: flex-start; }
.storage-table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.storage-table th, .storage-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.storage-table th:first-child { overflow: hidden; max-width: 14rem; text-align: left; text-overflow: ellipsis; }
.storage-table thead th { color: var(--muted); font-weight: 650; }
.storage-table tbody th { font-weight: 600; }
.storage-table td:last-child { font-weight: 650; }
@media (max-width: 620px) {
    /* Phones keep the shrine and its total; the parts are in the wider layout. */
    .storage-table th:not(:first-child, :last-child), .storage-table td:not(:last-child) { display: none; }
}
.profile-storage-link { white-space: nowrap; }
.profile-list li > a { margin-right: auto; }

/* Profiles and account pages share a frame. */
.personal-shell {
    --personal-padding: clamp(1rem, 2.4vw, 1.5rem);
    display: flex;
    flex-direction: column;
}
.personal-shell > :is(.page-content, .site-footer) {
    width: calc(100% - 2rem);
    max-width: 1080px;
    margin: 0 auto;
    padding-inline: var(--personal-padding);
    background-color: var(--panel);
}
.personal-shell > .page-content {
    flex: 1;
    padding-block: var(--personal-padding);
    border: 0;
    border-radius: 0;
}
.personal-shell .notifications-page { margin: 0; padding: 0; }
.profile-page { min-width: 0; overflow-wrap: anywhere; }
.profile-storage { display: flex; align-items: center; gap: 1.25rem; margin-top: 1.5rem; padding-top: 1.25rem; color: var(--muted); font-size: .92rem; }
.profile-plan { padding: .1rem .7rem; border-radius: 999px; background-color: var(--danger-tint); color: var(--danger); font-weight: 650; }
.profile-usage { display: grid; flex: 1; grid-template-columns: auto auto 1fr; align-items: center; gap: .5rem 1rem; }
.profile-storage-label { white-space: nowrap; }
.profile-storage-meter { width: 100%; height: .6rem; overflow: hidden; border: 0; border-radius: 999px; background-color: var(--hover); appearance: none; }
.profile-storage-meter::-webkit-progress-bar { border-radius: 999px; background-color: var(--hover); }
.profile-storage-meter::-webkit-progress-value { border-radius: 999px; background-color: var(--accent); }
.profile-storage-meter::-moz-progress-bar { border-radius: 999px; background-color: var(--accent); }
.profile-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .55rem 1.4rem; padding-bottom: 1.25rem; }
.profile-avatar { --avatar-size: 7rem; position: relative; grid-area: 1 / 1 / span 2; width: var(--avatar-size); height: var(--avatar-size); border: 3px solid var(--panel); border-radius: 50%; background-color: var(--hover); box-shadow: 0 0 0 1px var(--line); }
/* The picture is rounded, not the box: the avatar's menu opens over its edge. */
.profile-avatar img, .profile-avatar-placeholder { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.profile-avatar-placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.profile-avatar-placeholder .icon { width: auto; height: auto; font-size: calc(var(--avatar-size) * .45); }
.profile-avatar-edit { position: absolute; inset: 0; display: grid; place-items: center; min-height: 0; padding: 0; border: 0; border-radius: 50%; background-color: transparent; color: #fff; }
.profile-avatar-edit > span { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background-color: #1f2023cc; opacity: 0; transition: opacity 120ms ease; }
/* The pencil shows on hover or keyboard focus; touch screens have no hover, so it stays. */
.profile-avatar-edit:hover > span, .profile-avatar-edit:focus-visible > span { opacity: 1; }
@media (hover: none) { .profile-avatar-edit > span { opacity: 1; } }
.profile-avatar-edit:focus-visible { outline-offset: -5px; }
.profile-avatar-edit .icon { width: 1.6rem; height: 1.6rem; stroke-width: 1.5; }
.profile-heading { grid-area: 1 / 2; min-width: 0; }
.profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; }
.profile-name h1 { min-width: 0; margin: 0; }
.profile-founder { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border: 1px solid var(--gold-line); border-radius: 999px; background-color: var(--gold-tint); color: var(--gold); font-size: .78rem; font-weight: 700; }
.profile-founder .icon { width: auto; height: auto; font-size: .72rem; }
.profile-stats { display: flex; grid-area: 2 / 2; flex-wrap: wrap; gap: .2rem 1rem; }
.profile-stat { gap: .3rem; min-height: 32px; padding: 0; border: 0; border-radius: 4px; background-color: transparent; color: var(--muted); font-size: .9rem; font-weight: 400; }
.profile-stat b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-stat:where(:hover, :focus-visible, [aria-expanded='true']) > span { color: var(--link); text-decoration: underline; }
.profile-action { min-height: 36px; gap: .35rem; padding: .3rem .65rem; font-size: .85rem; }
.profile-action .icon { width: auto; height: auto; font-size: .9rem; }
.profile-header-signature p:first-child, .follow-person .profile-signature p:first-child { margin-top: 0; }
.profile-header-signature p:last-child, .follow-person .profile-signature p:last-child { margin-bottom: 0; }
.profile-modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin-top: min(8vh, 64px); overflow: auto; }
.profile-form fieldset { display: grid; gap: 1.1rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.profile-form textarea, .profile-form select { width: 100%; }
.profile-form textarea { resize: vertical; }
.growing-field { position: relative; }
/* The bottom padding keeps text clear of the counter in the corner. */
.growing-field textarea.growing { display: block; width: 100%; min-height: 0; padding-bottom: 1.6rem; resize: none; overflow: hidden; }
.char-count { position: absolute; right: .75rem; bottom: .4rem; color: var(--teal); font-size: .8rem; font-variant-numeric: tabular-nums; pointer-events: none; }
.char-count.none { color: var(--muted); }
.char-count.over { color: var(--danger); font-weight: 650; }
.field input:focus, .growing-field textarea.growing:focus, .profile-form textarea:focus, .profile-form select:focus { border-color: var(--focus-border); box-shadow: var(--focus-ring); outline: none; }
.profile-content-toggle { display: flex; align-items: center; gap: .75rem; width: fit-content; color: var(--ink-strong); font-size: .92rem; cursor: pointer; }
.profile-content-toggle input { position: relative; flex: none; width: 2.75rem; height: 1.5rem; margin: 0; border: 1px solid var(--line); border-radius: 999px; appearance: none; background-color: var(--hover); cursor: pointer; transition: background-color 120ms ease, border-color 120ms ease; }
.profile-content-toggle input::before { content: ''; position: absolute; top: 2px; left: 2px; width: calc(1.5rem - 6px); height: calc(1.5rem - 6px); border-radius: 50%; background-color: var(--ink); box-shadow: 0 1px 3px #00000066; transition: transform 120ms ease; }
.profile-content-toggle input:checked { border-color: var(--accent); background-color: var(--accent); }
.profile-content-toggle input:checked::before { transform: translateX(1.25rem); }
.profile-content-toggle input:disabled { opacity: .5; cursor: not-allowed; }
.profile-form small { margin-top: -.6rem; color: var(--muted); font-size: .82rem; }
.profile-form-actions { padding-top: 1.1rem; border-top: 1px solid var(--line); }
.profile-message { margin-top: 1.25rem; }
.profile-bio, .profile-header-signature { margin: .4rem 0 0; line-height: 1.45; }
.profile-bio { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-signature-preview { display: grid; gap: .35rem; margin-top: .4rem; color: var(--muted); }
.profile-signature-preview .profile-signature { padding: .5rem .75rem; border: 1px dashed var(--line); border-radius: var(--radius-control); color: var(--ink); font-size: .9rem; }
.profile-signature-error { color: var(--danger); }
.profile-list h2, .profile-shrines h2 { margin: 1.5rem 0 1rem; }
.profile-shrine-list { margin: 0; padding: 0; list-style: none; }
.profile-shrine-list li { display: flex; align-items: center; gap: .75rem; }
.profile-shrine-list li > .profile-shrine { min-width: 0; }
.profile-shrine-list .tag { font-size: .8rem; white-space: nowrap; }
.profile-shrine-tags { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.profile-shrine-counts { display: flex; flex: none; gap: .9rem; margin-inline-start: auto; }
.profile-shrine { display: flex; align-items: center; gap: .75rem; padding: .35rem .25rem; text-decoration: none; }
.profile-shrine:where(:hover, :focus-visible) { background-color: var(--hover); }
/* In a list the whole row is the hover and the link; the tags and tools stay their own links. */
.profile-shrine-list li { position: relative; padding-inline: .25rem; }
.profile-shrine-list li:hover { background-color: var(--hover); }
.profile-shrine-list .profile-shrine:hover { background-color: transparent; }
.profile-shrine-list .profile-shrine::after { content: ""; position: absolute; inset: 0; }
.profile-shrine-list li > :not(.profile-shrine) { position: relative; }
.profile-list ul { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.profile-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.profile-list > button { margin: .75rem .5rem 0 0; }
.profile-list .follow-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .75rem; padding: .35rem .25rem; overflow-wrap: anywhere; }
.follow-person { position: relative; display: flex; flex-wrap: wrap; align-items: center; align-content: start; gap: .25rem .65rem; min-width: 0; min-height: 36px; padding-inline-start: calc(36px + .5rem); }
.follow-name { min-width: 0; color: inherit; font-weight: 650; text-decoration: none; }
.follow-name .comment-avatar { position: absolute; inset-block-start: 0; inset-inline-start: 0; }
.follow-name:hover span { text-decoration: underline; }
.follow-person .profile-signature { flex-basis: 100%; color: var(--muted); font-size: .9rem; }
.follow-action { display: grid; justify-items: end; gap: .25rem; }
.follow-action .pill { min-height: 34px; padding: .25rem .85rem; font-size: .85rem; }
/* The Following page's own title says it already. */
.my-shrines .profile-list > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 820px) {
    .profile-storage { flex-wrap: wrap; gap: .75rem 1rem; }
    .profile-usage { flex-basis: 100%; grid-template-columns: 1fr auto; gap: .35rem 1rem; }
    .profile-storage-meter { grid-column: 1 / -1; margin-bottom: .35rem; }
    .profile-form-actions .pill { flex: 1; }
}

@media (max-width: 640px) {
    .profile-header { column-gap: .85rem; }
    .profile-avatar { --avatar-size: 4.5rem; grid-row: 1; }
    .profile-stats { grid-column: 1 / -1; }
}

@media (max-width: 390px) {
    .profile-avatar { --avatar-size: 3.5rem; }
    .profile-avatar-edit > span { width: 2.5rem; height: 2.5rem; }
    .profile-name { column-gap: .5rem; }
    .profile-name h1 { font-size: 1.75rem; }
}

/* Comments, in the drawer over the shrine. Comment HTML is contained so it cannot change
   the layout around it. */
.comments, .notifications-page { max-width: 760px; margin: 2rem auto; padding: 0 1rem 3rem; }
.comments h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.comments-empty, .comments-signin { color: var(--muted); }
.comment-list { display: grid; gap: .85rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.comment { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-control); background-color: var(--panel); }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .5rem; color: var(--muted); font-size: .85rem; }
.comment-author { display: inline-flex; align-items: center; gap: .5rem; color: inherit; font-weight: 650; font-size: .95rem; }
.comment-avatar { width: 36px; height: 36px; border: 2px solid var(--border); border-radius: 50%; background-color: var(--hover); object-fit: cover; }
.comment-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .profile-signature { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .85rem; }
.comment-form { display: grid; gap: .5rem; margin-bottom: 1rem; }
.comment-form label { color: var(--ink-strong); }
.comment-form small, .comment-status { color: var(--muted); }
.comment-form button { justify-self: start; }
/* Replying and editing happen in a modal, so only one comment is written at a time. */
.comment-modal { width: min(560px, calc(100vw - 32px)); }
.comment-modal .comment-form { margin-bottom: 0; }
.comment-quoted { margin: 0 0 1rem; padding: .75rem .9rem; border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; background-color: var(--accent-tint); color: var(--ink); max-height: 9rem; overflow: auto; }
.comment-quoted .comment-author { margin-bottom: .35rem; }
.comment-quoted .comment-avatar { width: 28px; height: 28px; }
.comment.highlighted { border-color: var(--accent); box-shadow: var(--focus-ring); }
.comment-linked { display: grid; gap: .6rem; margin-bottom: 1.25rem; scroll-margin-top: calc(var(--toolbar-height) + 1rem); }
.mention { color: var(--link); font-weight: 600; text-decoration: none; }
.mention:hover { text-decoration: underline; }
.comment-footer { display: flex; align-items: center; gap: .25rem; margin: .45rem 0 -.35rem -.5rem; }
.comment-action { display: inline-flex; align-items: center; gap: .3rem; min-height: 32px; padding: .2rem .55rem; border: 0; border-radius: 4px; background-color: transparent; color: var(--muted); font-size: .85rem; font-weight: 600; }
button.comment-action:hover { background-color: var(--hover); color: var(--link); }
.comment-action .icon { width: 17px; height: 17px; }
.comment-candle[aria-pressed='true'] { color: var(--gold); }
.comment-candle[aria-pressed='true'] .icon { fill: var(--gold-tint); }
/* Replies sit under their comment, indented along a thread line. */
.comment-thread { display: grid; gap: .5rem; margin: .5rem 0 0 1.4rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.comment-replies { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.comment-replies .comment { padding: .8rem .95rem; }
.comment-replies .comment-avatar { width: 30px; height: 30px; }
.comment-thread-toggle { justify-self: start; min-height: 32px; padding: .2rem .4rem; border: 0; background-color: transparent; color: var(--link); font-size: .88rem; font-weight: 650; }
.comment-thread-toggle:hover { text-decoration: underline; }
.comment-report { display: grid; gap: .4rem; margin-top: .6rem; }
.comment-report-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
/* A box with its button inside (the comment composer): the frame carries the border and focus. */
.growing-field.with-action { border: 1px solid var(--border); border-radius: var(--radius-control); background-color: var(--bg); }
.search-palette-input:focus-within, .address-input:focus-within, .growing-field.with-action:focus-within { border-color: var(--focus-border); box-shadow: var(--focus-ring); }
.growing-field.with-action textarea.growing, .growing-field.with-action textarea.growing:focus { padding-bottom: .25rem; border: 0; box-shadow: none; }
/* A picture left of the text, as on X; the text and footer share the right column. */
.growing-field.with-leading { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.growing-field.with-leading > :first-child { grid-row: 1 / 3; margin: .55rem 0 0 .6rem; }
.growing-field.with-leading textarea.growing { min-height: 42px; }
.growing-footer { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; padding: 0 .5rem .5rem; }
.growing-footer .char-count { position: static; }
.growing-footer .pill { min-height: 36px; }
.comment-menu { position: relative; margin-left: auto; }
.comment-menu-button { display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background-color: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.comment-menu-button:hover, .comment-menu-button[aria-expanded='true'] { background-color: var(--hover); color: var(--link); }
.menu-backdrop { position: fixed; inset: 0; z-index: 9; }
.comment-menu-list { position: absolute; right: 0; top: 36px; z-index: 10; display: grid; min-width: 9rem; padding: .35rem; border: 1px solid var(--line); border-radius: var(--radius-control); background-color: var(--panel); box-shadow: 0 12px 36px #00000066; }
.comment-menu-list button { display: block; width: 100%; min-height: 0; padding: .5rem .75rem; border: 0; border-radius: var(--radius-control); background-color: transparent; color: var(--ink); font-size: .9rem; text-align: left; }
.comment-menu-list button:hover, .comment-menu-list button:focus-visible { background-color: var(--hover); outline: none; }
.comment-menu-list .danger { color: var(--danger); }

/* Notifications */
.notification-bell { position: relative; }
.account-menu .notification-bell { width: 36px; min-height: 36px; padding: 0; border-color: transparent; border-radius: 4px; background-color: transparent; color: var(--ink); }
.account-menu .notification-bell:hover { background-color: var(--hover); color: var(--accent); }
.notification-badge { position: absolute; top: 2px; right: 0; min-width: 16px; padding: 0 4px; border: 2px solid var(--panel); border-radius: 999px; background-color: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: bold; line-height: 12px; text-align: center; }
.notifications-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.notifications-heading h1 { margin: 0; }
.notifications-empty { color: var(--muted); }
.notification-list { display: grid; gap: .6rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.notification { display: flex; align-items: flex-start; gap: .8rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-control); background-color: var(--panel); color: var(--ink); text-decoration: none; }
a.notification:hover { border-color: var(--accent); background-color: var(--hover); }
.notification.unread { border-color: var(--accent); background-color: var(--accent-tint); }
.notification .comment-avatar { flex: none; }
.notification-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 50%; background-color: var(--accent-tint); color: var(--link); }
.notification-text { display: grid; flex: 1; gap: .2rem; min-width: 0; }
.notification-text p { margin: 0; overflow-wrap: anywhere; }
.notification-excerpt { color: var(--muted); font-size: .9rem; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notification-date { color: var(--muted); font-size: .8rem; }
.notification-dot { flex: none; width: 9px; height: 9px; margin-top: .45rem; border-radius: 50%; background-color: var(--accent); }
.notification-settings fieldset { display: grid; gap: .5rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.notification-settings .check-field { padding: .65rem .85rem; }
/* Banners: the server draws each shrine's circle (shrine-card), the same one the graph shows. */
.shrine-banner { display: block; flex: none; width: 120px; height: auto; aspect-ratio: 1; }
.profile-shrine .shrine-banner { width: 4rem; max-width: 100%; }
/* A fixed box: a banner that fails to load shows its alt text without growing the bar. */
.shrine-bar .shrine-banner { width: 40px; height: 40px; overflow: hidden; }
.shrine-settings-row { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 1.25rem; }
@media (max-width: 860px) { .shrine-settings-row { grid-template-columns: minmax(0, 1fr); } }
.banner-settings { gap: 1rem; }
/* The banner as the graph shows it, on its graph paper, with the name under the close one. */
/* Three columns, the close banner's widest; each name stays in its own (static/app.js shrinks one
   that doesn't fit). */
.banner-head { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: .5rem; padding: 14px 16px 10px; border: 1px solid var(--line); border-radius: 4px; background-color: var(--bg); background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px); background-size: 16px 16px; background-position: center; }
.banner-name { max-width: 100%; padding: 2px 3px; overflow: hidden; color: var(--ink); font: 12px/1.25 system-ui, sans-serif; text-align: center; text-overflow: ellipsis; white-space: nowrap; paint-order: stroke fill; }
.profile-shrine .banner-name { min-width: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.banner-preview { position: relative; flex: none; width: 96px; height: 96px; }
.banner-distance { display: grid; justify-items: center; min-width: 0; max-width: 100%; gap: .45rem; color: var(--muted); font-size: .75rem; }
.banner-far { position: relative; display: block; }
.banner-layers { position: relative; display: block; flex: none; }
.banner-layers > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.banner-layers > img.banner-layers-picture { inset: auto; border-radius: 50%; object-fit: cover; }
.banner-layers > canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.banner-preview > .banner-layers { filter: drop-shadow(0 2px 6px #00000066); }
/* The banner card shows the shrine as the front page's preview card does (parts.cold
   shrine_card, inert), with the picture's pencil laid over its banner: 1px of card border plus
   the strip less the head's overlap down, 1px plus the body's padding in. */
.banner-card { position: relative; }
.banner-card .shrine-card { height: auto; }
.banner-card-edit { position: absolute; top: 27px; left: 15px; width: 64px; height: 64px; }
.banner-card-edit .profile-avatar-edit { inset: 8%; }
/* The banner's pencil, in the cover's corner: shown while the card is hovered or the pencil
   focused or open, always on touch screens (no hover), like the picture's. */
.banner-cover-edit { position: absolute; top: 9px; right: 9px; }
.cover-edit-button { width: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 50%; background-color: #1f2023cc; color: #fff; opacity: 0; transition: opacity 120ms ease; }
.cover-edit-button:where(:hover:not(:disabled)) { background-color: #1f2023; border-color: transparent; }
.banner-card:hover .cover-edit-button, .cover-edit-button:focus-visible, .cover-edit-button[aria-expanded='true'] { opacity: 1; }
@media (hover: none) { .cover-edit-button { opacity: 1; } }
.cover-edit-button .icon { width: 16px; height: 16px; font-size: 13px; }
.banner-cover-edit .banner-menu { top: calc(100% + 4px); right: 0; left: auto; }
.banner-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; border: 0; }
.banner-ring { display: grid; gap: .4rem; }
.banner-ring-label { font-size: .92rem; color: var(--ink-strong); }
.banner-label { display: grid; gap: .5rem; }
.label-head { display: flex; align-items: center; justify-content: space-between; }
.label-reset { margin: 0; }
.label-reset button { min-height: 0; padding: .15rem .4rem; border: 0; border-radius: 4px; background: transparent; color: var(--link); font-size: .82rem; }
.label-reset button:hover { background-color: var(--accent-tint); }
.label-form { display: grid; gap: .6rem; margin: 0; }
/* The editor's toolbar tools: 34px, pressed coral when on. */
.label-tools { display: flex; align-items: center; gap: 2px; width: max-content; padding: 3px; border: 1px solid var(--line); border-radius: 4px; background-color: var(--panel); }
.label-tool { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 34px; height: 34px; border-radius: 4px; color: var(--ink); cursor: pointer; }
.label-tool:hover { background-color: var(--hover); }
.label-tool:has(input:checked) { background-color: var(--selected); color: var(--accent); }
.label-tool:has(input:focus-visible) { outline: 2px solid var(--focus-border); outline-offset: 1px; }
.label-tool .icon { width: 18px; height: 16px; font-size: 15px; }
.label-tool-outline .icon { color: transparent; -webkit-text-stroke: 1.4px var(--ink); }
.label-tool-bar { width: 16px; height: 3px; border-radius: 2px; box-shadow: inset 0 0 0 1px #0000001f; }
.label-tool input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.label-tools-gap { width: 1px; height: 20px; margin: 0 5px; background-color: var(--line); }
/* The class panel's segments. */
.label-segs { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .75rem; }
.label-segs-title { font-size: .85rem; color: var(--muted); }
.label-segs-row { display: flex; }
.label-seg { flex: 1 1 0; min-width: 0; cursor: pointer; }
.label-seg > span { display: grid; place-items: center; height: 30px; margin-left: -1px; border: 1px solid var(--border); background-color: var(--panel); color: var(--ink); font-size: .78rem; }
.label-seg:first-child > span { margin-left: 0; border-radius: 4px 0 0 4px; }
.label-seg:last-child > span { border-radius: 0 4px 4px 0; }
.label-seg:hover > span { background-color: var(--hover); }
.label-seg:has(input:checked) > span { position: relative; z-index: 1; border-color: var(--accent); background-color: var(--selected); color: var(--accent); }
.label-seg:has(input:focus-visible) > span { position: relative; z-index: 2; outline: 2px solid var(--focus-border); outline-offset: 1px; }
.ring-current { justify-content: flex-start; gap: .75rem; width: 100%; min-height: 0; padding: .5rem .9rem .5rem .5rem; border: 1px solid var(--line); border-radius: 4px; background-color: var(--panel); color: var(--ink); font-weight: 500; }
.ring-current:where(:hover:not(:disabled)) { background-color: var(--accent-tint); }
.ring-current-name { flex: 1; text-align: left; }
.ring-change { color: var(--link); font-size: .9rem; }
.ring-modal-preview { display: grid; place-items: center; margin-bottom: 1.1rem; padding: 1rem; border-radius: 4px; background-color: var(--accent-tint); }
.ring-tile { display: grid; justify-items: center; gap: .35rem; padding: .7rem .4rem .5rem; border: 2px solid transparent; border-radius: 4px; background-color: var(--accent-tint); color: var(--muted); font-size: .78rem; text-align: center; cursor: pointer; }
.ring-tile:hover { background-color: var(--selected); }
.ring-founders { margin-top: -.2rem; padding: .05rem .45rem; border-radius: 999px; background-color: var(--gold-tint); color: var(--gold); font-size: .68rem; font-weight: 650; }
.ring-tile:has(input:checked) { border-color: var(--focus-border); background-color: var(--selected); color: var(--link); font-weight: 650; }
.banner-far .node-preview { display: block; }
.banner-far-candles { position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border: 2px solid var(--panel); border-radius: 50%; background-color: var(--accent); }
.banner-menu-cover { position: fixed; inset: 0; z-index: 40; }
.banner-menu { position: absolute; z-index: 41; top: 58%; left: 62%; display: grid; min-width: 200px; padding: .35rem; border: 1px solid var(--line); border-radius: 4px; background-color: var(--panel); box-shadow: 0 12px 32px #00000066; }
.banner-menu button { justify-content: flex-start; min-height: 36px; padding: .4rem .75rem; border: 0; border-radius: 4px; background-color: transparent; color: var(--ink); font-weight: 500; text-align: left; }
.banner-menu button:where(:hover, :focus-visible) { background-color: var(--hover); }
.banner-menu button.danger { color: var(--danger); }
.ring-tile:has(input:focus-visible) { outline: 2px solid var(--focus-border); outline-offset: 2px; }

.auth-lede { margin: 0; color: var(--muted); font-size: .92rem; }

/* Tags (IDL-147): links to a tag's page, the tag page, the picker that suggests existing tags,
   the graph's tag filter, and creators in search. */
a.tag { text-decoration: none; }
a.tag:hover { text-decoration: underline; }
.shrine-bar-tags { display: flex; flex: 0 1 auto; gap: .3rem; min-width: 0; overflow: hidden; }
.shrine-bar-tags .tag { flex: none; padding: .1rem .55rem; border-radius: 999px; background-color: var(--hover); color: var(--ink); font-size: .8rem; white-space: nowrap; }
.page-content:has(.tag-page) { border: 0; background-color: transparent; }
.tag-page h1 { margin: 0; overflow-wrap: anywhere; }
.tag-page-hash { margin-right: .1ch; color: var(--accent); }
.tag-page-count { margin: .3rem 0 1.5rem; color: var(--muted); }
.tag-page-more { display: flex; justify-content: center; margin-top: 1.5rem; }
.tag-picker { display: flex; flex-direction: column; gap: .45rem; }
.tag-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.tag-chip { display: inline-flex; align-items: center; gap: .1rem; padding: .1rem .15rem .1rem .6rem; border-radius: 999px; background-color: var(--hover); color: var(--ink); font-size: .85rem; overflow-wrap: anywhere; }
.tag-chip button { flex: none; width: 24px; min-height: 24px; padding: 0; border: 0; border-radius: 50%; background-color: transparent; color: inherit; font-weight: 500; line-height: 1; }
.tag-chip button:hover:not(:disabled) { background-color: var(--border); }
.tag-picker-field { position: relative; }
.tag-picker-field input { width: 100%; }
.tag-suggestions { position: absolute; z-index: 10; top: calc(100% + 4px); right: 0; left: 0; max-height: 264px; margin: 0; padding: .3rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-control); background-color: var(--panel); box-shadow: 0 12px 36px #00000066; list-style: none; }
.tag-suggestions li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .65rem; border-radius: var(--radius-control); color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.tag-suggestions li:hover { background-color: var(--hover); }
.tag-suggestions li[aria-selected='true'] { background-color: var(--selected); }
.tag-suggestions small { flex: none; color: var(--muted); }
.graph-filter { position: absolute; z-index: 4; top: 18px; right: 22px; width: min(300px, calc(100% - 44px)); padding: .65rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-control); background-color: var(--panel); }
.graph-filter > label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .82rem; }
.graph-filter input { min-height: 36px; padding: .3rem .75rem; font-size: .9rem; }
.graph-filter-status { margin: .45rem 0 0; color: var(--muted); font-size: .82rem; }
.search-group-start:not(:first-child) { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.search-group-start::before { content: attr(data-group); display: block; padding: 0 .85rem .35rem; color: var(--muted); font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.search-result-icon.creator { font-size: 1.1rem; font-weight: 700; }
@media (max-width: 820px) {
    .graph-filter { top: 12px; right: 14px; width: min(280px, calc(100% - 28px)); }
    .shrine-bar-tags { display: none; }
}

/* Cropping a picture before upload (avatar, banner). */
/* The banner's wide frame needs a wider modal. */
.crop-modal.crop-wide { width: min(680px, calc(100vw - 32px)); }
.crop-modal .modal-body { display: grid; justify-items: center; gap: .9rem; }
.crop-modal .modal-heading { justify-self: stretch; margin-bottom: 0; }
.crop-modal .modal-actions { justify-self: stretch; }
.crop-frame { position: relative; overflow: hidden; border-radius: 4px; background-color: #151618; cursor: grab; touch-action: none; user-select: none; }
.crop-frame.dragging { cursor: grabbing; }
.crop-frame img { position: absolute; max-width: none; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px #15161899; outline: 2px solid #ffffffcc; pointer-events: none; }
.crop-mask.square { border-radius: 0; outline-offset: -2px; }
.crop-zoom { display: flex; align-items: center; gap: .6rem; width: 280px; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop-modal .settings-hint { margin: 0; text-align: center; }

@media (min-width: 821px) {
    .shrine-bar-actions :where(.pill, .comment-menu-button) { min-width: 40px; min-height: 40px; padding: .4rem; border: 0; background: transparent; box-shadow: none; }
    .shrine-bar-actions :where(.pill, .comment-menu-button):hover { background: var(--hover); }
    .shrine-bar-actions .action-label, .shrine-bar-actions > .pill > span:not(.icon, .bookmark-count) { display: none; }
    .shrine-bar-actions .pill.primary { background: transparent; color: var(--link); }
    .shrine-bar-actions .pill.primary:hover { background: var(--hover); color: var(--link); }
    .shrine-bar-actions .candle-count { min-width: 0; padding: 0; background: transparent; color: inherit; }
    .shrine-bar-actions .bookmark-count { font-size: .85rem; }
}
/* Staff desk (/staff): the queue on the left, the open case on the right. Builds on style.css's
   tokens and is served after it. Tabs and rows are links: each opens its page. */
.page-content:has(.staff-desk) { max-width: 1240px; padding-block: 0; border: 0; background-color: transparent; }
.shell:has(.staff-desk) .site-footer { max-width: 1240px; }
.staff-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-bottom: 1.5rem; }
.staff-head h1 { margin: 0; }
.staff-rank { padding: .15rem .65rem; border-radius: 999px; background-color: var(--ok-tint); color: var(--ok); font-size: .85rem; font-weight: 650; }
.staff-tabs { display: flex; gap: 2px; margin-left: auto; padding: 4px; border: 1px solid var(--line); border-radius: 4px; background-color: var(--panel); }
.staff-tabs a { min-height: 36px; padding: .35rem 1.1rem; border-color: transparent; background-color: transparent; color: var(--muted); }
.staff-tabs a:hover { background-color: var(--hover); }
.staff-tabs a[aria-current='page'] { border-color: var(--line); background-color: var(--selected); color: var(--link); }
.staff-notice { margin: 0 0 1rem; }

.staff-split { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.staff-list, .staff-detail, .staff-log, .staff-empty { border: 1px solid var(--line); border-radius: 4px; background-color: var(--panel); }

/* Lists: the queue and account search. Only the rows scroll. */
.staff-list { position: sticky; top: 1rem; display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); overflow: hidden; }
.staff-list ul { flex: 1; margin: 0; padding: .35rem; overflow-y: auto; list-style: none; }
.staff-list-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem .85rem .75rem 1.25rem; border-bottom: 1px solid var(--line); }
.staff-list-head h2 { margin: 0; font-size: 1rem; }
.staff-list-foot { display: flex; justify-content: space-between; gap: .5rem; padding: .65rem .85rem; border-top: 1px solid var(--line); }
.staff-list-head .pill, .staff-list-foot .pill { min-height: 34px; padding: .3rem .85rem; font-size: .88rem; }
.staff-list-empty { margin: 0; padding: 1.25rem; color: var(--muted); }
.staff-search { display: flex; gap: .5rem; padding: .75rem .85rem; border-bottom: 1px solid var(--line); }
.staff-search input { flex: 1; width: 0; min-height: 38px; padding-block: .4rem; }
.staff-search .pill { min-height: 38px; }

.staff-row { position: relative; box-sizing: border-box; text-decoration: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .75rem; width: 100%; min-height: 0; padding: .75rem .85rem .75rem 1rem; border: 0; border-radius: 4px; background-color: transparent; color: var(--ink); font-weight: 450; text-align: left; }
.staff-row:hover { background-color: var(--hover); }
.staff-row[aria-current='true'] { background-color: var(--selected); }
.staff-row[aria-current='true']::before { content: ''; position: absolute; top: .75rem; bottom: .75rem; left: 3px; width: 3px; border-radius: 3px; background-color: var(--accent); }
.staff-row-title { overflow: hidden; color: var(--ink-strong); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.staff-row.urgent .staff-row-title { color: var(--danger); }
.staff-row-side { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.staff-row-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: .4rem; min-width: 0; color: var(--muted); font-size: .88rem; }
.staff-row-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-chip { flex: none; padding: .05rem .5rem; border-radius: 999px; background-color: var(--hover); color: var(--ink); font-size: .78rem; font-weight: 600; }
.staff-chip.alert { background-color: var(--danger-tint); color: var(--danger); }

/* The open case. */
.staff-detail { display: grid; gap: 1.25rem; min-width: 0; padding: 1.5rem 1.75rem 1.75rem; }
.staff-detail h2 { margin: 0; font-size: 1.4rem; overflow-wrap: anywhere; }
.staff-detail h2.urgent { color: var(--danger); }
.staff-detail h3 { margin: 0 0 .6rem; color: var(--ink); font-size: .95rem; }
.staff-facts { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0; }
.staff-facts div { display: grid; gap: .1rem; }
.staff-facts dt { color: var(--muted); font-size: .8rem; }
.staff-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.staff-quote { margin: 0; }
.staff-quote figcaption { margin-bottom: .4rem; color: var(--muted); font-size: .85rem; }
.staff-quote blockquote { max-height: 18rem; margin: 0; padding: .85rem 1rem; overflow: auto; border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; background-color: var(--accent-tint); white-space: pre-wrap; overflow-wrap: anywhere; }
.staff-quote.urgent blockquote { border-left-color: var(--danger); }
.staff-quote.plain blockquote { border-left-color: var(--border); background-color: var(--bg); }
.staff-link { justify-self: start; margin-top: -.5rem; font-size: .9rem; font-weight: 600; }
.staff-decision { display: grid; gap: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.staff-decision textarea, .staff-detail .modal-form textarea { width: 100%; min-height: 5rem; resize: vertical; }
.staff-detail :is(textarea, input, select):focus, .staff-search input:focus { border-color: var(--focus-border); box-shadow: var(--focus-ring); outline: none; }
.staff-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.staff-buttons .pill { min-height: 36px; padding: .35rem .95rem; font-size: .9rem; }
.staff-buttons select { min-height: 36px; padding-block: .3rem; }
.staff-action-row { display: flex; align-items: flex-start; gap: .5rem 1rem; }
.staff-action-row + .staff-action-row { margin-top: .6rem; }
.staff-action-label { flex: 0 0 3.5rem; padding-top: .45rem; color: var(--muted); font-size: .88rem; }
.staff-muted { margin: 0; color: var(--muted); font-size: .92rem; }
.staff-message { margin: 0; padding: .7rem .9rem; border-radius: 4px; background-color: var(--ok-tint); color: var(--ok); font-size: .92rem; }
.staff-placeholder { place-items: center; min-height: 16rem; color: var(--muted); text-align: center; }
.staff-empty { display: grid; justify-items: center; gap: .25rem; padding: 3.5rem 1rem; text-align: center; }
.staff-empty h2 { margin: 0; }
.staff-empty p { margin: 0 0 1rem; color: var(--muted); }

/* The log is a table; it scrolls sideways inside its frame on narrow screens. */
.staff-log { overflow: hidden; }
.staff-table-wrap { overflow-x: auto; }
.staff-log table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.staff-log th { padding: .6rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8rem; font-weight: 600; text-align: left; white-space: nowrap; }
.staff-log td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.staff-log tr:last-child td { border-bottom: 0; }
.staff-log td:is(:nth-child(1), :nth-child(2), :nth-child(4)) { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.staff-log td:nth-child(3) { font-weight: 650; white-space: nowrap; }
.staff-log-note { min-width: 16rem; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 820px) {
    .page-content:has(.staff-desk) { margin: 1rem 0; padding: 0 1rem; border-radius: 0; }
    .staff-tabs { flex-basis: 100%; margin-left: 0; }
    .staff-tabs a { flex: 1; padding-inline: .5rem; }
    .staff-split { grid-template-columns: minmax(0, 1fr); }
    .staff-list { position: static; max-height: 22rem; }
    .staff-detail { padding: 1.25rem; }
    .staff-action-row { flex-direction: column; }
    .staff-action-label { flex-basis: auto; padding-top: 0; }
}

.staff-shrines { display: grid; gap: .4rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.staff-shrines li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.staff-shrines .staff-row-side { margin-right: auto; }

/* Tier changes take a reason, above their switch. */
.staff-tier { display: grid; gap: .5rem; justify-items: start; }
.staff-tier .field { width: 100%; }

/* The step-up page, and the key and recovery codes on the settings page. */
.staff-verify { max-width: 32rem; }
.two-step-qr { width: 200px; max-width: 100%; margin: 0 0 1rem; padding: 6px; border: 1px solid var(--line); border-radius: 4px; background-color: #fff; }
.two-step-qr svg { display: block; width: 100%; height: auto; }
.two-step-key { display: grid; gap: .5rem; margin: 0 0 1rem; }
.two-step-key dt { color: var(--muted); font-size: .8rem; font-weight: 600; }
.two-step-key dd { margin: 0; overflow-wrap: anywhere; }
.two-step-recovery { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .4rem 1rem; margin: 0 0 1rem; padding: .8rem 1rem .8rem 2.2rem; border: 1px solid var(--line); border-radius: 4px; background-color: var(--accent-tint); font-variant-numeric: tabular-nums; }
#recovery-codes .settings-hint { margin: 0 0 1rem; }
.recovery-save { display: flex; gap: .5rem; margin: 0 0 1rem; }
