/* ==========================================================================
   Puberty Arts — visual system
   Restrained cyberpunk: deep ink, thin lines, two accents, soft moe details.
   All icons are inline SVG. No icon fonts, no frameworks.
   ========================================================================== */

:root {
  --bg: #07090f;
  --bg-soft: #0b0f1a;
  --panel: #101524;
  --panel-2: #151b2e;
  --panel-3: #1b2238;
  --line: rgba(148, 170, 220, 0.13);
  --line-strong: rgba(148, 170, 220, 0.24);
  --text: #e9edf8;
  --text-soft: #c3cadd;
  --muted: #8790a7;
  --dim: #5f687e;
  --cyan: #63e6ff;
  --cyan-deep: #1aa9c4;
  --pink: #ff5cae;
  --pink-deep: #c02f79;
  --violet: #8f86ff;
  --gold: #ffd479;
  --green: #6fe3a1;
  --red: #ff6b7a;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --glow-cyan: 0 0 0 1px rgba(99, 230, 255, 0.55), 0 0 22px rgba(99, 230, 255, 0.12);
  --glow-pink: 0 0 0 1px rgba(255, 92, 174, 0.5), 0 0 22px rgba(255, 92, 174, 0.12);
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.9, 0.28, 1);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "SF Pro Text", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(99, 230, 255, 0.1), transparent 62%),
    radial-gradient(800px 500px at 96% 2%, rgba(255, 92, 174, 0.09), transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, rgba(143, 134, 255, 0.07), transparent 65%),
    var(--bg);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(120, 150, 210, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 150, 210, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}

::selection { background: rgba(255, 92, 174, 0.35); color: #fff; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: #a8f1ff; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.18;
}
h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon { flex: 0 0 auto; vertical-align: -0.18em; }

.wrap {
  width: min(1480px, calc(100% - 40px));
  margin-inline: auto;
}
@media (max-width: 720px) { .wrap { width: calc(100% - 24px); } }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 20, 0.82);
  backdrop-filter: blur(18px) saturate(1.2);
}
.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex: 0 0 auto;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(99, 230, 255, 0.12), rgba(255, 92, 174, 0.12));
  border: 1px solid var(--line-strong);
}
.brand-mascot { width: 30px; height: 30px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand-sub { font-size: 0.63rem; color: var(--muted); letter-spacing: 0.22em; text-transform: uppercase; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 550;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-link.active { color: var(--text); background: rgba(99, 230, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(99, 230, 255, 0.16); }
.nav-link.active .icon { color: var(--cyan); }

.header-search {
  margin-left: auto;
  position: relative;
  width: min(330px, 30vw);
}
.header-search input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 38px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}
.header-search input::placeholder { color: var(--dim); }
.header-search input:focus {
  outline: none;
  border-color: rgba(99, 230, 255, 0.45);
  background: rgba(99, 230, 255, 0.045);
}
.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.header-search .search-key {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.15s var(--ease), background 0.18s, border-color 0.18s, color 0.18s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: 0.55; pointer-events: none; }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), #59b7ff 52%, var(--violet));
  color: #071018;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(99, 230, 255, 0.16);
}
.btn-primary:hover { background: linear-gradient(135deg, #8beeff, #74c4ff 52%, #a49dff); color: #061018; }
.btn-pink {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 92, 174, 0.16);
}
.btn-pink:hover { color: #fff; background: linear-gradient(135deg, #ff7cbf, #a49dff); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-soft); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn-icon { width: 38px; padding: 0; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 0.78rem; border-radius: 8px; }
.btn-lg { min-height: 46px; padding: 12px 22px; font-size: 0.95rem; border-radius: 12px; }
.btn-danger { border-color: rgba(255, 107, 122, 0.4); color: #ffb3bb; background: rgba(255, 107, 122, 0.08); }
.btn-danger:hover { background: rgba(255, 107, 122, 0.16); color: #ffd0d4; }

.account-menu { position: relative; }
.account-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
}
.account-button:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(145deg, rgba(99, 230, 255, 0.22), rgba(255, 92, 174, 0.22));
  border: 1px solid var(--line-strong);
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  flex: 0 0 auto;
}
.avatar-lg { width: 84px; height: 84px; font-size: 1.6rem; border-radius: 20px; }
.avatar-sm { width: 24px; height: 24px; font-size: 0.65rem; }
.account-name { font-size: 0.82rem; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
  z-index: 60;
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-user { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dropdown-user strong { display: block; font-size: 0.9rem; }
.dropdown-user span { font-size: 0.76rem; color: var(--muted); }
.dropdown a, .dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.85rem;
  text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: rgba(255, 255, 255, 0.055); color: var(--text); }

.menu-toggle { display: none; }

/* --------------------------------------------------------------------------
   Page shell
   -------------------------------------------------------------------------- */
#app, .page { min-height: 60vh; }
.page { padding: 34px 0 80px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.page-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}
.page-head h1 { margin-bottom: 4px; }
.page-head .lead { color: var(--muted); max-width: 620px; margin: 0; font-size: 0.94rem; }
.page-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.section { margin-top: 40px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-size: 1.25rem; }
.section-head .sub { color: var(--muted); font-size: 0.84rem; }

.panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel-pad { padding: 22px; }

.footer {
  border-top: 1px solid var(--line);
  padding: 14px 0 18px;
  color: var(--dim);
  font-size: 0.76rem;
}
.footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer a { color: var(--muted); }
.footer .footer-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.footer .dot { color: var(--line-strong); }

.brand-logo { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; display: block; }

.faq-prose { max-width: 820px; }
.faq-prose h2 { font-size: 1.15rem; margin: 0 0 10px; }
.faq-prose h3 { font-size: 0.98rem; margin: 22px 0 8px; color: var(--text-soft); }
.faq-prose p { color: var(--muted); line-height: 1.7; margin: 0 0 12px; }
.faq-prose code { color: var(--cyan); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field > label, .field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
}
.field-hint { color: var(--dim); font-size: 0.75rem; font-weight: 400; }
.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 13px;
  background: rgba(5, 8, 15, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgba(99, 230, 255, 0.5);
  background: rgba(99, 230, 255, 0.03);
  box-shadow: 0 0 0 3px rgba(99, 230, 255, 0.08);
}
.input.invalid, .textarea.invalid { border-color: rgba(255, 107, 122, 0.6); }
.field-error { color: #ff9aa5; font-size: 0.76rem; margin-top: 6px; min-height: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

.checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 0.86rem; color: var(--text-soft); }
.checkbox input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--pink); }

/* --------------------------------------------------------------------------
   Chips / tags / buttons
   -------------------------------------------------------------------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: nowrap;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}
a.chip:hover, button.chip:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); }
.chip.is-active { color: #071018; background: var(--cyan); border-color: transparent; font-weight: 650; }
.chip.is-pink { color: #fff; background: rgba(255, 92, 174, 0.16); border-color: rgba(255, 92, 174, 0.35); }
.chip .chip-x { opacity: 0.6; display: inline-flex; }
.chip .chip-x:hover { opacity: 1; }
.chip-sm { padding: 2px 8px; font-size: 0.7rem; }
.chip-muted { color: var(--muted); }
.chip-tag::before { content: "#"; color: var(--dim); }
.chip-tag { color: var(--muted); }
.chip-tag:hover { color: var(--cyan); }

/* Danbooru-style tag groups */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
a.group-card { display: block; color: inherit; text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
a.group-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.group-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.group-card-head strong { font-size: 0.95rem; }
.group-preview { gap: 5px; }
.chip-static { cursor: default; }
.chip-static::before { content: "#"; color: var(--dim); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
}
.badge-cyan { color: var(--cyan); border-color: rgba(99, 230, 255, 0.3); background: rgba(99, 230, 255, 0.08); }
.badge-pink { color: #ffb2d6; border-color: rgba(255, 92, 174, 0.32); background: rgba(255, 92, 174, 0.1); }
.badge-gold { color: var(--gold); border-color: rgba(255, 212, 121, 0.3); background: rgba(255, 212, 121, 0.08); }
.badge-green { color: var(--green); border-color: rgba(111, 227, 161, 0.3); background: rgba(111, 227, 161, 0.08); }
.badge-red { color: #ffb3bb; border-color: rgba(255, 107, 122, 0.32); background: rgba(255, 107, 122, 0.09); }

/* --------------------------------------------------------------------------
   Gallery filters
   -------------------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 16, 28, 0.7);
}
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-label { color: var(--dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; margin-right: 2px; }
.filters .spacer { flex: 1; }
.filter-select {
  height: 32px;
  padding: 0 30px 0 10px;
  font-size: 0.78rem;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  color: var(--text-soft);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.filter-select:focus { outline: none; border-color: rgba(99, 230, 255, 0.45); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  flex: 0 0 auto;
}
.color-swatch::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.color-swatch.is-active { outline: 2px solid var(--cyan); outline-offset: 2px; }
.color-swatch:hover { transform: scale(1.08); }

/* --------------------------------------------------------------------------
   Media grid / cards
   -------------------------------------------------------------------------- */
.media-grid {
  column-width: 240px;
  column-gap: 14px;
}
.media-grid.is-list {
  column-width: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.media-card {
  display: block;
  break-inside: avoid;
  margin-bottom: 14px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: zoom-in;
  transition: border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s;
  content-visibility: auto;
  contain-intrinsic-size: 260px 320px;
}
.media-card:hover { border-color: rgba(99, 230, 255, 0.35); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); }
.media-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.media-thumb {
  width: 100%;
  height: auto;
  min-height: 120px;
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(99, 230, 255, 0.06), rgba(255, 92, 174, 0.06)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.02) 0 12px, transparent 12px 24px);
  aspect-ratio: var(--ar, 4 / 5);
}
.media-card.is-loaded .media-thumb { animation: fade-in 0.35s var(--ease); }
.media-card .media-thumb[data-broken="1"] { opacity: 0.25; }
.media-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 34px 12px 10px;
  background: linear-gradient(to top, rgba(4, 6, 12, 0.9), rgba(4, 6, 12, 0.35) 55%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}
.media-card:hover .media-overlay, .media-card:focus-visible .media-overlay { opacity: 1; }
.media-overlay .meta { min-width: 0; }
.media-overlay .title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px #000;
}
.media-overlay .sub { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.7rem; }
.media-flags { position: absolute; top: 8px; left: 8px; display: flex; gap: 5px; flex-wrap: wrap; max-width: calc(100% - 16px); }
.media-flags .badge { backdrop-filter: blur(6px); background: rgba(5, 8, 15, 0.68); }
.media-flags .badge-cyan { background: rgba(6, 21, 27, 0.72); }
.media-type-icon {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(5, 8, 15, 0.66);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  color: var(--text-soft);
}
.media-counts {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}
.media-counts span { display: inline-flex; align-items: center; gap: 3px; }
.media-card.is-pending { cursor: default; }
.media-card.is-pending:hover { transform: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.grid-status { padding: 34px 0; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; }
.sentinel { height: 1px; }
.load-more { display: flex; justify-content: center; padding: 20px 0; }

.skeleton {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0.075) 50%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}
.skeleton-card { break-inside: avoid; margin-bottom: 14px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.skeleton-card .skeleton { aspect-ratio: 4 / 5; border-radius: 0; }
@keyframes shimmer { to { background-position: -220% 0; } }

.empty {
  padding: 60px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.012);
}
.empty .empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--cyan);
  background: rgba(99, 230, 255, 0.07);
  border: 1px solid rgba(99, 230, 255, 0.16);
}
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 420px; margin: 0 auto 16px; font-size: 0.88rem; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 5, 10, 0.78);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-root.open { opacity: 1; }
.modal-panel {
  position: relative;
  width: min(1100px, 100%);
  max-height: min(92vh, 1000px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(14px) scale(0.985);
  transition: transform 0.24s var(--ease);
}
.modal-root.open .modal-panel { transform: none; }
.modal-panel.is-narrow { width: min(520px, 100%); }
.modal-panel.is-wide { width: min(1320px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.014);
  flex: 0 0 auto;
}
.modal-head h2 { margin: 0; font-size: 1rem; }
.modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.modal-body { overflow: auto; overscroll-behavior: contain; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex: 0 0 auto; }

/* Media viewer layout */
.viewer { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr); }
@media (max-width: 900px) { .viewer { grid-template-columns: 1fr; } }
.viewer-stage {
  position: relative;
  min-height: 380px;
  max-height: 78vh;
  background: #05070d;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.viewer-stage img.media-full, .viewer-stage video.media-full {
  width: 100%;
  height: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #05070d;
}
.viewer-stage .preview-blur {
  width: 100%;
  height: 100%;
  max-height: 78vh;
  object-fit: contain;
  filter: blur(14px) saturate(0.8) brightness(0.6);
  transform: scale(1.03);
}
.viewer-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(5, 7, 13, 0.55), rgba(5, 7, 13, 0.9));
}
.viewer-lock .lock-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--cyan);
  border: 1px solid rgba(99, 230, 255, 0.3);
  background: rgba(99, 230, 255, 0.08);
}
.viewer-lock h3 { margin: 0; font-size: 1.05rem; }
.viewer-lock p { margin: 0; color: var(--muted); font-size: 0.82rem; max-width: 340px; }
.viewer-badge { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 3; }
.viewer-footnote {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
  pointer-events: none;
}

.pose-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.pose-overlay .bone { stroke: rgba(99, 230, 255, 0.65); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.pose-overlay .joint { fill: var(--pink); stroke: rgba(255, 255, 255, 0.8); stroke-width: 0.8; }

.viewer-side { display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.viewer-info { padding: 18px 20px 8px; }
.viewer-title { margin: 0 0 4px; font-size: 1.25rem; }
.viewer-byline { color: var(--muted); font-size: 0.8rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.viewer-byline a { color: var(--text-soft); }
.viewer-desc { color: var(--text-soft); font-size: 0.87rem; margin: 12px 0 0; white-space: pre-wrap; }
.viewer-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
}
.action-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.action-btn.is-active { color: var(--pink); border-color: rgba(255, 92, 174, 0.35); background: rgba(255, 92, 174, 0.09); }
.action-btn.is-active .icon { fill: rgba(255, 92, 174, 0.25); }
.action-btn:disabled { opacity: 0.55; pointer-events: none; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 20px; }
.meta-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.meta-table td { padding: 5px 0; color: var(--muted); vertical-align: top; }
.meta-table td:last-child { color: var(--text-soft); text-align: right; font-variant-numeric: tabular-nums; }
.meta-block { padding: 14px 20px; border-top: 1px solid var(--line); }
.meta-block h4 { margin: 0 0 8px; font-size: 0.7rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.14em; }
.palette-row { display: flex; gap: 6px; flex-wrap: wrap; }
.palette-row .swatch { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, 0.18); }

.comments { padding: 16px 20px 22px; border-top: 1px solid var(--line); }
.comments h4 { margin: 0 0 12px; font-size: 0.7rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.14em; }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment-body { min-width: 0; flex: 1; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; }
.comment-head a { color: var(--text); font-weight: 600; }
.comment-head time { color: var(--dim); font-size: 0.7rem; }
.comment-text { margin: 2px 0 0; font-size: 0.83rem; color: var(--text-soft); white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form textarea { min-height: 38px; height: 38px; resize: vertical; }

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */
.auth-shell { display: grid; grid-template-columns: 1.05fr 0.95fr; min-height: calc(100vh - var(--header-h)); }
.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 54px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(600px 400px at 70% 20%, rgba(99, 230, 255, 0.13), transparent 60%),
    radial-gradient(520px 420px at 20% 85%, rgba(255, 92, 174, 0.13), transparent 60%),
    linear-gradient(160deg, #0a0e1a, #070910);
}
.auth-visual::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  right: -100px;
  top: -80px;
  border: 1px solid rgba(99, 230, 255, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 120px rgba(99, 230, 255, 0.06);
}
.auth-visual::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  right: 10px;
  top: 40px;
  border: 1px dashed rgba(255, 92, 174, 0.18);
  border-radius: 50%;
  animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.auth-visual .mascot-large { width: 104px; height: 104px; margin-bottom: auto; position: relative; z-index: 1; }
.auth-visual h2 { position: relative; z-index: 1; font-size: clamp(1.8rem, 3vw, 2.6rem); max-width: 520px; }
.auth-visual p { position: relative; z-index: 1; color: var(--muted); max-width: 440px; }
.auth-visual .feature-list { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.auth-visual .feature { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 0.83rem; }
.auth-visual .feature .icon { color: var(--cyan); }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: min(440px, 100%); }
.auth-card .auth-head { margin-bottom: 26px; }
.auth-card .auth-head h1 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-card .auth-head p { color: var(--muted); font-size: 0.88rem; margin: 0; }
.auth-switch { margin-top: 22px; color: var(--muted); font-size: 0.84rem; text-align: center; }
.auth-switch a { font-weight: 600; }
.auth-alert { padding: 11px 14px; border-radius: 10px; font-size: 0.82rem; margin-bottom: 16px; display: none; }
.auth-alert.show { display: block; }
.auth-alert.error { background: rgba(255, 107, 122, 0.09); border: 1px solid rgba(255, 107, 122, 0.3); color: #ffb3bb; }
.auth-alert.ok { background: rgba(111, 227, 161, 0.08); border: 1px solid rgba(111, 227, 161, 0.28); color: #a7f0c8; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-visual { display: none; } }

/* --------------------------------------------------------------------------
   Gender ruler
   -------------------------------------------------------------------------- */
.gender-ruler { padding: 8px 2px 0; }
.gender-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.76rem; margin-bottom: 6px; }
.gender-labels .side { display: flex; flex-direction: column; gap: 1px; }
.gender-labels .side:last-child { text-align: right; }
.gender-labels strong { color: var(--text-soft); font-size: 0.82rem; }
.gender-track { position: relative; padding: 18px 0 8px; }
.gender-track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4d9dff 0%, #8f86ff 38%, #b08cff 52%, #ff8ec6 74%, #ff5cae 100%);
  outline: none;
  cursor: pointer;
  margin: 0;
}
.gender-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 92, 174, 0.18), 0 3px 10px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 0.15s;
}
.gender-track input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }
.gender-track input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 92, 174, 0.18);
}
.gender-ticks { position: relative; height: 38px; margin-top: 8px; }
.gender-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.64rem;
  color: var(--dim);
  text-align: center;
  max-width: 68px;
  line-height: 1.25;
  white-space: nowrap;
  transition: color 0.2s;
}
.gender-tick::before {
  content: "";
  display: block;
  width: 1px;
  height: 6px;
  margin: 0 auto 4px;
  background: var(--line-strong);
}
.gender-tick.is-near { color: var(--text-soft); }
.gender-tick.is-active { color: var(--pink); font-weight: 700; }
.gender-tick.is-active::before { background: var(--pink); height: 9px; }
.gender-readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.82rem;
}
.gender-readout strong { color: var(--pink); }
.gender-readout .pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.gender-readout .desc { color: var(--dim); font-size: 0.74rem; }

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */
.profile-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 26px;
  background: linear-gradient(150deg, #10162a, #0a0e18);
  --profile-a: #63e6ff;
  --profile-b: #ff5cae;
}
.profile-hero .coub-bg { position: absolute; inset: 0; overflow: hidden; opacity: 0.22; pointer-events: none; }
.profile-hero .coub-bg iframe { width: 100%; height: 100%; border: 0; transform: scale(1.35); }
.profile-hero .coub-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(500px 300px at 20% 20%, color-mix(in srgb, var(--profile-a) 22%, transparent), transparent 65%),
    radial-gradient(500px 300px at 82% 70%, color-mix(in srgb, var(--profile-b) 22%, transparent), transparent 65%);
}
.profile-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 9, 15, 0.95), rgba(7, 9, 15, 0.35) 62%, transparent);
  pointer-events: none;
}
.profile-hero-inner { position: relative; z-index: 1; padding: 34px; display: flex; align-items: flex-end; gap: 20px; min-height: 270px; flex-wrap: wrap; }
.profile-id { min-width: 0; flex: 1; }
.profile-name { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6); }
.profile-login { color: var(--muted); font-size: 0.9rem; margin: 2px 0 10px; }
.profile-login .dot { margin: 0 6px; color: var(--line-strong); }
.profile-bio { color: var(--text-soft); max-width: 680px; font-size: 0.9rem; white-space: pre-wrap; }
.profile-hero .profile-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.profile-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.profile-stat { display: flex; flex-direction: column; }
.profile-stat strong { font-size: 1.05rem; }
.profile-stat span { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }
.profile-gender-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 92, 174, 0.12); border: 1px solid rgba(255, 92, 174, 0.28); color: #ffc0dc; font-size: 0.76rem; margin-top: 4px; }
@media (max-width: 760px) { .profile-hero-inner { padding: 22px; } .profile-hero .profile-actions { margin-left: 0; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab {
  position: relative;
  padding: 11px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); }
.tab.is-active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--pink)); }
.tab .count { font-size: 0.68rem; color: var(--dim); background: rgba(255, 255, 255, 0.05); border-radius: 999px; padding: 1px 6px; }
.tab-panel[hidden] { display: none; }

.wall { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.wall-post { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.018); }
.wall-post .wall-body { flex: 1; min-width: 0; }
.wall-post .wall-head { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.wall-post .wall-head a { color: var(--text); font-weight: 600; }
.wall-post .wall-head time { color: var(--dim); font-size: 0.7rem; }
.wall-post .wall-text { margin: 6px 0 0; color: var(--text-soft); font-size: 0.88rem; white-space: pre-wrap; word-break: break-word; }
.wall-compose { display: flex; gap: 10px; margin-bottom: 18px; }
.wall-compose textarea { min-height: 74px; }
.delete-post { border: 0; background: transparent; color: var(--dim); padding: 2px; margin-left: auto; }
.delete-post:hover { color: var(--red); }

.kink-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 760px) { .kink-grid { grid-template-columns: 1fr; } }
.kink-box { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.018); }
.kink-box h4 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.kink-box.fetish h4 .icon { color: var(--pink); }
.kink-box.taboo h4 .icon { color: var(--gold); }
.kink-hidden { padding: 34px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; }

/* --------------------------------------------------------------------------
   Upload
   -------------------------------------------------------------------------- */
.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  padding: 30px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(400px 200px at center, rgba(99, 230, 255, 0.05), transparent 70%),
    rgba(255, 255, 255, 0.012);
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-drag { border-color: rgba(99, 230, 255, 0.55); background: rgba(99, 230, 255, 0.04); }
.dropzone .drop-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--cyan); background: rgba(99, 230, 255, 0.08); border: 1px solid rgba(99, 230, 255, 0.18); }
.dropzone h3 { margin: 2px 0 0; }
.dropzone p { margin: 0; color: var(--muted); font-size: 0.83rem; }
.dropzone input[type="file"] { display: none; }
.dropzone .file-types { color: var(--dim); font-size: 0.72rem; margin-top: 4px; }
.file-preview { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); margin-top: 14px; }
.file-preview img, .file-preview video { width: 94px; height: 94px; object-fit: cover; border-radius: 9px; background: #05070d; }
.file-preview .file-meta { min-width: 0; flex: 1; }
.file-preview .file-name { font-weight: 600; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview .file-sub { color: var(--muted); font-size: 0.76rem; }
.file-preview .file-remove { margin-left: auto; }
.progress { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 14px; }
.progress .bar { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width 0.18s; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.74rem; margin-top: 6px; }
.upload-note { display: flex; gap: 9px; padding: 11px 13px; border-radius: 10px; font-size: 0.78rem; color: var(--text-soft); background: rgba(99, 230, 255, 0.05); border: 1px solid rgba(99, 230, 255, 0.15); margin-bottom: 18px; }
.upload-note .icon { color: var(--cyan); margin-top: 1px; }

.upload-list { display: flex; flex-direction: column; gap: 10px; }
.upload-item { display: flex; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 255, 255, 0.018); align-items: center; }
.upload-item img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; background: #05070d; }
.upload-item .ui-meta { min-width: 0; flex: 1; }
.upload-item .ui-name { font-size: 0.8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .ui-sub { color: var(--muted); font-size: 0.7rem; display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Tags page
   -------------------------------------------------------------------------- */
.tag-hero { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.tag-hero .tag-icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: var(--cyan); background: rgba(99, 230, 255, 0.07); border: 1px solid rgba(99, 230, 255, 0.16); }
.tag-hero .tag-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.tag-hero .tag-prefix { color: var(--pink); }
.tag-desc { color: var(--muted); max-width: 760px; font-size: 0.88rem; }
.tag-cats { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 22px; }
.tag-cat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.018); min-width: 150px; }
.tag-cat strong { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }

/* --------------------------------------------------------------------------
   Moderation
   -------------------------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat-card { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)); }
.stat-card .stat-label { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-card .stat-value small { font-size: 0.78rem; color: var(--muted); font-weight: 400; }

.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}
.admin-row img { width: 92px; height: 78px; object-fit: cover; border-radius: 9px; background: #05070d; cursor: zoom-in; }
.admin-row .admin-meta { min-width: 0; }
.admin-row .admin-name { font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .admin-sub { color: var(--muted); font-size: 0.74rem; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.admin-row .admin-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.admin-row .admin-error { color: #ffb3bb; font-size: 0.74rem; margin-top: 5px; }
.duplicate-note { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 0.76rem; color: #ffd98a; }
.duplicate-note a { color: var(--cyan); text-decoration: none; }
.duplicate-note a:hover { text-decoration: underline; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.compare-card { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, 0.018); }
.compare-frame { aspect-ratio: 4 / 3; background: #05070d; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.compare-frame img { width: 100%; height: 100%; object-fit: contain; }
.compare-card figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.text-green { color: var(--green, #7bf1a8); }
.admin-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.data-table th { text-align: left; color: var(--dim); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 9px 10px; border-bottom: 1px solid rgba(148, 170, 220, 0.07); color: var(--text-soft); vertical-align: middle; }
.data-table tr:hover td { background: rgba(255, 255, 255, 0.015); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 700px) { .admin-row { grid-template-columns: 68px minmax(0, 1fr); } .admin-row img { width: 68px; height: 60px; } .admin-row .admin-actions { grid-column: 1 / -1; justify-content: flex-start; } }

/* --------------------------------------------------------------------------
   Toast / misc
   -------------------------------------------------------------------------- */
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(18, 24, 40, 0.97);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 0.84rem;
  animation: toast-in 0.22s var(--ease);
}
.toast.leaving { animation: toast-out 0.22s var(--ease) forwards; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--cyan); flex: 0 0 auto; }
.toast-error .toast-dot { background: var(--red); }
.toast-ok .toast-dot { background: var(--green); }
.toast-text { flex: 1; }
.toast-close { border: 0; background: transparent; color: var(--dim); font-size: 1.1rem; line-height: 1; padding: 0 2px; }
.toast-close:hover { color: var(--text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner-lg { width: 34px; height: 34px; border-width: 3px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 0.78rem; }
.tiny { font-size: 0.7rem; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.nowrap { white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.divider { height: 1px; background: var(--line); margin: 22px 0; border: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* Responsive nav */
@media (max-width: 1180px) {
  .header-search { width: min(250px, 24vw); }
  .nav-link span { display: none; }
  .nav-link { padding: 9px 10px; }
}
@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px 16px;
    background: rgba(9, 12, 21, 0.98);
    border-bottom: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
    z-index: 49;
  }
  .main-nav.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-link { padding: 11px 12px; }
  .nav-link span { display: inline; }
  .menu-toggle { display: inline-flex; }
  .header-search { display: none; }
  .header-search.mobile-open { display: block; position: absolute; top: calc(var(--header-h) + 6px); left: 12px; right: 12px; width: auto; z-index: 48; }
  .account-name { display: none; }
}
@media (max-width: 520px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 0.86rem; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-mascot { width: 24px; height: 24px; }
  .page { padding-top: 22px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .btn { min-height: 36px; padding: 8px 12px; }
  .media-grid { column-width: 160px; column-gap: 10px; }
  .media-card { margin-bottom: 10px; border-radius: 11px; }
  .viewer-stage { min-height: 240px; }
  .modal-root { padding: 0; }
  .modal-panel { max-height: 100vh; height: 100%; border-radius: 0; border: 0; }
  .modal-panel.is-narrow { height: auto; margin: 16px; }
}

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

/* Profile theme variables applied to hero */
.profile-hero { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--profile-a) 10%, transparent); }
.profile-hero .profile-name { background: linear-gradient(100deg, var(--text), color-mix(in srgb, var(--profile-a) 65%, var(--text))); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
