:root {
  --bg: #000000;
  --text: #e7e9ea;
  --text-muted: #71767b;
  --border: #2f3336;
  --hover: #080808;
  --sidebar-hover: #181818;
  --blue: #1d9bf0;
  --blue-hover: #1a8cd8;
  --danger: #f4212e;
  --sidebar-width: 275px;
  --main-max: 600px;
  --radius: 9999px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

.app-shell {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  max-width: 1280px;
  margin: 0 auto;
}

/* ——— Sidebar ——— */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 4px;
  font-size: 1.25rem;
  font-weight: 800;
  border-radius: var(--radius);
}

.brand:hover {
  background: var(--sidebar-hover);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
}

.brand-mark--coin {
  background: transparent;
  object-fit: contain;
  box-shadow: none;
  border-radius: 50%;
}

.brand-mark--x {
  background: #000;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #2f3336;
  padding: 0;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-user {
  margin-top: auto;
  padding: 12px 4px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  transition: background 0.15s ease;
}

.user-chip:hover {
  background: var(--sidebar-hover);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #333;
}

.user-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.logout-form {
  margin: 0;
}

.text-muted {
  color: var(--text-muted);
}

/* Login */
.login-page {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-steps {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.7;
  color: var(--text);
}

.login-steps code {
  background: var(--sidebar-hover);
  padding: 2px 6px;
  border-radius: 6px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.login-form label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-form input[type="text"] {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  letter-spacing: 0.15em;
  font-size: 1.25rem;
}

.login-form input[type="text"]:focus {
  border-color: var(--blue);
}

.login-hint {
  font-size: 0.9rem;
  margin: 0;
}

/* Profile */
.profile-card {
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  margin-bottom: 8px;
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

.profile-name {
  margin: 0;
  font-size: 1.5rem;
}

/* Linked accounts (settings) */
.accounts-panel {
  border-top: 1px solid var(--border);
  padding: 20px 16px 32px;
}

.settings-section-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.accounts-help {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.accounts-help code,
.account-code code,
.verify-info code {
  background: var(--sidebar-hover);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
}

.account-verify-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.account-verify-form label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.account-verify-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-verify-row input {
  flex: 1;
  min-width: 160px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}

.account-verify-row input:focus {
  border-color: var(--blue);
}

.verify-info {
  color: var(--blue);
  font-size: 0.95rem;
  margin: 8px 0 12px;
  line-height: 1.5;
}

.account-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.account-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-name {
  font-weight: 700;
}

.account-code {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-ok {
  background: rgba(0, 186, 124, 0.15);
  color: #00ba7c;
}

.badge-pending {
  background: rgba(255, 212, 0, 0.12);
  color: #ffd400;
}

.account-empty {
  padding: 12px 0;
}

.badge-pending {
  background: rgba(255, 212, 0, 0.12);
  color: #ffd400;
}

.badge-verified {
  background: rgba(0, 186, 124, 0.15);
  color: #00ba7c;
}

.badge-expired {
  background: rgba(113, 118, 123, 0.25);
  color: #71767b;
}

.badge-not_found {
  background: rgba(244, 33, 46, 0.12);
  color: #f4212e;
}

/* External verification */
.verify-page {
  padding: 20px 16px 40px;
  max-width: 520px;
}

.verify-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.verify-form label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.verify-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  line-height: 1.5;
}

.verify-code-line {
  font-size: 1.25rem;
  margin: 12px 0;
}

.verify-code-line code {
  background: var(--sidebar-hover);
  padding: 8px 12px;
  border-radius: 8px;
}

.status-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.status-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.status-value {
  margin: 8px 0 16px;
  font-size: 1.25rem;
}

.text-ok {
  color: #00ba7c;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 1.25rem;
  font-weight: 400;
  transition: background 0.15s ease;
}

.nav-item:hover {
  background: var(--sidebar-hover);
}

.nav-item.active {
  font-weight: 700;
}

.nav-icon {
  width: 1.5rem;
  text-align: center;
  font-size: 1.25rem;
}

/* ——— Main column ——— */
.main {
  flex: 1;
  max-width: var(--main-max);
  width: 100%;
  border-right: 1px solid var(--border);
  min-height: 100vh;
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  font-size: 1.25rem;
  font-weight: 700;
}

.compose-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-weight: 700;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--blue-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--sidebar-hover);
}

.btn-block {
  width: 100%;
}

.btn-danger {
  color: #f4212e;
  border-color: rgba(244, 33, 46, 0.45);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(244, 33, 46, 0.12);
  color: #f4212e;
}

/* HTMX loading indicator (hidden until request) */
.htmx-indicator {
  display: none;
  opacity: 0;
  transition: opacity 200ms ease;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: block;
  opacity: 1;
}
.htmx-request#verify-check-btn,
button.htmx-request {
  opacity: 0.7;
  cursor: wait;
}

/* Compose panel */
.compose-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding-top: 8px;
}

.compose-panel.open {
  display: flex;
}

.compose-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.compose-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.compose-field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Same look for title + URL fields */
#compose-form .compose-input,
.compose-panel .compose-input,
.compose-input {
  display: block !important;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box !important;
  background: #000 !important;
  color: #e7e9ea !important;
  border: 1px solid #2f3336 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  outline: none !important;
  font: inherit !important;
  line-height: 1.4;
  transition: border-color 0.15s ease;
}

.compose-input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.compose-input:hover {
  border-color: #536471;
}

.compose-input:focus {
  border-color: var(--blue);
  background: #000;
}

.compose-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.35;
}

.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* Feed */
.feed {
  display: flex;
  flex-direction: column;
}

.post-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.post-card--mutual {
  background: linear-gradient(
    135deg,
    rgba(255, 196, 0, 0.12) 0%,
    rgba(255, 160, 0, 0.06) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  border: 1px solid rgba(255, 196, 0, 0.55);
  border-radius: 14px;
  margin: 6px 8px;
  box-shadow: 0 0 0 1px rgba(255, 200, 50, 0.15),
    0 0 24px rgba(255, 180, 0, 0.18);
}

.post-card--mutual .post-title {
  color: #ffd54a;
}

.mutual-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  color: #1a1200;
  background: linear-gradient(90deg, #ffd54a, #ffb300);
  border: 1px solid rgba(255, 200, 80, 0.8);
}

/* One-way follow: A follows B, B does not follow back */
.account-item--one-way {
  border-color: rgba(244, 33, 46, 0.55);
  background: rgba(244, 33, 46, 0.08);
}

.account-item--one-way .account-name {
  color: #f4212e;
}

.badge-one-way {
  background: rgba(244, 33, 46, 0.18);
  color: #f4212e;
}

.badge-mutual-follow {
  background: rgba(0, 186, 124, 0.15);
  color: #00ba7c;
}

.badge-not-following {
  background: rgba(113, 118, 123, 0.2);
  color: var(--text-muted);
}

.follows-section-title {
  margin-top: 28px;
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.follows-legend {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 8px 0 0;
}

.follows-legend strong.one-way {
  color: #f4212e;
}

/* Minimal visit → follow list */
.mutual-simple {
  max-width: 480px;
}

.mutual-hint {
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.mutual-hint .ok-text {
  color: #00ba7c;
  font-weight: 700;
}

.mutual-hint .bad-text {
  color: #f4212e;
  font-weight: 700;
}

.mutual-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mutual-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.mutual-row--ok {
  border-color: rgba(0, 186, 124, 0.45);
  background: rgba(0, 186, 124, 0.08);
}

.mutual-row--ok .mutual-name,
.mutual-row--ok .mutual-status {
  color: #00ba7c;
}

.mutual-row--bad {
  border-color: rgba(244, 33, 46, 0.45);
  background: rgba(244, 33, 46, 0.08);
}

.mutual-row--bad .mutual-name,
.mutual-row--bad .mutual-status {
  color: #f4212e;
}

.mutual-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mutual-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a1a1a;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.mutual-avatar--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(113, 118, 123, 0.35);
  color: #e7e9ea;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.mutual-row--ok .mutual-avatar {
  border-color: rgba(0, 186, 124, 0.55);
}

.mutual-row--bad .mutual-avatar {
  border-color: rgba(244, 33, 46, 0.55);
}

.mutual-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mutual-name {
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mutual-x {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mutual-row--ok .mutual-x {
  color: #00ba7c;
}

.mutual-row--bad .mutual-x {
  color: #f4212e;
}

.mutual-status {
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.post-card:hover {
  background: var(--hover);
}

.post-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-author {
  color: var(--text);
  font-weight: 700;
}

.post-ttl {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-avatar,
.post-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
  object-fit: cover;
}

.post-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.post-body {
  flex: 1;
  min-width: 0;
}

.post-link {
  color: var(--blue);
  word-break: break-all;
  font-size: 1.05rem;
}

.post-link:hover {
  text-decoration: underline;
}

.post-host {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-title {
  margin: 6px 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.post-like-hint {
  margin: 8px 0 0;
  font-size: 0.85rem;
  line-height: 1.35;
}

.compose-login-gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compose-login-gate p {
  margin: 0;
}

.empty-feed {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}

/* Stub tabs */
.stub {
  padding: 48px 24px;
  text-align: center;
}

.stub h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.stub p {
  margin: 0;
  color: var(--text-muted);
}

/* Right spacer for X-like balance on wide screens */
.right-rail {
  width: 350px;
  display: none;
}

@media (min-width: 1100px) {
  .right-rail {
    display: block;
    border-left: 1px solid transparent;
    padding: 12px;
  }
}

.right-ad {
  position: sticky;
  top: 16px;
  margin-top: 8px;
  padding: 16px 18px;
  border: 1px dashed #38444d;
  border-radius: 16px;
  background: rgba(29, 155, 240, 0.06);
}

.right-ad-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.right-ad-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
  font-weight: 600;
}

.right-ad-handle {
  color: var(--blue);
  font-weight: 800;
}

.right-ad-handle:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .sidebar {
    width: 72px;
    padding: 4px;
  }

  .brand span,
  .nav-item span.label,
  .user-meta,
  .logout-form,
  .sidebar-user .btn-primary span {
    display: none;
  }

  .sidebar-user .btn-primary {
    padding: 10px;
    font-size: 0;
  }

  .sidebar-user .btn-primary::after {
    content: "TG";
    font-size: 0.75rem;
  }

  .user-chip {
    justify-content: center;
    padding: 8px;
  }

  .nav-item {
    justify-content: center;
    padding: 12px;
  }

  .main {
    border-right: none;
  }
}

/* ��� Global realtime chat ��� */
.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
}

.chat-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.chat-online {
  font-size: 0.85rem;
  font-weight: 500;
}

.chat-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 0 12px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 92%;
}

.chat-msg--mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
}

.chat-avatar--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #e7e9ea;
  background: #333;
}

.chat-bubble {
  background: #16181c;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 0;
}

.chat-msg--mine .chat-bubble {
  background: rgba(29, 155, 240, 0.12);
  border-color: rgba(29, 155, 240, 0.35);
}

.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-author {
  font-weight: 700;
  font-size: 0.9rem;
}

.chat-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-body {
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-compose {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.chat-input {
  flex: 1;
  background: #16181c;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 10px 16px;
  outline: none;
}

.chat-input:focus {
  border-color: var(--blue);
}

.chat-send {
  border-radius: 999px;
  padding: 0 16px;
  white-space: nowrap;
}

.chat-status {
  margin: 6px 16px 0;
  font-size: 0.8rem;
}

.chat-status--ok {
  color: #00ba7c;
}

.chat-status--bad {
  color: #f4212e;
}

.chat-error {
  margin: 4px 16px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f4212e;
}

/* ��� Help / Reddit-style discussions ��� */
.help-page {
  padding: 12px 16px 32px;
  max-width: 640px;
}

.help-intro {
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.help-create {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}

.help-create-summary {
  display: block;
  width: 100%;
  text-align: center;
  list-style: none;
  cursor: pointer;
  border-radius: 0;
  border: none;
}

.help-create-summary::-webkit-details-marker {
  display: none;
}

.help-create[open] .help-create-summary {
  border-bottom: 1px solid var(--border);
}

.help-create-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
}

.help-create-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.help-textarea {
  resize: vertical;
  min-height: 80px;
  border-radius: 12px !important;
  line-height: 1.4;
  font-family: inherit;
}

.help-thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-thread-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.help-thread-card:hover {
  border-color: #536471;
  background: var(--hover);
}

.help-thread-link {
  display: block;
  padding: 14px 16px;
}

.help-thread-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.help-thread-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.help-thread-preview {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.help-mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.help-mini-avatar--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: #333;
  color: #e7e9ea;
  width: 28px;
  height: 28px;
}

.help-op {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  background: #0a0a0a;
}

.help-op-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
}

.help-op-body {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.help-author {
  font-weight: 700;
  color: var(--text);
}

.help-comments-heading {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.help-comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.help-comment-form--reply {
  margin: 8px 0 0;
}

.help-comment-list,
.help-replies {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-comment {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #080808;
}

.help-comment--reply {
  background: transparent;
  border-left: 2px solid #38444d;
  border-radius: 0 10px 10px 0;
  margin-top: 4px;
}

.help-replies {
  margin-top: 10px;
  margin-left: 12px;
  padding-left: 8px;
  gap: 8px;
}

.help-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.help-comment-time {
  font-size: 0.78rem;
  margin-left: 6px;
}

.help-comment-body {
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.help-reply {
  margin-top: 8px;
}

.help-reply > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
}

.help-reply > summary:hover {
  color: var(--blue);
}

.help-reply > summary::-webkit-details-marker {
  display: none;
}

.help-thread-title-row,
.help-op-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.help-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.help-badge--resolved {
  background: rgba(0, 186, 124, 0.18);
  color: #00ba7c;
  border: 1px solid rgba(0, 186, 124, 0.4);
}

.help-thread-card--resolved {
  opacity: 0.88;
}

.help-op--resolved {
  border-color: rgba(0, 186, 124, 0.4);
  background: rgba(0, 186, 124, 0.05);
}

.help-owner-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.help-resolve-btn {
  background: #00ba7c !important;
  border-color: #00ba7c !important;
}

.help-resolve-btn:hover {
  filter: brightness(1.08);
}

.help-closed-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 186, 124, 0.1);
  border: 1px solid rgba(0, 186, 124, 0.3);
  color: #00ba7c;
  font-size: 0.9rem;
  font-weight: 600;
}

.help-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.help-search-input {
  flex: 1;
  min-width: 160px;
}

.help-search-meta {
  margin: -4px 0 14px;
  font-size: 0.88rem;
}

/* ��� Articles ��� */
.articles-page {
  padding: 12px 16px 32px;
  max-width: 640px;
}

.articles-intro {
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.article-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-card {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #0a0a0a;
  transition: border-color 0.12s ease;
}

.article-card:hover {
  border-color: #536471;
}

.article-card-media {
  flex: 0 0 140px;
  width: 140px;
  min-height: 110px;
  background: #16181c;
  display: block;
  align-self: stretch;
}

.article-thumb {
  width: 100%;
  height: 100%;
  min-height: 110px;
  object-fit: cover;
  display: block;
}

.article-thumb-fallback {
  width: 100%;
  min-height: 110px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(145deg, #1a1d21, #0d0f12);
  color: var(--text-muted);
}

.article-card-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.article-title {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}

.article-title:hover {
  color: var(--blue);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-site {
  color: var(--blue);
}

.article-url {
  font-size: 0.82rem !important;
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-delete {
  margin-top: 4px;
}

@media (max-width: 520px) {
  .article-card {
    flex-direction: column;
  }
  .article-card-media {
    flex: none;
    width: 100%;
    min-height: 160px;
  }
  .article-thumb,
  .article-thumb-fallback {
    min-height: 160px;
  }
}

/* Chat rooms tabs */
.chat-rooms {
  display: flex;
  gap: 6px;
  padding: 8px 16px 0;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.chat-room-tab {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.chat-room-tab:hover {
  background: var(--hover);
  color: var(--text);
}

.chat-room-tab.active {
  color: #fff;
  background: rgba(29, 155, 240, 0.2);
  border-color: rgba(29, 155, 240, 0.45);
}

.chat-room-hint {
  margin: 8px 16px 0;
  font-size: 0.82rem;
}

/* Admin */
.admin-page { max-width: 720px; }
.admin-flash {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 12px;
}
.admin-flash--ok {
  background: rgba(0, 186, 124, 0.12);
  color: #00ba7c;
  border: 1px solid rgba(0, 186, 124, 0.35);
}
.admin-flash--bad {
  background: rgba(244, 33, 46, 0.1);
  color: #f4212e;
  border: 1px solid rgba(244, 33, 46, 0.35);
}
.admin-user-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-user-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0a0a0a;
}
.admin-user-card--banned {
  border-color: rgba(244, 33, 46, 0.45);
  background: rgba(244, 33, 46, 0.06);
}
.admin-user-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.admin-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.admin-avatar--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #333;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}
.admin-user-name {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-user-meta {
  font-size: 0.82rem;
  margin-top: 2px;
}
.admin-ban-reason {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #f4212e;
}
.admin-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.admin-badge--ban {
  background: rgba(244, 33, 46, 0.18);
  color: #f4212e;
}
.admin-ban-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-reason {
  width: 160px;
  min-width: 120px;
  padding: 6px 10px !important;
  font-size: 0.85rem !important;
}
.admin-user-actions {
  flex-shrink: 0;
}
