/* Faktaresistens – one stylesheet for the site, the charts and the embeds.
   Colours are tokens on :root; dark mode is its own set of steps (not an inversion), chosen for the dark surface.
   Chart colours follow a colour-blind-validated categorical palette; Sweden is always slot 1 (blue). */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --surface-3: #e7e6e0;
  --border: rgba(11, 11, 11, 0.1);
  --border-strong: rgba(11, 11, 11, 0.2);
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #6b6a65;
  --ink: #0f1b2d;
  --ink-2: #1b2b45;
  --on-ink: #f4f3ee;
  --on-ink-2: #b9c0cc;
  --accent: #1c5cab;
  --accent-hover: #184f95;
  --accent-soft: #e3edfa;
  --accent-ink: #ffffff;
  --yellow: #fecc00;
  --yellow-soft: #fff4c2;
  /* chart chrome */
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --axis-text: #6b6a65;
  --muted-mark: #cfcec7;
  --muted-mark-strong: #a9a89f;
  /* categorical series, fixed order */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --s5: #e87ba4;
  --s6: #008300;
  --s7: #6250d6;
  --s8: #e34948;
  /* sequential blue */
  --q1: #cde2fb;
  --q2: #9ec5f4;
  --q3: #6da7ec;
  --q4: #3987e5;
  --q5: #256abf;
  --q6: #184f95;
  --q7: #0d366b;
  --nodata: #ebeae4;
  /* status (verdicts) – always with an icon and a word */
  --good: #0ca30c;
  --good-ink: #006300;
  --good-soft: #e3f4e3;
  --warning: #fab219;
  --warning-ink: #8a5a00;
  --warning-soft: #fff1d1;
  --critical: #d03b3b;
  --critical-ink: #b02525;
  --critical-soft: #fbe5e5;
  --shadow: 0 1px 2px rgba(16, 20, 30, 0.05), 0 8px 24px rgba(16, 20, 30, 0.06);
  --shadow-lg: 0 18px 50px rgba(16, 20, 30, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --wrap: 1180px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #222220;
    --surface-3: #2c2c2a;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #9d9c93;
    --ink: #0f1b2d;
    --ink-2: #1b2b45;
    --accent: #6da7ec;
    --accent-hover: #86b6ef;
    --accent-soft: #16263d;
    --accent-ink: #0b0b0b;
    --yellow-soft: #3a3110;
    --grid: #2c2c2a;
    --axis: #45453f;
    --axis-text: #9d9c93;
    --muted-mark: #3f3f3b;
    --muted-mark-strong: #5d5c56;
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
    --s8: #e66767;
    --q1: #12233a;
    --q2: #104281;
    --q3: #184f95;
    --q4: #256abf;
    --q5: #3987e5;
    --q6: #6da7ec;
    --q7: #b7d3f6;
    --nodata: #262624;
    --good-ink: #3fd13f;
    --good-soft: #142614;
    --warning-ink: #fab219;
    --warning-soft: #2e2510;
    --critical-ink: #ff7a7a;
    --critical-soft: #2e1515;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --surface-3: #2c2c2a;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #9d9c93;
  --ink: #0f1b2d;
  --ink-2: #1b2b45;
  --accent: #6da7ec;
  --accent-hover: #86b6ef;
  --accent-soft: #16263d;
  --accent-ink: #0b0b0b;
  --yellow-soft: #3a3110;
  --grid: #2c2c2a;
  --axis: #45453f;
  --axis-text: #9d9c93;
  --muted-mark: #3f3f3b;
  --muted-mark-strong: #5d5c56;
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #008300;
  --s7: #9085e9;
  --s8: #e66767;
  --q1: #12233a;
  --q2: #104281;
  --q3: #184f95;
  --q4: #256abf;
  --q5: #3987e5;
  --q6: #6da7ec;
  --q7: #b7d3f6;
  --nodata: #262624;
  --good-ink: #3fd13f;
  --good-soft: #142614;
  --warning-ink: #fab219;
  --warning-soft: #2e2510;
  --critical-ink: #ff7a7a;
  --critical-soft: #2e1515;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
}

/* ---------- base ---------- */
[hidden] {
  display: none !important;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
}
img,
svg {
  max-width: 100%;
}
/* Line icons follow the text size unless a component sizes them. */
.ic {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}
h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}
p {
  margin: 0;
}
.num {
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--text-3);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection {
  background: var(--yellow);
  color: #0b0b0b;
}

/* The plain page the server writes, until the app takes over. */
.seo {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px var(--gutter);
}
.seo-head {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}
.seo-head nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.seo h1 {
  font-size: 32px;
  margin-bottom: 12px;
}
.seo p,
.seo blockquote {
  max-width: 70ch;
  margin: 0 0 12px;
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap.narrow {
  max-width: 780px;
}
.page {
  padding: 32px 0 72px;
  min-height: 60vh;
}
.section {
  margin-top: 56px;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 800;
}
.section-head p {
  color: var(--text-2);
  max-width: 62ch;
  margin-top: 6px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.kicker::before {
  content: '';
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: var(--yellow);
}
.page-title {
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 850;
  letter-spacing: -0.03em;
}
.page-lead {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--text-2);
  max-width: 65ch;
  margin-top: 12px;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid.cols-2 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
}
.grid.cols-3 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.grid.cols-4 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
  font-size: 19px;
  letter-spacing: -0.035em;
  flex: none;
}
.brand:hover {
  color: var(--text);
}
.brand svg {
  width: 32px;
  height: 32px;
  flex: none;
}
.brand b {
  color: var(--accent);
  font-weight: 850;
}
.nav {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.nav a {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--text-2);
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav a[aria-current='page'] {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 -3px 0 var(--yellow);
}
.top-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: none;
}
.menu-btn {
  display: none !important;
}
.mobile-nav {
  display: none;
}
@media (max-width: 1040px) {
  .nav {
    display: none;
  }
  .menu-btn {
    display: inline-flex !important;
  }
  .top-inner {
    justify-content: space-between;
  }
  .mobile-nav {
    display: block;
    border-top: 1px solid var(--border);
    padding: 8px var(--gutter) 16px;
    background: var(--surface);
  }
  .mobile-nav a {
    display: block;
    padding: 12px 8px;
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
  }
  .mobile-nav a:last-child {
    border-bottom: 0;
  }
  .mobile-nav a[aria-current='page'] {
    box-shadow: inset 4px 0 0 var(--yellow);
    padding-left: 14px;
  }
}
@media (max-width: 520px) {
  .brand span {
    font-size: 17px;
  }
  .top-actions .hide-sm {
    display: none !important;
  }
}

/* ---------- footer ---------- */
.foot {
  background: var(--ink);
  color: var(--on-ink-2);
  padding: 48px 0 56px;
  font-size: 14.5px;
}
.foot a {
  color: var(--on-ink);
  text-decoration: none;
}
.foot a:hover {
  text-decoration: underline;
  color: #fff;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
}
.foot .brand {
  color: var(--on-ink);
  margin-bottom: 12px;
}
.foot .brand b {
  color: var(--yellow);
}
.foot h3 {
  color: var(--on-ink);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.foot-note {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}
@media (max-width: 800px) {
  .foot-grid {
    grid-template-columns: 1fr 1fr;
  }
  .foot-grid > :first-child {
    grid-column: 1 / -1;
  }
}

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}
.btn.ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.btn.ink:hover {
  background: var(--ink-2);
  color: #fff;
}
.btn.yellow {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #0b0b0b;
}
.btn.yellow:hover {
  filter: brightness(1.05);
  color: #0b0b0b;
}
.btn.danger {
  color: var(--critical-ink);
}
.btn.danger.solid {
  background: var(--critical);
  border-color: var(--critical);
  color: #fff;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: var(--surface-2);
}
.btn.icon {
  width: 40px;
  padding: 0;
}
.btn.sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13.5px;
}
.btn.sm.icon {
  width: 32px;
}
.btn.lg {
  height: 50px;
  padding: 0 24px;
  font-size: 16.5px;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn.sm svg {
  width: 15px;
  height: 15px;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 650;
  cursor: pointer;
  font-size: inherit;
  text-decoration: none;
}
.link-btn:hover {
  text-decoration: underline;
}
.arrow-link {
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.arrow-link::after {
  content: ' →';
}
.arrow-link:hover {
  text-decoration: underline;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-2);
}
.field small {
  color: var(--text-3);
  font-size: 12.5px;
}
.input,
.select,
textarea.input {
  height: 42px;
  width: 100%;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input {
  height: auto;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}
.input:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.select.sm,
.input.sm {
  height: 34px;
  font-size: 14px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14.5px;
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* segmented control */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar {
  display: none;
}
.seg button {
  border: 0;
  background: transparent;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg button svg {
  width: 16px;
  height: 16px;
}
.seg button:hover {
  color: var(--text);
}
.seg button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

/* chips */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover {
  color: var(--text);
  border-color: var(--text-3);
}
.chip[aria-pressed='true'],
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
:root[data-theme='dark'] .chip[aria-pressed='true'],
:root[data-theme='dark'] .chip.on {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .chip[aria-pressed='true'],
  :root:not([data-theme='light']) .chip.on {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
  }
}
.chip .x {
  font-size: 16px;
  line-height: 1;
  opacity: 0.7;
}
.chip .key {
  width: 12px;
  height: 4px;
  border-radius: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge.ok {
  background: var(--good-soft);
  color: var(--good-ink);
}
.badge.warn {
  background: var(--warning-soft);
  color: var(--warning-ink);
}
.badge.err {
  background: var(--critical-soft);
  color: var(--critical-ink);
}

/* verdict stamps: icon + word, never colour alone */
.verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.verdict i {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-style: normal;
  font-size: 12px;
  color: #fff;
}
.verdict.false,
.verdict.misleading {
  background: var(--critical-soft);
  color: var(--critical-ink);
}
.verdict.false i,
.verdict.misleading i {
  background: var(--critical);
}
.verdict.complicated {
  background: var(--warning-soft);
  color: var(--warning-ink);
}
.verdict.complicated i {
  background: var(--warning);
  color: #0b0b0b;
}
.verdict.true {
  background: var(--good-soft);
  color: var(--good-ink);
}
.verdict.true i {
  background: var(--good);
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad {
  padding: 20px;
}
a.card,
.card.link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
a.card:hover,
.card.link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
  color: inherit;
}

/* ---------- home: hero ---------- */
.hero {
  background: var(--ink);
  color: var(--on-ink);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 420px at 85% -10%, rgba(57, 135, 229, 0.35), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(254, 204, 0, 0.12), transparent 60%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 72px;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}
.hero h1 mark {
  background: none;
  color: var(--yellow);
}
.hero-lead {
  margin-top: 20px;
  font-size: clamp(17px, 1.7vw, 20px);
  color: var(--on-ink-2);
  max-width: 34em;
}
.hero-cta {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero .btn:not(.yellow):not(.primary) {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--on-ink);
}
.hero .btn:not(.yellow):not(.primary):hover {
  background: rgba(255, 255, 255, 0.08);
}
.hero-sources {
  margin-top: 28px;
  font-size: 13px;
  color: var(--on-ink-2);
  display: flex;
  gap: 6px 14px;
  flex-wrap: wrap;
  align-items: center;
}
.hero-sources b {
  color: var(--on-ink);
  font-weight: 700;
}
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding-top: 40px;
    padding-bottom: 48px;
    gap: 32px;
  }
}

/* the rotating fact in the hero */
.spotlight {
  background: var(--surface);
  color: var(--text);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: 22px 22px 16px;
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
.spotlight-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.spotlight-head .live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(12, 163, 12, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(12, 163, 12, 0);
  }
}
.spotlight-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  animation: fade-up 0.5s ease both;
}
.spotlight-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.spotlight-progress {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}
.spotlight-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}
.spotlight-progress i.run {
  animation: progress linear forwards;
}
@keyframes progress {
  to {
    width: 100%;
  }
}

/* ---------- facts (insight cards) ---------- */
.fact {
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  min-height: 100%;
}
.fact-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fact-top .emoji {
  font-size: 20px;
  text-transform: none;
}
.fact-head {
  font-size: 19px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.fact-figure {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.fact-figure b {
  font-size: 44px;
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1;
}
.fact-figure span {
  color: var(--text-2);
  font-size: 14px;
}
.fact-detail {
  color: var(--text-2);
  font-size: 14.5px;
}
.fact-chart {
  margin: 4px -4px 0;
}
.fact-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}
.fact-foot .src {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fact-foot a {
  font-weight: 700;
  font-size: 13.5px;
}
.spotlight .fact {
  padding: 0;
}
.spotlight .fact-head {
  font-size: 22px;
}
.spotlight .fact-figure b {
  font-size: 64px;
}
.spotlight .fact-foot {
  border-top: 0;
}

/* a gauge for self-sufficiency (0–200 %) */
.gauge {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: var(--surface-3);
  overflow: hidden;
}
.gauge i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 7px;
  background: var(--s1);
}
.gauge .mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--text);
}

/* ---------- today in Sweden: live counters ---------- */
.today {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.today-cell {
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.today-cell .emoji {
  font-size: 26px;
}
.today-cell b {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.today-cell span {
  color: var(--text-2);
  font-size: 14px;
}
.today-cell small {
  color: var(--text-3);
  font-size: 12.5px;
}
.today-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
}
@media (max-width: 760px) {
  .today {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- myth or fact? quiz ---------- */
.quiz {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}
.quiz-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
}
.quiz-card .claim {
  font-size: 21px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.quiz-card .claim::before {
  content: '”';
  display: block;
  font-size: 54px;
  line-height: 0.6;
  color: var(--yellow);
  font-weight: 900;
  margin-bottom: 4px;
}
.quiz-q {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 650;
}
.quiz-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.quiz-actions .btn {
  flex: 1;
}
.quiz-answer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fade-up 0.35s ease both;
}
.quiz-answer p {
  color: var(--text-2);
  font-size: 15px;
}
.quiz-result {
  font-weight: 750;
}

/* ---------- topics ---------- */
.topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.topic {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topic .emoji {
  font-size: 30px;
  line-height: 1;
}
.topic b {
  font-size: 17px;
  font-weight: 750;
}
.topic small {
  color: var(--text-3);
}

/* ---------- teasers on the start page ---------- */
.band {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
  margin-top: 56px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 860px) {
  .split {
    grid-template-columns: 1fr;
  }
}
.food-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cta-band {
  background: var(--yellow);
  color: #0b0b0b;
  border-radius: 24px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
}
.cta-band h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 850;
}
.cta-band p {
  margin-top: 10px;
  font-size: 17px;
  max-width: 44ch;
}
.cta-band .btn.ink {
  justify-self: start;
}
@media (max-width: 760px) {
  .cta-band {
    grid-template-columns: 1fr;
    padding: 28px;
  }
}

/* ---------- charts ---------- */
.chart-frame {
  position: relative;
  width: 100%;
}
.chart-frame svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart-frame.loading {
  opacity: 0.5;
  transition: opacity 0.2s;
}
.chart-svg text {
  font-family: var(--font);
}
.chart-svg .hit {
  cursor: pointer;
}
.chart-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  color: var(--text-3);
  text-align: center;
  padding: 24px;
}
.chart-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.year-slider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.year-slider input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}
.year-slider b {
  font-variant-numeric: tabular-nums;
  min-width: 3.2em;
  font-size: 18px;
}
.legend {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  display: inline-block;
  width: 14px;
  height: 4px;
  border-radius: 2px;
}
.legend i.box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* tooltip */
.tooltip {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  line-height: 1.4;
}
.tooltip .tt-title {
  font-weight: 750;
  margin-bottom: 4px;
}
.tooltip .tt-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.tooltip .tt-row i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.tooltip .tt-row b {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tooltip .tt-row span {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tooltip .tt-big {
  font-size: 20px;
  font-weight: 800;
}
.tooltip .tt-sub {
  color: var(--text-3);
  font-size: 12.5px;
}

/* the table view of a chart */
.data-table-wrap {
  overflow: auto;
  max-height: 460px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th,
table.data td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th:first-child,
table.data td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--surface);
}
table.data thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-2);
  z-index: 1;
}
table.data td {
  font-variant-numeric: tabular-nums;
}
table.data tr.hl td {
  font-weight: 750;
  background: var(--accent-soft);
}

/* ---------- the explore page ---------- */
.explore-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.topic-nav {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topic-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-2);
  font-weight: 650;
  font-size: 15px;
}
.topic-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.topic-nav a[aria-current='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.topic-nav .count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
}
.search-box {
  position: relative;
}
.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-3);
}
.search-box .input {
  padding-left: 42px;
  height: 48px;
  border-radius: 999px;
  font-size: 16px;
}
.ind-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}
.ind-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
}
.ind-card .t {
  font-weight: 750;
  font-size: 16.5px;
  line-height: 1.3;
}
.ind-card .d {
  color: var(--text-2);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ind-card .meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}
.ind-card .v {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
@media (max-width: 900px) {
  .explore-layout {
    grid-template-columns: 1fr;
  }
  .topic-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
  }
  .topic-nav a {
    white-space: nowrap;
    border: 1px solid var(--border);
    background: var(--surface);
  }
  .topic-nav .count {
    display: none;
  }
}

/* ---------- an indicator's page ---------- */
.ind-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.crumbs {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crumbs a {
  color: var(--text-2);
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}
.viewer {
  margin-top: 24px;
  padding: 20px;
}
.viewer-bar {
  display: flex;
  gap: 10px 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.note-box {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--text);
  font-size: 14.5px;
  border-left: 4px solid var(--warning);
}
.note-box b {
  white-space: nowrap;
}
.source-line {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-3);
  margin-top: 14px;
}
.source-line a {
  color: var(--text-2);
}
.side-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.stat-tile {
  padding: 16px 18px;
}
.stat-tile span {
  display: block;
  font-size: 13px;
  color: var(--text-3);
  font-weight: 650;
}
.stat-tile b {
  display: block;
  font-size: 30px;
  font-weight: 850;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.stat-tile small {
  color: var(--text-2);
  font-size: 13.5px;
}

/* country picker */
.picker {
  position: relative;
}
.picker-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  list-style: none;
  margin: 0;
}
.picker-list li {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.picker-list li[aria-selected='true'],
.picker-list li:hover {
  background: var(--accent-soft);
}
.picker-list li small {
  color: var(--text-3);
}

/* ---------- myths & explainers ---------- */
.myth-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 16px;
}
.myth-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.myth-card .claim {
  font-size: 19px;
  font-weight: 750;
  line-height: 1.35;
}
.myth-card .teaser {
  color: var(--text-2);
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article {
  max-width: 760px;
}
.article .claim-box {
  margin: 20px 0 8px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--critical);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}
.article .claim-box.true {
  border-left-color: var(--good);
}
.article .claim-box.complicated {
  border-left-color: var(--warning);
}
.prose {
  font-size: 17.5px;
  line-height: 1.7;
}
.prose > * + * {
  margin-top: 1em;
}
.prose h2 {
  font-size: 24px;
  margin-top: 1.6em;
  font-weight: 800;
}
.prose ul {
  padding-left: 1.2em;
}
.prose li + li {
  margin-top: 0.4em;
}
.prose strong {
  font-weight: 750;
}
.prose .embed-chart {
  margin: 1.6em 0;
}
.sources-list {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 14.5px;
}
.sources-list h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.sources-list ul {
  margin: 0;
  padding-left: 1.1em;
}

/* ---------- we need each other ---------- */
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 6px 28px;
}
.food-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 58px;
  gap: 4px 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.food-row .emoji {
  font-size: 24px;
  grid-row: 1 / 3;
}
.food-row .name {
  font-weight: 650;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.food-row .pct {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  grid-row: 1 / 3;
  grid-column: 3;
}
.food-row .bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
}
.food-row .bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  background: var(--s1);
  transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.food-row .bar .full {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 50%;
  width: 2px;
  background: var(--text-2);
}
.food-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-3);
  margin: 10px 0 18px;
}
.food-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.food-group {
  padding: 18px;
}
.food-group b {
  display: block;
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -0.03em;
}
.food-group .emojis {
  font-size: 24px;
  letter-spacing: 2px;
  margin-top: 8px;
  line-height: 1.5;
}
@media (max-width: 760px) {
  .food-groups {
    grid-template-columns: 1fr;
  }
}
.origin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}
.origin-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.origin-card h3 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.origin-card h3 .emoji {
  font-size: 28px;
}
.origin-card .meta {
  font-size: 13.5px;
  color: var(--text-3);
}
.hbars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hbar {
  display: grid;
  grid-template-columns: minmax(80px, 40%) minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
  font-size: 14px;
}
.hbar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hbar .track {
  height: 10px;
  background: var(--surface-3);
  border-radius: 0 5px 5px 0;
}
.hbar .track i {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--s1);
}
.hbar.hl span {
  font-weight: 750;
}
.hbar.muted .track i {
  background: var(--muted-mark-strong);
}
.hbar b {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
}

/* ---------- combine ---------- */
.combine-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
@media (max-width: 760px) {
  .combine-bar {
    grid-template-columns: 1fr;
  }
}
.r-meter {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.r-meter b {
  font-size: 28px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.r-meter .scale {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--s8), var(--surface-3) 50%, var(--s1));
  position: relative;
}
.r-meter .scale i {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--text);
  transform: translateX(-2px);
}
.why-box {
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  font-size: 15px;
}
.why-box h3 {
  font-size: 16px;
  margin-bottom: 6px;
}
.why-box ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

/* ---------- builder ---------- */
.builder {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.builder-side {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.builder-step h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.builder-step h3 i {
  font-style: normal;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 11px;
}
.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.type-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
}
.type-grid button svg {
  width: 26px;
  height: 26px;
}
.type-grid button[aria-pressed='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  color: var(--text);
}
.type-grid button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.builder-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stage-canvas {
  padding: 16px;
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 24px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.stage-canvas .graphic-card {
  box-shadow: var(--shadow-lg);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
}
.share-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 980px) {
  .builder {
    grid-template-columns: 1fr;
  }
  .builder-side {
    position: static;
    max-height: none;
  }
}

/* ---------- graphic page & gallery ---------- */
.graphic-card {
  background: var(--surface);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.gallery-item {
  overflow: hidden;
}
.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.gallery-item .gi-body {
  padding: 12px 14px;
}
.gallery-item .gi-body b {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}
.gallery-item .gi-body small {
  color: var(--text-3);
}
.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}

/* ---------- dialogs ---------- */
dialog.modal {
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 0;
  width: min(580px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop {
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(3px);
}
dialog.modal.small {
  width: min(440px, calc(100vw - 24px));
}
dialog.modal.wide {
  width: min(880px, calc(100vw - 24px));
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 6px;
}
.modal-head h2 {
  font-size: 20px;
}
.modal-body {
  padding: 10px 20px 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px 20px;
  flex-wrap: wrap;
}
.modal-foot .left {
  margin-right: auto;
}
.form-error {
  color: var(--critical-ink);
  background: var(--critical-soft);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.form-notice {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.form-notice.success {
  background: var(--good-soft);
  border-color: transparent;
}
.form-notice.info {
  background: var(--accent-soft);
  border-color: transparent;
}
.hint {
  font-size: 13.5px;
  color: var(--text-3);
}

/* ---------- toasts & popovers ---------- */
.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: fade-up 0.2s ease;
}
.toast.error {
  background: var(--critical);
  color: #fff;
}
.popover {
  position: absolute;
  z-index: 60;
  min-width: 240px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.popover .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
  font-size: 15px;
}
.popover .menu-item:hover {
  background: var(--surface-2);
}
.popover .menu-item svg {
  width: 18px;
  height: 18px;
  color: var(--text-3);
}
.popover hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
  width: 100%;
}
.popover .who {
  padding: 8px 12px 6px;
  font-size: 13px;
  color: var(--text-3);
}
.popover .who b {
  display: block;
  color: var(--text);
  font-size: 15px;
}

/* ---------- sign-in pages ---------- */
.auth {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-art {
  background: var(--ink);
  color: var(--on-ink);
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
.auth-art h1 {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 900;
  letter-spacing: -0.035em;
  max-width: 14em;
}
.auth-art p {
  color: var(--on-ink-2);
  font-size: 17px;
  max-width: 32em;
}
.auth-art ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-art li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.auth-art li::before {
  content: '✓';
  color: var(--yellow);
  font-weight: 900;
}
.auth-form-wrap {
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.auth-form {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form h2 {
  font-size: 28px;
  font-weight: 850;
}
.auth-form .sub {
  margin: -6px 0 4px;
  color: var(--text-2);
}
.auth-form .btn {
  height: 46px;
}
.auth-switch {
  text-align: center;
  color: var(--text-2);
  font-size: 14.5px;
}
.auth-icon {
  font-size: 40px;
  line-height: 1;
}
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.field-row .link-btn {
  font-size: 13px;
}
.pw-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-3);
}
.pw-bars {
  display: flex;
  gap: 3px;
}
.pw-bars i {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
}
.pw-meter[data-score='0'] .pw-bars i.on,
.pw-meter[data-score='1'] .pw-bars i.on {
  background: var(--critical);
}
.pw-meter[data-score='2'] .pw-bars i.on {
  background: var(--warning);
}
.pw-meter[data-score='3'] .pw-bars i.on,
.pw-meter[data-score='4'] .pw-bars i.on {
  background: var(--good);
}
@media (max-width: 860px) {
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    padding: 32px var(--gutter);
  }
}

/* ---------- account ---------- */
.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
.account-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}
.account-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
@media (max-width: 900px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- admin ---------- */
.admin-tabs {
  margin: 20px 0;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.admin-stat {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-stat span {
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.admin-stat b {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.admin-stat small {
  color: var(--text-3);
}
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-card h2 {
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-setting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
}
.admin-checks li {
  display: grid;
  grid-template-columns: 12px 120px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.admin-checks .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-3);
  display: inline-block;
}
.dot.ok {
  background: var(--good);
}
.dot.bad {
  background: var(--critical);
}
.dot.warn {
  background: var(--warning);
}
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-users-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.admin-users-head .input {
  max-width: 280px;
}
.admin-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.au-main {
  min-width: 0;
}
.au-name {
  font-weight: 700;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.au-sub {
  font-size: 13px;
}
.au-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-table-wrap {
  overflow-x: auto;
}
table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.admin-table th,
table.admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
table.admin-table td.msg {
  max-width: 360px;
  color: var(--text-3);
  font-size: 13px;
  word-break: break-word;
}
.fact-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.fact-editor .full {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .admin-grid,
  .fact-editor {
    grid-template-columns: 1fr;
  }
  .admin-user {
    flex-direction: column;
    align-items: flex-start;
  }
  .au-actions {
    justify-content: flex-start;
  }
}

/* ---------- embeds ---------- */
.embed-body {
  background: var(--surface);
}
.embed {
  padding: 0;
}
.embed .graphic-card {
  width: 100%;
}
.embed-error {
  padding: 24px;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- misc ---------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-2);
}
.empty-state h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}
.loading-line {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
  min-height: 180px;
}
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
@media print {
  .top,
  .foot,
  .share-row,
  .viewer-bar {
    display: none !important;
  }
  body {
    background: #fff;
  }
}
