/* Generated by php tools/build-page-styles.php from PageLayout::STYLESHEETS. */
/* ===========================================================================
 * Theme layer (Nocturne redesign, docs/redesign)
 * ---------------------------------------------------------------------------
 * Two independent choices drive the whole interface:
 *
 *   html[data-scheme="…"]  the base ground   (graphite | midnight | ink | slate)
 *   html[data-accent="…"]  the accent hue    (blurple | amber | teal | rose |
 *                                             green | blue)
 *
 * Both are written by assets/js/modules/theme.js from localStorage before the
 * body paints, so there is no flash. Every other rule in this file reads only
 * the aliases below (--bg, --surface, --accent, …) - nothing downstream knows
 * which scheme or accent is active. To add a scheme or an accent, add one
 * block here; nothing else needs to change.
 *
 * The palette is Nocturne's: a near-neutral blue-grey ground, contrast from
 * the tonal ramp rather than saturation, and the accent used as a line and a
 * glow rather than a flood. Accents all sit at the same perceptual lightness
 * (OKLCH L ~0.66) so contrast holds without re-checking each one - amber is
 * the site's original gold, kept as an option.
 * ======================================================================== */
:root {
  --release-media-ratio: 9 / 16;
  /* Base scheme - graphite (default). */
  --scheme-bg: #17181c;
  --scheme-chrome: #1d1e23;
  --scheme-panel: #202127;
  --scheme-raised: #292a31;
  --scheme-text: #ececee;
  --scheme-text-soft: #bcbdc2;
  --scheme-text-muted: #8e8f96;

  /* Accent - blurple (default). */
  --accent: #9184d9;
  --accent-strong: #b5abfc;
  --accent-deep: #5d5294;
  --on-accent: #14151f;
}

html[data-scheme="midnight"] {
  --scheme-bg: #161826;
  /* Chrome (sidebar + header) sits ABOVE the panel value so the frame reads
     as frame; it used to be a hair off --bg and disappeared into it. */
  --scheme-chrome: #232538;
  --scheme-panel: #1e2030;
  --scheme-raised: #262939;
  --scheme-text: #e9e9ed;
  --scheme-text-soft: #b6b9c8;
  --scheme-text-muted: #8b8fa2;
}

html[data-scheme="ink"] {
  --scheme-bg: #0b0e12;
  --scheme-chrome: #11161c;
  --scheme-panel: #151a21;
  --scheme-raised: #1d242d;
  --scheme-text: #f3f5f7;
  --scheme-text-soft: #c7ced6;
  --scheme-text-muted: #98a2ad;
}

html[data-scheme="slate"] {
  --scheme-bg: #1b2028;
  --scheme-chrome: #222831;
  --scheme-panel: #252c36;
  --scheme-raised: #2e3641;
  --scheme-text: #eef1f5;
  --scheme-text-soft: #c2c9d3;
  --scheme-text-muted: #959daa;
}

html[data-accent="amber"] {
  --accent: #d6a24f;
  --accent-strong: #f0b55a;
  --accent-deep: #8a6626;
  --on-accent: #14151f;
}

html[data-accent="teal"] {
  --accent: #3fb4a3;
  --accent-strong: #63d3c2;
  --accent-deep: #24705f;
  --on-accent: #06120f;
}

html[data-accent="rose"] {
  --accent: #db7f9f;
  --accent-strong: #f2a0bb;
  --accent-deep: #8c4a63;
  --on-accent: #1a0a10;
}

html[data-accent="green"] {
  --accent: #6fb762;
  --accent-strong: #92d585;
  --accent-deep: #3f7236;
  --on-accent: #08130a;
}

html[data-accent="blue"] {
  --accent: #5fa8e0;
  --accent-strong: #86c4f2;
  --accent-deep: #2f6795;
  --on-accent: #05121c;
}

/* Creator accents are local content styling. They must never be placed on the
   document root, where the header and app sidebar would inherit them. */
.creator-accent-scope[data-creator-accent="blurple"] {
  --accent: #9184d9;
  --accent-strong: #b5abfc;
  --accent-deep: #5d5294;
  --on-accent: #14151f;
}

.creator-accent-scope[data-creator-accent="amber"] {
  --accent: #d6a24f;
  --accent-strong: #f0b55a;
  --accent-deep: #8a6626;
  --on-accent: #14151f;
}

.creator-accent-scope[data-creator-accent="teal"] {
  --accent: #3fb4a3;
  --accent-strong: #63d3c2;
  --accent-deep: #24705f;
  --on-accent: #06120f;
}

.creator-accent-scope[data-creator-accent="rose"] {
  --accent: #db7f9f;
  --accent-strong: #f2a0bb;
  --accent-deep: #8c4a63;
  --on-accent: #1a0a10;
}

.creator-accent-scope[data-creator-accent="green"] {
  --accent: #6fb762;
  --accent-strong: #92d585;
  --accent-deep: #3f7236;
  --on-accent: #08130a;
}

.creator-accent-scope[data-creator-accent="blue"] {
  --accent: #5fa8e0;
  --accent-strong: #86c4f2;
  --accent-deep: #2f6795;
  --on-accent: #05121c;
}

/* ---- Button tones (visual refresh, SUB65) --------------------------------
 * Main buttons are a two-tone gradient from --btn-a to --btn-b with --btn-ink
 * text. They are derived from whatever accent is active, so they follow the
 * visitor's accent and, inside a creator's own content, the creator's accent
 * (named accents via data-creator-accent, custom colours via data-creator-color).
 * Only button tones are deepened; decorative accents keep their original hue.
 * The lightest stop leaves room for hover and the subtle white shimmer. */
:root,
.creator-accent-scope,
[data-creator-color] {
  --btn-a: #6846cf;
  --btn-b: #5135aa;
  --btn-ink: #fff;
  --btn-fill: linear-gradient(135deg, var(--btn-a) 0%, var(--btn-b) 100%);
  --btn-success: #237145;
  --btn-warning: #806000;
  --btn-danger: #b52c42;
}

html[data-accent="blurple"], :root:not([data-accent]), .creator-accent-scope[data-creator-accent="blurple"] { --btn-a: #6846cf; --btn-b: #5135aa; }
html[data-accent="amber"], .creator-accent-scope[data-creator-accent="amber"] { --btn-a: #a65000; --btn-b: #8a4300; }
html[data-accent="teal"], .creator-accent-scope[data-creator-accent="teal"] { --btn-a: #096e63; --btn-b: #07584f; }
html[data-accent="rose"], .creator-accent-scope[data-creator-accent="rose"] { --btn-a: #a92e60; --btn-b: #8c2650; }
html[data-accent="green"], .creator-accent-scope[data-creator-accent="green"] { --btn-a: #2d712c; --btn-b: #245b24; }
html[data-accent="blue"], .creator-accent-scope[data-creator-accent="blue"] { --btn-a: #1e64a3; --btn-b: #1a5188; }

/* Validated inline custom properties work across browsers and are allowed by
   the site's CSP. PHP supplies contrast-capped hex fallbacks for button fills. */
[data-creator-color] {
  --accent: var(--creator-accent, #9184d9);
  --btn-a: var(--creator-btn-a, #6846cf);
  --btn-b: var(--creator-btn-b, #5135aa);
  --accent-strong: color-mix(in srgb, var(--accent) 72%, white);
  --accent-deep: color-mix(in srgb, var(--accent) 68%, black);
}

@supports (color: oklch(from red l c h)) {
  [data-creator-color] {
    --btn-a: oklch(from var(--accent) min(l, 0.46) c h);
    --btn-b: oklch(from var(--accent) min(l, 0.38) c h);
  }
}

/* The visitor's own accent, captured on <html> so it does NOT change inside a
   creator's scope. Price tags use it: they look the same on every card. */
html {
  --site-accent: var(--accent);
  --site-accent-strong: var(--accent-strong);
}

/* ---- Aliases every downstream rule reads --------------------------------
 * Surfaces stay desaturated and close together: the redesign gets its
 * separation from hairline rules and whitespace, not from stacked boxes. */
:root {
  --bg: var(--scheme-bg);
  --bg-soft: var(--scheme-chrome);
  --chrome: var(--scheme-chrome);
  --surface: var(--scheme-panel);
  --panel: var(--scheme-panel);
  --raised: var(--scheme-raised);
  --surface-strong: var(--scheme-panel);
  --surface-raised: var(--scheme-raised);
  --border: color-mix(in srgb, var(--scheme-text) 8%, transparent);
  --border-strong: color-mix(in srgb, var(--scheme-text) 13%, transparent);
  --text: var(--scheme-text);
  --text-soft: var(--scheme-text-soft);
  --text-muted: var(--scheme-text-muted);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 42%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 78%, var(--scheme-text));
  /* Kept only so the two remaining "user audience" rules resolve; the
     redesign is a mono scheme - silver reads as muted text now. */
  --silver: var(--text-soft);
  --success: #57c785;
  --warning: #e0b25f;
  --danger: #e16d77;
  /* Staff. A literal gold rather than var(--accent), because it has to mean the
     same thing in every accent theme - a name in this colour is an administrator
     or a moderator, and that must not read as "this item is selected". */
  --staff: #e3b341;
  /* Elevation on a dark ground is an edge plus ambient darkness, never a
     stacked drop shadow. */
  --shadow-lg: 0 0 0 1px var(--border-strong), 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 0 0 1px var(--border), 0 6px 18px rgba(0, 0, 0, 0.4);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --space-card: 0.75rem;
  /* Height of the sticky app header - the sidebar rail and every sticky
     toolbar offset from this one number. */
  --header-h: 60px;
  /* Input fill (SUB78): one step above the raised surface, as in the
     signed-off frame. */
  --field: color-mix(in srgb, var(--scheme-raised), white 4%);
  /* Width of the app-shell sidebar rail. The header's lead group matches it so
     the search field lines up with where the main content starts. */
  --rail-w: 269px;

  /* ---- Page containment ------------------------------------------------
   * The content column is never allowed to run edge-to-edge: --gutter is the
   * breathing room on BOTH sides of every page (the sidebar rail stays flush
   * left, the text inside the content column never does), and --page-max caps
   * how wide a measure the content itself may take.
   *
   * The content column now runs the FULL width of the shell (no 1180px cap that
   * left half a widescreen empty) and the gutter does the shaping instead: it
   * scales with the viewport, so a wide screen gets generous side padding and a
   * narrow one keeps almost all of its width for content. */
  --gutter: clamp(18px, 2.65vw, 40px);
  --page-max: 100%;
  /* Single-line inputs are controls, not banners: they take their natural
   * measure instead of the full width of whatever contains them. Wide fields
   * (textareas, markdown bodies) get the second, roomier cap. */
  --field-max: 26rem;
  --field-max-wide: 46rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, "Segoe UI", "Helvetica Neue", sans-serif;
  /* Base type scale. Everything on the page is sized in rem off this, so the
     whole UI reads a step larger; the sub-0.9rem values were additionally
     rescaled so the SMALLEST text on the page ends up ~30% bigger. */
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  /* A flat scheme ground (SUB78): colour comes from artwork, cards and the
     accent on actions, not from washes behind the page. */
  background: var(--bg);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: color-mix(in srgb, var(--chrome) 92%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}

.site-header-inner {
  position: relative;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* The app header spans the full width like the shell below it, so the brand
   lines up with the sidebar rail rather than floating in a centered column. */
.app-header .site-header-inner {
  width: 100%;
  min-height: var(--header-h);
  padding: 0;
  justify-content: flex-start;
  /* Keep the whole top row on one line - the cart must never wrap below the
     hamburger/brand on narrow screens (#24). */
  flex-wrap: nowrap;
  gap: 0.65rem;
}

.app-header .site-header-inner::after {
  display: none;
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--accent-line), transparent 38%);
  opacity: 0.65;
}

/* Keep the wordmark intact; responsive header fitting handles tight screens. */
.app-header .site-brand-text {
  white-space: nowrap;
}

/* Header fitting hides the full wordmark when the available row is too narrow. */
.app-header.brand-compact .site-brand-text {
  display: none;
}

.app-header .site-brand {
  width: auto;
  justify-content: flex-start;
  min-width: 0;
  flex: 0 1 auto;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  /* Was overridden to 0.5rem by a second .site-brand block further down; folded
     in here so there is one declaration for this element. */
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
}

/* The project logo (assets/images/logo.png), shown as-is in its own colours. */
.site-brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: block;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.site-brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.site-brand:hover .site-brand-mark,
.site-brand:focus-visible .site-brand-mark {
  transform: scale(1.06);
  filter: drop-shadow(0 0 6px rgba(214, 92, 255, 0.45));
}

.site-brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-left: auto;
}

.site-nav-link {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.96rem;
  transition: color 0.18s ease;
}

.site-nav-link:hover,
.site-nav-link:focus-visible {
  color: var(--text);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.app-header-guest-actions {
  flex: 0 0 auto;
  margin-left: auto;
  padding-right: 1rem;
}

.site-header-action {
  min-width: 0;
  color: #fff;
}

/* ===== Top-right cart widget (#24) ===== */
.cart-widget {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
}

/* The `hidden` attribute must win over the flex display above, otherwise the
   empty widget stays visible. */
.cart-widget[hidden] {
  display: none;
}

/* In the public (non app-shell) header the cart sits beside the Account button,
   not pushed fully right, so the inline actions stay grouped. The app-shell
   header keeps margin-left:auto so the cart is pushed to the far right. */
.site-header:not(.app-header) .site-header-inner > .cart-widget {
  margin-left: 0;
}

/* The button chrome (border + fill) is invisible at rest - only the cart icon
 * and its count show. The box only materialises on hover/focus or while the
 * dropdown is open, so the header reads as icon + number, not as a control. */
.cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 40px;
  padding: 0 0.55rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.cart-toggle:hover,
.cart-toggle:focus-visible,
.cart-widget.is-open .cart-toggle {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}

.cart-icon-wrap {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
}

.cart-icon-wrap svg {
  width: 100%;
  height: 100%;
}

/* No badge pill any more - just a small white number sitting inline
 * to the right of the cart icon. Tabular numerals keep the header from
 * shifting as the count goes 9 -> 10. */
.cart-count {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.cart-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  /* Compact receipt-style rows (SUB-26): names wrap instead of being cropped,
     so the panel no longer needs the old 480px to fit them. */
  width: min(352px, calc(100vw - 24px));
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1200;
  overflow: hidden;
}

/* Keep the dropdown collapsed by default - the flex display above would
   otherwise override the `hidden` attribute and leave it permanently open. */
.cart-dropdown[hidden] {
  display: none;
}

/* An empty form message under Checkout must not leave a gap. */
.cart-dropdown [data-form-message]:empty {
  display: none;
}

/* In the app-shell header the cart is NOT pushed to the far right: it sits on
   the left, immediately after the brand, and its panel opens left-aligned
   underneath it. Same icon button as everywhere else. */
/* The cart now lives INSIDE .app-header-lead (immediately left of the search),
   so it is no longer a direct child of the header row - this rule only still
   applies to any header variant that keeps it at the top level. */
.app-header .site-header-inner > .cart-widget {
  margin-left: 0.35rem;
  margin-right: auto;
}

.app-header .cart-dropdown {
  left: 0;
  right: auto;
}

/* On a phone the cart button sits mid-row, so a panel anchored to it ran off
   the screen edge. Pin it to the viewport under the header instead. */
@media (max-width: 520px) {
  .cart-dropdown,
  .app-header .cart-dropdown {
    position: fixed;
    top: calc(var(--header-h) + 6px);
    left: 12px;
    right: 12px;
    width: auto;
    max-height: min(80vh, calc(100vh - var(--header-h) - 18px));
  }
}

.cart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.cart-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

/* Header actions sit beside the cart title and remain separate from each
   subscription row's checkout controls. */
.cart-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-panel-checkout {
  display: flex;
  align-items: center;
}

.cart-close {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  /* Generic button padding squeezed the icon into a dot. */
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 7px;
}

.cart-close:hover,
.cart-close:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.cart-close svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.cart-panel-body {
  overflow-y: auto;
  padding: 0.65rem 0.7rem 0.85rem;
}

.cart-empty {
  padding: 1.6rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.cart-groups {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cart-checkout-note {
  margin: 0.55rem 0.15rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

/* Creator group: a quiet card, creator name as its header row. */
.cart-creator-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem 0.65rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.015);
}

.cart-creator-heading {
  margin: 0;
  font-size: 0.95rem;
}

.cart-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cart-group-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.1rem;
}

.cart-group-head h3 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cart-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 0.805rem;
  font-weight: 700;
}

/* Rows instead of boxed cards: a thin divider between items. */
.cart-group-list {
  display: flex;
  flex-direction: column;
}

/* Thumbnail left; title over creator in the middle; the price on the right
   like a receipt line, with the remove button under it. The info and action
   wrappers dissolve into this one grid. */
.cart-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas:
    "media title price"
    "media creator actions";
  align-items: center;
  column-gap: 0.65rem;
  row-gap: 0.1rem;
  padding: 0.5rem 0.1rem;
}

.cart-item + .cart-item {
  border-top: 1px solid var(--border);
}

.cart-item-info,
.cart-item-actions {
  display: contents;
}

.cart-item-promo-note {
  grid-column: 2 / -1;
  margin: 0.25rem 0 0;
}

.cart-item-media {
  grid-area: media;
  width: 44px;
  height: auto;
  aspect-ratio: var(--release-media-ratio);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.cart-item-media img,
.cart-item-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* A tier row shows the CREATOR's framed avatar, not a letter tile. The frame
   brings its own border/radius, so the slot adds no box of its own. */
.cart-item-media-avatar {
  aspect-ratio: 1;
  background: none;
  overflow: visible;
  border-radius: 0;
}

/* Scoped through the slot so it outranks the generic .creator-avatar-frame
   sizes defined LATER in this file (and the narrow-screen override). */
.cart-item-media-avatar .creator-avatar-frame--cart {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

/* Names WRAP instead of being cropped: a tier name is what the row is about, so
   it is never worth an ellipsis. */
.cart-item-title {
  grid-area: title;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cart-item-creator {
  grid-area: creator;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* Tier/content and creator are both links out of the cart. */
.cart-item-title a {
  color: var(--text);
  text-decoration: none;
}

.cart-item-creator a {
  color: inherit;
  text-decoration: none;
}

.cart-item-title a:hover,
.cart-item-title a:focus-visible,
.cart-item-creator a:hover,
.cart-item-creator a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cart-item-price {
  grid-area: price;
  justify-self: end;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cart-item-interval {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.828rem;
}

.cart-item-actions > form {
  grid-area: actions;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

/* A subscription's own Checkout button sits under its name, not in the price
   column. */
.cart-item-actions > form:has(.btn) {
  grid-area: auto;
  grid-column: 2 / 3;
  justify-self: start;
  margin-top: 0.3rem;
}

.cart-item-actions .btn-sm {
  min-height: 30px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
}

/* Remove-from-cart is a TRASH CAN, drawn light so it is actually visible on
   the dark cart panel (the old muted X disappeared into the background). */
.cart-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.cart-remove:hover,
.cart-remove:focus-visible {
  color: #fff;
  background: var(--btn-danger);
}

.cart-remove svg {
  flex: none;
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.cart-group-checkout {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.cart-group-checkout .btn {
  min-height: 36px;
}

.cart-promo-code input {
  width: 100%;
}

.cart-group-checkout label {
  display: grid;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.828rem;
}

.site-main {
  width: min(var(--page-max), calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

/* SUB216 Stands in for the cart checkout button when the buyer's country is blocked. */
.cart-blocked-country {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- SUB224 VAT on shown prices, cart amounts and subscription terms ---------- */
.price-vat {
  color: var(--text-muted);
  font-size: 0.78em;
  font-weight: 500;
  white-space: nowrap;
}

.price-vat[data-tooltip] {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.cart-item-price .price-vat {
  margin-left: 0.3rem;
}

.cart-breakdown {
  display: grid;
  gap: 0.2rem;
  margin: 0.45rem 0 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--scheme-text) 3%, transparent);
  font-size: 0.828rem;
  font-variant-numeric: tabular-nums;
}

.cart-breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.cart-breakdown-row dt {
  min-width: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.cart-breakdown-row dd {
  margin: 0;
  white-space: nowrap;
}

.cart-breakdown-row.is-addon dt {
  padding-left: 0.6rem;
}

.cart-breakdown-row.is-discount dd {
  color: var(--success, #5ec27a);
}

.cart-breakdown-row.is-total {
  margin-top: 0.2rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  font-weight: 700;
}

.cart-breakdown-row.is-total dt {
  color: inherit;
  font-weight: 700;
}

.cart-promo-row {
  display: flex;
  gap: 0.4rem;
}

.cart-promo-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.cart-promo-error {
  margin: 0;
  color: var(--danger, #f07178);
  font-size: 0.8rem;
}

.creator-price-badge .price-vat {
  margin-left: 0.2rem;
}

.release-price-line .price-vat {
  margin-left: -6px;
  font-size: 13px;
}

.release-subscription-price .price-vat {
  display: block;
  font-size: 11px;
  line-height: 1.3;
}

.creator-tier-price .price-vat {
  margin-left: 0.35rem;
  font-size: 12px;
}

.cart-promo-row .btn {
  flex: none;
  width: auto;
}

/* SUB224 A subscription's amounts span the row, between it and its checkout. */
.cart-item-actions > .cart-breakdown {
  grid-column: 1 / -1;
  margin: 0.45rem 0 0.2rem;
}


/* The shell is full-bleed: the sidebar sits hard against the left edge of the
   viewport and the content column takes everything else. No outer gutter, no
   gap between the two - the border-right on the sidebar is the only
   separation. */
.app-shell {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

@media (min-width: 1025px) {
  html.sidebar-compact {
    --rail-w: 72px !important;
  }
}

/* Wraps the sidebar card plus the always-present Privacy link that sits
   below it (#50 follow-up) - the wrapper owns the sticky/height so the link
   is outside the bordered card but still in the same left column. */
.app-sidebar-col {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  align-self: start;
  display: flex;
  flex-direction: column;
  background: var(--chrome);
  border-right: 1px solid var(--border);
  box-shadow: none;
}

.sidebar-resizer {
  position: absolute;
  z-index: 6;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
}

.sidebar-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  right: 4px;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
body.sidebar-resizing .sidebar-resizer::after {
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent);
}

.sidebar-resizer:focus-visible {
  outline: none;
}

body.sidebar-resizing {
  cursor: col-resize;
  user-select: none;
}

.app-sidebar {
  flex: 1 1 auto;
  min-height: 0;
}

/* No card: the rail is a ground, not a floating panel - no radius, no outline,
   no shadow, and it runs the full height of the viewport. */
.sidebar-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.6rem 0.45rem;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sidebar-close,
.sidebar-toggle {
  display: none;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

/* App-header hamburger: compact square icon button so the top row stays tight
   and never wraps on narrow screens (#24). */
.sidebar-toggle {
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}

.sidebar-toggle-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
}

.sidebar-toggle-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.sidebar-compact-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--scheme-text) 5%, transparent);
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}

.sidebar-compact-toggle:hover,
.sidebar-compact-toggle:focus-visible {
  color: #fff;
  border-color: var(--accent);
}

.sidebar-compact-toggle span,
.sidebar-compact-toggle svg {
  width: 18px;
  height: 18px;
}

.sidebar-compact-toggle svg {
  fill: currentColor;
  transition: transform 0.16s ease;
}

@media (min-width: 1025px) {
html.sidebar-compact .sidebar-compact-toggle svg {
  transform: rotate(180deg);
}

html.sidebar-compact .sidebar-resizer {
  display: none;
}

html.sidebar-compact .sidebar-inner {
  padding-inline: 0.15rem;
}

html.sidebar-compact .sidebar-groups {
  padding-right: 0;
}

html.sidebar-compact .sidebar-group-title {
  margin-inline: 0;
  text-align: center;
  font-size: 0;
}

html.sidebar-compact .sidebar-group-title::after {
  content: attr(data-compact-label);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
}

html.sidebar-compact .sidebar-link {
  justify-content: center;
  min-height: 42px;
  padding-inline: 0.1rem;
  gap: 0;
}

html.sidebar-compact .sidebar-link-title,
html.sidebar-compact .sidebar-expand-toggle,
html.sidebar-compact .sidebar-identity-name,
html.sidebar-compact .sidebar-bottom-nav .sidebar-link > span:last-child,
html.sidebar-compact .sidebar-footer-action > span:last-child {
  display: none;
}

html.sidebar-compact .sidebar-icon-wrap {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}

html.sidebar-compact .sidebar-icon-wrap svg {
  width: 22px;
  height: 22px;
}

html.sidebar-compact .sidebar-expandable-head > .sidebar-link {
  flex: 1 1 auto;
}

html.sidebar-compact .sidebar-child-item,
html.sidebar-compact .sidebar-meta-item {
  justify-content: center;
  min-height: 28px;
  padding: 0.25rem 0;
  text-align: center;
  font-size: 0;
}

html.sidebar-compact .sidebar-context-label,
html.sidebar-compact .sidebar-tier-item,
html.sidebar-compact .sidebar-meta-item {
  font-size: 0;
}

html.sidebar-compact .sidebar-context-label::after,
html.sidebar-compact .sidebar-tier-item::after,
html.sidebar-compact .sidebar-meta-item::after {
  content: attr(data-compact-label);
  color: var(--text-muted);
  font-size: 0.6rem;
  line-height: 1;
}

html.sidebar-compact .sidebar-profile-row {
  justify-content: center;
}

html.sidebar-compact .sidebar-profile-row .sidebar-identity {
  flex: 0 0 auto;
}

html.sidebar-compact .sidebar-profile-row .sidebar-footer-icons {
  margin-left: 0;
}

}

/* The nav list is the ONLY part that scrolls. Without an explicit grow it was
   `flex: 0 1 auto` and sized to its content, pushing the bottom nav and the
   username footer past the fold on a long nav. */
.sidebar-groups {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.1rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 55%, var(--border)) transparent;
}

.sidebar-groups::-webkit-scrollbar {
  width: 8px;
}

.sidebar-groups::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-groups::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 55%, var(--border));
  background-clip: padding-box;
}

.sidebar-profile {
  margin: 0;
  padding: 0.1rem 0.1rem 0.01rem;
  border: 0;
}

.sidebar-eyebrow {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.874rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-name {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
}

.sidebar-email {
  margin: 0.45rem 0 0.95rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  word-break: break-word;
}

.sidebar-identity {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.46rem;
}

/* Signed-in footer: user icon + name on the left, action icons on the right,
   all on a single row that always fits (#13). */
.sidebar-profile-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-profile-row .sidebar-identity {
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.3rem;
}

.sidebar-identity-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Footer identity links to the User Profile page; when that page is active the
   name goes gold to match the active settings icon beside it (#22). The username
   carries a normal link underline while signed in (#26); the icon stays clean. */
.sidebar-identity-link {
  text-decoration: none;
  color: inherit;
}

.sidebar-identity-link .sidebar-identity-name {
  text-decoration: underline;
}

.sidebar-identity-link.is-active,
.sidebar-identity-link.is-active .sidebar-identity-name {
  color: var(--accent);
}

.sidebar-profile-row .sidebar-footer-icons {
  flex: 0 0 auto;
  margin-left: auto;
}

/* #265: an administrator or moderator is shown by the colour of their name.
   It overrides the link colour and the active-page colour on purpose - being
   staff is a property of the person, not of which page is open. */
.sidebar-identity-name.is-staff,
.sidebar-identity-link.is-active .sidebar-identity-name.is-staff {
  color: var(--staff);
  font-weight: 650;
}

.sidebar-group + .sidebar-group {
  margin-top: 1.3rem;
}

.sidebar-group-title {
  margin: 0 0 0.35rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-group-admin .sidebar-group-title,
.sidebar-group-admin .sidebar-link,
.sidebar-group-admin .sidebar-link.is-active,
.sidebar-group-admin .sidebar-link.is-active .sidebar-icon-wrap {
  color: #f3d77a;
}

.sidebar-group-admin .sidebar-link:hover,
.sidebar-group-admin .sidebar-link:focus-visible {
  color: #ffe69a;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 10px;
  color: var(--text-soft);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.16s ease, color 0.16s ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: color-mix(in srgb, var(--scheme-text) 4%, transparent);
  color: var(--text);
}

/* The active row is tinted with the accent (SUB78): no outline, no shadow. */
.sidebar-link.is-active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: transparent;
  box-shadow: none;
  color: var(--text);
  transform: none;
}

.sidebar-link-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  font-size: 0.97rem;
  font-weight: 600;
}

.sidebar-link-badge,
.messages-unread-count,
.messages-tab-count,
.admin-operations-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  min-height: 1.4rem;
  padding: 0 0.38rem;
  border-radius: 999px;
  background: var(--btn-fill);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.sidebar-link-badge {
  margin-left: auto;
}

.sidebar-link-badge + .sidebar-link-badge {
  margin-left: 0.25rem;
}

.sidebar-link-badge.is-lost {
  background: var(--btn-danger);
  color: #fff;
}

html.sidebar-compact .sidebar-link-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  min-width: 1.1rem;
  min-height: 1.1rem;
  padding: 0 0.25rem;
  font-size: 0.62rem;
}

html.sidebar-compact .sidebar-link-badge.is-lost {
  top: 1.05rem;
}

.sidebar-link.is-active .sidebar-link-title {
  font-weight: 600;
}

.sidebar-link.is-active .sidebar-icon-wrap {
  color: var(--accent-strong);
}

/* Account text remains slightly brighter; navigation state uses the shared
   accent treatment in every group. */
.sidebar-group-account .sidebar-group-title {
  color: color-mix(in srgb, var(--text-muted) 82%, white 18%);
}

.sidebar-group-account .sidebar-link-title {
  color: color-mix(in srgb, var(--text-soft) 82%, white 18%);
}

.sidebar-group-account .sidebar-link:hover .sidebar-link-title,
.sidebar-group-account .sidebar-link:focus-visible .sidebar-link-title,
.sidebar-group-account .sidebar-link.is-active .sidebar-link-title {
  color: color-mix(in srgb, var(--text) 82%, white 18%);
}

.sidebar-group-creator .sidebar-link-title {
  color: var(--text-soft);
}

.sidebar-group-creator .sidebar-link.is-active .sidebar-link-title,
.sidebar-group-creator .sidebar-link:hover .sidebar-link-title {
  color: var(--text);
}

.sidebar-expandable-head {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.sidebar-expandable-head > .sidebar-link {
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-expand-toggle {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.sidebar-expand-toggle:hover,
.sidebar-expand-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--scheme-text) 9%, transparent);
  background: color-mix(in srgb, var(--scheme-text) 6%, transparent);
  color: var(--text);
}

.sidebar-expand-arrow {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease;
}

.sidebar-expand-toggle[aria-expanded="false"] .sidebar-expand-arrow {
  transform: translateX(-2px) rotate(-45deg);
}

.sidebar-expandable-items[hidden] {
  display: none;
}

html.sidebar-state-pending .sidebar-expandable-items {
  visibility: hidden;
}

html.sidebar-creators-collapsed [data-sidebar-section="creators"] [data-sidebar-section-items],
html.sidebar-content-collapsed [data-sidebar-section="content"] [data-sidebar-section-items] {
  display: none;
}

.sidebar-child-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0.12rem 0;
  padding: 0.34rem 0.6rem;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.91rem;
  line-height: 1.35;
  /* Tier entries are links to their filtered gallery now, so kill the underline
     and give them the same hover affordance as the other nav rows. */
  text-decoration: none;
}

a.sidebar-child-item:hover,
a.sidebar-child-item:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--scheme-text) 6%, transparent);
}

/* The tier the gallery is currently filtered to, however the viewer got there. */
a.sidebar-child-item.is-active {
  color: var(--text);
  font-weight: 400;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--scheme-raised) 86%, var(--accent) 14%),
    color-mix(in srgb, var(--scheme-raised) 96%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, var(--border)), 0 5px 14px rgba(0, 0, 0, 0.18), 0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
}

.sidebar-context-item {
  min-height: 36px;
  color: var(--text-soft);
  font-size: 0.91rem;
  font-weight: 400;
  padding-left: 0.85rem;
  overflow-wrap: anywhere;
}

.sidebar-context-item::before,
.sidebar-tier-item::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text-muted) 72%, transparent);
}

a.sidebar-child-item.is-active::before {
  background: var(--accent);
}

/* #152: the creator owns the tiers listed beneath it, so it must not read as a
   sibling of them - heavier text and a square marker instead of the tier dot. */
.sidebar-context-creator {
  color: var(--text);
  font-weight: 600;
}

.sidebar-context-creator::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--text) 70%, transparent);
}

/* #152: a creator-recommended tier is marked in the rail as well, matching the
   accent treatment its card gets on the creator page. */
.sidebar-tier-item.is-recommended {
  color: var(--text);
  font-weight: 600;
}

.sidebar-tier-item.is-recommended::before {
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent);
}

html.sidebar-compact .sidebar-context-item::before,
html.sidebar-compact .sidebar-tier-item::before {
  display: none;
}

.sidebar-context-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

.sidebar-tier-item {
  padding-left: 0.85rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* SUB419 The content being edited, under Content: its marker sits beneath the
   Content icon and its text lines up with the Content label. */
.sidebar-content-current {
  min-height: 34px;
  margin: 0;
  padding: 0.2rem 0.75rem 0.2rem calc(0.75rem + 2px + 6px);
  gap: calc(0.75rem + 6px);
  color: var(--text);
}

.sidebar-content-current::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--accent);
}

.sidebar-content-current .sidebar-link-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html.sidebar-compact .sidebar-content-current {
  display: none;
}

.sidebar-child-item .sidebar-icon-wrap {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.sidebar-child-item .sidebar-link-title {
  font-size: 0.91rem;
  font-weight: 500;
}


.sidebar-icon-wrap {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 17px;
}

.sidebar-icon-wrap svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* The bottom nav block above it now owns the `margin-top: auto` that pushes
   the tail of the rail down - two auto margins would split the free space and
   leave a gap between Privacy and the footer. */
/* Always pinned to the bottom of the rail - never scrolls away. */
.sidebar-footer {
  flex: 0 0 auto;
  padding-top: 0.4rem;
  border-top: 1px solid color-mix(in srgb, var(--scheme-text) 12%, transparent);
}

.sidebar-footer-icons {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.12rem;
  margin-top: 0;
}

/* Privacy is a real nav item now, pinned to the BOTTOM of the rail so it is
   always the last entry in the menu (it used to be a stray subtle link floating
   under the sidebar card). .sidebar-groups flex-grows, so this block is pushed
   hard against the footer no matter how many groups are above it. */
.sidebar-bottom-nav {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 0.35rem;
}

/* Content-report trigger (#51 follow-up): thin, low-key text inside the page,
   bottom-right corner - never a prominent button. */
.page-report-row {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 1.5rem 1.25rem;
}

.page-report-link {
  min-height: auto;
  background: none;
  border: none;
  padding: 0.1rem 0.2rem;
  font-size: 0.782rem;
  font-weight: 400;
  color: var(--text-muted);
  opacity: 0.65;
  text-decoration: none;
  cursor: pointer;
}

.page-report-link:hover,
.page-report-link:focus-visible {
  color: var(--text-soft);
  opacity: 1;
  text-decoration: none;
}

.page-report-link:hover,
.page-report-link:focus-visible {
  color: var(--text-soft);
  opacity: 1;
}

.sidebar-footer-icons form {
  margin: 0;
}

/* Guest footer row (#43): person icon + Sign In / Create Account left-aligned,
   cookie icon pushed to the far right, all on the single sidebar-profile-row. */
.sidebar-session-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-session-row .sidebar-plain-action {
  padding: 0.24rem 0;
}

.sidebar-cookie-icon {
  margin-left: auto;
}

.sidebar-footer-icons--guest {
  width: 100%;
  justify-content: space-between;
}

.sidebar-footer-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 32px;
  padding: 0.25rem 0.45rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.sidebar-footer-action:hover,
.sidebar-footer-action:focus-visible {
  background: color-mix(in srgb, var(--scheme-text) 6%, transparent);
  color: var(--text);
}

.sidebar-session-sep {
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-profile-row .sidebar-identity-guest {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.sidebar-footer-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.sidebar-footer-icon .sidebar-icon-wrap {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.sidebar-footer-icon .sidebar-icon-wrap svg {
  width: 17px;
  height: 17px;
}

.sidebar-footer-icon:hover,
.sidebar-footer-icon:focus-visible,
.sidebar-footer-icon.is-active {
  color: var(--accent);
  background: transparent;
}

button.sidebar-footer-icon,
button.sidebar-footer-icon:hover,
button.sidebar-footer-icon:focus-visible {
  color: #fff;
}

.sidebar-plain-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.42rem;
  min-height: 24px;
  padding: 0.24rem 0.2rem;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.943rem;
  font-weight: 600;
  text-decoration: none;
}

.sidebar-plain-action:hover,
.sidebar-plain-action:focus-visible,
.sidebar-plain-action.is-active {
  color: var(--text);
  background: transparent;
}

/* Buyer review uses the site's existing graphite surfaces and compact controls. */
.buyer-review-panel { min-width: 0; }
.buyer-review-summary > * + * { margin-inline-start: .6rem; }
.buyer-review-controls { display: flex; flex-wrap: wrap; gap: .6rem; }
.buyer-review-controls form { flex: 1 1 10rem; }
.buyer-review-controls .btn { width: 100%; }
.buyer-review-label { margin: .35rem 0 0; color: var(--text-soft); font-size: .82rem; font-weight: 700; }
.buyer-review-table th, .buyer-review-table td { text-align: left; }
.buyer-review-badge { display: inline-flex; align-items: center; border: 1px solid #8e713b; background: #493d272e; color: #e1bf79; border-radius: .4rem; padding: .15rem .45rem; font-size: .75rem; font-weight: 600; white-space: nowrap; width: fit-content; justify-self: start; }
.buyer-review-badge.is-restricted { border-color: #93565c; background: #5f2d342e; color: #e8a3ab; }
.buyer-restriction-notice { background: var(--panel, #202126); border: 1px solid #93565c; border-radius: .7rem; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.buyer-restriction-notice p { margin: .4rem 0 0; }
.creator-ledger-transaction-id .buyer-review-badge { margin-top: .3rem; }
.admin-refund-table .buyer-review-badge, .admin-refund-pending-table .buyer-review-badge { margin-inline-start: .4rem; }
/* The window opens inside the users table, whose phone layout shows its own sort headings as buttons. These
   tables have nothing to sort: like every other stacked table, each card names its values and the heading row goes. */
@media (max-width: 720px) {
  .admin-user-actions-modal .buyer-review-panel .buyer-review-table.responsive-table-ready thead { display: none; }
  .admin-refund-table .buyer-review-badge, .admin-refund-pending-table .buyer-review-badge { margin-inline-start: 0; }
}


/* The content column carries the page gutter on BOTH sides - the sidebar rail
   is what sits flush against the viewport edge, never the headings and copy
   inside this column. --page-max then caps the measure; the slack falls on the
   right, which is where a left-aligned system wants it.
   ---------------------------------------------------------------------------
   IMPORTANT: every page renders `<main class="app-content app-page">` - BOTH
   classes land on the SAME element. `.app-page` is defined below this rule at
   the same specificity, so any `padding` it declares wins the cascade and
   silently erases this gutter (that is exactly what used to happen: the column
   ran flush against the sidebar). `main.app-content` raises the specificity so
   the gutter cannot be knocked out again, and `.app-page` declares no padding
   at all. Do not add one back to `.app-page`. */
main.app-content {
  min-width: 0;
  min-height: 0;
  align-self: start;
  padding: 0.75rem var(--gutter) 3rem;
  max-width: 100%;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.app-page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0;
}

.app-overlay {
  display: none;
}

.page-shell {
  width: 100%;
  max-width: var(--page-max);
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 1.75rem;
  padding-top: 0.01rem;
}

.creator-workspace {
  /* Single source of truth for every single-line control height across the
   * Creator workspace (#28). Inputs, selects AND buttons all reference this, so
   * the page can never again show three different heights on one row. */
  --control-h: 40px;
  max-width: var(--page-max);
  padding: 0.01rem 0 1rem;
}

/* Every single-line input, select and button in the Creator workspace uses the
 * same full control height. Change --control-h above and they all follow (#28).
 * Table heading buttons (sort, help) keep the shared heading size. */
.creator-workspace .form-control,
.creator-workspace .form-select,
.creator-workspace .input-group-text,
.creator-workspace .btn,
.creator-workspace button:not(.sidebar-footer-icon):not(.cart-toggle):not(.cart-close):not(.sidebar-toggle):not(.app-window-close):not(.creator-ledger-tooltip-trigger):not(thead button) {
  min-height: var(--control-h);
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.2;
  font-size: 0.9rem;
}

.creator-workspace .form-control,
.creator-workspace .form-select,
.creator-workspace .input-group-text {
  padding-left: 0.7rem;
  padding-right: 0.7rem;
  border-radius: 9px;
}

.creator-workspace .btn {
  padding-left: 0.85rem;
  padding-right: 0.85rem;
  border-radius: 9px;
}

.creator-workspace .btn-sm {
  --control-h: 40px;
  font-size: 0.977rem;
}

.creator-workspace .btn-icon-only {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

/* Textareas are multi-line, so they keep their own height but match the new
 * compact padding/radius. */
.creator-workspace textarea.form-control {
  min-height: 96px;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.creator-workspace .form-label {
  margin-bottom: 0.25rem;
  font-size: 0.943rem;
}

/* The shared form-message target reserves no space until JS writes into it, so
 * Creator pages start flush at the top with no empty leading line (#28). */
[data-global-form-message]:empty {
  display: none;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  gap: 1.5rem;
  align-items: start;
}

.workspace-hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.workspace-title {
  margin: 0;
  line-height: 1.15;
}

.workspace-title h1 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.workspace-copy {
  margin: 0.9rem 0 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.workspace-rail {
  position: sticky;
  top: 96px;
}

.page-header {
  margin-bottom: 0;
}

/* Page titles (SUB78): a large bold title in sentence case. A page that has
   both a kicker and an h1 shows the kicker as a small accent eyebrow above
   the title; a page with only a kicker uses it as the title. */
.page-kicker,
.page-header h1 {
  margin: 0;
  font-size: 2.15rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-transform: none;
}

.page-header:has(h1) .page-kicker {
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.page-kicker a {
  color: inherit;
  text-decoration: none;
}

.page-header p:not(.page-kicker) {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.5;
}

.page-header-note,
.creator-description {
  margin: 0.7rem 0 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-line;
}

.creator-search-form {
  padding: 0.35rem 0.3rem;
}

.creator-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

/* Categories and tiers are ONE capsule row split by a hairline, not two
   stacked rows - they are two axes of the same filter. */
.creator-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 0.7rem 0 0.25rem;
}

.creator-filter-bar.has-center-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

/* SUB243 Each group keeps its column when the creator hides the other. */
.creator-filter-bar.has-center-control > .creator-filter-group--categories { grid-column: 1; }
.creator-filter-bar.has-center-control > .creator-filter-group--actions { grid-column: 2; }
.creator-filter-bar.has-center-control > .creator-filter-group--tiers { grid-column: 3; }

.creator-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.creator-filter-group--categories {
  justify-content: flex-start;
}

.creator-filter-group--actions {
  justify-content: center;
}

.creator-filter-group--actions .mark-read-all {
  display: flex;
}

.creator-filter-group--tiers {
  justify-content: flex-end;
  margin-left: auto;
}

/* Counters share the creator-name row and never compete with the description. */
.creator-stats-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.creator-stats-row > span,
.creator-stats-row > a {
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

@media (max-width: 820px) {
  .creator-stats-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

.creator-stat strong {
  color: var(--text);
  font-weight: 600;
}

/* Part of the same right-aligned group now - no auto margin shoving it to the
   opposite end of the row. */
.creator-stat-recent {
  color: var(--accent);
  text-decoration: none;
}

a.creator-stat-recent:hover,
a.creator-stat-recent:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  color: var(--accent-strong);
}

/* The gallery follows the tier cards immediately - the stacked hero-bottom +
   panel-top padding left a dead band under the cards. */
.creator-gallery-panel {
  padding-top: 0.35rem;
}

/* An empty form-message box must occupy no space at all; it only earns its
   margin once something is actually written into it. */
#form-message:empty {
  display: none;
}

#form-message:not(:empty) {
  margin-bottom: 0.75rem;
}

/* Viewing a single tier: back-link under the creator name, that one tier's
   card parked in the header's top-right - never the whole tier bar. */
.creator-selected-tier-back {
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.creator-selected-tier-back:hover,
.creator-selected-tier-back:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}

.creator-selected-tier-card {
  flex: 1 1 50%;
  min-width: 0;
  margin-left: auto;
}

/* Inside the header slot the card needs its own surface - the gradient behind
   it is close enough in value that a transparent card would vanish. */
.creator-selected-tier-card .creator-tier-card {
  background: var(--surface-strong, var(--surface));
}

.creator-content-filters {
  margin: 0 1.5rem 0.75rem;
}

/* Section heading as a rule with a trailing count (mockup): label, hairline
   that fades out, count on the right. */
.creator-gallery-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.2rem;
}

.creator-gallery-heading h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.creator-gallery-rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong, var(--border)), transparent);
}

.creator-gallery-count {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Size the header controls by their content, independently of the sidebar. */
.app-header-lead {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.65rem;
  border-right: 1px solid color-mix(in srgb, var(--scheme-text) 10%, transparent);
}

.app-header-lead > .site-brand {
  flex: 0 0 auto;
}

.app-header-lead .site-brand-text {
  white-space: nowrap;
}

.app-header-lead > .cart-widget {
  flex: 0 0 auto;
  margin-left: 0;
  margin-right: 0;
}

/* Per-user actions in Admin > Users use the shared centered modal. */
.admin-user-actions-modal {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* The dialog lives inside a nowrap table cell; its text must still wrap. */
  white-space: normal;
}

.admin-user-actions-modal .app-modal-body,
.admin-user-actions-content,
.admin-user-action-form,
.admin-user-action-form label,
.admin-user-reason {
  min-width: 0;
}

.admin-user-actions-modal .form-control,
.admin-user-actions-modal .form-select {
  min-width: 0;
  max-width: 100%;
}

.admin-user-actions-modal .app-modal-head h2,
.admin-user-password-note,
.admin-user-remove-confirm {
  overflow-wrap: anywhere;
}

.admin-user-actions-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.admin-user-action-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised, var(--surface));
  color: #fff;
  cursor: pointer;
}

.admin-user-action-trigger:hover,
.admin-user-action-trigger:focus-visible {
  color: #fff;
  border-color: var(--accent);
}

.admin-user-action-trigger .sidebar-icon-wrap {
  width: 18px;
  height: 18px;
}

.admin-user-action {
  display: block;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
}

.admin-user-action:hover,
.admin-user-action:focus-visible {
  color: var(--text);
  background: var(--surface-raised);
}

.admin-user-actions-content form {
  margin: 0;
}

.admin-user-action-form {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem 0.55rem;
  border-top: 1px solid var(--border);
}

.admin-user-action-form label {
  display: grid;
  gap: 0.25rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-user-action-heading {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
}

.admin-user-action-heading-section {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-user-actions-content .btn-key-action {
  width: 100%;
}

.admin-user-actions-content .btn-danger {
  width: 100%;
  border-color: #8f1724;
  background: #b42332;
  color: #ffffff;
}

.admin-user-actions-content .btn-danger:hover,
.admin-user-actions-content .btn-danger:focus-visible {
  border-color: #64101a;
  background: #8f1724;
  color: #ffffff;
}

.admin-user-actions-content .admin-user-check {
  color: var(--text-soft) !important;
}

.admin-user-password-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.admin-user-fee-note {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Creator shop-colour picker: radio swatches in the profile editor. The
   swatch colours are hard-coded to match the html[data-accent] blocks at the
   top of this file - they must be changed together. */
.creator-profile-accent-row {
  width: 100%;
}

.creator-accent-options {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.creator-accent-option {
  display: grid;
  place-items: center;
  align-items: center;
  width: 42px;
  height: 42px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.creator-accent-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.creator-accent-option:has(input:checked) {
  border-color: var(--text);
  background: transparent;
}

.creator-accent-option:has(input:focus-visible) {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
}

.creator-accent-swatch {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

[data-accent-swatch="blurple"] {
  background: linear-gradient(135deg, #b5abfc, #5d5294);
}

[data-accent-swatch="amber"] {
  background: linear-gradient(135deg, #f0b55a, #8a6626);
}

[data-accent-swatch="teal"] {
  background: linear-gradient(135deg, #63d3c2, #24705f);
}

[data-accent-swatch="rose"] {
  background: linear-gradient(135deg, #f2a0bb, #8c4a63);
}

[data-accent-swatch="green"] {
  background: linear-gradient(135deg, #92d585, #3f7236);
}

[data-accent-swatch="blue"] {
  background: linear-gradient(135deg, #86c4f2, #2f6795);
}

.creator-accent-swatch--default {
  background: repeating-linear-gradient(45deg, var(--surface) 0 4px, var(--border) 4px 8px);
}

/* Global header search: one field for creators AND content. */
.global-search {
  position: relative;
  flex: 1 1 224px;
  max-width: 460px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.global-search-icon {
  position: absolute;
  left: 0.7rem;
  width: 16px;
  height: 16px;
  display: inline-flex;
  pointer-events: none;
  color: var(--text-soft);
  transition: color 0.18s ease;
}

.global-search-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Lifted well above the header surface so the field reads as the one thing you
   can type into. The old 3% fill was almost indistinguishable from the header
   behind it. */
.global-search-input {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  height: 40px;
  padding: 0 0.85rem 0 2.4rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--scheme-text) 11%, transparent);
  background: var(--field);
  color: var(--text);
  font-size: 0.92rem;
  box-shadow: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Appearance comes from the shared button component. */
.global-search-submit {
  flex: 0 0 auto;
}

.page-save-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, var(--chrome));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}

.page-save-bar[hidden] {
  display: none;
}

.page-save-message {
  color: var(--scheme-text);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.page-save-bar.is-saving {
  opacity: 0.78;
}

/* With JavaScript active, tracked editor forms use the one global header
 * action. The original submit controls remain as a no-script fallback.
 * A button with a form attribute submits a different form (Delete, Remove,
 * Publish) and stays visible; data-page-save-keep marks any other one. */
.page-save-ready form[data-page-save] button[type="submit"]:not([data-page-save-keep]):not([form]) {
  display: none;
}

.page-save-ready .page-save-fallback {
  display: none;
}

body.page-save-dialog-open::before {
  content: "";
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 1001;
  background: rgba(5, 7, 10, 0.65);
  backdrop-filter: blur(2px);
}

/* Editors stay non-modal so the header Save bar remains usable. The window
   sits 1rem below the header and keeps a 1rem gap at the bottom; the shared
   24px dialog margin must not add to that offset. */
dialog[data-page-save-dialog][open] {
  position: fixed;
  top: calc(var(--header-h) + 1rem);
  z-index: 1002;
  margin: 0 auto;
  max-height: calc(100dvh - var(--header-h) - 2rem);
  overflow: auto;
  overscroll-behavior: contain;
}

/* Like a modal, the page behind an open editor does not scroll. */
html:has(dialog[data-page-save-dialog][open]) {
  overflow: hidden;
}

.global-search-input::placeholder {
  color: var(--text-soft);
}

.global-search:hover .global-search-input {
  border-color: color-mix(in srgb, var(--scheme-text) 18%, transparent);
}

.global-search:focus-within .global-search-icon {
  color: var(--accent-strong);
}

.global-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--field);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

@media (max-width: 1100px) {
  .page-save-message {
    display: none;
  }
}

/* The page-wide save prompt stays centered while the view switch occupies the
   right side of the creator header (#305). */
.app-header-view-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  margin-left: auto;
  margin-right: 0.65rem;
  white-space: nowrap;
}

.site-public-message {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  /* Same height as the Search field and button beside it. */
  height: 40px;
  padding: 0 0.8rem;
  border: 1px solid color-mix(in srgb, var(--public-message-bg, #a8202b) 62%, white);
  border-radius: 10px;
  background: var(--public-message-bg, #a8202b);
  color: var(--public-message-fg, #fff);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 38px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 0 18px color-mix(in srgb, var(--public-message-bg, #a8202b) 24%, transparent);
}

@media (max-width: 900px) {
  .app-header-view-switch .site-header-action {
    padding-inline: 0.6rem;
  }
}

@media (max-width: 720px) {
  .global-search {
    display: none;
  }

  .global-search.is-shortcut-open {
    display: flex;
    position: fixed;
    inset: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    height: var(--header-h);
    padding: 10px 12px;
    background: var(--chrome);
    z-index: 1;
  }

  .global-search.is-shortcut-open .global-search-icon {
    left: 25px;
  }

  .global-search.is-shortcut-open .global-search-submit {
    display: none;
  }

  .app-header-view-switch {
    display: none;
  }

  .page-save-message {
    display: none;
  }
}
.creator-related-content {
  grid-column: 1 / -1;
}

.related-content-selected,
.creator-content-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.related-content-selected-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: start;
  height: auto;
  aspect-ratio: var(--release-media-ratio);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
}

.related-content-selected-item.is-dragging {
  opacity: 0.55;
}

.related-content-selected-title {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  min-width: 0;
  padding: 0.4rem 0.75rem 0.6rem;
  color: #fff;
  background: linear-gradient(rgb(0 0 0 / 82%), transparent);
  overflow-wrap: anywhere;
}

.related-content-selected-item .related-content-thumb {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--release-media-ratio);
  border-radius: 0;
}

.related-content-selected-item .related-content-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.related-content-selected-item .related-content-placeholder svg {
  width: 4rem;
  height: 4rem;
}

.content-picker-options {
  max-height: min(56vh, 34rem);
  overflow-y: auto;
}

.content-picker-option {
  cursor: pointer;
  color: var(--text);
}

.content-picker-option > td {
  color: var(--text);
}

.content-picker-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}

/* Grouped picker rows: one collapsible row per group (e.g. creator). */
.content-picker-group > td {
  padding: 0;
  background: var(--surface-raised);
}

.content-picker-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 0;
  background: var(--surface-raised);
  color: var(--text);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.content-picker-group-toggle::before {
  content: "\25B8";
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.content-picker-group-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.content-picker-group-toggle[aria-busy="true"] {
  opacity: 0.7;
}

.content-picker-group-toggle:hover,
.content-picker-group-toggle:focus-visible {
  background: var(--surface-strong);
}

.content-picker-group-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.content-picker-option[data-picker-group-member] > td:nth-child(2) {
  padding-left: 1.75rem;
}

.content-picker-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.content-picker-toolbar > div {
  flex: 1;
}

.content-picker-empty {
  margin: 0.75rem 0 0;
}

.content-picker-limit {
  margin: 0 0 0.55rem;
  white-space: nowrap;
}

.content-picker-select-cell {
  width: 3.5rem;
}

.content-picker-preview-col {
  width: 6.75rem;
}

.content-picker-select-cell input {
  width: 1rem;
  height: 1rem;
}

.related-content-reciprocal {
  display: block;
  margin-top: 1rem;
}

.content-picker-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.content-picker-actions .btn {
  min-width: 7rem;
  padding: 0.55rem 1.1rem;
}

.related-content-thumb,
.creator-content-related-thumb {
  display: grid;
  flex: 0 0 3rem;
  width: 3rem;
  height: auto;
  aspect-ratio: var(--release-media-ratio);
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.related-content-thumb img,
.creator-content-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-picker-option .related-content-thumb {
  width: 6.25rem;
  height: auto;
  aspect-ratio: var(--release-media-ratio);
}

.creator-content-related {
  margin-top: 1.5rem;
}

.creator-content-related-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: auto;
  aspect-ratio: var(--release-media-ratio);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
}

.creator-content-related-card .creator-content-related-thumb {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--release-media-ratio);
  border-radius: 0;
}

.creator-content-related-card .related-content-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.creator-content-related-card .related-content-placeholder svg {
  width: 4rem;
  height: 4rem;
}

.creator-content-related-card strong {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  left: 0;
  padding: 0.4rem 0.75rem 0.6rem;
  color: #fff;
  background: linear-gradient(rgb(0 0 0 / 82%), transparent);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.creator-promotion-view-toggle {
  margin-top: 1rem;
  width: fit-content;
}

/* Versions of one model (SUB-32). The buttons reuse the creator filter chips;
   green shows the viewer's access: filled = owned, outline = subscription. */
.creator-content-versions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0 0.9rem;
}

.creator-content-versions .creator-filter-label {
  margin-right: 0.2rem;
}

.creator-version-chip {
  cursor: pointer;
  font-family: inherit;
}

.creator-version-chip.is-owned {
  border-color: rgba(79, 195, 117, 0.85);
  background: var(--btn-success);
  color: #fff;
  font-weight: 600;
}

.creator-version-chip.is-subscribed {
  border-color: rgba(79, 195, 117, 0.85);
  background: var(--btn-success);
  color: #fff;
}

.creator-version-chip.is-active.is-owned,
.creator-version-chip.is-active.is-subscribed {
  box-shadow: inset 0 -3px 0 #4fc375;
}

.creator-content-version-part[hidden],
.creator-content-version-sections[hidden] {
  display: none !important;
}

.creator-content-version-part {
  display: contents;
}

.creator-content-version-notes {
  margin: 0 0 1rem;
}

.creator-content-version-notes > summary {
  cursor: pointer;
  color: var(--text-soft);
  font-weight: 600;
}

.creator-content-version-notes > .markdown-body {
  margin-top: 0.6rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
}

.creator-content-table-version {
  color: var(--text-muted);
  font-weight: 500;
}

.creator-editor-versions {
  margin: 0.25rem 0 0;
  padding: 0 0.8rem;
}

.creator-editor-versions .creator-version-chip.is-draft:not(.is-active),
[data-version-picker] .creator-version-chip.is-draft {
  border-style: dashed;
}

.creator-version-add {
  background: transparent;
}

.creator-version-fields {
  display: grid;
  gap: 0.9rem;
}

.creator-version-fields input[name="version_label"] {
  max-width: 16rem;
}

/* A model's version name beside its title on cards (SUB-32). */
.content-version-tag {
  margin-left: 0.3em;
  color: var(--text-muted);
  font-weight: 500;
}

/* SUB322 A creator's own weekly follower update limits, side by side. */
.admin-user-follower-limits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}


/* Tier cards: Home-style cards with a golden, all-caps header. Fixed width and
   height keep every card identical; the row wraps to multiple lines and falls
   back to horizontal scrolling when it cannot. */
/* Three cards per row, wrapping to additional rows when there are more tiers.
   Equal-width columns + grid stretch give every card the same height with no
   wasted vertical space. (#16) */
/* Tiers are cards: each one is a bounded object you can compare against its
   neighbours, not a slice of an unbounded band. The columns are capped rather
   than fractional, so two tiers on a wide screen stay two card-sized cards at
   the left edge instead of stretching to half the page each. */
/* Single horizontally scrolling row rather than a wrapping grid: the tier row
   sits above the fold now, so it must stay one row tall no matter how many
   tiers a creator has - extra tiers scroll sideways instead of pushing the
   gallery down the page. Cards are ~30% wider than before so the CTA and the
   description have room for real text. */
.creator-subscription-row {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
  justify-content: flex-start;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  /* Room for the scrollbar AND for the recommended card's ribbon/glow, which
     an overflow-x container would otherwise clip (overflow-x:auto forces
     overflow-y:auto too). The row's own padding-top below supplies the top. */
  padding-bottom: 0.9rem;
  scrollbar-width: thin;
}

/* Three cards across, then a fourth and beyond scroll in from the right. The
   gap is subtracted so the three-up base lands flush with both edges rather
   than overflowing by the gutters; the 0.9 factor trims each card 10% narrower
   than that base, leaving a sliver of the next card visible as a scroll hint. */
.creator-subscription-row > .creator-tier-card {
  flex: 0 0 calc((100% - 1.3rem) / 3 * 0.9);
  max-width: calc((100% - 1.3rem) / 3 * 0.9);
}

@media (max-width: 900px) {
  .creator-subscription-row > .creator-tier-card {
    flex-basis: calc((100% - 0.65rem) / 2);
    max-width: calc((100% - 0.65rem) / 2);
  }
}

@media (max-width: 560px) {
  .creator-subscription-row > .creator-tier-card {
    flex-basis: 84%;
    max-width: 84%;
  }
}

.creator-tier-card {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  /* Tight vertically: these cards sit above the fold and every wasted row here
     pushes the content gallery further down the page. */
  padding: 0.7rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border-strong, var(--border)));
  border-radius: var(--radius-md, 10px);
  background: var(--surface-strong, var(--surface));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 color-mix(in srgb, var(--text) 7%, transparent);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.creator-tier-card:is(:hover, :focus-within) {
  border-color: color-mix(in srgb, var(--accent) 75%, var(--border-strong));
  box-shadow: 0 0 20px -4px color-mix(in srgb, var(--accent) 28%, transparent), 0 14px 30px rgba(0, 0, 0, 0.27);
}

/* Title left, price right on ONE baseline-aligned row (mockup) - the price used
   to sit underneath the name, which wasted a whole line of card height. */
.creator-tier-card-head {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

/* The head is a link into this tier's filtered gallery. It must not look like
   body text OR like a button - the title carries the affordance on hover. */
.creator-tier-card-head--link {
  text-decoration: none;
  color: inherit;
}

.creator-tier-card-head--link:hover .creator-tier-title,
.creator-tier-card-head--link:focus-visible .creator-tier-title {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.creator-tier-card h3.creator-tier-title {
  margin: 0;
  font-size: 1.012rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  /* Wrap to a second line instead of clipping the name with an ellipsis. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.creator-tier-includes {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}

.creator-tier-includes-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.creator-tier-includes-list {
  color: var(--text-soft);
}

.creator-tier-price {
  margin: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
  white-space: nowrap;
  color: var(--text);
}

.creator-tier-amount {
  font-size: 1.15rem;
  font-weight: 700;
}

.creator-tier-interval {
  font-size: 0.92rem;
  color: var(--text-soft);
}

.creator-tier-description {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.943rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  flex: 1 1 auto;
}

/* "Includes X" / "Most popular" are CAPSULES, not italic running text - they
   are facts about the tier, and the mockup reads them as pills. */
.creator-tier-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.creator-tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  background: var(--surface-strong, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* "Includes …" reads as a LABEL, not a hole in the card: the old
   --surface-strong fill was the same dark value as the card behind it, so the
   pill vanished. Lighter fill + a defined edge, with the tier names inside it
   as accent links. */
.creator-tier-badge--includes {
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
  color: var(--text);
}

.creator-tier-badge-label {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.creator-tier-badge-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.creator-tier-badge-link:hover,
.creator-tier-badge-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.creator-tier-badge--accent {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

/* Creator-highlighted tier: stronger border plus a soft outer glow so it reads
   as the recommended choice at a glance, and a ribbon naming it. */
/* #152: recommended tiers lead the list and must be readable as the creator's
   pick at a glance - accent frame, tinted surface and a heavier title. */
.creator-tier-card.is-recommended {
  border-color: color-mix(in srgb, var(--accent) 85%, transparent);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--accent) 10%, transparent),
    transparent 60%),
    var(--surface-strong, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent),
    0 0 26px color-mix(in srgb, var(--accent) 26%, transparent);
}

.creator-tier-card.is-recommended .creator-tier-title {
  font-weight: 700;
  color: var(--text);
}

.creator-tier-card.is-recommended:is(:hover, :focus-within) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent),
    0 0 30px color-mix(in srgb, var(--accent) 32%, transparent);
}

.creator-tier-ribbons {
  position: absolute;
  top: -0.62rem;
  right: 0.7rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.creator-tier-ribbon {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--btn-fill);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tier-status-badge.is-recommended {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--accent-soft);
}

.creator-tier-action {
  margin-top: auto;
}

.creator-tier-action form {
  margin: 0;
}

.creator-tier-action [data-form-message] {
  display: none;
}

.creator-tier-cta {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

/* The "/month" suffix on the CTA is de-emphasised - lighter weight and smaller
   so the price stays the focus (#33). */
.creator-tier-cta-interval {
  font-weight: 400;
  font-size: 0.78em;
  opacity: 0.75;
  margin-left: 1px;
}

/* Hover keeps the same label (#22). The old gold glow is gone - on a dark
   ground the accent brightens the edge instead of blooming behind the button. */
.creator-tier-cta:hover,
.creator-tier-cta:focus-visible {
  border-color: transparent;
}

.creator-tier-unlocked {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--btn-a) 45%, #15171b);
  color: #fff;
  font-weight: 700;
  font-size: 0.943rem;
  text-decoration: none;
}

a.creator-tier-unlocked:hover,
a.creator-tier-unlocked:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 85%, transparent);
  background: color-mix(in srgb, var(--btn-a) 62%, #15171b);
  color: #fff;
}

.creator-tier-disabled {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.92rem;
}

.creator-tier-card.is-blocked {
  opacity: 0.72;
}

.creator-filter-tabs {
  margin-bottom: 0.6rem;
}

/* Filter controls share the filled graphite / accent button palette. */
.creator-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.3rem 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.creator-filter-group--categories .creator-filter-chip,
.creator-filter-row--categories .creator-filter-chip,
.creator-category-badge {
  border-radius: 999px;
}

.creator-filter-group--tiers .creator-filter-chip,
.creator-filter-row--tiers .creator-filter-chip {
  border-radius: 4px;
}

.creator-filter-chip:hover,
.creator-filter-chip:focus-visible {
  color: #fff;
  border-color: var(--border-strong, var(--border));
  background: color-mix(in srgb, var(--surface-raised), white 7%);
}

.creator-filter-chip.is-active {
  color: #fff;
  font-weight: 600;
  background: var(--btn-fill);
  border-color: transparent;
}

.creator-filter-chip.is-included {
  border-color: rgba(79, 195, 117, 0.85);
  background: var(--btn-success);
  color: #fff;
  font-weight: 600;
}

.creator-filter-check {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.28rem;
  border-radius: 50%;
  background: var(--btn-success);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.creator-search-form .input-group {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  flex-wrap: nowrap;
}

.creator-search-form .input-group .form-control {
  border-radius: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.creator-search-form .input-group .btn {
  border-radius: 12px !important;
  margin: 0;
  padding: 0.62rem 0.92rem;
  width: auto;
  flex: 0 0 auto;
}

.tier-signin-btn {
  width: 100%;
}

/* ---- De-carded sections -------------------------------------------------
 * The old look stacked every section inside its own rounded, shadowed,
 * lighter-than-the-page box. The redesign drops the box entirely: sections
 * sit directly on the page ground and are separated by a hairline rule and
 * whitespace. Only genuinely floating surfaces (dialogs, dropdowns, the auth
 * card) still carry an edge. */
.surface-card,
.hero,
.panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.hero {
  padding: var(--space-card) 0;
}

.panel {
  padding: 0;
  border-radius: 0;
}

/* Sections are separated by whitespace and their bold titles (SUB78), not by
   hairline seams. */

/* The auth card is a genuinely floating surface (it sits alone on an empty
   page), so it keeps an edge - but a hairline one, not a raised slab. */
.auth-card-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 0.85fr);
  gap: 0.75rem;
  align-items: start;
}

/* Density: the redesign is compact on purpose - every stack and grid gap
   drops from 1rem to 0.65rem so more fits on a screen without crowding. */
.stack-lg {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.stack-md {
  display: grid;
  gap: 0.65rem;
}

.feature-grid,
.stats-grid,
.dashboard-grid {
  display: grid;
  gap: 0.65rem;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

dialog[data-modal].promotion-modal {
  width: min(860px, calc(100vw - 2rem));
}

.promotion-form-grid {
  gap: 1rem 1.25rem;
}

.promotion-form-field {
  display: grid;
  grid-template-rows: auto 3rem;
  gap: 0.35rem;
  min-width: 0;
}

.promotion-form-field > .form-label {
  margin: 0;
  line-height: 1.25;
}

.promotion-form-field .form-control,
.promotion-form-field .form-select,
.promotion-form-field .multiselect-toggle {
  min-height: 3rem;
}

.promotion-modal .btn[data-promo-submit]:disabled,
.promotion-modal .btn[data-promo-submit]:disabled:hover,
.promotion-modal .btn[data-promo-submit]:disabled:focus,
.promotion-modal .btn[data-promo-submit]:disabled:active {
  background: var(--btn-fill);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
  cursor: default;
  filter: grayscale(1);
  opacity: 1;
}

@media (max-width: 720px) {
  .promotion-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dashboard-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Bottom-aligns a submit button against the labelled input fields beside it
 * in a dashboard-grid row (#41), e.g. the Discounts 2x2 create grid. */
.form-grid-action {
  display: flex;
  align-items: flex-end;
  align-self: stretch;
}

/* Promo Codes (#41): when a Scope other than "All content" is chosen, the
 * Create button moves out of the Scope row (its slot there is occupied by the
 * Content/Tier picker instead) and appears centered on its own row below. */
.promo-submit-centered {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* Compact metric cards (#25): half the previous width so four fit per row. */
.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid-category-create {
  grid-template-columns: minmax(220px, 0.5fr) minmax(320px, 1fr) auto;
  align-items: start;
}

.dashboard-grid-category-edit {
  grid-template-columns: minmax(220px, 0.5fr) minmax(320px, 1fr) auto;
  align-items: start;
}

.dashboard-filter-form .filter-actions {
  display: flex;
  align-items: end;
}

.form-block-pad {
  padding-top: 0.75rem;
}

.form-action-row {
  padding-top: 0.9rem;
}

.form-action-row-right {
  display: flex;
  justify-content: flex-end;
}

.form-action-row .btn {
  min-width: 180px;
}

.form-action-row-between {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-action-row-between .btn {
  width: auto;
}

.creator-toolbar-panel {
  padding: 0.65rem 0.75rem;
}

.creator-filter-card {
  padding: 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-raised) 86%, transparent);
  box-shadow: var(--shadow-sm);
}

.creator-filter-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.creator-filter-card-head span {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.creator-toolbar,
.workspace-status-strip {
  display: grid;
  grid-template-columns: minmax(360px, 2.8fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr);
  gap: 0.55rem;
  align-items: end;
}

.creator-toolbar-search {
  min-width: 0;
}

.creator-filter-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.creator-overview-strip {
  padding: 0.65rem;
}

.metrics-grid-compact {
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 0.5rem;
}

.metrics-grid-compact .metric-card {
  padding: 0.6rem;
  min-height: 0;
}

.metrics-grid-compact .metric-label {
  font-size: 0.782rem;
}

.metrics-grid-compact .metric-value {
  font-size: 1.2rem;
}

.creator-filter-label {
  align-self: center;
  color: var(--text-muted);
  font-size: 0.828rem;
  font-weight: 700;
  text-transform: uppercase;
}

.workspace-status-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.creator-toolbar-actions,
.creator-bulk-row,
.creator-ops-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.creator-toolbar-actions {
  align-self: end;
  justify-content: flex-end;
  white-space: nowrap;
}

.creator-bulk-row {
  width: auto;
  margin-right: auto;
  justify-content: flex-start;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Groups Create Content + template form together on the left of the toolbar
 * row, so the bulk-action row sits on the same line, to the right (#41). */
.creator-table-actions-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Shown once a row is checked (creator-tables.js). */
.creator-bulk-row[hidden] {
  display: none;
}

.creator-bulk-row .form-select {
  min-width: 180px;
}

.creator-create-split {
  display: inline-flex;
  align-items: stretch;
  position: relative;
}

.creator-create-main {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.creator-template-menu {
  position: relative;
}

.creator-template-caret {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
  list-style: none;
}

.creator-template-caret::-webkit-details-marker {
  display: none;
}

.creator-template-menu-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 25;
  min-width: 220px;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 23, 31, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.creator-template-menu-item {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.creator-template-menu-item:hover,
.creator-template-menu-item:focus-visible {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  outline: none;
}

.creator-template-inline,
.creator-template-delete,
.creator-template-panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.creator-template-inline {
  margin-left: auto;
}

.creator-template-inline .form-select,
.creator-template-delete .form-select {
  min-width: 180px;
}

.creator-template-panel {
  flex-wrap: wrap;
}

.creator-template-panel > .form-control {
  flex: 1 1 220px;
}

.creator-template-panel [data-template-message] {
  flex: 1 1 100%;
}

.subscription-table .subscription-main-col {
  width: auto;
}

.subscription-table .subscription-tight-col {
  width: 1%;
}

.subscription-table th:nth-child(n + 2),
.subscription-table td:nth-child(n + 2) {
  white-space: nowrap;
}

/* SUB476 Every value starts on the row's first line, so the creator, status,
   cost and dates line up and the lines under them read as their details. */
.subscription-table tbody td {
  vertical-align: top;
}

.subscription-table .subscription-creator {
  color: var(--text);
  font-weight: 700;
}

.subscription-table .subscription-creator a {
  color: inherit;
}

/* SUB472 The add-ons each subscription includes, under its name. */
.subscription-table .subscription-tier-line {
  margin-top: 0.15rem;
  color: var(--text-soft);
}

.subscription-table .subscription-tier-line + .subscription-tier-line {
  margin-top: 0.45rem;
}

.subscription-table .subscription-tier-line > a {
  color: inherit;
}

.subscription-table .subscription-addon-list {
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.subscription-table .subscription-addon-list li::before {
  margin-right: 0.35rem;
  color: var(--accent-strong);
  content: "+";
}

.subscription-table .subscription-price-cell {
  text-align: end;
}

.subscription-table .subscription-amount {
  color: var(--text);
  font-weight: 700;
}

.subscription-table .subscription-amount-detail {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.subscription-receipts .subscription-receipt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  padding: 0.6rem 0;
}

.subscription-receipts .subscription-receipt + .subscription-receipt {
  border-top: 1px solid var(--border);
}

.subscription-receipts .subscription-receipt > details {
  flex-basis: 100%;
}

/* Cancel and Reactivate (SUB477) ask in the same window, with spaced actions. */
.subscription-cancel-confirm .app-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.subscription-cancel-confirm [data-cancellation-survey-done][hidden] { display: none; }

.subscription-cancellation-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem 0;
}

.subscription-cancellation-choices .creator-filter-chip {
  gap: 0.45rem;
  justify-content: flex-start;
  min-height: 36px;
  white-space: normal;
}

.subscription-cancellation-choices input { flex: 0 0 auto; }

.subscription-cancellation-choices .creator-filter-chip:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 17%, var(--surface-raised));
  border-color: var(--accent);
}

[data-cancellation-survey] .form-label { display: block; }
[data-cancellation-survey] textarea { resize: vertical; }
[data-cancellation-survey] [data-form-message] { margin-top: 0.75rem; }

.subscription-reactivate-code {
  display: grid;
  gap: 0.5rem;
}

.subscription-reactivate-code .cart-breakdown-row[hidden] {
  display: none;
}

.subscription-reactivate-date {
  white-space: nowrap;
}

.subscription-reactivate-code label,
.subscription-reactivate-code .cart-promo-error,
.subscription-reactivate-code .cart-breakdown {
  margin: 0;
}

.subscription-table .subscription-actions-cell {
  width: 1%;
  text-align: end;
}

.creator-check-col {
  width: 1%;
  white-space: nowrap;
}

.creator-table-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--text-soft);
}

.creator-ops-title {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.creator-ops-title:hover,
.creator-ops-title:focus-visible {
  color: var(--accent);
}

.creator-ops-meta {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.874rem;
}

.creator-operations-panel {
  padding-top: 0.65rem;
}

.creator-operations-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.943rem;
}

.creator-operations-head strong {
  color: var(--text);
}

.creator-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.table-two-line {
  display: grid;
  gap: 0.1rem;
}

.table-two-line span {
  color: var(--text-muted);
  font-size: 0.874rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 0.874rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip-published {
  border-color: rgba(87, 199, 133, 0.36);
  color: #d6f5e2;
  background: rgba(87, 199, 133, 0.12);
}

.status-chip-scheduled {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.status-chip-draft,
.status-chip-hidden {
  border-color: rgba(152, 162, 173, 0.32);
  color: var(--text-muted);
}

/* SUB136 Draft subscriptions: hidden from everyone but the creator. */
.tier-status-badge.is-draft {
  border-style: dashed;
  color: var(--text-muted);
}

.creator-tier-ribbon.creator-tier-ribbon--draft,
.creator-profile-subscriptions .creator-tier-ribbon.creator-tier-ribbon--draft {
  background: #4a4b53;
  color: #fff;
}


/* ---- Unified Creator table system (#28) -------------------------------- *
 * One table look across every Creator page. Fixed layout + a <colgroup> give
 * deliberate, stable column widths; every data cell clips to one line via
 * .cell-clip except the explicit two-line Files/Updated cells. */
html.table-state-pending table {
  background-image: radial-gradient(circle, var(--accent, #7c6cff) 0 22%, transparent 24%);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  animation: table-loading-pulse 800ms ease-in-out infinite alternate;
}

html.table-state-pending table > * {
  visibility: hidden;
}

html.table-state-ready table {
  animation: table-ready-reveal 160ms ease-out;
}

@keyframes table-loading-pulse {
  to { background-size: 28px 28px; }
}

@keyframes table-ready-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html.table-state-pending table,
  html.table-state-ready table {
    animation: none;
  }
}

.app-table--fixed {
  table-layout: fixed;
}

.app-table--fixed col.col-status,
.app-table--fixed col.col-check {
  width: 34px;
}

/* The Creator content list shows a sortable "Status" heading and the status
   word itself, so it needs more than the shared 34px above (its width is set
   with the list's other columns below). .status-word is sized down to fit
   "Published"/"Scheduled". */

.creator-content-list-table .creator-content-status-col {
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  text-align: center;
}

.app-table--fixed col.col-actions {
  width: 80px;
}

.app-table--fixed col.col-tier {
  width: 20%;
}

.app-table--fixed col.col-arch {
  width: 18%;
}

.app-table--fixed col.col-files {
  width: 72px;
}

/* Downloads / Updated only take the width their data needs; the freed space
 * goes to Title and the wider Tier/Architecture columns (#28). */
.app-table--fixed col.col-updated {
  width: 132px;
}

.app-table .creator-tight-col {
  width: 34px;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
  text-align: center;
}

/* #41: same rule as .tier-name-cell above - kept off the <td> itself, applied
 * to an inner <span> so the row keeps a normal, shared cell height. */
.creator-row-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  width: auto;
}

/* #263: column-priority hiding. Applied by table.js to the <col>, the
 * <th> and every <td> of a column that had to be dropped so the row's
 * identifying column (Title/Name) stays visible while the page narrows. The
 * <col> is hidden too, otherwise the fixed-layout colgroup widths would shift
 * onto the wrong columns once a cell is removed. */
.col-priority-hidden {
  display: none !important;
}

.cell-clip {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Short labels (tier names) wrap onto a second line before they are cut. */
.cell-clip.cell-clip--lines {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.25;
}

/* SUB266 .row-details-* is the generic name (Ui::rowDetails), shared by
   Earnings > Transactions and Admin transactions.
   SUB258 Creator > Subscribers > Subscriber memberships. One compact line per
   row: subscription names with an expand button for their add-ons, dates
   coloured by what happens on them, and the status as the row's left edge
   (data-row-edge, app-workspace.css). */
.subscriber-memberships > .section-heading { align-items: center; }
/* SUB259 The dates the analytics count, under their heading. */
.creator-subscription-range { display: block; margin-top: 2px; color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
:is(.subscriber-tiers-line, .row-details-line) { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
:is(.subscriber-tiers-line, .row-details-line) > :is(.cell-clip, .creator-ledger-item) { flex: 0 1 auto; min-width: 0; }
:is(.subscriber-addons-toggle, .row-details-toggle) {
  display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
:is(.subscriber-addons-toggle, .row-details-toggle):is(:hover, :focus-visible) { border-color: var(--accent); color: var(--text); }
/* The id outranks the workspace's tall control size, as the button sits inside a dense row. */
#subscriber-memberships .subscriber-addons-toggle,
:is(#creator-ledger-transactions, #admin-ledger-transactions) .row-details-toggle { height: 22px; min-height: 22px; padding: 0; }
:is(.subscriber-addons-toggle, .row-details-toggle) svg { flex: 0 0 16px; width: 16px; height: 16px; fill: currentColor; transition: transform 0.16s ease; }
:is(.subscriber-addons-toggle, .row-details-toggle)[aria-expanded="true"] svg { transform: rotate(180deg); }
:is(.subscriber-addon-list, .row-details-list) { display: grid; gap: 0.15rem; max-width: 22rem; margin: 0.3rem 0 0.15rem; color: var(--text-muted); font-size: 0.78rem; line-height: 1.35; }
:is(.subscriber-addon-list, .row-details-list)[hidden] { display: none; }
:is(.subscriber-addon-list, .row-details-list) > div { display: flex; gap: 0.4rem; min-width: 0; }
:is(.subscriber-addon-list, .row-details-list) dt { flex: 0 0 auto; color: var(--text-soft, var(--text)); font-weight: 600; }
:is(.subscriber-addon-list, .row-details-list) dt::after { content: ":"; }
:is(.subscriber-addon-list, .row-details-list) dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
/* A narrow item column moves a value under its name instead of splitting a word. */
.row-details-list > div { flex-wrap: wrap; row-gap: 0; }
/* SUB298 An order of several items: its row shows every item's picture and the order's figures; a row
   per item under it shows the item's name and its share, opened and closed by the order's arrow. */
.ui-item-group { gap: 0.3rem; }
.ui-item-group-media { display: inline-flex; flex: none; }
.ui-item-group .row-details-toggle { margin-left: 0.3rem; }
tr.ledger-order-item.is-collapsed { display: none; }
tr.ledger-order-item > td.creator-ledger-column-item { padding-left: 1.75rem; }
.row-lines-head .row-details-line .ui-item { min-width: 0; }
.subscriber-addon-list .is-pending dt { color: #5fa8e0; font-weight: 600; }
.subscriber-date { white-space: nowrap; }
.subscriber-date.is-start { color: #57c785; }
.subscriber-date.is-renews { color: #86c8ff; }
.subscriber-date.is-expiring { color: #e8894a; }
.subscriber-date.is-ended { color: var(--text-muted); }
.subscriber-memberships-table td { white-space: nowrap; }
/* Table cells ignore max-width, so the add-on lines carry the limit and wrap. */
.subscriber-memberships-table td:nth-child(2) { white-space: normal; }

.architecture-abbreviations {
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Visually-hidden label (accessible to screen readers only). Was referenced by
 * every tight table header but never defined, so words like "Status"/"Select"
 * rendered visibly and overlapped the next header (#28). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Utility used by selects.js scope-visibility (discount/promo scope fields) but
 * never defined, so the Tier/Content fields stayed visible regardless of the
 * chosen scope (#28). */
.d-none {
  display: none !important;
}

.creator-row-check {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

/* Single-letter publish-status indicator in the 34px status column of the
   creator ops tables. */
.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 0.828rem;
  font-weight: 800;
}

.status-dot-published {
  border-color: rgba(87, 199, 133, 0.4);
  color: #d6f5e2;
  background: rgba(87, 199, 133, 0.14);
}

.status-dot-scheduled {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.status-dot-draft {
  border-color: rgba(152, 162, 173, 0.4);
  color: var(--text-muted);
}

.status-dot-hidden {
  border-color: rgba(225, 109, 119, 0.4);
  color: #ffbdc5;
  background: rgba(225, 109, 119, 0.12);
}

.status-dot-blocked {
  border-color: rgba(224, 82, 77, 0.55);
  color: #ffd7d4;
  background: rgba(224, 82, 77, 0.22);
}

/* Publish-status word in the content table's Status column. Plain text, no
 * badge or fill: the column is narrow, so the word is set small enough to fit
 * 72px on one line and the colour alone carries the state. */
.status-word {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--text-soft);
}

.status-word-published {
  color: #8fe0ae;
}

.status-word-scheduled {
  color: var(--accent-strong);
}

.status-word-draft {
  color: var(--accent-strong);
}

.status-word-hidden {
  color: #ffbdc5;
}

.status-word-blocked {
  color: #ff9d97;
}

/* #51: admin-blocked content - stronger red than "Hidden" since the creator
 * cannot reverse this themselves. */
.status-chip-blocked {
  border-color: rgba(224, 82, 77, 0.55);
  color: #ffd7d4;
  background: rgba(224, 82, 77, 0.22);
}

/* Gold icon inside any button; icon-only variant for compact row actions.
 * Buttons are always gold (.btn-primary) across the Creator workspace - silver
 * is no longer used as a style choice (#28). */
.btn-icon {
  display: inline-flex;
  align-items: center;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.btn .btn-icon {
  margin-right: 0.4rem;
}

.btn-icon-only {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.btn-icon-only .btn-icon {
  margin-right: 0;
}

.app-table--fixed col.col-price {
  width: 96px;
}

.app-table--fixed col.col-num {
  width: 96px;
}

/* Overview tier table (#41): Price/Subscribers/Revenue/Downloads need 20% more
 * room than the shared col-price/col-num so headers like "Subscribers" don't
 * overflow their cell and force a horizontal scrollbar. */
.app-table--fixed col.col-price-lg {
  width: 115px;
}

.app-table--fixed col.col-num-lg {
  width: 116px;
}

.app-table--fixed col.col-revenue {
  width: 112px;
}

/* Creator > Content: no min-width - the table fits its column, and when the
 * columns no longer do, table.js drops the least important ones (never
 * the Title). Each width is its heading's or its values' width, so every
 * default column fits at 1440px with a readable Title and no heading is cut
 * off. The headings are compact, as on Overview. */
.app-table.creator-content-list-table th,
.app-table.creator-content-list-table td {
  padding-right: 0.4rem;
  padding-left: 0.4rem;
}

.app-table.creator-content-list-table .creator-content-status-col,
.app-table.creator-content-list-table .creator-tight-col {
  padding-right: 0.3rem;
  padding-left: 0.3rem;
}

/* The sort button keeps the heading's size (the workspace's button rule
 * would make it a 0.9rem control). */
.creator-workspace .app-table.creator-content-list-table[data-sortable-table] thead th .creator-table-sort {
  min-height: 0;
  padding: 0;
  font-size: inherit;
}

.creator-content-list-table col.col-status {
  width: 66px;
}

.creator-content-list-table col.col-check {
  width: 28px;
}

.creator-content-list-table col.col-actions {
  width: 46px;
}

.creator-content-list-table col.col-version {
  width: 74px;
}

.creator-content-list-table col.col-tier {
  width: 102px;
}

.creator-content-list-table col.col-arch {
  width: 102px;
}

.creator-content-list-table col.col-files {
  width: 44px;
}

.creator-content-list-table col.col-num {
  width: 54px;
}

.creator-content-list-table col.col-revenue {
  width: 62px;
}

.creator-content-list-table col.col-storage {
  width: 70px;
}

.creator-content-list-table col.col-bandwidth {
  width: 82px;
}

.creator-content-list-table col.col-updated {
  width: 140px;
}

.creator-content-list-table .creator-content-created-col,
.creator-content-list-table .creator-content-updated-col {
  white-space: nowrap;
}

.creator-overview-content-table col.col-num {
  width: 120px;
}

.creator-overview-content-table col.col-revenue {
  width: 132px;
}

.preview-remove-confirm .app-modal-body {
  width: min(520px, calc(100vw - 2rem));
}

.creator-category-table col.col-category-name {
  width: 32%;
}

/* Monetization Content Prices table (#41, #238). */
.creator-content-price-table {
  min-width: 1180px;
}

.creator-content-price-table col.col-title {
  width: 260px;
}

.creator-content-price-table col.col-age {
  width: 132px;
}

.creator-content-price-table col.col-tier {
  width: 220px;
}

.creator-content-price-table col.col-arch {
  width: 6.3%;
}

.creator-content-price-table col.col-price-fit {
  width: 120px;
}

.creator-content-price-table col.col-site-fee,
.creator-content-price-table col.col-stripe-fee {
  width: 88px;
}

.creator-content-price-table col.col-creator-result {
  width: 96px;
}

.creator-content-price-table col.col-num {
  width: 68px;
}

.creator-content-price-table col.col-revenue {
  width: 97px;
}

.app-table--fixed col.col-discounts {
  width: 170px;
}

.creator-content-price-table col.col-discounts {
  width: 102px;
}

.creator-content-price-table .price-breakdown-value {
  white-space: nowrap;
}

.creator-next-price-change {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.creator-next-price-change time {
  color: var(--accent-strong);
  font-weight: 600;
}

/* Extra breathing room above the Categories/Tiers filter chips (#28). */
.creator-filter-row-spaced {
  margin-top: 0.85rem;
}

/* Overview stat strip: one compact row, grouped by meaning (#28). */
.creator-overview-strip {
  padding: 0.7rem 0.85rem;
}

.creator-subscription-analytics {
  display: grid;
  gap: 1.25rem;
}

.creator-subscription-period label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.creator-subscription-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.creator-subscription-kpis article {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.creator-subscription-kpis span,
.creator-subscription-kpis small {
  color: var(--text-muted);
}

.creator-subscription-kpis strong {
  font-size: 1.35rem;
}

.creator-subscription-duration {
  display: grid;
  gap: 1rem;
}

.creator-subscription-bars {
  display: grid;
  gap: 0.75rem;
}

.creator-subscription-bars > div {
  display: grid;
  grid-template-columns: minmax(8rem, 0.7fr) minmax(12rem, 3fr) 3rem;
  align-items: center;
  gap: 0.75rem;
}

.creator-subscription-bars > div > div {
  height: 0.75rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-raised);
}

.creator-subscription-bars i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--accent-strong);
}

@media (max-width: 960px) {
  .creator-subscription-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .creator-subscription-kpis {
    grid-template-columns: 1fr;
  }

  .creator-subscription-bars > div {
    grid-template-columns: 1fr 2.5rem;
  }

  .creator-subscription-bars > div > div {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.creator-stat-strip {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.stat-group {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0 1.1rem;
  border-right: 1px solid var(--border);
}

.creator-stat-strip .stat-group:first-child {
  padding-left: 0;
}

.creator-stat-strip .stat-group:last-child {
  border-right: 0;
  padding-right: 0;
}

/* Equal-width stat cells within a group. Combined with flex-grow:<count> on the
 * group, every cell across the strip is the same width (#28). */
.stat-items {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.stat-group-label {
  color: var(--accent);
  font-size: 0.713rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.stat-num {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat-cap {
  color: var(--text-muted);
  font-size: 0.736rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Drag-to-reorder + inline auto-save tables for Tiers/Categories (#28). */
.app-table--fixed col.col-drag {
  width: 34px;
}

.app-table--fixed col.col-num-sm {
  width: 9%;
}

/* Tiers editor (#28): Name sized to its 60-char limit, Description grows to fill
 * the rest so nothing line-wraps and there is no horizontal scrollbar. */
.app-table--fixed col.col-tier-name {
  width: 190px;
}

/* Tiers table column widths (#41): Name is a 30-char limit widened 20%
 * (36ch); Price is 2x the previous 12ch. */
:root {
  --tier-name-col-w: 36ch;
  --tier-price-col-w: 24ch;
}

.app-table--fixed col.col-tier-name-fit {
  width: var(--tier-name-col-w);
}

.app-table--fixed col.col-tier-price-fit {
  width: var(--tier-price-col-w);
}

.app-table--fixed col.col-desc-grow {
  width: auto;
}

.tier-editor-table col.col-actions {
  width: 290px;
}

.tier-editor-table .tier-actions-col {
  width: 290px;
  min-width: 290px;
  white-space: nowrap;
  text-align: right;
}

/* SUB156 Actions line up in every row: right-aligned, Publish and Unpublish the same width. */
.tier-editor-table .tier-actions-col .creator-row-actions {
  justify-content: flex-end;
}

.tier-editor-table .tier-publish-btn {
  min-width: 7.5rem;
  justify-content: center;
}

.tier-editor-table .tier-action-slot {
  display: inline-block;
  flex: 0 0 auto;
  width: 2.125rem;
}

.tier-editor-table tr.is-disabled td {
  color: color-mix(in srgb, var(--danger) 82%, var(--text));
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.tier-editor-table tr.is-disabled td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.tier-editor-table tr.is-disabled .tier-status-badge.is-expiring {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 58%, transparent);
}

/* Content Files table (#48): Status halved, Version narrowed 40%, Precision
 * widened 15% off the shared 190px col-tier-name base; the freed width flows
 * to the auto-width File column. */
.app-table--fixed col.col-file-version {
  width: 114px;
}

.app-table--fixed col.col-file-precision {
  width: 219px;
}

.app-table--fixed col.col-file-status {
  width: 95px;
}

/* Upload progress as a real bar, not text (#48) - the Status column is too
 * narrow for "Uploading… NN%" as text (it just clipped to "Uploadin…"); a
 * thin bar plus a short "NN%" label reads fine at any width. */
.file-status-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.file-status-label {
  font-size: 0.92rem;
}

.file-status-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.file-status-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s ease;
}

/* Aggregate progress for a whole upload section (#144) - one bar for every
 * file in the section, weighted by bytes, plus live speed and ETA. Rendered
 * by CreatorDashboardPageView::renderUploadTotalsBar for both Files and
 * Previews, so this styling is shared too. */
.upload-totals {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

/* Bar and its Pause/Resume control share one row - the control belongs beside
 * the progress it acts on (#144). */
.upload-totals-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.upload-totals-row .upload-totals-track {
  flex: 1 1 auto;
}

.upload-totals-toggle {
  flex: 0 0 auto;
}

.upload-totals.is-paused .upload-totals-fill {
  background: var(--text-muted);
}

[data-pause-queued-file][hidden],
[data-resume-queued-file][hidden],
[data-queued-file-retry][hidden],
[data-remove-queued-file][hidden],
[data-upload-totals-toggle][hidden] {
  display: none;
}

/* Sizes stay on one line (#144). They read left, under the Size heading,
 * like the numbers in the site's other creator tables. */
.file-size-cell {
  white-space: nowrap;
}

.upload-totals-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.upload-totals-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.upload-totals-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-size: 0.92rem;
  opacity: 0.85;
}

.upload-totals.is-error .upload-totals-fill {
  background: var(--danger, #d9534f);
}

.upload-totals.is-error .upload-totals-meta {
  opacity: 1;
}

/* #41: this must never be set directly on a <td> - display:flex on a table
 * cell breaks the browser's row-height coordination and forces an anonymous
 * wrapper box around it (looked like a boxed element nested inside the Name
 * column). Always applied to an inner <span> instead. */
.tier-name-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Profile editor layout (#28): Display name beside the avatar, Description on its
 * own row, Save in a normal action row. */
.creator-profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.creator-profile-identity {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  width: 100%;
}

.creator-profile-name-field {
  flex: 1 1 auto;
  min-width: 0;
}

.creator-profile-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.creator-avatar-field {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.creator-avatar-uploader {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.creator-avatar-uploader .creator-avatar-frame {
  width: 128px;
  height: 128px;
}

.creator-avatar-pick {
  width: 128px;
  justify-content: center;
  white-space: nowrap;
}

/* Small fitted creator avatar in the bottom-left identity row. */
.sidebar-avatar-wrap {
  overflow: hidden;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}

.sidebar-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
}

.drag-handle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.drag-handle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.creator-reorder-table tr.is-dragging {
  opacity: 0.55;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Hidden host forms whose controls live in the table rows via the `form`
 * attribute (lets a row's inputs auto-save without a Save button). */
.creator-row-forms {
  display: none;
}

.form-control-sm {
  min-height: 34px;
  padding: 0.35rem 0.5rem;
  font-size: 0.977rem;
}

.inline-price {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.inline-price .currency-prefix {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.inline-price-input {
  width: 100%;
  min-width: 0;
}

.inline-price .creator-price-input {
  width: 5rem;
  min-width: 0;
  flex: 0 0 auto;
}

.inline-suffix {
  color: var(--text-muted);
  font-size: 0.874rem;
  white-space: nowrap;
}

/* Profile editor: two-up fields + a non-interactive live card preview (#28). */
.creator-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

@media (max-width: 720px) {
  .creator-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.creator-card-preview {
  pointer-events: none;
}

.status-card {
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.status-card h2 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.status-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.943rem;
}

.status-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.creator-payment-terms {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.creator-payment-terms strong {
  color: var(--text);
}

.creator-price-list,
.mini-list {
  display: grid;
  gap: 0.55rem;
}

.creator-price-list-head,
.creator-price-row,
.mini-list-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(100px, 0.6fr) minmax(130px, 0.7fr) minmax(110px, 0.45fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.creator-price-list-head {
  color: var(--text-muted);
  font-size: 0.828rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: transparent;
}

.creator-price-input {
  width: 5rem;
  min-width: 0;
}

.creator-price-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.creator-price-cell [data-form-message] {
  min-width: 0;
}

.currency-prefix {
  color: var(--text-muted);
  font-size: 0.828rem;
  font-weight: 700;
}

.mini-list-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.mini-list-row p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.897rem;
}

.creator-form-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.creator-form-wide {
  grid-column: 1 / -1;
}

.compact-empty {
  padding: 1rem;
}

.creator-editor-workspace {
  gap: 0.85rem;
}

.creator-editor-form {
  display: block;
}

.creator-editor-grid {
  display: block;
}

.creator-editor-main {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

.creator-editor-panel {
  padding: 0.8rem;
}

.creator-editor-panel .section-heading {
  margin-bottom: 0.55rem;
}

.creator-editor-panel .section-heading h2 {
  font-size: 1rem;
}

.creator-editor-panel .section-heading p {
  font-size: 0.943rem;
}

.creator-editor-fields {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(130px, 0.7fr) minmax(160px, 0.85fr) minmax(160px, 0.85fr) minmax(130px, 0.65fr);
  gap: 0.65rem;
  align-items: end;
}

.creator-editor-form .creator-editor-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.creator-editor-top-fields,
.creator-release-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: start;
}

.creator-editor-top-fields {
  margin-bottom: 0.85rem;
}

.creator-editor-top-fields .form-select,
.creator-editor-top-fields .form-control,
.creator-editor-top-fields .creator-editor-price-field {
  width: 100%;
  max-width: none;
}

.creator-template-chooser {
  display: grid;
  width: 100%;
  gap: 0.35rem;
  padding: 1rem;
}

.creator-template-chooser p {
  margin: 0;
  color: var(--text-muted);
}

.creator-template-chooser .form-select {
  width: 100%;
  max-width: none;
}

.creator-editor-description-field {
  grid-column: 1 / -1;
  min-width: 0;
}

.creator-description-panel .section-heading {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.creator-template-save-panel,
.creator-release-panel {
  min-width: 0;
}

.creator-template-save-panel .creator-template-panel {
  align-items: stretch;
}

.creator-template-actions {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.creator-template-existing-label {
  margin: 1rem 0 0.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.creator-template-existing-names {
  margin: 0;
  padding-left: 1.25rem;
}

.creator-template-existing-names li + li {
  margin-top: 0.3rem;
}

.creator-editor-field-wide {
  grid-column: 1 / -1;
}

.creator-editor-price-field {
  width: 100%;
  max-width: 12rem;
}

/* Files table on Add Content and Edit content. File takes what the other
 * columns leave. Each other column has a floor that fits its heading and its
 * longest usual value (a select showing "INT8_CONVROT"), and a share of the
 * table, so on wide screens File stays at about 40%. The share is in cqw of
 * the wrapper because a fixed table layout ignores widths that mix a length
 * with a percentage. When even the floors do not fit, column priority hides
 * Bandwidth, then Downloads. */
.creator-file-table-wrap {
  container-type: inline-size;
}

.creator-file-metadata-table {
  --creator-file-text-inset: calc(0.65rem + 0.7rem + 1px);
  table-layout: fixed;
}

.creator-file-metadata-table col.creator-file-col-size {
  width: max(6rem, 6cqw);
}

.creator-file-metadata-table col.creator-file-col-downloads {
  width: max(8.75rem, 7.5cqw);
}

.creator-file-metadata-table col.creator-file-col-bandwidth {
  width: max(8.5rem, 7.5cqw);
}

.creator-file-metadata-table col.creator-file-col-type {
  width: max(9rem, 9cqw);
}

.creator-file-metadata-table col.creator-file-col-architecture {
  width: max(8.25rem, 9cqw);
}

.creator-file-metadata-table col.creator-file-col-precision {
  width: max(11.25rem, 11cqw);
}

.creator-file-metadata-table col.creator-file-col-upload {
  width: max(5.5rem, 7.5cqw);
}

.creator-file-metadata-table col.creator-file-col-actions {
  width: 2.75rem;
}

/* Add Content has no Downloads or Bandwidth, so its columns take more of the
 * table to keep File at the same share. */
[data-editor-mode="create"] .creator-file-metadata-table col.creator-file-col-size {
  width: max(6rem, 9cqw);
}

[data-editor-mode="create"] .creator-file-metadata-table col.creator-file-col-type,
[data-editor-mode="create"] .creator-file-metadata-table col.creator-file-col-architecture {
  width: max(9rem, 12cqw);
}

[data-editor-mode="create"] .creator-file-metadata-table col.creator-file-col-precision {
  width: max(11.25rem, 14cqw);
}

[data-editor-mode="create"] .creator-file-metadata-table col.creator-file-col-upload {
  width: max(6.5rem, 10cqw);
}

/* Headings and plain values start where the text inside the inputs and
 * selects starts, so every label sits over its column's content. Numbers
 * read left like the site's other creator tables. */
.creator-file-metadata-table thead th {
  vertical-align: top;
}

.creator-file-metadata-table thead th:not(.creator-tight-col),
.creator-file-metadata-table .file-size-cell,
.creator-file-metadata-table .creator-file-text-cell {
  padding-left: var(--creator-file-text-inset);
}

/* The sort button the column sorter puts in each heading: no inset of its
 * own, and only a line tall so a column total sits right under its label. */
.creator-file-metadata-table thead .creator-table-sort {
  min-height: 0;
  padding: 0;
}

.creator-file-metadata-table .file-size-cell,
.creator-file-metadata-table .creator-file-text-cell {
  font-variant-numeric: tabular-nums;
}

.creator-file-metadata-table thead th[data-file-total-text]::after {
  content: attr(data-file-total-text);
  display: block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
}

.creator-editor-technical-fields {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  margin-bottom: 0.75rem;
}

/* Date/time inputs open their native picker when the field is clicked. */
.input-with-picker {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.input-with-picker .form-control {
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.creator-release-schedule input[type="date"],
.creator-release-schedule input[type="time"] {
  color-scheme: dark;
}

.creator-release-schedule input[type="date"]::-webkit-calendar-picker-indicator,
.creator-release-schedule input[type="time"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
  opacity: 0.9;
  cursor: pointer;
}

.creator-file-architecture-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-top: 0.2rem;
  font-size: 0.78rem;
}

.creator-pricing-filters,
.creator-pricing-bulk {
  align-items: end;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.creator-pricing-card,
.creator-pricing-control-card,
.creator-pricing-rule-card {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.creator-pricing-card {
  padding: 1rem;
}

.creator-pricing-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.creator-pricing-control-card,
.creator-pricing-rule-card {
  padding: 0.85rem;
}

.creator-pricing-control-card h3 {
  margin-bottom: 0.75rem;
}

.creator-pricing-rule-card + .creator-pricing-rule-card {
  margin-top: 0.75rem;
}

.creator-pricing-rule-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  font-weight: 650;
}

.creator-pricing-rule-details > summary span:last-child {
  color: var(--muted);
  font-weight: 500;
}

.creator-pricing-rule-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  padding-top: 0.65rem;
}

.creator-pricing-rule-top {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(16rem, 32rem) 7rem;
  gap: 0.75rem;
}

.creator-pricing-rule-body .table-responsive,
.creator-pricing-rule-body .permission-actions {
  grid-column: 1 / -1;
}

.creator-pricing-conditions th:first-child,
.creator-pricing-conditions td:first-child {
  width: 3.5rem;
  text-align: center;
}

.creator-pricing-conditions th:last-child,
.creator-pricing-conditions td:last-child {
  width: 7rem;
}

.creator-pricing-conditions th,
.creator-pricing-conditions td {
  padding: 0.4rem 0.55rem;
}

.creator-pricing-conditions .form-control,
.creator-pricing-conditions .form-select {
  min-height: 2rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.creator-pricing-condition-value,
.creator-pricing-percent {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.creator-pricing-condition-value .form-control {
  width: 7rem;
}

.creator-pricing-condition-value .form-select {
  width: 7.5rem;
}

.creator-pricing-percent .form-control {
  width: 5.5rem;
}

.creator-pricing-logic-note {
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .creator-pricing-control-grid,
  .creator-pricing-filters,
  .creator-pricing-bulk {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-pricing-rule-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-pricing-rule-top {
    grid-template-columns: minmax(0, 1fr) 7rem;
  }
}

/* An empty model's editor (SUB-45) keeps the per-version panels hidden. */
.creator-editor-panel[hidden] {
  display: none;
}

/* Merge Versions (SUB-45): models as folders with their versions under them. */
dialog[data-modal].app-modal-wide.merge-versions-modal {
  width: min(980px, calc(100vw - 2rem));
}

.merge-tree-help {
  margin: 0 0 0.75rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.merge-tree-search {
  margin-bottom: 0.75rem;
}

.merge-tree-wrap {
  max-height: 60vh;
  overflow: auto;
}

.merge-tree-table col.merge-tree-col-status {
  width: 7rem;
}

.merge-tree-table col.merge-tree-col-date {
  width: 7.5rem;
}

.merge-tree-table col.merge-tree-col-sold {
  width: 4.5rem;
}

.merge-tree-table td {
  vertical-align: middle;
}

.merge-tree-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.merge-tree-child {
  padding-left: 1.6rem;
}

.merge-tree-folder {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--text-muted);
}

.merge-tree-folder svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.merge-tree-folder.is-open {
  color: var(--accent-strong);
}

.merge-tree-table .merge-tree-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 22rem;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.merge-tree-table .merge-tree-input:hover,
.merge-tree-table .merge-tree-input:focus {
  border-color: var(--border);
  background: var(--surface-raised);
}

.merge-tree-table .merge-tree-title {
  font-weight: 700;
}

.merge-tree-table .merge-tree-label {
  max-width: 9rem;
}

.merge-tree-count {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.merge-tree-model td {
  background: color-mix(in srgb, var(--surface-raised) 60%, transparent);
}

.merge-tree-model.is-drop-target td {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.merge-tree-version.is-moved td {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.merge-tree-table .merge-tree-model.is-empty .merge-tree-title {
  color: var(--text-muted);
}

.merge-tree-model-actions {
  text-align: right;
}

.merge-tree-new-model {
  margin-top: 0.6rem;
  padding: 0.7rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.88rem;
}

.merge-tree-new-model.is-drop-target {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* The table's drag handles are the only way to move a version, so they stay
 * visible in a narrow window too (other reorder tables swap them for buttons). */
@media (max-width: 720px) {
  .creator-reorder-table.merge-tree-table .drag-handle {
    display: inline-flex;
  }
}

.merge-tree-table th.merge-tree-sort {
  cursor: pointer;
  user-select: none;
}

/* Two models with the same title (Merge Versions). */
.merge-tree-model.is-duplicate td {
  background: rgba(214, 162, 79, 0.16);
}

.merge-tree-model.is-duplicate .merge-tree-title {
  color: #f0c27a;
}

.merge-tree-sort-versions {
  white-space: nowrap;
}

/* Version name, fixed width, in creator content tables (SUB-32). */
.creator-overview-content-table col.col-version {
  width: 6.5rem;
}

.creator-content-version-col {
  white-space: nowrap;
}

/* All versions monthly price, under the unlock price in the content editor. */
.creator-editor-family-price {
  margin-top: 0.85rem;
}

/* SUB161 Commercial Licence price: how it is priced, then the percent or the fixed price. */
.commercial-licence-price { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.commercial-licence-price > .form-select { flex: 1 1 200px; width: auto; min-width: 0; }
.commercial-licence-value { position: relative; display: inline-flex; align-items: center; flex: 0 0 120px; }
.commercial-licence-value > .form-control { width: 100%; padding-right: 30px; }
.commercial-licence-value > span { position: absolute; right: 11px; color: var(--text-muted); pointer-events: none; }
.commercial-licence-price:not(:has(option[value="percent"]:checked)) .commercial-licence-percent,
.commercial-licence-price:not(:has(option[value="fixed"]:checked)) .commercial-licence-fixed { display: none; }
.commercial-licence-setting .commercial-licence-price { margin-top: 10px; max-width: 520px; }
.commercial-licence-release { display: grid; gap: 6px; }
.commercial-licence-release > .form-label { margin: 0; }

/* SUB321 Subscribers > Followers: send an update to followers. Channel cards
   match the subscription KPI cards; the switch is the shared settings switch. */
.follower-update-panel > .section-heading {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
}

.follower-update-panel > .section-heading > div:first-child {
  align-self: center;
}

.follower-update-panel > .section-heading > [data-copy-text] {
  width: auto;
}

.follower-update-form {
  display: grid;
  gap: 0.75rem;
}

.follower-update-channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

/* SUB328 Trusted Creators: Send to, and the skip switch beside it. */
.follower-update-audience {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.5rem;
}

.surface-card.follower-update-audience {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-2);
}

.follower-update-audience-field {
  display: grid;
  gap: 0.35rem;
  flex: 0 1 18rem;
  min-width: 0;
}

.follower-update-audience-field .form-label {
  margin: 0;
}

.follower-update-skip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 38px;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  cursor: pointer;
}

.follower-update-skip .settings-switch {
  flex: none;
}

.follower-update-confirm-audience {
  margin: -0.5rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* The counts for a new Send to choice did not load: Send stays off until Retry loads them. */
.follower-update-reach-error {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.follower-update-reach-error[hidden] {
  display: none;
}

.follower-update-reach-error .btn {
  flex: none;
  width: auto;
}

/* Counts that do not belong to the current choice yet: loading, or failed to load. */
.follower-update-channels.is-stale .follower-update-reach {
  opacity: 0.45;
}

.follower-update-channel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.follower-update-channel:hover {
  border-color: var(--border-strong);
}

.follower-update-channel.is-checked {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.follower-update-channel.is-disabled {
  cursor: default;
  opacity: 0.6;
}

.follower-update-channel .settings-switch {
  flex: none;
  margin-left: auto;
}

.follower-update-channel-icon {
  display: inline-flex;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
}

.follower-update-channel-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.follower-update-channel-copy {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.follower-update-channel-label {
  font-weight: 600;
  color: var(--text);
}

.follower-update-reach,
.follower-update-allowance {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.follower-update-allowance.is-used-up {
  color: var(--warning);
}

.follower-update-form textarea {
  resize: vertical;
  min-height: 6rem;
}

.follower-update-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.follower-update-confirm-subject {
  margin: 0 0 0.75rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.follower-update-confirm-list {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.follower-update-confirm-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.follower-update-confirm-list li span:last-child {
  margin-left: auto;
  color: var(--text-muted);
}

.table-heading-icon {
  display: inline-flex;
  margin-right: 0.4rem;
  vertical-align: -0.15rem;
  color: var(--text-soft);
}

.follower-update-form [data-form-message]:empty {
  display: none;
}

.table-heading-icon svg {
  display: block;
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

@media (max-width: 720px) {
  .follower-update-channels {
    grid-template-columns: minmax(0, 1fr);
  }

  .follower-update-audience-field {
    flex-basis: 100%;
  }

  .follower-update-skip {
    justify-content: space-between;
    width: 100%;
  }

  .follower-update-reach-error {
    flex-basis: 100%;
    justify-content: space-between;
  }
}


/* Create and Edit Content actions live in the shared page header. */
.creator-editor-savebar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
}

.creator-editor-dirty-flag {
  margin-right: 0;
  font-size: 0.92rem;
  color: var(--accent-strong);
}

.compact-multiselect {
  min-height: 2.35rem;
}

/* Shared multi-select dropdown (#41): the enhanced <select multiple> stays in
   the DOM as the real form control but is visually hidden; .multiselect-toggle
   is the visible button and .multiselect-panel is the checklist popover. */
.multiselect-dropdown {
  position: relative;
}

.multiselect-source.multiselect-source {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.multiselect-toggle {
  width: 100%;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 2.2rem;
}

/* Higher specificity than the plain .form-select / .form-select:focus rules
   below (which set the `background` shorthand and would otherwise silently
   reset background-image back to none, hiding the arrow - #41). */
button.multiselect-toggle.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23a9b4c2' d='m12 15.4-6-6L7.4 8l4.6 4.6L16.6 8 18 9.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.1rem;
}

.multiselect-toggle.is-open {
  border-color: var(--accent-strong);
}

/* The panel is positioned with position:fixed by selects.js. It is appended to
   the active dialog when opened from a modal, or to body elsewhere. */
.multiselect-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  width: max-content;
  max-width: min(28rem, 90vw);
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 23, 31, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35);
}

.multiselect-actions {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.multiselect-actions[hidden] {
  display: none;
}

.multiselect-search,
.searchable-select-panel > .form-control {
  margin-bottom: 0.4rem;
}

.searchable-select-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
}

.searchable-select-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

/* SUB277 A listed option that cannot be chosen, such as a blocked country. */
.searchable-select-option[aria-disabled="true"] {
  color: var(--text-muted);
  cursor: default;
}

.searchable-select-option[aria-disabled="true"]:hover,
.searchable-select-option[aria-disabled="true"]:focus-within {
  background: transparent;
}

/* SUB277 The Blocked icon: a circle with a slash, after the option's name. */
.select-option-blocked {
  display: inline-block;
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  margin-left: auto;
  vertical-align: -0.15em;
  background: var(--danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20m0 2a8 8 0 0 1 6.3 12.9L7.1 5.7A8 8 0 0 1 12 4M5.7 7.1l11.2 11.2A8 8 0 0 1 5.7 7.1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20m0 2a8 8 0 0 1 6.3 12.9L7.1 5.7A8 8 0 0 1 12 4M5.7 7.1l11.2 11.2A8 8 0 0 1 5.7 7.1'/%3E%3C/svg%3E") center / contain no-repeat;
}

.multiselect-toggle .select-option-blocked {
  margin-left: 0.4rem;
}

.multiselect-list {
  max-height: min(60vh, 420px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.multiselect-option[hidden] {
  display: none;
}

.multiselect-option[data-locked-option] {
  cursor: default;
}

.multiselect-option:not([data-locked-option]):hover,
.multiselect-option:focus-within {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.multiselect-option input[type="checkbox"] {
  flex: none;
}

.user-select-trigger {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.user-select-modal .app-modal-body {
  display: grid;
  gap: 1rem;
  max-height: min(48rem, calc(100vh - 2rem));
}

.user-select-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 0.35fr);
  gap: 0.75rem;
}

.user-select-list {
  display: grid;
  gap: 0.25rem;
  max-height: min(55vh, 34rem);
  overflow-y: auto;
}

.user-select-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.user-select-option:hover,
.user-select-option:focus-within {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.user-select-option[hidden] {
  display: none;
}

.user-select-actions {
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .user-select-controls {
    grid-template-columns: 1fr;
  }
}

/* Required-field feedback (#41): no "Required" text badge - instead the field
 * name itself turns red plus the input gets a red border, only once the
 * creator has actually tried to publish with the field empty. */
[data-required-name].is-invalid {
  color: #e5484d;
}

[data-required-field].is-invalid {
  border-color: #e5484d;
}

/* Shared Add/Edit modal (#41): replaces the old inline "add a tier/category"
 * row that tried (and failed) to line its fields up with the table columns
 * below it. One native <dialog> per entity, reused for both create and edit. */
/* The CONTENT decides the width: min-content makes the dialog grow to fit rows
 * that cannot shrink (e.g. the price + fee breakdown row), min-width keeps the
 * comfortable 480px floor for plain forms, and max-width keeps it on screen.
 * Never go back to a fixed width - that is what clipped the Add Tier form. */
dialog[data-modal] {
  width: min-content;
  min-width: min(480px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* Wider variant for text-heavy dialogs (e.g. the Privacy/EULA modal, #50). */
dialog[data-modal].app-modal-wide {
  width: min(680px, calc(100vw - 2rem));
}

/* The page behind an open modal must not scroll. */
html:has(dialog[data-modal]:modal) {
  overflow: hidden;
}

dialog[data-modal]:modal {
  overscroll-behavior: contain;
}

dialog[data-modal]::backdrop {
  background: rgba(5, 7, 10, 0.65);
  backdrop-filter: blur(2px);
}

.app-modal-body {
  padding: 1.25rem;
}

.app-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.app-modal-head [data-modal-close][aria-label="Close"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 0;
  line-height: 1;
}

.app-modal-head [data-modal-close][aria-label="Close"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  background: currentColor;
  clip-path: polygon(11% 0, 50% 39%, 89% 0, 100% 11%, 61% 50%, 100% 89%, 89% 100%, 50% 61%, 11% 100%, 0 89%, 39% 50%, 0 11%);
  pointer-events: none;
}

dialog#cookie-modal {
  width: min(480px, calc(100vw - 2rem));
}

/* One settings window for content lists, purchases and the earnings ledger.
   Table borders, typography and corners come from the shared table rules. */
dialog[data-modal].screen-settings-window {
  width: min(780px, calc(100vw - 2rem));
  margin: 24px auto auto;
  max-height: calc(100dvh - 48px);
}
.screen-settings-window .app-modal-body { padding: 20px; }
.screen-settings-window .app-modal-head { gap: 20px; margin-bottom: 18px; }
dialog.screen-settings-window .app-modal-head h2 { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.25; letter-spacing: -.025em; }
.screen-settings-scroll { overflow: auto; max-height: calc(100dvh - 150px); }
.screen-settings-table { table-layout: auto; }
.screen-settings-table .screen-settings-control { width: 1%; text-align: center; }
.screen-settings-table .screen-settings-control input { width: 18px; height: 18px; margin: 0; vertical-align: middle; accent-color: var(--accent); cursor: pointer; }
.screen-settings-table .screen-settings-control select { width: 6.5rem; min-height: 38px; padding: 6px 24px 6px 10px; font-size: 15px; }
.screen-settings-table tbody th { width: 24%; font-weight: 600; }
.screen-settings-table label { display: block; margin: 0; cursor: pointer; }
.screen-settings-table .screen-settings-description { color: var(--text-muted); line-height: 1.45; }
.screen-settings-table tbody tr:nth-child(even) > * { background-color: color-mix(in srgb, var(--surface), var(--scheme-text) 3%); }
@media (max-width: 560px) {
  .screen-settings-window .app-modal-body { padding: 14px; }
  .screen-settings-table :is(th, td) { padding: 10px 8px; font-size: 14px; }
  .screen-settings-table tbody th { width: 28%; }
}

.app-modal-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.creator-autosave-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.workspace-status-strip-single {
  grid-template-columns: minmax(0, 1fr);
}

.section-heading-inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.creator-variable-head {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.5fr) auto;
  gap: 0.55rem;
  align-items: end;
}

.creator-category-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(260px, 1.6fr) auto auto;
  gap: 0.55rem;
  align-items: start;
}

.creator-tier-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(110px, 0.5fr) minmax(240px, 1.4fr) minmax(120px, 0.6fr) minmax(90px, 0.45fr) minmax(90px, 0.45fr) auto;
  gap: 0.55rem;
  align-items: start;
}

.creator-table-form {
  display: block;
}

.creator-variable-create {
  display: grid;
  gap: 0.65rem;
}

.creator-variable-head {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.creator-variable-head .form-control {
  max-width: none;
}

.creator-variable-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
}

.var-actions-col {
  width: 64px;
  white-space: nowrap;
  text-align: center;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
}

.var-actions-col .btn-icon-only + .btn-icon-only {
  margin-left: 0.2rem;
}

.creator-variable-table col.col-variable-name {
  width: 180px;
}

.creator-variable-table col.col-variable-body {
  width: auto;
}

.creator-variable-table col.col-variable-actions {
  width: 86px;
}

/* Mirrored highlight overlay behind a markdown textarea (#28): the textarea's
 * own text is transparent so the caret stays visible, while the div underneath
 * renders the identical text with unknown {variable} tokens wrapped in <mark>.
 * Font/padding/border must stay byte-identical between the two so wrapping
 * lines up exactly. */
.var-editor-wrap {
  position: relative;
}

.var-editor-wrap textarea {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--text);
}

.var-editor-wrap textarea::placeholder {
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.var-editor-highlight {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  pointer-events: none;
  color: var(--text);
}

.var-editor-highlight mark.var-unknown {
  background: rgba(220, 60, 60, 0.28);
  color: rgb(255, 120, 120);
  border-radius: 3px;
}

.var-insert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.var-insert-help {
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.var-insert-chip {
  font-size: 0.897rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
}

.var-insert-chip:hover {
  color: #fff;
  border-color: var(--accent-strong);
}

.body-preview-details {
  margin-top: 0.5rem;
}

.body-preview-details summary {
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.977rem;
}

.body-preview-content {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.body-preview-content:empty::before {
  content: "Nothing to preview yet.";
  color: var(--text-soft);
  font-size: 0.977rem;
}

.readonly-control {
  color: var(--text-soft);
}

/* No tickers anywhere. The up/down spinner on a number field is a browser
   default that never matched this interface and made every numeric input two
   pixels of hit target wider than the text in it; number fields are typed into,
   not nudged. This is global - `.no-spinner` is kept only so the existing
   markup that opts in explicitly still resolves. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

input[type="number"],
.no-spinner {
  -moz-appearance: textfield;
  appearance: textfield;
}

.dashboard-input-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.dashboard-input-actions-end {
  justify-self: end;
  align-self: start;
  align-items: flex-end;
  justify-content: flex-end;
  padding-top: 1.95rem;
}

.form-label-spacer {
  display: none;
}

.creator-inline-actions {
  min-height: 0;
  align-items: center;
}

.creator-inline-actions-end {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.promo-actions {
  display: flex;
  flex-direction: row;
  gap: 0.4rem;
  white-space: nowrap;
}

.promo-actions form {
  display: inline-flex;
  margin: 0;
}

.creator-action-icon {
  position: relative;
  flex: 0 0 auto;
}

.creator-action-icon[data-tooltip]:hover::after,
.creator-action-icon[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 20;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(17, 23, 31, 0.96);
  color: var(--text);
  font-size: 0.874rem;
  line-height: 1.2;
}

.action-hint {
  color: var(--text-soft);
  font-size: 0.977rem;
  line-height: 1.4;
  padding: 0.35rem 0.5rem;
}

.form-hint-right {
  text-align: right;
  margin: 0.4rem 0 0;
}

/* Inline "(n/max)" shown right after a form label (#41) - not a separate row
 * below the input. Rendered via Ui::labelWithCounter() everywhere a field has
 * a character limit. */
.field-counter {
  margin-left: 0.35rem;
  color: var(--text-muted);
  font-size: 0.897rem;
  font-weight: 500;
}

.field-counter.is-over {
  color: var(--danger);
}

.upload-item-error {
  color: #ffbdc5;
}

/* Plain page title that replaced the boxed creator-dashboard hero (#27). */
.workspace-title {
  margin: 0 0 1.1rem;
}

.workspace-title h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.metric-card {
  padding: var(--space-card);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

.metric-label {
  margin: 0 0 0.6rem;
  color: var(--text-soft);
  font-size: 0.874rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
}

.metric-value {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1;
  font-weight: 740;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

/* A card holding only its title row ends with it. */
.panel > .section-heading:only-child {
  margin-bottom: 0;
}

:is(.section-heading, .section-heading-inline, .creator-card-head, .tier-rules-section-head) > div:first-child {
  flex: 1;
  min-width: 0;
  align-self: stretch;
}

/* Heading + its count badge on one line (#151), reusing the sidebar badge pill
   so a count looks the same wherever it is shown. */
.section-heading-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Section titles (SUB78): bold titles in the text colour, sentence case. The
   accent stays reserved for state and action. */
.section-heading h2,
.panel h2,
.app-content h2 {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.02em;
}

.panel h3,
.app-content h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.01em;
}

.section-heading p {
  margin: 0.2rem 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* Previews box item-count/limit readout (#44), pinned to the same row as the
 * "Previews" heading via .section-heading's flex space-between. */
.creator-preview-limit-note {
  font-size: 0.943rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.creator-preview-limit-note.is-at-limit {
  color: var(--danger, #e0524d);
}

/* Cookie preferences modal (#43): shared dialog, opened from the cookie icon
 * next to Sign In / Create Account or the login checkbox - never a banner. */
.cookie-modal-text {
  margin: 0 0 0.85rem;
  font-size: 0.977rem;
  color: var(--text-soft);
}

.cookie-modal-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
}

.cookie-modal-option input {
  margin-top: 0.2rem;
}

.cookie-modal-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cookie-modal-option-desc {
  font-size: 0.92rem;
  color: var(--text-soft);
  font-weight: 400;
}

.cookie-modal-actions {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Privacy and site rules page. */
.privacy-page-list {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  font-size: 0.977rem;
  color: var(--text-soft);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.privacy-accepted-mark {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--success) 45%, transparent);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
  font-size: 0.86rem;
  font-weight: 700;
}

.privacy-agreements-section {
  display: grid;
  gap: 1rem;
}

.privacy-section-header h2,
.privacy-agreement-subtitle {
  margin: 0;
}

.privacy-agreement-grid {
  display: grid;
  gap: 1rem;
}

.privacy-agreement-card .creator-filter-card-head {
  align-items: flex-start;
  margin-bottom: 0.55rem;
}

.privacy-agreement-card .creator-filter-card-head h3,
.privacy-policy-card .creator-filter-card-head h2,
.privacy-data-export .creator-filter-card-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.3;
}

.creator-filter-card-head .privacy-accepted-mark {
  color: var(--success);
}

.privacy-agreement-subtitle {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.privacy-agreement-list,
.privacy-policy-list {
  display: grid;
  gap: 0.65rem;
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.privacy-policy-card .creator-filter-card-head,
.privacy-data-export .creator-filter-card-head {
  margin-bottom: 0.55rem;
}

.privacy-data-export p {
  margin: 0;
}

.privacy-agreement-body form,
.privacy-data-export form {
  margin-top: 0.7rem;
}

[data-show-when][hidden] {
  display: none;
}

.privacy-credit {
  margin: 0;
  font-size: 0.78rem;
  text-align: right;
}

.privacy-credit a {
  color: inherit;
}

/* Reads as a text link: beats the generic button padding and the mobile 44px button height. */
.privacy-policy-list .privacy-inline-link {
  display: inline;
  min-height: 0;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  vertical-align: baseline;
  color: var(--accent-strong);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.cookie-modal-message {
  font-size: 0.943rem;
  color: var(--danger, #e0524d);
}

.sidebar-card h2,
.sidebar-card h3,
.feed-card h3 {
  color: var(--accent);
  font-size: 0.92rem;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.home-main-heading,
.home-metric-heading,
.home-feature-heading {
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.home-feature-text {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-feature-tag {
  color: var(--accent);
  font-weight: 600;
}

/* Creator audience = gold, User audience = silver. (#14) */
.home-feature-tag--user {
  color: var(--silver);
}

/* Audience cards on the landing hero: gold for the creator side, silver for the
   user side. (#14) */
.home-aud-creator .metric-label,
.home-aud-creator .home-metric-heading {
  color: var(--accent);
}

.home-aud-user .metric-label,
.home-aud-user .home-metric-heading {
  color: var(--silver);
}

/* Full-width rule (page width minus the card padding), centered vertically
   between the Creator / User lines, and made more visible. (#14) */
.home-feature-divider {
  width: 100%;
  margin: 0.7rem 0;
  border: 0;
  border-top: 2px solid var(--accent);
  opacity: 0.75;
}

.feed-card {
  padding: var(--space-card);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

.feed-card + .feed-card {
  margin-top: 1rem;
}

.sidebar-card {
  padding: var(--space-card);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.empty-state {
  padding: var(--space-card);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: transparent;
}

.empty-state p:last-child {
  margin-bottom: 0;
}

/* ---- Buttons (visual refresh, SUB65) ------------------------------------
 * Main actions: a two-tone gradient from the active accent (--btn-a/--btn-b,
 * see app.css), a darker pressed bottom edge and a soft glow. Secondary
 * actions: solid graphite with the same pressed edge. Never outline-only.
 * The gradient is painted from the border box so the 1px transparent border
 * never shows a repeated sliver of the gradient (the old light left edge). */
.btn {
  --btn-disabled-tone: var(--btn-a);
  --btn-edge: color-mix(in srgb, var(--accent-deep) 80%, transparent);
  --btn-glow: color-mix(in srgb, var(--accent) 70%, transparent);
  background: var(--btn-fill) border-box;
  color: var(--btn-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.966rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 var(--btn-edge), 0 2px 0 rgba(0, 0, 0, 0.28), 0 10px 22px -14px var(--btn-glow);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease, background-color 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  filter: brightness(1.04);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 -1px 0 var(--btn-edge), 0 1px 0 rgba(0, 0, 0, 0.28), 0 6px 14px -10px var(--btn-glow);
}

.btn:disabled,
.btn.disabled {
  filter: none;
  opacity: 1;
  transform: none;
  cursor: default;
}

/* SUB178 The pressed button while it works: its request runs, or the page it
 * leads to is loading (forms.js setBusy). */
.btn.is-busy::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.45em;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-busy-spin 0.75s linear infinite;
}

.btn-icon-only.is-busy::before {
  margin-right: 0;
}

.btn-icon-only.is-busy .btn-icon {
  display: none;
}

@keyframes btn-busy-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn.is-busy::before {
    animation-duration: 1.5s;
  }
}

/* Page-specific disabled rules must not fade white labels and icons. */
:root :is(button, a):is(.btn, .creator-tier-disabled):is(:disabled, .disabled, [aria-disabled="true"]) {
  opacity: 1;
  background: color-mix(in srgb, var(--btn-disabled-tone, var(--btn-a)) 60%, var(--surface-raised)) border-box;
  filter: none;
  box-shadow: none;
  color: #fff;
}

:root :is(.btn-shine, .home-shimmer):is(:disabled, .disabled, [aria-disabled="true"])::after {
  display: none;
}

.btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

/* Monochrome button artwork follows its white label; keep hollow SVGs hollow. */
.btn svg {
  color: inherit;
}

.btn svg:not([fill="none"]),
.btn svg [fill]:not([fill="none"]) {
  fill: currentColor;
}

.btn svg[stroke]:not([stroke="none"]),
.btn svg [stroke]:not([stroke="none"]) {
  stroke: currentColor;
}

/* Compact tab buttons use the same white ink on their existing dark fills. */
:root :is(.creator-audience-tab, .creator-settings-tab, .admin-settings-tab, .admin-operations-tab, .messages-tab),
:root :is(.creator-audience-tab, .creator-settings-tab, .admin-settings-tab, .admin-operations-tab, .messages-tab).is-active,
:root :is(.creator-audience-tab, .creator-settings-tab, .admin-settings-tab, .admin-operations-tab, .messages-tab):is(:hover, :focus-visible, [aria-selected="true"]) {
  color: #fff;
}

/* Every button and link shows the hand cursor (#22). */
.btn,
button,
[role="button"],
a[href],
label.follow-toggle,
summary {
  cursor: pointer;
}

/* Main actions, including legacy class names that meant "filled". */
.btn-primary,
.btn-outline-light,
.btn-dark,
.btn.btn-key-action,
.btn.btn-dark.btn-key-action {
  background: var(--btn-fill) border-box;
  border-color: transparent;
  color: var(--btn-ink);
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-outline-light:hover,
.btn.btn-key-action:hover,
.btn.btn-key-action:focus-visible,
.btn.btn-key-action:active,
.btn.btn-dark.btn-key-action:hover,
.btn.btn-dark.btn-key-action:focus-visible,
.btn.btn-dark.btn-key-action:active,
.btn.btn-key-action:disabled {
  background: var(--btn-fill) border-box;
  border-color: transparent;
  color: var(--btn-ink);
}

.btn.btn-key-action {
  min-height: 44px;
  padding: 0.62rem 1.1rem;
  font-weight: 750;
}

/* Secondary actions: graphite, same pressed edge. */
.btn-secondary,
.btn-outline-secondary {
  --btn-disabled-tone: color-mix(in srgb, var(--surface-raised), white 7%);
  --btn-edge: rgba(0, 0, 0, 0.32);
  --btn-glow: transparent;
  background: color-mix(in srgb, var(--surface-raised), white 7%);
  border-color: transparent;
  color: var(--btn-ink);
}

.btn-secondary:hover,
.btn-secondary:focus-visible,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  background: color-mix(in srgb, var(--surface-raised), white 12%);
  border-color: transparent;
  color: var(--btn-ink);
  filter: none;
}

/* Status actions keep their meaning colours, with the same pressed edge. */
.btn-outline-warning,
.btn-warning {
  --btn-disabled-tone: var(--btn-warning);
  --btn-edge: rgba(0, 0, 0, 0.25);
  --btn-glow: transparent;
  background: var(--btn-warning);
  border-color: transparent;
  color: var(--btn-ink);
}

.btn-outline-danger,
.btn-danger {
  --btn-disabled-tone: var(--btn-danger);
  --btn-edge: rgba(0, 0, 0, 0.25);
  --btn-glow: transparent;
  background: var(--btn-danger);
  border-color: transparent;
  color: var(--btn-ink);
}

/* #51 Reports panel thumbsup/thumbsdown use the success variants. */
.btn-outline-success,
.btn-success {
  --btn-disabled-tone: var(--btn-success);
  --btn-edge: rgba(0, 0, 0, 0.25);
  --btn-glow: transparent;
  background: var(--btn-success);
  border-color: transparent;
  color: var(--btn-ink);
}

.btn-outline-success:hover,
.btn-warning:hover,
.btn-warning:focus-visible {
  filter: brightness(1.04);
}

/* Following: the graphite button with a white check. */
.btn.is-following {
  gap: 0.4rem;
  --btn-edge: rgba(0, 0, 0, 0.32);
  --btn-glow: transparent;
  background: color-mix(in srgb, var(--surface-raised), white 7%);
  border-color: transparent;
  color: var(--btn-ink);
}

.btn.is-following:hover,
.btn.is-following:focus-visible {
  background: color-mix(in srgb, var(--surface-raised), var(--danger) 16%);
  color: var(--btn-ink);
  filter: none;
}

.btn svg.follow-btn-check {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn.is-following:hover .follow-btn-check,
.btn.is-following:focus-visible .follow-btn-check {
  visibility: hidden;
}

/* Shimmer: only on a few key calls to action (btn-shine). */
.btn-shine {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn-shine::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 38%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: btn-shine 4.2s ease-in-out infinite;
}

@keyframes btn-shine {
  0%, 62% { left: -60%; }
  100% { left: 135%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-shine::after { animation: none; display: none; }
}

.btn-sm {
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  font-size: 0.966rem;
}

.poll-document-text {
  overflow-wrap: anywhere;
  margin-block: 1rem;
}

[data-poll-document] {
  gap: 0.5rem;
}

[data-poll-document] > .poll-document-text {
  margin-block: 0;
}

[data-poll-document] > .poll-document-text > :first-child {
  margin-top: 0;
}

[data-poll-document] > .poll-document-text > :last-child {
  margin-bottom: 0;
}

.poll-document-text img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.poll-document-text code {
  background: rgb(0 0 0 / 20%);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

.poll-document-text pre {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  background: rgb(0 0 0 / 20%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  padding: 1rem;
}

.poll-document-text pre code {
  background: none;
  padding: 0;
}

[data-poll-layout].markdown-composer {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

[data-poll-layout] .markdown-preview-pane {
  padding: 1rem;
}

.poll-question {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.poll-document-text [data-media-item] {
  cursor: pointer;
}

[data-poll-result-panel][hidden] {
  display: none;
}

.poll-question .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block: 0.5rem;
}

[data-poll-images] .preview-item {
  cursor: default;
}

[data-poll-images] .upload-item-thumb {
  cursor: pointer;
}

.page-shell .poll-card {
  --poll-state-color: var(--text-muted);
  border: 1px solid var(--poll-state-color);
  border-left: 4px solid var(--poll-state-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface);
}

.poll-card[data-poll-status="draft"] { --poll-state-color: var(--warning); }
.poll-card[data-poll-status="published"] { --poll-state-color: var(--border-strong); }
.page-shell .poll-draft-card {
  --poll-state-color: var(--border);
  border-left-width: 1px;
}

.page-shell .poll-card details.poll-draft-details {
  position: relative;
  display: block;
}

.poll-card .poll-draft-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 3.4rem;
  box-sizing: border-box;
  cursor: pointer;
}

.poll-card .poll-draft-details[open] > .poll-draft-header {
  padding-right: 26rem;
}

.poll-draft-header .poll-result-response-count {
  justify-self: end;
}

.poll-draft-details[open] > .poll-draft-toolbar {
  display: flex;
  position: absolute;
  top: 0;
  right: 0;
}

.poll-draft-card .poll-result-content {
  margin-top: 1rem;
}
.poll-card details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.poll-card details[open] {
  grid-template-columns: minmax(10rem, 1fr) auto auto;
}

.poll-card summary {
  display: contents;
  cursor: pointer;
}

.poll-result-title {
  min-width: 0;
  cursor: pointer;
}

.poll-result-title::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 0.45rem;
  font-size: 0.7em;
}

.poll-card details[open] .poll-result-title::before {
  transform: rotate(90deg);
}

.poll-result-response-count {
  grid-column: 2;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
}

.poll-card details[open] .poll-result-response-count {
  grid-column: 3;
}

.poll-result-toolbar {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.poll-result-toolbar label,
.poll-result-toolbar .button-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  flex-wrap: nowrap;
}

.poll-result-toolbar form {
  margin: 0;
}

.poll-result-toolbar [data-form-message] {
  display: none;
}

.poll-draft-toolbar .btn {
  font-weight: 400;
}

.poll-draft-toolbar {
  display: none;
}

.poll-result-content {
  grid-column: 1 / -1;
  margin-top: 1rem;
}

.page-shell .poll-results > .poll-card:nth-child(even) {
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
}

.poll-results [data-poll-result-panel] > section,
.poll-results [data-poll-result-panel="message"] {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.poll-results [data-poll-result-panel] > section:nth-child(odd) {
  background: color-mix(in srgb, var(--surface) 94%, var(--text) 6%);
}

.poll-results [data-poll-result-panel="message"] fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.page-shell .poll-editor-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface);
}

#poll-editor {
  gap: 1rem;
}

#poll-editor > .poll-editor-card {
  margin: 0;
  padding: 1rem;
  border-image: none;
  border-top-color: var(--border);
}

#poll-editor [data-poll-status]:empty,
#poll-editor [data-poll-images]:empty,
#poll-editor [data-form-message]:empty {
  display: none;
}

.message-poll-card {
  padding: 1rem;
}

.message-poll-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.message-poll-action p {
  flex: 1;
  margin: 0;
}

.poll-response-fields {
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
}

.poll-individual-audience .form-select {
  margin-top: 0.4rem;
}

.poll-response-fields .poll-document-text {
  margin: 0;
}

.poll-text-answer {
  position: relative;
}

.poll-text-answer .form-control {
  padding-right: 4rem;
}

.poll-text-answer textarea.form-control {
  padding-bottom: 1.75rem;
}

.poll-text-remaining {
  position: absolute;
  right: 0.75rem;
  bottom: 0.55rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.poll-text-answer input + .poll-text-remaining {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.message-poll-action .btn {
  margin-left: auto;
}

[data-poll-builder][hidden] { display: none; }

[data-poll-choice-settings][hidden],
[data-poll-text-settings][hidden] {
  display: none;
}

.poll-option-list {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.poll-answer-head {
  display: grid;
  grid-template-columns: minmax(0, 50%) auto;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.poll-answer-head .form-label {
  margin: 0;
}

.poll-answer-head .btn {
  justify-self: start;
}

.poll-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
}

.poll-option-row .form-control {
  max-width: none;
  border-radius: var(--radius-md);
}

[data-poll-composer] > .form-label,
[data-poll-builder]:not([hidden]) {
  display: block;
  margin-block: 1rem;
}

button:not(.btn),
input[type="button"]:not(.btn),
input[type="submit"]:not(.btn),
input[type="reset"]:not(.btn) {
  padding: 0.32rem 0.6rem;
}

button.price-fee-help {
  padding: 0;
}

.creator-workspace .creator-content-price-table col.col-creator-result {
  width: 128px;
}

@media (min-width: 1000px) {
  .creator-workspace .creator-content-price-table {
    width: 100%;
    min-width: 0;
  }

  .creator-workspace .creator-content-price-table col.col-title {
    width: auto;
  }

  .creator-workspace .creator-content-price-table col.col-status { width: 28px; }
  .creator-workspace .creator-content-price-table col.col-age { width: 7%; }
  .creator-workspace .creator-content-price-table col.col-tier { width: 11%; }
  .creator-workspace .creator-content-price-table col.col-arch { width: 44px; }
  .creator-workspace .creator-content-price-table col.col-price-fit { width: 100px; }
  .creator-workspace .creator-content-price-table col.col-site-fee,
  .creator-workspace .creator-content-price-table col.col-stripe-fee { width: 7%; }
  .creator-workspace .creator-content-price-table col.col-creator-result { width: 9%; }
  .creator-workspace .creator-content-price-table col.col-num { width: 5%; }
  .creator-workspace .creator-content-price-table col.col-revenue { width: 8%; }
  .creator-workspace .creator-content-price-table col.col-discounts { width: 9%; }

  .creator-workspace .creator-content-price-table :is(th, td) {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    white-space: normal;
    overflow-wrap: normal;
  }

  .creator-workspace .creator-content-price-table thead th {
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    font-size: 0.76rem;
    letter-spacing: 0;
    text-transform: none;
  }
}

.creator-fee-overview .creator-fee-overview-grid > div {
  grid-template-rows: min-content 1fr;
  align-content: start;
}

.form-label,
.auth-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text-muted);
  font-size: 0.828rem;
  font-weight: 500;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  font-size: 1.012rem;
  font-weight: 500;
  cursor: pointer;
}

.payment-connection-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}

.paypal-account-details {
  margin-block: 0.75rem;
}

.paypal-account-details > div {
  min-width: 0;
}

.paypal-connection-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.paypal-connection-actions .payment-connection-form,
.paypal-connection-actions > form {
  margin: 0;
}

.paypal-account-fields {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(0, 2fr);
  gap: 0.35rem 0.75rem;
}

.paypal-account-fields dt {
  font-weight: 600;
}

.paypal-account-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
  user-select: text;
}

@media (max-width: 560px) {
  .paypal-account-fields { grid-template-columns: 1fr; }
  .paypal-account-fields dd { margin-bottom: 0.5rem; }
}

.payment-connection-form .auth-checkbox-label {
  align-items: flex-start;
  margin: 0;
}

.payment-connection-form input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.form-control,
.form-select,
.input-group-text,
.auth-input {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--field);
  color: var(--text);
  font-size: 0.989rem;
  box-shadow: none;
}

/* ---- Field measure ------------------------------------------------------
 * A text field stretched across a 1200px column is a banner, not a control.
 * Every field keeps `width: 100%` so it still fills a narrow grid cell, but is
 * capped at a readable measure: --field-max for single-line controls,
 * --field-max-wide for the ones you actually compose in. The resets below are
 * the places where the surrounding layout already does the constraining and a
 * second cap would leave a ragged column. */
.form-control,
.form-select,
.auth-input {
  max-width: var(--field-max);
}

textarea.form-control,
.var-editor-wrap textarea,
.markdown-body textarea {
  max-width: var(--field-max-wide);
}

/* Table cells, price/inline rows, avatar+identity rows, dropdown panels and
   fixed-width grid columns size their own fields - let them. */
table .form-control,
table .form-select,
.app-table:where(:not(.app-table--loose)) .form-control,
.app-table:where(:not(.app-table--loose)) .form-select,
.creator-price-row .form-control,
.creator-price-row .form-select,
.inline-price .form-control,
.creator-row-forms .form-control,
.creator-row-forms .form-select,
.multiselect-panel .form-control,
.app-modal .form-control,
.app-modal .form-select,
.app-modal textarea.form-control,
.input-group > .form-control,
.input-group > .form-select,
.creator-editor-fields .form-control,
.creator-editor-fields .form-select,
.creator-editor-fields textarea.form-control,
.form-control-sm,
.creator-price-input,
.inline-price-input {
  max-width: none;
}

/* The search bar is a control too: it takes a measure and stops, instead of
   running the width of the page with the button pinned to the far edge. */
.creator-search-form {
  max-width: 34rem;
}

.form-control:hover,
.form-select:hover,
.auth-input:hover {
  border-color: var(--border-strong);
}

.auth-input {
  min-height: 36px;
}

.form-control::placeholder,
.auth-input::placeholder {
  color: var(--text-muted);
}

.form-control:focus,
.form-select:focus,
.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  background: var(--field);
  color: var(--text);
}

.input-group-text {
  width: auto;
  min-width: 74px;
  justify-content: center;
  color: var(--text-soft);
}

.alert {
  border-radius: 16px;
  padding: 0.95rem 1rem;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(87, 199, 133, 0.12);
  border-color: rgba(87, 199, 133, 0.24);
  color: #c8f0d7;
}

.alert-danger {
  background: rgba(225, 109, 119, 0.12);
  border-color: rgba(225, 109, 119, 0.24);
  color: #ffd0d5;
}

.alert-warning {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--accent-strong);
}

.tier-price-policy-card {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* The grid gap spaces the lines; paragraph margins would double it. */
.tier-price-policy-card > p {
  margin: 0;
}

.tier-price-policy-card,
.subscription-price-change-card {
  display: grid;
  gap: 0.45rem;
}

.subscription-price-change-card {
  margin: 0.35rem 0;
}

.subscription-price-change-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-start;
}

.subscription-price-change-actions form {
  display: grid;
  gap: 0.35rem;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: stretch;
}

.landing-actions,
.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

/* ===== Signed-out landing page ===== */
.public-landing-body {
  background:
    radial-gradient(circle at 84% 8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28rem),
    var(--bg);
}

.landing-main {
  width: 100%;
  overflow: hidden;
}

.landing-page {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 4rem;
}

.landing-kicker {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.72fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: 440px;
}

.landing-hero-copy h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.35rem, 3.8vw, 4rem);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-transform: uppercase;
}

.landing-hero-copy h1 span {
  display: block;
}

.landing-hero-copy h1 .landing-title-primary {
  color: var(--text);
  white-space: nowrap;
}

.landing-hero-copy h1 .landing-title-accent {
  color: var(--accent-strong);
}

.landing-lead {
  margin: 1.7rem 0 0;
  color: var(--text-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.7;
}

.landing-hero .landing-actions {
  margin-top: 2rem;
}

.landing-hero .landing-actions .btn,
.landing-final-cta .landing-actions .btn {
  min-height: 48px;
  padding: 0.75rem 1.25rem;
}

.landing-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.8rem;
  margin-top: 2.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.landing-proof span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.landing-proof span::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 65%, transparent);
  content: "";
}

.landing-proof strong {
  color: var(--text);
}

.landing-audiences {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 2.5rem;
}

.landing-audiences article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 0.35rem 1rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.landing-audiences .landing-kicker {
  grid-column: 1 / -1;
  margin-bottom: 0.2rem;
}

.landing-audiences h2,
.landing-audiences p {
  margin: 0;
}

.landing-audiences h2 {
  color: var(--text);
  font-size: 1.2rem;
}

.landing-audiences p:not(.landing-kicker) {
  grid-column: 1;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.landing-spotlight {
  position: relative;
  isolation: isolate;
  display: block;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  color: inherit;
  text-decoration: none;
  transform: rotate(1.5deg);
}

.landing-spotlight::before,
.landing-spotlight::after {
  position: absolute;
  z-index: -1;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  content: "";
}

.landing-spotlight::before {
  inset: 18px -15px -18px 15px;
  background: var(--surface);
  transform: rotate(-4deg);
}

.landing-spotlight::after {
  inset: 34px -28px -34px 28px;
  background: var(--chrome);
  transform: rotate(3deg);
}

.landing-release-spotlight {
  padding: 0;
  background: var(--chrome);
  transform: rotate(3deg);
}

.landing-release-spotlight::before {
  z-index: 0;
  transform: rotate(-7deg);
}

.landing-release-spotlight::after {
  display: none;
}

.landing-spotlight-front {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
  transform: rotate(-1.5deg);
}

.landing-spotlight-media,
.landing-spotlight-fallback {
  width: 100%;
  aspect-ratio: var(--release-media-ratio);
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--surface), var(--chrome));
}

.landing-spotlight-media img,
.landing-spotlight-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.landing-spotlight-fallback {
  display: grid;
  place-items: center;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing-spotlight-caption {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 0.55rem 0.5rem;
}

.landing-spotlight-caption span,
.landing-spotlight-caption small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.landing-spotlight-caption span {
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-spotlight-caption strong {
  color: var(--text);
  font-size: 1.25rem;
}

.landing-spotlight-label {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-circle-spotlight {
  min-height: 360px;
  display: grid;
  align-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
  transform: none;
}

.landing-circle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.landing-circle-creator {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  min-width: 0;
  color: var(--text);
  font-size: 0.82rem;
  text-align: center;
}

.creator-avatar-frame--landing-circle {
  width: 88px;
  height: 88px;
}

.landing-public-spotlight {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  transform: rotate(1deg);
}

.landing-public-spotlight .creator-gallery-card:first-child {
  grid-row: span 2;
}

.landing-public-spotlight .creator-gallery-media {
  aspect-ratio: var(--release-media-ratio);
}

.landing-public-spotlight .creator-gallery-media img,
.landing-public-spotlight .creator-gallery-media video {
  object-fit: cover;
}

.landing-spotlight-creator {
  min-height: 430px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.5rem;
}

.creator-avatar-frame--landing {
  width: 190px;
  height: 190px;
}

.landing-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(3rem, 7vw, 6rem);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.landing-benefits article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  padding: 2rem clamp(1.2rem, 2.5vw, 2.4rem);
}

.landing-benefits article + article {
  border-left: 1px solid var(--border);
}

.landing-benefit-number {
  color: var(--accent);
  font-size: 0.78rem;
}

.landing-benefits h2 {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 1.05rem;
}

.landing-benefits p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.landing-section {
  padding-top: clamp(3.5rem, 7vw, 6rem);
}

.landing-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.landing-section-heading h2,
.landing-control h2,
.landing-final-cta h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.landing-section-heading h2 {
  font-family: inherit;
  font-size: clamp(1.65rem, 2.6vw, 2.4rem);
  font-weight: 780;
}

.landing-text-link {
  padding-bottom: 0.3rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--text-soft);
  text-decoration: none;
  white-space: nowrap;
}

.landing-text-link:hover,
.landing-text-link:focus-visible {
  color: var(--accent-strong);
}

.landing-creator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.landing-creator-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-width: 0;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.landing-creator-card:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  background: var(--surface);
  transform: translateY(-3px);
}

.creator-avatar-frame--landing-card {
  width: 68px;
  height: 68px;
}

.landing-creator-card-copy {
  min-width: 0;
}

.landing-creator-card h3,
.landing-creator-card p {
  margin: 0;
}

.landing-creator-card h3 {
  font-size: 1rem;
}

.landing-creator-card h3 a,
.landing-creator-arrow {
  color: var(--text);
  text-decoration: none;
}

.landing-creator-card p,
.landing-creator-card span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.landing-creator-card span {
  display: block;
  margin-top: 0.35rem;
  color: var(--accent-strong);
}

.landing-creator-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.landing-release-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.landing-release-grid .creator-gallery-card {
  border-radius: 16px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.landing-release-grid .creator-gallery-card:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  transform: translateY(-4px);
}

.landing-release-grid .creator-gallery-media {
  aspect-ratio: var(--release-media-ratio);
}

.landing-release-grid .creator-gallery-media img,
.landing-release-grid .creator-gallery-media video {
  object-fit: cover;
}

.landing-release-caption-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.landing-release-caption-row p {
  margin: 0;
}

.landing-release-creator {
  flex: 1 0 auto;
  white-space: nowrap;
}

.landing-release-facts {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
  gap: 0.3rem;
  color: var(--text-soft);
  text-align: right;
  white-space: nowrap;
}

.landing-release-facts .architecture-abbreviations {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.landing-empty {
  padding: 2rem;
  border: 1px dashed var(--border-strong);
  border-radius: 15px;
  color: var(--text-soft);
  text-align: center;
}

.landing-empty p {
  margin: 0;
}

.landing-control {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: center;
  margin-top: clamp(5rem, 10vw, 9rem);
  padding: clamp(2rem, 5vw, 4.5rem);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 24px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 52%),
    var(--surface);
}

.landing-control p:not(.landing-eyebrow),
.landing-final-cta > p:not(.landing-eyebrow) {
  margin: 1.2rem 0 1.8rem;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.landing-control-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.landing-control-list span {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--chrome) 78%, transparent);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.landing-control-list span::before {
  color: var(--accent-strong);
  content: "\2713";
}

.landing-final-cta {
  display: grid;
  justify-items: center;
  padding: clamp(6rem, 12vw, 10rem) 1rem clamp(3rem, 7vw, 6rem);
  text-align: center;
}

.landing-final-cta > p:not(.landing-eyebrow) {
  margin-right: auto;
  margin-left: auto;
}

.landing-final-cta .landing-actions {
  justify-content: center;
}

@media (max-width: 1024px) {
  .sidebar-compact-toggle {
    display: none;
  }

  .landing-page {
    padding-top: 3.5rem;
  }

  .landing-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.68fr);
    gap: 2.5rem;
    min-height: 500px;
  }

  .landing-creator-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-release-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .site-header:not(.app-header) .site-header-actions {
    width: auto;
    margin-left: auto;
  }

  .site-header:not(.app-header) .site-header-actions .btn {
    width: auto;
  }

  .landing-page {
    width: min(100% - 24px, 620px);
    padding: 2.5rem 0 3rem;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .landing-hero-copy h1 {
    font-size: clamp(2.3rem, 10vw, 3.7rem);
  }

  .landing-hero-copy h1 .landing-title-primary {
    white-space: normal;
  }

  .landing-audiences {
    grid-template-columns: 1fr;
  }

  .landing-spotlight {
    width: min(88%, 420px);
    margin: 1rem auto 2rem;
  }

  .landing-benefits {
    grid-template-columns: 1fr;
  }

  .landing-benefits article + article {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .landing-section-heading {
    align-items: start;
    flex-direction: column;
  }

  .landing-release-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-control {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
}

@media (max-width: 520px) {
  .landing-creator-grid,
  .landing-release-grid,
  .landing-control-list {
    grid-template-columns: 1fr;
  }

  .landing-actions .btn {
    width: 100%;
  }

  .landing-proof {
    display: grid;
  }

  .landing-audiences article {
    grid-template-columns: 1fr;
  }

  .landing-audiences .btn {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .landing-circle-grid {
    grid-template-columns: 1fr;
  }
}

.creator-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}


/* Creator badge default size; each context sets its own size class. The
   badge itself is styled in app-badge.css. */
.creator-avatar-frame {
  position: relative;
  width: 84px;
  height: 84px;
}

.content-catalog {
  display: grid;
  gap: 0.9rem;
}

/* Release/gallery cards sit on a genuinely lighter surface than the page -
   at 3% white they were indistinguishable from the background. */
.creator-gallery-card {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.creator-gallery-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--release-media-ratio);
  height: auto;
  background: rgba(0, 0, 0, 0.2);
}

.creator-gallery-media img,
.creator-gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Creator > Content: what is not out on the page says so on the picture. */
.creator-gallery-status {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--btn-fill);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.creator-gallery-status--review { background: var(--warning); color: #1b1b1f; }
.creator-gallery-status--hidden { background: #3a3b42; color: #ffbdc5; }
.creator-gallery-status--blocked { background: var(--danger); }

/* A card's video marker takes the corner the status badge leaves free. */
.creator-gallery-media > .preview-play-badge {
  top: 10px;
  right: 10px;
  left: auto;
}

/* Updates feed states (#151). The feed carries the whole followed back
   catalogue, so an unread (NEW) card gets the list view's unread cue: an
   accent bar along its left edge (as thick as the row's inset bar) and a
   heavier title, plus a faint accent outline. Read cards stay plain. */
.creator-gallery-card.is-new {
  outline: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: -1px;
}

.creator-gallery-card.is-new::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 7;
  width: 3px;
  background: var(--accent);
  pointer-events: none;
}

.creator-gallery-card.is-new .creator-gallery-title {
  font-weight: 800;
}

.creator-gallery-date {
  margin-left: auto;
  padding-left: 0.5rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mark-read-all {
  margin: 0;
}

.purchase-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.purchase-card-actions details { flex-basis: 100%; }
.purchase-card-actions time { margin-right: auto; color: var(--text-muted); font-size: .8rem; }
.purchase-release-listing .creator-gallery-card { background: var(--surface-raised, var(--surface)); border: 1px solid var(--border); }
.purchase-card-actions .purchase-invoice-download { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 8px; border-radius: 8px; background: var(--surface-raised); color: #fff; }
.purchase-card-actions .purchase-invoice-download svg { width: 20px; height: 20px; fill: currentColor; }
.purchase-card-actions form { display: grid; gap: 10px; margin-top: 10px; }
.purchase-card-actions form label { display: grid; gap: 6px; }

.creator-price-badge-form {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 4;
}

/* Signed-out cards render the price as a direct link rather than a form.
   Keep that link in the same media-overlay position as the signed-in button. */
.creator-gallery-card > .creator-price-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 4;
}

.creator-price-badge-form [data-form-message] {
  display: none;
}

/* Price tags look the same on every card: the visitor's accent (--site-accent,
   app.css), never the creator's (SUB65). */
.creator-price-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0.25rem 0.55rem;
  border-radius: 7px;
  border: 0;
  background: color-mix(in srgb, var(--site-accent) 22%, rgba(11, 15, 20, 0.86));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--site-accent) 45%, transparent);
  color: color-mix(in srgb, var(--site-accent-strong) 80%, white);
  font-size: 0.874rem;
  font-weight: 800;
  text-decoration: none;
}

.creator-price-badge:hover,
.creator-price-badge:focus-visible {
  background: color-mix(in srgb, var(--site-accent) 34%, rgba(8, 12, 17, 0.9));
  color: #fff;
}

.creator-price-badge.is-free {
  background: color-mix(in srgb, var(--success) 18%, rgba(11, 15, 20, 0.86));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 40%, transparent);
  color: color-mix(in srgb, var(--success) 70%, white);
}

.creator-gallery-bar {
  display: grid;
  gap: 0.4rem;
  padding: 0.65rem 0.7rem;
  border-top: 1px solid var(--border);
  background: var(--chrome);
}

.creator-gallery-title {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
}

.creator-gallery-title a {
  color: inherit;
  text-decoration: none;
}

.creator-gallery-access {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.creator-gallery-access .creator-tier-badge {
  padding: 0.264rem 0.6rem;
  font-size: 0.948rem;
}

.creator-gallery-file-count {
  position: absolute;
  right: 0.55rem;
  bottom: 0.45rem;
  z-index: 2;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow:
    -1px -1px 0 #111,
    1px -1px 0 #111,
    -1px 1px 0 #111,
    1px 1px 0 #111;
}

.creator-content-visibility {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.2;
}

.creator-content-access-status {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.2;
}

.creator-content-access-status.is-unlocked {
  border-color: rgba(79, 195, 117, 0.55);
  background: rgba(79, 195, 117, 0.18);
  color: #95f1ac;
}

.creator-content-access-status.is-locked {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.creator-gallery-card.is-unlocked,
.content-is-unlocked {
  border-width: 2px;
  border-color: rgba(79, 195, 117, 0.55);
  box-shadow: 0 0 0 1px rgba(79, 195, 117, 0.16);
}

.creator-row.has-active-subscription .creator-cell-main {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 72%, transparent);
}

.creator-owned-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.48rem;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 20%, #15171b);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.unlocked-library-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.unlocked-library-filters label {
  display: grid;
  flex: 0 1 14rem;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.unlocked-library-filters .content-directory-invert-sort {
  flex: 0 0 auto;
}

/* The column picker sits at the end of the row, like on every listing. */
.unlocked-library-filters .content-directory-columns-button {
  width: auto;
  margin-left: auto;
  min-height: 40px;
  padding: 0 0.45rem;
  border-radius: 9px;
}

/* The purchases panel keeps the page's width, so the column priority can
   drop columns instead of the page growing sideways. */
.panel:has(> .table-responsive > .purchase-list-table) {
  min-width: 0;
}

/* Hidden columns stay hidden in the phone card layout too. */
.purchase-list-table [hidden] {
  display: none !important;
}

.purchase-new-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--btn-fill);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

.creator-gallery-taxonomy {
  display: flex;
  align-items: baseline;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.4;
}

.creator-gallery-action {
  margin: 0;
}

.creator-gallery-action .btn,
.creator-gallery-action-link {
  width: 100%;
}

.creator-content-detail {
  display: grid;
  gap: 0.45rem;
}

.creator-content-files-table-wrap {
  width: 100%;
  margin-top: 0.35rem;
  overflow-x: auto;
}

/* SUB-34: checkpoints of Flux content, listed below what is sold. */
.creator-content-files-support-heading {
  margin-top: 0.9rem;
}

.creator-content-files-table--grouped {
  table-layout: fixed;
}

.creator-content-files-table--grouped .creator-file-col-ext { width: 4.5rem; }
.creator-content-files-table--grouped .creator-file-col-type { width: 13%; }
.creator-content-files-table--grouped .creator-file-col-architecture { width: 17%; }
.creator-content-files-table--grouped .creator-file-col-precision { width: 11%; }
.creator-content-files-table--grouped .creator-file-col-size { width: 6.5rem; }
.creator-content-files-table--grouped .creator-file-col-actions { width: 8rem; }

.creator-content-files-table {
  width: 100%;
  min-width: 760px;
  margin: 0;
  table-layout: auto;
}

.creator-content-files-table th,
.creator-content-files-table td {
  vertical-align: middle;
}

.creator-content-files-table .creator-file-name {
  font: inherit;
  word-break: break-word;
}

.creator-file-mobile-metadata {
  display: none;
}

.creator-content-files-table .creator-file-ext-col {
  width: 1%;
  text-align: center;
  white-space: nowrap;
}

.creator-file-type-icon {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.creator-file-type-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.creator-content-files-table a.creator-file-name {
  text-decoration: underline;
}

.creator-content-files-table .creator-file-size-col,
.creator-content-files-table .creator-file-action-col {
  white-space: nowrap;
}

.creator-content-files-table .creator-file-action-col {
  width: 1%;
  text-align: right;
}

@media (max-width: 640px) {
  .creator-filter-bar {
    display: block;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .creator-filter-group {
    width: max-content;
    max-width: none;
    flex-wrap: nowrap;
  }

  .creator-filter-group--tiers {
    margin-top: 0.45rem;
    margin-left: 0;
    justify-content: flex-start;
  }

}

.creator-content-files-table .btn {
  min-height: 28px;
  padding: 0.3rem 0.55rem;
}

.creator-content-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.creator-content-preview-item {
  position: relative;
  aspect-ratio: var(--release-media-ratio);
  margin: 0;
  border-radius: 10px;
}

/* #51: reported-image highlight (admin/mod only) and the per-image report
 * flag button any signed-in viewer gets. An absolutely-positioned ::after
 * overlay (not an inset outline on the figure) so the full-bleed <img>/
 * <video> inside can never paint over it and hide it - including on hover,
 * where the item's opacity transition was making a plain inset outline
 * disappear (#51 third redesign: "the red border is hidden on mouseover"). */
.creator-content-preview-item.is-reported {
  border-radius: 8px;
}

.creator-content-preview-item.is-reported::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 3px var(--danger, #e0524d);
  pointer-events: none;
  z-index: 2;
}

.creator-content-preview-grid img,
.creator-content-preview-grid video {
  width: 100%;
  aspect-ratio: var(--release-media-ratio);
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
}

.creator-content-preview-item figcaption {
  margin: 0.4rem 0 0;
  color: var(--text-soft);
  font-size: 0.977rem;
  line-height: 1.4;
}

.creator-content-gallery-controls {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.creator-content-gallery-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.content-catalog-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0.95rem;
  align-items: start;
  padding: 0.85rem;
}

.content-catalog-thumb,
.content-catalog-thumb-link {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
}

.content-catalog-thumb {
  min-height: 120px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.content-catalog-thumb-media {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.content-catalog-thumb-fallback {
  width: 100%;
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.966rem;
}

.content-catalog-title {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: normal;
  text-transform: none;
}

.content-catalog-title a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-catalog-summary {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.content-card-taxonomy {
  margin: 0.55rem 0 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.content-tag-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
}

.content-tag-link:hover,
.content-tag-link:focus-visible {
  color: var(--accent-strong);
  border-bottom-color: color-mix(in srgb, var(--accent) 65%, transparent);
}

.taxonomy-divider {
  color: var(--text-muted);
}

.content-price-line {
  margin: 0.75rem 0 0;
  color: var(--text-soft);
}

.content-catalog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tier-follower-grid {
  display: grid;
  gap: 0.9rem;
}

.tier-follower-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.tier-follower-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: normal;
  text-transform: none;
}

.tier-follower-list {
  display: grid;
  gap: 0.34rem;
}

.tier-follower-link {
  display: inline-block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  text-decoration: none;
}

.tier-follower-link:hover,
.tier-follower-link:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 34%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 1.012rem;
}

.meta-pill-danger {
  background: rgba(224, 82, 77, 0.16);
  color: var(--danger, #e0524d);
}

.upload-dropzone {
  display: grid;
  grid-auto-flow: column;
  place-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 60px;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  text-align: center;
  cursor: pointer;
}

.upload-dropzone input[type="file"] {
  display: none;
}

.upload-dropzone.is-dragover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.preview-item {
  position: relative;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  /* The whole tile is the drag handle (#44): grab cursor everywhere on it,
     click still opens the lightbox (a plain click never fires dragstart). */
  cursor: pointer;
}

.preview-item:active {
  cursor: pointer;
}

.preview-item {
  aspect-ratio: var(--release-media-ratio);
}

.upload-item-tile {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.upload-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.upload-item-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  padding: 0.3rem;
  border-radius: 999px;
  border-color: rgba(255, 190, 190, 0.8);
  background: rgba(38, 14, 18, 0.86);
  color: #fff;
  line-height: 1;
}

.preview-item.is-dragging {
  opacity: 0.4;
}

/* Existing + newly-queued previews share one visual row: the two server/JS
 * containers stay separate elements (each still owns its own query scope),
 * but `display: contents` removes their own box so their <article> children
 * lay out directly in this grid instead of two stacked grids (#41). */
.creator-editor-preview-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.creator-editor-preview-gallery .preview-grid {
  display: contents;
}

.upload-item-progress {
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  bottom: 0.35rem;
  z-index: 2;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.805rem;
  text-align: center;
  pointer-events: none;
}

.video-preview-thumbnail {
  position: relative;
}

/* Remove the artwork before revealing the media so it cannot show through the fade or transparency. */
:root body .preview-placeholder {
  --preview-art-fallback: url("../images/preview-placeholder.jpg?v=8e657a4034b6");
  background-image: var(--preview-art-fallback);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

@supports (background-image: image-set(url("") type("image/webp"))) {
  :root body .preview-placeholder {
    --preview-art-full: url("../images/preview-placeholder-large.webp?v=5889d80ea764");
    --preview-art-standard: url("../images/preview-placeholder.webp?v=0e1be198918e");
    background-image: image-set(
      var(--preview-art-standard) 1x type("image/webp"),
      var(--preview-art-full) 2x type("image/webp"),
      var(--preview-art-fallback) 1x type("image/jpeg")
    );
  }

  :root body .media-lightbox-current.preview-placeholder {
    --preview-art-standard: var(--preview-art-full);
  }
}

:root body .preview-placeholder:has(> :is(.is-preview-ready, .video-preview-motion.is-playing)) {
  background-image: none;
}

.preview-placeholder > :is(img, video):not(.is-preview-ready, .video-preview-motion, .media-lightbox-swipe-incoming) {
  opacity: 0;
}

.preview-placeholder > .is-preview-ready.is-preview-fading:not(.media-lightbox-swipe-incoming) {
  animation: preview-image-reveal 180ms ease-out;
}

@keyframes preview-image-reveal {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .preview-placeholder > .is-preview-ready.is-preview-fading:not(.media-lightbox-swipe-incoming) {
    animation: none;
  }
}

.video-preview-motion {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
}

.video-preview-motion.is-playing {
  opacity: 1;
}

.preview-play-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  pointer-events: none;
}

.preview-play-badge::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
}

.preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-soft);
  font-size: 1.012rem;
  padding: 0.35rem 0.45rem;
}

.sidebar-list,
.plain-list {
  display: grid;
  gap: 0.55rem;
}

.plain-list {
  margin: 0;
  padding-left: 1.1rem;
}

.plain-list li {
  color: var(--text-soft);
  line-height: 1.6;
}

.settings-card {
  padding: var(--space-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.admin-user-row {
  padding: var(--space-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.admin-user-row:first-child {
  margin-top: 0;
}

.admin-user-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.admin-user-head h3 {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}

.admin-user-head p {
  margin: 0;
  color: var(--text-soft);
}

.admin-user-form-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) auto;
  justify-content: start;
  align-items: end;
  gap: 0.7rem;
}

.admin-user-form-row .form-select {
  max-width: 100%;
}
[data-sent-updates-list],
.sent-update {
  display: grid;
  gap: .75rem;
  overflow-wrap: anywhere;
}

.sent-update-channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .75rem 1rem;
}

.sent-update header p,
.sent-update-channel p {
  margin: .25rem 0 0;
  font-size: .875rem;
}

.sent-update-eta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  font-size: .875rem;
}

.sent-update-eta progress {
  width: min(100%, 8rem);
  accent-color: var(--accent);
}

/* SUB484 SUB485 Timing charts: share bars with the value above each, a smoothed trend line, Hour / Day / Month views. */
.timing-chart .section-heading p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.timing-chart-views {
  margin: 0.25rem 0 1rem;
}

.timing-chart-pane {
  display: none;
}

.timing-chart:has(input[value="hour"]:checked) [data-timing-view="hour"],
.timing-chart:has(input[value="day"]:checked) [data-timing-view="day"],
.timing-chart:has(input[value="month"]:checked) [data-timing-view="month"] {
  display: block;
}

.timing-chart-body {
  --timing-gap: clamp(0.2rem, 1.2vw, 0.9rem);
}

.timing-chart-plot,
.timing-chart-axis {
  display: grid;
  grid-template-columns: repeat(var(--timing-columns), minmax(0, 1fr));
  column-gap: var(--timing-gap);
}

.timing-chart-plot {
  position: relative;
  height: clamp(200px, 32vw, 300px);
  align-items: end;
  border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(to top, transparent 0 calc(33.333% - 1px), color-mix(in srgb, var(--border) 55%, transparent) calc(33.333% - 1px) 33.333%);
}

.timing-chart-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  min-width: 0;
  outline: none;
}

.timing-chart-bar {
  display: block;
  width: min(100%, 3.4rem);
  min-height: 0;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  transition: filter 0.15s ease;
}

.timing-chart-column:hover .timing-chart-bar,
.timing-chart-column:focus-visible .timing-chart-bar {
  filter: brightness(1.18);
}

.timing-chart-column:focus-visible {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.timing-chart-value {
  margin-bottom: 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
}

.timing-chart-trend {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.timing-chart-trend path {
  fill: none;
  stroke: #7aa7ff;
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.timing-chart-axis {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.timing-chart-axis span {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.timing-chart-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.timing-chart-legend i {
  display: inline-block;
  width: 1.4rem;
  border-top: 2px solid #7aa7ff;
}

@media (max-width: 720px) {
  .timing-chart-body.is-dense .timing-chart-value {
    display: none;
  }

  .timing-chart-body.is-dense .timing-chart-axis span:nth-child(even) {
    visibility: hidden;
  }

  .timing-chart-axis {
    font-size: 0.72rem;
  }

  .timing-chart-body.is-dense .timing-chart-axis span {
    overflow: visible;
  }
}


/* #51 follow-up: creator-wide moderation controls (suspend/lock) on each
 * creator's row in the Users panel, independent of any open report. */
.admin-creator-moderation {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.admin-creator-moderation form {
  margin: 0;
}

/* Reports list (#51 second redesign): just content title + open report
 * count, linking out to the per-content moderation page below - no status,
 * no inline actions here. */
.admin-reports-summary-table td {
  vertical-align: top;
}

.admin-reports-list {
  width: 100%;
  overflow: visible;
}

.admin-reports-summary-table {
  table-layout: fixed;
}

.admin-reports-summary-table th:last-child,
.admin-reports-summary-table td:last-child {
  width: 90px;
}

.admin-user-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(140px, 1fr)) max-content max-content;
  align-items: end;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 92%, var(--accent) 8%);
}

.admin-user-toolbar label {
  display: grid;
  gap: 0.25rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.admin-user-toolbar .form-control,
.admin-user-toolbar .form-select {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  background: var(--surface-raised, var(--surface));
}

.admin-user-status-control {
  display: grid;
  gap: 0.25rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.admin-user-status-filter {
  position: relative;
}

.admin-user-status-filter summary {
  list-style: none;
  cursor: pointer;
}

.admin-user-status-filter summary::-webkit-details-marker {
  display: none;
}

.admin-user-status-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  display: grid;
  gap: 0.4rem;
  width: max-content;
  min-width: 100%;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised, var(--surface));
  box-shadow: var(--shadow-md);
}

.admin-user-status-options label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  white-space: nowrap;
}

.admin-user-filter-check {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  align-self: center;
  gap: 0.45rem !important;
  cursor: pointer;
}

.admin-user-list-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.admin-user-list-heading h3 {
  margin: 0;
}

.admin-user-result-count {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-user-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

[data-admin-users] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.admin-section-users {
  overflow-x: hidden;
  overflow-x: clip;
}

.admin-users-table {
  --admin-user-name-width: 12%;
  width: 100%;
  min-width: 2000px;
  table-layout: fixed;
}

.admin-users-table td {
  overflow-wrap: normal;
}

.admin-users-table tbody td {
  white-space: nowrap;
}

.admin-users-table .admin-user-role-form [data-form-message]:empty {
  display: none;
}

.admin-users-table .admin-user-action-trigger {
  width: 32px;
  height: 32px;
}

.admin-users-table th[data-admin-column="creator"] {
  color: var(--warning);
}

/* The name column is pinned by the shared table (Table 'pinned' variant). */
.admin-users-table th:first-child,
.admin-users-table td:first-child {
  width: var(--admin-user-name-width);
  min-width: 0;
}

.admin-users-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-users-table .admin-user-sum-row > th,
.admin-users-table .admin-user-sum-row > td {
  border-bottom: 1px solid var(--border-strong);
  background: var(--table-total);
  font-weight: 700;
}

.admin-users-table th:last-child,
.admin-users-table td:last-child {
  width: 3.5%;
}

.admin-users-table .admin-user-number-col {
  text-align: center;
}

.admin-users-table .admin-user-money-col {
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  text-align: center;
}

.admin-users-table .admin-user-total-col {
  width: 6%;
  min-width: 5.5rem;
}

.admin-users-table .admin-user-date-col {
  white-space: nowrap;
}

.admin-users-table .admin-user-action-col {
  padding-inline: 0.35rem;
  text-align: center;
}

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) {
  width: 8.58%;
}

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) {
  width: 4.8%;
}

.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) {
  width: 6%;
}

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) {
  width: 6%;
}

.admin-users-table th:nth-child(6),
.admin-users-table td:nth-child(6) {
  width: 6%;
}

.admin-users-table th:nth-child(7),
.admin-users-table td:nth-child(7) {
  width: 6%;
}

.admin-users-table th:nth-child(8),
.admin-users-table td:nth-child(8) {
  width: 6.5%;
}

.admin-users-table th:nth-child(9),
.admin-users-table td:nth-child(9) {
  width: 6.5%;
}

.admin-users-table th:nth-child(10),
.admin-users-table td:nth-child(10) {
  width: calc(7% + 10px);
  white-space: nowrap;
}

.admin-users-table th:nth-child(11),
.admin-users-table td:nth-child(11) {
  width: 6%;
}

.admin-users-table th:nth-child(12),
.admin-users-table td:nth-child(12) {
  width: 6%;
}

.admin-users-table th:nth-child(13),
.admin-users-table td:nth-child(13) {
  width: 6%;
}

.admin-users-table th:nth-child(14),
.admin-users-table td:nth-child(14) {
  width: 6%;
}

.admin-users-table th:nth-child(15),
.admin-users-table td:nth-child(15) {
  width: 5.5%;
}

.admin-users-table th:nth-child(16),
.admin-users-table td:nth-child(16) {
  width: 4.8%;
}

.admin-user-name-link {
  display: block;
  overflow: hidden;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-name-link:hover,
.admin-user-name-link:focus-visible {
  color: var(--accent-strong);
}

.admin-user-sort {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.admin-user-header-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-height: 2.4em;
  overflow: hidden;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
}

.admin-user-number-col .admin-user-sort {
  justify-content: center;
  text-align: center;
}

.admin-user-sort:hover,
.admin-user-sort:focus-visible,
.admin-user-sort.is-active {
  color: var(--accent-strong);
}

.admin-user-sort-arrow {
  position: absolute;
  right: 0;
  display: none;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.admin-user-sort.is-active {
  padding-right: 0.75rem;
}

.admin-user-sort.is-active .admin-user-sort-arrow {
  display: block;
}

.admin-user-name-resizer {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 6;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.admin-user-name-resizer::after {
  position: absolute;
  top: 20%;
  right: 4px;
  width: 2px;
  height: 60%;
  border-radius: 2px;
  background: var(--border-strong);
  content: "";
}

.admin-user-name-resizer:hover::after,
.admin-user-name-resizer:focus-visible::after,
.admin-users-table.is-resizing-name .admin-user-name-resizer::after {
  background: var(--accent-strong);
}

th[aria-sort="ascending"] .admin-user-sort-arrow {
  border-bottom: 6px solid currentColor;
}

th[aria-sort="descending"] .admin-user-sort-arrow {
  border-top: 6px solid currentColor;
}

.admin-user-role-form .form-select {
  width: 100%;
  min-width: 0;
  padding-block: 0.25rem;
}

.admin-user-name-payment-ready,
.admin-user-name-payment-ready .admin-user-name-link {
  color: var(--warning);
}

.admin-user-name-company-owned,
.admin-user-name-company-owned .admin-user-name-link {
  color: #49c678;
}

.admin-user-report-link {
  color: #ff7171;
  font-weight: 700;
  text-decoration: underline;
}

.admin-user-report-link:hover,
.admin-user-report-link:focus-visible {
  color: #ff9a9a;
}

.admin-user-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: 0.45rem !important;
  color: var(--text-soft) !important;
  font-weight: 400;
}

.admin-user-check input {
  margin-top: 0.15rem;
}

.admin-user-reason {
  display: grid;
  gap: 0.4rem;
}

.admin-users-table tr[hidden] {
  display: none;
}

.admin-account-closures {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.admin-account-closure {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--scheme-panel);
}

.admin-account-closure > header,
.admin-account-closure-counts,
.admin-account-closure-actions,
.admin-termination-audiences {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.admin-account-closure > header {
  justify-content: space-between;
}

.admin-account-closure h3,
.admin-account-closure p {
  margin: 0;
}

.admin-account-closure-counts {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.admin-account-closure-actions {
  align-items: end;
}

.admin-account-closure-actions > form {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.termination-preset-row {
  display: grid;
  grid-template-columns: minmax(12rem, 0.38fr) minmax(24rem, 1fr) auto;
  align-items: start;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.termination-preset-row label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.termination-preset-row textarea {
  min-height: 8rem;
  resize: vertical;
}

.termination-preset-row [data-termination-preset-remove] {
  margin-top: 1.65rem;
}

dialog[data-modal].termination-presets-modal {
  width: min(960px, calc(100vw - 2rem));
}

.termination-presets-modal .app-modal-body {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.termination-presets-modal [data-termination-preset-list] {
  display: grid;
  gap: 0.25rem;
}

.admin-user-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.admin-user-card-grid > .panel {
  margin: 0;
}

.admin-user-broadcast form {
  display: grid;
  gap: 0.75rem;
}

/* #434 Free access section in the per-user Actions modal. */
.admin-user-grant-list {
  display: grid;
}

.admin-user-grant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.admin-user-grant-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-user-actions-content .admin-user-grant-row .btn-danger {
  flex: none;
  width: auto;
}

.admin-user-grant-add {
  display: grid;
  gap: 0.4rem;
}

.admin-user-grant-target {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}

.admin-user-grant-target-label {
  flex-basis: 100%;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-user-grant-target [data-admin-grant-target-label] {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.admin-user-grant-add .btn-primary {
  justify-self: start;
}

.admin-user-broadcast .btn {
  justify-self: start;
}

@media (max-width: 720px) {
  .admin-user-card-grid {
    grid-template-columns: 1fr;
  }

  .termination-preset-row {
    grid-template-columns: 1fr;
  }

  .termination-preset-row [data-termination-preset-remove] {
    margin-top: 0;
    justify-self: start;
  }
}

.admin-overview {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.admin-overview-activity-panel,
.admin-overview-data-panel {
  min-width: 0;
  max-width: 100%;
}

/* Settings tabs (#276). The categories inside a tab keep the same two-column
   grid they always had; the tabs only decide which set is on screen. */
.admin-settings-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.admin-message-record-tabs {
  margin: 0;
  padding-top: 0.75rem;
}

.admin-message-record-tabs .admin-settings-tab {
  text-decoration: none;
}

.admin-settings-tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.5rem 0.9rem;
  margin-bottom: -1px;
  color: var(--text-soft, var(--text-muted));
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.admin-settings-tab:hover,
.admin-settings-tab:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--scheme-text, var(--text)) 6%, transparent);
}

.admin-settings-tab[aria-selected="true"] {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-raised, transparent);
  border-bottom: 1px solid var(--surface-raised, transparent);
}

.admin-settings-tabpanel[hidden] {
  display: none;
}

.admin-settings-tab-intro {
  grid-column: 1 / -1;
  margin: 0 0 0.75rem;
  color: var(--text-soft, var(--text-muted));
}

.admin-email-template-group {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0;
}

.admin-message-template-menu {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.admin-message-template-menu a {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}

.admin-email-template-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.8fr);
  gap: 1rem;
}

.admin-email-template .admin-email-template-columns {
  grid-template-columns: minmax(0, 1fr);
}

.admin-email-template .admin-email-template-sample {
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
  border-left: 0;
}

.admin-email-template-columns > div,
.admin-email-template-columns form,
.admin-email-template-columns label,
.admin-email-template-columns .admin-settings-fields {
  min-width: 0;
}

.admin-email-template-columns input,
.admin-email-template-columns textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.admin-email-template-sample {
  min-width: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.admin-email-template-sample h5 {
  margin: 0 0 0.5rem;
}

.admin-email-template-sample .admin-delivery-body {
  max-width: none;
  max-height: none;
  overflow: visible;
}

.admin-email-template-empty-sample {
  color: var(--text-soft, var(--text-muted));
}

.admin-delivery-message details {
  position: relative;
}

.admin-delivery-message summary {
  padding-right: 1.5rem;
  list-style: none;
  cursor: pointer;
}

.admin-delivery-message summary::-webkit-details-marker {
  display: none;
}

.admin-delivery-message summary::after {
  content: "⌄";
  position: absolute;
  top: 0;
  right: 0;
}

.admin-delivery-message details[open] summary::after {
  content: "⌃";
}

@media (max-width: 900px) {
  .admin-email-template-columns {
    grid-template-columns: 1fr;
  }

  .admin-email-template-sample {
    padding: 1rem 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

.admin-email-template-about {
  margin: 0 0 0.35rem;
}

.admin-email-template-trigger {
  margin: 0 0 0.75rem;
  color: var(--text-soft, var(--text-muted));
  font-size: 0.9rem;
}

/* Plain-text mail: the editor must show the line breaks the reader will get. */
.admin-email-template-body {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

.admin-email-template-tokens {
  margin: 0.75rem 0;
}

.admin-email-template-tokens h5 {
  margin: 0 0 0.35rem;
}

.admin-email-template-tokens ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-soft, var(--text-muted));
  font-size: 0.88rem;
}

.admin-email-template-variable-example {
  display: block;
  margin-top: 0.15rem;
  color: var(--text);
  white-space: pre-wrap;
}

.admin-email-template-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-settings-categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-settings-category {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.admin-settings-category-landing,
.admin-settings-category-taxonomy,
.admin-settings-category-wide {
  grid-column: 1 / -1;
}

.admin-settings-category > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.admin-settings-category > summary::-webkit-details-marker {
  display: none;
}

.admin-settings-category > summary::after {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  content: "";
  transform: rotate(45deg);
  transition: transform 120ms ease;
}

.admin-settings-category[open] > summary::after {
  transform: rotate(225deg);
}

.admin-settings-category > summary h3 {
  flex: 1;
}

.admin-license-create {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) minmax(14rem, 1fr) minmax(16rem, 1.4fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.admin-license-create label {
  display: grid;
  gap: 0.35rem;
}

.admin-license-table th:first-child,
.admin-license-table td:first-child {
  width: 2.5rem;
}

.admin-license-table th:last-child,
.admin-license-table td:last-child {
  width: 8rem;
}

.admin-license-table input,
.admin-license-table select {
  min-width: 0;
}

@media (max-width: 900px) {
  .admin-license-create {
    grid-template-columns: 1fr;
  }
}

.admin-settings-category-content {
  padding-top: 0.8rem;
}

.admin-settings-category-content > p:first-child {
  margin-top: 0;
}

.admin-settings-permission-category .admin-permission-defaults {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-settings-permission-category .permission-default {
  width: 100%;
  max-width: none;
}

.admin-settings-category h3,
.admin-settings-category h4 {
  margin: 0;
  color: var(--text);
}

.admin-settings-category h3 {
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}

.admin-settings-category h4 {
  font-size: 0.82rem;
}

.admin-settings-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.admin-message-settings-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-settings-fields label {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.admin-settings-fields .admin-settings-color-field {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.admin-public-message-fields {
  grid-template-columns: auto minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}

.admin-public-message-switch {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.admin-settings-fields label.settings-switch {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
}

.admin-public-message-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-public-message-text .form-control {
  width: 100%;
  max-width: none;
}

.admin-public-message-label label.settings-switch {
  min-height: 0;
  margin: -8px 0;
  transform: scale(0.8);
  transform-origin: right center;
}

.admin-public-message-text-color:has(input[role="switch"]:not(:checked)) .app-color-picker {
  opacity: 0.45;
  pointer-events: none;
}

@media (max-width: 900px) {
  .admin-public-message-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-public-message-switch,
  .admin-public-message-text {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .admin-public-message-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-settings-fields .app-color-picker label.app-color-hex {
  display: flex;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.admin-financials-policy > .admin-settings-fields {
  align-items: start;
}

.admin-payment-requirements {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border-strong);
  padding-top: 0.75rem;
}

.admin-payment-requirements summary {
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.admin-payment-required-providers {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.admin-payment-required-providers legend {
  margin-bottom: 0.5rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.admin-payment-required-providers label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
}

.admin-payment-required-providers input[type="checkbox"] {
  margin: 0;
  accent-color: var(--accent);
}

.admin-settings-feature-group {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-ai-metadata-settings {
  display: grid;
  gap: 0.75rem;
}

.admin-ai-metadata-settings p,
.admin-media-tool p {
  margin: 0.25rem 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.admin-ai-metadata-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 0.45rem;
}

.admin-ai-metadata-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface-raised, var(--surface));
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
}

.admin-media-tool {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-width: 0;
}

.admin-media-tool form {
  display: grid;
  gap: 0.75rem;
}

.admin-media-tool form > .admin-settings-fields {
  width: 100%;
}

.admin-media-tool form > .btn {
  justify-self: start;
}

.admin-media-tool-progress:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-media-tool [data-form-message] {
  white-space: pre-wrap;
}

.admin-media-tool-spinner,
html.chart-state-pending [data-chart-canvas]:not([data-chart-ready])::after {
  width: 1rem;
  height: 1rem;
  flex: none;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: admin-media-tool-spin 0.75s linear infinite;
}

@keyframes admin-media-tool-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-media-tool-spinner,
  html.chart-state-pending [data-chart-canvas]:not([data-chart-ready])::after {
    animation-duration: 1.5s;
  }
}

.admin-financials {
  display: grid;
  gap: 1rem;
}

.admin-tax-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.admin-tax-control-xs {
  flex: 0 1 9rem;
}

.admin-tax-control-sm {
  flex: 0 1 11rem;
}

.admin-tax-control-date {
  flex: 0 1 11rem;
}

.admin-tax-control-md {
  flex: 0 1 18rem;
}

.admin-tax-control-lg {
  flex: 1 1 24rem;
}

.admin-tax-control-picker {
  flex: 1 1 28rem;
  min-width: min(100%, 20rem);
}

.admin-tax-operation-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
  margin-top: 0.75rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-tax-operation-progress[hidden] {
  display: none;
}

.admin-tax-controls > label,
.admin-tax-picker-field,
.admin-user-picker-search {
  display: grid;
  gap: 0.35rem;
}

.admin-tax-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.55rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-tax-picker-trigger:hover,
.admin-tax-picker-trigger:focus-visible,
.admin-user-picker-option:hover,
.admin-user-picker-option:focus-visible {
  border-color: var(--accent);
}

.admin-user-picker-list {
  display: grid;
  gap: 0.45rem;
  max-height: min(60vh, 34rem);
  margin-top: 0.75rem;
  overflow-y: auto;
}

.admin-user-picker-option {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface-raised, var(--surface));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.admin-user-picker-option span {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.admin-tax-backfill-status {
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.admin-tax-backfill-status.is-success {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.admin-tax-backfill-status.is-warning {
  border-color: color-mix(in srgb, var(--warning) 60%, var(--border));
}

.admin-tax-backfill-status p {
  margin: 0.55rem 0 0;
}

.admin-tax-audit-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}

.admin-tax-audit-toolbar label {
  display: grid;
  gap: 0.35rem;
  min-width: min(100%, 15rem);
}

.admin-tax-audit-toolbar p {
  margin: 0 0 0.55rem;
  color: var(--text-soft);
}

.admin-tax-audit-table .admin-tax-audit-review {
  min-width: 15rem;
  white-space: normal;
}

.admin-tax-audit-review ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.admin-tax-audit-row.is-warning > td {
  background: color-mix(in srgb, var(--warning) 9%, var(--surface));
}

.admin-tax-audit-row.is-warning > td:first-child {
  box-shadow: inset 3px 0 0 var(--warning);
}

.admin-tax-audit-status {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: capitalize;
}

.admin-tax-audit-status.is-warning {
  border-color: color-mix(in srgb, var(--warning) 60%, var(--border));
  color: var(--warning);
}

.admin-tax-audit-status.is-clear {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
  color: var(--success);
}

.admin-tax-no-action {
  color: var(--success);
}

.admin-financials-mode {
  align-self: start;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.admin-financials-mode.is-live {
  border-color: rgba(120, 214, 163, 0.45);
  color: #78d6a3;
}

.admin-financials-credential-meta small {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.admin-financials-policy,
.admin-financials-webhook {
  grid-column: 1 / -1;
}

.admin-financials-credential-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.admin-financials-credential {
  display: grid;
  gap: 0.4rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.admin-financials-credential:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-financials-credential > label:not(.form-check),
.admin-financials-webhook label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.admin-financials-credential-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-financials-credential-meta > span {
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-financials-credential-meta .is-configured {
  color: #78d6a3;
}

.admin-financials-credential-meta .is-missing {
  color: #ff8588;
}

.admin-financials-dashboard {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.admin-financials-dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-financials-dashboard-heading h3,
.admin-financials-dashboard-heading p,
.admin-financials-mode-intro,
.admin-financials-tool-card h4,
.admin-financials-tool-card p {
  margin: 0;
}

.admin-financials-dashboard-heading p,
.admin-financials-mode-intro,
.admin-financials-tool-card p {
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.admin-financials-dashboard-heading p {
  margin-top: 0.3rem;
}

.admin-financials-risk-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 250px;
}

.admin-financials-risk-legend span,
.admin-financials-tool-risk,
.admin-financials-card-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.2rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.2;
}

.admin-financials-risk-legend .is-safe,
.admin-financials-tool-risk.is-safe {
  border-color: rgba(87, 199, 133, 0.42);
  color: #b7f0cd;
  background: rgba(87, 199, 133, 0.08);
}

.admin-financials-risk-legend .is-caution,
.admin-financials-tool-risk.is-caution {
  border-color: rgba(214, 162, 79, 0.48);
  color: #f0cf98;
  background: rgba(214, 162, 79, 0.08);
}

.admin-financials-risk-legend .is-disruptive,
.admin-financials-tool-risk.is-disruptive {
  border-color: rgba(225, 109, 119, 0.42);
  color: #ffbdc5;
  background: rgba(225, 109, 119, 0.08);
}

.admin-financials-mode-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}

.admin-financials-mode-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
  list-style: none;
}

.admin-financials-mode-card > summary::-webkit-details-marker {
  display: none;
}

.admin-financials-mode-card > summary > span:first-child {
  display: grid;
  gap: 0.2rem;
  margin-right: auto;
}

.admin-financials-mode-card > summary::after {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  content: "";
  transform: translateY(-0.12rem) rotate(45deg);
}

.admin-financials-mode-card[open] > summary::after {
  transform: translateY(0.12rem) rotate(225deg);
}

.admin-financials-mode-card > summary small {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 500;
}

.admin-financials-card-state {
  color: var(--text-muted);
}

.admin-financials-card-state.is-active {
  border-color: rgba(87, 199, 133, 0.42);
  color: #b7f0cd;
  background: rgba(87, 199, 133, 0.08);
}

.admin-financials-mode-body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.admin-financials-tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-financials-tool-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.admin-financials-tool-card.is-safe {
  border-color: color-mix(in srgb, #57c785 24%, var(--border));
}

.admin-financials-tool-card.is-caution {
  border-color: color-mix(in srgb, #d6a24f 26%, var(--border));
}

.admin-financials-tool-card.is-disruptive {
  border-color: color-mix(in srgb, #e16d77 28%, var(--border));
}

a.admin-financials-tool-card:hover,
a.admin-financials-tool-card:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
}

.admin-financials-tool-card h4 {
  font-size: 0.94rem;
}

.admin-financials-tool-open {
  margin-top: auto;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-financials-verify {
  display: grid;
  width: 100%;
  gap: 0.75rem;
  margin-top: auto;
}

.admin-financials-verify .btn {
  width: 100%;
}

.admin-financials-verify .btn:disabled {
  cursor: default;
  filter: grayscale(0.55);
  opacity: 0.48;
}

.creator-ledger-heading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.creator-ledger-heading .creator-table-sort {
  width: auto;
}

.creator-ledger-heading .creator-ledger-tooltip-trigger {
  padding: 0;
}

.creator-ledger-tooltip-trigger {
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.1rem;
  min-width: 0;
  height: 1.1rem;
  min-height: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.creator-ledger-tooltip-trigger:focus-visible {
  outline: 2px solid var(--accent, #6c63ff);
  outline-offset: 3px;
}

.creator-ledger-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.creator-ledger-controls,
.creator-ledger-filter {
  width: 100%;
}

.admin-transaction-report .creator-ledger-filter {
  align-items: end;
  margin-bottom: 1rem;
}

.admin-delivery-body {
  max-height: 20rem;
  margin: 0.5rem 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
  font: inherit;
}

.admin-transaction-pagination {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.admin-transaction-sort {
  color: inherit;
  display: inline-block;
  text-decoration: none;
  white-space: nowrap;
}

.admin-transaction-sort:hover,
.admin-transaction-sort:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.creator-ledger-filter {
  align-items: end;
}

.creator-ledger-export-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.creator-sales-chart {
  padding-top: 1.25rem;
}

.creator-chart-controls,
.creator-chart-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.creator-chart-controls {
  flex-wrap: wrap;
}

.creator-sales-chart-canvas {
  min-height: 300px;
  padding: 1rem 0 0.5rem;
  overflow-x: auto;
}

[data-chart-fit] .creator-sales-chart-canvas {
  overflow-x: hidden;
}

.creator-sales-chart-canvas svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.creator-sales-chart-canvas .chart-grid line {
  stroke: var(--border);
  stroke-width: 1;
}

.creator-sales-chart-canvas text {
  fill: var(--text-muted);
  font-size: 12px;
}

.creator-sales-chart-canvas .chart-value {
  fill: var(--text);
  font-weight: 700;
}

.creator-sales-chart-canvas .chart-bar-value,
.creator-sales-chart-canvas .chart-series-value {
  fill: var(--bg);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.creator-sales-chart-canvas .chart-series-value {
  fill: var(--text);
}

.creator-sales-chart-canvas .chart-marks rect,
.creator-sales-chart-canvas .chart-marks circle {
  fill: var(--accent-strong);
}

.creator-sales-chart-canvas .chart-line {
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 3;
}

.creator-fee-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.creator-fee-overview-grid > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.creator-fee-overview-grid strong {
  font-size: 1.2rem;
}

.creator-fee-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.35rem;
}

.creator-fee-overview-grid p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.price-fee-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 0;
  min-height: 0 !important;
  margin-left: 0.3rem;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  vertical-align: middle;
  cursor: pointer;
}

.price-fee-help svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.price-table-heading {
  display: inline-flex;
  align-items: center;
}

.price-field-label-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.25rem;
}

.price-field-label-row .form-label {
  margin-bottom: 0;
}

.price-breakdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1rem;
  width: 100%;
}

/* Site Fee and Your Result stay together beside the price, or under it when the column is too narrow. */
.price-breakdown-items {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
}

.price-breakdown-input {
  display: flex;
  align-items: center;
  flex: 0 0 9rem;
  min-width: 0;
  gap: 0.25rem;
}

.price-breakdown-input .form-control {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.price-breakdown-item {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 0.3rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

.price-breakdown-item + .price-breakdown-item {
  margin-left: 0.8rem;
  padding-left: 0.8rem;
  border-left: 1px solid var(--border-strong);
}

.price-breakdown-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.price-breakdown-fee {
  color: var(--danger);
}

.price-breakdown-result {
  color: var(--success);
}

.price-fee-help:hover,
.price-fee-help:focus-visible {
  color: var(--text);
  outline: none;
}

.payment-fee-help-modal .app-modal-body {
  max-width: 34rem;
}

#tier-modal .app-modal-body {
  width: min(52rem, calc(100vw - 2rem));
  max-width: none;
}

.payment-fee-help-modal p {
  text-transform: none;
}

@media (max-width: 720px) {
  .creator-fee-overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-ledger-controls,
  .creator-ledger-export-actions {
    align-items: stretch;
    width: 100%;
  }

  .creator-ledger-export-actions {
    justify-content: flex-end;
  }
}

.admin-operations-panel,
.admin-refund-queue {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.admin-operations-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}

.admin-operations-tab {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.admin-operations-tab:hover,
.admin-operations-tab:focus-visible {
  color: var(--text);
}

.admin-operations-tab.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, var(--border));
}

.word-scan-panel .section-heading {
  align-items: center;
  justify-content: space-between;
}

.word-scan-panel :is(h2, h3, h4) {
  margin: 0;
  overflow-wrap: anywhere;
}

.word-scan-item {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
}

.word-scan-item .table-responsive {
  margin-top: 0.5rem;
}

.word-scan-excerpts {
  width: 100%;
}

.word-scan-excerpt {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.word-scan-excerpt + .word-scan-excerpt {
  margin-top: 0.4rem;
}

.word-scan-excerpt mark {
  padding-inline: 0.1em;
  border-radius: 0.18em;
  color: var(--text);
  background: color-mix(in srgb, var(--warning) 24%, var(--surface));
  box-shadow: inset 0 -1px var(--warning);
}

.word-scan-field-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 0.4rem 1rem;
}

.admin-queue-group-heading span {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 650;
}

/* A panel split into its figures and what they mean.
   The numbers carry the space; the aside is the sentence that interprets them plus
   whatever acts on them, and it stays beside them rather than below, so a claim and
   the button that tests it are never separated by a grid of cards. */
.admin-panel-split-aside {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 95%, var(--accent) 5%);
}

.admin-panel-split-aside > :last-child {
  margin-bottom: 0;
}

.admin-report-action-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-report-action-link:hover,
.admin-report-action-link:focus-visible {
  color: var(--accent-strong);
}

.admin-name-request-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.admin-name-request-table .col-date {
  width: 9.5rem;
}

.admin-name-request-table .col-name {
  width: 8.5rem;
}

.admin-name-request-table .col-reason {
  width: auto;
}

.admin-name-request-table .col-action {
  width: 230px;
}

.admin-name-request-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  white-space: nowrap;
}

.admin-name-request-actions form {
  margin: 0;
}

.admin-name-request-actions .btn {
  min-width: 72px;
}

.admin-name-request-actions .admin-name-request-remove {
  min-width: 34px;
}

.admin-name-request-action-cell {
  text-align: center;
}

.admin-queue-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(140px, 0.8fr)) auto;
  align-items: end;
  gap: 0.65rem;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 92%, var(--accent) 8%);
}

.admin-queue-toolbar-compact {
  grid-template-columns: minmax(220px, 1.5fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) auto;
}

/* Between desktop and phone the filters wrap inside the toolbar instead of
   pushing Clear filters past the panel. */
@media (max-width: 1180px) {
  .admin-queue-toolbar,
  .admin-queue-toolbar-compact {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

.admin-queue-toolbar label,
.admin-refund-controls label {
  display: grid;
  gap: 0.3rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.admin-queue-toolbar .form-control,
.admin-queue-toolbar .form-select {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  background: var(--surface-raised, var(--surface));
}

.admin-queue-status,
.admin-queue-bulk-form,
.admin-queue-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-queue-status > p,
.admin-queue-bulk-form,
.admin-queue-group-heading h3,
.admin-queue-group-heading p {
  margin: 0;
}

.admin-queue-status > p,
.admin-queue-bulk-form > span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.admin-queue-group-heading {
  align-items: end;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-queue-group-heading p {
  margin-top: 0.2rem;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.admin-queue-select-cell {
  width: 44px;
  text-align: center;
}

.admin-queue-select-cell input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.admin-queue-count-badge {
  display: inline-grid;
  min-width: 2rem;
  min-height: 2rem;
  place-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  font-weight: 750;
}

.admin-reports-list + .admin-reports-list,
.admin-refund-queue + .admin-refund-queue {
  margin-top: 0.75rem;
}

.admin-reports-summary-table,
.admin-message-reports table {
  min-width: 760px;
}

.admin-refund-queue {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 96%, var(--accent) 4%);
}

.admin-refund-retry-queue {
  border-color: color-mix(in srgb, #d6a24f 45%, var(--border));
}

.admin-refund-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.admin-refund-table :is(th, td) {
  white-space: nowrap;
}

.admin-refund-table tbody tr[hidden] {
  display: none !important;
}

.admin-refund-transaction-reference {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.admin-refund-queue > .table-responsive {
  min-width: 0;
  max-width: 100%;
  overscroll-behavior-x: contain;
}

@media (max-width: 720px) {
  .admin-refund-table td {
    overflow-wrap: anywhere;
  }
}

.admin-refund-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.72rem;
  white-space: nowrap;
}

.admin-refund-status.is-paid {
  border-color: rgba(120, 214, 163, 0.45);
  color: #78d6a3;
}

.admin-refund-status.is-partially-refunded,
.admin-refund-status.is-refund-requested {
  border-color: rgba(214, 162, 79, 0.5);
  color: #d6a24f;
}

.admin-refund-bulk-form {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised, var(--surface));
}

.admin-refund-reason-config,
.admin-refund-selected {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
}

.admin-refund-reason-row {
  display: grid;
  grid-template-columns: minmax(12rem, 0.7fr) minmax(18rem, 1.3fr) auto;
  align-items: end;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
}

.admin-refund-reason-row label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.admin-refund-reason-row label > span {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

.admin-refund-reason-row textarea {
  min-height: 5.25rem;
  resize: vertical;
}

.admin-refund-selected[aria-disabled="true"] {
  opacity: 0.55;
}

.admin-refund-controls fieldset,
.admin-refund-bulk-form fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
  margin: 0;
}

.admin-refund-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(190px, 1fr) minmax(220px, 1.4fr) auto;
  align-items: end;
  gap: 0.75rem;
}

.admin-refund-submit {
  justify-self: end;
  width: auto;
  max-width: 12rem;
}

@media (max-width: 1100px) {
  .admin-financials-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-tax-controls > label,
  .admin-tax-control-picker {
    flex-basis: 100%;
    max-width: none;
  }

  .admin-tax-audit-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-tax-audit-toolbar p {
    margin: 0;
  }

  .admin-queue-toolbar,
  .admin-queue-toolbar-compact,
  .admin-refund-reason-row,
  .admin-refund-controls {
    grid-template-columns: 1fr;
  }

  .admin-financials-tool-grid {
    grid-template-columns: 1fr;
  }

  .admin-financials-dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-financials-risk-legend {
    justify-content: flex-start;
    min-width: 0;
  }

  .admin-queue-status,
  .admin-queue-bulk-form,
  .admin-queue-group-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-queue-bulk-form .btn,
  .admin-refund-controls .btn {
    width: 100%;
  }
}

.admin-settings-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-settings-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
}

.admin-settings-sort-button:hover,
.admin-settings-sort-button:focus-visible,
.admin-settings-sort-button.is-active {
  color: var(--accent);
}

.admin-settings-sort-indicator {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.45;
  transform: translateY(-2px) rotate(45deg);
}

.admin-settings-sort-button.is-active .admin-settings-sort-indicator {
  opacity: 1;
}

.admin-settings-sort-button.is-descending .admin-settings-sort-indicator {
  transform: translateY(2px) rotate(225deg);
}

.admin-settings-actions-cell {
  width: 1%;
  text-align: right !important;
  white-space: nowrap;
}

.admin-settings-actions-cell form {
  margin: 0;
}

.admin-settings-save {
  margin-top: 1rem;
}

@media (max-width: 820px) {
  .admin-settings-categories {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-settings-category-landing,
  .admin-settings-category-taxonomy,
  .admin-settings-category-wide {
    grid-column: auto;
  }

  .admin-message-settings-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-settings-permission-category .admin-permission-defaults {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Admin dashboard (#210): one date range, dense KPI cards with trends, a
   standing state strip, one chart and one sortable data table. */
.admin-period-filter {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(120px, 0.7fr)) auto;
  align-items: end;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 92%, var(--accent) 8%);
}

.admin-period-filter label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.admin-period-filter [data-admin-period-fields][hidden] {
  display: none;
}

.admin-period-summary {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.admin-overview-kpis,
.admin-overview-state {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
  border: 0;
  background: var(--bg);
}

.admin-kpi,
.admin-state-card {
  display: grid;
  align-content: start;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
}

.admin-kpi-label,
.admin-state-card > span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-kpi-value,
.admin-state-card > strong {
  color: var(--text);
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  font-weight: 750;
  line-height: 1.1;
}

.admin-kpi-trend {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.74rem;
  font-weight: 700;
}

.admin-kpi.is-up .admin-kpi-trend { color: #78d6a3; }
.admin-kpi.is-down .admin-kpi-trend { color: #ff8588; }
.admin-kpi.is-flat .admin-kpi-trend { color: var(--text-muted); }

.admin-kpi-previous,
.admin-state-card > small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-state-card:hover,
.admin-state-card:focus-visible {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.admin-state-card.is-urgent {
  background: color-mix(in srgb, #ff5f62 9%, transparent);
}

.admin-state-card.is-urgent > strong {
  color: #ff8588;
}

.admin-state-card-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.admin-state-card-values > span {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.admin-state-card-values strong {
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  line-height: 1.1;
}

.admin-state-card-values small,
.admin-state-card-split > small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.admin-state-card-values .is-available strong { color: #78d6a3; }
.admin-state-card-values .is-missing strong { color: #ff8588; }
.admin-state-card-values .is-neutral strong { color: var(--text); }

.admin-data-toolbar {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.admin-data-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-data-actions p,
.admin-data-actions [data-chart-export-status] {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

/* Phones: the count and the Copy/CSV buttons wrap below the search. */
@media (max-width: 760px) {
  .admin-data-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-data-actions {
    flex-wrap: wrap;
  }
}

.admin-overview .admin-data-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: 32rem;
  overflow: auto;
}

.admin-overview-queue-row.is-link span {
  display: grid;
  gap: 0.1rem;
}

.admin-overview-queue-row.is-link small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

@media (max-width: 1500px) {
  .admin-overview-kpis,
  .admin-overview-state {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-period-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-overview-kpis,
  .admin-overview-state {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-overview-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  min-width: 0;
}

.admin-overview-main > .panel {
  min-width: 0;
}

/* Platform activity chart (#210): shares the creator sales chart canvas and
   adds a stats strip plus a hover readout of every series. */
.admin-activity-chart {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.admin-activity-chart .creator-sales-chart-canvas {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.admin-chart-tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 0.15rem;
  min-width: 15rem;
  max-width: 22rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-shadow: 0 12px 28px rgb(0 0 0 / 45%);
  font-size: 0.76rem;
  pointer-events: none;
}

.admin-chart-tooltip[hidden] {
  display: none;
}

.admin-chart-tooltip p {
  margin: 0 0 0.25rem;
  color: var(--text);
  font-weight: 750;
}

.admin-chart-tooltip div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
}

.admin-chart-tooltip div.is-active {
  color: var(--text);
  font-weight: 750;
}

.admin-chart-tooltip strong {
  color: var(--text);
  font-weight: 700;
}

.creator-sales-chart-canvas .chart-hit {
  fill: transparent;
}

.creator-sales-chart-canvas .chart-hit:hover {
  fill: color-mix(in srgb, var(--accent) 12%, transparent);
}

.admin-series-table th[scope="row"] {
  font-weight: 600;
}

/* Chart data (#210): the same numbers as a real table - sortable, selectable,
   copyable - so nothing is reachable only by hovering the chart. */

/* Delivery report (#210): the outbox uses the standard operations table. */
.admin-delivery-table th:nth-child(4),
.admin-delivery-table td:nth-child(4) {
  width: 8rem;
  max-width: 8rem;
  overflow-wrap: anywhere;
}

.admin-delivery-table td:nth-child(4) {
  font-size: 70%;
}

.admin-delivery-table th:nth-child(9),
.admin-delivery-table td:nth-child(9),
.admin-delivery-table th:nth-child(10),
.admin-delivery-table td:nth-child(10) {
  width: 9.25rem;
  min-width: 9.25rem;
  max-width: 9.25rem;
  white-space: nowrap;
}

.admin-delivery-status.is-failed {
  border-color: #ff8588;
  color: #ff8588;
}

.admin-delivery-status.is-pending {
  border-color: #f3d77a;
  color: #f3d77a;
}

.admin-delivery-status.is-sent {
  border-color: #78d6a3;
  color: #78d6a3;
}

.admin-overview-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.admin-subscriber-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.admin-subscriber-search .form-control {
  flex: 1 1 15rem;
  min-width: 0;
  max-width: 26rem;
}

.admin-subscriber-search .form-select {
  width: auto;
  max-width: 100%;
}

.admin-subscribers :is(.admin-subscriber-search, .table-page-controls) .btn {
  flex: none;
  width: auto;
}

.admin-overview-queue {
  border-top: 1px solid var(--border);
}

.admin-overview-queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 42px;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.82rem;
}

.admin-overview-queue-row strong {
  min-width: 2.2rem;
  color: var(--text);
  text-align: right;
}

.admin-overview-queue-row.is-danger strong {
  color: #ff8588;
}

.admin-overview-queue-row.is-warning strong {
  color: #f3d77a;
}

.admin-overview-queue-row.is-clear strong {
  color: #78d6a3;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.admin-overview-queue-row a {
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 980px) {
  .admin-overview-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1280px) {
  .admin-user-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-user-toolbar {
    grid-template-columns: 1fr;
  }

}

/* Storage report (#209). */
.admin-storage-breakdown,
.admin-storage-audit {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 84%, var(--bg));
}

.admin-storage-subheading,
.admin-storage-heading-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-storage-subheading h3,
.admin-storage-audit h3 {
  margin: 0;
}

.admin-storage-subheading p,
.admin-storage-audit p {
  margin: 0.15rem 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.admin-storage-breakdown-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) minmax(180px, 1fr) 4.5rem;
  align-items: center;
  gap: 0.8rem;
}

.admin-storage-breakdown-row > div {
  display: grid;
  gap: 0.1rem;
}

.admin-storage-breakdown-row span {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.admin-storage-breakdown-row > span {
  color: var(--text);
  text-align: right;
}

.admin-storage-breakdown-row progress {
  width: 100%;
  height: 0.55rem;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  accent-color: var(--accent);
}

.admin-storage-breakdown-row progress::-webkit-progress-bar {
  background: var(--bg);
}

.admin-storage-breakdown-row progress::-webkit-progress-value,
.admin-storage-breakdown-row progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.admin-storage-audit {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.admin-storage-audit.is-complete {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.admin-storage-audit.has-issues {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--border));
}

.admin-storage-audit-details summary {
  width: fit-content;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
}

.admin-storage-audit-details h4 {
  margin: 0.8rem 0 0.35rem;
  font-size: 0.8rem;
}

.admin-storage-audit-details ul {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding-left: 1.25rem;
}

.admin-storage-audit-details code {
  overflow-wrap: anywhere;
}

.admin-storage-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.45fr) minmax(170px, 0.45fr) auto;
  align-items: end;
  gap: 0.75rem;
}

.admin-storage-file-toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 0.4fr) auto;
}

.admin-storage-toolbar label {
  display: grid;
  gap: 0.3rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-storage-result-count {
  min-width: 7rem;
  padding-bottom: 0.65rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.admin-storage-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.admin-storage-total-row {
  border-top: 2px solid var(--border);
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
  font-weight: 700;
}

.admin-storage-file-toolbar + .admin-storage-subheading + .table-responsive .admin-storage-table {
  width: 100%;
  table-layout: fixed;
  font-size: 0.76rem;
}

.admin-storage-file-toolbar + .admin-storage-subheading + .table-responsive .admin-storage-table th {
  font-size: 0.68rem;
}

.admin-storage-select-col {
  width: 2.1rem;
  text-align: center;
}

.admin-storage-select-col input {
  display: block;
  margin: 0 auto;
}

.admin-storage-name-col {
  width: 25%;
}

.admin-storage-kind-col {
  width: 4.5rem;
}

.admin-storage-type-col {
  width: 5.5rem;
}

.admin-storage-type-value {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.admin-storage-type-value > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-storage-type-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-right: 0.3rem;
  object-fit: contain;
}

.admin-storage-file-link,
.admin-storage-content-link {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.admin-storage-content-col {
  width: 11.5%;
}

.admin-storage-path-col {
  width: 16%;
}

.admin-storage-size-col {
  width: 5.25rem;
}

.admin-storage-downloads-col {
  width: 3.9rem;
}

.admin-storage-bandwidth-col {
  width: 5.4rem;
}

.admin-storage-date-col {
  width: 6.5rem;
}

.admin-storage-table .admin-storage-actions-col {
  width: 3rem;
}

.admin-storage-table td > small {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-soft);
  font-size: 0.7rem;
}

.admin-storage-files-link {
  display: grid;
  gap: 0.15rem;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.18em;
}

.admin-storage-link-col {
  min-width: 7.5rem;
  width: 7.5rem;
}

.admin-storage-view-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.admin-storage-files-link small {
  color: var(--text-soft);
  font-size: 0.7rem;
}

.admin-storage-cleanup {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.admin-storage-path {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-storage-path-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.admin-storage-path-wrap .admin-storage-path {
  min-width: 0;
}

.admin-storage-copy {
  flex: 0 0 auto;
  padding: 0.2rem 0.35rem;
  font-size: 0.68rem;
}

.admin-storage-bulk-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin: 0;
}

.admin-storage-bulk-form .btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.admin-storage-table td form {
  margin: 0;
}

.admin-storage-filter-empty {
  margin-top: 0.75rem;
}

@media (max-width: 900px) {
  .admin-storage-toolbar,
  .admin-storage-file-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .admin-storage-result-count {
    padding-bottom: 0;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .admin-storage-toolbar,
  .admin-storage-file-toolbar,
  .admin-storage-breakdown-row,
  .admin-storage-audit {
    grid-template-columns: 1fr;
  }

  .admin-storage-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-storage-breakdown-row > span {
    text-align: left;
  }
}

/* #250: whether a requested account name can actually be granted. Sits beside the
   requested name so the reviewer sees it without opening anything. */
.admin-name-availability {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}

.admin-name-availability.is-free {
  color: var(--bs-success-text-emphasis, #0a3622);
  background: var(--bs-success-bg-subtle, #d1e7dd);
  border-color: var(--bs-success-border-subtle, #a3cfbb);
}

.admin-name-availability.is-warning {
  color: var(--bs-warning-text-emphasis, #664d03);
  background: var(--bs-warning-bg-subtle, #fff3cd);
  border-color: var(--bs-warning-border-subtle, #ffe69c);
}

.admin-name-availability.is-danger {
  color: var(--bs-danger-text-emphasis, #58151c);
  background: var(--bs-danger-bg-subtle, #f8d7da);
  border-color: var(--bs-danger-border-subtle, #f1aeb5);
}

/* Operational health in Platform Settings (#278, #285, #287). */
.admin-health-overview {
  margin: 0.75rem 0 0;
}

.admin-health-overview-heading {
  margin-bottom: 0.75rem;
}

.admin-health-overview-heading h3,
.admin-health-overview-heading p,
.admin-health-card h4,
.admin-health-card p {
  margin: 0;
}

.admin-health-overview-heading p,
.admin-health-card p {
  color: var(--text-muted);
}

.admin-maintenance-failures {
  margin: 0.55rem 0 0;
  padding-left: 1.25rem;
}

.admin-maintenance-failures li + li {
  margin-top: 0.35rem;
}

[data-maintenance-run-form] [data-form-message] {
  margin-top: 0.5rem;
  color: var(--danger);
  overflow-wrap: anywhere;
}

.admin-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-health-card {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: color-mix(in srgb, var(--surface) 82%, white 18%);
  box-shadow: 0 1px 3px rgb(0 0 0 / 14%);
}

.admin-health-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-health-card-heading span {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-health-card-action {
  margin-top: auto;
}

.admin-health-errors summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-health-errors ul {
  display: grid;
  gap: 0.6rem;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}

.admin-health-errors li,
.admin-health-errors li span,
.admin-health-errors li small {
  display: block;
}

.admin-health-errors li span,
.admin-health-errors li small {
  color: var(--text-muted);
}

/* Payment tests card: one list per area; the result word reads as a status, not a note. */
.admin-health-checks + .admin-health-checks,
.admin-health-checks + form {
  margin-top: 0.6rem;
}

.admin-health-checks li span {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.admin-health-card--ok {
  border-left-color: var(--bs-success-border-subtle, #a3cfbb);
  background: color-mix(in srgb, var(--surface) 88%, var(--bs-success, #198754) 12%);
}

.admin-health-card--warning {
  border-left-color: var(--bs-warning-border-subtle, #ffe69c);
  background: color-mix(in srgb, var(--surface) 84%, var(--bs-warning, #ffc107) 16%);
}

.admin-health-card--danger {
  border-left-color: var(--bs-danger-border-subtle, #f1aeb5);
  background: color-mix(in srgb, var(--surface) 84%, var(--bs-danger, #dc3545) 16%);
}

@media (max-width: 760px) {
  .admin-health-grid {
    grid-template-columns: 1fr;
  }
}

.admin-refund-request-action {
  min-width: 8rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
}

.admin-refund-request-action .searchable-select-dropdown {
  width: 100%;
}

/* SUB483 Suspicious activity: reasons as pills, actions on one line, each account's visits under its row. */
.admin-activity-reasons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.admin-activity-actions {
  white-space: nowrap;
  text-align: end;
}

.admin-activity-buttons {
  display: inline-flex;
  gap: 0.5rem;
}

.admin-activity-actions [aria-expanded="true"] {
  border-color: var(--accent);
}

tr.admin-activity-visits.is-collapsed {
  display: none !important;
}

tr.admin-activity-visits > td {
  padding-top: 0;
}

tr.admin-activity-visits .admin-overview-table-wrap {
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 0.75rem;
}

/* SUB107 Reasons a download key looks shared. */
.admin-shared-key-reasons {
  margin: 0;
  padding-left: 1rem;
}

/* SUB191 A creator's subscriptions in Admin > Users > Actions, archived ones muted. */
.admin-user-tiers-head {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
}

.admin-user-tiers-table th:first-child,
.admin-user-tiers-table td:first-child {
  text-align: left;
}

.admin-user-tiers-table tr.is-archived td {
  color: var(--text-soft);
}

.tier-status-badge.is-archived {
  color: var(--text-soft);
  border-style: dashed;
}

/* Admin > Countries */
.admin-countries .panel {
  display: grid;
  gap: 0.85rem;
}

.admin-countries > nav {
  margin-inline-end: auto;
}

.admin-countries-overview {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  align-items: start;
  gap: 1rem;
}

.admin-countries .table-responsive {
  overflow-x: auto;
}

:is(.admin-countries-states, .admin-countries-limits) tbody th {
  font-weight: 600;
}

.admin-countries-states tbody td {
  font-variant-numeric: tabular-nums;
}

.admin-countries-add {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(8rem, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.admin-countries-add [data-form-message] {
  grid-column: 1 / -1;
}

.admin-countries-tax-panel {
  scroll-margin-top: calc(var(--header-h, 64px) + 1rem);
}

.admin-countries-oss-form,
.admin-vat-rules-filter > .admin-countries-add {
  grid-template-columns: minmax(0, 13rem) auto;
  justify-content: start;
}

.admin-vat-rules > .admin-vat-rules-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
}

.admin-vat-rules-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-countries-oss-region {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
}

.admin-countries-oss-destinations {
  margin-top: 0.45rem;
}

.admin-countries-oss-destinations > summary {
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 400;
}

.admin-countries-oss-destinations > ul {
  display: grid;
  gap: 0.25rem;
  margin: 0.4rem 0 0.1rem;
  padding: 0;
  list-style: none;
}

.admin-countries-oss-destinations li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0;
}

.admin-countries-add [data-form-message]:empty,
.admin-countries-action [data-form-message]:empty,
.admin-countries-editor [data-form-message]:empty {
  display: none;
}

dialog[data-modal].admin-countries-modal {
  width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
}

.admin-countries-editor {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.admin-countries-editor textarea {
  resize: vertical;
}

.admin-countries-editor .app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.admin-countries-editor-check {
  width: fit-content;
}

.admin-countries-action {
  text-align: right;
  white-space: nowrap;
}

.admin-countries-action form {
  display: inline-grid;
  gap: 0.25rem;
  justify-items: center;
}

.admin-countries-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.admin-countries-meter-bar {
  flex: 0 0 3rem;
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-soft) 22%, transparent);
  overflow: hidden;
}

.admin-countries-meter-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.admin-countries tr.is-warning .admin-countries-meter-bar > span { background: var(--warning); }
.admin-countries tr.is-over .admin-countries-meter-bar > span { background: var(--danger); }

.country-status.is-ok {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 50%, transparent);
}

.country-status.is-warning {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 55%, transparent);
}

.country-status.is-over {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
}

.country-status.is-untracked {
  border-style: dashed;
}

.admin-countries-alerts {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-countries-alert {
  display: grid;
  gap: 0.15rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--warning) 50%, transparent);
  border-radius: var(--radius, 0.5rem);
  background: color-mix(in srgb, var(--warning) 8%, transparent);
}

.admin-countries-alert.is-over {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.admin-countries-alert.admin-countries-vat-issue {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.admin-countries-alert span,
.admin-countries-note {
  color: var(--text-muted);
}

.admin-countries-note {
  margin: 0;
}

.admin-countries-note.is-unread,
.admin-countries-uncounted {
  color: var(--warning);
}

.admin-countries-uncounted {
  display: block;
  font-size: 0.828rem;
}

@media (max-width: 720px) {
  .admin-countries-add {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1120px) {
  .admin-countries-overview {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Payment event actions share the same button and feedback layout. */
.payment-event-action {
  display: flex;
  flex-direction: column;
  margin: 0;
}
@media (max-width: 700px) {
  .payment-event-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .payment-event-actions > .payment-event-action {
    width: 100%;
    min-width: 0;
  }
}
.admin-scheduled-rebuild-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-raised, var(--surface));
}

.admin-scheduled-rebuild-banner h4,
.admin-scheduled-rebuild-banner p {
  margin: 0;
}

.admin-scheduled-rebuild-banner h4 + p {
  margin-top: 4px;
}

.admin-scheduled-rebuild-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 8px;
}

dialog[data-modal].admin-resolution-rebuild-modal {
  width: min(720px, calc(100vw - 2rem));
  min-width: 0;
}

.admin-resolution-rebuild-modal .app-modal-head h2 {
  font-size: 1.25rem;
}

.admin-resolution-rebuild-modal form {
  display: grid;
  gap: 16px;
}

.admin-resolution-rebuild-modal h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.admin-resolution-changes,
.admin-resolution-summary,
.admin-resolution-impact,
.admin-resolution-rebuild-modal p {
  margin: 0;
}

.admin-resolution-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.admin-resolution-changes li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised, var(--surface));
  font-size: .85rem;
}

.admin-resolution-changes strong {
  font-variant-numeric: tabular-nums;
}

.admin-resolution-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-resolution-summary > div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised, var(--surface));
}

.admin-resolution-summary dt {
  color: var(--text-muted);
  font-size: .85rem;
}

.admin-resolution-summary dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.admin-resolution-impact {
  display: grid;
  gap: 4px;
  font-size: .875rem;
}

.admin-resolution-impact > div {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  gap: 2px 10px;
}

.admin-resolution-impact dd {
  color: var(--text-muted);
  margin: 0;
}

.admin-resolution-schedule {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.admin-resolution-traffic {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 3px;
  margin: 10px 0 24px;
}

.admin-resolution-traffic-bar {
  position: relative;
  height: 52px;
  min-width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--surface-raised, var(--surface));
  color: var(--text-muted);
  cursor: pointer;
}

.admin-resolution-traffic-bar > span {
  position: absolute;
  inset-inline: 2px;
  bottom: 2px;
  height: max(2px, var(--traffic-height));
  max-height: calc(100% - 4px);
  border-radius: 2px;
  background: color-mix(in srgb, var(--text-muted) 75%, var(--surface));
  pointer-events: none;
}

.admin-resolution-traffic-bar.is-recommended {
  background: color-mix(in srgb, var(--surface) 84%, var(--accent));
}

.admin-resolution-traffic-bar.is-recommended > span {
  background: var(--accent);
}

.admin-resolution-traffic-bar:hover,
.admin-resolution-traffic-bar[aria-pressed="true"] {
  border-color: var(--accent);
}

.admin-resolution-traffic-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  z-index: 1;
}

.admin-resolution-traffic-bar > small {
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 2px);
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
}

.admin-resolution-start {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
}

.admin-resolution-start label {
  display: grid;
  gap: 4px;
}

.admin-resolution-start [data-resolution-schedule-reset][hidden] {
  display: none;
}

.admin-resolution-error {
  color: var(--danger);
}

.admin-resolution-rebuild-modal .app-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

@media (max-width: 520px) {
  .admin-resolution-rebuild-modal .app-modal-body {
    padding: 14px;
  }

  .admin-resolution-impact > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-resolution-traffic {
    gap: 1px;
  }

  .admin-resolution-traffic-bar > span {
    inset-inline: 1px;
  }

  .admin-resolution-rebuild-modal .app-modal-actions {
    position: sticky;
    bottom: -14px;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 -14px -14px;
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
  }

  .admin-resolution-rebuild-modal .app-modal-actions .btn {
    padding-inline: 8px;
    font-size: .8125rem;
    white-space: normal;
  }

  .admin-resolution-rebuild-modal .app-modal-actions [data-modal-close] {
    grid-column: 1 / -1;
  }
}

/* Admin > Stats (SUB468): filters, grouped headline figures with change
   against the previous range, one trend chart and the breakdown tables. */
.admin-stats {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.admin-stats-filters {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.admin-stats-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 0.65rem;
}

.admin-stats-filter-row .form-label {
  margin-bottom: 0.25rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
}

.admin-stats-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-stats-filter-actions .admin-period-summary {
  flex: 1 1 16rem;
  grid-column: auto;
}

.admin-stats-compare {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0.5rem 0 0;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-stats-focus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--accent) 12%);
}

.admin-stats-focus > div:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
}

.admin-stats-focus > div:first-child > span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-stats-focus strong {
  font-size: 1.15rem;
}

.admin-stats-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-stats-group {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
}

.admin-stats-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
}

.admin-stats-group-head h2,
.admin-stats-table-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.admin-stats-note {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.admin-stats-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.6rem;
}

.admin-stats-kpi {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.admin-stats-kpi-label {
  justify-self: start;
  overflow: hidden;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-stats-kpi > strong {
  overflow: hidden;
  color: var(--text);
  font-size: clamp(1.2rem, 1.6vw, 1.55rem);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-stats-kpi-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.5rem;
  min-height: 1.1rem;
}

.admin-stats-kpi-foot small {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.admin-stats-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.admin-stats-trend i {
  font-size: 0.6rem;
  font-style: normal;
}

.admin-stats-trend.is-better { background: color-mix(in srgb, #78d6a3 14%, transparent); color: #78d6a3; }
.admin-stats-trend.is-worse { background: color-mix(in srgb, #ff8588 14%, transparent); color: #ff8588; }
.admin-stats-trend.is-flat { background: color-mix(in srgb, var(--text-muted) 14%, transparent); color: var(--text-muted); }

.admin-stats-kpi.is-unfiltered {
  border-style: dashed;
}

.admin-stats-kpi.is-unfiltered > strong {
  color: var(--text-soft);
}

.admin-stats-chart-panel .section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-stats-chart-panel .section-heading h2 {
  margin: 0;
}

.admin-stats-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.admin-stats-legend i {
  display: inline-block;
  width: 1.1rem;
  height: 0;
  margin-left: 0.5rem;
  border-top: 3px solid var(--accent-strong);
}

.admin-stats-legend i.is-previous {
  border-top: 2px dashed var(--text-muted);
}

.admin-stats .admin-activity-chart .admin-overview-state {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.creator-sales-chart-canvas .chart-compare {
  fill: none;
  stroke: var(--text-muted);
  stroke-dasharray: 5 5;
  stroke-opacity: 0.75;
  stroke-width: 2;
}

.admin-chart-tooltip div.is-previous {
  margin-top: 0.25rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  min-width: 0;
}

.admin-stats-table {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-width: 0;
}

.admin-stats-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-stats-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: 34rem;
  overflow: auto;
}

.admin-stats-table th small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.admin-stats-zero {
  color: var(--text-muted);
}

.admin-stats-cancellation-reason {
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
}

.admin-stats-cancellation-note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-stats-table td.is-partial {
  text-decoration: underline dotted var(--text-muted);
  text-underline-offset: 3px;
}

.admin-stats-cohort {
  background: color-mix(in srgb, var(--accent) calc(var(--cohort, 0%) * 0.45), transparent);
}

@media (max-width: 1599px) {
  .admin-stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .admin-stats-filters {
    padding: 0.75rem;
  }

  .admin-stats-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stats-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stats-kpi {
    padding: 0.7rem 0.75rem;
  }

  .admin-stats-filter-actions > .btn {
    flex: 1 1 auto;
  }
}

/* Phones: the breakdowns stay compact tables that scroll sideways under
   their pinned name column, and grow with the page instead of in a box. */
@media (max-width: 720px) {
  .admin-stats-table-wrap {
    max-height: none;
  }

  .admin-stats-table-head .admin-data-actions {
    flex-wrap: nowrap;
  }

  .admin-stats-table tbody th[scope="row"] {
    max-width: 10rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .admin-stats .table-page-controls > div {
    flex-wrap: nowrap;
  }

  .admin-stats .table-page-controls .btn {
    flex: 0 0 auto;
    width: auto;
  }
}

.tax-figures-chooser { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.tax-figures-chooser > div { display: grid; gap: .4rem; }
.tax-figures-chooser .form-label { margin: 0; }
.tax-figures-chooser input[type="number"] { width: 7rem; }
.tax-figures-chooser .btn { margin-bottom: 0; }
.tax-figures-chooser > div[hidden] { display: none; }
.admin-tax-figures .app-table thead th:not(:first-child) { text-align: right; }
.tax-figures-facts { display: flex; flex-wrap: wrap; gap: 1.25rem 3rem; margin: 1rem 0; }
.tax-figures-facts dt { color: var(--text-soft); font-size: .85rem; }
.tax-figures-facts dd { margin: .3rem 0 0; font-variant-numeric: tabular-nums; }
.tax-figures-flags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tax-figures-flags .tier-status-badge { max-width: 100%; white-space: normal; }
.admin-tax-figures .app-table th:first-child { white-space: normal; }
.admin-tax-figures .app-table td { font-variant-numeric: tabular-nums; }
.tax-figures-total { font-weight: 700; background: var(--surface-raised, #292b30); }
@media (max-width: 600px) { .tax-figures-chooser > div { flex: 1 1 8rem; } .tax-figures-chooser .btn { width: 100%; } }
@media (max-width: 700px) {
  .admin-tax-figures .app-table { display: block; width: 100%; min-width: 0; }
  .admin-tax-figures .app-table.responsive-table-ready thead { display: none; }
  .admin-tax-figures .app-table tbody { display: block; }
  .admin-tax-figures .app-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--border); padding: .65rem 0; }
  .admin-tax-figures .app-table th { grid-column: 1 / -1; text-align: left; }
  .admin-tax-figures .app-table.responsive-table-ready tbody td { display: flex; flex-direction: column; align-items: flex-end !important; text-align: right !important; gap: .15rem; min-width: 0; }
  .admin-tax-figures .app-table.responsive-table-ready tbody td:empty { visibility: hidden; }
  .admin-tax-figures .app-table.responsive-table-ready tbody td::before { content: attr(data-label); color: var(--text-soft); font-size: .75rem; font-weight: 400; letter-spacing: normal; text-transform: none; }
  .admin-tax-figures .app-table.responsive-table-ready td, .admin-tax-figures .app-table.responsive-table-ready th { border: 0 !important; padding: .4rem .65rem !important; }
}


/* Content-detail moderation page (#51 third redesign): a proper table, one
 * row per report, sortable via the plain GET <select> next to the heading. */
.admin-report-sort-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-report-sort-form .form-select {
  width: auto;
}

.admin-report-detail-table {
  table-layout: fixed;
}

.admin-report-detail-list {
  width: 100%;
  overflow: visible;
}

.admin-report-detail-table th,
.admin-report-detail-table td {
  vertical-align: top;
}

.admin-report-detail-table th:nth-child(1),
.admin-report-detail-table td:nth-child(1) {
  width: 14%;
}

.admin-report-detail-table th:nth-child(2),
.admin-report-detail-table td:nth-child(2) {
  width: 10%;
}

.admin-report-detail-table th:nth-child(3),
.admin-report-detail-table td:nth-child(3) {
  width: 12%;
}

.admin-report-detail-table th:nth-child(5),
.admin-report-detail-table td:nth-child(5) {
  width: 64px;
}

.admin-report-reason {
  color: var(--text-soft);
  white-space: normal;
  word-break: break-word;
}

.admin-reports-thumb-menu {
  position: relative;
}

.admin-reports-thumb-menu summary {
  cursor: pointer;
  list-style: none;
}

.admin-reports-thumb-menu summary::-webkit-details-marker {
  display: none;
}

/* Small solid colour circular fine/act triggers - both the per-report table
 * controls and the lightbox's mirrored pair use this same class so they
 * always look identical (#51 third redesign: image actions must match the
 * table's thumbsup/thumbsdown exactly). */
.admin-thumb-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* #51 fourth redesign: single "Moderate" button per row/image opens one
 * shared <dialog> instead of two anchored per-row dropdowns - Fine (benign,
 * green) on the left, Act (accurate, red) side by side. */
.report-moderate-dialog {
  width: min(760px, calc(100vw - 2rem));
}

.report-moderate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .report-moderate-grid {
    grid-template-columns: 1fr;
  }
}

.report-moderate-col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.report-moderate-col-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: -0.85rem -0.85rem 0.3rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.report-moderate-col-head svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.report-moderate-col-head span {
  font-weight: 400;
  font-size: 0.943rem;
  color: var(--text-soft);
}

.report-moderate-col-head-fine {
  background: rgba(87, 199, 133, 0.14);
  color: #b7f0cd;
}

.report-moderate-col-head-act {
  background: rgba(225, 109, 119, 0.14);
  color: #ffbdc5;
}

.report-moderate-fine .admin-report-option-note {
  color: var(--text-soft);
  font-size: 1.012rem;
  margin: 0;
}

.admin-reports-thumb-form {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.3rem);
  right: 0;
  display: grid;
  gap: 0.4rem;
  width: max-content;
  min-width: 280px;
  max-width: 380px;
  padding: 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}

/* Every checkbox/radio option in a fine/act dropdown gets its own line -
 * `.creator-table-check` is `display: inline-flex`, which let several
 * options flow onto the same line like wrapped text (#51 third redesign:
 * "The entries for reporter actions are not listed nicely. There are
 * multiple on the same line."). */
.admin-report-option {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--text-soft);
}

.admin-report-option-label {
  display: block;
  margin: 0.2rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Reporter-punishment multi-select, bundled into the thumbsup/"fine"
 * dropdown (#51 third redesign: reporter punishment moved out of thumbsdown
 * - "The FINE should have the punishment actions towards reporters as
 * well"). One radio group (mutually exclusive by construction) plus one
 * independent "unreport all" checkbox. */
.admin-reporter-fieldset {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 0.3rem;
}

.admin-reporter-fieldset legend {
  font-size: 0.92rem;
  color: var(--text-muted);
  padding: 0 0.2rem;
}

/* Admin lightbox media actions (#51 third redesign): cloned from
 * #admin-media-action-template only on the content-detail page, so the
 * public lightbox never shows these. Small and side by side at the top of
 * the viewer, matching .admin-thumb-btn exactly. */
.media-lightbox-admin-actions:not([hidden]) {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* The template's root wrapper div - without an explicit flex/inline-flex
 * here the two cloned <form> elements (block-level by default) stacked
 * vertically inside it despite the flex row on the parent above (#51 third
 * redesign: "The thumbs up/down are VERTICAL, they should be side-by-side"). */
.admin-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-meta-list {
  display: grid;
  gap: 0.28rem;
}

.sidebar-meta-item {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.35;
}

/* #152: Memberships/Unlocks rows are creators - they navigate to that creator. */
a.sidebar-meta-link {
  display: block;
  padding: 0.12rem 0.3rem;
  margin: 0 -0.3rem;
  border-radius: 6px;
  text-decoration: none;
}

a.sidebar-meta-link:hover,
a.sidebar-meta-link:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--scheme-text) 6%, transparent);
}

.sidebar-profile-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.settings-card {
  background: rgba(255, 255, 255, 0.03);
}

.settings-quick-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.settings-quick-actions form {
  margin: 0;
}

.settings-danger-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 0.75rem;
  border: 1px solid #d12f40;
  border-radius: var(--radius-md);
  background: rgba(209, 47, 64, 0.14);
  box-shadow: inset 3px 0 0 #f04a59;
}

.settings-danger-action h3,
.settings-danger-action p {
  margin: 0;
}

.settings-danger-action h3 {
  color: #ffb7bf;
  font-size: 0.95rem;
}

.settings-danger-action p {
  margin-top: 0.2rem;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.auth-wrap {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
  padding: 0.75rem 0.01rem;
}

.auth-card {
  width: min(100%, 620px);
  margin: 0 auto;
}

.auth-card-inner {
  padding: clamp(1.6rem, 3vw, 2.4rem);
}

.auth-kicker {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.897rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.auth-card h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

.auth-subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.auth-form,
.account-action-stack {
  display: grid;
  gap: 0.95rem;
}

.auth-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}


/* Login page bottom row (#43): Save login information left, Create account
 * centered, Forgot password right - all on one row below the Sign In
 * button. */
.auth-bottom-row {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.012rem;
}

.auth-bottom-row > :first-child {
  justify-self: start;
}

.auth-bottom-row > :nth-child(2) {
  justify-self: center;
}

.auth-bottom-row > :last-child {
  justify-self: end;
}

.auth-bottom-row a {
  color: var(--text-soft);
  text-decoration: underline;
}

.auth-bottom-row a:hover,
.auth-bottom-row a:focus-visible {
  color: #fff;
}

.auth-hint {
  margin: 0.3rem 0 0;
  font-size: 0.897rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.auth-field.is-valid .auth-hint {
  color: #7fce8f;
}

.auth-field.is-invalid .auth-hint {
  color: #e88b93;
}

.auth-field.is-valid .auth-input {
  border-color: rgba(127, 206, 143, 0.55);
}

.auth-field.is-invalid .auth-input {
  border-color: rgba(232, 139, 147, 0.6);
}

.auth-error {
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 139, 147, 0.4);
  background: rgba(225, 109, 119, 0.12);
  color: #f0b8bc;
  font-size: 0.989rem;
  line-height: 1.4;
}

.auth-note {
  margin: 0 0 1.15rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-note strong {
  color: var(--text);
  word-break: break-word;
}

.auth-button[disabled] {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.auth-signin-button {
  text-decoration: none;
}

.auth-links a {
  color: var(--text-soft);
  text-decoration: none;
}

.auth-links a:hover,
.auth-links a:focus-visible {
  color: var(--text);
}

main.app-content.auth-wrap {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 2.5rem max(1rem, var(--gutter)) 3rem;
}

.auth-card {
  width: min(100%, 470px);
  margin: 0 auto;
}

.auth-page-register .auth-card {
  width: min(100%, 520px);
}

.auth-card-inner {
  padding: clamp(1.6rem, 4vw, 2.5rem);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 18px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 5%, var(--surface)), var(--surface));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.auth-card h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  letter-spacing: -0.035em;
}

.auth-form {
  gap: 1rem;
}

.auth-field,
.auth-input,
.auth-button {
  width: 100%;
  max-width: none;
}

.auth-input {
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--chrome) 76%, transparent);
}

.auth-password-control { position: relative; width: 100%; }
.auth-page .auth-input[hidden] { display: none; }
.auth-page .auth-password-control .auth-input { padding-right: 48px; }
.auth-password-toggle { position: absolute; top: 0; right: 3px; bottom: 0; display: grid; place-items: center; width: 42px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #fff; cursor: pointer; }
.auth-password-toggle:hover { color: #fff; }
.auth-password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.auth-password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.auth-button {
  min-height: 44px;
  margin-top: 0.2rem;
}

.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.auth-options-row .auth-checkbox-label {
  font-size: inherit;
}

.auth-options-row a,
.auth-switch a {
  color: var(--accent-strong);
  text-decoration: none;
}

.auth-switch {
  margin: 1.25rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.9rem;
  text-align: center;
}

.content-directory-filters {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
}

.content-directory-filters .form-select {
  max-width: none;
}

.content-directory-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.25rem;
}

.content-directory-header-tools {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.content-directory-view-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
}

:root .content-directory-view-switch [data-content-directory-view] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.content-directory-view-switch [data-content-directory-view]:last-child {
  border-right: 0;
}

:root .content-directory-view-switch [data-content-directory-view].is-active {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  color: #fff;
}

.content-directory-view-switch svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
}

.content-directory-card-scale {
  display: inline-flex;
  align-items: center;
}

.content-directory-card-scale input {
  width: 120px;
  accent-color: var(--accent);
  cursor: pointer;
}

.content-directory-header h1 {
  margin: 0.1rem 0 0.35rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.045em;
}

.content-directory-header p:last-child {
  margin: 0;
  color: var(--text-soft);
}

.content-directory-total {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.content-directory-total strong {
  color: var(--text);
  font-size: 1.65rem;
  font-variant-numeric: tabular-nums;
}

/* SUB280 The count sits before the controls, so a count that gains a digit
   never moves the right-aligned slider. */
.content-directory-header-tools--desktop .content-directory-total {
  order: -1;
}

.content-directory-search > label,
.content-directory-search-head > label,
.content-directory-filter-grid label {
  display: grid;
  gap: 0.4rem;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* The filter card's heading line: its name, then the count and view controls on the right. */
.content-directory-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.content-directory-search-head > .content-directory-header-tools--desktop {
  margin-left: auto;
}

.content-directory-search-head .content-directory-total strong {
  font-size: 1.25rem;
}

.content-directory-filters > .content-directory-header-tools--mobile {
  margin-top: 0.75rem;
}

.content-directory-search-control {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
}

.content-directory-search-control > span {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-soft);
  transform: translateY(-50%);
  pointer-events: none;
}

.content-directory-search-control svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.content-directory-search-control .form-control {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding-left: 2.7rem;
  font-size: 0.98rem;
}

.content-directory-search-control .btn-key-action {
  flex: 0 0 auto;
  width: auto;
  min-height: 48px;
}

.content-directory-filter-grid {
  display: grid;
  /* Every column is wide enough for its longest "All ..." option; the
     filters wrap to another row when the listing is narrower (SUB-47). */
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.content-directory-sort-controls {
  /* Sort by and Invert take two columns. */
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem;
}

.content-directory-invert-sort {
  display: inline-flex !important;
  align-items: center;
  min-height: 40px;
  gap: 0.4rem;
  white-space: nowrap;
  cursor: pointer;
}

.content-directory-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.4rem;
  margin-top: 0.7rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.content-directory-filter-footer a,
.content-directory-empty a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.content-directory-results {
  margin-top: 1.5rem;
}

/* A listing never grows past its column: a wide list scrolls inside it. */
.content-directory,
.content-directory > * {
  min-width: 0;
}

.content-directory-grid {
  display: grid;
  gap: 1rem;
}

.content-directory-grid .creator-gallery-media {
  aspect-ratio: var(--release-media-ratio);
}

.content-directory-grid .creator-gallery-media img,
.content-directory-grid .creator-gallery-media video {
  object-fit: cover;
}

.content-directory-grid .creator-gallery-title,
.content-directory-grid .creator-gallery-taxonomy a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-directory-grid .creator-gallery-taxonomy a {
  display: block;
}

.content-directory-grid.is-compact .creator-gallery-taxonomy {
  flex-wrap: wrap;
}

.content-directory-grid.is-compact .creator-gallery-date {
  flex-basis: 100%;
  margin-left: 0;
  padding-left: 0;
}

.content-directory-list {
  display: none;
}

.content-directory-list-architecture-label,
.content-directory-list-version-label,
.content-directory-list-date-label {
  display: none;
}

.content-directory.is-list-view .content-directory-grid,
.content-directory.is-list-view .content-directory-card-scale {
  display: none;
}

.content-directory.is-list-view .content-directory-list {
  display: block;
}

/* The list column picker (SUB-47) only applies to the list view. */
.content-directory:not(.is-list-view) .content-directory-columns-button {
  display: none;
}

/* The same compact gear as the Creator > Content and Earnings column pickers. */
.content-directory .content-directory-columns-button {
  width: auto;
  min-height: 40px;
  padding: 0 0.45rem;
  border-radius: 9px;
  font-size: 0.9rem;
  line-height: 1.2;
}

/* Hidden columns stay hidden in the phone card layout too, so every header
   keeps lining up with its cells. */
.content-directory-list-table [hidden] {
  display: none !important;
}

.content-directory-list-label {
  display: none;
}

/* Content lists keep the title compact and give the summary the remaining
   space. Names wrap; summaries use two lines before the column drops on
   narrower screens. Other columns keep their natural heading width. */
.content-directory-list-table th,
.content-directory-list-table td {
  white-space: nowrap;
}

.content-directory-list-title .cell-clip {
  display: inline-block;
  max-width: 100%;
  vertical-align: bottom;
}

/* SUB281 A square thumbnail one title line tall, so rows keep their height. */
.content-list-thumb {
  display: inline-block;
  width: 1lh;
  height: 1lh;
  margin-right: 0.55em;
  overflow: hidden;
  border-radius: 5px;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--border);
  vertical-align: top;
}

.content-list-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The management table's existing cells set the row height. */
.content-list-title-with-thumbnail {
  --content-list-row-thumbnail-size: 2.25rem;
  position: relative;
}

.content-list-title-with-thumbnail .content-list-thumb {
  position: absolute;
  inset-block-start: 50%;
  width: auto;
  height: min(var(--content-list-row-thumbnail-size), 100%);
  aspect-ratio: 1;
  margin: 0;
  transform: translateY(-50%);
}

.content-list-title-text {
  margin-inline-start: calc(var(--content-list-row-thumbnail-size) + 0.55em);
}

@media (max-width: 720px) {
  .content-list-featured-title {
    --content-list-row-thumbnail-size: 1lh;
    position: relative;
  }
}

@media (min-width: 721px) {
  .content-directory-list-table {
    table-layout: auto;
    width: 100%;
  }

  .content-directory-list-table :is(th, td) {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .content-directory-list-table .content-listing-column-creator { width: 9rem; min-width: 8rem; }
  .content-directory-list-table .content-listing-column-title { width: 1%; min-width: 13.75rem; }
  .content-directory-list-table .content-listing-column-version { width: 6.75rem; }
  .content-directory-list-table .content-listing-column-description { width: 100%; }
  .content-directory-list-description .cell-clip {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .content-directory-list-table .content-listing-column-architectures { width: 10rem; }
  .content-directory-list-table .content-listing-column-locked { width: 6.5rem; }
  .content-directory-list-table .content-listing-column-tier { width: 10rem; }
  .content-directory-list-table .content-listing-column-price { width: 9rem; }
  .content-directory-list-table .content-listing-column-type { width: 9rem; }
  .content-directory-list-table .content-listing-column-files { width: 5.5rem; }
  .content-directory-list-table .content-listing-column-size { width: 6.5rem; }
  .content-directory-list-table .content-listing-column-released,
  .content-directory-list-table .content-listing-column-updated { width: 12.5rem; }

  /* Set by content-directory.js when the list is too narrow for it. */
  .content-directory-list-table.is-description-squeezed .content-listing-column-description {
    display: none;
  }

  .content-directory-list-table.is-description-squeezed .content-listing-column-title {
    width: auto;
  }
}

.content-directory-list-row.is-new > td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.content-directory-list-row.is-new .content-directory-list-title .creator-ops-title {
  font-weight: 800;
}

.content-directory-list-tier,
.content-directory-list-architecture {
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-directory-list-tier .creator-tier-badge + .creator-tier-badge {
  margin-left: 0.3rem;
}

.content-directory-list-table .creator-price-badge-form {
  position: static;
}

/* In a list row the price badge and tier tags keep the row's text height. */
.content-directory-list-table .creator-price-badge,
.content-directory-list-table .creator-tier-badge,
.content-directory-list-table .creator-content-access-status {
  min-height: 0;
  padding: 0.05rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

/* A listing without a heading keeps its view controls on the right. */
.content-directory-header > .content-directory-header-tools--desktop {
  margin-left: auto;
}

/* On a single creator's cards the Locked state and tier tags sit where the
   creator name sits elsewhere, so the cards keep one size. */
.creator-gallery-taxonomy .creator-gallery-access {
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
  gap: 0.3rem;
}

/* A long status and tier row never widens the card past its column: the
   tags give way and the date stays whole. */
.content-directory-grid .creator-gallery-taxonomy {
  min-width: 0;
}

.content-directory-grid .creator-gallery-taxonomy .creator-gallery-date {
  flex-shrink: 0;
}

.creator-gallery-taxonomy .creator-gallery-access .creator-tier-badge,
.creator-gallery-taxonomy .creator-content-access-status {
  flex: 0 0 auto;
  padding: 0.05rem 0.45rem;
  font-size: 0.76rem;
}

/* A listing inside a panel (creator page, Home, Updates, search) has a small
   section heading, so its controls sit on the heading's line. */
.panel.content-directory .content-directory-header {
  align-items: center;
  margin-bottom: 0.85rem;
}

/* Section actions (Browse All Content, Mark all as read) follow the heading. */
.content-directory-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: auto;
  margin-left: -1rem;
}

.content-directory-empty {
  margin-top: 1rem;
}

.content-directory-empty p {
  margin-bottom: 0.45rem;
}

.content-directory-pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.content-directory-page,
.content-directory-page-gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-soft);
  text-decoration: none;
}

.content-directory-page {
  background: var(--surface-raised);
  color: #fff;
}

.content-directory-page:hover,
.content-directory-page:focus-visible,
.content-directory-page.is-active {
  border-color: transparent;
  background: var(--btn-fill);
  color: #fff;
}

.admin-taxonomy-create {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.8rem;
}

.admin-precision-create {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.admin-architecture-create {
  grid-template-columns: minmax(0, 0.5fr) minmax(0, 0.35fr) repeat(2, minmax(0, 1fr)) minmax(0, 0.8fr) auto;
  width: 100%;
}

/* Narrower screens: two fields per row (name | abbreviation, the two links,
   licence | button) instead of six fixed columns spilling sideways. */
@media (min-width: 721px) and (max-width: 1365px) {
  .admin-architecture-create {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-architecture-create .btn {
  justify-self: start;
}

.admin-taxonomy-create [data-form-message] {
  grid-column: 1 / -1;
}

.admin-taxonomy-table {
  margin-top: 1rem;
}

.admin-taxonomy-table .form-control,
.admin-taxonomy-table .form-select {
  min-width: 140px;
}

.admin-taxonomy-enabled,
.admin-taxonomy-order {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-taxonomy-enabled {
  white-space: nowrap;
}

.admin-taxonomy-action-cell {
  width: 1%;
  white-space: nowrap;
}

.admin-taxonomy-drag-cell {
  width: 1.6rem;
  padding-right: 0.15rem;
  padding-left: 0.15rem;
}

.admin-taxonomy-drag-handle {
  padding: 0.25rem 0.4rem;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.admin-taxonomy-drag-handle svg {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.admin-taxonomy-drag-handle svg path {
  fill: currentColor;
}

.admin-taxonomy-drag-handle:active {
  cursor: pointer;
}

[data-architecture-row].is-dragging,
[data-precision-row].is-dragging {
  opacity: 0.55;
}

.admin-precision-table {
  width: max-content;
  min-width: 100%;
}

.admin-precision-table th:nth-child(2),
.admin-precision-table td:nth-child(2) {
  min-width: 144px;
}

.admin-precision-table .admin-taxonomy-drag-cell {
  width: 0.8rem;
}

.admin-precision-architecture-heading {
  width: 1.2rem;
  min-width: 1.2rem;
  height: 7rem;
  padding: 0.4rem 0.25rem;
  text-align: center;
  vertical-align: bottom;
}

.admin-precision-architecture-heading span {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.admin-precision-support-cell {
  width: 1.2rem;
  padding-right: 0.25rem;
  padding-left: 0.25rem;
  text-align: center;
}

.admin-precision-support-cell input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.admin-architecture-table th:nth-child(2),
.admin-architecture-table td:nth-child(2) {
  width: 18%;
  min-width: 230px;
}

.admin-architecture-table th:nth-child(3),
.admin-architecture-table td:nth-child(3) {
  width: 5.4%;
}

.admin-architecture-table td:nth-child(2) .form-control {
  min-width: 210px;
}

.admin-architecture-table td:nth-child(3) .form-control {
  min-width: 90px;
}

.admin-architecture-table th:nth-child(4),
.admin-architecture-table td:nth-child(4),
.admin-architecture-table th:nth-child(5),
.admin-architecture-table td:nth-child(5) {
  min-width: 170px;
}

/* SUB176 Names show in full; the long links scroll inside their narrower fields. */
.admin-architecture-table td:nth-child(4) .form-control,
.admin-architecture-table td:nth-child(5) .form-control {
  min-width: 150px;
}

.admin-architecture-table th:nth-child(6),
.admin-architecture-table td:nth-child(6) {
  min-width: 220px;
}

.admin-taxonomy-action-form {
  display: grid;
  gap: 0.85rem;
}

@media (max-width: 720px) {
  .admin-architecture-create {
    width: 100%;
  }

  .app-header .app-header-lead {
    flex: 0 1 auto;
    width: auto;
  }

  .app-header .site-brand-text {
    display: none;
  }

  .app-header-guest-actions {
    margin-left: auto;
    gap: 0.55rem;
    padding-right: 0.65rem;
  }

  .app-header-guest-actions .site-nav-link {
    font-size: 0.84rem;
  }

  .app-header-guest-actions .btn {
    width: auto;
    padding-right: 0.55rem;
    padding-left: 0.55rem;
    font-size: 0.84rem;
  }

  .content-directory-filters {
    padding: 0.8rem;
  }

  .content-directory-header {
    align-items: start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .content-directory-filter-grid {
    grid-template-columns: 1fr;
  }

  .admin-taxonomy-create,
  .admin-precision-create {
    grid-template-columns: 1fr;
  }

  .admin-taxonomy-create [data-form-message] {
    grid-column: auto;
  }

  .auth-options-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 721px) and (max-width: 1050px) {
  .content-directory-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-directory-filter-grid > label:last-child,
  .content-directory-sort-controls {
    grid-column: span 2;
  }

}

[data-gallery] [data-media-item] {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

[data-gallery] [data-media-item]:hover {
  opacity: 0.96;
}

[data-gallery-dot].is-active {
  background: var(--btn-fill);
  color: #fff;
  border-color: transparent;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 9, 0.9);
  backdrop-filter: blur(4px);
  z-index: 1100;
}

.media-lightbox.is-open {
  display: flex;
}

body.lightbox-open {
  overflow: hidden;
  position: fixed;
  top: var(--lightbox-scroll-offset, 0);
  width: 100%;
  overscroll-behavior: none;
}

.media-lightbox-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 2.5rem);
  width: 100%;
  height: 100%;
  padding: 0 clamp(3rem, 8vw, 6rem);
}

/* Registration User Agreement gate. The dialog blocks the form on arrival, so
   inside the form itself only a compact "accepted" receipt plus a review link
   remain. */
.auth-agreement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.auth-agreement-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--success);
}

.auth-agreement-version {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.auth-agreement-intro {
  margin: 0 0 0.9rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.auth-agreement-rules {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  line-height: 1.5;
}

.auth-agreement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Keep the required agreement's title and version aligned. */
.auth-agreement-gate .app-modal-head {
  align-items: baseline;
}

/* Email confirmation notice: the address and the explanation used to be jammed
   onto one line ("<email>: <message>"). They are now stacked as a labelled
   block so the address reads as the subject of the page. */
.auth-verify-note {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  text-align: left;
}

.auth-verify-note p {
  margin: 0;
}

.auth-verify-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.auth-verify-email strong {
  font-size: 1.05rem;
  word-break: break-word;
}

.auth-verify-message {
  color: var(--text-soft);
  line-height: 1.5;
}


.media-lightbox {
  --lightbox-main-width: min(66vw, 1240px);
  --lightbox-side-width: calc(50vw - min(33vw, 620px) - var(--lightbox-side-gap));
  --lightbox-metadata-width: clamp(20rem, 29vw, 30rem);
  --lightbox-side-panel-width: clamp(8rem, 11vw, 13rem);
  --lightbox-side-height: 82vh;
  --lightbox-side-opacity: 0.38;
  --lightbox-side-gap: clamp(0.4rem, 1vw, 1rem);
  --lightbox-bottom-height: 96px;
  --lightbox-media-radius: 14px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(7px) brightness(0.72);
  overscroll-behavior: none;
  touch-action: none;
}

.media-lightbox-track {
  gap: var(--lightbox-side-gap);
  padding: 0 clamp(1rem, 3vw, 3rem);
}

/* The current image keeps a fixed footprint so loading the full-resolution
   source never resizes the viewer (object-fit letterboxes within the box). */
.media-lightbox-current {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--lightbox-main-width);
  height: calc(100vh - var(--lightbox-bottom-height) - 0.75rem);
  margin-bottom: var(--lightbox-bottom-height);
}

.media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--lightbox-metadata-width);
  gap: 0;
  padding: 0;
}

.media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-current {
  width: 100%;
  min-width: 0;
  height: 100vh;
  padding: clamp(1rem, 3vw, 2.5rem) calc(var(--lightbox-side-panel-width) + var(--lightbox-side-gap)) calc(var(--lightbox-bottom-height) + 0.75rem);
  margin-bottom: 0;
  box-sizing: border-box;
}

.media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-side {
  position: absolute;
  top: 50%;
  display: flex;
  width: var(--lightbox-side-panel-width);
  height: 78vh;
  z-index: 3;
}

.media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-side-prev {
  left: 0;
  transform: translateY(-50%);
}

.media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-side-next {
  right: var(--lightbox-metadata-width);
  transform: translateY(-50%);
}

.media-lightbox-ai-metadata:not([hidden]) {
  position: relative;
  align-self: stretch;
  min-width: 0;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-left: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  z-index: 2;
}

.media-lightbox-ai-metadata-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -5px;
  width: 10px;
  cursor: col-resize;
  touch-action: none;
  z-index: 4;
}

.media-lightbox-ai-metadata-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  background: transparent;
  transition: background-color 0.15s ease;
}

.media-lightbox-ai-metadata-resizer:hover::after,
.media-lightbox-ai-metadata-resizer:focus-visible::after,
body.is-resizing-lightbox-metadata .media-lightbox-ai-metadata-resizer::after {
  background: var(--accent);
}

body.is-resizing-lightbox-metadata {
  cursor: col-resize;
  user-select: none;
}

.media-lightbox-ai-metadata header {
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 7rem 0 1rem;
  border-bottom: 1px solid var(--border);
}

.media-lightbox-ai-metadata h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.media-lightbox-ai-metadata dl {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 0 0.5rem;
  height: calc(100vh - 3.75rem);
  margin: 0;
  padding: 0 1rem 1rem;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.media-lightbox-ai-metadata-row {
  flex: 1 1 7rem;
  min-width: 0;
  padding: 0.5rem 0.5rem 0.5rem 0;
}

.media-lightbox-ai-metadata-row.is-prompt {
  flex: 0 0 100%;
}

.media-lightbox-ai-metadata-row.is-primary-prompt {
  border-bottom: 1px solid var(--border);
}

.media-lightbox-ai-metadata dt {
  margin-bottom: 0.2rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.media-lightbox-ai-metadata dd {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.media-lightbox-ai-metadata-row:not(.is-prompt) dd {
  overflow-wrap: normal;
  white-space: nowrap;
}

.media-lightbox-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 6;
}

.media-lightbox-menu-wrap {
  position: relative;
}

.media-lightbox-menu-toggle,
.media-lightbox-close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(20, 24, 30, 0.78);
  color: #f4f7fa;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.media-lightbox-menu-toggle:hover,
.media-lightbox-menu-toggle[aria-expanded="true"],
.media-lightbox-close:hover {
  background: rgba(40, 46, 54, 0.94);
  border-color: rgba(255, 255, 255, 0.34);
}

.media-lightbox-menu-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.media-lightbox-menu:not([hidden]) {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: grid;
  width: min(17rem, calc(100vw - 1rem));
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(24, 28, 34, 0.98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  color: #f4f7fa;
}

.media-lightbox-menu-item {
  width: 100%;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #f4f7fa;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.media-lightbox-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.media-lightbox-menu-item[hidden] {
  display: none;
}

.media-lightbox-menu-item:disabled {
  opacity: 0.42;
  cursor: default;
}

.media-lightbox-menu-item svg,
.media-lightbox-menu-symbol {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
}

.media-lightbox-menu-item svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-lightbox-menu-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.media-lightbox-menu-check input {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 1.3rem;
  margin: 0;
  padding: 0.15rem;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.media-lightbox-menu-check input::before {
  content: "";
  display: block;
  width: 0.88rem;
  height: 0.88rem;
  border-radius: 50%;
  background: #f4f7fa;
  transition: transform 0.16s ease;
}

.media-lightbox-menu-check input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.media-lightbox-menu-check input:checked::before {
  transform: translateX(1.02rem);
}

.media-lightbox-menu-check input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.media-lightbox-menu-check input:disabled {
  opacity: 0.42;
  cursor: default;
}

.preview-ai-metadata-editor {
  width: 100%;
}

.preview-ai-metadata-fields {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.media-lightbox-current img,
.media-lightbox-current video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--lightbox-media-radius);
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.media-lightbox-current {
  touch-action: none;
}

video:fullscreen {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #000;
}

video:-webkit-full-screen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.media-lightbox-current > img:not(.media-lightbox-swipe-incoming),
.media-lightbox-current > video:not(.media-lightbox-swipe-incoming) {
  position: relative;
  z-index: 1;
}

.media-lightbox-swipe-incoming {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* #51 second redesign: the lightbox rebuilds a fresh <img>/<video> per image
 * (renderLightboxItem's buildMedia()), so it never inherited the grid
 * figure's .is-reported class - the red outline simply never reached the
 * viewer. gallery.js now toggles this class on the stage directly. */
.media-lightbox-current.is-reported img,
.media-lightbox-current.is-reported video {
  outline: 4px solid var(--danger, #e0524d);
  outline-offset: -2px;
}

.media-lightbox-side {
  position: absolute;
  top: 50%;
  flex: 0 0 var(--lightbox-side-width);
  width: var(--lightbox-side-width);
  max-width: none;
  height: var(--lightbox-side-height);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: var(--lightbox-side-opacity);
  filter: saturate(0.85);
  transition: opacity 0.2s ease, transform 0.22s ease, filter 0.22s ease;
  overflow: visible;
}

.media-lightbox-current.is-loading::after,
.media-lightbox-side.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.8rem;
  height: 1.8rem;
  margin: -0.9rem 0 0 -0.9rem;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: media-lightbox-spin 0.7s linear infinite, media-lightbox-spinner-reveal 0s linear 0.6s forwards;
  pointer-events: none;
  z-index: 4;
}

@keyframes media-lightbox-spin {
  to { transform: rotate(360deg); }
}

@keyframes media-lightbox-spinner-reveal {
  to { opacity: 1; }
}

.media-lightbox-side-prev {
  left: 0;
  transform: translateY(-50%);
}

.media-lightbox-side-next {
  right: 0;
  transform: translateY(-50%);
}

/* :has() because the column itself is pointer-events: none and so never
 * matches :hover - the thumbnail inside it is the hover target now. */
.media-lightbox-side:has(img:hover),
.media-lightbox-side:has(video:hover) {
  opacity: 0.78;
  filter: saturate(1);
}

.media-lightbox-track:not(:has(.media-lightbox-ai-metadata:not([hidden]))) .media-lightbox-side:has(img:hover),
.media-lightbox-track:not(:has(.media-lightbox-ai-metadata:not([hidden]))) .media-lightbox-side:has(video:hover) {
  transform: translateY(-50%);
}

.media-lightbox-side img,
.media-lightbox-side video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: var(--lightbox-media-radius);
  background: #000;
  pointer-events: auto;
  cursor: pointer;
}

.media-lightbox.side-previews-hidden .media-lightbox-side {
  display: none !important;
}

.media-lightbox.side-previews-hidden .media-lightbox-current,
.media-lightbox.is-single .media-lightbox-current {
  width: min(86vw, 1400px);
}

.media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])).side-previews-hidden .media-lightbox-current,
.media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])).is-single .media-lightbox-current {
  width: 100%;
}

.media-lightbox.is-single .media-lightbox-side {
  display: none;
}

.media-lightbox-close {
  font-size: 1.9rem;
  line-height: 1;
}

.media-lightbox-edge-nav {
  position: absolute;
  top: 50%;
  width: 2.6rem;
  height: 4rem;
  display: grid;
  place-items: center;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.68);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 6;
}

.media-lightbox-edge-nav:hover,
.media-lightbox-edge-nav:focus-visible {
  background: rgba(28, 34, 43, 0.92);
  border-color: rgba(255, 255, 255, 0.48);
}

.media-lightbox-edge-nav-prev {
  left: 0.65rem;
}

.media-lightbox-edge-nav-next {
  right: 0.65rem;
}

.media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-edge-nav-next {
  right: calc(var(--lightbox-metadata-width) + 0.65rem);
}

.media-lightbox.is-single .media-lightbox-edge-nav {
  display: none;
}

.media-lightbox-edge-fade {
  position: absolute;
  top: 50%;
  width: var(--lightbox-side-width);
  height: var(--lightbox-side-height);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 5;
}

.media-lightbox-edge-fade-prev {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.5) 24%, transparent 58%);
}

.media-lightbox-edge-fade-next {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.5) 24%, transparent 58%);
}

.media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-edge-fade {
  width: var(--lightbox-side-panel-width);
  height: 78vh;
}

.media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-edge-fade-next {
  right: var(--lightbox-metadata-width);
}

.media-lightbox.side-previews-hidden .media-lightbox-edge-fade,
.media-lightbox.is-single .media-lightbox-edge-fade {
  display: none;
}

.media-lightbox-bottom {
  position: absolute;
  left: 0;
  bottom: 0.4rem;
  width: 100%;
  max-height: var(--lightbox-bottom-height);
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0;
  box-sizing: border-box;
  pointer-events: auto;
  z-index: 20;
}

.media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-bottom {
  width: calc(100vw - var(--lightbox-metadata-width));
}

.media-lightbox-counter {
  position: relative;
  z-index: 5;
  min-height: 1.1rem;
  color: #fff;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.25rem;
  text-align: center;
  text-shadow:
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 2px 3px #000;
}

.media-lightbox-thumbnails {
  width: 100%;
  max-width: 100%;
  height: 70px;
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  pointer-events: auto;
  box-sizing: border-box;
  touch-action: none;
  user-select: none;
}

.media-lightbox-thumbnail {
  position: relative;
  flex: 1 1 0;
  height: 120px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 3px;
  background: transparent;
  opacity: 0.62;
  cursor: pointer;
  transition: opacity 0.14s ease, box-shadow 0.14s ease;
}

.media-lightbox-thumbnail:hover {
  opacity: 0.9;
}

.media-lightbox-thumbnail.is-active {
  opacity: 1;
  z-index: 2;
}

.media-lightbox-thumbnail-media {
  position: relative;
  display: inline-flex;
  width: 60.75px;
  max-width: 100%;
  aspect-ratio: var(--release-media-ratio);
  max-height: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.media-lightbox-thumbnail.is-active .media-lightbox-thumbnail-media::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.88);
  pointer-events: none;
  z-index: 3;
}

.media-lightbox-thumbnail img,
.media-lightbox-thumbnail video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 108px;
  object-fit: contain;
  border-radius: 2px;
}

.media-lightbox-carousel-clone {
  position: fixed;
  z-index: 4;
  margin: 0;
  object-fit: contain;
  background: #000;
  border-radius: var(--lightbox-media-radius);
  pointer-events: none;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  will-change: transform, opacity;
}

.media-lightbox.is-carousel-transitioning .media-lightbox-current > img,
.media-lightbox.is-carousel-transitioning .media-lightbox-current > video,
.media-lightbox.is-carousel-transitioning .media-lightbox-side > img,
.media-lightbox.is-carousel-transitioning .media-lightbox-side > video {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .media-lightbox-side {
    transition: none;
  }
}

@media (max-width: 800px) {
  .media-lightbox-bottom {
    grid-template-columns: minmax(0, 1fr);
  }

  .media-lightbox {
    --lightbox-main-width: 60vw;
    --lightbox-side-width: calc(20vw - var(--lightbox-side-gap));
    --lightbox-side-panel-width: calc(20vw - var(--lightbox-side-gap));
  }

  .media-lightbox-side {
    position: absolute;
    top: 50%;
    display: flex;
    width: var(--lightbox-side-width);
    height: 62vh;
    z-index: 2;
    opacity: 0.24;
  }

  .media-lightbox-side-prev {
    left: 0;
    transform: translateY(-50%);
  }

  .media-lightbox-side-next {
    right: 0;
    transform: translateY(-50%);
  }

  .media-lightbox-current {
    width: var(--lightbox-main-width);
    height: calc(100vh - var(--lightbox-bottom-height) - 0.75rem);
  }

  .media-lightbox-track {
    padding: 0 1rem;
  }

  .media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) {
    display: flex;
    padding: 0 1rem;
  }

  .media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-current {
    width: var(--lightbox-main-width);
    height: calc(100dvh - var(--lightbox-bottom-height) - 0.75rem);
    padding: 0;
  }

  .media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-side {
    top: 50%;
    width: var(--lightbox-side-panel-width);
    height: 62vh;
  }

  .media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-side-prev {
    left: 0;
  }

  .media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-side-next {
    right: 0;
  }

  .media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-edge-fade {
    top: 50%;
    width: var(--lightbox-side-panel-width);
    height: 62vh;
  }

  .media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-edge-fade-next {
    right: 0;
  }

  .media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-edge-nav-next {
    right: 0.65rem;
  }

  .media-lightbox:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-bottom {
    display: none;
    width: 100vw;
  }

  .media-lightbox-ai-metadata:not([hidden]) {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border-top: 0;
    border-left: 0;
    z-index: 8;
  }

  .media-lightbox-ai-metadata-resizer {
    display: none;
  }

  .media-lightbox-ai-metadata header {
    height: 3.75rem;
    padding: 0 7rem 0 0.75rem;
  }

  .media-lightbox-ai-metadata dl {
    height: calc(100dvh - 3.75rem);
    padding: 0 0.75rem 0.75rem;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .media-lightbox-controls {
    z-index: 10;
  }

}

@media (orientation: portrait) {
  .media-lightbox {
    --lightbox-main-width: 100vw;
    --lightbox-bottom-height: 82px;
  }

  .media-lightbox-track,
  .media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) {
    padding: 0;
  }

  .media-lightbox-current,
  .media-lightbox.side-previews-hidden .media-lightbox-current,
  .media-lightbox.is-single .media-lightbox-current,
  .media-lightbox-track:has(.media-lightbox-ai-metadata:not([hidden])) .media-lightbox-current {
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .media-lightbox-current img,
  .media-lightbox-current video {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }

  .media-lightbox-edge-nav,
  .media-lightbox-menu-toggle,
  .media-lightbox-close {
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    user-select: none;
  }

  .media-lightbox-controls {
    right: 1rem;
  }

  .media-lightbox-edge-nav {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(8, 10, 14, 0.24);
    color: rgba(255, 255, 255, 0.78);
  }

  .media-lightbox-edge-nav:hover,
  .media-lightbox-edge-nav:focus,
  .media-lightbox-edge-nav:focus-visible,
  .media-lightbox-edge-nav:active {
    outline: none;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(8, 10, 14, 0.24);
    color: rgba(255, 255, 255, 0.78);
  }

  .media-lightbox-menu-toggle,
  .media-lightbox-close,
  .media-lightbox-menu-toggle:hover,
  .media-lightbox-menu-toggle:focus,
  .media-lightbox-menu-toggle:focus-visible,
  .media-lightbox-menu-toggle:active,
  .media-lightbox-menu-toggle[aria-expanded="true"],
  .media-lightbox-close:hover,
  .media-lightbox-close:focus,
  .media-lightbox-close:focus-visible,
  .media-lightbox-close:active {
    outline: none;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(20, 24, 30, 0.3);
    color: rgba(244, 247, 250, 0.82);
  }

  .media-lightbox-side,
  .media-lightbox-edge-fade {
    display: none !important;
  }

  .media-lightbox-thumbnails {
    height: 58px;
  }

  .media-lightbox-thumbnail {
    height: 116px;
  }

  .media-lightbox-thumbnail img,
  .media-lightbox-thumbnail video {
    width: auto;
    max-height: 108px;
  }
}

@media (max-width: 800px) {
  .media-lightbox {
    --lightbox-bottom-height: 96px;
  }

  .media-lightbox-thumbnails {
    height: 72px;
    justify-content: safe center;
    gap: 4px;
    padding: 4px;
    overflow: hidden;
  }

  .media-lightbox-thumbnails > .media-lightbox-thumbnail {
    flex: 0 0 44px;
    height: 100%;
    padding: 0;
  }

  .media-lightbox-thumbnail-media {
    width: 100%;
    height: 100%;
  }

  .media-lightbox-thumbnail img,
  .media-lightbox-thumbnail video {
    width: 100%;
    object-fit: cover;
  }
}

[data-form-message] {
  margin-top: 0.7rem;
}

.text-muted,
.small,
small {
  color: var(--text-soft) !important;
}

@media (max-width: 1024px) {
  .content-grid,
  .landing-hero,
  .workspace-grid,
  .dashboard-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Metric cards stay multi-up on tablet rather than stacking one per row. */
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  /* Below 1024px the rail becomes an off-canvas drawer, so the column stops
     being a ground of its own - the drawer itself carries the chrome. */
  .app-sidebar-col {
    position: static;
    height: auto;
    background: transparent;
    border-right: 0;
    box-shadow: none;
  }

  .sidebar-resizer {
    display: none;
  }

  .app-header .site-header-inner::after {
    left: 0;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
    width: min(300px, calc(100% - 36px));
    height: 100vh;
    height: 100dvh;
    transform: translateX(-110%);
    transition: transform 0.2s ease;
    padding: 0;
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--chrome) 97%, var(--scheme-text) 3%),
      color-mix(in srgb, var(--chrome) 95%, var(--bg) 5%));
    border-right: 1px solid color-mix(in srgb, var(--scheme-text) 13%, transparent);
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.32);
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar-inner {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .sidebar-groups {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
  }

  .sidebar-bottom-nav {
    margin-top: 0;
  }

  .sidebar-close,
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
  }

  .app-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 11, 0.55);
    z-index: 1100;
  }

  body.sidebar-open .app-overlay {
    display: block;
  }

  .site-header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.85rem 0.01rem;
  }

  .app-header .site-brand {
    width: auto;
    justify-content: flex-start;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .workspace-rail {
    position: static;
  }

  .creator-toolbar,
  .workspace-status-strip,
  .creator-form-split,
  .creator-editor-grid,
  .creator-editor-top-fields,
  .creator-release-template-grid,
  .creator-editor-fields,
  .creator-editor-form .creator-editor-fields,
  .creator-category-row,
  .creator-tier-row,
  .creator-variable-head,
  .creator-price-list-head,
  .creator-price-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-toolbar-actions,
  .creator-bulk-row,
  .creator-template-inline,
  .creator-template-delete,
  .creator-template-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .creator-template-inline {
    margin-left: 0;
  }

  .creator-price-list-head {
    display: none;
  }

  .creator-editor-savebar {
    position: static;
  }

  .sidebar-toggle {
    order: -1;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .site-main {
    width: min(100%, calc(100% - 20px));
    padding-top: 1.4rem;
  }

  .app-shell {
    width: 100%;
  }

  .hero,
  .panel {
    padding: 0.75rem 0;
    border-radius: 0;
  }

  .auth-card-inner {
    padding: 1rem;
  }

  main.app-content {
    /* The gutter narrows on phones but never disappears. Matches the
       `main.app-content` specificity above so it actually overrides it. */
    --gutter: 1rem;
    padding: 0.75rem var(--gutter) 2rem;
    max-width: 100%;
  }

  .split-actions,
  .landing-actions,
  .site-header-actions {
    width: 100%;
  }

  .app-header .app-header-guest-actions {
    width: auto;
    min-width: 0;
  }

  .btn {
    width: 100%;
  }

  .admin-user-head,
  .admin-user-form-row {
    align-items: stretch;
    flex-direction: column;
  }

  .content-catalog-card {
    grid-template-columns: 1fr;
  }

  .creator-content-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-catalog-thumb-media,
  .content-catalog-thumb,
  .content-catalog-thumb-fallback {
    min-height: 180px;
    height: 180px;
  }

  .creator-avatar-frame {
    width: 72px;
    height: 72px;
  }

  .admin-user-form-row .form-select {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .creator-content-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   Feature components (follows, notifications, model body, licence)
   Uses the shared dark-theme tokens above to stay visually consistent.
   ========================================================================== */
/* Creator-page header block: the name reads as a page TITLE with the Follow
   control sitting directly beneath it (left-aligned) - it used to float
   arbitrarily right with no box around it, which looked unanchored. */
/* The creator "user bar" uses a restrained raised surface so the identity
   block is distinct from the page without a decorative gradient. */
.creator-top-header {
  position: relative;
  /* Tight top padding: the creator name is the first thing on the page and must
     not sit in a band of dead space. */
  /* Bottom padding is deliberately tighter than the top: the tier cards / gallery
     directly below must not be pushed down by dead space in the card. */
  padding: 0.55rem 1rem 0.3rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-raised) 96%, var(--accent) 4%);
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--accent) 18%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16), inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent);
  overflow: hidden;
}

.creator-top-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  width: auto;
  height: 3px;
  background: var(--accent);
}

.header-admin-actions {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  z-index: 20;
  margin: 0 1rem 0 auto;
}

.header-admin-actions > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  list-style: none;
  cursor: pointer;
  min-height: 36px;
  padding: 0.48rem 0.72rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.2;
}

.header-admin-actions > summary::-webkit-details-marker {
  display: none;
}

.header-admin-actions > summary:hover,
.header-admin-actions > summary:focus-visible,
.header-admin-actions[open] > summary {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.header-admin-actions-caret {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease;
}

.header-admin-actions[open] .header-admin-actions-caret {
  transform: translateY(2px) rotate(225deg);
}

.header-admin-actions-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  display: grid;
  min-width: 210px;
  padding: 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.header-admin-actions-menu form {
  margin: 0;
}

.header-admin-actions-menu button,
.header-admin-actions-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
}

.header-admin-actions-menu button:hover,
.header-admin-actions-menu button:focus-visible,
.header-admin-actions-menu a:hover,
.header-admin-actions-menu a:focus-visible {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: #fff;
}

.header-admin-actions-menu .admin-actions-unavailable {
  color: var(--text-muted);
  opacity: 0.65;
}

.header-admin-actions-menu [data-form-message] {
  display: none;
}

/* Creator top row: identity/follow on the left, the viewer's current
   membership pinned to the right so "what am I subscribed to / edit it" is
   always reachable without scrolling to the tier cards. */
.creator-top-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.creator-user-summary {
  flex: 1 1 50%;
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: flex-start;
  gap: 0.35rem 0.85rem;
  text-align: left;
}

.creator-user-summary > .creator-profile-top {
  grid-column: 2;
  min-width: 0;
}

.creator-user-summary > .creator-description {
  grid-column: 1 / -1;
}

/* Name + follow/notify controls share ONE row: the title on the left, the
   controls pushed to the right of it. They used to stack, which cost a whole
   line of vertical space before the tier cards. */
.creator-identity-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.creator-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
  position: relative;
}

.creator-header-meta-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.creator-header-meta-row .creator-stats-row,
.creator-header-meta-row .creator-description {
  flex: 1 1 auto;
  min-width: 0;
}

/* Message is pushed to the row's right edge so it sits directly beneath the
   Follow button on the row above, instead of trailing whatever is on the left. */
.creator-header-meta-row .creator-message-btn {
  margin-left: auto;
  flex: 0 0 auto;
}

.creator-message-btn {
  position: static;
}

/* Follow and Message share one footprint in the creator header (6.5rem from
   `.creator-follow-btn`). Follow is the main button, Message is secondary. */

/* Preview copies of the buttons are inert spans/buttons - no pointer affordance. */
.creator-preview-surface .creator-follow-btn,
.creator-preview-surface .creator-message-btn {
  pointer-events: none;
}

.follow-toggle-at {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-3px);
}

/* Private messages (#34). Role color is reserved for message identity:
 * administration is purple, creators are gold, and users are silver. */
.creator-content-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-left: 0.2rem;
}

/* SUB-25: the purchase button is the cost - a compact capsule holding a cart
   and the price. Signed-out visitors get "Sign In to Purchase" as the round
   card price pill under it, sharing its left edge so it never runs off the
   page when the row wraps. The pill hangs below the capsule, so the capsule
   stays level with the title; the row reserves the space it uses. */
.creator-content-purchase {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.creator-content-title-row:has(.creator-content-sign-in-pill) {
  padding-bottom: 2.15rem;
}

.creator-content-heading-actions:has(.creator-content-sign-in-pill) {
  row-gap: 2.6rem;
}

.btn.creator-content-buy {
  min-height: 38px;
  gap: 0.45rem;
  padding: 0.4rem 1.25rem 0.4rem 1.05rem;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 750;
  line-height: 1;
}

.creator-content-buy svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
}

.creator-content-buy-price {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.creator-content-sign-in-pill {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-height: 26px;
  padding: 0.2rem 0.75rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.creator-content-purchase [data-form-message]:empty {
  display: none;
}

.creator-content-also-in {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.creator-content-also-in-label {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.creator-content-tier-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.creator-content-tier-link:hover,
.creator-content-tier-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.creator-content-title-heading {
  display: block;
}

.creator-content-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.creator-content-title-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: -0.025em;
  text-transform: none;
}

/* Messages fills exactly one screen: the content area takes the window height
   below the header and the page fills that area, so the page's own padding
   can never add a window scroll. */
main.app-content.messages-main {
  height: calc(100dvh - var(--header-h));
  padding-bottom: 1rem;
  overflow: hidden;
}

.messages-page {
  --message-admin: #a78bfa;
  --message-creator: #d8ad52;
  --message-user: #b8c0cc;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.messages-mobile-navigation,
.messages-conversation-picker-backdrop,
.messages-conversation-picker-head,
.messages-conversation-picker-tabs,
.messages-conversation-picker-actions {
  display: none;
}

.messages-toolbar,
.messages-toolbar-actions {
  display: flex;
  align-items: center;
}

.messages-toolbar {
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.messages-toolbar-actions {
  flex: 0 0 auto;
  align-self: stretch;
  gap: 0.45rem;
}

.messages-toolbar-actions > *,
.messages-toolbar-actions form,
.messages-toolbar-actions .btn {
  align-self: stretch;
  height: 100%;
}

.messages-toolbar-actions form {
  display: flex;
}

.messages-tabs {
  display: flex;
  flex: 1 1 auto;
  gap: 0.35rem;
  border-bottom: 0;
  margin: 0;
}

.messages-unread-summary {
  white-space: nowrap;
}

.messages-unread-summary strong {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.messages-read-all {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.messages-read-all form,
.messages-read-through form {
  margin: 0;
}

.messages-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 0.9rem;
  border-bottom: 2px solid transparent;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 650;
}

.messages-tab:hover,
.messages-tab:focus-visible,
.messages-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.messages-admin-contact {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.messages-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(15rem, 0.34fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  flex: 1 1 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.messages-conversations {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 70%, transparent);
  overflow: hidden;
}

.messages-conversations-header {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.messages-conversations-header h2 {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.messages-conversations-header label {
  margin: 0;
}

.messages-conversations-header .form-control {
  width: 100%;
  min-height: 2.2rem;
  padding: 0.42rem 0.6rem;
}

[data-message-conversation-results] {
  display: contents;
}

.messages-conversation-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.messages-conversation {
  display: grid;
  gap: 0.32rem;
  padding: 0.85rem 1rem;
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  -webkit-user-drag: none;
}

.messages-conversation:hover,
.messages-conversation:focus-visible,
.messages-conversation.is-active {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--text);
}

.messages-conversation.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.messages-conversation.has-unread {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.messages-conversation.has-unread strong {
  color: var(--text);
  font-weight: 800;
}

.messages-search-group {
  margin: 0;
  padding: 0.55rem 1rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border);
}

/* While search shows its own group headings, the list heading would repeat them. */
.messages-conversations:has(.messages-search-group) .messages-conversations-header h2 {
  display: none;
}

.messages-conversation.is-new strong {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.messages-conversation.is-new .messages-conversation-meta {
  flex: none;
}

.messages-recipient-relation {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.messages-new-icon {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

.messages-new-icon svg {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}

.messages-conversation.is-new:hover .messages-new-icon,
.messages-conversation.is-new:focus-visible .messages-new-icon {
  border-color: var(--accent);
  color: var(--text);
}

.messages-page [data-creator-accent="blurple"] { --message-role-color: #9184d9; --creator-message-color: #9184d9; }
.messages-page [data-creator-accent="amber"] { --message-role-color: #d6a24f; --creator-message-color: #d6a24f; }
.messages-page [data-creator-accent="teal"] { --message-role-color: #3fb4a3; --creator-message-color: #3fb4a3; }
.messages-page [data-creator-accent="rose"] { --message-role-color: #db7f9f; --creator-message-color: #db7f9f; }
.messages-page [data-creator-accent="green"] { --message-role-color: #6fb762; --creator-message-color: #6fb762; }
.messages-page [data-creator-accent="blue"] { --message-role-color: #5fa8e0; --creator-message-color: #5fa8e0; }

.messages-conversation[data-creator-accent] strong,
.messages-thread-heading[data-creator-accent] h2,
.messages-blocked-user[data-creator-accent] strong {
  color: var(--creator-message-color);
}

[data-creator-accent] .message-role-badge.message-role-creator {
  color: var(--creator-message-color);
}

.messages-conversation.is-important {
  box-shadow: inset 3px 0 0 var(--message-admin);
  background: color-mix(in srgb, var(--message-admin) 10%, transparent);
}

.messages-conversation-head,
.message-bubble-meta,
.messages-thread-heading,
.messages-thread-heading > div,
.messages-thread-actions,
.messages-reply-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.messages-conversation-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.messages-conversation-head,
.message-bubble-meta,
.messages-thread-heading {
  justify-content: space-between;
}

.messages-conversation-head > strong,
.messages-thread-heading h2 {
  user-select: text;
  -webkit-user-select: text;
  cursor: auto;
}

.messages-conversation-head > strong,
.message-bubble-meta > strong,
.messages-thread-heading h2,
.messages-blocked-user .messages-conversation-head > strong {
  text-transform: none;
}

.messages-conversation time,
.message-bubble-meta time {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.message-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.2;
}

.message-role-admin {
  --message-role-color: var(--message-admin);
}

.message-role-creator {
  --message-role-color: var(--message-creator);
}

.message-role-user {
  --message-role-color: var(--message-user);
}

.message-role-badge.message-role-admin,
.message-role-badge.message-role-creator,
.message-role-badge.message-role-user {
  color: var(--message-role-color);
}

.messages-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.messages-thread-empty {
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--text-soft);
}

.messages-thread-heading {
  flex: 0 0 auto;
  min-height: 3.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}

.messages-thread-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.messages-thread-heading h2:has(.messages-creator-link) {
  font-size: 1.35rem;
}

.messages-thread-heading .messages-creator-link {
  color: inherit;
}

.messages-thread-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.messages-thread-actions form {
  margin: 0;
}

.message-thread-menu {
  position: relative;
}

.message-thread-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1;
  cursor: pointer;
  list-style: none;
  flex: 0 0 auto;
}

.message-thread-menu > summary::-webkit-details-marker {
  display: none;
}

.message-thread-menu > summary:hover,
.message-thread-menu > summary:focus-visible {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.message-thread-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  right: 0;
  display: grid;
  width: 13rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised, var(--surface));
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}

.message-thread-menu-panel form,
.message-thread-menu-panel .btn {
  width: 100%;
}

.message-thread-menu-panel .btn {
  justify-content: flex-start;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
  text-decoration: none;
}

.message-thread-menu-panel .btn:hover,
.message-thread-menu-panel .btn:focus-visible {
  filter: brightness(1.1);
}

.message-thread-menu-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  color: var(--text);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  cursor: pointer;
}

.message-thread-menu-option:hover,
.message-thread-menu-option:focus-within {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.message-thread-menu-switch {
  position: relative;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 1.25rem;
  margin: 0;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}

.message-thread-menu-switch::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--text-muted);
  content: "";
  transition: transform 120ms ease, background-color 120ms ease;
}

.message-thread-menu-switch:checked {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 35%, var(--surface));
}

.message-thread-menu-switch:checked::after {
  background: var(--accent-strong);
  transform: translateX(1rem);
}

.message-thread-menu-switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.messages-history-usage {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 7rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.message-thread-menu-panel .messages-history-usage {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.55rem 0.65rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.message-thread-menu-panel .messages-history-usage progress {
  flex: 1;
}

.messages-history-usage progress {
  width: 5rem;
  height: 0.45rem;
  accent-color: var(--accent);
}

.messages-history-warning {
  margin: 0.8rem 1rem 0;
}

.messages-thread-actions [data-form-message] {
  display: none;
}

.messages-blocked-note {
  margin: 0.8rem 1rem 0;
}

.messages-thread-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem;
  min-height: 0;
  flex: 1 1 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.messages-thread-list > * {
  flex-shrink: 0;
}

.messages-unread-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.45rem 0;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.messages-unread-divider hr {
  position: absolute;
  inset: auto 0;
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 2px solid var(--accent);
}

.messages-unread-divider span {
  position: relative;
  padding: 0 0.65rem;
  background: var(--surface);
}

.message-bubble.is-unread {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
}

.messages-read-through {
  display: flex;
  justify-content: center;
  padding: 0.15rem 0 0.35rem;
}

.message-bubble {
  align-self: flex-start;
  width: min(90%, 56rem);
  padding: 0.5rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--message-role-color) 48%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--message-role-color) 10%, var(--surface));
}

.message-bubble.is-mine {
  align-self: flex-end;
  --message-role-color: var(--scheme-text);
  background: color-mix(in srgb, var(--scheme-text) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--scheme-text) 34%, var(--border));
}

.message-bubble.is-mine.message-role-creator[data-creator-accent] {
  background: color-mix(in srgb, var(--message-role-color) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--message-role-color) 48%, var(--border));
}

.message-bubble.is-content-release,
.message-bubble.is-mine.is-content-release {
  align-self: center;
  width: min(var(--message-content-release-width, 88%), 56rem);
  height: 10rem;
  min-height: 10rem;
  padding: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.message-content-release-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  color: var(--text);
  cursor: pointer;
  user-select: text;
}

.message-content-release-title {
  color: inherit;
  text-decoration: none;
}

.message-content-release-media {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: var(--surface-raised, var(--surface));
}

.message-content-release-image {
  display: block;
  flex: 0 0 5.625rem;
  width: 5.625rem;
  min-width: 5.625rem;
  height: auto;
  align-self: flex-start;
  aspect-ratio: var(--release-media-ratio);
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.message-content-release-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-content-release-copy {
  display: flex;
  min-width: 0;
  padding: 0.8rem 0.95rem;
  flex-direction: column;
  gap: 0.65rem;
}

.message-content-release-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.message-content-release-heading strong {
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.message-content-release-heading time {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.message-content-release-description {
  display: -webkit-box;
  color: var(--text-soft);
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.message-content-release-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.message-content-release-facts span {
  padding: 0.24rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.message-content-release-card:hover .message-content-release-heading strong,
.message-content-release-card:focus-within .message-content-release-heading strong {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message-bubble[data-creator-accent="blurple"] { --message-role-color: #9184d9; }
.message-bubble[data-creator-accent="amber"] { --message-role-color: #d6a24f; }
.message-bubble[data-creator-accent="teal"] { --message-role-color: #3fb4a3; }
.message-bubble[data-creator-accent="rose"] { --message-role-color: #db7f9f; }
.message-bubble[data-creator-accent="green"] { --message-role-color: #6fb762; }
.message-bubble[data-creator-accent="blue"] { --message-role-color: #5fa8e0; }

.message-bubble.is-important {
  border-color: color-mix(in srgb, var(--message-admin) 78%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--message-admin) 20%, transparent);
}

.message-bubble.is-mine.is-important {
  border-color: color-mix(in srgb, var(--scheme-text) 34%, var(--border));
  box-shadow: none;
}

.message-bubble p {
  margin: 0.3rem 0 0;
  color: var(--text);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.message-content-reference,
.message-compose-reference {
  display: grid;
  gap: 0.12rem;
  margin-top: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text);
  text-decoration: none;
}

.message-content-reference {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.message-bubble.is-content-release .message-content-reference {
  margin-top: 0.4rem;
  padding: 0.35rem 0.5rem;
}

.message-content-thumbnail {
  display: block;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface-raised, var(--surface));
}

.message-content-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-content-reference-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.message-content-reference-copy strong {
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message-content-reference-copy > span,
.message-compose-reference > span {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.messages-reply-form {
  position: sticky;
  bottom: 0;
  z-index: 5;
  flex: 0 0 auto;
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-raised, var(--surface));
}

.message-customer-info .message-thread-menu-panel {
  width: min(22rem, calc(100vw - 5rem));
  max-height: 65dvh;
  overflow-y: auto;
}

.message-customer-info dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem 1rem;
  margin: 0.75rem 0;
}

.message-customer-info dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.messages-reply-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.messages-reply-form textarea.form-control {
  height: var(--message-input-height, 7rem);
  max-width: none;
  min-height: 7rem;
  max-height: 55dvh;
  resize: vertical;
}

.messages-reply-resizer {
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  height: 12px;
  cursor: ns-resize;
  touch-action: none;
}

.messages-reply-resizer::after {
  content: "";
  position: absolute;
  left: 40%;
  right: 40%;
  top: 5px;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
}

.messages-reply-resizer:focus-visible::after,
.messages-reply-resizer:hover::after {
  background: var(--accent);
}

.messages-send-button {
  flex: 0 0 2.35rem;
  width: 2.35rem;
  min-width: 2.35rem;
  padding: 0;
  font-size: 1.15rem;
}

.messages-empty,
.messages-empty-thread {
  padding: 1rem;
  color: var(--text-soft);
}

.messages-blocked-list {
  display: grid;
  gap: 0.65rem;
}

.messages-blocked-users {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.messages-blocked-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.messages-blocked-user > div {
  display: grid;
  gap: 0.35rem;
}

.messages-blocked-user time {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.messages-blocked-user form {
  flex: 0 0 auto;
  margin: 0;
}

.onsite-message-notification-list {
  display: grid;
  gap: 0.65rem;
}

.onsite-message-notifications {
  --message-admin: #a78bfa;
}

.onsite-message-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.onsite-message-notification.is-important {
  border-color: color-mix(in srgb, var(--message-admin) 72%, var(--border));
  background: color-mix(in srgb, var(--message-admin) 10%, var(--surface));
}

.onsite-message-notification-main {
  min-width: 0;
}

.onsite-message-notification-main p {
  margin: 0.35rem 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.onsite-message-notification-main time {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.onsite-message-notification form {
  flex: 0 0 auto;
}

@media (max-width: 780px) {
  .messages-page {
    min-height: 0;
  }

  .messages-page > .messages-toolbar {
    display: none;
  }

  .messages-mobile-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 48px;
    padding: 2px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-raised, var(--surface)) 76%, transparent);
  }

  .messages-conversation-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-width: 0;
    max-width: calc(100% - 52px);
    min-height: 44px;
    padding: 0.45rem 0.75rem;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 750;
    text-align: left;
    cursor: pointer;
  }

  .messages-conversation-picker-trigger > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .messages-mobile-menu-space {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  .messages-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  [data-message-conversation-picker] {
    position: fixed;
    z-index: 1201;
    inset: 0.5rem;
    display: none;
    max-height: none;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface-raised, var(--surface));
    box-shadow: var(--shadow-lg, 0 18px 50px rgba(0, 0, 0, 0.45));
    overflow: hidden;
  }

  .messages-page.is-conversation-picker-open [data-message-conversation-picker] {
    display: flex;
  }

  .messages-conversation-picker-backdrop {
    position: fixed;
    z-index: 1200;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(5, 6, 12, 0.72);
  }

  .messages-page.is-conversation-picker-open .messages-conversation-picker-backdrop {
    display: block;
  }

  .messages-conversation-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 56px;
    padding: 0.4rem 0.6rem 0.4rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }

  .messages-conversation-picker-head > strong {
    font-size: 1rem;
  }

  .messages-conversation-picker-close {
    display: inline-flex;
  }

  .messages-conversation-picker-tabs {
    display: block;
    padding: 0 0.55rem;
    border-bottom: 1px solid var(--border);
  }

  .messages-conversation-picker-tabs .messages-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .messages-conversation-picker-tabs .messages-tab {
    justify-content: center;
    padding-inline: 0.35rem;
  }

  .messages-conversation-picker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.55rem;
    border-bottom: 1px solid var(--border);
  }

  .messages-conversation-picker-actions form,
  .messages-conversation-picker-actions .messages-read-all,
  .messages-conversation-picker-actions .messages-admin-contact {
    display: flex;
    flex: 1 1 auto;
    margin: 0;
  }

  .messages-conversation-picker-actions .btn {
    width: 100%;
  }

  .messages-conversations-header {
    display: block;
    padding: 0.65rem;
  }

  .messages-conversations-header h2 {
    display: none;
  }

  .messages-conversation-list {
    display: block;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .messages-conversation {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .messages-thread-heading {
    position: absolute;
    z-index: 6;
    top: 4px;
    right: 4px;
    min-height: 44px;
    padding: 0;
    border: 0;
  }

  .messages-thread-heading > div:first-child {
    display: none;
  }

  .messages-thread-actions {
    justify-content: flex-end;
  }

  .message-thread-menu > summary {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .message-thread-menu-panel {
    max-height: calc(100dvh - var(--header-h) - 4rem);
    overflow-y: auto;
  }

  .message-bubble {
    width: 92%;
  }

  .message-bubble.is-content-release,
  .message-bubble.is-mine.is-content-release {
    width: 94%;
  }

  .message-content-release-media .message-content-release-image:not([hidden]) ~ .message-content-release-image {
    display: none;
  }

  .messages-blocked-user,
  .onsite-message-notification {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* #365 The claim page a buyer lands on after following an unlock link bought
   elsewhere. Deliberately plain: it is read once, by somebody who has never
   seen this site, and its only job is to say what the link is for. */
.unlock-claim-facts {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.5rem;
}

.unlock-claim-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.unlock-claim-row dt {
  flex: 0 0 11rem;
  margin: 0;
  color: var(--text-muted, var(--text));
}

.unlock-claim-row dd {
  flex: 1 1 12rem;
  margin: 0;
  font-weight: 650;
  min-width: 0;
  overflow-wrap: anywhere;
}

.unlock-claim-note {
  margin: 0 0 1rem;
}

.unlock-claim-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}


/* Header avatar: smaller than the directory card's, sized to the two text lines
   (name + bio) it sits beside. */
.creator-avatar-frame--header {
  width: 64px;
  height: 64px;
}

/* Narrow screens: the one-row header is allowed to break apart, and the
   counters stop hugging the right edge once they are the full width. */
@media (max-width: 820px) {
  .creator-identity-row {
    flex-wrap: wrap;
  }

  .creator-top-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .creator-user-summary,
  .creator-selected-tier-card,
  .creator-tier-shelf,
  .creator-membership-summary {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
  }

  .creator-stats-row {
    justify-content: flex-start;
  }

  .creator-avatar-frame--header {
    width: 52px;
    height: 52px;
  }
}

.creator-tier-shelf {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  margin-left: auto;
  text-align: right;
}

.creator-tier-shelf-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  transition: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 55%, var(--border)) var(--surface-strong);
  padding: 0.65rem 0 0.15rem;
}

.creator-tier-shelf-viewport.has-overflow-cue {
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
}

.creator-tier-shelf-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 28px;
  height: 42px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
}

.creator-tier-shelf-arrow:hover,
.creator-tier-shelf-arrow:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.creator-tier-shelf-arrow[hidden] {
  display: none;
}

.creator-tier-shelf-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.creator-tier-shelf-viewport.is-dragging {
  cursor: pointer;
  user-select: none;
}

.creator-tier-shelf-arrow--prev {
  left: 4px;
}

.creator-tier-shelf-arrow--next {
  right: 4px;
}

.creator-tier-shelf-track {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0.65rem;
  width: max-content;
  min-width: 100%;
}

.creator-tier-shelf-track > .creator-tier-card {
  flex: 0 0 min(340px, 82vw);
  width: min(340px, 82vw);
  text-align: left;
}

.creator-tier-shelf-track > .creator-tier-card:only-child {
  margin-left: auto;
}

.creator-tier-shelf-viewport::-webkit-scrollbar {
  height: 8px;
}

.creator-tier-shelf-viewport::-webkit-scrollbar-track {
  background: var(--surface-strong);
  border-radius: 999px;
}

.creator-tier-shelf-viewport::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: 999px;
}

/* "Part of <tier>" row in a content page's user bar. */
.creator-belongs-to {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.creator-belongs-to-label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

a.creator-tier-badge {
  text-decoration: none;
}

a.creator-tier-badge:hover,
a.creator-tier-badge:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  color: var(--text);
}

.creator-membership-summary {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  margin-left: auto;
  text-align: right;
}

.creator-membership-pill {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.creator-membership-pill:hover,
.creator-membership-pill:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}

.creator-membership-label {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.creator-membership-tier {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.creator-membership-price {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.creator-membership-more {
  font-size: 0.8rem;
  color: var(--accent);
}

.creator-membership-edit {
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .creator-tier-shelf,
  .creator-membership-summary {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
  }

  .creator-tier-shelf-track > .creator-tier-card {
    flex-basis: min(340px, 78vw);
    width: min(340px, 78vw);
  }
}

.creator-profile-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.creator-profile-top .page-header {
  flex: 0 1 auto;
  max-width: none;
  min-width: 0;
}

/* The name is the page title, but it now shares its row with the follow
   controls - a display-size 2.9rem would have pushed them onto their own line
   again, so it sits at a heading scale instead of a hero scale. */
.creator-profile-top .page-kicker {
  font-size: 1.85rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: none;
}

.creator-header-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-header-name:hover,
.creator-header-name:focus-visible {
  color: var(--accent);
}

/* Bio line, directly under the name inside the header block. */
.creator-top-header .creator-description {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-soft, var(--text-muted));
}

/* Standalone creator header (a content page - no tier row underneath). It is
   the same gradient card as the profile header now, so the card border is its
   outer edge; the closing hairline comes from .creator-header-rule instead. */
.creator-top-header--standalone {
  border-bottom-color: var(--border);
}

/* The content page's copy of the creator page's separator: on the creator page
   .creator-subscription-row draws a hairline across the bottom of the user bar,
   and a content page must end that same bar the same way. Same geometry, same
   colour - the only difference is that nothing follows it inside the card. */
.creator-header-rule {
  margin-top: 0.55rem;
  border-top: 1px solid var(--border);
}

/* THE separator: the one and only rule in the whole creator header block. The
   counters strip above deliberately has none, so the header reads as a single
   chunk that ends here, right before the tiers. */
.creator-subscription-row {
  margin-top: 0.55rem;
  /* 0.75rem clears the recommended card's ribbon, which overhangs the card top
     by 0.62rem and would otherwise be clipped by this overflow-x container. */
  padding-top: 0.75rem;
  padding-bottom: 0.6rem;
  border-top: 0;
}

.creator-follow-row {
  margin-top: 0;
}

/* The form is the actual layout container for the checkbox + button, so the
   flex/gap MUST live here (not only on the wrapper) - otherwise the label and
   button collapse together with no spacing. (#16) */
.creator-follow-row,
.creator-follow-row form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.creator-follow-row .form-check {
  margin: 0;
  white-space: nowrap;
}

/* Follow errors must stay compact and inline - a full-width alert block here
   shoved the hero layout apart (#21). Keep it a small inline pill, and take up
   zero space when empty so it never affects layout until there's a message. */
.creator-follow-row [data-form-message] {
  margin-top: 0;
  font-size: 0.977rem;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
}

.creator-follow-row [data-form-message]:empty {
  display: none;
}

/* Follow opt-in toggles (#21): compact icon checkboxes for Email + Notification
   shown right-aligned next to the Following button. */
.creator-follow-row--active {
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--surface-strong);
}

.creator-follow-row--active > form {
  gap: 0;
}

.creator-follow-row--active .follow-toggle-icon,
.creator-follow-row--active .creator-follow-btn {
  border: 0;
  border-radius: 0;
}

.creator-follow-row--active .follow-toggle-icon {
  border-right: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
}

.follow-toggles {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.follow-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.follow-toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

/* Shared follow preferences: white icons, graphite when off, accent when on. */
.follow-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--silver);
  background: var(--surface-strong);
  color: #fff;
  opacity: 1;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.follow-toggle-icon svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: currentColor;
}

.follow-toggle input:checked + .follow-toggle-icon {
  color: #fff;
  border-color: var(--btn-a);
  background: var(--btn-a);
}

.follow-toggle input:focus-visible + .follow-toggle-icon {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Settings page convention (#18): two-column grouped layout with one global
   save. .settings-grid is the two-column container; .setting-row is one
   title/control/description unit. */
.settings-group + .settings-group {
  margin-top: 1.5rem;
}

.settings-group-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft, rgba(255, 255, 255, 0.6));
  margin-bottom: 0.75rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 720px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.setting-row {
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.setting-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* SUB243 Two switches under one title in Settings > Appearance. */
.creator-filter-rows .setting-row-head {
  margin-top: 0.55rem;
}

.setting-row-title {
  font-weight: 600;
}

.setting-row-desc {
  margin: 0.4rem 0 0;
  font-size: 0.977rem;
  color: var(--text-soft, rgba(255, 255, 255, 0.55));
}

.settings-switch {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.settings-save-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.notification-unread {
  border-left: 3px solid var(--accent);
}

.creator-content-body {
  color: var(--text-soft);
  line-height: 1.65;
  margin-bottom: 0;
}

.creator-content-body > :last-child {
  margin-bottom: 0;
}
.creator-content-body > :first-child {
  margin-top: 0;
}
.creator-content-body h1,
.creator-content-body h2,
.creator-content-body h3 {
  color: var(--text);
  margin-top: 1.25rem;
}
.creator-content-body a {
  color: var(--accent-strong);
}
.creator-content-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  overflow-x: auto;
}
.creator-content-body code {
  background: var(--bg-soft);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}
.creator-content-body pre code {
  background: none;
  padding: 0;
}
.creator-content-body table {
  width: 100%;
  margin: 0.75rem 0;
}
.creator-content-body th,
.creator-content-body td {
  text-align: left;
}

.creator-content-license {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.creator-content-license a {
  color: var(--accent-strong);
}

.creator-content-link-separator {
  color: var(--text-muted);
  font-size: 0.8em;
}

/* Per-file version editor rows (creator content edit form) */

/* #264: a newly created API key. Shown once and never recoverable, so it is rendered
   into the page with a copy button rather than left to a toast that fades. */
.creator-api-key-create {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.creator-api-key-create .form-label {
  flex: 1 1 16rem;
  margin-bottom: 0;
}

/* Painted from the scheme, not from Bootstrap's light warning palette - those
   values are a pale yellow card with brown text, which on this dark interface was
   unreadable. The warning colour stays, as the border only. */
.creator-api-key-reveal {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md, 6px);
  border: 1px solid var(--warning);
  background: var(--scheme-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}

.creator-api-key-reveal-title {
  margin: 0;
  font-weight: 650;
  color: var(--warning);
}

.creator-api-key-reveal-value {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: var(--surface);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
  user-select: all;
}

.creator-api-keys tr.is-revoked {
  opacity: 0.55;
}

.creator-api-key-list { display: grid; gap: 1rem; }
.creator-api-key-row { min-width: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md, 6px); }
.creator-api-key-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.35rem 1rem; margin-bottom: 0.7rem; }
.creator-api-key-heading strong { overflow-wrap: anywhere; }
.creator-api-key-heading .text-muted { font-size: 0.8rem; }
.creator-api-keys [hidden] { display: none; }
.creator-api-key-legacy { margin: 0.6rem 0 0; font-size: 0.85rem; }
.creator-api-keys [data-key-message]:empty { display: none; }
.creator-api-key-create .form-control { margin-top: 0.35rem; }

/* A masked secret in one field: the value, then its icon actions inside the field. */
.secret-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  height: 44px;
  padding: 0 0.3rem 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.secret-field-value {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  user-select: all;
}
.secret-field [hidden] { display: none; }
.secret-field-value.is-masked { color: var(--text-soft); letter-spacing: 0.08em; overflow: hidden; user-select: none; }
.secret-field-actions { display: flex; flex: none; gap: 2px; }
.secret-field-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}
.secret-field-button svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.secret-field-button:hover,
.secret-field-button:focus-visible { background: var(--surface-raised); color: var(--text); }
.secret-field-button.is-danger:hover,
.secret-field-button.is-danger:focus-visible { color: var(--danger); }
.secret-field-button[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.secret-field-button[aria-disabled="true"]:hover { background: transparent; color: var(--text-soft); }
.secret-field-button:disabled { opacity: 0.35; cursor: default; }

/* #264: scripted-publishing documentation. Reference tables and folder-layout
   examples, read by a person once and then rarely again - plain and legible beats
   decorated. */
.creator-publishing-docs h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.creator-publishing-docs h4 {
  margin-top: 1.1rem;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

/* Subscripteon Creator Studio downloads: two buttons side by side. */
.creator-publishing-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.creator-publishing-together {
  margin: 0 0 1.25rem;
}

.creator-studio-screenshot {
  margin-bottom: 1.25rem;
}

.creator-studio-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .creator-publishing-downloads {
    grid-template-columns: minmax(0, 1fr);
  }
}

.creator-publishing-steps {
  padding-left: 1.2rem;
  line-height: 1.65;
}

.creator-publishing-steps > li + li {
  margin-top: 0.6rem;
}

/* A real code block: darker than the panel it sits on, with an edge, so it reads
   as something to be typed rather than as prose in a different font. */
.creator-publishing-code {
  margin: 0.55rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md, 6px);
  background: var(--scheme-bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
}

.creator-agent-publishing .section-heading {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.creator-agent-publishing .creator-publishing-downloads {
  margin-bottom: 0;
}

.creator-agent-publishing summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.creator-agent-key {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.creator-agent-publishing [data-agent-message]:empty { display: none; }
.creator-agent-publishing [data-agent-message] { margin: -0.4rem 0 0.8rem; font-size: 0.85rem; }

.creator-agent-code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 20rem;
  overflow-y: auto;
}

/* The values a creator may write, one per line rather than a run-on sentence -
   several of these are long licence names with spaces in them. */
.creator-publishing-values {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  line-height: 1.9;
}

.creator-publishing-values code {
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  background: var(--scheme-bg);
  font-size: 0.85rem;
}
.creator-audience-tabs {
  display: inline-flex;
  width: fit-content;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
}

.creator-audience-tab {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.creator-audience-tab:hover,
.creator-audience-tab:focus-visible {
  color: var(--text);
}

.creator-audience-tab.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, var(--border));
}

.creator-insights-stack {
  display: flex;
  width: 160px;
  height: 12px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(127, 127, 127, 0.12);
}

.creator-insights-stack i { background: #448cdd; }
.creator-insights-stack b { background: #369d79; }
.creator-insights-spark { width: 120px; height: 32px; }
.creator-insights-heat {
  display: block;
  padding: 6px;
  border-radius: 4px;
  background: rgba(68, 140, 221, var(--insight-opacity));
}
.creator-insights meter { width: 160px; }
.creator-insights .creator-ledger-filter { flex-wrap: wrap; }
.creator-insights { scroll-margin-top: 6rem; }
.creator-insights-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 1rem;
}
.creator-insights-summary dd {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.creator-settings-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.3rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  scrollbar-width: thin;
}

.creator-settings-tab {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.creator-settings-tab:hover,
.creator-settings-tab:focus-visible {
  color: var(--text);
}

.creator-settings-tab.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, var(--border));
}

.creator-follow-enabled {
  display: inline-flex;
  color: var(--success);
}

.creator-follow-enabled .btn-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.creator-follow-count-row td {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

/* #365 External unlock links and keys.
   The link field and its two buttons sit on one row so the address can be read
   and copied without the row wrapping on a normal workspace width; it collapses
   to a stack on narrow screens rather than scrolling sideways. No button fills
   are declared here - these reuse .btn-primary and .btn-secondary as they are. */
.creator-unlock-link-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.creator-unlock-link-row [data-unlock-link-field] {
  flex: 1 1 22rem;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.creator-unlock-new-keys {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md, 6px);
  border: 1px solid var(--border);
  background: var(--scheme-bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}

.creator-unlock-new-keys p {
  margin: 0;
  font-weight: 650;
}

.creator-unlock-new-keys textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .creator-unlock-link-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ==========================================================================
   Minimal utility layer.
   The markup uses Bootstrap-style grid/spacing utilities, but no Bootstrap
   stylesheet is loaded (only this file). These definitions make those classes
   work standalone so forms render in proper columns and spacing is consistent
   - fulfilling the PRD rule that pages must work without CDN CSS. Component
   classes (.btn, .form-control, .alert, .table, …) are intentionally NOT
   redefined here; they already exist above.
   ========================================================================== */
.row {
  display: flex;
  flex-wrap: wrap;
}
.row.g-2 {
  margin: -0.25rem;
}
.row.g-2 > [class*="col-"] {
  padding: 0.25rem;
}
.row > [class*="col-"] {
  flex: 1 1 100%;
  max-width: 100%;
}
@media (min-width: 768px) {
  .col-md-2 { flex: 0 0 16.666%; max-width: 16.666%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
}

.d-flex { display: flex; }
.d-inline-block { display: inline-block; }
.align-items-end { align-items: flex-end; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.w-100 { width: 100%; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.ms-2 { margin-left: 0.5rem; }

.text-center { text-align: center; }
.grouped-number { white-space: nowrap; }
.number-group { padding-inline-start: 0.25em; }
.table-responsive { width: 100%; overflow-x: auto; }
.align-middle td,
.align-middle th,
td.align-middle,
th.align-middle { vertical-align: middle; }

/* Flash toasts (#21): a fixed stack pinned to the top-center of the viewport.
   They overlay the page so a message never pushes a button or shifts layout. */
.toast-region {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(560px, calc(100vw - 2rem));
  pointer-events: none;
}

dialog[open] > .toast-region[data-modal-toast-region] {
  position: absolute;
  top: 1rem;
  z-index: 3;
  /* Fits small windows such as the badge window, not only wide ones. */
  width: min(560px, calc(100% - 2rem));
}

/* A notice inside a window lies over its title; a solid base keeps the notice readable. */
dialog[open] > .toast-region[data-modal-toast-region] .toast-error {
  background: linear-gradient(rgba(225, 109, 119, 0.59), rgba(225, 109, 119, 0.59)), #1c1d21;
}

dialog[open] > .toast-region[data-modal-toast-region] .toast-success {
  background: linear-gradient(rgba(87, 199, 133, 0.58), rgba(87, 199, 133, 0.58)), #1c1d21;
}

.toast {
  position: relative;
  pointer-events: auto;
  padding: 0.85rem 2.4rem 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-size: 0.92rem;
  line-height: 1.35;
  word-break: break-word;
  animation: toast-in 0.18s ease-out;
}

.toast-success {
  background: rgba(87, 199, 133, 0.58);
  border-color: rgba(87, 199, 133, 0.66);
  color: #f4fff8;
}

.toast-persistent {
  user-select: text;
}

.toast-error {
  background: rgba(225, 109, 119, 0.59);
  border-color: rgba(225, 109, 119, 0.68);
  color: #fff6f7;
}

.toast-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.toast-close:hover { opacity: 1; }

.toast-prominent {
  padding: 1.15rem 3.4rem 1.15rem 1.2rem;
  border-width: 2px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
}

.toast-prominent.toast-success {
  background: #154b35;
  border-color: #57c785;
}

.toast-prominent.toast-error {
  background: #6a2530;
  border-color: #e16d77;
}

.toast-prominent .toast-close {
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: #343845;
  color: #fff;
  opacity: 1;
}

.toast-prominent .toast-close:hover,
.toast-prominent .toast-close:focus-visible {
  background: #484e60;
}

.toast-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ───────────────────────────────────────────────────────────────────────────
   Canonical creator card (#22). ONE design used EVERYWHERE creators are listed:
   the signed-in home "Creators you follow", the Creators directory, and the
   Following page. Layout:
     [ NAME                                  [✉][🔔]  [Follow]   Joined ]
     [ [AVATAR]  description text that wraps to the right of the image and  ]
     [ [AVATAR]  runs underneath the action row above                       ]
   Edit it HERE, never per-page.
   ─────────────────────────────────────────────────────────────────────────── */
/* The creator list IS a table with sortable Creator/Joined columns and thin,
   visible horizontal + vertical grid lines (#22). */
.creator-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
}

.creator-th {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  font-size: 0.828rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Actions are only as wide as their content; Creator takes the rest. There is
   no Joined column - both sort links share the Creator cell, "Joined" pushed to
   its right edge so it sits above the dates. */
.creator-th-actions {
  width: 1%;
}

.creator-th-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Clickable column header that toggles ASC/DESC (the only sort UI - no bar). */
.creator-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.creator-sort--joined {
  margin-left: auto;
  text-align: right;
}

.creator-sort:hover,
.creator-sort:focus-visible {
  color: var(--accent);
}

.creator-sort.is-active {
  color: var(--accent-strong);
}

.creator-sort-arrow {
  font-size: 0.8em;
}

.creator-sort:not(.is-active) .creator-sort-arrow {
  display: none;
}

/* Creator rows read as CARDS: a lifted surface, not the page background with
   a hairline on it - at the same value as the ground they disappeared. */
.creator-cell {
  /* Thin rows: the avatar sets the height, the cell adds almost nothing. */
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: var(--surface);
  vertical-align: middle;
}

/* Creator column: avatar left, name + description right (card look). */
.creator-cell-main {
  vertical-align: middle;
  box-shadow: inset 3px 0 0 var(--accent);
}

.creator-cell-actions {
  width: 1%;
}

/* Action cluster, right-aligned: Email/Notify → Follow (rightmost). */
.creator-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.creator-card-actions form {
  margin: 0;
}

/* Follow / Following share one fixed footprint so the layout never shifts when
   the label changes - sized to the wider "Following" from the start, one line,
   no checkmark (#22). */
.creator-follow-btn {
  min-width: 6.5rem;
  white-space: nowrap;
}

/* The Follow button's state shows in its fill (#22, SUB65): Follow is a main
   button, Following is the graphite button with an accent check (app-forms.css). */

/* Hovering a "Following" button reveals its intent: the label swaps to
   "Unfollow" (the tooltip says "Click to unfollow [CREATOR]") (#32). Both labels
   are stacked in the SAME grid cell, so the button always sizes to the wider of
   the two words and never changes width. The swap is done with `visibility`
   (never `display`), so both keep occupying the cell - the button's size and
   position stay 100% constant on hover; only the visible word changes. */
.follow-btn-labels {
  display: inline-grid;
}

.follow-btn-labels > .follow-btn-label {
  grid-area: 1 / 1;
}

.creator-follow-btn .follow-btn-label-hover {
  visibility: hidden;
}

.creator-follow-btn.is-following:hover .follow-btn-label-default,
.creator-follow-btn.is-following:focus-visible .follow-btn-label-default {
  visibility: hidden;
}

.creator-follow-btn.is-following:hover .follow-btn-label-hover,
.creator-follow-btn.is-following:focus-visible .follow-btn-label-hover {
  visibility: visible;
}

/* The name is the card's headline. It sits at the top of the identity column
   beside the avatar, so it needs no clearance margin of its own - the column's
   gap spaces it from the description.
   Selector is scoped through .creator-cell-main on purpose: the generic
   `.app-content h2, .app-content h3` kicker style (tiny, uppercase, muted)
   otherwise wins on specificity and shrank this name to 0.736rem. */
.creator-cell-main .creator-card-name {
  margin: 0;
  padding: 0;
  min-width: 0;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
  text-transform: none;
  color: var(--text);
}

.creator-card-name a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

.creator-card-name a:hover,
.creator-card-name a:focus-visible {
  color: var(--accent-strong);
}

/* Joined date: only as wide as the date needs, right-aligned, never stretches. */
.creator-card-joined {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.977rem;
}

/* Avatar left, identity column right - the same shape as the creator page's
   top row, and the reason the row is no taller than the avatar. */
.creator-card-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.creator-card-identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-width: 0;
}

/* Each of the identity column's two lines: text on the left, its right-aligned
   entry (joined date on line one, release count on line two) at the far edge. */
.creator-card-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.creator-card-line > .creator-card-joined,
.creator-card-line > .creator-card-stat {
  flex: 0 0 auto;
  text-align: right;
}

.creator-card-stat {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Fixed-clamp description so cards stay uniform and never balloon. */
.creator-card-bio {
  margin: 0;
  min-width: 0;
  color: var(--text-soft);
  line-height: 1.45;
  display: -webkit-box;
  /* Two lines, not four: the row stays thin and uniform. */
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Shared avatar link wrapper. */
.creator-avatar-frame-link {
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 14px;
  text-decoration: none;
}

.creator-avatar-frame-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 3px;
}

/* Card avatar: 40% smaller than the old 112px so the row is not dominated by
   the icon and the name/description carry the card. */
.creator-avatar-frame--card {
  width: 67px;
  height: 67px;
}

/* Narrow screens: the two lines stop fighting for one line each and stack,
   with their right-hand entry dropping under the text. */
@media (max-width: 640px) {
  .creator-card-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
  }

  .creator-card-line > .creator-card-joined,
  .creator-card-line > .creator-card-stat {
    text-align: left;
  }
}

/* ============================================================
   Tier management rewrite (#35): compact add bar, compact tier
   cards, and the inclusion flowchart.
   ============================================================ */

.section-subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-soft);
  font-size: 0.943rem;
}

.tier-table-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.tier-add-form .btn .btn-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
}

.tier-add-form .btn .btn-icon svg {
  width: 16px;
  height: 16px;
}

.tier-add-form [data-form-message] {
  grid-column: 1 / -1;
}

.tier-add-form [data-form-message]:empty {
  display: none;
}

/* Compact tier cards in a responsive grid. */
.tier-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.tier-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.tier-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tier-status-badge {
  font-size: 0.828rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-soft);
  white-space: nowrap;
}

.tier-status-badge.is-expiring {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

.tier-card-actions {
  display: inline-flex;
  gap: 0.15rem;
}

.tier-card-fields {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tier-card-name {
  font-weight: 600;
}

.tier-card-price-field {
  position: relative;
  display: flex;
  align-items: center;
}

.tier-card-price-field .form-control {
  padding-left: 1.5rem;
  padding-right: 2.6rem;
}

.tier-card-price-prefix {
  position: absolute;
  left: 0.6rem;
  color: var(--text-soft);
  pointer-events: none;
}

.tier-card-price-suffix {
  position: absolute;
  right: 0.6rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  pointer-events: none;
}

.tier-card .field-counter {
  margin: 0;
}

.tier-card [data-form-message]:empty {
  display: none;
}

/* Inclusion flowchart. */
.tier-flow-hint {
  margin: 0 0 0.6rem;
  color: var(--text-soft);
  font-size: 0.943rem;
}

.tier-flow {
  position: relative;
  width: 100%;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.tier-flow-arrows {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.tier-flow-edge {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  opacity: 0.85;
}

.tier-flow-arrowhead {
  fill: var(--accent);
}

.tier-flow-layers {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 0.5rem 0;
}

.tier-flow-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2rem;
}

.tier-flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 8.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.tier-flow-node:hover,
.tier-flow-node:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  outline: none;
}

.tier-flow-node.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-1px);
}

.tier-flow-node-name {
  font-weight: 600;
}

.tier-flow-node-price {
  font-size: 0.874rem;
  color: var(--text-soft);
}

.tier-flow-edge-remove {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.tier-flow-edge-remove:hover,
.tier-flow-edge-remove:focus-visible {
  color: #fff;
  border-color: transparent;
  background: var(--btn-danger);
  outline: none;
}


/* Creator workspace visual system (#76). */
.creator-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 0;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}

.creator-page-header .page-kicker {
  margin: 0;
}

.creator-page-header > div:first-child {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  align-content: center;
}

.creator-page-note {
  margin: 0.25rem 0 0;
  color: var(--text-soft);
}

.creator-edit-heading-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.35rem;
  color: var(--text);
}

.creator-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.creator-page-actions > .btn,
.creator-page-actions > button.btn,
.creator-page-actions .creator-create-main,
.creator-page-actions .creator-template-caret {
  min-height: 40px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.creator-page-actions > .btn.btn-key-action,
.creator-page-actions .creator-create-main.btn-key-action {
  min-height: 44px;
  padding-top: 0.62rem;
  padding-bottom: 0.62rem;
}

.creator-workspace .creator-card {
  min-width: 0;
}

.creator-ledger-heading {
  align-items: center;
}

.creator-ledger-filter {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.35rem 0 0.75rem;
  padding: 0.35rem 0;
  flex: 1 1 auto;
}

.creator-ledger-unread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.creator-ledger-unread[hidden] {
  display: none;
}

.creator-ledger-unread p {
  margin: 0;
}

.creator-ledger-filter > div {
  flex: 1 1 170px;
}

.creator-ledger-filter > div[hidden] {
  display: none;
}

.creator-ledger-filter .creator-ledger-filter-action {
  flex: 0 0 auto;
}

.creator-ledger-filter-action .btn {
  min-height: 40px;
}

.earnings-controls-panel {
  width: 100%;
}

.creator-earnings-controls {
  min-width: 0;
}

/* Navigation badge controls (Admin > Financial and Users, Creator > Earnings
   and Subscribers). A bell at the end of the caller's row opens a small
   window with the badge choices; each choice applies and is saved at once,
   without the page Save bar (SUB261). */
.notification-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.notification-controls > .notification-controls-open {
  flex: 0 0 auto;
  margin-left: auto;
}

.notification-controls > form.creator-ledger-filter {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.notification-tabs-row {
  align-items: center;
}

.notification-controls-window {
  width: min(28rem, calc(100vw - 2rem));
}

.notification-controls-grid {
  display: grid;
  gap: 1.1rem;
}

.notification-controls-grid > * + * {
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}

.earnings-control,
.earnings-unread-reset label,
.earnings-rolling-control > label:not(.earnings-rolling-check) {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  white-space: nowrap;
}

:is(.earnings-control, .earnings-unread-reset label, .earnings-rolling-control > label) > span:first-child,
.earnings-read-control p {
  color: var(--text-muted);
  font-size: 0.828rem;
  font-weight: 500;
  line-height: 1.4;
}

.earnings-rolling-control {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  white-space: nowrap;
}

.earnings-rolling-control .earnings-rolling-check {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-soft);
  font-size: 0.93rem;
}

.earnings-rolling-control .earnings-rolling-check > span {
  color: inherit;
  font-size: inherit;
}

.earnings-rolling-control input[type="number"] {
  width: 6rem;
}

/* SUB261 In the badge window Rolling and Days share one line: the checkbox on
   the left, Days with its field inline on the right, both at the same height. */
.notification-controls-window .earnings-rolling-control {
  align-items: center;
  justify-content: space-between;
}

.notification-controls-window .earnings-rolling-control > label:not(.earnings-rolling-check) {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.notification-controls-window .earnings-rolling-control > label:not(.earnings-rolling-check) > span:first-child {
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1;
}

.earnings-read-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.earnings-read-control p {
  margin: 0;
  white-space: normal;
}

/* Rolling on: acknowledging does nothing, so those controls read as off.
   Scoped here because buttons site-wide keep their white label when disabled. */
:root [data-notification-controls] .btn:disabled {
  color: var(--text-muted);
  cursor: default;
}

[data-notification-controls] .form-control:disabled {
  opacity: 0.5;
  cursor: default;
}

[data-notification-controls] .earnings-unread-reset:has(input:disabled) label > span:first-child {
  opacity: 0.6;
}

.earnings-unread-reset {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem 1rem;
  min-width: 0;
}

.earnings-unread-reset label {
  flex: 1 1 10rem;
}

.earnings-unread-reset input[type="date"] {
  width: 100%;
}

.earnings-unread-reset [data-unread-date-message]:empty {
  display: none;
}

.earnings-unread-reset [data-unread-date-message] {
  flex: 1 1 100%;
  white-space: normal;
}

.notification-controls-window .btn {
  width: auto;
  flex: 0 0 auto;
}

/* A date range and its actions on one line: Creator > Earnings (both ranges)
   and Admin > Financial > Earnings. Fields share the room and shrink. */
.earnings-date-range {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.earnings-date-range > div:not(.creator-ledger-export-actions) {
  flex: 0 1 12rem;
  min-width: 7.5rem;
}

.earnings-date-range .creator-ledger-export-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.admin-transaction-report .earnings-date-range > div:first-of-type {
  flex: 2 1 16rem;
}

.admin-transaction-report .creator-ledger-filter > div {
  min-width: 0;
}

.admin-transaction-report,
.admin-transaction-report .creator-ledger-filter > div {
  min-width: 0;
}

@media (max-width: 900px) {
  .earnings-date-range {
    flex-wrap: wrap;
  }

  .earnings-date-range > div:not(.creator-ledger-export-actions) {
    flex: 1 1 9rem;
  }
}

.creator-ledger-table-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.creator-ledger-table-heading h3,
.creator-ledger-table-heading p {
  margin: 0;
}

.creator-ledger-table-heading > div:first-child:not(.creator-chart-controls) {
  flex: 1;
  min-width: 0;
  align-self: stretch;
  align-content: end;
}

.creator-ledger-table-heading p,
.creator-ledger-table-heading > span,
.creator-ledger-cell-note {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.creator-ledger-transactions-heading {
  margin-top: 1.3rem;
}

.creator-ledger-table-wrap {
  border-radius: var(--radius-md);
}

.creator-workspace .creator-ledger-table {
  font-variant-numeric: tabular-nums;
}

.creator-workspace .creator-ledger-summary {
  min-width: 900px;
}

.creator-workspace .creator-ledger-transactions {
  width: 100%;
  min-width: 72rem;
  table-layout: fixed;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-date {
  width: 9.45rem;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-type {
  width: 10.5rem;
}

.creator-ledger-transactions tbody time {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.creator-ledger-transactions .creator-ledger-column-item {
  width: 1%;
  white-space: nowrap;
}

.creator-ledger-transactions .creator-ledger-item {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-purchasing-user {
  width: 14rem;
  white-space: nowrap;
}

.creator-ledger-buyer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.creator-ledger-buyer-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-ledger-buyer-menu {
  flex: 0 0 auto;
}

.creator-ledger-buyer-menu > summary,
.table-row-menu > summary {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-color: transparent;
  background: transparent;
  font-size: 1.4rem;
}

[data-anchored-menu] > [data-anchored-menu-panel] {
  position: fixed;
  inset: auto;
  z-index: 100;
  width: 10rem;
  max-width: calc(100vw - 16px);
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-purchaser-country {
  width: 6rem;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-classification {
  width: 10.5rem;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-invoice {
  width: 3.25rem;
  padding-right: 0.35rem;
  padding-left: 0.35rem;
  text-align: center;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-invoice-heading,
.creator-workspace .creator-ledger-transactions .creator-invoice-download {
  display: inline-flex;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-invoice-heading {
  width: 1.8rem;
  height: 1.8rem;
  color: #fff;
}

.creator-workspace .creator-ledger-transactions .creator-invoice-download,
.purchase-invoice-download {
  width: 1.8rem;
  height: 1.8rem;
  color: #fff;
}

.creator-workspace .creator-ledger-transactions .creator-invoice-download svg,
.purchase-invoice-download svg,
.purchase-invoice-column svg {
  width: 100%;
  height: 100%;
  fill: #fff;
  color: #fff;
  stroke: #fff;
}

:is(.creator-workspace, .admin-transaction-report) .creator-ledger-transactions .creator-ledger-pending,
:is(.creator-workspace, .admin-transaction-report) .creator-ledger-transactions .creator-ledger-pending > td,
:is(.creator-workspace, .admin-transaction-report) .creator-ledger-transactions .creator-ledger-pending time,
:is(.creator-workspace, .admin-transaction-report) .creator-ledger-transactions .creator-ledger-pending a,
:is(.creator-workspace, .admin-transaction-report) .creator-ledger-transactions .creator-ledger-pending .creator-ledger-cell-note {
  color: var(--danger);
}

/* A reconciled row with no reportable money is a data fault, not a sale. */
:is(.creator-workspace, .admin-transaction-report) .creator-ledger-transactions .creator-ledger-invalid > td {
  background: rgba(222, 42, 57, 0.18);
  font-weight: 700;
}

:is(.creator-workspace, .admin-transaction-report) .creator-ledger-transactions .creator-ledger-invalid > td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.purchase-invoice-column {
  width: 2.5rem;
  text-align: center;
}

.purchase-invoice-column > span[aria-label="Invoice"] {
  display: inline-flex;
  width: 1.8rem;
  height: 1.8rem;
}

.purchase-invoice-download {
  display: inline-flex;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-type,
.creator-workspace .creator-ledger-transactions .creator-ledger-column-classification,
.creator-workspace .creator-ledger-transactions td:nth-child(2),
.creator-workspace .creator-ledger-transactions td:nth-child(5) {
  padding-right: 0.2rem;
  padding-left: 0.2rem;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-price,
.creator-workspace .creator-ledger-transactions .creator-ledger-column-discount,
.creator-workspace .creator-ledger-transactions .creator-ledger-column-paid {
  width: 5.25rem;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-stripe,
.creator-workspace .creator-ledger-transactions .creator-ledger-column-tax,
.creator-workspace .creator-ledger-transactions .creator-ledger-column-platform {
  width: 4.5rem;
  padding-right: 0.45rem;
  padding-left: 0.45rem;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-tax-due {
  width: 5.25rem;
}

.creator-workspace .creator-ledger-transactions .creator-ledger-column-balance,
.creator-workspace .creator-ledger-transactions .creator-ledger-column-earnings {
  width: 5.5rem;
}

.creator-workspace .creator-ledger-transactions td:first-child {
  white-space: nowrap;
}

.creator-workspace .creator-ledger-item {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-ledger-pending-reason {
  display: block;
  max-width: 100%;
  margin-top: 0.2rem;
  overflow: hidden;
  color: var(--danger);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Underline only when it opens the diagnostic. A viewer without that
   entitlement gets the same words as plain text, not a link that goes
   nowhere. */
a.creator-ledger-pending-reason {
  text-decoration: underline;
}

.creator-ledger-pending-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85em;
  color: var(--muted);
}

.creator-ledger-diagnostic-reason {
  color: var(--danger);
  font-weight: 700;
}

.creator-ledger-diagnostic-ok {
  font-weight: 700;
}

.creator-ledger-diagnostic-data {
  display: grid;
  gap: 0;
  margin: 0;
}

.creator-ledger-diagnostic-data > div {
  display: grid;
  grid-template-columns: minmax(10rem, 0.7fr) minmax(0, 1.3fr);
  gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}

.creator-ledger-diagnostic-data dt {
  color: var(--text-muted);
}

.creator-ledger-diagnostic-data dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Admin Earnings: a data grid with every column. It scrolls sideways inside
   its box, each column starts at its content width and the admin can drag
   any heading edge to change it (table.js). */
.admin-transaction-report .creator-ledger-table-wrap {
  overflow-x: auto;
}

.admin-transaction-report .creator-ledger-transactions {
  width: max-content;
  min-width: 100%;
}

.admin-transaction-report .creator-ledger-transactions :is(th, td) {
  white-space: nowrap;
}

.admin-transaction-report .creator-ledger-column-tax,
.admin-transaction-report .creator-ledger-column-tax-due {
  padding-right: 0.45rem;
  padding-left: 0.45rem;
}

.creator-ledger-table .creator-ledger-column-platform {
  border-left: 3px solid var(--border-strong, var(--border));
}

.creator-ledger-table td:not(:first-child) {
  white-space: nowrap;
}

.creator-ledger-cell-note {
  display: block;
  margin-top: 0.15rem;
}

.creator-ledger-table .creator-ledger-empty {
  padding: 1.25rem;
  color: var(--text-muted);
  text-align: center;
}

/* A transfer between the site's own two Stripe accounts. It carries a real
   signed amount but belongs to no column total, so it spans the money
   columns. It must still read as one line of the same weight and size as the
   figures above and below it, or the row grows taller than its neighbours and
   the number stops lining up. */
.creator-ledger-table .creator-ledger-internal-transfer {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.creator-ledger-table .creator-ledger-total-row th,
.creator-ledger-table .creator-ledger-total-row td {
  font-weight: 700;
}

.creator-ledger-amount-neutral {
  color: var(--text);
}

.creator-ledger-amount-negative {
  color: var(--danger);
}

.creator-ledger-transaction-id {
  width: 1%;
  max-width: 6rem;
  font-size: 0.65rem;
  white-space: nowrap;
}

.creator-ledger-transaction-id code {
  color: var(--text-muted);
  font: inherit;
  user-select: all;
}

.creator-ledger-amount-warning {
  color: var(--warning);
  font-weight: 700;
}

.creator-ledger-amount-positive {
  color: var(--success);
  font-weight: 700;
}

/* A row new to a badge (unread, or inside its rolling window) gets a thin
   gold edge on its first visible cell, never a tinted row. A literal gold
   rather than var(--accent), so "new" reads the same under every theme.
   A row with data-row-edge="<state>" uses the same edge in its state's
   colour (SUB258, Creator > Subscribers); "new" gold wins over a state. */
.creator-ledger-row-new > :nth-child(1 of td:not([hidden])),
.notification-row-new > :nth-child(1 of td:not([hidden])),
[data-row-edge] > :nth-child(1 of td:not([hidden])) {
  --row-edge-inset: inset 3px 0 var(--row-edge, #f0b55a);
  box-shadow: var(--row-edge-inset), var(--pinned-edge, 0 0 #0000);
}

/* SUB476 Positioned for the edge's hover target, at no specificity, so a
   pinned first cell (Table 'pinned') stays sticky on a new row. */
:where(.creator-ledger-row-new, .notification-row-new, [data-row-edge]) > :where(:nth-child(1 of td:not([hidden]))) {
  position: relative;
}

[data-row-edge="active"] { --row-edge: #57c785; }
[data-row-edge="expiring"] { --row-edge: #e8894a; }
[data-row-edge="attention"] { --row-edge: #e16d77; }
[data-row-edge="ended"] { --row-edge: #6b7380; }
.creator-ledger-row-new,
.notification-row-new { --row-edge: #f0b55a; }

/* The edge's hover target, so its tooltip can say what the colour means. */
.table-row-edge-hit {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 8px;
}

.creator-sales-chart {
  position: relative;
  margin-bottom: 1.4rem;
}

.creator-sales-chart ol {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  min-height: 220px;
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.creator-sales-chart-plot {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
}

.creator-sales-chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  padding: 1rem 0.5rem 3.4rem 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.creator-sales-chart li {
  display: grid;
  flex: 1 0 76px;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
}

.creator-sales-chart-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0.2rem;
  height: 155px;
}

.creator-sales-chart-bars > span {
  display: flex;
  flex-direction: column;
  justify-content: end;
  width: 42px;
  height: 100%;
}

.creator-sales-chart-bars b {
  margin-bottom: 0.2rem;
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.creator-sales-chart-bars i {
  width: 100%;
  height: var(--chart-height);
  min-height: 2px;
  border-radius: 3px 3px 0 0;
}

.creator-ledger-export-actions {
  display: flex;
  flex: 1 1 100%;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-left: auto;
}

.creator-sales-chart .is-sales {
  background: var(--accent);
}

.creator-sales-chart .is-proceeds {
  background: var(--success);
}

.creator-ledger-table-heading > span i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-inline: 0.35rem 0.15rem;
  border-radius: 2px;
}

.markdown-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.markdown-compose-pane,
.markdown-preview-pane {
  min-width: 0;
  min-height: 310px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  overflow: hidden;
}

.markdown-compose-pane .var-editor-wrap,
.markdown-compose-pane textarea.form-control {
  width: 100%;
  max-width: none;
  min-height: 270px;
  border: 0;
  border-radius: 0;
}

.markdown-compose-pane textarea.form-control {
  resize: vertical;
}

.markdown-compose-pane .var-editor-wrap textarea.form-control,
.markdown-compose-pane .var-editor-wrap textarea.form-control:focus {
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.markdown-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 42px;
  padding: 0.4rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-raised) 76%, transparent);
}

.creator-workspace .markdown-tool {
  min-width: 34px;
  min-height: 30px;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.markdown-tool:hover,
.markdown-tool:focus-visible {
  border-color: var(--accent);
  color: var(--text);
}

.markdown-reference {
  margin-left: auto;
  font-size: 0.86rem;
}

.markdown-preview-label {
  min-height: 42px;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.markdown-preview-pane .body-preview-content {
  min-height: 220px;
  margin: 0;
  padding: 1rem;
  border: 0;
  border-radius: 0;
}

.markdown-preview-pane {
  min-height: 230px;
}

.creator-release-panel .form-block-pad {
  max-width: none;
  margin: 0;
}

/* Date picker, time picker and the Schedule button share one row. */
.creator-release-schedule {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.25rem 1rem 0.5rem 0;
}

[data-schedule-overdue-helper][hidden] {
  display: none;
}

.creator-release-schedule-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.creator-release-schedule-field .form-label {
  margin: 0;
}

.creator-release-saved-time {
  color: var(--text-muted);
  font-size: 0.875rem;
  white-space: nowrap;
}

.creator-release-actions {
  display: flex;
  justify-content: flex-start;
  padding: 0.25rem 1rem 1rem 0;
}

.btn.btn-key-action.btn-release {
  min-height: 52px;
  min-width: 10rem;
  padding: 0.8rem 1.25rem;
  border-color: transparent;
  background: var(--btn-success);
  color: #fff;
  box-shadow: 0 0.45rem 1.2rem color-mix(in srgb, var(--success) 25%, transparent);
}

.btn.btn-key-action.btn-release.btn-release-update {
  min-height: 40px;
  min-width: 0;
  padding: 0.55rem 0.85rem;
}

.btn.btn-key-action.btn-release:hover:not(:disabled),
.btn.btn-key-action.btn-release:focus-visible:not(:disabled) {
  border-color: transparent;
  background: var(--btn-success);
  color: #fff;
}

.btn.btn-key-action.btn-release:active,
.btn.btn-key-action.btn-release:disabled {
  border-color: transparent;
  background: var(--btn-success);
  color: #fff;
}

.creator-release-template-grid.is-template-only {
  grid-template-columns: minmax(0, 1fr);
}

.creator-profile-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  width: 100%;
}

.creator-profile-layout > form {
  display: contents;
}

.signed-home-intro {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.7fr);
  gap: 1.25rem;
  margin-bottom: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface));
}

.signed-home-copy h1 {
  margin: 0.2rem 0 0.55rem;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
}

.signed-home-copy > p:last-child {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

@media (max-width: 900px) {
  .signed-home-intro {
    grid-template-columns: minmax(0, 1fr);
  }
}

.creator-profile-editor-panel,
.creator-profile-preview-panel {
  min-width: 0;
  width: 100%;
}

.creator-profile-primary-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(320px, 2fr) minmax(150px, 0.55fr);
  align-items: start;
  gap: 1rem;
}

.creator-profile-primary-grid > div {
  min-width: 0;
}

.creator-profile-primary-grid .section-heading {
  margin-bottom: 0.65rem;
}

.creator-profile-details-column {
  display: grid;
  gap: 0.75rem;
}

.creator-profile-color-column {
  justify-self: end;
}

.creator-profile-desc-row .form-control {
  max-width: none;
}

.creator-profile-name-field .form-control {
  max-width: none;
}

.creator-profile-follower-message .form-control {
  max-width: none;
}

.creator-profile-preview-panel {
  position: static;
}

.creator-profile-previews {
  display: grid;
  gap: 1rem;
}

.creator-profile-previews > section,
.creator-preview-surface,
.creator-preview-surface > * {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.creator-profile-previews > section > h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.creator-preview-surface {
  pointer-events: none;
  user-select: none;
}

[data-profile-save]:disabled {
  opacity: 0.5;
}

.markdown-composer[data-preview-mode="variable"] .markdown-compose-pane,
.markdown-composer[data-preview-mode="variable"] .markdown-preview-pane {
  min-height: 8rem;
}

.markdown-composer[data-preview-mode="variable"] {
  align-items: start;
}

.markdown-composer[data-preview-mode="variable"] .markdown-compose-pane {
  min-height: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.markdown-composer[data-preview-mode="variable"] .var-editor-wrap {
  min-height: 0;
}

.markdown-composer[data-preview-mode="variable"] .markdown-toolbar {
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.markdown-composer[data-preview-mode="variable"] textarea.form-control {
  display: block;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.markdown-composer[data-preview-mode="variable"] .markdown-preview-pane {
  overflow: auto;
}

.markdown-composer[data-preview-mode="variable"] textarea {
  min-height: calc(5lh + 1.5rem);
}

/* "Profile: username" - the handle is a link to the public creator page but
   must not look like a different typeface from the kicker it sits in. It
   inherits everything and adds only the underline that marks it clickable. */
.creator-page-kicker-handle {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.creator-appearance-section {
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.creator-profile-editor-panel .creator-appearance-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.creator-avatar-crop-editor {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  width: min(280px, 80vw);
  margin-top: 0.4rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.creator-avatar-crop-stage {
  width: 256px;
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  cursor: pointer;
  touch-action: none;
}

.creator-avatar-crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.creator-avatar-zoom {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}

.creator-avatar-crop-editor p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.licence-document-list {
  display: grid;
  gap: 0.55rem;
}

.licence-document {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.licence-document summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  font-weight: 700;
}

.licence-document summary span:last-child {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.licence-document-body {
  padding: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  line-height: 1.65;
  white-space: normal;
}

.licence-text-editor {
  min-height: 460px !important;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.55;
  resize: vertical;
}

.license-modal .app-modal-body {
  width: min(1200px, calc(100vw - 2rem));
  max-width: none;
}

.license-modal {
  max-width: none;
  width: auto;
}

dialog[data-modal].category-modal {
  width: min(960px, calc(100vw - 2rem));
  max-width: none;
}

.category-modal .app-modal-body {
  width: 100%;
}

@media (max-width: 980px) {
  .markdown-composer,
  .creator-profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-profile-primary-grid {
    grid-template-columns: minmax(140px, 0.5fr) minmax(260px, 1.5fr);
  }

  .creator-profile-color-column {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .creator-profile-preview-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .creator-profile-primary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-profile-color-column {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .creator-page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .creator-page-actions,
  .creator-page-actions .btn,
  .creator-page-actions .creator-create-split {
    width: 100%;
  }

  .creator-page-actions .btn {
    justify-content: center;
  }

  .creator-workspace .app-table:where(:not(.app-table--loose)) {
    min-width: 720px;
  }

  .creator-workspace .creator-reorder-table {
    min-width: 620px;
  }

  .creator-ledger-heading,
  .creator-ledger-table-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .creator-ledger-heading .btn,
  .creator-ledger-filter,
  .creator-ledger-filter > div,
  .creator-ledger-filter .creator-ledger-filter-action,
  .creator-ledger-filter-action .btn {
    width: 100%;
  }

  .markdown-reference {
    flex-basis: 100%;
    margin-left: 0;
  }
}

.permission-intro {
  margin: 0;
  color: var(--text-soft);
}

.creator-content-permission-overrides {
  margin-top: 1rem;
}

.content-permission-override-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.65rem;
}

.content-permission-override {
  display: grid;
  gap: 0.3rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}

.permission-setting-grid,
.admin-permission-defaults {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
}

.creator-license-permissions .permission-setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.creator-license-permissions .permission-setting {
  max-width: none;
}

@media (max-width: 700px) {
  .creator-license-permissions .permission-setting-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.permission-setting,
.permission-default {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  min-height: 3rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
  transition: border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}

.permission-setting {
  grid-template-columns: 1.75rem minmax(0, 1fr);
  align-content: start;
  flex: 1 1 22rem;
}

.permission-default {
  flex: 1 1 22rem;
  cursor: pointer;
}

.permission-chip-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.permission-chip-copy strong {
  font-size: 0.8rem;
  line-height: 1.2;
}

.permission-chip-copy small {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 400;
}

.permission-description {
  margin-top: 0.3rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
}

.permission-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--text-muted);
}

.permission-chip-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
}

.permission-chip.is-allowed {
  border-color: color-mix(in srgb, var(--success, #4dbd74) 55%, var(--border));
}

.permission-chip.is-allowed .permission-chip-icon {
  color: var(--success, #4dbd74);
}

.permission-chip.is-not-allowed {
  opacity: 0.58;
  filter: grayscale(0.75);
}

.permission-chip.is-inherited .permission-chip-icon {
  color: var(--text-soft);
}

.permission-chip-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.permission-chip:has(.permission-chip-input:focus-visible),
.permission-chip:has(.permission-chip-select:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.permission-chip-select.form-select {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  min-height: 2rem;
  padding: 0.3rem 1.8rem 0.3rem 0.45rem;
  font-size: 0.75rem;
}

.permission-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.75rem 0.75rem;
}

.creator-permission-details > summary,
.category-permission-editor > summary {
  padding: 0.8rem;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.creator-permission-details[open] > summary,
.category-permission-editor[open] > summary {
  border-bottom: 1px solid var(--border);
}

.category-permission-editor {
  margin: 0.75rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-raised) 72%, transparent);
}

.category-permission-editor .permission-intro {
  padding: 0.75rem 0.75rem 0;
}

.permission-scope-list {
  display: grid;
  gap: 0.55rem;
}

.permission-scope,
.permission-guide {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.permission-scope summary,
.permission-guide summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  cursor: pointer;
  font-weight: 700;
}

.permission-scope summary span:last-child {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.permission-guide {
  margin-bottom: 0.75rem;
}

.permission-guide p {
  margin: 0;
  padding: 0 0.75rem 0.75rem;
  color: var(--text-soft);
}

.public-permission-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 0;
}

.creator-content-permissions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.45rem;
}

.creator-content-report {
  margin-right: 0.25rem;
}

.permission-summary-title {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.public-permission-item {
  position: relative;
  width: 2rem;
  min-height: 2rem;
  color: var(--text-muted);
}

.public-permission-item summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}

.public-permission-item summary::-webkit-details-marker {
  display: none;
}

.public-permission-item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.public-permission-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 20;
  width: min(28rem, calc(100vw - 2rem));
  min-width: 22rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: var(--surface-strong, var(--surface));
  box-shadow: 0 12px 28px rgb(0 0 0 / 18%);
  color: var(--text);
}

.public-permission-item:not([open]) .public-permission-popover {
  display: none;
}

.public-permission-item:hover .public-permission-popover,
.public-permission-item > summary:focus-visible + .public-permission-popover,
.public-permission-item[open] .public-permission-popover {
  display: block;
}

.public-permission-popover p {
  margin: 0;
  line-height: 1.5;
}

.public-permission-popover p + p {
  margin-top: 0.65rem;
}

.public-permission-state {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.public-permission-state span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--success, #4dbd74);
}

.public-permission-item.is-not-allowed .public-permission-state span,
.public-permission-source {
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .public-permission-popover {
    right: auto;
    left: 0;
    min-width: min(22rem, calc(100vw - 2rem));
  }
}

.public-permission-item .permission-chip-icon {
  width: 1.65rem;
  height: 1.65rem;
}

.public-permission-item .permission-chip-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.public-permission-item.is-allowed {
  border-color: color-mix(in srgb, var(--success, #4dbd74) 45%, var(--border));
  color: var(--success, #4dbd74);
}

.public-permission-item.is-not-allowed {
  color: var(--text-muted);
  opacity: 0.48;
  filter: grayscale(1);
}

.admin-frame-create,
.admin-frame-grant {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.admin-frame-create .form-check {
  grid-column: 1 / -1;
}

.admin-frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.admin-frame-card {
  display: grid;
  min-width: 0;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.admin-frame-card > img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  justify-self: center;
}

.admin-frame-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-section-permissions .app-table {
  width: 100%;
  overflow: hidden;
}

@media (max-width: 720px) {
  .permission-setting {
    grid-template-columns: 1.75rem minmax(0, 1fr);
    flex-basis: 100%;
    max-width: none;
  }

  .admin-frame-create,
  .admin-frame-grant {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-frame-create .form-check {
    grid-column: auto;
  }
}


/* ===========================================================================
 * Appearance picker (User Profile > Settings > Appearance)
 * ---------------------------------------------------------------------------
 * Scheme swatches preview the four ground steps of each scheme; accent chips
 * preview the hue itself. The colors use classes so the production Content
 * Security Policy does not block them. Selection is marked with the accent as
 * a line, in keeping with the rest of the redesign.
 * ======================================================================== */
.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.theme-picker-scheme {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .theme-picker-scheme {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.theme-option {
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 0;
}

/* The radio stays in the DOM for keyboard and screen-reader users; only its
   painted box is hidden. */
.theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.theme-option:hover {
  border-color: var(--border-strong);
}

.theme-option.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.theme-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-option-scheme {
  display: block;
  padding: 0.45rem;
}

.theme-option-name {
  display: block;
  font-size: 0.862rem;
  font-weight: 500;
  color: var(--text);
}

.theme-swatches {
  display: flex;
  gap: 2px;
  margin-top: 0.4rem;
}

.theme-swatch-band {
  flex: 1 1 0;
  height: 14px;
  border-radius: 2px;
}

.theme-swatch-midnight-1 { background: #161826; }
.theme-swatch-midnight-2 { background: #1a1c2b; }
.theme-swatch-midnight-3 { background: #1e2030; }
.theme-swatch-midnight-4 { background: #262939; }
.theme-swatch-graphite-1 { background: #17181c; }
.theme-swatch-graphite-2 { background: #1c1d22; }
.theme-swatch-graphite-3 { background: #202127; }
.theme-swatch-graphite-4 { background: #292a31; }
.theme-swatch-ink-1 { background: #0b0e12; }
.theme-swatch-ink-2 { background: #10141a; }
.theme-swatch-ink-3 { background: #151a21; }
.theme-swatch-ink-4 { background: #1d242d; }
.theme-swatch-slate-1 { background: #1b2028; }
.theme-swatch-slate-2 { background: #20262f; }
.theme-swatch-slate-3 { background: #252c36; }
.theme-swatch-slate-4 { background: #2e3641; }

.theme-option-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 28px;
  padding: 0 0.6rem 0 0.45rem;
  border-radius: 999px;
}

.theme-dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  flex: 0 0 13px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

/* ---- Final density + de-card pass ---------------------------------------
 * Everything below tightens surfaces the redesign should no longer read as
 * separate boxes, and pulls the remaining raised chrome down to a hairline. */
.setting-row {
  border-radius: var(--radius-md);
  padding: 0.55rem 0.7rem;
  background: transparent;
}

.settings-group-title {
  font-size: 0.736rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.settings-group + .settings-group {
  margin-top: 1rem;
}

.settings-grid {
  gap: 0.5rem;
}

.settings-card {
  padding: 0.7rem;
  background: transparent;
}

.setting-row-desc {
  font-size: 0.862rem;
}

.settings-security-fields {
  margin-top: 0.7rem;
}

/* One table treatment across the site: rounded containers and compact,
   uppercase headings. Individual tables may still define column widths. */
.table-responsive,
.admin-settings-table-wrap,
.admin-overview-table-wrap,
.admin-user-table-wrap,
.admin-report-detail-list,
.creator-content-files-table-wrap {
  border-radius: var(--radius-md);
  background: transparent;
}

.table-responsive,
.admin-settings-table-wrap,
.admin-overview-table-wrap,
.admin-user-table-wrap,
.admin-report-detail-list,
.creator-content-files-table-wrap {
  overflow-x: auto;
}

/* The shared table look lives in app-table.css (SUB67). */

/* Dropdowns, popovers and dialogs are genuinely floating, so they keep an
   edge - a hairline plus ambient darkness, never a stacked drop shadow. */
.cart-dropdown,
.multiselect-panel,
.app-modal-body {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
}

.content-directory-header-tools--mobile,
.download-history-mobile-cards,
.creator-overview-mobile-primary,
.creator-overview-mobile-details {
  display: none;
}

/* Phone layouts use a different reading flow while desktop keeps the existing
   table, toolbar, and multi-column geometry. */
@media (max-width: 720px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  main.app-content {
    --gutter: 1rem;
    overflow-x: clip;
  }

  .page-shell,
  .page-shell > *,
  .page-shell .stack-lg,
  .page-shell .stack-md,
  .page-shell .panel,
  .page-shell .hero,
  .creator-accent-scope,
  .creator-workspace,
  .creator-profile-layout,
  .creator-profile-form,
  .creator-profile-primary-grid,
  .creator-profile-primary-grid > div,
  .creator-content-detail,
  .messages-page,
  .messages-layout {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .page-shell > * {
    justify-self: stretch;
  }

  .page-kicker {
    overflow-wrap: anywhere;
  }

  .section-heading,
  .creator-table-actions,
  .creator-operations-head,
  .content-directory-header,
  .admin-overview-head,
  .admin-report-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .section-heading > *,
  .creator-table-actions > *,
  .creator-operations-head > *,
  .content-directory-header > * {
    min-width: 0;
    max-width: 100%;
  }

  .creator-workspace {
    --control-h: 44px;
  }

  .creator-workspace .markdown-tool {
    width: auto;
    min-width: 44px;
    min-height: 44px;
  }

  .creator-workspace .upload-dropzone [data-browse-trigger] {
    width: auto;
    min-height: 44px;
  }

  .creator-editor-preview-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-mobile-reorder {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 0.35rem;
    pointer-events: auto;
  }

  .preview-mobile-reorder-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
    font-size: 1.1rem;
  }

  .form-control:not(textarea),
  .form-select,
  .btn,
  button,
  summary,
  .sidebar-link,
  .messages-tab {
    min-height: 44px;
  }

  .btn-icon-only,
  .sidebar-toggle,
  .follow-toggle-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
  }

  .cart-toggle {
    width: auto;
    min-width: 44px;
    height: 44px;
  }

  .content-directory-search-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .content-directory-search-control > span {
    top: 24px;
  }

  .content-directory-search-control .btn-key-action,
  .content-directory-filter-grid,
  .content-directory-filter-grid .form-select {
    width: 100%;
    max-width: 100%;
  }

  .content-directory-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-directory-sort-controls {
    grid-column: 1 / -1;
  }

  .content-directory-filter-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .content-directory-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-directory-filters {
    padding: 1rem;
  }

  .creator-top-header,
  .creator-top-row,
  .creator-user-summary,
  .creator-membership-summary,
  .creator-tier-shelf,
  .creator-tier-shelf-viewport,
  .creator-filter-bar {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .creator-tier-shelf-track > .creator-tier-card {
    flex-basis: min(18rem, calc(100vw - 5rem));
    width: min(18rem, calc(100vw - 5rem));
  }

  .creator-tier-card-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .creator-filter-bar {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.45rem;
  }

  .creator-filter-group {
    max-width: none;
  }

  .creator-content-body,
  .markdown-body,
  .creator-description,
  .creator-profile-form a,
  .responsive-table-ready a {
    overflow-wrap: anywhere;
  }

  .creator-stat-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-stat-strip .stat-group,
  .creator-stat-strip .stat-group:first-child,
  .creator-stat-strip .stat-group:last-child {
    padding: 0.75rem 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .creator-stat-strip .stat-group:first-child {
    padding-top: 0;
  }

  .creator-stat-strip .stat-group:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .stat-items {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .stat-item {
    min-width: 0;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  }

  .creator-profile-primary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-profile-color-column {
    grid-column: auto;
    justify-self: stretch;
  }

  .creator-profile-form .form-control,
  .creator-profile-form .form-select,
  .creator-profile-form textarea,
  .creator-profile-form input,
  .creator-profile-form section {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .creator-profile-identity,
  .creator-profile-actions,
  .creator-profile-previews,
  .creator-table-actions-left,
  .creator-toolbar-actions,
  .creator-bulk-row,
  .permission-actions,
  .messages-thread-actions {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .creator-profile-identity {
    flex-direction: column;
  }

  .creator-table-actions-left > *,
  .creator-toolbar-actions > *,
  .creator-bulk-row > *,
  .permission-actions > * {
    width: 100%;
    max-width: 100%;
  }

  .table-responsive {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }

  .creator-filter-card .creator-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .creator-filter-card .creator-toolbar-search {
    grid-column: 1 / -1;
  }

  .creator-filter-card .creator-toolbar > :not(.creator-toolbar-search) {
    min-width: 0;
  }

  .creator-filter-card .creator-toolbar > :not(.creator-toolbar-search) .form-select {
    min-width: 0;
    padding-right: 1.5rem;
    padding-left: 0.55rem;
    font-size: 0.8rem;
  }

  .creator-filter-card .creator-filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.25rem;
  }

  .creator-filter-card .creator-filter-row .creator-filter-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .responsive-table-ready:not(.creator-table) {
    display: block;
    width: 100%;
    min-width: 0 !important;
    max-width: 100%;
    table-layout: auto;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  .responsive-table-ready:not(.creator-table) colgroup,
  .responsive-table-ready:not(.creator-table) thead {
    display: none;
  }

  .responsive-table-ready[data-sortable-table]:not(.creator-table) thead,
  .responsive-table-ready[data-admin-settings-table]:not(.creator-table) thead {
    display: block;
    width: 100%;
    margin-bottom: 0.55rem;
    overflow: visible;
  }

  .responsive-table-ready[data-sortable-table]:not(.creator-table) thead tr,
  .responsive-table-ready[data-admin-settings-table]:not(.creator-table) thead tr {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
  }

  .responsive-table-ready[data-sortable-table]:not(.creator-table) thead th,
  .responsive-table-ready[data-admin-settings-table]:not(.creator-table) thead th {
    display: block;
    flex: 0 0 auto;
    width: auto !important;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .responsive-table-ready[data-sortable-table]:not(.creator-table) thead button,
  .responsive-table-ready[data-admin-settings-table]:not(.creator-table) thead button {
    width: auto;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-strong);
  }

  .responsive-table-ready[data-sortable-table]:not(.creator-table) thead .creator-ledger-tooltip-trigger {
    width: 1.1rem;
    padding: 0;
    border-radius: 50%;
  }

  .responsive-table-ready:not(.creator-table) tbody {
    display: grid;
    gap: 0.75rem;
    width: 100%;
  }

  .responsive-table-ready:not(.creator-table) tbody tr {
    display: grid;
    min-width: 0;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
  }

  .responsive-table-ready:not(.creator-table) tbody td {
    display: grid;
    grid-template-columns: minmax(6.75rem, 0.42fr) minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100%;
    padding: 0.7rem 0.75rem !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    white-space: normal !important;
    text-align: left !important;
  }

  .responsive-table-ready:not(.creator-table) tbody td:last-child {
    border-bottom: 0 !important;
  }

  .responsive-table-ready:not(.creator-table) tbody td::before {
    content: attr(data-mobile-label);
    min-width: 0;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .responsive-table-ready:not(.creator-table) tbody td[data-mobile-label=""] {
    display: block;
  }

  /* SUB262 A status pill keeps its own width instead of filling the card row. */
  .responsive-table-ready:not(.creator-table) tbody td > .ui-capsule {
    justify-self: start;
  }

  .responsive-table-ready:not(.creator-table) tbody td[data-mobile-label=""]::before {
    display: none;
  }

  .responsive-table-ready:not(.creator-table) tbody td > *,
  .responsive-table-ready:not(.creator-table) tbody td form,
  .responsive-table-ready:not(.creator-table) tbody td input,
  .responsive-table-ready:not(.creator-table) tbody td select,
  .responsive-table-ready:not(.creator-table) tbody td textarea {
    min-width: 0;
    max-width: 100%;
  }

  .creator-content-files-table-wrap {
    overflow: visible;
    border: 0;
  }

  .creator-content-files-table.responsive-table-ready:not(.creator-table) tbody {
    gap: 0.4rem;
  }

  .creator-content-files-table.responsive-table-ready:not(.creator-table) tbody tr {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.15rem 0.5rem;
    padding: 0.45rem 0.5rem;
    overflow: visible;
  }

  .creator-content-files-table.responsive-table-ready:not(.creator-table) tbody td {
    display: block;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .creator-content-files-table.responsive-table-ready:not(.creator-table) tbody td::before {
    display: none;
  }

  .creator-content-files-table.responsive-table-ready:not(.creator-table) tbody td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .creator-content-files-table.responsive-table-ready:not(.creator-table) tbody td:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .creator-content-files-table.responsive-table-ready:not(.creator-table) tbody td:nth-child(n + 3):nth-child(-n + 6) {
    display: none !important;
  }

  .creator-content-files-table.responsive-table-ready:not(.creator-table) tbody td:nth-child(7) {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .creator-content-files-table.responsive-table-ready .creator-file-mobile-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem 0.35rem;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .creator-content-files-table.responsive-table-ready .creator-file-mobile-metadata span + span::before {
    content: "/";
    margin-right: 0.35rem;
    color: var(--text-soft);
  }

  .creator-content-files-table.responsive-table-ready .creator-file-action-col .btn {
    min-height: 30px;
    padding: 0.25rem 0.45rem;
    font-size: 0.75rem;
  }

  .creator-content-list-table thead {
    display: none !important;
  }

  .creator-content-list-table tbody tr {
    display: flex !important;
    flex-direction: column;
  }

  .creator-content-list-table tbody td:nth-child(3) {
    order: 1;
    padding-top: 0.9rem !important;
  }

  .creator-content-list-table tbody td:nth-child(1) {
    order: 2;
  }

  .creator-content-list-table tbody td:nth-child(4) {
    order: 3;
  }

  .creator-content-list-table tbody td:nth-child(5) {
    order: 4;
  }

  .creator-content-list-table tbody td:nth-child(6) {
    order: 5;
  }

  .creator-content-list-table tbody td:nth-child(7) {
    order: 6;
  }

  .creator-content-list-table tbody td:nth-child(8) {
    order: 7;
  }

  .creator-content-list-table tbody td:nth-child(9) {
    order: 8;
  }

  .creator-content-list-table tbody td:nth-child(10) {
    order: 9;
  }

  .creator-content-list-table tbody td:nth-child(11) {
    order: 10;
  }

  .creator-content-list-table tbody td:nth-child(12) {
    order: 11;
  }

  .creator-content-list-table tbody td:nth-child(13) {
    order: 12;
  }

  .creator-content-list-table tbody td:nth-child(2) {
    order: 13;
  }

  .creator-content-price-table tbody tr {
    display: flex !important;
    flex-direction: column;
  }

  .creator-content-price-table tbody td:nth-child(2) {
    order: 1;
    padding-top: 0.9rem !important;
  }

  .creator-content-price-table tbody td:nth-child(1) {
    order: 2;
  }

  .creator-content-price-table tbody td:nth-child(3) {
    order: 3;
  }

  .creator-content-price-table tbody td:nth-child(4) {
    order: 4;
  }

  .creator-content-price-table tbody td:nth-child(5) {
    order: 5;
  }

  .creator-content-price-table tbody td:nth-child(6) {
    order: 6;
  }

  .creator-content-price-table tbody td:nth-child(7) {
    order: 7;
  }

  .creator-content-price-table tbody td:nth-child(8) {
    order: 8;
  }

  .creator-content-price-table tbody td:nth-child(9) {
    order: 9;
  }

  .creator-content-price-table tbody td:nth-child(10) {
    order: 10;
  }

  .creator-content-price-table tbody td:nth-child(11) {
    order: 11;
  }

  .creator-content-price-table tbody td:nth-child(2)::before {
    display: none;
  }

  .creator-content-list-table tbody td:nth-child(3)::before {
    display: none;
  }

  .creator-content-list-table .creator-ops-title {
    font-size: 1.05rem;
    line-height: 1.35;
  }

  .creator-row-check-label {
    display: inline-grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    cursor: pointer;
  }

  .creator-row-check-label .creator-row-check {
    width: 1.25rem;
    height: 1.25rem;
  }

  .creator-reorder-table .drag-handle {
    display: none;
  }

  .mobile-reorder-actions {
    display: flex;
    gap: 0.5rem;
  }

  .mobile-reorder-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.1rem;
  }

  .responsive-table-ready .cell-clip {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .creator-table.responsive-table-ready,
  .creator-table.responsive-table-ready thead,
  .creator-table.responsive-table-ready tbody,
  .creator-table.responsive-table-ready tr,
  .creator-table.responsive-table-ready th,
  .creator-table.responsive-table-ready td {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .creator-table.responsive-table-ready {
    border: 0;
  }

  .creator-table.responsive-table-ready thead {
    margin-bottom: 0.65rem;
  }

  .creator-table.responsive-table-ready .creator-th-main {
    padding: 0.65rem 0;
    border-width: 0 0 1px;
  }

  .creator-table.responsive-table-ready .creator-th-actions {
    display: none;
  }

  .creator-table.responsive-table-ready tbody {
    display: grid;
    gap: 0.75rem;
  }

  .creator-table.responsive-table-ready .creator-row {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .creator-table.responsive-table-ready .creator-cell {
    border: 0;
  }

  .creator-table.responsive-table-ready .creator-cell-main {
    box-shadow: inset 3px 0 0 var(--accent);
  }

  .creator-table.responsive-table-ready .creator-cell-actions {
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
  }

  .creator-table.responsive-table-ready .creator-cell::before {
    display: none;
  }

  .creator-card-body {
    gap: 0.75rem;
  }

  .creator-avatar-frame--card {
    width: 56px;
    height: 56px;
  }

  .creator-cell-main .creator-card-name {
    font-size: 1.3rem;
  }

  .creator-card-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .creator-card-actions .follow-toggles {
    flex: 0 0 auto;
  }

  .creator-card-actions .creator-card-follow,
  .creator-card-actions .creator-follow-btn {
    flex: 1 1 8rem;
    width: auto;
  }

  .follow-toggle-icon {
    width: 44px;
    height: 44px;
  }

  .messages-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  .messages-tab {
    justify-content: center;
    min-width: 0;
    padding-right: 0.45rem;
    padding-left: 0.45rem;
    text-align: center;
  }

  .messages-thread-heading > div {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  .messages-thread-heading h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .messages-send-button {
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .message-thread-menu > summary {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .message-bubble {
    width: min(94%, 34rem);
    overflow-wrap: anywhere;
  }

  .app-modal,
  dialog,
  .app-modal-body,
  .report-moderate-dialog {
    max-width: calc(100vw - 2rem);
  }

  .admin-overview-main,
  .admin-overview-secondary,
  .admin-settings-categories,
  .admin-taxonomy-create,
  .admin-precision-create,
  .admin-user-toolbar,
  .admin-frame-create,
  .admin-frame-grant {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-actions-menu,
  .admin-reports-thumb-form {
    right: 0;
    left: auto;
    width: min(22rem, calc(100vw - 2rem));
    min-width: 0;
    max-width: calc(100vw - 2rem);
  }

  .signed-home-page {
    display: flex;
    flex-direction: column;
  }

  .signed-home-page > .signed-home-intro {
    display: none;
  }

  .signed-home-content {
    margin-top: 0 !important;
  }

  .content-directory-header-tools--desktop {
    display: none;
  }

  /* One toolbar row: view, phone columns and gear together, count at the end. */
  .content-directory-header-tools--mobile {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-top: 0.85rem;
  }

  .content-directory-header-tools--mobile .content-directory-total {
    margin-left: auto;
  }

  .content-directory-header-actions {
    margin-left: 0;
  }

  /* The invoice heading is an icon with no label: no sort chip on phones. */
  .purchase-list-table.responsive-table-ready thead .purchase-invoice-column {
    display: none !important;
  }

  /* Category chips, tier chips and Mark all as read each get their own
     wrapping row instead of three columns that overlap on a phone. */
  .creator-filter-bar,
  .creator-filter-bar.has-center-control {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .creator-filter-bar .creator-filter-group {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .creator-filter-bar .creator-filter-group--actions {
    order: 3;
  }

  .content-directory-grid .creator-gallery-media {
    aspect-ratio: var(--release-media-ratio);
  }



  .content-directory-list-table.responsive-table-ready thead {
    display: none !important;
  }

  .content-directory-list-table.responsive-table-ready tbody {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--surface) 94%, var(--surface-raised));
  }

  .content-directory-list-table.responsive-table-ready .content-directory-list-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.8rem;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .content-directory-list-table.responsive-table-ready .content-directory-list-row:nth-child(odd) {
    background: color-mix(in srgb, var(--surface) 96%, var(--surface-raised));
  }

  .content-directory-list-table.responsive-table-ready .content-directory-list-row:nth-child(even) {
    background: color-mix(in srgb, var(--surface-raised) 70%, var(--surface));
  }

  .content-directory-list-table.responsive-table-ready .content-directory-list-row:last-child {
    border-bottom: 0;
  }

  .content-directory-list-table.responsive-table-ready .content-directory-list-row > td {
    display: block;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .content-directory-list-table.responsive-table-ready .content-directory-list-row > td::before {
    display: none;
  }

  .content-directory-list-title {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-right: 5rem !important;
    font-size: 1rem;
  }

  .content-directory-list-description {
    display: none !important;
  }

  .content-directory-list-date {
    grid-column: 1 / -1;
    grid-row: 3;
    color: var(--text-soft);
    font-size: 0.75rem;
  }

  .content-directory-list-date-label {
    display: inline;
    margin-right: 0.35rem;
    font-weight: 600;
  }

  .content-directory-list-architecture {
    grid-column: 1;
    grid-row: 2;
  }

  .content-directory-list-table .content-directory-list-version {
    grid-column: 1 / -1;
    grid-row: 4;
    width: auto;
    max-width: none;
    color: var(--text-soft);
    font-size: 0.75rem;
  }

  .content-directory-list-table .content-directory-list-version:has(.cell-clip:empty) {
    display: none !important;
  }

  .content-directory-list-version-label {
    display: inline;
    margin-right: 0.35rem;
    font-weight: 600;
  }

  .content-directory-list-architecture-label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
  }

  .content-directory-list-architecture .cell-clip,
  .purchase-list-table .purchase-column-status .cell-clip {
    display: inline-flex;
    width: auto;
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.75rem;
  }

  .content-directory-list-creator {
    grid-column: 2;
    grid-row: 2;
    text-align: right !important;
  }

  .content-directory-list-creator::after {
    content: "Creator";
    display: block;
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
  }

  /* The price column takes the top-right corner of a phone row. */
  .content-directory-list-table.responsive-table-ready .content-directory-list-row > .content-directory-list-price {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
  }

  .content-directory-list-tier {
    grid-column: 2;
    grid-row: 2;
    text-align: right !important;
  }

  .content-directory-list-tier .content-directory-list-label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
  }

  .content-directory-list-locked,
  .content-directory-list-type,
  .content-directory-list-files,
  .content-directory-list-size,
  .content-directory-list-updated {
    grid-column: 1 / -1;
    color: var(--text-soft);
    font-size: 0.75rem;
  }

  .content-directory-list-table .content-directory-list-locked:empty {
    display: none !important;
  }

  .content-directory-list-type .content-directory-list-label,
  .content-directory-list-files .content-directory-list-label,
  .content-directory-list-size .content-directory-list-label {
    display: inline;
    margin-right: 0.35rem;
    font-weight: 600;
  }

  .content-directory-list-type .cell-clip,
  .content-directory-list-files .cell-clip,
  .content-directory-list-size .cell-clip {
    display: inline;
  }

  /* My Purchases uses the same rows: the status sits where a listing shows
     the architectures, and the invoice and refund actions end the row. */
  .purchase-list-table .purchase-column-status {
    grid-column: 1;
    grid-row: 2;
  }

  .purchase-list-table .purchase-column-status .content-directory-list-label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
  }

  .purchase-list-table.responsive-table-ready .content-directory-list-row > .purchase-column-invoice {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }

  .purchase-list-table.responsive-table-ready .content-directory-list-row > .purchase-column-invoice:empty {
    display: none;
  }

  .download-history-table {
    display: none;
  }

  .download-history-mobile-cards {
    display: grid;
    gap: 0.65rem;
  }

  .download-history-mobile-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
  }

  .download-history-mobile-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 0.65rem;
    padding: 0.75rem;
  }

  .download-history-mobile-main > strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .download-history-mobile-main > span {
    grid-column: 1;
    color: var(--text-soft);
    font-size: 0.82rem;
  }

  .download-history-mobile-main > time {
    grid-column: 2;
    grid-row: 1 / 3;
    color: var(--text-muted);
    font-size: 0.72rem;
  }

  .download-history-mobile-card details {
    border-top: 1px solid var(--border);
  }

  .download-history-mobile-card summary {
    padding: 0.55rem 0.75rem;
    color: var(--accent-strong);
    cursor: pointer;
  }

  .download-history-mobile-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0;
    padding: 0 0.75rem 0.75rem;
  }

  .download-history-mobile-card dl > div {
    min-width: 0;
  }

  .download-history-mobile-card dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
  }

  .download-history-mobile-card dd {
    margin: 0.1rem 0 0;
    overflow-wrap: anywhere;
  }

  .creator-overview-desktop-stats {
    display: none;
  }

  .creator-overview-mobile-primary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
  }

  .creator-overview-mobile-primary > div {
    display: grid;
    gap: 0.2rem;
  }

  .creator-overview-mobile-primary > div:last-child {
    text-align: right;
  }

  .creator-overview-mobile-primary span {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
  }

  .creator-overview-mobile-primary strong {
    overflow-wrap: anywhere;
    font-size: 1.05rem;
  }

  .creator-overview-mobile-details {
    display: block;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .creator-overview-mobile-details summary {
    padding-top: 0.65rem;
    color: var(--accent-strong);
    cursor: pointer;
  }

  .creator-overview-mobile-details .creator-stat-strip {
    margin-top: 0.65rem;
  }

  .creator-workspace .table-responsive {
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
  }

  /* The default width of a workspace table on phones; a table's own rule
     below sets its own (the table rule used to override every one of them). */
  .creator-workspace {
    --creator-mobile-table-width: 960px;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) {
    display: table;
    width: var(--creator-mobile-table-width);
    min-width: var(--creator-mobile-table-width) !important;
    border: 1px solid var(--border) !important;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden !important;
    background: color-mix(in srgb, var(--surface) 94%, var(--surface-raised));
    table-layout: auto;
  }

  .creator-workspace table.app-table--fixed.responsive-table-ready:not(.creator-table) {
    table-layout: fixed;
  }

  .creator-workspace .creator-overview-tier-table {
    --creator-mobile-table-width: 760px;
  }

  .creator-workspace .creator-overview-content-table {
    --creator-mobile-table-width: 1040px;
  }

  .creator-workspace .creator-content-list-table {
    --creator-mobile-table-width: 1240px;
  }

  .creator-workspace .creator-content-price-table {
    --creator-mobile-table-width: 1180px;
  }

  .creator-workspace .creator-ledger-transactions {
    --creator-mobile-table-width: 1400px;
  }

  .creator-workspace .creator-file-metadata-table {
    --creator-mobile-table-width: 1100px;
  }

  .creator-workspace .content-picker-options table {
    --creator-mobile-table-width: 920px;
  }

  .creator-workspace .creator-category-table {
    --creator-mobile-table-width: 900px;
  }

  .creator-workspace .tier-editor-table {
    --creator-mobile-table-width: 1240px;
  }

  .creator-workspace .creator-variable-table {
    --creator-mobile-table-width: 900px;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) colgroup {
    display: table-column-group;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) thead {
    display: table-header-group !important;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) tbody {
    display: table-row-group !important;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) tr {
    display: table-row !important;
    width: auto;
    border: 0;
    background: transparent;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) th,
  .creator-workspace table.responsive-table-ready:not(.creator-table) td {
    display: table-cell !important;
    width: auto !important;
    min-width: 0;
    padding: 0.65rem 0.75rem !important;
    border-bottom: 1px solid var(--border) !important;
    white-space: nowrap !important;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) thead th {
    background: color-mix(in srgb, var(--surface-raised) 92%, var(--surface));
  }

  /* These stay real tables, so their sort headings keep the shared heading
     look instead of the phone card layout's sort chips. */
  .creator-workspace table.responsive-table-ready:not(.creator-table) thead button:not(.creator-ledger-tooltip-trigger) {
    width: auto;
    min-height: 0 !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) th + th,
  .creator-workspace table.responsive-table-ready:not(.creator-table) td + td {
    border-left: 1px solid color-mix(in srgb, var(--border) 72%, transparent) !important;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) tbody tr:nth-child(odd) {
    background: color-mix(in srgb, var(--surface) 96%, var(--surface-raised));
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) tbody tr:nth-child(even) {
    background: color-mix(in srgb, var(--surface-raised) 70%, var(--surface));
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) tbody tr:hover {
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) tbody tr:last-child td {
    border-bottom: 0 !important;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) td::before {
    display: none !important;
  }

  .creator-workspace table.responsive-table-ready:not(.creator-table) .cell-clip {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Columns hidden with the column picker stay hidden in these tables too. */
  .creator-workspace table.responsive-table-ready:not(.creator-table) [hidden] {
    display: none !important;
  }

  /* Workspace tables scroll sideways on phones; their Title keeps a readable
     width instead of what the other columns leave. */
  .creator-workspace table.responsive-table-ready col.col-title,
  .creator-workspace .creator-content-list-table col.col-title {
    width: 240px;
  }

  .creator-profile-previews .creator-header-meta-row {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .creator-profile-previews .creator-header-meta-row .creator-description {
    flex: 1 0 100%;
    width: 100%;
  }

  main.app-content.messages-main {
    height: calc(100dvh - var(--header-h));
    padding: 0 0.5rem 0.25rem;
    overflow: hidden;
  }

  .messages-page {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .messages-layout {
    grid-template-rows: auto minmax(0, 1fr);
    flex: 1 1 0;
    min-height: 0;
  }

  .messages-thread {
    min-height: 0;
    overflow: hidden;
  }

  .messages-thread-list {
    min-height: 0;
    padding: 0.55rem;
  }

  .messages-reply-form {
    padding: 0.55rem;
  }

  .messages-reply-form textarea.form-control {
    height: var(--message-input-height, 7rem);
    min-height: 7rem;
    max-height: 55dvh;
    resize: none;
  }

}

@media (max-width: 480px) {
  .responsive-table-ready:not(.creator-table) tbody td {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
  }
}

/* Links carry the accent; body copy never does. */
a:not(.btn):not(.sidebar-link):not(.site-brand):not(.creator-filter-chip) {
  text-underline-offset: 3px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
 * Shared table (visual refresh, SUB67)
 * --------------------------------------------------------------------------
 * THE one table look for the whole site: creator dashboard, earnings, admin,
 * account pages, content lists, release files and tables inside descriptions.
 * Every <table> gets it from these element rules; table-specific classes may
 * only add layout (column widths, sticky columns, alignment) or row states -
 * never their own borders, header style, fonts or backgrounds.
 *
 * Table.php owns the table frame. table.js owns sorting, saved column choices,
 * pagination and responsive column priority. table-column-help.js explains
 * headers and table-export.js supplies copy/CSV exports.
 *
 * Cell helpers (Ui::itemCell, Ui::capsule) render the shared item cell
 * (image + name) and the shared capsule used for every status/type value.
 * ========================================================================== */

table {
  --table-head: color-mix(in srgb, var(--surface), black 16%);
  --table-row-hover: color-mix(in srgb, var(--surface), var(--scheme-text) 4%);
  --table-total: color-mix(in srgb, var(--surface), black 10%);
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 0.97rem;
  font-variant-numeric: tabular-nums;
}

table th,
table td {
  padding: 0.62rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table th {
  text-align: left;
}

table thead th {
  height: 42px;
  background: var(--table-head);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

table thead th > a,
table thead th > button:not(.btn) {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

/* Rounded corners come from the corner cells, so sticky headers and columns
   keep working (a table with overflow hidden would break them). */
table > :first-child > tr:first-child > :first-child { border-top-left-radius: 11px; }
table > :first-child > tr:first-child > :last-child { border-top-right-radius: 11px; }
table > :last-child > tr:last-child > * { border-bottom: 0; }
table > :last-child > tr:last-child > :first-child { border-bottom-left-radius: 11px; }
table > :last-child > tr:last-child > :last-child { border-bottom-right-radius: 11px; }
table > colgroup + thead > tr:first-child > :first-child { border-top-left-radius: 11px; }
table > colgroup + thead > tr:first-child > :last-child { border-top-right-radius: 11px; }

table tbody tr > td,
table tbody tr > th {
  transition: background-color 0.12s ease;
}

table tbody tr:hover > td,
table tbody tr:hover > th {
  background-color: var(--table-row-hover);
}

table tfoot th,
table tfoot td {
  background: var(--table-total);
  color: var(--text);
  font-weight: 700;
  border-top: 1px solid var(--border-strong);
}

table caption {
  padding: 0 0 0.5rem;
  color: var(--text-muted);
  text-align: left;
}

/* One base class (.app-table, written by Table.php) and a few modifiers.
 * Width comes from the element rules above. The base keeps every heading,
 * including row headings, on one line; the modifiers below are the
 * only places a table really differs:
 *   --loose    full cell padding inside dashboard cards, wrapping row headings
 *              and no dashboard minimum width (statements, payouts, tax pages);
 *   --figures  right-aligned figures with a left-aligned first column;
 *   --data     sticky heading, row heading and totals for long data panels;
 *   --fixed    fixed layout sized by the colgroup (see app-creator-tables.css);
 *   --links    accent coloured links in cells (admin settings lists);
 *   --striped  zebra rows;
 *   --pinned   first column pinned while scrolling sideways. */
.app-table:where(:not(.app-table--loose)) th,
.app-table:where(:not(.app-table--loose)) td {
  vertical-align: middle;
}

.app-table:where(:not(.app-table--loose)) th {
  text-align: left;
  white-space: nowrap;
}

/* A heading's align option (Table::head) and matching cells. */
.app-table :is(th, td).text-end { text-align: end; }
.app-table :is(th, td).text-center { text-align: center; }
.app-table th.text-end .creator-table-sort { justify-content: flex-end; }
.app-table th.text-center .creator-table-sort { justify-content: center; }

.app-table--links th,
.app-table--links td {
  text-align: left;
  vertical-align: middle;
}

.app-table--links a {
  color: var(--accent-strong);
}

.admin-settings-empty-row td {
  color: var(--text-muted);
  text-align: center;
}

.app-table--figures th,
.app-table--figures td {
  text-align: right;
  white-space: nowrap;
}

.app-table--figures th:first-child,
.app-table--figures td:first-child {
  text-align: left;
}

.app-table--data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--table-head);
  white-space: nowrap;
}

.app-table--data .admin-data-number {
  text-align: right;
  white-space: nowrap;
}

.app-table--data tbody th[scope="row"] {
  text-align: left;
  white-space: nowrap;
}

.app-table--data thead th:first-child,
.app-table--data tbody th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--table-head);
  box-shadow: 1px 0 0 var(--border);
}

.app-table--data tfoot th,
.app-table--data tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 1px solid var(--border-strong, var(--border));
  background: var(--scheme-raised, var(--bg));
  font-weight: 750;
}

/* --dense: compact rows for long data grids (Earnings transactions). */
.app-table--dense th,
.app-table--dense td {
  padding: 0.2rem 0.6rem;
  line-height: 1.3;
}

.app-table--dense thead th {
  height: 32px;
}

.app-table--dense :is(.ui-item-thumb, .ui-item-icon) {
  width: 16px;
  height: 20px;
  border-radius: 3px;
}

.app-table--dense .ui-capsule {
  padding-block: 2px;
  line-height: 1.25;
}

.app-table--dense .ui-item {
  gap: 0.45rem;
}

/* --striped: zebra rows. Only visible rows count, so a filtered or paged
   list keeps alternating. The tints are opaque, so pinned cells stay solid.
   --pinned: the first column stays in view while the table scrolls
   sideways. Both are wide-screen only: the phone card layout (720px and
   below, app-appearance.css) shows each row as its own card. */
@media (min-width: 721px) {
  .app-table--striped {
    --table-stripe: color-mix(in srgb, var(--surface), var(--scheme-text) 3.5%);
    --table-row-hover: color-mix(in srgb, var(--surface), var(--scheme-text) 7%);
  }

  /* A row marked data-row-continues belongs to the row above: it is not
     counted and takes that row's tint. */
  .app-table--striped > tbody > tr:nth-child(even of :not([hidden], [data-outside-page], [data-row-continues])) > *,
  .app-table--striped > tbody > tr:nth-child(even of :not([hidden], [data-outside-page], [data-row-continues])) + tr[data-row-continues] > * {
    background-color: var(--table-stripe);
  }

  /* :nth-child(n) matches every row; it only lifts hover above the stripe. */
  .app-table--striped > tbody > tr:hover:nth-child(n of :not([hidden])) > * {
    background-color: var(--table-row-hover);
  }

  /* The edge is a custom property, so a row's coloured edge (app-workspace.css,
     --row-edge-inset) and the pinned edge combine instead of replacing each other. */
  .app-table--pinned > :is(thead, tbody, tfoot) > tr > :first-child {
    --pinned-edge: 1px 0 0 var(--border-strong);
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: var(--row-edge-inset, 0 0 #0000), var(--pinned-edge);
  }

  /* --pinned-end: the last column (Actions) stays in view as well. */
  .app-table--pinned-end > :is(thead, tbody, tfoot) > tr > :last-child {
    --pinned-edge-end: -1px 0 0 var(--border-strong);
    position: sticky;
    right: 0;
    z-index: 3;
    box-shadow: var(--pinned-edge-end);
  }

  .app-table--pinned > thead > tr > :first-child,
  .app-table--pinned-end > thead > tr > :last-child {
    z-index: 5;
  }

  /* Lowest specificity, so stripes, hover and total rows still tint it. */
  .app-table--pinned > :where(tbody) > tr > :where(:first-child),
  .app-table--pinned-end > :where(tbody) > tr > :where(:last-child) {
    background-color: var(--surface);
  }

  /* While scrolled sideways the pinned columns cast a soft edge over the
     columns passing under them (table.js sets .is-scrolled-x on the scroller
     once it has left the start, and .is-scrollable-end while more lies to the right). */
  .is-scrolled-x .app-table--pinned > :is(thead, tbody, tfoot) > tr > :first-child {
    --pinned-edge: 1px 0 0 var(--border-strong), 8px 0 12px -3px rgb(0 0 0 / 0.55);
  }

  .is-scrolled-x .app-table--data :is(thead th:first-child, tbody th[scope="row"]) {
    box-shadow: 1px 0 0 var(--border-strong), 8px 0 12px -3px rgb(0 0 0 / 0.55);
  }

  .is-scrollable-end .app-table--pinned-end > :is(thead, tbody, tfoot) > tr > :last-child {
    --pinned-edge-end: -1px 0 0 var(--border-strong), -8px 0 12px -3px rgb(0 0 0 / 0.55);
  }
}

/* Resizable columns (table.js): a handle on each heading's right edge. Once
   a width is set the table is laid out from the heading widths and values
   that no longer fit wrap within the chosen width. */
table[data-resizable-columns] thead th {
  position: relative;
}

table[data-resizable-columns].app-table--data thead th {
  position: sticky;
}

.app-table-resizer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.app-table-resizer::after {
  position: absolute;
  top: 25%;
  right: 3px;
  width: 2px;
  height: 50%;
  border-radius: 2px;
  background: var(--border-strong, var(--border));
  content: "";
}

.app-table-resizer:hover::after,
.app-table-resizer:focus-visible::after,
table.is-resizing-column .app-table-resizer::after {
  background: var(--accent-strong);
}

table.is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

table.is-column-sized {
  table-layout: fixed;
  min-width: 0 !important;
  max-width: none;
}

table[data-columns][data-resizable-columns].is-column-sized :is(th, td),
table[data-columns][data-resizable-columns].is-column-sized :is(th, td) :is(a, button, time, .ui-item-name, .ui-capsule, .creator-ledger-item) {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
  max-width: 100%;
}

.app-table-scrollbar {
  height: 15px;
  overflow-x: scroll;
  overflow-y: hidden;
  scrollbar-width: auto;
}

.app-table-scrollbar > div {
  height: 1px;
}

.app-table-scrollbar::-webkit-scrollbar { height: 12px; }
.app-table-scrollbar::-webkit-scrollbar-track { background: var(--surface); border-radius: 6px; }
.app-table-scrollbar::-webkit-scrollbar-thumb { background: var(--text-muted); border: 3px solid var(--surface); border-radius: 6px; }

/* Sort controls: client-side buttons (creator-tables.js), admin sort buttons
   and server-side sort links all look the same. Keep button selectors stronger
   than the generic button:not(.btn) rule so headings inherit only cell padding. */
table thead th button.creator-table-sort,
table thead th button[data-admin-settings-sort],
table thead th button[data-admin-user-sort],
table thead th > a.creator-sort,
table thead th > a.admin-transaction-sort,
table thead th > a.content-directory-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-decoration: none;
  text-transform: inherit;
  cursor: pointer;
}

.creator-table-sort { width: 100%; }

.creator-table-sort:hover,
.creator-table-sort:focus-visible,
[data-admin-settings-sort]:hover,
[data-admin-user-sort]:hover,
table thead th > a:hover {
  color: var(--text);
}

table thead th[aria-sort="ascending"],
table thead th[aria-sort="descending"] {
  color: var(--text);
}

.creator-table-sort-arrow {
  color: var(--accent-strong);
  font-size: 0.72rem;
}

/* Shared capsule: every status or type value in a table uses this shape.
   The existing status classes keep their own meaning colours. */
.ui-capsule,
table .status-chip,
table .meta-pill,
table .admin-delivery-status,
table .admin-refund-status,
table .admin-name-availability,
table .admin-tax-audit-status,
table .tier-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 0.6rem;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ui-capsule {
  color: var(--text-soft);
  background: color-mix(in srgb, var(--scheme-text) 8%, transparent);
}

.ui-capsule.is-accent { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.ui-capsule.is-info { color: #9fd0f3; background: rgba(95, 168, 224, 0.16); }
.ui-capsule.is-success { color: color-mix(in srgb, var(--success) 75%, white); background: color-mix(in srgb, var(--success) 16%, transparent); }
.ui-capsule.is-warning { color: color-mix(in srgb, var(--warning) 80%, white); background: color-mix(in srgb, var(--warning) 16%, transparent); }
.ui-capsule.is-danger { color: color-mix(in srgb, var(--danger) 70%, white); background: color-mix(in srgb, var(--danger) 16%, transparent); }

.country-evidence > summary { color: var(--text-soft); }
.country-evidence > summary:is(:hover, :focus-visible) { color: var(--text); }

/* Shared item cell: a release or subscription image next to its name. */
.ui-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.ui-item-thumb {
  display: inline-block;
  flex: none;
  width: 28px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-raised);
}

.ui-item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ui-item-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 36px;
  border-radius: 6px;
  color: var(--accent-text);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-raised));
}

.subscription-start { --subscription-color: #57c785; }
.subscription-renews { --subscription-color: #86c8ff; }
.subscription-expiring { --subscription-color: #e8894a; }
.ui-item:is(.subscription-start, .subscription-renews, .subscription-expiring) :is(.ui-item-icon, .creator-ledger-item) { color: var(--subscription-color); }
.ui-item:is(.subscription-start, .subscription-renews, .subscription-expiring) .ui-item-icon { background: color-mix(in srgb, var(--subscription-color) 16%, var(--surface-raised)); }

.ui-item-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.ui-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A title names its row: it wraps onto another line and is never cut off.
   The same holds for creator names and item names in shared tables. */
table td:is(.col-title, .content-directory-list-title, .content-directory-list-creator) {
  white-space: normal;
  text-overflow: clip;
}

table td .ui-item-name,
table.creator-ledger-transactions td .creator-ledger-item {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: break-word;
}

/* The item column takes the width its names need; it only wraps when the
   table runs out of room. */
.creator-ledger-transactions :is(th, td).creator-ledger-column-item {
  width: auto;
  min-width: 9rem;
}

table td:is(.col-title, .content-directory-list-title, .content-directory-list-creator) .creator-ops-title.cell-clip {
  display: inline;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

/* Fixed-layout tables give each column a set width: a heading that does not
   fit is shortened with an ellipsis (its full name is in the column help). */
table[style*="table-layout: fixed"] thead th,
.app-table--fixed thead th,
.creator-content-files-table--grouped thead th {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The admin Users table has more columns than fit on one heading line, so its
   headings wrap instead of being cut off. */
.admin-users-table thead th {
  white-space: normal;
  line-height: 1.25;
  vertical-align: bottom;
}

.app-table--fixed thead th .creator-table-sort {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Total rows inside a table body share the footer look. */
table tr.creator-ledger-total-row > *,
table tr.admin-user-sum-row > * {
  background: var(--table-total);
  color: var(--text);
  font-weight: 700;
}

/* table.js measures each heading at its natural width (no clipping, no
   stretching) for a moment while it sizes fixed-layout columns. */
table.is-measuring-headings thead th,
table.is-measuring-headings thead th * {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

table.is-measuring-headings thead th * {
  flex-shrink: 0 !important;
}

table.is-measuring-headings thead th :is(a, button, span) {
  width: auto !important;
  min-width: 0 !important;
}

.table-page-controls, .table-page-controls > div, .table-page-controls > form, .table-page-controls label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .5rem;
}
.table-page-controls {
  margin-block: .4rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.table-page-controls select { width: auto; }
.table-page-controls[hidden], .table-page-controls [hidden], .app-table tr[data-outside-page] { display: none !important; }

.table-column-help-popover {
  position: fixed;
  z-index: 1200;
  width: min(35rem, calc(100vw - 1.25rem));
  max-height: min(24rem, calc(100vh - 1.25rem));
  overflow: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 88%, white 12%);
  box-shadow: 0 12px 28px rgb(0 0 0 / 24%);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.3rem);
  transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
  pointer-events: none;
  user-select: text;
}

.table-column-help-popover.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
  pointer-events: auto;
}

.table-column-help-popover h2 {
  margin: 0;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  color: var(--success, #4dbd74);
  font-size: 1rem;
  line-height: 1.3;
}

.table-column-help-popover p {
  margin: 0.7rem 0 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: normal;
}

table > thead th[data-column-help-ready="1"] .creator-table-sort,
table > thead th[data-column-help-ready="1"] a,
table > thead th[data-column-help-ready="1"] button,
table > thead th[data-column-help-ready="1"] input,
table > thead th[data-column-help-ready="1"] select {
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .table-column-help-popover {
    transition-duration: 1ms;
  }
}

/* SUB66 Rule-based subscriptions: tier card Automatic box, tier editor
   sections, Pools, loyalty progress, monthly picks and discount reasons.
   Uses the shared theme variables only, so colour schemes and accents apply. */

/* ---------- Tier card: Automatic box ---------- */
.tier-access-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 70%, transparent);
}

.tier-access-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-text, var(--accent));
}

.tier-access-head svg {
  width: 13px;
  height: 13px;
}

.tier-access-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.tier-access-line {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--text);
}

.tier-access-icon {
  flex: none;
  margin-top: 0.1rem;
  color: var(--accent-strong, var(--accent));
}

/* SUB153 Colour says one thing each: green is permanent, white is while
   subscribed, yellow is a discount. */
.tier-access-line.is-sub {
  margin-top: -0.15rem;
  padding-left: 1.35rem;
  font-size: 0.82em;
}

.tier-access-line.is-sub .tier-access-icon {
  width: 13px;
  height: 13px;
}

.tier-access-line.is-keep,
.tier-access-line.is-keep .tier-access-icon,
.creator-profile-subscriptions .tier-access-line.is-keep { color: var(--success); }

.tier-access-line.is-during,
.tier-access-line.is-during .tier-access-icon { color: var(--text); }
.creator-profile-subscriptions .tier-access-line.is-during,
.creator-profile-subscriptions .tier-access-line.is-during .tier-access-icon { color: #f4f3f7; }

.tier-access-line.is-discount,
.tier-access-line.is-discount .tier-access-icon,
.creator-profile-subscriptions .tier-access-line.is-discount { color: var(--warning); }

.tier-access-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tier-access-excluded summary {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong, var(--border));
}

.tier-access-excluded ul {
  margin: 0.3rem 0 0;
  padding-left: 1rem;
  color: var(--text-soft);
}

/* Image tier cards keep every automatic rule readable over the artwork. */
.creator-profile-subscriptions .tier-access-box {
  gap: 10px;
  padding: 12px;
  border-color: rgb(255 255 255 / .16);
  border-radius: 12px;
  background: rgb(8 9 13 / .58);
  backdrop-filter: blur(10px);
}

.creator-profile-subscriptions .tier-access-head { color: #eeeafc; font-size: 11px; }
.creator-profile-subscriptions .tier-access-lines { gap: 8px; }
.creator-profile-subscriptions .tier-access-line { color: #f4f3f7; font-size: 13px; line-height: 1.45; }
.creator-profile-subscriptions .tier-access-line.is-sub { font-size: 12px; }
.creator-profile-subscriptions .tier-access-foot { flex-wrap: wrap; padding-top: 8px; border-color: rgb(255 255 255 / .14); color: #c1c1cb; font-size: 11px; }
.creator-profile-subscriptions .tier-access-excluded ul { color: #e4e3eb; }

/* ---------- Tier editor ---------- */
#tier-modal.tier-modal-rules .app-modal-body {
  width: min(66rem, calc(100vw - 2rem));
  max-width: none;
}

/* Position and height come from the shared dialog rules (app-window.css, and
   app-content.css for editors opened under the header). An id rule here would
   outrank them and push the window past the bottom of the screen. */

#tier-modal.tier-modal-rules .app-modal-body {
  padding: 0;
}

#tier-modal.tier-modal-rules .app-modal-head {
  position: sticky;
  align-items: center;
  top: 0;
  z-index: 5;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

#tier-modal.tier-modal-rules .app-modal-body > form {
  padding: 1.25rem;
}

.tier-rules {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.5rem;
  align-items: start;
  margin: 0 0 1.25rem;
}

.tier-rules-main {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

.tier-rules-section {
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tier-rules-main > .tier-rules-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.tier-rules-section > .btn,
.tier-rules-section > div > .btn {
  align-self: flex-start;
}

.tier-rules-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* SUB151 Switch options: two compact columns, each switch right after its
   name. A switched-on option with settings spans both columns. */
.tier-rules-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
  border-top: 1px solid var(--border);
}

.tier-rules-options > .tier-rules-section {
  padding: 0.55rem 0;
  border-top: 0;
  gap: 0.5rem;
}

.tier-rules-options > .tier-rules-section:has(.tier-rules-body):has(.tier-rules-section-head input:checked) {
  grid-column: 1 / -1;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.tier-rules-options > .tier-rules-section:last-child { border-bottom: 0; }

.tier-rules-options .tier-rules-section-head {
  justify-content: flex-start;
  gap: 0.75rem;
}

.tier-rules-link {
  align-self: flex-start;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tier-rules-link:hover {
  color: var(--text);
}

.tier-rules-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tier-rules-section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.tier-rules-segment {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 9px;
  background: var(--bg, var(--surface));
}

.tier-rules-segment label {
  position: relative;
  cursor: pointer;
}

.tier-rules-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tier-rules-segment span {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 7px;
  font-size: 0.95rem;
  color: #fff;
}

.tier-rules-segment input:checked + span {
  background: var(--btn-fill);
  color: #fff;
  font-weight: 650;
}

.tier-rules-segment input:disabled + span {
  filter: saturate(0.4);
  cursor: default;
}

.tier-rules-segment input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tier-rules-hint {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.tier-rules-empty {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.tier-rules-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.tier-rules-inline .form-select {
  width: auto;
  min-width: 0;
}

.tier-rules-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.tier-rules-number {
  width: 4.75rem !important;
}

.tier-rules-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.tier-rules-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 130px;
  margin-top: 0.6rem;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  background: var(--surface-raised, var(--surface));
}

.tier-rules-grid > div {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--border);
}

.tier-rules-grid-head {
  border-top: 0 !important;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg, var(--surface)) 55%, transparent);
}

.tier-rules-grid-label {
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.tier-rules-grid-cell {
  justify-content: center;
}

.tier-rules-included {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.tier-rules-grid-cell.is-off .tier-rules-included {
  text-decoration: line-through;
  opacity: 0.6;
}

.tier-rules-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.tier-rules-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.tier-rules-switch-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 18%, transparent);
  position: relative;
  transition: background 0.15s ease;
}

.tier-rules-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: left 0.15s ease, background 0.15s ease;
}

.tier-rules-switch input:checked + .tier-rules-switch-track {
  background: var(--accent);
}

.tier-rules-switch input:checked + .tier-rules-switch-track::after {
  left: 21px;
  background: #fff;
}

.tier-rules-switch input:disabled + .tier-rules-switch-track {
  opacity: 0.5;
  cursor: default;
}

.tier-rules-switch input:focus-visible + .tier-rules-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tier-rules-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tier-rules-step {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 9px;
  background: var(--surface-raised, var(--surface));
  font-size: 0.92rem;
  color: var(--text-soft);
}

.tier-rules-preview {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tier-rules-preview .tier-price-policy-card {
  margin: 0;
  font-size: 0.86rem;
}

/* SUB152 Card background, under the card it changes. */
.tier-card-background {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.tier-card-background [hidden] { display: none !important; }
.tier-card-background .tier-rules-section-head { gap: 0.75rem; }
.tier-card-background .tier-rules-section-head .btn { flex: none; width: auto; }
.tier-card-background .tier-rules-segment { align-self: stretch; }
.tier-card-background .tier-rules-segment label { flex: 1 1 0; text-align: center; }
.tier-card-background .tier-rules-segment span { display: block; padding: 0.3rem 0.6rem; font-size: 0.88rem; }
.tier-card-background-swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}
.tier-card-background-swatch {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border-radius: 7px;
  outline: 2px solid transparent;
  outline-offset: 1px;
  background: var(--surface-raised, var(--surface));
  cursor: pointer;
}
.tier-card-background-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.tier-card-background-swatch img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tier-card-background-swatch:hover { outline-color: var(--border-strong, var(--border)); }
.tier-card-background-swatch:has(input:checked) { outline-color: var(--accent); }
.tier-card-background-swatch:has(input:focus-visible) { outline-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.tier-card-background-adjust {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.tier-card-background-adjust .profile-range { gap: 4px; font-size: 0.86rem; }
.tier-card-background-adjust .form-label { font-size: 0.86rem; }

.tier-rules-preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.tier-rules-preview-card {
  min-height: 3rem;
}

/* The public card is the editor, with the same typography and layout. */
.tier-rules-preview-card .price-breakdown {
  flex-wrap: wrap;
  align-items: start;
  gap: 8px 12px;
}
.tier-rules-preview-card .price-breakdown-input {
  display: block;
  flex: 1 1 100%;
  min-width: 0;
}
.tier-rules-preview-card .price-breakdown-items {
  flex: 1 1 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.tier-rules-preview-card .price-breakdown-item,
.tier-rules-preview-card .price-breakdown-item + .price-breakdown-item {
  flex: 1 1 100%;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 12px;
}
.tier-rules-preview-card .price-breakdown-item:last-child {
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
.tier-rules-preview-card .creator-tier-card { width: 100%; }
/* SUB141 Name, description and price are edited on the card. Each sits on a
   light input surface that keeps the card's own type and position: stronger
   on hover with a pencil, an accent ring while typing. */
.tier-card-edit-field { position: relative; display: block; min-width: 0; width: 100%; }
.creator-tier-card .tier-card-input {
  display: block;
  box-sizing: border-box;
  width: calc(100% + 14px);
  min-width: 0;
  min-height: 0;
  max-width: none;
  margin: -3px -7px;
  padding: 2px 6px;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 7px;
  background: rgb(255 255 255 / .07);
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  resize: none;
  overflow: hidden;
  box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.creator-tier-card .tier-card-input::placeholder { color: inherit; opacity: .55; }
.creator-tier-card .tier-card-input:hover { border-color: rgb(255 255 255 / .5); background: rgb(255 255 255 / .12); }
.creator-tier-card .tier-card-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgb(8 9 13 / .6);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
}
.tier-card-edit-field::after,
.tier-card-price-input::after {
  content: "";
  position: absolute;
  top: -12px;
  right: -16px;
  z-index: 4;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M4 16.3 14.4 5.9l3.7 3.7L7.7 20H4zM15.8 4.5l1.5-1.5a1.4 1.4 0 0 1 2 0l1.7 1.7a1.4 1.4 0 0 1 0 2l-1.5 1.5z'/%3E%3C/svg%3E") center / 11px no-repeat;
  box-shadow: 0 2px 6px rgb(0 0 0 / .45);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.tier-card-edit-field:hover::after,
.tier-card-edit-field:focus-within::after,
.tier-card-price-input:hover::after,
.tier-card-price-input:focus-within::after { opacity: 1; transform: none; }
.tier-card-counter {
  position: absolute;
  right: -7px;
  bottom: -14px;
  z-index: 3;
  padding: 0 3px;
  border-radius: 3px;
  background: #101116;
  color: #c4c4cd;
  font-size: 10px;
  font-weight: 400;
  line-height: 12px;
  opacity: 0;
  pointer-events: none;
}
.tier-card-edit-field:focus-within .tier-card-counter,
.tier-card-edit-field.is-near-limit .tier-card-counter { opacity: 1; }
.tier-card-price-edit { display: inline-flex; align-items: baseline; gap: 1px; }
.tier-card-price-input {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  margin: 0 4px 0 0;
  padding: 0 3px;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 7px;
  background: rgb(255 255 255 / .07);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.tier-card-price-input:hover { border-color: rgb(255 255 255 / .5); background: rgb(255 255 255 / .12); }
.tier-card-price-input:focus-within {
  border-color: var(--accent);
  background: rgb(8 9 13 / .6);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
}
.creator-tier-card .tier-card-price-input input {
  appearance: textfield;
  max-width: 8ch;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.creator-tier-card .tier-card-price-input input:hover,
.creator-tier-card .tier-card-price-input input:focus { border: 0; background: transparent; box-shadow: none; }
.tier-card-price-input input::-webkit-inner-spin-button,
.tier-card-price-input input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.tier-rules-preview-card .creator-tier-cta { gap: 3px; flex-wrap: wrap; }
.tier-price-policy-card[hidden],
.tier-price-policy-card [hidden],
.tier-rules-preview-card [hidden] { display: none !important; }
.tier-price-policy-card p { margin: 4px 0 0; }

/* Early Access types a subscription includes: one tick each. */
.tier-rule-picks {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tier-rule-picks.is-inline {
  flex-direction: row;
  flex-wrap: wrap;
}

.tier-rule-picks.is-inline .tier-rule-pick {
  flex: 0 1 auto;
}

.tier-rule-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 55%, transparent);
  cursor: pointer;
}

.tier-rule-pick:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tier-rule-pick input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
}

.tier-rule-pick-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.tier-rule-pick-text strong {
  color: var(--text);
  font-size: 0.95rem;
}

.tier-rule-pick-text span {
  color: var(--text-soft);
  font-size: 0.86rem;
}

.tier-rule-pick-text .tier-rule-pick-content {
  color: var(--muted, var(--text-soft));
  font-size: 0.8rem;
}

/* SUB134 A rule's access: two questions answered with tiles. */
.tier-access-q {
  margin-top: 0.45rem;
}

.tier-access-q + .tier-access-q {
  margin-top: 0.85rem;
}

.tier-access-q-title {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.tier-access-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.tier-access-tiles.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tier-access-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 55%, transparent);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tier-access-tile:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.tier-access-tile:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.tier-access-tile:has(> input:disabled) {
  cursor: default;
  opacity: 0.55;
  border-color: var(--border);
}

.tier-access-tile > input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
}

.tier-access-tile-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.tier-access-tile-text > strong {
  font-size: 0.92rem;
}

.tier-access-tile-text > span {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted, var(--text-soft));
}

.tier-access-tile .tier-rules-number {
  width: 3.4rem !important;
  height: 1.6rem;
  min-height: 0;
  padding: 0 0.35rem;
  font-size: 0.82rem;
}

.tier-access-tile-text > span:has(.tier-rules-number) {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.tier-access-rule-summary {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.tier-pool-rule [hidden] {
  display: none !important;
}

/* SUB145 A subscription's access lines. One line reads flat; several are
   separate cards. */
.tier-access-groups {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tier-access-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

[data-access-section].has-several .tier-access-group {
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 40%, transparent);
}

.tier-access-group .tier-access-q,
.tier-access-group .tier-access-q + .tier-access-q {
  margin: 0;
}

.tier-access-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tier-access-group-head > .btn.btn-icon-only.btn-sm {
  flex: none;
  min-height: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
}

.tier-access-group .tier-pool-rules {
  margin: 0;
  gap: 0.45rem;
}

.tier-access-group .tier-pool-rule {
  padding: 0;
  border: 0;
  background: none;
}

.tier-access-versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tier-access-version {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  margin: 0;
}

.tier-access-version > span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* SUB127 Pool rules: an item matching any rule is in the pool. */
.tier-pool-rules {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.4rem 0 0.5rem;
}

.tier-pool-rule {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  background: color-mix(in srgb, var(--surface-raised, var(--surface)) 55%, transparent);
}

.tier-pool-rule-row {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.tier-pool-rule-row > .tier-pool-rule-scope:only-of-type {
  grid-column: 1;
}

.tier-pool-rule-targets {
  min-width: 0;
}

.tier-pool-rule-row [data-rule-remove] {
  grid-column: 3;
}

.tier-pool-rule .tier-rules-inline > span:first-child {
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* ---------- Subscriber: loyalty and picks ---------- */
.tier-loyalty {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tier-loyalty-track {
  display: flex;
  align-items: center;
}

.tier-loyalty-node {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--border-strong, var(--border));
  color: var(--text-muted);
}

.tier-loyalty-node.is-done {
  background: linear-gradient(135deg, var(--btn-a, var(--accent)), var(--btn-b, var(--accent-strong)));
  border-color: transparent;
  color: var(--btn-ink, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.tier-loyalty-node.is-next {
  border-color: var(--accent);
  color: var(--accent-strong, var(--accent));
}

.tier-loyalty-bar {
  flex: 1;
  height: 6px;
  margin: 0 -2px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--scheme-text, #fff) 10%, transparent);
}

.tier-loyalty-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--btn-a, var(--accent)), var(--btn-b, var(--accent-strong)));
}

.tier-loyalty-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.tier-loyalty-labels > span {
  flex: 1;
  text-align: center;
}

.tier-loyalty-labels > span:first-child {
  text-align: left;
}

.tier-loyalty-labels > span:last-child {
  text-align: right;
}

.tier-picks {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.tier-picks-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tier-picks-left {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--accent-strong, var(--accent));
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

.tier-picks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.tier-pick-item {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-raised, var(--surface));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--scheme-text, #fff) 6%, transparent) inset, 0 8px 20px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tier-pick-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--scheme-text, #fff) 8%, transparent) inset, 0 12px 26px rgba(0, 0, 0, 0.3);
}

.tier-pick-media {
  display: block;
  aspect-ratio: var(--release-media-ratio);
  overflow: hidden;
}

.tier-pick-item .tier-pick-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}

.tier-pick-item.is-kept .tier-pick-thumb {
  filter: saturate(0.85);
}

.tier-pick-item {
  position: relative;
}

.tier-pick-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.tier-pick-badge .ui-capsule {
  backdrop-filter: blur(6px);
  background: color-mix(in srgb, var(--success) 22%, rgba(10, 12, 18, 0.72));
}

.tier-pick-item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.86rem;
}

.tier-pick-item-foot a {
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-kept-from {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 860px) {
  .tier-rules,
  .tier-rules-two {
    grid-template-columns: 1fr;
  }

  .tier-rules-grid {
    grid-template-columns: minmax(0, 1fr) 96px 96px;
  }

  .tier-rules-preview {
    position: static;
  }
}

.tier-pools-table .creator-row-actions {
  align-items: center;
}

.tier-pools-table .creator-row-actions form {
  display: inline-flex;
  align-items: center;
}

.tier-pools-table .creator-row-actions [data-form-message]:empty {
  display: none;
}

.tier-rewards-panel .tier-loyalty + .tier-picks {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tier-rewards-panel .section-heading h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.tier-rewards-panel .section-heading h2 > span {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-muted);
}

.tier-pick-item .btn {
  padding: 0.15rem 0.65rem;
  min-height: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

/* ---------- Automatic pricing rule kinds ---------- */
.discount-kind-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.discount-kind-steps {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 34rem;
}

.tier-rules-step.discount-kind-step {
  grid-template-columns: minmax(0, 1fr) auto;
}

.tier-rules-step.discount-kind-step:has(select[name="multibuy_items[]"]) {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.cart-item-reason {
  grid-column: 1 / -1;
  margin: 0.2rem 0 0;
}

.cart-item-reason .ui-capsule,
.creator-content-discount-reason .ui-capsule {
  max-width: 100%;
  padding: 0.2rem 0.6rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Toggled parts use the hidden attribute; keep it stronger than display rules. */
.tier-rules [hidden],
[data-rule-kind-when][hidden],
.creator-pricing-rule-card [hidden] {
  display: none !important;
}

.creator-pricing-rule-body > [data-rule-kind-when],
.creator-pricing-rule-body > .mb-2:has([data-rule-kind]) {
  grid-column: 1 / -1;
}

.creator-content-discount-reason {
  margin: 0.35rem 0 0;
}

/* ---------- Early Access on the content editor's Release panel ---------- */
.release-early-access .form-label {
  display: block;
  margin-bottom: 0.25rem;
}

.release-early-access .release-rule-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
}

.release-early-access .form-check {
  margin: 0;
}

/* ---------- Early access strip on the creator page ---------- */
.early-access-strip {
  margin-bottom: 1rem;
}

.early-access-strip ul {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.early-access-strip li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  font-size: 0.92rem;
}

.early-access-strip a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.early-access-when {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  /* SUB134 Access tiles stack on phones. */
  .tier-access-tiles,
  .tier-access-tiles.is-two {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The Older content picker stays inside its column on phones. */
  .tier-rules-grid {
    grid-template-columns: minmax(0, 1fr) 78px 78px;
  }

  .tier-rules-grid > div {
    min-width: 0;
    padding: 0.5rem 0.55rem;
  }

  .tier-rules-grid-label .tier-rules-inline,
  .tier-rules-grid-label .form-select {
    min-width: 0;
    max-width: 100%;
  }

  /* Keep the existing mobile carousel width when there are just two tiers;
     the desktop two-card rule otherwise squeezes the Automatic overlay. */
  .creator-profile-subscriptions .creator-tier-shelf-track:has(> .creator-tier-card:nth-child(2):last-child) > article.creator-tier-card {
    flex-basis: min(340px, 84vw);
  }

  .tier-rules-step:has([data-step-tier]) {
    grid-template-columns: auto 4.75rem minmax(0, 1fr) 2.75rem;
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .tier-rules-step [data-step-tier] {
    grid-column: 1 / -2;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }

  .tier-access-versions {
    grid-template-columns: minmax(0, 1fr);
  }

  .tier-rules-step:has([data-step-tier]) > button {
    grid-column: 4;
    grid-row: 1 / 3;
    justify-self: end;
  }

  .merge-suggestions li {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .early-access-strip li {
    max-width: 100%;
    flex-wrap: wrap;
    border-radius: var(--radius-md, 10px);
  }

  .early-access-strip a {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

/* ---------- Model grouping suggestions (Merge Versions) ---------- */
.merge-suggestions {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--accent-line, var(--border-strong));
  border-radius: var(--radius-md, 10px);
  background: var(--accent-soft);
}

.merge-suggestions ul {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.merge-suggestions li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.merge-suggestions form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* SUB138 Automatic discounts: four kind tiles, typed percentages. */
.tier-access-tiles.is-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.discount-kind-percent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.creator-pricing-covers-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  grid-column: 1 / -1;
}

.tier-other-discounts {
  margin-top: 0.5rem;
  font-size: 0.86rem;
}

.tier-other-discounts > span {
  color: var(--text-muted);
}

.tier-other-discounts ul {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
}

.tier-other-discounts[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .tier-access-tiles.is-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .tier-access-tiles.is-four {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* SUB154 Add-on editors use the same graphite panels as the rest of Settings. */
[data-addon-editor] .tier-rules-main > .tier-rules-section {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 35%, var(--surface));
}
.addon-editor-card .tier-rules-section-head { gap: 12px; }
.addon-allow { display: inline-flex; align-items: center; gap: 9px; flex: none; color: var(--text-muted); font-size: 0.82rem; }
.addon-editor-card .tier-rules-body { padding-top: 6px; gap: 12px; }
.addon-group-title { margin: 5px 0 0; font-size: 1rem; font-weight: 650; }
.addon-content-card .form-label { display: grid; gap: 7px; margin: 0; }
.addon-content-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.addon-picker { display: grid; gap: 6px; min-width: 0; font-size: 0.87rem; }
.addon-price-row { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.addon-price-row > label { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: var(--text-muted); font-size: 0.82rem; }
.addon-value-field { position: relative; display: inline-flex; width: 90px; min-width: 0; height: 36px; border: 1px solid var(--border-strong, var(--border)); border-radius: 8px; background: var(--field, var(--bg)); color: var(--text); font-size: 0.88rem; font-variant-numeric: tabular-nums; overflow: hidden; vertical-align: middle; }
.addon-value-field input.form-control { position: relative; z-index: 1; display: block; width: 100%; min-width: 0; min-height: 0; height: 100%; padding: 7px 10px; margin: 0; border: 0; border-radius: inherit; background: transparent; color: transparent; caret-color: var(--text); font: inherit; line-height: 20px; box-shadow: none; }
.addon-value-field input.form-control:focus { background: transparent; color: transparent; box-shadow: none; }
.addon-value-display { position: absolute; inset: 0; display: flex; align-items: center; padding: 7px 10px; white-space: pre; pointer-events: none; font: inherit; line-height: 20px; }
.addon-value-unit { margin-left: 3px; color: var(--text-muted); }
.addon-value-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.addon-value-field:has(input[aria-invalid=true]) { border-color: var(--danger); }
.addon-loyalty-step { display: grid; gap: 10px; padding: 10px; border-radius: 8px; background: var(--bg); }
.addon-loyalty-step .tier-rules-inline { gap: 8px; }
.addon-loyalty-step [data-step-kind] { flex: 1; width: auto; min-width: 180px; }
.addon-settings-card > .tier-rules-section-head:not(:first-child) { min-height: 32px; gap: 16px; }
.tier-access-addons-head { margin-top: 14px; }
dialog[data-modal].addon-chooser-modal { width: min(940px, calc(100vw - 32px)); max-width: none; margin: 5vh auto auto; max-height: 90vh; }
.addon-chooser-modal .app-modal-head > div { display: grid; gap: 4px; }
.addon-chooser-modal .app-modal-head .text-muted { font-size: 0.88rem; }
.addon-checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.addon-choice-list { display: grid; gap: 12px; min-width: 0; }
.addon-choice-card { padding: 14px; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--surface-raised) 35%, var(--surface)); }
.addon-choice-card h3, .addon-summary h3 { margin: 0 0 12px; font-size: 1rem; font-weight: 650; }
.addon-choice-option { display: flex; gap: 10px; align-items: center; min-height: 34px; font-size: 0.9rem; padding: 5px 0; }
.addon-choice-option input { flex: none; accent-color: var(--accent); }
.addon-choice-option > span { flex: 1; min-width: 0; }
.addon-choice-option strong { margin-left: auto; flex: none; font-size: 0.8rem; font-weight: 550; color: var(--text-muted); }
.addon-choice-keep { padding-left: 24px; margin-top: 5px; }
.addon-choice-keep .addon-choice-option > span { color: var(--success); }
.addon-choice-description { margin: -4px 0 10px; font-size: 0.85rem; line-height: 1.6; color: var(--text); }
.addon-choice-covers { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; color: var(--text-muted); }
dialog[data-modal].content-cards-window { width: min(1100px, calc(100vw - 32px)); max-width: none; max-height: 86vh; }
.content-cards-window .app-modal-head > div { display: grid; gap: 4px; }
.content-cards-window .app-modal-head .text-muted { font-size: 0.88rem; }
.content-cards-window .content-cards-window-grid { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.creator-gallery-future-only { margin: 0 0 1rem; }
.creator-gallery-future-only :is(button, a).creator-gallery-older-link { display: inline; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.creator-gallery-future-only :is(button, a).creator-gallery-older-link:hover, .creator-gallery-future-only :is(button, a).creator-gallery-older-link:focus-visible { color: var(--text); }
.content-cards-window :is([data-content-card-id], [data-content-cards-more])[hidden] { display: none; }
button.addon-choice-count { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.addon-choice-count:hover, button.addon-choice-count:focus-visible { color: var(--accent); }
.addon-summary button.addon-choice-count { display: inline; min-height: 0; vertical-align: baseline; box-shadow: none; }
.addon-summary { position: sticky; top: 0; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.addon-summary .tier-access-box { border: 0; padding: 0; background: transparent; }
.addon-summary .tier-access-foot { display: none; }
.addon-summary [data-addon-selected-rules]:not(:empty) { margin-top: 8px; }
.addon-breakdown { display: grid; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 0.83rem; color: var(--text-muted); }
.addon-breakdown > div { display: flex; justify-content: space-between; gap: 12px; }
.addon-breakdown > div > span:last-child { flex: none; }
.addon-breakdown + [data-addon-price-change], .addon-breakdown ~ [data-addon-submit] { margin-top: 16px; }
.addon-summary > .btn { width: 100%; white-space: normal; }
.addon-summary [data-form-message]:not(:empty) { margin-top: 12px; color: var(--danger); font-size: 0.9rem; }
@media (max-width: 900px) {
  .addon-checkout-layout { grid-template-columns: minmax(0, 1fr); }
  .addon-summary { position: static; }
}
@media (max-width: 540px) {
  [data-addon-editor] .tier-rules-main > .tier-rules-section { padding: 12px; }
  .addon-content-extras { grid-template-columns: minmax(0, 1fr); }
  .addon-value-field input.form-control, .addon-value-display { padding-left: 8px; padding-right: 8px; }
  dialog[data-modal].addon-chooser-modal { width: calc(100vw - 16px); margin-top: 2vh; max-height: 96vh; }
  .addon-chooser-modal .app-modal-body { padding: 14px; }
  .addon-checkout-layout { gap: 16px; }
  .addon-choice-card { padding: 12px; }
  .addon-choice-option { font-size: 0.85rem; gap: 8px; }
  .addon-choice-option strong { font-size: 0.75rem; }
}
/* Size the dialog itself so its scrollbar cannot widen the mobile editor. */
#tier-modal.tier-modal-rules { width: min(66rem, calc(100vw - 2rem)); min-width: 0; overflow-x: hidden; }
#tier-modal.tier-modal-rules .app-modal-body { width: 100%; max-width: 100%; }
.addon-chooser-modal .app-modal-body { width: 100%; min-width: 0; }
dialog[data-modal].addon-chooser-modal { min-width: 0; overflow-x: hidden; }

.addon-prices-table.app-table { width: 100%; min-width: 0; }
.addon-prices-table td:first-child { white-space: normal; }
.addon-prices-table td:not(:first-child) { white-space: nowrap; }
.addon-prices-table .addon-value-field { width: 74px; height: 32px; }
.addon-range-entry { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.addon-range-entry select { width: auto; }
.addon-range-entry [hidden] { display: none; }
@media (max-width: 540px) {
  .addon-prices-table.app-table { width: 100%; }
  .addon-prices-table .addon-value-field { width: 58px; }
}

.addon-default-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
@media (max-width: 1000px) { .addon-default-cards { grid-template-columns: minmax(0, 1fr); } }
.addon-price-card { min-width: 0; padding: 16px; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--surface-raised) 35%, var(--surface)); }
.addon-price-card h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 650; }
.addon-price-card > p { margin: 0 0 14px; color: var(--text-muted); font-size: .88rem; line-height: 1.5; }
.addon-price-card .addon-price-row { gap: 20px 32px; }
@media (max-width: 540px) { .addon-price-card { min-width: 0; padding: 12px; } }

.addon-editor-card[hidden] { display: none; }
.addon-default-pick-options { margin-bottom: 14px; }
.addon-default-pick-options [hidden] { display: none; }

.addon-price-card > [data-default-add-range] { margin-top: 12px; }

.tier-access-price { white-space: nowrap; }
.addon-early-table .addon-value-field { width: 74px; height: 32px; }

.creator-ledger-heading[data-tooltip] { display: inline-flex; flex-direction: row; align-items: center; }
.creator-ledger-heading[data-tooltip] > .btn-icon { flex: none; }
.addon-prices-table, .addon-early-table { --creator-mobile-table-width: 100%; }
.addon-prices-table .creator-ledger-heading, .addon-early-table .creator-ledger-heading { flex-direction: row; align-items: center; }

/* Shared Round 7 frame. Page-specific compositions stay in their own files. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2?v=34b9c504cab7') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2?v=3100e775e861') 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;
}

html { background: var(--bg); color-scheme: dark; }
body { background: var(--bg); -webkit-font-smoothing: antialiased; }
body, .site-brand, .site-brand-text, .creator-card-name, .creator-card-name a,
.creator-ops-title, .creator-release-creator { font-family: Inter, "Segoe UI", sans-serif; font-kerning: normal; font-variant-ligatures: normal; }
.creator-card-name, .creator-card-name a, .creator-ops-title { letter-spacing: -.02em; word-spacing: normal; }
.creator-cell-main .creator-card-name { font-size: 20px; font-weight: 750; line-height: 1.25; }
.creator-card-name a, .landing-creator-card-copy h3 a { color: var(--text); text-decoration: none; }
.creator-card-name a:hover, .landing-creator-card-copy h3 a:hover { color: var(--accent-text); }
button, input, select, textarea { font-family: inherit; }
:where(a[href], area[href], button, select, summary, label[for], label:has(input:is([type="checkbox"], [type="radio"])),
  input:is([type="button"], [type="submit"], [type="reset"], [type="checkbox"], [type="radio"], [type="file"], [type="image"], [type="color"]),
  [role="button"], [role="link"], [role="tab"], [role="switch"], [role="checkbox"], [role="radio"], [role="combobox"], [role="option"],
  [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"],
  [onclick], [data-modal-open], [data-modal-close], [data-content-cards-open], [data-picker-option], [data-gallery] [data-media-item]) {
  cursor: pointer !important;
}
:where(:disabled, [aria-disabled="true"], [disabled], [inert], label:has(:disabled)) { cursor: default !important; }
h1, h2, h3, .page-kicker { font-family: Inter, "Segoe UI", sans-serif; }

/* Chrome uses the selected scheme; its height also anchors the sticky rail. */
.site-header-inner { min-height: var(--header-h); }
.app-header .site-header-inner { min-height: calc(var(--header-h) - 1px); height: calc(var(--header-h) - 1px); }
.site-brand-text { font-weight: 800; letter-spacing: -.02em; }
.site-brand { font-size: 18px; letter-spacing: -.02em; }
.site-brand-mark, .site-brand-mark img { width: 30px; height: 30px; }
.sidebar-compact-toggle { width: 36px; height: 36px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--scheme-text) 7%, transparent); }
.sidebar-link-title { font-size: 15.5px; }
.sidebar-link .sidebar-icon-wrap, .sidebar-link .sidebar-icon-wrap svg { width: 19px; height: 19px; }
.sidebar-group-title { font-size: 12px; }
.sidebar-meta-link { border-radius: 10px; }
/* Header search: a dark, bordered field with white text, and the shared main
   button beside it at its normal size (the same Search button as the Content page). */
.global-search { flex-basis: 440px; max-width: 560px; min-width: 368px; height: 40px; gap: 8px; padding: 0; border: 0; background: none; }
.global-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: color-mix(in srgb, var(--scheme-text) 62%, transparent); }
.global-search .global-search-input { height: 40px; padding: 0 12px 0 38px; border: 1px solid color-mix(in srgb, var(--scheme-text) 17%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--scheme-bg) 55%, #000); color: var(--scheme-text); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45); font-size: 15px; caret-color: var(--accent-strong); }
.global-search-input::placeholder { color: color-mix(in srgb, var(--scheme-text) 58%, transparent); opacity: 1; }
.global-search:hover .global-search-input { border-color: color-mix(in srgb, var(--scheme-text) 26%, transparent); }
.global-search .global-search-input:focus { border-color: var(--accent); background: color-mix(in srgb, var(--scheme-bg) 55%, #000); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.global-search:focus-within .global-search-icon { color: var(--accent-strong); }
@media (min-width: 721px) and (max-width: 1099px) {
  .global-search { flex-basis: 288px; min-width: 288px; }
  .global-search-submit { display: none; }
}
.site-header-action { min-height: 40px; padding: 0 18px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.header-admin-actions > summary { min-height: 36px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--scheme-text) 7%, transparent); color: #fff; }
.sidebar-inner { padding-top: 14px; }
.sidebar-groups { padding-bottom: 28px; -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); }
.sidebar-group-title { margin-bottom: 6px; }
.sidebar-link { border: 0; }
.sidebar-icon-wrap { color: var(--text-muted); }
.sidebar-discovery { margin-top: 22px; }
.sidebar-discovery .creator-release-creator { display: flex; width: 100%; min-height: 40px; gap: 11px; padding: 4px 10px; border-radius: 10px; background: transparent; font-size: 15px; font-weight: 500; }
.sidebar-discovery .creator-release-creator img { width: 24px; height: 24px; }
.sidebar-discovery .creator-release-creator > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-creator-entry { display: flex; align-items: center; min-width: 0; gap: 4px; }
.sidebar-creator-entry > .creator-release-creator { flex: 1; min-width: 0; }
.sidebar-creator-entry > .sidebar-link-badge { flex: none; margin-right: 10px; }
/* The rail scrolls, so an outside focus ring would be clipped at its edges. */
.sidebar-groups :is(a, button):focus-visible { outline-offset: -3px; }
.sidebar-viewed-creator > .sidebar-context-creator { margin: 0; padding: 0; }
.sidebar-viewed-creator > .sidebar-context-creator::before { display: none; }
.sidebar-creator-submenu { margin: 4px 0 8px 10px; padding-left: 5px; border-left: 1px solid var(--border); }
.sidebar-submenu-title { margin: 14px 0 6px; padding-left: 0; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-creator-submenu .sidebar-tier-item { padding: 8px 10px; margin: 0; font-size: 14px; }
.sidebar-creator-submenu .sidebar-tier-item::before { display: none; }
.sidebar-discovery-release.is-active { background: var(--accent-soft); color: var(--text); }
.sidebar-discovery-release { display: flex; align-items: center; gap: 11px; padding: 5px 10px; border-radius: 10px; text-decoration: none; }
.sidebar-discovery-release:is(:hover, :focus-visible), .sidebar-discovery .creator-release-creator:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--scheme-text) 4%, transparent); }
.sidebar-discovery-thumb { width: 32px; aspect-ratio: var(--release-media-ratio); border-radius: 6px; flex: none; overflow: hidden; }
.sidebar-discovery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sidebar-discovery-release > span { display: flex; flex-direction: column; min-width: 0; }
.sidebar-discovery-release strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.sidebar-discovery-release small { color: var(--text-muted); font-size: 13px; }

main.app-content { padding-top: 28px; padding-bottom: 72px; }
.page-shell { gap: 28px; }

/* The existing page head becomes the art-backed head card. The creator
   banner and the Home hero have their own compositions and remain separate. */
:is(.page-shell > .hero:not(.creator-top-header), .content-directory-header:has(h1), .creator-page-header, .page-shell > .page-header) {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 180px;
  max-width: none;
  margin: 0;
  padding: 32px 36px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: none;
}
:is(.page-shell > .hero:not(.creator-top-header), .content-directory-header:has(h1), .creator-page-header, .page-shell > .page-header)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('../images/site-art.jpg?v=5e33e1b6ab90') right center / 70% auto no-repeat;
  opacity: .55;
  -webkit-mask-image: linear-gradient(90deg, transparent 25%, #000 85%);
  mask-image: linear-gradient(90deg, transparent 25%, #000 85%);
}
.page-header h1,
.page-header > .page-kicker:only-child,
.creator-page-header .page-kicker,
.content-directory-header h1 { margin: 0; font-size: 44px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; color: var(--text); text-transform: none; }
.content-directory-header:has(h1) .page-kicker { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
.page-header-note { color: var(--text-soft); }
.page-shell > .hero:not(.creator-top-header) .creator-search-form { margin-bottom: 0; padding: 0; }
.section-heading { align-items: baseline; margin-bottom: 18px; }
.content-directory-header > div:first-child:not(.content-directory-header-tools),
.admin-financials-dashboard-heading > div:first-child {
  flex: 1;
  min-width: 0;
  align-self: stretch;
}
.content-directory-header > div:first-child:not(.content-directory-header-tools) { align-content: end; }
:is(.section-heading, .creator-gallery-heading) h2,
.panel > h2 { font-size: 26px; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; text-transform: none; color: var(--text); }
.messages-conversations-header h2 { color: var(--text); font-size: 18px; font-weight: 700; letter-spacing: -.02em; text-transform: none; }
.creator-filter-card-head :is(h2, h3) { font-size: 22px; font-weight: 750; letter-spacing: -.02em; text-transform: none; color: var(--text); }
.creator-gallery-heading { margin-bottom: 18px; }
.creator-gallery-rule { background: none; }

/* Shared surfaces and controls. Tables retain app-table.css as their single
   source of styling; no table-specific reskin is introduced here. */
.surface-card, .panel:not(.content-directory) { padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: none; }
.admin-kpi, .admin-state-card { padding: 16px; border-radius: 14px; }
.admin-kpi-label, .admin-state-card > span { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.panel.content-directory { padding: 0; border: 0; background: transparent; }
.panel.content-directory + .panel { margin-top: 20px; }
.content-directory-filters { background: var(--surface); box-shadow: none; border-radius: 16px; }
.form-control, .form-select, .auth-input { min-height: 40px; border-radius: 10px; background-color: var(--field); border-color: var(--border-strong); }
.form-control:focus, .form-select:focus, .auth-input:focus { background-color: var(--field); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.multiselect-panel { background: var(--surface-raised); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[type="checkbox"]:not([role="switch"]):not(.follow-toggle input) { width: 18px; height: 18px; flex-shrink: 0; }

:is(.creator-audience-tabs, .creator-settings-tabs, .admin-settings-tabbar, .admin-operations-tabs, .messages-tabs, .content-directory-view-switch) { gap: 2px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
/* Tabs: a count badge keeps the sidebar badges' gap from its label. */
:is(.creator-audience-tab, .creator-settings-tab, .admin-settings-tab, .admin-operations-tab, .messages-tab) { display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem; min-height: 34px; margin: 0; padding: 0 16px; border: 0; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--text-soft); text-decoration: none; }
:is(.creator-audience-tab, .creator-settings-tab, .admin-settings-tab, .admin-operations-tab, .messages-tab).is-active { background: color-mix(in srgb, var(--scheme-text) 8%, transparent); box-shadow: none; color: var(--text); }
.content-directory-view-switch [data-content-directory-view] { width: 34px; height: 34px; border: 0; border-radius: 9px; }
.content-directory-view-switch [data-content-directory-view].is-active { background: color-mix(in srgb, var(--scheme-text) 8%, transparent); color: var(--text); }

/* Canonical release card. The top row and footer contain only the links and
   facts supplied by the original renderer. No duplicate content for mobile. */
.content-directory-grid { grid-template-columns: repeat(var(--content-columns, 5), minmax(0, 1fr)); gap: 20px; }
[data-content-directory-card-scale-wrap][hidden] { display: none; }
.creator-gallery-card { min-width: 0; display: flex; flex-direction: column; align-self: stretch; height: 100%; border: 0; border-radius: 16px; background: var(--surface); transition: transform .2s, background .2s; }
.creator-gallery-card:hover { transform: translateY(-3px); background: color-mix(in srgb, var(--surface), white 4%); }
.creator-gallery-card.is-unlocked { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--success) 55%, transparent); }
.creator-release-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 8px 12px; }
.creator-release-creator { min-width: 0; color: var(--text-soft); font-size: 13.5px; font-weight: 600; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.creator-release-creator:hover { color: var(--text); }
.creator-release-creator { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 7px 3px 3px; border-radius: 999px; background: color-mix(in srgb, var(--scheme-text) 6%, transparent); }
.creator-release-creator img { display: block; flex: none; width: 20px; height: 20px; object-fit: cover; border-radius: 50%; }
.creator-release-creator > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.creator-release-facts { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; min-width: 0; gap: 8px; color: var(--text-muted); font-size: 13px; }
.creator-release-facts .architecture-abbreviations { padding: 3px 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 5px; background: color-mix(in srgb, var(--scheme-text) 7%, transparent); font-size: 12px; font-weight: 500; line-height: 1.2; }
.creator-release-versions { flex: none; margin-left: auto; white-space: nowrap; }
.creator-release-top .creator-price-badge-form { position: static; flex: none; margin: 0 0 0 auto; }
.creator-release-top > .creator-price-badge { position: static; flex: none; margin-left: auto; }
.creator-release-top .creator-price-badge { min-height: 24px; padding: 3px 9px; font-size: 13px; line-height: 18px; background: color-mix(in srgb, var(--site-accent) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--site-accent) 38%, transparent); }
.creator-release-top .creator-price-badge.is-free { background: color-mix(in srgb, var(--success) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 32%, transparent); }
.creator-release-owned { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: auto; min-height: 24px; padding: 3px 8px; border-radius: 7px; color: var(--text-soft); background: var(--surface-raised); font-size: 12px; font-weight: 600; line-height: 18px; text-decoration: none; white-space: nowrap; }
.creator-release-owned svg { width: 14px; height: 14px; fill: currentColor; }
.creator-release-owned.is-permanent { color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.creator-gallery-card .creator-gallery-media { flex: none; height: auto; aspect-ratio: 9 / 16; overflow: hidden; text-decoration: none; background: color-mix(in srgb, var(--bg), black 25%); }
.creator-gallery-card .creator-gallery-media img,
.creator-gallery-card .creator-gallery-media video { object-fit: cover; transition: none; }
.creator-gallery-card:hover .creator-gallery-media img { transform: none; }
.creator-gallery-card .creator-gallery-bar { display: flex; flex-direction: column; gap: 9px; flex: 1; padding: 11px 12px 12px; border: 0; background: transparent; }
.creator-gallery-card .creator-gallery-title { min-height: 1.3em; color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.3; }
.creator-gallery-card .creator-gallery-title a { display: block; overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
.creator-gallery-title a:hover { color: var(--accent-text); }
.creator-gallery-title .content-version-tag { color: var(--text-muted); font-size: 13.5px; font-weight: 400; }
.creator-gallery-card .creator-gallery-taxonomy { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: auto; font-size: 13px; line-height: 1.4; }
.creator-gallery-card .creator-gallery-date { flex: none; margin-left: auto; padding: 0; font-size: 13px; }
.creator-gallery-card .creator-gallery-access { flex-wrap: wrap; overflow: visible; min-width: 0; gap: 5px; }
.creator-gallery-card .creator-gallery-access .creator-tier-badge,
.creator-gallery-card .creator-content-access-status { max-width: 100%; min-height: 24px; padding: 3px 8px; border-radius: 6px; font-size: 12.5px; line-height: 18px; white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 1024px) {
  .sidebar-close + .sidebar-groups { margin-top: 12px; }
  main.app-content { padding-top: 22px; }
  :is(.page-shell > .hero:not(.creator-top-header), .content-directory-header:has(h1), .creator-page-header, .page-shell > .page-header) { padding: 26px; }
}
@media (min-width: 1025px) {
  [data-download-history] .creator-toolbar { grid-template-columns: minmax(240px, 2.8fr) repeat(3, minmax(120px, .75fr)); }
  html.sidebar-compact .sidebar-discovery .creator-release-creator { justify-content: center; padding-inline: 0; }
  html.sidebar-compact .sidebar-discovery .creator-release-creator > span:not(.creator-avatar-frame),
  html.sidebar-compact .sidebar-discovery-release > span:not(.sidebar-discovery-thumb) { display: none; }
  html.sidebar-compact .sidebar-discovery-release { justify-content: center; padding-inline: 0; }
  html.sidebar-compact .sidebar-creator-entry { justify-content: center; position: relative; }
  html.sidebar-compact .sidebar-creator-entry > .creator-release-creator { flex: 0 0 auto; width: auto; }
  html.sidebar-compact .sidebar-creator-entry > .sidebar-link-badge { margin: 0; }
  html.sidebar-compact .sidebar-discovery-thumb { width: 24px; }
  html.sidebar-compact .sidebar-creator-submenu { margin-inline: 0; padding-left: 0; border-left: 0; }
  html.sidebar-compact .sidebar-submenu-title { padding-left: 0; text-align: center; font-size: 0; }
  html.sidebar-compact .sidebar-submenu-title::after { content: attr(data-compact-label); font-size: 0.62rem; letter-spacing: 0.03em; }
}

[data-drag-carousel] { overflow: hidden; touch-action: pan-y; cursor: default; user-select: none; min-width: 0; }
[data-drag-carousel].is-dragging { cursor: default; }
.drag-carousel-track { display: flex; align-items: stretch; gap: 14px; width: max-content; min-width: 100%; will-change: transform; }
.drag-carousel-track > * { flex: none; }
.drag-carousel-frame { position: relative; min-width: 0; }
.drag-carousel-arrow { position: absolute; z-index: 3; top: 50%; display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; padding: 0; border: 1px solid rgb(255 255 255 / .12); border-radius: 50%; background: rgb(14 14 20 / .6); color: rgb(255 255 255 / .9); box-shadow: 0 4px 14px rgb(0 0 0 / .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); cursor: pointer; opacity: .7; transform: translateY(-50%); transition: opacity .2s, background .2s, border-color .2s; }
.drag-carousel-arrow--prev { left: 12px; }
.drag-carousel-arrow--next { right: 12px; }
.drag-carousel-arrow > svg { width: 20px; height: 20px; }
.drag-carousel-frame:hover > .drag-carousel-arrow, .drag-carousel-arrow:focus-visible { opacity: 1; }
.drag-carousel-arrow:hover { background: rgb(14 14 20 / .78); border-color: rgb(255 255 255 / .24); color: #fff; }
.drag-carousel-arrow.is-at-end:not(:focus-visible) { opacity: 0 !important; pointer-events: none; }
.drag-carousel-arrow[hidden] { display: none; }
@media (hover: none) { .drag-carousel-arrow { opacity: .8; } }
@media (max-width: 720px) {
  .app-header .app-header-lead { flex: 0 0 auto; }
  main.app-content { padding-top: 18px; }
  .page-shell { gap: 22px; }
  :is(.page-shell > .hero:not(.creator-top-header), .content-directory-header:has(h1), .creator-page-header, .page-shell > .page-header) { min-height: 160px; padding: 22px; border-radius: 16px; }
  .page-header h1, .page-header > .page-kicker:only-child, .creator-page-header .page-kicker, .content-directory-header h1 { font-size: 34px; }
  .content-directory-grid { gap: 12px; }
  .content-directory-header-tools--mobile .content-directory-card-scale { flex: 1; min-width: 0; max-width: 120px; }
  .content-directory-header-tools--mobile .content-directory-card-scale input { width: 100%; min-width: 0; min-height: 44px; }
  .creator-release-top { gap: 6px; padding: 8px; }
  .creator-release-creator { font-size: 12.5px; }
  .creator-gallery-card .creator-gallery-bar { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .creator-gallery-card, .creator-gallery-card .creator-gallery-media img { transition: none; }
  .creator-gallery-card:hover, .creator-gallery-card:hover .creator-gallery-media img { transform: none; }
}

/* Round 7 reskin: home screens. Loaded after app-foundation.css. */
.landing-page, .signed-home-page { display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: none; margin: 0 auto; }
.landing-page { padding: 0; }
.landing-page .landing-hero, .signed-home-intro {
  position: relative; isolation: isolate; display: grid; grid-template-columns: clamp(380px, 30vw, 560px) minmax(0, 1fr);
  align-items: center; gap: 30px; min-width: 0; min-height: 0; margin: -28px calc(-1 * var(--gutter)) -12px;
  padding: 32px 0 0 calc(var(--gutter) + 16px); border: 0; border-radius: 0; background: transparent; overflow: hidden;
}
.landing-hero::before, .signed-home-intro::before { content: ""; position: absolute; z-index: -2; inset: 0; background: url('../images/site-art.jpg?v=5e33e1b6ab90') 70% center / cover no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent, #000 65%); mask-image: linear-gradient(90deg, transparent, #000 65%); }
.landing-hero::after, .signed-home-intro::after { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: linear-gradient(0deg, var(--bg), transparent 30%), linear-gradient(90deg, var(--bg), transparent 75%); }
.landing-hero-copy, .signed-home-copy { min-width: 0; padding: 0; }
.landing-hero-copy h1, .signed-home-copy h1 { margin: 18px 0; font-size: clamp(38px, 3vw, 50px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; text-transform: none; }
.landing-hero-copy h1 .landing-title-primary, .landing-hero-copy h1 .landing-title-accent { text-transform: none; letter-spacing: -.035em; font-weight: 800; font-size: inherit; line-height: inherit; }
.landing-hero-copy h1 span { display: block; }
.landing-hero-copy h1 .landing-title-primary { color: var(--text); white-space: normal; }
.landing-hero-copy h1 .landing-title-accent { color: var(--accent-text); }
.landing-lead, .signed-home-copy > p:not(.page-kicker) { margin: 0; color: var(--text-soft); font-size: 18px; line-height: 1.6; }
.landing-kicker, .signed-home-copy .page-kicker { margin: 0; color: var(--accent-text); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.home-hero-actions .btn { min-height: 46px; padding: 0 23px; font-size: 16px; }
.home-hero-actions .btn-icon-only { width: 46px; min-width: 46px; padding: 0; }
.home-shimmer { position: relative; isolation: isolate; overflow: hidden; }
.home-shimmer::after { content: ""; position: absolute; inset: -50% -80%; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.03) 48%, rgba(255, 255, 255, 0.06) 50%, transparent 63%); transform: translateX(-70%); animation: home-shimmer 6s ease-in-out infinite; }
@keyframes home-shimmer { 0%, 58% { transform: translateX(-70%); } 88%, 100% { transform: translateX(70%); } }
.home-hero-rail { width: 100%; padding-block: 1px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 94%, transparent); }
.home-hero-rail .drag-carousel-track { align-items: stretch; gap: 14px; }
.home-hero-rail .creator-gallery-card, .home-legacy-slide { position: relative; width: 250px; height: auto; aspect-ratio: var(--release-media-ratio); margin: 0; border: 0; border-radius: 16px; overflow: hidden; background: transparent; box-shadow: none; transform: none; }
.home-legacy-slide { overflow: visible; }
/* Composite the artwork and caption together before applying the rounded clip. */
.home-legacy-slide > .landing-spotlight, .home-legacy-slide .landing-public-spotlight > .landing-spotlight, .home-hero-rail .creator-gallery-card {
  overflow: visible; clip-path: inset(0 round 16px); mask-image: linear-gradient(#000, #000);
}
.home-hero-rail .creator-gallery-media { height: auto; aspect-ratio: var(--release-media-ratio); }
.home-hero-rail .creator-gallery-media img { width: 100%; height: 100%; object-fit: cover; }
.home-hero-rail .creator-release-top { position: absolute; z-index: 2; inset: auto 0 10px; padding: 0 14px; min-height: 24px; }
.home-hero-rail .creator-release-creator { color: #e9e9ed; background: #11141a88; }
.home-hero-rail .creator-gallery-bar { position: absolute; inset: auto 0 0; min-height: 130px; justify-content: flex-end; padding: 55px 14px 46px; background: linear-gradient(0deg, #0c0c12ed, transparent); pointer-events: none; }
.home-hero-rail .creator-gallery-title { color: #f6f6f8; font-size: 16px; }
.home-hero-rail .creator-gallery-title a { pointer-events: auto; }
.home-hero-rail .creator-gallery-taxonomy, .home-hero-rail .creator-release-facts, .home-hero-rail .creator-release-meta { display: none; }
.home-legacy-slide .creator-gallery-card .creator-gallery-taxonomy { display: flex; }
.home-hero-rail .creator-gallery-card:hover { transform: none; }
.home-legacy-slide > .landing-spotlight { display: block; width: 100%; height: 100%; min-height: 0; margin: 0; aspect-ratio: auto; border: 0; border-radius: 0; background: var(--surface); box-shadow: none; transform: none; }
.home-legacy-slide .landing-spotlight::before, .home-legacy-slide .landing-spotlight::after { content: none; }
.home-legacy-slide .landing-spotlight-front { position: relative; width: 100%; height: 100%; padding: 0; aspect-ratio: auto; border: 0; border-radius: 0; transform: none; box-shadow: none; }
.home-legacy-slide .landing-spotlight-media { width: 100%; height: auto; aspect-ratio: var(--release-media-ratio); border-radius: 0; }
.home-legacy-slide .landing-spotlight-caption { position: absolute; z-index: 1; inset: auto 0 0; padding: 50px 14px 14px; background: linear-gradient(0deg, #0c0c12ed, transparent); }
.home-legacy-slide .landing-spotlight-caption strong, .home-legacy-slide .landing-spotlight-caption small { color: #fff; }
.home-legacy-slide .landing-spotlight-caption strong { font-size: 17px; }
.home-legacy-slide .landing-spotlight-caption span, .home-legacy-slide .landing-spotlight-caption small { font-size: 13px; }
.home-legacy-slide .landing-spotlight-media { display: block; }
.home-hero-rail .landing-spotlight-media canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-hero-rail .landing-spotlight-media canvas:not(.is-preview-ready) { opacity: 0; }
.home-hero-rail :is(.landing-spotlight-media, .creator-gallery-media):focus-visible { border-radius: 16px; outline: 3px solid var(--accent-text); outline-offset: -4px; }
.home-legacy-slide .home-release-caption { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 7px; align-items: center; padding: 40px 10px 10px; text-align: left; border: 0; box-shadow: none; }
.home-release-caption .creator-avatar-frame-link { grid-row: 1 / 3; padding: 0; margin: 0; min-width: 0; }
.home-release-caption .creator-avatar-frame--home-hero { width: 28px; height: 28px; padding: 1px; }
.home-release-caption .home-release-title { min-width: 0; color: #fff; font-size: 16px; font-weight: 700; line-height: 1.3; text-decoration: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; }
.home-legacy-slide .home-release-caption .home-release-version { grid-column: 2; margin: 0; color: #b7b5c3; font-size: 13px; font-weight: 400; white-space: nowrap; }
.home-legacy-slide:has(.landing-public-spotlight) { width: 778px; aspect-ratio: auto; }
.home-legacy-slide .landing-public-spotlight { display: flex; gap: 14px; height: 100%; transform: none; }
.home-legacy-slide .landing-public-spotlight > .creator-gallery-card { flex: none; transform: none; }
.home-legacy-slide .landing-public-spotlight > .landing-release-spotlight { flex: none; width: 250px; min-height: 0; margin: 0; border: 0; border-radius: 16px; aspect-ratio: var(--release-media-ratio); background: var(--surface); transform: none; box-shadow: none; }
.home-legacy-slide .landing-circle-spotlight { padding: 20px 12px; }
.home-legacy-slide .landing-circle-grid { display: flex; flex-direction: column; gap: 16px; }
.home-legacy-slide .landing-circle-creator { display: flex; flex-direction: row; gap: 14px; text-align: left; }
.home-legacy-slide .creator-avatar-frame--landing-circle { width: 64px; height: 64px; }
.signed-home-page > .panel, .landing-page > .signed-home-content { margin: 0 !important; padding: 0; border: 0; border-radius: 0; background: transparent; }
.signed-home-page .section-heading { margin-bottom: 18px; }
.signed-home-page .home-creators-browser { grid-template-columns: minmax(0, 1fr); align-items: start; }
.signed-home-page .home-creators-browser .creator-table--cards thead { grid-column: 1; grid-row: auto; justify-self: end; width: 250px; }
.signed-home-page .section-heading h2, .landing-section-heading h2 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.landing-section, .landing-releases-section { margin: 0; padding: 0; }
.landing-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin: 0 0 20px; }
.landing-text-link { font-size: 14.5px; font-weight: 600; color: var(--text-soft); }
.landing-release-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.landing-release-grid .creator-gallery-card { border: 0; background: var(--surface); }
.landing-release-grid .creator-gallery-media { aspect-ratio: var(--release-media-ratio); }
.landing-release-grid .creator-gallery-card:hover { transform: translateY(-3px); }
.landing-creator-grid { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.landing-creator-card { padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: none; }
.landing-creator-card-copy h3 { font-size: 20px; }
.home-spotlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 20px; }
.home-spotlight-card { overflow: hidden; border: 1px solid var(--border); border-radius: 18px; }
.home-spotlight-card .creator-table { display: block; width: 100%; margin: 0; background: transparent; }
.home-spotlight-card tbody { display: block; }
.home-spotlight-card .creator-row { position: relative; isolation: isolate; display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; grid-template-rows: auto auto auto; gap: 2px 18px; padding: 18px; background: var(--creator-card-art) center 40% / cover no-repeat, var(--surface); border: 0; border-radius: 0; }
.home-spotlight-card .creator-row::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: radial-gradient(130% 120% at 50% 45%, transparent 50%, rgb(6 6 10 / .7) 100%); }
.home-spotlight-card .creator-cell { display: contents; padding: 0; border: 0; background: transparent; }
.home-spotlight-card .creator-card-body, .home-spotlight-card .creator-card-identity { display: contents; }
.home-spotlight-card .creator-avatar-frame-link { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.home-spotlight-card .creator-avatar-frame { width: 82px; height: 82px; }
.home-spotlight-card .creator-card-line:first-child { grid-column: 2; grid-row: 1; align-self: end; align-items: center; gap: 10px; min-height: 0; }
.home-spotlight-card .creator-card-line:nth-child(2) { display: contents; }
.home-spotlight-card .creator-card-name { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 800; }
.home-spotlight-card .creator-card-name a, .home-spotlight-card .creator-card-bio { padding: 0; border: 0; color: #fff; background: transparent; text-decoration: none; text-shadow: 0 1px 2px #000d, 0 0 10px #0007; }
.home-spotlight-card .creator-card-bio { grid-column: 2; grid-row: 2; margin: 0; min-width: 0; white-space: normal; font-size: 14px; line-height: 1.4; }
.home-spotlight-card .creator-card-previews { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.home-spotlight-card .creator-card-previews:empty { display: none; }
.home-spotlight-card .creator-card-previews a { display: block; aspect-ratio: var(--release-media-ratio); overflow: hidden; border-radius: 12px; background: var(--surface); }
.home-spotlight-card .creator-card-previews img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-spotlight-card .creator-card-actions { grid-column: 3; grid-row: 1; justify-content: flex-end; flex-wrap: wrap; align-self: center; gap: 8px; }
.landing-audiences { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 0; }
.landing-audiences article { display: flex; position: relative; isolation: isolate; min-height: 280px; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.home-audience-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; position: relative; z-index: 1; padding: 34px; pointer-events: none; }
/* SUB279 The text and buttons keep their clicks; the faded pictures behind the text side are shielded and only the visible pictures open their release. */
.home-audience-copy > * { max-width: 100%; pointer-events: auto; }
.home-audience-copy::before { content: ""; position: absolute; z-index: -1; inset: 0 auto 0 0; width: calc(48% + 20px); pointer-events: auto; }
.home-audience-copy h2 { margin: 10px 0; font-size: 26px; font-weight: 800; line-height: 1.25; }
.home-audience-copy p:not(.page-kicker) { margin: 0 0 24px; color: var(--text-soft); font-size: 16px; }
.home-audience-copy .btn { margin-top: auto; }
.home-audience-mosaic { display: flex; gap: 10px; position: absolute; z-index: 0; top: -55px; bottom: -55px; right: -20px; width: 66%; transform: rotate(-6deg); -webkit-mask-image: linear-gradient(90deg, transparent, #000 42%); mask-image: linear-gradient(90deg, transparent, #000 42%); }
.landing-audiences article { container-type: inline-size; }
.home-mosaic-column:nth-child(n+4) { display: none; }
@container (min-width: 750px) { .home-mosaic-column:nth-child(4) { display: block; } }
@container (min-width: 1050px) { .home-mosaic-column:nth-child(5) { display: block; } }
@container (min-width: 1200px) { .home-mosaic-column:nth-child(6) { display: block; } }
.home-more-end { display: flex; justify-content: center; min-height: 46px; }
[data-home-releases] [hidden] { display: none !important; }
.home-mosaic-column { flex: 1; min-width: 0; overflow: hidden; }
.home-mosaic-track, .home-mosaic-set { display: flex; flex-direction: column; gap: 10px; }
.home-mosaic-track { animation: home-mosaic-drift 85s linear infinite; }
/* SUB279 Every other column drifts the other way: the first down, the second up, and so on. */
.home-mosaic-column:nth-child(odd) .home-mosaic-track { animation-direction: reverse; }
.home-mosaic-column:nth-child(3n) .home-mosaic-track { animation-duration: 100s; }
.home-audience-mosaic:hover .home-mosaic-track, .home-audience-mosaic:focus-within .home-mosaic-track { animation-play-state: paused; }
.home-mosaic-link { display: block; position: relative; border-radius: 10px; outline: none; -webkit-user-drag: none; }
.home-mosaic-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.home-mosaic-link:focus-visible::after { box-shadow: inset 0 0 0 3px var(--accent); }
/* Keyboard focus stops the drift on the focusable set and lifts the fade, so the focused picture is in view. */
.home-audience-mosaic:has(.home-mosaic-link:focus-visible) .home-mosaic-track { animation: none; }
.home-audience-mosaic:has(.home-mosaic-link:focus-visible) { -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .55), #000 30%); mask-image: linear-gradient(90deg, rgba(0, 0, 0, .55), #000 30%); }
.home-audience-mosaic .home-mosaic-track img { display: block; flex: none; width: 100%; height: auto; min-height: 0; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; transition: filter .2s ease; }
.home-mosaic-link:hover img { filter: brightness(1.12); }
@keyframes home-mosaic-drift { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 5px)); } }
@media (max-width: 1250px) {
  .landing-page .landing-hero, .signed-home-intro { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; padding-left: var(--gutter); }
  .landing-hero-copy h1, .signed-home-copy h1 { font-size: 36px; }
  .home-hero-rail .creator-gallery-card, .home-legacy-slide { width: 220px; height: auto; }
  .home-legacy-slide:has(.landing-public-spotlight) { width: 688px; }
  .home-legacy-slide .landing-public-spotlight > .landing-release-spotlight { width: 220px; }
  .landing-release-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-audience-copy { padding: 26px; }
}
@media (max-width: 800px) {
  .landing-page, .signed-home-page { gap: 20px; }
  .landing-page .landing-hero, .signed-home-page > .signed-home-intro { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px var(--gutter) 0; margin-top: -18px; margin-bottom: -8px; }
  .landing-hero::before, .signed-home-intro::before { -webkit-mask-image: linear-gradient(0deg, #000, transparent 70%); mask-image: linear-gradient(0deg, #000, transparent 70%); }
  .home-hero-actions > .btn { width: auto; }
  .home-hero-actions > .btn:first-child { flex: 1 1 auto; }
  .landing-page .landing-hero-copy h1, .signed-home-copy h1 { font-size: clamp(34px, 7vw, 46px); }
  .home-hero-rail .creator-gallery-card, .home-legacy-slide { width: 210px; height: auto; }
  .home-legacy-slide:has(.landing-public-spotlight) { width: 658px; }
  .home-legacy-slide .landing-public-spotlight > .landing-release-spotlight { width: 210px; }
  .landing-release-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .landing-audiences { grid-template-columns: 1fr; }
  .home-spotlight-card .creator-row { grid-template-columns: 58px minmax(0, 1fr) auto; column-gap: 12px; padding: 16px; }
  .home-spotlight-card .creator-avatar-frame { width: 58px; height: 58px; }
  .home-spotlight-card .creator-card-name { font-size: 24px; }
  .home-spotlight-card .creator-card-previews { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 24px) / 4); gap: 8px; overflow-x: auto; }
  .home-spotlight-card .creator-card-actions .follow-toggles { flex-wrap: wrap; }

}
@media (prefers-reduced-motion: reduce) {
  .home-shimmer::after, .home-mosaic-track { animation: none; }
}

@media (max-width: 520px) {
  .home-spotlight-card .creator-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px; }
  .home-spotlight-card .creator-avatar-frame { width: 48px; height: 48px; }
  .home-spotlight-card .creator-card-name { font-size: 21px; }
  .home-spotlight-card .creator-card-bio { grid-column: 2 / -1; }
  .home-spotlight-card .creator-card-actions { max-width: 130px; }
  .home-spotlight-card .creator-card-actions .follow-toggles { justify-content: flex-end; }
}

/* Home artwork, shared by the live page and the admin's embedded preview. */
html[data-home-background="silk"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/silk.jpg?v=4ca10f9a3818'); }
html[data-home-background="glass"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/glass.jpg?v=b00514cedcc9'); }
html[data-home-background="streaks"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/streaks.jpg?v=ac9ceb12fd07'); }
html[data-home-background="bokeh"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/bokeh.jpg?v=c56d711ef359'); }
html[data-home-background="tiles"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/tiles.jpg?v=4bcb86cd74b7'); }
html[data-home-background="aurora"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/aurora.jpg?v=4595ea9bcefc'); }
html[data-home-background="grain"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/grain.jpg?v=67b601401462'); }
html[data-home-background="contour"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/contour.jpg?v=bc862cffb897'); }
html[data-home-background="liquid"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/liquid.jpg?v=86921312b6e0'); }
html[data-home-background="beams"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/home-backgrounds/beams.jpg?v=29067c0535a1'); }
html[data-home-background="original"] :is(.landing-hero, .signed-home-intro)::before { background-image: url('../images/site-art.jpg?v=5e33e1b6ab90'); }

.admin-home-background-preview { position: relative; aspect-ratio: 5 / 3; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.admin-home-background-preview iframe { position: absolute; inset: 0; width: 1500px; height: 900px; max-width: none; border: 0; pointer-events: none; transform-origin: top left; }
.admin-home-background-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.admin-home-background-option { position: relative; min-width: 0; cursor: pointer; }
.admin-home-background-option > input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin-home-background-option > span { display: block; overflow: hidden; border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--surface); transition: border-color 120ms ease, background 120ms ease; }
.admin-home-background-option img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.admin-home-background-option > span > span { display: block; padding: 9px 11px; color: var(--text-soft); font-size: 14px; font-weight: 600; }
.admin-home-background-option:hover > span { background: var(--surface-hover, var(--surface)); border-color: var(--border); }
.admin-home-background-option > input:checked + span { border-color: var(--accent); background: var(--accent-soft, var(--surface)); }
.admin-home-background-option > input:checked + span > span { color: var(--text); }
.admin-home-background-option > input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 3px; }
@media (max-width: 480px) {
  .admin-home-background-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* Round 7 reskin: creators screens. Loaded after app-foundation.css. */

.creator-directory-page { gap: 20px; }
.creator-directory-page > .hero { display: flex; flex-direction: column; justify-content: center; }
.creator-directory-page .page-header-note { margin: 16px 0 0; }
.creator-directory-browser { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; align-items: center; }
.creator-directory-browser > .creator-search-form { margin: 0; min-width: 0; }
.creator-directory-browser .input-group { display: flex; gap: 8px; }
.creator-directory-browser .input-group .form-control { min-width: 0; min-height: 46px; border-radius: 11px; }
.creator-directory-browser .input-group .btn { flex: none; border-radius: 10px; }
.creator-directory-browser .creator-table--cards { display: contents; }
.creator-directory-browser .creator-table--cards thead { grid-column: -2 / -1; grid-row: 1; }
/* SUB299 Apply as a creator sits between the search and the sorting. */
.creator-directory-browser.has-apply { grid-template-columns: minmax(0, 1fr) auto 250px; }
.creator-directory-browser.has-apply:not(:has(.creator-table--cards)) { grid-template-columns: minmax(0, 1fr) auto; }
.creator-directory-browser.has-apply > .creator-search-form { grid-column: 1; grid-row: 1; }
.creator-directory-apply { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 11px; white-space: nowrap; }
.creator-directory-browser .creator-table--cards thead tr,
.creator-directory-browser .creator-table--cards .creator-th-main { display: block; border: 0; padding: 0; background: none; }
.creator-directory-browser .creator-table--cards thead tr { display: flex; }
.creator-directory-browser .creator-table--cards .creator-th-main { flex: 1; }
.creator-directory-browser .creator-table--cards .creator-th-actions { display: block; width: 1px; padding: 0; border: 0; background: none; }
.creator-directory-browser .creator-th-row { display: flex; justify-content: stretch; gap: 4px; padding: 4px; min-height: 46px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.creator-directory-browser .creator-sort { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 9px; color: var(--text-soft); text-decoration: none; font-family: Inter, "Segoe UI", sans-serif; font-size: 14px; font-weight: 650; text-transform: none; letter-spacing: normal; }
.creator-directory-browser .creator-sort.is-active { background: color-mix(in srgb, var(--scheme-text) 9%, var(--surface)); color: var(--text); }
.creator-directory-browser .creator-table--cards tbody { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.creator-directory-browser .creator-table--cards .creator-row { position: relative; isolation: isolate; min-width: 0; border: 1px solid var(--border-strong); border-radius: 18px; overflow: hidden; box-shadow: none; }
.creator-directory-browser .creator-table--cards .creator-cell { display: contents; padding: 0; border: 0; background: none; }
.creator-row--compact .creator-card-previews a { display: block; overflow: hidden; border: 1px solid rgb(255 255 255 / .08); background: rgb(0 0 0 / .35); text-decoration: none; }
.creator-row--compact .creator-card-previews img { display: block; width: 100%; height: 100%; object-fit: cover; }
.creator-row--compact .creator-card-name,
.creator-row--compact .creator-card-name a { font-family: Inter, "Segoe UI", sans-serif; font-weight: 800; letter-spacing: normal; }
.creator-row--compact .creator-card-name a { color: #fff; text-decoration: none; text-shadow: 0 1px 4px #000a; }
.creator-row--compact .creator-card-name a:hover { text-decoration: underline; }

.creator-profile-feature { display: grid; gap: 28px; min-width: 0; }
.creator-profile-page > .creator-profile-feature > .creator-profile-banner { min-height: 170px; display: flex; align-items: center; padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: none; isolation: isolate; }
.creator-profile-banner::before { z-index: -1; inset: 0; height: auto; background: linear-gradient(180deg, transparent 22%, rgb(4 5 8 / .3) 47%, rgb(4 5 8 / .96) 100%); }
.creator-profile-art { position: absolute; z-index: -2; inset: 0; }
.creator-profile-art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 35%; }
.creator-profile-banner-content { display: flex; align-items: center; gap: 20px; width: 100%; min-width: 0; padding: 20px; }
.creator-profile-banner .creator-user-summary { flex: 1; display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: end; gap: 22px; min-width: 0; }
.creator-profile-banner .creator-avatar-frame--header { width: 112px; height: 112px; }
.creator-profile-banner .creator-profile-top { display: flex; gap: 6px; min-width: 0; }
.creator-profile-banner .page-header { width: 100%; }
.creator-profile-banner .page-header > .page-kicker { margin: 0; font-size: 36px; font-weight: 800; line-height: 1.08; color: #fff; letter-spacing: -.035em; text-transform: none; }
.creator-profile-banner .creator-header-name { white-space: normal; text-overflow: initial; text-decoration: none; color: #fff; overflow-wrap: anywhere; }
.creator-profile-banner .creator-header-name:hover { text-decoration: underline; }
.creator-profile-banner .creator-description { width: 100%; color: #f1f1f3; font-size: 15px; line-height: 1.5; }
.creator-profile-banner .creator-stats-row { flex-wrap: wrap; gap: 8px 20px; font-size: 13px; color: #e4e4e9; }
.creator-profile-banner .creator-stats-row > span,
.creator-profile-banner .creator-stats-row > a { padding: 0; border: 0; background: none; color: inherit; }
.creator-profile-banner .creator-stat strong { color: #fff; font-weight: 750; }
.creator-profile-banner .creator-stat-recent:hover { color: #fff; text-decoration: underline; }
.creator-profile-banner .creator-header-actions { flex: 0 0 auto; justify-content: flex-end; gap: 10px; margin: 0; }
.creator-profile-banner .creator-follow-row { flex: none; }
.creator-profile-banner .creator-message-btn { order: 2; }
.creator-profile-banner .creator-follow-row { order: 3; }
.creator-profile-banner .btn { min-height: 40px; border-radius: 10px; }
.creator-profile-subscriptions { min-width: 0; }
.creator-profile-subscriptions > h2 { margin: 0 0 10px; color: var(--text); font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.creator-profile-subscriptions .creator-tier-shelf { container-type: inline-size; width: calc(100% - 34px); margin: 0 17px; text-align: left; }
/* The scrollport reserves room for the entire card glow on every edge. */
.creator-profile-subscriptions .creator-tier-shelf-viewport { width: auto; max-width: none; padding: 32px; margin: -22px -32px -12px; mask-image: none; }
.creator-profile-subscriptions .creator-tier-shelf-track { width: max-content; min-width: 100%; gap: 20px; align-items: stretch; }
.creator-profile-subscriptions .creator-tier-shelf-track > .creator-tier-card { flex: 0 0 clamp(300px, calc((100cqw - 40px) / 3), 390px); width: auto; margin: 0; }
.creator-profile-subscriptions .creator-tier-shelf:has(.creator-tier-card:nth-child(2):last-child) { max-width: 780px; }
.creator-profile-subscriptions .creator-tier-shelf-track:has(> .creator-tier-card:nth-child(2):last-child) > .creator-tier-card { flex-basis: calc((100% - 20px) / 2 + 12px); }
.creator-profile-subscriptions .creator-tier-shelf-track:has(> .creator-tier-card:nth-child(2):last-child) > .creator-tier-card:last-child { padding-right: 68px; }
.creator-profile-subscriptions .creator-selected-tier-card { width: min(calc(100% - 34px), 390px); margin: 0 17px; }
.creator-profile-subscriptions .creator-tier-shelf-arrow { top: 0; transform: translateY(calc(-100% - 8px)); width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--btn-fill, var(--surface-strong)); color: #fff; }
.creator-profile-subscriptions .creator-tier-shelf-arrow--next { right: 0; }
.creator-profile-subscriptions .creator-tier-shelf-arrow--prev { left: auto; right: 42px; }
.creator-profile-subscriptions .creator-tier-card { position: relative; isolation: isolate; min-height: 410px; gap: 12px; padding: 150px 18px 18px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border-strong)); border-radius: 18px; background: #101116; color: #fff; box-shadow: none; }
.creator-profile-subscriptions .creator-tier-card::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 0%, rgb(4 5 8 / .08) 15%, rgb(4 5 8 / .85) 51%, rgb(4 5 8 / .97) 100%); }
.creator-tier-art { position: absolute; z-index: -2; inset: 0; display: flex; gap: 2px; pointer-events: none; }
.creator-tier-art img { display: block; flex: 1 1 0; min-width: 0; width: 0; height: 100%; object-fit: cover; object-position: center 30%; }
.creator-tier-art img.creator-tier-art-banner { position: absolute; inset: 0; z-index: -1; width: 100%; }
/* SUB190 Content pictures sit over the background and fade in from the left, so a chosen background stays visible. */
.creator-tier-art-content { position: absolute; inset: 0; display: flex; gap: 2px; }
.creator-tier-art-content > span { flex: 1 1 0; min-width: 0; }
.creator-tier-art-content > span > img { width: 100%; }
.creator-tier-art-banner ~ .creator-tier-art-content { -webkit-mask-image: linear-gradient(90deg, transparent 10%, #000 65%); mask-image: linear-gradient(90deg, transparent 10%, #000 65%); }
.creator-profile-subscriptions .creator-tier-card.is-most-popular { border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 65%, transparent), 0 10px 28px color-mix(in srgb, var(--accent) 20%, transparent); }
.creator-profile-subscriptions .creator-tier-card.is-recommended { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 26px color-mix(in srgb, var(--accent) 26%, transparent); }
.creator-profile-subscriptions .creator-tier-card-head { flex-wrap: wrap; align-items: baseline; gap: 7px; }
.creator-profile-subscriptions .creator-tier-card h3.creator-tier-title { display: block; flex: 1; overflow: visible; color: #fff; font-size: 20px; font-weight: 800; line-height: 1.25; text-decoration: none; }
.creator-profile-subscriptions .creator-tier-amount { color: #fff; font-size: 26px; }
.creator-profile-subscriptions .creator-tier-interval { color: #dddde5; font-size: 13px; }
.creator-profile-subscriptions .creator-tier-facts { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.creator-profile-subscriptions .creator-tier-facts .creator-tier-price { margin: 0; }
.creator-profile-subscriptions .creator-tier-release-count { color: #dddde5; font-size: 14px; }
.creator-profile-subscriptions .creator-tier-description { display: block; flex: none; max-height: none; overflow: visible; color: #f0f0f4; font-size: 14px; line-height: 1.5; }
.creator-profile-subscriptions .creator-tier-ribbons { top: 14px; right: 14px; left: 14px; justify-content: flex-end; flex-wrap: wrap; }
.creator-profile-subscriptions .creator-tier-ribbon { padding: 5px 9px; border: 0; border-radius: 7px; background: var(--btn-fill); color: #fff; font-size: 11px; }
.creator-profile-subscriptions .creator-tier-action { margin-top: auto; padding-top: 5px; }
.release-subscription-card :is(.creator-tier-unlocked, .creator-tier-disabled),
.creator-profile-subscriptions .creator-tier-cta,
.creator-profile-subscriptions .creator-tier-unlocked,
.creator-profile-subscriptions .creator-tier-disabled { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 10px; background: #37383f; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; }
.release-subscription-card button.creator-tier-disabled,
.creator-tier-card .creator-tier-cta,
.creator-tier-card button.creator-tier-disabled { background: var(--btn-fill); color: var(--btn-ink, #fff); opacity: 1; }
.creator-profile-subscriptions .is-most-popular .creator-tier-cta.btn-shine { position: relative; overflow: hidden; }
.creator-profile-subscriptions .is-most-popular .creator-tier-cta.btn-shine::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 20%, rgb(255 255 255 / .06) 49%, transparent 78%); transform: translateX(-140%); animation: creator-tier-shimmer 5s ease-in-out infinite; }
.release-subscription-card .creator-tier-unlocked,
.creator-profile-subscriptions .creator-tier-unlocked { color: #fff; background: color-mix(in srgb, var(--btn-a) 45%, #15171b); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.release-subscription-card a.creator-tier-unlocked:is(:hover, :focus-visible),
.creator-profile-subscriptions a.creator-tier-unlocked:is(:hover, :focus-visible) { background: color-mix(in srgb, var(--btn-a) 62%, #15171b); }
.creator-profile-subscriptions .creator-tier-includes { border-color: rgb(255 255 255 / .16); }
.creator-profile-subscriptions .creator-tier-includes-label { color: #c4c4cd; }
.creator-profile-subscriptions .creator-tier-badge-link { color: #fff; text-decoration: underline; }
.creator-profile-page .creator-gallery-heading { margin: 0; }
.creator-profile-page .creator-gallery-heading h2 { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.creator-profile-page .creator-gallery-count { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 3px 9px; margin: 0; border-radius: 20px; background: var(--surface-raised); color: var(--text-soft); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.creator-profile-page .creator-gallery-panel .content-directory-header { gap: 15px; margin-bottom: 18px; }
.creator-profile-page .content-directory-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.creator-profile-page .content-directory-search { flex: 1 0 100%; min-width: 0; margin: 0; }
.creator-profile-page .content-directory-filter-grid { display: contents; }
.creator-profile-page .content-directory-filter-grid > label { flex: 1 1 160px; min-width: max-content; }
.creator-profile-page .content-directory-search > label,
.creator-profile-page .content-directory-filter-grid label { font-size: 12px; text-transform: none; letter-spacing: 0; }
.creator-profile-page .content-directory-sort-controls { display: flex; flex: 1.5 1 230px; min-width: max-content; align-items: end; gap: 10px; }
.creator-profile-page .content-directory-sort-controls > label:first-child { flex: 1; min-width: max-content; }
.creator-profile-page .content-directory-invert-sort { flex: none; min-height: 40px; margin: 0; white-space: nowrap; }
.creator-profile-page .content-directory-filter-footer { flex-basis: 100%; min-height: 0; margin: 0; }
.creator-profile-page .content-directory-filter-footer:has([data-content-directory-status]:empty):not(:has(a)) { display: none; }
.creator-profile-page .content-directory-filters .form-control,
.creator-profile-page .content-directory-filters .form-select { min-height: 40px; }
.creator-profile-page .content-directory-filters .form-select { field-sizing: content; min-width: max-content; font-size: 15px; }
.creator-profile-page .creator-filter-bar { margin: 0 0 18px; gap: 12px; }
.creator-profile-page .creator-filter-group { gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.creator-profile-page .creator-filter-group--actions { border: 0; padding: 0; background: none; }
.creator-profile-page .creator-filter-chip { min-height: 34px; padding: 7px 13px; border: 0; border-radius: 8px; background: var(--surface-raised); box-shadow: none; color: #fff; font-size: 13px; font-weight: 650; }
.creator-profile-page .creator-filter-chip.is-active { color: #fff; background: var(--btn-fill); }
.creator-profile-page .creator-gallery-card.is-unlocked { border: 0; box-shadow: none; }

@keyframes creator-tier-shimmer { 0%, 55% { transform: translateX(-140%); } 85%, 100% { transform: translateX(140%); } }
@media (max-width: 1250px) {
  .creator-directory-browser .creator-table--cards tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-profile-banner-content { gap: 16px; }
  .creator-profile-page .content-directory-search { flex: 2 1 290px; }
}
@media (max-width: 720px) {
  .creator-directory-browser { grid-template-columns: 1fr; gap: 14px; }
  .creator-directory-browser .creator-table--cards thead { grid-column: 1; grid-row: 2; }
  .creator-directory-browser.has-apply,
  .creator-directory-browser.has-apply:not(:has(.creator-table--cards)) { grid-template-columns: minmax(0, 1fr); }
  .creator-directory-browser.has-apply > .creator-search-form { grid-column: 1; grid-row: 1; }
  .creator-directory-browser.has-apply .creator-directory-apply { grid-column: 1; grid-row: 2; }
  .creator-directory-browser.has-apply .creator-table--cards thead { grid-column: 1; grid-row: 3; }
  .creator-directory-browser .creator-table--cards tbody { grid-template-columns: 1fr; gap: 16px; }
  .creator-profile-page > .creator-profile-feature > .creator-profile-banner { min-height: 170px; border-radius: 16px; }
  .creator-profile-banner-content { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; padding: 12px; }
  .creator-profile-banner .creator-user-summary,
  .creator-profile-banner .creator-profile-top { display: contents; }
  .creator-profile-banner .creator-avatar-frame-link { grid-column: 1; grid-row: 1 / 3; }
  .creator-profile-banner .creator-avatar-frame--header { width: 56px; height: 56px; }
  .creator-profile-banner .page-header { grid-column: 2; grid-row: 1; align-self: end; }
  .creator-profile-banner .creator-description { grid-column: 1 / -1; grid-row: 3; }
  .creator-profile-banner .page-header > .page-kicker { font-size: 28px; }
  .creator-profile-banner .creator-description { font-size: 13px; line-height: 1.35; white-space: normal; }
  .creator-profile-banner .creator-header-actions { grid-column: 1 / -1; grid-row: 4; margin-left: 0; }
  .creator-profile-banner .creator-stats-row { grid-column: 2; grid-row: 2; gap: 4px 12px; font-size: 12px; }
  .creator-profile-subscriptions .creator-tier-shelf-track > .creator-tier-card { flex-basis: min(340px, 100cqw); }
  .creator-profile-page .creator-filter-group--tiers { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .creator-profile-subscriptions .is-most-popular .creator-tier-cta.btn-shine::after { animation: none; }
}

/* Compact creator identity and shared attached follow controls. */
.creator-card-bio[data-creator-bio] { display: block; max-width: none; overflow: visible; -webkit-line-clamp: unset; }
.creator-follow-group,
.creator-profile-banner .creator-follow-group,
.home-spotlight-card .creator-follow-group,
.creator-directory-browser .creator-follow-group {
  display: inline-flex; flex: none; flex-wrap: nowrap; align-items: stretch; gap: 0;
  width: auto; max-width: none; margin: 0; padding: 0; min-height: 30px; border: 0;
  border-radius: 9px; background: transparent; isolation: isolate;
}
.creator-follow-group form,
.creator-follow-group .follow-toggles { display: flex; flex-wrap: nowrap; gap: 0; align-items: stretch; margin: 0; padding: 0; }
.creator-follow-group :is(.follow-toggle, .follow-toggle-icon, .creator-follow-btn) {
  display: flex; align-items: center; justify-content: center; min-height: 30px; height: 30px;
  margin: 0; padding: 0; border: 0; border-radius: 0;
  color: #fff; background: #292a32; font-size: 12px; line-height: 1; text-shadow: none;
}
.creator-follow-group .follow-toggle { position: relative; width: 27px; cursor: pointer; text-decoration: none; background: transparent; }
.creator-follow-group .follow-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.creator-follow-group .follow-toggle-icon { width: 27px; min-width: 0; border-right: 1px solid rgb(255 255 255 / .13); }
.creator-follow-group .follow-toggle:first-of-type .follow-toggle-icon { border-radius: 8px 0 0 8px; }
.creator-follow-group .follow-toggle input:checked + .follow-toggle-icon { color: #fff; background: var(--btn-a); }
.creator-follow-group .follow-toggle:hover .follow-toggle-icon { background: #41424e; }
.creator-follow-group .follow-toggle input:focus-visible + .follow-toggle-icon { outline: 2px solid #fff; outline-offset: -3px; }
.creator-follow-group .follow-toggle svg { width: 13px; height: 13px; fill: currentColor; }
.creator-follow-group .follow-toggle-at { font-size: 15px; font-weight: 700; }
.creator-follow-group .creator-follow-btn {
  min-width: 72px; padding: 0 9px; gap: 4px; border-radius: 0 8px 8px 0;
  color: #fff; background: var(--btn-fill);
}
.creator-follow-group > .creator-follow-btn:first-child,
.creator-follow-group > .creator-card-follow:first-child .creator-follow-btn { border-radius: 8px 0 0 8px; }
.creator-follow-group .creator-follow-btn:hover { filter: brightness(1.04); }
.creator-follow-group .creator-follow-btn .follow-btn-check { width: 12px; height: 12px; }
.creator-follow-group [data-form-message]:empty { display: none; }
.creator-directory-browser .creator-row--compact,
.home-spotlight-card .creator-row--compact {
  --creator-badge-size: 64px;
  display: flex; flex-direction: column; gap: 0; padding: 0; min-width: 0; color: #fff;
  background: #17181d;
}
.creator-directory-browser .creator-row--compact::before,
.home-spotlight-card .creator-row--compact::before {
  content: none;
}
.creator-card-media { position: relative; isolation: isolate; width: 100%; aspect-ratio: calc(var(--creator-thumb-count, 6) * 9) / 16; }
.creator-card-media .creator-profile-art { z-index: -1; }
.creator-card-media::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 35%, #17181d30 55%, #17181de8 88%, #17181d 100%); }
.creator-row--compact .creator-cell-main { min-width: 0; }
.creator-directory-browser .creator-row--compact .creator-card-body,
.home-spotlight-card .creator-row--compact .creator-card-body {
  position: relative; z-index: 2; display: grid; grid-template-columns: var(--creator-badge-size) minmax(0, 1fr);
  gap: 12px; align-items: start; min-width: 0; height: var(--creator-badge-size);
  margin-top: calc(var(--creator-badge-size) / -2); padding: 0 12px 8px; box-sizing: content-box;
}
.creator-directory-browser .creator-row--compact .creator-avatar-frame-link,
.home-spotlight-card .creator-row--compact .creator-avatar-frame-link { grid-column: auto; grid-row: auto; align-self: start; }
.creator-directory-browser .creator-row--compact .creator-avatar-frame,
.home-spotlight-card .creator-row--compact .creator-avatar-frame { position: relative; top: auto; left: auto; width: var(--creator-badge-size); height: var(--creator-badge-size); }
.creator-directory-browser .creator-row--compact .creator-card-identity,
.home-spotlight-card .creator-row--compact .creator-card-identity { display: block; min-width: 0; padding-top: 1px; }
.creator-directory-browser .creator-row--compact .creator-card-line,
.home-spotlight-card .creator-row--compact .creator-card-line { display: block; margin: 0; }
.creator-directory-browser .creator-row--compact .creator-card-line:first-child,
.home-spotlight-card .creator-row--compact .creator-card-line:first-child {
  display: flex; flex-direction: row; align-items: center; flex-wrap: nowrap; justify-content: space-between; gap: 8px;
  min-height: 26px; margin: 0 0 3px;
}
.creator-directory-browser .creator-row--compact .creator-card-name,
.home-spotlight-card .creator-row--compact .creator-card-name {
  flex: 1; min-width: 0; margin: 0; color: #fff; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere;
}
.creator-row--compact .creator-card-name a { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* SUB326 The creator's name covers the card's whole bottom area, padding included; Follow and the unlocked badge stay on top. */
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-card-name a::after { content: ""; position: absolute; inset: 0; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact :is(.creator-follow-group, .creator-owned-badge) { position: relative; z-index: 1; }
/* Cards leave more of the name row to the creator's identity. */
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group { min-height: 26px; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group :is(.follow-toggle, .follow-toggle-icon, .creator-follow-btn) { height: 26px; min-height: 26px; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group :is(.follow-toggle, .follow-toggle-icon) { width: 20px; min-width: 20px; flex: none; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group .creator-card-follow { flex: none; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group .follow-toggle svg { width: 11px; height: 11px; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group .follow-toggle-at { font-size: 13px; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group .creator-follow-btn { min-width: 54px; padding: 0 6px; gap: 0; font-size: 11px; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group .follow-btn-check { display: none; }
.creator-directory-browser .creator-row--compact .creator-card-bio,
.home-spotlight-card .creator-row--compact .creator-card-bio {
  display: block; margin: 0; padding: 0; min-height: 0; max-height: none; overflow: visible;
  white-space: normal; overflow-wrap: anywhere; color: #f4f3f8; font-size: 14px; line-height: 16px;
  text-shadow: 0 1px 3px #000b;
}
.creator-directory-browser .creator-row--compact .creator-card-previews,
.home-spotlight-card .creator-row--compact .creator-card-previews {
  position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--creator-thumb-count, 6), minmax(0, 1fr));
  grid-auto-flow: column; gap: 0; width: 100%; margin: 0; padding: 0; overflow: hidden;
}
.creator-directory-browser .creator-row--compact .creator-card-previews a,
.home-spotlight-card .creator-row--compact .creator-card-previews a { aspect-ratio: 9 / 16; max-height: none; border: 0; border-radius: 0; }
.creator-row--compact .creator-card-previews a[hidden] { display: none; }
.creator-row--compact .creator-owned-badge { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 3px; margin: 0; border: 0; border-radius: 50%; background: var(--btn-fill); color: #fff; }
.creator-row--compact .creator-owned-badge svg { width: 12px; height: 12px; fill: currentColor; }
.creator-row--compact .creator-owned-badge > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.home-spotlight-card { max-width: 640px; }
.home-spotlight-card .creator-row--compact .creator-card-previews { grid-template-columns: repeat(var(--creator-thumb-count, 6), minmax(0, 1fr)); }
.home-spotlight-card .creator-row--compact .creator-card-previews a { width: 100%; max-height: none; }
.home-spotlight-card .creator-row--compact .creator-card-name { font-size: 21px; }
.creator-profile-banner .creator-follow-group { align-self: start; }
/* Same height, corners and label size as the Message button beside it. */
.creator-profile-banner .creator-follow-group { border-radius: 10px; }
.creator-profile-banner .creator-follow-group :is(.follow-toggle, .follow-toggle-icon, .creator-follow-btn) { height: 40px; min-height: 40px; }
.creator-profile-banner .creator-follow-group .follow-toggle,
.creator-profile-banner .creator-follow-group .follow-toggle-icon { width: 38px; }
.creator-profile-banner .creator-follow-group .follow-toggle:first-of-type .follow-toggle-icon { border-radius: 10px 0 0 10px; }
.creator-profile-banner .creator-follow-group .creator-follow-btn { min-width: 102px; padding: 0 13px; border-radius: 0 10px 10px 0; font-size: .966rem; }
.creator-profile-banner .creator-follow-group > .creator-follow-btn:first-child,
.creator-profile-banner .creator-follow-group > .creator-card-follow:first-child .creator-follow-btn { border-radius: 10px 0 0 10px; }
.creator-profile-banner .creator-follow-group .follow-toggle svg { width: 16px; height: 16px; }
.creator-profile-banner-content { align-items: start; }
.creator-profile-banner .creator-header-actions { align-self: start; }
.creator-profile-banner .creator-header-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.creator-profile-banner .creator-header-actions > .creator-message-btn { justify-content: center; text-align: center; }
@media (max-width: 720px) {
  .creator-profile-banner .creator-header-actions { flex-direction: row; justify-content: flex-start; align-items: center; }
  .creator-profile-banner .creator-header-actions { gap: 8px; }
  .creator-profile-banner .creator-header-actions > .btn { width: auto; min-width: 0; padding-inline: 14px; font-size: 14px; }
  .creator-profile-banner .creator-follow-group .follow-toggle,
  .creator-profile-banner .creator-follow-group .follow-toggle-icon { width: 36px; }
  .creator-profile-banner .creator-follow-group .creator-follow-btn { min-width: 0; padding-inline: 12px; font-size: 14px; }
}
.creator-profile-banner .creator-message-btn { min-width: 102px; margin: 0; padding: 8px 13px; background: #37383f; color: #fff; }
.creator-profile-subscriptions .creator-tier-card { min-height: 350px; padding-top: 130px; gap: 8px; }
.creator-profile-subscriptions .creator-tier-card:hover { transform: none; }
.creator-profile-subscriptions .creator-tier-card:is(:hover, :focus-within) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 20px -4px color-mix(in srgb, var(--accent) 28%, transparent);
}
.creator-profile-subscriptions .creator-tier-card:is(.is-recommended, .is-most-popular):is(:hover, :focus-within) {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent), 0 0 30px color-mix(in srgb, var(--accent) 40%, transparent);
}
/* The whole card filters the gallery to its subscription through the title link; Subscribe, What's Included and badge links keep their own clicks. */
.creator-tier-card .creator-tier-action :is(a, button:not(:disabled)) { transform: none; filter: none; }
.creator-tier-card .creator-tier-card-head--link { position: static; }
.creator-tier-card .creator-tier-card-head--link::before {
  content: ""; position: absolute; z-index: 1; inset: 0; border-radius: inherit; cursor: pointer;
}
.creator-tier-card :is(.creator-tier-action, .creator-tier-badge-link, .creator-tier-included) { position: relative; z-index: 2; }
.creator-tier-card .creator-tier-included[open] { position: static; }
.creator-tier-card:has(.creator-tier-card-head--link:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.creator-tier-card .creator-tier-card-head--link:focus-visible { outline: none; }
.creator-profile-subscriptions .creator-tier-card.is-selected,
.creator-profile-subscriptions .creator-tier-card.is-selected:is(:hover, :focus-within) {
  /* SUB185/SUB251 The gallery filter: the card's own edge turns dashed, a soft tint of the creator's colour laid over the border. */
  outline: 2px dashed color-mix(in srgb, var(--accent) 80%, #fff); outline-offset: -2px;
}
/* What's Included lies over the card's own background, darkened, with the card's other content hidden beneath it. */
.creator-tier-card:has(> .creator-tier-included[open]) > :not(.creator-tier-art, .creator-tier-included) { visibility: hidden; }
.creator-tier-card > .creator-tier-included[open] > summary { visibility: hidden; }
/* The stretched CTA must stay static, so the Most popular sweep is a moving background layer. */
.creator-profile-subscriptions .creator-tier-card.is-most-popular .creator-tier-action .creator-tier-cta {
  --tier-cta-sweep: linear-gradient(110deg, transparent 40%, rgb(255 255 255 / .1) 50%, transparent 60%);
  position: static; overflow: visible; background-image: var(--tier-cta-sweep), var(--btn-fill);
  background-size: 300% 100%, 100% 100%; background-repeat: no-repeat; animation: creator-tier-cta-sweep 5s ease-in-out infinite;
}
.creator-tier-card .creator-tier-action .creator-tier-cta.btn-shine::after { display: none; }
@keyframes creator-tier-cta-sweep { 0%, 55% { background-position: 100% 0, 0 0; } 85%, 100% { background-position: 0 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .creator-profile-subscriptions .creator-tier-card.is-most-popular .creator-tier-action .creator-tier-cta { animation: none; background-position: 100% 0, 0 0; } }
.creator-profile-subscriptions .creator-tier-amount { font-size: 30px; }
.creator-profile-subscriptions .creator-tier-shelf-track:has(> .creator-tier-card:nth-child(2):last-child) > .creator-tier-card { flex-basis: max(300px, calc((100cqw - 20px) / 2)); }
.creator-profile-subscriptions .creator-tier-shelf-track:has(> .creator-tier-card:nth-child(2):last-child) > .creator-tier-card:last-child { padding-right: 18px; }
@media (max-width: 720px) {
  .creator-profile-subscriptions .creator-tier-shelf-track:has(> .creator-tier-card:nth-child(2):last-child) > .creator-tier-card { flex-basis: min(340px, 100cqw); }
}
.creator-tier-included { position: static; margin: 0; }
.creator-tier-included > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px;
  padding: 6px 10px; border-radius: 8px; background: #ffffff19; color: #fff; cursor: pointer;
  font-size: 13px; font-weight: 600; list-style: none;
}
.creator-tier-included > summary::-webkit-details-marker { display: none; }
.creator-tier-included > summary svg { width: 16px; height: 16px; fill: currentColor; }
.creator-tier-rules-overlay {
  position: absolute; z-index: 5; inset: 0; padding: 10px; border-radius: inherit;
  background: linear-gradient(180deg, rgb(6 7 10 / .6), rgb(6 7 10 / .82)); color: #f4f4f7; overflow-y: auto; overscroll-behavior: contain; backdrop-filter: blur(2px);
}
/* SUB186 Public cards: a layer over the page placed on its card by app.js; it may run below the card and never scrolls. */
.creator-tier-rules-overlay[popover] {
  position: fixed; inset: auto; box-sizing: border-box; height: auto; max-height: none; margin: 0; overflow: visible;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border-strong)); background: rgb(8 9 13 / .72);
  box-shadow: 0 18px 40px rgb(0 0 0 / .55); backdrop-filter: blur(14px);
}
.creator-tier-rules-overlay[popover]::backdrop { display: none; }
.creator-tier-rules-overlay > button.app-window-close.app-window-close.creator-tier-rules-close { position: absolute; z-index: 2; top: 10px; right: 10px; }
/* SUB167 What's Included: one text panel with its own small head; the close button floats over the top corner. */
.creator-tier-rules-body { padding: 10px 12px; border-radius: 12px; background: rgb(8 9 13 / .58); backdrop-filter: blur(10px); }
.creator-tier-rules-title { min-height: 20px; margin: 0 0 10px; padding-right: 48px; }
.creator-tier-rules-overlay .tier-access-head { font-size: 13.2px; }
.creator-tier-rules-overlay .tier-access-box { gap: 6px; border: 0; padding: 0; border-radius: 0; background: none; backdrop-filter: none; }
.creator-tier-rules-overlay .tier-access-addons-head { margin-top: 8px; }
.creator-background-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.creator-background-option { position: relative; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: var(--surface); cursor: pointer; }
.creator-background-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.creator-background-option img { display: block; width: 100%; height: 90px; object-fit: cover; }
.creator-background-option input { position: absolute; top: 8px; right: 8px; accent-color: var(--accent); }
.creator-background-option span { display: block; padding: 7px 10px; font-size: 14px; }
.creator-background-option[hidden] { display: none; }
.creator-profile-page .creator-gallery-panel { container-type: inline-size; }
.creator-profile-page .creator-gallery-panel .content-directory-filters {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center;
  gap: 10px; margin: 0 0 12px; padding: 0; border: 0; border-radius: 0; background: none;
}
.creator-profile-page .creator-gallery-panel .content-directory-search { grid-column: span 6; min-width: 0; margin: 0; }
.creator-profile-page .creator-gallery-panel .content-directory-search > label {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.creator-profile-page .creator-gallery-panel .content-directory-search-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.creator-profile-page .creator-gallery-panel .content-directory-search-control .form-control { width: 100%; min-width: 0; max-width: none; padding-left: 34px; }
.creator-profile-page .creator-gallery-panel .content-directory-search-control .btn { flex: none; width: auto; min-height: 40px; padding: 8px 14px; border-radius: 9px; }
.creator-profile-page .creator-gallery-panel .content-directory-filter-grid,
.creator-profile-page .creator-gallery-panel .content-directory-sort-controls { display: contents; }
.creator-profile-page .creator-gallery-panel .content-directory-filter-grid > label,
.creator-profile-page .creator-gallery-panel .content-directory-sort-controls > label {
  display: block; grid-column: span 3; min-width: 0; margin: 0; padding: 0; font-size: 0; line-height: 0;
}
.creator-profile-page .creator-gallery-panel .content-directory-sort-controls > label:first-child { grid-column: span 4; }
.creator-profile-page .creator-gallery-panel .content-directory-sort-controls > .content-directory-invert-sort {
  grid-column: span 2; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; min-height: 40px; padding: 8px 9px; border: 0; border-radius: 9px;
  background: var(--surface-raised); color: var(--text-soft); font-size: 14px; line-height: 1; cursor: pointer;
}
.creator-profile-page .creator-gallery-panel .content-directory-filters .form-select,
.creator-profile-page .creator-gallery-panel .content-directory-filters .form-control {
  width: 100%; min-width: 0; min-height: 40px; height: 40px; border-radius: 9px;
  background-color: var(--surface-raised); font-size: 15px; line-height: 1.3; field-sizing: fixed;
}
.creator-profile-page .creator-gallery-panel .content-directory-invert-sort input { accent-color: var(--accent); }
.creator-profile-page .creator-gallery-panel .content-directory-filter-footer { grid-column: 1 / -1; }
.creator-profile-page .creator-filter-bar { align-items: center; justify-content: space-between; margin-bottom: 18px; }
.creator-profile-page .creator-filter-group--actions { flex-direction: column; justify-content: center; }
.creator-profile-page .creator-filter-group--categories { justify-self: start; width: fit-content; }
.creator-profile-page .creator-filter-group--tiers { justify-self: end; justify-content: flex-start; width: fit-content; }
.creator-profile-page .creator-filter-bar .content-directory-pagination { margin: 0; padding: 0; gap: 4px; }
.creator-release-creator > .creator-avatar-frame--chip,
.creator-avatar-frame--chip { display: inline-block; position: relative; flex: none; width: 22px; height: 22px; }
.sidebar-discovery .creator-release-creator > .creator-avatar-frame--chip { width: 28px; height: 28px; }
html.sidebar-compact .sidebar-discovery .creator-release-creator > .creator-avatar-frame--chip { display: inline-block; }
.sidebar-meta-creator { display: flex; align-items: center; gap: 11px; }
@container (max-width: 720px) {
  .creator-profile-page .creator-gallery-panel .content-directory-search { grid-column: 1 / -1; }
  .creator-profile-page .creator-gallery-panel .content-directory-filter-grid > label { grid-column: span 6; }
  .creator-profile-page .creator-gallery-panel .content-directory-sort-controls > label:first-child { grid-column: span 8; }
  .creator-profile-page .creator-gallery-panel .content-directory-sort-controls > .content-directory-invert-sort { grid-column: span 4; }
}
@media (max-width: 1100px) {
  .creator-directory-browser .creator-table--cards tbody { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .creator-directory-browser .creator-row--compact .creator-card-body,
  .home-spotlight-card .creator-row--compact .creator-card-body { gap: 8px; padding-inline: 8px; }
  .creator-directory-browser .creator-row--compact .creator-card-name { font-size: 17px; }
  .creator-background-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Creator appearance: image strength and optional vignette are creator-controlled. */
.creator-directory-browser .creator-row--compact,
.home-spotlight-card .creator-row--compact { background: #17181d; }
.creator-directory-browser .creator-row--compact::before,
.home-spotlight-card .creator-row--compact::before,
.creator-profile-banner::before { background: none; }
.creator-profile-art { pointer-events: none; overflow: hidden; }
.creator-profile-art img { opacity: var(--creator-art-opacity, 1); filter: none; }
.creator-profile-art img.is-creator-art-ready { animation: creator-art-reveal .2s ease; }
@keyframes creator-art-reveal { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .creator-profile-art img.is-creator-art-ready { animation: none; } }
.creator-profile-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 25%, #000 100%); opacity: var(--creator-art-vignette, 0); }
/* SUB152 Subscription card backgrounds take the profile banner's opacity and vignette. */
.creator-tier-art img { opacity: var(--creator-art-opacity, 1); }
.creator-tier-art::before,
.creator-tier-art::after { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at center, transparent 25%, #000 100%); pointer-events: none; }
.creator-tier-art::before { opacity: clamp(0, var(--creator-art-vignette, 0), 1); }
.creator-tier-art::after { opacity: clamp(0, calc(var(--creator-art-vignette, 0) - 1), 1); }
.creator-card-body, .creator-profile-banner-content { text-shadow: 0 1px 5px #000b; }
.creator-badge-field { display: grid; gap: 6px; margin: 12px 0; text-align: left; font-size: 15px; }
.creator-badge-field .form-control { min-width: 0; }
.creator-background-adjustments { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; margin-top: 22px; }
.creator-background-adjustments label { display: grid; gap: 10px; font-size: 15px; }
.creator-background-adjustments output { float: right; color: var(--text-soft); }
.creator-background-adjustments input[type="range"] { width: 100%; accent-color: var(--accent); }
.creator-background-adjustments .creator-vignette-toggle { display: flex; align-items: center; gap: 8px; }
.creator-highlight-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.creator-highlight-slots label { display: grid; gap: 8px; min-width: 0; font-size: 15px; }
.creator-highlight-slots .form-select { width: 100%; min-width: 0; }
.creator-profile-previews .creator-table--cards tbody { display: grid; grid-template-columns: minmax(0, 1fr); }
.creator-profile-previews .creator-row--compact { position: relative; isolation: isolate; overflow: hidden; }
@media (max-width: 700px) {
  .creator-background-adjustments { grid-template-columns: 1fr; gap: 16px; }
  .creator-highlight-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.creator-badge-swatches { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 14px; }
.creator-badge-swatch:hover, .creator-badge-swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.creator-profile-previews .home-spotlight-card { max-width: 620px; }
.creator-profile-previews .creator-row--compact .creator-card-previews { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; }
.creator-profile-banner { position: relative; isolation: isolate; overflow: hidden; }
.creator-profile-previews .creator-profile-banner { min-height: 240px; display: flex; align-items: flex-end; padding: 0; border-radius: 18px; }
.creator-profile-previews .creator-profile-banner .creator-profile-banner-content { padding: 24px; }
@media (min-width: 1000px) { .creator-profile-primary-grid { grid-template-columns: 220px minmax(300px, 1fr) 160px; gap: 24px; } }
.creator-avatar-crop-editor { width: 100%; max-width: 100%; box-sizing: border-box; }

/* SUB186 One shelf moves alongside the creator when one complete card fits. */
.creator-profile-feature { container: creator-header / inline-size; }
.creator-profile-header-layout { display: grid; gap: 28px; min-width: 0; }
.creator-profile-header-layout > .creator-profile-banner { min-height: 170px; display: flex; align-items: center; padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: none; isolation: isolate; }
@container creator-header (min-width: 840px) {
  /* SUB186 The subscriptions column is as wide as its cards (380px each, 12px apart, 12px edge), up to two thirds; the creator text takes the rest. */
  .creator-profile-feature--subscriptions-card .creator-profile-header-layout:has(.creator-profile-subscriptions) { --subs-width: 66%; grid-template-columns: minmax(440px, 1fr) minmax(0, var(--subs-width)); gap: 0 16px; align-items: stretch; }
  /* Cards are counted among themselves: each card's Subscribe window sits between them in the row. */
  .creator-profile-feature--subscriptions-card .creator-profile-header-layout:has(.creator-tier-shelf-track > .creator-tier-card:nth-child(1 of .creator-tier-card):nth-last-child(1 of .creator-tier-card)) { --subs-width: 392px; }
  .creator-profile-feature--subscriptions-card .creator-profile-header-layout:has(.creator-tier-shelf-track > .creator-tier-card:nth-child(2 of .creator-tier-card):nth-last-child(1 of .creator-tier-card)) { --subs-width: min(66%, 784px); }
  .creator-profile-feature--subscriptions-card .creator-profile-header-layout:has(.creator-tier-shelf-track > .creator-tier-card:nth-child(3 of .creator-tier-card):nth-last-child(1 of .creator-tier-card)) { --subs-width: min(66%, 1176px); }
  .creator-profile-feature--subscriptions-card .creator-profile-banner { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-columns: subgrid; overflow: hidden; }
  /* The profile picture is as tall as the creator area beside the subscriptions; app.js keeps --creator-avatar-size equal to that height. */
  .creator-profile-feature--subscriptions-card .creator-profile-banner-content { --creator-avatar-size: 120px; position: relative; grid-column: 1; flex-direction: column; align-items: stretch; justify-content: center; gap: 10px; height: 100%; padding: 16px 20px 16px calc(36px + var(--creator-avatar-size)); }
  .creator-profile-feature--subscriptions-card .creator-profile-banner .creator-user-summary { display: block; flex: none; }
  .creator-profile-feature--subscriptions-card .creator-profile-banner .creator-user-summary > .creator-avatar-frame-link { position: absolute; top: 50%; left: 20px; transform: translateY(-50%); }
  .creator-profile-feature--subscriptions-card .creator-avatar-frame--header { width: var(--creator-avatar-size); height: var(--creator-avatar-size); }
  .creator-profile-feature--subscriptions-card .page-header > .page-kicker { font-size: 28px; }
  .creator-profile-feature--subscriptions-card .creator-profile-banner .creator-description { font-size: 13px; line-height: 1.4; }
  .creator-profile-feature--subscriptions-card .creator-profile-banner .creator-stats-row { font-size: 12px; gap: 4px 12px; }
  .creator-profile-feature--subscriptions-card .creator-profile-banner .creator-header-actions { justify-content: flex-start; flex-wrap: wrap; }
  .creator-profile-feature--subscriptions-card .creator-profile-banner .btn { min-height: 34px; }
  .creator-profile-feature--subscriptions-card .creator-profile-subscriptions { grid-column: 2; grid-row: 1; z-index: 1; align-self: center; justify-self: end; width: 100%; min-width: 0; padding: 12px 12px 12px 0; }
  .creator-profile-feature--subscriptions-card .creator-profile-subscriptions > h2 { display: none; }
  .creator-profile-feature--subscriptions-card .creator-tier-shelf { width: 100%; max-width: none; margin: 0; }
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-viewport { margin: -3px; padding: 3px; scrollbar-width: none; }
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-viewport::-webkit-scrollbar { display: none; height: 0; }
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-track { gap: 12px; }
  /* SUB186 Each card is only as tall as its text; What's Included and Subscribe share the bottom row. */
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-track > .creator-tier-card,
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-track:has(> .creator-tier-card:nth-child(2):last-child) > .creator-tier-card,
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-track:has(> .creator-tier-card:nth-child(2):last-child) > .creator-tier-card:last-child {
    box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; align-items: start; gap: 4px 8px;
    flex: 0 0 380px; width: 380px; height: auto; min-height: 0; max-height: none; padding: 12px;
  }
  .creator-profile-feature--subscriptions-card .creator-tier-card::before { background: linear-gradient(180deg, rgb(4 5 8 / .7), rgb(4 5 8 / .92)); }
  /* No hover or focus effects here: cards never move, and glows are a thin ring that fits the row. */
  .creator-profile-feature--subscriptions-card .creator-tier-card,
  .creator-profile-feature--subscriptions-card .creator-tier-card:is(:hover, :focus-within) { transform: none; transition: none; box-shadow: none; }
  .creator-profile-feature--subscriptions-card .creator-tier-card:is(.is-recommended, .is-most-popular),
  .creator-profile-feature--subscriptions-card .creator-tier-card:is(.is-recommended, .is-most-popular):is(:hover, :focus-within) { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
  .creator-profile-feature--subscriptions-card .creator-tier-ribbons { position: absolute; top: 8px; right: 8px; left: auto; flex-direction: column; align-items: flex-end; gap: 2px; }
  .creator-profile-feature--subscriptions-card .creator-tier-ribbon { padding: 2px 5px; font-size: 9px; line-height: 10px; }
  .creator-profile-feature--subscriptions-card .creator-tier-card-head { grid-area: 1 / 1 / 2 / -1; }
  .creator-profile-feature--subscriptions-card .creator-tier-card:has(.creator-tier-ribbons) .creator-tier-card-head { padding-right: 92px; }
  .creator-profile-feature--subscriptions-card .creator-tier-card:has(.creator-tier-ribbon:nth-child(2)) .creator-tier-card-head { min-height: 30px; }
  .creator-profile-feature--subscriptions-card .creator-tier-card:has(.creator-tier-ribbon:nth-child(3)) .creator-tier-card-head { min-height: 46px; }
  .creator-profile-feature--subscriptions-card .creator-tier-card h3.creator-tier-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 17px; line-height: 20px; }
  .creator-profile-feature--subscriptions-card .creator-tier-description { grid-area: 2 / 1 / 3 / -1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-height: 36px; overflow: hidden; font-size: 13px; line-height: 18px; }
  .creator-profile-feature--subscriptions-card .creator-tier-facts { grid-area: 3 / 1 / 4 / -1; margin: 0 0 4px; min-height: 16px; }
  .creator-profile-feature--subscriptions-card .creator-tier-facts .creator-tier-price { display: none; }
  .creator-profile-feature--subscriptions-card .creator-tier-release-count { font-size: 12px; line-height: 16px; }
  .creator-profile-feature--subscriptions-card .creator-tier-included { grid-area: 4 / 1; align-self: end; }
  .creator-profile-feature--subscriptions-card .creator-tier-included > summary { min-height: 34px; padding: 7px 10px; font-size: 13px; line-height: 20px; white-space: nowrap; }
  .creator-profile-feature--subscriptions-card .creator-tier-badges { display: none; }
  .creator-profile-feature--subscriptions-card .creator-tier-action { grid-area: 4 / 2; align-self: end; min-width: 0; margin: 0; padding-top: 0; }
  .creator-profile-feature--subscriptions-card .creator-tier-card:not(:has(> .creator-tier-included)) > .creator-tier-action { grid-column: 1 / -1; }
  .creator-profile-feature--subscriptions-card :is(.creator-tier-cta, .creator-tier-unlocked, .creator-tier-disabled) { min-height: 34px; padding: 7px 10px; font-size: 13px; line-height: 20px; white-space: nowrap; }
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-arrow { top: 50%; transform: translateY(-50%); width: 32px; height: 36px; box-shadow: 0 2px 12px #0009; }
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-arrow--prev { left: -8px; right: auto; }
  .creator-profile-feature--subscriptions-card .creator-tier-shelf-arrow--next { right: -8px; }
}

/* SUB189 The Edit Subscription card is the desktop card on the creator page: 380px, as tall as its text, What's Included and Subscribe side by side, the price set in the Subscribe button. */
.tier-rules-preview .creator-tier-card.tier-rules-preview-tier { box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; align-items: start; gap: 4px 8px; width: 380px; max-width: 100%; height: auto; min-height: 0; padding: 12px; transform: none; transition: none; box-shadow: none; }
.tier-rules-preview .tier-rules-preview-tier::before { background: linear-gradient(180deg, rgb(4 5 8 / .7), rgb(4 5 8 / .92)); }
.tier-rules-preview .tier-rules-preview-tier:is(.is-recommended, .is-most-popular) { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-ribbons { position: absolute; top: 8px; right: 8px; left: auto; flex-direction: column; align-items: flex-end; gap: 2px; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-ribbon { padding: 2px 5px; font-size: 9px; line-height: 10px; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-card-head { grid-area: 1 / 1 / 2 / -1; }
.tier-rules-preview .tier-rules-preview-tier:has(.creator-tier-ribbons:not([hidden])) .creator-tier-card-head { padding-right: 92px; }
.tier-rules-preview .tier-rules-preview-tier h3.creator-tier-title { font-size: 17px; line-height: 20px; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-description { grid-area: 2 / 1 / 3 / -1; font-size: 13px; line-height: 18px; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-facts { grid-area: 3 / 1 / 4 / -1; margin: 0 0 4px; min-height: 16px; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-facts .creator-tier-price { display: none; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-release-count { font-size: 12px; line-height: 16px; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-included { grid-area: 4 / 1; align-self: end; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-included > summary { min-height: 34px; padding: 7px 10px; font-size: 13px; line-height: 20px; white-space: nowrap; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-badges { display: none; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-action { grid-area: 4 / 2; align-self: end; min-width: 0; margin: 0; padding-top: 0; }
.tier-rules-preview .tier-rules-preview-tier:has(> .creator-tier-included[hidden]) > .creator-tier-action { grid-column: 1 / -1; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-cta { min-height: 34px; padding: 4px 10px; font-size: 13px; line-height: 20px; white-space: nowrap; flex-wrap: nowrap; }
.tier-rules-preview .tier-rules-preview-tier .creator-tier-cta .tier-card-price-input { margin: 0 2px; }

/* SUB320 Shared follow split button and delivery choices. */
.creator-follow-group[data-follow-group] {
  --follow-height: 30px;
  --follow-radius: 8px;
  border-radius: var(--follow-radius);
  background: var(--btn-fill);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / .24);
}
.creator-follow-group[data-follow-group][data-following="1"] { background: #292a32; }
.creator-follow-group[data-follow-group] > .creator-card-follow { flex: none; }
.creator-follow-group[data-follow-group] :is(.creator-card-follow > .creator-follow-btn, a.creator-follow-btn, .follow-menu-toggle) {
  position: relative;
  height: var(--follow-height);
  min-height: var(--follow-height);
  background: transparent;
  box-shadow: none;
  transform: none;
}
.creator-follow-group[data-follow-group] :is(.creator-card-follow > .creator-follow-btn, a.creator-follow-btn) {
  border-radius: var(--follow-radius) 0 0 var(--follow-radius);
}
.creator-follow-group[data-follow-group] .follow-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; min-width: 28px;
  margin: 0; padding: 0; border: 0; border-inline-start: 1px solid rgb(255 255 255 / .2);
  border-radius: 0 var(--follow-radius) var(--follow-radius) 0; color: #fff;
}
.creator-follow-group[data-follow-group] :is(.creator-follow-btn, .follow-menu-toggle):hover { background: rgb(255 255 255 / .08); }
.creator-follow-group[data-follow-group] :is(.creator-follow-btn, .follow-menu-toggle):focus-visible { z-index: 1; }
.creator-follow-group .follow-menu-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.creator-follow-group .follow-menu-toggle:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
:is(.creator-directory-browser, .home-spotlight-card) .creator-row--compact .creator-follow-group[data-follow-group] { --follow-height: 26px; }
.creator-profile-banner .creator-follow-group[data-follow-group] { --follow-height: 40px; --follow-radius: 10px; }
.creator-profile-banner .creator-follow-group .follow-menu-toggle { width: 34px; min-width: 34px; }
.creator-directory-browser .creator-row--compact .creator-card-body:has(.creator-paypal-status) {
  height: auto;
  min-height: var(--creator-badge-size);
}
.creator-card-line .creator-paypal-status { font-size: .72rem; margin-bottom: 3px; }
.creator-profile-top .creator-paypal-status { display: inline-block; margin-bottom: 4px; }
@media (max-width: 360px) {
  .creator-row--compact:has(.creator-paypal-status) .creator-card-name a { white-space: normal; }
}
.follow-options-panel { display: grid; gap: 3px; width: 224px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 6px; background: var(--surface-raised, #202126); border-color: var(--border); }
.follow-options-panel[hidden] { display: none; }
.follow-channel-row { display: flex; align-items: center; gap: 12px; margin: 0; padding: 11px 12px; border-radius: 8px; color: var(--text); cursor: pointer; white-space: normal; text-align: left; }
.follow-channel-row:hover { background: rgb(255 255 255 / .05); }
.follow-channel-row:focus-within { outline: 2px solid var(--accent-strong); outline-offset: -2px; }
.follow-channel-icon { display: inline-flex; flex: 0 0 20px; width: 20px; height: 20px; align-items: center; justify-content: center; color: var(--text-soft); }
.follow-channel-icon svg { display: block; width: 20px; height: 20px; fill: currentColor; }
.follow-channel-icon svg:has([fill="none"][stroke]) { fill: none; }
.follow-channel-copy { display: grid; flex: 1; min-width: 0; gap: 5px; }
.follow-channel-label { font-size: 14px; font-weight: 600; line-height: 1.3; }
.follow-channel-description { font-size: 13px; line-height: 1.5; color: var(--text-soft); }
.follow-channel-row .settings-switch { flex: none; margin-left: auto; }
.follow-channel-row input[type="checkbox"] { appearance: none; position: relative; width: 19px; height: 19px; margin: 0; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--field, #17181d); cursor: pointer; }
.follow-channel-row input[type="checkbox"]:checked { background: var(--btn-a, var(--accent)); border-color: var(--btn-a, var(--accent)); }
.follow-channel-row input[type="checkbox"]:checked::after { content: ''; position: absolute; inset: 3px 5px 5px 4px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.follow-channel-row:has(input:checked) .follow-channel-icon { color: var(--accent-strong); }.follow-channel-row:has(input:disabled) { opacity: .65; cursor: default; }
dialog[data-modal].follow-choice-modal { width: min(520px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); }
.follow-choice-modal .app-modal-head h2 { margin: 0; font-size: 23px; line-height: 1.3; }
.follow-choice-modal .follow-channel-row { align-items: start; padding: 14px 10px; }
.follow-choice-modal .follow-channel-row .settings-switch { padding-top: 1px; }
.follow-choice-modal .follow-channel-row + .follow-channel-row { border-top: 1px solid var(--border); border-radius: 0; }
.follow-choice-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.follow-choice-actions > .btn { width: auto; }
.follow-choice-actions [data-follow-unfollow] { margin-inline-end: auto; }
.follow-choice-actions [data-follow-unfollow][hidden] { display: none; }
.follow-choice-modal [data-form-message]:empty { display: none; }

/* Round 7 reskin: content screens. Loaded after app-foundation.css. */

/* Public Content uses balanced rows of compact controls. */
[data-public-content-directory] { gap: 18px; container-type: inline-size; }
[data-public-content-directory] > .content-directory-header { margin: 0; }
[data-public-content-directory] .content-directory-header h1 { margin: 0; font-size: 34px; }
[data-public-content-directory] .content-directory-header .page-header-note { margin: 12px 0 0; }
[data-content-listing]:has(> .content-directory-filters--compact) { container-type: inline-size; }
.content-directory-filters--compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: none;
}
.content-directory-filters--compact .content-directory-search { grid-column: 1 / -1; min-width: 0; max-width: none; }
.content-directory-filters--compact .content-directory-filter-grid,
.content-directory-filters--compact .content-directory-sort-controls { display: contents; }
.content-directory-filters--compact .content-directory-filter-grid label { min-width: 0; gap: 0; font-size: 14px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.content-directory-filters--compact .content-directory-search-control { display: flex; align-items: center; gap: 6px; }
.content-directory-filters--compact .content-directory-search-control .form-control { width: 100%; max-width: none; padding-left: 32px; }
.content-directory-filters--compact .content-directory-search-control > span { left: 10px; top: 50%; }
.content-directory-filters--compact .content-directory-search-control .form-control,
.content-directory-filters--compact .content-directory-search-control .btn-key-action,
.content-directory-filters--compact .form-select { min-height: 40px; height: 40px; font-size: 14px; }
.content-directory-filters--compact .content-directory-search-control .btn-key-action { flex: none; width: auto; padding: 6px 12px; }
.content-directory-filters--compact .form-select { width: 100%; min-width: 0; field-sizing: fixed; text-overflow: ellipsis; }
.content-directory-filters--compact .content-directory-filter-grid .content-directory-invert-sort { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; }
.content-directory-filters--compact .content-directory-filter-footer { grid-column: 1 / -1; min-height: 0; margin: 0; }
.content-directory-filters--compact .content-directory-filter-footer:has([data-content-directory-status]:empty):not(:has(a)) { display: none; }
[data-public-content-directory] .content-directory-results { display: block; margin: 0; }
[data-public-content-directory] .content-directory-header-tools--desktop { margin: 0 0 18px; }
[data-public-content-directory] .content-directory-total { order: -1; gap: 5px; margin-right: auto; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-raised); font-size: 13px; }
[data-public-content-directory] .content-directory-total strong { font-size: inherit; }
[data-public-content-directory] .content-directory-list { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
@container (min-width: 760px) {
  .content-directory-filters--compact { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .content-directory-filters--compact .content-directory-search { grid-column: span 6; }
  .content-directory-filters--compact .content-directory-filter-grid label { grid-column: span 2; }
}
@container (min-width: 1500px) {
  .content-directory-filters--compact { grid-template-columns: minmax(420px, 2fr) repeat(6, minmax(145px, 1fr)) auto; }
  .content-directory-filters--compact .content-directory-search,
  .content-directory-filters--compact .content-directory-filter-grid label { grid-column: auto; }
}
.content-directory-list-creator .creator-release-creator { min-width: 0; }
.content-directory-list-creator .creator-release-creator > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Release detail uses the shared creator controls and release cards. */
.release-page { --release-strip-height: clamp(440px, 43vw, 620px); position: relative; isolation: isolate; gap: 24px; }
.release-page::before { content: ""; position: absolute; z-index: -1; inset: -24px calc(-1 * var(--gutter, 24px)) auto; height: 760px; pointer-events: none; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent); }
.release-page > .creator-content-filters { margin: 0; }
/* Three tracks: previews (1-2) beside fixed purchase details (3); below, About (1) and
   Files (2-3) split the width in half. Track 2 = 50% - 460px - 1.5 gaps. */
.release-page .creator-content-section { --release-side: 460px; display: grid; grid-template-columns: minmax(0, 1fr) max(0px, calc(50% - var(--release-side) - 1.5 * 24px)) var(--release-side); gap: 24px; align-items: start; min-width: 0; }
.release-page .creator-content-detail,
.release-page .creator-content-version-sections { display: contents; }
.release-page [data-version-part][hidden] { display: none !important; }
.release-summary { grid-column: 3; grid-row: 1; display: grid; gap: 20px; min-width: 0; }
.release-meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.release-meta-row time { margin-left: auto; font-size: 14px; color: var(--text-soft); }
.release-page .creator-content-title-heading { margin: 0; }
.release-page .creator-content-title-row h1 { font-size: clamp(34px, 3vw, 48px); line-height: 1.15; font-weight: 800; letter-spacing: -.035em; text-transform: none; margin: 0; color: var(--text); overflow-wrap: anywhere; }
.release-title-link { color: inherit; text-decoration: none; }
.release-title-link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.fit-text-line { white-space: nowrap; overflow-wrap: normal !important; max-width: 100%; min-width: 0; }
.release-title-version { font-size: .58em; font-weight: 400; color: var(--text-soft); letter-spacing: -.01em; margin-left: .4em; white-space: nowrap; }
.release-page .creator-content-versions { margin: 0; }
.release-page .creator-version-chip { border-radius: 8px; min-height: 34px; background: var(--surface-raised); }
.release-page .creator-version-chip.is-active { background: var(--btn-fill); }
.release-creator-row { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
/* SUB316 The creator's name covers the whole card, padding included; the follow controls stay on top. */
.release-creator-name > a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.release-creator-row .creator-follow-group { position: relative; z-index: 1; }
.release-creator-row .creator-avatar-frame--header { width: 46px; height: 46px; flex: 0 0 46px; }
.release-creator-name { display: grid; gap: 3px; flex: 1; min-width: 50px; }
.release-creator-name > a { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; }
.release-creator-name > span { font-size: 13px; color: var(--text-soft); white-space: nowrap; }
.release-creator-row .creator-follow-group { margin-left: auto; }
.release-buy-card { padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.release-buy-card .creator-content-heading-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 0; margin: 0; width: 100%; }
.release-buy-card .creator-content-version-part { display: block; }
.release-buy-card .creator-content-purchase { width: 100%; display: grid; gap: 16px; }
.release-price-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; }
.release-buy-card .creator-content-buy-price { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.04em; color: var(--text); }
.release-price-line > span { font-size: 14px; color: var(--text-soft); }
.release-buy-card .creator-content-buy-price > small { margin-left: 2px; font-size: 17px; font-weight: 500; letter-spacing: 0; color: var(--text-soft); }
/* All versions: the model's monthly subscription, under the one-time unlock. */
.release-buy-card .creator-content-family:not(:first-child) { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.release-buy-card .creator-content-family .creator-content-access-status { justify-self: start; }
.release-buy-card .creator-content-buy { width: 100%; min-height: 48px; border-radius: 10px; font-size: 17px; font-weight: 700; }
.release-buy-card .creator-content-also-in { display: grid; gap: 14px; margin-top: 18px; }
.release-buy-card .creator-content-also-in-label { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-soft); text-transform: none; }
.release-buy-card .creator-content-also-in-label::before,
.release-buy-card .creator-content-also-in-label::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.release-buy-card .release-subscription-card { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 12px; padding: 18px; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border-strong)); border-radius: 18px; background: #101116; color: #fff; }
.release-subscription-card::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgb(4 5 8 / .45), rgb(4 5 8 / .88)); }
.release-buy-card .release-subscription-card:is(:hover, :focus-within) { border-color: var(--accent); box-shadow: 0 0 20px -4px color-mix(in srgb, var(--accent) 28%, transparent); }
.release-subscription-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: inherit; text-decoration: none; }
.release-subscription-link:hover { color: inherit; }
.release-subscription-card .creator-tier-action { margin: 0; }
.release-subscription-card .creator-tier-cta { width: 100%; min-height: 44px; }
.release-subscription-addon { color: #dddde5; font-size: 13px; }
.release-subscription-text { display: grid; gap: 5px; min-width: 0; }
.release-subscription-text > span { color: #dddde5; font-size: 12px; }
.release-subscription-text > strong { font-size: 17px; }
.release-subscription-text > small { color: var(--text-soft); font-size: 13px; line-height: 1.4; }
.release-subscription-price { font-size: 24px; font-weight: 750; white-space: nowrap; }
.release-subscription-price > small { display: block; text-align: right; font-size: 12px; color: #dddde5; font-weight: 400; }
.release-purchases-paused { margin: 0.75rem 0 0; color: var(--text-soft); }
.release-preview-panel { grid-column: 1 / 3; grid-row: 1; min-width: 0; }
.release-preview-panel > .section-heading { margin: 0 0 12px; }
.release-page .creator-content-preview-gallery { min-width: 0; }
.release-page .creator-content-preview-grid { display: flex; align-items: stretch; gap: 12px; height: var(--release-strip-height); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-y; cursor: default; border-radius: 16px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 5%, #000 94%, transparent); }
.release-page .creator-content-preview-grid::-webkit-scrollbar { display: none; }
.release-page .creator-content-preview-grid[data-drag-carousel-ready] { overflow: hidden; }
.release-page .creator-content-preview-grid > .drag-carousel-track { height: 100%; gap: 12px; }
.release-page .creator-content-preview-item { flex: 0 0 auto; width: auto; height: 100%; aspect-ratio: var(--release-media-ratio); margin: 0; border-radius: 16px; overflow: hidden; background: var(--surface); }
.release-page .creator-content-preview-item > :is(img, video) { width: 100%; height: 100%; max-height: none; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.release-page :is(.release-about, .release-technical, .creator-content-files) { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.release-page :is(.release-about, .release-technical) > h3,
.release-page .creator-content-files h3 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; text-transform: none; color: var(--text); margin: 0 0 16px; }
.release-about { grid-column: 1; grid-row: 2; }
.release-page .creator-content-body { max-width: none; margin: 0; font-size: 16px; line-height: 1.7; }
.release-page .creator-content-files { grid-column: 2 / 4; grid-row: 2 / span 2; }
.release-page .creator-content-files > .section-heading { margin: 0 0 16px; }
.release-page .creator-content-files-table-wrap { margin: 0; border: 0; overflow: visible; }
.release-page .creator-content-files-table { display: block; width: 100%; min-width: 0; margin: 0; border: 0; background: transparent; }
.release-page .creator-content-files-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.release-page .creator-content-files-table :is(colgroup, .creator-content-files-table-empty) { display: none; }
.release-page .creator-content-files-table tbody { display: grid; gap: 12px; }
.release-page .creator-content-files-table tbody tr { display: grid; grid-template-columns: 36px minmax(0, 1fr) 42px; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); }
.release-page .creator-content-files-table tbody td { display: block; padding: 0; border: 0; background: transparent; width: auto; max-width: none; min-width: 0; }
.release-page .creator-content-files-table tbody td:nth-child(n + 3):nth-child(-n + 6) { display: none; }
.release-page .creator-content-files-table tbody td:nth-child(2) { grid-column: 2; }
.release-page .creator-content-files-table tbody td:last-child { grid-column: 3; }
.release-page .creator-file-name { font-size: 15px; line-height: 1.45; font-weight: 650; overflow-wrap: anywhere; word-break: break-word; white-space: normal; color: var(--text); text-decoration: none; }
.release-page a.creator-file-name:hover { color: var(--accent-text); }
.release-page .creator-file-mobile-metadata { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; color: var(--text-soft); font-size: 12px; }
.release-page .creator-file-mobile-metadata > span::after { content: none; }
.release-page .creator-file-mobile-metadata .ui-capsule { font-size: 11px; padding: 3px 6px; }
.release-page .release-file-download { display: inline-flex; width: 42px; height: 42px; min-height: 42px; padding: 9px; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: var(--btn-fill); color: #fff; }
.release-file-download > svg { width: 24px; height: 24px; flex: 0 0 24px; }
.release-page .creator-content-files-support-heading { margin-top: 22px; }
.release-technical { grid-column: 1; grid-row: 3; }
.release-setting-list { display: flex; gap: 8px; flex-wrap: wrap; }
.release-setting { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); background: var(--surface-raised); border-radius: 10px; }
.release-setting > span { font-size: 13px; color: var(--text-soft); }
.release-setting strong { font-size: 14px; overflow-wrap: anywhere; }
.release-licence { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; font-size: 15px; }
.release-licence-notice { margin: 14px 0 0; color: var(--text-soft); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.release-page .creator-content-permissions { grid-column: 1 / -1; grid-row: 4; display: flex; padding: 0; margin: 0; gap: 14px; flex-wrap: wrap; align-items: center; }
.release-page .creator-content-report { display: inline-flex; align-items: center; padding: 10px 14px; border: 0; border-radius: 9px; background: var(--surface-raised); color: #fff; font-size: 14px; }
.release-page .creator-content-architecture-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.release-page .creator-content-architecture-links > a { padding: 9px 12px; border-radius: 8px; background: var(--surface-raised); font-size: 14px; text-decoration: none; color: var(--text); }
.release-page .creator-content-architecture-links > .creator-content-link-separator { display: none; }
.release-page .creator-content-permissions > .public-permission-list { flex-basis: 100%; margin: 0; }
.release-page .creator-content-related { grid-column: 1 / -1; grid-row: 5; margin-top: 12px; }
.release-page .creator-content-related > .section-heading h3 { font-size: 26px; color: var(--text); text-transform: none; font-weight: 800; }
/* As many release cards as fit one row at the preview carousel's height. */
.release-page .creator-content-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(var(--release-strip-height) * .5), 1fr)); grid-template-rows: var(--release-strip-height); grid-auto-rows: 0; gap: 0 18px; height: var(--release-strip-height); margin: 0; overflow: clip; }
.release-page .creator-content-related-grid > .creator-gallery-card { height: 100%; min-height: 0; overflow: hidden; }
.release-page .creator-content-related-grid > .creator-gallery-card:hover { transform: none; }
.release-page .creator-content-related-grid .creator-gallery-media { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
.release-page .creator-content-related-grid .creator-gallery-media img { object-fit: cover; }
.release-page .creator-content-version-notes { grid-column: 1 / -1; grid-row: 6; }
.description-copy-field { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; margin: 16px 0; }
.description-copy-label { color: var(--text-soft); font-size: 12px; font-weight: 700; text-transform: none; }
.description-copy-field code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.description-copy-field .btn { flex: 0 0 auto; width: auto; }
.description-copy-help { position: relative; font-size: 13px; }
.description-copy-help summary { cursor: pointer; color: var(--accent-text); }
.description-copy-help[open] { flex-basis: 100%; padding: 12px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px; }
.description-copy-help p { margin: 8px 0; }
.description-copy-help pre { margin-bottom: 0; white-space: pre-wrap; }
.release-editor-settings { grid-column: 1 / -1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 8px 0; }
.release-editor-settings legend { float: none; width: auto; font-size: 16px; font-weight: 700; padding: 0 6px; }
.release-editor-setting-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.release-editor-settings label { display: grid; gap: 7px; font-size: 14px; color: var(--text-soft); }

@media (max-width: 1250px) {
  .release-page .creator-identity-row { flex-wrap: wrap; gap: 10px; }
  .release-page .creator-identity-row > .page-header { flex: 1 0 100%; width: 100%; }
  .release-page .creator-header-actions { margin-left: 0; max-width: 100%; }
  .release-page .creator-content-section { grid-template-columns: minmax(0, 1fr) 0 380px; gap: 18px; }
  .release-page .creator-content-files { grid-column: 1 / -1; grid-row: 3; }
  .release-page .creator-content-permissions { grid-row: 5; }
  .release-page .creator-content-related { grid-row: 6; }
  .release-about { grid-column: 1 / -1; grid-row: 2; }
  .release-technical { grid-column: 1 / -1; grid-row: 4; }
  .release-page { --release-strip-height: 540px; }
}
@media (max-width: 720px) {
  [data-public-content-directory] .content-directory-header-tools--desktop { display: none; }
  [data-public-content-directory] .content-directory-header-tools--mobile { margin: 0; }
  [data-public-content-directory] .content-directory-results { display: block; }
  [data-public-content-directory] .creator-gallery-heading { margin-bottom: 16px; }
  .release-page .creator-content-section { grid-template-columns: minmax(0, 1fr); }
  .release-page .creator-content-permissions { grid-row: 6; }
  .release-page .creator-content-related { grid-row: 7; }
  .release-page .creator-content-version-notes { grid-row: 8; }
  .release-summary { grid-column: 1; grid-row: 2; }
  .release-preview-panel { grid-column: 1; }
  .release-about { grid-row: 3; }
  .release-page .creator-content-files { grid-row: 4; }
  .release-technical { grid-row: 5; }
  .release-page { --release-strip-height: 480px; }
  .release-editor-setting-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-page :is(.release-about, .release-technical, .creator-content-files) { padding: 18px; }
}

/* SUB73 Subscriptions that include this release; arrows switch between several. */
.release-buy-card .release-subscription-card[hidden] { display: none; }
.release-subscription-card.is-subscribed { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 12%, var(--surface-raised)); }
.release-subscription-card.is-subscribed .release-subscription-text > span { color: var(--accent-strong); }
.release-tier-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: -4px; }
.release-tier-step { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: rgb(255 255 255 / .07); color: var(--text-soft); cursor: pointer; }
.release-tier-step:hover, .release-tier-step:focus-visible { background: rgb(255 255 255 / .12); color: var(--text); }
.release-tier-step > svg { width: 18px; height: 18px; }
.release-tier-position { min-width: 44px; text-align: center; font-size: 13px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.release-buy-card .creator-content-also-in:first-child { margin-top: 0; }

/* SUB161 Unlock with a licence arrow: Personal or Commercial Licence. */
.licence-split { position: relative; display: flex; align-items: stretch; width: 100%; }
.licence-split > .creator-content-buy { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.licence-split-menu { position: static; display: flex; }
.licence-split-toggle { display: grid; place-items: center; width: 52px; min-height: 48px; height: 100%; padding: 0; border-left: 1px solid rgb(255 255 255 / .18); border-top-left-radius: 0; border-bottom-left-radius: 0; border-radius: 0 10px 10px 0; cursor: pointer; list-style: none; }
.licence-split-toggle::-webkit-details-marker { display: none; }
.licence-split-toggle > svg { width: 20px; height: 20px; transition: transform .15s; }
.licence-split-menu[open] > .licence-split-toggle > svg { transform: rotate(180deg); }
.licence-split-panel { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; left: 0; display: grid; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-raised); box-shadow: 0 16px 40px rgb(0 0 0 / .45); }
.licence-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 0; padding: 12px 14px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.licence-option:is(:hover, :focus-visible) { background: var(--surface-hover); color: var(--text); }
.licence-option-text { display: grid; gap: 3px; min-width: 0; }
.licence-option-text > strong { font-size: 15px; }
.licence-option-text > small { color: var(--text-soft); font-size: 13px; }
.licence-option-price { font-size: 17px; font-weight: 750; white-space: nowrap; }
.release-buy-card .creator-content-commercial:not(:first-child) { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.release-buy-card .creator-content-commercial .release-price-line .creator-ledger-heading { font-size: 14px; color: var(--text-soft); }
.release-buy-card .creator-content-commercial .creator-content-access-status { justify-self: start; }
.cart-item-licence { grid-column: 2 / -1; margin: 0.15rem 0 0; }

.addon-summary .addon-renewal-hint { margin: 20px 0 12px; }
.addon-chooser-modal > .app-modal-body { max-width: none; border-radius: 0; box-shadow: none; }

/* Round 7 reskin: earnings-auth screens. Loaded after app-foundation.css. */

/* Auth shares its composition across sign-in, registration and password pages. */
/* Account settings share the same spacing and raised controls as the reskin. */
#settings.panel { padding: 28px; border-radius: 20px; }
#settings > .section-heading { margin-bottom: 20px; }
#settings .section-heading h2 { font-size: 28px; letter-spacing: -.035em; }
#settings .settings-quick-actions { margin-bottom: 28px; gap: 10px; }
#settings .settings-group { margin: 0; padding: 24px 0; border-top: 1px solid var(--border); }
#billing-us-state { scroll-margin-top: calc(var(--header-h, 64px) + 1rem); }
#settings .settings-group-title { margin: 0 0 16px; color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -.02em; text-transform: none; }
#settings .settings-grid { gap: 14px 24px; }
#settings .setting-row { min-width: 0; padding: 18px; background: color-mix(in srgb, var(--scheme-raised) 35%, transparent); border-color: var(--border); border-radius: 12px; }
#settings .setting-row-head { gap: 14px; flex-wrap: wrap; }
#settings .setting-row-title { font-size: 16px; line-height: 1.4; }
#settings .setting-row-head > .form-select { flex: 1 1 200px; width: auto; min-width: 0; max-width: 100%; }
#settings .setting-row-desc { margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--text-soft); }
#settings :is(.form-select, .form-control) { min-height: 44px; font-size: 16px; }
#settings .settings-security-fields { display: grid; gap: 14px; margin-top: 18px; }
#settings .settings-security-fields .form-label { display: block; margin: 0; font-size: 15px; }
#settings .settings-security-fields .form-label :is(input, textarea) { display: block; width: 100%; margin-top: 7px; }
#settings .settings-security-fields .btn { justify-self: start; }
#settings .settings-switch input, .settings-switch input[role="switch"] { appearance: none; width: 42px; height: 25px; margin: 0; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--scheme-raised); cursor: pointer; position: relative; }
#settings .settings-switch input::after, .settings-switch input[role="switch"]::after { content: ''; position: absolute; width: 17px; height: 17px; inset: 3px auto auto 3px; border-radius: 50%; background: var(--text-soft); transition: transform .15s; }
#settings .settings-switch input:checked, .settings-switch input[role="switch"]:checked { background: var(--accent); border-color: var(--accent); }
#settings .settings-switch input:checked::after, .settings-switch input[role="switch"]:checked::after { background: var(--on-accent); transform: translateX(17px); }
#settings .settings-switch input:focus-visible, .settings-switch input[role="switch"]:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
#settings .carousel-speed-control { display: flex; align-items: center; gap: 14px; flex: 1 1 200px; }
#settings [data-carousel-speed] { width: 100%; min-width: 80px; accent-color: var(--accent); }
#settings [data-carousel-speed-value] { min-width: 3.5ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
#settings .theme-options { margin-top: 14px; }
#settings .theme-option { padding: 12px; }
#settings .settings-danger-action { margin-top: 24px; }
@media (max-width: 720px) {
  #settings.panel { padding: 20px; }
  #settings .settings-grid { grid-template-columns: minmax(0, 1fr); }
  #settings .setting-row { padding: 15px; }
}

main.app-content.auth-wrap {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - var(--header-h));
  padding: 56px 24px;
}

.auth-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bg) 38%, transparent), var(--bg) 100%),
    url('../images/site-art.jpg?v=5e33e1b6ab90') center / cover no-repeat;
}

.auth-card { width: min(100%, 470px); }
.auth-page-register .auth-card { width: min(100%, 520px); }
.auth-page-register main.app-content.auth-wrap { padding-block: 32px; }

.auth-page .auth-card-inner {
  padding: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px -30px #000b;
}

.auth-page .auth-card h1 { margin: 0 0 8px; font-size: 28px; line-height: 1.2; letter-spacing: -.03em; }
.auth-page .auth-subtitle { margin: 0 0 24px; font-size: 14px; line-height: 1.55; }
@media (min-width: 640px) { .auth-page .auth-subtitle { white-space: nowrap; } }
.auth-page .auth-form { gap: 16px; }
.auth-page .auth-label { margin-bottom: 7px; color: var(--text-soft); font-size: 14px; font-weight: 600; }
.auth-page .auth-input { min-height: 46px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background-color: var(--field); font-size: 16px; }
.auth-page .auth-input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.auth-page .auth-options-row { gap: 12px; font-size: 13px; }
.auth-page .auth-options-row a { color: var(--text-soft); white-space: nowrap; }
.auth-page .auth-button { min-height: 48px; margin-top: 2px; border-radius: 12px; font-size: 16px; font-weight: 700; }
.auth-page .auth-hint { margin-top: 6px; font-size: 13px; }
.auth-page .auth-switch { margin-top: 22px; padding-top: 20px; font-size: 14px; }
.auth-page .auth-agreement { gap: 8px; }
.auth-page .auth-agreement-status { margin: 0 0 8px; font-size: 14px; }
.auth-page .auth-agreement-open { justify-self: start; }
.auth-page .auth-gated[hidden] { display: none; }
.auth-page .auth-agreement-gate { margin: 20px auto auto; }

/* Only the Earnings workspace receives this header and panel composition. */
.creator-workspace:has(> .creator-earnings) { gap: var(--dash-gap); }
.creator-workspace:has(> .creator-earnings) > .creator-page-header { min-height: 40px; padding: 0; border: 0; border-radius: 0; background: none; }
.creator-workspace:has(> .creator-earnings) > .creator-page-header::before { content: none; }
.creator-workspace:has(> .creator-earnings) > .creator-page-header .page-kicker { font-size: 30px; }
.creator-earnings { gap: var(--dash-gap); min-width: 0; }
.creator-earnings > .creator-settings-tabs { justify-self: end; flex-wrap: wrap; margin: 0; padding: 4px; }
.creator-earnings .creator-settings-tab { min-height: 34px; padding: 6px 13px; font-size: 14px; }
.creator-earnings .panel { min-width: 0; padding: var(--dash-pad-y) var(--dash-pad-x); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.creator-earnings :is(.section-heading, .creator-ledger-table-heading) { margin: 0 0 10px; }
/* Side by side, the heading centres against its actions; stacked on phones it stays left-aligned like every other panel. */
@media (min-width: 721px) { .creator-earnings :is(.section-heading, .creator-ledger-table-heading) { align-items: center; } }
.creator-earnings :is(h2, .section-heading h2) { margin: 0; font-size: var(--dash-heading); font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.creator-earnings :is(.creator-sales-chart, .creator-invoice-archive, .creator-fee-overview) :is(h2, h3) { margin: 0; font-size: var(--dash-heading); font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.creator-earnings :is(.creator-sales-chart, .creator-invoice-archive, .creator-fee-overview) :is(.section-heading, .creator-ledger-table-heading) { margin-bottom: 8px; }
.creator-earnings :is(.section-heading, .creator-ledger-table-heading) p { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.creator-earnings .earnings-controls-panel .section-heading > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
.creator-earnings .earnings-controls-panel .section-heading p { margin: 0; }
.creator-earnings .creator-fee-overview-grid { gap: 20px; }
.creator-earnings .creator-fee-overview-grid > div { padding: 0; border: 0; border-radius: 0; background: none; }
.creator-earnings .creator-fee-overview-grid > div + div { padding-left: 20px; border-left: 1px solid var(--border); }
.creator-earnings .creator-fee-overview-grid p { font-size: 14px; line-height: 1.55; }
.creator-earnings .creator-fee-heading-row { gap: 8px; flex-wrap: wrap; color: var(--text-soft); font-size: 15px; }
.creator-earnings .creator-fee-heading-row strong { color: var(--text); }
.creator-earnings :is(.form-label, .creator-chart-controls label, .earnings-read-control p, :is(.earnings-unread-reset label, .earnings-control, .earnings-rolling-control > label) > span:first-child) { color: var(--text-soft); font-size: 14px; }
.creator-earnings .earnings-date-range { margin: 0; padding: 0; gap: 12px; }
.creator-earnings .earnings-daily .creator-chart-controls { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 12px; }
.creator-earnings .earnings-daily .creator-chart-controls label { display: grid; min-width: 0; }
.creator-earnings .earnings-daily .creator-chart-controls select { width: 100%; min-width: 0; }
.creator-earnings .earnings-daily .creator-sales-chart-canvas { padding-top: 8px; overflow-x: auto; }
.creator-earnings :is(.btn, .form-select, .form-control) { min-height: 40px; }
.creator-earnings .creator-invoice-archive .section-heading { flex-flow: row wrap; align-items: center; justify-content: flex-start; gap: 10px 24px; margin: 0; }
.creator-earnings .creator-invoice-archive .creator-ledger-filter { width: auto; min-width: 0; max-width: 100%; margin: 0; padding: 0; }
.creator-earnings .creator-invoice-archive .creator-ledger-filter > div { width: auto; }
.creator-earnings .creator-invoice-archive .creator-ledger-filter > div:first-child { flex: 0 1 12rem; min-width: 0; max-width: 100%; }

/* Contain the existing shared table; its cells and appearance remain shared.
   Admin > Financial > Earnings uses the same ledger table as Creator > Earnings. */
.creator-earnings .creator-ledger { max-width: 100%; overflow: hidden; }
.earnings-ledger-scroll-frame { position: relative; min-width: 0; }
.earnings-ledger-scroll-frame::before, .earnings-ledger-scroll-frame::after { content: ""; position: absolute; z-index: 3; inset-block: 0; width: 32px; opacity: 0; pointer-events: none; }
.earnings-ledger-scroll-frame::before { left: 0; background: linear-gradient(to right, var(--surface), transparent); }
.earnings-ledger-scroll-frame::after { right: 0; background: linear-gradient(to left, var(--surface), transparent); }
.earnings-ledger-scroll-frame.has-more-left::before, .earnings-ledger-scroll-frame.has-more-right::after { opacity: 1; }
:is(.creator-earnings, .admin-transaction-report) .creator-ledger-table-wrap { width: 100%; min-width: 0; max-width: 100%; max-height: 780px; overflow: auto; overscroll-behavior-x: contain; scrollbar-width: auto; }
.creator-earnings .creator-ledger[data-ledger-pagination-ready] .creator-ledger-table-wrap { max-height: none; }
:is(.creator-earnings, .admin-transaction-report) .creator-ledger-table { table-layout: auto; width: max-content; min-width: 100%; }
:is(.creator-earnings, .admin-transaction-report) .creator-ledger-table :is(th, td) { white-space: nowrap; }
:is(.creator-earnings, .admin-transaction-report) .creator-ledger-table thead th { position: sticky; top: 0; z-index: 2; }
:is(.creator-earnings, .admin-transaction-report) .creator-ledger-transactions { width: max-content; min-width: 100%; table-layout: auto; }
/* Let the shared table size every selected column naturally. */
:is(.creator-earnings, .admin-transaction-report) .creator-ledger-transactions :is(th, td)[class*="creator-ledger-column-"]:not(.creator-ledger-column-item) { width: auto; min-width: 0; padding: .3rem .6rem; }
:is(.creator-earnings, .admin-transaction-report) .creator-ledger-transactions .creator-ledger-column-classification { overflow: visible; text-overflow: clip; white-space: nowrap; }
:is(.creator-earnings, .admin-transaction-report) .creator-ledger-transactions .ui-capsule { white-space: nowrap; }
/* Admin > Financial > Earnings: the Transactions heading matches its controls heading. */
.admin-transaction-report .creator-ledger-transactions-heading { margin: 0; }
.admin-transaction-report .creator-ledger-transactions-heading h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.01em; }
.earnings-pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; padding-top: 10px; color: var(--text-muted); font-size: 14px; }
.earnings-pagination > div { display: flex; align-items: center; gap: 14px; }
.creator-earnings .creator-ledger-transactions-heading { margin-top: 0; }
.creator-earnings .creator-chart-controls { gap: 14px; }
.creator-earnings .creator-chart-controls label { gap: 8px; }
.creator-earnings .creator-sales-chart-canvas { padding-top: 8px; }

/* Creator dashboard: compact cards. Every card keeps one inner left edge:
   its heading, controls and tables all start at the card padding. */
.creator-workspace { --dash-pad-y: 12px; --dash-pad-x: 18px; --dash-gap: 12px; --dash-heading: 17px; min-width: 0; gap: var(--dash-gap); }
.page-shell.creator-workspace > :is(.creator-page-header, .page-header) { min-height: 40px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.page-shell.creator-workspace > :is(.creator-page-header, .page-header)::before { content: none; }
.page-shell.creator-workspace > :is(.creator-page-header, .page-header) :is(.page-kicker, h1) { font-size: 30px; }
.creator-workspace > :is(section, form, nav),
.creator-workspace :is(.stack-lg, .form-grid, .settings-grid) > * { min-width: 0; }
.creator-workspace .stack-lg { gap: var(--dash-gap); }
.creator-workspace .panel { --dashboard-card-padding: var(--dash-pad-x); padding: var(--dash-pad-y) var(--dash-pad-x); border-radius: 14px; }
.creator-workspace .creator-card { --dashboard-card-padding: var(--dash-pad-x); padding: var(--dash-pad-y) var(--dash-pad-x); border-radius: 14px; background: var(--surface); }
/* Creator > Content is the shared content listing: no panel behind it, so its
   cards stand on the page exactly as in every other listing. */
.creator-workspace .creator-card.content-directory { padding: 0; border-radius: 0; background: transparent; }
.creator-workspace :is(.creator-card, .panel) > .section-heading { margin-bottom: 8px; }
.creator-workspace :is(.creator-card, .panel) :is(.section-heading h2, h2:first-child) { font-size: var(--dash-heading); line-height: 1.3; font-weight: 800; letter-spacing: -.02em; }
.creator-workspace .creator-card > p,
.creator-workspace .creator-card .section-heading p { color: var(--text-soft); font-size: 13px; line-height: 1.45; }
.creator-workspace :is(.creator-card, .panel) .section-heading p { margin: 2px 0 0; }
/* A card whose heading leads a row of controls shows them on one line. */
.creator-workspace :is(.creator-card, .panel):has(> .section-heading:first-child + :is(form.creator-ledger-filter)) { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 24px; }
.creator-workspace :is(.creator-card, .panel):has(> .section-heading:first-child + :is(form.creator-ledger-filter)) > .section-heading { flex: 1 1 auto; min-width: 0; align-self: center; margin: 0; }
.creator-workspace :is(.creator-card, .panel):has(> .section-heading:first-child + :is(form.creator-ledger-filter)) > .section-heading + * { flex: 1 1 520px; min-width: 0; }
.creator-workspace :is(.creator-card, .panel):has(> .section-heading:first-child + :is(form.creator-ledger-filter)) > .section-heading + * ~ * { flex: 1 1 100%; }
.creator-workspace :is(.creator-settings-tabs, .creator-audience-tabs) { max-width: 100%; margin-bottom: 0; align-self: start; }
.creator-workspace .creator-settings-tabs { flex-wrap: wrap; }
.creator-workspace :is(.form-control, .form-select) { max-width: 100%; min-height: 40px; }
.creator-workspace .table-responsive { position: relative; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.creator-workspace .table-responsive > table { margin-bottom: 0; }
.creator-workspace :is(.creator-row-actions, .button-row) { flex-wrap: wrap; gap: 8px; }
.creator-workspace .table-responsive .creator-row-actions { flex-wrap: nowrap; }

/* Content: the count and view controls sit inside the filter card, on its heading line. */
.creator-workspace .content-directory.creator-card .content-directory-results { margin-top: 10px; }
.creator-workspace .content-directory.creator-card .content-directory-filters { padding: 12px 14px; }
.creator-workspace .content-directory-filter-footer:has([data-content-directory-status]:empty):not(:has(a)) { display: none; }

/* Every overview statistic in one compact row of small tiles; each group's
   name sits beside its tiles instead of on a row of its own. */
.creator-workspace .creator-overview-strip { padding: 8px 10px; }
.creator-workspace .creator-stat-strip { gap: 0; align-items: center; }
.creator-workspace .stat-group { flex-direction: row; align-items: center; gap: 10px; padding-inline: 12px; }
.creator-workspace .stat-group-label { flex: none; color: var(--text-muted); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.creator-workspace .stat-items { flex: 1 1 auto; gap: 6px; }
.creator-workspace .stat-item { gap: 0; min-width: 0; padding: 5px 10px; border-radius: 8px; background: color-mix(in srgb, var(--scheme-raised) 55%, transparent); }
.creator-workspace .stat-num { font-size: 17px; line-height: 1.25; letter-spacing: -.02em; overflow-wrap: anywhere; }
.creator-workspace .stat-cap { font-size: 11.5px; font-weight: 500; line-height: 1.3; letter-spacing: 0; text-transform: none; }

/* Overview: number and caption share one line, so the statistics row is a single
   short band. Group names, section headings and the first table column all start
   on the same left edge, the card's inner padding; the tables fill their card
   instead of sitting in a second box, and rows are compact. */
.creator-workspace:has(.creator-overview-strip) { --overview-edge: 16px; }
.creator-workspace .creator-overview-strip { padding: 6px var(--overview-edge); }
.creator-workspace .creator-overview-strip .stat-group:first-child { padding-left: 0; }
.creator-workspace .creator-overview-strip .stat-group:last-child { padding-right: 0; }
.creator-workspace .creator-overview-strip .stat-item { flex-direction: row; align-items: baseline; gap: 6px; padding: 4px 10px; }
.creator-workspace .creator-overview-strip .stat-item { min-width: max-content; }
.creator-workspace .creator-overview-strip .stat-items { display: flex; }
.creator-workspace .creator-overview-strip :is(.creator-stat-strip, .stat-items) { flex-wrap: wrap; row-gap: 6px; }
.creator-workspace .creator-overview-strip .stat-num { font-size: 16px; white-space: nowrap; overflow-wrap: normal; }
.creator-workspace .creator-overview-strip .stat-cap { font-size: 12px; color: var(--text-soft); }
.creator-workspace:has(.creator-overview-strip) .creator-card:not(.creator-overview-strip):has(> .table-responsive) { padding: 0; overflow: hidden; }
.creator-workspace:has(.creator-overview-strip) .creator-card > .table-responsive > table { border: 0; border-radius: 0; }
.creator-workspace:has(.creator-overview-strip) .creator-card > .table-responsive > table :is(th, td) { padding-block: 6px; }
.creator-workspace:has(.creator-overview-strip) .creator-card > .table-responsive > table thead th { height: 34px; }
.creator-workspace:has(.creator-overview-strip) .creator-card > .table-responsive > table tr > :first-child { padding-left: var(--overview-edge); text-align: left; }
.creator-workspace:has(.creator-overview-strip) .creator-card > .table-responsive > table tr > :last-child { padding-right: var(--overview-edge); }
.creator-workspace:has(.creator-overview-strip) .creator-card > .table-responsive > table tbody tr:last-child > * { border-bottom: 0; }

/* Subscriber preferences and all settings use the same raised control groups. */
.creator-workspace .setting-row { min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--scheme-raised) 35%, transparent); }
.creator-workspace .setting-row-head { flex-wrap: wrap; gap: 12px; }
.creator-workspace .setting-row-title { font-size: 15px; line-height: 1.45; }
.creator-workspace .setting-row-desc { margin: 6px 0 0; color: var(--text-soft); font-size: 13px; line-height: 1.5; }
.creator-workspace .settings-grid { gap: 10px; }
.creator-workspace .creator-license-permissions .permission-setting-grid { gap: 16px; padding: 18px 0 0; }
.creator-workspace .creator-license-permissions .permission-setting { padding: 18px; border-color: var(--border); border-radius: 12px; background: color-mix(in srgb, var(--scheme-raised) 35%, transparent); opacity: 1; filter: none; }
.creator-workspace .creator-license-permissions .permission-chip-copy strong { font-size: 15px; line-height: 1.45; }
.creator-workspace .creator-license-permissions :is(.permission-chip-copy small, .permission-description) { font-size: 14px; line-height: 1.6; }
.creator-workspace .creator-license-permissions .permission-chip-select { font-size: 16px; }
.creator-workspace .creator-subscription-analytics { grid-template-columns: minmax(0, 1fr); }
.creator-workspace .creator-subscription-analytics > * { min-width: 0; }
.creator-workspace .creator-subscription-analytics .creator-ledger-table-heading { flex-wrap: wrap; gap: 18px; }
.creator-workspace .creator-subscription-analytics .creator-ledger-table-heading > div { min-width: 0; }
.creator-workspace .creator-subscription-analytics .creator-chart-controls { flex-wrap: wrap; gap: 12px; }
.creator-workspace .creator-subscription-analytics .creator-sales-chart-canvas { max-width: 100%; overflow-x: auto; }
.creator-workspace .creator-subscription-kpis { gap: 8px; }
.creator-workspace .creator-subscription-kpis article { min-width: 0; gap: 0; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--scheme-raised) 35%, transparent); }
.creator-workspace .creator-subscription-kpis strong { font-size: 19px; line-height: 1.3; letter-spacing: -.02em; }
.creator-workspace .creator-subscription-kpis :is(span, small) { font-size: 12.5px; line-height: 1.4; }

/* Every Insights panel keeps its existing chart, values and definitions. */
.creator-earnings .creator-insights > p { margin-block: 12px 18px; }
.creator-earnings .creator-insights > details { padding: 0 16px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--scheme-raised) 35%, transparent); }
.creator-earnings .creator-insights > details > summary { min-height: 0; padding-block: 14px; }
.creator-earnings .creator-insights > details[open] { padding-bottom: 14px; }
.creator-earnings .creator-insights summary { cursor: pointer; color: var(--text-soft); font-size: 14px; }
.creator-earnings .creator-insights details p { font-size: 14px; line-height: 1.6; color: var(--text-soft); }
.creator-earnings .creator-insights details p:last-child { margin-bottom: 0; }
.creator-earnings .creator-insights > details:not([open]) { min-height: 0; }
.creator-earnings .creator-insights > details:not([open]) > summary { margin-bottom: 0; }
.creator-earnings .creator-insights .creator-ledger-filter { margin-block: 22px; gap: 14px; }
.creator-earnings .creator-insights .creator-ledger-filter label { display: grid; gap: 8px; min-width: 0; color: var(--text-soft); font-size: 14px; }
.creator-earnings .creator-insights-summary { gap: 14px; margin-block: 22px; }
.creator-earnings .creator-insights-summary > div { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--scheme-raised) 35%, transparent); }
.creator-earnings .creator-insights-summary dt { color: var(--text-soft); font-size: 14px; }
.creator-earnings .creator-insights-summary dd { margin-top: 12px; font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -.035em; }
.creator-earnings .creator-insights nav.cluster { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.creator-earnings .creator-insights nav.cluster a { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 9px; background: var(--scheme-raised); color: var(--text); font-size: 14px; font-weight: 600; }
.creator-earnings .creator-insights .table-responsive { margin-top: 18px; }
.creator-earnings .creator-insights-spark { color: var(--accent); }
.creator-earnings .creator-insights-heat { border-radius: 6px; }
.creator-earnings .creator-insights .app-table { min-width: 620px; }
.creator-earnings .creator-insights td:has(.creator-insights-spark) { min-width: 145px; }
.creator-earnings .creator-insights-subscription > th { font-weight: 700; }
.creator-earnings .creator-insights-subscription:not(:first-child) > * { border-top: 1px solid var(--border); }
.creator-earnings .creator-insights-addon > th { font-weight: 500; color: var(--text-soft); }
.creator-earnings .creator-insights-addon > th > span { display: inline-block; padding-left: 20px; }
.creator-earnings .creator-pricing-card > .table-responsive { margin-top: 22px; }
.creator-earnings .admin-overview-state { gap: 14px; margin-block: 20px; }
.creator-earnings .admin-state-card { padding: 18px; border-radius: 12px; background: var(--scheme-raised); }
.creator-earnings > form { justify-self: start; max-width: 100%; }

/* Profile is a working editor, using the public card renderer for previews. */
.creator-workspace .creator-profile-layout { gap: 20px; }
.creator-workspace .creator-profile-primary-grid { gap: 26px; }
.creator-workspace .creator-profile-details-column { gap: 20px; }
.creator-workspace .creator-profile-form { gap: 24px; }
.creator-workspace .creator-appearance-section { padding-top: 14px; margin-top: 14px; }
.creator-workspace .creator-profile-previews { gap: 24px; }
.creator-workspace .creator-profile-previews > section > h3 { margin-bottom: 12px; color: var(--text-soft); font-size: 15px; text-transform: none; letter-spacing: 0; }
.creator-workspace .creator-profile-color-column { justify-self: stretch; }
.creator-workspace .creator-highlight-slots { gap: 14px; }

/* Poll composer and results retain their existing actions and preview panes. */
.creator-workspace #poll-editor { gap: var(--dash-gap); }
.creator-workspace #poll-editor > .poll-editor-card { padding: var(--dash-pad-y) var(--dash-pad-x); border-radius: 14px; }
.creator-workspace #poll-editor .markdown-composer { margin-top: 12px; }
/* Section headings outside a card (Unsent polls) keep the card heading size. */
.creator-workspace > .stack-lg > .section-heading { margin-bottom: 0; }
.creator-workspace > .stack-lg > .section-heading h2 { font-size: var(--dash-heading); }
.creator-workspace > .stack-lg > .section-heading + p { margin: 0; }
.markdown-toolbar { flex-wrap: wrap; gap: 6px; padding: 10px; border-radius: 12px; background: var(--scheme-raised); }
.markdown-toolbar .markdown-tool { min-height: 34px; padding: 6px 10px; border-radius: 7px; color: var(--text); background: var(--surface); }
.creator-workspace .poll-send-row { display: flex; align-items: center; gap: 12px; }
.creator-workspace #poll-editor .markdown-preview-pane { min-width: 0; padding: 20px; border-radius: 12px; background: color-mix(in srgb, var(--scheme-raised) 35%, transparent); }
.creator-workspace #poll-editor .markdown-preview-label { color: var(--text-soft); font-size: 14px; }
.creator-workspace .poll-result-toolbar { flex-wrap: wrap; gap: 14px; }
.creator-workspace .poll-result-content { min-width: 0; }

@media (max-width: 1100px) {
  .creator-workspace .creator-profile-primary-grid { grid-template-columns: minmax(160px, .7fr) minmax(0, 1.3fr); }
  .creator-workspace .creator-profile-color-column { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .creator-workspace { --dash-pad-x: 14px; }
  .creator-workspace .creator-profile-primary-grid { grid-template-columns: minmax(0, 1fr); }
  .creator-workspace .creator-profile-color-column { grid-column: auto; }
  .creator-workspace :is(.settings-grid, .creator-highlight-slots) { grid-template-columns: minmax(0, 1fr); }
  .creator-earnings .creator-insights .creator-ledger-filter > :is(label, div) { flex: 1 1 100%; width: 100%; }
  .creator-earnings .creator-insights-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-earnings .creator-insights-summary > div { padding: 14px; }
  .creator-earnings .creator-insights-summary dd { font-size: 24px; }
  .creator-workspace #poll-editor .markdown-composer { grid-template-columns: minmax(0, 1fr); }
  .creator-workspace #poll-editor .markdown-preview-pane { padding: 16px; }
}

.earnings-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--dash-gap, 12px); }
.earnings-summary.earnings-summary-projections { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.creator-earnings .earnings-summary-tile { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 0; padding: 8px 14px 24px; overflow: hidden; }
.creator-earnings .earnings-summary-tile.is-projection { padding-bottom: 8px; }
.earnings-summary-tile h3 { margin: 0; color: var(--text-muted); font-size: 12.5px; font-weight: 600; }
.earnings-summary-tile > strong { color: var(--text); font-size: 21px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.earnings-summary-tile > span { color: var(--text-soft); font-size: 13px; }
.earnings-summary-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.earnings-summary-heading > span { color: var(--text-muted); font-size: 12px; }
.earnings-next-payout { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; color: var(--text-soft); font-size: 13px; }
.earnings-next-payout time { color: var(--text); font-variant-numeric: tabular-nums; }
.earnings-sparkline { position: absolute; bottom: 0; left: 0; width: 100%; height: 20px; background: linear-gradient(transparent, color-mix(in srgb, var(--accent) 12%, transparent)); }
.earnings-sparkline path { fill: none; stroke: var(--accent); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.earnings-charts-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(285px, 1fr); gap: var(--dash-gap, 12px); }
.earnings-panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 8px; }
.earnings-chart-legend { display: flex; gap: 16px; color: var(--text-soft); font-size: 13px; }
.earnings-chart-legend span { display: flex; align-items: center; gap: 7px; }
.earnings-chart-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.earnings-chart-legend span:last-child i { background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.earnings-daily-canvas { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.earnings-daily-canvas svg { display: block; width: 100%; height: 310px; }
.earnings-daily-canvas line { stroke: var(--border); }
.earnings-daily-canvas text { fill: var(--text-muted); font: 12px Inter, sans-serif; }
.earnings-daily-canvas rect { fill: var(--accent); stroke: color-mix(in srgb, var(--accent-strong) 80%, transparent); stroke-width: 1; }
.earnings-daily-canvas rect.is-recurring { fill: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.earnings-top .earnings-panel-head { margin-bottom: 2px; }
.earnings-top .earnings-panel-head h2 { margin: 0; }
.earnings-top-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; min-width: 0; }
.earnings-top-row > .ui-item { flex: 0 0 32px; }
.earnings-top-row .ui-item-thumb, .earnings-top-row .ui-item-icon { width: 32px; height: 44px; border-radius: 7px; }
.earnings-top-detail { flex: 1; min-width: 0; }
.earnings-top-detail > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--text); font-size: 14px; }
.earnings-top-detail strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.earnings-top-detail strong a:focus-visible { outline-offset: -2px; }
.earnings-top-detail span { flex-shrink: 0; font-weight: 700; }
.earnings-top-detail strong .content-version-tag { margin-left: .3em; color: var(--text-muted); font-weight: 500; }
.earnings-top-track { height: 5px; margin: 8px 0 5px; overflow: hidden; border-radius: 4px; background: color-mix(in srgb, var(--scheme-text) 8%, transparent); }
.earnings-top-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.earnings-top-detail small, .earnings-empty { color: var(--text-muted); font-size: 13px; }

.app-shell:has(.creator-workspace) .sidebar-groups { display: flex; flex-direction: column; }
.app-shell:has(.creator-workspace) .sidebar-groups > :first-child { order: -2; }
.app-shell:has(.creator-workspace) .sidebar-groups > .sidebar-group-creator { order: -1; }

@media (min-width: 1400px) {
  /* Pulled up into the page header's row; the header is a positioned card,
     so the tabs must stack above it or the header swallows their clicks. */
  .creator-earnings > .creator-settings-tabs { position: relative; z-index: 1; margin-top: calc(-42px - var(--dash-gap)); align-self: start; }
  .creator-workspace:has(> .creator-earnings) > .creator-page-header { padding-right: 860px; }
}

@media (max-width: 1200px) {
  .earnings-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .earnings-charts-row { grid-template-columns: minmax(0, 1fr); }
  .creator-earnings .creator-ledger-table-heading { flex-wrap: wrap; align-items: start; }
}

@media (max-width: 720px) {
  main.app-content.auth-wrap { padding: 30px 16px; }
  .auth-page .auth-card-inner { padding: 24px; }
  .auth-page .auth-options-row { flex-wrap: wrap; }
  .creator-earnings .panel { padding: 18px; }
  .creator-earnings > .creator-settings-tabs { justify-self: stretch; }
  .creator-earnings .creator-fee-overview-grid { grid-template-columns: minmax(0, 1fr); }
  .creator-earnings .creator-fee-overview-grid > div + div { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .earnings-summary { gap: 12px; }
  .creator-earnings .earnings-summary-tile { padding: 14px 16px 34px; }
}

/* Creator > Earnings > Overview (SUB255 to SUB257). The top card is one row
   of date fields with the badge bell at its end; Transactions has its own
   range beside its heading. */
.creator-earnings .creator-earnings-controls { padding-block: 12px; }
.creator-earnings .creator-ledger-transactions-heading { flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.creator-earnings .creator-ledger-transactions-heading > div:first-child { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; align-self: auto; }
.creator-earnings .creator-ledger-transactions-heading > div:first-child > span { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.creator-earnings .creator-ledger-transactions-heading > form { flex-wrap: wrap; max-width: 100%; }
.creator-earnings .creator-ledger-transactions-heading > form > div:not(.creator-ledger-export-actions) { flex: 0 1 11rem; width: auto; min-width: 0; max-width: 100%; }
.creator-earnings .creator-ledger-transactions-heading .creator-ledger-export-actions { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-start; width: auto; min-width: 0; margin-left: 0; }
.creator-earnings .creator-ledger-export-links { display: flex; flex-wrap: wrap; gap: inherit; }
.creator-earnings .creator-ledger-transactions-heading .date-range-summary { flex: 0 1 auto; margin: 0 0 10px; }
@media (max-width: 720px) {
  .creator-earnings .creator-invoice-archive .creator-ledger-filter > div:first-child { flex-basis: 10rem; }
  .creator-earnings :is(.creator-invoice-archive, .creator-ledger-transactions-heading) :is(.form-control, .form-select) { min-height: 44px; }
  .creator-earnings .creator-ledger-transactions-heading { align-items: flex-start; }
  .creator-earnings .earnings-date-range { width: 100%; }
  .creator-earnings .creator-earnings-controls .earnings-date-range > div { flex: 1 1 8rem; width: auto; min-width: 0; }
  .creator-earnings .creator-ledger-transactions-heading > form > div:not(.creator-ledger-export-actions) { flex: 1 1 8rem; }
  .creator-earnings .creator-ledger-transactions-heading > form > .earnings-range-period:has(option[value="custom"]:checked) { flex-basis: 100%; }
  .creator-earnings .creator-ledger-transactions-heading .creator-ledger-export-actions { flex-basis: 100%; }
  .creator-earnings .creator-ledger-export-actions .btn:not(.btn-icon-only) { width: auto; min-height: 44px; }
  .creator-earnings .creator-ledger-transactions-heading .date-range-summary { margin-bottom: 0; }
}

/* Small windows: the badge controls and the chart's display switches. */
.chart-settings-window { width: min(22rem, calc(100vw - 2rem)); min-width: 0; }
.chart-settings-options { display: grid; }
.chart-settings-option, .chart-settings-option.settings-switch { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; color: var(--text); font-size: 15px; cursor: pointer; }
.chart-settings-option select { width: auto; }
.chart-settings-option + .chart-settings-option { border-top: 1px solid var(--border); }
.notification-controls-window .earnings-control select { width: 100%; }

/* The earnings chart draws at its real pixel size: a long range scrolls
   sideways with the y-axis held in place, opening on the newest date. */
.creator-earnings .earnings-daily .creator-sales-chart-canvas { min-height: 356px; padding: 8px 0 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
html.chart-state-pending [data-chart-canvas]:not([data-chart-ready]) { position: relative; min-height: 356px; overflow: hidden; }
html.chart-state-pending [data-chart-canvas]:not([data-chart-ready]) > * { visibility: hidden; }
html.chart-state-pending [data-chart-canvas]:not([data-chart-ready])::after { content: ""; position: absolute; top: calc(50% - .5rem); left: calc(50% - .5rem); }
.creator-sales-chart-canvas .chart-scroll-plot { display: flex; }
.creator-sales-chart-canvas .chart-scroll-plot svg { width: auto; height: auto; flex: 0 0 auto; }
.creator-sales-chart-canvas .chart-y-axis { position: sticky; left: 0; z-index: 1; overflow: visible; }
.creator-sales-chart-canvas .chart-axis-backdrop { fill: var(--surface); }
.creator-sales-chart-canvas .chart-date { font-size: 11px; font-variant-numeric: tabular-nums; }
.creator-sales-chart-canvas .chart-axis-value { fill: var(--text-soft); font-weight: 700; pointer-events: none; font-variant-numeric: tabular-nums; }
.creator-sales-chart-canvas .chart-plot .chart-value { fill: var(--text-soft); font-weight: 600; font-variant-numeric: tabular-nums; }
.earnings-daily .earnings-panel-head h2 { margin: 0; }
:is(.notification-controls-window, .chart-settings-window) .app-modal-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
[data-admin-users] > .notification-tabs-row { margin-bottom: 1rem; }
/* Phones, Admin > Financial > Earnings: the fields take the full width and the
   bell sits at the end of the last line, beside the columns button. */
@media (max-width: 720px) {
  .admin-transaction-report .notification-controls.has-row { position: relative; }
  .admin-transaction-report .notification-controls.has-row > .notification-controls-open { position: absolute; right: 0; bottom: 0; }
}
.admin-transaction-report .earnings-date-range input[type="search"] { width: 100%; max-width: none; }

/* A Custom range's To while it ends today: empty and reads Today (DateRangePicker::toInput). */
.date-range-pending [data-date-range-inactive],
[data-date-range-fields][hidden] { display: none; }
.date-range-summary { flex: 1 0 100%; margin: 0; color: var(--text-muted); font-size: .8rem; }
.date-range-to { position: relative; display: block; }
.date-range-to .date-range-today { display: none; position: absolute; inset: 0 2.5rem 0 0; align-items: center; padding-left: calc(0.7rem + 1px); color: var(--text); pointer-events: none; }
.date-range-to[data-empty]:not(:focus-within) .date-range-today { display: flex; }
.date-range-to[data-empty]:not(:focus-within) input::-webkit-datetime-edit { opacity: 0; }
@supports not selector(::-webkit-datetime-edit) {
  @supports (-webkit-text-fill-color: transparent) {
    .date-range-to[data-empty]:not(:focus-within) input { -webkit-text-fill-color: transparent; }
  }
  @supports not (-webkit-text-fill-color: transparent) {
    .date-range-to[data-empty]:not(:focus-within) input { color: transparent; }
  }
}

/* One close control for dialogs, viewers and floating windows. */
button.app-window-close.app-window-close,
.app-modal-head button.app-window-close {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #fff;
  background: var(--btn-danger);
  box-shadow: inset 0 -2px 0 #0002;
  font-size: 0;
  line-height: 1;
  opacity: 1;
  cursor: pointer;
  transform: none;
  transition: background .15s, box-shadow .15s;
}
button.app-window-close::before,
.app-modal-head button.app-window-close::before {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  background: currentColor;
  clip-path: polygon(11% 0, 50% 39%, 89% 0, 100% 11%, 61% 50%, 100% 89%, 89% 100%, 50% 61%, 11% 100%, 0 89%, 39% 50%, 0 11%);
  pointer-events: none;
}
button.app-window-close > * { display: none; }
button.sidebar-close.app-window-close { display: none; }
@media (max-width: 1024px) { button.sidebar-close.app-window-close { display: inline-flex; } }
button.app-window-close:hover { background: color-mix(in srgb, var(--btn-danger) 94%, black); color: #fff; transform: none; }
button.app-window-close:focus-visible { outline: 2px solid var(--accent-strong, #b5abfc); outline-offset: 3px; }
dialog[data-modal], dialog.sharing-dialog {
  margin: 24px auto auto;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.app-modal-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.app-modal-head > form { flex: 0 0 auto; margin: 0; }
.app-modal-head h2 { margin: 0; }
.app-modal-head .app-window-close { align-self: start; }
.auth-agreement-version { margin-left: auto; }
html:has(dialog:modal) { overflow: hidden; }

/* Wide enough for the login description's two balanced lines, no wider. */
dialog#cookie-modal {
  width: min(368px, calc(100vw - 2rem));
  min-width: 0;
  margin: auto;
}
#cookie-modal .app-modal-body { padding: 20px; }
#cookie-modal .app-modal-head { align-items: center; margin-bottom: 14px; }
#cookie-modal .app-modal-head h2 { font-size: 20px; line-height: 1.25; }
#cookie-modal .cookie-modal-text {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  text-wrap: pretty;
}
#cookie-modal .cookie-modal-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-raised);
}
#cookie-modal .cookie-modal-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
#cookie-modal .cookie-modal-option-text { gap: 4px; line-height: 19px; }
#cookie-modal .cookie-modal-option-text strong { font-size: 13px; font-weight: 650; }
#cookie-modal .cookie-modal-option-desc { font-size: 13px; line-height: 19px; text-wrap: balance; }
#cookie-modal .cookie-modal-actions { justify-content: center; gap: 10px; margin-top: 16px; }
#cookie-modal .cookie-modal-actions .btn { flex: 0 0 auto; width: auto; min-height: 40px; padding-inline: 16px; font-size: 13px; }
#cookie-modal .cookie-modal-message:empty { display: none; }
@media (max-width: 520px) {
  #cookie-modal .app-modal-body { padding: 18px; }
  #cookie-modal .cookie-modal-option-desc { text-wrap: pretty; }
}
.toast button.toast-close.app-window-close {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  flex-basis: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: inherit;
  box-shadow: none;
  transform: translateY(-50%);
}
.toast button.toast-close.app-window-close::before { width: 14px; height: 14px; }
.toast button.toast-close.app-window-close:hover { background: rgba(0, 0, 0, 0.4); }
.toast:has(.app-window-close) { min-height: 56px; padding-right: 56px; }

/* The one tooltip for every data-tooltip (promotion-tooltips.js), also on the standalone agreement page. */
.promotion-field-tooltip {
  position: fixed;
  z-index: 10000;
  width: max-content;
  max-width: min(22rem, calc(100vw - 1rem));
  padding: 0.6rem 0.75rem;
  color: #f1f4f7;
  background: #252b34;
  border: 1px solid #4d5968;
  border-radius: 0.45rem;
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 18%);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  white-space: pre-line;
  pointer-events: none;
}

.promotion-field-tooltip[hidden] {
  display: none;
}

/* Creator badge (src/Views/CreatorBadge.php). One rounded square at every
   size: a gradient fill (or the creator's image), letters that scale with the
   badge, and a border artwork overlay. Sizes come from each context's size
   class; nothing here sets a width. */

.creator-avatar-frame.creator-badge {
  --badge-base: var(--creator-badge-color, #7b61ff);
  position: relative;
  display: inline-block;
  flex: none;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 22%;
  background: none;
  overflow: visible;
  isolation: isolate;
  container: creator-badge / size;
  vertical-align: middle;
}

/* The face starts inside the border ring (about 1.6-7% of the badge in every
   border artwork), so its edge stays hidden under the ring. */
.creator-badge > .creator-badge-fill,
.creator-badge > .creator-avatar-image {
  position: absolute;
  top: 3.5%;
  left: 3.5%;
  width: 93%;
  height: 93%;
  max-width: none;
  border-radius: 20%;
}

/* A multi-tone gradient from one base colour: lighter, warmer light from the
   top left, deeper shade towards the bottom right. */
.creator-badge-fill {
  z-index: 0;
  background:
    radial-gradient(120% 90% at 12% 0%, color-mix(in srgb, var(--badge-base) 55%, #fff) 0%, transparent 58%),
    radial-gradient(110% 100% at 100% 100%, color-mix(in srgb, var(--badge-base) 45%, #000) 0%, transparent 70%),
    linear-gradient(150deg, var(--badge-base), color-mix(in srgb, var(--badge-base) 62%, #0b0b14));
  background:
    radial-gradient(120% 90% at 12% 0%, oklch(from var(--badge-base) calc(l + 0.15) calc(c * 1.05) calc(h - 16) / 0.95) 0%, transparent 60%),
    radial-gradient(110% 100% at 100% 100%, oklch(from var(--badge-base) calc(l - 0.2) calc(c * 0.95) calc(h + 24)) 0%, transparent 72%),
    linear-gradient(150deg, oklch(from var(--badge-base) calc(l + 0.04) c calc(h - 6)), oklch(from var(--badge-base) calc(l - 0.13) c calc(h + 14)));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), inset 0 -6cqi 12cqi rgb(0 0 0 / 0.22);
}

.creator-badge-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(168deg, rgb(255 255 255 / 0.2), rgb(255 255 255 / 0.04) 44%, transparent 45%);
  pointer-events: none;
}

.creator-badge > .creator-avatar-image {
  z-index: 1;
  object-fit: cover;
  display: block;
}

/* Two classes so caption rules such as ".x .caption span" cannot resize the text. */
.creator-avatar-frame.creator-badge > .creator-avatar-initials {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  padding: 0 0 0.02em;
  background: none;
  color: #fff;
  font-family: Inter, "Segoe UI", sans-serif;
  /* CreatorBadge::textSize fits the text to the inner face at every size. */
  font-size: var(--badge-text-size, 41cqi);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  text-indent: -0.045em;
  text-shadow: 0 0.03em 0.1em rgb(0 0 0 / 0.42);
  white-space: pre;
  text-transform: none;
}

.creator-badge:not([data-badge-letters="1"], [data-badge-letters="2"]) > .creator-avatar-initials { letter-spacing: -0.06em; }

.creator-badge > .creator-avatar-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Chip sizes: the border artwork would only blur into the letters, so the
   badge becomes a plain full-size gradient tile with slightly larger text. */
@container creator-badge (max-width: 30px) {
  .creator-avatar-overlay { display: none; }
  .creator-badge-fill,
  .creator-avatar-image { top: 0; left: 0; width: 100%; height: 100%; border-radius: 24%; }
  .creator-badge-fill { box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28); }
  .creator-badge-fill::after { display: none; }
  .creator-avatar-frame.creator-badge > .creator-avatar-initials { font-size: calc(var(--badge-text-size, 41cqi) * 1.16); letter-spacing: -0.03em; text-indent: -0.03em; }
  .creator-badge:not([data-badge-letters="1"], [data-badge-letters="2"]) > .creator-avatar-initials { letter-spacing: -0.05em; }
}

/* Size classes introduced with the shared badge. */
/* Wide enough (over the 30px chip limit) for the border artwork to show. */
.creator-avatar-frame--sidebar { width: 34px; height: 34px; }
.creator-avatar-frame--picker { width: 64px; height: 64px; }

/* Appearance editor: border picker. Each option is the creator's own badge. */
.creator-frame-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  width: 100%;
}

.creator-workspace .creator-frame-options { gap: 8px; }

.creator-workspace .creator-frame-option,
.creator-frame-option {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 10px 6px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: color-mix(in srgb, var(--scheme-raised, #23242b) 40%, transparent);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.creator-frame-option > span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.creator-workspace .creator-frame-option:hover,
.creator-frame-option:hover { background: color-mix(in srgb, var(--scheme-raised, #23242b) 85%, transparent); color: var(--text); }

.creator-workspace .creator-frame-option:has(input:checked),
.creator-frame-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 75%, transparent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: none;
  color: var(--text);
}

.creator-frame-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.creator-frame-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Badge colour swatches preview the same gradient as the badge. */
.creator-workspace .creator-badge-swatches .creator-badge-swatch,
.creator-badge-swatch {
  --badge-base: var(--creator-badge-color, #7b61ff);
  position: relative;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  flex: 0 0 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(120% 90% at 12% 0%, color-mix(in srgb, var(--badge-base) 55%, #fff) 0%, transparent 58%),
    linear-gradient(150deg, var(--badge-base), color-mix(in srgb, var(--badge-base) 62%, #0b0b14));
  background:
    radial-gradient(120% 90% at 12% 0%, oklch(from var(--badge-base) calc(l + 0.15) calc(c * 1.05) calc(h - 16) / 0.95) 0%, transparent 60%),
    radial-gradient(110% 100% at 100% 100%, oklch(from var(--badge-base) calc(l - 0.2) calc(c * 0.95) calc(h + 24)) 0%, transparent 72%),
    linear-gradient(150deg, oklch(from var(--badge-base) calc(l + 0.04) c calc(h - 6)), oklch(from var(--badge-base) calc(l - 0.13) c calc(h + 14)));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.28), inset 0 0 0 1px rgb(255 255 255 / 0.08);
  cursor: pointer;
}

/* Round 10 mockup layer. Built only from the site's own tokens and components. */

/* ---- Page frame: title and tabs on one row, as on Earnings ---- */
.profile-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.profile-editor-heading .creator-settings-tabs { display: flex; margin: 0; }
.profile-editor .creator-settings-tab { cursor: pointer; }

.profile-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 18px; }
.profile-editor-controls { display: grid; gap: 16px; min-width: 0; }
.profile-pane { display: grid; gap: 22px 28px; }
.profile-pane[hidden] { display: none; }
.profile-editor-actions { display: flex; justify-content: flex-end; margin: 0; }

/* ---- Preview band: the real components at their real size, above the controls ---- */
.profile-preview-band { min-width: 0; }
.profile-preview-band.is-sticky { position: sticky; top: var(--app-header-h, 60px); z-index: 20; padding: 12px 0; margin: -12px 0; background: linear-gradient(var(--bg, #17181c) 82%, transparent); }
.profile-preview-band > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; min-width: 0; }
.profile-preview-band > div[hidden] { display: none; }
.profile-preview { display: grid; gap: 8px; margin: 0; min-width: 0; }
.profile-preview > * { min-width: 0; }
.profile-preview > figcaption { font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.profile-preview-band .creator-preview-surface { margin: 0; }
.profile-preview-band a, .profile-preview-band label, .profile-preview-band button { pointer-events: none; }
.profile-preview-page { margin: 0; padding: 0; }
.profile-preview-page .creator-profile-feature { margin: 0; }
.profile-fit { min-width: 0; overflow: hidden; }
.profile-fit > * { margin: 0; }

/* Two-column panes on wide screens */
.profile-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px 28px; align-items: start; }
.profile-col { display: grid; gap: 22px; min-width: 0; }

/* ---- Fields ---- */
.profile-field { display: grid; gap: 8px; min-width: 0; }
.profile-field > .form-label { margin: 0; }
.profile-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-field-head .btn, .profile-picture-row .btn { flex: none; width: auto; }
.profile-hint { margin: -2px 0 2px; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.profile-pane textarea.form-control { min-height: 96px; resize: vertical; }
.profile-pane .form-control.profile-letters { width: 220px; max-width: 100%;font-weight: 700; letter-spacing: .02em; }

/* ---- Badge style choice: each option shows what it does ---- */
.profile-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.profile-style { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: color-mix(in srgb, var(--surface-raised) 45%, transparent); cursor: pointer; transition: background-color .15s, border-color .15s; }
.profile-style:hover { background: color-mix(in srgb, var(--surface-raised) 85%, transparent); }
.profile-style:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 75%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.profile-style:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-style input { position: absolute; opacity: 0; pointer-events: none; }
.profile-style strong { display: block; font-size: 14.5px; color: var(--text); }
.profile-style small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-muted); }
.profile-style-badge { display: grid; place-items: center; width: 52px; height: 52px; flex: none; }
.profile-style-empty { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--surface-raised); color: var(--text-muted); }
.profile-style-empty svg { width: 22px; height: 22px; fill: currentColor; }
.profile-letters-fields, .profile-picture-fields { display: grid; gap: 22px; }
.profile-letters-fields[hidden], .profile-picture-fields[hidden] { display: none; }
.profile-picture-row { display: flex; align-items: center; gap: 14px; }
.profile-picture-thumb { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--surface-raised); color: var(--text-muted); font-size: 11.5px; text-align: center; }
.profile-picture-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-border-field .creator-frame-options { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }

/* ---- Badge sizes preview ---- */
.profile-badge-sizes { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 18px 20px; min-height: 201px; border-radius: 14px; background: var(--bg, #17181c); border: 1px solid var(--border); }
.profile-badge-sizes figure { margin: 0; display: grid; justify-items: center; gap: 8px; }
.profile-badge-sizes figcaption { display: grid; justify-items: center; font-size: 11.5px; line-height: 1.3; color: var(--text-muted); white-space: nowrap; }
.profile-badge-sizes figcaption b { color: var(--text-soft); font-weight: 700; }

/* ---- Background ---- */
.profile-pane .creator-background-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.profile-adjust { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.profile-range { display: grid; gap: 8px; min-width: 0; }
.profile-range .form-label { display: flex; justify-content: space-between; margin: 0; }
.profile-range output { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.profile-range input[type=range] { width: 100%; accent-color: var(--accent); }
.profile-range input[type=range]:disabled { opacity: .45; }
.profile-range-inner { display: grid; gap: 8px; }
.profile-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.profile-check input { margin: 0; }

/* ---- Card pictures: slots in card order ---- */
.profile-picture-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 116px)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.profile-picture-slots li { display: grid; gap: 6px; min-width: 0; }
.profile-picture-slot { position: relative; display: block; padding: 0; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; overflow: hidden; background: var(--surface-raised); cursor: pointer; aspect-ratio: 9 / 16; transition: border-color .15s, transform .15s; }
.profile-picture-slot:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.profile-picture-slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-slot-img, .profile-slot-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-picture-slot.is-auto .profile-slot-img img { filter: saturate(.7) brightness(.78); }
.profile-slot-number { position: absolute; top: 6px; left: 6px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; background: rgb(0 0 0 / .62); color: #fff; font-size: 12px; font-weight: 800; }
.profile-picture-slot:not(.is-auto) .profile-slot-number { background: var(--accent); color: var(--on-accent, #06120f); }
.profile-slot-auto { position: absolute; top: 6px; right: 6px; padding: 2px 8px; border-radius: 99px; background: rgb(0 0 0 / .6); color: #fff; font-size: 12px; font-weight: 700; }
.profile-slot-title { font-size: 12px; line-height: 1.3; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Shared colour picker ---- */
.app-color-picker { position: relative; max-width: 320px; --pick: #3FB4A3; }
.app-color-trigger { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 12px 6px 6px; color: var(--text); text-align: left; cursor: pointer; }
.app-color-chip { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--pick); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14), inset 0 1px 0 rgb(255 255 255 / .25); }
.app-color-hex-value { font-weight: 750; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.app-color-name { color: var(--text-muted); font-size: 13px; }
.app-color-picker.is-empty .app-color-name { color: var(--text-soft); font-size: 14px; }
.app-color-chevron { width: 18px; height: 18px; margin-left: auto; fill: var(--text-muted); }
.app-color-popover { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; display: grid; gap: 12px; width: 288px; padding: 14px; border: 1px solid var(--border-strong, var(--border)); border-radius: 16px; background: var(--surface-raised); box-shadow: 0 18px 50px rgb(0 0 0 / .5); }
.app-color-popover[hidden] { display: none; }
.app-color-sv { position: relative; height: 160px; border-radius: 10px; background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--hue, #0ff)); cursor: pointer; touch-action: none; }
.app-color-sv-thumb { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #fff; border-radius: 50%; background: var(--pick); box-shadow: 0 0 0 1px rgb(0 0 0 / .45), 0 2px 6px rgb(0 0 0 / .4); pointer-events: none; }
.app-color-hue { position: relative; height: 14px; border-radius: 99px; background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); cursor: pointer; touch-action: none; }
.app-color-hue-thumb { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgb(0 0 0 / .45), 0 2px 6px rgb(0 0 0 / .4); pointer-events: none; }
.app-color-row { display: flex; align-items: center; gap: 10px; }
.app-color-now { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--pick); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); }
.app-color-hex { display: flex; align-items: center; gap: 8px; flex: 1; margin: 0; color: var(--text-muted); font-size: 12.5px; font-weight: 700; }
.app-color-hex input { flex: 1; min-width: 0; text-transform: uppercase; font-weight: 750; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.app-color-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.app-color-preset { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14); cursor: pointer; }
.app-color-preset[aria-pressed=true] { box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 4px #fff; }
.app-color-footer { display: flex; justify-content: space-between; gap: 8px; }
.app-color-picker .app-color-footer .btn { min-width: 0; padding-inline: 8px; font-size: 12px !important; white-space: nowrap; }

/* ---- Upload window (app-modal) ---- */
dialog.profile-upload-window { width: min(440px, calc(100vw - 2rem)); margin: auto; }
.profile-upload-window .app-modal-body { padding: 20px; display: grid; gap: 16px; }
.profile-upload-window .app-modal-head h2 { font-size: 20px; line-height: 1.25; }
.profile-upload-spec { display: grid; margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.profile-upload-spec[hidden] { display: none; }
.profile-upload-spec > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 11px 14px; }
.profile-upload-spec > div:nth-child(odd) { background: color-mix(in srgb, var(--surface-raised) 70%, transparent); }
.profile-upload-spec dt { color: var(--text-muted); font-size: 13px; font-weight: 650; }
.profile-upload-spec dd { margin: 0; color: var(--text); font-size: 13.5px; font-weight: 600; }
.profile-upload-actions { display: flex; justify-content: center; gap: 10px; margin: 0; }
.profile-crop { display: grid; justify-items: center; gap: 12px; }
.profile-crop[hidden] { display: none; }
.profile-crop .profile-range { width: 220px; }
.profile-crop .profile-hint { margin: 0; }
.profile-crop-stage { position: relative; width: 220px; height: 220px; overflow: hidden; border-radius: 24%; background: #000; cursor: pointer; touch-action: none; }
.profile-crop-stage img { position: absolute; max-width: none; user-select: none; pointer-events: none; }
.profile-crop-mask { position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .55); pointer-events: none; }

/* ---- Narrower screens ---- */
@media (max-width: 1024px) {
  .profile-cols { grid-template-columns: minmax(0, 1fr); }
  .profile-editor-heading { display: grid; }
  .profile-editor-heading .creator-settings-tabs { justify-self: stretch; display: grid; grid-template-columns: repeat(4, auto); }
  .profile-editor-heading .creator-settings-tab { text-align: center; padding-inline: .5rem; }
}
@media (max-width: 640px) {
  .profile-picture-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-styles, .profile-adjust { grid-template-columns: minmax(0, 1fr); }
  .profile-pane .creator-background-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-badge-sizes { gap: 6px; padding: 12px 10px; min-height: 0; }
  .profile-badge-sizes figure { flex: 1 1 0; min-width: 0; }
  .profile-badge-sizes figcaption { white-space: normal; text-align: center; font-size: 10.5px; }
  .profile-editor-heading .creator-settings-tab { font-size: .8rem; padding-inline: .35rem; }
  .app-color-picker { max-width: none; }
  .app-color-popover { width: 100%; }
}

/* Keep editor integration scoped so the rest of the workspace is unaffected. */
.creator-workspace:has(.profile-editor) > .creator-page-header { align-items: center; flex-wrap: wrap; gap: 16px; }
.creator-workspace:has(.profile-editor) .creator-page-actions { margin: 0; }
.profile-editor-tabs { display: flex; margin: 0; }
.profile-editor-tabs button { cursor: pointer; font-family: inherit; min-height: 34px; padding: 0 16px; }
.profile-editor-tabs .creator-settings-tab { background: var(--surface); }
.profile-editor-tabs .creator-settings-tab.is-active { background: color-mix(in srgb, var(--scheme-text) 10%, var(--surface)); }
.profile-editor form { min-width: 0; }
.profile-preview-band [data-profile-preview][hidden], .profile-fit[hidden] { display: none; }
.profile-preview-band .profile-fit > .creator-preview-surface { max-width: none; }
.profile-preview-band .creator-table--cards tbody { display: grid; grid-template-columns: minmax(0, 1fr); }
.profile-preview-band .creator-card-previews { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.profile-preview-band .creator-card-previews img { width: 100%; height: 100%; object-fit: cover; }
.profile-preview-band .creator-row--compact { position: relative; isolation: isolate; overflow: hidden; }
.profile-preview-band .creator-profile-banner { min-height: 170px; display: flex; align-items: center; padding: 0; border-radius: 18px; }
.profile-preview-band .creator-profile-banner-content { padding: 20px; }
.profile-preview-band .creator-description:empty { display: none; }
.profile-style-badge .creator-avatar-frame { width: 52px; height: 52px; }
.profile-border-field > .setting-row-desc { margin: -2px 0 2px; font-size: 13px; }
.profile-editor .creator-accent-options { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-editor .creator-accent-option { width: 38px; height: 38px; padding: 4px; border-radius: 10px; background: var(--surface-raised); }
.profile-editor .creator-accent-swatch { width: 28px; height: 28px; border-radius: 7px; }
.profile-editor .creator-accent-option:has(input:checked) { background: color-mix(in srgb, var(--accent) 30%, var(--surface-raised)); outline: 2px solid var(--accent); outline-offset: 1px; }
.profile-editor .creator-frame-option input { accent-color: var(--accent); }
.profile-editor-actions { justify-content: flex-end; }
.profile-editor-actions [data-form-message]:empty { display: none; }
.profile-picture-slot [data-slot-picture] { pointer-events: none; }
.profile-picture-slot .profile-slot-auto[hidden] { display: none; }
.profile-picture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; max-height: 56vh; overflow: auto; padding: 4px; }
.profile-picture-grid .profile-picture-option { position: relative; border-radius: 12px; cursor: pointer; background: var(--surface-raised); }
.profile-picture-grid .profile-picture-option[hidden] { display: none; }
.profile-picture-grid .profile-picture-option[aria-selected=true] { box-shadow: 0 0 0 3px var(--accent); }
.profile-picture-grid .profile-picture-option[aria-selected=true]::after { content: "\2713"; position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff; background: var(--accent); font-weight: 800; pointer-events: none; }
.profile-picture-grid .creator-gallery-card { margin: 0; min-height: 0; aspect-ratio: 9 / 16; overflow: hidden; border: 0; }
.profile-picture-grid .creator-gallery-media { display: block; position: absolute; inset: 0; }
.profile-picture-grid .creator-gallery-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-picture-grid .creator-gallery-bar { position: absolute; inset: auto 0 0; padding: 28px 10px 12px; background: linear-gradient(transparent, #000e); pointer-events: none; }
.profile-picture-grid .creator-gallery-title { display: block; margin: 0; padding: 0; font-size: 14px; line-height: 1.35; color: #fff; white-space: normal; overflow-wrap: anywhere; }
.profile-picture-grid .creator-gallery-title > span { color: #fff; }
.profile-picture-grid .creator-gallery-title .content-version-tag { display: block; color: #ddd; font-size: 12px; }
.profile-picture-grid .creator-release-facts, .profile-picture-grid .creator-release-top, .profile-picture-grid .creator-gallery-taxonomy { display: none; }
[data-profile-picture-picker] .content-picker-options { display: none; }
[data-profile-picture-picker] .content-picker-toolbar { margin: 0; }
.app-color-trigger { min-height: 42px; background: var(--surface-raised); }
.app-color-chip { display: block; }
.app-color-popover { max-width: calc(100vw - 64px); }
.app-color-sv [data-color-sv-thumb] { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #fff; border-radius: 50%; background: var(--pick); box-shadow: 0 0 0 1px #0008; pointer-events: none; }
input.app-color-hue { appearance: none; width: 100%; margin: 3px 0; border: 0; background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
input.app-color-hue::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; background: transparent; box-shadow: 0 0 0 1px #0008; }
.app-color-hex input { width: 0; }
.app-color-custom-presets { display: flex; flex-wrap: wrap; gap: 12px; }
.app-color-custom-presets:empty { display: none; }
.app-color-custom { position: relative; display: inline-flex; padding-right: 8px; }
.app-color-remove { position: absolute; top: -6px; right: 0; display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 5px; background: #51525c; color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.app-color-picker .app-color-preset { flex: 0 0 20px; min-width: 20px; max-width: 20px; min-height: 20px !important; max-height: 20px; padding: 0; }
.app-color-picker .app-color-remove { min-width: 16px; max-width: 16px; min-height: 16px !important; max-height: 16px; padding: 0; }
.profile-upload-window .profile-upload-spec dd { line-height: 1.45; }
.profile-upload-window .profile-crop canvas { width: 220px; height: 220px; border-radius: 24%; background: #111; cursor: pointer; touch-action: none; }
.profile-background-upload-preview { display: block; max-width: 100%; max-height: 240px; margin: auto; border-radius: 10px; }
.profile-background-upload-preview[hidden] { display: none; }
.profile-upload-error { margin: 0; color: var(--danger, #f87883); font-size: 14px; }
.profile-upload-window [hidden] { display: none; }
/* Unsaved changes: a bar stuck to the bottom of the editor. It appears below the
   controls, never in the header, so nothing above it moves. */
.page-save-ready .profile-editor-actions { display: none; }
.profile-save-dock { position: sticky; bottom: 12px; z-index: 25; }
.profile-save-dock[hidden] { display: none; }
.profile-save-dock .page-save-bar { position: static; transform: none; width: 100%; min-height: 56px; gap: 10px; padding: 8px 10px 8px 18px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--chrome, var(--surface))); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent), 0 14px 36px rgb(0 0 0 / .5); }
.profile-save-dock .page-save-message { display: block; margin-right: auto; font-size: 14px; }
.profile-save-dock .page-save-bar .btn { min-width: 92px; }

/* Inline field errors */
.profile-editor .form-control.is-invalid { border-color: var(--danger, #e5484d); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger, #e5484d) 18%, transparent); }
.profile-field-error { margin: -2px 0 0; color: var(--danger, #e5484d); font-size: 13px; font-weight: 600; line-height: 1.35; }
.profile-field-error[hidden] { display: none; }

/* Picture picker: the full viewport height, search with filters and sort in one row,
   the grid scrolling between them and the pinned Cancel and Confirm. */
dialog[data-modal].app-modal-wide[data-profile-picture-picker] { width: min(1040px, calc(100vw - 2rem)); height: calc(100dvh - 2rem); max-height: none; margin: 1rem auto; }
[data-profile-picture-picker] > .app-modal-body { display: flex; flex-direction: column; gap: 16px; height: 100%; min-height: 0; box-sizing: border-box; }
[data-profile-picture-picker] .app-modal-head { flex: none; }
[data-profile-picture-picker] .content-picker-toolbar { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 12px; flex: none; }
[data-profile-picture-picker] .content-picker-toolbar > div { width: auto; min-width: 0; }
[data-profile-picture-picker] .content-picker-toolbar .form-select { width: 100%; }
[data-profile-picture-picker] [data-picker-count] { display: none; }
[data-profile-picture-picker] .profile-picture-grid { flex: 1 1 auto; min-height: 0; max-height: none; align-content: start; }
[data-profile-picture-picker] .content-picker-empty:not([hidden]) { flex: none; }
[data-profile-picture-picker] .content-picker-actions { flex: none; margin-top: 0; }

/* Card picture slots: drag to reorder; the chip shows a pinned version or picture. */
.profile-picture-slots li { touch-action: manipulation; }
.profile-picture-slot { -webkit-touch-callout: none; user-select: none; }
.profile-picture-slot img { -webkit-user-drag: none; }
.profile-slot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.profile-slot-actions .btn { min-width: 0; padding-inline: 4px; }
.profile-slot-pin { position: absolute; left: 6px; right: 6px; bottom: 6px; width: fit-content; max-width: calc(100% - 12px); padding: 2px 8px; border-radius: 99px; background: rgb(0 0 0 / .68); color: #fff; font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-slot-pin[hidden] { display: none; }
.profile-picture-slots li.is-drag-source .profile-picture-slot { border-style: dashed; border-color: var(--accent); }
.profile-picture-slots li.is-drag-source .profile-picture-slot > * { opacity: .25; }
.profile-slot-ghost { position: fixed; top: 0; left: 0; z-index: 1000; pointer-events: none; border-radius: 12px; box-shadow: 0 18px 40px rgb(0 0 0 / .55); opacity: .95; }
.profile-slot-ghost .profile-picture-slot { width: 100%; height: 100%; border-color: var(--accent); }
.profile-slot-ghost .profile-slot-number, .profile-slot-ghost .profile-slot-auto { display: none; }

/* Version and picture of one card picture. */
.profile-picture-detail { width: min(820px, calc(100vw - 2rem)); }
.profile-picture-detail .app-modal-body { display: grid; gap: 14px; }
.profile-detail-release { margin: -6px 0 0; color: var(--text-soft); font-weight: 600; }
.profile-detail-version { display: grid; gap: 6px; max-width: 280px; }
.profile-detail-version[hidden] { display: none; }
.profile-detail-pictures { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 10px; max-height: min(60vh, 640px); overflow: auto; padding: 4px; }
.profile-detail-picture { position: relative; display: block; padding: 0; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; overflow: hidden; background: var(--surface-raised); aspect-ratio: 9 / 16; cursor: pointer; }
.profile-detail-picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-detail-picture:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.profile-detail-picture:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-detail-picture[aria-selected=true] { box-shadow: 0 0 0 3px var(--accent); border-color: var(--accent); }
.profile-detail-picture[aria-selected=true] .profile-slot-number { background: var(--accent); color: var(--on-accent, #06120f); }
/* The second vignette layer extends the range above the former maximum. */
.creator-profile-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at center, transparent 25%, #000 100%); opacity: clamp(0, calc(var(--creator-art-vignette, 1) - 1), 1); pointer-events: none; }
@media (max-width: 1024px) {
  .creator-workspace:has(.profile-editor) > .creator-page-header { display: grid; }
  .profile-editor-tabs { display: grid; grid-template-columns: repeat(4, auto); width: 100%; }
  .profile-editor-tabs .creator-settings-tab { text-align: center; padding-inline: .5rem; }
}
@media (max-width: 640px) {
  .profile-editor-tabs .creator-settings-tab { font-size: .8rem; padding-inline: .35rem; }
  .profile-preview-band .creator-profile-banner-content { padding: 12px; }
  .profile-badge-sizes .creator-avatar-frame--header { width: 56px; height: 56px; }
  .profile-badge-sizes .creator-avatar-frame--picker { width: 64px; height: 64px; }
  .profile-picture-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-profile-picture-picker] .content-picker-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-profile-picture-picker] .content-picker-toolbar > div:first-child { grid-column: 1 / -1; }
  .profile-detail-pictures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-save-dock { bottom: 8px; }
  .profile-save-dock .page-save-bar { min-height: 52px; padding: 7px 8px 7px 14px; }
  .profile-save-dock .page-save-message { font-size: 13px; white-space: normal; line-height: 1.25; }
  .profile-save-dock .page-save-message { flex: 1 1 auto; min-width: 0; }
  .profile-save-dock .page-save-bar .btn { flex: none; width: auto; min-width: 0; padding-inline: 16px; }
  .profile-badge-sizes figure { flex: 1 1 auto; min-width: min-content; }
  .profile-editor .profile-cols { grid-template-columns: minmax(0, 1fr); }
}

.profile-badge-sizes .creator-avatar-frame { width: var(--profile-badge-size); height: var(--profile-badge-size); }
.profile-preview-band .creator-card-media { --creator-thumb-count: 6 !important; aspect-ratio: 54 / 16; }
.profile-preview-band .creator-card-previews { --creator-thumb-count: 6 !important; }
@media (max-width: 640px) {
  .creator-workspace .profile-editor-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 2px; }
  .creator-workspace .profile-editor-tabs .creator-settings-tab { min-width: 0; padding: 0 4px; font-size: 12px !important; white-space: nowrap; }
  .profile-badge-sizes .creator-avatar-frame--header { --profile-badge-size: 76px !important; }
}

.profile-style-badge.is-empty > .creator-avatar-frame { display: none; }
.profile-style-empty[hidden] { display: none; }

.profile-upload-window:not([data-image-kind="badge"]) .profile-crop canvas { width: auto; max-width: 100%; height: auto; max-height: 280px; border-radius: 10px; }

/* SUB262 Creator onboarding: the application page, Admin > Creators,
 * Trusted Creators, publish review in the release panel, and the creator tour. */

/* ---- Apply as a creator ------------------------------------------------- */
/* SUB300 The form's panels on the left, the FAQ beside them; on narrow screens the FAQ follows. */
.creator-apply-layout {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.creator-apply-layout.has-faq {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.creator-apply-main,
.creator-apply-form {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.creator-apply-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.creator-apply-fields > .is-wide {
  grid-column: 1 / -1;
}

.creator-apply-fields .form-label {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.creator-apply-fields > div > .form-label {
  display: block;
  margin-bottom: 0.35rem;
}

.creator-apply-fields :is(.form-control, .form-select) {
  width: 100%;
  max-width: none;
}

.creator-apply-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.creator-apply-status .section-heading {
  align-items: center;
}

.creator-apply-summary {
  display: grid;
  gap: 1rem;
  margin: 0 0 1rem;
}

.creator-apply-summary h3 {
  margin: 0 0 0.5rem;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.creator-apply-summary dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1.25rem;
  margin: 0;
}

.creator-apply-summary dl > div:has(> dd > br),
.creator-apply-summary dl > .is-wide {
  grid-column: 1 / -1;
}

.creator-apply-summary dt {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.creator-apply-summary dd {
  margin: 0.15rem 0 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.creator-apply-links {
  display: grid;
  gap: 0.2rem;
}

.creator-apply-faq {
  position: sticky;
  top: calc(var(--app-header-height, 64px) + 1rem);
  display: grid;
  gap: 0.5rem;
}

.creator-apply-faq .section-heading {
  margin-bottom: 0.25rem;
}

.creator-apply-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-raised, rgba(255, 255, 255, 0.03));
}

.creator-apply-faq-item > summary {
  padding: 0.7rem 0.85rem;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.creator-apply-faq-answer {
  padding: 0 0.85rem 0.8rem;
  color: var(--text-soft);
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .creator-apply-layout.has-faq {
    grid-template-columns: minmax(0, 1fr);
  }

  .creator-apply-faq {
    position: static;
  }
}

@media (max-width: 720px) {
  .creator-apply-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Admin > Creators: Applications and Publish requests ---------------- */
.admin-approval-table td:first-child {
  white-space: nowrap;
}

/* Both queues fit the page at 1280 wide and up: headings and titles wrap, and
 * below 1400 wide the time goes under the date, emails break and Approve and
 * Decline stack. */
.admin-approval-table .creator-ledger-heading {
  white-space: normal;
}

@media (max-width: 1399px) {
  .admin-approval-sent-separator {
    display: none;
  }

  .admin-approval-sent > span:last-child {
    display: block;
  }

  .admin-approval-table .table-two-line span {
    overflow-wrap: anywhere;
  }

  .admin-approval-table .admin-name-request-actions {
    flex-wrap: wrap;
  }
}

.admin-approval-table .admin-name-request-actions [data-form-message]:empty {
  display: none;
}

.admin-approval-table .admin-report-reason {
  min-width: 9rem;
  white-space: normal;
}

.admin-approval-links {
  display: grid;
  gap: 0.2rem;
}

.admin-approval-links a,
.admin-approval-links span {
  display: block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-approval-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-creators .admin-operations-panel > .empty-state {
  margin-top: 1rem;
}

.admin-approval-requests .ui-item-name .cell-clip {
  white-space: normal;
}

.admin-creators-applications-open [data-form-message]:empty {
  display: none;
}

/* ---- Admin > Creators > Trusted Creators --------------------------------- */
.admin-trusted-creator .section-heading {
  align-items: center;
}

.admin-trusted-creator .section-heading p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
}

.admin-trusted-permissions {
  display: grid;
  gap: 0.55rem;
  max-width: none;
}

/* ---- Publish review in the release panel --------------------------------- */
.creator-release-panel .section-heading .ui-capsule {
  align-self: center;
}

.creator-release-note {
  margin: -0.25rem 0 0.75rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.creator-release-panel .creator-release-note.is-warning {
  color: var(--warning);
}

.creator-release-panel .creator-release-note.is-danger {
  color: var(--danger);
}

.creator-release-actions {
  align-items: center;
  gap: 0.75rem;
}

.status-word-review {
  color: #8ec5f5;
}

.status-chip-in-review {
  border-color: rgba(95, 168, 224, 0.42);
  color: #9fd0f7;
  background: rgba(95, 168, 224, 0.12);
}

/* ---- Creator tour -------------------------------------------------------- */
.creator-tour {
  position: fixed;
  inset: 0;
  z-index: 1300;
}

.creator-tour-shade {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.65);
  backdrop-filter: blur(2px);
}

.creator-tour-spotlight {
  position: fixed;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(5, 7, 10, 0.65);
  pointer-events: none;
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.creator-tour-card {
  position: fixed;
  left: 50%;
  bottom: 16px;
  width: min(360px, calc(100vw - 24px));
  padding: 1.1rem 1.2rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  outline: none;
}

.creator-tour.is-anchored .creator-tour-card {
  bottom: auto;
  transform: none;
}

.creator-tour.is-anchored .creator-tour-card::before {
  content: "";
  position: absolute;
  top: calc(50% - 7px);
  left: -8px;
  width: 14px;
  height: 14px;
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
  transform: rotate(45deg);
}

.creator-tour-count {
  margin: 0 0 0.35rem;
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.creator-tour-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.creator-tour-text {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.creator-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
}

.creator-tour-nav {
  display: flex;
  gap: 0.5rem;
}

.creator-tour [hidden] {
  display: none !important;
}

.creator-tour .btn {
  flex: 0 0 auto;
  width: auto;
}


.admin-approval-table .admin-name-request-actions > * {
  flex: 1 1 0;
}

.admin-approval-table .admin-name-request-actions form .btn {
  width: 100%;
}

.creator-release-panel [hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .admin-trusted-creator .section-heading > .ui-capsule {
    align-self: flex-start;
  }
}

/* ---- SUB300/SUB301 Admin > Creators: who may apply, review, invitations, FAQ ---- */
.admin-creators-switches {
  display: grid;
  gap: 0.6rem;
  max-width: 34rem;
}

.admin-creators-applications-open {
  margin-bottom: 1rem;
}

.admin-application-review > .app-modal-body {
  width: min(880px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.admin-application-account {
  margin: -0.25rem 0 1rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.admin-application-review .admin-approval-dialog-actions {
  flex-wrap: wrap;
  align-items: flex-start;
}

.admin-application-review .admin-approval-dialog-actions [data-form-message]:empty {
  display: none;
}

.admin-creators-invite {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-creators-invite > .form-label {
  display: grid;
  flex: 0 1 420px;
  gap: 0.35rem;
  margin: 0;
}

.admin-creators-invite > .ui-capsule {
  align-self: center;
}

.admin-creators-invite [data-form-message]:empty {
  display: none;
}

.admin-invite-link-cell {
  max-width: 22rem;
}

.admin-invite-link {
  display: block;
  max-width: 20rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.admin-faq {
  display: grid;
  gap: 0.85rem;
}

.admin-faq-entry {
  display: grid;
  gap: 0.6rem;
}

.admin-faq-entry .form-label {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.admin-faq-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.admin-faq-entry [data-form-message]:empty {
  display: none;
}

.admin-faq-new-heading {
  margin: 0.75rem 0 0;
  font-size: 1rem;
}

.admin-faq-entry .form-control {
  width: 100%;
  max-width: none;
}

.creator-apply-summary a {
  overflow-wrap: anywhere;
}
