:root {
  --navy: #1434cb;
  --gold: #f7b600;
  --ink: #0f1729;
  --paper: #f4f7fc;
  --cream: #ffffff;
  --surface: #ffffff;
  --line: #d4dcf0;
  --muted: #5c6578;
  --wash: #e8eef9;
  --cta: var(--gold);
  --cta-ink: #0f1729;
  --header-h: 4.4rem;
  --edge: clamp(1.75rem, 20vw, 18rem);
  --edge-rail: clamp(1.25rem, 3.5vw, 4rem);
  --radius: 14px;
  --radius-sm: 12px;
  --shadow: 0 12px 28px rgba(20, 52, 203, 0.08);
  --shadow-tight: 0 6px 16px rgba(15, 23, 41, 0.07);
  --display: "Libre Baskerville", "Georgia", serif;
  --ui: "DM Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 3.6rem);
}

body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(1100px 480px at 8% -8%, rgba(20, 52, 203, 0.09), transparent 55%),
    radial-gradient(900px 420px at 95% 0%, rgba(247, 182, 0, 0.12), transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.68;
}

img { max-width: 100%; height: auto; }

a { color: var(--navy); }
a:hover { color: #0a2888; }

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: var(--edge);
  top: 0.5rem;
  z-index: 40;
  background: var(--ink);
  color: var(--cream);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 1.1rem;
  min-height: var(--header-h);
  padding: 0.55rem var(--edge);
  background: rgba(255, 250, 243, 0.94);
  box-shadow: var(--shadow-tight);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-logo {
  width: 10.25rem;
  height: auto;
  border-radius: 12px;
}

.brand-mark {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.02rem, 2vw, 1.55rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.mobile-header-cta { display: none; }

.nav-toggle {
  margin-left: auto;
  border: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.48rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}

.nav {
  display: none;
  align-items: center;
  gap: 0.95rem;
  flex-wrap: nowrap;
}

.nav.is-open {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  padding: 0.85rem 0 0.35rem;
}

.nav a,
.nav summary {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.nav a.is-active { color: var(--navy); }

.nav-dropdown { position: relative; }
.nav-dropdown ul {
  margin: 0.4rem 0 0;
  padding: 0.55rem 0.2rem;
  list-style: none;
}

.badge-18 {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--olive);
  background: rgba(92, 107, 58, 0.12);
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.65rem;
  padding: 0.42rem 1.15rem;
  text-decoration: none;
  font-family: var(--ui);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.btn-primary,
.btn-play {
  background: var(--gold);
  color: var(--cta-ink);
  box-shadow: 0 8px 16px rgba(247, 182, 0, 0.35);
}

.btn-primary:hover { filter: brightness(1.06); color: var(--cta-ink); }

.btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.mobile-header-cta.btn { display: none; }

.page-toc--chips {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: none;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1rem calc(-1 * var(--edge)) 0;
  padding: 0.65rem var(--edge);
  background: rgba(255, 250, 243, 0.92);
  box-shadow: var(--shadow-tight);
}

.page-toc__head {
  display: flex;
  gap: 0.55rem;
  width: 100%;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--olive);
}

.page-toc__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.page-toc__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.7rem 0.22rem 0.22rem;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow-tight);
}

.page-toc__link:hover { color: var(--clay); }

.page-toc__link.is-active {
  background: var(--wash);
  color: var(--clay);
}

.page-toc__num,
.page-toc__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--clay);
  color: var(--cream);
  font-size: 0.7rem;
  font-weight: 800;
}

.anchor-nav:empty { display: none; }

#main { padding: 0 var(--edge) 3.2rem; }

.hero {
  padding: 1.8rem 0 1.15rem;
}

/* Full-bleed banner: cancel .page side padding (equal edges when no TOC rail) */
.hero--visa {
  position: relative;
  isolation: isolate;
  margin: -1.25rem calc(-1 * var(--edge)) 1rem;
  padding: 0;
  min-height: 0;
  display: block;
  border-radius: 0;
  overflow: hidden;
  border-left: none;
  box-shadow: none;
  background: #08123a;
  color: #f4f7ff;
}
.page:has(.page-toc--rail) .hero--visa {
  /* Bleed under the sticky TOC column + rail padding */
  margin-right: calc(
    -1 * (var(--edge-rail) + clamp(13rem, 16vw, 17rem) + clamp(1.25rem, 3vw, 2.75rem))
  );
}

.hero--visa::after {
  display: none;
}

.hero--visa .hero-stage {
  display: block;
  width: 100%;
  line-height: 0;
  background: #050b22;
}

.hero--visa .hero-background,
.hero--visa .hero-banner {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  margin: 0;
  object-fit: contain;
  object-position: center center;
  aspect-ratio: auto;
}

.hero--visa .hero-copy {
  position: relative;
  z-index: 2;
  padding: 1.15rem var(--edge) 1.35rem;
  background:
    linear-gradient(180deg, rgba(8, 18, 56, 0.98) 0%, #0c1c5a 100%);
  border-top: 1px solid rgba(247, 182, 0, 0.28);
}

.hero--visa .kicker {
  color: #f7b600;
}

.hero--visa h1,
.hero--visa .lede {
  color: #f4f7ff;
  text-shadow: none;
}

.hero--visa h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.75rem, 4vw, 2.65rem);
}

.hero--visa .lede {
  max-width: 40rem;
  margin: 0;
  font-size: 1.05rem;
  opacity: 0.92;
  line-height: 1.45;
}

.hero--craft {
  position: relative;
  isolation: isolate;
  margin: 1.1rem 0 0.4rem;
  padding: 1.85rem 1.4rem 1.35rem;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(232, 238, 249, 0.9) 55%, rgba(20, 52, 203, 0.12) 100%),
    radial-gradient(ellipse at 92% 8%, rgba(247, 182, 0, 0.22), transparent 52%);
  border-left: 6px solid var(--navy);
  box-shadow: var(--shadow);
}

.kicker {
  margin: 0 0 0.4rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  max-width: 46rem;
  font-size: 1.14rem;
}

.section { padding: 1.65rem 0; }

.section h2 {
  margin: 0 0 0.8rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.3vw, 1.95rem);
  font-weight: 600;
}

.section h3 {
  margin: 1.1rem 0 0.55rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
}

.prose p { margin: 0 0 1rem; }
.prose ul,
.prose ol { margin: 0 0 1rem; padding-left: 1.15rem; }

.clay-stack {
  display: grid;
  gap: 0.85rem;
}

.clay-row {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1.55fr) minmax(0, 0.9fr) minmax(7.2rem, 0.8fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem 1.1rem;
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.clay-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--clay);
  color: var(--cream);
  font-weight: 800;
  font-size: 0.82rem;
}

.clay-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.clay-logo,
.clay-logo.is-disabled {
  display: flex;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}

.clay-logo-img {
  width: 7.6rem;
  height: 2.85rem;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 0.22rem 0.35rem;
  box-shadow: var(--shadow-tight);
}

.clay-meta { min-width: 0; }

.clay-brand h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.22rem;
}

.clay-stars {
  margin: 0.18rem 0 0;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  color: var(--clay);
}

.clay-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.28rem;
}

.clay-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--olive);
  background: rgba(92, 107, 58, 0.12);
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
}

.clay-pay { margin: 0; font-size: 0.92rem; color: var(--muted); }

.clay-pays {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
}

.clay-pays img {
  width: 3.2rem;
  height: 2rem;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 0.12rem;
}

.clay-bonus {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}

.clay-bonus-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--olive);
}

.loom-criteria {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.loom-criteria span {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  box-shadow: var(--shadow-tight);
  font-size: 0.9rem;
}

.loom-criteria b {
  display: block;
  color: var(--clay);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.note { color: var(--muted); font-size: 0.94rem; }

.table-scroll {
  overflow-x: auto;
  margin-bottom: 1.2rem;
}

.content-table,
.pay-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.94rem;
  background: var(--cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-tight);
}

.content-table th,
.content-table td,
.pay-table th,
.pay-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--wash);
}

.pay-table thead th {
  background: var(--wash);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--olive);
}

.pay-table tr.is-current { background: rgba(196, 92, 38, 0.08); }
.yes { color: var(--olive); font-weight: 800; }

.pay-logos {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.pay-logos[data-grid-count="8"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pay-logo {
  margin: 0;
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.5rem 0.5rem;
  text-align: center;
  box-shadow: var(--shadow-tight);
}

.pay-logo img {
  width: 5.4rem;
  height: 2.35rem;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}

.pay-logo figcaption {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.pay-method {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.pay-method img {
  width: 3.15rem;
  height: 2rem;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 0.1rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.slot-grid[data-grid-count="10"] {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.slot-card {
  margin: 0;
  background: var(--cream);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-tight);
}

.slot-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.slot-card figcaption {
  padding: 0.4rem 0.5rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.faq details {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  margin: 0 0 0.55rem;
  box-shadow: var(--shadow-tight);
}

.faq summary {
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
}

.faq summary::marker { color: var(--olive); }

.faq details p { margin: 0.55rem 0 0.15rem; }

.weaver-portrait {
  margin: 0;
  max-width: 16rem;
}

.weaver-portrait img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  background: var(--wash);
  box-shadow: var(--shadow);
}

.weaver-portrait figcaption {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.author-portrait {
  margin: 0 auto 0.35rem;
  max-width: 11rem;
  text-align: center;
}

.author-portrait img {
  display: block;
  width: 100%;
  max-width: 11rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  background: var(--wash);
  box-shadow: var(--shadow);
  border: 3px solid #fff;
}

.author-portrait figcaption {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.author-intro {
  display: grid;
  gap: 1.25rem;
  align-items: start;
  margin: 0.4rem 0 1.4rem;
}

@media (min-width: 720px) {
  .author-intro {
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 1.75rem;
  }

  .author-portrait {
    margin: 0;
  }
}

.kiln-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.1rem 0 0;
}

.kiln-facts div {
  background: var(--cream);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  box-shadow: var(--shadow-tight);
}

.kiln-facts b {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: 0.22rem;
}

.writes-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.writes-list li { margin: 0 0 0.35rem; }

.writes-list a {
  display: block;
  padding: 0.55rem 0.8rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--cream);
  border-radius: 12px;
  box-shadow: var(--shadow-tight);
}

.writes-list a:hover { color: var(--clay); }

.loom-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 2rem 0 0;
  padding: 1rem 1.1rem;
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.loom-card img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--wash);
}

.site-footer {
  padding: 2.1rem var(--edge) 1.6rem;
  background:
    linear-gradient(180deg, rgba(92, 107, 58, 0.12), rgba(246, 239, 228, 0.4)),
    var(--wash);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr;
  gap: 1.5rem;
}

.footer-logo {
  width: 11.5rem;
  border-radius: 12px;
}

.legal-line {
  margin: 1.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: var(--clay);
  color: var(--cream);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(196, 92, 38, 0.3);
}

.to-top.is-visible { display: block; }

@media (min-width: 861px) {
  .nav-toggle { display: none; }
  .nav { display: flex; margin-left: auto; }
  .nav-dropdown ul {
    position: absolute;
    right: 0;
    min-width: 15rem;
    background: var(--cream);
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
    box-shadow: var(--shadow);
  }
  .page-toc--chips { display: flex; }
}

@media (max-width: 860px) {
  :root { --edge: clamp(0.9rem, 6vw, 1.5rem); }
  .brand { flex: 1; min-width: 0; order: 0; }
  .brand-mark { display: none; }
  .mobile-header-cta,
  .mobile-header-cta.btn {
    display: inline-flex;
    order: 1;
  }
  .nav-toggle { order: 2; margin-left: 0.35rem; }
  .page-toc--chips { display: none !important; }
  .clay-row {
    grid-template-columns: 1fr 1fr;
    padding: 1.1rem 0.9rem 0.95rem;
  }
  .clay-badge {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.72rem;
  }
  .clay-brand {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 0.35rem;
  }
  .clay-meta { text-align: center; }
  .clay-tags { display: none; }
  .clay-pays {
    grid-column: 1;
    grid-row: 2;
    justify-content: flex-start;
  }
  .clay-bonus {
    grid-column: 2;
    grid-row: 2;
    text-align: right;
  }
  .clay-row .btn {
    grid-column: 1 / -1;
    width: 100%;
  }
  .clay-logo-img { width: 8.6rem; height: 3.1rem; }
  .pay-logos,
  .pay-logos[data-grid-count="8"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .slot-grid,
  .slot-grid[data-grid-count="10"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .loom-criteria { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .kiln-facts { grid-template-columns: 1fr; }
  .table-scroll--pay {
    overflow: visible;
  }
  .table-scroll--pay table {
    min-width: 0;
    width: 100%;
    display: block;
    background: transparent;
    box-shadow: none;
  }
  .table-scroll--pay thead { display: none; }
  .table-scroll--pay tbody { display: block; }
  .table-scroll--pay tr {
    display: grid;
    grid-template-columns: minmax(7rem, 1.15fr) 1fr 1fr;
    grid-template-areas:
      "method a b"
      "method c d";
    align-items: center;
    column-gap: 0.45rem;
    row-gap: 0.3rem;
    margin: 0 0 0.55rem;
    padding: 0.65rem 0.75rem;
    background: var(--cream);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-tight);
  }
  .table-scroll--pay th,
  .table-scroll--pay td {
    display: block;
    width: auto;
    border: 0;
    padding: 0;
    white-space: normal;
  }
  .table-scroll--pay td:first-child {
    grid-area: method;
    font-weight: 800;
  }
  .table-scroll--pay td:nth-child(2) { grid-area: a; }
  .table-scroll--pay td:nth-child(3) { grid-area: b; }
  .table-scroll--pay td:nth-child(4) { grid-area: c; }
  .table-scroll--pay td:nth-child(5) { grid-area: d; }
  .table-scroll--pay td:nth-child(n+6) { display: none; }
  .table-scroll--pay td + td::before {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--olive);
    margin-bottom: 0.05rem;
  }
  .table-scroll--pay tbody tr td:nth-child(2)::before { content: "Talletus"; }
  .table-scroll--pay tbody tr td:nth-child(3)::before { content: "Kotiutus"; }
  .table-scroll--pay tbody tr td:nth-child(4)::before { content: "Nopeus"; }
  .table-scroll--pay tbody tr td:nth-child(5)::before { content: "Kulut"; }
}

.page {
  display: grid;
  /* One column by default — a reserved empty TOC track left a white gap
     on the right of the hero when the rail was missing/hidden. */
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  align-items: start;
  padding: 1.25rem var(--edge) 3.5rem;
  overflow-x: clip;
}
.page:has(.page-toc--rail) {
  grid-template-columns: minmax(0, 1fr) clamp(13rem, 16vw, 17rem);
  padding: 1.25rem var(--edge-rail) 3.5rem var(--edge);
}
#main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  padding: 0;
}
.page-toc--rail,
.anchor-nav.page-toc--rail {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
  padding: 1rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-tight);
}
.page-toc--rail .page-toc__head { margin-bottom: 0.75rem; }
.page-toc--rail .page-toc__label {
  display: block;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--navy);
}
.page-toc--rail .page-toc__hint { font-size: 0.8rem; color: var(--muted); }
.page-toc--rail .page-toc__links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.page-toc--rail .page-toc__link {
  display: grid;
  grid-template-columns: 0.65rem 1fr;
  gap: 0.55rem;
  align-items: start;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.25rem 0;
}
.page-toc--rail .page-toc__dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.42rem;
  border-radius: 50%;
  background: var(--line);
  border: 2px solid var(--gold);
}
.page-toc--rail .page-toc__link.is-active { color: var(--navy); }
.page-toc--rail .page-toc__link.is-active .page-toc__dot { background: var(--gold); }

.ranking-block h2 { margin-bottom: 0.75rem; }
.affiliate-note { color: var(--muted); font-size: 0.9rem; }
.rank-cards { display: flex; flex-direction: column; gap: 0.85rem; }
.rank-card--row {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1.3fr) minmax(0, 1fr) auto minmax(7rem, 0.9fr) auto;
  gap: 0.75rem 0.85rem;
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 5px solid var(--navy);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-tight);
}
.rank-card__badge {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(20, 52, 203, 0.1);
  color: var(--navy);
  font-weight: 800;
}
.rank-card__brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.rank-card__logo { width: 88px; height: 52px; object-fit: contain; }
.rank-card__name { margin: 0; font-weight: 800; font-size: 1.05rem; }
.rank-card__stars { color: #c5cee0; letter-spacing: 0.05em; }
.rank-card__star.is-on { color: var(--gold); }
.rank-card__features {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.rank-card__pays { display: flex; flex-wrap: nowrap; gap: 0.3rem; align-items: center; }
.rank-card__pays img {
  width: 44px;
  height: 28px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
}
.rank-card__cta { justify-self: end; }
.rank-card__cta .btn { white-space: nowrap; }

.visa-author-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1.1rem 1.2rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-tight);
}
.visa-author-card img { border-radius: 50%; width: 96px; height: 96px; object-fit: cover; }

.scaffold-note { color: var(--muted); font-style: italic; }

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 3px solid var(--navy);
}
.brand-logo { background: #fff; padding: 0.15rem 0.35rem; border-radius: 10px; }
.to-top { background: var(--navy); color: var(--gold); }

.pay-logos[data-grid-count="10"] {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    padding-left: var(--edge);
    padding-right: var(--edge);
  }
  /* Match .anchor-nav.page-toc--rail specificity or column 2 creates an
     implicit track and squeezes #main to ~0px on narrow viewports. */
  #main {
    grid-column: 1;
    grid-row: auto;
    min-width: 0;
    width: 100%;
  }
  .page-toc--rail,
  .anchor-nav.page-toc--rail {
    grid-column: 1;
    grid-row: auto;
    position: static;
    max-height: none;
    overflow: visible;
    order: -1;
    width: 100%;
  }
  .page-toc--rail .page-toc__links {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .affiliate-note {
    display: block;
    white-space: normal;
  }
  .rank-cards { gap: 0.65rem; }
  .rank-card--row {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.75rem 0.85rem 0.85rem;
    text-align: center;
  }
  .rank-card__badge {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 1;
    width: 1.7rem;
    height: 1.7rem;
    font-size: 0.78rem;
  }
  .rank-card__brand {
    grid-column: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding-top: 0.15rem;
  }
  .rank-card__id { text-align: center; }
  .rank-card__logo,
  .rank-card__logo-link .rank-card__logo {
    width: 7.25rem;
    height: 2.65rem;
  }
  .rank-card__name { font-size: 0.98rem; }
  .rank-card__stars { font-size: 0.85rem; }
  .rank-card__features { display: none; }
  .rank-card__bonus {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
    margin: 0;
    padding: 0.35rem 0.5rem;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--navy);
    background: rgba(20, 52, 203, 0.06);
    border-radius: 8px;
  }
  .rank-card__bonus-label { font-weight: 800; }
  .rank-card__pays {
    grid-column: 1;
    justify-self: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }
  .rank-card__pays img {
    width: 38px;
    height: 24px;
  }
  .rank-card__cta {
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
  }
  .rank-card__cta .btn {
    display: flex;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
  .pay-logos[data-grid-count="10"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
