/* ============================================================
   Pricey — Shared Design System
   ============================================================ */

/* --- Design Tokens --- */
:root {
  --purple: #8B5CF6;
  --purple-dark: #6D28D9;
  --blue: #3B82F6;
  --green: #84CC16;
  --bg: #080810;
  --surface: #0f0f1a;
  --surface2: #161625;
  --surface3: #1c1c2e;
  --border: #1e1e35;
  --text: #f1f5f9;
  --muted: #64748b;
  --red: #ef4444;
  --yellow: #f59e0b;
  --gold: #f59e0b;
  --grad: linear-gradient(135deg, #8B5CF6, #3B82F6);
  --grad-green: linear-gradient(135deg, #84CC16, #3B82F6);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.2);
  --shadow-glow: 0 12px 40px #8B5CF625;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* --- Noise Overlay --- */
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

/* --- Glow Overlay --- */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, #8B5CF622, transparent),
    radial-gradient(ellipse 60% 50% at 90% 80%, #3B82F618, transparent),
    radial-gradient(ellipse 40% 40% at 50% 50%, #84CC1608, transparent);
}
.glow-subtle {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 5% 10%, #8B5CF615, transparent),
    radial-gradient(ellipse 50% 40% at 95% 90%, #3B82F612, transparent);
}

/* --- Typography --- */
.font-display { font-family: 'Syne', sans-serif; }
h1, h2, h3, h4, h5 { font-family: 'Syne', sans-serif; }
.grad-text {
  background: var(--grad);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.green-text {
  background: var(--grad-green);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Navigation --- */
.nav {
  position: relative; z-index: 100;
  background: rgba(8,8,16,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 14px;
  padding: 0 40px; height: 60px;
}
.nav-sticky { position: sticky; top: 0; }
.nav-fixed { position: fixed; top: 0; left: 0; right: 0; padding: 16px 48px; }
.nav-fixed .nav-inner { padding: 0; height: auto; border-bottom: 1px solid var(--border); background: rgba(8,8,16,0.7); backdrop-filter: blur(20px); }

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

.nav-logo { display: flex; align-items: center; gap: 8px; }
.nav-logo img { height: 28px; }
.nav-logo-text {
  font-family: 'Syne', sans-serif; font-weight: 900; font-size: 18px;
  background: var(--grad); background-clip: text; -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-logo-text-lg { font-size: 20px; }
.nav-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.nav-page { font-size: 13px; font-weight: 600; color: var(--muted); }

.back-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-decoration: none; transition: color .15s;
}
.back-btn:hover { color: var(--text); }
.back-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.user-pill { display: flex; align-items: center; gap: 8px; }
.user-pill img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); }
.user-pill span { font-size: 13px; font-weight: 600; }
.user-mini img { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); }
.user-mini span { font-size: 12px; font-weight: 600; color: var(--muted); }
.user-mini { display: flex; align-items: center; gap: 8px; }

.nav-user-pill { display: flex; align-items: center; gap: 8px; }
.nav-user-pill img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); }
.nav-user-pill span { font-size: 13px; font-weight: 600; }

/* Mobile hamburger */
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--text);
}
.nav-hamburger svg { width: 22px; height: 22px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: 9px;
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; border: none;
  transition: opacity .15s, transform .1s, border-color .2s, background .15s, color .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-primary { background: var(--grad); color: white; box-shadow: 0 4px 20px #8B5CF635; }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--purple); color: #a78bfa; opacity: 1; }
.btn-danger { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.4); opacity: 1; }
.btn-success { background: rgba(132,204,22,0.1); color: var(--green); border: 1px solid rgba(132,204,22,0.2); }
.btn-success:hover { background: rgba(132,204,22,0.2); border-color: rgba(132,204,22,0.4); opacity: 1; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 12px; }
.btn-lg svg { width: 20px; height: 20px; }

.btn-nav {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grad); color: white;
  font-size: 14px; font-weight: 700; padding: 10px 22px; border-radius: 10px;
  text-decoration: none; transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 24px #8B5CF640;
  font-family: 'Syne', sans-serif; border: none; cursor: pointer;
}
.btn-nav:hover { opacity: .9; transform: translateY(-1px); }
.btn-nav svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 15px; font-weight: 600;
  padding: 14px 28px; border-radius: 12px; text-decoration: none;
  transition: border-color .2s, transform .15s;
  font-family: 'Syne', sans-serif; cursor: pointer;
}
.btn-outline:hover { border-color: var(--purple); transform: translateY(-2px); }

.btn-logout {
  font-size: 12px; font-weight: 700; color: #f87171;
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  border-radius: 8px; padding: 6px 14px; text-decoration: none;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(239,68,68,0.2); }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 14px;
}
.card-title {
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.card-title svg { width: 15px; height: 15px; color: #a78bfa; flex-shrink: 0; }

/* --- Forms --- */
label {
  display: block; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
  font-family: 'Syne', sans-serif;
}
input[type=text], input[type=number], select, textarea {
  width: 100%; background: var(--surface3); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 12px; color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
textarea { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row { margin-bottom: 14px; }
.form-row:last-child { margin-bottom: 0; }
.hint { font-size: 11px; color: var(--muted); margin-top: 5px; }

/* --- Badges & Tags --- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 6px 14px;
  border-radius: 100px; letter-spacing: .5px;
  font-family: 'Syne', sans-serif;
}
.badge-green {
  background: rgba(132,204,22,0.1); border: 1px solid rgba(132,204,22,0.25); color: var(--green);
}
.badge-purple {
  background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.25); color: #a78bfa;
}
.badge-blue {
  background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #60a5fa;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green .badge-dot { animation: pulse 2s infinite; }

.tag {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 100px; font-size: 11px; font-weight: 700;
  font-family: 'Syne', sans-serif;
}
.tag-purple { background: rgba(139,92,246,0.12); border: 1px solid rgba(139,92,246,0.2); color: #a78bfa; }
.tag-green { background: rgba(132,204,22,0.12); border: 1px solid rgba(132,204,22,0.2); color: var(--green); }
.tag-blue { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.2); color: #60a5fa; }
.tag-yellow { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.2); color: #fbbf24; }
.tag-red { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.2); color: #f87171; }

/* --- Bot Status Pill --- */
.bot-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--green);
  background: rgba(132,204,22,0.1); border: 1px solid rgba(132,204,22,0.2);
  padding: 5px 12px; border-radius: 100px;
  font-family: 'Syne', sans-serif;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* --- Toggle --- */
.toggle { position: relative; width: 38px; height: 20px; display: inline-block; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--surface3); border-radius: 100px;
  cursor: pointer; transition: .2s; border: 1px solid var(--border);
}
.toggle-slider:before {
  content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: white; left: 2px; top: 2px; transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--purple); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { display: flex; align-items: center; gap: 8px; }
.toggle-label svg { width: 14px; height: 14px; color: var(--muted); }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 18px; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(60px); opacity: 0; transition: all .3s;
  font-family: 'Syne', sans-serif;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.ok { border-color: var(--green); color: var(--green); }
.toast.err { border-color: var(--red); color: #f87171; }

/* --- Modal / Drawer --- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 200;
  display: flex; align-items: stretch; justify-content: flex-end;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal-bg.centered { align-items: center; justify-content: center; }
.modal-bg.centered .modal-panel {
  width: 100%; max-width: 600px; max-height: 88vh;
  border-radius: var(--radius-xl); animation: fadeUp .2s ease;
}

.modal-panel {
  background: var(--surface); border-left: 1px solid var(--border);
  width: 560px; max-width: 95vw; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; animation: slideIn .25s ease;
}
.modal-header {
  padding: 24px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-shrink: 0;
}
.modal-header-info { flex: 1; min-width: 0; }
.modal-header h3 { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.modal-close {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px; padding: 6px; cursor: pointer;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: var(--surface3); }
.modal-close svg { width: 16px; height: 16px; display: block; }
.modal-body { padding: 20px 24px; flex: 1; }
.modal-footer-bar {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0;
}

/* --- Segment Control --- */
.segmented {
  display: inline-flex; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 20px;
}
.segmented button {
  padding: 7px 16px; font-size: 12px; font-weight: 700;
  font-family: 'Syne', sans-serif; color: var(--muted);
  background: none; border: none; border-radius: 7px; cursor: pointer;
  transition: all .15s; display: flex; align-items: center; gap: 6px;
}
.segmented button svg { width: 13px; height: 13px; }
.segmented button.active { background: var(--grad); color: white; }
.segmented button:hover:not(.active) { color: var(--text); }

.subview { display: none; }
.subview.active { display: block; }

/* --- Stat Box --- */
.stat {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px;
}
.stat-num {
  font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 900; letter-spacing: -1px;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-lbl {
  font-size: 11px; color: var(--muted); margin-top: 3px;
  text-transform: uppercase; letter-spacing: .5px; font-family: 'Syne', sans-serif;
}
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 14px; }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* --- Info Row --- */
.info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--muted); }
.info-row span:last-child { font-weight: 600; text-align:right; }

/* --- Section Block --- */
.section-block { margin-bottom: 20px; }
.section-block-title {
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}

/* --- Divider --- */
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* --- Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: var(--radius-lg); height: 152px; border: 1px solid var(--border);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* --- Footer --- */
.footer {
  position: relative; z-index: 1; text-align: center;
  padding: 32px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  flex-wrap: wrap;
}
.footer .brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.footer img { height: 20px; opacity: .6; }
.footer a { color: var(--muted); text-decoration: none; transition: color .15s; }
.footer a:hover { color: var(--text); }

/* --- Page Header --- */
.page-header { margin-bottom: 40px; }
.page-header h1 { font-family: 'Syne', sans-serif; font-size: 32px; font-weight: 900; letter-spacing: -1.5px; margin-bottom: 6px; }
.page-header p { font-size: 14px; color: var(--muted); }

/* --- Animations --- */
@keyframes fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideIn { from{transform:translateX(40px);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* --- Legal Pages --- */
.legal-wrap {
  position: relative; z-index: 1;
  max-width: 820px; margin: 0 auto; padding: 140px 24px 100px;
}
.page-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 6px 14px;
  border-radius: 100px; margin-bottom: 20px; letter-spacing: .5px;
  font-family: 'Syne', sans-serif;
}
.page-badge-purple { background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.25); color: #a78bfa; }
.page-badge-blue { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #60a5fa; }
.page-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(32px, 5vw, 48px); font-weight: 900;
  letter-spacing: -1.5px; margin-bottom: 12px;
}
.page-updated { color: var(--muted); font-size: 14px; margin-bottom: 48px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 44px; }
.toc a {
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 100px; text-decoration: none;
  font-family: 'Syne', sans-serif; transition: color .15s, border-color .15s;
}
.toc a:hover { color: #60a5fa; border-color: var(--blue); }
.legal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
}
.legal-card h2 {
  font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800;
  margin-top: 36px; margin-bottom: 14px; letter-spacing: -.3px;
}
.legal-card h2:first-child { margin-top: 0; }
.legal-card p, .legal-card li { font-size: 15px; line-height: 1.75; color: #cbd5e1; margin-bottom: 14px; }
.legal-card ul { padding-left: 22px; margin-bottom: 14px; }
.legal-card a { color: #60a5fa; text-decoration: none; }
.legal-card a:hover { text-decoration: underline; }
.legal-card strong { color: var(--text); }
.legal-card table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 14px; }
.legal-card th, .legal-card td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); color: #cbd5e1;
}
.legal-card th {
  color: var(--text); font-family: 'Syne', sans-serif;
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
}

/* --- Layout Helpers --- */
.content { position: relative; z-index: 1; padding: 48px 40px; max-width: 1200px; margin: 0 auto; }
.content-narrow { position: relative; z-index: 1; padding: 48px 40px; max-width: 960px; margin: 0 auto; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .nav-inner { padding: 0 24px; }
  .nav-fixed { padding: 12px 24px; }
  .content { padding: 32px 20px; }
  .content-narrow { padding: 32px 20px; }
  .legal-wrap { padding: 120px 20px 60px; }
}

@media (max-width: 768px) {
  /* Nav mobile */
  .nav-hamburger { display: flex; align-items: center; justify-content: center; }
  .nav-right-desktop { display: none; }
  .nav-mobile-menu {
    display: none; position: fixed; inset: 0; z-index: 150;
    background: rgba(8,8,16,0.98); backdrop-filter: blur(20px);
    padding: 80px 24px 24px; flex-direction: column; gap: 12px;
    animation: fadeIn .2s ease; overflow-y: auto;
  }
  .nav-mobile-menu.open { display: flex; }
  .nav-mobile-menu .btn { width: 100%; justify-content: center; padding: 14px; min-height: 44px; }
  .nav-mobile-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; color: var(--muted); cursor: pointer; padding: 8px;
    min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center;
  }
  .nav-mobile-close svg { width: 24px; height: 24px; }

  .stats-row { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }

  /* Cards & buttons */
  .card { padding: 18px; }
  .btn { min-height: 44px; padding: 12px 20px; }
  .btn-sm { min-height: 36px; padding: 8px 14px; }

  /* Tables overflow */
  .user-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Info rows */
  .info-row { gap: 12px; }
  .info-row span:last-child { text-align: right; word-break: break-word; }

  /* Segment control scroll */
  .segmented { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .segmented button { white-space: nowrap; flex-shrink: 0; padding: 10px 16px; }

  /* Toggle rows */
  .toggle-row { gap: 12px; }

  /* Legal pages */
  .legal-card { padding: 24px; }
  .legal-card h2 { font-size: 18px; margin-top: 28px; }
  .legal-card p, .legal-card li { font-size: 14px; line-height: 1.7; }
  .legal-card table { font-size: 13px; display: block; overflow-x: auto; }
  .legal-card th, .legal-card td { padding: 8px 10px; }
  .toc { gap: 6px; }
  .toc a { font-size: 11px; padding: 5px 10px; }
  .footer { padding: 24px 16px; font-size: 12px; flex-direction: column; gap: 12px; }

  .page-header h1 { font-size: 26px; letter-spacing: -1px; }
  .page-header p { font-size: 13px; }

  /* Modal bottom sheet on mobile */
  .modal-bg { align-items: flex-end; justify-content: stretch; }
  .modal-panel { border-radius: 16px 16px 0 0 !important; max-height: 92vh; width: 100% !important; max-width: 100% !important; }
  .modal-header { padding: 20px 20px 14px; }
  .modal-body { padding: 16px 20px; }
  .modal-footer-bar { padding: 14px 20px; }

  /* Badge & tag touch targets */
  .badge { padding: 8px 14px; }
  .tag { padding: 5px 12px; }

  /* Toast */
  .toast { left: 16px; right: 16px; bottom: 16px; justify-content: center; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 12px; height: 52px; }
  .stats-row { grid-template-columns: 1fr; gap: 8px; }
  .content { padding: 20px 14px; }
  .content-narrow { padding: 20px 14px; }
  .page-header h1 { font-size: 22px; letter-spacing: -1px; }
  .page-header { margin-bottom: 28px; }
  .btn-lg { padding: 12px 20px; font-size: 14px; }
  .card { padding: 16px; margin-bottom: 12px; }
  .legal-wrap { padding: 100px 14px 40px; }
  .legal-card { padding: 20px; }
  .legal-card h2 { font-size: 17px; margin-top: 24px; }
  .stat-num { font-size: 22px; }
  .stat { padding: 14px; }

  /* Confirm dialog */
  .confirm-box { width: 100%; max-width: 100%; margin: 0 16px; padding: 24px; }
}
