/* =========================================================================
   VibeLoop — one stylesheet, dark + light, mobile first, animated.
   ========================================================================= */

/* ---------------------------------------------------------------- Tokens */
:root {
  --brand: #7c5cff;
  --brand-2: #ff4d8d;
  --brand-3: #2ee6c5;
  --grad: linear-gradient(120deg, #7c5cff 0%, #b45cff 45%, #ff4d8d 100%);
  --grad-soft: linear-gradient(120deg, rgba(124, 92, 255, .18), rgba(255, 77, 141, .18));

  --r-xs: 8px;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  --sp: 4px;
  --topbar-h: 64px;
  --tabbar-h: 68px;
  --maxw: 1240px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .16s;
  --t: .28s;
  --t-slow: .6s;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #08080e;
  --bg-2: #0c0c14;
  --surface: #12121c;
  --surface-2: #191926;
  --surface-3: #20202f;
  --line: rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f1f1f7;
  --text-2: #c3c3d4;
  --muted: #8f8fa6;
  --shadow: 0 18px 50px -22px rgba(0, 0, 0, .9);
  --shadow-sm: 0 6px 20px -12px rgba(0, 0, 0, .9);
  --glow: 0 0 0 1px rgba(124, 92, 255, .25), 0 20px 60px -30px rgba(124, 92, 255, .55);
  --skeleton: linear-gradient(90deg, #171724 25%, #20202f 37%, #171724 63%);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f5fb;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f9;
  --surface-3: #e9e9f4;
  --line: rgba(18, 18, 40, .09);
  --line-strong: rgba(18, 18, 40, .18);
  --text: #13131f;
  --text-2: #33334a;
  --muted: #63637c;
  --shadow: 0 18px 40px -26px rgba(24, 24, 60, .35);
  --shadow-sm: 0 6px 18px -12px rgba(24, 24, 60, .3);
  --glow: 0 0 0 1px rgba(124, 92, 255, .18), 0 24px 60px -34px rgba(124, 92, 255, .5);
  --skeleton: linear-gradient(90deg, #ececf5 25%, #f6f6fc 37%, #ececf5 63%);
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60% 40% at 8% -6%, rgba(124, 92, 255, .18), transparent 60%),
    radial-gradient(50% 40% at 96% 4%, rgba(255, 77, 141, .14), transparent 60%);
  opacity: .9;
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(60% 40% at 8% -6%, rgba(124, 92, 255, .16), transparent 60%),
    radial-gradient(50% 40% at 96% 4%, rgba(255, 77, 141, .12), transparent 60%);
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.025em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.2rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: .12em .42em; border-radius: 6px; border: 1px solid var(--line); }
::selection { background: rgba(124, 92, 255, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* ------------------------------------------------------------ Utilities */
.muted { color: var(--muted); }
.tiny { font-size: .78rem; line-height: 1.45; }
.center { text-align: center; }
.center-actions { justify-content: center; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 18px; }
.mb-3 { margin-bottom: 18px; }
.hide-sm { display: inline-flex; }
.dot-sep { opacity: .5; margin: 0 2px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: gradShift 9s ease-in-out infinite;
}
.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.ico-xs { width: 13px; height: 13px; flex: 0 0 auto; }

/* ------------------------------------------------------------- Animations */
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  0% { opacity: 0; transform: scale(.92); }
  60% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.28) rotate(-6deg); }
  100% { transform: scale(1); }
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 230, 197, .55); }
  70% { box-shadow: 0 0 0 9px rgba(46, 230, 197, 0); }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(2deg); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes barGrow { from { width: 0; } }
@keyframes ripple {
  to { transform: scale(3.2); opacity: 0; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); }
}
@keyframes barPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 45ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Cross-document view transitions (Chrome). Everything else just fades. */
@view-transition { navigation: auto; }
/* The transition overlay must never swallow a click. */
::view-transition { pointer-events: none !important; }
::view-transition-old(root) { animation: vtOut .18s ease both; }
::view-transition-new(root) { animation: vtIn .32s var(--ease-out) both; }
@keyframes vtOut { to { opacity: 0; transform: scale(.995); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(10px); } }

/* Theme switch reveal */
::view-transition-old(theme-clip),
::view-transition-new(theme-clip) { animation: none; }

/* ------------------------------------------------------------ Nav progress */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0;
  z-index: 200;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(124, 92, 255, .8);
  transition: width .4s var(--ease), opacity .3s;
  opacity: 0;
}
.nav-progress.is-active { opacity: 1; }
.nav-progress.is-done { width: 100% !important; opacity: 0; transition: width .18s, opacity .3s .18s; }

/* ------------------------------------------------------------------ Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
  transition: border-color var(--t), background var(--t);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .topbar { background: var(--bg-2); }
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-size: 1.16rem;
  flex: 0 0 auto;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--grad);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px -8px rgba(124, 92, 255, .9);
  transition: transform var(--t) var(--ease);
}
.brand-mark::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 9px solid #fff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-left: 3px;
}
.brand-mark span {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .5), transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.brand:hover .brand-mark span { transform: translateX(120%); }
.brand-mark-sm { width: 22px; height: 22px; border-radius: 7px; }
.brand-mark-sm::after { border-left-width: 7px; border-top-width: 4.5px; border-bottom-width: 4.5px; }
.brand-name span { color: var(--brand); }

.mainnav { display: flex; gap: 2px; margin-left: 6px; }
.mainnav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: .92rem;
  font-weight: 550;
  color: var(--muted);
  transition: color var(--t-fast), background var(--t-fast);
}
.mainnav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: translateX(-50%);
  transition: width var(--t) var(--ease);
}
.mainnav-link:hover { color: var(--text); background: var(--surface-2); }
.mainnav-link.is-active { color: var(--text); }
.mainnav-link.is-active::after { width: 18px; }

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

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.92); }

.theme-toggle { position: relative; overflow: hidden; }
.theme-icon { position: absolute; display: grid; place-items: center; transition: transform .45s var(--ease), opacity .3s; }
html[data-theme="dark"] .theme-icon-moon { transform: translateY(0) rotate(0); opacity: 1; }
html[data-theme="dark"] .theme-icon-sun { transform: translateY(26px) rotate(-40deg); opacity: 0; }
html[data-theme="light"] .theme-icon-sun { transform: translateY(0) rotate(0); opacity: 1; }
html[data-theme="light"] .theme-icon-moon { transform: translateY(-26px) rotate(40deg); opacity: 0; }

/* user menu */
.usermenu { position: relative; }
.usermenu-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 3px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.usermenu-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.usermenu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 246px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
  animation: popIn .22s var(--ease-out) both;
  z-index: 95;
}
.usermenu-panel[hidden] { display: none; }
.usermenu-head {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.usermenu-head strong { display: block; font-size: .94rem; }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  background: none;
  border-radius: 10px;
  font-size: .9rem;
  cursor: pointer;
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast), padding-left var(--t-fast);
}
.menu-item:hover { background: var(--surface-2); color: var(--text); padding-left: 14px; }
.menu-item-danger { color: #ff6b8a; }

/* ------------------------------------------------------------------ Layout */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 18px calc(var(--tabbar-h) + 40px);
  animation: fadeIn .4s var(--ease-out) both;
}
.page-narrow { max-width: 760px; margin: 0 auto; }
.section { margin-top: 40px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr; gap: 26px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t), transform var(--t) var(--ease), box-shadow var(--t);
}
.pad { padding: 20px; }
.card.pad { padding: 20px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h1 { margin-bottom: .2em; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 10px;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-3);
  animation: pulseDot 2s infinite;
  flex: 0 0 auto;
}

/* ------------------------------------------------------------------ Buttons */
.btn {
  --btn-bg: var(--surface-2);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  font-size: .93rem;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t), background var(--t), border-color var(--t), filter var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1.5px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.985); }
.btn-primary {
  background: var(--grad);
  background-size: 160% 100%;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 30px -16px rgba(124, 92, 255, .95);
}
.btn-primary:hover { background-position: 100% 50%; box-shadow: 0 18px 40px -18px rgba(255, 77, 141, .8); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 8px 14px; font-size: .84rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-label { transition: opacity .2s, transform .2s; }
.btn-spinner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin .7s linear infinite;
}
.btn.is-loading .btn-label { opacity: 0; transform: scale(.9); }
.btn.is-loading .btn-spinner { opacity: 1; }

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  transform: scale(0);
  pointer-events: none;
  animation: ripple .6s ease-out forwards;
  z-index: -1;
}
.btn-ghost .ripple, .icon-btn .ripple { background: rgba(124, 92, 255, .25); }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 550;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.link-btn:hover { color: var(--text); background: var(--surface-2); }
.link-btn:active { transform: scale(.96); }

/* -------------------------------------------------------------------- Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .73rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.chip-platform { color: var(--p, var(--brand)); border-color: color-mix(in srgb, var(--p, var(--brand)) 35%, transparent); background: color-mix(in srgb, var(--p, var(--brand)) 12%, transparent); }
.chip-live { color: var(--brand-3); border-color: rgba(46, 230, 197, .3); background: rgba(46, 230, 197, .1); }
.chip-filter { cursor: pointer; transition: all var(--t-fast); }
.chip-filter:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.chip-filter.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-cat { background: var(--grad-soft); border-color: transparent; }
.chip-pin { color: #ffc86b; border-color: rgba(255, 200, 107, .3); background: rgba(255, 200, 107, .1); }
.chip-tag { text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; }
.chip-platform svg, .chip svg { color: inherit; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }

/* ------------------------------------------------------------------ Avatars */
.avatar {
  --size: 40px;
  width: var(--size);
  height: var(--size);
  flex: 0 0 var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: calc(var(--size) * .38);
  letter-spacing: -.02em;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--a-h, 260) 78% 58%), hsl(calc(var(--a-h, 260) + 46) 82% 50%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 16px -10px rgba(0, 0, 0, .8);
  user-select: none;
}
.avatar-xs { --size: 22px; }
.avatar-sm { --size: 32px; }
.avatar-md { --size: 42px; }
.avatar-xl { --size: 76px; font-size: 1.6rem; }

/* ------------------------------------------------------------------ Inputs */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: .82rem; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.field-label em { font-style: normal; color: var(--brand); font-variant-numeric: tabular-nums; }
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--line-strong); }
.input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .18);
}
textarea.input { resize: vertical; min-height: 64px; line-height: 1.55; }
select.input { 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, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon .ico { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-with-icon .input { padding-left: 40px; }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn .input { flex: 1; }
.input-with-prefix { display: flex; align-items: center; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm); padding-left: 13px; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.input-with-prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 92, 255, .18); }
.input-with-prefix > span { color: var(--muted); }
.input-with-prefix .input { border: 0; background: none; box-shadow: none; padding-left: 4px; }

.check { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--text-2); cursor: pointer; }
.check input {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--t-fast);
  flex: 0 0 auto;
}
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ""; width: 5px; height: 9px; border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(42deg) translateY(-1px); }

.fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0; }
.fieldset legend { padding: 0 8px; font-size: .82rem; font-weight: 600; color: var(--text-2); }
.form-row { display: grid; grid-template-columns: 1fr; gap: 14px; }
.handle-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.handle-field { display: flex; align-items: center; gap: 8px; }
.handle-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--p) 16%, transparent);
  color: var(--p);
  border: 1px solid color-mix(in srgb, var(--p) 28%, transparent);
}
.handle-field .input { padding: 9px 12px; font-size: .88rem; }

.slider-field { display: flex; flex-direction: column; gap: 6px; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 4px; background: var(--surface-3); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6.5px;
  border-radius: 50%;
  background: var(--grad);
  border: 2px solid var(--surface);
  box-shadow: 0 2px 8px -2px rgba(124, 92, 255, .9);
  transition: transform var(--t-fast);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 4px; background: var(--surface-3); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }

/* ------------------------------------------------------------------ Alerts */
.alert {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: .89rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  margin-bottom: 14px;
  animation: fadeUp .35s var(--ease-out) both;
}
.alert-error { color: #ff8296; border-color: rgba(255, 77, 109, .32); background: rgba(255, 77, 109, .1); }
.alert-success { color: #46e0b0; border-color: rgba(46, 230, 197, .3); background: rgba(46, 230, 197, .1); }
.alert-info { color: var(--text-2); }
.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  width: fit-content;
}
.notice-spotlight { border-color: rgba(46, 230, 197, .3); color: var(--brand-3); }

/* ------------------------------------------------------------------- Toasts */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 16px);
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: .88rem;
  font-weight: 550;
  animation: toastIn .32s var(--ease-out) both;
  max-width: 100%;
}
.toast.is-out { animation: toastIn .25s ease reverse both; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.toast-success .toast-dot { background: var(--brand-3); }
.toast-error .toast-dot { background: #ff5c7a; }

/* --------------------------------------------------------------------- Hero */
.hero {
  position: relative;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 52px);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 34px;
  box-shadow: var(--shadow);
}
.hero-glow {
  position: absolute;
  width: 620px;
  height: 620px;
  right: -220px;
  top: -320px;
  background: radial-gradient(circle, rgba(124, 92, 255, .45), transparent 62%);
  filter: blur(20px);
  animation: floaty 16s ease-in-out infinite;
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 0%, #000 10%, transparent 72%);
  opacity: .6;
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 780px; }
.hero h1 { margin-bottom: .5em; }
.lede { font-size: clamp(1rem, .95rem + .35vw, 1.12rem); color: var(--text-2); max-width: 620px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  list-style: none;
  padding: 20px 0 0;
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
}
.hero-stats li { display: flex; flex-direction: column; gap: 2px; }
.hero-stats strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.hero-stats span { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

/* ---------------------------------------------------------------- Spotlight */
.spotlight { margin-bottom: 12px; }
.spotlight-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.spotlight-head h2 { margin: 0; }
.spotlight-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spotlight-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.spotlight-main { min-width: 0; }
.spotlight-side { display: flex; flex-direction: column; gap: 14px; }
.spotlight-reactions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.react-people { display: flex; align-items: center; gap: 8px; }
.react-avatars { display: inline-flex; }
.react-avatars .avatar { margin-left: -7px; border: 2px solid var(--surface); }
.react-avatars .avatar:first-child { margin-left: 0; }

.creator-card .creator-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.creator-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; }
.creator-name:hover { color: var(--brand); }
.creator-about { font-size: .87rem; color: var(--muted); margin-bottom: 14px; }
.creator-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 0;
  margin: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.creator-stats strong { display: block; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.creator-stats span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.handle-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 6px; }
.handle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 600;
  color: var(--p);
  background: color-mix(in srgb, var(--p) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--p) 30%, transparent);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
  max-width: 100%;
}
.handle-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.handle-chip svg { color: var(--p); }
.handle-chip:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -14px var(--p); }
.handle-chips-lg .handle-chip { padding: 8px 14px; font-size: .84rem; }

.how-card h3 { font-size: .95rem; margin-bottom: 10px; }
.how-list { margin: 0; padding-left: 18px; font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.how-list li::marker { color: var(--brand); font-weight: 700; }

.empty-hero { text-align: center; padding: 48px 24px; margin-bottom: 20px; }
.empty-hero h1, .empty-hero h2 { margin-bottom: .3em; }
.error-code { font-size: 5rem; font-weight: 800; letter-spacing: -.06em; margin: 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

/* ------------------------------------------------------------- History strip */
.history-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.history-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  scroll-snap-align: start;
  transition: transform var(--t) var(--ease), border-color var(--t);
}
.history-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.history-slot { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.history-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); }
.history-thumb-fallback { display: grid; place-items: center; color: var(--muted); }
.history-name { font-size: .88rem; font-weight: 650; }
.history-card .tiny { margin-top: -4px; }

/* ---------------------------------------------------------------- Post card */
.post { overflow: hidden; }
.post-head { display: flex; align-items: flex-start; gap: 11px; padding: 16px 18px 12px; }
.post-avatar { flex: 0 0 auto; }
.post-who { min-width: 0; flex: 1; }
.post-name { font-weight: 650; font-size: .95rem; letter-spacing: -.015em; }
.post-name:hover { color: var(--brand); }
.post-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 1px; }
.post-body { padding: 0 18px 14px; font-size: .96rem; color: var(--text-2); }
.post-body p { margin-bottom: .6em; }
.post-body p:last-child { margin-bottom: 0; }
.post-media { padding: 0 10px; }
.post-featured .post-media { padding: 0; }
.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 12px;
  flex-wrap: wrap;
}
.post-links { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.post-menu { margin-left: auto; width: 32px; height: 32px; }
.post-menu:hover { color: #ff6b8a; border-color: rgba(255, 107, 138, .4); }

.post-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.grid-item { min-width: 0; }
.feed { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }

/* ------------------------------------------------------------------- Embed */
.embed {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  width: 100%;
}
.embed-wide { aspect-ratio: 16 / 9; }
.embed-vertical { aspect-ratio: 9 / 16; max-width: 380px; margin: 0 auto; max-height: 70vh; }
.embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
}
.embed-facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.embed-facade.is-loaded img { opacity: 1; transform: scale(1); }
.embed-facade:hover img { transform: scale(1.045); }
.embed-shimmer {
  position: absolute;
  inset: 0;
  background: var(--skeleton);
  background-size: 400% 100%;
  animation: shimmer 1.4s linear infinite;
  transition: opacity .3s;
}
.embed-facade.is-loaded .embed-shimmer { opacity: 0; }
.embed-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(12, 12, 20, .55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .25);
  transition: transform var(--t) var(--ease), background var(--t);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .9);
}
.embed-play svg { margin-left: 3px; }
.embed-facade:hover .embed-play { transform: scale(1.1); background: rgba(124, 92, 255, .8); }
.embed-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: rgba(10, 10, 18, .7);
  backdrop-filter: blur(6px);
}
.embed-open {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: .7rem;
  font-weight: 600;
  color: #fff;
  background: rgba(10, 10, 18, .68);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .16);
  opacity: 0;
  transition: opacity var(--t);
}
.embed:hover .embed-open { opacity: 1; }

/* -------------------------------------------------------------------- Poll */
.poll { padding: 4px 18px 14px; }
.poll-q { font-size: 1.02rem; margin-bottom: 4px; }
.poll-sub { font-size: .87rem; color: var(--muted); margin-bottom: 12px; }
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  font-size: .9rem;
  transition: border-color var(--t-fast), transform var(--t-fast), background var(--t-fast);
}
.poll-opt:hover:not(:disabled) { border-color: var(--brand); transform: translateX(2px); }
.poll-opt:disabled { cursor: default; }
.poll-opt.is-voted { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); }
.poll-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(124, 92, 255, .3), rgba(255, 77, 141, .22));
  transition: width .8s var(--ease-out);
  pointer-events: none;
}
.poll[data-voted="1"] .poll-fill { width: var(--pct); }
.poll-label { position: relative; font-weight: 550; }
.poll-pct {
  position: relative;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: .82rem;
  color: var(--muted);
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .3s .2s, transform .3s .2s;
}
.poll[data-voted="1"] .poll-pct { opacity: 1; transform: none; }
.poll[data-voted="1"] .poll-opt.is-voted .poll-pct { color: var(--brand); }
.poll-foot { font-size: .78rem; color: var(--muted); margin-top: 10px; }

/* --------------------------------------------------------------- Reactions */
.reactions { display: flex; gap: 5px; flex-wrap: wrap; }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast), background var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.reaction:hover { transform: translateY(-2px) scale(1.04); border-color: var(--line-strong); }
.reaction:active { transform: scale(.94); }
.reaction.is-active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 16%, transparent); }
.reaction-emoji { font-size: 1rem; line-height: 1; }
.reaction-count { font-size: .76rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.reaction-count:empty { display: none; }
.reaction.is-active .reaction-count { color: var(--brand); }
.reaction.is-pop .reaction-emoji { animation: pop .45s var(--ease); }
.reactions-lg .reaction { padding: 9px 14px; }
.reactions-lg .reaction-emoji { font-size: 1.3rem; }
.reactions-lg .reaction-count { font-size: .85rem; }

.burst {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 400;
  animation: burst .7s ease-out forwards;
}

/* ----------------------------------------------------------------- Profile */
.profile-cover { position: relative; height: 96px; border-radius: var(--r-lg); overflow: hidden; margin-bottom: -56px; }
.cover-blob {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 40%, hsl(var(--h, 260) 80% 55% / .55), transparent 55%),
              radial-gradient(circle at 75% 60%, rgba(255, 77, 141, .4), transparent 55%);
  filter: blur(24px);
  animation: floaty 18s ease-in-out infinite;
}
.profile-head { position: relative; padding: 20px; margin-bottom: 22px; }
.profile-id { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-id .avatar-xl { border: 4px solid var(--surface); box-shadow: var(--shadow); }
.profile-text { flex: 1; min-width: 200px; }
.profile-text h1 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); margin-bottom: 2px; }
.profile-handle { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.profile-about { font-size: .93rem; color: var(--text-2); max-width: 60ch; }
.profile-actions { margin-left: auto; }
.profile-stats {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 14px 0 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.profile-stats strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.profile-stats span { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-left: 5px; }

/* --------------------------------------------------------------- Composer */
.composer { padding: 18px; margin-bottom: 24px; }
.composer-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.composer-head p { margin: 2px 0 0; }
.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 16px;
  max-width: 100%;
  overflow-x: auto;
}
.segmented-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 0;
  background: none;
  border-radius: var(--r-pill);
  font-size: .84rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.segmented-btn:hover { color: var(--text); }
.segmented-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.composer-panel { display: none; flex-direction: column; gap: 14px; }
.composer-panel.is-active { display: flex; animation: fadeUp .3s var(--ease-out) both; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.poll-inputs { display: grid; grid-template-columns: 1fr; gap: 8px; }
.hint { margin-top: -4px; }
.embed-preview { border-radius: var(--r); overflow: hidden; animation: fadeUp .3s var(--ease-out) both; }
.embed-preview .embed { max-height: 300px; }
.embed-preview.is-bad { padding: 12px 14px; background: rgba(255, 77, 109, .1); border: 1px solid rgba(255, 77, 109, .3); color: #ff8296; font-size: .86rem; border-radius: var(--r-sm); }

/* ------------------------------------------------------------------ Forum */
.forum-layout { display: grid; grid-template-columns: 1fr; gap: 22px; align-items: start; }
.thread-list { display: flex; flex-direction: column; gap: 12px; }
.thread-card { display: flex; gap: 12px; padding: 14px; align-items: flex-start; transition: transform var(--t) var(--ease), border-color var(--t); }
.thread-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.vote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 46px;
  padding: 7px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  flex: 0 0 auto;
}
.vote-btn:hover { color: var(--brand); border-color: var(--brand); }
.vote-btn.is-active { color: var(--brand); border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, transparent); }
.vote-btn.is-pop svg { animation: pop .4s var(--ease); }
.vote-btn-inline { flex-direction: row; }
.thread-body { min-width: 0; flex: 1; }
.thread-tags { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; align-items: center; }
.thread-title { font-size: 1.02rem; margin: 0 0 4px; }
.thread-title a:hover { color: var(--brand); }
.thread-excerpt { font-size: .87rem; color: var(--muted); margin-bottom: 8px; }
.thread-meta { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); flex-wrap: wrap; }
.thread-row { display: flex; align-items: center; gap: 12px; padding: 13px 15px; transition: transform var(--t) var(--ease), border-color var(--t); }
.thread-row:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.thread-cat { font-size: 1.1rem; }
.thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-main strong { font-size: .92rem; font-weight: 620; }
.thread-votes { font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.forum-side { display: flex; flex-direction: column; gap: 14px; }
.stat-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: .87rem; }
.stat-list li { display: flex; justify-content: space-between; gap: 10px; }
.stat-list span { color: var(--muted); }
.stat-list + form, .stat-list + .btn { margin-top: 14px; }
.rules-list { margin: 0; padding-left: 16px; font-size: .86rem; color: var(--muted); display: flex; flex-direction: column; gap: 7px; }
.rules-list li::marker { color: var(--brand); }

.thread-full .thread-h1 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); margin: 10px 0 14px; }
.thread-author { display: flex; gap: 10px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.thread-content { font-size: 1rem; color: var(--text-2); line-height: 1.68; }
.thread-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.reply-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.reply { padding: 16px; }
.reply-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.reply-head > div { flex: 1; min-width: 0; }
.reply-index { font-size: .74rem; font-weight: 700; color: var(--muted); }
.reply-body { font-size: .92rem; color: var(--text-2); }
.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--muted); margin-bottom: 16px; transition: color var(--t-fast), transform var(--t-fast); }
.back-link:hover { color: var(--text); transform: translateX(-3px); }

/* -------------------------------------------------------------- Tools pages */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tool-card { padding: 20px; display: flex; flex-direction: column; gap: 8px; transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t); }
.tool-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.tool-top { display: flex; justify-content: space-between; align-items: center; }
.tool-icon { font-size: 1.7rem; line-height: 1; }
.tool-card h2 { font-size: 1.12rem; margin: 4px 0 0; }
.tool-card p { font-size: .87rem; flex: 1; }
.tool-open { align-self: flex-start; margin-top: 6px; }
.tools-band { display: grid; grid-template-columns: 1fr; gap: 22px; padding: 26px; margin-top: 44px; }
.tools-band-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: .9rem; color: var(--text-2); }
.tools-band-list li { display: flex; gap: 10px; align-items: center; }
.tools-band-list span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.coming-soon { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 26px; }
.coming-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; font-size: .88rem; color: var(--muted); }
.coming-list li { display: flex; gap: 9px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--line-strong); }

/* Teleprompter */
.tp-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.tp-script { font-size: 1rem; line-height: 1.7; min-height: 240px; }
.tp-controls { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 18px 0; }
.tp-start-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.tp-tips h3 { margin-top: 0; }
.tp-tips .tiny-title:not(:first-child) { margin-top: 20px; }
.tp-tips .rules-list { margin-bottom: 4px; }
.tp-stage {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: #05050a;
  color: #fff;
  display: flex;
  flex-direction: column;
  animation: fadeIn .25s ease both;
}
.tp-stage[hidden] { display: none; }
.tp-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .04);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.tp-toolbar .btn { color: #fff; border-color: rgba(255, 255, 255, .18); }
.tp-toolbar .btn:hover { background: rgba(255, 255, 255, .1); }
.tp-toolbar-speed { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.tp-toolbar-speed input { width: 120px; }
.tp-viewport { position: relative; flex: 1; overflow: hidden; }
.tp-reading-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  height: 0;
  border-top: 1px dashed rgba(46, 230, 197, .55);
  z-index: 2;
  pointer-events: none;
}
.tp-reading-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: -42px;
  width: 100%;
  height: 84px;
  background: linear-gradient(180deg, transparent, rgba(46, 230, 197, .07), transparent);
}
.tp-text {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  padding: 0 clamp(20px, 8vw, 160px) 60vh;
  font-size: 64px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -.02em;
  white-space: pre-wrap;
  will-change: transform;
}
.tp-text p { margin: 0 0 .7em; }
.tp-text .tp-gap { height: .7em; }
.tp-stage.is-mirrored .tp-text { transform-origin: center; }
.tp-progress { height: 3px; background: rgba(255, 255, 255, .1); flex: 0 0 auto; }
.tp-progress span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .25s linear; }
.tp-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(6rem, 20vw, 14rem);
  font-weight: 800;
  letter-spacing: -.05em;
  background: rgba(5, 5, 10, .85);
  z-index: 5;
  animation: popIn .3s var(--ease) both;
}
.tp-countdown[hidden] { display: none; }

/* Checker / hashtags / embed tool */
.checker-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.checker-notes { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.note-item { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; padding: 9px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); animation: fadeUp .25s var(--ease-out) both; }
.note-item.warn { color: #ffb35c; border-color: rgba(255, 179, 92, .3); background: rgba(255, 179, 92, .08); }
.note-item.bad { color: #ff8296; border-color: rgba(255, 77, 109, .3); background: rgba(255, 77, 109, .08); }
.note-item.good { color: #46e0b0; border-color: rgba(46, 230, 197, .3); background: rgba(46, 230, 197, .08); }
.limit-list { display: flex; flex-direction: column; gap: 14px; }
.limit-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; font-size: .82rem; }
.limit-name { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.limit-bar { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.limit-bar span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--grad); transition: width .4s var(--ease), background .3s; }
.limit-row.is-warn .limit-bar span { background: linear-gradient(90deg, #ffb35c, #ff7a45); }
.limit-row.is-over .limit-bar span { background: linear-gradient(90deg, #ff5c7a, #ff2d55); }
.limit-num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .78rem; }
.limit-row.is-over .limit-num { color: #ff8296; font-weight: 700; }

.hash-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hash-output { display: flex; flex-wrap: wrap; gap: 7px; min-height: 90px; align-content: flex-start; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.hash-tag { padding: 6px 11px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; cursor: pointer; transition: all var(--t-fast); animation: popIn .25s var(--ease-out) both; }
.hash-tag:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }

.embed-demo { margin-top: 10px; max-width: 520px; }
.kv { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; }
.kv > div { display: flex; gap: 12px; font-size: .86rem; align-items: baseline; }
.kv dt { color: var(--muted); min-width: 110px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.kv dd { margin: 0; word-break: break-word; }

/* ------------------------------------------------------------------- About */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.about-grid .card { position: relative; overflow: hidden; }
.about-num { position: absolute; right: 14px; top: 8px; font-size: 2.6rem; font-weight: 800; letter-spacing: -.05em; color: var(--line-strong); line-height: 1; }
.about-grid h2 { font-size: 1.08rem; margin-bottom: 6px; }
.about-grid p { font-size: .89rem; color: var(--muted); }
.about-numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; text-align: center; }
.about-numbers strong { display: block; font-size: 1.7rem; letter-spacing: -.03em; }
.about-numbers span { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* ---------------------------------------------------------------- Settings */
.settings-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.settings-preview { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.settings-preview strong { display: block; font-size: 1.05rem; }
.settings-side { display: flex; flex-direction: column; gap: 14px; }

/* -------------------------------------------------------------------- Auth */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-wrap { width: 100%; max-width: 460px; margin: 0 auto; padding: 30px 0; }
.auth-wrap-wide { max-width: 620px; }
.auth-card { padding: 28px; }
.auth-card .brand { margin-bottom: 18px; }
.auth-title { font-size: 1.6rem; margin-bottom: .25em; }
.brand-lg { font-size: 1.3rem; }
.brand-lg .brand-mark { width: 36px; height: 36px; }
.check-list { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; font-size: .86rem; }
.check-list li { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.check-list .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5c7a; }
.check-list li.ok .dot { background: var(--brand-3); }
.check-list li.bad { color: #ff8296; }

/* ------------------------------------------------------------------ Footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 18px 90px; margin-top: 40px; background: var(--bg-2); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.footer-brand { display: flex; align-items: center; gap: 9px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { transition: color var(--t-fast); }
.footer-links a:hover { color: var(--text); }
.build-stamp { font-family: var(--mono); font-size: .72rem; opacity: .7; }

/* ------------------------------------------------------------------ Tabbar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .tabbar { background: var(--bg-2); }
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 12px;
  transition: color var(--t-fast), transform var(--t-fast);
  min-width: 56px;
}
.tab:active { transform: scale(.92); }
.tab.is-active { color: var(--brand); }
.tab-create { margin-top: -22px; }
.tab-fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 14px 30px -12px rgba(124, 92, 255, .95);
  border: 3px solid var(--bg);
  transition: transform var(--t) var(--ease), box-shadow var(--t);
}
.tab-create:hover .tab-fab { transform: translateY(-3px) rotate(90deg); }

/* -------------------------------------------------------------- Empty/other */
.empty { text-align: center; }
.empty h3 { margin-bottom: 4px; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }
.search-form { display: flex; gap: 8px; align-items: center; flex: 1 1 320px; max-width: 520px; }
.search-form .input-with-icon { flex: 1; }
.tiny-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mt-3.card { margin-top: 18px; }

/* ------------------------------------------------------------- Responsive */
@media (min-width: 560px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .poll-inputs { grid-template-columns: 1fr 1fr; }
  .handle-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .coming-list { grid-template-columns: 1fr 1fr; }
  .about-numbers { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  :root { --topbar-h: 68px; }
  .page { padding: 34px 26px 60px; }
  .tabbar { display: none; }
  .toasts { bottom: 26px; }
  .site-footer { padding-bottom: 30px; }
  .two-col { grid-template-columns: 1.15fr .85fr; gap: 30px; }
  .spotlight-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); }
  .forum-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .settings-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .checker-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .tp-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .tp-controls { grid-template-columns: 1fr 1fr; }
  .tools-band { grid-template-columns: 1.2fr 1fr; padding: 34px; }
  .coming-soon { grid-template-columns: 1fr 1fr; padding: 28px; }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .tool-grid { grid-template-columns: repeat(4, 1fr); }
  .post-featured .post-body { padding: 16px 22px 14px; }
}

@media (min-width: 1100px) {
  .page-narrow { max-width: 820px; }
  .feed { max-width: 760px; }
}

@media (max-width: 899px) {
  .mainnav { display: none; }
  .hide-sm { display: none; }
  .topbar-inner { gap: 10px; padding: 0 14px; }
  .brand-name { font-size: 1.02rem; }
  .hero { border-radius: var(--r-lg); }
  .spotlight-side .creator-card { order: -1; }
  .post-grid { gap: 14px; }
  .search-form { max-width: none; flex-basis: 100%; }
  .page-head { gap: 14px; }
}

@media (max-width: 420px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .reaction { padding: 5px 7px; }
  .post-actions { gap: 6px; }
  .segmented-btn { padding: 7px 10px; font-size: .8rem; }
  .tp-text { font-size: 44px !important; }
}

/* ---------------------------------------------------------- Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .grad { animation: none; }
}

/* Print — just the content */
@media print {
  .topbar, .tabbar, .site-footer, .toasts, .post-actions, .nav-progress { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* =========================================================================
   Admin panel + moderation pages (v1.1)
   ========================================================================= */

/* ------------------------------------------------------------------ shell */
.admin-body { background: var(--bg); }
.admin-topbar { z-index: 95; }
.chip-admin { color: #b9a6ff; border-color: rgba(124, 92, 255, .35); background: rgba(124, 92, 255, .14); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.menu-item-admin { color: var(--brand); font-weight: 600; }

.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* minmax(0,…) stops the scrollable nav widening the page */
  gap: 0;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 0 80px;
}
.admin-side {
  padding: 14px 14px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.admin-nav {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}
.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: var(--r-pill);
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.admin-nav-link:hover { color: var(--text); background: var(--surface-2); }
.admin-nav-link.is-active { color: var(--text); background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.admin-badge {
  font-style: normal;
  font-size: .68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: #ff4d6d;
  color: #fff;
  display: inline-grid;
  place-items: center;
}
.admin-side-foot { display: none; }
.admin-main { padding: 22px 18px 40px; min-width: 0; }

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.admin-head h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); margin-bottom: .15em; }
.admin-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------- stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { padding: 16px; display: flex; flex-direction: column; gap: 2px; transition: transform var(--t) var(--ease), border-color var(--t); }
.stat-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.stat-card strong { font-size: 1.9rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-card strong.is-warn { color: #ff8fa3; }
.stat-sub { font-size: .74rem; color: var(--muted); }

.admin-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-cols > * { min-width: 0; }
.admin-cols h2 { font-size: 1.1rem; }

/* ------------------------------------------------------------- mini blocks */
.admin-promo { display: flex; gap: 12px; align-items: flex-start; }
.admin-promo-thumb { width: 96px; aspect-ratio: 16/9; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: 0 0 auto; display: grid; place-items: center; }
.admin-promo-fallback { display: grid; place-items: center; color: var(--muted); width: 100%; height: 100%; }
.admin-promo-body { min-width: 0; }
.admin-promo-body strong { display: block; font-size: .95rem; }
.admin-promo-actions { display: flex; gap: 4px; margin-top: 4px; }

.mini-schedule { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-schedule li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .84rem; }
.mini-schedule li:last-child { border-bottom: 0; }
.mini-slot { min-width: 92px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.mini-who { font-weight: 600; }

.report-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.report-mini li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .84rem; }
.report-mini-title { flex: 1; min-width: 120px; }

.log-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.log-mini li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: .8rem; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.log-mini li:last-child { border-bottom: 0; }
.log-action { font-weight: 650; white-space: nowrap; }
.log-detail { color: var(--muted); flex: 1 1 120px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.log-user_blocked, .log-user_deleted, .log-login_failed { background: #ff5c7a; }
.log-featured_manual, .log-featured_auto { background: var(--brand-3); }
.log-report_created { background: #ffb35c; }

/* --------------------------------------------------------------- filters */
.admin-filter {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-filter .input-with-icon { flex: 1 1 260px; }
.admin-select { max-width: 220px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; padding: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th {
  text-align: left;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--t-fast); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tr.is-blocked { background: rgba(255, 92, 122, .06); }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.user-cell .tiny { display: block; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { display: inline; }
.link-danger { color: #ff6b8a; }
.link-danger:hover { color: #ff4d6d; background: rgba(255, 77, 109, .1); }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.nowrap { white-space: nowrap; }
.chip-blocked { color: #ff8296; border-color: rgba(255, 77, 109, .35); background: rgba(255, 77, 109, .12); }
.chip-reason { color: #ffc86b; border-color: rgba(255, 200, 107, .3); background: rgba(255, 200, 107, .1); }
.chip-manual { color: #b9a6ff; border-color: rgba(124, 92, 255, .35); background: rgba(124, 92, 255, .14); }

/* ----------------------------------------------------------- admin forms */
.admin-callout { border-color: rgba(255, 77, 109, .35); margin-bottom: 18px; animation: fadeUp .3s var(--ease-out) both; }
.admin-callout h2 { font-size: 1.1rem; }
.admin-inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.admin-inline-form .field { flex: 1 1 280px; }
.admin-inline-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-danger { background: #ff4d6d; border-color: transparent; color: #fff; box-shadow: 0 10px 26px -16px rgba(255, 77, 109, .9); }
.btn-danger:hover { background: #ff3b5e; }
.admin-hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.admin-inline-actions .btn { align-self: flex-start; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-of-type { border-bottom: 0; }
.switch { position: relative; display: inline-flex; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-track {
  width: 48px; height: 28px; border-radius: var(--r-pill);
  background: var(--surface-3); border: 1px solid var(--line);
  display: block; position: relative; transition: background var(--t) var(--ease), border-color var(--t);
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform var(--t) var(--ease);
}
.switch input:checked + .switch-track { background: var(--grad); border-color: transparent; }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(124, 92, 255, .3); }

.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.copy-code { flex: 1 1 260px; font-size: .74rem; overflow-x: auto; white-space: nowrap; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }

/* ----------------------------------------------------------- admin posts */
.admin-post-list { display: flex; flex-direction: column; gap: 10px; }
.admin-post-row { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.admin-post-thumb { width: 104px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: 0 0 auto; display: grid; place-items: center; }
.admin-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-post-body { flex: 1; min-width: 0; }
.admin-post-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .84rem; }
.admin-post-text { font-size: .88rem; margin: 6px 0 2px; color: var(--text-2); }
.admin-post-actions { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.admin-post-actions form { display: inline; }

/* ------------------------------------------------------------ promotions */
.schedule-list { display: flex; flex-direction: column; }
.schedule-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: .84rem;
}
.schedule-row:last-child { border-bottom: 0; }
.schedule-row.is-now { background: rgba(46, 230, 197, .06); border-radius: var(--r-sm); padding-left: 8px; padding-right: 8px; }
.schedule-when { display: flex; align-items: baseline; gap: 8px; }
.schedule-when span { color: var(--muted); font-size: .78rem; }
.schedule-what { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.schedule-what a { font-weight: 650; }
.schedule-actions { display: flex; gap: 4px; }
.schedule-actions form { display: inline; }

/* ---------------------------------------------------------------- reports */
.report-list { display: flex; flex-direction: column; gap: 12px; }
.report-card { border-color: var(--line); }
.report-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.report-body { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.report-title { font-weight: 650; font-size: .98rem; display: block; margin-bottom: 2px; }
.report-title:hover { color: var(--brand); }
.report-note { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: .85rem; color: var(--text-2); }
.report-preview { width: 120px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--surface-2); flex: 0 0 auto; display: grid; place-items: center; }
.report-preview img { width: 100%; height: 100%; object-fit: cover; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.report-actions form { display: inline; }
.report-target { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); margin-top: 14px; }
.report-target strong { display: block; }
.report-target p { margin: 6px 0 0; color: var(--muted); }
.link-report:hover { color: #ffb35c; }

/* ------------------------------------------------------- policy + promoted */
.policy-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.policy-body { font-size: .95rem; color: var(--text-2); line-height: 1.7; }
.policy-body p { margin-bottom: 1em; }
.policy-side { display: flex; flex-direction: column; gap: 14px; }
.policy-banner { border-color: rgba(255, 77, 109, .3); position: relative; overflow: hidden; }
.policy-18 {
  position: absolute; right: 14px; top: 8px;
  font-size: 2.4rem; font-weight: 800; letter-spacing: -.04em;
  color: rgba(255, 77, 109, .18); line-height: 1;
}
.policy-banner h2 { font-size: 1.05rem; }
.check-policy { align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: .84rem; }
.check-policy input { margin-top: 2px; }
.check-policy a { color: var(--brand); text-decoration: underline; }

.promo-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.promo-card { display: flex; flex-direction: column; overflow: hidden; transition: transform var(--t) var(--ease), border-color var(--t); }
.promo-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.promo-thumb { position: relative; display: block; aspect-ratio: 16/9; background: var(--surface-2); }
.promo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.promo-thumb-fallback { display: grid; place-items: center; height: 100%; color: var(--muted); }
.promo-time {
  position: absolute; left: 8px; bottom: 8px;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: rgba(8, 8, 14, .72); backdrop-filter: blur(6px);
  color: #fff; font-size: .7rem; font-weight: 700;
}
.promo-body { display: flex; flex-direction: column; gap: 3px; padding: 12px; }
.promo-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

.lookup-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 20px; }
.lookup-copy h2 { font-size: 1.1rem; margin-bottom: .2em; }
.lookup-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lookup-form .input { width: auto; min-width: 220px; }

/* ------------------------------------------------------------------ setup */
.setup-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); margin: 14px 0; font-size: .84rem; }
.setup-row { display: flex; justify-content: space-between; gap: 12px; }
.setup-row span { color: var(--muted); }
.plain-list { margin: 6px 0 0; padding-left: 18px; font-size: .85rem; }

/* ------------------------------------------------------------- responsive */
@media (min-width: 700px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .promo-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-post-row { align-items: center; }
  .schedule-row { grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
  .report-body { align-items: center; }
}

@media (min-width: 1000px) {
  .admin-shell { grid-template-columns: 236px minmax(0, 1fr); padding: 22px 26px 60px; gap: 26px; }
  .admin-side { border-bottom: 0; border-right: 1px solid var(--line); padding: 0 18px 0 0; position: sticky; top: 90px; align-self: start; height: calc(100vh - 120px); display: flex; flex-direction: column; }
  .admin-nav { flex-direction: column; overflow: visible; gap: 2px; padding-bottom: 0; }
  .admin-nav-link { width: 100%; border-radius: var(--r-sm); padding: 10px 12px; }
  .admin-nav-link:hover { padding-left: 16px; }
  .admin-side-foot { display: block; margin-top: auto; line-height: 1.5; }
  .admin-main { padding: 0; }
  .admin-cols { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .policy-layout { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .promo-grid { grid-template-columns: repeat(3, 1fr); }
  .hide-md { display: table-cell; }
}

@media (max-width: 999px) {
  .hide-md { display: none; }
}

@media (max-width: 640px) {
  .admin-topbar .chip-admin { display: none; }
  .admin-topbar .topbar-right .btn-ghost { display: none; }
}

@media (max-width: 420px) {
  .admin-post-thumb, .report-preview { width: 72px; }
  .admin-main { padding: 18px 14px 40px; }
}
