/* ============================================================
   ZENBU Analytics — exa.ai-inspired design tokens.
   ============================================================ */

:root {
  /* color */
  --brand: #1f40ed;
  --brand-dark: #0d2189;
  --brand-faint: #e7ebfd;
  --brand-subtle: #a1aff7;
  --brand-muted: #4d87e7;
  --violet: #675181;
  --ink: #111111;
  --text: #374151;
  --text-2: #787572;
  --text-3: #9ca3af;
  --hairline: #e5e7eb;
  --panel: #ffffff;
  --panel-soft: #faf9f7;
  --panel-faint: #f5f5f5;
  --dark: #181815;
  --green: #50b40a;
  --green-bg: #d1fae5;
  --red: #d32f2f;
  --track: #f0f0f0;
  /* gradient tokens (kept to three, exa discipline) */
  --grad-underline: linear-gradient(90deg, #1f40ed, #675181, #a1aff7);
  --grad-banner: linear-gradient(90deg, #e7ebfd, #faf9f7, #e7ebfd);
  --grad-dark-glow: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(31, 64, 237, 0.18), transparent 60%);
  /* elevation (near-flat) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.14);
  /* type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 20px;
  /* spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  /* radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  /* layout */
  --nav-h: 60px;
  --page-max: 1040px;
  --page-pad: var(--space-4);
  /* z-index tiers */
  --z-nav: 20;
  --z-mobilebar: 30;
}

/* ---------- entrance animation ---------- */

@keyframes fade-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-rise {
  animation: fade-rise 240ms ease-out both;
}

/* Rows inside a tbody can be staggered by position without JS. */
tbody .fade-rise:nth-child(2) { animation-delay: 30ms; }
tbody .fade-rise:nth-child(3) { animation-delay: 60ms; }
tbody .fade-rise:nth-child(4) { animation-delay: 90ms; }
tbody .fade-rise:nth-child(5) { animation-delay: 120ms; }
tbody .fade-rise:nth-child(6) { animation-delay: 150ms; }
tbody .fade-rise:nth-child(n+7) { animation-delay: 180ms; }

.bar-chart .fade-rise:nth-child(2) { animation-delay: 30ms; }
.bar-chart .fade-rise:nth-child(3) { animation-delay: 60ms; }
.bar-chart .fade-rise:nth-child(4) { animation-delay: 90ms; }
.bar-chart .fade-rise:nth-child(5) { animation-delay: 120ms; }
.bar-chart .fade-rise:nth-child(6) { animation-delay: 150ms; }

/* Staggered hero entrance */
.hero__title { animation-delay: 0ms; }
.hero__sub   { animation-delay: 80ms; }
.hero__cta   { animation-delay: 160ms; }

/* Scroll reveal (dark section) */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }
  .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-rise { animation: none; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--panel);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- announcement banner ---------- */

.announcement-banner {
  background: var(--grad-banner);
  border-bottom: 1px solid var(--hairline);
  padding: 10px 24px;
  text-align: center;
}

.announcement-banner p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}

.announcement-banner strong {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- navbar ---------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__logo {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: #000;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar__word {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink);
  white-space: nowrap;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.navbar__link {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--text-md);
  font-weight: 400;
  transition: color 0.15s, background-color 0.15s;
}

.navbar__link:hover {
  color: var(--ink);
  background: var(--panel-faint);
}

.navbar__link.is-active {
  color: var(--ink);
  font-weight: 500;
  background: var(--panel-faint);
}

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

.navbar__cta {
  text-decoration: none;
}

/* ---------- main column ---------- */

main {
  flex: 1;
  min-width: 0;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--panel-soft);
  border-top: 1px solid var(--hairline);
  padding: 28px 24px;
  margin-top: 40px;
}

.site-footer p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: 72px 24px 56px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(17, 17, 17, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 80% at 50% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: var(--page-max);
  margin: 0 auto;
}

.hero__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(34px, 5.5vw, 52px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero__accent {
  font-style: italic;
  background: var(--grad-underline);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin: 18px 0 0;
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-2);
}

.hero__cta {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- page + cards ---------- */

.page {
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--page-pad) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  flex-wrap: wrap;
  padding: 14px var(--space-5);
  border-bottom: 1px solid var(--hairline);
}

.card__title {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--ink);
}

.card__toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card__body {
  padding: var(--space-4);
}

.card__body--flush {
  padding: 0;
}

/* Wraps tables so narrow screens scroll horizontally instead of squeezing cells. */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.table-wrap .table {
  min-width: 540px;
}

/* ---------- KPI stat cards ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}

.kpi-card__value {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--ink);
}

.kpi-card__label {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin-top: 4px;
}

.kpi-card__delta {
  font-size: var(--text-xs);
  font-weight: 500;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.kpi-card__delta.is-up { color: var(--green); }
.kpi-card__delta.is-down { color: var(--red); }

/* ---------- inputs / controls ---------- */

.search-input, .select {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  min-height: 36px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input { width: clamp(160px, 28ch, 240px); max-width: 100%; }

.search-input:focus, .select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 64, 237, 0.12);
}

.search-input::placeholder { color: var(--text-3); }

.select { cursor: pointer; }

.results-status {
  padding: 10px var(--space-5) 0;
  font-size: var(--text-sm);
  color: var(--text-2);
  min-height: 18px;
}

/* ---------- mono chips ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.55);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  white-space: nowrap;
}

/* ---------- tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  text-align: left;
  padding: 12px var(--space-5);
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}

.table thead th {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-2);
  background: var(--panel);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.table tbody tr:last-child td { border-bottom: 0; }

.table tbody tr:hover { background: #fafafa; }

.t-num { text-align: right; }

.table-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  min-width: 0;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cell-name {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--brand-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-name:hover { color: var(--brand); }

.cell-sub {
  font-size: var(--text-sm);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.count {
  font-size: var(--text-base);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}

.glyph { color: var(--text-2); display: inline-flex; flex-shrink: 0; }
.glyph svg { width: 20px; height: 20px; display: block; }

/* ---------- progress bars ---------- */

.share-bar {
  display: block;
  width: 120px;
  max-width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}

.share-bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: var(--radius-sm);
  transition: width 0.6s ease;
}

tr.is-sealed .share-bar__fill { background: var(--green); }

/* ---------- buttons ---------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #000;
  color: #fff;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  min-height: 40px;
  white-space: nowrap;
  transition: background-color 0.15s, transform 0.1s ease;
}

.btn-primary:hover { background: #222222; transform: translateY(-1px); }
.btn-primary:active { transform: none; }

.btn-report {
  background: var(--panel);
  color: var(--brand-dark);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  min-height: 30px;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-report:hover:not(:disabled) {
  background: var(--brand-faint);
  border-color: var(--brand);
}

.btn-report:disabled {
  color: var(--green);
  background: var(--green-bg);
  border-color: transparent;
  cursor: default;
  font-weight: 500;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  min-height: 38px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-outline:hover {
  background: var(--panel-faint);
  border-color: var(--text-3);
}

/* ---------- segmented control ---------- */

.segmented {
  display: inline-flex;
  flex-shrink: 0;
  gap: 2px;
  background: var(--panel-faint);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 3px;
}

.segmented button {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 14px;
  min-height: 30px;
  white-space: nowrap;
  border-radius: 6px;
  background: transparent;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.segmented button:hover { color: var(--ink); }

.segmented button.is-active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---------- profile header card ---------- */

.profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  flex-wrap: wrap;
}

.profile-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.profile-card__info {
  flex: 1 1 0;
  min-width: 0;
}

.profile-card__info h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 2px;
  overflow-wrap: anywhere;
}

.profile-card__handle {
  font-size: var(--text-sm);
  color: var(--text-2);
}

.profile-card__bio {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin: 6px 0 0;
}

.kpi-card--big {
  min-width: 160px;
  flex-shrink: 0;
  margin-left: auto;
  text-align: right;
}

.kpi-card--big .kpi-card__value { font-size: 38px; }

/* ---------- bar chart (platform ranking) ---------- */

.bar-chart {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.bar-chart__label-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.bar-chart__name {
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-chart__value {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.bar-chart__track {
  height: 8px;
  border-radius: var(--radius-sm);
  background: var(--track);
  overflow: hidden;
}

.bar-chart__fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: var(--radius-sm);
  transition: width 0.8s ease;
}

.bar-chart__row.is-top .bar-chart__fill { background: var(--brand-dark); }

/* ---------- dark showcase section ---------- */

.dark-section {
  position: relative;
  background: var(--dark);
  color: #f5f5f5;
  border-radius: var(--radius-md);
  padding: 44px var(--space-5);
  overflow: hidden;
}

.dark-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-dark-glow);
  pointer-events: none;
}

.dark-section__inner {
  position: relative;
  max-width: 720px;
}

.dark-section__eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-subtle);
}

.dark-section__title {
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #fff;
}

.dark-section .bar-chart { padding: 0; }

.dark-section .bar-chart__name { color: #e5e7eb; }
.dark-section .bar-chart__value { color: #9ca3af; }
.dark-section .bar-chart__track { background: rgba(255, 255, 255, 0.12); }
.dark-section .bar-chart__fill { background: var(--brand-subtle); }
.dark-section .bar-chart__row.is-top .bar-chart__fill { background: #4d87e7; }
.dark-section .glyph { color: #9ca3af; }

/* ---------- empty state ---------- */

.empty-state {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.empty-state p {
  font-size: var(--text-base);
  color: var(--text-2);
  margin: 0 0 var(--space-4);
}

/* ---------- report dialog ---------- */

@keyframes sheet-up {
  from { transform: translateY(24px); }
  to   { transform: translateY(0); }
}

.report-dialog {
  border: 0;
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.report-dialog::backdrop {
  background: rgba(17, 17, 17, 0.45);
}

.report-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--space-5);
  border-bottom: 1px solid var(--hairline);
  background: var(--panel);
}

.report-dialog__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.report-dialog__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--panel);
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.report-dialog__close:hover {
  background: var(--panel-faint);
  border-color: var(--text-3);
  color: var(--ink);
}

.report-dialog__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.report-dialog__handle {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}

.report-dialog__link {
  display: flex;
  justify-content: center;
  text-align: center;
}

.report-dialog__steps {
  margin: 0;
  padding-left: 18px;
  font-size: var(--text-sm);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.report-dialog__help {
  font-size: var(--text-sm);
  color: var(--brand-dark);
  text-decoration: none;
  align-self: flex-start;
}

.report-dialog__help:hover { text-decoration: underline; }

.report-dialog__disclaimer {
  margin: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
  font-size: var(--text-xs);
  color: var(--text-3);
}

.report-dialog__clarify {
  margin: -8px 0 0;
  font-size: var(--text-xs);
  color: var(--text-3);
}

.report-dialog__cancel {
  align-self: flex-end;
}

/* ---------- tablet (768–1024px) ---------- */

@media (min-width: 768px) and (max-width: 1024px) {
  .page { padding: 0 14px var(--space-6); }
  .card__header { padding: 14px var(--space-4); }
  .table th, .table td { padding: 12px var(--space-4); }
}

/* ---------- mobile (≤767px) ---------- */

@media (max-width: 767px) {
  .announcement-banner { padding: 8px 16px; }

  .navbar {
    padding: 0 14px;
    gap: 10px;
  }

  .navbar__word { font-size: 17px; }

  .navbar__nav { margin-left: auto; }

  .navbar__link { padding: 8px 10px; font-size: var(--text-base); }

  .navbar__hint { display: none; }

  .navbar__cta { padding: 8px 14px; min-height: 36px; font-size: var(--text-sm); }

  .hero { padding: 44px 16px 36px; }
  .hero__sub { font-size: 16px; }

  .page {
    padding: 0 10px var(--space-5);
    gap: 10px;
  }

  .card__header {
    padding: 12px var(--space-4);
    align-items: flex-start;
  }

  .card__toolbar {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .card__toolbar .search-input,
  .card__toolbar .select {
    width: 100%;
  }

  .table th, .table td { padding: 12px var(--space-4); }

  /* Tables scroll horizontally inside the card, bleeding to card edges. */
  .table-wrap {
    margin: 0;
    scrollbar-width: none;
  }
  .table-wrap::-webkit-scrollbar { display: none; }

  /* Profile header stacks vertically, KPI spans full width. */
  .profile-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-card__info h1 { overflow-wrap: anywhere; }

  .kpi-card--big {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .share-bar { width: 100%; min-width: 80px; }

  .dark-section { padding: 32px var(--space-4); }
  .dark-section__title { font-size: 24px; }

  /* Report dialog becomes a bottom sheet, safe-area aware. */
  .report-dialog {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - env(safe-area-inset-top));
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .report-dialog__body {
    padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  }

  .report-dialog__close {
    width: 44px;
    height: 44px;
  }

  .report-dialog__link,
  .report-dialog__cancel {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .report-dialog[open] { animation: sheet-up 220ms ease-out; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .fade-rise,
  .report-dialog[open] { animation: none; }
  .share-bar__fill,
  .bar-chart__fill,
  .btn-report,
  .btn-primary,
  .btn-outline,
  .segmented button,
  .navbar__link,
  .report-dialog__close { transition: none; }
}
