:root {
  --bg: #f5f8fa;
  --surface: #ffffff;
  --border: #e1e8ed;
  --text: #14171a;
  --muted: #657786;
  --accent: #e85a9b;
  --accent-hover: #d14a8a;
  --accent-wash: #fde8f2;
  --accent-rgb: 232, 90, 155;
  --link: #c73e7a;
  --danger: #e0245e;
  --repost: #17bf63;
  --radius-btn: 4px;
  --nav: 275px;
  --main: 600px;
  --aside: 350px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
html.accent-blue {
  --accent: #5b9bd5;
  --accent-hover: #4a8bc4;
  --accent-wash: #e8f2fa;
  --accent-rgb: 91, 155, 213;
  --link: #4a7fb8;
}
html.dark {
  --bg: #15202b;
  --surface: #192734;
  --border: #38444d;
  --text: #ffffff;
  --muted: #8899a6;
  --accent-wash: rgba(var(--accent-rgb), 0.12);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { font-size: 16px; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.375;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.shell {
  display: grid;
  grid-template-columns: var(--nav) var(--main) var(--aside);
  max-width: 1230px;
  margin: 0 auto;
  min-height: 100vh;
  align-items: start;
}
.left-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 8px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand {
  display: flex;
  align-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  margin: 2px 0 6px;
  text-decoration: none;
}
.brand:hover { background: var(--accent-wash); text-decoration: none; }
.brand img { width: 34px; height: 34px; margin: auto; border-radius: 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  color: var(--text);
  font-size: 19px;
  font-weight: 400;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--accent-wash); text-decoration: none; color: var(--text); }
.nav-item.active { font-weight: 700; }
.nav-item.active .icon { color: var(--accent); }
.nav-item .icon { width: 26px; height: 26px; flex-shrink: 0; }
.badge {
  position: absolute;
  left: 28px;
  top: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-weight: 700;
  font-size: 14px;
}
.btn:hover { background: var(--bg); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; text-decoration: none; }
.btn-primary:disabled { opacity: .45; cursor: default; }
.btn-pill { border-radius: 999px; }
.btn-block { width: 100%; }
.nav-post {
  margin-top: 8px;
  width: 100%;
  padding: 12px;
  font-size: 16px;
}
.nav-spacer { flex: 1; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}
.nav-user:hover { background: var(--accent-wash); text-decoration: none; }
.nav-user small { color: var(--muted); display: block; font-weight: 400; }
.nav-logout-form { margin: 0; padding: 0 8px 12px; width: 100%; }
.nav-logout-btn {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
  color: var(--danger);
}
.nav-logout-btn:hover { background: rgba(224, 36, 94, .12); color: var(--danger); text-decoration: none; }

.main {
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-height: 100vh;
  min-width: 0;
}
.page-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
html.dark .page-head { background: rgba(25,39,52,.92); }
.page-head h1 { font-size: 19px; margin: 0; font-weight: 800; }
.page-head .sub { color: var(--muted); font-size: 13px; font-weight: 400; }

.compose {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 8px solid var(--bg);
  border-bottom-color: var(--bg);
}
.compose-body { flex: 1; min-width: 0; }
.compose textarea {
  width: 100%;
  border: 0;
  resize: none;
  min-height: 56px;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: var(--text);
}
.compose-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.compose-left { display: flex; gap: 4px; align-items: center; }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: var(--accent-wash); }
.icon { width: 18px; height: 18px; display: block; }
.count { font-size: 13px; color: var(--muted); }
.count.warn { color: var(--accent); }
.count.over { color: var(--danger); font-weight: 700; }
.thumbs { display: grid; gap: 4px; margin-top: 8px; border-radius: 16px; overflow: hidden; }
.thumbs.n1 { grid-template-columns: 1fr; }
.thumbs.n2, .thumbs.n4 { grid-template-columns: 1fr 1fr; }
.thumbs.n3 { grid-template-columns: 1fr 1fr; }
.thumbs img { width: 100%; height: 160px; object-fit: cover; background: #000; cursor: pointer; }
.thumbs.n1 img { height: 280px; }

.post {
  display: flex;
  gap: 10px;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
}
.post:hover { background: #f5f8fa; }
html.dark .post:hover { background: #1e2732; }
.post.unavailable { color: var(--muted); font-style: italic; cursor: default; }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--accent);
  flex-shrink: 0;
}
.avatar.sm { width: 32px; height: 32px; }
.avatar.lg { width: 140px; height: 140px; border: 4px solid var(--surface); margin-top: -70px; }
.post-main { flex: 1; min-width: 0; }
.context { color: var(--muted); font-size: 13px; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.post-meta { display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; }
.post-meta .name { font-weight: 700; color: var(--text); }
.post-meta .name:hover { text-decoration: underline; }
.post-meta .handle, .post-meta .dot, .post-meta time { color: var(--muted); font-size: 14px; }
.post-text { font-size: 15px; white-space: pre-wrap; word-wrap: break-word; margin: 2px 0 6px; }
.post-text a { color: var(--link); }
.quote {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  margin: 6px 0;
}
.quote .post-text { font-size: 14px; }
.actions {
  display: flex;
  justify-content: space-between;
  max-width: 420px;
  margin-left: -8px;
}
.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px;
  border-radius: 999px;
  min-width: 44px;
  min-height: 36px;
  font-size: 13px;
}
.act:hover { color: var(--accent); }
.act:hover .act-wrap { background: var(--accent-wash); }
.act.repost:hover, .act.repost.on { color: var(--repost); }
.act.like.on { color: var(--accent); }
.act.bm.on { color: var(--accent); }
.act-wrap { width: 32px; height: 32px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.act-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; }
.act-ico .icon { width: 18px; height: 18px; }
.sheet-divider { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }

.right {
  position: sticky;
  top: 0;
  padding: 12px 16px;
  height: 100vh;
  overflow: auto;
}
.search-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.search-box:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.search-box input {
  border: 0;
  background: transparent;
  flex: 1;
  outline: none;
  color: var(--text);
  font-size: 15px;
}
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.card {
  background: var(--bg);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}
.card h2 { font-size: 19px; margin: 0; padding: 12px 16px; }
.trend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
}
.who {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
}
.trend:hover, .who:hover { background: rgba(0,0,0,.04); text-decoration: none; }
.trend .k { color: var(--muted); font-size: 13px; line-height: 1.3; }
.trend .t { font-weight: 700; font-size: 15px; line-height: 1.3; }
.trend-empty .k:last-child { font-weight: 400; }
.who .who-txt { flex: 1; min-width: 0; }
.who .name { font-weight: 700; display: block; }
.who .handle { color: var(--muted); font-size: 13px; }

.follow-btn {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.follow-btn:hover { background: var(--accent-wash); }
.follow-btn.on { background: var(--accent); color: #fff; }

.profile-banner, .banner {
  height: 200px;
  background: var(--accent);
  background-size: cover;
  background-position: center;
}
.profile-head { padding: 0 16px 12px; }
.profile-actions { display: flex; justify-content: flex-end; padding: 12px 0; min-height: 56px; }
.profile-head h2 { margin: 0; font-size: 20px; }
.profile-head .handle { color: var(--muted); margin: 0 0 8px; }
.bio { margin: 0 0 8px; }
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.profile-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.profile-tag:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 16px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}
.profile-detail { min-width: 0; }
.profile-detail dt {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.profile-detail dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
}
.meta-row { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 12px; }
.counts { display: flex; gap: 16px; margin-top: 10px; }
.counts a { color: var(--text); }
.counts strong { font-weight: 700; }
.tabs { display: flex; border-bottom: 1px solid var(--border); }
.tabs a {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover { background: var(--accent-wash); text-decoration: none; }

.user-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif.unread { background: var(--accent-wash); }
.group-card {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.group-card:hover { background: var(--accent-wash); text-decoration: none; color: var(--text); }

.form { padding: 16px; }
.form h3 { margin: 20px 0 0; font-size: 17px; }
.form h3.signal-heading { margin-top: 24px; }
.form .form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.settings-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px 24px;
  margin: 0;
  border-top: 1px solid var(--border);
}
.settings-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.settings-links a:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-hover);
  text-decoration: none;
  box-shadow: 0 0 0 1px var(--accent-wash);
}
.settings-links a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.legacy-form { border-top: 1px solid var(--border); margin-top: 8px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }

/* Form controls — same surface/border language as .btn, pink focus ring */
.field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=image]),
.field textarea,
.field select,
.form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=image]),
.form textarea,
.form select,
.form input[type=date],
.form input[type=number],
.staff-filters input:not([type=checkbox]):not([type=radio]),
.staff-filters select,
.auth-card input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=submit]):not([type=button]),
.auth-card textarea,
.auth-card select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.375;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.field textarea,
.form textarea,
.auth-card textarea {
  min-height: 88px;
  resize: vertical;
}

.field select,
.form select,
.staff-filters select,
.auth-card select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23657786' d='M1.4.7 6 5.3 10.6.7 12 2.1l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
}

html.dark .field select,
html.dark .form select,
html.dark .staff-filters select,
html.dark .auth-card select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238899a6' d='M1.4.7 6 5.3 10.6.7 12 2.1l-6 6-6-6z'/%3E%3C/svg%3E");
}

.field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):focus,
.field textarea:focus,
.field select:focus,
.form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):focus,
.form textarea:focus,
.form select:focus,
.staff-filters input:not([type=checkbox]):not([type=radio]):focus,
.staff-filters select:focus,
.auth-card input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):focus,
.auth-card textarea:focus,
.auth-card select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
  background: var(--surface);
}

.field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden])::placeholder,
.field textarea::placeholder,
.form input::placeholder,
.form textarea::placeholder,
.auth-card input::placeholder,
.auth-card textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):disabled,
.field textarea:disabled,
.field select:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--bg);
}

.field input:-webkit-autofill,
.field textarea:-webkit-autofill,
.auth-card input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px var(--accent-wash) inset;
  border-color: var(--accent);
  transition: background-color 9999s ease-out 0s;
}

.field input[type=file],
.form input[type=file],
.auth-card input[type=file] {
  padding: 8px;
  background: var(--bg);
  cursor: pointer;
}

/* Custom file picker — settings, groups, etc. */
.file-field { margin-bottom: 14px; }
.file-field .file-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.file-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.file-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.file-control input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  background: transparent;
}
.file-btn {
  flex-shrink: 0;
  margin: 0;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
}
.file-btn:hover {
  background: var(--accent-wash);
  text-decoration: none;
}
.file-name {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-name.has-file {
  color: var(--text);
  font-weight: 600;
}

.field input[type=file]:not(.file-control input[type=file])::file-selector-button,
.form input[type=file]:not(.file-control input[type=file])::file-selector-button {
  margin-right: 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 7px 14px;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.field input[type=file]:not(.file-control input[type=file])::file-selector-button:hover,
.form input[type=file]:not(.file-control input[type=file])::file-selector-button:hover {
  background: var(--accent-wash);
}

.field input[type=checkbox],
.form input[type=checkbox],
.staff-filters input[type=checkbox],
.form input[type=radio]:not(.choice-pill input) {
  width: auto;
  accent-color: var(--accent);
  cursor: pointer;
}

.help { color: var(--danger); font-size: 13px; }
.flash { padding: 10px 16px; background: var(--accent-wash); color: var(--accent-hover); }

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty img { width: 72px; height: 72px; margin: 0 auto 12px; }
.empty h2 { color: var(--text); margin: 0 0 8px; }

.thread-focus { border-bottom: 1px solid var(--border); }
.thread-focus .post-text { font-size: 23px; line-height: 1.3; }

.mobile-top, .mobile-bottom, .fab { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; max-width: 100%; }

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-art {
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-art img { width: 160px; height: 160px; }
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: var(--surface);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 28px; margin: 12px 0 20px; }
.auth-logo { width: 48px; height: 48px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .btn { margin-top: 4px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 60;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
}
.modal.open { display: flex; }
.modal-card {
  background: var(--surface);
  border-radius: 16px;
  width: min(600px, 100%);
  max-height: calc(100vh - 80px);
  overflow: auto;
}

@media (max-width: 1099px) {
  .shell { grid-template-columns: 72px minmax(0, 600px); max-width: 700px; }
  .right { display: none; }
  .nav-label, .nav-post span, .nav-user span { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-post { width: 46px; height: 46px; border-radius: 999px; padding: 0; margin-left: 4px; }
  .left-nav { padding: 8px 4px; }
}
@media (max-width: 767px) {
  .shell { display: block; padding-bottom: calc(56px + var(--safe-b) + 8px); }
  .left-nav, .right { display: none; }
  .main { border: 0; min-height: calc(100vh - 56px); }
  .mobile-top {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: calc(6px + var(--safe-t)) 12px 6px;
    align-items: center;
    gap: 10px;
    min-height: 48px;
  }
  .mobile-bottom {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-b);
    justify-content: space-around;
  }
  .mobile-bottom a {
    flex: 1;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    position: relative;
  }
  .mobile-bottom a.active { color: var(--accent); }
  .fab {
    display: flex;
    position: fixed;
    right: 16px;
    bottom: calc(68px + var(--safe-b));
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    align-items: center;
    justify-content: center;
    z-index: 45;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
    text-decoration: none;
  }
  .fab:hover { background: var(--accent-hover); text-decoration: none; }
  .avatar.lg { width: 86px; height: 86px; margin-top: -48px; }
  .profile-banner { height: 140px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 180px; }
  .thumbs.n1 img { height: 200px; }
  .thumbs img { height: 120px; }
  .page-head { display: none; }
}
.more-menu { position: relative; }
.dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 160px;
  box-shadow: 0 1px 8px rgba(0,0,0,.12);
  display: none;
  z-index: 15;
}
.dropdown.open { display: block; }
.dropdown button, .dropdown a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: 0;
  background: none;
  color: var(--text);
}
.dropdown button:hover, .dropdown a:hover { background: var(--bg); text-decoration: none; }
.danger { color: var(--danger) !important; }

/* Toggle switches */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}
.switch-block {
  padding: 4px 0 8px;
}
.switch-block .switch-help {
  margin: 8px 0 0 56px;
}
.switch-help {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  max-width: 36rem;
}
.switch-inline {
  margin: 8px 0 14px;
}
.switch-compact {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.switch-compact:has(input:checked) {
  color: var(--text);
}
.switch-text {
  line-height: 1.3;
}
.switch input[type=checkbox] {
  position: relative;
  width: 44px;
  height: 24px;
  margin: 0;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, box-shadow .15s ease;
}
.switch input[type=checkbox]::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .2s ease;
}
.switch input[type=checkbox]:checked {
  background: var(--accent);
}
.switch input[type=checkbox]:checked::before {
  transform: translateX(20px);
}
.switch input[type=checkbox]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.switch input[type=checkbox]:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Pill radio choices — appearance theme picker */
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}
.choice-pill {
  cursor: pointer;
  user-select: none;
}
.choice-pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.choice-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.choice-pill:hover span {
  border-color: var(--accent);
  background: var(--accent-wash);
}
.choice-pill input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.choice-pill input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-wash);
}

/* Staff panel */
.staff-bar { margin: 0 0 12px; padding: 12px 16px; background: var(--accent-wash); border-bottom: 1px solid var(--border); }
.staff-bar-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; }
.staff-badge { font-weight: 700; color: var(--accent-hover); display: flex; align-items: center; gap: 6px; }
.staff-role { color: var(--muted); font-size: 14px; }
.staff-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.staff-tab { padding: 6px 12px; border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.staff-tab.active, .staff-tab:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.staff-stat { padding: 0 16px 16px; }
.staff-stat h2 { font-size: 15px; margin: 0 0 8px; padding: 12px 0 0; }
.stat-num { font-size: 28px; font-weight: 800; margin: 0 0 8px; padding-left: 2px; color: var(--accent); line-height: 1.1; }
.stat-warn { color: var(--danger); font-size: 13px; margin: 0 0 8px; padding-left: 2px; }
.staff-stat .lockdown-list { margin: 0 0 12px; padding-left: 18px; }
.lockdown-status { font-weight: 700; }
.lockdown-status.is-off { color: var(--danger); }
.lockdown-status.is-on { color: var(--repost); }
.staff-stat .btn { display: flex; width: fit-content; margin: 2px auto 0; }
.staff-quick { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.staff-panel { margin: 0 16px 16px; padding: 16px; }
.staff-panel h2 { font-size: 17px; margin: 0 0 12px; }
.staff-subtabs { margin-bottom: 12px; }
.staff-link-list { list-style: none; margin: 0; padding: 0; }
.staff-link-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.staff-note { padding: 10px 0; border-bottom: 1px solid var(--border); }
.staff-note:last-child { border-bottom: 0; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 12px; margin-bottom: 16px; }
.perm-check { font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.staff-table-wrap { overflow-x: auto; margin: 0 16px 16px; }
.staff-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.staff-table th, .staff-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.staff-table tr.priority-urgent { background: rgba(224,36,94,.08); }
.staff-table tr.priority-high { background: rgba(var(--accent-rgb), .08); }
.staff-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 16px 12px; padding: 12px; }
.staff-invite-form { padding: 16px; }
.staff-invite-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.staff-invite-uses { margin: 0; min-width: 120px; max-width: 140px; }
.staff-invite-uses input[type=number] { width: 100%; }
.room-create-form { margin: 16px; padding: 16px; }
.room-create-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.room-create-title { flex: 1 1 200px; margin: 0; min-width: 0; }
.room-create-hours { margin: 0; min-width: 100px; max-width: 120px; }
.message-new-form { margin: 16px; padding: 16px; }
#bulk-form { margin: 0 16px 12px; padding: 12px 16px; }
#bulk-form .btn { margin-left: 8px; }
.staff-appeal-form { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.staff-appeal-form input[type=text] { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-btn); background: var(--surface); }
.staff-appeal-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.appeal-body { max-width: 280px; font-size: 14px; }
.staff-stack { display: flex; flex-direction: column; gap: 12px; }
.staff-panel .staff-table-wrap { margin: 0; overflow-x: auto; }
.staff-table .cell-user strong { display: block; }
.staff-table .cell-user .handle { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.staff-table .cell-email { word-break: break-word; min-width: 160px; }
.staff-table .cell-actions { white-space: nowrap; width: 1%; }
.staff-detail-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 16px 16px; }
@media (min-width: 900px) { .staff-detail-grid { grid-template-columns: 1fr 1fr; } }
.staff-dl dt { font-weight: 700; margin-top: 8px; }
.staff-dl dd { margin: 2px 0 0; color: var(--muted); }
.staff-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-sm { font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.inline-form { display: inline; }
.empty-cell { text-align: center; color: var(--muted); padding: 24px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--bg); }

/* Site settings */
.site-form h2 { margin: 20px 0 8px; font-size: 17px; }
.site-form h2:first-child { margin-top: 0; }
.form-hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.site-preview { margin: 16px 0; padding: 12px; background: var(--bg); }
.site-preview h3 { margin: 0 0 8px; font-size: 15px; }
.flash-error { background: rgba(224,36,94,.12); color: var(--danger); }
.site-banner { padding: 10px 16px; text-align: center; font-size: 14px; background: var(--accent-wash); color: var(--accent-hover); border-bottom: 1px solid var(--border); }
.site-banner.tone-warn { background: rgba(255,193,7,.15); color: #856404; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
.sheet-backdrop[hidden], .sheet[hidden] { display: none !important; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: var(--surface); border-radius: 16px 16px 0 0;
  padding: 16px; max-height: 85vh; overflow: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
}
@media (min-width: 768px) {
  .sheet { left: 50%; transform: translateX(-50%); bottom: auto; top: 10vh; width: min(480px, 92vw); border-radius: 16px; }
}
.rank-pill { font-size: 12px; color: var(--accent); background: var(--accent-wash); padding: 2px 8px; border-radius: 999px; }
.rank-pill-lg {
  display: inline-block;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-wash);
  padding: 4px 12px;
  border-radius: 999px;
}
.ace-mark { color: var(--accent); margin-left: 4px; }
.resonance-glow { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); }
.resonance-pill, .chain-pill, .lineage-pill { font-size: 11px; color: var(--accent); margin-left: 4px; }
.cascade-banner { background: var(--accent-wash); padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.chip-grid .choice-pill span { min-width: auto; }
.onboarding-panel { padding: 16px; }
.onboarding-form .form-hint { margin: 0 0 16px; }
.onboarding-form .btn { width: 100%; max-width: 280px; }
.echo-ambient { pointer-events: none; position: fixed; top: 72px; left: 50%; transform: translateX(-50%); width: 120px; height: 120px; border-radius: 50%; opacity: 0; z-index: 50; }
.echo-ambient.pulse { animation: echoPulse 1.2s ease-out; background: radial-gradient(circle, rgba(var(--accent-rgb), .35), transparent 70%); }
@keyframes echoPulse { from { opacity: .8; transform: translateX(-50%) scale(.6); } to { opacity: 0; transform: translateX(-50%) scale(1.4); } }
.post.echo-hit { animation: echoHit .8s ease-out; }
@keyframes echoHit { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); } 100% { box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0); } }
html.accent-blue .brand img,
html.accent-blue .auth-logo,
html.accent-blue .auth-art img,
html.accent-blue .empty img[src*="spade"],
html.accent-blue .notif img[src*="spade"],
html.accent-blue .group-card img[src*="spade"],
html.accent-blue .error-page img[src*="spade"],
html.accent-blue img.avatar[src*="spade"],
.avatar-brand-blue {
  filter: hue-rotate(-122deg) saturate(0.88) brightness(1.03);
}
@media (prefers-reduced-motion: reduce) { .echo-ambient.pulse, .post.echo-hit, .resonance-glow { animation: none !important; } }
.legacy-profile { opacity: .92; }
.legacy-badge, .legacy-note { display: block; margin: 8px 0; padding: 10px; background: var(--bg); border-left: 3px solid var(--accent); }
.passport-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; padding: 16px; }
.stamp { border: 2px dashed var(--border); border-radius: 12px; padding: 16px 8px; text-align: center; min-height: 80px; }
.stamp.earned { border-color: var(--accent); background: var(--accent-wash); }
.archive-magazine .archive-entry { margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.chat-thread { padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 50vh; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 16px; background: var(--bg); align-self: flex-start; }
.chat-bubble.mine { align-self: flex-end; background: var(--accent-wash); }
.chat-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }
.discovery-rail { padding: 12px 16px; }
.section-heading { padding: 12px 16px 8px; margin: 0; font-size: 19px; }
.rail-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.spotlight-banner, .rank-up-banner { background: var(--accent-wash); padding: 12px 16px; text-align: center; }
.interest-label { padding: 8px 16px; color: var(--accent); font-size: 14px; }
.countdown-pill { font-size: 13px; color: var(--accent); }
.ace-checklist { list-style: none; padding: 16px; }
.ace-checklist .ok { color: var(--repost); }
