/* ============================================================
   Verdiqts — Core Design Tokens & Foundation
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-base:        #0C0C0E;
  --bg-surface:     #141416;
  --bg-raised:      #1C1C1F;
  --bg-overlay:     #242428;

  /* Borders */
  --border-subtle:  #27272A;
  --border-default: #3F3F46;
  --border-strong:  #52525B;

  /* Text */
  --text-primary:   #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted:     #71717A;
  --text-disabled:  #52525B;

  /* Brand — Amber */
  --brand:          #F59E0B;
  --brand-hover:    #FBBF24;
  --brand-subtle:   #1C1500;
  --brand-text:     #FDE68A;

  /* Agree — Green */
  --agree:          #22C55E;
  --agree-hover:    #4ADE80;
  --agree-bg:       #052E16;
  --agree-text:     #BBF7D0;

  /* Disagree — Red */
  --disagree:       #EF4444;
  --disagree-hover: #F87171;
  --disagree-bg:    #2D0707;
  --disagree-text:  #FECACA;

  --neutral:        #71717A;

  --font-body:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-full:    9999px;

  --shadow-card:    0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-pop:     0 12px 32px rgba(0,0,0,0.5);
  --transition:     150ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-base:        #F4F4F5;
  --bg-surface:     #FFFFFF;
  --bg-raised:      #F9F9FA;
  --bg-overlay:     #FFFFFF;
  --border-subtle:  #E4E4E7;
  --border-default: #D4D4D8;
  --border-strong:  #A1A1AA;
  --text-primary:   #09090B;
  --text-secondary: #52525B;
  --text-muted:     #71717A;
  --text-disabled:  #A1A1AA;
  --brand-subtle:   #FFFBEB;
  --brand-text:     #92400E;
  --agree-bg:       #F0FDF4;
  --agree-text:     #166534;
  --disagree-bg:    #FFF1F2;
  --disagree-text:  #9F1239;
  --shadow-card:    0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
}

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

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

/* Kill iOS tap highlight on interactive elements */
a, button, input, select, textarea, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-hover); }

img, svg { display: block; max-width: 100%; }

button { font-family: inherit; cursor: pointer; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection { background: var(--brand); color: var(--bg-base); }

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em 0; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em 0; }

/* ============================================================
   Layout
   ============================================================ */
.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
}

.container { max-width: 720px; margin: 0 auto; }

.layout-feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 960px) {
  .layout-feed {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .layout-feed > * { min-width: 0; }
  .layout-feed .sidebar { display: none; }
}

/* ============================================================
   Top Navigation
   ============================================================ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 12, 14, 0.78);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow 200ms ease, border-color 200ms ease;
}

[data-theme="light"] .topnav {
  background: rgba(255, 255, 255, 0.82);
}

.topnav__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
}

.topnav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: opacity var(--transition);
}
.topnav__brand:hover { color: var(--text-primary); opacity: 0.85; }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand);
  color: #0C0C0E;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

/* Generic icon button used for bell and search */
.topnav__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  cursor: pointer;
  position: relative;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.topnav__icon-btn:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}
.topnav__icon-btn:active { transform: scale(0.92); }

/* Search icon — only on mobile (desktop has the search input instead) */
.topnav__icon-btn--search { display: none; }

.topnav__search {
  flex: 1;
  max-width: 480px;
}

.topnav__search input {
  width: 100%;
  padding: 9px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.topnav__search input:focus { border-color: var(--brand); background: var(--bg-raised); }
.topnav__search input::placeholder { color: var(--text-muted); }

.topnav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.topnav__bell {
  display: grid;
  place-items: center;
}
.topnav__bell-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--brand);
  color: #0C0C0E;
  font-size: 10px;
  font-weight: 800;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-base);
}

.topnav__user { position: relative; }
.topnav__avatar {
  background: none;
  border: 0;
  padding: 0;
  border-radius: var(--radius-full);
  overflow: hidden;
  width: 36px;
  height: 36px;
}
.topnav__avatar img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  display: none;
  z-index: 60;
}
.dropdown[data-open="true"] { display: block; }
.dropdown a, .dropdown__signout {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-weight: 500;
}
.dropdown a:hover, .dropdown__signout:hover { background: var(--bg-raised); }
.dropdown__header { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
.dropdown__name { font-weight: 700; color: var(--text-primary); }
.dropdown__handle { color: var(--text-muted); font-size: 13px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn--primary {
  background: var(--brand);
  color: #0C0C0E;
}
.btn--primary:hover { background: var(--brand-hover); color: #0C0C0E; transform: translateY(-1px); }
.btn--secondary {
  background: var(--bg-raised);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn--secondary:hover { background: var(--bg-overlay); }
.btn--ghost {
  background: transparent;
  color: var(--text-primary);
}
.btn--ghost:hover { background: var(--bg-raised); }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--lg { padding: 14px 24px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--danger {
  background: var(--disagree);
  color: #fff;
}

/* ============================================================
   Cards & Forms
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.card--sm { padding: 16px; }
.card--lg { padding: 32px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
}
.field textarea { resize: vertical; min-height: 120px; font-family: inherit; }
.field__hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.field__hint--error { color: var(--disagree); }
.field__row { display: flex; gap: 12px; }
.field__row > * { flex: 1; }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--text-secondary);
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ============================================================
   Auth Pages
   ============================================================ */
.auth-page {
  min-height: calc(100vh - 200px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card);
}
.auth-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  text-align: center;
}
.auth-card__brand .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  font-size: 32px;
}
.auth-card h1 {
  font-size: 24px;
  margin: 0;
  letter-spacing: -0.02em;
}
.auth-card__sub {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}
.auth-card__footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-card__footer a { font-weight: 600; }
.auth-card__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 18px 0;
}
.auth-card__divider::before,
.auth-card__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}
.auth-card__magic {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}
.auth-card__magic summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  text-align: center;
  padding: 6px 0;
}
.auth-card__magic summary::-webkit-details-marker { display: none; }
.auth-card__magic summary:hover { color: var(--brand); }
.auth-card__magic[open] summary { color: var(--text-primary); margin-bottom: 8px; }

.founding-banner {
  background: linear-gradient(135deg, var(--brand-subtle), var(--bg-overlay));
  border: 1px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--brand-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   Flash Messages
   ============================================================ */
.flash-stack {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(440px, calc(100vw - 40px));
}
.flash {
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-pop);
  pointer-events: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  animation: flashIn 200ms ease;
}
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash__close {
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.flash--success { border-color: var(--agree); background: var(--agree-bg); color: var(--agree-text); }
.flash--error   { border-color: var(--disagree); background: var(--disagree-bg); color: var(--disagree-text); }
.flash--info    { border-color: var(--brand); background: var(--brand-subtle); color: var(--brand-text); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  padding: 32px 20px;
  margin-top: 60px;
  background: var(--bg-surface);
}
.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-primary);
}
.site-footer__links {
  display: flex;
  gap: 24px;
}
.site-footer__links a {
  color: var(--text-secondary);
  font-size: 14px;
}
.site-footer__links a:hover { color: var(--brand); }
.site-footer__copy {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}
.site-footer__copy span { display: inline-block; margin-left: 6px; opacity: 0.6; }

@media (max-width: 700px) {
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .site-footer__copy { margin-left: 0; }
}

/* ============================================================
   Mobile Navigation
   ============================================================ */
.mobilenav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
  justify-content: space-around;
}
.mobilenav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
}
.mobilenav a:hover, .mobilenav a:active { color: var(--brand); }
.mobilenav__post {
  background: var(--brand) !important;
  color: #0C0C0E !important;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  margin-top: -16px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}
.mobilenav__post svg { stroke: #0C0C0E !important; }
.mobilenav__post span { display: none; }

@media (max-width: 700px) {
  .mobilenav { display: flex; }
  .main { padding-bottom: 100px; }
  .topnav__search { display: none; }
}

/* ============================================================
   Utility
   ============================================================ */
.u-text-muted { color: var(--text-muted); }
.u-text-secondary { color: var(--text-secondary); }
.u-text-center { text-align: center; }
.u-mt-0 { margin-top: 0; }
.u-mt-1 { margin-top: 8px; }
.u-mt-2 { margin-top: 16px; }
.u-mt-3 { margin-top: 24px; }
.u-mt-4 { margin-top: 32px; }
.u-mb-0 { margin-bottom: 0; }
.u-mb-1 { margin-bottom: 8px; }
.u-mb-2 { margin-bottom: 16px; }
.u-mb-3 { margin-bottom: 24px; }
.u-mb-4 { margin-bottom: 32px; }
.u-flex { display: flex; }
.u-gap-1 { gap: 8px; }
.u-gap-2 { gap: 16px; }
.u-gap-3 { gap: 24px; }
.u-items-center { align-items: center; }
.u-justify-between { justify-content: space-between; }
.u-w-full { width: 100%; }
.u-hidden { display: none !important; }

/* Search advanced filters */
.search-filters {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 12px;
}
.search-filters summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  list-style: none;
}
.search-filters summary::-webkit-details-marker { display: none; }
.search-filters summary:hover { color: var(--brand); }
.search-filters[open] summary { color: var(--text-primary); margin-bottom: 12px; }
.search-filters__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 600px) {
  .search-filters__grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Empty States — with inline SVG illustrations
   ============================================================ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty__icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-raised);
  margin-bottom: 16px;
  color: var(--text-secondary);
}
.empty__art {
  display: block;
  margin: 0 auto 20px;
  width: 180px;
  height: 140px;
  color: var(--brand);
  opacity: 0.85;
}
.empty h2 { color: var(--text-primary); margin-bottom: 8px; }
.empty p { max-width: 360px; margin: 0 auto; }

/* ============================================================
   Error pages
   ============================================================ */
.error-page {
  min-height: calc(100vh - 250px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 60px 20px;
}
.error-page__code {
  font-size: 96px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  letter-spacing: -0.04em;
}
.error-page h1 { margin: 16px 0 8px 0; font-size: 28px; }
.error-page p { color: var(--text-secondary); margin-bottom: 24px; max-width: 440px; }

/* ============================================================
   Modals
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-backdrop[data-open="true"] { display: flex; }
.modal {
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-pop);
  animation: modalIn 200ms ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h2 { margin-top: 0; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ============================================================
   Onboarding flow
   ============================================================ */
.onboarding {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  position: relative;
}
.onboarding__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.onboarding__brand .brand-mark { width: 44px; height: 44px; font-size: 24px; }
.onboarding__wordmark { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.onboarding__progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
}
.onboarding__dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-subtle);
  transition: background 200ms ease;
}
.onboarding__dot.is-active { background: var(--brand); }

.onboarding__step { display: none; animation: stepIn 280ms ease; }
.onboarding__step.is-active { display: block; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.onboarding__step h1 {
  font-size: 30px;
  text-align: center;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.onboarding__sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  margin: 0 0 32px;
}

.onboarding__hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 32px;
}
.onboarding-pill {
  padding: 12px 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.onboarding-pill:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}
.onboarding-pill.is-picked {
  background: var(--brand);
  color: #0C0C0E;
  border-color: var(--brand);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.onboarding__counter {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}
.onboarding__counter span { color: var(--brand); font-weight: 800; }

.onboarding__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.onboarding__actions .btn--lg { padding: 14px 32px; font-size: 16px; }

.onboarding__users {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.onboarding-user {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}
.onboarding-user:hover {
  border-color: var(--border-default);
  transform: translateY(-1px);
}
.onboarding-user.is-picked {
  border-color: var(--brand);
  background: var(--brand-subtle);
}
.onboarding-user img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.onboarding-user__main { flex: 1; min-width: 0; }
.onboarding-user__name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.onboarding-user__handle {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.onboarding-user__bio {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.onboarding-user__follow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.onboarding__final {
  text-align: center;
  padding: 32px;
  margin-top: 24px;
}

.onboarding__skip {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: 0;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md);
}
.onboarding__skip:hover { background: var(--bg-raised); color: var(--text-primary); }

@media (max-width: 700px) {
  .onboarding { padding: 24px 14px 100px; }
  .onboarding__step h1 { font-size: 24px; }
  .onboarding__sub { font-size: 14px; margin-bottom: 24px; }
  .onboarding-pill { padding: 10px 18px; font-size: 14px; }
  .onboarding__users { grid-template-columns: 1fr; }
  .onboarding__skip { top: 12px; right: 12px; }
  .onboarding__brand .brand-mark { width: 36px; height: 36px; font-size: 20px; }
  .onboarding__wordmark { font-size: 18px; }
}

/* ============================================================
   Mobile Responsive — Comprehensive Overrides
   Breakpoints: 700px (tablet→phone), 480px (small phones)
   ============================================================ */
@media (max-width: 700px) {
  /* Page container */
  .main { padding: 16px 14px 100px 14px; }
  .container { padding: 0; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  /* ============================================================
     Topnav — modern mobile layout
     ============================================================ */
  .topnav {
    background: rgba(12, 12, 14, 0.92);
    border-bottom-color: transparent;
  }
  .topnav.is-scrolled {
    box-shadow: 0 6px 20px -10px rgba(0,0,0,0.6);
    border-bottom-color: var(--border-subtle);
  }
  .topnav__inner {
    padding: 10px 14px;
    gap: 8px;
    min-height: 56px;
  }

  /* Brand: keep mark + text but tighter */
  .topnav__brand {
    gap: 9px;
    flex-shrink: 0;
  }
  .topnav__brand .brand-text {
    display: inline;
    font-size: 17px;
    letter-spacing: -0.025em;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 17px;
    border-radius: 8px;
  }

  /* Hide the desktop search input on mobile */
  .topnav__search { display: none; }

  /* Show the search icon only on mobile */
  .topnav__icon-btn--search { display: inline-flex; }

  /* Actions: tight horizontal stack pushed right */
  .topnav__actions {
    gap: 4px;
    margin-left: auto;
  }
  .topnav__icon-btn {
    width: 42px;
    height: 42px;
  }
  .topnav__icon-btn svg { width: 19px; height: 19px; }

  /* Hide the redundant Post Take button on mobile — bottom nav has it */
  .topnav__post { display: none; }

  /* Sign in / Join: pill-shaped, compact */
  .topnav__actions .btn--ghost {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-full);
  }
  .topnav__actions .btn--primary {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  }

  /* Avatar: subtle ring */
  .topnav__avatar {
    width: 36px;
    height: 36px;
    margin-left: 4px;
    border: 2px solid var(--border-subtle);
    transition: border-color var(--transition);
  }
  .topnav__avatar:hover { border-color: var(--brand); }
  .topnav__avatar img {
    width: 32px;
    height: 32px;
  }

  /* Dropdowns */
  .dropdown {
    min-width: 220px;
    right: 0;
    margin-top: 2px;
  }

  /* Take card */
  .take-card { padding: 16px; }
  .take-card__head {
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-bottom: 12px;
    font-size: 12px;
  }
  .take-card__head .user-mini img { width: 26px; height: 26px; }
  .take-card.is-hot::before { top: 12px; right: 14px; font-size: 14px; }
  .take-card__body {
    font-size: 16px;
    line-height: 1.45;
    margin-bottom: 14px;
  }
  .take-card__tags { margin: -6px 0 14px; gap: 5px; }
  .vote-stats { font-size: 11px; flex-wrap: wrap; gap: 6px 10px; }
  /* Actions row wraps so icons drop to a second line when the card is narrow */
  .take-card__actions {
    gap: 6px;
    flex-wrap: wrap;
  }
  .vote-btn {
    padding: 11px 10px;
    font-size: 12px;
    letter-spacing: 0.02em;
    min-height: 44px;
    flex: 1 1 calc(50% - 4px);
  }
  .take-card__actions .icon-btn,
  .take-card__actions form {
    flex: 0 0 auto;
  }
  .icon-btn { padding: 8px 10px; min-width: 44px; min-height: 44px; justify-content: center; }

  /* Take detail */
  .take-detail { padding: 18px; margin-bottom: 18px; }
  .take-detail__body {
    font-size: 21px;
    line-height: 1.35;
    margin: 14px 0 18px;
  }
  .take-detail .vote-bar { height: 10px; }
  .take-detail .vote-stats { font-size: 13px; }
  .take-detail .vote-stats__agree strong,
  .take-detail .vote-stats__disagree strong { display: inline; }

  /* Comments */
  .comment-thread { margin-top: 24px; }
  .comment { padding: 14px; }
  .comment--reply {
    margin-left: 14px;
    padding-left: 12px;
  }
  .comment-form { padding: 14px; }
  .comment-form textarea { font-size: 16px; padding: 10px 12px; min-height: 70px; }

  /* Submit form */
  .submit-form { padding: 18px; }
  .submit-form textarea {
    padding: 14px;
    font-size: 17px;
    min-height: 110px;
  }
  .submit-form__row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .submit-form__row .btn { width: 100%; order: 3; }
  .submit-form__row .char-count { order: 2; margin-left: auto; }

  /* Tag input */
  .tag-input-wrap { margin-top: 14px; }
  .tag-input-shell {
    padding: 9px 10px;
    min-height: 44px;
  }
  .tag-input-shell input {
    font-size: 16px; /* prevents iOS zoom */
    min-width: 120px;
  }
  .tag-pill {
    padding: 5px 6px 5px 11px;
    font-size: 12px;
  }
  .tag-pill button {
    width: 22px;
    height: 22px;
    font-size: 15px;
  }
  .tag-suggestion {
    padding: 12px;
    min-height: 44px;
  }

  /* Feed tabs */
  .feed-tabs { gap: 0; }
  .feed-tabs a { padding: 12px 12px; font-size: 13px; }

  /* Hashtag page header */
  .layout-feed > div > .card { padding: 16px; }

  /* Auth pages */
  .auth-page { padding: 24px 14px; min-height: calc(100vh - 160px); }
  .auth-card { padding: 24px 20px; }
  .auth-card__brand { gap: 12px; margin-bottom: 22px; }
  .auth-card__brand .brand-mark { width: 48px; height: 48px; font-size: 26px; }
  .auth-card h1 { font-size: 22px; }

  /* Forms */
  .field input,
  .field textarea,
  .field select {
    font-size: 16px; /* iOS no-zoom */
    padding: 12px 14px;
  }
  .field__row { flex-direction: column; gap: 0; }

  /* Profile header */
  .profile-header { padding: 18px; }
  .profile-header__top { gap: 14px; }
  .profile-header__avatar {
    width: 72px;
    height: 72px;
    border-width: 2px;
  }
  .profile-header h1 { font-size: 20px; }
  .profile-header__bio { font-size: 13px; }
  .profile-header__actions { width: 100%; margin-left: 0; margin-top: 4px; }
  .profile-header__actions .btn { width: 100%; }
  .profile-stats__num { font-size: 18px; }
  .profile-stats__label { font-size: 10px; }
  .profile-tabs a { padding: 12px 14px; font-size: 13px; }

  /* Settings */
  .settings-section.card { padding: 18px; }
  .settings-section h2 { font-size: 18px; }
  .settings-nav { gap: 6px; flex-wrap: wrap; }
  .settings-nav a { padding: 8px 12px; font-size: 13px; }

  /* Leaderboard */
  .leaderboard__row { padding: 12px 14px; gap: 12px; }
  .leaderboard__rank { font-size: 18px; min-width: 28px; }
  .leaderboard__row img { width: 36px; height: 36px; }
  .leaderboard__name { font-size: 13px; }
  .leaderboard__sub { font-size: 11px; }
  .leaderboard__score { font-size: 14px; }

  /* Battle Arena */
  .battle { padding: 16px; gap: 12px; }
  .battle__side { padding: 14px; }
  .battle__pct { font-size: 24px; }
  .battle__body { font-size: 14px; margin: 10px 0; }

  /* Cards & sidecards */
  .card { padding: 18px; }
  .card--lg { padding: 22px; }
  .side-card { padding: 14px; }

  /* Footer — extra bottom padding so content clears the fixed mobilenav */
  .site-footer {
    padding: 24px 14px calc(24px + 72px + env(safe-area-inset-bottom)) 14px;
    margin-top: 40px;
  }
  .site-footer__inner { gap: 16px; }
  .site-footer__links { gap: 16px; flex-wrap: wrap; }

  /* Modals */
  .modal-backdrop { padding: 14px; align-items: flex-end; }
  .modal {
    padding: 22px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-width: 100%;
    margin-bottom: 0;
  }
  .modal__actions { flex-direction: column-reverse; gap: 8px; }
  .modal__actions .btn { width: 100%; justify-content: center; }

  /* Notification panel */
  .notif-panel {
    top: 64px;
    right: 14px;
    left: 14px;
    width: auto;
    max-width: none;
  }

  /* Flash stack — sit just below topnav, not floating center */
  .flash-stack {
    top: 72px;
    width: calc(100vw - 28px);
  }
  .flash { padding: 12px 14px; font-size: 13px; }

  /* Topic / hashtag pills horizontal scroller — keep within parent padding (no breakout) */
  .topic-pills { padding: 4px 0 12px 0; margin: 0 0 14px 0; }
  .topic-pills-wrap { min-width: 0; max-width: 100%; }

  /* Admin tables — self-scroll horizontally without needing a wrapper div */
  .admin-table {
    display: block;
    width: calc(100% + 28px);
    margin-left: -14px;
    margin-right: -14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .admin-table > thead,
  .admin-table > tbody {
    display: table;
    width: 100%;
    min-width: 720px;
    table-layout: auto;
  }
  .admin-table th, .admin-table td { padding: 10px 12px; font-size: 12px; }
  .admin-actions { gap: 4px; flex-wrap: wrap; }
  .admin-actions .btn { padding: 6px 10px; font-size: 11px; }
  .admin-page-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .admin-page-head h1 { font-size: 20px; }
  .admin-main { padding: 16px 14px; }
  .stat-card { padding: 16px; }
  .stat-card__num { font-size: 26px; }

  /* Comment vote buttons need bigger touch targets */
  .comment__vote, .comment__reply-link {
    padding: 8px 10px;
    min-height: 36px;
  }

  /* Hashtag pills tap target */
  .hashtag-pill {
    padding: 5px 12px;
    min-height: 28px;
    line-height: 18px;
  }

  /* Disable hover-only transforms that look weird on touch */
  .topic-pills a:hover,
  .hashtag-pill:hover,
  .vote-btn:hover { transform: none !important; }
}

@media (max-width: 480px) {
  /* Tighter still on small phones */
  .main { padding: 12px 12px 100px 12px; }
  h1 { font-size: 1.35rem; }

  .topnav__inner { padding: 8px 12px; gap: 8px; }
  .topnav__actions { gap: 6px; }
  .topnav__avatar { width: 32px; height: 32px; }
  .topnav__avatar img { width: 32px; height: 32px; }
  .topnav__bell { width: 32px; height: 32px; }
  .topnav__bell svg { width: 18px; height: 18px; }

  .take-card { padding: 14px; }
  .take-card__body { font-size: 15px; }

  .take-detail { padding: 16px; }
  .take-detail__body { font-size: 19px; }

  .submit-form { padding: 14px; }
  .submit-form textarea { padding: 12px; font-size: 16px; min-height: 100px; }

  .auth-card { padding: 22px 18px; }
  .auth-card h1 { font-size: 20px; }

  .profile-header { padding: 14px; }
  .profile-header__avatar { width: 64px; height: 64px; }
  .profile-stats { gap: 10px; padding-top: 14px; }
  .profile-stats__num { font-size: 16px; }

  /* Take card actions: stack vote buttons over icon buttons cleanly */
  .take-card__actions {
    flex-wrap: wrap;
  }
  .vote-btn { flex: 1 1 calc(50% - 4px); }
  .take-card__actions .icon-btn { flex: 0 0 auto; }

  /* Mobile nav slightly tighter */
  .mobilenav a { padding: 6px 8px; }

  /* Cards even tighter */
  .card { padding: 14px; }
  .side-card { padding: 12px; }
}

/* Larger touch targets for any interactive element on coarse pointer devices */
@media (hover: none) and (pointer: coarse) {
  .vote-btn, .btn, .icon-btn, .topnav__bell, .topnav__avatar,
  .feed-tabs a, .profile-tabs a, .dropdown a, .dropdown__signout {
    min-height: 44px;
  }
  .hashtag-pill {
    padding: 6px 14px;
  }
}
