/* ==========================================================================
   The Fence — design system
   Dark by default, light theme via [data-theme="light"] or the OS setting.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0a0c11;
  --bg-2: #0e1117;
  --surface: #12151d;
  --surface-2: #171b25;
  --surface-3: #1e2330;
  --surface-hover: #1b202b;
  --line: rgba(255, 255, 255, .065);
  --line-2: rgba(255, 255, 255, .11);
  --line-3: rgba(255, 255, 255, .18);
  --text: #eef1f7;
  --text-2: #b3bccc;
  --muted: #7b8597;
  --accent: #ffb547;
  --accent-2: #ff7a3d;
  --accent-grad: linear-gradient(135deg, #ffd166 0%, #ff9a3d 55%, #ff7a3d 100%);
  --accent-ink: #1b1206;
  --accent-soft: rgba(255, 181, 71, .12);
  --accent-line: rgba(255, 181, 71, .35);
  --good: #3ddc97;
  --good-soft: rgba(61, 220, 151, .12);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, .12);
  --info: #6aa8ff;
  --info-soft: rgba(106, 168, 255, .12);
  --like: #ff5d7a;
  --glow-1: rgba(255, 170, 60, .10);
  --glow-2: rgba(124, 92, 255, .09);
  --code-bg: #0b0e14;
  --chart-line: #cc8119;

  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 6px 18px rgba(0, 0, 0, .3);
  --ring: 0 0 0 3px rgba(255, 181, 71, .32);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --fast: 140ms;
  --med: 240ms;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --header-h: 68px;
  --container: 1240px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f5f6fa;
    --bg-2: #eef0f6;
    --surface: #ffffff;
    --surface-2: #f4f6fa;
    --surface-3: #e9edf4;
    --surface-hover: #f7f8fb;
    --line: rgba(15, 23, 42, .075);
    --line-2: rgba(15, 23, 42, .12);
    --line-3: rgba(15, 23, 42, .2);
    --text: #0e1320;
    --text-2: #414a5c;
    --muted: #6b7487;
    --accent: #e8900c;
    --accent-soft: rgba(232, 144, 12, .1);
    --accent-line: rgba(232, 144, 12, .4);
    --good: #0f9f6e;
    --bad: #dc3d4b;
    --info: #2f6fdb;
    --glow-1: rgba(255, 170, 60, .16);
    --glow-2: rgba(124, 92, 255, .1);
    --code-bg: #f3f5f9;
    --chart-line: #c47800;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 10px 30px -14px rgba(15, 23, 42, .2), 0 2px 6px rgba(15, 23, 42, .05);
    --shadow-lg: 0 30px 70px -24px rgba(15, 23, 42, .3), 0 6px 18px rgba(15, 23, 42, .06);
    --ring: 0 0 0 3px rgba(232, 144, 12, .25);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fa;
  --bg-2: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --surface-3: #e9edf4;
  --surface-hover: #f7f8fb;
  --line: rgba(15, 23, 42, .075);
  --line-2: rgba(15, 23, 42, .12);
  --line-3: rgba(15, 23, 42, .2);
  --text: #0e1320;
  --text-2: #414a5c;
  --muted: #6b7487;
  --accent: #e8900c;
  --accent-soft: rgba(232, 144, 12, .1);
  --accent-line: rgba(232, 144, 12, .4);
  --good: #0f9f6e;
  --bad: #dc3d4b;
  --info: #2f6fdb;
  --glow-1: rgba(255, 170, 60, .16);
  --glow-2: rgba(124, 92, 255, .1);
  --code-bg: #f3f5f9;
  --chart-line: #c47800;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 10px 30px -14px rgba(15, 23, 42, .2), 0 2px 6px rgba(15, 23, 42, .05);
  --shadow-lg: 0 30px 70px -24px rgba(15, 23, 42, .3), 0 6px 18px rgba(15, 23, 42, .06);
  --ring: 0 0 0 3px rgba(232, 144, 12, .25);
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 720px;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 8% -8%, var(--glow-1), transparent 65%),
    radial-gradient(800px 460px at 92% -12%, var(--glow-2), transparent 65%);
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5 { margin: 0; font-family: var(--font-display); line-height: 1.2; letter-spacing: -.015em; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(255, 181, 71, .3); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
code, kbd, pre { font-family: var(--mono); }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-weight: 600; transition: top var(--fast) var(--ease); }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 820px; }
main { flex: 1; padding-bottom: 72px; }

/* ------------------------------------------------------------------ header */

.announce {
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
}
.member-view-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px 16px; flex-wrap: wrap;
  padding: 8px 16px; font-size: 13.5px; font-weight: 600; color: var(--text);
  background: var(--info-soft); border-bottom: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
}
.member-view-bar > span { display: inline-flex; align-items: center; gap: 8px; }
.member-view-bar .i { color: var(--info); width: 16px; height: 16px; }
.member-view-bar .btn .i { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--med) var(--ease), background var(--med) var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -.02em; flex: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 6px 18px -6px rgba(255, 140, 50, .55); transition: transform var(--med) var(--spring); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-name span { color: var(--muted); font-weight: 600; }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a { padding: 8px 12px; border-radius: var(--pill); color: var(--text-2); font-weight: 550; font-size: 14.5px; transition: color var(--fast), background var(--fast); }
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.is-active { color: var(--text); background: var(--surface-2); }

.header-search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.header-search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 38px;
  border-radius: var(--pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 14px;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.header-search input::placeholder { color: var(--muted); }
.header-search input:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring); }
.header-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  transition: background var(--fast), color var(--fast), border-color var(--fast), transform var(--fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .badge-dot {
  position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--pill); background: var(--accent-2); color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .i-moon { display: none; }
}
.menu-toggle { display: none; }

/* user dropdown */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.avatar-btn { display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--surface); transition: border-color var(--fast), background var(--fast); }
.avatar-btn:hover { border-color: var(--line-3); }
.avatar-btn .i { width: 15px; height: 15px; color: var(--muted); transition: transform var(--med) var(--ease); }
.dropdown[open] .avatar-btn .i { transform: rotate(180deg); }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  padding: 6px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  animation: pop-in var(--med) var(--ease);
  z-index: 50;
}
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 14.5px; }
.menu-head span { color: var(--muted); font-size: 12.5px; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none;
  border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; text-align: left; transition: background var(--fast), color var(--fast);
}
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }
.menu .i { width: 17px; height: 17px; }
.menu hr { margin: 6px 0; }
.menu .count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: var(--pill); padding: 0 7px; }

/* mobile drawer */
.mobile-nav { display: none; }

/* ------------------------------------------------------------------ buttons */

.btn {
  --b-bg: var(--surface-2);
  --b-fg: var(--text);
  --b-line: var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--pill);
  border: 1px solid var(--b-line);
  background: var(--b-bg);
  color: var(--b-fg);
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  transition: transform var(--fast) var(--ease), background var(--fast), border-color var(--fast), box-shadow var(--med) var(--ease), filter var(--fast), color var(--fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { border-color: var(--line-3); background: var(--surface-3); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn .i { width: 17px; height: 17px; }
.btn-primary {
  --b-fg: var(--accent-ink);
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: 0 8px 22px -10px rgba(255, 140, 50, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { background: var(--accent-grad); border-color: transparent; filter: brightness(1.06) saturate(1.05); box-shadow: 0 12px 28px -10px rgba(255, 140, 50, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-outline { --b-bg: transparent; }
.btn-danger { --b-bg: var(--bad-soft); --b-fg: var(--bad); --b-line: transparent; }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-sm .i { width: 15px; height: 15px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.toggle-btn.is-on { --b-bg: var(--accent-soft); --b-line: var(--accent-line); color: var(--accent); }
.toggle-btn.like.is-on { --b-bg: rgba(255, 93, 122, .12); --b-line: rgba(255, 93, 122, .4); color: var(--like); }
.toggle-btn.is-on .i { fill: currentColor; }
.toggle-btn.pulse .i { animation: pulse .45s var(--spring); }

/* ------------------------------------------------------------------ forms */

.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field > label, .label { font-weight: 600; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.label .opt { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.err { color: var(--bad); font-size: 13px; margin: 0; display: flex; gap: 6px; align-items: flex-start; }
.err .i { width: 15px; height: 15px; margin-top: 3px; }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 14.5px;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.input, .select { height: 44px; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .85; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring); }
.has-error .input, .has-error .select, .has-error .textarea { border-color: rgba(255, 107, 107, .55); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.textarea.mono { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; word-break: break-all; }
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8597' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: right 13px center;
}
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0; border-radius: 6px; border: 1.5px solid var(--line-3); background: var(--surface); display: grid; place-items: center; transition: background var(--fast), border-color var(--fast); cursor: pointer; }
.check input::after { content: ""; width: 10px; height: 6px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform var(--fast) var(--spring); }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.check a { color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { grid-template-columns: repeat(3, 1fr); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ------------------------------------------------------------------ chips & badges */

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: 12.5px; font-weight: 550; color: var(--text-2); white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
a.chip:hover { border-color: var(--line-3); color: var(--text); }
.chip .i { width: 13px; height: 13px; }
.chip-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.chip-good { background: var(--good-soft); border-color: transparent; color: var(--good); }
.chip-bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.chip-info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.chip-lg { height: 34px; padding: 0 14px; font-size: 13.5px; }
.chip-x { margin-right: -4px; opacity: .6; }
a.chip:hover .chip-x { opacity: 1; }

.addon-mark {
  --c: #8b93a7;
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 92%, #fff 8%), color-mix(in srgb, var(--c) 70%, #000 30%));
  color: #fff; font-weight: 800; font-size: 10.5px; letter-spacing: -.02em; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 10px -4px color-mix(in srgb, var(--c) 70%, transparent);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.addon-mark-xs { width: 20px; height: 20px; border-radius: 6px; font-size: 8.5px; }
.addon-mark-md { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
.addon-mark-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 17px; }
.addon-mark-xl { width: 72px; height: 72px; border-radius: 20px; font-size: 22px; }
.addon-chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; color: var(--text-2); position: relative; z-index: 2; }
a.addon-chip:hover { color: var(--text); }

.class-pill {
  --cc: #999;
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px 0 8px;
  border-radius: var(--pill); background: color-mix(in srgb, var(--cc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--cc) 28%, transparent);
  font-size: 12.5px; font-weight: 600; color: var(--text); position: relative; z-index: 2; white-space: nowrap;
}
.class-pill .dot, .dot-c { width: 8px; height: 8px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--cc) 25%, transparent); flex: none; }

.avatar {
  --h1: 30; --h2: 80;
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(135deg, hsl(var(--h1) 75% 58%), hsl(var(--h2) 70% 45%));
  color: #fff; font-weight: 700; font-size: 13px; text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  border: 2px solid var(--surface);
}
.avatar-xs { width: 22px; height: 22px; font-size: 10px; border-width: 1.5px; }
.avatar-sm { width: 26px; height: 26px; font-size: 11px; border-width: 1.5px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 104px; height: 104px; font-size: 40px; border-width: 4px; }
.avatar-ghost { background: var(--surface-3); color: var(--muted); }
.user-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--text-2); position: relative; z-index: 2; min-width: 0; }
.user-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.user-link:hover { color: var(--text); }
.user-link.is-ghost { color: var(--muted); font-style: italic; font-weight: 500; }
.role-badge { display: inline-grid; place-items: center; color: var(--accent); }
.role-badge .i { width: 14px; height: 14px; fill: var(--accent-soft); }
.role-badge.is-mod { color: var(--info); }

/* ------------------------------------------------------------------ cards */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 16px; display: flex; gap: 9px; align-items: center; }
.card-head h2 .i, .card-head h3 .i { color: var(--muted); }
.card-body { padding: 20px 22px; }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 20px; }
.grid-cards.cols-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.xcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform var(--med) var(--ease), border-color var(--med), box-shadow var(--med) var(--ease);
  isolation: isolate;
}
.xcard:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.xcard.is-hidden { opacity: .6; }
.xcard-media {
  --c: #8b93a7;
  position: relative;
  aspect-ratio: 16 / 8.5;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.xcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.xcard:hover .xcard-media img { transform: scale(1.04); }
.xcard-art {
  position: absolute; inset: 0; padding: 18px;
  background:
    radial-gradient(120% 130% at 0% 0%, color-mix(in srgb, var(--c) 34%, transparent), transparent 55%),
    radial-gradient(90% 90% at 100% 100%, color-mix(in srgb, var(--c) 16%, transparent), transparent 60%),
    var(--surface-2);
}
.xcard-art code {
  position: absolute; inset: 58px 16px 0 16px;
  font-size: 11px; line-height: 1.55; color: color-mix(in srgb, var(--c) 45%, var(--text-2));
  opacity: .55; word-break: break-all; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 10%, transparent 92%);
  transition: opacity var(--med);
}
.xcard:hover .xcard-art code { opacity: .8; }
.xcard-badges { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 1; }
.xcard-badges .chip { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--bg) 60%, transparent); border-color: var(--line-2); color: var(--text); }
.xcard-badges .chip-accent { background: color-mix(in srgb, var(--accent) 22%, var(--bg)); color: var(--accent); }
.xcard-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 16px; flex: 1; }
.xcard-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 26px; }
.xcard-meta .sep { color: var(--muted); }
.xcard-meta .gv { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.xcard-title { font-size: 16.5px; line-height: 1.3; letter-spacing: -.012em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xcard-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.xcard-title a:focus-visible { box-shadow: none; }
.xcard:has(.xcard-title a:focus-visible) { box-shadow: var(--ring); }
.xcard-summary { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); }
.stats { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.stats span { display: inline-flex; align-items: center; gap: 4px; }
.stats .i { width: 14px; height: 14px; }

/* Tooltips on small icon stats. They sit above a card's whole-card link so they
   can be hovered, or tapped on touch screens. */
.tip-stat { position: relative; z-index: 2; cursor: default; }
.tip-stat:focus { outline: none; box-shadow: none; }
.tip-stat::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px);
  padding: 5px 9px; border-radius: var(--r-xs); background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity var(--fast), transform var(--fast) var(--ease), visibility var(--fast);
}
.tip-stat:last-child::after { left: auto; right: -4px; transform: translateY(4px); }
.tip-stat:hover::after, .tip-stat:focus::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.tip-stat:last-child:hover::after, .tip-stat:last-child:focus::after { transform: none; }

/* compact list rows (sidebar "more by", newest list) */
.xrow { display: flex; gap: 12px; align-items: center; padding: 10px; margin: 0 -10px; border-radius: var(--r); transition: background var(--fast); position: relative; }
.xrow:hover { background: var(--surface-2); }
.xrow-main { min-width: 0; flex: 1; }
.xrow-title { font-weight: 600; font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.xrow-title::after { content: ""; position: absolute; inset: 0; }
.xrow-sub { color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ sections */

.section { margin-top: 64px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.section-head .i-title { width: 24px; height: 24px; color: var(--accent); }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.link-arrow .i { width: 16px; height: 16px; transition: transform var(--fast) var(--ease); }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover .i { transform: translateX(3px); }
.page-head { padding: 40px 0 28px; }
.page-head h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.025em; }
.page-head p { color: var(--text-2); margin: 10px 0 0; font-size: 16px; max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 700; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.eyebrow .i { width: 15px; height: 15px; }
.empty {
  display: grid; place-items: center; text-align: center; gap: 10px;
  padding: 56px 24px; border: 1px dashed var(--line-2); border-radius: var(--r-xl); color: var(--muted);
}
.empty .i { width: 40px; height: 40px; color: var(--line-3); stroke-width: 1.5; }
.empty h3 { color: var(--text); font-size: 18px; }
.empty p { margin: 0; max-width: 420px; }

/* ------------------------------------------------------------------ home */

.hero { position: relative; padding: 72px 0 56px; text-align: center; overflow: hidden; }
.hero-fence {
  position: absolute; inset: auto 0 0 0; height: 220px; pointer-events: none; z-index: -1; opacity: .5;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, var(--line) 46px 54px),
    linear-gradient(180deg, transparent 0 32%, var(--line) 32% 36%, transparent 36% 66%, var(--line) 66% 70%, transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%), radial-gradient(60% 100% at 50% 100%, #000, transparent);
  mask-image: radial-gradient(70% 120% at 50% 100%, #000 20%, transparent 70%);
}
.hero h1 {
  font-size: clamp(38px, 6.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 800;
  max-width: 900px;
  margin: 0 auto;
}
.hero h1 .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 640px; margin: 22px auto 0; font-size: clamp(16px, 1.8vw, 18.5px); color: var(--text-2); line-height: 1.55; }
.hero-search { position: relative; max-width: 640px; margin: 34px auto 0; }
.hero-search .i-search { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 21px; height: 21px; color: var(--muted); pointer-events: none; }
.hero-search input {
  width: 100%; height: 62px; padding: 0 150px 0 56px; border-radius: var(--pill);
  border: 1px solid var(--line-2); background: var(--surface); font-size: 16.5px;
  box-shadow: var(--shadow); transition: border-color var(--fast), box-shadow var(--med);
}
.hero-search input:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring), var(--shadow-lg); }
.hero-search .btn { position: absolute; right: 8px; top: 8px; height: 46px; }
.hero-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.hero-quick a { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px 5px 5px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: transform var(--fast) var(--ease), border-color var(--fast), color var(--fast); }
.hero-quick a:hover { transform: translateY(-2px); border-color: var(--line-3); color: var(--text); }
.hero-cta { display: flex; justify-content: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }

.finder {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end;
  max-width: 820px; margin: 34px auto 0; padding: 12px; text-align: left;
  border-radius: var(--r-2xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.finder-field { display: grid; gap: 5px; }
.finder-field > span { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding-left: 6px; }
.finder .select { height: 48px; border-radius: var(--r-lg); background-color: var(--surface-2); }
.finder .btn { height: 48px; border-radius: var(--r-lg); }
.soon-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: var(--pill); padding: 1px 7px; }

.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.class-card {
  --cc: #999;
  padding: 14px 16px 16px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 11%, var(--surface)), var(--surface) 65%);
  border: 1px solid color-mix(in srgb, var(--cc) 20%, var(--line));
  transition: border-color var(--med), transform var(--med) var(--ease);
}
.class-card:hover { border-color: color-mix(in srgb, var(--cc) 50%, transparent); transform: translateY(-2px); }
.class-card-name { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; }
.class-card-name:hover { color: var(--cc); }
.class-card-name .dot-c { width: 10px; height: 10px; }
.class-card-specs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.class-card-specs a {
  font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 3px 10px; border-radius: var(--pill);
  background: color-mix(in srgb, var(--cc) 8%, var(--surface-2)); border: 1px solid var(--line);
  transition: color var(--fast), border-color var(--fast), background var(--fast);
}
.class-card-specs a:hover { color: var(--text); border-color: color-mix(in srgb, var(--cc) 55%, transparent); background: color-mix(in srgb, var(--cc) 16%, var(--surface-2)); }
.addon-tile.is-soon, .filter-list a.is-soon { opacity: .75; }
.filter-list a .n.soon { color: var(--accent); font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: .05em; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 52px; border-radius: var(--r-xl); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.stat { padding: 22px 24px; background: var(--surface); text-align: left; }
.stat strong { display: block; font-family: var(--font-display); font-size: 30px; letter-spacing: -.03em; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13.5px; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.stat .i { width: 15px; height: 15px; color: var(--accent); }

.addon-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.addon-tile {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  transition: transform var(--med) var(--ease), border-color var(--med), box-shadow var(--med);
}
.addon-tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 55%); opacity: 0; transition: opacity var(--med); }
.addon-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 40%, var(--line-2)); box-shadow: var(--shadow); }
.addon-tile:hover::before { opacity: 1; }
.addon-tile > * { position: relative; }
.addon-tile strong { display: block; font-size: 14.5px; line-height: 1.3; }
.addon-tile strong + span { color: var(--muted); font-size: 12.5px; }
.addon-tile.is-big { flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; }
.addon-tile.is-big p { margin: 0; color: var(--text-2); font-size: 13.5px; }

.class-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.class-tile {
  --cc: #999;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cc) 12%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--cc) 18%, var(--line)); font-weight: 600; font-size: 14px;
  transition: transform var(--med) var(--ease), border-color var(--med);
}
.class-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--cc) 55%, transparent); }
.class-tile .dot-c { width: 10px; height: 10px; }

.creator-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.creator {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  transition: transform var(--med) var(--ease), border-color var(--med);
}
.creator:hover { transform: translateY(-2px); border-color: var(--line-2); }
.creator strong { display: block; font-size: 15px; }
.creator strong a::after { content: ""; position: absolute; inset: 0; }
.creator .stats { margin-top: 3px; }
.creator .rank { margin-left: auto; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--line-3); }

.cta-band {
  position: relative; overflow: hidden; margin-top: 72px; padding: 48px; border-radius: var(--r-2xl);
  background: radial-gradient(120% 160% at 0% 0%, rgba(255, 181, 71, .2), transparent 50%), radial-gradient(100% 140% at 100% 100%, rgba(124, 92, 255, .18), transparent 55%), var(--surface);
  border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.025em; }
.cta-band p { margin: 8px 0 0; color: var(--text-2); max-width: 520px; }

/* ------------------------------------------------------------------ browse */

.browse { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 32px; align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 22px; max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; padding: 2px 6px 24px 2px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.filters:hover { scrollbar-color: var(--line-2) transparent; }
.filter-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.filter-group h3 a { text-transform: none; letter-spacing: 0; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.filter-list { display: grid; gap: 2px; }
.filter-list a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--text-2); font-weight: 520; transition: background var(--fast), color var(--fast);
}
.filter-list a:hover { background: var(--surface-2); color: var(--text); }
.filter-list a.is-on { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent-line); }
.filter-list a .n { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.filter-list .more { display: none; }
.filter-list.is-expanded .more { display: flex; }
.filter-expand { background: none; border: 0; color: var(--accent); font-size: 13px; font-weight: 600; padding: 6px 10px; text-align: left; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-cloud a.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.class-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.class-grid a { --cc: #999; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--r-sm); font-size: 13px; font-weight: 550; color: var(--text-2); transition: background var(--fast), color var(--fast); white-space: nowrap; overflow: hidden; }
.class-grid a:hover { background: var(--surface-2); color: var(--text); }
.class-grid a.is-on { background: color-mix(in srgb, var(--cc) 14%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cc) 40%, transparent); }
.spec-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.filter-search { position: relative; }
.filter-search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.filter-search .input { padding-left: 40px; border-radius: var(--pill); height: 42px; }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.results-head .count { color: var(--muted); font-size: 14px; font-weight: 550; }
.results-head .count strong { color: var(--text); }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.seg::-webkit-scrollbar { display: none; }
.seg a { padding: 6px 13px; border-radius: var(--pill); font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background var(--fast), color var(--fast); }
.seg a:hover { color: var(--text); }
.seg a.is-on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.active-filters .clear { color: var(--muted); font-size: 13px; font-weight: 600; margin-left: 4px; }
.active-filters .clear:hover { color: var(--accent); }
.filters-toggle { display: none; }
#browse-results { transition: opacity var(--fast); }
#browse-results.is-loading { opacity: .45; pointer-events: none; }

.addon-hero { display: flex; align-items: center; gap: 22px; padding: 40px 0 30px; }
.addon-hero h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.025em; }
.addon-hero p { margin: 8px 0 0; color: var(--text-2); max-width: 640px; }
.addon-hero .links { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
.pager-pages { display: flex; gap: 4px; }
.pager-btn, .pager-num {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; min-width: 38px; padding: 0 12px; justify-content: center;
  border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
a.pager-btn:hover, a.pager-num:hover { border-color: var(--line-3); color: var(--text); }
.pager-num.is-current { background: var(--accent-grad); color: var(--accent-ink); border-color: transparent; }
.pager-btn.is-disabled { opacity: .4; }
.pager-btn .i { width: 16px; height: 16px; }
.pager-gap { display: grid; place-items: center; width: 24px; color: var(--muted); }

/* ------------------------------------------------------------------ string page */

.crumbs { display: flex; align-items: center; gap: 6px; padding: 28px 0 18px; color: var(--muted); font-size: 13.5px; font-weight: 550; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }
.crumbs .i { width: 14px; height: 14px; }
.x-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.x-head h1 { font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.028em; line-height: 1.12; }
.x-head .summary { font-size: 17px; color: var(--text-2); margin: 12px 0 0; line-height: 1.5; }
.x-head-meta { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: 13.5px; }
.x-head-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.x-head-meta .i { width: 15px; height: 15px; }
.x-notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-lg); margin-top: 18px; font-size: 14px; background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.x-notice .i { color: var(--info); margin-top: 2px; }
.x-notice.warn { background: var(--accent-soft); border-color: var(--accent-line); }
.x-notice.warn .i { color: var(--accent); }
.x-notice a { color: var(--accent); font-weight: 600; }

.stringbox { margin-top: 26px; border-radius: var(--r-xl); border: 1px solid var(--line-2); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.stringbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stringbox-head .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stringbox-head .left strong { display: block; font-size: 14.5px; }
.stringbox-head .left strong + span { color: var(--muted); font-size: 12.5px; }
.stringbox-head .right { display: flex; gap: 8px; }
.stringbox-body { position: relative; background: var(--code-bg); }
.stringbox textarea {
  display: block; width: 100%; height: 168px; padding: 18px 20px; margin: 0; border: 0; resize: none;
  background: transparent; color: var(--text-2); font: 12.5px/1.6 var(--mono); word-break: break-all; white-space: pre-wrap;
  overflow: hidden; cursor: text;
}
.stringbox textarea:focus { outline: none; box-shadow: none; }
.stringbox.is-open textarea { height: 420px; overflow: auto; }
.stringbox-fade { position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(180deg, transparent, var(--code-bg)); pointer-events: none; transition: opacity var(--med); }
.stringbox.is-open .stringbox-fade { opacity: 0; }
.stringbox-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px 10px 18px; border-top: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.stringbox-foot .hint { display: flex; align-items: center; gap: 6px; }
.btn-copy { min-width: 150px; }
.btn-copy.is-done { --b-bg: var(--good) !important; background: var(--good) !important; box-shadow: 0 8px 22px -10px var(--good); color: #062b1b; }

/* content blocks on the string page */
.blocks { display: grid; gap: 20px; margin-top: 26px; }
.blocks .stringbox { margin-top: 0; }
.stringbox:not(.is-main) { box-shadow: none; }
.stringbox.is-main { border-color: var(--accent-line); }
.stringbox.is-short textarea { height: 66px; overflow: auto; }
.kind-mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--surface-3); color: var(--text-2); }
.kind-mark .i { width: 18px; height: 18px; }
.main-chip { height: 20px; padding: 0 8px; font-size: 11px; margin-left: 4px; vertical-align: 1px; }
.block-images { display: grid; gap: 10px; }
.block-images.count-2 { grid-template-columns: 1fr 1fr; }
.block-images.count-3 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.block-images figure { margin: 0; display: grid; gap: 6px; align-content: start; }
.block-image { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.block-image img { width: 100%; height: auto; transition: transform .4s var(--ease); }
.block-images.count-2 .block-image img, .block-images.count-3 .block-image img { aspect-ratio: 16 / 10; object-fit: cover; }
.block-image:hover img { transform: scale(1.02); }
.block-images figcaption { font-size: 13px; color: var(--muted); text-align: center; }

/* content block editor */
.eblocks { display: grid; gap: 12px; }
.eblock { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface-2); transition: border-color var(--fast), opacity var(--fast); }
.eblock.has-error { border-color: rgba(255, 107, 107, .55); }
.eblock.is-dragging { opacity: .45; }
.eblock.is-new { animation: highlight 1.4s var(--ease); }
.eblock-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.eblock-handle { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); cursor: grab; }
.eblock-handle:hover { background: var(--surface-3); color: var(--text); }
.eblock-handle:active { cursor: grabbing; }
.eblock-type { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13.5px; }
.eblock-type .i { width: 16px; height: 16px; color: var(--accent); }
.eblock-main { display: flex; align-items: center; gap: 6px; margin-left: 4px; padding: 3px 10px; border-radius: var(--pill); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color var(--fast), border-color var(--fast), background var(--fast); }
.eblock-main:has(input:checked) { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.eblock-main input { margin: 0; accent-color: var(--accent); }
.eblock-tools { margin-left: auto; display: flex; gap: 2px; }
.eblock-tools .icon-btn { width: 32px; height: 32px; }
.eblock-tools .icon-btn .i { width: 16px; height: 16px; }
.eblock-tools .icon-btn:disabled { opacity: .3; pointer-events: none; }
.eblock-body { display: grid; gap: 10px; padding: 12px; }
.eblock-body .textarea, .eblock-body .input, .eblock-body .select { background-color: var(--surface); }
.eblock-copy-meta { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; }
.eblock-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.eblock-add .btn:disabled { opacity: .45; }
.dropzone-sm { padding: 16px; }
.shot.shot-cap { aspect-ratio: auto; overflow: visible; border: 0; background: none; animation: none; display: grid; gap: 6px; align-content: start; }
.shot-cap img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line-2); }
.shot-cap .input { height: 34px; padding: 6px 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.inline-icon { display: inline; width: 14px; height: 14px; vertical-align: -2px; }

.x-section { margin-top: 40px; }
.x-section > h2 { font-size: 19px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.x-section > h2 .i { color: var(--muted); }
.x-section > h2 .n { color: var(--muted); font-weight: 600; font-size: 15px; }

.prose { color: var(--text-2); font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose h3, .prose h4, .prose h5 { color: var(--text); margin: 1.6em 0 .6em; }
.prose h3 { font-size: 20px; } .prose h4 { font-size: 17px; } .prose h5 { font-size: 15.5px; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--muted); }
.prose code { font-size: .88em; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text); }
.prose pre { padding: 14px 16px; border-radius: var(--r); background: var(--code-bg); border: 1px solid var(--line); overflow: auto; font-size: 13px; }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin: 0 0 1em; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent-line); color: var(--text-2); }
.prose strong { color: var(--text); }

.gallery { display: grid; gap: 10px; margin-top: 26px; }
.gallery-main { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 16 / 9; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; transition: opacity var(--med); }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.gallery-thumbs button { flex: none; width: 96px; aspect-ratio: 16 / 10; padding: 0; border-radius: var(--r-sm); overflow: hidden; border: 2px solid transparent; background: var(--surface-2); opacity: .65; transition: opacity var(--fast), border-color var(--fast); }
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs button:hover { opacity: 1; }
.gallery-thumbs button.is-on { opacity: 1; border-color: var(--accent); }

.versions { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); }
.version { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); }
.version:first-child { border-top: 0; }
.version.is-current { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.version .v { font-family: var(--mono); font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: var(--pill); background: var(--surface-3); white-space: nowrap; }
.version.is-current .v { background: var(--accent); color: var(--accent-ink); }
.version .meta { color: var(--muted); font-size: 12.5px; }
.version .log { margin: 4px 0 0; font-size: 14px; color: var(--text-2); white-space: pre-line; }

.side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 20px); }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 18px; }
.side-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.side-actions { display: grid; gap: 10px; }
.side-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-actions .row-3 { grid-template-columns: 1fr 1fr auto; }
.facts { display: grid; gap: 0; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.facts div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.facts dt .i { width: 15px; height: 15px; }
.facts dd { margin: 0; font-weight: 600; text-align: right; display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.facts dd a:hover { color: var(--accent); }
.author-card { display: flex; gap: 14px; align-items: center; }
.author-card strong { font-size: 16px; display: flex; align-items: center; gap: 6px; }
.author-card strong + span { color: var(--muted); font-size: 13px; display: block; }
.author-bio { margin: 12px 0 0; color: var(--text-2); font-size: 13.5px; }
.mod-tools { border-color: color-mix(in srgb, var(--info) 30%, transparent); background: color-mix(in srgb, var(--info) 5%, var(--surface)); }
.mod-tools .btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* comments */
.comment-form { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 22px; }
.comment-form form { flex: 1; display: grid; gap: 10px; }
.comment-form .textarea { min-height: 52px; height: 52px; transition: height var(--med) var(--ease), border-color var(--fast), box-shadow var(--fast); }
.comment-form .textarea:focus, .comment-form .textarea.has-text { height: 110px; }
.comment-form .actions { display: none; justify-content: space-between; align-items: center; gap: 10px; }
.comment-form form:focus-within .actions, .comment-form form.has-text .actions { display: flex; }
.comment-list { display: grid; gap: 4px; }
.comment { display: flex; gap: 12px; padding: 12px 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.comment-head .user-link { font-size: 14px; color: var(--text); }
.comment-head .op { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent); }
.comment-body { margin-top: 4px; font-size: 14.5px; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-body.is-deleted { color: var(--muted); font-style: italic; }
.comment-actions { display: flex; gap: 2px; margin-top: 4px; margin-left: -8px; }
.comment-actions button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 0; background: none; border-radius: var(--pill); color: var(--muted); font-size: 12.5px; font-weight: 600; transition: background var(--fast), color var(--fast); }
.comment-actions button:hover { background: var(--surface-2); color: var(--text); }
.comment-actions .i { width: 14px; height: 14px; }
.replies { margin-top: 6px; padding-left: 16px; border-left: 2px solid var(--line); display: grid; }
.reply-slot:empty { display: none; }
.reply-slot { margin-top: 10px; }
.comment.is-new { animation: highlight 2.2s var(--ease); border-radius: var(--r); }
.signin-prompt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: var(--text-2); margin-bottom: 20px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ submit form */

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px; }
.form-card + .form-card { margin-top: 18px; }
.form-card > h2 { font-size: 17px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.form-card > h2 .step { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; }
.paste-zone { position: relative; }
.paste-zone .textarea { min-height: 170px; padding-bottom: 42px; background: var(--code-bg); }
.paste-status { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; pointer-events: none; font-size: 12.5px; color: var(--muted); }
.paste-status .detected { display: none; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: var(--pill); background: var(--good-soft); color: var(--good); font-weight: 600; }
.paste-status .detected.is-on { display: inline-flex; animation: pop-in var(--med) var(--spring); }
.addon-picker-other { margin-top: 10px; }
.dropzone {
  position: relative; display: grid; place-items: center; gap: 6px; text-align: center; padding: 28px 18px;
  border: 1.5px dashed var(--line-3); border-radius: var(--r-lg); color: var(--muted); cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .i { width: 28px; height: 28px; color: var(--accent); }
.dropzone strong { color: var(--text); }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.shot-grid:empty { display: none; }
.shot { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); background: var(--surface-2); animation: pop-in var(--med) var(--ease); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot button, .shot label.rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; }
.shot .i { width: 14px; height: 14px; }
.shot input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.shot:has(input:checked) img { opacity: .25; filter: grayscale(1); }
.shot:has(input:checked)::after { content: "Will be removed"; position: absolute; inset: auto 0 8px; text-align: center; font-size: 12px; font-weight: 700; color: var(--bad); }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px 8px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); cursor: text; transition: border-color var(--fast), box-shadow var(--fast); }
.tag-input:focus-within { border-color: var(--accent-line); box-shadow: var(--ring); }
.tag-input input { flex: 1; min-width: 120px; border: 0; background: none; outline: none; padding: 4px 6px; font-size: 14px; }
.tag-input .chip button { border: 0; background: none; padding: 0; color: inherit; display: grid; place-items: center; opacity: .6; }
.tag-input .chip button:hover { opacity: 1; }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-suggest button { border: 1px dashed var(--line-2); background: none; border-radius: var(--pill); padding: 3px 10px; font-size: 12.5px; color: var(--muted); font-weight: 550; transition: color var(--fast), border-color var(--fast); }
.tag-suggest button:hover { color: var(--text); border-color: var(--line-3); }
.preview-pane { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 14px; }
.preview-pane .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.preview-pane .xcard:hover { transform: none; }
.tips { font-size: 13.5px; color: var(--text-2); }
.tips ul { margin: 8px 0 0; padding-left: 18px; }
.tips li { margin: 5px 0; }
.md-hint { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.md-hint code { font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); }

/* ------------------------------------------------------------------ auth */

.auth-wrap { display: grid; place-items: center; padding: 56px 16px 24px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-2xl); padding: 36px 32px 30px; box-shadow: var(--shadow-lg); }
.auth-card .brand-mark { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 20px; }
.auth-card h1 { font-size: 26px; letter-spacing: -.025em; }
.auth-card .lead { color: var(--text-2); margin: 8px 0 24px; }
.auth-card .alt { text-align: center; color: var(--muted); font-size: 14px; margin: 22px 0 0; }
.auth-card .alt a, .link { color: var(--accent); font-weight: 600; }
.auth-card .alt a:hover, .link:hover { text-decoration: underline; text-underline-offset: 3px; }
.form-alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); margin-bottom: 18px; font-size: 14px; background: var(--bad-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.form-alert .i { color: var(--bad); margin-top: 2px; }
.form-alert.ok { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.form-alert.ok .i { color: var(--good); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: var(--pill); background: none; color: var(--muted); display: grid; place-items: center; }
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--bad); transition: width var(--med) var(--ease), background var(--med); }

/* ------------------------------------------------------------------ profile */

.profile-head { position: relative; margin-top: 28px; border-radius: var(--r-2xl); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.profile-cover { height: 150px; background: radial-gradient(120% 160% at 0% 0%, hsl(var(--h1) 80% 55% / .55), transparent 55%), radial-gradient(100% 140% at 100% 100%, hsl(var(--h2) 75% 50% / .5), transparent 60%), var(--surface-2); }
.profile-info { display: flex; align-items: flex-end; gap: 22px; padding: 0 28px 24px; margin-top: -52px; flex-wrap: wrap; }
.profile-info .avatar-xl { box-shadow: var(--shadow); border-color: var(--surface); }
.profile-info .who { flex: 1; min-width: 220px; padding-bottom: 4px; }
.profile-info h1 { font-size: 30px; letter-spacing: -.025em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-info .sub { color: var(--muted); font-size: 14px; margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.profile-info .sub span { display: inline-flex; align-items: center; gap: 6px; }
.profile-info .sub .i { width: 15px; height: 15px; }
.profile-bio { padding: 0 28px 24px; margin: 0; color: var(--text-2); max-width: 760px; white-space: pre-line; }
.profile-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.profile-stats div { padding: 16px 28px; border-left: 1px solid var(--line); }
.profile-stats div:first-child { border-left: 0; }
.profile-stats strong { display: block; font-size: 22px; font-family: var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.profile-stats span { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ account */

.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 550; font-size: 14px; transition: background var(--fast), color var(--fast); }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); }
.settings-section { scroll-margin-top: calc(var(--header-h) + 20px); }
.settings-section + .settings-section { margin-top: 18px; }
.settings-section h2 { font-size: 18px; margin-bottom: 4px; }
.settings-section > .hint { margin-bottom: 20px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.avatar-edit { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.verify-banner { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 16px 18px; border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid var(--accent-line); margin-bottom: 18px; flex-wrap: wrap; }
.verify-banner p { margin: 0; display: flex; gap: 10px; align-items: center; }
.verify-banner .i { color: var(--accent); }

/* notifications */
.notif-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); }
.notif { position: relative; display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); transition: background var(--fast); }
.notif:first-child { border-top: 0; }
.notif:hover { background: var(--surface-hover); }
.notif.is-unread { background: linear-gradient(90deg, var(--accent-soft), transparent 50%); }
.notif.is-unread::before { content: ""; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); }
.notif .ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); flex: none; }
.notif .ic .i { width: 17px; height: 17px; }
.notif .txt { flex: 1; min-width: 0; font-size: 14px; color: var(--text-2); }
.notif .txt strong { color: var(--text); }
.notif .txt a::after { content: ""; position: absolute; inset: 0; }
.notif time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ------------------------------------------------------------------ static pages */

.doc { max-width: 780px; }
.doc h2 { font-size: 22px; margin: 40px 0 12px; }
.doc h3 { font-size: 17px; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--text-2); font-size: 15.5px; line-height: 1.75; }
.doc ul, .doc ol { padding-left: 22px; }
.doc a { color: var(--accent); }
.doc code { font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text); }
.steps { display: grid; gap: 14px; margin-top: 18px; }
.step-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 18px 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); }
.step-card h3 { margin: 4px 0 6px; font-size: 16px; }
.step-card p { margin: 0; font-size: 14.5px; }
.step-card ol { margin: 6px 0 0; padding-left: 18px; font-size: 14.5px; }
.step-card ol li { line-height: 1.6; }
.callout { display: flex; gap: 12px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--accent-soft); border: 1px solid var(--accent-line); margin: 24px 0; }
.callout .i { color: var(--accent); margin-top: 3px; }
.callout p { margin: 0; color: var(--text); font-size: 14.5px; }

/* ------------------------------------------------------------------ admin */

.admin { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 28px; }
.admin-nav { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 2px; }
.admin-nav .title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 12px 8px; font-weight: 700; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 550; font-size: 14px; transition: background var(--fast), color var(--fast); }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.is-on { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.admin-nav .count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent-2); border-radius: var(--pill); padding: 0 7px; }
.admin h1 { font-size: 26px; margin-bottom: 20px; letter-spacing: -.02em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.tile span { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.tile span .i { width: 15px; height: 15px; }
.tile strong { display: block; font-size: 28px; font-family: var(--font-display); letter-spacing: -.03em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table tr:hover td { background: var(--surface-hover); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table .actions form { display: contents; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--muted); }
.table .t-title { font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; flex: 1; max-width: 420px; }
.report { padding: 16px 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.report:first-child { border-top: 0; }
.report-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.report-target { padding: 10px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 14px; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.report-actions .input { height: 32px; max-width: 260px; font-size: 13px; border-radius: var(--pill); }
.color-swatch { width: 44px; height: 44px; padding: 3px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); }

/* SEO & analytics settings */
.seo-admin { max-width: 820px; }
.seo-admin .form-card > h2 .chip { margin-left: 4px; }
.seo-more summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 14px; width: fit-content; }
.seo-more summary:hover { color: var(--text); }
.seo-steps { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 8px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.seo-steps a, .seo-admin .hint a { color: var(--accent); }
.seo-copy { display: flex; gap: 8px; }
.seo-copy .input { flex: 1; min-width: 0; }
.seo-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.seo-row .hint { margin-top: 2px; }
.seo-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.seo-url { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

/* Dashboard: Google Analytics card */
.ga-card { margin-bottom: 20px; }
.ga-range { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.ga-head-actions { display: flex; align-items: center; gap: 10px; }
.ga-head-actions form { display: contents; }
.ga-empty { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ga-empty p { margin: 0; color: var(--text-2); font-size: 14px; }
.ga-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.ga-stats div { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); }
.ga-stats span { display: block; color: var(--muted); font-size: 12.5px; }
.ga-stats strong { display: block; font-family: var(--font-display); font-size: 24px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ga-stats small { color: var(--muted); font-size: 11.5px; }
.ga-chart { margin: 0; }
.ga-chart-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.ga-plot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; }
.ga-yaxis { position: relative; min-width: 24px; height: 200px; }
.ga-yaxis span { position: absolute; right: 0; transform: translateY(50%); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1; }
.ga-area { position: relative; height: 200px; cursor: crosshair; outline: none; border-radius: 4px; touch-action: pan-y; }
.ga-area:focus-visible { box-shadow: var(--ring); }
.ga-area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ga-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.ga-grid.is-base { border-top-color: var(--line-3); }
.ga-wash { fill: var(--chart-line); fill-opacity: .1; }
.ga-line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ga-cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--line-3); pointer-events: none; }
.ga-cross i { position: absolute; left: -5px; width: 10px; height: 10px; margin-bottom: -5px; border-radius: 50%; background: var(--chart-line); box-shadow: 0 0 0 2px var(--surface); }
.ga-tip { position: absolute; top: -6px; transform: translateX(10px); padding: 8px 11px; border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); pointer-events: none; white-space: nowrap; font-size: 12.5px; z-index: 2; }
.ga-tip.is-flip { transform: translateX(calc(-100% - 10px)); }
.ga-tip strong { display: block; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.ga-tip span { color: var(--muted); }
.ga-xaxis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.ga-table { margin-top: 12px; }
.ga-table summary { cursor: pointer; font-size: 13px; color: var(--muted); width: fit-content; }
.ga-table summary:hover { color: var(--text); }
.ga-table .table-wrap { margin-top: 10px; max-height: 280px; overflow-y: auto; }
.ga-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.ga-lists h3 { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.ga-bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-xs); font-size: 13.5px; overflow: hidden; }
.ga-bar + .ga-bar { margin-top: 3px; }
.ga-bar i { position: absolute; inset: 0 auto 0 0; background: var(--surface-2); border-radius: var(--r-xs); z-index: 0; }
.ga-bar a, .ga-bar span { position: relative; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ga-bar a { font-family: var(--mono); font-size: 12.5px; }
.ga-bar a:hover { color: var(--accent); }
.ga-bar b { position: relative; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.ga-bar b small { color: var(--muted); font-weight: 500; margin-left: 4px; }

/* ------------------------------------------------------------------ footer */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 52px 0 28px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-grid a { color: var(--text-2); font-size: 14px; transition: color var(--fast); }
.footer-grid a:hover { color: var(--accent); }
.footer-about p { color: var(--muted); font-size: 14px; max-width: 320px; margin: 14px 0 0; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------------ toasts & dialogs */

.toasts { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 14px 16px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); font-size: 14px; pointer-events: auto;
  animation: toast-in .42s var(--spring);
}
.toast.is-leaving { animation: toast-out .28s var(--ease) forwards; }
.toast .ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none; background: var(--info-soft); color: var(--info); }
.toast .ic .i { width: 14px; height: 14px; stroke-width: 2.6; }
.toast.success .ic { background: var(--good-soft); color: var(--good); }
.toast.error .ic { background: var(--bad-soft); color: var(--bad); }
.toast .msg { flex: 1; padding-top: 1px; color: var(--text); }
.toast .close { border: 0; background: none; color: var(--muted); padding: 2px; border-radius: 6px; display: grid; }
.toast .close:hover { color: var(--text); }
.toast .close .i { width: 16px; height: 16px; }

.consent {
  position: fixed; z-index: 80; left: 20px; bottom: 20px; width: min(440px, calc(100vw - 40px));
  display: grid; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); animation: toast-in .42s var(--spring);
}
.consent p { display: flex; gap: 10px; margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.consent p .i { flex: none; width: 17px; height: 17px; margin-top: 2px; color: var(--accent); }
.consent a { color: var(--accent); }
.consent-btns { display: flex; gap: 8px; justify-content: flex-end; }
.consent-btns .btn { min-width: 92px; }

dialog.modal {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-2xl);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal[open] { animation: modal-in .32s var(--spring); }
dialog::backdrop { background: rgba(5, 7, 12, .6); backdrop-filter: blur(4px); animation: fade-in .2s var(--ease); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 0; }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 18px 22px 22px; }
.reason-list { display: grid; gap: 8px; margin-bottom: 14px; }
.reason-list label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line-2); cursor: pointer; font-size: 14px; transition: border-color var(--fast), background var(--fast); }
.reason-list label:hover { border-color: var(--line-3); }
.reason-list label:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.reason-list input { accent-color: var(--accent); }
dialog.lightbox { max-width: 96vw; max-height: 94vh; padding: 0; border: 0; background: transparent; overflow: visible; }
dialog.lightbox[open] { animation: modal-in .3s var(--ease); }
dialog.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
dialog.lightbox .icon-btn { position: fixed; top: 16px; right: 16px; background: rgba(0, 0, 0, .5); color: #fff; }
dialog::backdrop { background: rgba(5, 7, 12, .78); }

.error-page { text-align: center; padding: 96px 0 40px; }
.error-page .code { font-family: var(--font-display); font-size: clamp(80px, 16vw, 150px); font-weight: 900; letter-spacing: -.06em; line-height: 1; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { font-size: 28px; margin-top: 10px; }
.error-page p { color: var(--text-2); max-width: 480px; margin: 12px auto 26px; }

/* ------------------------------------------------------------------ motion */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(.98); } }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes highlight { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.reveal { animation: rise .6s var(--ease) both; }
.reveal-2 { animation-delay: .06s; }
.reveal-3 { animation-delay: .12s; }
.reveal-4 { animation-delay: .18s; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
.site-header { view-transition-name: header; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1120px) {
  .header-search { max-width: 280px; }
  .x-layout, .form-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 960px) {
  :root { --header-h: 62px; }
  .main-nav, .header-search, .header-actions .hide-md { display: none; }
  .menu-toggle { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .mobile-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 39; display: block;
    padding: 14px 20px 22px; background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: transform var(--med) var(--ease), opacity var(--med), visibility var(--med);
  }
  .mobile-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .mobile-nav form { position: relative; margin-bottom: 12px; }
  .mobile-nav form .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
  .mobile-nav form .input { padding-left: 42px; border-radius: var(--pill); }
  .mobile-nav nav { display: grid; gap: 2px; }
  .mobile-nav nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); font-weight: 600; color: var(--text-2); }
  .mobile-nav nav a:hover { background: var(--surface-2); color: var(--text); }
  .mobile-nav .mobile-nav-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: var(--r); background: none; font-weight: 600; color: var(--text-2); text-align: left; }
  .mobile-nav .mobile-nav-btn:hover { background: var(--surface-2); color: var(--text); }
  .mobile-nav .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

  .browse { grid-template-columns: 1fr; }
  .filters-toggle { display: inline-flex; }
  .filters { position: static; max-height: none; display: none; padding: 18px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; }
  .filters.is-open { display: grid; animation: pop-in var(--med) var(--ease); }
  .x-layout, .form-layout { grid-template-columns: 1fr; }
  .side, .preview-pane { position: static; }
  .preview-pane { order: -1; display: none; }
  .settings, .admin { grid-template-columns: 1fr; }
  .settings-nav, .admin-nav { position: static; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .admin-nav .title { display: none; }
  .settings-nav a, .admin-nav a { white-space: nowrap; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .finder { grid-template-columns: 1fr 1fr; }
  .finder .btn { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-stats div:nth-child(3) { border-left: 0; }
  .profile-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ga-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ga-lists { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  body { font-size: 14.5px; }
  .hero { padding: 44px 0 36px; }
  .hero-search input { height: 54px; padding-right: 16px; font-size: 15.5px; }
  .hero-search .btn { display: none; }
  .finder { grid-template-columns: 1fr; margin-top: 26px; }
  .eblock-copy-meta { grid-template-columns: 1fr; }
  .block-images.count-2 { grid-template-columns: 1fr; }
  .section { margin-top: 48px; }
  .section-head h2 { font-size: 20px; }
  .grid-cards { grid-template-columns: 1fr; gap: 14px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 0; }
  .form-card { padding: 20px 18px; }
  .auth-card { padding: 28px 20px 24px; border-radius: var(--r-xl); }
  .cta-band { padding: 30px 22px; }
  .stat { padding: 16px 18px; }
  .stat strong { font-size: 24px; }
  .header-actions .btn-share span { display: none; }
  .header-actions .btn-share { width: 40px; padding: 0; }
  .stringbox-head .right { width: 100%; }
  .stringbox-head .right .btn-copy { flex: 1; }
  .stringbox-head .right .btn-ghost span { display: none; }
  .version { grid-template-columns: auto 1fr; }
  .version > :last-child { grid-column: 1 / -1; }
  .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .consent { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .ga-area, .ga-yaxis { height: 160px; }
  .profile-info { padding: 0 18px 18px; }
  .profile-bio { padding: 0 18px 18px; }
  .profile-stats div { padding: 14px 18px; }
  .addon-hero { flex-direction: column; align-items: flex-start; }
}
