:root {
  --ink: #111318;
  --ink-2: #4a5060;
  --ink-3: #7b8296;
  --line: #e3e6ec;
  --bg: #ffffff;
  --bg-2: #f6f7fa;
  --accent: #2b5cff;
  --accent-ink: #ffffff;
  --radius: 10px;
  --tile: 46px;
  --measure: 1240px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

.wrap { width: 100%; max-width: var(--measure); margin: 0 auto; padding: 0 20px; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

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

/* ------------------------------------------------------------------ header */

.head { padding: 28px 0 4px; }
.head h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.lede { margin: 0 0 20px; color: var(--ink-2); max-width: 62ch; }

.search { position: relative; max-width: 620px; }
.search input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 16px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(17 19 24 / 4%);
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(43 92 255 / 16%);
}
.search button {
  position: absolute; right: 6px; top: 6px;
  width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: var(--bg-2); color: var(--ink-2);
  font-size: 20px; line-height: 1; cursor: pointer;
}

.status { min-height: 22px; margin: 10px 0 0; color: var(--ink-3); font-size: 14px; }

.chips { margin: 14px 0 0; }
.chips ul {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.chips a {
  display: inline-block; padding: 5px 11px;
  font-size: 13px; text-decoration: none; color: var(--ink-2);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
}
.chips a:hover { color: var(--ink); border-color: #cdd2dc; }

/* -------------------------------------------------------------- ad slots
   Reserved height per breakpoint. The container never collapses and never
   grows: house, live and unfilled all occupy exactly this box (protocol 47
   §7). Keep these values in step with the <aside class="ad"> markup.        */

.ad {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  width: 100%; max-width: 970px; height: 250px;
  margin: 28px auto; padding: 16px 20px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.ad-tag {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
}
.ad-body { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ad-body strong { font-size: 18px; }
.ad-line { color: var(--ink-2); font-size: 14px; max-width: 46ch; }
.ad-cta {
  margin-top: 6px; font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--accent);
}
.ad-cta:hover { text-decoration: underline; }

[data-slot="incontent-1"],
[data-slot="incontent-2"] { max-width: 336px; height: 280px; margin: 34px auto; }

[data-slot="end-billboard"] { margin-bottom: 40px; }

@media (max-width: 1023px) {
  [data-slot="atf-billboard"],
  [data-slot="end-billboard"] { max-width: 728px; height: 90px; padding: 8px 14px; }
  [data-slot="atf-billboard"] .ad-line,
  [data-slot="end-billboard"] .ad-line { display: none; }
  [data-slot="atf-billboard"] .ad-body strong,
  [data-slot="end-billboard"] .ad-body strong { font-size: 15px; }
}

@media (max-width: 767px) {
  [data-slot="atf-billboard"],
  [data-slot="end-billboard"] { max-width: 320px; height: 100px; }
  [data-slot="incontent-1"],
  [data-slot="incontent-2"] { max-width: 300px; height: 250px; }
}

/* ------------------------------------------------------------------- grid */

main { padding-bottom: 8px; }

section { scroll-margin-top: 16px; }

.grp { padding-top: 30px; }
.grp-head { margin: 0 0 14px; }
.grp-head h2 {
  margin: 0 0 4px;
  font-size: clamp(20px, 2.4vw, 25px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.grp-blurb { margin: 0; color: var(--ink-3); font-size: 14px; }
.grp-blurb .n { color: var(--ink-3); }

.sub { margin: 0 0 18px; }
.sub h3 {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 0 8px;
  font-size: 12px; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}
.sub h3 .n { font-size: 11px; font-weight: 500; letter-spacing: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--tile));
  gap: 5px;
  justify-content: start;
}

.e {
  display: flex; align-items: center; justify-content: center;
  height: var(--tile);
  padding: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
               "Twemoji Mozilla", "EmojiOne Color", "Android Emoji", sans-serif;
  font-size: 32px; line-height: 1;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 90ms ease, border-color 90ms ease, transform 90ms ease;
}
.e:hover { background: var(--bg-2); border-color: var(--line); }
.e:active { transform: scale(0.94); }
.e[hidden] { display: none; }

.recent { padding-top: 4px; }

.hint { margin: -4px 0 14px; color: var(--ink-3); font-size: 14px; }

.tones details {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 14px 14px; margin-bottom: 10px;
}
.tones summary {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 0; cursor: pointer;
  font-weight: 600; font-size: 15px;
}
.tones summary .n { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--ink-3); }
.tones details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }

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

.foot {
  margin-top: 40px; padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: 14px;
}
.foot p { margin: 0 0 8px; max-width: 78ch; }
.foot .fine { color: var(--ink-3); font-size: 12.5px; }

/* ------------------------------------------------------------------ toast */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 18px);
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 60;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2f4f8; --ink-2: #b9c0cf; --ink-3: #8b93a6;
    --line: #262b36; --bg: #0f1218; --bg-2: #171c25; --accent: #8aa6ff;
  }
  .search input { background: var(--bg-2); }
  .toast { background: #f2f4f8; color: #0f1218; }
}

/* ------------------------------------------------------- inner pages */

.crumbs { margin: 0 0 6px; font-size: 14px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.prose { max-width: 760px; padding-bottom: 24px; }
.prose h2 {
  margin: 30px 0 8px; font-size: 19px; font-weight: 650;
  letter-spacing: -0.01em; color: var(--ink); text-transform: none;
}
.prose p, .prose li { color: var(--ink-2); }
.prose p { margin: 0 0 12px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin: 0 0 6px; }
.prose code { font-size: 0.92em; background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }

.facts {
  width: 100%; border-collapse: collapse; margin: 8px 0 20px;
  font-size: 14.5px;
}
.facts th, .facts td {
  text-align: left; vertical-align: top; padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.facts th { width: 34%; color: var(--ink-3); font-weight: 600; }
.facts td { color: var(--ink-2); }
