/* ── Variables ── */
:root {
  --bg-primary: #1a1a1a;
  --bg-surface: #212121;
  --bg-elevated: #282828;
  --bg-input: #1d1d1d;
  --border: rgba(255,255,255,0.06);
  --border-mid: rgba(255,255,255,0.10);
  --accent: #d93348;
  --accent-sub: rgba(217,51,72,0.12);
  --text-primary: #f0f0f6;
  --text-secondary: #9898b4;
  --text-muted: #72728a;
  --green: #34c77b;
  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.5), 0 8px 32px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* iOS: remove gray tap flash; desktop: no effect */
* { -webkit-tap-highlight-color: transparent; }
html {
  font-size: 16px; scroll-behavior: smooth;
  /* Prevent iOS from adjusting font sizes after orientation change */
  -webkit-text-size-adjustment: 100%;
  /* iOS Safari treats html as the true scroll root — overflow-x must be set here,
     not just on body, to actually prevent horizontal layout shift on input focus. */
  overflow-x: hidden;
  max-width: 100%;
}
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100%;
  position: relative; /* contain absolutely-positioned children (hamburger menu, etc.) */
  display: flex;
  flex-direction: column;
}
/* ── Loading bar ─────────────────────────────────────────────────── */
#page-loading-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.25s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
#page-loading-bar.loading {
  opacity: 1;
  width: 65%;
}
#page-loading-bar.done {
  width: 100%;
  opacity: 0;
  transition: width 0.1s ease, opacity 0.4s ease 0.1s;
}

/* Kill double-tap zoom delay on interactive elements */
button, a, label, [role="button"] { touch-action: manipulation; }
/* iOS Safari: font-size < 16px on any focused input triggers viewport auto-zoom.
   Set 16px globally so no input ever causes the page to shift. */
input, select, textarea { font-size: 16px; }
a { color: var(--text-primary); text-decoration: none; }
a:hover { color: var(--text-primary); }
code { font-family: 'SF Mono', 'Fira Code', Consolas, monospace; font-size: 0.875em; }

/* ── Navbar ── */
.navbar {
  background: rgba(7,7,14,0.92);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* Safe area: push content below Dynamic Island / notch */
  padding-top: env(safe-area-inset-top);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto;
  padding: 0 1.5rem;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary); text-decoration: none;
  letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; align-items: center; gap: 0.5rem;
}
.nav-logo:hover { color: var(--text-primary); text-decoration: none; }
.logo-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 0.1rem; }

/* ── Hamburger (hidden on desktop, shown on mobile) ── */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-secondary); border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
/* Hamburger → X animation when open */
.nav-mobile-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-mobile-open .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-mobile-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-link {
  color: var(--text-secondary); padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm); font-size: 0.875rem;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--text-primary); text-decoration: none; }
.btn-link { background: none; border: none; cursor: pointer; font-size: 0.875rem; font-family: var(--font); }
.nav-alert {
  background: var(--accent); color: #fff;
  padding: 0.2rem 0.65rem; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  letter-spacing: 0.02em;
}

/* ── Flash messages ── */
.flash-container { position: fixed; top: 60px; right: 1.25rem; z-index: 200; display: flex; flex-direction: column; gap: 0.4rem; }
.flash {
  padding: 0.7rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; max-width: 340px;
  border-left: 3px solid transparent;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  animation: slideIn 0.18s ease;
}
@keyframes slideIn { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.flash-success { border-left-color: var(--green); color: var(--text-primary); }
.flash-error { border-left-color: var(--accent); color: var(--text-primary); }
.flash-info { border-left-color: var(--border-mid); color: var(--text-secondary); }
.flash-warning { border-left-color: #d4a017; color: var(--text-primary); }

/* ── Main layout ── */
.main-content {
  flex: 1; /* Push footer to bottom of viewport on short pages */
  max-width: 1120px; margin: 0 auto; width: 100%;
  padding: 2.5rem 1.5rem;
  /* Home indicator clearance */
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
}

/* ── Buttons ── */
.btn-primary {
  background: var(--accent); color: #fff;
  border: none; padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
  display: inline-block; text-decoration: none;
  letter-spacing: 0.01em;
}
.btn-primary:hover { opacity: 0.88; text-decoration: none; color: #fff; }
.btn-primary-small { background: var(--accent); color: #fff; padding: 0.3rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; }
.btn-primary-small:hover { opacity: 0.88; text-decoration: none; color: #fff; }
.btn-secondary {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-mid); padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
  display: inline-block; text-decoration: none;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.2); color: var(--text-primary); text-decoration: none; }
.btn-secondary-small {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border); padding: 0.28rem 0.7rem;
  border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
  display: inline-block; text-decoration: none;
}
.btn-secondary-small:hover { border-color: var(--border-mid); color: var(--text-primary); text-decoration: none; }
.btn-secondary-tiny { background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: 0.18rem 0.45rem; border-radius: 4px; font-size: 0.75rem; cursor: pointer; transition: color 0.15s; }
.btn-secondary-tiny:hover { color: var(--text-secondary); }
.btn-danger-small { background: transparent; color: var(--accent); border: 1px solid rgba(217,51,72,0.3); padding: 0.28rem 0.7rem; border-radius: var(--radius-sm); font-size: 0.8rem; cursor: pointer; transition: background 0.15s; }
.btn-danger-small:hover { background: var(--accent-sub); }
.btn-danger-tiny { background: transparent; color: var(--accent); border: 1px solid rgba(217,51,72,0.3); padding: 0.18rem 0.45rem; border-radius: 4px; font-size: 0.75rem; cursor: pointer; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 0.95rem; padding: 0.2rem; color: var(--text-muted); transition: color 0.15s; }
.btn-icon:hover { color: var(--text-secondary); }
.btn-full { width: 100%; display: block; text-align: center; }
.btn-large { padding: 0.75rem 2.25rem; font-size: 1rem; }

/* ── Apple HIG: 44pt minimum touch targets ── */
.nav-link, .btn-secondary-small, .btn-danger-small, .btn-icon,
.back-link, .incident-type-btn, .severity-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
/* Reaction buttons need both dimensions */
.reaction-btn { min-height: 44px; min-width: 44px; padding: 0 0.5rem; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-input); border: 1px solid var(--border-mid);
  color: var(--text-primary); padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm); font-size: 1rem; /* 16px — never triggers iOS Safari auto-zoom */
  transition: border-color 0.15s;
  font-family: var(--font);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: rgba(255,255,255,0.22);
}
.form-group select option { background: var(--bg-elevated); }

/* ── Custom select chevron — dark theme, matches design system ── */
.form-group select, select.team-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2372728a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px 7px;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-divider { border-top: 1px solid var(--border); margin: 1.25rem 0; padding-top: 1rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Auth pages ── */
.auth-container { display: flex; justify-content: center; padding: 3rem 1rem; }
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem 2rem;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-card);
}
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.35rem; letter-spacing: -0.02em; }
.auth-sub { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.75rem; }
.auth-switch { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--text-muted); }
.auth-switch a { color: var(--text-secondary); }
.auth-switch a:hover { color: var(--text-primary); }
.auth-form { display: flex; flex-direction: column; }

/* ── Hero ── */
.hero { padding: 6rem 1rem 4rem; text-align: left; max-width: 1120px; margin: 0 auto; }
.hero-eyebrow {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem;
}
.hero-eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--accent); display: block; }
.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.25rem;
  letter-spacing: -0.04em;
  max-width: 720px;
  color: var(--text-primary);
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { font-size: 1.05rem; color: var(--text-secondary); max-width: 500px; margin-bottom: 2.5rem; line-height: 1.65; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ── Features ── */
.features { padding: 1.5rem 0 5rem; max-width: 1120px; margin: 0 auto; }
.features-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 2.5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2.5rem 3rem; }
.feature-card { background: transparent; padding: 0; }
.feature-number { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.85rem; }
.feature-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.feature-card p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }

/* ── Onboarding ── */
.onboarding-container { max-width: 920px; margin: 0 auto; }
.onboarding-header { margin-bottom: 3rem; }
.onboarding-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.onboarding-header p { color: var(--text-secondary); font-size: 0.95rem; }
.league-section { margin-bottom: 3rem; }
.league-header { display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 1.25rem; }
.league-divider { flex: 1; height: 1px; background: var(--border); }
.league-badge {
  padding: 0.2rem 0.6rem; border-radius: 3px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em;
}
.league-badge.nba { background: rgba(29,66,138,0.2); color: #6b9fe0; border: 1px solid rgba(29,66,138,0.4); }
.league-badge.nfl { background: rgba(150,20,20,0.2); color: #e07070; border: 1px solid rgba(150,20,20,0.4); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.5rem; }
.team-tile { cursor: pointer; }
.team-tile input[type=radio] { display: none; }
.team-tile-inner {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.9rem 0.6rem;
  text-align: center; transition: border-color 0.15s, background 0.15s;
}
.team-tile:hover .team-tile-inner { border-color: var(--border-mid); background: var(--bg-elevated); }
.team-tile input:checked + .team-tile-inner {
  border-color: var(--team-color, var(--accent));
  background: color-mix(in srgb, var(--team-color, var(--accent)) 10%, var(--bg-surface));
}
.team-abbr { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.25rem; letter-spacing: -0.01em; }
.team-name { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.team-city { font-size: 0.68rem; color: var(--text-muted); margin-top: 1px; }
.onboarding-submit { margin-top: 2.5rem; }

/* ── Profile completion prompt ── */
.profile-prompt {
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1rem;
  margin-bottom: 1.75rem;
  background: transparent;
}
.profile-prompt-inner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.profile-prompt-text { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.profile-prompt-text strong { font-size: 0.87rem; color: var(--text-primary); }
.profile-prompt-text span { font-size: 0.78rem; color: var(--text-muted); }
.profile-prompt-form {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex: 1;
}
.profile-prompt-form input[type="text"] {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.35rem 0.65rem;
  font-size: 1rem; color: var(--text-primary);
  outline: none; transition: border-color 0.15s;
  flex: 1; min-width: 100px;
}
.profile-prompt-form input[type="text"]:focus { border-color: var(--border-mid); }
.profile-prompt-dismiss {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 0.85rem; padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm); transition: color 0.12s; flex-shrink: 0;
}
.profile-prompt-dismiss:hover { color: var(--text-primary); }

/* ── Dashboard ── */
.dashboard-container { max-width: 920px; margin: 0 auto; }
.dashboard-header { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.dashboard-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.03em; }

/* Stats — ambient numbers, no box */
.stats-bar { display: flex; gap: 2.5rem; margin-bottom: 1.25rem; }
.stat-block { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }
.stat-value { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text-primary); line-height: 1; }
.stat-value.negative { color: var(--accent); }

/* Fav teams — inline, no card */
.dashboard-teams { display: flex; gap: 2rem; flex-wrap: wrap; }
.fav-team-card { text-decoration: none; display: flex; flex-direction: column; gap: 1px; }
.fav-team-card:hover { text-decoration: none; }
.fav-empty { color: var(--text-muted); font-size: 0.875rem; display: flex; align-items: center; }
.fav-league { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); }
.fav-abbr { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
.fav-name { font-size: 0.78rem; color: var(--text-secondary); }

/* Section layout */
.dashboard-section { margin-bottom: 2.5rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.85rem; }
.section-title { font-size: 0.88rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.section-sub { font-size: 0.7rem; color: var(--text-muted); display: block; margin-top: 1px; }

/* Alert list — left-accent strip, no background box */
.alert-list { display: flex; flex-direction: column; gap: 0.15rem; }
.alert-banner {
  display: flex; align-items: center; gap: 1rem;
  border-left: 3px solid var(--accent);
  padding: 0.7rem 1rem;
  text-decoration: none; transition: opacity 0.15s;
}
.alert-banner:hover { opacity: 0.75; text-decoration: none; }
.alert-body { flex: 1; min-width: 0; } /* min-width:0 lets flex children truncate with ellipsis */
.alert-title { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.alert-arrow { color: var(--text-muted); font-size: 0.85rem; }

/* Group list — vertical rows with dividers */
.group-list { display: flex; flex-direction: column; }
.group-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none; transition: opacity 0.15s;
}
.group-card:last-child { border-bottom: none; }
.group-card:hover { opacity: 0.75; text-decoration: none; }
.group-card-left { flex: 1; }
.group-card-name { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 0.3rem; }
.group-card-meta { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.4rem; }
.group-card-scores { display: flex; gap: 1.5rem; font-size: 0.8rem; color: var(--text-muted); }
.group-card-scores span { display: flex; gap: 0.35rem; align-items: baseline; }

/* Badges */
.badge-scope {
  background: transparent;
  padding: 0.12rem 0.45rem; border-radius: 3px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text-muted); border: 1px solid var(--border);
  text-transform: uppercase;
}
.badge-role {
  padding: 0.12rem 0.45rem; border-radius: 3px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.badge-role.owner { color: rgba(220,180,60,0.9); border: 1px solid rgba(220,180,60,0.25); background: rgba(220,180,60,0.08); }
.badge-role.admin { color: var(--text-secondary); border: 1px solid var(--border-mid); background: transparent; }
.badge-role.member { color: var(--text-muted); border: 1px solid var(--border); background: transparent; }

/* Empty states */
.empty-state { padding: 2rem 0; color: var(--text-muted); text-align: left; background: transparent; border: none; }
.empty-state p { margin-bottom: 0.75rem; font-size: 0.9rem; }
.text-muted { color: var(--text-muted); }

/* ── Group page ── */
.group-container { max-width: 980px; margin: 0 auto; }
.group-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2.5rem; flex-wrap: wrap; gap: 1rem; padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.group-header h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em; }
.group-header-meta { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.group-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.invite-box {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0;
}
.invite-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.invite-code { font-size: 0.85rem; color: var(--text-primary); font-family: monospace; letter-spacing: 0.03em; }

/* Thread tagline — rotates per page load */
.thread-tagline {
  font-size: 0.78rem; color: var(--text-muted);
  font-style: italic; margin-top: 0.2rem;
}

/* Invite panel */
.invite-panel {
  display: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}
.invite-panel.invite-panel-open { display: block; }
.invite-panel-inner { padding: 1rem 0; }
.invite-panel-label {
  font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.65rem;
}
.invite-panel-row {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.invite-url-input {
  flex: 1; min-width: 0;
  background: var(--bg-surface); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); padding: 0.4rem 0.7rem;
  font-size: 1rem; color: var(--text-primary); font-family: monospace;
  outline: none; cursor: text; max-width: 100%;
}
.invite-url-input:focus { border-color: var(--border-mid); }

/* Leaderboards — plain grid, no card boxes */
.leaderboard-section { margin-bottom: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.leaderboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem 2.5rem; }
.lb-card { padding: 0; background: transparent; }
.lb-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); margin-bottom: 0.85rem; }
.lb-row { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0; }
.lb-row + .lb-row { border-top: 1px solid var(--border); }
.lb-pos { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); width: 16px; }
.lb-top .lb-pos { color: var(--accent); }
.lb-top .lb-name { color: var(--text-primary); font-weight: 600; }
.lb-name { font-size: 0.875rem; color: var(--text-secondary); flex: 1; padding-left: 0.4rem; }
.lb-score { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); }
.lb-top .lb-score { color: var(--text-primary); }
.lb-empty { font-size: 0.8rem; color: var(--text-muted); padding: 0.35rem 0; }

/* Thread list — rows with dividers, no outer wrapper */
.group-section { margin-bottom: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.group-section:first-of-type { padding-top: 0; border-top: none; }
.thread-list { display: flex; flex-direction: column; }
.thread-card {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
  text-decoration: none; transition: opacity 0.15s;
}
.thread-card:last-child { border-bottom: none; }
.thread-card:hover { opacity: 0.75; text-decoration: none; }
.thread-card-left { flex: 1; }
.thread-title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.thread-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.thread-card-right { display: flex; align-items: center; gap: 0.6rem; }
.thread-target { font-size: 0.78rem; color: var(--text-muted); }
.thread-arrow { color: var(--text-muted); font-size: 0.8rem; }
.team-chip { font-size: 0.75rem; font-weight: 700; }

/* Member table — rows with dividers, no outer wrapper */
.member-table { }
.member-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  align-items: center; gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem; background: transparent;
}
.member-row:last-child { border-bottom: none; }
.member-header {
  background: transparent;
  color: var(--text-muted); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.member-name { font-weight: 600; color: var(--text-primary); }
.score.shame { color: var(--accent); font-weight: 700; }
.score.trash { color: var(--text-secondary); font-weight: 700; }
.score.brag { color: rgba(200,160,40,0.9); font-weight: 700; }

/* Receipt list — rows with dividers, no outer wrapper */
.receipt-list { display: flex; flex-direction: column; }
.receipt-item {
  display: flex; align-items: center; gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  text-decoration: none; transition: opacity 0.15s;
}
.receipt-item:last-child { border-bottom: none; }
.receipt-item:hover { opacity: 0.75; text-decoration: none; }
.receipt-title { flex: 1; font-size: 0.875rem; color: var(--text-primary); }
.receipt-shame { font-size: 0.78rem; color: var(--accent); font-weight: 700; }
.receipt-arrow { color: var(--text-muted); font-size: 0.78rem; }

/* Group preview (join page) */
.group-preview { padding: 0.75rem 0; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.group-preview-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.group-preview-meta { display: flex; gap: 0.75rem; font-size: 0.82rem; color: var(--text-muted); }

/* Join landing page */
.join-invite-eyebrow {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.5rem;
}
.join-group-meta {
  display: flex; align-items: center; gap: 0.65rem;
  margin-top: 0.5rem;
}
.join-member-count { font-size: 0.82rem; color: var(--text-muted); }

/* ── Thread page ── */
.thread-container { max-width: 760px; margin: 0 auto; }
.back-link { font-size: 0.82rem; color: var(--text-muted); display: inline-block; margin-bottom: 1rem; transition: color 0.15s; }
.back-link:hover { color: var(--text-secondary); }
.thread-title-large { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.25; letter-spacing: -0.02em; }
.thread-header { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.thread-header-meta { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; margin-top: 0.6rem; }
.team-chip-lg {
  padding: 0.2rem 0.65rem; border-radius: 3px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; border: 1px solid;
}
.target-label { font-size: 0.8rem; color: var(--text-muted); }
.status-badge { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.18rem 0.5rem; border-radius: 3px; }
.status-badge.active { background: rgba(52,199,123,0.1); color: var(--green); border: 1px solid rgba(52,199,123,0.25); }
.status-badge.closed { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }

/* Chat window — flat on page background, messages scroll freely */
.chat-window {
  background: transparent; border: none; border-radius: 0;
  padding: 0 0 1rem;
  min-height: 320px; max-height: 58vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.35rem;
  margin-bottom: 0;
  scroll-behavior: smooth;
}
.chat-window::-webkit-scrollbar { width: 4px; }
.chat-window::-webkit-scrollbar-track { background: transparent; }
.chat-window::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }

.message { display: flex; }
.message-system { justify-content: center; margin: 0.65rem 0.25rem; }
.message-system-body {
  font-size: 0.82rem; color: var(--text-muted); font-style: italic;
  text-align: center; max-width: 88%; padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.message-user { padding: 0 0.25rem; }
.message-mine  { justify-content: flex-end; }
.message-theirs { justify-content: flex-start; }
.message-bubble {
  border-radius: var(--radius-sm); padding: 0.45rem 0.65rem; max-width: 72%;
}
/* Own messages — subtle accent tint, right side */
.message-mine .message-bubble {
  background: rgba(217,51,72,0.13);
  border: 1px solid rgba(217,51,72,0.2);
}
/* Others — slightly elevated dark, left side */
.message-theirs .message-bubble {
  background: var(--bg-elevated);
}
.message-author {
  font-size: 0.75rem; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 0.2rem; display: flex; align-items: center; gap: 0.4rem;
}
.target-tag {
  color: var(--accent);
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--accent-sub); border: 1px solid rgba(217,51,72,0.3);
  padding: 0 0.35rem; border-radius: 3px; font-style: normal;
}
.message-text { font-size: 0.9rem; color: var(--text-primary); word-break: break-word; line-height: 1.5; }
.message-footer { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.reaction-bar { display: flex; gap: 0.2rem; }
.reaction-btn {
  background: transparent; border: 1px solid var(--border);
  border-radius: 20px; padding: 0.12rem 0.45rem;
  font-size: 0.75rem; cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  display: flex; align-items: center; gap: 2px;
  color: var(--text-muted);
}
.reaction-btn:hover { border-color: var(--border-mid); background: var(--bg-elevated); }
.reaction-btn.reacted { border-color: rgba(217,51,72,0.4); background: var(--accent-sub); color: var(--text-secondary); }
.reaction-count { font-size: 0.7rem; }
.message-time { font-size: 0.68rem; color: var(--text-muted); margin-left: auto; }
.delete-btn {
  background: none; border: none; cursor: pointer; font-size: 0.7rem;
  color: transparent; padding: 0.1rem 0.2rem; border-radius: 3px;
  transition: color 0.12s;
}
.message-bubble:hover .delete-btn { color: var(--text-muted); }
.delete-btn:hover { color: var(--accent) !important; }

/* Chat input */
.chat-input-area {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-primary);
}
.chat-form {
  display: flex; gap: 0.6rem; align-items: flex-end;
  background: transparent; border: none; padding: 0;
}
.chat-form textarea {
  flex: 1; min-width: 0; resize: none;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  font-size: 16px; font-family: var(--font); line-height: 1.5;
  transition: border-color 0.15s;
}
.chat-form textarea:focus { outline: none; border-color: var(--border-mid); }
.chat-form textarea::placeholder { color: var(--text-muted); }
.chat-submit { white-space: nowrap; flex-shrink: 0; }
.thread-closed-notice {
  text-align: center; padding: 1.25rem; color: var(--text-muted);
  font-size: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius);
}

/* ── Public receipt page ── */
body.receipt-page {
  background: var(--bg-primary);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 3rem 1rem;
}
.receipt-container {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem 2rem;
  max-width: 540px; width: 100%;
  box-shadow: var(--shadow-card);
}
.receipt-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
}
.receipt-logo { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-secondary); display: flex; align-items: center; gap: 0.4rem; }
.receipt-logo-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.receipt-official {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); border: 1px solid var(--border); padding: 0.18rem 0.55rem; border-radius: 3px;
}
.receipt-title-block { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.receipt-main-title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; }
.receipt-body { display: flex; flex-direction: column; }
.receipt-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0.7rem 0; border-bottom: 1px solid var(--border);
}
.receipt-row:last-child { border-bottom: none; }
.receipt-key { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding-top: 2px; }
.receipt-val { font-size: 0.875rem; color: var(--text-primary); text-align: right; max-width: 62%; }
.receipt-score { font-size: 1rem; font-weight: 700; }
.receipt-divider { border-top: 1px solid var(--border); margin: 0.35rem 0; }
.receipt-quote-row { flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.receipt-quote {
  font-style: italic; font-size: 0.875rem; color: var(--text-secondary);
  border-left: 2px solid var(--accent); padding-left: 0.75rem; margin: 0;
  line-height: 1.6;
}
.receipt-shame-val { font-size: 1.35rem; font-weight: 700; color: var(--accent); }
.receipt-footer { margin-top: 2rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.receipt-timestamp { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.75rem; width: 100%; }

/* ── Incident header (thread page) ── */
.incident-header {
  padding: 1rem 0 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.incident-meta-row {
  display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap; margin-bottom: 0.5rem;
}
.incident-type-badge {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent);
}
.incident-severity { font-size: 0.72rem; color: var(--text-muted); }
.incident-reporter { font-size: 0.72rem; color: var(--text-muted); }
.incident-status {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 0.15rem 0.45rem; border-radius: 3px;
}
.incident-status.active { color: var(--green); background: rgba(52,199,123,0.08); border: 1px solid rgba(52,199,123,0.2); }
.incident-status.confirmed { color: #6b9fe0; background: rgba(29,66,138,0.12); border: 1px solid rgba(29,66,138,0.3); }
.incident-status.dismissed { color: var(--text-muted); background: transparent; border: 1px solid var(--border); }
.incident-status.redeemed { color: rgba(200,160,40,0.9); background: rgba(200,160,40,0.08); border: 1px solid rgba(200,160,40,0.2); }
.incident-context {
  font-size: 0.9rem; font-style: italic; color: var(--text-secondary);
  margin-bottom: 0.75rem; line-height: 1.5;
}
.incident-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Incident report form ── */
.report-container { max-width: 760px; margin: 0 auto; }
.report-header { margin-bottom: 2.5rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--border); }
.report-header h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.35rem; }
.report-sub { font-size: 0.875rem; color: var(--text-secondary); }
.report-form { display: flex; flex-direction: column; }
.report-section { margin-bottom: 2rem; }
.report-section-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.4rem;
}
.report-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; }
.report-submit { display: flex; align-items: center; margin-top: 0.5rem; }

/* Incident type buttons */
.incident-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem;
}
.incident-type-btn { cursor: pointer; }
.incident-type-btn input[type=radio] { display: none; }
.incident-type-inner {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  text-align: center;
}
.incident-type-btn:hover .incident-type-inner { border-color: var(--border-mid); color: var(--text-primary); }
.incident-type-btn input:checked + .incident-type-inner {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-sub);
}

/* Severity bar */
.severity-bar { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.severity-btn { cursor: pointer; }
.severity-btn input[type=radio] { display: none; }
.severity-inner {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem; min-width: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: border-color 0.12s, background 0.12s;
}
.severity-btn:hover .severity-inner { border-color: var(--border-mid); }
.severity-btn input:checked + .severity-inner {
  border-color: var(--accent); background: var(--accent-sub);
}
.severity-num { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.severity-label-text { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.severity-btn input:checked + .severity-inner .severity-num { color: var(--accent); }
.severity-btn input:checked + .severity-inner .severity-label-text { color: var(--accent); }

/* Team tile suggested state */
.team-tile.team-suggested .team-tile-inner {
  border-color: var(--border-mid);
  background: var(--bg-elevated);
}

/* Dashboard no-groups state */
.dashboard-no-groups { padding: 3rem 0; }
.no-groups-sub { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 400px; }
.no-groups-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ── Responsive ── */
@media (max-width: 640px) {
  /* Layout */
  .nav-inner { padding: 0 1rem; }
  .main-content { padding: 1.5rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); }

  /* Reinforce 16px on mobile (global rule already sets this; belt-and-suspenders) */
  input, select, textarea, .invite-url-input {
    font-size: 16px;
    max-width: 100%;
  }
  /* Ensure no container causes horizontal overflow on mobile */
  .dashboard-container, .group-container, .thread-container,
  .report-container, .auth-container, .onboarding-container,
  .legal-container {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Hamburger nav */
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(52px + env(safe-area-inset-top));
    left: 0; right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    flex-direction: column;
    padding: 0.5rem 0;
  }
  .nav-mobile-open .nav-links { display: flex; }
  .nav-links .nav-link,
  .nav-links .btn-primary-small,
  .nav-links .btn-link {
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
    min-height: 52px;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
    display: flex; align-items: center;
    justify-content: flex-start;
  }
  .nav-links .btn-primary-small {
    background: transparent; color: var(--text-primary);
    border-radius: 0;
  }
  .nav-links form { width: 100%; }
  .nav-links > *:last-child .nav-link,
  .nav-links > *:last-child { border-bottom: none; }
  /* My Account row — visually anchors the top of the drawer */
  .nav-links .nav-link-account {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border-mid);
    padding-top: 1.1rem; padding-bottom: 1.1rem;
  }

  /* Hero */
  .hero { padding: 3rem 0 2rem; }

  /* Home feature grid — single column */
  .feature-grid { grid-template-columns: 1fr; gap: 1.75rem; }

  /* Auth — full-bleed card feels native on iOS */
  .auth-container { padding: 1rem 0; }
  .auth-card {
    border-left: none; border-right: none;
    border-radius: 0; max-width: 100%;
    padding: 2rem 1.25rem;
  }

  /* Legal pages */
  .legal-container { padding: 0 1.25rem; }
  .legal-title { font-size: 1.5rem; }

  /* Dashboard */
  .stats-bar { gap: 1.5rem; }
  .fav-name { display: none; }
  .dashboard-teams { gap: 1.25rem; }

  /* Group page */
  .group-header { flex-direction: column; gap: 1rem; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  /* Tables */
  .member-row { grid-template-columns: 2fr 1fr 1fr; }
  .member-row span:nth-child(n+4) { display: none; }
  .member-header span:nth-child(n+4) { display: none; }
  .leaderboard-grid { grid-template-columns: 1fr 1fr; }

  /* Thread chat — column layout: stretch items to full width */
  .chat-form { flex-direction: column; align-items: stretch; }
  .chat-form textarea { width: 100%; }
  .chat-submit { width: 100%; }

  /* Name grid — single column on narrow screens */
  .name-grid { grid-template-columns: 1fr; }

  /* Profile prompt — stack inputs vertically on mobile */
  .profile-prompt-form { flex-direction: column; align-items: stretch; }
  .profile-prompt-form input[type="text"] { flex: none; width: 100%; min-width: 0; }

  /* Onboarding league rows — wrap meta + select on narrow screens */
  .onboarding-league-row { flex-wrap: wrap; }
  .onboarding-league-meta { min-width: 0; flex: 1 1 100%; }
  .onboarding-select-wrap { flex: 1 1 100%; }

}

/* ── Team Color Preview (dropdowns) ── */
.team-color-preview {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.color-abbr {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ── Onboarding — multi-league dropdowns ── */
.onboarding-container { max-width: 640px; margin: 0 auto; padding: 2rem 0 4rem; }
.onboarding-header { margin-bottom: 2.5rem; }
.onboarding-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.onboarding-header p { color: var(--text-muted); font-size: 0.95rem; }
.onboarding-leagues { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.onboarding-league-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.onboarding-league-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 120px;
}
.onboarding-league-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.onboarding-league-badge {
  font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); background: var(--bg-card);
  padding: 0.1rem 0.35rem; border-radius: 3px; width: fit-content;
}
.onboarding-select-wrap { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.onboarding-select-wrap select { flex: 1; font-size: 1rem; }

/* ── Name grid (first/last name columns) ── */
.name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.onboarding-submit { text-align: center; }
.onboarding-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.75rem; }

/* ── Settings league rows ── */
.settings-league-row { margin-bottom: 0.75rem; }

/* ── Admin nav link ── */
.nav-link-admin { color: var(--accent) !important; }

/* ── Global back button ── */
.page-back-wrap { margin-bottom: 0.5rem; }
.page-back-btn {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 0.875rem; color: var(--text-muted); padding-right: 1rem;
  transition: color 0.15s;
}
.page-back-btn:hover { color: var(--text-secondary); text-decoration: none; }

/* ── Site footer ── */
.site-footer {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  font-size: 0.78rem; color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text-secondary); }

/* ── Legal pages ── */
.legal-container { max-width: 680px; margin: 0 auto; }
.legal-card { padding: 2rem 0; }
.legal-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.35rem; }
.legal-effective { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.legal-intro { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 2rem; line-height: 1.65; }
.legal-section { margin-bottom: 2rem; }
.legal-section h2 { font-size: 1rem; font-weight: 700; margin-bottom: 0.65rem; letter-spacing: -0.01em; }
.legal-section p, .legal-section li { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }
.legal-section ul { padding-left: 1.25rem; }
.legal-section li { margin-bottom: 0.4rem; }
.legal-section a { color: var(--text-primary); }

/* ── Danger zone (account deletion) ── */
.danger-zone { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(217,51,72,0.15); }
