@charset "utf-8";
/* ==========================================================================
   PopGameFa — design system: "Paper Lab"
   A knowledge hub, not an arcade. Light warm paper, a single teal for
   structure and amber for emphasis, generous measure, numbered lesson blocks
   and a sticky learning rail. Deliberately the visual opposite of playpopfa.
   Typeface: Sahel (SIL OFL), self-hosted.
   ========================================================================== */

@font-face { font-family: 'Sahel'; src: url('/assets/fonts/Sahel.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sahel'; src: url('/assets/fonts/Sahel-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Sahel'; src: url('/assets/fonts/Sahel-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --paper: #fdfaf3;
  --paper-2: #f6f1e6;
  --card: #ffffff;
  --ink: #17302d;
  --ink-2: #3d5c58;
  --ink-3: #6f8b87;
  --rule: #e6ded0;
  --rule-2: #d3c8b4;

  --teal: #0f766e;
  --teal-dark: #0b544e;
  --teal-soft: #e2f2f0;
  --amber: #f0a202;
  --amber-soft: #fdf1d8;
  --rose: #c0392b;
  --green: #2f8f4e;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(23, 48, 45, .06);
  --shadow: 0 4px 18px -8px rgba(23, 48, 45, .22);

  --wrap: 1120px;
  --measure: 68ch;
  --gap: clamp(16px, 3vw, 26px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Sahel', system-ui, Tahoma, sans-serif;
  font-size: 17px;
  line-height: 2.05;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.nav-open, body.pg-noscroll { overflow: hidden; }

img, svg { max-width: 100%; height: auto; }
a { color: var(--teal); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .55em; font-weight: 700; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.7rem); letter-spacing: -.005em; }
h2 { font-size: clamp(1.3rem, 1.08rem + 1.05vw, 1.8rem); }
h3 { font-size: clamp(1.05rem, .98rem + .45vw, 1.25rem); }
p { margin: 0 0 1.15em; }
ul, ol { padding-inline-start: 1.4em; margin: 0 0 1.25em; }
li { margin-bottom: .55em; }
b, strong { font-weight: 700; }
code { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 5px; padding: 1px 6px; font-size: .88em; }

/* See playpopfa note: no display:inline-block here — this class is used on
   <td> elements and an inline-block cell drops out of table layout. */
.ltr-nums { direction: ltr; unicode-bidi: isolate; font-feature-settings: 'tnum' 1; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--teal); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 10px; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 0; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2rem, 780px); margin-inline: auto; }
.section { padding-block: clamp(34px, 5vw, 62px); }
.section--tight { padding-block: clamp(22px, 3.5vw, 40px); }
.section--paper { background: var(--paper-2); border-block: 1px solid var(--rule); }
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: var(--measure); }

/* ------------------------------------------------------------- header --- */
.site-header { background: var(--card); border-bottom: 2px solid var(--rule); position: sticky; top: 0; z-index: 60; }
.header-in { display: flex; align-items: center; gap: 14px; min-height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.logo img { width: 36px; height: 36px; }
.logo span small { display: block; font-size: .68rem; color: var(--ink-3); font-weight: 400; line-height: 1.3; }

.nav-toggle { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 7px; background: var(--paper-2); border: 1px solid var(--rule-2); color: var(--ink); border-radius: var(--r-sm); padding: 9px 14px; font: inherit; font-size: .88rem; cursor: pointer; }
@media (min-width: 1000px) { .nav-toggle { display: none; } }

#site-nav { margin-inline-start: auto; }
@media (min-width: 1000px) { #site-nav { display: flex; align-items: center; gap: 8px; } }
#site-nav ul { display: flex; gap: 0; list-style: none; margin: 0; padding: 0; }
#site-nav a {
  display: block; padding: 10px 12px; color: var(--ink-2); font-size: .9rem; font-weight: 600;
  text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap;
}
#site-nav a:hover { color: var(--teal); border-bottom-color: var(--rule-2); }
#site-nav a[aria-current='page'] { color: var(--teal); border-bottom-color: var(--teal); }
.nav-cta { margin-inline-start: 8px; flex: none; }
/* `#site-nav a` (id + type) outranks `.btn` (class), so without this the CTA
   inside the nav inherits the muted link colour and renders text-on-text. */
#site-nav .nav-cta .btn { color: #fff; padding: 9px 18px; border-bottom: 0; }
#site-nav .nav-cta .btn:hover { color: #fff; border-bottom: 0; }
@media (max-width: 999px) {
  #site-nav { position: fixed; inset: 66px 0 0; background: var(--card); padding: 18px; overflow-y: auto; display: none; }
  #site-nav.is-open { display: block; }
  #site-nav ul { flex-direction: column; }
  #site-nav a { padding: 14px 8px; border-bottom: 1px solid var(--rule); font-size: 1rem; }
  .nav-cta { display: block; margin: 18px 0 0; }
  .nav-cta .btn { width: 100%; }
}

/* ------------------------------------------------------------ buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-sm); border: 0; cursor: pointer;
  background: var(--teal); color: #fff; font: inherit; font-weight: 700; font-size: .95rem;
  text-decoration: none; transition: background .15s, transform .15s; box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--teal-dark); color: #fff; transform: translateY(-1px); text-decoration: none; }
.btn--amber { background: var(--amber); color: #3a2600; }
.btn--amber:hover { background: #d99202; color: #3a2600; }
.btn--ghost { background: transparent; border: 2px solid var(--rule-2); color: var(--ink); box-shadow: none; }
.btn--ghost:hover { background: var(--paper-2); color: var(--ink); border-color: var(--teal); }
.btn--sm { padding: 7px 14px; font-size: .84rem; }
.btn--lg { padding: 15px 30px; font-size: 1.02rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: clamp(16px, 2.6vw, 24px); box-shadow: var(--shadow-sm); }
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }

.kicker {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .08em;
  color: var(--teal); text-transform: uppercase; margin-bottom: 10px;
  border-bottom: 2px solid var(--amber); padding-bottom: 3px;
}

/* --------------------------------------------------------------- hero --- */
.hero { padding-block: clamp(30px, 4.5vw, 54px) 0; }
.hero-grid { display: grid; gap: clamp(22px, 4vw, 38px); }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; } }
.hero h1 mark { background: linear-gradient(transparent 62%, var(--amber-soft) 62%); color: inherit; padding: 0 2px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* --------------------------------------------------- lesson structure --- */
.lessons { counter-reset: lesson; display: grid; gap: 14px; }
.lesson {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 18px 20px 18px 20px; position: relative; padding-inline-start: 64px;
}
.lesson::before {
  counter-increment: lesson; content: counter(lesson);
  position: absolute; inset-inline-start: 18px; top: 18px;
  width: 32px; height: 32px; border-radius: 50%; background: var(--teal-soft);
  color: var(--teal); font-weight: 700; display: grid; place-items: center; font-size: .95rem;
}
.lesson h3 { margin-bottom: .35em; }
.lesson p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------- game surface --- */
.game-shell { background: var(--card); border: 2px solid var(--rule-2); border-radius: var(--r-lg); padding: clamp(14px, 2.4vw, 22px); box-shadow: var(--shadow); }
.game-shell-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.game-shell-head h2 { margin: 0; font-size: 1.08rem; }
.game-badge { font-size: .74rem; font-weight: 700; color: var(--teal); background: var(--teal-soft); border-radius: 999px; padding: 5px 12px; }

/* --------------------------------------------------------- game board --- */
.pg { display: flex; flex-direction: column; gap: 15px; }
.pg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); gap: 8px; }
.pg-stat { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 9px 11px; display: flex; flex-direction: column; }
.pg-stat-label { font-size: .68rem; color: var(--ink-3); }
.pg-stat-value { font-size: 1.02rem; font-weight: 700; }
.pg-stat--mult .pg-stat-value { color: var(--teal); }
.pg-stat--win .pg-stat-value { color: var(--amber); }

.pg-board { display: flex; flex-direction: column; gap: 6px; }
.pg-row { display: flex; align-items: center; gap: 10px; padding: 3px 6px; border-radius: var(--r-sm); }
.pg-row.is-active { background: var(--amber-soft); }
.pg-mult { min-width: 56px; text-align: center; font-size: .78rem; font-weight: 700; padding: 5px 6px; border-radius: 6px; color: var(--ink-3); background: var(--paper-2); border: 1px solid var(--rule); flex: none; }
.pg-mult.is-active { background: var(--amber); color: #3a2600; border-color: transparent; }
.pg-mult.is-past { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.pg-tiles { display: flex; gap: 7px; flex: 1; justify-content: center; }
.pg-tile {
  width: var(--pg-tile, 54px); height: var(--pg-tile, 54px); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper-2); border: 1px solid var(--rule-2); border-radius: 10px;
  color: var(--ink-3); font: inherit; font-size: 1.1rem; font-weight: 700; cursor: default; padding: 0;
  transition: transform .14s, background .14s, border-color .14s;
}
.pg-tile[data-state='hidden'] { cursor: pointer; background: var(--card); border-color: var(--teal); color: var(--teal); }
.pg-tile[data-state='hidden']:hover { background: var(--teal-soft); transform: translateY(-2px); }
.pg-tile[data-state='safe'] { background: #dff3e5; border-color: var(--green); color: var(--green); }
.pg-tile[data-state='poop'] { background: #fbe3e0; border-color: var(--rose); }
.pg-tile[data-state='disabled'] { opacity: .45; }

.pg-coach { margin: 0; font-size: .9rem; color: var(--ink-2); background: var(--teal-soft); border-inline-start: 4px solid var(--teal); border-radius: var(--r-sm); padding: 11px 14px; line-height: 1.8; }
.pg-controls { display: flex; flex-direction: column; gap: 12px; }
.pg-chips { display: flex; flex-direction: column; gap: 7px; }
.pg-chips-label { font-size: .78rem; color: var(--ink-3); }
.pg-chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.pg-chip { flex: 1 1 60px; min-width: 60px; height: 42px; border-radius: var(--r-sm); border: 1px solid var(--rule-2); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; direction: ltr; }
.pg-chip.is-active { background: var(--teal); color: #fff; border-color: transparent; }
.pg-chip[disabled] { opacity: .45; cursor: not-allowed; }
.pg-chip-input { flex: 1 1 105px; min-width: 105px; height: 42px; border-radius: var(--r-sm); text-align: center; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink); font: inherit; direction: ltr; }
.pg-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.pg-btn { flex: 1 1 auto; padding: 12px 18px; border-radius: var(--r-sm); border: 0; cursor: pointer; background: var(--teal); color: #fff; font: inherit; font-weight: 700; font-size: .94rem; }
.pg-btn--main { flex: 2 1 190px; }
.pg-btn--ghost { background: transparent; border: 2px solid var(--rule-2); color: var(--ink-2); flex: 0 1 auto; }
.pg-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pg-note { margin: 0; font-size: .78rem; color: var(--ink-3); line-height: 1.75; }

.pg-side { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.pg-ladder, .pg-log, .pg-session { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; }
.pg-ladder-title, .pg-log-title, .pg-session-title { font-size: .9rem; margin: 0 0 10px; }
.pg-ladder-track { display: flex; flex-wrap: wrap; gap: 5px; }
.pg-ladder-step { font-size: .74rem; font-weight: 700; padding: 5px 9px; border-radius: 6px; background: var(--card); border: 1px solid var(--rule); color: var(--ink-3); }
.pg-ladder-step.is-done { background: #dff3e5; color: var(--green); border-color: transparent; }
.pg-ladder-step.is-next { background: var(--amber); color: #3a2600; border-color: transparent; }
.pg-ladder-note, .pg-log-note { font-size: .75rem; color: var(--ink-3); margin: 10px 0 0; line-height: 1.75; }
.pg-log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.pg-log-item { display: flex; align-items: center; gap: 8px; font-size: .78rem; margin: 0; }
.pg-log-badge { font-weight: 700; border-radius: 5px; padding: 2px 7px; font-size: .7rem; }
.pg-log-item.is-win .pg-log-badge { background: #dff3e5; color: var(--green); }
.pg-log-item.is-loss .pg-log-badge { background: #fbe3e0; color: var(--rose); }
.pg-log-amount { margin-inline-start: auto; font-weight: 700; }
.pg-log-empty { color: var(--ink-3); font-size: .8rem; margin: 0; }
.pg-session-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0; font-size: .82rem; }
.pg-session-grid dt { color: var(--ink-3); }
.pg-session-grid dd { margin: 0; font-weight: 700; }

.pg-dialog { position: fixed; inset: 0; z-index: 200; background: rgba(23, 48, 45, .5); display: flex; align-items: center; justify-content: center; padding: 18px; }
.pg-dialog[hidden] { display: none; }
.pg-dialog-card { background: var(--card); border-radius: var(--r-lg); padding: clamp(20px, 4vw, 28px); width: min(450px, 100%); text-align: center; box-shadow: 0 30px 70px -25px rgba(23,48,45,.55); max-height: 90vh; overflow-y: auto; }
.pg-dialog-emoji { font-size: 2.3rem; line-height: 1; margin-bottom: 8px; }
.pg-dialog-title { font-size: 1.12rem; }
.pg-dialog-text { color: var(--ink-2); font-size: .92rem; margin: 0 0 1em; }
.pg-dialog-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.pg-dots { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.pg-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--rule-2); }
.pg-dot.is-on { width: 22px; background: var(--teal); }
.pg-result-grid { display: grid; grid-template-columns: 1fr auto; margin: 14px 0; text-align: start; font-size: .89rem; }
.pg-result-grid dt { color: var(--ink-2); padding: 8px 0; border-bottom: 1px solid var(--rule); }
.pg-result-grid dd { margin: 0; font-weight: 700; padding: 8px 0; border-bottom: 1px solid var(--rule); text-align: end; }

@media (max-width: 560px) {
  .pg-tile { --pg-tile: min(17vw, 54px) !important; }
  .pg-tiles { gap: 5px; }
  .pg-mult { min-width: 46px; font-size: .7rem; padding: 4px; }
  .pg-row { gap: 6px; padding: 2px; }
}

/* ------------------------------------------------------ learning tools --- */
.tool { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.tool-head { background: var(--teal-soft); padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.tool-head h3 { margin: 0 0 3px; font-size: 1.02rem; }
.tool-head p { margin: 0; font-size: .82rem; color: var(--ink-2); }
.tool-body { padding: 18px; }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  background: var(--paper-2); border: 1px solid var(--rule-2); border-radius: 999px;
  padding: 8px 15px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; color: var(--ink-2);
}
.chip.is-on { background: var(--teal); color: #fff; border-color: transparent; }
.tool-out { background: var(--paper-2); border-radius: var(--r-sm); padding: 14px 16px; font-size: .92rem; line-height: 1.9; min-height: 90px; }
.tool-out p:last-child { margin-bottom: 0; }
.tool-out h4 { margin: 0 0 6px; font-size: .95rem; color: var(--teal); }

/* -------------------------------------------------------------- table --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; min-width: 680px; font-size: .89rem; }
table.data caption { text-align: start; padding: 14px 16px 0; color: var(--ink-3); font-size: .8rem; }
table.data th, table.data td { padding: 11px 13px; text-align: start; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.data thead th { background: var(--paper-2); color: var(--ink-2); font-size: .8rem; white-space: nowrap; }
table.data th[data-sortkey] { cursor: pointer; user-select: none; }
table.data th[data-sortkey]:hover { color: var(--teal); }
table.data th[data-sortkey]::after { content: ' ⇅'; opacity: .5; font-size: .8em; }
table.data tbody tr:nth-child(even) { background: #fbf8f1; }
table.data tbody tr:hover { background: var(--teal-soft); }
.c-brand a { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; text-decoration: none; }
.c-brand img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.c-num { text-align: center; white-space: nowrap; }
.c-num b { color: var(--teal); font-size: 1rem; }
.rank-pill { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--paper-2); border: 1px solid var(--rule-2); font-weight: 700; font-size: .84rem; }
.table-hint { font-size: .8rem; color: var(--ink-3); margin: 10px 0 0; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: .74rem; font-weight: 700; }
.pill--unknown { background: var(--paper-2); color: var(--ink-3); border: 1px dashed var(--rule-2); }

/* --------------------------------------------------------- breadcrumb --- */
.crumbs { font-size: .8rem; color: var(--ink-3); padding-block: 14px 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li { margin: 0; display: flex; gap: 6px; align-items: center; }
.crumbs li + li::before { content: '‹'; color: var(--rule-2); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* --------------------------------------------------------------- misc --- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 1.9em; padding-bottom: .25em; border-bottom: 2px solid var(--rule); }
.prose h3 { margin-top: 1.5em; }
.prose ul li::marker, .prose ol li::marker { color: var(--teal); font-weight: 700; }
.callout { background: var(--teal-soft); border-radius: var(--r); padding: 16px 18px; margin: 1.6em 0; border-inline-start: 4px solid var(--teal); }
.callout h3 { margin-top: 0; font-size: 1rem; }
.callout p:last-child { margin-bottom: 0; }
.callout--warn { background: #fdeeec; border-inline-start-color: var(--rose); }
.callout--note { background: var(--amber-soft); border-inline-start-color: var(--amber); }

.faq { display: grid; gap: 8px; }
.faq details { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); }
.faq summary { cursor: pointer; padding: 14px 17px; font-weight: 700; font-size: .95rem; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--teal); font-size: 1.3rem; flex: none; }
.faq details[open] summary::after { content: '−'; }
.faq details > div { padding: 0 17px 15px; color: var(--ink-2); font-size: .91rem; }
.faq details > div p:last-child { margin-bottom: 0; }

.link-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); list-style: none; padding: 0; margin: 0; }
.link-grid li { margin: 0; }
.link-grid a { display: block; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 15px 17px; color: var(--ink); height: 100%; text-decoration: none; }
.link-grid a:hover { border-color: var(--teal); background: var(--teal-soft); }
.link-grid strong { display: block; margin-bottom: 4px; font-size: .95rem; }
.link-grid span { font-size: .81rem; color: var(--ink-3); line-height: 1.65; display: block; }

/* ------------------------------------------------------ brand pieces --- */
.brand-row {
  display: grid; gap: 14px; align-items: center; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; margin-bottom: 10px;
  grid-template-columns: auto 1fr auto;
}
@media (max-width: 700px) { .brand-row { grid-template-columns: auto 1fr; } .brand-row .brand-row-actions { grid-column: 1 / -1; } }
.brand-row img { width: 48px; height: 48px; object-fit: contain; }
.brand-row h3 { margin: 0 0 3px; font-size: 1.02rem; }
.brand-row p { margin: 0; font-size: .84rem; color: var(--ink-2); }
.brand-row-score { text-align: center; }
.brand-row-score b { display: block; font-size: 1.55rem; color: var(--teal); line-height: 1.1; }
.brand-row-score span { font-size: .7rem; color: var(--ink-3); }
.brand-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.scorebars { display: grid; gap: 9px; margin: 0; }
.scorebar { display: grid; grid-template-columns: minmax(86px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .84rem; }
.scorebar-label { color: var(--ink-2); }
.scorebar-track { height: 9px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--rule); overflow: hidden; }
.scorebar-fill { display: block; height: 100%; width: var(--fill, 0%); background: var(--teal); transition: width .7s ease; }
.scorebar-value { font-weight: 700; }

.stars { display: inline-flex; gap: 1px; }
.star { color: var(--rule-2); font-size: .95rem; }
.star.is-on { color: var(--amber); }

/* ----------------------------------------------------------- comments --- */
.comments { display: grid; gap: 16px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comment { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 17px; margin: 0; }
.comment.is-pending { border-style: dashed; border-color: var(--amber); background: var(--amber-soft); }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; }
.comment-name { font-weight: 700; font-size: .9rem; }
.comment-head time { font-size: .75rem; color: var(--ink-3); margin-inline-start: auto; }
.comment-status { font-size: .72rem; color: #8a5a00; background: var(--amber-soft); border-radius: 999px; padding: 2px 9px; margin-inline-start: auto; }
.comment-body { margin: 0; font-size: .89rem; color: var(--ink-2); line-height: 1.9; }
.comment-form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.field input[type='text'], .field textarea { background: var(--card); border: 1px solid var(--rule-2); border-radius: var(--r-sm); padding: 11px 13px; color: var(--ink); font: inherit; font-size: .92rem; width: 100%; }
.field textarea { min-height: 105px; resize: vertical; line-height: 1.85; }
.rating-input { display: flex; gap: 6px; flex-direction: row-reverse; justify-content: flex-end; }
.rating-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.rating-input label { cursor: pointer; font-size: 1.55rem; color: var(--rule-2); line-height: 1; padding: 2px; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: var(--amber); }
.rating-input input:focus-visible + label { outline: 3px solid var(--amber); outline-offset: 2px; }
.form-status { font-size: .86rem; margin: 0; padding: 10px 13px; border-radius: var(--r-sm); }
.form-status:empty { display: none; }
.form-status.is-ok { background: #dff3e5; color: #1e6b39; }
.form-status.is-error { background: #fbe3e0; color: var(--rose); }
.form-note { font-size: .78rem; color: var(--ink-3); margin: 0; line-height: 1.75; }

/* ------------------------------------------------------------- author --- */
.authorbox { display: flex; gap: 14px; align-items: flex-start; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r); padding: 15px 17px; margin-top: 2.2em; }
.authorbox-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.authorbox p { margin: 0; font-size: .82rem; color: var(--ink-3); line-height: 1.8; }
.authorbox strong { display: block; color: var(--ink); font-size: .92rem; margin-bottom: 2px; }
.updated { font-size: .8rem; color: var(--ink-3); }

/* ------------------------------------------------------------- footer --- */
.site-footer { background: var(--ink); color: #d7e3e1; margin-top: clamp(40px, 6vw, 72px); }
.site-footer a { color: #b9d4d0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-top { display: grid; gap: 26px; padding-block: clamp(30px, 5vw, 46px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); }
.footer-brand p { font-size: .85rem; color: #9dbab6; max-width: 34ch; }
.footer-brand .logo { color: #fff; }
.footer-brand .logo span small { color: #9dbab6; }
.footer-col h3 { font-size: .88rem; margin-bottom: 11px; color: #fff; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-col li { margin: 0; }
.footer-col a { font-size: .85rem; }
.footer-disclaimer { border-top: 1px solid rgba(255,255,255,.14); padding-block: 15px; font-size: .77rem; color: #9dbab6; line-height: 1.85; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-block: 16px; font-size: .78rem; color: #9dbab6; display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.site-footer code { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #d7e3e1; }

/* ---------------------------------------------------------------- 404 --- */
.err { text-align: center; padding-block: clamp(50px, 9vw, 100px); }
.err-code { font-size: clamp(3.5rem, 14vw, 7rem); font-weight: 700; color: var(--teal); margin: 0; line-height: 1; }
.err .link-grid { margin-top: 28px; text-align: start; }
