/* Load order, lowest to highest priority. */
@layer base, theme, admin, addons, rpg_classic, rpg_roleplay, roleplay_tokens, roleplay_custom;

/* RPG Initiative's own fonts (PLANNING.md live note 20): Ubuntu for text,
   Orbitron for headings. OFL fonts from Fontsource, copied into
   public/fonts by the build and served from this site (the CSP needs
   nothing new). Latin and Latin Extended; other scripts use the system
   fonts behind them. */
@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Ubuntu";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Ubuntu";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/orbitron-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/orbitron-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@layer base {
  /* ---------- Tokens ---------- */

  :root {
    /* Brand (rpginitiative.com default): greys with blue. Blue is a
       background only (white text on top); the light blue is fine as text.
       Never black as a background: dark means dark grey. Ink is the dark
       grey used for text on pale fills. */
    --color_ink: #23272c;
    --color_surface: #363a40;
    --color_primary: #2862c4;
    --color_teal: #5b9be6;
    --color_raspberry: #2862c4;
    --color_thistle: #b0b5bc;

    /* Roles (dark is the default look). */
    --color_bg: #2b2e33;
    --color_bg_raised: var(--color_surface);
    --color_text: #e6e8eb;
    --color_text_muted: var(--color_thistle);
    /* Links: blue (a lighter tint here: the brand blue is too dark to read
       as text on Ink or Surface). */
    --color_link: #8ccdf2;
    --color_border: #4a4f57;
    /* Form fields' outlines: stronger than other borders, so a field
       always stands out from the page. */
    --color_field_border: #7c8490;
    /* A card's header bar (card_header, widget titles), and its text. */
    --color_card_header: #3f454d;
    --color_on_card_header: var(--color_text);
    /* Highlights (section labels, handles, progress, ⓘ), and text on them. */
    --color_accent: var(--color_teal);
    --color_on_accent: var(--color_ink);
    --color_on_fill: #ffffff;
    /* Calls to action are raspberry; delete is an outline in the error
       colour, so it never looks like the main button. */
    --color_save: var(--color_raspberry);
    /* Unsaved changes: light pink, with dark text on it. */
    --color_unsaved: #9ec5ff;
    --color_on_unsaved: var(--color_ink);
    --color_error_text: #f2a0a8;
    /* A small warning mark (a thread someone you ignore is in). */
    --color_flag: #f2c94c;
    --color_success_text: #7cc4a0;
    /* Every other row of a list or table: a faint tint of the text colour,
       so it follows dark and light mode by itself. */
    --color_row_alt: color-mix(in srgb, var(--color_text) 4%, transparent);
    /* Mixed: a group whose settings don't all match (the yellow between
       deny's red and allow's green). */
    --color_mixed: #f2c94c;
    --color_on_mixed: var(--color_ink);

    /* Type scale (rem, so the visitor's font setting is respected). */
    --font_body: "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font_heading: "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font_mono: ui-monospace, "Cascadia Code", Consolas, monospace;
    --text_xs: 0.75rem;
    --text_sm: 0.875rem;
    --text_md: 1rem;
    --text_lg: 1.125rem;
    --text_xl: 1.25rem;
    --text_2xl: 1.5rem;
    --text_3xl: 2rem;

    /* Spacing scale. */
    --space_1: 0.25rem;
    --space_2: 0.5rem;
    --space_3: 0.75rem;
    --space_4: 1rem;
    --space_5: 1.5rem;
    --space_6: 2rem;
    --space_7: 3rem;

    --radius: 0.5rem;
    --touch_target: 2.75rem; /* 44px */
    --content_width: 70rem;

    /* Motion. */
    --motion_fast: 150ms;
    --motion_normal: 250ms;
    --motion_slow: 400ms;
    --motion_ease: cubic-bezier(0.2, 0, 0, 1);

    /* A wide logo with a light-mode version: which one shows. */
    --logo_on_dark: block;
    --logo_on_light: none;

    /* Chart series, in this fixed order (never cycled): blue, orange, aqua,
       yellow, magenta, green. Checked for colour-blind separation on the
       raised surface of each mode; always shown with labels beside them. */
    --chart_1: #3987e5;
    --chart_2: #d95926;
    --chart_3: #199e70;
    --chart_4: #c98500;
    --chart_5: #d55181;
    --chart_6: #008300;

    /* Which mode it is, for light-dark() (roles', groups' and species'
       colours in templates) and the browser's own controls. */
    color-scheme: dark;
  }

  /* Light mode: follows the device unless a page forces a theme. */
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
      color-scheme: light;
      --color_bg: #e9ebee;
      --color_bg_raised: #f8f9fa;
      --color_text: #23272c;
      --color_text_muted: #565c64;
      --color_link: #1f5bb8;
      --color_border: #c9ced5;
      --color_field_border: #7f8691;
      --color_card_header: #dde2e8;
      --color_error_text: #b3261e;
      --color_success_text: #2f6b52;
      --color_mixed: #805e00;
      --color_flag: #805e00;
      --logo_on_dark: none;
      --logo_on_light: block;
      --chart_1: #2a78d6;
      --chart_2: #eb6834;
      --chart_3: #1baf7a;
      --chart_4: #eda100;
      --chart_5: #e87ba4;
      --chart_6: #008300;
    }
  }

  :root[data-theme="light"] {
    color-scheme: light;
    --color_bg: #e9ebee;
    --color_bg_raised: #f8f9fa;
    --color_text: #23272c;
    --color_text_muted: #565c64;
    --color_link: #1f5bb8;
    --color_border: #c9ced5;
    --color_field_border: #7f8691;
    --color_card_header: #dde2e8;
    --color_error_text: #b3261e;
    --color_success_text: #2f6b52;
    --color_mixed: #805e00;
    --color_flag: #805e00;
    --logo_on_dark: none;
    --logo_on_light: block;
    --chart_1: #2a78d6;
    --chart_2: #eb6834;
    --chart_3: #1baf7a;
    --chart_4: #eda100;
    --chart_5: #e87ba4;
    --chart_6: #008300;
  }

  @media (prefers-reduced-motion: reduce) {
    :root {
      --motion_fast: 0ms;
      --motion_normal: 0ms;
      --motion_slow: 0ms;
    }
  }

  /* ---------- Reset ---------- */

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

  :where(body, h1, h2, h3, h4, p, figure, pre) {
    margin: 0;
  }

  :where(img, svg, video) {
    display: block;
    max-width: 100%;
  }

  :where(button, input, select, textarea) {
    font: inherit;
  }

  /* ---------- Page ---------- */

  :where(body) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color_bg);
    color: var(--color_text);
    font-family: var(--font_body);
    font-size: var(--text_md);
    line-height: 1.5;
  }

  :where(.page_content) {
    flex: 1;
    width: 100%;
    max-width: var(--content_width);
    margin: 0 auto;
    /* Room at the bottom for the help button. */
    padding: var(--space_5) var(--space_4) calc(var(--space_5) + 3rem);
  }

  /* Links show by colour; the underline comes on hover and focus only. */
  :where(a) {
    color: var(--color_link);
    text-decoration: none;
  }

  /* Under the cursor a link shifts a little toward the text colour (lighter
     on dark, darker on light). */
  :where(a:hover, a:focus-visible) {
    color: color-mix(in srgb, var(--color_link) 70%, var(--color_text));
    text-decoration: underline;
  }

  /* A form's button that looks like a link (a quieter second choice). */
  :where(.link_button) {
    padding: 0;
    border: 0;
    background: none;
    color: var(--color_link);
    font: inherit;
    cursor: pointer;
  }

  :where(.link_button:hover, .link_button:focus-visible) {
    color: color-mix(in srgb, var(--color_link) 70%, var(--color_text));
    text-decoration: underline;
  }

  /* ---------- Typography ---------- */

  :where(.heading) {
    font-family: var(--font_heading, var(--font_body));
    line-height: 1.2;
    margin-bottom: var(--space_4);
  }

  /* Headings stand clearly above the text under them. */
  :where(.heading_page) {
    font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  }

  :where(.page_header, .page_actions) {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space_2) var(--space_4);
    margin-block-end: var(--space_4);
  }

  :where(.page_header_title) {
    margin: 0;
  }

  :where(.page_header_actions, .card_header_actions) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space_2);
    margin-inline-start: auto;
  }

  /* A section heading is a band of its own colour (the same as a card's
     header), so it never blends into the text around it. */
  :where(.heading_section) {
    font-size: var(--text_xl);
    margin-top: var(--space_6);
    padding: var(--space_2) var(--space_4);
    background: var(--card_header_bg, var(--color_card_header));
    color: var(--color_on_card_header);
    border: 1px solid var(--card_border, var(--color_border));
    border-radius: var(--radius);
  }

  /* A modal's own heading stays plain: the box is the separation. */
  :where(.modal_heading) {
    padding: 0;
    background: none;
    border: 0;
  }

  /* First thing in a card or section: the card's own padding is enough. */
  :where(.heading_section:first-child) {
    margin-top: 0;
  }

  :where(.text) {
    margin-bottom: var(--space_4);
  }

  :where(.text_muted) {
    color: var(--color_text_muted);
  }

  :where(.text_strong) {
    font-weight: 600;
  }

  :where(.text_small) {
    font-size: var(--text_sm);
  }

  :where(.code) {
    font-family: var(--font_mono);
    font-size: var(--text_sm);
  }

  :where(.code_block) {
    font-family: var(--font_mono);
    font-size: var(--text_sm);
    overflow-x: auto;
    white-space: pre;
    padding: var(--space_3);
  }

  /* ---------- Buttons ---------- */

  :where(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space_2);
    min-height: var(--touch_target);
    padding: var(--space_2) var(--space_4);
    /* Plain buttons: outlined and tinted in the brand blue (filled ones
       are the main action). */
    border: 1px solid var(--color_primary);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--color_primary) 18%, var(--color_bg_raised));
    color: var(--color_text);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: filter var(--motion_fast) var(--motion_ease);
  }

  :where(.btn:hover) {
    filter: brightness(1.15);
  }

  :where(.btn_primary, .btn_save) {
    background: var(--color_save);
    border-color: var(--color_save);
    color: var(--color_on_fill);
  }

  /* Delete, and Cancel (backing out): outlined in the error color. */
  :where(.btn_delete),
  :where(.btn_cancel) {
    background: transparent;
    border-color: var(--color_error_text);
    color: var(--color_error_text);
  }

  :where(.btn:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
  }

  :where(.btn_small) {
    min-height: 2rem;
    padding: var(--space_1) var(--space_3);
    font-size: var(--text_sm);
  }

  :where(.btn_wide) {
    width: 100%;
  }

  /* An icon-only button (a list row's edit and trash): square. */
  :where(.btn_icon) {
    width: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
  }

  /* Unsaved changes: the save button switches to its own color. */
  :where(.is_unsaved) {
    background: var(--color_unsaved);
    border-color: var(--color_unsaved);
    color: var(--color_on_unsaved);
  }

  /* ---------- Cards ---------- */

  /* A page block's look (site_block_style_plain...) sets the --card_*
     values its widget's card reads. */
  :where(.card) {
    background: var(--card_bg, var(--color_bg_raised));
    border: 1px solid var(--card_border, var(--color_border));
    border-radius: var(--radius);
    padding: var(--card_pad, var(--space_4));
    margin-bottom: var(--space_4);
  }

  /* A card's header bar: the title (and actions on the right) on a band of
     its own colour, edge to edge across the top of the card. */
  :where(.card_header) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space_2);
    margin: calc(-1 * var(--card_pad, var(--space_4))) calc(-1 * var(--card_pad, var(--space_4))) var(--space_3);
    padding: var(--space_2) var(--space_4);
    background: var(--card_header_bg, var(--color_card_header));
    color: var(--color_on_card_header);
    border-bottom: 1px solid var(--card_border, var(--color_border));
    border-radius: var(--radius) var(--radius) 0 0;
  }

  /* A grip or arrows before the name sit on its line. */
  :where(.card_header_title) {
    display: flex;
    align-items: center;
    gap: var(--space_1);
    margin: 0;
    margin-inline-end: auto;
    font-family: var(--font_heading, var(--font_body));
    font-size: var(--text_lg);
    font-weight: 700;
  }

  /* A key or secret hidden as dots, its buttons underneath. */
  :where(.hidden_value_block) {
    display: grid;
    gap: var(--space_2);
    margin-bottom: var(--space_3);
  }

  :where(.card_summary) {
    cursor: pointer;
    font-weight: 600;
  }

  /* A grid of pictures (an archive, art to pick from). An item is a small
     card; a pick item wraps a radio in its label. */
  :where(.media_grid) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: var(--space_3);
    margin-bottom: var(--space_4);
  }

  :where(.media_grid_item) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
    background: var(--color_bg_raised);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    padding: var(--space_2);
  }

  :where(.media_grid_image) {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: calc(var(--radius) / 2);
  }

  :where(.media_grid_image_square) {
    aspect-ratio: 1;
    object-fit: contain;
  }

  :where(.media_preview) {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    margin-bottom: var(--space_4);
  }

  :where(.media_preview_small) {
    max-width: 8rem;
  }

  /* Two cards side by side when there's room (a setup page's Bot setup
     and Bot status), one above the other on a phone. */
  :where(.card_pair) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: var(--space_4);
    align-items: start;
  }

  :where(.setup_steps) {
    margin: 0 0 var(--space_3);
    padding-inline-start: 1.5rem;
    display: grid;
    gap: var(--space_2);
  }

  :where(.card_row) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_3);
  }

  :where(.card_main) {
    flex: 1 1 16rem;
    min-width: 0;
  }

  /* ---------- Badges and detail lists ---------- */

  :where(.badge) {
    display: inline-block;
    padding: 0 var(--space_2);
    border-radius: var(--radius);
    background: var(--color_primary);
    color: var(--color_on_fill);
    font-size: var(--text_xs);
    font-weight: 600;
    vertical-align: middle;
  }

  /* A staff notification's duty (notify_matrix): Mod, Support, Admin, each
     its own theme color. */
  :where(.duty_badge) {
    margin-inline-start: var(--space_1);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  :where(.duty_mod) {
    background: var(--color_accent);
    color: var(--color_on_accent);
  }

  :where(.duty_support) {
    background: var(--color_primary);
    color: var(--color_on_fill);
  }

  :where(.duty_admin) {
    background: var(--color_mixed);
    color: var(--color_on_mixed);
  }

  /* Notification settings: each section its own card, apart from the next. */
  :where(.notify_section) {
    margin-bottom: var(--space_4);
  }

  /* An Email switch while Email notifications is off: greyed, untouchable. */
  :where(.switch_input:disabled) {
    opacity: 0.4;
    cursor: not-allowed;
  }

  /* A connected account: its picture beside its name. */
  :where(.connected_account) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_2);
  }

  /* A count on its own, set apart from the words beside it. */
  :where(.count_chip) {
    display: inline-block;
    min-width: 1.75em;
    padding: 0 var(--space_2);
    border-radius: var(--radius);
    background: var(--color_primary);
    color: var(--color_on_fill);
    font-size: var(--text_sm);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    vertical-align: middle;
  }

  :where(.count_chip_zero) {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--color_border);
    color: var(--color_text_muted);
  }

  /* Trust levels (core/trust.ts), for staff: low ones stand out. */
  :where(.trust_badge_very_low, .trust_badge_low) {
    background: var(--color_error_text);
  }

  :where(.trust_badge_medium_low, .trust_badge_medium) {
    background: var(--color_text_muted, var(--color_primary));
  }

  :where(.trust_badge_high) {
    background: var(--color_success_text);
  }

  :where(.detail_list) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space_1) var(--space_4);
  }

  :where(.detail_list:not(:last-child)) {
    margin-bottom: var(--space_4);
  }

  :where(.detail_term) {
    color: var(--color_text_muted);
    font-size: var(--text_sm);
  }

  :where(.detail_value) {
    margin: 0 0 var(--space_2);
    overflow-wrap: anywhere;
  }

  @media (min-width: 40rem) {
    :where(.detail_list) {
      grid-template-columns: max-content minmax(0, 1fr);
    }

    :where(.detail_value) {
      margin-bottom: 0;
    }
  }

  /* ---------- Forms ---------- */

  :where(.form) {
    display: flex;
    flex-direction: column;
    gap: var(--space_4);
  }

  /* Room between a form and whatever follows it (another card, a list). */
  :where(.form:not(:last-child)) {
    margin-bottom: var(--space_5);
  }

  /* ...and above it, after a list's last row or a table (margins next to
     each other collapse, so after a heading or a paragraph it adds none). */
  :where(.form:not(:first-child)) {
    margin-top: var(--space_4);
  }

  /* A form's fields go one under another at a width that reads well
     (fields flowing into columns left cards ragged, with holes
     and stranded buttons). Choice lists, editors and text use it too. */
  :where(.form_narrow) {
    width: 100%;
    max-width: var(--form_narrow_width, 44rem);
  }

  /* Cards stack, one per row, across the page (card_grid too: settings
     pages read top to bottom, never in two columns). */
  :where(.card_grid) {
    display: flex;
    flex-direction: column;
    gap: var(--space_4);
  }

  @media (min-width: 64rem) {

    :where(.btn_save) {
      align-self: flex-start;
      min-width: 12rem;
    }
  }

  /* A label with its ⓘ tip beside it. */
  :where(.field_label_row) {
    display: flex;
    align-items: center;
    gap: var(--space_2);
  }

  /* A short form kept to one column, however wide the screen. */
  :where(.form_stack) {
    display: flex;
    flex-direction: column;
    max-width: 32rem;
  }

  :where(.field) {
    display: flex;
    flex-direction: column;
    gap: var(--space_1);
  }

  :where(.field_label) {
    font-weight: 600;
  }

  :where(.field_input) {
    width: 100%;
    min-height: var(--touch_target);
    padding: var(--space_2) var(--space_3);
    border: 1px solid var(--color_field_border);
    border-radius: var(--radius);
    background: var(--color_bg);
    color: var(--color_text);
  }

  /* A drop-down: our own arrow at the right, in the text colour (the
     browsers' own is faint on the dark theme, and differs on phones). */
  :where(select.field_input:not([multiple])) {
    appearance: none;
    padding-right: 2.75rem;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--color_text) 50%),
      linear-gradient(135deg, var(--color_text) 50%, transparent 50%);
    background-position:
      calc(100% - 1.5rem) 55%,
      calc(100% - 1.05rem) 55%;
    background-size: 0.45rem 0.45rem;
    background-repeat: no-repeat;
  }

  :where(select.field_input:disabled) {
    opacity: 0.6;
  }

  /* Where a log entry came from: the platform's or add-on's icon. */
  :where(.log_source) {
    display: inline-flex;
    vertical-align: -0.125em;
    color: var(--color_text_muted);
  }

  /* A form that saves itself: Saving… / Saved / Couldn't save. */
  :where(.autosave_status) {
    min-height: 1.5em;
    margin: 0;
  }

  :where(.autosave_failed) {
    color: var(--color_error_text);
  }

  /* "Saved!" right under the field just changed, for a moment. */
  :where(.autosave_flash) {
    margin: calc(var(--space_1) * -1) 0 0;
    color: var(--color_success_text);
    font-size: var(--text_sm);
    font-weight: 700;
  }

  /* Fades out; with reduced motion it just goes (autosave.js removes it). */
  @media (prefers-reduced-motion: no-preference) {
    :where(.autosave_flash) {
      animation: autosave_flash 2.5s ease-out forwards;
    }
  }

  /* A profile field with the member's eye (who sees their answer): the eye
     sits at the end of the label's line, its menu drops under it. */
  :where(.field_shared) {
    position: relative;
  }

  :where(.share_menu) {
    position: absolute;
    top: 0;
    right: 0;
  }

  :where(.share_menu_button) {
    display: inline-flex;
    padding: 0 var(--space_1);
    border-radius: var(--radius);
    color: var(--color_text_muted);
    line-height: 1.5;
  }

  :where(.share_menu_button:hover, .share_menu_button:focus-visible) {
    background: var(--color_bg);
    color: var(--color_link);
  }

  :where(.share_menu_list) {
    margin: 0;
  }

  @keyframes autosave_flash {
    0%,
    70% {
      opacity: 1;
    }

    100% {
      opacity: 0;
    }
  }

  /* Example text in a blank field: a hint, not a value. */
  :where(.field_input)::placeholder {
    color: var(--color_text_muted);
    opacity: 0.8;
  }

  :where(.field_input:focus-visible, .field_checkbox:focus-visible, .btn:focus-visible) {
    outline: 2px solid var(--color_link);
    outline-offset: 2px;
  }

  :where(.field_textarea) {
    min-height: 5rem;
    resize: vertical;
    line-height: 1.4;
  }

  /* The installer (src/installer): a centred column like the setup page,
     sections in boxes, the site's dark grey and blue. */
  :where(.installer_page) {
    max-width: 40rem;
  }

  /* The installer's brand bar and footer (as the setup page's). */
  :where(.installer_brand_bar) {
    background: var(--color_ink);
    border-bottom: 1px solid var(--color_border);
  }

  :where(.installer_brand) {
    display: flex;
    gap: var(--space_3);
    align-items: center;
    max-width: 40rem;
    margin: 0 auto;
    padding: var(--space_3) var(--space_4);
    color: var(--color_text);
    text-decoration: none;
  }

  /* The wordmark: its own size, narrower on a small phone. */
  :where(.installer_brand_logo) {
    display: block;
    width: 287px;
    max-width: 100%;
    height: auto;
  }

  :where(.installer_foot) {
    padding: var(--space_4) var(--space_4) var(--space_6);
    background: var(--color_ink);
    border-top: 1px solid var(--color_border);
    color: var(--color_text_muted);
    font-size: var(--text_sm);
    text-align: center;
  }

  :where(.installer_foot_line) {
    margin: 0 0 var(--space_1);
  }

  :where(.installer_section) {
    display: flex;
    flex-direction: column;
    gap: var(--space_4);
    margin-bottom: 0;
  }

  /* Installing: a bar that fills as it goes, and the count under it. */
  :where(.installer_progress) {
    appearance: none;
    width: 100%;
    height: 0.75rem;
    border: 0;
    border-radius: 999px;
    background: var(--color_border);
    overflow: hidden;
  }

  :where(.installer_progress)::-webkit-progress-bar {
    border-radius: 999px;
    background: var(--color_border);
  }

  :where(.installer_progress)::-webkit-progress-value {
    border-radius: 999px;
    background: var(--color_primary);
    transition: width var(--motion_slow) var(--motion_ease);
  }

  :where(.installer_progress)::-moz-progress-bar {
    border-radius: 999px;
    background: var(--color_primary);
  }

  :where(.installer_progress_line) {
    margin: 0;
    color: var(--color_text_muted);
  }

  /* Installing: the step it's on, with a spinner (still for reduced motion). */
  :where(.installer_working) {
    display: flex;
    align-items: center;
    gap: var(--space_3);
    margin: 0;
  }

  :where(.installer_spinner) {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid var(--color_border);
    border-top-color: var(--color_link);
    border-radius: 50%;
  }

  @media (prefers-reduced-motion: no-preference) {
    :where(.installer_spinner) {
      animation: installer_spin 0.9s linear infinite;
    }
  }

  @keyframes installer_spin {
    to {
      transform: rotate(360deg);
    }
  }

  :where(.installer_input) {
    border-color: var(--color_text_muted);
  }

  :where(.installer_submit) {
    align-self: flex-start;
  }

  :where(.installer_submit:disabled) {
    background: var(--color_border);
    border-color: var(--color_border);
    color: var(--color_text_muted);
    cursor: not-allowed;
  }

  :where(.installer_key) {
    word-break: break-all;
  }

  :where(.installer_finish) {
    margin-top: var(--space_4);
  }

  :where(.field_input_error) {
    border-color: var(--color_error_text);
  }

  :where(.field_help) {
    color: var(--color_text_muted);
    font-size: var(--text_sm);
  }

  :where(.password_rule_list) {
    margin: var(--space_1) 0 0;
    padding: 0;
    list-style: none;
    color: var(--color_text_muted);
    font-size: var(--text_sm);
  }

  :where(.password_rule)::before {
    content: "○";
    display: inline-block;
    width: 1.5em;
  }

  :where(.password_rule_met) {
    color: var(--color_success_text);
  }

  :where(.password_rule_met)::before {
    content: "✓";
  }

  :where(.field_error) {
    color: var(--color_error_text);
    font-size: var(--text_sm);
  }

  :where(.field_check) {
    display: flex;
    align-items: flex-start;
    gap: var(--space_2);
    min-height: var(--touch_target);
    cursor: pointer;
  }

  :where(.form_footer) {
    color: var(--color_text_muted);
    font-size: var(--text_sm);
  }

  /* Bot traps: off-screen, not display:none (bots check for that). */
  :where(.form_trap) {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  /* ---------- Lists ---------- */

  :where(.link_list) {
    display: flex;
    flex-direction: column;
    gap: var(--space_1);
    margin: 0 0 var(--space_4);
    padding: 0;
    list-style: none;
  }

  /* Widgets' lists (site pages, the admin dashboard). */
  :where(.widget_list) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* A row with its count at the far end (Waiting on staff, a group legend). */
  :where(.widget_row) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_2);
  }

  /* The Stats widget: label, then its number, a row each. */
  :where(.site_stats_list) {
    display: flex;
    flex-direction: column;
    gap: var(--space_1);
    margin: 0;
  }

  :where(.site_stats_row) {
    display: flex;
    justify-content: space-between;
    gap: var(--space_2);
  }

  :where(.site_stats_value) {
    margin: 0;
    font-weight: 700;
  }

  :where(.site_legend_italic) {
    font-style: italic;
  }

  :where(.code_list) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: var(--space_2);
    margin: 0;
    padding: var(--space_3);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    list-style: none;
  }

  /* QR codes keep a white background in dark mode so phones can scan them. */
  :where(.qr_code) {
    padding: var(--space_2);
    border-radius: var(--radius);
    background: #ffffff;
  }

  :where(.platform_buttons) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
  }

  /* An off-screen default button (Enter in a text box presses it). */
  :where(.default_submit) {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  /* ---------- Notices ---------- */

  :where(.notice:not(:last-child)) {
    margin-bottom: var(--space_4);
  }

  :where(.notice) {
    padding: var(--space_3) var(--space_4);
    border: 1px solid var(--color_border);
    border-left-width: 4px;
    border-radius: var(--radius);
    background: var(--color_bg_raised);
  }

  :where(.notice_error) {
    border-left-color: var(--color_error_text);
  }

  :where(.notice_success) {
    border-left-color: var(--color_success_text);
  }

  /* A notice with buttons beside its text (the account page's "set up
     two-factor", a waiting two-factor removal). */
  :where(.twofa_nudge) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_3);
  }

  :where(.twofa_nudge_text) {
    display: flex;
    align-items: center;
    gap: var(--space_2);
    margin: 0;
  }

  /* A roleplay's reminder for this member (core/reminders.ts): floats at the
     top of its pages while they scroll. */
  :where(.reminder_bar) {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: var(--space_2);
    border-left-color: var(--color_link);
  }

  :where(.reminder_bar_text) {
    flex: 1;
    margin: 0;
  }

  :where(.reminder_bar_icon) {
    flex: none;
  }

  :where(.reminder_bar_close) {
    flex: none;
  }

  /* The list of problems at the top of a long form (form_problems.js). */
  :where(.form_problems_list) {
    margin: var(--space_2) 0 0;
    padding-left: var(--space_5);
  }

  /* ---------- Shared header and footer ---------- */

  :where(.site_header, .site_footer) {
    padding: var(--space_3) var(--space_4);
    background: var(--color_bg_raised);
    border-color: var(--color_border);
  }

  :where(.site_header) {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_3);
    border-bottom: 1px solid var(--color_border);
  }

  :where(.site_nav) {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_3);
  }

  /* The built pages' menu takes what room is left, wrapping in it. */
  :where(.site_menu) {
    flex: 0 1 auto;
    min-width: 0;
  }

  :where(.site_nav_link) {
    display: inline-flex;
    align-items: center;
    gap: var(--space_1);
    color: var(--color_text);
    font-weight: 600;
    text-decoration: none;
  }

  :where(.site_nav_link:hover, .site_nav_link:focus-visible) {
    color: var(--color_link);
  }

  :where(.site_nav_link[aria-current], .site_nav_link.site_menu_current) {
    color: var(--color_link);
  }

  /* A header in the site menu: it opens its pages, like the account menu. */
  :where(.site_menu_item) {
    padding: 0.375rem 0.875rem;
    gap: var(--space_2);
    border-radius: 999px;
  }

  :where(.site_menu_item:hover, .site_menu_item:focus-visible) {
    background-color: color-mix(in srgb, var(--color_primary) 18%, var(--color_bg_raised));
    color: var(--color_text);
    text-decoration: none;
  }

  :where(.site_menu_item[aria-current], .site_menu_item.site_menu_current) {
    background-color: var(--color_primary);
    color: var(--color_on_fill);
  }

  :where(.site_nav_group_button) {
    list-style: none;
    cursor: pointer;
  }

  :where(.site_nav_group_button::-webkit-details-marker) {
    display: none;
  }

  :where(.site_nav_group_list) {
    right: auto;
    left: 0;
  }

  /* More: the menu items that didn't fit on the line (menu_more.js), each
     item's own links indented under it. */
  :where(.site_menu_more_list) {
    right: 0;
    left: auto;
  }

  :where(.site_menu_more_under) {
    padding-left: var(--space_5);
  }

  :where(.site_menu_more_button) {
    justify-content: space-between;
  }

  :where(.site_footer) {
    padding: var(--space_5) var(--space_4) var(--space_3);
    border-top: 1px solid var(--color_border);
    font-size: var(--text_sm);
  }

  /* The site's name, then a column per group of links; stacked on phones. */
  :where(.site_footer_columns) {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space_4);
    max-width: var(--content_width);
    margin: 0 auto;
  }

  :where(.site_footer_brand, .site_footer_column) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
  }

  :where(.site_footer_name) {
    margin: 0;
    font-weight: 700;
    font-size: var(--text_lg);
  }

  :where(.site_footer_small) {
    margin: 0;
    color: var(--color_text_muted);
  }

  /* A column's header: larger, in the heading font and full text color,
     with a line under it, so it never reads as one of its links. */
  :where(.site_footer_heading) {
    margin: 0 0 var(--space_1);
    padding-bottom: var(--space_2);
    border-bottom: 2px solid var(--color_accent);
    color: var(--color_text);
    font-family: var(--font_heading, var(--font_body));
    font-size: var(--text_md);
    font-weight: 700;
  }

  :where(.site_footer_heading_link) {
    color: inherit;
    text-decoration: none;
  }

  :where(.site_footer_heading_link:hover, .site_footer_heading_link:focus-visible) {
    color: var(--color_link);
  }

  :where(.site_footer_powered) {
    max-width: var(--content_width);
    margin: var(--space_5) auto 0;
    padding-top: var(--space_3);
    border-top: 1px solid var(--color_border);
    text-align: center;
  }

  @media (max-width: 40rem) {
    :where(.site_footer_columns) {
      grid-template-columns: 1fr;
    }
  }

  /* The roleplay in a header (site_brand partial): its logo, and its name
     ending in "…" rather than pushing the header's buttons off. */
  :where(.site_brand) {
    display: flex;
    flex: none;
    align-items: center;
    min-width: 0;
    color: var(--color_text);
    font-weight: 700;
    font-size: var(--text_lg);
    text-decoration: none;
  }

  :where(.site_brand_name) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* The phone header's logo (phones only; the name shows elsewhere). */
  :where(.site_phone_logo) {
    display: block;
    max-width: min(12rem, 100%);
    max-height: 2.25rem;
    object-fit: contain;
  }

  :where(.site_phone_logo_large) {
    max-height: 4rem;
  }

  /* "Powered by RPG Initiative" in the footer: its wordmark, small. */
  :where(.site_powered_link) {
    display: inline-flex;
    gap: var(--space_2);
    align-items: center;
    vertical-align: middle;
  }

  :where(.site_powered_logo) {
    width: auto;
    height: 1rem;
  }

  :where(.site_logo_for_dark) {
    display: var(--logo_on_dark);
  }

  :where(.site_logo_for_light) {
    display: var(--logo_on_light);
  }

  :where(.site_footer_link) {
    color: var(--color_text_muted);
    text-decoration: none;
  }

  :where(.site_footer_link:hover, .site_footer_link:focus-visible) {
    color: var(--color_link);
    text-decoration: underline;
  }

  /* A heading at the top of a modal. */
  :where(.modal_heading) {
    margin-top: 0;
  }

  /* ---------- Quick search (modal) ---------- */

  :where(.quick_search) {
    margin-bottom: var(--space_3);
  }

  :where(.quick_search_heading) {
    margin: var(--space_3) 0 var(--space_1);
    font-size: var(--text_xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color_text_muted);
  }

  :where(.quick_search_list) {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  :where(.quick_search_item) {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: var(--space_2);
    border-radius: var(--radius);
    color: inherit;
    text-decoration: none;
  }

  :where(.quick_search_item:hover, .quick_search_item:focus-visible) {
    background: var(--color_bg);
  }

  /* ---------- The user menu (header) ---------- */

  :where(.user_menu) {
    position: relative;
  }

  :where(.user_menu_button) {
    display: flex;
    align-items: center;
    gap: var(--space_2);
    padding: var(--space_1) var(--space_2);
    border-radius: var(--radius);
    cursor: pointer;
    list-style: none;
  }

  :where(.user_menu_button::-webkit-details-marker) {
    display: none;
  }

  :where(.user_menu_button:hover, .user_menu_button:focus-visible) {
    background: var(--color_bg);
  }

  :where(.user_menu_name) {
    font-weight: 600;
  }

  :where(.user_menu_caret) {
    color: var(--color_text_muted);
  }

  :where(.user_menu_list) {
    position: absolute;
    top: calc(100% + var(--space_1));
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    min-width: 13rem;
    padding: var(--space_1);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
  }

  /* The user menu's line between the account links and the "My" ones. */
  :where(.user_menu_rule, .site_drawer_rule) {
    margin: var(--space_1) 0;
    border: 0;
    border-top: 1px solid var(--color_border);
  }

  :where(.user_menu_form) {
    margin: 0;
    border-top: 1px solid var(--color_border);
    padding-top: var(--space_1);
    margin-top: var(--space_1);
  }

  :where(.user_menu_link) {
    display: flex;
    align-items: center;
    gap: var(--space_2);
    width: 100%;
    padding: var(--space_2) var(--space_3);
    border: 0;
    border-radius: calc(var(--radius) / 2);
    background: none;
    color: var(--color_text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  :where(.user_menu_link:hover, .user_menu_link:focus-visible) {
    background: var(--color_bg);
    color: var(--color_link);
  }

  :where(.site_menu_more_button.site_menu_current, .site_menu_sub_link[aria-current]) {
    color: var(--color_link);
  }

  /* A ⋯ menu on an item (the user menu's popup, on a small button). */
  :where(.more_menu_button) {
    list-style: none;
    cursor: pointer;
  }

  :where(.more_menu_button::-webkit-details-marker) {
    display: none;
  }

  :where(.user_menu_icon) {
    display: inline-flex;
    color: var(--color_text_muted);
  }

  /* ---------- Style guide ---------- */

  :where(.styleguide_row) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_3);
    margin-bottom: var(--space_2);
  }

  /* The classes under each sample. */
  :where(.styleguide_name) {
    margin: var(--space_1) 0 var(--space_5);
    font-family: var(--font_mono);
    font-size: var(--text_xs);
    color: var(--color_text_muted);
    overflow-wrap: anywhere;
  }

  :where(.styleguide_contents) {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 12rem;
    column-gap: var(--space_5);
  }

  :where(.styleguide_tokens, .styleguide_icons) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: var(--space_2);
    margin: 0 0 var(--space_5);
    padding: 0;
    list-style: none;
  }

  :where(.styleguide_token, .styleguide_icon) {
    display: flex;
    align-items: center;
    gap: var(--space_2);
    min-width: 0;
    overflow-wrap: anywhere;
  }

  :where(.styleguide_icon) {
    font-size: var(--text_lg);
  }

  :where(.styleguide_swatch) {
    flex: none;
    width: var(--touch_target);
    height: var(--touch_target);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
  }

  :where(.styleguide_swatch_bg) {
    background: var(--color_bg);
  }

  :where(.styleguide_swatch_bg_raised) {
    background: var(--color_bg_raised);
  }

  :where(.styleguide_swatch_text) {
    background: var(--color_text);
  }

  :where(.styleguide_swatch_text_muted) {
    background: var(--color_text_muted);
  }

  :where(.styleguide_swatch_link) {
    background: var(--color_link);
  }

  :where(.styleguide_swatch_border) {
    background: var(--color_border);
  }

  :where(.styleguide_swatch_card_header) {
    background: var(--color_card_header);
  }

  :where(.styleguide_swatch_primary) {
    background: var(--color_primary);
  }

  :where(.styleguide_swatch_teal) {
    background: var(--color_teal);
  }

  :where(.styleguide_swatch_raspberry) {
    background: var(--color_raspberry);
  }

  :where(.styleguide_swatch_thistle) {
    background: var(--color_thistle);
  }

  :where(.styleguide_swatch_save) {
    background: var(--color_save);
  }

  :where(.styleguide_swatch_unsaved) {
    background: var(--color_unsaved);
  }

  :where(.styleguide_swatch_error_text) {
    background: var(--color_error_text);
  }

  :where(.styleguide_swatch_success_text) {
    background: var(--color_success_text);
  }

  /* ---------- Icons, swatches, button rows ---------- */

  :where(.icon) {
    display: inline-block;
    flex-shrink: 0;
    width: 1.25em;
    height: 1.25em;
    vertical-align: -0.2em;
  }

  :where(.swatch) {
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
  }

  :where(.button_row) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_2);
  }

  :where(.button_row:not(:last-child)) {
    margin-bottom: var(--space_3);
  }

  /* Fields side by side, their labels on one line (help text below one
     doesn't push the other down). */
  :where(.field_row) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    align-items: start;
    gap: var(--space_3);
  }

  /* A set of fields that belong together in a longer list (a milestone's
     tiers), set apart from the next by a line. */
  :where(.field_set) {
    display: grid;
    gap: var(--space_2);
    padding-block: var(--space_3);
    border-block-start: 1px solid var(--color_border);
  }

  /* A length of time: the number, then its unit (duration_field). */
  :where(.duration_row) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_2);
  }

  /* A group of choices in a form is a heading and its choices, not a box. */
  :where(fieldset.field) {
    border: 0;
    padding: 0;
    margin-inline: 0;
    min-width: 0;
  }

  :where(legend.field_label) {
    padding: 0;
  }

  /* A saved ID or secret: greyed, with its Change button under it. */
  :where(.saved_field_value) {
    opacity: 0.6;
    cursor: not-allowed;
  }

  :where(.saved_field_summary) {
    margin-block-start: var(--space_2);
    list-style: none;
  }

  /* A plain number box is as wide as a number, not the whole column. */
  :where(input.field_input[type="number"]:not(.duration_amount)) {
    max-width: 10rem;
  }

  :where(.duration_amount) {
    flex: 1 1 4.5rem;
    min-width: 4.5rem;
    max-width: 8rem;
  }

  /* The unit always shows whole ("minutes", not "minut"). */
  :where(.duration_unit) {
    flex: 0 0 auto;
    width: auto;
    min-width: 8.5rem;
  }

  :where(.size_unit) {
    min-width: 5.5rem;
  }

  /* Groups of words (field synonyms): a row of chips each. */
  :where(.groups_box, .groups_rows) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
    align-items: stretch;
  }

  :where(.groups_add) {
    align-self: flex-start;
  }

  :where(.groups_row) {
    display: flex;
    gap: var(--space_2);
    align-items: flex-start;
  }

  :where(.groups_words) {
    flex: 1;
  }

  :where(.link_row) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: var(--space_2) var(--space_3);
  }

  :where(.form_picture) {
    max-width: min(100%, 24rem);
    max-height: 10rem;
    border-radius: var(--radius);
  }

  /* Theme cards (Switch theme, and the admin's list): a screenshot each
     (a placeholder until it has one), its name, and what to do with it. */
  :where(.theme_cards) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: var(--space_3);
  }

  :where(.theme_card) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space_2);
    padding: var(--space_3);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
  }

  /* Its <picture> (the light-mode screenshot swaps in on light devices). */
  :where(.theme_shot_frame) {
    display: block;
  }

  :where(.theme_shot) {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
    border-radius: var(--radius);
    background: var(--color_bg);
    box-shadow: inset 0 0 0 1px var(--color_border);
  }

  :where(.theme_card_name) {
    margin: 0;
  }

  :where(.badge_on) {
    background: var(--color_success_text);
    color: var(--color_bg);
  }

  /* ---------- Switches and choices ---------- */

  :where(.switch_list) {
    display: flex;
    flex-direction: column;
    gap: var(--space_3);
    margin-bottom: var(--space_4);
  }

  /* Roleplays on your profile: a tile each, picked ones lit up. */
  :where(.rep_tiles) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: var(--space_3);
    margin-top: var(--space_3);
  }

  :where(.rep_tile) {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space_2);
    padding: var(--space_3);
    border: 2px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_surface);
    text-align: center;
    cursor: pointer;
    opacity: 0.65;
    transition: border-color var(--motion_fast) var(--motion_ease), background var(--motion_fast) var(--motion_ease), opacity var(--motion_fast) var(--motion_ease);
  }

  :where(.rep_tile:hover) {
    opacity: 1;
  }

  :where(.rep_tile:has(input:checked)) {
    opacity: 1;
    border-color: var(--color_accent);
    background: color-mix(in srgb, var(--color_accent) 14%, var(--color_surface));
  }

  :where(.rep_tile:has(input:focus-visible)) {
    outline: 2px solid var(--color_link);
    outline-offset: 2px;
  }

  :where(.rep_tile_logo) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius);
    background: var(--color_primary);
    color: var(--color_on_fill);
    font-size: var(--text_xl);
    font-weight: 700;
    object-fit: cover;
  }

  /* The mark on a picked one, in its corner. */
  :where(.rep_tile:has(input:checked))::after {
    content: "\2713";
    position: absolute;
    top: var(--space_2);
    right: var(--space_2);
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--color_accent);
    color: var(--color_on_accent);
    font-size: var(--text_sm);
    font-weight: 700;
  }

  :where(.rep_tile_name) {
    font-size: var(--text_sm);
    overflow-wrap: anywhere;
  }

  :where(.switch, .choice) {
    display: flex;
    align-items: flex-start;
    gap: var(--space_3);
    min-height: var(--touch_target);
    cursor: pointer;
  }

  /* Every on/off box is a switch (field_checkbox too: never a tick box). */
  :where(.switch_input, .field_checkbox) {
    appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 2.75rem;
    height: 1.5rem;
    margin: 0.1rem 0 0;
    border-radius: 999px;
    background: var(--color_border);
    cursor: pointer;
    transition: background var(--motion_fast) var(--motion_ease);
  }

  :where(.switch_input, .field_checkbox)::before {
    content: "";
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: var(--color_on_fill);
    transition: transform var(--motion_fast) var(--motion_ease);
  }

  :where(.switch_input:checked, .field_checkbox:checked) {
    background: var(--color_primary);
  }

  :where(.switch_input:checked, .field_checkbox:checked)::before {
    transform: translateX(1.25rem);
  }

  :where(.switch_input:disabled, .field_checkbox:disabled, .choice_input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
  }

  :where(.switch_input:focus-visible, .field_checkbox:focus-visible, .choice_input:focus-visible) {
    outline: 2px solid var(--color_link);
    outline-offset: 2px;
  }

  :where(.switch_text) {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }

  :where(.switch_label) {
    font-weight: 600;
  }

  :where(.switch_help) {
    color: var(--color_text_muted);
    font-size: var(--text_sm);
  }

  :where(.choice_group) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
    margin: 0;
    padding: 0;
    border: 0;
  }

  :where(.choice_input) {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.15rem 0 0;
    accent-color: var(--color_primary);
  }

  :where(.field_color) {
    width: 4rem;
    height: var(--touch_target);
    padding: 0.2rem;
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg);
  }

  /* A role's, group's or species' colours (entity_colors partial): each
     switched-on one's dark and light pickers side by side. */
  :where(.entity_colors) {
    margin: 0 0 var(--space_4);
    padding: 0;
    border: 0;
  }

  :where(.entity_colors_legend) {
    margin-bottom: var(--space_2);
    font-weight: 700;
  }

  :where(.entity_colors_pair) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_4);
    margin: 0 0 var(--space_3) var(--space_6);
  }

  :where(.entity_colors_pick) {
    display: flex;
    flex-direction: column;
    gap: var(--space_1);
  }

  /* Under a template's CSS: the colour tags it can use. */
  :where(.color_tags) {
    margin: 0 0 var(--space_4);
  }

  /* A list's search and filters: one row (wrapping on phones). */
  :where(.search_form) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_2);
    margin-bottom: var(--space_4);
  }

  :where(.search_form_query) {
    flex: 1 1 16rem;
  }

  :where(.search_form_pick) {
    flex: 0 1 14rem;
  }

  :where(.danger_zone) {
    margin-top: var(--space_6);
    padding-top: var(--space_4);
    border-top: 1px solid var(--color_border);
  }

  :where(.detail_list_small) {
    margin-top: var(--space_2);
    font-size: var(--text_sm);
  }

  /* ---------- Boards (leaderboards) ---------- */

  /* Joined buttons, one of them picked (a board's time ranges, its
     orders): the whole width on a phone, as wide as they need from 40rem. */
  :where(.segmented) {
    display: flex;
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  @media (min-width: 40rem) {
    :where(.segmented) {
      display: inline-flex;
    }
  }

  :where(.board) {
    margin: 0 0 var(--space_4);
    padding: 0;
    list-style: none;
  }

  :where(.board_row:last-child) {
    border-bottom: none;
  }

  :where(.board_row) {
    display: flex;
    align-items: center;
    gap: var(--space_3);
    padding: var(--space_3) 0;
    border-bottom: 1px solid var(--color_border);
  }

  :where(.board_rank) {
    min-width: 2rem;
    color: var(--color_text_muted);
    font-size: var(--text_lg);
    font-weight: 700;
    text-align: center;
  }

  :where(.board_main) {
    flex: 1;
    min-width: 0;
  }

  /* An avatar, or the name's first letter in a circle when there's none. */
  :where(.avatar) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--color_primary);
    color: var(--color_on_fill);
    font-weight: 700;
  }

  :where(.avatar_image) {
    object-fit: cover;
    background: var(--color_bg_raised);
  }

  :where(.avatar_large) {
    width: 6rem;
    height: 6rem;
    font-size: var(--text_xl);
  }

  /* A hover card: shown over the page by cards.js, next to the name. */
  :where(.card_popup) {
    position: absolute;
    z-index: 50;
    width: min(20rem, calc(100vw - 2 * var(--space_4)));
    padding: var(--space_4);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
  }

  :where(.card_popup[hidden]) {
    display: none;
  }

  /* ---------- Built pages (page builder) ---------- */

  :where(.site_grid) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space_4);
  }

  /* Each block is a size container, so a widget can lay itself out for the
     room it has (Live now stacks in a narrow block). */
  :where(.site_block) {
    min-width: 0;
    container-type: inline-size;
  }

  :where(.site_block_style_plain) {
    --card_bg: transparent;
    --card_border: transparent;
    --card_pad: 0;
  }

  :where(.site_block_style_accent) {
    --card_bg: color-mix(in srgb, var(--color_primary) 12%, var(--color_bg_raised));
    --card_border: var(--color_primary);
  }

  :where(.site_block_align_center) {
    text-align: center;
  }

  :where(.site_block_space_tight) {
    --card_pad: var(--space_2);
  }

  :where(.site_block_space_roomy) {
    --card_pad: var(--space_6);
  }

  @media (max-width: 39.99rem) {
    :where(.site_block_hide_phone) {
      display: none;
    }
  }

  @media (min-width: 40rem) {
    :where(.site_block_hide_wide) {
      display: none;
    }
  }

  /* 3 columns on wide screens; a block spans the width it's set to. A
     grid shape (site_grid_<shape>, the page builder's) sets the columns
     and, for a single column, the spans; the editor's grid reads them too. */
  @media (min-width: 64rem) {
    :where(.site_grid) {
      grid-template-columns: var(--grid_columns, repeat(3, minmax(0, 1fr)));
    }

    :where(.site_block_w2) {
      grid-column: span var(--grid_span2, 2);
    }

    :where(.site_block_w3) {
      grid-column: span var(--grid_span3, 3);
    }

    /* A page's content takes two columns, with the blocks beside it stacked in the third. */
    :where(.site_beside_main) {
      grid-column: span var(--grid_span2, 2);
    }

    :where(.site_grid_wide_left) {
      --grid_columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    }

    :where(.site_grid_wide_middle) {
      --grid_columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
    }

    :where(.site_grid_wide_right) {
      --grid_columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
    }
  }

  :where(.site_grid_single) {
    --grid_columns: minmax(0, 1fr);
    --grid_span2: 1;
    --grid_span3: 1;
  }

  :where(.site_grid_narrow) {
    max-width: 48rem;
    margin-inline: auto;
  }

  :where(.site_beside) {
    display: flex;
    flex-direction: column;
    gap: var(--space_4);
    min-width: 0;
  }

  :where(.site_divider) {
    margin: var(--space_2) 0;
    border: 0;
    border-top: 1px solid var(--color_border);
  }

  :where(.site_space) {
    height: var(--space_6);
  }

  :where(.site_button) {
    margin: 0;
  }

  :where(.site_logo) {
    flex: none;
    width: 2rem;
    height: 2rem;
    margin-right: var(--space_2);
    border-radius: var(--radius);
    object-fit: contain;
    vertical-align: middle;
  }

  :where(.site_logo_large) {
    width: 6rem;
    height: 6rem;
  }

  :where(.site_image) {
    margin: 0;
  }

  :where(.site_image_img, .site_banner_img, .site_settings_image) {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
  }

  :where(.site_banner) {
    display: flex;
    flex-direction: column;
    gap: var(--space_3);
  }

  :where(.site_banner_img) {
    width: 100%;
    max-height: 20rem;
    object-fit: cover;
  }

  :where(.site_banner_main) {
    display: flex;
    align-items: center;
    gap: var(--space_3);
  }

  :where(.site_banner_logo) {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius);
    object-fit: contain;
  }

  /* Under a banner: the logo sits over its bottom edge, framed, so the
     picture and the name read as one header rather than a stack. */
  :where(.site_banner_main_over) {
    align-items: flex-end;
    margin-top: calc(var(--space_3) * -1 - 3rem);
    padding-inline: var(--space_4);
  }

  :where(.site_banner_logo_over) {
    width: 6rem;
    height: 6rem;
    border: 4px solid var(--color_bg);
    background: var(--color_bg);
  }

  :where(.site_video_frame) {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius);
  }

  :where(.site_video_vertical) {
    max-width: 22rem;
    margin: 0 auto;
  }

  :where(.site_video_frame_vertical) {
    aspect-ratio: 9 / 16;
  }

  :where(.site_links_link) {
    display: inline-flex;
    align-items: center;
    gap: var(--space_2);
  }

  /* ---------- Modal ---------- */

  :where(.modal) {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space_4);
  }

  :where(.modal_backdrop) {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.55);
  }

  /* The box stays put and its content scrolls, so the close button is
     always in reach however long the form. */
  :where(.modal_box) {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(32rem, 100%);
    max-height: calc(100dvh - 2 * var(--space_4));
    overflow: hidden;
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    box-shadow: 0 1rem 2.5rem rgb(0 0 0 / 0.45);
    animation: modal_in var(--motion_normal) var(--motion_ease);
  }

  :where(.modal_body) {
    flex: 1;
    min-height: 0;
    padding: var(--space_5) var(--space_4) var(--space_4);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  /* On a phone: a sheet from the bottom, full width, in thumb's reach. */
  @media (max-width: 39.99rem) {
    :where(.modal) {
      align-items: flex-end;
      padding: 0;
    }

    :where(.modal_box),
    :where(.modal_box_wide) {
      width: 100%;
      max-height: 92dvh;
      border-bottom: 0;
      border-radius: var(--radius) var(--radius) 0 0;
      animation-name: modal_sheet_in;
    }

    :where(.modal_body) {
      padding-bottom: calc(var(--space_4) + env(safe-area-inset-bottom, 0px));
    }
  }

  /* Big editors in a popup (data-modal-wide in the content). */
  :where(.modal_box_wide) {
    width: min(64rem, 100%);
  }

  :where(.modal_box:focus) {
    outline: none;
  }

  :where(.modal_close) {
    position: absolute;
    top: var(--space_2);
    right: var(--space_2);
    z-index: 1;
  }

  :where(.modal_open) {
    overflow: hidden;
  }

  @keyframes modal_in {
    from {
      opacity: 0;
      transform: translateY(0.5rem);
    }
  }

  @keyframes modal_sheet_in {
    from {
      transform: translateY(100%);
    }
  }

  /* A hover card's buttons: View profile, Report, Warn, Open in admin. */
  :where(.card_actions) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1);
    margin-top: var(--space_2);
    padding-top: var(--space_2);
    border-top: 1px solid var(--color_border);
  }

  :where(.person_link) {
    color: inherit;
    text-decoration: none;
  }

  :where(.person_link:hover, .person_link:focus-visible) {
    text-decoration: underline;
  }

  :where(.progress) {
    width: 100%;
    height: 0.5rem;
    accent-color: var(--color_accent);
  }

  /* ---------- The in-page color picker (color_picker.js) ---------- */

  :where(.color_pick) {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space_1);
  }

  :where(.color_pick_swatch) {
    width: 2.2rem;
    height: 2.2rem;
    border: 2px solid var(--color_border);
    border-radius: var(--radius);
    cursor: pointer;
  }

  :where(.color_pick_swatch:focus-visible) {
    outline: 2px solid var(--color_link);
    outline-offset: 2px;
  }

  :where(.color_hex) {
    width: 6.5rem;
    font-family: ui-monospace, Consolas, monospace;
  }

  :where(.color_pick_popover) {
    position: absolute;
    top: calc(100% + var(--space_1));
    left: 0;
    z-index: 60;
    display: grid;
    gap: var(--space_2);
    width: 14rem;
    padding: var(--space_2);
    background: var(--color_bg_raised);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
  }

  /* Saturation left to right, brightness bottom to top, over the hue. */
  :where(.color_pick_sv) {
    position: relative;
    height: 9rem;
    border-radius: calc(var(--radius) / 2);
    background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent);
    cursor: crosshair;
    touch-action: none;
  }

  :where(.color_pick_hue) {
    position: relative;
    height: 0.9rem;
    border-radius: 0.45rem;
    background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
    cursor: pointer;
    touch-action: none;
  }

  :where(.color_pick_thumb) {
    position: absolute;
    top: 50%;
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  /* ---------- Lists (items with Edit in a modal) ---------- */

  /* One item: what it is on the left, its buttons on the right, Delete
     (the trash) last and set apart from the rest. */
  :where(.list_row) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_2);
    margin-inline: calc(-1 * var(--space_2));
    padding: var(--space_2);
    border-bottom: 1px solid var(--color_border);
  }

  /* Every other row is shaded a little, so long lists are easier to follow
     (the text stays lined up with the rest of the card). */
  :where(.list_row:nth-child(even)) {
    background: var(--color_row_alt);
  }

  :where(.list_row_main) {
    flex: 1;
    min-width: 12rem;
  }

  /* Copy beside a row's pencil: a form that sits in the row like a button. */
  :where(.copy_form) {
    display: inline-flex;
    margin: 0;
  }

  :where(.list_row_actions) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_1);
  }

  :where(.list_row_delete) {
    margin-left: var(--space_3);
  }

  /* A row with a small picture first (an achievement, a character). */
  :where(.list_row_with_picture) {
    display: flex;
    align-items: center;
    gap: var(--space_3);
  }

  :where(.list_row_picture) {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
    border-radius: var(--radius);
  }

  :where(.list_row_picture_empty) {
    background: var(--color_bg);
    color: var(--color_text_muted);
  }

  /* The bell's popup (bell_popup.js): a small panel under the bell, its
     rows clickable, each at most 5 lines. */
  :where(.bell_wrap) {
    position: relative;
    display: inline-flex;
  }

  :where(.bell_drop) {
    position: absolute;
    top: calc(100% + var(--space_2));
    right: 0;
    z-index: 30;
    width: min(24rem, calc(100vw - 2rem));
    max-height: min(32rem, 75vh);
    overflow-y: auto;
    background: var(--color_bg_raised);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    box-shadow: 0 1rem 2.5rem rgb(0 0 0 / 0.45);
  }

  :where(.bell_drop_head) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_2);
    padding: var(--space_2) var(--space_3);
    background: var(--color_card_header);
    color: var(--color_on_card_header);
    border-bottom: 1px solid var(--color_border);
  }

  :where(.bell_drop_title) {
    margin: 0;
    font-family: var(--font_heading, var(--font_body));
    font-weight: 700;
  }

  :where(.bell_drop_list) {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  :where(.bell_row) {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: var(--space_2) var(--space_3);
    border-bottom: 1px solid var(--color_border);
    color: var(--color_text);
    text-decoration: none;
  }

  :where(.bell_row:hover) {
    background: color-mix(in srgb, var(--color_link) 10%, transparent);
    text-decoration: none;
  }

  :where(.bell_row_unread) {
    font-weight: 700;
    border-left: 3px solid var(--color_link);
  }

  :where(.bell_row_text) {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
  }

  :where(.bell_row_time) {
    font-size: var(--text_xs);
    font-weight: 400;
    color: var(--color_text_muted);
  }

  :where(.bell_drop_empty) {
    padding: var(--space_3);
    color: var(--color_text_muted);
  }

  :where(.bell_drop_all) {
    display: block;
    padding: var(--space_2) var(--space_3);
    text-align: center;
    font-weight: 600;
  }

  /* A field builder row's "Text · fills itself with..." line. */
  :where(.field_builder_summary) {
    display: block;
    font-weight: 400;
  }

  /* Things waiting for approval: a badge that stands out. */
  :where(.badge_waiting) {
    background: var(--color_unsaved);
    color: var(--color_bg);
  }

  /* Rows put in order by dragging (drag_list.js): the grip, the name, its
     switch, and up and down arrows for the keyboard. */
  :where(.drag_list) {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  :where(.drag_row) {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--space_3);
    padding: var(--space_2);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg);
    margin-bottom: var(--space_2);
  }

  :where(.drag_row_moving) {
    outline: 2px solid var(--color_link);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
  }

  :where(.drag_handle) {
    display: inline-flex;
    padding: var(--space_1);
    cursor: grab;
    touch-action: none;
    color: var(--color_text_muted);
  }

  /* A row's up and down arrows (drag_grip.hbs): on a phone instead of the
     grip; with a mouse kept for the keyboard, seen once focused. */
  :where(.drag_arrows) {
    display: inline-flex;
    gap: var(--space_1);
    vertical-align: middle;
  }

  @media (pointer: coarse) {
    :where(.drag_handle) {
      display: none;
    }
  }

  @media (pointer: fine) {
    :where(.drag_arrows:not(:focus-within)) {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
  }

  :where(.drag_row_title) {
    flex: 1 1 10rem;
    font-weight: 600;
  }

  /* Where a section comes from (an add-on, a custom widget...). */
  :where(.drag_row_from) {
    margin-inline-start: var(--space_2);
    color: var(--color_text_muted);
    font-size: var(--text_xs);
    font-weight: 400;
  }

  :where(.drag_buttons) {
    display: flex;
    gap: var(--space_1);
  }

  /* A picture put in a post as a link: the word, and the picture shown
     beside it on hover or focus (post_peek.js). */
  :where(.post_peek) {
    text-decoration-style: dotted;
  }

  :where(.post_peek_box) {
    position: absolute;
    z-index: 50;
    max-width: 320px;
    padding: var(--space_1);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    box-shadow: 0 4px 16px rgb(0 0 0 / 30%);
    pointer-events: none;
  }

  :where(.post_peek_img) {
    display: block;
    max-width: 100%;
    max-height: 320px;
  }

  /* The Credits page: each kind's makers, a line each. */
  :where(.credits_list) {
    display: grid;
    gap: var(--space_3);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  /* The Staff page: each category's people as cards in a grid. */
  :where(.staff_people) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: var(--space_3);
    margin: 0 0 var(--space_6);
    padding: 0;
    list-style: none;
  }

  :where(.staff_person) {
    display: flex;
    align-items: center;
    gap: var(--space_3);
    margin: 0;
  }

  /* A row that can't move keeps the grip's room, so names line up. */
  :where(.drag_handle_off) {
    visibility: hidden;
  }

  /* A list inside a row (sub-forums under their forum), set in. */
  :where(.drag_sublist) {
    margin-left: var(--space_6);
  }

  /* A list you add to one line at a time (automod's sites and words): the
     line and its buttons, then a search box and the entries, each a row
     with its trash, in a box that scrolls once it's long. */
  :where(.list_add) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_2);
    margin-top: var(--space_4);
  }

  :where(.list_add_input) {
    flex: 1 1 14rem;
  }

  :where(.list_add_buttons) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_2);
  }

  :where(.list_heading) {
    display: flex;
    align-items: center;
    gap: var(--space_2);
    margin: var(--space_4) 0 var(--space_2);
    font-size: var(--text_md);
  }

  :where(.list_search) {
    margin-bottom: var(--space_2);
  }

  :where(.list_box) {
    max-height: 20rem;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
  }

  :where(.list_box_row) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_2);
    padding: var(--space_1) var(--space_1) var(--space_1) var(--space_3);
    border-bottom: 1px solid var(--color_border);
  }

  :where(.list_box_row:last-child) {
    border-bottom: 0;
  }

  /* Shaded every other row too, like list rows. */
  :where(.list_box_row:nth-child(even)) {
    background: var(--color_row_alt);
  }

  :where(.list_box_text) {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* A row that moves (drag_grip: a grip with a mouse, arrows on a phone)
     beside what it holds (a <details>, a form, a card). */
  :where(.drag_row) {
    display: flex;
    gap: var(--space_2);
    align-items: flex-start;
  }

  :where(.drag_row_body) {
    flex: 1;
    min-width: 0;
  }

  :where(.list_box_empty) {
    padding: var(--space_3);
    color: var(--color_text_muted);
  }

  /* Ticked badge fields on a profile. */
  :where(.profile_field_badges) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1);
    margin: 0 0 var(--space_2);
  }

  :where(.profile_field_badges:empty) {
    display: none;
  }

  /* ---------- Tables ---------- */

  :where(.data_table) {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text_sm);
  }

  :where(.data_table:not(:last-child), .table_scroll:not(:last-child)) {
    margin-bottom: var(--space_4);
  }

  /* Tables shade every other row too. */
  :where(tr:nth-child(even)) {
    background: var(--color_row_alt);
  }

  :where(.data_cell) {
    padding: var(--space_2);
    border-bottom: 1px solid var(--color_border);
    text-align: left;
  }

  /* A table of switches' columns (notify_matrix, the forums' access). */
  :where(.matrix_switch) {
    width: 5rem;
    text-align: center;
    vertical-align: middle;
  }

  /* A switch alone in a table cell: centred, no room kept for a label. */
  :where(.switch_cell) {
    justify-content: center;
    align-items: center;
    min-height: 0;
  }

  /* Wide tables scroll sideways inside this instead of the page. */
  :where(.table_scroll) {
    overflow-x: auto;
    max-width: 100%;
  }

  /* ---------- Page numbers ---------- */

  :where(.pager) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1);
    margin: var(--space_4) 0;
  }

  /* Tabs that are links (one page per tab): views/partials/tab_bar.hbs. */
  :where(.tab_bar) {
    position: relative;
    border-bottom: 1px solid var(--color_border);
    padding-bottom: var(--space_2);
    margin-bottom: var(--space_4);
  }

  :where(.tab_bar_links) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_2);
  }

  /* On a phone (with scripts): one button showing the tab you're on, which
     opens the list of them all (page_tabs.js). */
  :where(.tab_bar_toggle) {
    display: none;
  }

  @media (max-width: 39.99rem) {
    :where(.tab_bar_ready) {
      border-bottom: 0;
      padding-bottom: 0;
    }

    :where(.tab_bar_toggle_on) {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space_2);
      width: 100%;
      min-height: var(--touch_target);
      padding: 0 var(--space_3);
      border: 2px solid var(--color_primary);
      border-radius: var(--radius);
      background: var(--color_bg_raised);
      color: var(--color_text);
      font: inherit;
      font-weight: 700;
      cursor: pointer;
    }

    /* Open: the button joins the list below it. */
    :where(.tab_bar_toggle_on[aria-expanded="true"]) {
      border-end-start-radius: 0;
      border-end-end-radius: 0;
      background: var(--color_primary);
      color: var(--color_on_fill);
    }

    :where(.tab_bar_links_folded) {
      display: none;
    }

    :where(.tab_bar_links_open) {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      z-index: 30;
      display: flex;
      flex-direction: column;
      gap: 0;
      padding: 0;
      border: 2px solid var(--color_primary);
      border-top: 0;
      border-radius: 0 0 var(--radius) var(--radius);
      background: var(--color_bg_raised);
      box-shadow: 0 0.75rem 2rem rgb(0 0 0 / 0.5);
      overflow: hidden;
    }

    /* Each tab in the open list is its own row. */
    :where(.tab_link_row) {
      display: flex;
      border-radius: 0;
      border-bottom: 1px solid var(--color_border);
      padding: 0 var(--space_4);
    }

    :where(.tab_link_row:last-child) {
      border-bottom: 0;
    }

    :where(.tab_link_row:hover) {
      background: var(--color_surface);
    }
  }

  :where(.tab_link) {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch_target);
    padding: 0 var(--space_3);
    border-radius: var(--radius);
    color: var(--color_text);
    text-decoration: none;
  }

  :where(.tab_link_current) {
    background: var(--color_primary);
    color: var(--color_on_fill);
  }

  :where(.pager_link) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch_target);
    min-height: var(--touch_target);
    padding: 0 var(--space_2);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    color: var(--color_text);
    text-decoration: none;
  }

  :where(.pager_link_current) {
    border-color: var(--color_primary);
    background: var(--color_primary);
    color: var(--color_on_fill);
  }

  :where(.pager_gap) {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space_2);
    color: var(--color_text_muted);
  }

  /* ---------- Cookie notice ---------- */

  /* A card floating centred near the bottom until OK is clicked. */
  :where(.cookie_notice) {
    position: fixed;
    bottom: var(--space_4);
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    display: flex;
    align-items: center;
    gap: var(--space_3);
    width: min(36rem, calc(100vw - 2 * var(--space_4)));
    margin: 0;
    padding: var(--space_3) var(--space_4);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
  }
  /* The style guide's sample of it: shown in place. */
  :where(.cookie_notice_sample) {
    position: static;
    transform: none;
    width: auto;
  }

  /* Room at the bottom so the notice never covers the footer. */
  :where(.cookie_notice_icon) {
    flex: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color_text_muted);
  }

  :where(.cookie_notice_text) {
    flex: 1;
    margin: 0;
    font-size: var(--text_sm);
  }

  /* ---------- Profile header (profile_header: the public profile and
     your account page) ---------- */

  /* --profile_color is the person's color (profile_look.js); without one,
     the brand teal. */
  :where(.profile_top) {
    --profile_color_or: var(--profile_color, var(--color_accent));
    overflow: hidden;
    margin-bottom: var(--space_5);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
  }

  /* The same cut everywhere, so moving a banner shows what the profile will. */
  :where(.profile_banner) {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 1;
    min-height: 6rem;
    width: 100%;
    background: linear-gradient(135deg, var(--color_primary), var(--color_save));
  }

  /* A picture always fills the width. A short one shows the profile color
     around it. */
  :where(.profile_banner_picture) {
    background: var(--profile_color, var(--color_accent));
  }

  /* profile_look.js sets how high it sits. */
  :where(.profile_banner_image) {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: auto;
  }

  :where(.profile_banner_wrap) {
    position: relative;
  }

  /* The pencil, Move and trash on a banner, and on an avatar's corners. */
  :where(.picture_tools) {
    display: flex;
    gap: var(--space_1);
  }

  :where(.picture_tools_banner) {
    position: absolute;
    top: var(--space_2);
    right: var(--space_2);
  }

  /* A solid back, to read over any picture. */
  :where(.picture_tool) {
    background: var(--color_bg);
  }

  :where(.picture_tool_edit) {
    position: absolute;
    right: 0;
    bottom: 0;
  }

  /* Moving a banner where it sits (banner_move). */
  :where(.profile_banner_moving) {
    outline: 2px solid var(--color_link);
    outline-offset: -2px;
    cursor: grab;
    touch-action: none;
  }

  :where(.profile_banner_moving:active) {
    cursor: grabbing;
  }

  /* Room under it, because the avatar sits up over the banner's edge. */
  :where(.banner_move) {
    margin-bottom: 3.5rem;
    padding: var(--space_3) var(--space_5);
    border-bottom: 1px solid var(--color_border);
  }

  :where(.banner_controls) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: var(--space_2) var(--space_4);
    margin-bottom: var(--space_2);
  }

  :where(.banner_edit_preview) {
    margin-bottom: var(--space_3);
    border-radius: var(--radius);
  }

  :where(.picture_pick_button) {
    position: relative;
    cursor: pointer;
  }

  :where(.picture_pick_button:has(:focus-visible)) {
    outline: 2px solid var(--color_link);
    outline-offset: 2px;
  }

  :where(.picture_pick_busy) {
    opacity: 0.6;
    cursor: progress;
  }

  :where(.profile_head) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--space_2) var(--space_4);
    padding: 0 var(--space_5) var(--space_4);
  }

  /* The avatar (or its letter), ringed in the profile color, over the banner. */
  :where(.profile_avatar_wrap) {
    position: relative;
    flex: none;
    width: 7rem;
    height: 7rem;
    margin-top: -3.5rem;
  }

  :where(.profile_avatar) {
    width: 7rem;
    height: 7rem;
    border: 4px solid var(--profile_color_or);
    font-size: var(--text_2xl);
  }

  :where(.profile_identity) {
    flex: 1 1 12rem;
    min-width: 0;
    padding-top: var(--space_3);
  }

  :where(.profile_actions) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_2);
  }

  :where(.profile_name) {
    margin: 0;
    font-size: var(--text_2xl);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  :where(.profile_username) {
    margin: 0;
  }

  :where(.profile_progress) {
    padding: 0 var(--space_5) var(--space_4);
  }

  /* --swatch: a milestone's own color (profile_look.js). */
  :where(.profile_line) {
    margin: 0;
    font-weight: 600;
    color: var(--swatch, var(--profile_color_or));
  }

  :where(.profile_platform_list) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1) var(--space_3);
  }

  :where(.profile_bar) {
    width: 100%;
    max-width: none;
    margin-top: var(--space_1);
    accent-color: var(--profile_color_or);
  }

  /* In a row from the left at their own size, so one looks as right as six. */
  :where(.profile_stats) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_3) var(--space_6);
    margin: 0;
    padding: var(--space_3) var(--space_5);
    border-top: 1px solid var(--color_border);
  }

  :where(.profile_stat_label) {
    font-size: var(--text_xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color_text_muted);
  }

  :where(.profile_stat_value) {
    margin: 0;
    font-weight: 600;
  }

  /* Sections on the shared grid, filling the gaps a wide one leaves. */
  :where(.profile_grid) {
    grid-auto-flow: dense;
    align-items: start;
  }

  /* The sidebar and the tabs: the sidebar above them on phones, beside
     them (on the right) wide. */
  :where(.profile_layout) {
    display: grid;
    gap: var(--space_4);
    margin-block-start: var(--space_4);
  }

  :where(.profile_sidebar) {
    display: flex;
    flex-direction: column;
    gap: var(--space_4);
    min-width: 0;
  }

  :where(.profile_body) {
    min-width: 0;
  }

  @media (min-width: 52rem) {
    :where(.profile_layout_side) {
      grid-template-columns: minmax(0, 1fr) 18rem;
      align-items: start;
    }

    :where(.profile_sidebar) {
      grid-column: 2;
      grid-row: 1;
    }
  }

  /* Where an avatar comes from: a circle each (account page). */
  :where(.avatar_sources) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_3);
  }

  :where(.avatar_source_item) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space_1);
    width: 4.5rem;
  }

  :where(.avatar_source_name) {
    max-width: 100%;
    overflow: hidden;
    font-size: var(--text_xs);
    color: var(--color_text_muted);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :where(.picture_pick_round) {
    display: contents;
  }

  :where(.avatar_source) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 3.25rem;
    height: 3.25rem;
    padding: 0;
    border: 2px solid var(--color_border);
    border-radius: 50%;
    background: var(--color_bg);
    color: var(--color_text);
    cursor: pointer;
  }

  :where(.avatar_source:hover, .avatar_source_on) {
    border-color: var(--color_primary);
  }

  :where(.avatar_source:disabled) {
    opacity: 0.45;
    cursor: not-allowed;
  }

  :where(.avatar_source_image) {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  :where(.profile_bio) {
    margin: 0 0 var(--space_2);
    overflow-wrap: anywhere;
  }

  /* Moving a banner up or down (banner_position). */
  :where(.banner_place) {
    margin-bottom: var(--space_3);
  }

  :where(.banner_place_frame) {
    margin-bottom: var(--space_2);
    border-radius: var(--radius);
    cursor: grab;
    touch-action: none;
  }

  :where(.banner_place_frame:active) {
    cursor: grabbing;
  }

  :where(.banner_place_range) {
    width: 100%;
    accent-color: var(--color_primary);
  }

  /* The background-save pop-up wears the cookie notice's look (toast
     partial: both classes); above it, and over any modal. */
  :where(.rpgi_toast) {
    z-index: 70;
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
    animation: modal_in var(--motion_normal) var(--motion_ease);
  }

  :where(.rpgi_toast_icon) {
    color: var(--color_success_text);
  }

  :where(.rpgi_toast_icon_error) {
    color: var(--color_error_text);
  }

  /* ---------- Your account (/account) ---------- */

  :where(.account_card) {
    scroll-margin-top: var(--space_4);
  }

  :where(.account_subheading) {
    margin: var(--space_4) 0 var(--space_2);
    font-size: var(--text_md);
  }

  :where(.account_subheading:first-child) {
    margin-top: 0;
  }

  :where(.account_suggest_label) {
    margin: var(--space_3) 0 var(--space_1);
  }

  :where(.account_suggest) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_2);
    margin-bottom: var(--space_3);
  }

  :where(.account_pill) {
    border-radius: 999px;
  }

  /* The post editor's Gallery: pictures to pick from (post_editor.js). */
  :where(.post_gallery) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_2);
    max-height: 16rem;
    overflow-y: auto;
    padding: var(--space_2);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
  }

  :where(.post_gallery_choice) {
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
  }

  :where(.post_gallery_choice:hover, .post_gallery_choice:focus-visible) {
    border-color: var(--color_link);
  }

  :where(.post_gallery_thumb) {
    display: block;
    width: 5rem;
    height: 5rem;
    border-radius: var(--radius);
    object-fit: cover;
  }

  /* The email logo on Email look, at the size emails show it. */
  :where(.email_logo_preview) {
    display: block;
    width: 160px;
    max-width: 100%;
    height: auto;
  }

  /* An address with a Copy button, and something shown only when asked. */
  :where(.copy_shown) {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_2);
  }

  :where(.reveal_box) {
    margin-block: var(--space_3);
  }

  /* Spread evenly across the width, wrapping down. */
  :where(.color_list) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--space_3);
    margin-bottom: var(--space_3);
  }

  :where(.color_list_row) {
    display: flex;
    align-items: center;
    gap: var(--space_1);
  }

  :where(.avatar_gallery_pick) {
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
  }

  :where(.avatar_gallery_pick:focus-visible) {
    outline: 2px solid var(--color_link);
    outline-offset: 2px;
  }

  /* Pictures for roleplays: thumbnails to pick from (radios hidden, as with
     the color picker) or to delete. */
  :where(.picture_picker) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_3);
    margin-bottom: var(--space_3);
  }

  :where(.picture_choice) {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space_2);
    padding: var(--space_1);
    border-radius: var(--radius);
    cursor: pointer;
  }

  :where(.picture_choice:has(:checked)) {
    box-shadow: 0 0 0 2px var(--color_bg), 0 0 0 4px var(--color_text);
  }

  :where(.picture_choice:has(:focus-visible)) {
    outline: 2px solid var(--color_link);
    outline-offset: 4px;
  }

  :where(.picture_choice_none) {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch_target);
    padding: 0 var(--space_3);
    border: 2px solid var(--color_border);
    border-radius: 999px;
    font-size: var(--text_sm);
  }

  :where(.picture_thumb_avatar) {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    object-fit: cover;
  }

  :where(.removed_picture_preview) {
    display: block;
    max-width: 20rem;
    height: auto;
    border-radius: var(--radius);
  }

  :where(.gallery_thumb) {
    display: block;
    width: 7rem;
    height: 7rem;
    border-radius: var(--radius);
    object-fit: cover;
  }

  :where(.picture_thumb_banner) {
    width: 10rem;
    aspect-ratio: 5 / 2;
    border-radius: var(--radius);
    object-fit: cover;
  }

  /* One row per thing: what it is, then its button. */
  :where(.account_row) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_2) var(--space_3);
    padding: var(--space_2) 0;
    border-bottom: 1px solid var(--color_border);
  }

  :where(.account_row:last-child) {
    border-bottom: none;
  }

  :where(.account_row_main) {
    flex: 1 1 14rem;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
  }

  /* Connections: a tile each, across the width. */
  :where(.connections) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: var(--space_3);
    margin-top: var(--space_3);
  }

  :where(.connection_tile) {
    padding: var(--space_3);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg);
  }

  :where(.connection_tile:last-child) {
    border-bottom: 1px solid var(--color_border);
  }

  /* Upload by dropping: the file box lies invisibly over the whole dropzone,
     so a click or a drop anywhere on it works. */
  :where(.upload_dropzone) {
    position: relative;
    padding: var(--space_6) var(--space_4);
    border: 2px dashed var(--color_border);
    border-radius: var(--radius);
    text-align: center;
  }

  :where(.upload_dropzone:hover, .upload_dropzone_over, .upload_dropzone:has(:focus-visible)) {
    border-color: var(--color_link);
    background: var(--color_bg);
  }

  :where(.upload_dropzone_busy) {
    border-style: solid;
    opacity: 0.8;
  }

  :where(.upload_dropzone_text) {
    margin: 0 0 var(--space_1);
  }

  :where(.upload_dropzone_input) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }

  :where(.upload_button) {
    margin-top: var(--space_2);
  }

  /* A line in Security: what it is, then its button. */
  :where(.security_line) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_2) var(--space_4);
  }

  :where(.security_line_text) {
    flex: 1 1 16rem;
    margin: 0;
    overflow-wrap: anywhere;
  }

  /* The profile color picker: radios shown as swatches (--swatch from
     profile_look.js), side by side and wrapping down. */
  :where(.color_picker) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_3);
  }

  /* Any color: its own line under the site's colors. */
  :where(.color_custom) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
    margin-top: var(--space_4);
    padding-top: var(--space_3);
    border-top: 1px solid var(--color_border);
  }

  :where(.color_custom_label) {
    margin: 0;
  }

  :where(.color_custom_row) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_3);
  }

  /* A settings card: what it's about on the left, the settings on the right. */
  :where(.settings_row) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space_2) var(--space_5);
    padding: var(--space_4) 0;
    border-top: 1px solid var(--color_border);
  }

  :where(.settings_row_first) {
    border-top: 0;
  }

  @media (min-width: 48rem) {
    :where(.settings_row) {
      grid-template-columns: 11rem minmax(0, 1fr);
    }
  }

  :where(.settings_row_title) {
    margin: 0;
    font-size: var(--text_md);
  }

  :where(.settings_row_body) {
    min-width: 0;
  }

  :where(.settings_row_help) {
    margin: 0 0 var(--space_3);
  }

  /* Fields keep to a comfortable width; pictures and colors take the room. */
  :where(.settings_narrow) {
    max-width: 44rem;
  }

  :where(.settings_stack) {
    display: flex;
    flex-direction: column;
    gap: var(--space_4);
  }

  :where(.color_choice) {
    position: relative;
    display: inline-flex;
    border-radius: 999px;
    cursor: pointer;
  }

  :where(.color_input) {
    position: absolute;
    opacity: 0;
  }

  :where(.color_swatch) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch_target);
    height: var(--touch_target);
    border: 2px solid var(--color_border);
    border-radius: 50%;
    background: var(--swatch, var(--color_bg));
  }

  :where(.color_swatch_none) {
    padding: 0 var(--space_3);
    border-radius: 999px;
    font-size: var(--text_sm);
  }

  :where(.color_choice:has(:checked)) {
    box-shadow: 0 0 0 2px var(--color_bg), 0 0 0 4px var(--color_text);
  }

  :where(.color_choice:has(:focus-visible)) {
    outline: 2px solid var(--color_link);
    outline-offset: 6px;
  }

  /* "Skip to the content": the first thing a keyboard reaches, shown only
     while it has focus. */
  :where(.skip_link) {
    position: absolute;
    top: var(--space_2);
    left: var(--space_2);
    z-index: 1000;
    padding: var(--space_2) var(--space_3);
    border-radius: var(--radius);
    background: var(--color_primary);
    color: var(--color_on_fill);
    transform: translateY(-200%);
  }

  :where(.skip_link:focus) {
    transform: none;
  }

  :where(.visually_hidden) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* ---------- Passkeys ---------- */

  :where(.passkey_box) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
  }

  /* The help button: fixed in a corner; the page keeps room below its
     content so it never covers a save button. */
  :where(.help_button) {
    position: fixed;
    right: var(--space_3);
    bottom: var(--space_3);
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--color_primary);
    color: var(--color_on_fill);
  }

  :where(.help_list) {
    margin: 0 0 var(--space_2);
    padding-left: var(--space_3);
  }

  /* Posts (forums, replies): the shared post text. */
  :where(.approval_pictures) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  :where(.approval_picture) {
    max-height: 240px;
    max-width: 100%;
    border-radius: 6px;
  }

  :where(.post_body) {
    overflow-wrap: anywhere;
    /* Floated pictures stay inside the post. */
    display: flow-root;
  }

  /* Pictures in posts (postText.ts): left or right with the text wrapping
     around, center, or full width; small, medium or large. Phones put
     every picture on its own line, full width. */
  :where(.post_figure) {
    margin: var(--space_3) 0;
  }

  :where(.post_picture) {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
  }

  :where(.post_caption) {
    margin-top: var(--space_1);
    color: var(--color_text_muted);
    font-size: var(--text_sm);
    text-align: center;
  }

  :where(.post_figure_size_small) {
    width: 30%;
  }

  :where(.post_figure_size_medium) {
    width: 50%;
  }

  :where(.post_figure_size_large) {
    width: 75%;
  }

  :where(.post_figure_size_full) {
    width: 100%;
  }

  :where(.post_figure_left) {
    float: left;
    margin-right: var(--space_4);
  }

  :where(.post_figure_right) {
    float: right;
    margin-left: var(--space_4);
  }

  :where(.post_figure_center) {
    margin-right: auto;
    margin-left: auto;
  }

  @media (max-width: 39.99rem) {
    :where(.post_figure) {
      float: none;
      width: 100%;
      margin-right: 0;
      margin-left: 0;
    }
  }

  /* Articles (the help and dev sites): headings, code and lists in the
     text (markdown.ts gives each its class), and the contents of long ones. */
  :where(.article_heading) {
    margin: var(--space_5) 0 var(--space_2);
    line-height: 1.25;
  }

  :where(.article_pre) {
    overflow-x: auto;
    padding: var(--space_3);
    border-radius: var(--radius);
    background: var(--color_border);
  }

  :where(.article_code) {
    font-size: 0.92em;
  }

  :where(.article_list) {
    margin: 0;
    padding-left: var(--space_5);
  }

  :where(.article_contents_3) {
    margin-left: var(--space_4);
  }

  /* A help picture (![caption](pictures/x.jpg)) and its caption, and the
     Help pictures page's previews. */
  :where(.article_figure) {
    margin: var(--space_4) 0;
  }

  :where(.article_picture) {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
  }

  :where(.article_caption) {
    margin-top: var(--space_1);
    color: var(--color_text_muted);
    font-size: var(--text_sm);
  }

  :where(.help_picture_row) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_3);
    padding: var(--space_3) 0;
    border-top: 1px solid var(--color_border);
  }

  :where(.help_picture_thumb) {
    width: 12rem;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
  }

  /* Show password (password_toggle.js): the eye sits inside the box's end. */
  :where(.password_wrap) {
    position: relative;
    display: block;
  }

  :where(.password_input) {
    width: 100%;
    padding-inline-end: 2.75rem;
  }

  :where(.password_eye) {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    display: grid;
    place-items: center;
    width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color_text_muted);
    cursor: pointer;
  }

  :where(.password_eye:hover, .password_eye:focus-visible) {
    color: var(--color_text);
  }

  /* ---------- Shared links as cards (web/embeds.ts, embeds.js) ---------- */

  :where(.embed) {
    max-width: 36rem;
    margin: 0 0 var(--space_3);
  }

  :where(.embed_card) {
    display: flex;
    gap: var(--space_3);
    align-items: flex-start;
    padding: var(--space_3);
    border: 1px solid var(--color_border);
    border-left: 4px solid var(--embed_accent, var(--color_primary));
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    color: var(--color_text);
    text-decoration: none;
    transition: border-color var(--motion_fast) ease, background-color var(--motion_fast) ease;
  }

  :where(.embed_card:hover, .embed_card:focus-visible) {
    border-color: var(--embed_accent, var(--color_primary));
    background: color-mix(in srgb, var(--embed_accent, var(--color_primary)) 6%, var(--color_bg_raised));
    color: var(--color_text);
    text-decoration: none;
  }

  :where(.embed_picture),
  :where(.embed_initial) {
    flex: none;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: var(--radius);
    object-fit: cover;
  }

  :where(.embed_initial) {
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--embed_accent, var(--color_primary)) 22%, var(--color_bg));
    color: var(--color_text);
    font-family: var(--font_heading);
    font-size: var(--text_xl);
    font-weight: 700;
  }

  :where(.embed_body) {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space_1);
    min-width: 0;
  }

  :where(.embed_kind) {
    display: inline-flex;
    gap: var(--space_1);
    align-items: center;
    color: var(--color_text_muted);
    font-size: var(--text_xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  :where(.embed_title) {
    color: var(--embed_accent, var(--color_link));
    font-family: var(--font_heading);
    font-size: var(--text_lg);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  :where(.embed_subtitle) {
    color: var(--color_text_muted);
    font-size: var(--text_sm);
  }

  /* A few lines of it, cut off softly. */
  :where(.embed_excerpt) {
    display: -webkit-box;
    overflow: hidden;
    font-size: var(--text_sm);
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  :where(.embed_mature) {
    color: var(--color_text_muted);
    font-style: italic;
  }

  :where(.embed_faces) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1);
  }

  :where(.embed_face),
  :where(.embed_face_img),
  :where(.embed_face_initial) {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
  }

  :where(.embed_face_img) {
    object-fit: cover;
  }

  :where(.embed_face_initial) {
    display: grid;
    place-items: center;
    background: var(--color_bg);
    font-size: var(--text_xs);
    font-weight: 700;
  }

  :where(.embed_meta) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1) var(--space_3);
    color: var(--color_text_muted);
    font-size: var(--text_xs);
  }

  /* Phones: the picture smaller, the card the full width. */
  @media (max-width: 47.99rem) {
    :where(.embed_picture),
    :where(.embed_initial) {
      width: 3.25rem;
      height: 3.25rem;
    }
  }

  :where(.post_quote) {
    margin: 0 0 var(--space_2);
    padding: var(--space_2) var(--space_3);
    border-left: 3px solid var(--color_border);
    color: var(--color_text_muted);
  }

  /* The marks postText.ts turns into formatting. */
  :where(.post_heading) {
    margin: var(--space_4) 0 var(--space_2);
    line-height: 1.25;
    font-weight: 700;
  }

  /* # ## ### in a post: the sizes the editor shows. */
  :where(.post_heading_1) {
    font-size: var(--text_2xl);
  }

  :where(.post_heading_2) {
    font-size: var(--text_xl);
  }

  :where(.post_heading_3) {
    font-size: var(--text_lg);
  }

  :where(.post_subtext) {
    font-size: var(--text_xs);
    color: var(--color_text_muted);
  }

  :where(.post_list) {
    margin: 0 0 var(--space_3);
    padding-left: var(--space_5);
  }

  :where(.post_code) {
    overflow-x: auto;
    margin: 0 0 var(--space_3);
    padding: var(--space_3);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg);
    font-family: var(--font_mono);
    font-size: var(--text_sm);
    white-space: pre-wrap;
  }

  /* Hidden until hovered, tapped (focus) or tabbed to. */
  :where(.post_spoiler) {
    padding: 0 0.15em;
    border-radius: 0.2em;
    background: var(--color_text_muted);
    color: transparent;
    cursor: pointer;
    transition: color var(--motion_fast) var(--motion_ease), background var(--motion_fast) var(--motion_ease);
  }

  :where(.post_spoiler:hover, .post_spoiler:focus) {
    background: var(--color_border);
    color: inherit;
  }

  /* ---------- The post editor (post_editor.js) ---------- */

  :where(.post_toolbar) {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem;
    padding: var(--space_1);
    border: 1px solid var(--color_border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--color_bg_raised);
  }

  :where(.post_tool) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color_text);
    font-size: var(--text_lg);
    cursor: pointer;
  }

  /* On a phone: one row that scrolls sideways, with buttons a thumb can hit. */
  @media (max-width: 39.99rem) {
    :where(.post_toolbar) {
      flex-wrap: nowrap;
      overflow-x: auto;
      scrollbar-width: thin;
      overscroll-behavior-x: contain;
    }

    :where(.post_tool) {
      flex: 0 0 auto;
      width: 2.75rem;
      height: 2.75rem;
    }
  }

  :where(.post_tool:hover, .post_tool:focus-visible) {
    border-color: var(--color_border);
    background: var(--color_bg);
  }

  :where(.post_tool[aria-expanded="true"]) {
    border-color: var(--color_primary);
  }

  :where(.post_tool_gap) {
    width: 1px;
    height: 1.5rem;
    margin: 0 var(--space_1);
    background: var(--color_border);
  }

  /* The live field: looks like the other boxes, grows with the text. */
  :where(.post_rich) {
    min-height: 10rem;
    border-radius: 0 0 var(--radius) var(--radius);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    cursor: text;
  }

  :where(.pe_code) {
    padding: 0 0.2em;
    border-radius: 0.2em;
    background: var(--color_bg_raised);
    font-family: var(--font_mono);
    font-size: 0.9em;
  }

  /* A picture's line in the editor, and the bar that places it. */
  :where(.pe_picture) {
    color: var(--color_text_muted);
    font-family: var(--font_mono);
    font-size: var(--text_sm);
  }

  :where(.post_picture_bar) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_3);
    margin-top: var(--space_2);
    padding: var(--space_3);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
  }

  :where(.post_picture_bar_thumb) {
    width: 6rem;
    height: auto;
    align-self: flex-start;
    border-radius: var(--radius);
  }

  :where(.post_picture_bar_tools) {
    display: flex;
    flex: 1 1 18rem;
    flex-direction: column;
    gap: var(--space_2);
  }

  :where(.post_picture_bar_group) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1);
  }

  :where(.post_picture_pressed) {
    outline: 2px solid var(--color_link);
  }

  :where(.pe_codeblock) {
    display: inline-block;
    width: 100%;
    font-family: var(--font_mono);
    font-size: 0.9em;
    background: var(--color_bg_raised);
  }

  :where(.pe_spoiler) {
    border-radius: 0.2em;
    background: var(--color_border);
  }

  :where(.pe_link) {
    color: var(--color_link);
  }

  :where(.pe_mention) {
    color: var(--color_link);
    font-weight: 600;
  }

  :where(.pe_h1) {
    font-size: var(--text_2xl);
    font-weight: 700;
  }

  :where(.pe_h2) {
    font-size: var(--text_xl);
    font-weight: 700;
  }

  :where(.pe_h3) {
    font-size: var(--text_lg);
    font-weight: 700;
  }

  :where(.pe_subtext) {
    font-size: var(--text_xs);
    color: var(--color_text_muted);
  }

  :where(.pe_quote) {
    padding-left: var(--space_2);
    border-left: 3px solid var(--color_border);
    color: var(--color_text_muted);
  }

  :where(.pe_item) {
    padding-left: var(--space_1);
  }

  /* A mark (** _ # >) in the live field: in the text, not shown. */
  :where(.pe_mark) {
    font-size: 0;
  }

  /* A bullet's "- " is a mark; the dot stands in for it. */
  :where(.pe_bullet)::before {
    content: "• ";
  }

  /* The @mention and emoji pickers, under the toolbar. */
  :where(.post_picker) {
    padding: var(--space_2) var(--space_3);
    border: 1px solid var(--color_border);
    border-bottom: none;
    background: var(--color_bg);
  }

  :where(.post_picker_list) {
    max-height: 12rem;
    overflow-y: auto;
    margin: var(--space_2) 0 0;
    padding: 0;
    list-style: none;
  }

  :where(.post_picker_item) {
    display: block;
    width: 100%;
    padding: var(--space_2);
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--color_text);
    text-align: left;
    cursor: pointer;
  }

  :where(.post_picker_item:hover, .post_picker_item:focus-visible) {
    background: var(--color_bg_raised);
  }

  :where(.post_emoji_grid) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr));
    max-height: 13rem;
    overflow-y: auto;
  }

  :where(.post_emoji) {
    height: 2.5rem;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    font-size: 1.35rem;
    cursor: pointer;
  }

  :where(.post_emoji:hover, .post_emoji:focus-visible) {
    background: var(--color_bg_raised);
  }

  :where(.post_source) {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0;
  }

  :where(.post_solution) {
    border-color: var(--color_accent);
  }

  :where(.post_reactions) {
    margin-block: var(--space_2);
  }

  :where(.post_item_image) {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
    border-radius: var(--radius);
    margin-block-end: var(--space_2);
  }

  :where(.post_latest) {
    display: flex;
    gap: var(--space_2);
    align-items: center;
  }

  :where(.post_latest_image) {
    inline-size: 4rem;
    block-size: 4rem;
    object-fit: cover;
    border-radius: var(--radius);
  }

  /* Text whose line breaks matter (e.g. release notes). */
  :where(.text_lines) {
    white-space: pre-line;
  }

  /* ⓘ tips (the info partial): open in place, no script. */
  :where(.info_tip) {
    display: inline-block;
    position: relative;
  }

  :where(.info_tip_button) {
    cursor: pointer;
    list-style: none;
    color: var(--color_accent);
  }

  :where(.info_tip_body) {
    position: absolute;
    z-index: 5;
    inset-block-start: 100%;
    inset-inline-start: 0;
    inline-size: max-content;
    max-inline-size: min(20rem, 80vw);
    padding: var(--space_2);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    font-size: 0.9em;
  }

  /* ---------- Phone header: the menu drawer (site_header) ----------
     Last in the file so it wins over the header's own rules. */

  :where(.site_drawer) {
    display: none;
  }

  :where(.site_phone_only) {
    display: none;
  }

  @media (max-width: 47.99rem) {
    :where(.site_wide_only, .site_wide_name) {
      display: none;
    }

    /* Phones: the name gives way (…) to the bell and the menu button. */
    :where(.site_brand) {
      flex: 0 1 auto;
    }

    :where(.site_phone_only) {
      display: block;
    }

    :where(.site_drawer) {
      display: block;
    }
  }

  :where(.site_drawer_button) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--touch_target);
    height: var(--touch_target);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    font-size: var(--text_xl);
    list-style: none;
    cursor: pointer;
  }

  :where(.site_drawer_button::-webkit-details-marker) {
    display: none;
  }

  /* Dims the page; a tap on it only closes the drawer. */
  :where(.site_drawer_backdrop) {
    position: fixed;
    inset: 0;
    z-index: 54;
    background: rgb(0 0 0 / 0.55);
  }

  /* The panel slides in from the right over the dimmed page. Its rows run
     edge to edge, a line under each. */
  :where(.site_drawer_panel) {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    width: min(20rem, 88vw);
    overflow-y: auto;
    border-left: 1px solid var(--color_border);
    background: var(--color_bg_raised);
    animation: drawer_in var(--motion_normal) var(--motion_ease);
  }

  @keyframes drawer_in {
    from {
      transform: translateX(100%);
    }
  }

  /* You (your picture and name) and the close button. */
  :where(.site_drawer_top) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space_2);
    padding: var(--space_3) var(--space_4);
    border-bottom: 1px solid var(--color_border);
  }

  :where(.site_drawer_who) {
    display: flex;
    align-items: center;
    gap: var(--space_2);
    min-width: 0;
    color: var(--color_text);
    font-weight: 700;
    text-decoration: none;
  }

  :where(.site_drawer_who_name) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :where(.site_drawer_join) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
    padding: var(--space_3) var(--space_4);
    border-bottom: 1px solid var(--color_border);
  }

  /* Log in or Sign up, opened inside the drawer (with Back above it). */
  /* Reactions under a post, picture, character... */
  :where(.reactions_row) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1);
    margin: var(--space_2) 0;
  }

  :where(.reaction_mine) {
    background: var(--color_primary);
    color: var(--color_on_fill);
  }

  :where(.reaction_picture) {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    vertical-align: middle;
  }

  /* What an add-on needs: chips, filled when that add-on is on. */
  :where(.addon_needs) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_2);
    margin-top: var(--space_1);
  }

  :where(.addon_deps) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_1);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  :where(.addon_dep) {
    display: inline-flex;
    align-items: center;
    gap: var(--space_1);
    padding: 0.125rem var(--space_2);
    border: 1px dashed var(--color_border);
    border-radius: 999px;
    color: var(--color_text_muted);
    font-size: var(--text_sm);
    text-decoration: none;
  }

  :where(.addon_dep_on) {
    border-style: solid;
    border-color: var(--color_success_text);
    color: var(--color_text);
  }

  :where(.addon_also) {
    margin-bottom: var(--space_3);
    padding: var(--space_2) var(--space_3);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
  }

  :where(.addon_grants_for) {
    margin: var(--space_3) 0 0;
  }

  /* An add-on's Enable: each permission it adds, and the roles that get it. */
  :where(.addon_grants) {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  :where(.addon_grant) {
    padding: var(--space_3) 0;
    border-top: 1px solid var(--color_border);
  }

  :where(.addon_grant_set) {
    margin: 0;
    padding: 0;
    border: 0;
  }

  :where(.addon_grant_name) {
    padding: 0;
  }

  :where(.addon_grant_help) {
    margin: var(--space_1) 0 var(--space_2);
  }

  :where(.site_drawer_sheet_body) {
    padding: var(--space_3) var(--space_4);
  }

  :where(.site_drawer_search) {
    padding: var(--space_3) var(--space_4);
    border-bottom: 1px solid var(--color_border);
  }

  :where(.site_drawer_results:not(:empty)) {
    padding: var(--space_2) var(--space_4);
    border-bottom: 1px solid var(--color_border);
  }

  :where(.site_drawer_links) {
    display: flex;
    flex-direction: column;
  }

  :where(.site_drawer_link) {
    display: flex;
    align-items: center;
    gap: var(--space_2);
    width: 100%;
    min-height: calc(var(--touch_target) + var(--space_1));
    padding: 0 var(--space_4);
    border: none;
    border-bottom: 1px solid var(--color_border);
    border-radius: 0;
    background: transparent;
    color: var(--color_text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  :where(.site_drawer_link:hover, .site_drawer_link:focus-visible) {
    background: var(--color_bg);
  }

  /* Where you are: the item, and the one it's under. */
  :where(.site_drawer_link[aria-current], .site_drawer_link_here) {
    box-shadow: inset 3px 0 0 var(--color_primary);
    background: var(--color_bg);
    color: var(--color_link);
    font-weight: 600;
  }

  /* A group opens its own level (user_menu.js). Without scripts the links
     are listed under its row. */
  :where(.site_drawer_row) {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--color_border);
  }

  /* The button that opens a group. */
  :where(.site_drawer_in_row) {
    justify-content: space-between;
    border-bottom: none;
  }

  :where(.site_drawer_item_label) {
    display: inline-flex;
    align-items: center;
    gap: var(--space_2);
  }

  :where(.site_drawer_level) {
    display: flex;
    flex-direction: column;
  }

  :where(.site_drawer_back) {
    color: var(--color_text_muted);
  }

  /* ---------- Search: the box and its button as one line ---------- */

  /* One control: the border, background and focus ring belong to the bar,
     so the box and its button always read as a single piece. */
  :where(.search_bar) {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--color_field_border);
    border-radius: var(--radius);
    background: var(--color_bg);
  }

  :where(.search_bar:focus-within) {
    outline: 2px solid var(--color_link);
    outline-offset: 2px;
  }

  :where(.search_bar_input) {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    background: transparent;
  }

  :where(.search_bar_button) {
    flex: none;
    border: 0;
    border-inline-start: 1px solid var(--color_field_border);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: transparent;
    color: var(--color_text_muted);
  }

  :where(.search_bar_button:hover) {
    color: var(--color_text);
  }

  :where(.search_bar_input:focus-visible, .search_bar_button:focus-visible) {
    outline: none;
  }

  /* Add-a-chip pickers (chip_picker.hbs): the picked ones as chips, then
     the drop-down. A chip is a ticked box in a label: clicking it takes it
     off (chip_picker.js), and without the script it shows struck out. */
  :where(.chip_picker) {
    display: flex;
    flex-direction: column;
    gap: var(--space_2);
  }

  :where(.chip_list) {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space_2);
  }

  :where(.chip_list:empty) {
    display: none;
  }

  :where(.chip) {
    display: inline-flex;
    align-items: center;
    gap: var(--space_1);
    min-height: 1.9rem;
    padding: var(--space_1) var(--space_2);
    border: 1px solid var(--color_border);
    border-radius: 999px;
    background: var(--color_bg);
    cursor: pointer;
  }

  :where(.chip[aria-pressed="true"]) {
    border-color: var(--color_save);
    background: var(--color_save);
    color: var(--color_on_fill);
  }

  :where(.chip:has(.chip_check:not(:checked))) {
    opacity: 0.5;
    text-decoration: line-through;
  }

  :where(.chip:focus-within) {
    outline: 2px solid var(--color_link);
    outline-offset: 2px;
  }

  /* A form's answers on a page (a wanted ad's): each label beside its
     value, a long one (writing, a list) under its label; a section's name
     above its own. */
  :where(.answers) {
    display: grid;
    grid-template-columns: minmax(8rem, max-content) 1fr;
    gap: var(--space_2) var(--space_4);
    margin: 0 0 var(--space_4);
  }

  :where(.answers_row) {
    display: contents;
  }

  :where(.answers_label) {
    color: var(--color_text_muted);
    font-size: var(--text_sm);
    font-weight: 700;
  }

  :where(.answers_value) {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  :where(.answers_wide) {
    grid-column: 1 / -1;
  }

  :where(.answers_heading) {
    margin: var(--space_4) 0 var(--space_2);
    padding-bottom: var(--space_1);
    border-bottom: 1px solid var(--color_border);
    font-size: var(--text_md);
  }

  :where(.answers_heading:first-child) {
    margin-top: 0;
  }

  @media (width < 36rem) {
    :where(.answers) {
      grid-template-columns: 1fr;
      gap: var(--space_1);
    }

    :where(.answers_value) {
      margin-bottom: var(--space_2);
    }
  }

  :where(.chip_check) {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  :where(.chip_x) {
    color: var(--color_text_muted);
  }

  /* A chip's × as a button: a small round mark, red on hover. */
  :where(.lines_chip_x) {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
  }

  :where(.lines_chip_x):hover,
  :where(.lines_chip_x):focus-visible {
    background: color-mix(in srgb, var(--color_error_text) 20%, transparent);
    color: var(--color_error_text);
  }

  :where(.chip:hover) {
    border-color: var(--color_error_text);
  }

  :where(.chip_add) {
    max-width: 20rem;
  }

  /* A list setting (lines_field.hbs): one box like a text box, its items as
     chips and the Add box last, in a line with them. */
  :where(.lines_chips) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space_1);
    min-height: 2.6rem;
    padding: var(--space_1);
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg);
    cursor: text;
  }

  :where(.lines_chips):focus-within {
    border-color: var(--color_link);
    outline: 2px solid color-mix(in srgb, var(--color_link) 35%, transparent);
  }

  :where(.lines_chip) {
    min-height: 1.75rem;
    padding: 0 0.15rem 0 var(--space_2);
    background: var(--color_bg_raised);
    font-size: var(--text_sm);
    cursor: default;
  }

  :where(.lines_chip):hover {
    border-color: var(--color_border);
  }

  :where(.lines_add) {
    flex: 1 1 8rem;
    min-width: 8rem;
    padding: var(--space_1);
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    outline: 0;
  }

  /* The type-to-find box (chip_picker.js) and what it finds. */
  :where(.chip_find_wrap) {
    position: relative;
    max-width: 20rem;
  }

  :where(.chip_found) {
    position: absolute;
    z-index: 30;
    inset: calc(100% + 2px) 0 auto;
    max-height: 14rem;
    margin: 0;
    padding: var(--space_1) 0;
    overflow-y: auto;
    border: 1px solid var(--color_border);
    border-radius: var(--radius);
    background: var(--color_bg_raised);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.35);
    list-style: none;
  }

  /* Near the bottom of a modal or the screen: it opens upward. */
  :where(.chip_found_up) {
    inset: auto 0 calc(100% + 2px);
  }

  :where(.chip_found_item) {
    padding: var(--space_1) var(--space_3);
    cursor: pointer;
  }

  :where(.chip_found_item:hover, .chip_found_item[aria-selected="true"]) {
    background: var(--color_primary);
    color: var(--color_on_fill);
  }

  :where(.chip_found_none) {
    padding: var(--space_1) var(--space_3);
    color: var(--color_text_muted);
  }

  /* Paused moving pictures (still_gifs.js): one from another site is
     covered until it plays. */
  :where(.still_gif) {
    cursor: pointer;
  }

  :where(.still_gif_cover) {
    background: color-mix(in srgb, var(--color_text) 12%, var(--color_bg));
    opacity: 0.35;
  }

  /* Last in the layer: anything with the hidden attribute stays hidden,
     even components that set their own display (like .btn). Keep this
     the final rule of the layer. */
  :where([hidden]) {
    display: none;
  }

  /* A notice's close button (notice_dismiss.js), at its end. */
  :where(.notice_close) {
    float: inline-end;
    margin-inline-start: var(--space_2);
  }

  /* ---------- Templated areas (core/templateAreas.ts) ---------- */

  /* A site's template: its box holds its own painting. */
  :where(.tpl, .tpl_content) {
    isolation: isolate;
  }

  /* A card drawn by its template fills its place in a grid. */
  :where(.tpl_content_card) {
    display: grid;
  }

  /* A display template's editor: code, its tags, and the preview's parts. */
  :where(.code_box) {
    font-family: var(--font_mono);
    font-size: var(--text_sm);
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
  }

  :where(.tag_list) {
    display: grid;
    gap: var(--space_2);
    margin: 0 0 var(--space_4);
  }

  :where(.tag_list_row) {
    display: grid;
    gap: var(--space_1);
  }

  :where(.tpl_part_sample) {
    padding: var(--space_2) var(--space_3);
    border: 1px dashed var(--color_border);
    color: var(--color_text_muted);
    text-align: center;
  }

  /* Required features a template left out, put back at its end. */
  :where(.tpl_missing) {
    display: grid;
    gap: var(--space_2);
    margin-block-start: var(--space_3);
    padding-block-start: var(--space_3);
    border-top: 1px dashed var(--color_border);
  }

  :where(.tpl_missing_note) {
    margin: 0;
    color: var(--color_text_muted);
    font-size: var(--text_sm);
  }

  /* ---------- What's new to the reader (core/newMarks.ts) ---------- */

  /* The theme's look (layout New look): a "New" chip only when it is
     new; its icon or picture always, dimmed when it isn't. */
  :where(.new_chip) {
    display: inline-block;
    margin-inline-end: var(--space_1);
    padding: 0 var(--space_2);
    border-radius: 999px;
    background: var(--color_accent);
    color: var(--color_on_accent);
    font-size: var(--text_xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
  }

  :where(.new_mark) {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    margin-inline-end: var(--space_1);
    color: var(--color_accent);
    font-size: 1.25rem;
    vertical-align: middle;
  }

  :where(.new_mark_image) {
    display: block;
    max-width: 2rem;
    max-height: 2rem;
  }

  :where(.new_mark_off) {
    opacity: 0.35;
    filter: grayscale(1);
  }

  /* Mark all read, beside a list's heading. */
  :where(.new_read_all) {
    display: inline;
  }

  /* The menu's dot (a member's choice): a section with something new. */
  :where(.menu_new_dot) {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-inline-start: var(--space_1);
    border-radius: 50%;
    background: var(--color_accent);
    vertical-align: middle;
  }
}

:where(.collection_switch) {
  display: inline-flex;
  flex: none;
  margin-inline-start: auto;
  border: 1px solid var(--color_primary);
  border-radius: var(--radius);
}

:where(.collection_switch_choice) {
  border: 0;
  border-radius: 0;
  white-space: nowrap;
}

:where(.collection_switch_choice:first-child) {
  border-start-start-radius: calc(var(--radius) - 1px);
  border-end-start-radius: calc(var(--radius) - 1px);
}

:where(.collection_switch_choice:last-child) {
  border-start-end-radius: calc(var(--radius) - 1px);
  border-end-end-radius: calc(var(--radius) - 1px);
  border-inline-start: 1px solid var(--color_primary);
}

:where(.collection_switch_choice[aria-current]) {
  background: var(--color_primary);
  color: var(--color_on_fill);
}

:where(.collection_switch_choice:focus-visible) {
  position: relative;
  z-index: 1;
}

@media (max-width: 39.99rem) {
  :where(.collection_switch_name) {
    display: none;
  }
}

:where(.collection_grid) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--space_3);
}
