/* Larpville forums, v3 design
   App shell (left rail + stage), OLED-dark neutral surfaces, one mint accent, Material Symbols,
   Fira Sans / Fira Code. Motion: shared tokens, page transitions, staggered reveals, hover lifts.
   Everything animated turns off under prefers-reduced-motion. */

/* ---------- tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #0a0b0d;
  --rail-bg: #0d0e11;
  --surface: #131418;
  --surface-2: #191b20;
  --surface-3: #21242b;
  --line: #22252c;
  --line-2: #2e323a;
  --text: #eceef2;
  --text-2: #b9bec8;
  --muted: #858b97;
  --accent: #3ddc97;
  --accent-hi: #62eeb0;
  --on-accent: #04150d;
  --accent-soft: rgba(61, 220, 151, .12);
  --accent-line: rgba(61, 220, 151, .35);
  --link: #7fe3b9;
  --green: #3ddc97;
  --red: #ff6b6b;
  --red-strong: #e5484d;
  --amber: #f5b544;
  --orange: #ff8a4c;
  --code-bg: #0c0d10;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 16px 40px -8px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .03);
  --glow: 0 0 0 1px var(--accent-line);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --d1: 120ms;
  --d2: 220ms;
  --d3: 420ms;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5f7;
  --rail-bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceef2;
  --line: #e4e6eb;
  --line-2: #d5d9e0;
  --text: #111318;
  --text-2: #3c424d;
  --muted: #6a717e;
  --accent: #0f9d63;
  --accent-hi: #0b8a56;
  --on-accent: #ffffff;
  --accent-soft: rgba(15, 157, 99, .1);
  --accent-line: rgba(15, 157, 99, .35);
  --link: #0b7f50;
  --green: #0f9d63;
  --red: #d93a3a;
  --amber: #b7791f;
  --orange: #d9661f;
  --code-bg: #f6f7f9;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 16px 40px -12px rgba(16, 24, 40, .18), 0 0 0 1px rgba(16, 24, 40, .04);
  --glow: 0 0 0 1px var(--accent-line);
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; transition: color var(--d1) var(--ease); }
a:hover { color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, pre, .mono { font-family: "Fira Code", Consolas, monospace; }
.mono { font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); }
::selection { background: var(--accent-soft); }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600; }
.skip:focus { top: 12px; }

/* Material Symbols */
.ms {
  font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1;
  letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; direction: ltr;
  font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; user-select: none; flex: none;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  width: 1em; overflow: hidden; vertical-align: middle;
}
.i { font-size: 18px; vertical-align: -4px; }

/* ---------- motion ---------- */
@view-transition { navigation: auto; }
.rail { view-transition-name: rail; }
.topbar { view-transition-name: topbar; }
::view-transition-group(rail), ::view-transition-group(topbar),
::view-transition-old(rail), ::view-transition-new(rail),
::view-transition-old(topbar), ::view-transition-new(topbar) { animation: none; }
::view-transition-old(root) { animation: vt-out 140ms var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in 240ms var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes slide-in-r { from { opacity: 0; transform: translateX(16px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes flash-bg { from { background: var(--accent-soft); } }
@keyframes shimmer { to { background-position: -200% 0; } }
.reveal { animation: rise var(--d3) var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--rail-bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; padding: 14px 10px 12px; z-index: 70;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.rail-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand:hover { color: var(--text); }
.brand-img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: none; transition: transform var(--d2) var(--ease); }
.brand:hover .brand-img { transform: scale(1.04); }
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 17px; line-height: 1.15; letter-spacing: -.2px; min-width: 0; }
.brand-text small { font-weight: 400; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; }
.rail-close { display: none; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rail-nav a, .rail-foot-btn {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); min-height: 38px;
  color: var(--text-2); font-weight: 500; font-size: 14.5px; background: none; border: 0; width: 100%; text-align: left;
  transition: background var(--d1) var(--ease), color var(--d1) var(--ease);
}
.rail-nav a .ms, .rail-foot-btn .ms { font-size: 21px; transition: transform var(--d2) var(--ease); }
.rail-nav a:hover, .rail-foot-btn:hover { background: var(--surface-2); color: var(--text); }
.rail-nav a:hover .ms { transform: translateX(2px); }
.rail-nav a.is-active { background: var(--accent-soft); color: var(--text); }
.rail-nav a.is-active .ms { color: var(--accent); font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.rail-nav a.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text); font-size: 11.5px; display: grid; place-items: center; }
.rail-count.is-alert { background: var(--red-strong); color: #fff; }
.rail-cats { flex: 1; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.rail-cat-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0;
  padding: 8px 10px 4px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
}
.rail-cat-head:hover { color: var(--text-2); }
.rail-caret { font-size: 18px; transition: transform var(--d2) var(--ease); }
.rail-cat.is-collapsed .rail-caret { transform: rotate(-90deg); }
.rail-cat-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--d2) var(--ease); }
.rail-cat-body > div { overflow: hidden; min-height: 0; }
.rail-cat.is-collapsed .rail-cat-body { grid-template-rows: 0fr; }
.rail-forum {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 14px; min-height: 34px;
  transition: background var(--d1) var(--ease), color var(--d1) var(--ease);
}
.rail-forum:hover { background: var(--surface-2); color: var(--text); }
.rail-forum.is-active { background: var(--surface-2); color: var(--text); }
.rail-forum-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); flex: none; }
.rail-forum-ic .ms { font-size: 16px; }
.rail-forum-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.rail-foot form { margin: 0; }
.rail-backdrop { display: none; }
.stage { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.page { flex: 1; padding-top: 22px; padding-bottom: 56px; min-width: 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { display: none; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.topbar-brand img { width: 30px; height: 30px; border-radius: 8px; }
.topsearch { position: relative; display: flex; align-items: center; flex: 1; max-width: 520px; }
.topsearch > .ms { position: absolute; left: 12px; color: var(--muted); pointer-events: none; font-size: 20px; }
.topsearch input[type=search] {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 44px 8px 40px; min-height: 40px; font-size: 14.5px;
  transition: border-color var(--d1) var(--ease), box-shadow var(--d2) var(--ease), background var(--d1) var(--ease);
}
.topsearch input[type=search]:hover { border-color: var(--line-2); }
.topsearch input[type=search]:focus { background: var(--surface-2); }
.topsearch kbd { position: absolute; right: 10px; font: 500 11.5px "Fira Code", monospace; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.topsearch:focus-within kbd { opacity: 0; }
.usernav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.btn-new { margin-right: 6px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: none; border: 0; color: var(--text-2); transition: background var(--d1) var(--ease), color var(--d1) var(--ease), transform var(--d1) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ms { font-size: 22px; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 7px; }
.icon-btn.sm .ms { font-size: 17px; }
.icon-btn.is-on { color: var(--amber); }
.icon-btn.is-on .ms { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.dot-badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red-strong); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg); animation: pop var(--d3) var(--ease) both;
}
.userchip { display: flex; align-items: center; gap: 9px; background: none; border: 0; padding: 4px 8px 4px 4px; border-radius: 12px; text-align: left; transition: background var(--d1) var(--ease); }
.userchip:hover { background: var(--surface-2); }
.userchip .av { width: 34px; height: 34px; border-radius: 9px; }
.userchip-text { display: flex; flex-direction: column; line-height: 1.2; }
.userchip-name { font-weight: 600; font-size: 14px; }
.userchip-title { font-size: 12px; color: var(--muted); }
.userchip-caret { font-size: 18px; color: var(--muted); }
.nav-toggle { display: none; }

/* ---------- menus ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top left;
  transition: opacity var(--d1) var(--ease), transform var(--d2) var(--ease), visibility 0s linear var(--d2);
}
.menu.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.menu-right, .usernav .menu { left: auto; right: 0; transform-origin: top right; }
.menu-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom right; }
.menu a, .menu button:not(.swatch):not(.btn) {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text);
  background: none; border: 0; text-align: left; font-size: 14px; min-height: 36px; transition: background var(--d1) var(--ease);
}
.menu a:hover, .menu button:not(.swatch):not(.btn):hover { background: var(--surface-3); color: var(--text); }
.menu button.danger, .menu button.danger .ms { color: var(--red); }
.menu .ms { color: var(--muted); font-size: 19px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }
.menu-label { display: block; font-size: 11.5px; color: var(--muted); padding: 4px 10px; text-transform: uppercase; letter-spacing: .7px; font-weight: 600; }
.menu-form { padding: 4px; display: flex; flex-direction: column; gap: 6px; }
.menu-form select { width: 100%; }
.menu-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 10px; font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .menu-head-link { display: inline; width: auto; min-height: 0; padding: 0; font-weight: 500; font-size: 13px; color: var(--link); }
.menu .menu-head-link:hover { background: none; color: var(--accent-hi); }
.menu-empty { padding: 20px; text-align: center; color: var(--muted); }
.menu-alerts { width: 380px; }
.menu-alerts .menu-body { max-height: 440px; overflow: auto; }
.menu-user { width: 270px; }
.menu-profile { padding: 10px !important; }
.menu-profile > span:not(.av) { display: flex; flex-direction: column; line-height: 1.3; }
.menu-profile small { color: var(--muted); font-size: 12px; }
.menu form { margin: 0; }
.alert-row { display: flex !important; gap: 12px; align-items: flex-start !important; white-space: normal; }
.alert-row.is-unread { background: var(--accent-soft); }
.alert-text { font-size: 13.5px; line-height: 1.45; }
.alert-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 15px; border-radius: 10px;
  font-weight: 600; font-size: 14px; border: 1px solid transparent; white-space: nowrap; line-height: 1.2; position: relative;
  transition: background var(--d1) var(--ease), border-color var(--d1) var(--ease), color var(--d1) var(--ease), transform var(--d1) var(--ease), box-shadow var(--d2) var(--ease);
}
.btn .ms { font-size: 19px; }
.btn:active { transform: scale(.97); }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hi); color: var(--on-accent); }
.btn-ghost { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-2); }
.btn-ghost.is-on { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.btn-ghost.is-on .ms { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.btn-danger { background: var(--red-strong); color: #fff; }
.btn-danger:hover { background: #f05257; color: #fff; }
.btn-block { width: 100%; justify-content: flex-start; }
.btn-block.btn-primary { justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); display: inline-flex; align-items: center; gap: 5px; }
.linkish:hover { color: var(--accent-hi); }

/* ---------- forms ---------- */
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], select, textarea {
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 12px; min-width: 0; min-height: 40px;
  transition: border-color var(--d1) var(--ease), box-shadow var(--d2) var(--ease), background var(--d1) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line-2) 50%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
::placeholder { color: var(--muted); opacity: 1; }
textarea { width: 100%; resize: vertical; line-height: 1.55; }
input[type=color] { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
input.num { width: 86px; }
.inline-form { display: inline; margin: 0; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row + .form-row { margin-top: 10px; }
.form-row-end { justify-content: flex-end; margin-top: 12px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-block .block-body { padding: 18px 20px; }
.form-block > .form-row, .form-block > .editor, .form-block > details { margin: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 500; font-size: 13.5px; color: var(--text-2); }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.field small { color: var(--muted); font-size: 12.5px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14px; min-height: 30px; }
.check input { accent-color: var(--accent); width: 17px; height: 17px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.checkgrid { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hp { position: absolute; left: -9999px; }
.icon-preview { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); }
.errorbox { background: rgba(255, 107, 107, .09); border: 1px solid rgba(255, 107, 107, .35); color: #ffc9c9; padding: 11px 14px; border-radius: var(--r); margin-bottom: 14px; animation: rise var(--d2) var(--ease); }
[data-theme="light"] .errorbox { color: #9b1c1c; }
.warnbox { background: rgba(245, 181, 68, .08); border: 1px solid rgba(245, 181, 68, .32); padding: 10px 13px; border-radius: var(--r); font-size: 13.5px; }
.flash { display: flex; align-items: center; gap: 8px; background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 10px 14px; border-radius: var(--r); margin-top: 18px; animation: rise var(--d3) var(--ease); }
.flash .ms { color: var(--accent); }
.notice { margin-top: 18px; display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 10px 12px 14px; }
.notice-ic { color: var(--amber); }
.notice-body { flex: 1; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; letter-spacing: .2px; line-height: 1.4; }
.badge-new { background: var(--accent-soft); color: var(--accent); }
.badge-red { background: var(--red-strong); color: #fff; }
.tagpill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); line-height: 1.5; }
.tagpill .ms { font-size: 14px; }
.tagpill-green { background: var(--accent-soft); color: var(--accent); }
.tagpill-red { background: rgba(255, 107, 107, .12); color: var(--red); }
.tagpill-op { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.prefix { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px; margin-right: 7px; vertical-align: 2px; line-height: 1.55; letter-spacing: .2px; }
.ubanner { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; padding: 2px 8px; border-radius: 5px; line-height: 1.6; }
.rep-pos { color: var(--green); }
.rep-neg { color: var(--red); }
.alt-flag { color: var(--amber); font-weight: 600; font-size: 13px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; vertical-align: 1px; flex: none; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; margin-left: 4px; }
.dotsep::before { content: "·"; color: var(--muted); margin: 0 6px; }

/* ---------- avatars / usernames ---------- */
.av { border-radius: 8px; object-fit: cover; display: inline-grid; place-items: center; flex: none; background: var(--surface-3); }
.av-xs { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; vertical-align: middle; }
.av-s { width: 34px; height: 34px; font-size: 14px; border-radius: 9px; }
.av-m { width: 42px; height: 42px; font-size: 17px; border-radius: 11px; }
.av-l { width: 96px; height: 96px; font-size: 38px; border-radius: 18px; }
.av-xl { width: 128px; height: 128px; font-size: 50px; border-radius: 22px; }
/* letter avatars always center their letter, whatever container they land in */
.av.av-letter { display: inline-flex !important; flex-direction: row !important; align-items: center !important; justify-content: center !important; background: var(--av); color: rgba(0, 0, 0, .72); font-weight: 700; line-height: 1; text-align: center; }
.av-link { display: inline-flex; flex: none; border-radius: 10px; transition: transform var(--d2) var(--ease); }
.av-link:hover { transform: scale(1.05); }
.avatar-stack { display: flex; margin-bottom: 10px; }
.avatar-stack .av-link { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); border-radius: 10px; }
.avatar-stack .av-link:first-child { margin-left: 0; }
.username { font-weight: 600; color: var(--text); }
.username:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.name-bold { font-weight: 700; }
.name-glow { text-shadow: 0 0 10px currentColor; font-weight: 600; }
.name-sparkle { font-weight: 700; background: linear-gradient(90deg, currentColor 40%, #fff 50%, currentColor 60%) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: sparkle 3.5s linear infinite; }
@keyframes sparkle { to { background-position: -250% 0; } }
.username.is-banned { text-decoration: line-through; color: var(--muted) !important; }
.online-dot { position: absolute; right: -3px; bottom: -3px; width: 13px; height: 13px; border-radius: 50%; background: var(--green); border: 3px solid var(--surface); }

/* ---------- generic layout & cards ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 22px; align-items: start; }
.layout-left { grid-template-columns: 230px minmax(0, 1fr); }
.layout-full { grid-template-columns: minmax(0, 1fr); }
.layout-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 18px; flex-wrap: wrap; }
.pagetitle { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.4px; line-height: 1.25; }
.pagedesc { color: var(--muted); margin: 4px 0 0; }
.pagehead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: 14px; font-size: 13.5px; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; transition: background var(--d1) var(--ease), color var(--d1) var(--ease); }
.crumbs a:hover { color: var(--text); background: var(--surface-2); }
.crumbs .ms { font-size: 17px; }
.crumb-sep { color: var(--line-2); }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; }
.tabs a { padding: 7px 14px; color: var(--muted); font-weight: 500; border-radius: 8px; white-space: nowrap; transition: background var(--d1) var(--ease), color var(--d1) var(--ease); }
.tabs a:hover { color: var(--text); background: var(--surface-2); }
.tabs a.is-active { color: var(--text); background: var(--surface-3); box-shadow: var(--shadow-sm); }
.section-label { margin: 0 0 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }

.card, .block, .widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.block { overflow: hidden; }
.page > .block + .block, .page > .block + form, .page > form + .block, .page > form + form, .page > .card + .card { margin-top: 18px; }
.card-head, .block-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-title, .block-title, .widget-title { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title a, .block-title a { color: var(--text); }
.card-title .ms, .block-title .ms { color: var(--muted); font-size: 19px; }
.card-meta { color: var(--muted); font-size: 13px; }
.card-foot, .block-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card-foot { justify-content: center; }
.block-body { padding: 0; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { margin: 0; }
.empty-ic { font-size: 40px; color: var(--line-2); }
.collapse-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; transition: color var(--d1) var(--ease), background var(--d1) var(--ease), transform var(--d2) var(--ease); }
.collapse-btn:hover { color: var(--text); background: var(--surface-3); }
.is-collapsed .collapse-btn { transform: rotate(180deg); }
.collapsible { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--d2) var(--ease); }
.collapsible > div { overflow: hidden; min-height: 0; }
.is-collapsed > .collapsible { grid-template-rows: 0fr; }
.is-collapsed .card-head { border-bottom-color: transparent; }

/* ---------- home ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 26px 28px; margin-bottom: 22px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface);
}
.hero-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.hero-title .username { font-weight: 700; }
.hero-sub { margin: 6px 0 16px; color: var(--text-2); max-width: 560px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(84px, 1fr)); gap: 8px; margin: 0; }
.hero-stats div { background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.hero-stats dt { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.hero-stats dd { margin: 2px 0 0; font: 600 21px/1.2 "Fira Code", monospace; }
.cats { display: flex; flex-direction: column; gap: 22px; }
.cat-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; }
.cat-title { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .9px; color: var(--text-2); }
.cat-count { font: 600 11.5px "Fira Code", monospace; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.tiles-compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform var(--d2) var(--ease), border-color var(--d2) var(--ease), box-shadow var(--d2) var(--ease), background var(--d2) var(--ease);
}
.tile:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--surface-2); }
.tile-hit { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.tile > *:not(.tile-hit) { position: relative; z-index: 1; pointer-events: none; }
.tile a:not(.tile-hit) { pointer-events: auto; }
.tile-top { display: flex; gap: 12px; align-items: flex-start; }
.tile-ic {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c);
  transition: transform var(--d2) var(--ease), background var(--d2) var(--ease);
}
.tile-ic .ms { font-size: 23px; font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.tile-ic.sm { width: 34px; height: 34px; border-radius: 9px; }
.tile-ic.sm .ms { font-size: 19px; }
.tile:hover .tile-ic { background: color-mix(in srgb, var(--c) 22%, transparent); }
.tile-head { min-width: 0; flex: 1; }
.tile-title { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.tile-desc { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-ext { color: var(--muted); }
.tile-subs { display: flex; flex-wrap: wrap; gap: 6px; }
.subchip { font-size: 12.5px; padding: 3px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); transition: all var(--d1) var(--ease); }
.subchip:hover { color: var(--text); border-color: color-mix(in srgb, var(--c, var(--accent)) 50%, var(--line-2)); background: var(--surface-3); }
.subchip.is-unread { color: var(--text); border-color: var(--accent-line); }
.subchip.is-unread::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.subchip-more { color: var(--muted); }
.tile-foot { display: flex; align-items: center; gap: 14px; padding-top: 12px; border-top: 1px dashed var(--line); margin-top: auto; font-size: 13px; color: var(--muted); }
.tile-stat { display: inline-flex; align-items: baseline; gap: 4px; font-size: 12.5px; white-space: nowrap; }
.tile-stat b { font: 600 13px "Fira Code", monospace; color: var(--text-2); }
.tile-stat .ms { font-size: 16px; }
.tile-last { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; max-width: 60%; color: var(--text-2); }
.tile-last:hover { color: var(--text); }
.tile-last-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.tile-last-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tile-last.is-empty { font-size: 12.5px; }

/* ---------- sidebar widgets ---------- */
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.widget { overflow: hidden; }
.widget .card-head { padding: 12px 16px; }
.widget-title { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.widget-body { padding: 12px 16px 14px; }
.widget-pad { padding: 8px; }
.widget-sub { font-weight: 700; font-size: 11.5px; margin: 6px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.widget-sub:first-child { margin-top: 0; }
.widget-foot { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.namelist { color: var(--muted); line-height: 1.8; font-size: 14px; margin-bottom: 6px; }
.namelist .username { font-weight: 500; color: var(--text-2); }
.namelist-more { font-size: 13.5px; display: inline-block; margin-top: 2px; }
.i-fire { color: var(--orange) !important; }
.widget-list { display: flex; flex-direction: column; padding: 6px; }
.trend, .latest { display: flex; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); align-items: flex-start; transition: background var(--d1) var(--ease), transform var(--d1) var(--ease); }
.trend:hover, .latest:hover { background: var(--surface-2); color: var(--text); }
.trend:hover { transform: translateX(2px); }
.trend-rank { width: 20px; flex: none; color: var(--muted); font: 600 13px/21px "Fira Code", monospace; text-align: center; }
.trend:nth-child(-n+3) .trend-rank { color: var(--orange); }
.trend-main, .latest-main { min-width: 0; display: flex; flex-direction: column; }
.trend-title, .latest-title { font-size: 14px; font-weight: 500; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.trend-meta, .latest-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.trend-meta .ms { font-size: 14px; }
.pairs { margin: 0; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.pairs div { display: flex; justify-content: space-between; gap: 10px; }
.pairs dt { color: var(--muted); }
.pairs dd { margin: 0; text-align: right; font-family: "Fira Code", monospace; font-size: 13.5px; }
.pairs dd .username { font-family: "Fira Sans", sans-serif; }
.staffrow { display: flex; gap: 10px; align-items: center; padding: 3px 0; }

/* ---------- shoutbox ---------- */
.shoutbox .card-head { padding: 12px 16px; }
.shouts { min-height: 60px; max-height: 280px; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.shout { display: flex; gap: 10px; padding: 5px 8px; border-radius: 9px; align-items: flex-start; position: relative; transition: background var(--d1) var(--ease); }
.shout.is-new { animation: rise var(--d3) var(--ease) both; }
.shout:hover { background: var(--surface-2); }
.shout-main { min-width: 0; flex: 1; font-size: 14px; line-height: 1.45; }
.shout-meta { font-size: 12.5px; }
.shout-time { color: var(--muted); margin-left: 4px; }
.shout-body { word-wrap: break-word; }
.shout-body img { max-height: 120px; }
.shout-del { position: absolute; right: 6px; top: 6px; opacity: 0; font-size: 11.5px; background: var(--surface-3); border: 0; border-radius: 5px; color: var(--red); padding: 2px 7px; transition: opacity var(--d1) var(--ease); }
.shout:hover .shout-del, .shout-del:focus { opacity: 1; }
.shout-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.shout-form input { flex: 1; border-radius: 999px; padding-left: 16px; }
.shout-form .btn { border-radius: 999px; width: 40px; padding: 0; }
.shout-login { padding: 12px 16px; border-top: 1px solid var(--line); }

/* ---------- forum page ---------- */
.forumhead {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 22px; border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}
.forumhead-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); flex: none; }
.forumhead-ic .ms { font-size: 30px; font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.forumhead-main { flex: 1; min-width: 240px; }
.forumhead-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.forumhead-meta span { display: inline-flex; align-items: center; gap: 6px; }
.forumhead-meta .ms { font-size: 17px; }
.forumhead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.subforums { margin-bottom: 22px; }
.threadlist { overflow: visible; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background var(--d1) var(--ease), color var(--d1) var(--ease); }
.seg a .ms { font-size: 17px; }
.seg a:hover { color: var(--text); }
.seg a.is-active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.seg a.is-active .ms { color: var(--accent); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: transparent; border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; font-weight: 500; transition: all var(--d1) var(--ease); }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.is-active { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.chip .ms { font-size: 16px; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pb); }
.prefixbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.trows { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.trows-sticky { border-bottom: 1px solid var(--line); }
.trows-label { display: flex; align-items: center; gap: 6px; padding: 6px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; }
.trows-label .ms { font-size: 15px; color: var(--amber); }
.trow {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 160px; gap: 14px; align-items: center; padding: 11px 12px; border-radius: 11px;
  transition: background var(--d1) var(--ease);
}
.trow:hover { background: var(--surface-2); }
.trow.is-deleted { opacity: .5; }
.trow.is-fresh { animation: flash-bg 2.4s var(--ease); }
.trow-title { margin: 0; font-size: 15.5px; font-weight: 500; line-height: 1.4; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trow-title a { color: var(--text-2); }
.trow.is-unread .trow-title a { color: var(--text); font-weight: 600; }
.trow-title a:hover { color: var(--accent-hi); }
.trow-meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; }
.trow-meta .username { color: var(--muted); font-weight: 500; }
.ticon { color: var(--muted); display: inline-flex; }
.ticon .ms { font-size: 16px; }
.trow-stats { display: flex; align-items: center; gap: 12px; }
.bubble { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font: 500 12.5px "Fira Code", monospace; min-width: 58px; justify-content: center; }
.bubble .ms { font-size: 15px; }
.bubble.is-hot { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.trow-views { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font: 12.5px "Fira Code", monospace; min-width: 52px; }
.trow-views .ms { font-size: 15px; }
.trow-last { display: flex; align-items: center; gap: 9px; justify-content: flex-end; text-align: right; color: var(--muted); min-width: 0; }
.trow-last:hover { color: var(--text); }
.trow-last-text { display: flex; flex-direction: column; font-size: 12.5px; min-width: 0; line-height: 1.35; }
.trow-last-name { color: var(--text-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minipages { display: inline-flex; gap: 3px; margin-left: 8px; }
.minipages a, .minipages span { font-size: 11.5px; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); }

/* ---------- pagination ---------- */
.pagenav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagenav a { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; transition: all var(--d1) var(--ease); }
.pagenav a:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
.pagenav a.is-current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.pagenav .ms { font-size: 17px; }
.pagenav-gap { color: var(--muted); padding: 0 3px; }

/* ---------- thread page ---------- */
.threadpage { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.threadpage-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.threadhead { margin-bottom: 4px; }
.thread-title { font-size: 27px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; margin: 0; }
.thread-title .prefix { font-size: 13px; vertical-align: 5px; }
.threadhead-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 13.5px; margin-top: 10px; align-items: center; }
.threadhead-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.threadhead-meta .ms { font-size: 17px; }
.threadbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.thread-edit { padding: 16px; }
.solution-box { display: block; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-lg); padding: 14px 18px; color: var(--text); transition: transform var(--d2) var(--ease); }
.solution-box:hover { color: var(--text); transform: translateY(-1px); }
.solution-head { color: var(--accent); font-weight: 600; display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.solution-body { color: var(--text-2); font-size: 14px; }
.poll-body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.poll-opt { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer; transition: border-color var(--d1) var(--ease); isolation: isolate; }
.poll-opt::before { content: ""; position: absolute; inset: 0; width: 0; background: var(--accent-soft); z-index: -1; transition: width 700ms var(--ease); }
.poll-opt.has-results::before { width: var(--pct); }
.poll-opt:hover { border-color: var(--muted); }
.poll-opt.is-mine { border-color: var(--accent-line); }
.poll-opt input { accent-color: var(--accent); }
.poll-text { flex: 1; font-weight: 500; }
.poll-num { font: 500 13px "Fira Code", monospace; color: var(--text-2); }
.poll-voters { width: 100%; display: flex; gap: 3px; flex-wrap: wrap; }
.threadrail { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; }
.rail-card { padding: 14px; }
.rail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 12px; }
.rail-stats div { text-align: center; padding: 8px 4px; background: var(--surface-2); border-radius: 10px; }
.rail-stats dt { font-size: 11.5px; color: var(--muted); }
.rail-stats dd { margin: 2px 0 0; font: 600 16px/1.2 "Fira Code", monospace; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rail-actions { display: flex; flex-direction: column; gap: 6px; }
.rail-actions form { margin: 0; }
.rail-actions .menu { width: 100%; }
.rail-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin: 0 0 8px; }
.rail-label ~ .rail-label { margin-top: 14px; }
.participants { display: flex; flex-wrap: wrap; gap: 6px; }
.participant { position: relative; }
.participant b { position: absolute; right: -4px; bottom: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--surface-3); border: 2px solid var(--surface); font-size: 10px; display: grid; place-items: center; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-block; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); transition: all var(--d1) var(--ease); }
.tag:hover { color: var(--accent); border-color: var(--accent-line); }
.share-bb { width: 100%; font-size: 12px; font-family: "Fira Code", monospace; }

.posts { display: flex; flex-direction: column; gap: 14px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); scroll-margin-top: 84px; transition: border-color var(--d2) var(--ease), box-shadow var(--d2) var(--ease); }
.post:target, .post.is-highlight { border-color: var(--accent-line); box-shadow: var(--glow); }
.post.is-fresh { animation: rise var(--d3) var(--ease) both, post-glow 2.6s var(--ease); }
@keyframes post-glow { from { border-color: var(--accent); } }
.post.is-deleted { opacity: .6; border-style: dashed; }
.post.is-solution { border-color: var(--accent-line); }
.post.is-ignored > :not(.post-ignored) { display: none; }
.post-ignored { padding: 14px 18px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.post-author { display: flex; gap: 12px; align-items: center; padding: 14px 18px 0; }
.post-av { position: relative; flex: none; }
.post-av .online-dot { border-color: var(--surface); }
.post-author-main { flex: 1; min-width: 0; }
.post-author-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-uname { font-size: 15.5px; }
.post-uname .username { font-weight: 700; }
.post-author-sub { display: flex; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.post-author-sub span { display: inline-flex; align-items: center; gap: 3px; }
.post-author-sub .ms { font-size: 14px; }
.post-head-right { display: flex; align-items: center; gap: 4px; align-self: flex-start; }
.post-head-right .badge, .post-head-right .tagpill { margin-right: 4px; }
.post-time { color: var(--muted); font-size: 13px; margin-right: 4px; white-space: nowrap; }
.post-time:hover { color: var(--text); }
.post-num { color: var(--muted); font: 12.5px "Fira Code", monospace; padding: 0 4px; }
.post-body { padding: 14px 18px 16px 72px; min-height: 40px; }
.post-edited { padding: 0 18px 10px 72px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.post-edited .ms { font-size: 14px; }
.post-sig { margin: 0 18px 12px 72px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 13.5px; color: var(--text-2); max-height: 240px; overflow: hidden; }
.post-sig img { max-height: 180px; }
.post-attachments { margin: 0 18px 12px 72px; }
.post-attachments-title { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .6px; }
.attach-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.attach-thumb { display: flex; flex-direction: column; width: 150px; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface-2); transition: transform var(--d2) var(--ease); }
.attach-thumb:hover { transform: translateY(-2px); }
.attach-thumb img { height: 100px; object-fit: cover; width: 100%; }
.attach-thumb span { font-size: 12px; padding: 5px 8px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-file { display: inline-flex; align-items: center; gap: 10px; padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--text); transition: border-color var(--d1) var(--ease); }
.attach-file:hover { color: var(--text); border-color: var(--accent-line); }
.attach-file span { display: flex; flex-direction: column; line-height: 1.3; }
.attach-file small { color: var(--muted); font-size: 12px; }
.post-reactions:not(:empty) { padding: 0 18px 10px 72px; }
.post-foot { display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px 8px 64px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.post-actions { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.act { background: none; border: 0; color: var(--muted); font-size: 13px; font-weight: 500; min-height: 32px; padding: 4px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px; transition: color var(--d1) var(--ease), background var(--d1) var(--ease), transform var(--d1) var(--ease); }
.act:hover { color: var(--text); background: var(--surface-2); }
.act:active { transform: scale(.96); }
.act .ms { font-size: 17px; }
.act.is-on { color: var(--accent); }
.act.is-mq { color: var(--accent); background: var(--accent-soft); }
.act-danger { color: var(--red); }
.react-btn.is-on .ms { display: none; }
.reactbar { display: inline-flex; align-items: center; gap: 8px; padding: 3px 11px 3px 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; transition: border-color var(--d1) var(--ease); animation: pop var(--d3) var(--ease); }
.reactbar:hover { color: var(--text); border-color: var(--line-2); }
.reactbar-icons { display: inline-flex; }
.reactbar-emoji { width: 22px; height: 22px; display: grid; place-items: center; font-size: 13px; margin-left: -5px; background: var(--surface-3); border-radius: 50%; border: 2px solid var(--surface-2); }
.reactbar-emoji:first-child { margin-left: 0; }
.react-wrap { position: relative; }
.react-picker {
  position: absolute; bottom: calc(100% + 6px); left: 0; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 4px; box-shadow: var(--shadow); gap: 2px; z-index: 30; white-space: nowrap; display: flex;
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(.95); transform-origin: bottom left;
  transition: opacity var(--d1) var(--ease), transform var(--d2) var(--ease), visibility 0s linear var(--d2);
}
.react-wrap:hover .react-picker, .react-wrap:focus-within .react-picker, .react-wrap.is-open .react-picker { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.react-picker::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.react-picker button { font-size: 21px; width: 38px; height: 38px; background: none; border: 0; border-radius: 50%; line-height: 1; transition: transform var(--d2) var(--ease), background var(--d1) var(--ease); }
.react-picker button:hover { background: var(--surface-3); transform: translateY(-3px) scale(1.2); }
.reactlist-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.reactlist-rows { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.reactlist-row { display: flex; gap: 10px; align-items: center; padding: 5px; }
.reactlist-row > div { flex: 1; display: flex; flex-direction: column; }
.reactlist-row small { color: var(--muted); font-size: 12px; }
.reactlist-emoji { font-size: 18px; }

.multiquote-bar { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); border-radius: 999px; padding: 6px 6px 6px 16px; display: flex; gap: 10px; align-items: center; animation: rise var(--d3) var(--ease); }
.multiquote-bar .ms { color: var(--accent); }
.live-bar { position: sticky; top: 72px; z-index: 30; display: flex; justify-content: center; height: 0; overflow: visible; }
.live-bar button { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 999px; padding: 8px 18px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); animation: pop var(--d3) var(--ease); }
.quickreply { padding: 16px; scroll-margin-top: 84px; }
.quickreply-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.cta { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cta > div:first-child { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.cta-actions { display: flex; gap: 8px; }
.similar { overflow: hidden; }
.simlist { display: flex; flex-direction: column; padding: 6px; }
.simlist a { color: var(--text); font-size: 14px; display: flex; flex-direction: column; padding: 9px 12px; border-radius: 9px; transition: background var(--d1) var(--ease); }
.simlist a:hover { background: var(--surface-2); color: var(--text); }
.simlist small { color: var(--muted); font-size: 12.5px; }

/* ---------- new-thread picker ---------- */
.picker { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.picker-search { position: relative; display: flex; align-items: center; }
.picker-search .ms { position: absolute; left: 14px; color: var(--muted); }
.picker-search input { width: 100%; padding-left: 44px; min-height: 48px; font-size: 15.5px; border-radius: 12px; }
.picker-group { overflow: hidden; }
.picker-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.picker-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; padding-left: calc(12px + var(--d) * 26px); border-radius: 10px; color: var(--text); transition: background var(--d1) var(--ease); }
.picker-item:hover { background: var(--surface-2); color: var(--text); }
.picker-item .tile-ic { color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.picker-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.picker-text small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-go { color: var(--muted); transition: transform var(--d2) var(--ease); }
.picker-item:hover .picker-go { transform: translateX(4px); color: var(--accent); }

/* ---------- editor ---------- */
.editor { border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); position: relative; transition: border-color var(--d1) var(--ease), box-shadow var(--d2) var(--ease); }
.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor.is-drag { border-color: var(--accent); box-shadow: var(--glow); }
.ed-toolbar { display: flex; flex-wrap: wrap; gap: 2px 4px; padding: 5px 6px; border-bottom: 1px solid var(--line); align-items: center; background: var(--surface); border-radius: 12px 12px 0 0; }
.ed-group { display: flex; gap: 1px; padding-right: 4px; margin-right: 2px; border-right: 1px solid var(--line); }
.ed-group:last-child { border-right: 0; }
.ed-right { margin-left: auto; }
.ed-toolbar button:not(.swatch), .ed-help { background: none; border: 0; color: var(--text-2); min-width: 32px; height: 32px; padding: 0 7px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: 13.5px; transition: background var(--d1) var(--ease), color var(--d1) var(--ease); }
.ed-toolbar button:not(.swatch):hover, .ed-help:hover { background: var(--surface-3); color: var(--text); }
.ed-toolbar .ms { font-size: 18px; }
.ed-toolbar [data-menu] .ms + .ms, .ed-toolbar [data-menu] > .ms:last-child:not(:first-child) { font-size: 15px; }
.ed-color-a { font-weight: 700; border-bottom: 3px solid var(--red); line-height: 1; padding-bottom: 1px; }
.ed-preview-btn.is-on { background: var(--accent-soft) !important; color: var(--accent) !important; }
.ed-menu { max-height: 340px; overflow-y: auto; min-width: 190px; }
.ed-fonts { width: 250px; }
.ed-fonts button { font-size: 15px !important; }
.ed-colors { width: 250px; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; padding: 4px; }
.swatch { width: 100%; aspect-ratio: 1; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .14); padding: 0; transition: transform var(--d1) var(--ease); }
.swatch:hover { transform: scale(1.15); }
.ed-custom-color { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; font-size: 13.5px; }
.ed-smilies { width: 280px; display: grid; grid-template-columns: repeat(7, 1fr); }
.ed-smilies button { font-size: 19px !important; padding: 4px !important; justify-content: center !important; }
.editor textarea { border: 0; border-radius: 0; background: transparent; padding: 12px 14px; display: block; min-height: 130px; font-size: 15px; box-shadow: none; }
.editor textarea:focus { border: 0; box-shadow: none; }
.ed-preview { padding: 12px 14px; min-height: 130px; background: var(--surface); }
.ed-hint { font-size: 12.5px; color: var(--muted); padding: 6px 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.ed-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 10px; }
.ed-attachments:not(:empty) { padding: 10px; border-top: 1px solid var(--line); }
.ed-att { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); font-size: 13px; max-width: 290px; animation: rise var(--d2) var(--ease); }
.ed-att img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; }
.ed-att span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ed-att button { background: var(--surface-3); border: 0; border-radius: 6px; padding: 3px 8px; font-size: 12px; color: var(--text-2); }
.ed-att.is-uploading { opacity: .55; animation: pulse-fade 1s ease-in-out infinite alternate; }
@keyframes pulse-fade { to { opacity: .9; } }
.mention-pop { position: absolute; z-index: 45; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; min-width: 210px; animation: rise var(--d2) var(--ease); }
.mention-pop button { display: flex; gap: 8px; align-items: center; width: 100%; background: none; border: 0; padding: 6px 8px; border-radius: 7px; color: var(--text); text-align: left; }
.mention-pop button.is-active, .mention-pop button:hover { background: var(--surface-3); }
.title-input { font-size: 17px; font-weight: 500; padding: 11px 14px !important; }
.prefix-select { max-width: 200px; }
.poll-builder { border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 16px; }
.poll-builder summary { cursor: pointer; font-weight: 500; display: flex; gap: 6px; align-items: center; min-height: 28px; }
.poll-builder-body { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
[data-poll-options] { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }

/* ---------- BBCode output ---------- */
.bbwrap { word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.7; }
.bbwrap img.bb-img { max-width: 100%; height: auto; border-radius: 8px; cursor: zoom-in; vertical-align: middle; }
.bb-quote { margin: 10px 0; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; position: relative; }
.bb-quote-head { padding: 8px 14px 0; font-size: 13px; font-weight: 600; }
.bb-quote-head a { color: var(--text-2); }
.bb-quote-body { padding: 6px 14px 10px; max-height: 260px; overflow: hidden; }
.bb-quote.is-expanded .bb-quote-body { max-height: none; }
.bb-quote-expand { display: none; width: 100%; border: 0; background: var(--surface-2); border-top: 1px solid var(--line); color: var(--link); padding: 8px 14px; position: relative; text-align: left; font-size: 13px; }
.bb-quote.is-long:not(.is-expanded) .bb-quote-expand { display: block; }
.bb-code { margin: 10px 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--code-bg); }
.bb-code-head { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.bb-code-head span:first-child { font-weight: 600; color: var(--text-2); }
.bb-code-meta { flex: 1; }
.bb-copy { background: var(--surface-3); border: 0; color: var(--text-2); font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 6px; transition: all var(--d1) var(--ease); }
.bb-copy:hover { color: var(--text); }
.bb-copy.is-done { color: var(--on-accent); background: var(--accent); }
.bb-code pre { margin: 0; padding: 12px 16px; overflow: auto; max-height: 460px; font-size: 13px; line-height: 1.6; tab-size: 4; }
.bb-code pre code.hljs { background: transparent; padding: 0; }
.bb-icode { font-size: .88em; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.bb-mono { font-family: "Fira Code", monospace; font-size: .94em; }
.bb-spoiler { margin: 10px 0; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.bb-spoiler summary { cursor: pointer; padding: 9px 14px; font-weight: 600; font-size: 13.5px; user-select: none; }
.bb-spoiler summary::marker { color: var(--accent); }
.bb-spoiler[open] .bb-spoiler-body { animation: rise var(--d2) var(--ease); }
.bb-spoiler-body { padding: 4px 14px 12px; }
.bb-ispoiler { background: var(--text-2); color: transparent; border-radius: 4px; cursor: pointer; transition: background var(--d2) var(--ease), color var(--d2) var(--ease); }
.bb-ispoiler * { visibility: hidden; }
.bb-ispoiler.is-shown { background: var(--surface-3); color: inherit; }
.bb-ispoiler.is-shown * { visibility: visible; }
.bb-hide { margin: 10px 0; border: 1px dashed var(--line-2); border-radius: 10px; overflow: hidden; }
.bb-hide-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; padding: 6px 14px; background: var(--surface-2); color: var(--muted); }
.bb-hide.is-open { border-color: var(--accent-line); }
.bb-hide.is-open .bb-hide-head { color: var(--accent); }
.bb-hide.is-locked .bb-hide-body { color: var(--muted); font-style: italic; }
.bb-hide.is-locked .bb-hide-head { color: var(--amber); }
.bb-hide-body { padding: 10px 14px; }
.bb-media { position: relative; max-width: 640px; aspect-ratio: 16 / 9; margin: 10px 0; border-radius: 10px; overflow: hidden; background: #000; }
.bb-media iframe, .bb-media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bb-table-wrap { overflow-x: auto; margin: 10px 0; }
.bb-table { border-collapse: collapse; min-width: 50%; }
.bb-table td, .bb-table th { border: 1px solid var(--line-2); padding: 7px 11px; text-align: left; }
.bb-table th { background: var(--surface-2); }
.bb-h { font-weight: 700; margin: 14px 0 6px; line-height: 1.3; letter-spacing: -.2px; }
.bb-h1 { font-size: 22px; } .bb-h2 { font-size: 18px; } .bb-h3 { font-size: 16px; }
.bb-hr { margin: 14px 0; }
.bb-mark { color: #111; padding: 0 3px; border-radius: 3px; }
.bbwrap ul, .bbwrap ol { margin: 6px 0; padding-left: 26px; }
.mention { font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 0 5px; border-radius: 5px; }
.smilie { font-size: 1.15em; line-height: 1; }
.bb-attach-img img { max-width: 360px; max-height: 280px; border-radius: 8px; border: 1px solid var(--line); vertical-align: middle; }
.bb-attach-img.is-full img { max-width: 100%; max-height: none; }
.bb-attach-file { display: inline-flex; padding: 4px 10px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-2); }
.bb-attach-missing { color: var(--muted); font-style: italic; }
.fx-rainbow { background: linear-gradient(90deg, #ff6b6b, #ffa94d, #ffd43b, #69db7c, #3bc9db, #4dabf7, #b197fc, #ff6b6b) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: rainbow 4s linear infinite; font-weight: 600; }
@keyframes rainbow { to { background-position: -200% 0; } }
.fx-glow { color: #fff; text-shadow: 0 0 6px var(--glow), 0 0 14px var(--glow); }
[data-theme="light"] .fx-glow { color: var(--glow); }
.fx-grad { -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 600; }
.fx-outline { -webkit-text-stroke: 1px var(--ol); paint-order: stroke fill; font-weight: 700; }
.fx-shake { display: inline-block; animation: shake .35s infinite; }
@keyframes shake { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(1px, -1px) rotate(-1deg); } 50% { transform: translate(-1px, 1px) rotate(1deg); } 75% { transform: translate(1px, 1px) rotate(0); } }

/* ---------- profile ---------- */
.profile-head { margin-bottom: 18px; overflow: hidden; }
.profile-banner { height: 200px; background: var(--surface-2) center / cover no-repeat; border-bottom: 1px solid var(--line); }
.profile-top { display: flex; gap: 20px; padding: 0 24px 18px; align-items: flex-end; flex-wrap: wrap; }
.profile-av { margin-top: -58px; position: relative; border-radius: 26px; border: 5px solid var(--surface); background: var(--surface); animation: pop 500ms var(--ease) both; }
.profile-av .online-dot { width: 20px; height: 20px; border-width: 4px; right: -3px; bottom: -3px; }
.profile-id { flex: 1; min-width: 220px; padding-top: 12px; }
.profile-name { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -.4px; }
.profile-name .username { font-weight: 700; }
.profile-title { color: var(--muted); }
.profile-banners { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 13.5px; }
.profile-meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile-meta .ms { font-size: 16px; }
.profile-actions { display: flex; gap: 8px; align-items: center; }
.profile-stats { display: grid; grid-template-columns: repeat(6, 1fr); margin: 0; border-top: 1px solid var(--line); }
.profile-stats div { padding: 13px; text-align: center; border-right: 1px solid var(--line); }
.profile-stats div:last-child { border-right: 0; }
.profile-stats dt { color: var(--muted); font-size: 12.5px; }
.profile-stats dd { margin: 2px 0 0; font: 600 18px/1.3 "Fira Code", monospace; }
.wall-form { display: flex; gap: 12px; align-items: flex-start; }
.wall-form textarea { flex: 1; min-height: 44px; }
.wallpost { display: flex; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.wallpost:first-child { border-top: 0; }
.wallpost-main { flex: 1; min-width: 0; }
.wallpost-head { margin-bottom: 3px; }
.wallpost-actions { display: flex; gap: 4px; margin-top: 4px; }
.about-bio { padding: 18px 20px; }
.about-pairs { padding: 0 20px 18px; max-width: 480px; }
.post-sig-side img { max-width: 100%; }
.media-edit { display: flex; gap: 18px; padding: 18px 20px; align-items: center; border-top: 1px solid var(--line); flex-wrap: wrap; }
.media-edit:first-child { border-top: 0; }
.media-edit form { flex: 1; min-width: 240px; }
.banner-preview { width: 240px; height: 80px; border-radius: 10px; background: var(--surface-3) center / cover; }

/* ---------- misc lists ---------- */
.feed-row { display: flex; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); align-items: flex-start; transition: background var(--d1) var(--ease); }
.feed-row:first-child { border-top: 0; }
.feed-row:hover { background: var(--surface-2); }
.feed-main { flex: 1; min-width: 0; }
.feed-snippet { color: var(--text-2); font-size: 14px; margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.result { display: flex; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); transition: background var(--d1) var(--ease); }
.result:first-child { border-top: 0; }
.result:hover { background: var(--surface-2); }
.result-main { flex: 1; min-width: 0; }
.result-title { font-weight: 600; color: var(--text); font-size: 15.5px; }
.result-title:hover { color: var(--accent-hi); }
.result-snippet { color: var(--text-2); font-size: 14px; margin: 3px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.membergrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 10px; }
.membergrid .empty { grid-column: 1 / -1; }
.membercard { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); transition: transform var(--d2) var(--ease), border-color var(--d2) var(--ease); }
.membercard:hover { transform: translateY(-2px); border-color: var(--line-2); }
.block-body > .membercard { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.block-body > .membercard:first-child { border-top: 0; }
.membercard .av-l { width: 50px; height: 50px; font-size: 21px; border-radius: 13px; }
.membercard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.membercard-main .ubanner { align-self: flex-start; font-size: 10px; padding: 1px 6px; }
.membercard-name .username { font-weight: 700; }
.membercard-stat { text-align: right; font: 600 15px/1.3 "Fira Code", monospace; display: flex; flex-direction: column; }
.membercard-stat small { font: 400 11.5px "Fira Sans", sans-serif; color: var(--muted); }
.notable { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inline-search { display: flex; gap: 6px; }
.sidenav { display: flex; flex-direction: column; padding: 6px; position: sticky; top: 80px; gap: 2px; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-height: 38px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; transition: background var(--d1) var(--ease), color var(--d1) var(--ease); }
.sidenav a:hover { background: var(--surface-2); color: var(--text); }
.sidenav a.is-active { background: var(--accent-soft); color: var(--text); }
.sidenav a.is-active .ms { color: var(--accent); }
.sidenav a .ms { color: var(--muted); font-size: 19px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }
.table tbody tr { transition: background var(--d1) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; }
.stat b { font: 600 26px/1.2 "Fira Code", monospace; }
.stat span { color: var(--muted); font-size: 13px; }
.prefix-row { padding: 10px 16px; border-top: 1px solid var(--line); }
.prefix-row:first-child { border-top: 0; }
.prefix-preview { min-width: 110px; }
.ipsearch { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.tagcloud { padding: 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tagcloud small { color: var(--muted); }
.helptable { display: flex; flex-direction: column; }
.help-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: start; }
.help-row:first-child { border-top: 0; }
.help-name { font-weight: 600; font-size: 14px; }
.help-src { margin: 0; background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.fontgrid { padding: 16px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; font-size: 18px; }
.smiliegrid { padding: 16px 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.smiliegrid div { display: flex; align-items: center; gap: 8px; }
.smiliegrid span { font-size: 22px; }
.smiliegrid code { font-size: 12px; color: var(--muted); }
.authbox { max-width: 440px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); animation: rise var(--d3) var(--ease); }
.authbox .pagetitle { margin-bottom: 20px; }
.authbox-foot { margin-top: 20px; text-align: center; color: var(--muted); }
.errorpage { text-align: center; }
.errorpage .form-row { justify-content: center; margin-top: 16px; }
.report .block-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- overlays ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .88); display: grid; place-items: center; cursor: zoom-out; animation: vt-in var(--d2) var(--ease); }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; animation: pop var(--d3) var(--ease); }
.lightbox .icon-btn { position: absolute; top: 14px; right: 14px; color: #fff; }
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: vt-in var(--d2) var(--ease); }
.modal-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; width: 100%; max-width: 480px; box-shadow: var(--shadow); max-height: 90vh; display: flex; flex-direction: column; animation: rise var(--d3) var(--ease); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px; overflow: auto; }
.usercard-pop { position: absolute; z-index: 80; width: 320px; animation: rise var(--d2) var(--ease); }
.usercard { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.usercard-banner { height: 70px; background: var(--ub, none) center / cover, var(--surface-2); }
.usercard-top { display: flex; gap: 12px; padding: 0 16px; align-items: flex-end; margin-top: -30px; }
.usercard-top .av-l { width: 72px; height: 72px; border: 4px solid var(--surface); border-radius: 18px; }
.usercard-top > div { padding-bottom: 2px; }
.usercard-top .ubanner { margin: 3px 4px 0 0; }
.usercard-name .username { font-weight: 700; font-size: 16px; }
.usercard-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin: 12px 0 0; border-top: 1px solid var(--line); }
.usercard-stats div { padding: 8px 4px; text-align: center; }
.usercard-stats dt { font-size: 11.5px; color: var(--muted); }
.usercard-stats dd { margin: 0; font-size: 13.5px; font-weight: 600; }
.usercard-actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 110; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; background: var(--surface); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); animation: slide-in-r var(--d3) var(--ease); max-width: min(380px, calc(100vw - 40px)); font-size: 14px; }
.toast.is-leaving { transition: opacity var(--d2) var(--ease), transform var(--d2) var(--ease); opacity: 0; transform: translateX(16px); }
.toast.is-error { border-color: var(--red); }
.toast a { color: var(--text); display: flex; gap: 10px; align-items: flex-start; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 20px 0; font-size: 13.5px; margin-top: auto; }
.footer-in { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer-left { display: flex; gap: 10px; color: var(--muted); align-items: center; }
.footer-left img { border-radius: 6px; }
.footer-left b { color: var(--text); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- responsive (375 / 768 / 1024 / 1440) ---------- */
@media (max-width: 1280px) {
  .layout { grid-template-columns: minmax(0, 1fr) 286px; }
  .threadpage { grid-template-columns: minmax(0, 1fr) 250px; }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: 100%;
    transform: translateX(-102%); transition: transform var(--d3) var(--ease); box-shadow: var(--shadow);
  }
  .rail.is-open { transform: none; }
  .rail-close { display: inline-grid; }
  .rail-backdrop { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; transition: opacity var(--d2) var(--ease), visibility 0s linear var(--d2); }
  .rail-backdrop.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
  .nav-toggle { display: inline-grid; }
  .topbar-brand { display: flex; }
  .topbar { padding: 0 16px; }
  .wrap { padding: 0 20px; }
  .layout, .layout-left, .threadpage { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .sidenav, .threadrail { position: static; }
  .threadrail { order: -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .sidenav { flex-direction: row; flex-wrap: wrap; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
  .notable { grid-template-columns: 1fr; }
  .help-row { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 12px; }
  .topsearch { display: none; }
  .btn-new span, .userchip-text, .userchip-caret { display: none; }
  .btn-new { padding: 7px 10px; }
  .hero { padding: 20px; }
  .hero-title { font-size: 23px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .tiles, .tiles-compact { grid-template-columns: minmax(0, 1fr); }
  .forumhead { padding: 18px; }
  .trow { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .trow-av .av-m { width: 36px; height: 36px; }
  .trow-stats { grid-column: 2; }
  .trow-last { display: none; }
  .post-body, .post-edited, .post-reactions:not(:empty) { padding-left: 16px; }
  .post-sig, .post-attachments { margin-left: 16px; }
  .post-foot { padding-left: 8px; }
  .post-author { flex-wrap: wrap; padding: 12px 14px 0; }
  .post-head-right { width: 100%; justify-content: flex-end; order: 3; margin-top: -4px; }
  .hide-sm { display: none !important; }
  .thread-title { font-size: 21px; }
  .threadrail { grid-template-columns: minmax(0, 1fr); }
  .grid-2, .grid-3, .ipsearch { grid-template-columns: minmax(0, 1fr); }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .profile-banner { height: 130px; }
  .menu-alerts { width: min(380px, calc(100vw - 24px)); position: fixed; top: 60px; right: 12px; }
  .ed-right { margin-left: 0; }
  .pagetitle { font-size: 22px; }
  .table { font-size: 13px; }
  .table th, .table td { padding: 8px 10px; }
  .toasts { right: 12px; left: 12px; align-items: stretch; }
}

/* ---------- 2FA ---------- */
.tfa-setup { padding: 18px 20px; }
.tfa-setup p { margin: 0 0 14px; color: var(--text-2); }
.tfa-steps { margin: 0 0 18px; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.tfa-grid { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.tfa-qr { background: #fff; padding: 12px; border-radius: 12px; width: 208px; height: 208px; flex: none; }
.tfa-qr img, .tfa-qr canvas { display: block; }
.tfa-side { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 16px; }
.tfa-secret { display: block; font-size: 15px; letter-spacing: 1px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; word-break: break-all; user-select: all; }
.tfa-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 0 0 16px; }
.tfa-codes code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; text-align: center; font-size: 14px; user-select: all; }
.tfa-manage { display: flex; flex-direction: column; gap: 10px; }
.otp-input { font: 500 20px "Fira Code", monospace; letter-spacing: 4px; text-align: center; }
.auth-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.auth-ic .ms { font-size: 28px; }
