/* =====================================================================
   CCC — Crypto Cards Compare  ·  black + silver theme
   ===================================================================== */

:root {
  --bg:        #08090c;
  --bg-2:      #0d0f14;
  --surface:   #14161d;
  --surface-2: #1a1d26;
  --line:      rgba(255, 255, 255, 0.08);
  --line-2:    rgba(255, 255, 255, 0.14);

  --text:      #e7eaf0;
  --text-dim:  #b4bac6;
  --text-mut:  #9aa1af;

  --silver-1:  #f4f6f9;
  --silver-2:  #c3c9d4;
  --silver-3:  #8d93a1;
  --silver-grad: linear-gradient(135deg, #ffffff 0%, #cfd4dd 40%, #8a90a0 100%);

  --radius:    16px;
  --radius-sm: 11px;
  --nav-h:     70px;
  --maxw:      1240px;

  --shadow:    0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(120, 130, 160, 0.10), transparent 60%),
    radial-gradient(900px 500px at 5% 10%, rgba(90, 100, 130, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------------
   Animated background — floating crypto cards
   ------------------------------------------------------------------- */
.bg-cards {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(1100px 700px at 50% 30%, transparent 40%, rgba(8, 9, 12, 0.55) 100%);
}

.float-card {
  position: absolute;
  width: 260px;
  height: 164px;
  border-radius: 18px;
  opacity: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.85);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bc) 65%, #1b1d24) 0%,
                                color-mix(in srgb, var(--bc) 18%, #0c0d12) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: rotate(var(--rot, 0deg));
  animation-name: floatFade;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}
.float-card .fc-chip {
  width: 38px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, #f2d98c, #b8923c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.float-card .fc-name { font-weight: 800; font-size: 18px; letter-spacing: .3px; }
.float-card .fc-num  { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; letter-spacing: 2px; opacity: .8; }

@keyframes floatFade {
  0%   { opacity: 0;            transform: translateY(46px)  rotate(var(--rot)) scale(.94); }
  18%  { opacity: var(--maxop); }
  82%  { opacity: var(--maxop); }
  100% { opacity: 0;            transform: translateY(-66px) rotate(var(--rot)) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .float-card { animation: none; opacity: 0; }
}

/* ---------------------------------------------------------------------
   Navigation (fixed)
   ------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(10, 11, 15, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand-logo {
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 1px;
  background: var(--silver-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.brand-logo.small { font-size: 20px; }
.brand-tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mut);
  white-space: nowrap;
  border-left: 1px solid var(--line-2);
  padding-left: 12px;
}

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  position: relative;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .18s ease, background .18s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-links a.active { color: var(--silver-1); }
.nav-links a.active::after {
  content: "";
  position: absolute; left: 16px; right: 16px; bottom: 2px; height: 2px;
  border-radius: 2px;
  background: var(--silver-grad);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px; border-radius: 2px;
  background: var(--silver-2);
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------------------------------------------------------------------
   Layout / hero
   ------------------------------------------------------------------- */
main {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 64px) 24px 80px;
}

.hero { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--silver-3);
  margin: 0 0 18px;
}
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--silver-1);
}
.hero h1 .grad {
  background: var(--silver-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  margin: 0 auto;
  max-width: 620px;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------------
   Quick compare — tab menu + focused single-category table
   ------------------------------------------------------------------- */
.quick-compare { margin-bottom: 60px; }
.qc-title {
  text-align: center;
  margin: 0 0 6px;
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--silver-1);
}
.qc-sub {
  text-align: center;
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--text-mut);
}
.qc-tabs-wrap {
  position: relative;
  margin-bottom: 22px;
}
.qc-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Scroll arrows — hidden on desktop, shown on mobile only when the tabs
   row overflows. JS toggles the `hidden` attribute based on scroll position. */
.qc-scroll { display: none; }

@media (max-width: 700px) {
  .qc-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 44px;  /* room for the absolute-positioned arrow buttons */
    margin: 0 -16px;     /* extend to viewport edges so swipes feel natural */
  }
  .qc-tabs::-webkit-scrollbar { display: none; }
  .qc-tab { flex-shrink: 0; scroll-snap-align: start; }

  .qc-scroll {
    display: grid;
    place-items: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line-2);
    background: rgba(20, 22, 29, 0.96);
    color: var(--silver-1);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    transition: transform .15s ease, background .15s ease;
  }
  .qc-scroll[hidden] { display: none; }
  .qc-scroll-left  { left: 4px; }
  .qc-scroll-right { right: 4px; }
  .qc-scroll:hover { background: rgba(30, 33, 42, 0.98); }
  .qc-scroll:active { transform: translateY(-50%) scale(0.94); }
}
.qc-tab {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .15s ease;
}
.qc-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); transform: translateY(-1px); }
.qc-tab.active {
  color: #0a0b0e;
  font-weight: 700;
  background: var(--silver-grad);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Quick table: keep the focused value column roomy, card/signup tight */
.qc-table th:first-child, .qc-table td:first-child { width: 200px; }
.qc-table .col-signup, .qc-table th:last-child { width: 130px; }

/* ---------------------------------------------------------------------
   Comparison table
   ------------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20,22,29,.92), rgba(14,16,21,.92));
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: hidden;
  backdrop-filter: blur(6px);
}

/* Header that may need to wrap (long labels like Annual Membership Fee) */
.compare-table thead th.th-wrap { white-space: normal; min-width: 116px; }

/* The full 8-column table gets a min width so columns stay readable;
   the wrapper scrolls horizontally on narrower desktops/tablets. */
@media (min-width: 981px) {
  .compare-table.full { min-width: 1100px; }
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.compare-table thead th {
  text-align: left;
  padding: 16px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--silver-3);
  background: rgba(18, 20, 27, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.compare-table tbody td {
  padding: 18px 16px;
  vertical-align: top;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}
.compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table tbody tr { transition: background .18s ease; }
.compare-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.col-card { min-width: 168px; }
.card-id { display: flex; align-items: center; gap: 12px; }
.card-badge {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #0e0f13;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--bc) 42%, transparent),
              inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.card-name { font-weight: 700; font-size: 15px; color: var(--text); }

.benefits li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 5px;
  font-size: 13px;
}
.benefits li::before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--silver-3);
}
.benefits li:last-child { margin-bottom: 0; }

/* Payback column — emphasized so rewards stand out */
.col-payback { background: rgba(80, 226, 178, 0.055); }
.payback-val { font-weight: 600; color: var(--text); font-size: 14px; }
.hl-pay {
  font-weight: 800;
  color: #5fe6b8;
  letter-spacing: .2px;
  text-shadow: 0 0 18px rgba(95, 230, 184, 0.35);
}
.col-payback .payback-val:only-child:not(:has(.hl-pay)) { color: var(--text-mut); font-weight: 500; }

/* High-yield figures highlighted inside benefits */
.hl-yield {
  font-weight: 800;
  color: #ffcf6b;
  text-shadow: 0 0 16px rgba(255, 207, 107, 0.32);
}

/* "Free" annual fee — positive highlight */
.hl-free {
  font-weight: 800;
  color: #5fe6b8;
  text-shadow: 0 0 16px rgba(95, 230, 184, 0.3);
}

/* FX fee rate (other currencies) — neutral cyan accent so the comparable
   percentage stands out against the surrounding label text */
.hl-fx {
  font-weight: 800;
  color: #6fd8ff;
  text-shadow: 0 0 16px rgba(111, 216, 255, 0.32);
}

.col-signup { text-align: right; white-space: nowrap; }
.btn-signup {
  cursor: pointer;
  border: 0;
  padding: 11px 20px;
  border-radius: 11px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #0a0b0e;
  background: var(--silver-grad);
  box-shadow: 0 6px 18px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.6);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.btn-signup:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 10px 26px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.7); }
.btn-signup:active { transform: translateY(0); }

.disclaimer-note {
  margin: 18px 4px 0;
  font-size: 12.5px;
  color: var(--text-mut);
  text-align: center;
}

/* ---------------------------------------------------------------------
   Placeholder pages (Analytics / Inquiries)
   ------------------------------------------------------------------- */
.page-placeholder {
  text-align: center;
  max-width: 600px;
  margin: 60px auto;
  padding: 56px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20,22,29,.85), rgba(14,16,21,.85));
  box-shadow: var(--shadow-sm);
}
.page-placeholder h1 {
  margin: 8px 0 16px;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  letter-spacing: -1px;
  background: var(--silver-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.btn-ghost {
  display: inline-block;
  margin-top: 26px;
  padding: 11px 22px;
  border-radius: 11px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--line-2);
  transition: background .18s ease, border-color .18s ease;
}
.btn-ghost:hover { background: rgba(255,255,255,.06); border-color: var(--silver-3); }

/* ---------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  padding: 32px 24px 48px;
  text-align: center;
}
.footer p {
  max-width: 540px;
  margin: 12px auto 0;
  font-size: 13px;
  color: var(--text-mut);
  line-height: 1.6;
}
.footer-copy { font-size: 12px; opacity: .8; }

/* ---------------------------------------------------------------------
   Sign-up modal
   ------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 7, 0.72);
  backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 34px 30px 30px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: popIn .22s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes popIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px;
  border: 0; border-radius: 9px;
  background: rgba(255,255,255,.05);
  color: var(--text-dim);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.modal-close:hover { background: rgba(255,255,255,.1); color: #fff; }

.modal-title { margin: 0 0 6px; font-size: 22px; font-weight: 800; color: var(--silver-1); letter-spacing: -.4px; }
.modal-text  { margin: 0 0 22px; font-size: 14px; color: var(--text-mut); }

.modal-options { display: flex; flex-direction: column; gap: 12px; }
.store-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.03);
  color: var(--text);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.store-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.07); border-color: var(--silver-3); }
.store-ico { display: grid; place-items: center; width: 30px; }
.store-apple .store-ico { color: #fff; }
.store-text { display: flex; flex-direction: column; line-height: 1.2; }
.store-text small { font-size: 11px; color: var(--text-mut); }
.store-text strong { font-size: 17px; font-weight: 700; }

.modal-disclaimer {
  margin: 18px 2px 0;
  font-size: 12.5px;
  color: var(--silver-3);
  font-style: italic;
}

/* Invitation-code flow */
.get-code-btn {
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  background: rgba(80, 226, 178, 0.08);
  border-color: rgba(80, 226, 178, 0.35);
}
.get-code-btn:hover { background: rgba(80, 226, 178, 0.14); border-color: rgba(80, 226, 178, 0.6); }
.get-code-btn .store-ico { color: #5fe6b8; }

.invite-form { margin-top: 14px; }
.invite-row { display: flex; gap: 8px; }
.invite-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 16px; /* >=16px stops iOS Safari auto-zooming the field on focus */
}
.invite-input::placeholder { color: var(--text-mut); }
.invite-input:focus {
  outline: none;
  border-color: #5fe6b8;
  box-shadow: 0 0 0 3px rgba(95, 230, 184, 0.18);
}
.invite-input.invalid {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.18);
}
.invite-input:disabled { opacity: 0.6; }
.invite-send {
  flex: 0 0 auto;
  padding: 12px 20px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #06231a;
  background: linear-gradient(135deg, #7af0c8, #34c89a);
  transition: filter .15s ease;
}
.invite-send:hover { filter: brightness(1.06); }
.invite-send:disabled { cursor: default; filter: grayscale(0.3) brightness(0.9); }
.invite-note {
  margin: 12px 2px 0;
  font-size: 12.5px;
  color: var(--silver-3);
  font-style: italic;
  line-height: 1.5;
}
.invite-success {
  margin: 10px 2px 0;
  font-size: 13px;
  font-weight: 600;
  color: #5fe6b8;
}

/* ---------------------------------------------------------------------
   Responsive — stack the table into card panels on small screens
   ------------------------------------------------------------------- */
@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .brand-tag { display: none; }

  .nav-links {
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
    background: rgba(10, 11, 15, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 14px 12px; border-radius: 10px; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: rgba(255,255,255,.06); }

  /* table -> stacked panels */
  .table-wrap {
    border: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
    backdrop-filter: none;
  }
  .compare-table thead { display: none; }
  .compare-table,
  .compare-table tbody,
  .compare-table tr,
  .compare-table td { display: block; width: 100%; }

  .compare-table tr {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(20,22,29,.94), rgba(14,16,21,.94));
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .compare-table tbody tr:hover { background: linear-gradient(180deg, rgba(24,26,34,.96), rgba(16,18,24,.96)); }

  .compare-table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    text-align: right;
  }
  .compare-table td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--silver-3);
    padding-top: 1px;
  }
  .compare-table .benefits { text-align: right; }
  .compare-table .benefits li { padding-left: 0; padding-right: 14px; }
  .compare-table .benefits li::before { left: auto; right: 0; }

  .col-card {
    background: rgba(255,255,255,.02);
    padding: 18px !important;
  }
  .col-card::before { display: none; }
  .card-id { justify-content: flex-start; }

  .col-signup { padding: 16px 18px !important; }
  .col-signup::before { display: none; }
  .btn-signup { width: 100%; padding: 14px; font-size: 15px; }
}

@media (max-width: 600px) {
  /* Tidy the category tabs into a single swipeable row instead of wrapping */
  .qc-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
  }
  .qc-tabs::-webkit-scrollbar { display: none; }
  .qc-tab { flex: 0 0 auto; }
}

@media (max-width: 460px) {
  main { padding: calc(var(--nav-h) + 32px) 16px 64px; }
  .nav-inner { padding: 0 16px; }
  .hero { margin-bottom: 40px; }
  .compare-table td { flex-direction: column; text-align: left; gap: 4px; }
  .compare-table td::before { flex-basis: auto; }
  .compare-table .benefits,
  .compare-table .benefits li { text-align: left; padding-right: 0; padding-left: 14px; }
  .compare-table .benefits li::before { left: 0; right: auto; }
}

/* =====================================================================
   Analytics page
   ===================================================================== */
.analytics-hero { margin-bottom: 36px; }

.source-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 12px;
}
.source-pills a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.source-pills a:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); border-color: var(--silver-3); }

.preview-banner {
  display: inline-block;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffcf6b;
  background: rgba(255, 207, 107, 0.08);
  border: 1px solid rgba(255, 207, 107, 0.32);
}

/* Section wrapper */
.ax-section { position: relative; z-index: 2; margin-bottom: 64px; }
.ax-section:last-of-type { margin-bottom: 24px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 24px; }
.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--silver-1);
}
.section-head .section-sub { margin: 0; font-size: 15px; color: var(--text-mut); line-height: 1.55; }
.section-head .section-sub a { color: var(--text-dim); border-bottom: 1px solid var(--line-2); }
.section-head .section-sub a:hover { color: var(--text); border-color: var(--silver-3); }

/* Stat tiles */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(20,22,29,.92), rgba(14,16,21,.92));
  backdrop-filter: blur(6px);
}
.stat .stat-label {
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--silver-3);
  font-weight: 700;
}
.stat .stat-value {
  margin: 6px 0 4px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.5px;
  background: var(--silver-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.stat .stat-note { font-size: 12.5px; color: var(--text-mut); }

/* Tracked-cards roster (industry section) */
.industry-roster {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.industry-roster .card-pill {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  color: var(--text-mut);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
}
.industry-roster .card-pill.own {
  color: var(--silver-1);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.roster-key {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-mut);
}
.roster-key .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; margin-right: 6px; background: rgba(255, 255, 255, 0.5); }

/* Card deep-dive panel */
.card-panel {
  position: relative;
  overflow: hidden;
  padding: 24px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20,22,29,.92), rgba(14,16,21,.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.card-panel::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(700px 220px at 0% 0%, color-mix(in srgb, var(--bc) 22%, transparent), transparent 60%),
    radial-gradient(500px 200px at 100% 100%, color-mix(in srgb, var(--bc) 10%, transparent), transparent 70%);
  pointer-events: none;
}
.card-panel > * { position: relative; }
.card-panel:last-of-type { margin-bottom: 0; }
.card-panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.card-panel-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}
.card-panel-head .source-link {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 1px;
  white-space: nowrap;
}
.card-panel-head .source-link:hover { color: var(--text); border-color: var(--silver-3); }

/* Sparkline block */
.sparkline-wrap {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
}
.sl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sl-label {
  font-size: 11px;
  letter-spacing: .55px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--silver-3);
}
.sl-range {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mut);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.sparkline svg { width: 100%; height: 80px; display: block; }

/* Segments stacked bar (Plasma user segments) */
.segments-bar {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
}
.sb-label {
  font-size: 11px;
  letter-spacing: .55px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--silver-3);
  margin-bottom: 12px;
}
.segments-bar-track {
  display: flex;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.35);
}
.segments-bar-track .seg { height: 100%; transition: filter .15s ease; }
.segments-bar-track .seg:hover { filter: brightness(1.15); }
.segments-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text);
}
.segments-legend .swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.segments-legend .legend-mut { color: var(--text-mut); font-weight: 500; }
.segments-legend .legend-item { font-weight: 600; }

/* Tweet wall */
.tweet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.tweet {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(20, 22, 29, 0.72);
  backdrop-filter: blur(6px);
  color: inherit;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.tweet:hover {
  transform: translateY(-2px);
  background: rgba(24, 26, 34, 0.85);
  border-color: color-mix(in srgb, var(--bc) 40%, var(--line-2));
}
.tweet-head { display: flex; align-items: center; gap: 10px; }
.tweet-avatar {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #0e0f13;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--bc) 55%, transparent),
    0 4px 10px color-mix(in srgb, var(--bc) 30%, transparent);
}
.tweet-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tweet-handle {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.tweet-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-mut);
  font-variant-numeric: tabular-nums;
}
.tweet-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}
.tweet-card-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--text);
  background: color-mix(in srgb, var(--bc) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--bc) 40%, transparent);
}

/* Analytics page — mobile polish */
@media (max-width: 600px) {
  .ax-section { margin-bottom: 48px; }
  .card-panel { padding: 18px; }
  .card-panel-head { flex-wrap: wrap; }
  .card-panel-head .source-link {
    margin-left: 0;
    flex-basis: 100%;
    order: 3;
    padding-top: 4px;
  }
  .sparkline-wrap, .segments-bar { padding: 14px; }
  .segments-legend { gap: 8px 14px; font-size: 12px; }
  .stat { padding: 14px 16px; }
  .stat .stat-value { font-size: 24px; }
  .preview-banner { font-size: 12px; padding: 7px 14px; }
}
