/* ===========================================================
   Void — anonymous media board
   Theme: dusk falling into dawn — twilight indigo, coral sun,
   gold and rose light, terminal mono type
   =========================================================== */

:root {
  /* a twilight sky: deep indigo deepening into a plum horizon */
  --bg:          #0e0a1a;
  --bg-soft:     #150f26;
  --surface:     #1a1230;
  --surface-2:   #241838;
  --ink:         #07040f;
  --border:      #3c2a56;
  --border-soft: #291d3e;
  --text:        #f7e9f0;
  --muted:       #a98fc0;

  /* dawn light — a low coral sun, golden hour and rose */
  --accent:      #ff8a5c;
  --accent-soft: #33172a;
  --accent-2:    #ffc46b;
  --neon-pink:   #ff6fa5;
  --neon-lime:   #ffd479;

  --danger:      #ff5d7a;
  --danger-soft: #341019;
  --success:     #6fe0ad;
  --success-soft:#0d2a22;
  --warning:     #ffd166;

  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 18px 44px rgba(8, 4, 16, .8);
  --font: "Cascadia Mono", "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
  --mono: "Cascadia Mono", "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;

  /* The sky wash of the page background and the blurred top bar, pulled out as
     tokens so a chosen palette can repaint them along with everything else
     rather than being stuck with the dusk colours. */
  --grid:       rgba(255, 138, 92, .045);
  --glow-rose:  rgba(255, 111, 165, .17);
  --glow-gold:  rgba(255, 196, 107, .14);
  --glow-coral: rgba(255, 138, 92, .14);
  --topbar:     rgba(18, 12, 32, .82);
}

/* ---------- palettes ----------
   Dusk is the theme above, so it needs no block of its own: `data-palette`
   is simply absent for it. The others only restate the colour tokens; every
   rule below keeps reading the same variables, so nothing else changes.
   All of them are dark, since the stylesheet assumes a dark ground in places
   it does not tokenise (shadows, image blends). */

/* Clear night: cold blues, and a moon rather than a sun. */
html[data-palette="midnight"] {
  --bg:          #060a16;
  --bg-soft:     #0a1224;
  --surface:     #0e1830;
  --surface-2:   #16223e;
  --ink:         #03060e;
  --border:      #23375c;
  --border-soft: #172646;
  --text:        #e9f1fd;
  --muted:       #93a8c8;

  --accent:      #4fb2ff;
  --accent-soft: #0c2138;
  --accent-2:    #7fd8ff;
  --neon-pink:   #8f9dff;
  --neon-lime:   #5fe3d0;

  --danger:      #ff6b8a;
  --danger-soft: #2c1220;
  --success:     #5fd6a3;
  --success-soft:#0a2620;
  --warning:     #ffd166;

  --shadow:      0 18px 44px rgba(2, 6, 16, .85);
  --grid:        rgba(79, 178, 255, .05);
  --glow-rose:   rgba(143, 157, 255, .16);
  --glow-gold:   rgba(127, 216, 255, .12);
  --glow-coral:  rgba(79, 178, 255, .13);
  --topbar:      rgba(8, 14, 30, .82);
}

/* Last light: burnt oranges and embers over near-black. */
html[data-palette="ember"] {
  --bg:          #140705;
  --bg-soft:     #1e0b08;
  --surface:     #26100c;
  --surface-2:   #331812;
  --ink:         #0b0403;
  --border:      #4d241a;
  --border-soft: #35170f;
  --text:        #fdeee6;
  --muted:       #c49a86;

  --accent:      #ff7a3d;
  --accent-soft: #3a170d;
  --accent-2:    #ffb14f;
  --neon-pink:   #ff6b4a;
  --neon-lime:   #ffd166;

  --danger:      #ff5470;
  --danger-soft: #3a1016;
  --success:     #7fd6a0;
  --success-soft:#12291d;
  --warning:     #ffc14f;

  --shadow:      0 18px 44px rgba(12, 3, 0, .85);
  --grid:        rgba(255, 122, 61, .05);
  --glow-rose:   rgba(255, 84, 112, .16);
  --glow-gold:   rgba(255, 177, 79, .15);
  --glow-coral:  rgba(255, 122, 61, .17);
  --topbar:      rgba(28, 10, 6, .82);
}

/* Terminal green: the old phosphor look, kept as an option for anyone who
   missed it. */
html[data-palette="phosphor"] {
  --bg:          #04100a;
  --bg-soft:     #07190f;
  --surface:     #0a2216;
  --surface-2:   #0f2e1e;
  --ink:         #020a06;
  --border:      #1c4a30;
  --border-soft: #123424;
  --text:        #e4fbe9;
  --muted:       #7fbd97;

  --accent:      #4fe08a;
  --accent-soft: #0c2e1d;
  --accent-2:    #9dffc2;
  --neon-pink:   #6ff0b0;
  --neon-lime:   #c9ff6f;

  --danger:      #ff6b7f;
  --danger-soft: #2c1218;
  --success:     #6fe0ad;
  --success-soft:#0d2a22;
  --warning:     #ffd166;

  --shadow:      0 18px 44px rgba(1, 8, 4, .85);
  --grid:        rgba(79, 224, 138, .05);
  --glow-rose:   rgba(111, 240, 176, .14);
  --glow-gold:   rgba(157, 255, 194, .11);
  --glow-coral:  rgba(79, 224, 138, .14);
  --topbar:      rgba(6, 22, 14, .82);
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win. Plenty of rules below set an
   explicit `display` (e.g. img/video/.btn), which would otherwise override
   the browser default and leave "hidden" elements on screen. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    /* a faint blueprint grid, like the floor of a terminal room */
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 34px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 34px 100%,
    /* dusk overhead: rose and violet, then the warm dawn horizon below */
    radial-gradient(1100px 620px at 12% -8%, var(--glow-rose), transparent 62%),
    radial-gradient(900px 520px at 92% 4%, var(--glow-gold), transparent 60%),
    radial-gradient(780px 520px at 76% 100%, var(--glow-coral), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

img, video { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; }

::selection { background: var(--accent); color: #fff; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

/* The logo is fixed content: it must never be squeezed by the nav beside it,
   which is what used to squash the mark on a narrow bar. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 40px; width: auto; flex: 0 0 auto; }

/* The running page-view total, sat beside the logo. */
.hits {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.hits-dot { color: var(--accent); font-size: 9px; line-height: 1; }
.hits-count { color: var(--text); font-weight: 650; }
.hits-word { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }

@media (max-width: 760px) {
  .hits-word { display: none; }
}

/* The nav takes the leftover width and scrolls if it ever needs more, so a
   long row of links can never squeeze the logo beside it. */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 550;
  font-size: 14px;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav-link.is-active { color: var(--text); background: var(--surface-2); }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: 0 0 auto; }

/* The board's own accounts. Icons only, and they sit in the account row where
   nothing scrolls or clips — the handle they point at is in the title. */
.socials {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  margin-right: 2px;
  padding-right: 10px;
  border-right: 1px solid var(--border-soft);
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}
.social-link svg { display: block; }
.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* The live badge. It only exists while the stream is running, so it is allowed
   to take a little more width than the icons beside it — but not much, because
   the account row must not push the logo around. */
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(255, 93, 122, .55);
  border-radius: 999px;
  background: rgba(255, 93, 122, .14);
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1;
  white-space: nowrap;
}
.live-chip:hover {
  color: #fff;
  background: rgba(255, 93, 122, .3);
  border-color: var(--danger);
  text-decoration: none;
}

.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255, 93, 122, .6);
  animation: live-pulse 1.9s ease-out infinite;
}

@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 93, 122, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(255, 93, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 93, 122, 0); }
}

/* A badge that throbs is decoration, not information: anyone who has asked the
   system for less motion still gets the word LIVE. */
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* ---------- user menu ---------- */

.usermenu { position: relative; }
.usermenu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { border-color: var(--accent); }
.usermenu-tag { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}

.usermenu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.usermenu-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 6px;
}
.usermenu-meta { min-width: 0; }
.usermenu-anon { font-family: var(--mono); font-size: 14px; }
.usermenu-real { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item-danger { color: var(--danger); }

/* ---------- avatars ---------- */

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: none;
}
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 42px; height: 42px; }
.avatar-lg { width: 96px; height: 96px; }

/* ---------- layout ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 27px; }
.page-head p { color: var(--muted); margin: 0; }

.footer {
  border-top: 1px solid var(--border-soft);
  background: rgba(6, 16, 10, .72);
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.footer-brand { font-weight: 600; color: var(--text); }
.footer-app {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(255, 138, 92, .06);
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.footer-app:hover {
  text-decoration: none;
  color: var(--text);
  border-color: var(--accent);
  background: rgba(255, 138, 92, .14);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px) scale(1.03); }
.btn:active { transform: translateY(0) scale(.97); }

/* neon glow pills */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #d1541f);
  color: var(--ink);
  border-color: rgba(255, 138, 92, .55);
  box-shadow: 0 6px 20px rgba(255, 138, 92, .32), 0 0 18px rgba(255, 138, 92, .28);
}
.btn-primary:hover { box-shadow: 0 8px 28px rgba(255, 138, 92, .48), 0 0 30px rgba(255, 138, 92, .45); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent-2), var(--neon-pink));
  color: var(--ink);
  border-color: rgba(255, 196, 107, .55);
  box-shadow: 0 6px 20px rgba(255, 196, 107, .30), 0 0 18px rgba(255, 111, 165, .26);
}
.btn-accent:hover { box-shadow: 0 8px 28px rgba(255, 196, 107, .45), 0 0 30px rgba(255, 111, 165, .42); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent-2); box-shadow: 0 0 16px rgba(255, 196, 107, .28); }

.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(255, 138, 92, .30); }

.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(255, 77, 109, .5);
  color: #ffb3c0;
  box-shadow: 0 0 16px rgba(255, 77, 109, .22);
}
.btn-danger:hover { box-shadow: 0 0 24px rgba(255, 77, 109, .42); }

.btn-sm      { padding: 8px 16px; font-size: 13px; }
.btn-lg      { padding: 14px 30px; font-size: 16px; }
.btn-block   { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- landing / hero ---------- */

.hero {
  padding: 74px 0 54px;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 26px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: rgba(255, 138, 92, .10);
  color: #ffd9c2;
  font-size: 12.5px;
  font-family: var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(38px, 7vw, 66px);
  letter-spacing: -.035em;
  margin-bottom: 14px;
  background: linear-gradient(120deg, #fff2ea 25%, #ffc46b 60%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { font-size: 17.5px; color: var(--muted); margin: 0 auto 34px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; justify-content: center; }

.hero .hero-note {
  margin: 20px auto 0;
  max-width: 620px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
}
.hero .hero-note strong { color: #ffd9c2; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 46px;
}
.stat {
  min-width: 140px;
  padding: 14px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-value { font-size: 24px; font-weight: 700; color: var(--accent-2); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 46px 0 18px;
}
.section-head h2 { font-size: 19px; margin: 0; }

/* ---------- media grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* Holds the picture and the download button, so the button is placed against
   the picture rather than the bottom of the card. */
.card-media-wrap { position: relative; display: block; }

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--ink);
  overflow: hidden;
}
.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.card-type {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(4, 10, 6, .78);
  border: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.card-count {
  position: absolute;
  top: 38px;
  left: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(4, 10, 6, .78);
  border: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: .05em;
  color: #fff;
}
.card-removed {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 6, .9);
  color: var(--danger);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.card-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card:hover .card-title { color: var(--accent-2); }
.card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.card-meta .dot { opacity: .45; }

.anon-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: #ffd9c2;
  background: rgba(255, 138, 92, .12);
  border: 1px solid var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.user-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
  background: rgba(255, 196, 107, .14);
  border: 1px solid rgba(255, 196, 107, .35);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px 2px 6px;
  color: #ffe6a8;
  background: linear-gradient(135deg, rgba(255, 200, 87, .30), rgba(255, 146, 30, .16));
  border: 1px solid rgba(255, 200, 87, .55);
  font-weight: 650;
  letter-spacing: .08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  box-shadow: 0 0 10px rgba(255, 200, 87, .18), inset 0 1px 0 rgba(255, 255, 255, .14);
  animation: badge-glow 3.4s ease-in-out infinite;
}
.badge-shield {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 3px rgba(255, 200, 87, .55));
}

@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 200, 87, .18), inset 0 1px 0 rgba(255, 255, 255, .14); }
  50%      { box-shadow: 0 0 16px rgba(255, 200, 87, .40), inset 0 1px 0 rgba(255, 255, 255, .20); }
}

@media (prefers-reduced-motion: reduce) {
  .badge-admin { animation: none; }
}

/* ---------- card action buttons (admins) ---------- */

.card-tools {
  position: absolute;
  top: 9px;
  right: 9px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s ease;
}
.card:hover .card-tools { opacity: 1; }
.icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(4, 10, 6, .85);
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--danger-soft); }

/* ---------- filter tabs ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 550;
}
.tab:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- forms ---------- */

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.form { display: flex; flex-direction: column; gap: 17px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.check input[type=checkbox] {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.check .hint { font-size: 12px; color: var(--muted); font-weight: 400; }

/* Role editor: the permission list reads as a tidy grid of ticks rather than
   one tall column, which keeps a forty-key role in view. */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 8px 18px;
}
.perm-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}
.perm-item input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type=text],
input[type=password],
input[type=search],
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 138, 92, .22);
}
input[type=file] {
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 13.5px;
  width: 100%;
}
input[type=file]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.form-narrow { max-width: 430px; margin: 0 auto; }
.form-actions { display: flex; gap: 11px; flex-wrap: wrap; align-items: center; }

/* ---------- alerts ---------- */

.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 18px;
  font-size: 14px;
}
.flash-error   { border-color: #5a2530; background: var(--danger-soft);  color: #ffb3c1; }
.flash-success { border-color: #1f4f3e; background: var(--success-soft); color: #8ff0c6; }
.flash-info    { border-color: var(--accent-soft); background: rgba(255,196,107,.10); color: #ffd9c2; }

/* NSFW scan status shown above the upload form while images are screened. */
.nsfw-status {
  margin: 0 0 16px;
  border-color: var(--accent-soft);
  background: rgba(255, 138, 92, .08);
  color: #ffd9c2;
  font-size: 13.5px;
}

.empty {
  padding: 58px 24px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty h3 { color: var(--text); }

/* ---------- single post ---------- */

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 940px) { .post-layout { grid-template-columns: 1fr; } }

.post-media {
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.post-media img, .post-media video { max-height: 74vh; width: 100%; object-fit: contain; }
.post-media.is-gallery {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 3px;
  place-items: stretch;
}
.post-media.is-gallery img, .post-media.is-gallery video {
  height: 100%;
  max-height: 320px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--ink);
}

.post-info { padding: 20px 0 8px; }
.post-info h1 { font-size: 24px; }
.post-body { color: #eadbe4; white-space: pre-wrap; word-break: break-word; margin: 12px 0 0; }
.post-stats { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 16px; }

.comments { display: flex; flex-direction: column; gap: 12px; }
.comment {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.comment-body { min-width: 0; flex: 1; }
.comment-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; }
.comment-time { font-size: 12px; color: var(--muted); }
.comment-delete { margin-left: auto; }
.comment-delete .btn { padding: 3px 10px; font-size: 12.5px; }
.comment-delete .btn:hover { color: var(--danger); border-color: var(--danger); }
.comment-text { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.comment-image {
  display: block;
  margin-top: 8px;
  max-width: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
}
.comment-image img { width: 100%; height: auto; max-height: 320px; object-fit: cover; display: block; }

.composer { margin-top: 18px; }
.composer-row { display: flex; gap: 10px; align-items: flex-end; }

/* ---------- emoji picker ---------- */

.emoji-wrap { position: relative; }
.emoji-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.emoji-toggle:hover { border-color: var(--accent); }

.emoji-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(292px, 78vw);
  max-height: 210px;
  overflow-y: auto;
  padding: 9px;
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.emoji-wrap.is-open .emoji-panel { display: grid; }
.emoji-btn {
  border: 0;
  background: transparent;
  font-size: 19px;
  line-height: 1;
  padding: 5px;
  border-radius: 7px;
  cursor: pointer;
}
.emoji-btn:hover { background: var(--surface-2); transform: scale(1.15); }

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 7, 4, .72);
  backdrop-filter: blur(3px);
}
.modal.is-open { display: flex; }
.modal-box {
  width: 100%;
  max-width: 460px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 88vh;
  overflow-y: auto;
}
.modal-box h2 { font-size: 19px; }
.modal-box p.sub { color: var(--muted); font-size: 13.5px; margin-top: -6px; }
.modal-box-wide { max-width: 720px; }

/* ---------- media manager & image cropper (owner) ---------- */

.media-manage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  margin: 16px 0;
  max-height: 52vh;
  overflow-y: auto;
}

.media-manage-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.media-manage-item img,
.media-manage-item video {
  width: 100%;
  height: 108px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-soft);
  display: block;
}

.media-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.media-manage-actions form { margin: 0; display: flex; flex: 1; }
.media-manage-actions .btn { flex: 1; }

.crop-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 16px auto 0;
  line-height: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.crop-stage img {
  display: block;
  max-width: 100%;
  max-height: 56vh;
  height: auto;
}

.crop-selection {
  position: absolute;
  border: 1px solid var(--accent-2);
  background: rgba(255, 196, 107, .20);
  box-shadow: 0 0 0 9999px rgba(3, 7, 4, .55);
  pointer-events: none;
}

.crop-hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- image lightbox ---------- */

.post-media img[data-lightbox],
.comment-image { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 7, 4, .88);
  backdrop-filter: blur(6px);
}
.lightbox.is-open { display: flex; }
body.lightbox-open { overflow: hidden; }

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.lightbox-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(12, 23, 16, .82);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}
.lightbox-btn:hover { border-color: var(--accent); background: var(--surface-2); }
.lightbox-btn[hidden] { display: none; }

.lightbox-close {
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  font-size: 24px;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  padding-bottom: 4px;
  font-size: 30px;
}
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

@media (max-width: 560px) {
  .lightbox { padding: 12px; }
  .lightbox-close { top: 10px; right: 10px; }
  .lightbox-nav { width: 38px; height: 38px; font-size: 24px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ---------- live post toasts ---------- */

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 110;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 36px));
}

.toast {
  position: relative;
  display: block;
  padding: 12px 32px 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-sm);
  background: rgba(12, 23, 16, .96);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast:hover { border-color: var(--accent); border-left-color: var(--accent-2); text-decoration: none; }
.toast.is-in { opacity: 1; transform: translateY(0); }

.toast-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12.5px;
}
.toast-author {
  color: var(--accent-2);
  font-family: var(--mono);
  font-weight: 600;
}
.toast-title {
  margin-top: 4px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.toast-close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.toast-close:hover { color: var(--text); }

@media (max-width: 560px) {
  .toast-stack { right: 10px; left: 10px; bottom: 10px; width: auto; }
}

/* ---------- tables (admin) ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.cell-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.cell-tight { width: 1%; white-space: nowrap; }

/* ---------- report row ---------- */

.report-row td { vertical-align: top; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pill-danger  { background: var(--danger); color: #fff; }
.pill-accent  { background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--accent); }
.pill-warning { background: rgba(255,200,87,.16); color: var(--warning); border: 1px solid rgba(255,200,87,.3); }
.pill-success { background: var(--success-soft); color: var(--success); border: 1px solid #1f4f3e; }
.pill-muted   { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---------- pagination ---------- */

.pagination { display: flex; gap: 7px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px;
  padding: 8px 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
}
.pagination a:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.pagination .is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- misc ---------- */

.muted { color: var(--muted); }
.mono  { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mt-0 { margin-top: 0; }
.mt-3 { margin-top: 24px; }

.preview {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
}
.preview img, .preview video { width: 100%; max-height: 340px; object-fit: contain; }
.preview-meta { padding: 10px 13px; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.preview-item { display: flex; flex-direction: column; min-width: 0; }
.preview-multi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding: 8px;
}
.preview-multi .preview-item { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; min-width: 0; }
.preview-multi .preview-item img, .preview-multi .preview-item video { height: 140px; max-height: 140px; object-fit: cover; }
.preview-multi .preview-meta {
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Anything past the first few of each kind is listed rather than played. */
.preview-multi .preview-item.is-file {
  justify-content: center;
  gap: 0;
  min-height: 64px;
  padding: 10px;
}
.preview-kind {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.preview-summary {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 4px 2px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- upload progress ---------- */

.upload-progress {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.upload-bar {
  height: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.upload-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(255, 138, 92, .55);
  transition: width .18s ease;
}
.upload-bar-fill.is-indeterminate {
  width: 40%;
  animation: upload-sweep 1.1s ease-in-out infinite;
}
@keyframes upload-sweep {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}
.upload-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}
.upload-pct { color: var(--accent-2); font-weight: 700; }
.upload-progress.is-error .upload-bar-fill { background: var(--danger); box-shadow: none; }
.upload-progress.is-error .upload-note { color: var(--danger); }

.divider { height: 1px; background: var(--border-soft); margin: 22px 0; border: 0; }

@media (max-width: 700px) {
  .nav-link { padding: 8px 10px; }
  .usermenu-tag { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .page { padding: 20px 14px 52px; }
  .hero { padding: 44px 0 34px; }
}

/* ---------- device list (admin) ---------- */

.device-agent {
  font-size: 12px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reveal summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent-2);
  list-style: none;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::before { content: '▸ '; }
.reveal[open] summary::before { content: '▾ '; }
.reveal-body {
  margin-top: 9px;
  display: grid;
  gap: 10px;
  max-width: 340px;
}
.device-line {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .02);
}

/* ---------- mobile / small screens ---------- */

@media (max-width: 760px) {
  /* top bar: brand + account on the first row, nav scrolls on its own row */
  .topbar-inner { flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px; }
  .brand-logo { height: 34px; }
  .nav {
    order: 3;
    flex: 1 0 100%;
    gap: 6px;
    padding-bottom: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-link { white-space: nowrap; padding: 8px 12px; }
  .topbar-right { margin-left: auto; }

  /* spacing + type */
  .page { padding: 20px 14px 56px; }
  .page-head h1 { font-size: 22px; }
  .hero { padding: 40px 0 30px; }
  .hero h1 { font-size: clamp(30px, 10vw, 42px); }
  .hero p { font-size: 16px; margin-bottom: 26px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { margin-top: 32px; gap: 10px; }
  .stat { flex: 1 1 130px; min-width: 0; padding: 12px 15px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* single post */
  .post-layout { gap: 18px; }
  .post-info h1 { font-size: 20px; }
  .post-media img, .post-media video { max-height: 56vh; }
  .post-stats { gap: 10px; font-size: 12.5px; }

  /* forms — 16px keeps iOS from zooming in when a field is focused */
  input[type=text], input[type=password], input[type=search], textarea, select { font-size: 16px; }
  .card-panel { padding: 18px 15px; }
  .form-actions .btn { width: 100%; }

  /* tables */
  th, td { padding: 10px 12px; font-size: 13px; }
  .cell-actions .btn { padding: 8px 12px; font-size: 12.5px; }

  /* modal rises from the bottom like a sheet */
  .modal { padding: 12px; align-items: flex-end; }
  .modal-box { padding: 20px 16px; max-height: 92vh; }

  .emoji-panel { width: min(300px, 92vw); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .device-agent { max-width: 190px; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
  .card-body { padding: 10px 11px 11px; }
  .card-title { font-size: 13px; }
  .tabs { gap: 6px; }
  .tab { padding: 7px 12px; font-size: 13px; }
}

/* ---------- IP location map (admin) ---------- */

.map-dialog {
  width: min(720px, 94vw);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.map-dialog::backdrop { background: rgba(3, 7, 4, .72); }
.map-dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.map-dialog-title {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-dialog iframe {
  display: block;
  width: 100%;
  height: min(58vh, 420px);
  border: 0;
  background: var(--ink);
}
.map-dialog-note { margin: 0; padding: 11px 16px 15px; font-size: 12px; }

@media (max-width: 760px) {
  .map-dialog { width: 96vw; }
  .map-dialog iframe { height: 54vh; }
}

/* ---------- the bell ---------- */

.bell { position: relative; }

.bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.bell-btn:hover, .bell.is-open .bell-btn { color: var(--text); border-color: var(--accent); }

.bell-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 18px;
  text-align: center;
}
.bell-count[hidden] { display: none; }

.bell-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.bell-panel[hidden] { display: none; }

.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.bell-clear {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
.bell-clear:hover { color: var(--ink); border-color: var(--accent-2); }
.bell-clear:disabled { opacity: .5; cursor: progress; }
.bell-clear[hidden] { display: none; }

.bell-body { overflow-y: auto; padding: 6px; }

.bell-empty { margin: 20px 12px; text-align: center; font-size: 13px; color: var(--muted); }

.bell-group + .bell-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border-soft); }
.bell-group-head {
  padding: 8px 12px 4px;
  font-size: 10.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.bell-item {
  display: block;
  padding: 9px 12px;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.bell-item:hover { background: var(--surface-2); text-decoration: none; }
.bell-item-report { border-left-color: var(--accent); }
.bell-item-post   { border-left-color: var(--accent-2); }
.bell-item-chat   { border-left-color: var(--success); }

.bell-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
}
.bell-item-author { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent-2); }
.bell-item-body {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.bell-item-time { display: block; margin-top: 4px; font-size: 11px; color: var(--muted); }

.bell-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 15px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
}
.bell-foot a { color: var(--accent-2); }

.pill-live { margin-left: 6px; background: var(--accent-2); color: var(--ink); }
.pill-live[hidden] { display: none; }

/* ---------- the notice banner ---------- */

.notice-bar {
  overflow: hidden;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.notice-track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 46px;
  padding: 8px 0;
  white-space: nowrap;
  will-change: transform;
  animation: notice-scroll 22s linear infinite;
}

.notice-bar:hover .notice-track { animation-play-state: paused; }

.notice-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--accent-2);
}

.notice-item::before {
  content: "//";
  color: var(--muted);
}

@keyframes notice-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- adverts ---------- */

.ad-banner {
  display: block;
  line-height: 0;
}
.ad-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* The strip under the header, on every page. */
.ad-strip {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px 0;
}
.ad-strip .ad-banner img {
  max-height: 130px;
  object-fit: cover;
}

/* The block under a post, above its comments. */
.ad-block {
  margin-top: 18px;
}
.ad-block .ad-banner img {
  max-height: 170px;
  object-fit: cover;
}

/* Small preview of an uploaded advert in the admin list. */
.ad-thumb {
  display: block;
  width: 132px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Download buttons under the media on a post. */
.post-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.post-downloads .muted { font-size: 12px; }

/* The top-right corner is kept for the two shortcuts, side by side, so the
   badges along the bottom edge stay readable. */
.card-download {
  position: absolute;
  right: 48px;
  top: 9px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(4, 10, 6, .78);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, border-color .15s ease;
}
.card:hover .card-download { opacity: 1; }
.card-download:hover {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 760px) {
  .ad-strip { padding-top: 10px; }
  .ad-strip .ad-banner img { max-height: 96px; }
  .card-download { opacity: 1; }
}

@media (max-width: 420px) {
  .ad-strip .ad-banner img { max-height: 74px; }
  .ad-thumb { width: 104px; }
}

/* ---------- tickets ---------- */

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0;
}

.ticket-msg {
  max-width: 720px;
  padding: 13px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-sm);
}

.ticket-msg.is-staff {
  border-left-color: var(--accent);
  background: var(--surface);
}

.ticket-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.ticket-who {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.ticket-msg.is-staff .ticket-who { color: var(--accent-2); }

.ticket-meta time { font-size: 11.5px; color: var(--muted); }

.ticket-body {
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ticket-reply { margin-top: 18px; }

.ticket-closed-note { font-size: 13.5px; margin-top: 18px; }

/* ---------- levels & anonymous profiles ---------- */

a.anon-tag { text-decoration: none; transition: background .15s ease, border-color .15s ease, color .15s ease; }
a.anon-tag:hover { color: #f7e9f0; background: rgba(255, 138, 92, .22); border-color: var(--accent); }

.badge-level {
  --lv: 195;
  color: hsl(var(--lv), 85%, 78%);
  background: hsla(var(--lv), 85%, 60%, .14);
  border: 1px solid hsla(var(--lv), 85%, 60%, .42);
  font-weight: 650;
}
.badge-level.lvl-2 { --lv: 200; }
.badge-level.lvl-3 { --lv: 165; }
.badge-level.lvl-4 { --lv: 125; }
.badge-level.lvl-5 { --lv: 85; }
.badge-level.lvl-6 { --lv: 45; }
.badge-level.lvl-7 { --lv: 15; }
.badge-level.lvl-8 { --lv: 320; box-shadow: 0 0 9px hsla(320, 85%, 60%, .3); }

.level-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.level-bar {
  position: relative;
  height: 7px;
  max-width: 420px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.level-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s ease;
}

/* ---------- coins & gifting ---------- */

.coin-glyph { font-size: 13px; line-height: 1; }

.usermenu-coins {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--warning);
}

.badge-gift {
  --gf: 45;
  color: hsl(var(--gf), 90%, 78%);
  background: hsla(var(--gf), 85%, 58%, .14);
  border: 1px solid hsla(var(--gf), 85%, 58%, .42);
  font-weight: 650;
}
.badge-gift.g1 { --gf: 190; }
.badge-gift.g2 { --gf: 150; }
.badge-gift.g3 { --gf: 45; }
.badge-gift.g4 { --gf: 25; }
.badge-gift.g5 { --gf: 320; box-shadow: 0 0 9px hsla(320, 85%, 60%, .32); }

.gift-bar > span {
  background: linear-gradient(90deg, #ffc857, #ff9220);
}

.gift-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  font-size: 19px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.gift-wall {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.gift-wall-lead {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--warning);
}
.gift-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 15px;
  line-height: 1.2;
}
.gift-chip-count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.gift-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.gift-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.gift-option:hover { border-color: var(--accent); }
.gift-option input { position: absolute; opacity: 0; pointer-events: none; }
.gift-option:has(input:checked) {
  border-color: var(--accent-2);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--accent-2), 0 0 16px rgba(255, 196, 107, .22);
}
.gift-option:has(input:disabled) {
  opacity: .42;
  cursor: not-allowed;
  border-color: var(--border-soft);
}
.gift-option:has(input:disabled):hover { border-color: var(--border-soft); }
.gift-option-emoji { font-size: 25px; line-height: 1; }
.gift-option-name { font-weight: 650; font-size: 13.5px; }
.gift-option-cost { font-family: var(--mono); font-size: 11.5px; color: var(--warning); }

/* ---------- boosts ---------- */

.boost-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 200, 87, .13);
  border: 1px solid rgba(255, 200, 87, .45);
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.card-boost {
  position: absolute;
  bottom: 9px;
  left: 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(4, 10, 6, .82);
  border: 1px solid rgba(255, 200, 87, .5);
  color: var(--warning);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(255, 200, 87, .2);
}

/* A post the admin team has lifted to page one. It shares the bottom-left
   corner with the boost tag, so when both are on a card the boost steps up. */
.card-bump {
  position: absolute;
  bottom: 9px;
  left: 9px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(4, 10, 6, .82);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(255, 138, 92, .22);
}
.card-media:has(.card-bump) .card-boost { bottom: 38px; }

/* ---------- verified & 18+ ---------- */

.badge-verified {
  color: #8ff0c6;
  background: var(--success-soft);
  border: 1px solid #1f4f3e;
  font-weight: 650;
  white-space: nowrap;
}
.badge-adult {
  color: #ffb3c1;
  background: var(--danger-soft);
  border: 1px solid #5a2530;
  font-weight: 650;
  white-space: nowrap;
}

.card-verified {
  position: absolute;
  bottom: 9px;
  right: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(4, 10, 6, .82);
  border: 1px solid #1f4f3e;
  color: #8ff0c6;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.card-adult {
  position: absolute;
  top: 38px;
  left: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(4, 10, 6, .82);
  border: 1px solid #5a2530;
  color: #ffb3c1;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
}
/* The 18+ tag, the file count and the type pill share the top-left corner,
   stacked so none of them covers another. */
.card-media:has(.card-adult) .card-count { top: 67px; }

.card-media.is-adult-locked video,
.card-media.is-adult-locked img { display: none; }

.adult-card-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 70, 100, .16), transparent 62%),
    rgba(4, 10, 6, .92);
}
.adult-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #5a2530;
  background: var(--danger-soft);
  color: #ffb3c1;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}
.adult-card-note {
  font-size: 12px;
  color: var(--muted);
  max-width: 180px;
}

/* Signed-in members still get a censor overlay on 18+ media: the file loads
   blurred and only clears once they click through and confirm. */
.card-media.is-adult-censored img,
.card-media.is-adult-censored video { filter: blur(22px); transform: scale(1.08); }
.card-media.is-adult-censored.is-revealed img,
.card-media.is-adult-censored.is-revealed video { filter: none; transform: none; }
.card-media.is-adult-censored .adult-card-lock { background: rgba(4, 10, 6, .5); }
.card-media.is-adult-censored.is-revealed .adult-card-lock { display: none; }

.post-media.is-adult-censored { position: relative; }
.post-media.is-adult-censored img,
.post-media.is-adult-censored video { filter: blur(26px); transform: scale(1.05); }
.post-media.is-adult-censored.is-revealed img,
.post-media.is-adult-censored.is-revealed video { filter: none; transform: none; }
.adult-censor-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 24px;
  border: 0;
  cursor: pointer;
  text-align: center;
  color: inherit;
  font: inherit;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 70, 100, .2), transparent 62%),
    rgba(4, 10, 6, .62);
}
.adult-censor-overlay strong { font-size: 17px; }
.adult-censor-overlay .adult-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid #5a2530;
  background: var(--danger-soft);
  color: #ffb3c1;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}
.post-media.is-adult-censored.is-revealed .adult-censor-overlay { display: none; }

.adult-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 46px 24px;
  text-align: center;
  border: 1px solid #5a2530;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 70, 100, .14), transparent 60%),
    var(--surface);
}
.adult-gate h2 { margin: 0; font-size: 20px; }
.adult-gate .adult-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 52px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid #5a2530;
  background: var(--danger-soft);
  color: #ffb3c1;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}
.adult-gate .row { gap: 10px; flex-wrap: wrap; }

/* ---------- selfie age check ---------- */

.age-stage {
  position: relative;
  margin: 16px 0;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--ink);
  overflow: hidden;
}

.age-stage video,
.age-stage img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
  transform: scaleX(-1); /* mirror the live camera so it feels natural */
}

/* The captured still is already the right way round — flip it back. */
.age-stage img[data-age-shot] { transform: none; }

/* Oval face guide — the dimmed framing age-verification apps use.
   It only shows while the live camera feed is on screen. */
.age-guide {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.age-stage video:not([hidden]) ~ .age-guide { display: flex; }

/* Darken everything outside the oval, leaving a soft-edged clear window. */
.age-guide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 33% 45% at 50% 48%,
              rgba(2, 8, 5, 0) 0 88%, rgba(2, 8, 5, .78) 97%);
}

.age-guide-oval {
  position: relative;
  flex: 0 0 auto;
  height: 82%;
  max-height: 300px;
  aspect-ratio: 3 / 4;
  border-radius: 50%;
  border: 2px dashed rgba(247, 233, 240, .85);
  overflow: hidden;
  animation: age-guide-pulse 2.4s ease-in-out infinite;
}

/* Sweeping scan line inside the oval. */
.age-guide-oval::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 10%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: age-guide-scan 2.8s ease-in-out infinite;
}

.age-guide-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(247, 233, 240, .85);
  text-shadow: 0 1px 8px rgba(2, 8, 5, .95);
}

/* Liveness ring — fills as the face is moved left and right. Guidance only:
   the "Take photo" button is never locked behind it. */
.age-ring {
  position: absolute;
  right: 14px;
  bottom: 54px;
  width: 52px;
  height: 52px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}

.age-stage video:not([hidden]) ~ .age-ring { display: flex; }

.age-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.age-ring-track,
.age-ring-fill {
  fill: none;
  stroke-width: 4;
}

.age-ring-track { stroke: rgba(233, 237, 255, .18); }

.age-ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset .12s linear;
  filter: drop-shadow(0 0 6px rgba(255, 138, 92, .6));
}

.age-ring-pct {
  position: relative;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 1px 6px rgba(2, 8, 5, .95);
}

@keyframes age-guide-pulse {
  0%, 100% { border-color: rgba(247, 233, 240, .85); box-shadow: 0 0 0 rgba(255, 138, 92, 0); }
  50%      { border-color: var(--accent);            box-shadow: 0 0 26px rgba(255, 138, 92, .55); }
}

@keyframes age-guide-scan {
  0%   { top: 10%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 88%; opacity: 0; }
}

.age-status {
  margin: 0;
  padding: 18px 16px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.age-stage video:not([hidden]) ~ .age-status,
.age-stage img:not([hidden]) ~ .age-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(transparent, rgba(2, 8, 5, .9));
  color: var(--text);
  padding: 26px 16px 12px;
}

.age-verify {
  margin-top: 16px;
  padding: 22px 16px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.age-verify p {
  margin: 12px 0 14px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
}

.age-verify-ring {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: age-spin .9s linear infinite;
}

@keyframes age-spin { to { transform: rotate(360deg); } }

.age-verify-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.age-verify-bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--neon-pink));
  animation: age-slide 1.3s ease-in-out infinite;
}

@keyframes age-slide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

/* Owner review list thumbnail (admin panel). */
.age-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  display: block;
}

/* ---------- reactions ---------- */

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.reaction-bar form { display: inline-flex; margin: 0; }
.reaction.reaction { gap: 6px; }
.reaction.is-active {
  border-color: var(--accent-2);
  background: rgba(255, 196, 107, .16);
  color: #f4e2e8;
  box-shadow: 0 0 0 1px var(--accent-2), 0 0 14px rgba(255, 196, 107, .22);
}
.reaction[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- share menu (post view) ---------- */

.share { position: relative; display: inline-flex; margin-top: 12px; }
.share-toggle { gap: 7px; }

.share-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 140;
  display: flex;
  flex-direction: column;
  min-width: 208px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(10, 24, 16, .98);
  box-shadow: var(--shadow);
}
.share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.share-item:hover, .share-item:focus-visible { background: var(--surface-2); text-decoration: none; }
.share-glyph { width: 18px; text-align: center; font-size: 14px; }

@media (max-width: 420px) {
  .adult-card-note { display: none; }
  .card-verified, .card-adult { font-size: 10px; padding: 2px 7px; }
}

/* ---------- house rules gate ----------
   The one-time overlay in front of the whole board. It is deliberately
   opaque: nothing behind it is readable until the rules are accepted. */

html.is-terms-locked,
html.is-terms-locked body { overflow: hidden; }

.terms {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(255, 138, 92, .20), transparent 62%),
    radial-gradient(900px 560px at 92% 112%, rgba(255, 111, 165, .18), transparent 62%),
    radial-gradient(700px 500px at 78% -6%, rgba(255, 196, 107, .16), transparent 60%),
    #0b0716;
  animation: terms-fade .3s ease both;
}
.terms:focus { outline: none; }

/* Drifting light behind the card, plus a faint scan-line texture. */
.terms-glow {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(233, 237, 255, .028) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 30% 40%, rgba(255, 138, 92, .16), transparent 46%),
    radial-gradient(circle at 72% 66%, rgba(255, 111, 165, .14), transparent 46%);
  animation: terms-drift 18s ease-in-out infinite alternate;
}

.terms-card {
  position: relative;
  width: 100%;
  max-width: 660px;
  max-height: 88vh;
  margin: auto;
  padding: 30px 30px 22px;
  overflow-y: auto;
  border: 1px solid transparent;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #241638, #170f26 60%) padding-box,
    linear-gradient(115deg, var(--accent), var(--accent-2), var(--neon-pink), var(--neon-lime), var(--accent)) border-box;
  background-size: 100% 100%, 340% 100%;
  background-position: 0 0, 0 0;
  box-shadow: 0 34px 90px rgba(8, 4, 16, .72), 0 0 70px rgba(255, 138, 92, .10);
  animation: terms-rise .5s cubic-bezier(.2, .9, .25, 1.04) both,
             terms-edge 12s linear infinite;
}

/* Neon sheen across the top edge of the card. */
.terms-strip {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--neon-pink), var(--neon-lime), var(--accent));
  background-size: 320% 100%;
  animation: terms-edge 6s linear infinite;
}

.terms-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 16px;
}

.terms-sigil {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  border: 1px solid #5d2740;
  background: radial-gradient(circle at 50% 35%, rgba(255, 77, 109, .26), rgba(58, 22, 38, .9));
  color: #ffb3c1;
  animation: terms-pulse 2.6s ease-in-out infinite;
}

.terms-eyebrow {
  margin: 0 0 3px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.terms-head h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.015em;
  background: linear-gradient(100deg, var(--accent), #ffc46b 42%, var(--accent-2) 72%, var(--neon-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.terms-lede {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.terms-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.terms-list li {
  display: flex;
  gap: 13px;
  padding: 14px 15px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(16, 34, 24, .72), rgba(8, 18, 12, .72));
  animation: terms-item .45s ease both;
}
.terms-list li:nth-child(1) { animation-delay: .10s; }
.terms-list li:nth-child(2) { animation-delay: .18s; }
.terms-list li:nth-child(3) { animation-delay: .26s; }
.terms-list li:nth-child(4) { animation-delay: .34s; }

.terms-list li.is-severe {
  border-color: #5d2740;
  background: linear-gradient(180deg, rgba(58, 22, 38, .78), rgba(24, 14, 26, .8));
}

.terms-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.terms-list li.is-severe .terms-num {
  border-color: #6b2c46;
  color: #ffb3c1;
}

.terms-list h3 {
  margin: 4px 0 4px;
  font-size: 15px;
  letter-spacing: -.005em;
}
.terms-list li.is-severe h3 { color: #ffc7d2; }

.terms-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.terms-refusal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin: 0 0 18px;
  padding: 15px 16px;
  border: 1px solid #6b2c46;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(58, 22, 38, .9), rgba(24, 14, 26, .9));
  animation: terms-item .3s ease both;
}
.terms-refusal strong { color: #ffc7d2; font-size: 14.5px; }
.terms-refusal span { color: var(--muted); font-size: 13px; }
.terms-refusal .btn { margin-top: 4px; }

.terms-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.terms-note {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  opacity: .85;
}

@keyframes terms-fade { from { opacity: 0; } }
@keyframes terms-rise {
  from { opacity: 0; transform: translateY(22px) scale(.975); }
  to   { opacity: 1; transform: none; }
}
@keyframes terms-item { from { opacity: 0; transform: translateX(-8px); } }
@keyframes terms-edge {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 0, 340% 0; }
}
@keyframes terms-drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1.02); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}
@keyframes terms-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 77, 109, 0); }
  50%      { box-shadow: 0 0 26px rgba(255, 77, 109, .45); }
}

@media (max-width: 560px) {
  .terms { padding: 12px; align-items: flex-start; }
  .terms-card { padding: 22px 18px 18px; max-height: 94vh; }
  .terms-head h2 { font-size: 24px; }
  .terms-actions .btn { flex: 1 1 100%; }
  .terms-list li { padding: 12px 12px; gap: 11px; }
}

/* ---------- phone alerts toggle (header) ---------- */

.push-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.push-toggle:hover { color: var(--text); border-color: var(--accent); }

.push-toggle.is-on {
  border-color: var(--accent);
  color: #ffd9c2;
  box-shadow: 0 0 16px rgba(255, 138, 92, .28);
}
.push-toggle.is-busy { opacity: .6; cursor: progress; }
.push-toggle.is-hint { color: var(--muted); opacity: .8; }

/* The button arrives hidden and the script reveals it only once the browser
   says it can receive alerts. Needed because the display rule above would
   otherwise beat the browser's own [hidden] styling. */
.push-toggle[hidden] { display: none; }

/* On phones the long label goes, but the button still says what it is. */
.push-label-short { display: none; }

@media (max-width: 760px) {
  .push-toggle { padding: 0 11px; }
  .push-label { display: none; }
  .push-label-short { display: inline; }
}

/* Only a genuinely tiny screen goes without the word — most phones report
   exactly 360px wide, so the cutoff has to sit well below that. */
@media (max-width: 320px) {
  .push-toggle { width: 38px; padding: 0; justify-content: center; }
  .push-label-short { display: none; }
}

/* ---------- install as an app ---------- */

.install-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.install-toggle:hover { color: var(--text); border-color: var(--accent); }

/* The script reveals this only when the browser offers an install, so the
   display rule above must not beat the browser's own [hidden] styling. */
.install-toggle[hidden] { display: none; }

/* On phones the word goes and the button becomes a plain download glyph. */
@media (max-width: 760px) {
  .install-toggle { width: 38px; padding: 0; justify-content: center; }
  .install-label { display: none; }
}

/* ---------- the Android app itself, as a plain download ---------- */

.apk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  transition: color .15s ease, border-color .15s ease;
}
.apk-toggle:hover { text-decoration: none; color: var(--text); border-color: var(--accent); }

/* The wording shortens before the button does — on a phone this sits beside
   the alerts button and the bell, and both words would not fit. */
.apk-label-short { display: none; }

@media (max-width: 760px) {
  .apk-label { display: none; }
  .apk-label-short { display: inline; }
}

@media (max-width: 320px) {
  .apk-toggle { width: 38px; padding: 0; justify-content: center; }
  .apk-label-short { display: none; }
}

/* ---------- iPhone & iPad ---------- */

/* Apple opens no APK and cannot install one, so the Android download is kept
   off those devices. The button beside it carries the Share menu steps. */
.is-apple .apk-toggle,
.is-apple .footer-app { display: none; }

.ios-steps { margin: 16px 0 14px; }
.ios-steps li { padding: 12px 13px; }

.ios-note {
  margin: 0 0 18px;
  padding: 11px 13px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 138, 92, .08);
  font-size: 13px;
  color: var(--muted);
}
.ios-note strong { color: var(--text); }

/* ===========================================================
   Private posts
   A private post hands nothing to a browser without a pass, so
   its card shows a notice where the picture would be, and the
   post page itself becomes the request form.
   =========================================================== */

.card-media.is-private-locked img,
.card-media.is-private-locked video { display: none; }

.private-card-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(255, 138, 92, .05) 0 9px, transparent 9px 18px),
    rgba(2, 8, 5, .94);
}

.private-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.private-card-note {
  max-width: 190px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.card-private { border-style: dashed; }

.card-private-pill {
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- the request gate on a single post ---------- */

.private-gate {
  max-width: 560px;
  margin: 40px auto;
  padding: 26px 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.private-gate-glyph {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border: 1px solid var(--accent);
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
  box-shadow: 0 0 22px rgba(255, 138, 92, .22);
}

.private-gate h1 { font-size: 22px; }

.private-gate-post {
  padding: 13px 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: left;
}

.private-gate-title {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 650;
}

.private-gate .form { text-align: left; }

/* ===========================================================
   The archive grid — quick view and hover preview
   =========================================================== */

/* A second button on the picture: the magnifier opens the file in
   place, so one clip can be checked without leaving the grid. */
.card-quick {
  position: absolute;
  right: 9px;
  top: 9px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(4, 10, 6, .78);
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.card:hover .card-quick { opacity: 1; }
.card-quick:hover {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.08);
}

/* The play glyph on a clip. It fades as the preview starts rolling. */
.card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding-left: 3px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: rgba(2, 8, 5, .62);
  color: var(--accent);
  font-size: 15px;
  pointer-events: none;
  opacity: .92;
  transition: opacity .2s ease, transform .2s ease;
}
.card-video:hover .card-play { opacity: 0; transform: translate(-50%, -50%) scale(.7); }

@media (max-width: 760px) {
  .card-quick { opacity: 1; }
  .card-play { opacity: .92; }
}

/* ---------- the quick view overlay ---------- */

.quickview {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
  background: rgba(2, 8, 5, .92);
  backdrop-filter: blur(9px);
}
.quickview.is-open { display: flex; }

.quickview-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: min(980px, 100%);
  max-height: 100%;
}

.quickview-stage { display: grid; place-items: center; min-height: 0; }
.quickview-stage img,
.quickview-stage video {
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--ink);
}

.quickview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.quickview-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
}

.quickview-close {
  position: absolute;
  top: -13px;
  right: -13px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.quickview-close:hover { border-color: var(--accent); color: var(--accent); }

body.quickview-open { overflow: hidden; }

@media (max-width: 620px) {
  .quickview { padding: 14px; }
  .quickview-stage img, .quickview-stage video { max-height: 62vh; }
}

/* ---------- terminal touches for the filter bar ---------- */

.tab {
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
}
.tab.is-active::before { content: '> '; opacity: .8; }
.tab.is-active { color: var(--ink); font-weight: 700; }

/* ===========================================================
   Appearance and language
   The gear beside the alerts button opens a small panel of
   colour palettes and the languages the board speaks.
   =========================================================== */

.prefs { position: relative; }

.prefs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.prefs-btn:hover, .prefs.is-open .prefs-btn { color: var(--text); border-color: var(--accent); }

.prefs-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(304px, calc(100vw - 24px));
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}
.prefs-panel[hidden] { display: none; }

.prefs-head {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.prefs-label {
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.prefs-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.prefs-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: .03em;
  cursor: pointer;
}

.prefs-chip {
  display: block;
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.prefs-swatch:hover .prefs-chip { transform: translateY(-1px); }
.prefs-swatch.is-active { color: var(--text); }
.prefs-swatch.is-active .prefs-chip {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 14px rgba(255, 255, 255, .06);
}

/* Each chip is a miniature of the sky that palette paints behind the page. */
.prefs-chip[data-palette="dusk"]     { background: linear-gradient(140deg, #0e0a1a 0%, #4a2a5e 42%, #ff6fa5 78%, #ffc46b 100%); }
.prefs-chip[data-palette="midnight"] { background: linear-gradient(140deg, #060a16 0%, #16223e 42%, #4fb2ff 78%, #7fd8ff 100%); }
.prefs-chip[data-palette="ember"]    { background: linear-gradient(140deg, #140705 0%, #4a1d0c 42%, #ff7a3d 78%, #ffb14f 100%); }
.prefs-chip[data-palette="phosphor"] { background: linear-gradient(140deg, #04100a 0%, #0e3520 42%, #4fe08a 78%, #9dffc2 100%); }

.prefs-langs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.prefs-lang {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.prefs-lang:hover { color: var(--text); border-color: var(--accent-2); }
.prefs-lang.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

/* While a page is being translated it is held back, so the English words are
   never shown for a moment before they turn into the chosen language. The
   timeout in the header script takes this off again even if the translator
   never runs. */
html.i18n-pending body { visibility: hidden; }



