@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500;1,600&family=Inter+Tight:wght@300;400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Design tokens — Direction B: Kalevala / scholarly ─── */
:root {
  --bg:      #ece5d4;
  --surface: #f6f0df;
  --ink:     #1a1f2b;
  --ink-2:   #3d4654;
  --ink-3:   #80796a;
  --rule:    #c8bea1;
  --primary: #1f3a52;
  --primary-2: #355374;
  --accent:  #bd6d59;
  --warm:    #a78250;
  --swan:  #eeeeee;
  --logotext: #f6f0df;
  --grey: #999999;

  --sans:  'Inter Tight', system-ui, -apple-system, sans-serif;
  --serif: 'Newsreader', 'Cormorant Garamond', Georgia, serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;

  --max: 780px;
  --pad: clamp(1.25rem, 5vw, 3rem);
  --r:   10px;
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  background-image: radial-gradient(rgba(0,0,0,.018) 1px, transparent 1px);
  background-size: 3px 3px;
}

/* ─── Container ─────────────────────────────────────── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
 
  background-repeat: repeat;
  background-size: 180px 120px;
}

/* ─── Folk border ───────────────────────────────────── */
.folk-bar {
  color: var(--primary);
  background: var(--surface);
  overflow: hidden;
  line-height: 0;
}

/* ─── Rule ──────────────────────────────────────────── */
.kj-rule {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  opacity: .45;
  max-width: var(--max);
  margin: 2.5rem auto;
  padding: 0 var(--pad);
}

/* ═══════════════════════════════════════════════════
   INDEX PAGE
   ═══════════════════════════════════════════════════ */

/* ─── Site header ───────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
  background-image: url('forest-pattern.svg');
  position: relative;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: none;
}

/* ─── Logo ──────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.logo-swan { color: var(--swan); flex-shrink: 0; }
.logo-name {
  display: block;
  font-family: var(--serif);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.015em;
  line-height: 1.02;
  color: var(--logotext);
}
.logo-sub {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 9px;
  font-weight: 500;
  color: var(--rule);
  padding-top: 5px;
}
/* Initial letter — K and J */
.logo-initial {
  font-style: italic;
  color: var(--accent);
  font-size: 1.22em;
  line-height: 1;
  letter-spacing: 0;
}

/* Compact in sticky text-page header */
.text-page-header .logo-name {
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* ─── Header nav ────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-shrink: 0;
  color: var(--rule);
  
}
.site-nav-item {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--rule);
  text-decoration: none;
  transition: color 0.12s;
  white-space: nowrap;
  padding-top: 1.5rem;
}
.site-nav-item:hover { color: var(--warm); }
.site-nav-item--active { color: var(--warm); }

/* ─── Burger menu button ────────────────────────────── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.burger-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--logotext);
  border-radius: 2px;
  transition: transform 0.22s, opacity 0.22s;
  transform-origin: center;
}
.nav-burger.is-open .burger-bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.nav-burger.is-open .burger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-burger.is-open .burger-bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ─── Page intro ────────────────────────────────────── */
.page-intro {
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
  
}
.kj-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 1.25rem;
}
.page-intro h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4.2vw, 3.125rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 0.875rem;
}
.page-intro-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--ink-3);
}

/* ─── Level sections ────────────────────────────────── */
.level-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.level-section:last-of-type { border-bottom: none; }

.level-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 0;
}
/* breathing room below the header only when the section is open */
.level-collapse[open] > summary.level-header { margin-bottom: 1.75rem; }
/* level icons sit inline on the section-name line, inheriting its colour
   (accent normally, --warm on hover, --ink-2 in dark) */
.level-name .level-icon {
  color: inherit;
  margin-right: 0.5rem;
}
.level-name .level-icon svg {
  width: 1.15em;
  height: 1.15em;
}

/* ─── Level badges ──────────────────────────────────── */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--rule);
}
.badge-sm { width: 2.25rem; height: 2.25rem; font-size: 0.6875rem; }

/* all level badges share one subtle, theme-aligned style */
.lvl-a1, .lvl-a2, .lvl-b1, .lvl-b2 { background: var(--surface); color: var(--ink-2); }

/* width of the inline icon + chevron block on the name line; the eyebrow and
   description are indented by this so their text lines up with the level name */
.level-meta { flex: 1; --hdr-indent: 4.06rem; }
.level-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
  padding-left: var(--hdr-indent);
}
.level-name {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.level-name-en {
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink-3);
  font-family: var(--sans);
  font-style: normal;
  letter-spacing: 0;
}
.level-desc {
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-top: 0.25rem;
  font-style: italic;
  font-family: var(--serif);
  padding-left: var(--hdr-indent);
}

/* ─── Lukutekstit 2-column layout ──────────────────── */
.levels-grid {
  display: block;
  padding-bottom: 13.5rem;
}
.levels-grid #level-a1 { grid-column: 1; grid-row: 1; }
.levels-grid #level-a2 { grid-column: 2; grid-row: 1; }
.levels-grid #level-b1 { grid-column: 1; grid-row: 2; }
.levels-grid #level-b2 { grid-column: 2; grid-row: 2; }
.levels-grid .level-section { border-bottom: none; }
@media (max-width: 600px) {
  .levels-grid { display: block; }
}

/* ─── Text list ─────────────────────────────────────── */
.text-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}
.text-list li { border-bottom: 1px solid var(--rule); }

li {font-size: 1.1875rem; font-family: var(--serif);}

.text-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9375rem 0.25rem 0.9375rem 0;
  text-decoration: none;
  color: var(--accent);
  transition: color 0.12s;
}
.text-link:hover { color: var(--warm); }

.text-icon {
  flex-shrink: 0;
  color: var(--accent);
  transition: color 0.12s;
  opacity: 0.6;
}
.text-link:hover .text-icon { color: var(--warm); opacity: 1; }

.text-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-3);
  min-width: 1.75rem;
  flex-shrink: 0;
  transition: color 0.12s;
}
.text-link:hover .text-num { color: var(--ink-3); }

.text-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.text-fi-link {
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.3;
}
.text-en-link {
  font-size: 0.8125rem;
  color: var(--ink-3);
  font-weight: 300;
}
.text-arrow {
  color: var(--ink-3);
  font-size: 0.8125rem;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.12s, transform 0.12s;
}
.text-link:hover .text-arrow { opacity: 1; transform: translateX(0); }

/* ─── Collapsible level sections (lukutekstit hub) ───── */
.level-collapse > summary { cursor: pointer; list-style: none; }
.level-collapse > summary::-webkit-details-marker { display: none; }
.level-collapse .level-name .level-icon::after {
  content: '';
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.5rem;
  vertical-align: middle;
  background-color: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 5.5 L16 12 L9 18.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 5.5 L16 12 L9 18.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: transform 0.15s, background-color 0.12s;
}
.level-collapse[open] .level-name .level-icon::after { transform: rotate(90deg); }
.level-collapse > summary:hover .level-name { color: var(--warm); }
.level-collapse > summary:hover .level-name .level-icon::after { background-color: var(--ink-3); }

/* ─── Footer skyline ────────────────────────────────── */
.footer-skyline {
  width: 100%;
  line-height: 0;
  overflow: hidden;
}
.footer-skyline img {
  display: block;
  width: 100%;
  height: auto;
}

/* ─── Home ─────────────────────────────────────────── */
.home {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--pad) 4rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

/* Hero (left column) */
.home-hero { text-align: left; }
.home-kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}
/* let a .home-kicker label keep its accent colour + mono look inside
   .text-body, where the more specific `.text-body p` would override them */
.text-body .home-kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
}
.home-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
}
.home-title-en {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  color: var(--ink-3);
  margin: 0.4rem 0 0;
}
.home-sub {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 34rem;
  margin: 1.5rem 0 0;
}
.home-sub-en { display: block; color: var(--ink-3); margin-top: 0.25rem; font-family: var(--serif); padding-top: 0.875rem;}

/* CTAs */
.home-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem 1.5rem;
  margin-top: 2rem;
}
.btn-primary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--surface);
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: var(--r);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.0625rem;
  transition: background 0.15s, transform 0.15s;
}
.btn-primary .btn-en { font-size: 0.8rem; font-weight: 400; opacity: 0.75; }
.btn-primary .btn-arrow { font-size: 1.15rem; color: var(--accent); }
.btn-primary:hover { background: var(--primary-2); transform: translateY(-1px); }
.btn-text {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.btn-text .btn-en-inline { color: var(--ink-3); }
.btn-text:hover { color: var(--accent); border-color: var(--accent); }

/* Links (right column) — rows, no boxes */
.home-cards {
  display: flex;
  flex-direction: column;
  /* drop the right column so the first card title's cap-top aligns with
     the hero title ("Learn Finnish…"); tuned against the rendered page */
  margin-top: 2rem;
}
.home-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: color 0.15s;
}
.home-card:first-child { padding-top: 0; }
.home-card:last-child { border-bottom: none; padding-bottom: 0; }
.home-card-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.5rem; }
.home-card-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent);
  transition: color 0.15s;
}
.home-card-title-en {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.home-card-desc { font-family: var(--serif); font-size: 1rem; line-height: 1.5; color: var(--ink-2); }
.home-card-desc-en { font-family: var(--serif); font-size: 0.9rem; line-height: 1.5; color: var(--ink-3); }
.home-card:hover .home-card-title { color: var(--warm); }

/* Load reveal */
@media (prefers-reduced-motion: no-preference) {
  .home-hero > *,
  .home-card { animation: home-rise 0.5s both; }
  .home-hero > *:nth-child(1) { animation-delay: 0.02s; }
  .home-hero > *:nth-child(2) { animation-delay: 0.06s; }
  .home-hero > *:nth-child(3) { animation-delay: 0.10s; }
  .home-hero > *:nth-child(4) { animation-delay: 0.14s; }
  .home-hero > *:nth-child(5) { animation-delay: 0.18s; }
  .home-card:nth-child(1) { animation-delay: 0.22s; }
  .home-card:nth-child(2) { animation-delay: 0.27s; }
  .home-card:nth-child(3) { animation-delay: 0.32s; }
  .home-card:nth-child(4) { animation-delay: 0.37s; }
  @keyframes home-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
}

@media (max-width: 720px) {
  .home { grid-template-columns: 1fr; }
  .home-hero { text-align: center; }
  .home-cta { justify-content: center; }
  .home-cards { margin-top: 0; }
}

/* ─── Site background — full-width photo band directly above the footer (ALL pages) ─── */
/* Footer: page colour + top line. The photo is a full-width band pinned directly above it via ::before. */
.site-footer { position: relative; background: var(--bg); border-top: 1px solid var(--rule); }
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;            /* sit directly above the footer */
  height: 56.25vw;         /* full image aspect at full width (1920x1080) */
  max-height: 70vh;
  z-index: -1;             /* behind the page content, above the page background */
  pointer-events: none;
  background-image:
    linear-gradient(to top, rgba(246, 240, 223, 0.4) 0%, var(--bg) 100%),
    url("/bg2_day.jpg");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 100%, cover;
}

/* Dark theme — redefine the design tokens so all components adapt automatically */
html.theme-dark {
  --bg: #10141c;
  --surface: #1c2330;
  --ink: #eee6d2;
  --ink-2: #b9b2a2;
  --ink-3: #8a93a1;
  --rule: rgba(238, 230, 210, 0.14);
  --primary: #335779;
  --primary-2: #426b91;
  --accent: #cf7f6a;
  --warm: #c79a64;
}

/* Header is navy in both themes — keep its text from following the token swap */
html.theme-dark .site-nav-item,
html.theme-dark .logo-sub { color: #c8bea1; }
/* header is navy in both themes, so the nav uses the same colours as light:
   restore the hover + active-page highlight (the base rule above out-specifies
   the un-themed :hover / --active rules, and --warm shifts in dark) */
html.theme-dark .site-nav-item:hover,
html.theme-dark .site-nav-item--active { color: #a78250; }
html.theme-dark .theme-toggle { color: #c8bea1; border-color: rgba(246, 240, 223, 0.28); }

/* Dark theme — page background, night photo band, and footer */
html.theme-dark body { background-color: var(--bg); }
html.theme-dark .site-footer { background: var(--bg); border-top: 1px solid var(--rule); }
html.theme-dark .site-footer::before {
  background-image:
    linear-gradient(to top, rgba(16, 20, 28, 0.5) 0%, #10141c 100%),
    url("/bg_night.jpg");
}
html.theme-dark .footer-copy { color: rgba(246, 240, 223, 0.6); }

/* Dark theme — homepage hero/cards (Phase 1). Other page content is styled in Phase 2. */
html.theme-dark body.home-page .home-kicker { color: var(--accent); }
html.theme-dark body.home-page .home-title { color: #f6f0df; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
html.theme-dark body.home-page .home-title-en { color: rgba(246, 240, 223, 0.78); }
html.theme-dark body.home-page .home-sub { color: rgba(246, 240, 223, 0.92); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
html.theme-dark body.home-page .home-sub-en { color: rgba(246, 240, 223, 0.68); }
html.theme-dark body.home-page .btn-primary { border: 1px solid rgba(246, 240, 223, 0.18); }
html.theme-dark body.home-page .btn-text { color: #f6f0df; border-color: rgba(246, 240, 223, 0.45); }
html.theme-dark body.home-page .btn-text .btn-en-inline { color: rgba(246, 240, 223, 0.7); }
html.theme-dark body.home-page .btn-text:hover { color: var(--accent); border-color: var(--accent); }
html.theme-dark body.home-page .home-card { border-bottom-color: rgba(246, 240, 223, 0.2); }
/* home cards use the same token-based link scheme as lukutekstit/index.html:
   title --ink-2 → --ink on hover; EN label + descriptions fall back to the
   adaptive --ink-3 / --ink-2 tokens (no bespoke cream overrides) */
html.theme-dark body.home-page .home-card-title { color: var(--ink-2); }
html.theme-dark body.home-page .home-card:hover .home-card-title { color: var(--ink); }

/* Dark theme — Phase 2: fixes for hardcoded / inverted spots on content pages */
html.theme-dark .audio-btn { color: #f0e8d0; }                  /* icon stays light on the navy button */
html.theme-dark .panel > summary:hover { background: rgba(238, 230, 210, 0.06); }

/* Dark theme: swap rest ↔ hover for links, section names, panel names, answer toggle */
html.theme-dark .text-link { color: var(--ink-2); }
html.theme-dark .text-link:hover { color: var(--ink); }
html.theme-dark .text-icon { color: var(--ink-2); }
html.theme-dark .text-link:hover .text-icon { color: var(--ink); }
html.theme-dark .text-audio-slot { color: var(--ink-2); }
html.theme-dark .text-link:hover .text-audio-slot { color: var(--ink); }
html.theme-dark .level-name { color: var(--ink-2); }
html.theme-dark .level-collapse > summary:hover .level-name { color: var(--ink); }
html.theme-dark .panel > summary { color: var(--ink-2); }
html.theme-dark .panel > summary:hover { color: var(--ink); }
html.theme-dark .qa-answer > summary { color: var(--ink-2); }
html.theme-dark .qa-answer > summary:hover { color: var(--ink); }
html.theme-dark .fi-word:hover,
html.theme-dark .vocab-word:hover,
html.theme-dark .text-body [data-lemma]:hover { background: rgba(238, 230, 210, 0.10); }
/* dark theme: the navy --primary dotted underline is too faint — match it to the
   word's own text colour so it reads as "tap me", keeping the accent on hover */
html.theme-dark .text-body [data-lemma] { text-decoration-color: currentColor; }
html.theme-dark .text-body [data-lemma]:hover { text-decoration-color: var(--accent); }
/* hovers that used navy as a text colour are too dim on dark → use the accent */
html.theme-dark .back-link:hover,
html.theme-dark .fi-word:hover,
html.theme-dark .audio-skip:not(:disabled):hover,
html.theme-dark .audio-speed-btn:hover { color: var(--accent); }
html.theme-dark body.home-page .site-footer { background: #10141c; border-top: 1px solid rgba(246, 240, 223, 0.18); }
html.theme-dark body.home-page .footer-copy { color: rgba(246, 240, 223, 0.6); }

/* Header-right group + light/dark toggle button */
.header-right { display: flex; align-items: center; gap: 1.5rem; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.025rem;
  height: 2.025rem;
  margin-top: 1.5rem; /* drop onto the nav text line (nav items have padding-top: 1.5rem) */
  background: none;
  border: 1px solid rgba(246, 240, 223, 0.28);
  border-radius: 50%;
  color: var(--rule);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s;
}
.theme-toggle:hover { color: var(--warm); border-color: rgba(246, 240, 223, 0.55); }
.theme-toggle svg { width: 0.99rem; height: 0.99rem; display: block; }
.theme-toggle .icon-sun { display: none; }
html.theme-dark .theme-toggle .icon-sun { display: block; }
html.theme-dark .theme-toggle .icon-moon { display: none; }

/* ─── Footer ────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  padding: 0;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.footer-copy {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--ink-3);
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.footer-links a {
  font-size: 0.8125rem;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.12s;
}
.footer-links a:hover { color: var(--ink); }

/* ═══════════════════════════════════════════════════
   TEXT PAGES
   ═══════════════════════════════════════════════════ */

/* ─── Page header (sticky) ──────────────────────────── */
.text-page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}
.text-page-header .folk-bar { line-height: 0; }
.text-page-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.12s;
}
.back-link:hover { color: var(--primary); }

/* ─── Text hero ─────────────────────────────────────── */
.text-article { padding-bottom: 4rem; }

.text-hero {
  background: var(--bg);
  padding: 1.5rem 0 0;
}
.text-fi-h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 4.2vw, 3.125rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 0;
}
.text-en-h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--ink-3);
}
.text-fi-h1.has-flyout {
  position: relative;
  display: inline-block;
  cursor: help;
}
.title-flyout {
  position: absolute;
  left: 100%;
  bottom: 100%;
  margin-left: 0.5rem;
  margin-bottom: 0.25rem;
  background: var(--primary);
  color: #f0e8d0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  z-index: 50;
}
.text-fi-h1.has-flyout:hover .title-flyout,
.text-fi-h1.has-flyout:focus .title-flyout,
.text-fi-h1.has-flyout.flyout-open .title-flyout {
  opacity: 1;
  transform: translateY(0);
}
.text-hero-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* ─── Finnish text body ─────────────────────────────── */
.text-body { padding: 1.5rem 0 1rem; }
.text-body p {
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 1.35em;
}
.text-body p:last-child { margin-bottom: 0; }



/* ─── Collapsible panels ────────────────────────────── */
.panel {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  margin: 1.5rem 0;
  overflow: hidden;
  background: var(--surface);
}
.panel > summary {
  padding: 0.9375rem 1.25rem;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--accent);
  user-select: none;
  transition: background 0.12s;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::before {
  content: '▸';
  font-size: 0.625rem;
  color: var(--accent);
  opacity: .6;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.panel[open] > summary::before { transform: rotate(90deg); }
.panel > summary:hover { background: #ede7d4; color: var(--warm); }
.panel[open] > summary { border-bottom: 1px solid var(--rule); }

.panel-body { padding: 1.5rem 1.375rem; }
.panel-body p {
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.75;
  color: var(--ink-2);
  margin-bottom: 1.35em;
}
.panel-body p:last-child { margin-bottom: 0; }
.panel-body ul,
.panel-body ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.panel-body li {
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.75;
  color: var(--ink-2);
  margin-bottom: 0.6em;
}
.panel-body code {
  font-family: var(--mono);
  font-size: 0.8125em;
  background: rgba(31,58,82,.08);
  padding: 0.125em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}
.panel-grammar > summary { color: var(--accent); }
.panel-grammar > summary::before { color: var(--accent); opacity: .6; }

/* Per-question answer reveal in the Kysymyksiä panel — inline: the clickable
   "Vastaus / Answer" sits on the question's line and is replaced by the answer. */
.qa-answer { display: inline; }
.qa-answer > summary {
  display: inline;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  user-select: none;
}
.qa-answer > summary::-webkit-details-marker { display: none; }
.qa-answer > summary:hover { color: var(--warm); }
.qa-answer[open] > summary { display: none; }
.qa-answer-body { color: var(--ink-2); }

/* ─── Word hover tooltip ────────────────────────────── */
.fi-word {
  cursor: help;
  border-radius: 2px;
  transition: background 0.08s, color 0.08s;
}
.fi-word:hover {
  background: rgba(31, 58, 82, 0.09);
  color: var(--primary);
}
.word-tooltip {
  position: fixed;
  z-index: 300;
  background: var(--primary);
  color: #f0e8d0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.45;
  padding: 0.5rem 0.875rem;
  border-radius: 4px;
  max-width: 340px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.12s, transform 0.12s;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}
.word-tooltip.tip-on {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Text navigation ───────────────────────────────── */
.text-nav {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  padding: 1.125rem 0;
}
.text-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  max-width: 38%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-link:hover { background: var(--rule); color: var(--ink); }
.nav-home { color: var(--ink-3); flex-shrink: 0; }
.nav-disabled { color: var(--ink-3); opacity: 0.35; pointer-events: none; }

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 600px) {
  .text-hero { padding: 1.25rem 0 0; }
  .level-section { padding: 1.25rem 0; }
  .text-body p { font-size: 1.0625rem; }
  .page-intro h1 { letter-spacing: -0.02em; }
  .footer-links { gap: 1rem; flex-wrap: wrap; }
}

/* The nav collapses to a burger before it can overlap the logo (~835px). */
@media (max-width: 840px) {
  .nav-burger { display: flex; }
  /* nav is collapsed here, so there is no nav line to align to — centre the toggle */
  .theme-toggle { margin-top: 0; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .site-nav.nav-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .site-nav-item {
    padding: 0.875rem var(--pad);
    font-size: 1.0625rem;
    border-bottom: 1px solid var(--rule);
    white-space: normal;
  }
  .site-nav-item:last-child { border-bottom: none; }
}

  .simple-link {
  
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--accent);
  text-decoration: underline dotted;
  transition: color 0.12s;
  white-space: nowrap;
 
  }
  .simple-link:hover { color: var(--ink-3); }

/* ═══════════════════════════════════════════════════
   SANASTO (VOCABULARY) PAGES
   ═══════════════════════════════════════════════════ */

/* ─── Search bar ────────────────────────────────────── */
/* alphabet jump index, above the search */
.sanasto-alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  padding-top: 1.5rem;
  margin-bottom: -0.25rem;
}
.sanasto-alpha-link {
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}
.sanasto-alpha-link:hover {
  color: var(--accent);
  background: var(--surface);
}

.sanasto-search-wrap {
  padding-top: 1.25rem;
  padding-bottom: 0;
}
.sanasto-search {
  width: 100%;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.625rem 1rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.sanasto-search::placeholder { color: var(--ink-3); }
.sanasto-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,58,82,0.1);
}
.sanasto-chip--hidden  { display: none !important; }
.sanasto-group--hidden { display: none !important; }
.sanasto-empty {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
  padding: 2rem 0;
  text-align: center;
}

/* ─── Level nav ─────────────────────────────────────── */
.sanasto-level-nav {
  display: flex;
  gap: 0.75rem;
  padding-top: 2rem;
  padding-bottom: 0;
}
.sanasto-level-btn {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink-3);
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.sanasto-level-btn:hover,
.sanasto-level-btn--active {
  background: var(--primary);
  color: #f0e8d0;
  border-color: var(--primary);
}

/* ─── Vocab grid ─────────────────────────────────────── */
#vocab-grid {
  padding-top: 2rem;
  padding-bottom: 4rem;
}
.sanasto-group { margin-bottom: 2.5rem; }
.sanasto-group-label {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--rule);
}
.sanasto-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.sanasto-chip {
  font-family: var(--serif);
  font-size: 1rem;
  padding: 0.3rem 0.7rem;
  border-radius: 5px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
  user-select: none;
}
.sanasto-chip:hover,
.sanasto-chip--active {
  background: var(--primary);
  color: #f0e8d0;
  border-color: var(--primary);
}
/* POS colour hints */
.sanasto-pos-verb      { border-left: 3px solid var(--accent); }
.sanasto-pos-adjective { border-left: 3px solid var(--warm); }
.sanasto-pos-adverb    { border-left: 3px solid var(--ink-3); }

/* ─── Inflection tooltip ─────────────────────────────── */
.sanasto-tip {
  position: fixed;
  z-index: 400;
  background: var(--primary);
  color: #f0e8d0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.4;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  /* wide enough for long inflected forms on desktop, but never wider than the
     viewport on mobile */
  max-width: min(26rem, calc(100vw - 1.25rem));
  min-width: 220px;
}
.sanasto-tip.tip-on { opacity: 1; transform: translateY(0); }

.sanasto-tip-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid rgba(240,232,208,0.2);
}
.sanasto-tip-header-top {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
}
.sanasto-tip-word {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 500;
}
.sanasto-tip-pos {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.65;
}
.sanasto-tip-tr {
  font-size: 0.8125rem;
  opacity: 0.85;
  font-style: italic;
}
.sanasto-tip-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8125rem;
}
.sanasto-tip-table th {
  text-align: right;
  font-weight: 500;
  opacity: 0.65;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.5rem 0.25rem;
}
.sanasto-tip-table th:first-child { text-align: left; }
.sanasto-tip-table td {
  padding: 0.15rem 0.5rem;
  text-align: right;
  overflow-wrap: anywhere;   /* a too-long form wraps instead of overflowing off-screen */
}
.sanasto-tip-table td.case-name {
  text-align: left;
  opacity: 0.65;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-right: 1rem;
}
.sanasto-tip-table tr:nth-child(even):not(.case-ex-row) td { opacity: 0.82; }
/* The form currently shown in the text — bold + bright green. */
.sanasto-tip .cur { color: #4ade80; font-weight: 700; }
.sanasto-tip-table td:has(.cur) { opacity: 1; }
/* space between the stacked conjugation tables in a verb flyout */
.sanasto-tip-table + .sanasto-tip-table { margin-top: 0.5rem; }

/* Lemma flyout: interactive so its collapsible verb sections can be clicked. */
.sanasto-tip.lf-tip { pointer-events: auto; }
.tip-sec > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f0e8d0;
  opacity: 0.9;
  padding: 0.28rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
}
.tip-sec > summary::-webkit-details-marker { display: none; }
.tip-sec > summary::before {
  content: '▸';
  font-size: 0.7em;
  opacity: 0.7;
  transition: transform 0.15s;
}
.tip-sec[open] > summary::before { transform: rotate(90deg); }
.tip-sec + .tip-sec { border-top: 1px solid rgba(240,232,208,0.14); }
.tip-sec > .sanasto-tip-table { margin: 0.15rem 0 0.35rem; }

/* Example sentence for the highlighted form (lazy-loaded). */
.tip-example { display: none; }
.tip-example.on {
  display: block;
  margin: 0.45rem 0;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(240,232,208,0.16);
}
.tip-example .ex-fi { color: #f0e8d0; font-style: italic; line-height: 1.4; }
.tip-example .ex-en { color: rgba(240,232,208,0.68); line-height: 1.35; margin-top: 0.15rem; }
.case-ex-row td {
  padding-top: 0;
  padding-bottom: 0.35rem;
  white-space: normal;
}
.case-ex {
  font-size: 0.75rem;
  font-style: italic;
  opacity: 0.62;
  text-align: left;
  line-height: 1.35;
}
.case-ex-ru {
  font-style: normal;
  opacity: 0.75;
  font-size: 0.7rem;
  color: rgba(240,232,208,0.65);
}
.sanasto-tip-extra {
  margin-top: 0.5rem;
  padding-top: 0.375rem;
  border-top: 1px solid rgba(240,232,208,0.2);
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ─── Vocabulary words in reading texts ─────────────────────────── */
.vocab-word,
.text-body [data-lemma] {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--primary);
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.12s, color 0.12s;
}
.vocab-word:hover,
.text-body [data-lemma]:hover {
  background: rgba(31, 58, 82, 0.09);
}
.vocab-word--active {
  background: rgba(31, 58, 82, 0.14);
  text-decoration-color: var(--accent);
}

/* Badge for new texts */
.text-badge-new {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.4rem;
  line-height: 1.6;
}

.text-audio-slot {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  margin-left: -0.55rem;
  color: var(--accent);
  opacity: 0.6;
  transition: color 0.12s, opacity 0.12s;
}
.text-link:hover .text-audio-slot { color: var(--warm); opacity: 1; }

/* Word-list hover preview on lukutekstit */
.words-preview {
  position: fixed;
  z-index: 300;
  background: var(--primary);
  color: #f0e8d0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  max-width: 320px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  font-size: 0.78rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.words-preview.tip-on { opacity: 1; }
.words-preview-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.65;
  margin-right: 0.2rem;
}
.words-preview-chip {
  background: rgba(240,232,208,0.15);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-family: var(--serif);
  font-size: 0.8rem;
}

/* ─── Text type tag (monologue / dialogue / news / …) ─────────────── */
.text-type-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(31,58,82,0.08);
  color: var(--primary);
  padding: 0.15em 0.55em;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.35rem;
}

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

/* ─── Audio player ───────────────────────────────────── */
.audio-player {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 0.75rem 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0;
}
.audio-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.audio-btn {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
  padding: 0.4rem;
}
.audio-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.audio-btn:not(:disabled):hover { background: var(--primary-2); }
.audio-btn svg { width: 100%; height: 100%; display: block; }

.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.audio-skip {
  width: 2.1rem;
  height: 2.1rem;
  background: transparent;
  color: var(--ink-3);
  padding: 0.18rem;
}
.audio-skip:not(:disabled):hover { background: transparent; color: var(--primary); }
.audio-player--unavailable .audio-skip { display: none; }

.audio-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.audio-current,
.audio-duration {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-3);
}
.audio-progress {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  cursor: pointer;
}
.audio-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.1s linear;
  pointer-events: none;
}
.audio-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.audio-player:hover .audio-thumb,
.audio-player--playing .audio-thumb { opacity: 1; }

.audio-status {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.audio-player--unavailable .audio-btn { background: var(--rule); }
.audio-player--unavailable .audio-current,
.audio-player--unavailable .audio-duration { visibility: hidden; }

.audio-speeds {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.audio-speeds-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--ink-3);
  margin-right: 0.05rem;
}
.audio-speed-btn {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.6;
}
.audio-speed-btn:hover { border-color: var(--primary); color: var(--primary); }
.audio-speed-btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
}
