/* Light mode (default) */
:root,
[data-theme="light"] {
  --bg0: #ffffff;
  --bg1: #f3f1eb;
  --bg2: #e8e4db;
  --ink: #1f2a24;
  --muted: #5d6b63;
  --accent: #1f7a6b;
  --accent-deep: #16584d;
  --good: #2f7d4c;
  --bad: #b33b3b;
  --panel: rgba(243, 241, 235, 0.96);
  --line: rgba(31, 42, 36, 0.12);
  --shadow: 0 16px 40px rgba(50, 40, 20, 0.1);
  --swatch-ring: rgba(31, 42, 36, 0.2);
  --token-hover: rgba(31, 42, 36, 0.28);
  --token-selected: #1f2a24;
  --bg-grad-a: #ffffff;
  --bg-grad-b: #ffffff;

  /* Shared highlight palette — saturated, mutually distinct tints */
  --hl-1: #12c4d2; /* aqua — cyan, not grey-blue */
  --hl-2: #e8b020; /* gold */
  --hl-3: #ff7a45; /* coral */
  --hl-4: #d44ec8; /* orchid */
  --hl-5: #2db85a; /* mint — true green */
  --hl-6: #f2a4bc; /* blossom — light rose, readable on black text */
  --hl-7: #9aa8b8; /* slate — cool neutral grey */
  --hl-8: #5b7fd6; /* indigo — true blue, distinct from aqua */
  /* Puzzle bilingual text: clear I / l / 1, plain zero (no slash) */
  --font-language: "IBM Plex Sans", Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  --hl-fill-base: transparent;
  --hl-1-fill: color-mix(in srgb, var(--hl-1) 70%, var(--hl-fill-base));
  --hl-2-fill: color-mix(in srgb, var(--hl-2) 70%, var(--hl-fill-base));
  --hl-3-fill: color-mix(in srgb, var(--hl-3) 68%, var(--hl-fill-base));
  --hl-4-fill: color-mix(in srgb, var(--hl-4) 68%, var(--hl-fill-base));
  --hl-5-fill: color-mix(in srgb, var(--hl-5) 68%, var(--hl-fill-base));
  --hl-6-fill: color-mix(in srgb, var(--hl-6) 68%, var(--hl-fill-base));
  --hl-7-fill: color-mix(in srgb, var(--hl-7) 78%, var(--hl-fill-base));
  --hl-8-fill: color-mix(in srgb, var(--hl-8) 68%, var(--hl-fill-base));
  --hl-pattern-fill: color-mix(in srgb, var(--ink) 9%, transparent);
  --hl-pattern-ink: var(--ink);
}

[data-theme="dark"] {
  --bg0: #1a2332;
  --bg1: #243044;
  --bg2: #2e3d55;
  --ink: #e8eef7;
  --muted: #9aabc2;
  --accent: #3d9b8f;
  --accent-deep: #2a756c;
  --good: #4f9d6e;
  --bad: #c45a5a;
  --panel: rgba(36, 48, 68, 0.92);
  --line: rgba(232, 238, 247, 0.12);
  --shadow: 0 18px 50px rgba(8, 14, 24, 0.35);
  --swatch-ring: rgba(255, 255, 255, 0.28);
  --token-hover: rgba(255, 255, 255, 0.35);
  --token-selected: #fff;
  --bg-grad-a: #35506e;
  --bg-grad-b: #2d4a45;

  --hl-1: #3ad4e2;
  --hl-2: #f0c14a;
  --hl-3: #ff8a5c;
  --hl-4: #e878d4;
  --hl-5: #4ed878;
  --hl-6: #f4b8cc;
  --hl-7: #b0bcc8;
  --hl-8: #7a9ae8;
  --font-language: "IBM Plex Sans", Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  --hl-fill-base: var(--bg1);
  --hl-1-fill: color-mix(in srgb, var(--hl-1) 62%, var(--hl-fill-base));
  --hl-2-fill: color-mix(in srgb, var(--hl-2) 62%, var(--hl-fill-base));
  --hl-3-fill: color-mix(in srgb, var(--hl-3) 60%, var(--hl-fill-base));
  --hl-4-fill: color-mix(in srgb, var(--hl-4) 60%, var(--hl-fill-base));
  --hl-5-fill: color-mix(in srgb, var(--hl-5) 60%, var(--hl-fill-base));
  --hl-6-fill: color-mix(in srgb, var(--hl-6) 60%, var(--hl-fill-base));
  --hl-7-fill: color-mix(in srgb, var(--hl-7) 68%, var(--hl-fill-base));
  --hl-8-fill: color-mix(in srgb, var(--hl-8) 60%, var(--hl-fill-base));
  --hl-pattern-fill: color-mix(in srgb, var(--ink) 12%, transparent);
  --hl-pattern-ink: var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  --kb-inset: 0px;
  scroll-padding-bottom: calc(var(--kb-inset) + 1rem);
  overflow-x: hidden;
  max-width: 100%;
}

html:has(body.has-osk[data-page="puzzle"]) {
  overflow-anchor: none;
  scroll-padding-bottom: 0.35rem;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg0);
}

[data-theme="dark"] body,
html[data-theme="dark"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg-grad-a) 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, var(--bg-grad-b) 0%, transparent 50%),
    linear-gradient(165deg, var(--bg0), #121821 70%);
}

.page {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

body.has-osk {
  --kb-inset: calc(12.5rem + env(safe-area-inset-bottom, 0px));
}

body.has-osk .page {
  padding-bottom: calc(var(--kb-inset) + 4.5rem);
}

.osk {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  gap: 0.32rem;
  padding: 0.45rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg1) 92%, var(--ink));
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 28px rgba(20, 24, 20, 0.12);
  max-width: 100%;
  overflow-x: hidden;
}

.osk[hidden] {
  display: none;
}

.osk-row {
  display: flex;
  justify-content: center;
  gap: 0.26rem;
}

.osk-key {
  flex: 1 1 0;
  max-width: 3.35rem;
  min-width: 0;
  height: 2.7rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg1);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.osk-key.wide {
  flex: 1.35 1 0;
  max-width: 4.5rem;
  font-size: 1.02rem;
}

.osk-key.space {
  flex: 4 1 0;
  max-width: 14rem;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.osk-key.osk-dismiss {
  flex: 0 0 2.7rem;
  width: 2.7rem;
  max-width: 2.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.osk-key.osk-dismiss svg {
  display: block;
}
.osk-row.glyph-keys .osk-key.osk-dismiss {
  flex-basis: 3.55rem;
  width: 3.55rem;
  max-width: none;
  height: 3.7rem;
}
.osk-row.glyph-keys {
  flex-wrap: wrap;
  gap: 0.35rem;
}
.osk-key.osk-glyph {
  flex: 0 0 auto;
  width: 3.55rem;
  max-width: none;
  height: 3.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2a2118;
}
.osk-key.osk-glyph .glyph-root {
  width: auto;
  height: 90%;
  max-width: 94%;
}
.osk-key.osk-glyph .glyph-aff {
  width: 1.55rem;
  height: 2.55rem;
}
body[data-glyph] .osk-key.osk-glyph .glyph-aff.osk-mark,
body[data-glyph] .osk-key.osk-glyph .glyph-aff.osk-mark.glyph-above,
body[data-glyph] .osk-key.osk-glyph .glyph-aff.osk-mark.glyph-below,
body[data-glyph] .osk-key.osk-glyph .glyph-aff.osk-mark.glyph-corner,
body[data-glyph] .osk-key.osk-glyph .glyph-aff.osk-mark.glyph-inside {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  transform: none;
  width: auto;
  height: 74%;
  max-width: 82%;
}
.osk-key.osk-glyph.is-pending {
  outline: 2px solid #7a3e2e;
  outline-offset: 1px;
}
.osk-key.osk-glyph-back {
  font-size: 1.15rem;
  align-items: center;
}
.glyph-answer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 0.95rem;
  margin: 0.35rem 0 0.15rem;
}
.glyph-answer-slot {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 2.55rem;
  max-width: none;
  min-height: 2.7rem;
  max-height: none;
  padding: 0.12rem 0.16rem;
  overflow: visible;
  border: 1.5px dashed #c8bfb2;
  border-radius: 8px;
  background: transparent;
  color: #2a2118;
  cursor: pointer;
}
/* letter-word pins text to the baseline. A glyph in a fixed box needs the spare
   space split, or a tall letter sits on the bottom border. */
.glyph-answer-slot.letter-word {
  align-items: center;
}
.glyph-answer-slot .glyph-unit,
.glyph-answer-slot .glyph-unit.has-above,
.glyph-answer-slot .glyph-unit.has-below,
.glyph-answer-slot .glyph-unit.has-corner {
  margin: 0;
}
.glyph-answer-slot.is-active {
  border-style: solid;
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
}
.glyph-answer-slot.is-hinted {
  background: #f6f1e6;
}
.glyph-answer-slot.correct {
  border-color: var(--good);
  border-style: solid;
  border-width: 3px;
}
.glyph-answer-slot.incorrect {
  border-color: var(--bad);
  border-style: solid;
  border-width: 3px;
}

.osk-key.extra {
  max-width: 3rem;
  color: var(--accent-deep);
}

.osk-key.active,
.osk-key:active {
  background: color-mix(in srgb, var(--accent) 22%, var(--bg1));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.letter-box.is-active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
}

.hero {
  margin-bottom: 1.5rem;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.theme-yinyang {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex-shrink: 0;
}

.theme-yinyang .yang-fill {
  fill: var(--bg1);
  stroke: var(--line);
  stroke-width: 0.75;
}

.theme-yinyang .yin-fill {
  fill: var(--ink);
}

.theme-yinyang .yin-dot {
  fill: var(--bg1);
}

.theme-yinyang .yang-dot {
  fill: var(--ink);
}

.brand {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.masthead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.masthead-lockup {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

a.masthead-home {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  line-height: 0;
  cursor: pointer;
}

a.masthead-home:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.2rem;
}

.masthead-badge {
  position: relative;
  flex-shrink: 0;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 50%;
  background: #2f5c56;
}

.masthead-tile {
  position: absolute;
  display: grid;
  place-items: center;
  width: 0.98rem;
  height: 0.98rem;
  border-radius: 0.22rem;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
}

.masthead-tile-b {
  top: 0.34rem;
  left: 0.46rem;
  z-index: 3;
  background: #d85a3a;
  color: #fff;
}

.masthead-tile-a {
  right: auto;
  bottom: 0.4rem;
  left: 0.4rem;
  z-index: 2;
  background: #e6b04a;
  color: #1a1a1a;
}

.masthead-tile-e {
  right: 0.38rem;
  bottom: 0.4rem;
  z-index: 2;
  background: #8ec9bc;
  color: #fff;
}

.masthead-word {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.masthead-logo {
  display: block;
  width: auto;
  height: 2.75rem;
  max-width: min(18rem, 72vw);
}

.masthead-logo-dark {
  display: none;
}

[data-theme="dark"] .masthead-logo-light {
  display: none;
}

[data-theme="dark"] .masthead-logo-dark {
  display: block;
}

/* Home themes paint their own page, so the word follows that background. */
.home-page .masthead-logo-light {
  display: block;
}

.home-page .masthead-logo-dark {
  display: none;
}

.home-page[data-home-theme="midnight-babel"] .masthead-logo-light,
.home-page[data-home-theme="laser-disco"] .masthead-logo-light,
.home-page[data-home-theme="memphis-after-dark"] .masthead-logo-light,
.home-page[data-home-theme="noir-detective"] .masthead-logo-light,
.home-page[data-home-theme="cosmic-panels"] .masthead-logo-light,
.home-page[data-home-theme="alien-greenhouse"] .masthead-logo-light {
  display: none;
}

.home-page[data-home-theme="midnight-babel"] .masthead-logo-dark,
.home-page[data-home-theme="laser-disco"] .masthead-logo-dark,
.home-page[data-home-theme="memphis-after-dark"] .masthead-logo-dark,
.home-page[data-home-theme="noir-detective"] .masthead-logo-dark,
.home-page[data-home-theme="cosmic-panels"] .masthead-logo-dark,
.home-page[data-home-theme="alien-greenhouse"] .masthead-logo-dark {
  display: block;
}

.masthead-word-poly {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  width: max-content;
  max-width: 100%;
  --poly-bar-overlap: 0.14em;
}

.masthead-word-poly .masthead-name-poly {
  position: relative;
  z-index: 1;
}

.masthead-word-poly .masthead-bars {
  width: 100%;
  margin-top: calc(-1 * var(--poly-bar-overlap));
  position: relative;
  z-index: 0;
}

body[data-page="puzzle"] .masthead-word-poly {
  --poly-bar-overlap: 0.1em;
}

.masthead-word-poly .masthead-bars i {
  height: 0.32rem;
}

.home2-top .masthead-word-poly .masthead-bars i {
  height: 0.42rem;
}

body[data-page="puzzle"] .masthead-word-poly .masthead-bars i {
  height: 0.24rem;
}

.masthead-name-poly {
  display: inline-block;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.92;
  color: #1c2a3a;
  white-space: nowrap;
}

[data-theme="dark"] .masthead-name-poly {
  color: var(--ink);
}

body[data-page="puzzle"] .masthead-name-poly {
  font-size: clamp(1.15rem, 3.2vw, 1.45rem);
}

.masthead-name {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.92;
}

.masthead-babel {
  color: #1c2a3a;
}

.masthead-ese {
  color: #2f5c56;
}

.masthead-bars {
  display: grid;
  grid-template-columns: 1.12fr 1fr 1fr 0.92fr;
  gap: 0.1rem;
  width: 100%;
  margin-top: 0.16rem;
}

.masthead-bars i {
  display: block;
  height: 0.26rem;
  border-radius: 1px;
}

.masthead-bars i:nth-child(1) { background: #d85a3a; }
.masthead-bars i:nth-child(2) { background: #f0a070; }
.masthead-bars i:nth-child(3) { background: #e6b04a; }
.masthead-bars i:nth-child(4) { background: #2f5c56; }

.masthead-tagline {
  margin: 0 0 0 0.15rem;
  padding: 0.05rem 0 0.05rem 0.7rem;
  border-left: 1px solid #9aa3a0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  color: #1c2a3a;
  white-space: nowrap;
}

[data-theme="dark"] .masthead-babel,
[data-theme="dark"] .masthead-tagline {
  color: var(--ink);
}

[data-theme="dark"] .masthead-ese {
  color: #7eb8ae;
}

[data-theme="dark"] .masthead-tagline {
  border-left-color: var(--line);
}

.hero h1 {
  margin: 0.55rem 0 0.4rem;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 500;
  color: var(--ink);
}

.lede {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.5;
}

.catalog-preview {
  margin: 0 auto 0.85rem;
  max-width: min(26.5rem, 100%);
}

.catalog-preview img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(50, 40, 20, 0.12);
}

.catalog-howto {
  margin-bottom: 1rem;
}

.catalog-howto-title,
.catalog-heading {
  margin: 0 0 0.65rem;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.catalog-howto p {
  margin: 0 0 0.55rem;
  color: var(--ink);
  line-height: 1.5;
}

.catalog-howto .help-steps {
  margin: 0 0 0.55rem;
  padding-left: 1.2rem;
}

.catalog-howto .help-steps li {
  margin: 0 0 0.35rem;
}

.catalog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.catalog-link {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg1);
  color: inherit;
  text-decoration: none;
}

.catalog-link:hover {
  border-color: var(--accent);
}

.catalog-index {
  flex: 0 0 1.5rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.catalog-name {
  flex: 1;
  min-width: 0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.catalog-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.catalog-title .catalog-name {
  flex: 0 1 auto;
}

.catalog-mythology {
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0.01em;
}

.catalog-tick {
  flex: 0 0 auto;
  color: var(--good);
  font-weight: 800;
}

.catalog-empty {
  grid-column: 1 / -1;
  color: var(--muted);
}

.testpuzzles-page .lede code {
  font-size: 0.92em;
}

.testpuzzles-list {
  display: grid;
  gap: 1rem;
}

.testpuzzles-empty {
  margin: 0;
  color: var(--muted);
}

.testpuzzle-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg1);
}

.testpuzzle-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.testpuzzle-title-block {
  flex: 1 1 12rem;
  min-width: 0;
}

.testpuzzle-card.is-complete {
  border-color: color-mix(in srgb, #2e7d32 35%, var(--line));
  background: color-mix(in srgb, #e8f5e9 55%, var(--bg1));
}

.testpuzzle-solved {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  margin-left: auto;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #e8f5e9;
  color: #1b5e20;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.testpuzzle-solved-mark {
  display: inline-flex;
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
}

.testpuzzle-solved-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.testpuzzle-solved-label {
  line-height: 1.2;
}

.testpuzzle-difficulty {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.testpuzzle-difficulty-easy {
  background: #e8f5e9;
  color: #2e7d32;
}

.testpuzzle-difficulty-medium {
  background: #fff8e1;
  color: #f57f17;
}

.testpuzzle-difficulty-hard {
  background: #fce4ec;
  color: #c62828;
}

.testpuzzle-difficulty-expert {
  background: #ede7f6;
  color: #4527a0;
}

.neo-theme-filter {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.neo-theme-filter button {
  font: inherit;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line, #c8c2b4);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.neo-theme-filter button.is-active {
  font-weight: 700;
  border-color: currentColor;
}

.testpuzzle-difficulty-wrap {
  display: grid;
  gap: 0.45rem;
}

.testpuzzle-difficulty-heading {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.testpuzzle-difficulty-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.45rem 0.85rem;
  margin: 0;
}

.testpuzzle-difficulty-stats dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.testpuzzle-difficulty-stats dd {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.testpuzzle-difficulty-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

.testpuzzle-title {
  margin: 0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.testpuzzle-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.testpuzzle-phrases {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
}

.testpuzzle-phrases dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.testpuzzle-phrases dd {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  font-size: 0.98rem;
  font-weight: 600;
}

.testpuzzle-glyph-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.15rem 0.35rem;
  line-height: 1;
}

.testpuzzle-glyph-line .glyph-root {
  width: 1.45rem;
  height: 1.85rem;
}

.testpuzzle-glyph-line .glyph-aff {
  width: 0.9rem;
  height: 1.65rem;
}

.testpuzzle-glyph-line .skin-diacritic .glyph-dia {
  width: 0.55rem;
  height: 0.55rem;
}

.testpuzzle-glyph-line .glyph-unit.has-above {
  margin-top: 0.72rem;
}

.testpuzzle-glyph-line .glyph-unit.has-stack-above {
  margin-top: 1.35rem;
}

.testpuzzle-glyph-line .glyph-unit.has-below {
  margin-bottom: 0.72rem;
}

.testpuzzle-glyph-line .glyph-unit.has-stack-below {
  margin-bottom: 1.35rem;
}

.testpuzzle-glyph-line .glyph-unit.has-shoulder {
  margin-top: 0.42rem;
}

.testpuzzle-latin,
.testpuzzle-pair-latin {
  font-style: italic;
}

.testpuzzle-pairs h3 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.testpuzzle-pairs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.testpuzzle-pairs li {
  font-size: 0.9rem;
  line-height: 1.35;
}

.testpuzzle-pair-en {
  color: var(--ink);
}

.testpuzzle-pair-sep {
  color: var(--muted);
}

.testpuzzle-pair-lang {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  font-style: normal;
  vertical-align: bottom;
}

.testpuzzle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.try-top {
  display: flex;
  justify-content: center;
  width: 100%;
}

.try-top .masthead {
  align-items: center;
}

.try-title {
  margin: 0.2rem 0 1.15rem;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 4.2vw, 2.55rem);
  font-weight: 700;
  line-height: 1.12;
  text-align: center;
  color: var(--home-heading, var(--ink));
}

@media (max-width: 640px) {
  .try-title {
    font-size: clamp(1.2rem, 5.6vw, 1.55rem);
    white-space: nowrap;
    letter-spacing: -0.015em;
  }
}

.try-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  gap: 0.85rem;
}

.try-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 9.5rem;
  padding: 0;
  border: 1px solid var(--home-border, var(--line));
  border-radius: 16px;
  background: var(--home-card-bg, var(--bg1));
  color: var(--home-body-text, inherit);
  box-shadow: var(--home-shadow, var(--shadow));
}

.try-main {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1 1 auto;
  padding: 1rem 1.05rem 0.9rem;
  color: inherit;
  text-decoration: none;
}

.try-card:hover,
.try-card:focus-within {
  border-color: color-mix(in srgb, var(--home-primary, var(--accent)) 50%, var(--home-border, var(--line)));
}

.try-main:focus-visible,
.try-bonus:focus-visible {
  outline: 2px solid var(--home-primary, var(--accent));
  outline-offset: 2px;
}

.try-foot {
  display: flex;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-top: auto;
  padding: 0.65rem 1.05rem 0.75rem;
  border-top: 1px solid color-mix(in srgb, var(--home-border, var(--line)) 80%, transparent);
}

.try-bonus {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--home-primary, var(--accent-deep));
  text-decoration: none;
  flex: 0 0 auto;
}

.try-bonus:hover,
.try-bonus:focus-visible {
  color: var(--home-heading, var(--ink));
}

.try-bonus-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.try-bonus .try-arrow {
  margin-left: 0;
}

.try-lang {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--home-heading, var(--ink));
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.try-solved-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  margin-left: 0.1rem;
  border-radius: 50%;
  background: var(--good, #2f7d4c);
  color: #fff;
  flex-shrink: 0;
}

.try-solved-mark svg {
  display: block;
  width: 0.62rem;
  height: 0.62rem;
}

.try-phrase-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.try-phrase-row .try-phrase {
  flex: 1 1 auto;
  min-width: 0;
}

.try-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin-left: auto;
  color: var(--home-primary, var(--accent-deep));
}

.try-phenomena {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  flex: 1 1 auto;
  min-width: 0;
}

.try-phenomena .phenomenon-badge {
  cursor: inherit;
  min-width: 0;
}

.try-phenomena .phenomenon-badge img {
  width: 1.15rem;
  height: 1.15rem;
  filter: none;
  opacity: 1;
}

.try-phenomena .phenomenon-badge span {
  color: var(--home-muted-text, var(--muted));
  font-size: 0.5rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

.try-num {
  color: var(--home-heading, var(--ink));
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.try-english {
  margin: 0;
  font-family: var(--font-language);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
}

.try-notes {
  margin: 0.45rem 0 0;
  color: var(--home-muted, var(--muted, #5c6570));
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: pre-wrap;
}

.try-notes-label {
  margin-right: 0.35rem;
  color: var(--home-heading, var(--ink));
  font-weight: 800;
  letter-spacing: 0.04em;
}

.try-phrase {
  margin: 0;
  font-family: var(--font-language);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.35;
}

.try-phrase.try-glyphs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.2rem 0.4rem;
  line-height: 1;
}

.try-phrase .glyph-root {
  width: 1.7rem;
  height: 2.2rem;
}

.try-phrase .skin-v2 .glyph-root {
  width: calc(2.2rem * var(--g-aspect, 0.94));
  height: 2.2rem;
}

.try-phrase .glyph-aff {
  width: 1rem;
  height: 1.7rem;
}

.try-phrase .skin-v2 .glyph-aff {
  width: 0.95rem;
  height: 0.95rem;
}

.try-phrase .skin-diacritic .glyph-dia {
  width: 0.55rem;
  height: 0.55rem;
}

.try-phrase .glyph-unit.has-above {
  margin-top: 0.72rem;
}

.try-phrase .glyph-unit.has-stack-above {
  margin-top: 1.35rem;
}

.try-phrase .glyph-unit.has-below {
  margin-bottom: 0.72rem;
}

.try-phrase .glyph-unit.has-stack-below {
  margin-bottom: 1.35rem;
}

.try-phrase .glyph-unit.has-shoulder {
  margin-top: 0.42rem;
}

.try-phrase .glyph-unit {
  position: relative;
}

.try-phrase .skin-v2 .glyph-unit {
  margin: 0;
}

.try-result {
  color: var(--home-primary, var(--accent-deep));
  font-size: 0.92rem;
  font-weight: 700;
}

.try-card.is-complete .try-result {
  color: var(--home-primary, #1b5e20);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.phenomenon-badges {
  display: none;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.phenomenon-badges:not([hidden]) {
  display: flex;
}

.phenomenon-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 2.1rem;
  max-width: none;
  margin: 0;
  padding: 0.1rem 0.2rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.phenomenon-badge:focus-visible {
  outline: 2px solid var(--home-focus, var(--accent));
  outline-offset: 2px;
  border-radius: 6px;
}

.phenomenon-badge img {
  width: 1.55rem;
  height: 1.55rem;
  object-fit: contain;
  display: block;
  filter: grayscale(1) contrast(1.05);
  opacity: 0.88;
  pointer-events: none;
}

.phenomenon-badge span {
  font-size: 0.55rem;
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-align: center;
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  white-space: nowrap;
  pointer-events: none;
}

.phenomenon-tip {
  position: fixed;
  z-index: 80;
  max-width: min(18rem, calc(100vw - 1.5rem));
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1.5px solid var(--home-border, var(--line));
  background: var(--home-pill-bg, #fff);
  color: var(--home-pill-text, var(--ink));
  box-shadow: 0 10px 28px color-mix(in srgb, #000 18%, transparent);
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 500;
  pointer-events: none;
}

@media (max-width: 520px) {
  .phenomenon-badges {
    gap: 0.25rem 0.35rem;
  }

  .phenomenon-badge {
    min-width: 1.85rem;
  }

  .phenomenon-badge img {
    width: 1.3rem;
    height: 1.3rem;
  }

  .phenomenon-badge span {
    font-size: 0.5rem;
  }
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

@media (min-width: 900px) {
  .control-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.phenomenon-fieldset {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.65rem 0.75rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg1);
  min-width: 0;
}

.phenomenon-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.phenomenon-hint {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: none;
  letter-spacing: normal;
}

.phenomenon-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.phenomenon-checks .check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.phenomenon-checks .check input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

label.vocab-v1-only[hidden],
label.vocab-v2-only[hidden] {
  display: none;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg1);
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-deep);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.status,
.feedback {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.feedback.ok {
  color: var(--good);
}

.feedback.bad {
  color: var(--bad);
}

.feedback.feedback-solved {
  margin-top: 0.35rem;
  padding: 0.85rem 0.95rem;
  border: 1.5px solid color-mix(in srgb, var(--good) 45%, var(--line));
  border-radius: var(--home-button-radius, 0.55rem);
  background: color-mix(in srgb, var(--good) 10%, var(--bg1, #fff));
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.35;
}

.solve-congrats-msg {
  margin: 0;
}

.puzzle-solved-card,
.daily-bonus-card {
  width: 100%;
  margin-top: 0.85rem;
  box-sizing: border-box;
}

.puzzle-solved-card[hidden],
.daily-bonus-card[hidden] {
  display: none !important;
}

.daily-bonus-card {
  margin-top: 0;
}

.daily-cta-stack {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.daily-cta-stack .daily-bonus-card {
  margin-top: 0;
}

.bonus-puzzle-heading {
  font-size: clamp(1.25rem, 3.8vw, 1.55rem);
}

.puzzle-solved-card + .puzzle-solved-card {
  margin-top: 0.65rem;
}

body.puzzle-is-solved #btn-submit-match,
body.puzzle-solution-revealed #btn-submit-match,
#btn-submit-match[hidden] {
  display: none !important;
}

.puzzle-solve-stats {
  margin: 0.15rem 0 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--home-muted-text, var(--muted));
}

.puzzle-solved-card .daily-cta-heading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-align: center;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
}

.puzzle-solved-card {
  align-items: stretch;
  text-align: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem 1.1rem;
}

.puzzle-solved-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.puzzle-solved-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.puzzle-solved-date {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--home-muted-text, var(--muted));
  white-space: nowrap;
}

.puzzle-solved-date[hidden] {
  display: none !important;
}

.puzzle-share-options {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.puzzle-share-options[hidden] {
  display: none !important;
}

.puzzle-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border: 2px solid var(--home-heading, #3d342c);
  border-radius: 50%;
  background: var(--home-card-bg, #fff);
  color: var(--home-heading, #3d342c);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.puzzle-share-button:hover,
.puzzle-share-button.is-flash {
  background: var(--home-heading, #3d342c);
  color: var(--home-card-bg, #fff);
  transform: scale(1.05);
}

.puzzle-share-button:active {
  transform: scale(0.95);
}

.puzzle-share-button svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.puzzle-solved-stats {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--home-border, #ddd) 35%, transparent);
  flex-wrap: wrap;
}

.puzzle-solved-stats[hidden] {
  display: none !important;
}

.puzzle-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex: 1;
  min-width: 4.5rem;
}

.puzzle-stat-label {
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--home-muted-text, var(--muted));
}

.puzzle-stat-value {
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--home-heading, var(--text));
  white-space: nowrap;
}

.puzzle-attempt-value {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.puzzle-attempt-value .medal-icon {
  font-size: 1rem;
  line-height: 1;
}

.puzzle-bonus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: 100%;
  margin-top: 0.7rem;
  min-height: 2.4rem;
  padding: 0.55rem 1.2rem;
  border: 1.5px solid var(--home-primary, var(--accent));
  border-radius: 999px;
  background: var(--home-primary, var(--accent));
  color: var(--home-button-text, #fff);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  box-shadow: none;
  cursor: pointer;
}

.puzzle-bonus-btn:hover {
  transform: none;
  background: var(--home-primary-hover, var(--accent-deep));
  border-color: var(--home-primary-hover, var(--accent-deep));
}

.puzzle-bonus-btn.is-solved {
  border-color: var(--home-primary, var(--accent));
  background: var(--home-primary, var(--accent));
  color: var(--home-button-text, #fff);
}

.puzzle-bonus-btn-label {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.puzzle-bonus-btn-arrow {
  flex: 0 0 auto;
  font-size: 0.95em;
  line-height: 1;
}

.puzzle-bonus-btn[hidden] {
  display: none !important;
}

.daily-cta-card.is-solved .daily-cta-heading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: var(--home-heading, var(--ink));
}

body[data-page="home2"] .daily-cta-card.is-solved .daily-cta-heading {
  justify-content: flex-start;
}

.daily-cta-solved-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--good, #2f7d4c);
  color: #fff;
  flex-shrink: 0;
}

.daily-cta-solved-mark svg {
  display: block;
  width: 0.78rem;
  height: 0.78rem;
}

.sample-puzzle-card.is-solved .puzzle-solve-stats,
.daily-cta-card .puzzle-solve-stats {
  text-align: center;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.section-head {
  position: relative;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.section-head h2 {
  margin: 0 0 0.25rem;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.45rem;
}

.section-head p {
  margin: 0 0 1rem;
  color: var(--muted);
}

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

.section-head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg1);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.icon-btn .icon-svg {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}

.icon-btn[aria-expanded="true"],
.icon-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg1));
}

.icon-btn[hidden],
#btn-notes {
  display: none !important;
}

.notes-pop {
  position: absolute;
  top: 2.4rem;
  right: 0;
  z-index: 12;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1.7rem 0.65rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg1);
  box-shadow: var(--shadow);
}

.notes-pop-close {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.notes-pop-close:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.notes-pop .notes-input {
  margin: 0;
  min-height: 7rem;
}

.columns,
.match-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.match-headers {
  position: sticky;
  top: 0;
  z-index: 8;
  /* Mirror the row grid (with its centre mark column) so columns line up. */
  grid-template-columns: minmax(0, 1fr) 1.3rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.15rem 0 0.35rem;
  background: var(--bg1);
}

.match-headers .column-stack[data-column="english"] {
  grid-column: 3;
}

.column-stack {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.match-board {
  display: grid;
  gap: 0.2rem;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.puzzle-block {
  border-radius: 14px;
  padding: 0.85rem 0.9rem 1rem;
  border: 1px solid var(--line);
}

.examples-block {
  background: color-mix(in srgb, var(--bg2) 28%, var(--bg1));
  padding-top: 0;
}

.answers-block {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  text-align: center;
}

.block-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.block-label {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}

.block-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  background: var(--bg1);
}

.block-badge.accent {
  color: var(--accent-deep);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--bg1));
}

[data-theme="dark"] .block-badge.accent {
  color: var(--ink);
}

.block-hint {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.match-rows {
  display: grid;
  gap: 0.65rem;
}

.question-stack {
  display: grid;
  gap: 1.15rem;
}

.actions.translation-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.25rem;
  min-height: 0;
}

.actions.translation-actions .hints-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.hint-count {
  display: inline-flex;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--bg1));
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15rem;
  justify-content: center;
}

.hint-count[hidden] {
  display: none !important;
}

.actions.translation-actions .btn.primary {
  display: block;
  margin: 0;
}

.translation-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.55rem;
  margin-top: 0.7rem;
  min-height: 2.1rem;
}

.translation-meta .hints-btn {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.translation-meta .puzzle-timer {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.translation-meta #btn-help {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.translation-meta .help-pop,
.translation-meta .hints-pop {
  grid-column: 1 / -1;
  grid-row: 2;
}

.puzzle-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  min-height: 2.1rem;
  height: 2.1rem;
  padding: 0 0.72rem 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg1);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
}

.puzzle-timer:hover {
  background: color-mix(in srgb, var(--ink) 4%, var(--bg1));
  border-color: color-mix(in srgb, var(--ink) 22%, var(--line));
}

.puzzle-timer-icon {
  display: block;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
}

.puzzle-timer-time {
  display: inline-block;
  min-width: 2.1rem;
}

.puzzle-timer.is-collapsed {
  width: 2.1rem;
  padding: 0;
  justify-content: center;
}

.puzzle-timer.is-collapsed .puzzle-timer-time {
  display: none;
}

.puzzle-timer[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.actions.translation-actions .feedback {
  display: block;
  width: 100%;
  text-align: center;
  margin: 0.45rem 0 0;
}

.hints-pop {
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0.75rem 0 0;
  padding: 0.55rem 2.2rem 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg1);
  box-shadow: var(--shadow);
  text-align: left;
}

.hints-pop-title {
  margin: 0 0 0.5rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
}

.hints-pop-phenomena {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1.15rem;
  row-gap: 0.15rem;
  margin: -0.2rem 0 0.65rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
}

.hints-pop-meta-line {
  display: inline;
}

.hints-pop-close {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.hints-pop-close:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.hint-option {
  display: block;
  width: 100%;
  margin: 0 0 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg1);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.hint-option:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg1));
}

.hint-option.is-used,
.hint-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg1));
}

.hint-option:disabled {
  cursor: default;
  opacity: 0.72;
}

#hint-word-breaks,
#hint-live-check {
  display: none !important;
}

.hint-letter-option {
  margin-top: 0.35rem;
}

.hint-reveal-option {
  position: relative;
  margin-top: 1.75rem;
}

.hint-reveal-option::before {
  content: "";
  position: absolute;
  top: -0.9rem;
  left: 0;
  right: 0;
  border-top: 1px solid var(--line);
}

.hint-latin {
  margin: 0.8rem 0 0;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.hint-latin .hint-option {
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: normal;
}

.hints-pop .phenomenon-badges {
  flex: 0 1 auto;
  justify-content: flex-start;
  margin: 0 0 0.7rem;
}

.reveal-confirm {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

.reveal-confirm[hidden] {
  display: none !important;
}

.reveal-confirm-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(16, 24, 32, 0.45);
  cursor: pointer;
}

.reveal-confirm-dialog {
  position: relative;
  z-index: 1;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1.25rem 1.2rem 1.1rem;
  border-radius: var(--home-card-radius, 1rem);
  border: 1px solid var(--home-border, var(--line));
  background: var(--home-card-bg, var(--bg1));
  color: var(--home-body-text, var(--ink));
  box-shadow: var(--home-shadow, 0 16px 40px rgba(16, 24, 32, 0.28));
  box-sizing: border-box;
}

.reveal-confirm-title {
  margin: 0 0 0.45rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--home-heading, var(--ink));
}

.reveal-confirm-body {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--home-body-text, var(--ink));
}

.reveal-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.reveal-confirm-cancel,
.reveal-confirm-ok {
  min-height: 2.1rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border-width: 1.5px;
  border-style: solid;
  font-weight: 650;
  box-shadow: none;
}

.reveal-confirm-cancel {
  background: var(--home-pill-bg, #fff);
  color: var(--home-pill-text, var(--ink));
  border-color: var(--home-border, var(--line));
}

.reveal-confirm-cancel:hover {
  transform: none;
  background: var(--home-pill-hover-bg, color-mix(in srgb, var(--ink) 4%, #fff));
}

.reveal-confirm-ok {
  background: var(--home-primary, var(--accent));
  color: var(--home-button-text, #fff);
  border-color: var(--home-primary, var(--accent));
}

.reveal-confirm-ok:hover {
  transform: none;
  background: var(--home-primary-hover, var(--accent-deep));
  border-color: var(--home-primary-hover, var(--accent-deep));
}

.hint-structure-body {
  margin: 0.15rem 0 0.55rem;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 5%, var(--bg1));
  font-size: 0.86rem;
  line-height: 1.4;
}

.hint-structure-body p {
  margin: 0 0 0.35rem;
}

.hint-structure-example-label {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.hint-structure-body p:last-child {
  margin-bottom: 0;
}

.hint-rule-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.45;
}

.hint-rule-list li + li {
  margin-top: 0.45rem;
}

.hint-rule-body .reveal-glyph,
.hint-structure-body .reveal-glyph {
  vertical-align: middle;
  margin: 0.15rem 0.12rem;
}

/* A bare mark quoted in a hint or solution sits on the same line as the words. */
.glyph-mark-host {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.glyph-mark-slot {
  display: none;
}
.reveal-glyph:has(.glyph-mark-host) {
  align-items: center;
  vertical-align: middle;
}
.glyph-mark-host.has-above,
.glyph-mark-host.has-below,
.glyph-mark-host.has-corner,
.glyph-mark-host.has-inside,
.glyph-mark-host.has-beside {
  margin: 0;
}

.gloss-term {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.18em;
  cursor: help;
}

.gloss-term:hover,
.gloss-term[aria-expanded="true"] {
  color: var(--accent);
  text-decoration-style: solid;
}

.gloss-tip {
  display: block;
  margin: 0.45rem 0 0.1rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg1));
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.4;
}

.gloss-tip strong {
  font-weight: 700;
}

.hint-structure-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  margin-top: 0.35rem;
}

.hint-structure-part {
  display: grid;
  gap: 0.1rem;
}

.hint-structure-role {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hint-structure-word {
  font-weight: 700;
}

.question-card {
  padding: 0.15rem 0 0.35rem;
  border: 0;
  text-align: left;
}

.question-prompt-line,
.question-prompt-block {
  margin: 0.55rem 0 0.85rem;
  text-align: left;
  max-width: none;
}

.question-prompt-lead,
.question-prompt-phrase {
  margin: 0;
}

.question-prompt-lead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.22rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
}

.question-prompt-lead-text {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.question-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: auto;
  flex-shrink: 0;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--accent);
}

.question-pager-count {
  margin-right: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.question-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 999px;
  background: var(--bg1);
  color: var(--accent-deep);
  cursor: pointer;
}

.question-pager-btn .icon-svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.question-pager-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg1));
}

.question-pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.question-prompt-phrase {
  font-family: var(--font-language);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
}

.question-mark {
  display: inline-block;
  min-width: 0;
  margin-right: 0;
  font-weight: 700;
}

.question-mark:empty {
  display: none;
}

.question-mark.ok {
  color: var(--good);
}

.question-mark.bad {
  color: var(--bad);
}

.quoted-prompt {
  font-weight: 600;
}

.letter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 1.15rem;
  align-items: flex-end;
  max-width: 100%;
}

.accent-entry-note {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  font-style: italic;
}

.letter-row.letter-row-hidden-breaks {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.4rem 0.65rem;
}

.letter-run {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.18rem;
  align-items: flex-end;
  max-width: 100%;
}

.letter-word {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.18rem;
  align-items: flex-end;
  max-width: 100%;
}

.letter-run .letter-box,
.letter-word .letter-box {
  flex: 0 1 1.9rem;
  min-width: 1.15rem;
  width: auto !important;
  max-width: 1.9rem;
}

.letter-box {
  box-sizing: border-box;
  flex: 0 0 1.9rem;
  width: 1.9rem !important;
  min-width: 1.9rem;
  max-width: 1.9rem;
  height: 2.15rem;
  scroll-margin-bottom: calc(var(--kb-inset) + 1rem);
  margin: 0;
  padding: 0 !important;
  border: 1.5px solid #b8b8b8;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 2.15rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
}

.letter-box[data-kind="space"] {
  text-transform: none;
  margin-inline: 0.28rem;
}

.letter-box[data-kind="space"].is-filled,
.letter-box[data-kind="letter"].is-filled {
  background: color-mix(in srgb, var(--ink) 6%, #fff);
}

.letter-box.is-hinted {
  background: color-mix(in srgb, var(--accent) 16%, #fff);
  border-color: var(--accent);
}

[data-theme="dark"] .letter-box {
  background: var(--bg1);
  border-color: #8a8a8a;
}

[data-theme="dark"] .letter-box[data-kind="space"].is-filled,
[data-theme="dark"] .letter-box[data-kind="letter"].is-filled {
  background: color-mix(in srgb, var(--ink) 12%, var(--bg1));
}

[data-theme="dark"] .letter-box.is-hinted {
  background: color-mix(in srgb, var(--accent) 22%, var(--bg1));
}

.letter-box:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.letter-word.correct .letter-box,
.letter-box.correct {
  border-color: var(--good);
}

.letter-word.incorrect .letter-box,
.letter-box.incorrect {
  border-color: var(--bad);
}

.letter-punct {
  display: inline-block;
  min-width: 0.45rem;
  padding: 0 0.05rem 0.15rem;
  font-weight: 600;
  color: var(--muted);
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.3rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: stretch;
}

.match-mark {
  align-self: center;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  user-select: none;
  pointer-events: none;
}

.match-mark.ok {
  color: var(--good);
}

.match-mark.bad {
  color: var(--bad);
}

.match-cell {
  display: flex;
  min-width: 0;
}

.match-cell .sentence-item {
  flex: 1;
  width: 100%;
  height: 100%;
}

.column {
  /* Opaque so sentence rows don't show through the sticky headers */
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  box-shadow: var(--shadow);
}

.column-head {
  display: inline-flex;
  align-items: baseline;
  width: fit-content;
  max-width: 100%;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg1));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  box-shadow: none;
}

.column-stack .column-head {
  justify-self: start;
}

.column-head h3 {
  margin: 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-deep);
}

[data-theme="dark"] .column-head h3 {
  color: var(--ink);
}

.column-total {
  display: none;
}

.column-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.column-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.swatch {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 2px solid var(--swatch-ring);
  cursor: pointer;
  padding: 0;
}

.swatch .count {
  position: absolute;
  right: -0.35rem;
  top: -0.35rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg1);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}

.swatch .count.is-zero {
  display: none;
}

.highlight-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.notes-block {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line));
}

.notes-block .block-label label {
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}

.notes-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg1);
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  resize: vertical;
  min-height: 4rem;
}

.highlight-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  color: var(--ink);
  font-size: 0.85rem;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.highlight-option input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.selected-word {
  color: var(--ink);
  font-weight: 600;
}

.sentence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.sentence-item {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.55rem;
  align-items: start;
  background: color-mix(in srgb, var(--bg2) 35%, var(--bg1));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
  min-height: 100%;
  transition:
    border-color 0.12s ease,
    background 0.12s ease,
    opacity 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.12s ease;
}

.sentence-item.press-active,
.sentence-item.drag-ready,
.sentence-item.dragging {
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.sentence-item.drag-ready {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 12%, var(--bg1));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent),
    0 8px 20px color-mix(in srgb, var(--accent) 18%, transparent);
  cursor: grabbing;
}

.sentence-item.dragging {
  opacity: 0.35;
  transform: scale(0.98);
  box-shadow: none;
  cursor: grabbing;
}

.sentence-item:active {
  cursor: grabbing;
}

.sentence-item.fixed,
.sentence-item.fixed:active {
  cursor: default;
  touch-action: pan-y;
}

.sentence-item.fixed .drag-handle {
  display: none;
}

.sentence-item.fixed {
  grid-template-columns: 1fr;
}

.sentence-item.drop-before::before,
.sentence-item.drop-after::after {
  content: "";
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  height: 0.28rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent),
    0 0 14px color-mix(in srgb, var(--accent) 45%, transparent);
  z-index: 3;
  pointer-events: none;
}

.sentence-item.drop-before::before {
  top: -0.5rem;
}

.sentence-item.drop-after::after {
  bottom: -0.5rem;
}

.sentence-item.drop-before,
.sentence-item.drop-after {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg1));
}

.drag-handle {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.2;
  user-select: none;
  -webkit-user-select: none;
  padding: 0.15rem 0.2rem;
  border-radius: 6px;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.sentence-item .label {
  font-weight: 700;
  color: var(--accent);
  min-width: 1.4rem;
  pointer-events: none;
}

body[data-page="puzzle"] #match-rows .sentence-item,
body[data-page="puzzle"] #match-rows .sentence-item .text,
body[data-page="puzzle"] #match-rows .sentence-item .text .token {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent !important;
  cursor: pointer;
  touch-action: manipulation;
}

body[data-page="puzzle"] #match-rows .sentence-item .text::selection,
body[data-page="puzzle"] #match-rows .sentence-item .text *::selection,
body[data-page="puzzle"] #match-rows .sentence-item::selection,
body[data-page="puzzle"] #match-rows .sentence-item *::selection {
  background: transparent !important;
  color: inherit !important;
}

.token {
  cursor: pointer;
  border-radius: 0.25rem;
  padding: 0.02em 0.1em;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.sentence-item .text {
  line-height: 1.55;
}

/* Puzzle bilingual text — IBM Plex Sans: clear I / l / 1, plain zero */
.match-cell .sentence-item .text,
.match-cell .token,
.letter-box,
.hint-structure-word,
.reveal-vocab,
.reveal-counting-pair,
.testpuzzle-pair-lang,
.testpuzzle-pair-en,
#lang-name,
#language-heading,
.play-lede .play-lang-name,
.daily-cta-lang {
  font-family: var(--font-language);
}

.token:hover {
  outline: 1px dashed var(--token-hover);
}

.token.selected {
  outline: 2px solid var(--token-selected);
}

.token.hl-1,
.token-menu-swatch.hl-1 { background-color: var(--hl-1-fill); }
.token.hl-2,
.token-menu-swatch.hl-2 { background-color: var(--hl-2-fill); }
.token.hl-3,
.token-menu-swatch.hl-3 { background-color: var(--hl-3-fill); }
.token.hl-4,
.token-menu-swatch.hl-4 { background-color: var(--hl-4-fill); }
.token.hl-5,
.token-menu-swatch.hl-5 { background-color: var(--hl-5-fill); }
.token.hl-6,
.token-menu-swatch.hl-6 { background-color: var(--hl-6-fill); }
.token.hl-7,
.token-menu-swatch.hl-7 { background-color: var(--hl-7-fill); }
.token.hl-8,
.token-menu-swatch.hl-8 { background-color: var(--hl-8-fill); }

.token.hl-1,
.token.hl-2,
.token.hl-3,
.token.hl-4,
.token.hl-5,
.token.hl-6,
.token.hl-7,
.token.hl-8 {
  color: color-mix(in srgb, var(--ink) 86%, #000);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.1em 0.12em;
}

[data-theme="dark"] .token.hl-1,
[data-theme="dark"] .token.hl-2,
[data-theme="dark"] .token.hl-3,
[data-theme="dark"] .token.hl-4,
[data-theme="dark"] .token.hl-5,
[data-theme="dark"] .token.hl-6,
[data-theme="dark"] .token.hl-7,
[data-theme="dark"] .token.hl-8 {
  color: var(--ink);
}

html[data-theme="dark"] .token.hl-1,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .token.hl-1 {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl-1) 72%, transparent);
}

html[data-theme="dark"] .token.hl-2,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .token.hl-2 {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl-2) 72%, transparent);
}

html[data-theme="dark"] .token.hl-3,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .token.hl-3 {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl-3) 72%, transparent);
}

html[data-theme="dark"] .token.hl-4,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .token.hl-4 {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl-4) 72%, transparent);
}

html[data-theme="dark"] .token.hl-5,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .token.hl-5 {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl-5) 72%, transparent);
}

html[data-theme="dark"] .token.hl-6,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .token.hl-6 {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl-6) 72%, transparent);
}

html[data-theme="dark"] .token.hl-7,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .token.hl-7 {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl-7) 72%, transparent);
}

html[data-theme="dark"] .token.hl-8,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .token.hl-8 {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--hl-8) 72%, transparent);
}

.token.hl-pat-1,
.token.hl-pat-2,
.token.hl-pat-3,
.token.hl-pat-4,
.token.hl-pat-5,
.token.hl-pat-6,
.token.hl-pat-7,
.token.hl-pat-8 {
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0.1em 0.1em;
}

.token.hl-pat-1 { border: 2px solid var(--hl-pattern-ink); }
.token.hl-pat-2 { border: 2px dashed var(--hl-pattern-ink); }
.token.hl-pat-3 { border: 2px dotted var(--hl-pattern-ink); }
.token.hl-pat-4 { border: 3px double var(--hl-pattern-ink); }
.token.hl-pat-5 {
  border: none;
  border-radius: 0;
  text-decoration-line: underline;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 0.16em;
  padding-bottom: 0.04em;
}
.token.hl-pat-6 {
  background-image: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--hl-pattern-ink) 28%, transparent) 0 1px,
    transparent 1px 6px
  );
}
.token.hl-pat-7 {
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--hl-pattern-ink);
}
.token.hl-pat-8 {
  border: none;
  border-left: 4px solid var(--hl-pattern-ink);
  padding-left: 0.12em;
}

.token.hl-mark-1::after,
.token.hl-mark-2::after,
.token.hl-mark-3::after,
.token.hl-mark-4::after,
.token.hl-mark-5::after,
.token.hl-mark-6::after,
.token.hl-mark-7::after,
.token.hl-mark-8::after {
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1;
  vertical-align: super;
  margin-left: 0.12em;
  color: var(--ink);
}

.token.hl-mark-1::after { content: "*"; }
.token.hl-mark-2::after { content: "†"; }
.token.hl-mark-3::after { content: "‡"; }
.token.hl-mark-4::after { content: "§"; }
.token.hl-mark-5::after { content: "‖"; }
.token.hl-mark-6::after { content: "¶"; }
.token.hl-mark-7::after { content: "※"; }
.token.hl-mark-8::after { content: "°"; }

.actions {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.question-prompt {
  cursor: default;
}

.reveal {
  position: relative;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  color: var(--muted);
}

.reveal-close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.7rem;
  height: 1.7rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.reveal-close:hover {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.reveal-list {
  margin: 0.35rem 0 0.85rem;
  padding-left: 1.2rem;
}

.reveal-list li + li {
  margin-top: 0.35rem;
}

body[data-page="puzzle"] #reveal .reveal-vocab {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.2rem, 1fr));
  gap: 0.28rem 1.1rem;
  margin: 0.2rem 0 0.85rem;
  padding-left: 0;
  list-style: none;
}

body[data-page="puzzle"] #reveal .reveal-vocab li,
body[data-page="puzzle"] #reveal .reveal-vocab li + li {
  margin: 0;
}

.reveal-actions {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.reveal strong {
  color: var(--ink);
}

@media (max-width: 800px) {
  .page {
    width: 100%;
    padding: 0.4rem 0.35rem 1.5rem;
    padding-left: max(0.35rem, env(safe-area-inset-left));
    padding-right: max(0.35rem, env(safe-area-inset-right));
  }

  .panel {
    border-radius: 8px;
    padding: 0.4rem 0.3rem;
    margin-bottom: 0.4rem;
    box-shadow: none;
  }

  .hero {
    margin-bottom: 0.5rem;
  }

  .brand {
    font-size: 1.75rem;
  }

  .hero h1 {
    font-size: 0.98rem;
    margin: 0.3rem 0 0.2rem;
  }

  .lede {
    display: none;
  }

  .section-head h2 {
    font-size: 1.2rem;
  }

  .section-head p {
    font-size: 0.78rem;
    line-height: 1.3;
    margin-bottom: 0.45rem;
  }

  .control-grid,
  .meta {
    grid-template-columns: 1fr;
  }

  .match-board {
    gap: 0.3rem;
  }

  /* Keep side-by-side columns; compress sticky chrome */
  .match-headers {
    position: sticky;
    top: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0.2rem minmax(0, 1fr);
    gap: 0.06rem;
    padding: 0.1rem 0 0.18rem;
    background: var(--bg1);
  }

  .match-headers .column-stack[data-column="english"] {
    grid-column: 3;
  }

  .column-stack {
    gap: 0.15rem;
  }

  .column {
    padding: 0.2rem;
    border-radius: 6px;
    box-shadow: none;
    background: var(--bg1);
    border-color: transparent;
  }

  .column-hint {
    display: none;
  }

  .column-head {
    padding: 0.18rem 0.4rem;
    border-radius: 6px;
  }

  .column-head h3 {
    font-size: 0.68rem;
  }

  .column-palette {
    gap: 0.15rem;
    margin-bottom: 0;
  }

  .swatch {
    width: 1.25rem;
    height: 1.25rem;
  }

  .swatch .count {
    min-width: 0.85rem;
    height: 0.85rem;
    font-size: 0.55rem;
    line-height: 0.85rem;
    right: -0.18rem;
    top: -0.18rem;
  }

    /* Light section labels — avoid heavy nested cards */
  .puzzle-block {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .examples-block {
    background: transparent;
  }

  .answers-block {
    margin-top: 0.25rem;
    padding-top: 0.4rem;
    border-top: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line));
    background: transparent;
    box-shadow: none;
  }

  .block-label-row {
    margin-bottom: 0.1rem;
  }

  .block-label {
    font-size: 0.9rem;
  }

  .block-hint {
    display: none;
  }

  .block-badge {
    font-size: 0.58rem;
    padding: 0.1rem 0.3rem;
  }

  /* Ruled pairs: no grey cards, hairline between rows */
  .match-rows {
    gap: 0;
  }

  .match-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0.2rem minmax(0, 1fr);
    gap: 0.06rem;
    align-items: start;
    padding: 0.2rem 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  .match-row:first-child {
    border-top: 0;
  }

  .match-row:last-child {
    border-bottom: 0;
  }

  .match-cell {
    min-width: 0;
  }

  .match-cell::before {
    content: none !important;
    display: none !important;
  }

  .match-mark {
    align-self: center;
    position: static;
    font-size: 0.8rem;
  }

  .match-mark:empty {
    display: block;
    visibility: hidden;
  }

  /* Flatten given text */
  #match-rows .sentence-item {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0.08rem 0.02rem;
    gap: 0.2rem;
    min-height: 0;
  }

  #match-rows .sentence-item.drag-ready,
  #match-rows .sentence-item.drop-before,
  #match-rows .sentence-item.drop-after {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-radius: 4px;
  }

  .question-stack {
    gap: 0.85rem;
  }

  .question-prompt-line,
  .question-prompt-block {
    margin: 0.5rem 0 0.7rem;
  }

  .question-prompt-lead {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }

  .question-prompt-phrase {
    font-size: 1.18rem;
  }

  .letter-box {
    flex-basis: 1.55rem;
    width: 1.55rem !important;
    min-width: 1.55rem;
    max-width: 1.55rem;
    height: 1.8rem;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.8rem;
  }

  .letter-run .letter-box,
  .letter-word .letter-box {
    flex: 0 1 1.55rem;
    min-width: 1.1rem;
    width: auto !important;
    max-width: 1.55rem;
  }

  .sentence-item {
    grid-template-columns: auto 1fr;
    gap: 0.2rem;
    padding: 0.15rem 0.05rem;
    border-radius: 0;
    min-height: 0;
  }

  .drag-handle {
    display: none;
  }

  .sentence-item .label {
    min-width: 0.95rem;
    font-size: 0.8rem;
  }

  .sentence-item .text {
    font-family: var(--font-language);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--ink);
    overflow-wrap: break-word;
  }

  .token {
    padding: 0.04em 0.1em;
    border-radius: 0.16rem;
  }

  .notes-block {
    margin-top: 0.35rem;
    padding-top: 0.4rem;
  }

  .notes-input {
    min-height: 2.75rem;
    padding: 0.4rem 0.45rem;
    margin-top: 0.25rem;
    border-radius: 6px;
  }

  .highlight-option {
    margin-top: 0.45rem;
    font-size: 0.75rem;
    gap: 0.35rem;
  }

  .highlight-actions {
    margin-top: 0.4rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
  }

  .selected-word {
    font-size: 0.75rem;
  }

  .actions {
    margin-top: 0.55rem;
    gap: 0.45rem;
  }

  .btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
  }

  .hero-top {
    flex-direction: row;
    align-items: center;
  }

  .theme-toggle {
    padding: 0;
  }

  body.has-osk {
    --kb-inset: calc(11.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.has-osk .page {
    padding-bottom: calc(var(--kb-inset) + 4.5rem);
  }

  .osk {
    gap: 0.24rem;
    padding: 0.35rem 0.22rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  }

  .osk-key {
    height: 2.8rem;
    min-width: 0;
    border-radius: 6px;
    font-size: 1.06rem;
  }
}

/* ── Desktop ruled layout (mirrors mobile style, wider viewport) ── */
@media (min-width: 801px) {
  /* Flatten sentence blocks — no grey cards, ruled rows */
  .puzzle-block {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .examples-block {
    background: transparent;
  }

  .answers-block {
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    border: 0;
    border-top: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line));
    background: transparent;
    box-shadow: none;
  }

  .block-hint {
    font-size: 0.85rem;
    margin-bottom: 0.55rem;
  }

  /* Ruled rows */
  .match-rows {
    gap: 0;
  }

  .match-row {
    align-items: start;
    padding: 0.45rem 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  .match-row:first-child {
    border-top: 0;
  }

  .match-row:last-child {
    border-bottom: 0;
  }

  /* Flatten training sentences */
  #match-rows .sentence-item {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0.2rem 0.1rem;
    gap: 0.3rem;
    min-height: 0;
  }

  #match-rows .sentence-item.drag-ready,
  #match-rows .sentence-item.drop-before,
  #match-rows .sentence-item.drop-after {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-radius: 6px;
  }

  /* Remove drag handle on desktop ruled layout */
  .drag-handle {
    display: none;
  }

  .sentence-item {
    grid-template-columns: auto 1fr;
    gap: 0.3rem;
    min-height: 0;
  }
}

/* Puzzle page */
.puzzle-page {
  padding-top: 1.25rem;
}

.puzzle-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.5rem 0.4rem 0.65rem;
}

.puzzle-topbar-meta {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.meta-chip {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  flex: 1 1 0;
}

.meta-chip:last-child {
  flex: 0 1 auto;
  max-width: 5.5rem;
}

.puzzle-topbar .meta-label {
  margin: 0;
  font-size: 0.62rem;
  line-height: 1;
}

.meta-chip strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.close-btn {
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
}

#btn-reveal {
  font-weight: 700;
  font-size: 1.15rem;
}

.close-btn span {
  display: block;
  transform: translateY(-0.05rem);
}

.puzzle-status {
  margin: 0 0 1rem;
}

.swatch-readonly {
  cursor: default;
  pointer-events: none;
}

.token-menu {
  --token-menu-pad: 0.95rem;
  --token-menu-gap: 0.55rem;
  --token-menu-pointer: 11px;
  position: fixed;
  z-index: 45;
  width: min(320px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: var(--token-menu-pad);
  border-width: var(--home-card-border-width, 1.5px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border, var(--line));
  border-radius: var(--home-card-radius, 12px);
  background-color: var(--home-card-bg, var(--bg1, #fffbef));
  color: var(--home-body-text, var(--ink));
  box-shadow: var(--home-card-shadow, var(--home-shadow, var(--shadow)));
  pointer-events: auto;
}

.token-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background-color: var(--home-card-bg, #fffbef);
  pointer-events: none;
}

.token-menu--portal {
  background-color: var(--home-card-bg, #fffbef);
}

body[data-page="puzzle"] .token-menu.is-sheet {
  position: fixed;
  z-index: 46;
  margin: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.token-menu-toolbar,
.token-menu-mode,
.token-menu-colors,
.token-menu-notes-panel,
.token-menu-match-option {
  position: relative;
  z-index: 1;
}

.token-menu[hidden] {
  display: none;
}

.token-menu-pointer {
  display: none;
  position: absolute;
  width: var(--token-menu-pointer);
  height: var(--token-menu-pointer);
  background: var(--home-card-bg, var(--bg1));
  border-left: var(--home-card-border-width, 1.5px) solid var(--home-border, var(--line));
  border-top: var(--home-card-border-width, 1.5px) solid var(--home-border, var(--line));
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 1;
}

.token-menu[data-placement="top"] .token-menu-pointer {
  display: block;
  bottom: calc(var(--token-menu-pointer) / -2 - 1px);
  left: var(--token-menu-arrow-left, 50%);
  margin-left: calc(var(--token-menu-pointer) / -2);
  border-left: 0;
  border-top: 0;
  border-right: var(--home-card-border-width, 1.5px) solid var(--home-border, var(--line));
  border-bottom: var(--home-card-border-width, 1.5px) solid var(--home-border, var(--line));
}

.token-menu[data-placement="bottom"] .token-menu-pointer {
  display: block;
  top: calc(var(--token-menu-pointer) / -2 - 1px);
  left: var(--token-menu-arrow-left, 50%);
  margin-left: calc(var(--token-menu-pointer) / -2);
}

.token-menu-toolbar {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  margin: 0 0 var(--token-menu-gap);
}

.token-menu-toolbar .token-menu-mode {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.token-menu-toolbar .token-menu-close {
  width: 2.65rem;
  height: auto;
  align-self: stretch;
  min-height: 2.65rem;
}

.token-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0 0 var(--token-menu-gap);
}

.token-menu-title {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--home-heading, var(--ink));
  line-height: 1.2;
}

.token-menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--home-border, var(--line));
  border-radius: var(--home-button-radius, 0.45rem);
  background: var(--home-pill-bg, color-mix(in srgb, var(--ink) 6%, var(--bg1)));
  color: var(--home-pill-text, var(--ink));
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.token-menu-close span {
  display: block;
  transform: translateY(-0.05rem);
}

.token-menu-close:hover {
  background: var(--home-pill-hover-bg, color-mix(in srgb, var(--ink) 10%, var(--bg1)));
  border-color: var(--home-primary, var(--accent));
}

.token-menu-close:focus-visible {
  outline: 2px solid var(--home-focus, var(--accent));
  outline-offset: 2px;
}

.token-menu-mode,
.highlight-mode-toggle {
  display: flex;
  gap: 0;
  padding: 0;
  border: 1.5px solid var(--home-border, var(--line));
  border-radius: var(--home-button-radius, 0.45rem);
  background: color-mix(
    in srgb,
    var(--home-body-text, var(--ink)) 5%,
    var(--home-card-tint, var(--home-card-bg, #fffbef))
  );
  overflow: hidden;
}

.token-menu-mode {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 var(--token-menu-gap);
}

.token-menu-mode .token-menu-mode-btn {
  flex: 1 1 0;
  min-height: 2.65rem;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--home-border, var(--line));
  background: transparent;
  color: var(--home-muted-text, var(--muted));
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.4rem 0.2rem;
  cursor: pointer;
}

.token-menu-mode .token-menu-mode-btn:last-child {
  border-right: 0;
}

.token-menu-mode-btn.is-active,
.highlight-mode-btn.is-active {
  background: var(--home-pill-bg, var(--bg1));
  color: var(--home-pill-text, var(--ink));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--home-primary, var(--accent)) 35%, transparent);
}

.token-menu-mode-btn:focus-visible,
.highlight-mode-btn:focus-visible {
  outline: 2px solid var(--home-focus, var(--accent));
  outline-offset: -2px;
  z-index: 1;
}

.highlight-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.55rem 0 0.15rem;
}

.highlight-mode-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.highlight-mode-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.32rem 0.58rem;
  cursor: pointer;
}

.token-menu-colors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: center;
  justify-items: center;
  min-height: 2.85rem;
  margin: 0 0 0.45rem;
  background-color: var(--home-card-bg, #fffbef);
  border-radius: calc(var(--home-button-radius, 0.45rem) - 0.05rem);
}

.token-menu-colors[hidden] {
  display: none;
}

.token-menu-notes-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0 0 0.15rem;
}

.token-menu-notes-panel[hidden] {
  display: none;
}

.token-menu-notes-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 6.5rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--home-border, var(--line));
  border-radius: calc(var(--home-button-radius, 0.45rem) - 0.05rem);
  background: var(--home-card-bg, #fffbef);
  color: var(--home-ink, var(--ink));
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
  resize: vertical;
}

.token-menu-notes-input:focus-visible {
  outline: 2px solid var(--home-focus, var(--accent));
  outline-offset: 1px;
}

.token-menu-match-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.1rem 0.05rem 0;
  font-size: 0.74rem;
  font-weight: 450;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  color: var(--home-muted-text, var(--muted));
  cursor: pointer;
}

.token-menu-match-option[hidden] {
  display: none;
}

.token-menu-match-option input {
  flex-shrink: 0;
  width: 0.92rem;
  height: 0.92rem;
  margin: 0;
  accent-color: var(--home-primary, var(--accent));
  cursor: pointer;
}

.token-menu-match-option span {
  flex: 0 1 auto;
  min-width: 0;
  text-transform: none;
  letter-spacing: normal;
}

.token-menu-swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 2px solid var(--swatch-ring);
  border-radius: 999px;
  background: transparent;
  color: var(--home-body-text, var(--ink));
  cursor: pointer;
  box-sizing: border-box;
}

.token-menu-swatch:focus-visible {
  outline: 2px solid var(--home-focus, var(--accent));
  outline-offset: 2px;
}

.token-menu-swatch.is-selected {
  box-shadow:
    0 0 0 2px var(--home-card-bg, var(--bg1)),
    0 0 0 4px var(--home-primary, var(--accent));
}

.token-menu-swatch.is-selected::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--home-heading, var(--ink));
  text-shadow:
    0 0 2px var(--home-card-bg, #fff),
    0 0 2px var(--home-card-bg, #fff);
  pointer-events: none;
}

.token-menu-colors.token-menu-patterns .token-menu-swatch {
  border-radius: 6px;
  background-color: transparent;
}

.token-menu-pattern-1 { border: 2px solid var(--hl-pattern-ink); }
.token-menu-pattern-2 { border: 2px dashed var(--hl-pattern-ink); }
.token-menu-pattern-3 { border: 2px dotted var(--hl-pattern-ink); }
.token-menu-pattern-4 { border: 3px double var(--hl-pattern-ink); }
.token-menu-pattern-5 {
  border: none;
  border-bottom: 3px solid var(--hl-pattern-ink);
  border-radius: 2px;
}
.token-menu-colors.token-menu-patterns .token-menu-swatch.token-menu-pattern-6 {
  border: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--hl-pattern-ink) 28%, transparent) 0 1px,
    transparent 1px 6px
  );
}
.token-menu-pattern-7 {
  border: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--hl-pattern-ink);
}
.token-menu-pattern-8 {
  border: none;
  border-left: 4px solid var(--hl-pattern-ink);
  border-radius: 2px;
}

.token-menu-colors.token-menu-marks .token-menu-swatch {
  border-radius: 6px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.token-menu-swatch:hover {
  filter: brightness(0.97);
}

.token-menu-backdrop {
  display: none !important;
}

.token-menu[data-placement="docked"] .token-menu-pointer {
  display: none;
}

@media (max-width: 599px) {
  .token-menu {
    width: min(320px, calc(100vw - 24px));
  }
}

/* ── Daily Decodish brand skin (puzzle page) ───────────────────────── */
body[data-page="puzzle"] {
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  background: var(--paper, #ffffff);
}

body[data-page="puzzle"][data-theme="light"],
html[data-theme="light"] body[data-page="puzzle"] {
  --ink: #1f2a24;
  --paper: #ffffff;
  --card: #f3f1eb;
  --teal: #1f7a6b;
  --coral: #e6765b;
  --gold: #e7b653;
  --blue: #8eb8c8;
  --rule: #d8d3c7;
  --muted: #5d6b63;
  --bg0: #ffffff;
  --bg1: #f3f1eb;
  --bg2: #e8e4db;
  --accent: #1f7a6b;
  --accent-deep: #16584d;
  --good: #2f7d4c;
  --bad: #b33b3b;
  --panel: rgba(243, 241, 235, 0.96);
  --line: rgba(31, 42, 36, 0.12);
  --shadow: 0 9px 22px rgba(24, 48, 47, 0.06);
  --swatch-ring: rgba(24, 48, 47, 0.18);
  --token-hover: rgba(24, 48, 47, 0.28);
  --token-selected: #1f2a24;
  --bg-grad-a: transparent;
  --bg-grad-b: transparent;
  --hl-pattern-fill: color-mix(in srgb, var(--ink) 8%, transparent);
}

body[data-page="puzzle"][data-theme="dark"],
html[data-theme="dark"] body[data-page="puzzle"] {
  --ink: #f2ebe0;
  --paper: #1c2624;
  --card: #24302d;
  --teal: #5aa897;
  --coral: #e8957f;
  --gold: #e7b653;
  --blue: #8eb8c8;
  --rule: #3a4642;
  --muted: #9aa7a2;
  --bg0: #1c2624;
  --bg1: #24302d;
  --bg2: #2c3935;
  --accent: #5aa897;
  --accent-deep: #7bc4b4;
  --good: #5aa897;
  --bad: #e8957f;
  --panel: rgba(36, 48, 45, 0.96);
  --line: rgba(242, 235, 224, 0.14);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  --swatch-ring: rgba(242, 235, 224, 0.28);
  --token-hover: rgba(242, 235, 224, 0.35);
  --token-selected: #fff;
  --bg-grad-a: transparent;
  --bg-grad-b: transparent;
  --hl-pattern-fill: color-mix(in srgb, var(--ink) 14%, transparent);
}

body[data-page="puzzle"],
html[data-theme="dark"] body[data-page="puzzle"] {
  background: var(--paper);
}

body[data-page="puzzle"] .puzzle-page {
  width: min(720px, calc(100% - 1.5rem));
  padding: 0.45rem 0 3.5rem;
}

body.has-osk[data-page="puzzle"] .puzzle-page {
  padding-bottom: calc(var(--kb-inset) + 0.35rem);
}

body[data-page="puzzle"] .daily-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  min-height: 2.9rem;
}

body[data-page="puzzle"] .daily-top-start,
body[data-page="puzzle"] .daily-top-end {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 3;
  flex-shrink: 0;
}

body[data-page="puzzle"] .daily-top-start {
  justify-content: flex-start;
}

body[data-page="puzzle"] .daily-top-end {
  justify-content: flex-end;
}

body[data-page="puzzle"] .masthead {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  pointer-events: none;
  z-index: 1;
}

body[data-page="puzzle"] .masthead-lockup {
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-right: 0;
  max-width: min(16.5rem, calc(100vw - 9.5rem));
  pointer-events: auto;
}

body[data-page="puzzle"] .masthead-tagline {
  margin: 0.08rem 0 0;
  padding: 0;
  border: 0;
  text-align: center;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

body[data-page="puzzle"] .masthead-logo {
  height: auto;
  width: min(11rem, calc(100vw - 12rem));
  max-width: none;
}

body[data-page="puzzle"] .daily-top-actions {
  display: none;
}

body[data-page="puzzle"] .chrome-btn.icon-btn,
body[data-page="puzzle"] .chrome-btn.reset-btn,
body[data-page="puzzle"] .chrome-btn.save-btn,
body[data-page="puzzle"] .chrome-btn.help-btn {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

body[data-page="puzzle"] .chrome-btn.puzzle-timer {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--home-pill-bg, #fff);
  color: var(--home-pill-text, var(--ink));
  box-shadow: none;
}

body[data-page="puzzle"] .chrome-btn.theme-toggle {
  border-radius: 0.55rem;
}

body[data-page="puzzle"] .chrome-btn.icon-btn:hover,
body[data-page="puzzle"] .chrome-btn.reset-btn:hover,
body[data-page="puzzle"] .chrome-btn.save-btn:hover,
body[data-page="puzzle"] .chrome-btn.help-btn:hover {
  background: color-mix(in srgb, var(--ink) 4%, #fff);
  border-color: color-mix(in srgb, var(--ink) 22%, var(--line));
}

body[data-page="puzzle"] .chrome-btn.puzzle-timer:hover {
  background: var(--home-pill-hover-bg, color-mix(in srgb, var(--ink) 4%, #fff));
  border-color: color-mix(in srgb, var(--home-pill-text, var(--ink)) 22%, var(--line));
}

html[data-theme="dark"] body[data-page="puzzle"] .chrome-btn.icon-btn,
html[data-theme="dark"] body[data-page="puzzle"] .chrome-btn.reset-btn,
html[data-theme="dark"] body[data-page="puzzle"] .chrome-btn.save-btn {
  background: var(--bg1);
  border-color: #8a8a8a;
}

html[data-theme="dark"] body[data-page="puzzle"] .chrome-btn.puzzle-timer {
  background: var(--home-pill-bg, var(--bg1));
  color: var(--home-pill-text, var(--ink));
  border-color: color-mix(in srgb, var(--home-pill-text, var(--ink)) 35%, var(--line));
}

html[data-theme="dark"] body[data-page="puzzle"] .chrome-btn.icon-btn:hover,
html[data-theme="dark"] body[data-page="puzzle"] .chrome-btn.reset-btn:hover,
html[data-theme="dark"] body[data-page="puzzle"] .chrome-btn.save-btn:hover {
  background: color-mix(in srgb, var(--ink) 10%, var(--bg1));
}

html[data-theme="dark"] body[data-page="puzzle"] .chrome-btn.puzzle-timer:hover {
  background: var(--home-pill-hover-bg, color-mix(in srgb, var(--ink) 10%, var(--bg1)));
}

body[data-page="puzzle"] .translation-meta {
  position: relative;
}

body[data-page="puzzle"] .translation-meta .help-pop {
  top: auto;
  bottom: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
}

body[data-page="puzzle"] .daily-card {
  background: var(--card, var(--bg1));
  border: 1px solid color-mix(in srgb, var(--ink) 10%, var(--line));
  border-top: 3px solid var(--accent);
  border-radius: 20px;
  padding: 0.55rem 1.35rem 1.2rem;
  box-shadow: var(--shadow);
}

html[data-theme="dark"] body[data-page="puzzle"] .daily-card {
  background: var(--bg1);
  border-color: var(--line);
  border-top-color: var(--accent);
}

body[data-page="puzzle"] .issue-line {
  margin: 0 0 0.45rem;
  padding-top: 0.12rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--accent);
}

body[data-page="puzzle"] .issue-sep {
  margin: 0 0.25rem;
  opacity: 0.7;
}

body[data-page="puzzle"] .heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.45rem;
}

body[data-page="puzzle"] .heading-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

body[data-page="puzzle"] .reset-btn,
body[data-page="puzzle"] .save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: auto;
  height: 2.1rem;
  margin: 0;
  padding: 0 0.72rem 0 0.55rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

body[data-page="puzzle"] .reset-btn .icon-svg,
body[data-page="puzzle"] .save-btn .icon-svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

body[data-page="puzzle"] .reset-btn:hover,
body[data-page="puzzle"] .save-btn:hover {
  background: color-mix(in srgb, var(--ink) 4%, #fff);
}

html[data-theme="dark"] body[data-page="puzzle"] .reset-btn,
html[data-theme="dark"] body[data-page="puzzle"] .save-btn {
  background: var(--bg1);
  border-color: #8a8a8a;
}

html[data-theme="dark"] body[data-page="puzzle"] .reset-btn:hover,
html[data-theme="dark"] body[data-page="puzzle"] .save-btn:hover {
  background: color-mix(in srgb, var(--ink) 10%, var(--bg1));
}

body[data-page="puzzle"] #btn-save-pack[hidden],
body[data-page="puzzle"][data-mode="static"] #btn-save-pack {
  display: none !important;
}

body[data-page="puzzle"] .section-head h2,
body[data-page="puzzle"] #puzzle-heading {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 4.5vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

body[data-page="puzzle"] .heading-row .icon-btn {
  margin-top: 0;
  align-self: center;
}

body[data-page="puzzle"] .instruction,
body[data-page="puzzle"] #puzzle-instructions {
  display: none;
}

body[data-page="puzzle"] .highlight-mode-bar {
  display: none;
}

body[data-page="puzzle"] .section-head {
  position: relative;
}

body[data-page="puzzle"] .notes-pop {
  top: 2.6rem;
  right: 0;
}

body[data-page="puzzle"] .help-pop {
  padding: 1.7rem 0.75rem 0.75rem;
}

body[data-page="puzzle"] .help-body {
  margin: 0 0 0.7rem;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.45;
}

body[data-page="puzzle"] .help-body p {
  margin: 0 0 0.55rem;
}

body[data-page="puzzle"] .help-steps {
  margin: 0 0 0.55rem;
  padding-left: 1.15rem;
}

body[data-page="puzzle"] .help-steps li {
  margin: 0 0 0.35rem;
}

body[data-page="puzzle"] .help-pop .issue-line {
  margin: 0 1.8rem 0.45rem 0;
  padding-top: 0;
  border-top: 0;
  font-size: 0.72rem;
}

body[data-page="puzzle"] .help-pop .issue-meta {
  margin: 0;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--accent);
}

body[data-page="puzzle"] .close-btn {
  width: 3.55rem;
  height: 2.1rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0 0.85rem;
}

body[data-page="puzzle"] .question-prompt-block {
  margin: 0.2rem 0 0.55rem;
  padding: 0.05rem 0.15rem 0.1rem;
  text-align: center;
}

body[data-page="puzzle"] .question-prompt-lead {
  justify-content: center;
  color: var(--accent);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
}

body[data-page="puzzle"] .question-prompt-lead-text {
  justify-content: center;
}

body[data-page="puzzle"] .question-prompt-phrase {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 4.2vw, 1.9rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  text-align: center;
  overflow: visible;
  padding-top: 0.85rem;
}

body[data-page="puzzle"] .question-prompt-phrase:has(.glyph-token) {
  font-family: var(--font-language);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  padding-top: 0;
}

body[data-page="puzzle"] .actions.translation-actions {
  margin-top: 1.35rem;
}

body[data-page="puzzle"] .match-headers {
  background: transparent;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #ddd9ce;
}

html[data-theme="dark"] body[data-page="puzzle"] .match-headers {
  border-bottom-color: var(--line);
}

body[data-page="puzzle"] .column-head {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.55rem 0.35rem 0.35rem;
  box-shadow: none;
}

body[data-page="puzzle"] .column-head h3 {
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--accent);
}

body[data-page="puzzle"] .examples-block {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

body[data-page="puzzle"] .answers-block {
  border-top: 2px solid var(--accent);
  margin-top: 0.3rem;
  padding-top: 0.25rem;
}

body[data-page="puzzle"] .question-prompt-block {
  margin: 0.2rem 0 0.45rem;
}

body[data-page="puzzle"] .question-card {
  padding: 0;
}


body[data-page="puzzle"] .letter-box {
  border: 2px solid #b8b8b8;
  border-radius: 6px;
  background: #fff;
  font-weight: 800;
}

html[data-theme="dark"] body[data-page="puzzle"] .letter-box {
  border-color: #8a8a8a;
  background: #fff;
  color: #1a1a1a;
}

body[data-page="puzzle"] .letter-word.correct .letter-box,
body[data-page="puzzle"] .letter-word.correct .letter-box.is-active,
body[data-page="puzzle"] .letter-word.correct .letter-box:focus,
body[data-page="puzzle"] .letter-box.correct,
body[data-page="puzzle"] .letter-box.correct.is-active,
body[data-page="puzzle"] .letter-box.correct:focus {
  border-color: #2f9e5a;
}

body[data-page="puzzle"] .letter-word.incorrect .letter-box,
body[data-page="puzzle"] .letter-word.incorrect .letter-box.is-active,
body[data-page="puzzle"] .letter-word.incorrect .letter-box:focus,
body[data-page="puzzle"] .letter-box.incorrect,
body[data-page="puzzle"] .letter-box.incorrect.is-active,
body[data-page="puzzle"] .letter-box.incorrect:focus {
  border-color: #d94b3a;
}

body[data-page="puzzle"] .btn.primary {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0.7rem 1.5rem;
  box-shadow: none;
}

body[data-page="puzzle"] .btn.primary:hover {
  background: var(--accent-deep);
}

body[data-page="puzzle"] .translation-meta .hints-btn.btn.primary {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
}

body[data-page="puzzle"] .translation-meta .hints-btn .hint-count {
  background: color-mix(in srgb, #fff 22%, transparent);
  color: #fff;
}

body[data-page="puzzle"] .token.hl-1,
body[data-page="puzzle"] .token.hl-2,
body[data-page="puzzle"] .token.hl-3,
body[data-page="puzzle"] .token.hl-4,
body[data-page="puzzle"] .token.hl-5,
body[data-page="puzzle"] .token.hl-6,
body[data-page="puzzle"] .token.hl-7,
body[data-page="puzzle"] .token.hl-8 {
  color: color-mix(in srgb, var(--ink) 88%, #000);
}

html[data-theme="dark"] body[data-page="puzzle"] .token.hl-1,
html[data-theme="dark"] body[data-page="puzzle"] .token.hl-2,
html[data-theme="dark"] body[data-page="puzzle"] .token.hl-3,
html[data-theme="dark"] body[data-page="puzzle"] .token.hl-4,
html[data-theme="dark"] body[data-page="puzzle"] .token.hl-5,
html[data-theme="dark"] body[data-page="puzzle"] .token.hl-6,
html[data-theme="dark"] body[data-page="puzzle"] .token.hl-7,
html[data-theme="dark"] body[data-page="puzzle"] .token.hl-8 {
  color: var(--ink);
}

body[data-page="puzzle"] .highlight-mode-label {
  color: var(--accent);
}

body[data-page="puzzle"] .highlight-mode-toggle,
body[data-page="puzzle"] .token-menu-mode {
  border-color: var(--home-border, var(--rule));
  background: color-mix(in srgb, var(--home-body-text, var(--ink)) 5%, var(--home-card-tint, var(--card)));
}

body[data-page="puzzle"] .highlight-mode-btn.is-active,
body[data-page="puzzle"] .token-menu-mode-btn.is-active {
  background: var(--home-pill-bg, #fffdf8);
  color: var(--home-pill-text, var(--ink));
}

html[data-theme="dark"] body[data-page="puzzle"] .highlight-mode-btn.is-active,
html[data-theme="dark"] body[data-page="puzzle"] .token-menu-mode-btn.is-active {
  background: var(--bg2);
  color: var(--home-heading, var(--ink));
}

body[data-page="puzzle"] .match-rows {
  gap: 0;
}

body[data-page="puzzle"] #match-rows .sentence-item .text {
  font-family: var(--font-language);
  font-weight: 500;
  line-height: 1.45;
}

body[data-page="puzzle"] #match-rows .match-cell[data-column="english"] .sentence-item .text {
  line-height: 1.85;
}

body[data-page="puzzle"] #match-rows .match-row {
  align-items: start;
  border-top: 1px solid #ebe7dc;
  padding: 0.15rem 0;
}

body[data-page="puzzle"] #match-rows .match-cell {
  align-items: flex-start;
}

html[data-theme="dark"] body[data-page="puzzle"] #match-rows .match-row {
  border-top-color: var(--line);
}

body[data-page="puzzle"] #match-rows .match-row:first-child {
  border-top: 0;
}

body[data-page="puzzle"] .panel:not(.daily-card) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

body[data-page="puzzle"] #reveal.reveal {
  margin: 1rem 0 6rem;
  padding: 1.15rem 2.2rem 1.25rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg1);
  color: var(--ink);
}

body[data-page="puzzle"] .reveal-title {
  margin: 0 0 0.65rem;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  color: var(--ink);
}

body[data-page="puzzle"] #reveal.reveal p {
  margin: 0 0 0.45rem;
}

body[data-page="puzzle"] #reveal.reveal .reveal-list {
  margin: 0.2rem 0 0.85rem;
}

body[data-page="puzzle"] .puzzle-page,
body[data-page="puzzle"] .daily-card {
  max-width: 100%;
  overflow-x: hidden;
}

body[data-page="puzzle"] .match-board {
  max-width: 100%;
  overflow-x: visible;
}

html[data-theme="dark"] body[data-page="puzzle"] .daily-card.panel {
  background: var(--bg1);
  border-color: var(--line);
}

@media (max-width: 640px) {
  body[data-page="puzzle"] .puzzle-page {
    width: 100%;
    padding-top: 0.22rem;
    padding-left: max(0.28rem, env(safe-area-inset-left));
    padding-right: max(0.28rem, env(safe-area-inset-right));
  }

  body.has-osk[data-page="puzzle"] .puzzle-page {
    padding-bottom: calc(var(--kb-inset) + 0.35rem);
  }

  body[data-page="puzzle"] .daily-top {
    margin-bottom: 0.16rem;
  }

  body[data-page="puzzle"] .daily-card.panel {
    border-radius: 14px;
    padding: 0.4rem 0.42rem 0.85rem;
    overflow-x: hidden;
  }

  body[data-page="puzzle"] #puzzle-heading {
    font-size: 1.42rem;
    line-height: 1.1;
  }

  body[data-page="puzzle"] .heading-row {
    margin-bottom: 0.32rem;
    gap: 0.5rem;
  }

  body[data-page="puzzle"] .letter-row,
  body[data-page="puzzle"] .letter-line,
  body[data-page="puzzle"] .question-stack,
  body[data-page="puzzle"] .match-board {
    max-width: 100%;
  }

  body[data-page="puzzle"] .match-board {
    padding-inline: 0.2rem 0.1rem;
  }

  body[data-page="puzzle"] .masthead-badge {
    width: 2.05rem;
    height: 2.05rem;
  }

  body[data-page="puzzle"] .masthead-tile {
    width: 0.82rem;
    height: 0.82rem;
    font-size: 0.54rem;
    border-radius: 0.18rem;
  }

  body[data-page="puzzle"] .masthead-tile-b {
    top: 0.28rem;
    left: 0.38rem;
  }

  body[data-page="puzzle"] .masthead-tile-a {
    bottom: 0.32rem;
    left: 0.32rem;
  }

  body[data-page="puzzle"] .masthead-tile-e {
    right: 0.3rem;
    bottom: 0.32rem;
  }

  body[data-page="puzzle"] .masthead-name-poly {
    font-size: 1.22rem;
  }

  body[data-page="puzzle"] .masthead-name {
    font-size: 1.22rem;
  }

  body[data-page="puzzle"] .masthead-logo {
    height: auto;
    width: min(11rem, calc(100vw - 12rem));
    max-width: none;
  }

  body[data-page="puzzle"] .masthead-lockup {
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding-right: 0;
    max-width: min(16.5rem, calc(100vw - 9.2rem));
    padding-left: 0;
  }

  body[data-page="puzzle"] .column-head {
    padding: 0.22rem 0.06rem 0.12rem;
  }

  body[data-page="puzzle"] .match-headers,
  body[data-page="puzzle"] #match-rows .match-row {
    gap: 0.4rem;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  }

  body[data-page="puzzle"] .match-headers .column-stack[data-column="english"] {
    grid-column: 2;
  }

  body[data-page="puzzle"] .match-headers {
    padding-bottom: 0.12rem;
  }

  body[data-page="puzzle"] #match-rows .match-row {
    padding: 0.18rem 0;
  }

  body[data-page="puzzle"] #match-rows .match-mark,
  body[data-page="puzzle"] #match-rows .match-mark:empty {
    display: none;
  }

  body[data-page="puzzle"] #match-rows .sentence-item {
    padding: 0.06rem 0.04rem;
  }

  body[data-page="puzzle"] #match-rows .sentence-item .text {
    font-family: var(--font-language);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
  }

  body[data-page="puzzle"] .token {
    padding: 0.04em 0.08em;
    border-radius: 0.16rem;
  }

  body[data-page="puzzle"] .answers-block {
    margin-top: 0.22rem;
    padding-top: 0.22rem;
  }

  body[data-page="puzzle"] .question-prompt-block {
    margin: 0.16rem 0 0.45rem;
  }

  body[data-page="puzzle"] .question-prompt-lead {
    font-size: 0.78rem;
  }

  body[data-page="puzzle"] .question-prompt-phrase {
    font-size: clamp(1.35rem, 5.5vw, 1.65rem);
    line-height: 1.25;
  }

  body[data-page="puzzle"] .question-prompt-phrase:has(.glyph-token) {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  body[data-page="puzzle"] .actions.translation-actions {
    margin-top: 1.05rem;
  }

  body.has-osk {
    --kb-inset: calc(10.5rem + env(safe-area-inset-bottom, 0px));
  }

  .osk {
    gap: 0.2rem;
    padding: 0.32rem 0.28rem calc(0.32rem + env(safe-area-inset-bottom, 0px));
  }

  .osk-key {
    height: 2.4rem;
    font-size: 1.02rem;
    border-radius: 6px;
  }
}

@media (max-width: 640px) and (max-height: 760px) {
  body[data-page="puzzle"] .puzzle-page {
    padding-top: 0.08rem;
  }

  body[data-page="puzzle"] .daily-top {
    min-height: 2.9rem;
    margin-bottom: 0.06rem;
  }

  body[data-page="puzzle"] .masthead-lockup {
    padding-right: 0;
    max-width: min(16.5rem, calc(100vw - 8.5rem));
  }

  body[data-page="puzzle"] .masthead-tagline {
    font-size: 0.62rem;
  }

  body[data-page="puzzle"] .daily-card.panel {
    padding: 0.22rem 0.32rem 0.55rem;
    border-radius: 12px;
  }

  body[data-page="puzzle"] .masthead-date,
  body[data-page="puzzle"] .issue-line {
    margin-bottom: 0.12rem;
    font-size: 0.56rem;
  }

  body[data-page="puzzle"] #puzzle-heading {
    font-size: 1.18rem;
  }

  body[data-page="puzzle"] .heading-row {
    margin-bottom: 0.16rem;
  }

  body[data-page="puzzle"] .column-head {
    padding: 0.1rem 0.04rem 0.06rem;
  }

  body[data-page="puzzle"] .match-headers {
    padding-bottom: 0.04rem;
  }

  body[data-page="puzzle"] #match-rows .match-row {
    padding: 0.1rem 0;
  }

  body[data-page="puzzle"] #match-rows .sentence-item {
    padding: 0.02rem 0.02rem;
  }

  body[data-page="puzzle"] #match-rows .sentence-item .text {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  body[data-page="puzzle"] .answers-block {
    margin-top: 0.1rem;
    padding-top: 0.1rem;
  }

  body[data-page="puzzle"] .question-prompt-block {
    margin: 0.08rem 0 0.22rem;
  }

  body[data-page="puzzle"] .question-prompt-lead {
    margin-bottom: 0.12rem;
    font-size: 0.68rem;
  }

  body[data-page="puzzle"] .question-prompt-phrase {
    font-size: 1.05rem;
    line-height: 1.18;
  }

  body[data-page="puzzle"] .letter-box {
    height: 1.6rem;
    line-height: 1.6rem;
    font-size: 0.9rem;
  }

  .letter-box {
    flex-basis: 1.4rem;
    width: 1.4rem !important;
    min-width: 1.25rem;
    max-width: 1.4rem;
    height: 1.6rem;
    font-size: 0.9rem;
    line-height: 1.6rem;
  }

  .letter-run .letter-box,
  .letter-word .letter-box {
    flex: 0 1 1.4rem;
    min-width: 1.05rem;
    max-width: 1.4rem;
  }

  body.has-osk {
    --kb-inset: calc(9.6rem + env(safe-area-inset-bottom, 0px));
  }

  .osk-key {
    height: 2.2rem;
    font-size: 0.96rem;
  }
}

/* —— Public homepage v2 (daily invitation + colour-scheme tester) —— */
body[data-page="home2"],
body[data-page="try"],
body[data-page="neotry"] {
  min-height: 100dvh;
  background: transparent;
  color: inherit;
}

.home-page {
  --home-page-bg: #ffffff;
  --home-card-bg: #f3f1eb;
  --home-card-tint: #ffffff;
  --home-banner-bg: #eef2f7;
  --home-primary: #1f7a6b;
  --home-primary-hover: #16584d;
  --home-heading: #16584d;
  --home-body-text: #1f2a24;
  --home-muted-text: #5d6b63;
  --home-border: #e0ddd6;
  --home-source-accent: #d85a3a;
  --home-secondary-accent: #e6b04a;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(31, 42, 36, 0.06);
  --home-focus: #16584d;
  --home-pill-bg: #ffffff;
  --home-pill-text: #1f2a24;
  --home-pill-hover-bg: #f3f1eb;
  --home-logo-babel: #1c2a3a;
  --home-logo-ese: #2f5c56;
  --home-logo-rule: #9aa3a0;

  min-height: 100dvh;
  width: 100%;
  background: var(--home-page-background, var(--home-page-bg));
  color: var(--home-body-text);
}

.home-page[data-home-theme="current"] {
  --home-page-bg: #ffffff;
  --home-card-bg: #f3f1eb;
  --home-card-tint: #ffffff;
  --home-banner-bg: #eef2f7;
  --home-primary: #1f7a6b;
  --home-primary-hover: #16584d;
  --home-heading: #16584d;
  --home-body-text: #1f2a24;
  --home-muted-text: #5d6b63;
  --home-border: #e0ddd6;
  --home-source-accent: #d85a3a;
  --home-secondary-accent: #e6b04a;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(31, 42, 36, 0.06);
  --home-focus: #16584d;
  --home-pill-bg: #ffffff;
  --home-pill-text: #1f2a24;
  --home-pill-hover-bg: #f3f1eb;
  --home-logo-babel: #1c2a3a;
  --home-logo-ese: #2f5c56;
  --home-logo-rule: #9aa3a0;
}

.home-page[data-home-theme="ink-papyrus"] {
  --home-page-bg: #f3ebdd;
  --home-card-bg: #fffdf7;
  --home-card-tint: #f0e6d7;
  --home-banner-bg: #e7efeb;
  --home-primary: #245c56;
  --home-primary-hover: #1c4c47;
  --home-heading: #18383b;
  --home-body-text: #354e4f;
  --home-muted-text: #687574;
  --home-border: #d7cdbd;
  --home-source-accent: #c96746;
  --home-secondary-accent: #d3a841;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(47, 56, 51, 0.12);
  --home-focus: #c96746;
  --home-pill-bg: #fffdf7;
  --home-pill-text: #18383b;
  --home-pill-hover-bg: #f0e6d7;
  --home-logo-babel: #18383b;
  --home-logo-ese: #245c56;
  --home-logo-rule: #d7cdbd;
}

.home-page[data-home-theme="oxford-library"] {
  --home-page-bg: #f2efe8;
  --home-card-bg: #fcfaf5;
  --home-card-tint: #ece8de;
  --home-banner-bg: #e7ebf0;
  --home-primary: #263d5a;
  --home-primary-hover: #1c3049;
  --home-heading: #172a3a;
  --home-body-text: #384753;
  --home-muted-text: #6c747a;
  --home-border: #d1cdc4;
  --home-source-accent: #b8614b;
  --home-secondary-accent: #c5963d;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(28, 43, 59, 0.12);
  --home-focus: #c5963d;
  --home-pill-bg: #fcfaf5;
  --home-pill-text: #172a3a;
  --home-pill-hover-bg: #ece8de;
  --home-logo-babel: #172a3a;
  --home-logo-ese: #263d5a;
  --home-logo-rule: #d1cdc4;
}

.home-page[data-home-theme="terracotta-archive"] {
  --home-page-bg: #f5eee6;
  --home-card-bg: #fffdfc;
  --home-card-tint: #f5e2d6;
  --home-banner-bg: #e5efec;
  --home-primary: #9d4f3f;
  --home-primary-hover: #833e32;
  --home-heading: #303238;
  --home-body-text: #4d4a49;
  --home-muted-text: #78706c;
  --home-border: #dccdc1;
  --home-source-accent: #346b65;
  --home-secondary-accent: #d2a343;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(78, 57, 46, 0.12);
  --home-focus: #346b65;
  --home-pill-bg: #fffdfc;
  --home-pill-text: #303238;
  --home-pill-hover-bg: #f5e2d6;
  --home-logo-babel: #303238;
  --home-logo-ese: #9d4f3f;
  --home-logo-rule: #dccdc1;
}

/* Clue Raider Classic companion: terracotta’s cousin, gold-led like Lost Relic.
   Palette refreshed to flat gold tokens (see static/theme-tokens.css). */
.home-page[data-home-theme="gilded-chamber"] {
  --home-page-bg: #faf7f1; /* --bg */
  --home-card-bg: #eae3d2; /* --card */
  --home-card-tint: #eae3d2;
  --home-banner-bg: #faf7f1;
  --home-primary: #b4903f; /* --gold */
  --home-primary-hover: #8e6f2e; /* --gold-deep */
  --home-heading: #2c2418; /* --ink */
  --home-body-text: #2c2418; /* --ink */
  --home-muted-text: #6b5f4c; /* --ink-soft */
  --home-border: #d9ccac; /* --hairline */
  --home-source-accent: #9d4f3f;
  --home-secondary-accent: #4f8f6a;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(50, 40, 20, 0.1);
  --home-focus: #b4903f;
  --home-pill-bg: #eae3d2;
  --home-pill-text: #2c2418;
  --home-pill-hover-bg: #eae3d2;
  --home-logo-babel: #2c2418;
  --home-logo-ese: #b4903f;
  --home-logo-rule: #d9ccac;
}

.home-page[data-home-theme="midnight-babel"] {
  --home-page-bg: #152a32;
  --home-card-bg: #203b42;
  --home-card-tint: #294950;
  --home-banner-bg: #1c353d;
  --home-primary: #e5b95b;
  --home-primary-hover: #f0c96f;
  --home-heading: #f9f5eb;
  --home-body-text: #e6e9e4;
  --clue-bg: transparent;
  --clue-ink: var(--home-body-text);
  --clue-line: color-mix(in srgb, var(--home-body-text) 20%, transparent);
  --clue-border: color-mix(in srgb, var(--home-body-text) 32%, transparent);
  --row-label: #d9f8e3;
  --row-label-border: color-mix(in srgb, #b7ebc9 75%, transparent);
  --home-muted-text: #c4ceca;
  --home-border: #49656a;
  --home-source-accent: #e17957;
  --home-secondary-accent: #79b2a7;
  --home-button-text: #152a32;
  --home-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --home-focus: #e5b95b;
  --home-pill-bg: #f9f5eb;
  --home-pill-text: #152a32;
  --home-pill-hover-bg: #e6e9e4;
  --home-logo-babel: #f9f5eb;
  --home-logo-ese: #79b2a7;
  --home-logo-rule: #49656a;
  --translation-pair-bg: #f4ebdd;
  --translation-pair-border: #d8c9b4;
  --translation-pair-text: #20383b;
  --translation-pair-muted: #64706d;
  --translation-pair-hover: #fff8ec;
  --translation-pair-hover-border: #cbb99f;
  --translation-pair-selection-bg: #f2c96d;
  --translation-pair-selection-text: #17363c;
  --translation-pair-selected-bg: #f8e2ae;
  --translation-pair-selected-border: #e5b95b;
  --translation-pair-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}

.home-page[data-home-theme="sage-slate"] {
  --home-page-bg: #eef1ee;
  --home-card-bg: #fafbf9;
  --home-card-tint: #e4eae5;
  --home-banner-bg: #e8edf0;
  --home-primary: #3d6b5c;
  --home-primary-hover: #2f5649;
  --home-heading: #243832;
  --home-body-text: #3a4a44;
  --home-muted-text: #6a7872;
  --home-border: #c8d2cb;
  --home-source-accent: #b85c42;
  --home-secondary-accent: #8a9f3d;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(36, 56, 50, 0.12);
  --home-focus: #b85c42;
  --home-pill-bg: #fafbf9;
  --home-pill-text: #243832;
  --home-pill-hover-bg: #e4eae5;
  --home-logo-babel: #243832;
  --home-logo-ese: #3d6b5c;
  --home-logo-rule: #c8d2cb;
}

.home-page[data-home-theme="rosewood-manuscript"] {
  --home-page-bg: #f4ece8;
  --home-card-bg: #fffcfa;
  --home-card-tint: #f0e0da;
  --home-banner-bg: #ebe4e8;
  --home-primary: #6b3a45;
  --home-primary-hover: #552e37;
  --home-heading: #3a2228;
  --home-body-text: #4a3a3d;
  --home-muted-text: #7a686c;
  --home-border: #d9c8c4;
  --home-source-accent: #2f6b62;
  --home-secondary-accent: #c4923a;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(58, 34, 40, 0.12);
  --home-focus: #2f6b62;
  --home-pill-bg: #fffcfa;
  --home-pill-text: #3a2228;
  --home-pill-hover-bg: #f0e0da;
  --home-logo-babel: #3a2228;
  --home-logo-ese: #6b3a45;
  --home-logo-rule: #d9c8c4;
}

.home-page[data-home-theme="coastal-fog"] {
  --home-page-bg: #eef2f5;
  --home-card-bg: #fbfcfd;
  --home-card-tint: #e3eaef;
  --home-banner-bg: #e8eef2;
  --home-primary: #3a5f7a;
  --home-primary-hover: #2d4c62;
  --home-heading: #1e3344;
  --home-body-text: #3d4f5c;
  --home-muted-text: #6d7d88;
  --home-border: #c5d0d9;
  --home-source-accent: #c96a4a;
  --home-secondary-accent: #5a9aab;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(30, 51, 68, 0.12);
  --home-focus: #5a9aab;
  --home-pill-bg: #fbfcfd;
  --home-pill-text: #1e3344;
  --home-pill-hover-bg: #e3eaef;
  --home-logo-babel: #1e3344;
  --home-logo-ese: #3a5f7a;
  --home-logo-rule: #c5d0d9;
}

.home-page[data-home-theme="candlelit-study"] {
  --home-page-bg: #f7f0e4;
  --home-card-bg: #fffaf2;
  --home-card-tint: #f2e6d2;
  --home-banner-bg: #ebe8df;
  --home-primary: #8b6914;
  --home-primary-hover: #735610;
  --home-heading: #3d3420;
  --home-body-text: #524a3a;
  --home-muted-text: #7a7264;
  --home-border: #ddd0b8;
  --home-source-accent: #9d4f3f;
  --home-secondary-accent: #4a7c6f;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(61, 52, 32, 0.12);
  --home-focus: #9d4f3f;
  --home-pill-bg: #fffaf2;
  --home-pill-text: #3d3420;
  --home-pill-hover-bg: #f2e6d2;
  --home-logo-babel: #3d3420;
  --home-logo-ese: #8b6914;
  --home-logo-rule: #ddd0b8;
}

.home-page[data-home-theme="seaside-postcard"] {
  --home-page-bg: #eaf4f4;
  --home-card-bg: #fffdf8;
  --home-card-tint: #e1f0ef;
  --home-banner-bg: #fff0e5;
  --home-primary: #176b75;
  --home-primary-hover: #105862;
  --home-heading: #163f4a;
  --home-body-text: #365860;
  --home-muted-text: #65777a;
  --home-border: #bed5d4;
  --home-source-accent: #c95f50;
  --home-secondary-accent: #c58b2a;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(22, 63, 74, 0.1);
  --home-focus: #e07a5f;
  --home-pill-bg: #fffdf8;
  --home-pill-text: #163f4a;
  --home-pill-hover-bg: #e1f0ef;
  --home-logo-babel: #163f4a;
  --home-logo-ese: #176b75;
  --home-logo-rule: #bed5d4;
  --translation-pair-bg: #fff9ed;
  --translation-pair-border: #dccfba;
  --translation-pair-text: #173f49;
  --translation-pair-muted: #657273;
  --translation-pair-hover: #ffffff;
  --translation-pair-hover-border: #cbb99f;
  --translation-pair-selection-bg: #ffd08a;
  --translation-pair-selection-text: #173f49;
  --translation-pair-selected-bg: #fff8ec;
  --translation-pair-selected-border: #176b75;
  --translation-pair-shadow: 0 1px 2px rgba(22, 63, 74, 0.1);
}

.home-page[data-home-theme="peach-pistachio"] {
  --home-page-bg: #faeee5;
  --home-card-bg: #fffdf9;
  --home-card-tint: #f7e1d4;
  --home-banner-bg: #e7f0dc;
  --home-primary: #477052;
  --home-primary-hover: #365d40;
  --home-heading: #34443a;
  --home-body-text: #505c53;
  --home-muted-text: #747b73;
  --home-border: #ddcabe;
  --home-source-accent: #b95545;
  --home-secondary-accent: #9a711e;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(74, 62, 51, 0.1);
  --home-focus: #b95545;
  --home-pill-bg: #fffdf9;
  --home-pill-text: #34443a;
  --home-pill-hover-bg: #f7e1d4;
  --home-logo-babel: #34443a;
  --home-logo-ese: #477052;
  --home-logo-rule: #ddcabe;
  --translation-pair-bg: #fff8ee;
  --translation-pair-border: #ddcbb9;
  --translation-pair-text: #35443b;
  --translation-pair-muted: #6d766f;
  --translation-pair-hover: #ffffff;
  --translation-pair-hover-border: #c9b8a5;
  --translation-pair-selection-bg: #f2c879;
  --translation-pair-selection-text: #2e3d34;
  --translation-pair-selected-bg: #fff4e6;
  --translation-pair-selected-border: #477052;
  --translation-pair-shadow: 0 1px 2px rgba(74, 62, 51, 0.1);
}

.home-page[data-home-theme="lilac-lemonade"] {
  --home-page-bg: #f2eef8;
  --home-card-bg: #fffdfb;
  --home-card-tint: #eae3f4;
  --home-banner-bg: #fff4c9;
  --home-primary: #62518a;
  --home-primary-hover: #504176;
  --home-heading: #3d3454;
  --home-body-text: #554e65;
  --home-muted-text: #746e7e;
  --home-border: #d3c9df;
  --home-source-accent: #b84f69;
  --home-secondary-accent: #9a6b00;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(61, 52, 84, 0.1);
  --home-focus: #b84f69;
  --home-pill-bg: #fffdfb;
  --home-pill-text: #3d3454;
  --home-pill-hover-bg: #eae3f4;
  --home-logo-babel: #3d3454;
  --home-logo-ese: #62518a;
  --home-logo-rule: #d3c9df;
  --translation-pair-bg: #fffdf6;
  --translation-pair-border: #ddd2bf;
  --translation-pair-text: #403750;
  --translation-pair-muted: #746e78;
  --translation-pair-hover: #ffffff;
  --translation-pair-hover-border: #c9bfad;
  --translation-pair-selection-bg: #ffe37d;
  --translation-pair-selection-text: #392f4c;
  --translation-pair-selected-bg: #fff8dc;
  --translation-pair-selected-border: #62518a;
  --translation-pair-shadow: 0 1px 2px rgba(61, 52, 84, 0.1);
}

.home-page[data-home-theme="sunny-notebook"] {
  --home-page-bg: #f8f1d9;
  --home-card-bg: #fffefa;
  --home-card-tint: #fff3c6;
  --home-banner-bg: #ddeef2;
  --home-primary: #28677a;
  --home-primary-hover: #1e5667;
  --home-heading: #253f49;
  --home-body-text: #45575c;
  --home-muted-text: #6d7878;
  --home-border: #d9ceab;
  --home-source-accent: #b9553f;
  --home-secondary-accent: #9a6b00;
  --home-button-text: #ffffff;
  --home-shadow: 0 8px 24px rgba(59, 59, 43, 0.1);
  --home-focus: #b9553f;
  --home-pill-bg: #fffefa;
  --home-pill-text: #253f49;
  --home-pill-hover-bg: #fff3c6;
  --home-logo-babel: #253f49;
  --home-logo-ese: #28677a;
  --home-logo-rule: #d9ceab;
  --translation-pair-bg: #ffffff;
  --translation-pair-border: #d9ceb0;
  --translation-pair-text: #29434b;
  --translation-pair-muted: #6b7778;
  --translation-pair-hover: #fffdf4;
  --translation-pair-hover-border: #c8bd9e;
  --translation-pair-selection-bg: #ffd55a;
  --translation-pair-selection-text: #233b43;
  --translation-pair-selected-bg: #fff8e1;
  --translation-pair-selected-border: #28677a;
  --translation-pair-shadow: 0 1px 2px rgba(59, 59, 43, 0.1);
}

.home-page[data-home-theme="laser-disco"] {
  --home-page-bg: #120c24;
  --home-page-background:
    radial-gradient(circle at 15% 10%, rgba(255, 45, 163, 0.22), transparent 32%),
    radial-gradient(circle at 85% 25%, rgba(0, 229, 255, 0.18), transparent 34%),
    #120c24;
  --home-card-bg: #211638;
  --home-card-tint: #30204d;
  --home-banner-bg: #281944;
  --home-primary: #00d9e8;
  --home-primary-hover: #54f2fc;
  --home-heading: #fff8ee;
  --home-body-text: #f0e8f5;
  --clue-bg: transparent;
  --clue-ink: var(--home-body-text);
  --clue-line: color-mix(in srgb, var(--home-body-text) 20%, transparent);
  --clue-border: color-mix(in srgb, var(--home-body-text) 32%, transparent);
  --row-label: #d9f8e3;
  --row-label-border: color-mix(in srgb, #b7ebc9 75%, transparent);
  --home-muted-text: #cbbbd7;
  --home-border: #704d8e;
  --home-source-accent: #ff4fa7;
  --home-secondary-accent: #e6ff4f;
  --home-button-text: #101722;
  --home-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --home-focus: #e6ff4f;
  --home-pill-bg: #fff8ee;
  --home-pill-text: #101722;
  --home-pill-hover-bg: #f0e8f5;
  --home-logo-babel: #fff8ee;
  --home-logo-ese: #00d9e8;
  --home-logo-rule: #704d8e;
  --translation-pair-bg: #fff7e8;
  --translation-pair-border: #ff4fa7;
  --translation-pair-text: #211638;
  --translation-pair-muted: #675b70;
  --translation-pair-hover: #ffffff;
  --translation-pair-hover-border: #ff4fa7;
  --translation-pair-selection-bg: #e6ff4f;
  --translation-pair-selection-text: #171020;
  --translation-pair-selected-bg: #fff7e8;
  --translation-pair-selected-border: #00d9e8;
  --translation-pair-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  --home-card-radius: 18px;
  --home-card-border-width: 1px;
  --home-card-border-style: solid;
  --home-card-shadow:
    0 0 0 1px rgba(0, 217, 232, 0.18),
    0 12px 32px rgba(0, 0, 0, 0.38);
  --home-button-radius: 8px;
}

.home-page[data-home-theme="memphis-pop"] {
  --home-page-bg: #fff4da;
  --home-page-background:
    radial-gradient(circle at 12px 12px, rgba(37, 75, 216, 0.12) 2px, transparent 3px)
    0 0 / 30px 30px,
    #fff4da;
  --home-card-bg: #ffffff;
  --home-card-tint: #ffe57a;
  --home-banner-bg: #ffb8a8;
  --home-primary: #254bd8;
  --home-primary-hover: #1737b3;
  --home-heading: #171923;
  --home-body-text: #34343b;
  --home-muted-text: #62616a;
  --home-border: #171923;
  --home-source-accent: #d83a2e;
  --home-secondary-accent: #8a5800;
  --home-button-text: #ffffff;
  --home-shadow: 7px 7px 0 #254bd8;
  --home-focus: #d83a2e;
  --home-pill-bg: #ffffff;
  --home-pill-text: #171923;
  --home-pill-hover-bg: #fff9e9;
  --home-logo-babel: #171923;
  --home-logo-ese: #254bd8;
  --home-logo-rule: #171923;
  --translation-pair-bg: #ffffff;
  --translation-pair-border: #171923;
  --translation-pair-text: #171923;
  --translation-pair-muted: #5e5c62;
  --translation-pair-hover: #fff9e9;
  --translation-pair-hover-border: #171923;
  --translation-pair-selection-bg: #ffe04c;
  --translation-pair-selection-text: #171923;
  --translation-pair-selected-bg: #fff9e9;
  --translation-pair-selected-border: #254bd8;
  --translation-pair-shadow: 2px 2px 0 rgba(23, 25, 35, 0.2);
  --home-card-radius: 6px;
  --home-card-border-width: 2px;
  --home-card-border-style: solid;
  --home-card-shadow: 7px 7px 0 #254bd8;
  --home-button-radius: 4px;
}

.home-page[data-home-theme="miami-memphis"] {
  --home-page-bg: #8de3df;
  --home-page-background:
    radial-gradient(circle at 14px 14px, rgba(62, 36, 111, 0.18) 3px, transparent 3.5px)
    0 0 / 34px 34px,
    #8de3df;
  --home-card-bg: #fffdf5;
  --home-card-tint: #ffe16a;
  --home-banner-bg: #ff9a87;
  --home-primary: #4a2c7a;
  --home-primary-hover: #38205f;
  --home-heading: #28203a;
  --home-body-text: #433a4e;
  --home-muted-text: #575058;
  --home-border: #28203a;
  --home-source-accent: #b8313e;
  --home-secondary-accent: #765500;
  --home-button-text: #ffffff;
  --home-shadow: 7px 7px 0 #4a2c7a;
  --home-focus: #e33f56;
  --home-pill-bg: #fffdf5;
  --home-pill-text: #28203a;
  --home-pill-hover-bg: #fff8d9;
  --home-logo-babel: #28203a;
  --home-logo-ese: #4a2c7a;
  --home-logo-rule: #28203a;
  --translation-pair-bg: #ffffff;
  --translation-pair-border: #28203a;
  --translation-pair-text: #28203a;
  --translation-pair-muted: #655e69;
  --translation-pair-hover: #fff8d9;
  --translation-pair-hover-border: #28203a;
  --translation-pair-selection-bg: #ff9a87;
  --translation-pair-selection-text: #28203a;
  --translation-pair-selected-bg: #fff8d9;
  --translation-pair-selected-border: #4a2c7a;
  --translation-pair-shadow: 2px 2px 0 rgba(40, 32, 58, 0.2);
  --home-card-radius: 8px;
  --home-card-border-width: 2px;
  --home-card-border-style: solid;
  --home-card-shadow: 7px 7px 0 #4a2c7a;
  --home-button-radius: 5px;
}

.home-page[data-home-theme="gelato-geometry"] {
  --home-page-bg: #cde7bc;
  --home-page-background:
    linear-gradient(135deg, rgba(148, 33, 74, 0.09) 25%, transparent 25%)
    0 0 / 38px 38px,
    #cde7bc;
  --home-card-bg: #fff9e9;
  --home-card-tint: #ffd0b5;
  --home-banner-bg: #e6d4f2;
  --home-primary: #8c2048;
  --home-primary-hover: #701638;
  --home-heading: #342634;
  --home-body-text: #50434d;
  --home-muted-text: #575058;
  --home-border: #342634;
  --home-source-accent: #a1264c;
  --home-secondary-accent: #426036;
  --home-button-text: #ffffff;
  --home-shadow: 7px 7px 0 #8c2048;
  --home-focus: #563a86;
  --home-pill-bg: #fff9e9;
  --home-pill-text: #342634;
  --home-pill-hover-bg: #fff4e8;
  --home-logo-babel: #342634;
  --home-logo-ese: #8c2048;
  --home-logo-rule: #342634;
  --translation-pair-bg: #fffdf7;
  --translation-pair-border: #6a5664;
  --translation-pair-text: #342634;
  --translation-pair-muted: #6e636b;
  --translation-pair-hover: #fff4e8;
  --translation-pair-hover-border: #6a5664;
  --translation-pair-selection-bg: #e6d4f2;
  --translation-pair-selection-text: #342634;
  --translation-pair-selected-bg: #fff4e8;
  --translation-pair-selected-border: #8c2048;
  --translation-pair-shadow: 2px 2px 0 rgba(52, 38, 52, 0.2);
  --home-card-radius: 10px;
  --home-card-border-width: 2px;
  --home-card-border-style: solid;
  --home-card-shadow: 7px 7px 0 #8c2048;
  --home-button-radius: 6px;
}

.home-page[data-home-theme="paper-confetti"] {
  --home-page-bg: #f7f3e8;
  --home-page-background:
    radial-gradient(circle at 8px 8px, #e94d64 2px, transparent 2.5px)
    0 0 / 42px 42px,
    radial-gradient(circle at 28px 27px, #2777c8 2px, transparent 2.5px)
    0 0 / 52px 52px,
    #f7f3e8;
  --home-card-bg: #ffffff;
  --home-card-tint: #ffe36a;
  --home-banner-bg: #bfe4dd;
  --home-primary: #1f5f7a;
  --home-primary-hover: #174b62;
  --home-heading: #1d2225;
  --home-body-text: #3d4345;
  --home-muted-text: #686d6d;
  --home-border: #1d2225;
  --home-source-accent: #b92842;
  --home-secondary-accent: #765600;
  --home-button-text: #ffffff;
  --home-shadow: 6px 6px 0 #1d2225;
  --home-focus: #e94d64;
  --home-pill-bg: #ffffff;
  --home-pill-text: #1d2225;
  --home-pill-hover-bg: #fffbe9;
  --home-logo-babel: #1d2225;
  --home-logo-ese: #1f5f7a;
  --home-logo-rule: #1d2225;
  --translation-pair-bg: #ffffff;
  --translation-pair-border: #1d2225;
  --translation-pair-text: #1d2225;
  --translation-pair-muted: #626868;
  --translation-pair-hover: #fffbe9;
  --translation-pair-hover-border: #1d2225;
  --translation-pair-selection-bg: #ffe36a;
  --translation-pair-selection-text: #1d2225;
  --translation-pair-selected-bg: #fffbe9;
  --translation-pair-selected-border: #1f5f7a;
  --translation-pair-shadow: 2px 2px 0 rgba(29, 34, 37, 0.2);
  --home-card-radius: 4px;
  --home-card-border-width: 2px;
  --home-card-border-style: solid;
  --home-card-shadow: 6px 6px 0 #1d2225;
  --home-button-radius: 3px;
}

.home-page[data-home-theme="memphis-after-dark"] {
  --home-page-bg: #181029;
  --home-page-background:
    radial-gradient(circle at 12px 12px, rgba(81, 226, 224, 0.22) 2px, transparent 2.5px)
    0 0 / 34px 34px,
    linear-gradient(135deg, rgba(255, 77, 158, 0.1), transparent 45%),
    #181029;
  --home-card-bg: #281c3b;
  --home-card-tint: #3a2854;
  --home-banner-bg: #35204b;
  --home-primary: #57e2de;
  --home-primary-hover: #87f2ee;
  --home-heading: #fff8e9;
  --home-body-text: #eee7f2;
  --clue-bg: transparent;
  --clue-ink: var(--home-body-text);
  --clue-line: color-mix(in srgb, var(--home-body-text) 20%, transparent);
  --clue-border: color-mix(in srgb, var(--home-body-text) 32%, transparent);
  --row-label: #d9f8e3;
  --row-label-border: color-mix(in srgb, #b7ebc9 75%, transparent);
  --home-muted-text: #c9bcd1;
  --home-border: #8b69a5;
  --home-source-accent: #ff6aab;
  --home-secondary-accent: #ddf75a;
  --home-button-text: #171026;
  --home-shadow: 7px 7px 0 #ff6aab;
  --home-focus: #ddf75a;
  --home-pill-bg: #fff8e9;
  --home-pill-text: #171026;
  --home-pill-hover-bg: #ffffff;
  --home-logo-babel: #fff8e9;
  --home-logo-ese: #57e2de;
  --home-logo-rule: #8b69a5;
  --translation-pair-bg: #fff8e9;
  --translation-pair-border: #ff6aab;
  --translation-pair-text: #281c3b;
  --translation-pair-muted: #665b6b;
  --translation-pair-hover: #ffffff;
  --translation-pair-hover-border: #ff6aab;
  --translation-pair-selection-bg: #ddf75a;
  --translation-pair-selection-text: #20172d;
  --translation-pair-selected-bg: #ffffff;
  --translation-pair-selected-border: #57e2de;
  --translation-pair-shadow: 2px 2px 0 rgba(0, 0, 0, 0.16);
  --home-card-radius: 7px;
  --home-card-border-width: 2px;
  --home-card-border-style: solid;
  --home-card-shadow: 7px 7px 0 #ff6aab;
  --home-button-radius: 4px;
}

.home-page[data-home-theme="sunday-funnies"] {
  --home-page-bg: #f5e8c8;
  --home-page-background:
    radial-gradient(circle, rgba(26, 35, 42, 0.13) 1px, transparent 1.4px)
    0 0 / 9px 9px,
    #f5e8c8;
  --home-card-bg: #fffdf2;
  --home-card-tint: #ffd84d;
  --home-banner-bg: #8ed5e8;
  --home-primary: #175ca8;
  --home-primary-hover: #10477f;
  --home-heading: #17242c;
  --home-body-text: #344148;
  --home-muted-text: #555c5e;
  --home-border: #17242c;
  --home-source-accent: #b92f34;
  --home-secondary-accent: #765400;
  --home-button-text: #ffffff;
  --home-shadow: 7px 7px 0 #17242c;
  --home-focus: #d9383e;
  --home-pill-bg: #fffdf2;
  --home-pill-text: #17242c;
  --home-pill-hover-bg: #fff6ce;
  --home-logo-babel: #17242c;
  --home-logo-ese: #175ca8;
  --home-logo-rule: #17242c;
  --translation-pair-bg: #fffdf5;
  --translation-pair-border: #17242c;
  --translation-pair-text: #17242c;
  --translation-pair-muted: #62696a;
  --translation-pair-hover: #fff6ce;
  --translation-pair-hover-border: #17242c;
  --translation-pair-selection-bg: #ffd84d;
  --translation-pair-selection-text: #17242c;
  --translation-pair-selected-bg: #fff6ce;
  --translation-pair-selected-border: #175ca8;
  --translation-pair-shadow: 2px 2px 0 rgba(23, 36, 44, 0.18);
  --home-card-radius: 3px;
  --home-card-border-width: 3px;
  --home-card-border-style: solid;
  --home-card-shadow: 7px 7px 0 #17242c;
  --home-button-radius: 3px;
}

.home-page[data-home-theme="noir-detective"] {
  --home-page-bg: #17191b;
  --home-page-background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.025) 0,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 7px
    ),
    #17191b;
  --home-card-bg: #25282a;
  --home-card-tint: #343638;
  --home-banner-bg: #30282a;
  --home-primary: #d7b84a;
  --home-primary-hover: #e9cd63;
  --home-heading: #f6eedb;
  --home-body-text: #e1daca;
  --clue-bg: transparent;
  --clue-ink: var(--home-body-text);
  --clue-line: color-mix(in srgb, var(--home-body-text) 20%, transparent);
  --clue-border: color-mix(in srgb, var(--home-body-text) 32%, transparent);
  --row-label: #d9f8e3;
  --row-label-border: color-mix(in srgb, #b7ebc9 75%, transparent);
  --home-muted-text: #bdb6aa;
  --home-border: #77736b;
  --home-source-accent: #e25c55;
  --home-secondary-accent: #d7b84a;
  --home-button-text: #191b1d;
  --home-shadow: 8px 8px 0 #050606;
  --home-focus: #e25c55;
  --home-pill-bg: #f6eedb;
  --home-pill-text: #191b1d;
  --home-pill-hover-bg: #fff8e8;
  --home-logo-babel: #f6eedb;
  --home-logo-ese: #d7b84a;
  --home-logo-rule: #77736b;
  --translation-pair-bg: #f3ebd8;
  --translation-pair-border: #26282a;
  --translation-pair-text: #202326;
  --translation-pair-muted: #62605a;
  --translation-pair-hover: #fff8e8;
  --translation-pair-hover-border: #26282a;
  --translation-pair-selection-bg: #d7b84a;
  --translation-pair-selection-text: #181a1c;
  --translation-pair-selected-bg: #fff8e8;
  --translation-pair-selected-border: #d7b84a;
  --translation-pair-shadow: 2px 2px 0 rgba(5, 6, 6, 0.35);
  --home-card-radius: 0;
  --home-card-border-width: 2px;
  --home-card-border-style: solid;
  --home-card-shadow: 8px 8px 0 #050606;
  --home-button-radius: 0;
}

.home-page[data-home-theme="cosmic-panels"] {
  --home-page-bg: #15142e;
  --home-page-background:
    radial-gradient(circle at 20% 25%, rgba(255, 236, 88, 0.34) 1px, transparent 2px)
    0 0 / 34px 34px,
    radial-gradient(circle at 75% 60%, rgba(89, 225, 238, 0.22) 1px, transparent 2px)
    0 0 / 47px 47px,
    #15142e;
  --home-card-bg: #292453;
  --home-card-tint: #39336a;
  --home-banner-bg: #432755;
  --home-primary: #59dfe8;
  --home-primary-hover: #82f2f7;
  --home-heading: #fff8e8;
  --home-body-text: #ece7f4;
  --clue-bg: transparent;
  --clue-ink: var(--home-body-text);
  --clue-line: color-mix(in srgb, var(--home-body-text) 20%, transparent);
  --clue-border: color-mix(in srgb, var(--home-body-text) 32%, transparent);
  --row-label: #d9f8e3;
  --row-label-border: color-mix(in srgb, #b7ebc9 75%, transparent);
  --home-muted-text: #c6bdd4;
  --home-border: #8a7eb6;
  --home-source-accent: #ff65b2;
  --home-secondary-accent: #ffe45e;
  --home-button-text: #14152c;
  --home-shadow: 7px 7px 0 #ff65b2;
  --home-focus: #ffe45e;
  --home-pill-bg: #fff8e8;
  --home-pill-text: #14152c;
  --home-pill-hover-bg: #ffffff;
  --home-logo-babel: #fff8e8;
  --home-logo-ese: #59dfe8;
  --home-logo-rule: #8a7eb6;
  --translation-pair-bg: #fff9ec;
  --translation-pair-border: #302a56;
  --translation-pair-text: #25213e;
  --translation-pair-muted: #655e70;
  --translation-pair-hover: #ffffff;
  --translation-pair-hover-border: #302a56;
  --translation-pair-selection-bg: #ffe45e;
  --translation-pair-selection-text: #201c37;
  --translation-pair-selected-bg: #ffffff;
  --translation-pair-selected-border: #59dfe8;
  --translation-pair-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
  --home-card-radius: 10px 2px 10px 2px;
  --home-card-border-width: 2px;
  --home-card-border-style: solid;
  --home-card-shadow: 7px 7px 0 #ff65b2;
  --home-button-radius: 4px;
}

.home-page[data-home-theme="riso-rebel"] {
  --home-page-bg: #f2d9cb;
  --home-page-background:
    radial-gradient(circle, rgba(28, 62, 122, 0.13) 1px, transparent 1.3px)
    0 0 / 8px 8px,
    #f2d9cb;
  --home-card-bg: #fff5e5;
  --home-card-tint: #f5b4ad;
  --home-banner-bg: #a9d8ca;
  --home-primary: #254f98;
  --home-primary-hover: #193c7a;
  --home-heading: #203051;
  --home-body-text: #3c455a;
  --home-muted-text: #555962;
  --home-border: #203051;
  --home-source-accent: #b62955;
  --home-secondary-accent: #756000;
  --home-button-text: #ffffff;
  --home-shadow: 6px 6px 0 #d82f68;
  --home-focus: #d82f68;
  --home-pill-bg: #fff5e5;
  --home-pill-text: #203051;
  --home-pill-hover-bg: #fff9ea;
  --home-logo-babel: #203051;
  --home-logo-ese: #254f98;
  --home-logo-rule: #203051;
  --translation-pair-bg: #fff9ea;
  --translation-pair-border: #203051;
  --translation-pair-text: #203051;
  --translation-pair-muted: #636977;
  --translation-pair-hover: #ffffff;
  --translation-pair-hover-border: #203051;
  --translation-pair-selection-bg: #f5b4ad;
  --translation-pair-selection-text: #203051;
  --translation-pair-selected-bg: #ffffff;
  --translation-pair-selected-border: #254f98;
  --translation-pair-shadow: 2px 2px 0 rgba(32, 48, 81, 0.2);
  --home-card-radius: 2px;
  --home-card-border-width: 2px;
  --home-card-border-style: solid;
  --home-card-shadow: 6px 6px 0 #d82f68;
  --home-button-radius: 2px;
}

.home-page[data-home-theme="alien-greenhouse"] {
  --home-page-bg: #101d2c;
  --home-page-background:
    radial-gradient(ellipse at top left, rgba(180, 255, 58, 0.16), transparent 40%),
    radial-gradient(ellipse at bottom right, rgba(231, 80, 203, 0.15), transparent 42%),
    #101d2c;
  --home-card-bg: #172b34;
  --home-card-tint: #213d3a;
  --home-banner-bg: #25353a;
  --home-primary: #b4f13c;
  --home-primary-hover: #c8ff5b;
  --home-heading: #f4ffe2;
  --home-body-text: #e1ebd9;
  --clue-bg: transparent;
  --clue-ink: var(--home-body-text);
  --clue-line: color-mix(in srgb, var(--home-body-text) 20%, transparent);
  --clue-border: color-mix(in srgb, var(--home-body-text) 32%, transparent);
  --row-label: #d9f8e3;
  --row-label-border: color-mix(in srgb, #b7ebc9 75%, transparent);
  --home-muted-text: #b5c5b0;
  --home-border: #4e6c62;
  --home-source-accent: #f071d3;
  --home-secondary-accent: #ffd35a;
  --home-button-text: #15231f;
  --home-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  --home-focus: #f071d3;
  --home-pill-bg: #f4ffe2;
  --home-pill-text: #15231f;
  --home-pill-hover-bg: #e9f5d9;
  --home-logo-babel: #f4ffe2;
  --home-logo-ese: #b4f13c;
  --home-logo-rule: #4e6c62;
  --translation-pair-bg: #e9f5d9;
  --translation-pair-border: #85a56d;
  --translation-pair-text: #18342f;
  --translation-pair-muted: #5d7068;
  --translation-pair-hover: #f4ffe8;
  --translation-pair-hover-border: #85a56d;
  --translation-pair-selection-bg: #f071d3;
  --translation-pair-selection-text: #241329;
  --translation-pair-selected-bg: #f4ffe8;
  --translation-pair-selected-border: #b4f13c;
  --translation-pair-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  --home-card-radius: 30px 8px 30px 8px;
  --home-card-border-width: 1px;
  --home-card-border-style: solid;
  --home-card-shadow:
    0 16px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(180, 241, 60, 0.1);
  --home-button-radius: 999px;
}

.home-page[data-home-theme="bubblegum-brutalist"] {
  --home-page-bg: #ff9fcb;
  --home-page-background: #ff9fcb;
  --home-card-bg: #fffdf5;
  --home-card-tint: #ffe34d;
  --home-banner-bg: #8ecfff;
  --home-primary: #173fc5;
  --home-primary-hover: #0e2e9e;
  --home-heading: #111111;
  --home-body-text: #252525;
  --home-muted-text: #454045;
  --home-border: #111111;
  --home-source-accent: #a81652;
  --home-secondary-accent: #6b4700;
  --home-button-text: #ffffff;
  --home-shadow: 9px 9px 0 #111111;
  --home-focus: #ffe34d;
  --home-pill-bg: #fffdf5;
  --home-pill-text: #111111;
  --home-pill-hover-bg: #fff9d5;
  --home-logo-babel: #111111;
  --home-logo-ese: #173fc5;
  --home-logo-rule: #111111;
  --translation-pair-bg: #ffffff;
  --translation-pair-border: #111111;
  --translation-pair-text: #111111;
  --translation-pair-muted: #54505a;
  --translation-pair-hover: #fff9d5;
  --translation-pair-hover-border: #111111;
  --translation-pair-selection-bg: #173fc5;
  --translation-pair-selection-text: #ffffff;
  --translation-pair-selected-bg: #fff9d5;
  --translation-pair-selected-border: #173fc5;
  --translation-pair-shadow: 4px 4px 0 #111111;
  --home-card-radius: 0;
  --home-card-border-width: 3px;
  --home-card-border-style: solid;
  --home-card-shadow: 9px 9px 0 #111111;
  --home-button-radius: 0;
}

.home-page[data-home-theme="puzzle-table"] {
  --home-page-bg: #69ddd5;
  --home-page-background: #69ddd5;
  --home-card-bg: #fffdf8;
  --home-card-tint: #e7f4e3;
  --home-banner-bg: #e7f4e3;
  --home-primary: #1f7a3a;
  --home-primary-hover: #186230;
  --home-heading: #163028;
  --home-body-text: #1f2a24;
  --home-muted-text: #4d6158;
  --home-border: rgba(22, 48, 40, 0.14);
  --home-source-accent: #1f7a3a;
  --home-secondary-accent: #1f7a6b;
  --home-button-text: #ffffff;
  --home-shadow: 0 16px 36px rgba(18, 55, 48, 0.12);
  --home-focus: #1f7a3a;
  --home-pill-bg: #ffffff;
  --home-pill-text: #163028;
  --home-pill-hover-bg: #f3faf1;
  --home-logo-babel: #163028;
  --home-logo-ese: #1f7a3a;
  --home-logo-rule: rgba(22, 48, 40, 0.2);
  --translation-pair-bg: #ffffff;
  --translation-pair-border: rgba(22, 48, 40, 0.14);
  --translation-pair-text: #163028;
  --translation-pair-muted: #4d6158;
  --translation-pair-hover: #f3faf1;
  --translation-pair-hover-border: #1f7a3a;
  --translation-pair-selection-bg: #e7f4e3;
  --translation-pair-selection-text: #163028;
  --translation-pair-selected-bg: #f3faf1;
  --translation-pair-selected-border: #1f7a3a;
  --translation-pair-shadow: none;
  --home-card-radius: 22px;
  --home-card-border-width: 0px;
  --home-card-border-style: solid;
  --home-card-shadow: 0 16px 36px rgba(18, 55, 48, 0.14);
  --home-button-radius: 999px;
}

.home-page[data-home-theme="poolside-punk"] {
  --home-page-bg: #69ddd5;
  --home-page-background: #69ddd5;
  --home-card-bg: #fffbef;
  --home-card-tint: #ffd84d;
  --home-banner-bg: #ff806e;
  --home-primary: #173d59;
  --home-primary-hover: #0d2e47;
  --home-heading: #102c3d;
  --home-body-text: #263c45;
  --home-muted-text: #424f55;
  --home-border: #10242d;
  --home-source-accent: #b82e2e;
  --home-secondary-accent: #725300;
  --home-button-text: #ffffff;
  --home-shadow: 8px 8px 0 #10242d;
  --home-focus: #ff3d32;
  --home-pill-bg: #fffbef;
  --home-pill-text: #102c3d;
  --home-pill-hover-bg: #fff7ce;
  --home-logo-babel: #102c3d;
  --home-logo-ese: #173d59;
  --home-logo-rule: #10242d;
  --translation-pair-bg: #ffffff;
  --translation-pair-border: #10242d;
  --translation-pair-text: #102c3d;
  --translation-pair-muted: #536168;
  --translation-pair-hover: #fff7ce;
  --translation-pair-hover-border: #10242d;
  --translation-pair-selection-bg: #ff806e;
  --translation-pair-selection-text: #151515;
  --translation-pair-selected-bg: #fff7ce;
  --translation-pair-selected-border: #173d59;
  --translation-pair-shadow: 4px 4px 0 #10242d;
  --home-card-radius: 3px;
  --home-card-border-width: 3px;
  --home-card-border-style: solid;
  --home-card-shadow: 8px 8px 0 #10242d;
  --home-button-radius: 2px;
}

.home-page[data-home-theme="citrus-riot"] {
  --home-page-bg: #c9f24a;
  --home-page-background: #c9f24a;
  --home-card-bg: #fffbef;
  --home-card-tint: #ff9e3d;
  --home-banner-bg: #dccbff;
  --home-primary: #51308e;
  --home-primary-hover: #3e2076;
  --home-heading: #2e183f;
  --home-body-text: #463650;
  --home-muted-text: #655a6b;
  --home-border: #24172d;
  --home-source-accent: #a72d24;
  --home-secondary-accent: #5c4300;
  --home-button-text: #ffffff;
  --home-shadow: 9px 9px 0 #51308e;
  --home-focus: #d13a2f;
  --home-pill-bg: #fffbef;
  --home-pill-text: #2e183f;
  --home-pill-hover-bg: #fff3d6;
  --home-logo-babel: #2e183f;
  --home-logo-ese: #51308e;
  --home-logo-rule: #24172d;
  --translation-pair-bg: #fffdf7;
  --translation-pair-border: #24172d;
  --translation-pair-text: #2e183f;
  --translation-pair-muted: #665c6c;
  --translation-pair-hover: #fff3d6;
  --translation-pair-hover-border: #24172d;
  --translation-pair-selection-bg: #dccbff;
  --translation-pair-selection-text: #24172d;
  --translation-pair-selected-bg: #fff3d6;
  --translation-pair-selected-border: #51308e;
  --translation-pair-shadow: 4px 4px 0 #51308e;
  --home-card-radius: 0;
  --home-card-border-width: 3px;
  --home-card-border-style: solid;
  --home-card-shadow: 9px 9px 0 #51308e;
  --home-button-radius: 0;
}

.home-page[data-home-theme="bauhaus-playground"] {
  --home-page-bg: #f4e9d3;
  --home-page-background: #f4e9d3;
  --home-card-bg: #fffdf7;
  --home-card-tint: #f2c230;
  --home-banner-bg: #78a7e3;
  --home-primary: #1546a0;
  --home-primary-hover: #0c347f;
  --home-heading: #171717;
  --home-body-text: #333333;
  --home-muted-text: #62605c;
  --home-border: #171717;
  --home-source-accent: #b62525;
  --home-secondary-accent: #745500;
  --home-button-text: #ffffff;
  --home-shadow: 8px 8px 0 #c62b2b;
  --home-focus: #c62b2b;
  --home-pill-bg: #fffdf7;
  --home-pill-text: #171717;
  --home-pill-hover-bg: #fff9df;
  --home-logo-babel: #171717;
  --home-logo-ese: #1546a0;
  --home-logo-rule: #171717;
  --translation-pair-bg: #ffffff;
  --translation-pair-border: #171717;
  --translation-pair-text: #171717;
  --translation-pair-muted: #5c5a56;
  --translation-pair-hover: #fff9df;
  --translation-pair-hover-border: #171717;
  --translation-pair-selection-bg: #f2c230;
  --translation-pair-selection-text: #171717;
  --translation-pair-selected-bg: #fff9df;
  --translation-pair-selected-border: #c62b2b;
  --translation-pair-shadow: 4px 4px 0 #171717;
  --home-card-radius: 0;
  --home-card-border-width: 3px;
  --home-card-border-style: solid;
  --home-card-shadow: 8px 8px 0 #c62b2b;
  --home-button-radius: 0;
}

.home-page[data-home-theme="candy-concrete"] {
  --home-page-bg: #cdb8f5;
  --home-page-background: #cdb8f5;
  --home-card-bg: #f7fff8;
  --home-card-tint: #a8e6c1;
  --home-banner-bg: #ff9fbd;
  --home-primary: #9e204a;
  --home-primary-hover: #7d1538;
  --home-heading: #21182a;
  --home-body-text: #3d3444;
  --home-muted-text: #45404d;
  --home-border: #21182a;
  --home-source-accent: #8a1840;
  --home-secondary-accent: #775400;
  --home-button-text: #ffffff;
  --home-shadow: 8px 8px 0 #21182a;
  --home-focus: #173e95;
  --home-pill-bg: #f7fff8;
  --home-pill-text: #21182a;
  --home-pill-hover-bg: #f4fff8;
  --home-logo-babel: #21182a;
  --home-logo-ese: #9e204a;
  --home-logo-rule: #21182a;
  --translation-pair-bg: #ffffff;
  --translation-pair-border: #21182a;
  --translation-pair-text: #21182a;
  --translation-pair-muted: #655d69;
  --translation-pair-hover: #f4fff8;
  --translation-pair-hover-border: #21182a;
  --translation-pair-selection-bg: #173e95;
  --translation-pair-selection-text: #ffffff;
  --translation-pair-selected-bg: #f4fff8;
  --translation-pair-selected-border: #9e204a;
  --translation-pair-shadow: 4px 4px 0 #21182a;
  --home-card-radius: 5px;
  --home-card-border-width: 3px;
  --home-card-border-style: solid;
  --home-card-shadow: 8px 8px 0 #21182a;
  --home-button-radius: 3px;
}

.home-page[data-home-theme="laser-disco"] .daily-cta-phrase-panel {
  box-shadow: 0 0 18px rgba(0, 217, 232, 0.22);
}

.home-page[data-home-theme="memphis-pop"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #171923;
}

.home-page[data-home-theme="miami-memphis"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #28203a;
}

.home-page[data-home-theme="gelato-geometry"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #342634;
}

.home-page[data-home-theme="paper-confetti"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #1d2225;
}

.home-page[data-home-theme="memphis-after-dark"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #8b69a5;
}

.home-page[data-home-theme="sunday-funnies"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #17242c;
}

.home-page[data-home-theme="noir-detective"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #050606;
}

.home-page[data-home-theme="cosmic-panels"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #ff65b2;
}

.home-page[data-home-theme="riso-rebel"] .sample-puzzle-card {
  box-shadow: 4px 4px 0 #d82f68;
}

.home-page:is(
  [data-home-theme="sunday-funnies"],
  [data-home-theme="noir-detective"],
  [data-home-theme="cosmic-panels"],
  [data-home-theme="riso-rebel"]
) .daily-cta-date,
.home-page:is(
  [data-home-theme="sunday-funnies"],
  [data-home-theme="noir-detective"],
  [data-home-theme="cosmic-panels"],
  [data-home-theme="riso-rebel"]
) .sample-puzzle-meta {
  display: inline-block;
  padding: 0.18rem 0.42rem;
  border: 2px solid var(--home-border);
  background: var(--home-secondary-accent);
  color: var(--home-button-text);
  letter-spacing: 0.08em;
}

.home-page:is(
  [data-home-theme="sunday-funnies"],
  [data-home-theme="noir-detective"],
  [data-home-theme="cosmic-panels"],
  [data-home-theme="riso-rebel"]
) .sample-puzzle-meta-lang {
  color: inherit;
  font-weight: 800;
}

@media (max-width: 480px) {
  .home-page[data-home-theme="miami-memphis"] {
    --home-page-background:
      radial-gradient(circle at 14px 14px, rgba(62, 36, 111, 0.1) 3px, transparent 3.5px)
      0 0 / 34px 34px,
      #8de3df;
  }

  .home-page[data-home-theme="gelato-geometry"] {
    --home-page-background:
      linear-gradient(135deg, rgba(148, 33, 74, 0.05) 25%, transparent 25%)
      0 0 / 38px 38px,
      #cde7bc;
  }

  .home-page[data-home-theme="paper-confetti"] {
    --home-page-background:
      radial-gradient(circle at 8px 8px, rgba(233, 77, 100, 0.55) 2px, transparent 2.5px)
      0 0 / 42px 42px,
      radial-gradient(circle at 28px 27px, rgba(39, 119, 200, 0.55) 2px, transparent 2.5px)
      0 0 / 52px 52px,
      #f7f3e8;
  }

  .home-page[data-home-theme="memphis-after-dark"] {
    --home-page-background:
      radial-gradient(circle at 12px 12px, rgba(81, 226, 224, 0.12) 2px, transparent 2.5px)
      0 0 / 34px 34px,
      linear-gradient(135deg, rgba(255, 77, 158, 0.06), transparent 45%),
      #181029;
  }

  .home-page[data-home-theme="sunday-funnies"] {
    --home-page-background:
      radial-gradient(circle, rgba(26, 35, 42, 0.07) 1px, transparent 1.4px)
      0 0 / 9px 9px,
      #f5e8c8;
  }

  .home-page[data-home-theme="noir-detective"] {
    --home-page-background:
      repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.015) 0,
        rgba(255, 255, 255, 0.015) 1px,
        transparent 1px,
        transparent 7px
      ),
      #17191b;
  }

  .home-page[data-home-theme="cosmic-panels"] {
    --home-page-background:
      radial-gradient(circle at 20% 25%, rgba(255, 236, 88, 0.18) 1px, transparent 2px)
      0 0 / 34px 34px,
      radial-gradient(circle at 75% 60%, rgba(89, 225, 238, 0.12) 1px, transparent 2px)
      0 0 / 47px 47px,
      #15142e;
  }

  .home-page[data-home-theme="riso-rebel"] {
    --home-page-background:
      radial-gradient(circle, rgba(28, 62, 122, 0.07) 1px, transparent 1.3px)
      0 0 / 8px 8px,
      #f2d9cb;
  }
}

.home-page[data-home-theme="bubblegum-brutalist"] .sample-puzzle-meta {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.home-page[data-home-theme="bubblegum-brutalist"] .home-theme-tester-select,
.home-page[data-home-theme="bubblegum-brutalist"] .home2-pill-btn,
.home-page:is(
  [data-home-theme="poolside-punk"],
  [data-home-theme="citrus-riot"],
  [data-home-theme="bauhaus-playground"],
  [data-home-theme="candy-concrete"],
  [data-home-theme="miami-memphis"],
  [data-home-theme="gelato-geometry"],
  [data-home-theme="paper-confetti"],
  [data-home-theme="memphis-after-dark"],
  [data-home-theme="sunday-funnies"],
  [data-home-theme="noir-detective"],
  [data-home-theme="cosmic-panels"],
  [data-home-theme="riso-rebel"]
) .home-theme-tester-select,
.home-page:is(
  [data-home-theme="poolside-punk"],
  [data-home-theme="citrus-riot"],
  [data-home-theme="bauhaus-playground"],
  [data-home-theme="candy-concrete"],
  [data-home-theme="miami-memphis"],
  [data-home-theme="gelato-geometry"],
  [data-home-theme="paper-confetti"],
  [data-home-theme="memphis-after-dark"],
  [data-home-theme="sunday-funnies"],
  [data-home-theme="noir-detective"],
  [data-home-theme="cosmic-panels"],
  [data-home-theme="riso-rebel"]
) .home2-pill-btn {
  border-width: 2px;
  border-color: var(--home-border);
}

.home-page:is(
  [data-home-theme="poolside-punk"],
  [data-home-theme="citrus-riot"],
  [data-home-theme="bauhaus-playground"],
  [data-home-theme="candy-concrete"],
  [data-home-theme="miami-memphis"],
  [data-home-theme="gelato-geometry"],
  [data-home-theme="paper-confetti"],
  [data-home-theme="memphis-after-dark"],
  [data-home-theme="sunday-funnies"],
  [data-home-theme="noir-detective"],
  [data-home-theme="cosmic-panels"],
  [data-home-theme="riso-rebel"]
) .sample-puzzle-meta {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

body[data-page="home2"] .home-page .masthead-babel,
html[data-theme="light"] body[data-page="puzzle"] .home-page .masthead-babel,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .masthead-babel {
  color: var(--home-logo-babel);
}

body[data-page="home2"] .home-page .masthead-name-poly,
html[data-theme="light"] body[data-page="puzzle"] .home-page .masthead-name-poly,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .masthead-name-poly {
  color: var(--home-logo-babel);
}

body[data-page="home2"] .home-page .masthead-ese,
html[data-theme="light"] body[data-page="puzzle"] .home-page .masthead-ese,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .masthead-ese {
  color: var(--home-logo-ese);
}

body[data-page="home2"] .home-page .masthead-tagline,
html[data-theme="light"] body[data-page="puzzle"] .home-page .masthead-tagline,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .masthead-tagline {
  color: var(--home-logo-babel);
  border-left-color: var(--home-logo-rule);
}

/* Puzzle page: apply homepage colour schemes (except current+document-dark). */
body[data-page="puzzle"]:has(.home-page:not([data-home-theme="current"])) {
  background: transparent;
}

html[data-theme="light"] body[data-page="puzzle"] .home-page,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) {
  --paper: var(--home-page-bg);
  --card: var(--home-card-bg);
  --bg0: var(--home-page-bg);
  --bg1: var(--home-card-bg);
  --bg2: var(--home-card-tint);
  --accent: var(--home-primary);
  --accent-deep: var(--home-primary-hover);
  --ink: var(--home-body-text);
  --muted: var(--home-muted-text);
  --line: var(--home-border);
  --shadow: var(--home-shadow);
  --panel: color-mix(in srgb, var(--home-card-bg) 96%, transparent);
  --token-selected: var(--home-body-text);
  --swatch-ring: color-mix(in srgb, var(--home-body-text) 20%, transparent);
  --token-hover: color-mix(in srgb, var(--home-body-text) 28%, transparent);
  --hl-fill-base: var(--home-card-bg);
  --hl-pattern-ink: var(--home-body-text);
  --hl-pattern-fill: color-mix(in srgb, var(--home-body-text) 18%, transparent);
  --hl-1-fill: color-mix(in srgb, var(--hl-1) 62%, var(--hl-fill-base));
  --hl-2-fill: color-mix(in srgb, var(--hl-2) 62%, var(--hl-fill-base));
  --hl-3-fill: color-mix(in srgb, var(--hl-3) 60%, var(--hl-fill-base));
  --hl-4-fill: color-mix(in srgb, var(--hl-4) 60%, var(--hl-fill-base));
  --hl-5-fill: color-mix(in srgb, var(--hl-5) 60%, var(--hl-fill-base));
  --hl-6-fill: color-mix(in srgb, var(--hl-6) 60%, var(--hl-fill-base));
  --hl-7-fill: color-mix(in srgb, var(--hl-7) 68%, var(--hl-fill-base));
  --hl-8-fill: color-mix(in srgb, var(--hl-8) 60%, var(--hl-fill-base));
  min-height: 100dvh;
  width: 100%;
  background: var(--home-page-background, var(--home-page-bg));
  color: var(--home-body-text);
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .daily-card,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .daily-card {
  background: var(--home-card-bg);
  border-width: var(--home-card-border-width, 1px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border);
  border-top-width: max(3px, var(--home-card-border-width, 1px));
  border-top-color: var(--home-primary);
  border-radius: var(--home-card-radius, 1rem);
  box-shadow: var(--home-card-shadow, var(--home-shadow));
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .btn.primary,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .btn.primary {
  background: var(--home-primary);
  color: var(--home-button-text);
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .btn.primary:hover,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .btn.primary:hover {
  background: var(--home-primary-hover);
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .chrome-btn.reset-btn,
html[data-theme="light"] body[data-page="puzzle"] .home-page .chrome-btn.save-btn,
html[data-theme="light"] body[data-page="puzzle"] .home-page .chrome-btn.icon-btn,
html[data-theme="light"] body[data-page="puzzle"] .home-page .chrome-btn.help-btn,
html[data-theme="light"] body[data-page="puzzle"] .home-page .chrome-btn.puzzle-timer,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .chrome-btn.reset-btn,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .chrome-btn.save-btn,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .chrome-btn.icon-btn,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .chrome-btn.help-btn,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .chrome-btn.puzzle-timer {
  background: var(--home-pill-bg);
  color: var(--home-pill-text);
  border-color: var(--home-border);
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .chrome-btn.puzzle-timer:hover,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .chrome-btn.puzzle-timer:hover {
  background: var(--home-pill-hover-bg);
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .letter-box,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .letter-box {
  background: #fff;
  border-color: color-mix(in srgb, var(--home-border) 70%, var(--home-muted-text));
  color: var(--home-pill-text, var(--home-heading, #1c2a3a));
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .letter-box[data-kind="space"].is-filled,
html[data-theme="light"] body[data-page="puzzle"] .home-page .letter-box[data-kind="letter"].is-filled,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .letter-box[data-kind="space"].is-filled,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .letter-box[data-kind="letter"].is-filled {
  background: color-mix(in srgb, var(--home-pill-text, var(--home-heading, #1c2a3a)) 6%, #fff);
  color: var(--home-pill-text, var(--home-heading, #1c2a3a));
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .letter-box.is-hinted,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .letter-box.is-hinted {
  color: var(--home-pill-text, var(--home-heading, #1c2a3a));
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .letter-word.correct .letter-box,
html[data-theme="light"] body[data-page="puzzle"] .home-page .letter-box.correct,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .letter-word.correct .letter-box,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .letter-box.correct {
  border-color: #2f9e5a;
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .letter-word.incorrect .letter-box,
html[data-theme="light"] body[data-page="puzzle"] .home-page .letter-box.incorrect,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .letter-word.incorrect .letter-box,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .letter-box.incorrect {
  border-color: #d94b3a;
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .column-head h3,
html[data-theme="light"] body[data-page="puzzle"] .home-page #puzzle-heading,
html[data-theme="light"] body[data-page="puzzle"] .home-page #puzzle-instructions,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .column-head h3,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) #puzzle-heading,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) #puzzle-instructions {
  color: var(--home-heading);
}

html[data-theme="light"] body[data-page="puzzle"] .home-page .issue-line,
body[data-page="puzzle"] .home-page:not([data-home-theme="current"]) .issue-line {
  color: var(--home-primary);
}

/* Keep translation rows unboxed on the puzzle page (all themes). */
body[data-page="puzzle"] #match-rows .sentence-item {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body[data-page="puzzle"] #match-rows .sentence-item:hover {
  background: transparent;
  border-color: transparent;
}

body[data-page="home2"] .page.home2-page {
  width: min(720px, calc(100% - 32px));
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 0 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100dvh;
  box-sizing: border-box;
}

.home2-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  width: 100%;
}

.home2-top .masthead {
  align-items: center;
  width: 100%;
}

.home2-top .masthead-lockup {
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
}

.home2-top .masthead-logo {
  height: auto;
  width: min(17rem, 78vw);
  max-width: none;
}

.home2-top .masthead-word {
  align-items: center;
  width: min(100%, 16rem);
}

.home2-top .masthead-word.masthead-word-poly {
  width: max-content;
  max-width: min(100%, 16rem);
  --poly-bar-overlap: 0.18em;
}

.home2-top .masthead-name-poly {
  font-size: clamp(2.35rem, 11vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-align: center;
}

.home2-top .masthead-name {
  font-size: clamp(2.35rem, 11vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-align: center;
}

.home2-top .masthead-bars {
  gap: 0.14rem;
  margin-top: 0.3rem;
}

.home2-top .masthead-word-poly .masthead-bars {
  margin-top: calc(-1 * var(--poly-bar-overlap));
}

.home2-top .masthead-bars i {
  height: 0.4rem;
}

.home2-top .masthead-tagline {
  margin: 0.12rem 0 0;
  padding: 0;
  border: 0;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  font-size: clamp(0.92rem, 2.2vw, 1.08rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

.home2-top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.home2-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  --home2-section-gap: 0;
  gap: 0;
  width: 100%;
}

.home2-intro {
  width: 100%;
  max-width: none;
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: var(--home-card-radius, 1.5rem);
  border-width: var(--home-card-border-width, 1px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border);
  border-top-width: max(3px, var(--home-card-border-width, 1px));
  border-top-color: var(--home-primary);
  background: var(--home-card-bg);
  box-shadow: var(--home-card-shadow, var(--home-shadow));
  box-sizing: border-box;
}

.home2-intro-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home2-intro-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.home2-intro-copy {
  min-width: 0;
}

.home2-intro-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.home2-intro-title {
  margin: 0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--home-heading);
}

button.home2-intro-title {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: inherit;
}

.home2-intro .home2-intro-hide {
  margin-left: auto;
}

a.home2-intro-title,
button.home2-intro-title {
  text-decoration: none;
}

a.home2-intro-title:hover,
button.home2-intro-title:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

a.home2-intro-title:focus-visible,
button.home2-intro-title:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.home2-intro-hide {
  flex-shrink: 0;
  margin: 0;
  padding: 0.2rem 0.35rem;
  border: 0;
  background: transparent;
  color: var(--home-muted-text);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.home2-intro-hide:hover {
  color: var(--home-heading);
}

.home2-intro-hide:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.home2-intro-lede {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--home-muted-text);
}

.home2-pill-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.4rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--home-border);
  border-radius: var(--home-button-radius, 999px);
  background: var(--home-pill-bg);
  color: var(--home-pill-text);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.home2-pill-btn:hover {
  border-color: var(--home-border);
  background: var(--home-pill-hover-bg);
}

.home2-pill-btn:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.home2-pill-btn-accent {
  background: var(--home-accent-bg, var(--home-cta-bg, #ffe066));
  color: var(--home-accent-text, var(--home-cta-text, #1a1a1a));
  border-color: var(--home-border);
}

.home2-pill-btn-accent:hover {
  background: var(--home-accent-hover-bg, var(--home-cta-hover-bg, #ffd633));
}

.home2-pill-btn-practice {
  background: #fff;
  color: #1c2a3a;
  border-color: var(--home-border);
}

.home2-pill-btn-practice:hover {
  background: #f3f3f3;
  color: #1c2a3a;
}

.home2-new-link {
  width: 100%;
  max-width: 50rem;
  margin: 0;
  padding: 0;
  text-align: center;
}

.home2-help-link {
  margin: 20px auto 0;
}

.home2-page-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.1rem 0.95rem;
  width: 100%;
  margin: 0.65rem auto 0;
}

.home2-page-links .home2-new-link {
  width: auto;
  max-width: none;
}

.home2-page-links .home2-new-link-btn {
  padding: 0.05rem 0.15rem;
  white-space: nowrap;
}

.home2-restore-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 1.1rem;
  width: 100%;
  max-width: none;
  margin: 24px auto 0;
  padding: 0;
}

.home2-restore-links .home2-new-link {
  width: auto;
  max-width: none;
  padding: 0;
}

.home2-new-link-btn {
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 0;
  background: transparent;
  color: var(--home-muted-text);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.home2-new-link-btn:hover {
  color: var(--home-heading);
}

.home2-new-link-btn:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.home2-recent {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin-top: 20px;
  padding: 0;
}

.home2-recent-card {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1rem 1.15rem 0.85rem;
  border-radius: var(--home-card-radius, 1.5rem);
  border-width: var(--home-card-border-width, 1px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border);
  border-top-width: max(3px, var(--home-card-border-width, 1px));
  border-top-color: var(--home-primary);
  background: var(--home-card-bg);
  box-shadow: var(--home-card-shadow, var(--home-shadow));
}

.home2-recent-card .home2-recent-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.15rem;
  border-bottom: 0;
}

.home2-recent-card .home2-recent-title {
  margin: 0;
  justify-self: center;
  text-align: center;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-transform: none;
  color: var(--home-heading);
}

.home2-recent-card .home2-intro-hide {
  grid-area: auto;
  justify-self: start;
}

.home2-recent-card .home2-recent-link {
  justify-self: end;
  font-size: 0.82rem;
}

.home2-recent-card .recent-puzzle-list {
  gap: 2px;
}

.home2-recent-card .recent-puzzle-row--home {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  background: transparent;
}

.home2-recent-card .home-recent-row-link {
  display: grid;
  grid-template-columns: minmax(6.6rem, 0.85fr) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 0.45rem 0.75rem;
  padding: 0.42rem 0.35rem;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.home2-recent-card .home-recent-row-link:hover {
  background: color-mix(in srgb, var(--home-heading) 7%, transparent);
}

.home2-recent-card .home-recent-row-link:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.home2-recent-card .recent-puzzle-date {
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--home-heading);
  white-space: nowrap;
}

.home2-recent-card .home-recent-lang {
  position: relative;
  top: -0.19em;
  min-width: 0;
  overflow: hidden;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--home-heading);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home2-recent-card .home-recent-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 4.6rem;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--home-muted-text);
}

.home2-recent-card .home-recent-meta.is-unsolved {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.home2-recent-card .home-recent-time {
  color: var(--home-heading);
}

.home2-recent-card .recent-puzzle-solved-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--good, #2f7d4c);
  color: #fff;
  flex-shrink: 0;
}

.home2-recent-card .recent-puzzle-solved-mark svg {
  display: block;
  width: 0.62rem;
  height: 0.62rem;
}

.home2-recent-card .recent-puzzle-row--home:last-child {
  padding-bottom: 0;
}

.home2-recent-title {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-muted-text);
}

.home2-recent-head-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.home2-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.home2-recent-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.55rem 0.85rem;
}

.home2-recent-link {
  flex-shrink: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--home-primary);
  text-decoration: none;
}

.home2-recent-link:hover {
  text-decoration: underline;
}

.home2-recent-link:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.home-archive-page .home-archive-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.home-archive-back {
  align-self: flex-start;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--home-primary);
  text-decoration: none;
}

.home-archive-back:hover {
  text-decoration: underline;
}

.home-archive-back:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.home2-archive-intro {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.home2-archive-title {
  margin: 0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--home-heading);
}

.home2-archive-lede {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--home-muted-text);
  max-width: 36rem;
}

.home2-archive .recent-puzzle-list {
  margin-top: 0.85rem;
}

.recent-puzzle-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.recent-puzzle-row {
  display: grid;
  grid-template-columns:
    5.2rem
    10.75rem
    minmax(0, 1fr)
    12.5rem;
  gap: 0.35rem 0.65rem;
  align-items: start;
  min-width: 0;
  padding: 0.5rem 0.72rem;
  border-radius: var(--home-card-radius, 1rem);
  border: 1px solid var(--home-border);
  background: var(--home-card-bg);
  box-shadow: var(--home-card-shadow, var(--home-shadow));
  box-sizing: border-box;
}

.recent-puzzle-date {
  align-self: start;
  padding-top: 0.14rem;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.25;
  color: var(--home-muted-text);
}

.recent-puzzle-info {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.recent-puzzle-lang {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--home-source-accent);
}

.recent-puzzle-mythology {
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--home-muted-text, var(--muted));
}

.recent-puzzle-phenomena {
  min-width: 0;
}

.recent-puzzle-glyph-link {
  align-self: start;
  margin-top: 0.2rem;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: #7a3e2e;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}
.recent-puzzle-glyph-link:hover {
  color: #5c2c20;
}
.recent-puzzle-phenomenon {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--home-muted-text);
  white-space: normal;
}

.recent-puzzle-phrase-panel {
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.65rem;
  min-height: 2.65rem;
  max-height: 2.65rem;
  min-width: 0;
  padding: 0.35rem 0.7rem;
  border-radius: var(--home-button-radius, 0.95rem);
  border: 1px solid var(--home-border);
  background: var(--home-panel-pattern, var(--home-card-tint));
  color: var(--home-heading);
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.recent-puzzle-phrase-panel:hover {
  border-color: var(--home-primary);
  background: color-mix(in srgb, var(--home-panel-pattern, var(--home-card-tint)) 88%, #fff);
}

.recent-puzzle-phrase-panel:hover .phrase-go {
  transform: translateX(0.14rem);
}

.recent-puzzle-phrase-panel:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.recent-puzzle-phrase-panel .phrase-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}

.recent-puzzle-phrase {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(0.95rem, 2.4vw, 1.08rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--home-heading);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-puzzle-status-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
  align-self: start;
  min-height: 2.65rem;
  padding-top: 0.14rem;
  box-sizing: border-box;
}

.recent-puzzle-solved-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--good, #2f7d4c);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--good, #2f7d4c) 22%, transparent);
}

.recent-puzzle-solved-badge svg {
  display: block;
  width: 0.82rem;
  height: 0.82rem;
}

.recent-puzzle-solved-badge.is-placeholder {
  visibility: hidden;
  background: transparent;
  box-shadow: none;
}

.recent-puzzle-status {
  min-width: 0;
  text-align: right;
}

.recent-puzzle-status-line {
  display: block;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: inherit;
  white-space: normal;
}

.recent-puzzle-status-wrap.is-solved .recent-puzzle-status-line {
  color: var(--home-primary);
}

.recent-puzzle-status-wrap.is-unsolved .recent-puzzle-status-line {
  color: var(--home-muted-text);
}

.recent-puzzle-row.is-solved {
  border-color: color-mix(in srgb, var(--good, #2f7d4c) 35%, var(--home-border));
}

.recent-puzzle-empty {
  margin: 0;
  padding: 0.85rem 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.92rem;
  color: var(--home-muted-text);
}

.home2-samples {
  width: 100%;
  max-width: 50rem;
  box-sizing: border-box;
  padding: 0.35rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
}

.home2-samples-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0;
}

.home2-samples-title {
  margin: 0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--home-heading);
}

.home2-samples-note {
  margin: 0;
  flex-shrink: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--home-muted-text);
  text-align: right;
}

.sample-puzzle-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.sample-puzzle-list:not(.is-expanded) .sample-puzzle-card--extra {
  display: none;
}

.sample-puzzle-expander {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 18rem;
  margin: 0 auto;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--home-border);
  border-radius: var(--home-button-radius, 999px);
  background: var(--home-pill-bg);
  color: var(--home-pill-text);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  box-sizing: border-box;
}

.sample-puzzle-expander:hover {
  background: var(--home-pill-hover-bg);
}

.sample-puzzle-expander:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.sample-puzzle-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.95rem 0.95rem 1rem;
  border-radius: var(--home-card-radius, 1.15rem);
  border-width: var(--home-card-border-width, 1px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border);
  border-top-width: max(3px, var(--home-card-border-width, 1px));
  border-top-color: var(--home-primary);
  background: var(--home-card-bg);
  box-shadow: var(--home-card-shadow, var(--home-shadow));
  box-sizing: border-box;
}

.sample-puzzle-meta {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--home-primary);
}

.sample-puzzle-meta-lang {
  color: var(--home-source-accent);
  font-weight: 800;
}

.sample-puzzle-meta-focus {
  color: var(--home-muted-text, var(--muted));
  font-weight: 700;
}

.sample-puzzle-meta-focus::before {
  content: "·";
  margin: 0 0.35em;
  color: var(--home-muted-text, var(--muted));
  font-weight: 700;
}

.sample-puzzle-phrase-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 0.1rem;
  padding: 0.85rem 0.75rem;
  border-radius: 0.75rem;
  background: var(--home-panel-pattern, var(--home-card-tint));
  border: 1px solid var(--home-border);
  text-decoration: none;
  text-align: center;
  color: inherit;
  cursor: pointer;
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sample-puzzle-phrase-panel:hover {
  border-color: var(--home-primary);
  background: color-mix(in srgb, var(--home-panel-pattern, var(--home-card-tint)) 88%, #fff);
}

.sample-puzzle-phrase-panel:hover .phrase-go {
  transform: translateX(0.12rem);
}

.sample-puzzle-phrase-panel:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.sample-puzzle-phrase {
  margin: 0;
  display: inline;
  text-align: center;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
  color: var(--home-heading);
  overflow-wrap: anywhere;
}

.phrase-cluster {
  display: inline;
  max-width: 100%;
  text-align: center;
}

.phrase-glue {
  white-space: nowrap;
}

.phrase-go {
  display: inline;
  white-space: nowrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin-left: 0;
  color: var(--home-source-accent, #c95f50);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 1.1em;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  transition: transform 0.15s ease;
}

.daily-cta-phrase:empty,
.sample-puzzle-phrase:empty {
  display: none;
}

.sample-puzzle-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1rem 0;
  color: var(--home-muted-text);
  font-size: 0.92rem;
}

.home-theme-tester {
  width: 100%;
  max-width: 50rem;
  margin: 1.5rem 0 0.5rem;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid color-mix(in srgb, var(--home-border) 80%, transparent);
  box-sizing: border-box;
}

.home-theme-tester-eyebrow {
  margin: 0 0 0.45rem;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--home-muted-text);
}

.home-theme-tester-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}

.home-theme-tester-label {
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--home-muted-text);
}

.home-theme-tester-select {
  min-width: 12.5rem;
  max-width: 100%;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--home-border);
  border-radius: 0.45rem;
  background: var(--home-card-bg);
  color: var(--home-body-text);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: none;
}

.home-theme-tester-select:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.home2-theme-picker {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0.85rem auto 0.5rem;
  padding: 0.4rem 0 0.25rem;
  border-top: 1px solid color-mix(in srgb, var(--home-border) 80%, transparent);
  box-sizing: border-box;
  text-align: center;
}

.home2-appearance-btn {
  display: inline;
  min-height: 0;
  margin: 0;
  padding: 0.05rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--home-muted-text);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  cursor: pointer;
}

.home2-appearance-btn:hover {
  color: var(--home-heading);
}

.home2-appearance-btn:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 3px;
}

.home2-appearance-current {
  color: var(--home-heading);
  font-weight: 700;
}

.home2-appearance-panel {
  display: flex;
  justify-content: center;
  margin: 12px auto 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--home-border);
  background: var(--home-card-bg);
  box-shadow: var(--home-card-shadow, var(--home-shadow));
}

.home2-appearance-panel[hidden] {
  display: none;
}

.home2-theme-picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.65rem;
}

.home2-theme-picker-label {
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--home-muted-text);
}

.home2-theme-picker-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.home2-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.15rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  cursor: pointer;
}

.home2-theme-btn:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 2px;
}

.home2-theme-btn[aria-pressed="true"] {
  outline: 2px solid var(--home-focus);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--home-body-text) 6%, transparent);
}

.home2-theme-btn-swatch {
  display: block;
  width: 1.85rem;
  height: 1.25rem;
  border-radius: 3px;
  box-sizing: border-box;
}

.home2-theme-btn-swatch--puzzle-table {
  background: linear-gradient(160deg, #69ddd5 0 46%, #e7f4e3 46% 72%, #fffdf8 72%);
  border: 1px solid rgba(22, 48, 40, 0.18);
  box-shadow: 0 2px 6px rgba(18, 55, 48, 0.16);
}

.home2-theme-btn-swatch--poolside-punk {
  background: linear-gradient(160deg, #69ddd5 0 42%, #ff806e 42% 58%, #fffbef 58%);
  border: 2px solid #10242d;
  box-shadow: 2px 2px 0 #10242d;
}

.home2-theme-btn-swatch--terracotta-archive {
  background:
    radial-gradient(circle at 68% 28%, #9d4f3f 0 24%, transparent 25%),
    radial-gradient(circle at 26% 74%, #d2a343 0 16%, transparent 17%),
    radial-gradient(circle at 82% 78%, #346b65 0 10%, transparent 11%),
    linear-gradient(155deg, #f5eee6 0%, #f5e2d6 100%);
  border: 1px solid #dccdc1;
}

.home2-theme-btn-swatch--gilded-chamber {
  background:
    radial-gradient(circle at 68% 28%, #b4903f 0 24%, transparent 25%),
    radial-gradient(circle at 26% 74%, #9d4f3f 0 16%, transparent 17%),
    radial-gradient(circle at 82% 78%, #4f8f6a 0 10%, transparent 11%),
    linear-gradient(155deg, #faf7f1 0%, #eae3d2 100%);
  border: 1px solid #d9ccac;
}

.home2-theme-btn-swatch--midnight-babel {
  background: linear-gradient(180deg, #e5b95b 0 28%, #152a32 28%);
  border: 1px solid #49656a;
}

.home2-theme-btn-swatch--cosmic-panels {
  background:
    radial-gradient(circle at 72% 28%, #59dfe8 0 18%, transparent 19%),
    radial-gradient(circle at 28% 72%, #ffe45e 0 14%, transparent 15%),
    #15142e;
  border: 2px solid #8a7eb6;
  border-radius: 6px 2px 6px 2px;
  box-shadow: 2px 2px 0 #ff65b2;
}

.home2-theme-btn-swatch--bubblegum-brutalist {
  width: 1.7rem;
  height: 1.15rem;
  background: linear-gradient(135deg, #ff9fcb 0 55%, #ffe34d 55%);
  border: 3px solid #111111;
  border-radius: 0;
  box-shadow: 3px 3px 0 #111111;
}

.home2-theme-btn-swatch--paper-confetti {
  background:
    radial-gradient(circle at 22% 35%, #e94d64 0 12%, transparent 13%),
    radial-gradient(circle at 72% 68%, #2777c8 0 10%, transparent 11%),
    #f7f3e8;
  border: 2px solid #1d2225;
  box-shadow: 2px 2px 0 #1d2225;
}

.home2-help-pop {
  position: fixed;
  z-index: 40;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(46rem, calc(100vw - 1.25rem));
  max-height: min(92vh, 44rem);
  overflow: auto;
  padding: 1.45rem 1.35rem 1.25rem;
  border-radius: var(--home-card-radius, 1.5rem);
  border-width: var(--home-card-border-width, 1px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border);
  border-top-width: max(3px, var(--home-card-border-width, 1px));
  border-top-color: var(--home-primary);
  background: var(--home-card-bg, #f3f1eb);
  color: var(--home-body-text, var(--ink));
  box-shadow: var(--home-card-shadow, var(--home-shadow, 0 12px 32px rgba(28, 42, 58, 0.18)));
  box-sizing: border-box;
  isolation: isolate;
}

.home2-help-pop[hidden] {
  display: none;
}

.home2-help-close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--home-border);
  border-radius: var(--home-button-radius, 999px);
  background: var(--home-pill-bg, color-mix(in srgb, var(--home-card-bg, #fff) 88%, #fff));
  color: var(--home-pill-text, var(--home-heading, var(--ink)));
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.home2-help-close:hover {
  background: var(--home-pill-hover-bg, color-mix(in srgb, var(--home-card-tint, #f0e6d2) 70%, #fff));
  border-color: var(--home-primary);
}

.home2-help-close:focus-visible {
  outline: 2px solid var(--home-focus, var(--accent));
  outline-offset: 2px;
}

.home2-help-eyebrow {
  margin: 0 2rem 0.35rem 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--home-source-accent, #8b3a2a);
}

.home2-help-title {
  margin: 0 2rem 0.45rem 0;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--home-heading, var(--ink));
}

.home2-help-lede {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--home-body-text, var(--ink));
}

.home2-help-sublede {
  margin: 0.15rem 0 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--home-muted-text, var(--muted));
}

.home2-help-steps {
  list-style: none;
  margin: 1.15rem 0 0;
  padding: 1rem 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  border-top: 1px solid color-mix(in srgb, var(--home-border, #2c3644) 70%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--home-border, #2c3644) 70%, transparent);
}

.home2-help-step {
  position: relative;
  min-width: 0;
  padding: 0 0.15rem;
}

.home2-help-step + .home2-help-step::before {
  content: "";
  position: absolute;
  top: 0.15rem;
  bottom: 0.15rem;
  left: -0.5rem;
  width: 1px;
  background: color-mix(in srgb, var(--home-border, #2c3644) 55%, transparent);
}

.home2-help-step-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.home2-help-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  margin-bottom: 0;
  border: 1px solid var(--home-border, #2c3644);
  border-radius: 0.35rem;
  background: var(--home-card-tint, #f0d37a);
  color: var(--home-heading, #1a1a1a);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--home-border, #2c3644) 70%, transparent);
}

.home2-help-step:nth-child(1) .home2-help-step-num {
  background: #f0d37a;
}

.home2-help-step:nth-child(2) .home2-help-step-num {
  background: #f0b48a;
}

.home2-help-step:nth-child(3) .home2-help-step-num {
  background: #7eb8ad;
}

.home2-help-step-title {
  margin: 0 0 0.35rem;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--home-heading, var(--ink));
}

.home2-help-step-body {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--home-muted-text, var(--muted));
}

.home2-help-hints-tip {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: var(--home-button-radius, 0.65rem);
  border-width: var(--home-card-border-width, 1px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border);
  background: var(--home-pill-bg, #ffffff);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--home-pill-text, var(--home-body-text, var(--ink)));
}

.home2-help-hints-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 0 0.1rem;
  padding: 0.18rem 0.55rem;
  border: 2px solid var(--home-border, var(--ink));
  border-radius: var(--home-button-radius, 0.35rem);
  background: var(--home-pill-bg, var(--home-card-tint, #ffe34d));
  color: var(--home-pill-text, var(--home-heading, var(--ink)));
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.home2-help-example {
  margin-top: 0.85rem;
  margin-bottom: 0;
  padding: 0.85rem 0.9rem 0.75rem;
  border-radius: var(--home-card-radius, 0.95rem);
  border-width: var(--home-card-border-width, 1px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border);
  background: var(--home-pill-bg, #ffffff);
  box-shadow: var(--home-card-shadow, var(--home-shadow));
}

.home2-help-example-eyebrow {
  margin: 0 0 0.55rem;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--translation-pair-muted, var(--home-pill-text, var(--home-muted-text, var(--muted))));
}

.home2-help-example-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.home2-help-example-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.15rem minmax(0, 1fr);
  gap: 0.35rem;
  align-items: start;
  padding: 0.4rem 0;
  border-top: 1px solid color-mix(in srgb, var(--home-border, #2c3644) 55%, transparent);
}

.home2-help-example-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.home2-help-pop .glyph-token,
.home2-help-pop .reveal-glyph {
  color: #1c2420;
}

.home2-help-example-lang .reveal-glyph-line {
  align-items: flex-end;
}

.home2-help-example-lang,
.home2-help-example-en {
  min-width: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--home-pill-text, var(--translation-pair-text, var(--home-heading, var(--ink))));
}

.home2-help-example-arrow {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.1em;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--home-source-accent, #c95f50);
}

.home2-help-example-arrow::before {
  content: "→";
}

.help-hl {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.06rem;
  padding: 0.08rem 0.28rem;
  border-radius: 0.3rem;
  font: inherit;
  color: #1c2a3a;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.home2-help-example .help-hl .glyph-token,
.home2-help-example .help-hl .reveal-glyph {
  color: #1c2420;
}

.help-hl-green {
  background: #b7d9a4;
  color: #1c2a3a;
}

.help-hl-violet {
  background: #d7b4d8;
  color: #1c2a3a;
}

.help-hl-blue {
  background: #9ec8d6;
  color: #1c2a3a;
}

@media (max-width: 720px) {
  .home2-help-steps {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 0.85rem 0;
  }

  .home2-help-step + .home2-help-step::before {
    display: none;
  }

  .home2-help-step-head {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
  }

  .home2-help-step-title {
    margin: 0;
  }

  .home2-help-example-row {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
    gap: 0.4rem;
    padding: 0.28rem 0;
  }

  .home2-help-example-arrow {
    display: none;
  }

  .home2-help-example-lang {
    grid-column: 1;
  }

  .home2-help-example-en {
    grid-column: 2;
  }
}

@media (max-width: 767px) {
  .home2-intro-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title hide" "actions actions";
    align-items: center;
    gap: 12px;
  }

  .home2-intro-title {
    grid-area: title;
  }

  .home2-intro-hide {
    grid-area: hide;
    justify-self: end;
  }

  .home2-intro-actions {
    grid-area: actions;
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .home2-intro-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .home2-pill-btn {
    width: 100%;
    min-height: 2.75rem;
    font-size: 1.02rem;
  }

  .home2-intro-title {
    font-size: 22px;
  }

  .home2-intro-lede {
    font-size: 1.08rem;
    line-height: 1.45;
  }

  .home2-recent-card {
    padding: 0.9rem 0.85rem 0.75rem;
  }

  .home2-recent-card .home2-recent-title {
    font-size: 1.12rem;
    white-space: nowrap;
  }

  .home2-recent-card .home2-recent-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .home2-recent-card .home-recent-row-link {
    grid-template-columns: 6.15rem minmax(0, 1fr) auto;
    gap: 0.3rem 0.45rem;
    padding: 0.4rem 0.1rem;
  }

  .home2-recent-card .recent-puzzle-date {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
  }

  .home2-recent-card .home-recent-lang {
    font-size: 0.88rem;
  }

  .home2-recent-card .home-recent-meta {
    min-width: 3.6rem;
    font-size: 0.75rem;
  }

  .recent-puzzle-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.65rem 0.75rem;
    align-items: start;
  }

  .home2-archive-intro {
    gap: 0.3rem;
  }

  .home2-archive-title {
    font-size: clamp(1.35rem, 6vw, 1.65rem);
  }

  .recent-puzzle-date,
  .recent-puzzle-info,
  .recent-puzzle-status {
    text-align: left;
  }

  .recent-puzzle-phrase-panel {
    width: 100%;
    height: 2.65rem;
    min-height: 2.65rem;
    max-height: 2.65rem;
    padding: 0.35rem 0.8rem;
    align-self: start;
  }

  .recent-puzzle-phrase {
    white-space: nowrap;
  }

  .recent-puzzle-status-wrap {
    justify-content: flex-start;
    align-self: start;
    min-height: 0;
    padding-top: 0;
  }

  .recent-puzzle-status {
    text-align: left;
  }

  .home2-samples-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .home2-samples-title {
    font-size: clamp(1.5rem, 6vw, 1.75rem);
  }

  .home2-samples-note {
    text-align: left;
    font-size: 0.98rem;
  }

  .sample-puzzle-list {
    grid-template-columns: 1fr;
  }

  .sample-puzzle-meta {
    font-size: 0.8rem;
  }

  .sample-puzzle-phrase {
    font-size: 1em;
  }

  .sample-puzzle-phrase-panel {
    padding: 1rem 0.85rem;
    font-size: clamp(1.2rem, 5vw, 1.4rem);
  }

  .daily-cta-date {
    font-size: 15px;
    letter-spacing: 0.06em;
  }

  .daily-cta-heading {
    font-size: 32px;
  }

  .daily-cta-lede {
    font-size: 18px;
    line-height: 1.5;
  }

  .daily-cta-phrase-panel {
    font-size: clamp(1.55rem, 6vw, 1.9rem);
  }

  .daily-cta-phrase {
    font-size: 1em;
  }

  .home2-top .masthead-tagline {
    font-size: 0.88rem;
  }

  .home-theme-tester-row {
    flex-direction: column;
    align-items: stretch;
  }

  .home-theme-tester-select {
    width: 100%;
  }
}

.daily-cta-card {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 20px;
  border-radius: var(--home-card-radius, 1.5rem);
  border-width: var(--home-card-border-width, 1px);
  border-style: var(--home-card-border-style, solid);
  border-color: var(--home-border);
  border-top-width: max(3px, var(--home-card-border-width, 1px));
  border-top-color: var(--home-primary);
  background: var(--home-card-bg);
  box-shadow: var(--home-card-shadow, var(--home-shadow));
}

.daily-cta-date {
  margin: 0 0 16px;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--home-primary);
  white-space: nowrap;
}

.daily-cta-heading {
  margin: 0 0 16px;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 32px;
  text-wrap: balance;
  overflow-wrap: anywhere;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--home-heading);
}

.daily-cta-lede {
  margin: 0 0 24px;
  max-width: 42rem;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--home-muted-text);
  overflow-wrap: anywhere;
}

.daily-cta-lang {
  font-style: italic;
  font-weight: 500;
  color: var(--home-source-accent);
}

.daily-cta-phrase-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 0.2rem;
  padding: 1.05rem 1rem;
  border-radius: 0.95rem;
  background: var(--home-panel-pattern, var(--home-card-tint));
  border: 1px solid var(--home-border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  text-align: center;
  font-size: clamp(1.45rem, 4.8vw, 2rem);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.daily-cta-phrase-panel:hover {
  border-color: var(--home-primary);
  background: color-mix(in srgb, var(--home-panel-pattern, var(--home-card-tint)) 88%, #fff);
}

.daily-cta-phrase-panel:hover .phrase-go {
  transform: translateX(0.14rem);
}

.daily-cta-phrase-panel:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 3px;
}

.daily-cta-phrase {
  margin: 0;
  display: inline;
  text-align: center;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.28;
  color: var(--home-heading);
  overflow-wrap: anywhere;
  word-break: normal;
}

.daily-cta-phrase.is-glyph {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0.15rem 0.28rem;
  font-family: inherit;
}

.daily-decode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 24px;
  box-sizing: border-box;
  overflow: visible;
  border-radius: 14px;
  background: color-mix(in srgb, var(--home-primary) 14%, var(--home-card-bg, #fffdf8));
  border: 1px solid color-mix(in srgb, var(--home-primary) 38%, transparent);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.daily-decode:hover {
  border-color: var(--home-primary);
}

.daily-decode:focus-visible {
  outline: 2px solid var(--home-focus);
  outline-offset: 3px;
}

.daily-decode .daily-cta-phrase,
.daily-decode .question-prompt-phrase {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.55rem 0.15rem 0;
  text-align: center;
  font-family: var(--font-language);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--home-heading);
  overflow: visible;
}

.daily-decode .daily-cta-phrase.is-glyph {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.35rem 0.4rem;
}

.daily-decode .glyph-token {
  color: var(--home-heading);
}

.daily-decode {
  --board-glyph: calc(2.07rem * 1.25);
}

body[data-page="home2"] .skin-v2 .glyph-unit {
  position: relative;
}

.daily-decode .glyph-root,
.daily-decode .skin-v2 .glyph-root {
  height: var(--board-glyph) !important;
  width: calc(var(--board-glyph) * var(--g-aspect)) !important;
}

.daily-decode .glyph-aff:not(.glyph-salt),
.daily-decode .skin-v2 .glyph-aff:not(.glyph-salt) {
  width: calc(0.99rem * 1.25) !important;
  height: calc(0.99rem * 1.25) !important;
}

.daily-decode .glyph-aff.glyph-salt,
.daily-decode .skin-v2 .glyph-aff.glyph-salt {
  height: var(--board-glyph) !important;
  width: calc(var(--board-glyph) * 8 / 34) !important;
}

.daily-decode-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: min(220px, 100%);
  min-height: 48px;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: var(--home-primary);
  color: var(--home-button-text, #fff);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
}

.daily-decode:hover .daily-decode-play {
  background: var(--home-primary-hover, var(--home-primary));
}

.home-page[data-home-theme="puzzle-table"] .daily-cta-card,
.home-page[data-home-theme="puzzle-table"] .home2-intro,
.home-page[data-home-theme="puzzle-table"] .home2-recent-card {
  border-top-width: 0;
}

.daily-cta-status,
.daily-cta-fallback {
  margin: 1rem 0 0;
  max-width: 48rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--home-muted-text);
}

.daily-cta-fallback {
  padding: 1.25rem 1rem;
  border-radius: 1rem;
  border: 1px dashed var(--home-border);
  background: var(--home-card-bg);
}

@media (max-width: 720px) {
  body[data-page="home2"] .page.home2-page {
    gap: 24px;
    padding: 1rem 0 1.75rem;
  }

  .daily-cta-card {
    padding: 20px;
  }

  .home2-intro {
    padding: 20px 24px;
  }

  .home2-top .masthead-word {
    width: min(100%, 16rem);
  }

  .sample-puzzle-list {
    gap: 1rem;
    padding-right: 0.35rem;
    padding-bottom: 0.35rem;
  }
}

@media (min-width: 768px) {
  body[data-page="home2"] .page.home2-page {
    padding-top: 1.75rem;
    padding-bottom: 2.25rem;
  }

  .daily-cta-card {
    padding: 36px;
  }

  .daily-cta-date {
    font-size: 16px;
  }

  .daily-cta-heading {
    font-size: 44px;
  }

  .home2-top .masthead-logo {
    width: 24rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .daily-cta-phrase-panel,
  .sample-puzzle-phrase-panel,
  .phrase-go {
    transition: none;
  }

  .daily-cta-phrase-panel:hover .phrase-go,
  .sample-puzzle-phrase-panel:hover .phrase-go {
    transform: none;
  }
}

/* —— Lab preview of public homepage CTA —— */
body[data-page="play"] {
  min-height: 100dvh;
}

body[data-page="play"] .page.play-page {
  max-width: 26rem;
  margin: 0 auto;
  padding: 1.1rem 1.1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-height: 100dvh;
  box-sizing: border-box;
}

.play-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.play-top .masthead-tagline {
  display: none;
}

.play-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  padding: 1.35rem 1.2rem 1.4rem;
  border-radius: 1.15rem;
  background: var(--bg1);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, var(--line));
  border-top: 3px solid var(--accent-deep);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 8%, transparent);
  container-type: inline-size;
  container-name: play-card;
}

.play-date {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.play-heading {
  margin: 0;
  width: 100%;
  white-space: nowrap;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 9.4cqi, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--accent-deep);
}

.play-lede {
  margin: 0.85rem 0 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--muted);
}

.play-lede .play-lang-name {
  font-style: italic;
  font-weight: 700;
  color: var(--ink);
}

.play-preview {
  margin-top: 0.85rem;
  padding: 1.15rem 1rem;
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--bg2) 55%, var(--bg0));
  border: 1px solid color-mix(in srgb, var(--ink) 6%, transparent);
}

.play-phrase {
  margin: 0;
  padding-top: 0.85rem;
  overflow: visible;
  text-align: center;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--accent-deep);
}

.play-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.55rem;
  min-height: 3rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  font-size: 1.02rem;
  font-weight: 700;
}

.play-meta {
  margin: 0.15rem 0 0;
  text-align: center;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.play-concept-note {
  margin: 0.2rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--muted) 85%, transparent);
}

@media (min-width: 720px) {
  body[data-page="play"] .page.play-page {
    max-width: 28rem;
    padding-top: 2rem;
  }
}

/* Puzzle layout v2: answer entry first; hide decode headline (Reset/Help stay). */
body[data-page="puzzle"][data-layout="v2"] #puzzle-heading {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] .heading-row {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] #puzzle-instructions,
body[data-page="puzzle"][data-layout="v2"] .highlight-mode-bar {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] .section-head {
  margin: 0;
  min-height: 0;
}

body[data-page="puzzle"][data-layout="v2"] .match-board {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

body[data-page="puzzle"][data-layout="v2"] .match-board > .answers-block {
  order: -2;
  margin-bottom: 0.15rem;
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

body[data-page="puzzle"][data-layout="v2"] .match-board > .clues-head {
  order: 5;
  margin-top: 0.55rem;
  margin-bottom: 0;
  padding-top: 0.4rem;
  padding-bottom: 0;
  border-bottom: 0;
  border-top: 2px solid var(--home-border, var(--ink));
}

body[data-page="puzzle"][data-layout="v2"] .match-board > .match-headers {
  order: 0;
}


body[data-page="puzzle"][data-layout="v2"] .match-board > .examples-block {
  order: 1;
}

body[data-page="puzzle"][data-layout="v2"] .match-board > .translation-meta {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] .question-pager {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] .daily-card {
  padding: 0.95rem 1.25rem 1rem;
}

body[data-page="puzzle"][data-layout="v2"] .question-prompt-lead {
  justify-content: center;
  margin-bottom: 0.28rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

body[data-page="puzzle"][data-layout="v2"] .question-prompt-block:has(.glyph-token) .question-prompt-lead {
  margin-bottom: 0.12rem;
}

body[data-page="puzzle"][data-layout="v2"] .question-prompt-lead-text {
  gap: 0.4rem;
}

body[data-page="puzzle"][data-layout="v2"] .prompt-lang-from {
  color: var(--home-source-accent, #c95f50);
}

body[data-page="puzzle"][data-layout="v2"] .prompt-lang-arrow {
  color: var(--home-muted-text, var(--muted));
  letter-spacing: 0;
}

body[data-page="puzzle"][data-layout="v2"] .prompt-lang-to {
  color: var(--home-primary, var(--accent));
}

body[data-page="puzzle"][data-layout="v2"] .question-prompt-phrase {
  font-size: clamp(1.65rem, 4.4vw, 2.05rem);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

body[data-page="puzzle"][data-layout="v2"] .question-prompt-phrase:has(.glyph-token) {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

body[data-page="puzzle"][data-layout="v2"] .letter-box {
  border-width: 2px;
  border-color: var(--home-border, color-mix(in srgb, var(--ink) 55%, var(--line)));
  border-radius: 0.35rem;
  background: #fff;
}

body[data-page="puzzle"][data-layout="v2"] .letter-word.correct .letter-box,
body[data-page="puzzle"][data-layout="v2"] .letter-box.correct {
  border-color: #2f9e5a;
}

body[data-page="puzzle"][data-layout="v2"] .letter-word.incorrect .letter-box,
body[data-page="puzzle"][data-layout="v2"] .letter-box.incorrect {
  border-color: #d94b3a;
}

body[data-page="puzzle"][data-layout="v2"] .actions.translation-actions {
  margin-top: 0;
}

body[data-page="puzzle"][data-layout="v2"] .letter-row > #btn-submit-match.btn.primary {
  align-self: center;
  flex: 0 0 auto;
  width: auto;
  height: 2.15rem;
  min-height: 2.15rem;
  margin: 0;
  padding: 0 1rem;
}

body[data-page="puzzle"][data-layout="v2"] #btn-submit-match.btn.primary {
  border: 1.5px solid var(--home-border, var(--line));
  border-radius: 999px;
  background: var(--home-pill-bg, #fff);
  color: var(--home-pill-text, var(--ink));
  box-shadow: none;
  min-height: 2.1rem;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
}

body[data-page="puzzle"][data-layout="v2"] #btn-submit-match.btn.primary:hover {
  transform: none;
  background: var(--home-pill-hover-bg, color-mix(in srgb, var(--ink) 4%, #fff));
  border-color: color-mix(in srgb, var(--home-pill-text, var(--ink)) 22%, var(--home-border, var(--line)));
  color: var(--home-pill-text, var(--ink));
  box-shadow: none;
}

.clues-head {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head > .puzzle-timer {
  grid-column: 1;
  justify-self: start;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head > .help-btn {
  grid-column: 2;
  justify-self: center;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head > .clues-end {
  grid-column: 3;
  justify-self: end;
}

body[data-page="puzzle"][data-layout="v2"] .clues-end {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

body[data-page="puzzle"][data-layout="v2"] .osk-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 999px;
  border: 1.5px solid var(--home-border, var(--line));
  background: var(--home-pill-bg, #fff);
  color: var(--home-pill-text, var(--ink));
  box-shadow: none;
  cursor: pointer;
}

body[data-page="puzzle"][data-layout="v2"] .osk-toggle[hidden] {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] .osk-toggle.is-on {
  background: var(--home-primary, var(--accent));
  border-color: var(--home-primary, var(--accent));
  color: var(--home-button-text, #fff);
}

body[data-page="puzzle"][data-layout="v2"] .clues-title {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head .phenomenon-badges {
  order: 0;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head .hints-btn {
  margin: 0;
  flex-shrink: 0;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head .puzzle-timer {
  margin: 0;
  flex-shrink: 0;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head .hints-btn.btn.primary {
  background: var(--home-pill-bg, #fff);
  color: var(--home-pill-text, var(--ink));
  border: 1.5px solid var(--home-border, var(--line));
  border-radius: 999px;
  box-shadow: none;
  min-height: 2.1rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 650;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head .hints-btn.btn.primary:hover {
  background: var(--home-pill-hover-bg, color-mix(in srgb, var(--ink) 4%, #fff));
}

body[data-page="puzzle"][data-layout="v2"] .clues-head .hints-btn .hint-count {
  background: color-mix(in srgb, var(--home-pill-text, var(--ink)) 12%, transparent);
  color: var(--home-pill-text, var(--ink));
}

body[data-page="puzzle"][data-layout="v2"] .clues-head .hints-pop {
  position: absolute;
  grid-column: 1 / -1;
  grid-row: 1;
  bottom: calc(100% + 0.35rem);
  top: auto;
  right: 0;
  z-index: 40;
  width: min(22rem, calc(100vw - 2rem));
  margin: 0;
}

body[data-page="puzzle"][data-layout="v2"] .clues-head .hints-pop.is-desktop-tall {
  position: fixed;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  margin: 0;
  box-shadow: 0 12px 32px rgba(20, 24, 20, 0.16);
  background: var(--bg1, #fff);
}

/* JS pins this on phones / coarse pointers so the panel isn't clipped by the card */
body[data-page="puzzle"] .hints-pop.is-sheet {
  position: fixed;
  z-index: 40;
  margin: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.65rem 2.2rem 0.85rem 0.85rem;
  border-width: 2px;
  box-shadow: 0 12px 32px rgba(20, 24, 20, 0.18);
}

body[data-page="puzzle"] .hints-pop.is-sheet .hints-pop-title {
  font-size: 0.85rem;
}

body[data-page="puzzle"] .hints-pop.is-sheet .hint-option {
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.45rem;
}

body[data-page="puzzle"] .hints-pop.is-sheet .hint-structure-body {
  font-size: 0.95rem;
}

body[data-page="puzzle"][data-layout="v2"] .match-headers {
  border-bottom: 2px solid var(--home-border, var(--ink));
  padding-bottom: 0.16rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
}

body[data-page="puzzle"][data-layout="v2"] .match-headers .column-stack[data-column="language"] {
  justify-self: start;
  min-width: 0;
}

body[data-page="puzzle"][data-layout="v2"] .match-headers .column-stack[data-column="english"] {
  grid-column: 3;
  justify-self: end;
  margin-left: 0;
}

body[data-page="puzzle"][data-layout="v2"] .match-header-submit {
  grid-column: 2;
  justify-self: center;
}

body[data-page="puzzle"][data-layout="v2"] .column-head h3 {
  color: var(--home-muted-text, var(--muted));
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

body[data-page="puzzle"][data-layout="v2"] #match-rows .match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.15rem minmax(0, 1fr);
  gap: 0.35rem;
  border-top: 1px solid color-mix(in srgb, var(--home-border, var(--line)) 55%, transparent);
  padding: 0.2rem 0;
  align-items: start;
}

body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item {
  padding: 0;
}

body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text {
  font-family: var(--font-language);
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
}

body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text .token[class*="hl-"] {
  padding: 0.04em 0.08em;
}

body[data-page="puzzle"][data-layout="v2"] #match-rows .match-row:first-child {
  border-top: 0;
}

body[data-page="puzzle"][data-layout="v2"] #match-rows .match-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  padding-top: 0.05em;
  visibility: visible;
}

body[data-page="puzzle"][data-layout="v2"] #match-rows .match-mark:empty::before {
  content: "→";
  color: var(--home-source-accent, #c95f50);
  font-size: 0.95rem;
  font-weight: 700;
}

body[data-page="puzzle"][data-layout="v2"] .translation-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  grid-template-columns: none;
}

body[data-page="puzzle"][data-layout="v2"] .translation-meta .puzzle-timer {
  justify-self: auto;
}

body[data-page="puzzle"] .chrome-btn.help-btn {
  width: 2.1rem;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
}

body[data-page="puzzle"][data-layout="v2"] .chrome-btn.help-btn {
  width: 2.1rem;
  min-width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
}

.help-btn-label {
  display: none;
}

body[data-page="puzzle"][data-layout="v2"] .reset-btn,
body[data-page="puzzle"][data-layout="v2"] .save-btn,
body[data-page="puzzle"][data-layout="v2"] .close-btn {
  border-radius: 999px;
  border-width: 1.5px;
  height: 2.1rem;
}

@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-layout="v2"] .daily-card {
    padding: 0.55rem 0.55rem 0.7rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .match-board {
    gap: 0.2rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .question-prompt-block {
    margin: 0.08rem 0 0.28rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .question-prompt-lead {
    margin-bottom: 0.15rem;
    font-size: 0.78rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .question-prompt-block:has(.glyph-token) .question-prompt-lead {
    margin-bottom: 0.08rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .question-prompt-phrase {
    font-size: clamp(1.3rem, 5.2vw, 1.55rem);
    margin-bottom: 0.28rem;
    line-height: 1.18;
  }

  body[data-page="puzzle"][data-layout="v2"] .question-prompt-phrase:has(.glyph-token) {
    font-size: 0.88rem;
    margin-bottom: 0.16rem;
    line-height: 1.35;
  }

  body[data-page="puzzle"][data-layout="v2"] .letter-row {
    gap: 0.3rem 0.6rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .letter-row.letter-row-hidden-breaks {
    gap: 0.28rem 0.32rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .glyph-answer-row {
    gap: 0.4rem 0.65rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .letter-box {
    flex-basis: 1.6rem;
    width: 1.6rem !important;
    min-width: 1.35rem;
    max-width: 1.6rem;
    height: 1.65rem;
    line-height: 1.65rem;
    font-size: 1.05rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .letter-run .letter-box,
  body[data-page="puzzle"][data-layout="v2"] .letter-word .letter-box {
    flex: 0 1 1.6rem;
    min-width: 1.15rem;
    max-width: 1.6rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .actions.translation-actions {
    margin-top: 0;
  }

  body[data-page="puzzle"][data-layout="v2"] .letter-row > #btn-submit-match.btn.primary {
    height: 1.65rem;
    min-height: 1.65rem;
    min-width: 0;
    max-width: none;
    padding: 0 0.85rem;
    font-size: 0.82rem;
  }

  body[data-page="puzzle"][data-layout="v2"] #match-rows .match-row {
    /* No arrow column on small screens — more width for English, fewer wraps. */
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.18fr);
    gap: 0.35rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .match-headers {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.35rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .column-head {
    padding: 0.02rem 0.02rem 0.02rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .column-head:has(.glyph-view-toggle) {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    width: auto;
  }

  body[data-page="puzzle"][data-layout="v2"] .glyph-view-toggle {
    margin-top: 0;
    flex-shrink: 0;
  }

  body[data-page="puzzle"][data-layout="v2"] .glyph-view-btn {
    padding: 0.1rem 0.42rem;
    font-size: 0.72rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .column-head h3 {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
  }

  body[data-page="puzzle"][data-layout="v2"] #match-rows .match-row {
    padding: 0.14rem 0;
    border-top-color: color-mix(in srgb, var(--home-border, var(--line)) 40%, transparent);
  }

  body[data-page="puzzle"][data-layout="v2"] #match-rows .match-mark,
  body[data-page="puzzle"][data-layout="v2"] #match-rows .match-mark:empty {
    display: none;
    visibility: hidden;
  }

  body[data-page="puzzle"][data-layout="v2"] #match-rows .match-mark:empty::before {
    content: none;
  }

  body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item {
    padding: 0;
  }

  body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text {
    font-family: var(--font-language);
    font-size: 0.88rem;
    line-height: 1.35;
    font-weight: 500;
  }

  body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text .token[class*="hl-"] {
    padding: 0.03em 0.06em;
  }

  body.has-osk[data-page="puzzle"][data-layout="v2"] #match-rows .match-row {
    padding: 0.1rem 0;
  }

  body.has-osk[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text {
    font-size: 0.86rem;
    line-height: 1.32;
  }

  body[data-page="puzzle"][data-layout="v2"] .clues-head,
  body[data-page="puzzle"][data-layout="v2"] .match-board > .clues-head {
    gap: 0.35rem;
    margin-top: 0.35rem;
    margin-bottom: 0;
    padding-top: 0.28rem;
    padding-bottom: 0;
  }

  body[data-page="puzzle"][data-layout="v2"] .clues-head .puzzle-timer {
    min-height: 1.95rem;
    height: 1.95rem;
    padding: 0 0.55rem 0 0.4rem;
    font-size: 0.78rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .clues-head .hints-btn.btn.primary {
    padding: 0.32rem 0.6rem;
    font-size: 0.84rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .match-board > .translation-meta {
    margin-top: 0.28rem;
  }

  body[data-page="puzzle"][data-layout="v2"] .help-btn-label {
    font-size: 0.88rem;
  }
}

body[data-page="puzzle"] .column-head:has(.glyph-switch),
body[data-page="puzzle"] .column-head:has(.glyph-view-toggle),
body[data-page="puzzle"] .column-head:has(.glyph-entry) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

body[data-page="puzzle"][data-layout="v2"] .match-headers .column-stack[data-column="english"] .column-head {
  justify-self: end;
}

body[data-page="puzzle"][data-layout="v2"] .column-head:has(.glyph-view-toggle) {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  width: auto;
}

body[data-page="puzzle"][data-layout="v2"] .column-head:has(.glyph-view-toggle) h3 {
  white-space: nowrap;
}

body[data-page="puzzle"][data-layout="v2"] .glyph-view-toggle {
  margin-top: 0;
  flex-shrink: 0;
}
.glyph-entry {
  margin-top: 0.35rem;
  font: 600 0.78rem/1.2 Inter, system-ui, sans-serif;
  color: #7a3e2e;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}
.glyph-switch {
  display: block;
  margin-top: 0.35rem;
}
.glyph-switch-select {
  appearance: auto;
  max-width: 100%;
  border: 1px solid var(--line, #d9d0c4);
  border-radius: 999px;
  background: #fffdf8;
  color: inherit;
  padding: 0.28rem 0.7rem;
  font: 600 0.8rem/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.glyph-view-toggle {
  display: inline-flex;
  margin-top: 0.35rem;
  border: 1px solid var(--line, #d9d0c4);
  border-radius: 999px;
  overflow: hidden;
  background: #fffdf8;
}
.glyph-view-btn {
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.22rem 0.7rem;
  font: 600 0.78rem/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.glyph-view-btn + .glyph-view-btn {
  border-left: 1px solid var(--line, #d9d0c4);
}
.glyph-view-btn.is-active {
  background: var(--accent, #7a3e2e);
  color: #fffdf8;
}
.glyph-token {
  display: inline-flex;
  align-items: flex-end;
  vertical-align: bottom;
  line-height: 1;
  color: #2a2118;
}
/* Puzzle glyphs follow the theme ink. The brown above is manuscript ink for
   light paper, and it disappears on dark puzzle cards. Home keeps the brown.
   Keyboard keys stay a light strip, so marks there keep the key ink. */
body[data-page="puzzle"] .glyph-token,
body[data-page="puzzle"] .reveal-glyph,
body[data-page="puzzle"] .glyph-answer-slot {
  color: var(--ink);
}
body[data-page="puzzle"] .osk-key .glyph-token {
  color: inherit;
}
body[data-page="puzzle"] .glyph-answer-slot.is-hinted {
  color: #2a2118;
}
body[data-page="puzzle"] .glyph-answer-slot.is-active {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
}
.glyph-unit {
  display: inline-flex;
  align-items: flex-end;
  border-radius: 5px;
  padding: 1px 2px;
}
.glyph-root,
.glyph-aff {
  display: block;
  overflow: visible;
}
.glyph-root { width: 2.15rem; height: 2.75rem; }
.glyph-aff { width: 1.25rem; height: 2.45rem; }
.skin-star .glyph-root { width: 2.2rem; height: 2.75rem; }
.skin-ribbon .glyph-root { width: 2.35rem; height: 2.4rem; }
.skin-wire .glyph-root { width: 2.05rem; height: 2.7rem; }
 .glyph-root { width: 2.15rem; height: 2.7rem; }
.skin-coin .glyph-root { width: 2.35rem; height: 2.35rem; }
.skin-coin .glyph-aff,
.skin-sun .glyph-aff,
.skin-orbit .glyph-aff { width: 1.18rem; height: 1.18rem; }
#match-rows .glyph-root { height: 2.3rem; }
#match-rows .glyph-aff { height: 2.05rem; }
#match-rows .skin-star .glyph-root { height: 2.3rem; }
#match-rows .skin-ribbon .glyph-root { height: 2.05rem; }
#match-rows .skin-wire .glyph-root { height: 2.25rem; }
#match-rows  .glyph-root { height: 2.25rem; }
#match-rows .skin-coin .glyph-root,
#match-rows .skin-sun .glyph-root,
#match-rows .skin-orbit .glyph-root { height: 2rem; }
#match-rows .skin-coin .glyph-aff,
#match-rows .skin-sun .glyph-aff,
#match-rows .skin-orbit .glyph-aff { width: 1rem; height: 1rem; }
.glyph-answer-slot .glyph-root { width: 2.15rem; height: 2.3rem; }
.glyph-answer-slot .skin-star .glyph-root { width: 2.2rem; height: 2.3rem; }
.glyph-answer-slot .skin-ribbon .glyph-root { width: 2.35rem; height: 2.05rem; }
.glyph-answer-slot .skin-wire .glyph-root { width: 2.05rem; height: 2.25rem; }
.glyph-answer-slot  .glyph-root { width: 2.15rem; height: 2.25rem; }
.glyph-answer-slot .skin-coin .glyph-root,
.glyph-answer-slot .skin-sun .glyph-root,
.glyph-answer-slot .skin-orbit .glyph-root { width: 2.35rem; height: 2rem; }
.glyph-answer-slot .glyph-aff { width: 1.25rem; height: 2.05rem; }
.glyph-answer-slot .skin-coin .glyph-aff,
.glyph-answer-slot .skin-sun .glyph-aff,
.glyph-answer-slot .skin-orbit .glyph-aff { width: 1rem; height: 1rem; }
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .glyph-token {
  align-items: flex-end;
  vertical-align: bottom;
  min-width: 0;
  min-height: 0;
}
body[data-page="puzzle"][data-layout="v2"][data-glyph] #match-rows .match-cell[data-column="language"] .sentence-item .text {
  line-height: 1;
}
body[data-page="puzzle"][data-glyph] #match-rows .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] #match-rows .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] #match-rows .glyph-unit.has-corner,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .glyph-unit.has-corner {
  margin: 0;
}
body[data-page="puzzle"] .question-prompt-phrase .glyph-token {
  margin: 0 0.2rem;
}
body[data-page="puzzle"] .question-prompt-phrase .glyph-root {
  width: 2.15rem;
  height: 2.3rem;
}
body[data-page="puzzle"] .question-prompt-phrase .glyph-aff {
  width: 1.25rem;
  height: 2.05rem;
}
body[data-page="puzzle"] .question-prompt-phrase .skin-coin .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-sun .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-orbit .glyph-root {
  width: 2rem;
  height: 2rem;
}
body[data-page="puzzle"] .question-prompt-phrase .skin-coin .glyph-aff,
body[data-page="puzzle"] .question-prompt-phrase .skin-sun .glyph-aff,
body[data-page="puzzle"] .question-prompt-phrase .skin-orbit .glyph-aff {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-layout="v2"][data-glyph] #match-rows .match-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr);
    gap: 0.28rem;
  }

  body[data-page="puzzle"][data-layout="v2"][data-glyph] .match-headers {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.28rem;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .match-row {
    padding-top: 0.04rem;
    padding-bottom: 0.04rem;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .text {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    column-gap: 0.15rem;
    min-width: 0;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .text .glyph-token {
    flex: 0 0 auto;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .sentence-item .text.is-glyph-wrap {
    flex-wrap: wrap;
    row-gap: 0.2rem;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .glyph-unit,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .glyph-unit {
    padding: 0;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .glyph-root,
  body[data-page="puzzle"] .question-prompt-phrase .glyph-root {
    width: 1.75rem;
    height: 2.15rem;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .glyph-aff,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .glyph-aff,
  body[data-page="puzzle"] .question-prompt-phrase .glyph-aff {
    width: 1.15rem;
    height: 1.9rem;
  }

  body[data-page="puzzle"][data-glyph] .glyph-answer-slot {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 2.55rem;
    height: 2.7rem;
    min-width: 2.55rem;
    max-width: 2.55rem;
    min-height: 2.7rem;
    max-height: 2.7rem;
    padding: 0;
  }

  body[data-page="puzzle"][data-glyph] .glyph-answer-slot:has(.glyph-aff) {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .skin-ribbon .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-ribbon .glyph-root {
    width: 1.6rem;
    height: 1.65rem;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .skin-coin .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-sun .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-orbit .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-coin .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-sun .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-orbit .glyph-root {
    width: 1.45rem;
    height: 1.45rem;
  }
  body[data-page="puzzle"][data-glyph] #match-rows .skin-coin .glyph-aff,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-sun .glyph-aff,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-orbit .glyph-aff,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-coin .glyph-aff,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-sun .glyph-aff,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-orbit .glyph-aff {
    width: 0.72rem;
    height: 0.72rem;
  }

  body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="english"] .text {
    font-size: 0.84rem;
    line-height: 1.85;
  }

  body.has-osk[data-glyph] .osk {
    gap: 0.16rem;
    padding-top: 0.22rem;
    padding-bottom: calc(0.22rem + env(safe-area-inset-bottom, 0px));
  }

  body.has-osk[data-glyph] .osk-row.glyph-keys {
    flex-wrap: wrap;
    gap: 0.22rem;
  }

  body.has-osk[data-glyph] .osk-key.osk-glyph {
    flex: 0 0 2.85rem;
    width: 2.85rem;
    min-width: 2.85rem;
    max-width: 2.85rem;
    height: 2.75rem;
  }

  .osk-row.glyph-keys .osk-key.osk-dismiss {
    flex-basis: 2.85rem;
    width: 2.85rem;
    min-width: 2.85rem;
    height: 2.75rem;
  }

  body.has-osk[data-glyph] .osk-key.osk-glyph .glyph-root {
    width: auto;
    height: 90%;
    max-width: 94%;
  }

  body.has-osk[data-glyph] .osk-key.osk-glyph .glyph-aff {
    width: auto;
    height: 78%;
    max-width: 70%;
  }

  body.has-osk[data-glyph] .osk-key.osk-glyph .glyph-aff.osk-mark {
    width: auto;
    height: 76%;
    max-width: 84%;
  }

  body.has-osk[data-page="puzzle"][data-layout="v2"][data-glyph] .question-prompt-phrase:has(.glyph-token) {
    margin-bottom: 0.1rem;
    font-size: 0.86rem;
  }

  body.has-osk[data-page="puzzle"][data-layout="v2"][data-glyph] .actions.translation-actions {
    margin-top: 0;
  }

  body.has-osk[data-page="puzzle"][data-layout="v2"][data-glyph] .letter-row > #btn-submit-match.btn.primary {
    height: 1.65rem;
    min-height: 1.65rem;
    padding: 0 0.85rem;
  }
}

body[data-glyph] .glyph-aff,
body[data-glyph] .glyph-root,
.token[class*="hl-"] .glyph-aff,
.token[class*="hl-"] .glyph-root {
  background: none;
}
.glyph-root.glyph-echo {
  transform: scale(0.62);
  transform-origin: center bottom;
}
body[data-glyph] .glyph-root.glyph-turn,
body[data-glyph] .glyph-aff.glyph-turn,
.osk-key.is-rotate .glyph-aff {
  transform: rotate(180deg);
  transform-origin: center center;
}
body[data-glyph] .glyph-root.glyph-flip,
body[data-glyph] .glyph-aff.glyph-flip,
.osk-key.is-reflect .glyph-aff {
  transform: scaleX(-1);
  transform-origin: center center;
}
body[data-glyph] .glyph-root.glyph-turn.glyph-flip {
  transform: scaleX(-1) rotate(180deg);
}
body[data-glyph] .glyph-root.glyph-echo.glyph-turn {
  transform: scale(0.62) rotate(180deg);
  transform-origin: center center;
}
body[data-glyph] .glyph-root.glyph-echo.glyph-flip {
  transform: scale(0.62) scaleX(-1);
  transform-origin: center center;
}
body[data-glyph] .glyph-aff.glyph-above,
body[data-glyph] .glyph-aff.glyph-below,
body[data-glyph] .glyph-aff.glyph-corner,
body[data-glyph] .glyph-aff.glyph-inside,
body[data-page="puzzle"][data-glyph] #match-rows .glyph-aff.glyph-above,
body[data-page="puzzle"][data-glyph] #match-rows .glyph-aff.glyph-below,
body[data-page="puzzle"][data-glyph] #match-rows .glyph-aff.glyph-corner,
body[data-page="puzzle"][data-glyph] #match-rows .glyph-aff.glyph-inside,
body[data-page="puzzle"] .question-prompt-phrase .glyph-aff.glyph-above,
body[data-page="puzzle"] .question-prompt-phrase .glyph-aff.glyph-below,
body[data-page="puzzle"] .question-prompt-phrase .glyph-aff.glyph-corner,
body[data-page="puzzle"] .question-prompt-phrase .glyph-aff.glyph-inside,
body[data-page="play"] .play-phrase .glyph-aff.glyph-above,
body[data-page="play"] .play-phrase .glyph-aff.glyph-below,
body[data-page="play"] .play-phrase .glyph-aff.glyph-corner,
body[data-page="play"] .play-phrase .glyph-aff.glyph-inside {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  transform: none;
  align-self: center;
  margin: 0 0.04rem;
  background: none;
}
.reveal-glyph-line {
  display: inline-flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.08rem 0.14rem;
  vertical-align: bottom;
}
.reveal-glyph {
  display: inline-flex;
  align-items: flex-end;
  vertical-align: -0.45em;
  margin: 0 0.1rem;
  gap: 0.06rem;
}
.reveal-glyph-line .reveal-glyph {
  margin: 0;
  vertical-align: bottom;
}
.reveal-glyph .glyph-unit,
body[data-page="puzzle"] #reveal .glyph-unit {
  position: relative;
  box-sizing: content-box;
  padding: 0;
}
body[data-page="puzzle"] #reveal .glyph-aff.glyph-above,
body[data-page="puzzle"] #reveal .glyph-aff.glyph-below,
body[data-page="puzzle"] #reveal .glyph-aff.glyph-corner,
body[data-page="puzzle"] #reveal .glyph-aff.glyph-inside {
  position: absolute;
  margin: 0;
  align-self: auto;
}
body[data-page="puzzle"] #reveal .glyph-aff.glyph-above {
  left: 50%;
  top: 0;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -100%);
}
body[data-page="puzzle"] #reveal .glyph-aff.glyph-below {
  left: 50%;
  bottom: 0;
  top: auto;
  right: auto;
  transform: translate(-50%, 100%);
}
body[data-page="puzzle"] #reveal .glyph-aff.glyph-corner {
  top: 0;
  right: 0;
  left: auto;
  bottom: auto;
  transform: translate(62%, -62%);
}
.reveal-glyph.skin-v2 .glyph-aff:not(.glyph-salt) {
  width: 0.72rem;
  height: 0.72rem;
}
.reveal-glyph .glyph-root {
  width: 1.15rem;
  height: 1.5rem;
}
.reveal-glyph .glyph-aff {
  width: 0.95rem;
  height: 0.95rem;
}
.reveal-glyph.skin-coin .glyph-root,
.reveal-glyph.skin-sun .glyph-root,
.reveal-glyph.skin-orbit .glyph-root {
  width: 1.2rem;
  height: 1.2rem;
}

.skin-burmese { --g-aspect: 1.222; }
.skin-sinhala { --g-aspect: 0.944; }
.skin-georgian { --g-aspect: 0.611; }
.skin-tagalog { --g-aspect: 0.722; }
.skin-hanacaraka { --g-aspect: 1.167; }
.skin-burmese .glyph-root,
.skin-sinhala .glyph-root,
.skin-georgian .glyph-root,
.skin-tagalog .glyph-root,
.skin-hanacaraka .glyph-root {
  height: 2.75rem;
  width: calc(2.75rem * var(--g-aspect));
}
#match-rows .skin-burmese .glyph-root,
#match-rows .skin-sinhala .glyph-root,
#match-rows .skin-georgian .glyph-root,
#match-rows .skin-tagalog .glyph-root,
#match-rows .skin-hanacaraka .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
body[data-page="puzzle"] .question-prompt-phrase .skin-burmese .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-sinhala .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-georgian .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-tagalog .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-hanacaraka .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
.glyph-answer-slot .skin-burmese .glyph-root,
.glyph-answer-slot .skin-sinhala .glyph-root,
.glyph-answer-slot .skin-georgian .glyph-root,
.glyph-answer-slot .skin-tagalog .glyph-root,
.glyph-answer-slot .skin-hanacaraka .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
.osk-key.osk-glyph .skin-burmese .glyph-root,
.osk-key.osk-glyph .skin-sinhala .glyph-root,
.osk-key.osk-glyph .skin-georgian .glyph-root,
.osk-key.osk-glyph .skin-tagalog .glyph-root,
.osk-key.osk-glyph .skin-hanacaraka .glyph-root {
  height: 2.85rem;
  width: calc(2.85rem * var(--g-aspect));
}
.reveal-glyph.skin-burmese .glyph-root,
.reveal-glyph.skin-sinhala .glyph-root,
.reveal-glyph.skin-georgian .glyph-root,
.reveal-glyph.skin-tagalog .glyph-root,
.reveal-glyph.skin-hanacaraka .glyph-root {
  height: 1.5rem;
  width: calc(1.5rem * var(--g-aspect));
}
@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-glyph] #match-rows .skin-burmese .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-sinhala .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-georgian .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-tagalog .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-hanacaraka .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-burmese .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-sinhala .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-georgian .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-tagalog .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-hanacaraka .glyph-root,
  body[data-page="puzzle"] .question-prompt-phrase .skin-burmese .glyph-root,
  body[data-page="puzzle"] .question-prompt-phrase .skin-sinhala .glyph-root,
  body[data-page="puzzle"] .question-prompt-phrase .skin-georgian .glyph-root,
  body[data-page="puzzle"] .question-prompt-phrase .skin-tagalog .glyph-root,
  body[data-page="puzzle"] .question-prompt-phrase .skin-hanacaraka .glyph-root {
    height: 2.15rem;
    width: calc(2.15rem * var(--g-aspect));
  }
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-burmese .glyph-root,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-sinhala .glyph-root,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-georgian .glyph-root,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-tagalog .glyph-root,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-hanacaraka .glyph-root {
    height: 1.7rem;
    width: calc(1.7rem * var(--g-aspect));
  }
  body[data-page="puzzle"][data-glyph] #match-rows :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff,
  body[data-page="puzzle"] .question-prompt-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff {
    width: 1.05rem;
    height: 1.05rem;
  }
}

/* Grammar marks need to stay readable next to the letter. Above and below sit clear of it. */
:is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff {
  width: 1.2rem;
  height: 1.2rem;
}
#match-rows :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff,
.glyph-answer-slot :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff {
  width: 1.1rem;
  height: 1.1rem;
}
body[data-page="puzzle"] .question-prompt-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff {
  width: 1.1rem;
  height: 1.1rem;
}
body[data-glyph] :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] #match-rows :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-unit.has-above,
body[data-page="puzzle"] .question-prompt-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-unit.has-above,
body[data-page="play"] .play-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-unit.has-above {
  position: relative;
  margin-top: 1.25rem;
}
body[data-glyph] :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] #match-rows :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-unit.has-below,
body[data-page="puzzle"] .question-prompt-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-unit.has-below,
body[data-page="play"] .play-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-unit.has-below {
  position: relative;
  margin-bottom: 1.15rem;
}
body[data-glyph] :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.glyph-above,
body[data-page="puzzle"][data-glyph] #match-rows :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.glyph-above,
body[data-page="puzzle"] .question-prompt-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.glyph-above,
body[data-page="play"] .play-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.glyph-above {
  position: absolute;
  left: 50%;
  top: 0;
  right: auto;
  bottom: auto;
  margin: 0;
  transform: translate(-50%, -110%);
  align-self: auto;
}
body[data-glyph] :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.glyph-below,
body[data-page="puzzle"][data-glyph] #match-rows :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.glyph-below,
body[data-page="puzzle"] .question-prompt-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.glyph-below,
body[data-page="play"] .play-phrase :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.glyph-below {
  position: absolute;
  left: 50%;
  bottom: 0;
  top: auto;
  right: auto;
  margin: 0;
  transform: translate(-50%, 110%);
  align-self: auto;
}
body[data-glyph] .osk-key.osk-glyph :is(.skin-burmese, .skin-sinhala, .skin-georgian, .skin-tagalog, .skin-hanacaraka, .skin-nushu, .skin-quipu, .skin-hangul, .skin-rongorongo, .skin-mandombe, .skin-bengali, .skin-amharic, .skin-inuktitut, .skin-brush, .skin-seed, .skin-crescent) .glyph-aff.osk-mark {
  width: 1.15rem;
  height: 1.15rem;
}

.skin-nushu { --g-aspect: 1.111; }
.skin-quipu { --g-aspect: 0.5; }
.skin-hangul { --g-aspect: 0.889; }
.skin-rongorongo { --g-aspect: 0.833; }
.skin-mandombe { --g-aspect: 1; }
.skin-bengali { --g-aspect: 1.25; }
.skin-amharic { --g-aspect: 0.5; }
.skin-inuktitut { --g-aspect: 1; }
.skin-brush { --g-aspect: 1.467; }
.skin-seed { --g-aspect: 0.944; }
.skin-crescent { --g-aspect: 1; }
.skin-nushu .glyph-root,
.skin-quipu .glyph-root,
.skin-hangul .glyph-root,
.skin-rongorongo .glyph-root,
.skin-mandombe .glyph-root,
.skin-bengali .glyph-root,
.skin-amharic .glyph-root,
.skin-inuktitut .glyph-root,
.skin-brush .glyph-root,
.skin-seed .glyph-root,
.skin-crescent .glyph-root {
  height: 2.75rem;
  width: calc(2.75rem * var(--g-aspect));
}
#match-rows .skin-nushu .glyph-root,
#match-rows .skin-quipu .glyph-root,
#match-rows .skin-hangul .glyph-root,
#match-rows .skin-rongorongo .glyph-root,
#match-rows .skin-mandombe .glyph-root,
.skin-bengali .glyph-root,
.skin-amharic .glyph-root,
.skin-inuktitut .glyph-root,
.skin-brush .glyph-root,
.skin-seed .glyph-root,
.skin-crescent .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
body[data-page="puzzle"] .question-prompt-phrase .skin-nushu .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-quipu .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-hangul .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-rongorongo .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-mandombe .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-bengali .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-amharic .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-inuktitut .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-brush .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-seed .glyph-root,
body[data-page="puzzle"] .question-prompt-phrase .skin-crescent .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
.glyph-answer-slot .skin-nushu .glyph-root,
.glyph-answer-slot .skin-quipu .glyph-root,
.glyph-answer-slot .skin-hangul .glyph-root,
.glyph-answer-slot .skin-rongorongo .glyph-root,
.glyph-answer-slot .skin-mandombe .glyph-root,
.glyph-answer-slot .skin-bengali .glyph-root,
.glyph-answer-slot .skin-amharic .glyph-root,
.glyph-answer-slot .skin-inuktitut .glyph-root,
.glyph-answer-slot .skin-brush .glyph-root,
.glyph-answer-slot .skin-seed .glyph-root,
.glyph-answer-slot .skin-crescent .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
.osk-key.osk-glyph .skin-nushu .glyph-root,
.osk-key.osk-glyph .skin-quipu .glyph-root,
.osk-key.osk-glyph .skin-hangul .glyph-root,
.osk-key.osk-glyph .skin-rongorongo .glyph-root,
.osk-key.osk-glyph .skin-mandombe .glyph-root,
.skin-bengali .glyph-root,
.skin-amharic .glyph-root,
.skin-inuktitut .glyph-root,
.skin-brush .glyph-root,
.skin-seed .glyph-root,
.skin-crescent .glyph-root {
  height: 2.85rem;
  width: calc(2.85rem * var(--g-aspect));
}
.reveal-glyph.skin-nushu .glyph-root,
.reveal-glyph.skin-quipu .glyph-root,
.reveal-glyph.skin-hangul .glyph-root,
.reveal-glyph.skin-rongorongo .glyph-root,
.reveal-glyph.skin-mandombe .glyph-root,
.skin-bengali .glyph-root,
.skin-amharic .glyph-root,
.skin-inuktitut .glyph-root,
.skin-brush .glyph-root,
.skin-seed .glyph-root,
.skin-crescent .glyph-root {
  height: 1.5rem;
  width: calc(1.5rem * var(--g-aspect));
}
@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-glyph] #match-rows .skin-nushu .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-quipu .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-hangul .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-rongorongo .glyph-root,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-mandombe .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-nushu .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-quipu .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-hangul .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-rongorongo .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-mandombe .glyph-root,
.skin-bengali .glyph-root,
.skin-amharic .glyph-root,
.skin-inuktitut .glyph-root,
.skin-brush .glyph-root,
.skin-seed .glyph-root,
.skin-crescent .glyph-root {
    height: 2.15rem;
    width: calc(2.15rem * var(--g-aspect));
  }
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-nushu .glyph-root,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-quipu .glyph-root,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-hangul .glyph-root,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-rongorongo .glyph-root,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-mandombe .glyph-root,
.skin-bengali .glyph-root,
.skin-amharic .glyph-root,
.skin-inuktitut .glyph-root,
.skin-brush .glyph-root,
.skin-seed .glyph-root,
.skin-crescent .glyph-root {
    height: 1.7rem;
    width: calc(1.7rem * var(--g-aspect));
  }
}

.skin-shadow { --g-aspect: 1; }
.skin-map { --g-aspect: 1.375; }
.skin-arch { --g-aspect: 0.652; }
.skin-mosaic { --g-aspect: 1; }
.skin-crystal { --g-aspect: 0.714; }
.skin-plant { --g-aspect: 0.8; }
.skin-clock { --g-aspect: 1; }
.skin-reef { --g-aspect: 1; }
.skin-vessel { --g-aspect: 0.727; }
.skin-fossil { --g-aspect: 0.85; }
.skin-herald { --g-aspect: 1.25; }
.skin-ink { --g-aspect: 1.467; }
.skin-logogram .glyph-root {
  height: 2.75rem;
  width: calc(2.75rem * var(--g-aspect));
}
#match-rows .skin-logogram .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
.glyph-answer-slot .skin-logogram .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
.glyph-answer-slot .skin-logogram .glyph-aff {
  width: 1.05rem;
  height: 1.05rem;
}
.osk-key.osk-glyph .skin-logogram .glyph-root {
  height: 2.85rem;
  width: calc(2.85rem * var(--g-aspect));
}
.reveal-glyph.skin-logogram .glyph-root {
  height: 1.5rem;
  width: calc(1.5rem * var(--g-aspect));
}
.skin-logogram .glyph-aff {
  width: 1.05rem;
  height: 1.05rem;
}
body[data-glyph] .skin-logogram .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-unit.has-above,
body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-unit.has-above,
body[data-page="play"] .play-phrase .skin-logogram .glyph-unit.has-above {
  position: relative;
  margin-top: 1.25rem;
}
body[data-glyph] .skin-logogram .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-unit.has-below,
body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-unit.has-below,
body[data-page="play"] .play-phrase .skin-logogram .glyph-unit.has-below {
  position: relative;
  margin-bottom: 1.15rem;
}
body[data-glyph] .skin-logogram .glyph-aff.glyph-above,
body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-aff.glyph-above,
body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-aff.glyph-above,
body[data-page="play"] .play-phrase .skin-logogram .glyph-aff.glyph-above {
  position: absolute;
  left: 50%;
  top: 0;
  right: auto;
  bottom: auto;
  margin: 0;
  transform: translate(-50%, -110%);
  align-self: auto;
}
body[data-glyph] .skin-logogram .glyph-aff.glyph-below,
body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-aff.glyph-below,
body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-aff.glyph-below,
body[data-page="play"] .play-phrase .skin-logogram .glyph-aff.glyph-below {
  position: absolute;
  left: 50%;
  bottom: 0;
  top: auto;
  right: auto;
  margin: 0;
  transform: translate(-50%, 110%);
  align-self: auto;
}
body[data-glyph] .skin-logogram .glyph-unit:has(.glyph-corner),
body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-unit:has(.glyph-corner),
body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-unit:has(.glyph-corner),
body[data-page="play"] .play-phrase .skin-logogram .glyph-unit:has(.glyph-corner) {
  position: relative;
}
body[data-glyph] .skin-logogram .glyph-aff.glyph-corner,
body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-aff.glyph-corner,
body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-aff.glyph-corner,
body[data-page="play"] .play-phrase .skin-logogram .glyph-aff.glyph-corner {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  bottom: auto;
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
  transform: translate(22%, -48%);
  align-self: auto;
}
@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-logogram .glyph-root,
  body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-root {
    height: 2.15rem;
    width: calc(2.15rem * var(--g-aspect));
  }
}

/* Carved and new families: an above mark sits on the top of the letter. */
body.glyph-diacritic .skin-diacritic .glyph-unit,
.skin-diacritic .glyph-unit {
  position: relative;
  align-items: flex-end;
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-above,
body[data-page="play"] .play-phrase .skin-diacritic .glyph-unit.has-above,
body.glyph-diacritic .skin-diacritic .glyph-unit.has-above {
  margin-top: 1.2rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-stack-above,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-stack-above,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-stack-above,
body[data-page="play"] .play-phrase .skin-diacritic .glyph-unit.has-stack-above,
body.glyph-diacritic .skin-diacritic .glyph-unit.has-stack-above {
  margin-top: 2.4rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-below,
body[data-page="play"] .play-phrase .skin-diacritic .glyph-unit.has-below,
body.glyph-diacritic .skin-diacritic .glyph-unit.has-below {
  margin-bottom: 1.2rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-stack-below,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-stack-below,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-stack-below,
body[data-page="play"] .play-phrase .skin-diacritic .glyph-unit.has-stack-below,
body.glyph-diacritic .skin-diacritic .glyph-unit.has-stack-below {
  margin-bottom: 2.4rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-shoulder,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-shoulder,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-shoulder,
body[data-page="play"] .play-phrase .skin-diacritic .glyph-unit.has-shoulder,
body.glyph-diacritic .skin-diacritic .glyph-unit.has-shoulder {
  margin-top: 0.7rem;
}
body.glyph-diacritic .skin-diacritic .glyph-dia,
#match-rows .skin-diacritic .glyph-dia,
.glyph-answer-slot .skin-diacritic .glyph-dia,
body[data-page="puzzle"] .question-prompt-phrase .skin-diacritic .glyph-dia,
body[data-page="play"] .play-phrase .skin-diacritic .glyph-dia {
  position: absolute;
  width: 0.78rem;
  height: 0.78rem;
  margin: 0;
  align-self: auto;
}
body[data-page="puzzle"] .question-prompt-phrase .skin-diacritic .glyph-dia {
  width: 1.05rem;
  height: 1.05rem;
}
.reveal-glyph.skin-diacritic .glyph-dia {
  width: 0.48rem;
  height: 0.48rem;
}
.skin-diacritic .glyph-dia-above.glyph-dia-stack-0 {
  left: 50%;
  top: 0;
  transform: translate(-50%, -108%);
}
.skin-diacritic .glyph-dia-above.glyph-dia-stack-1 {
  left: 50%;
  top: 0;
  transform: translate(-50%, -216%);
}
.skin-diacritic .glyph-dia-below.glyph-dia-stack-0 {
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 108%);
}
.skin-diacritic .glyph-dia-below.glyph-dia-stack-1 {
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 216%);
}
.skin-diacritic .glyph-dia-left.glyph-dia-stack-0 {
  left: 0;
  top: 0;
  transform: translate(-36%, -8%);
}
.skin-diacritic .glyph-dia-left.glyph-dia-stack-1 {
  left: 0;
  top: 0;
  transform: translate(-36%, -108%);
}
.skin-diacritic .glyph-dia-right.glyph-dia-stack-0 {
  right: 0;
  top: 0;
  transform: translate(36%, -8%);
}
.skin-diacritic .glyph-dia-right.glyph-dia-stack-1 {
  right: 0;
  top: 0;
  transform: translate(36%, -108%);
}
body.glyph-diacritic .osk-key.osk-glyph .glyph-aff.osk-mark {
  width: auto;
  height: 78%;
  max-width: 88%;
}
body.has-osk.glyph-diacritic .osk-key.osk-glyph:has(.glyph-unit) {
  height: auto;
  min-height: 3.7rem;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0.12rem 0;
}
body.has-osk.glyph-diacritic .osk-key.osk-glyph:has(.has-above) {
  padding-top: 1.3rem;
}
body.has-osk.glyph-diacritic .osk-key.osk-glyph:has(.has-stack-above) {
  padding-top: 2.5rem;
}
body.has-osk.glyph-diacritic .osk-key.osk-glyph:has(.has-below) {
  padding-bottom: 1.3rem;
}
body.has-osk.glyph-diacritic .osk-key.osk-glyph:has(.has-stack-below) {
  padding-bottom: 2.5rem;
}
body.has-osk.glyph-diacritic .osk-key.osk-glyph:has(.has-shoulder) {
  padding-top: 0.2rem;
}
body.glyph-diacritic .osk-key.osk-glyph .glyph-unit,
body.glyph-diacritic .osk-key.osk-glyph .glyph-unit.has-above,
body.glyph-diacritic .osk-key.osk-glyph .glyph-unit.has-stack-above,
body.glyph-diacritic .osk-key.osk-glyph .glyph-unit.has-below,
body.glyph-diacritic .osk-key.osk-glyph .glyph-unit.has-stack-below,
body.glyph-diacritic .osk-key.osk-glyph .glyph-unit.has-shoulder {
  margin: 0;
  padding: 0;
}
body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph .glyph-unit .glyph-root {
  width: auto;
  height: calc(3.7rem * 0.9);
  max-width: 94%;
}
body.glyph-diacritic .osk-key.osk-glyph .glyph-dia {
  width: 1.1rem;
  height: 1.1rem;
}
@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-dia,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-dia {
    width: 0.72rem;
    height: 0.72rem;
  }
  .skin-diacritic .glyph-dia-above.glyph-dia-stack-0 {
    transform: translate(-50%, -110%);
  }
  .skin-diacritic .glyph-dia-above.glyph-dia-stack-1 {
    transform: translate(-50%, -210%);
  }
  .skin-diacritic .glyph-dia-below.glyph-dia-stack-0 {
    transform: translate(-50%, 110%);
  }
  .skin-diacritic .glyph-dia-below.glyph-dia-stack-1 {
    transform: translate(-50%, 210%);
  }
  .skin-diacritic .glyph-dia-left.glyph-dia-stack-0 {
    transform: translate(-36%, -8%);
  }
  .skin-diacritic .glyph-dia-left.glyph-dia-stack-1 {
    transform: translate(-36%, -110%);
  }
  .skin-diacritic .glyph-dia-right.glyph-dia-stack-0 {
    transform: translate(36%, -8%);
  }
  .skin-diacritic .glyph-dia-right.glyph-dia-stack-1 {
    transform: translate(36%, -110%);
  }
  body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-above,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-above,
  body[data-page="puzzle"] .question-prompt-phrase .skin-diacritic .glyph-unit.has-above {
    margin-top: 0.88rem;
  }
  body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-above {
    margin-top: 1.22rem;
  }
  body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-stack-above,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-stack-above,
  body[data-page="puzzle"] .question-prompt-phrase .skin-diacritic .glyph-unit.has-stack-above {
    margin-top: 1.65rem;
  }
  body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-stack-above {
    margin-top: 2.35rem;
  }
  body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-below,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-below,
  body[data-page="puzzle"] .question-prompt-phrase .skin-diacritic .glyph-unit.has-below {
    margin-bottom: 0.88rem;
  }
  body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-below {
    margin-bottom: 1.22rem;
  }
  body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-stack-below,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-stack-below,
  body[data-page="puzzle"] .question-prompt-phrase .skin-diacritic .glyph-unit.has-stack-below {
    margin-bottom: 1.65rem;
  }
  body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-stack-below {
    margin-bottom: 2.35rem;
  }
  body.has-osk.glyph-diacritic {
    --kb-inset: calc(14.5rem + env(safe-area-inset-bottom, 0px));
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph:has(.glyph-unit) {
    height: auto;
    min-height: 2.75rem;
    max-width: 2.85rem;
    align-items: center;
    padding: 0.08rem 0;
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph:has(.has-above) {
    padding-top: 1rem;
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph:has(.has-stack-above) {
    padding-top: 1.9rem;
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph:has(.has-below) {
    padding-bottom: 1rem;
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph:has(.has-stack-below) {
    padding-bottom: 1.9rem;
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph:has(.has-shoulder) {
    padding-top: 0.15rem;
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph .glyph-aff.osk-mark {
    width: auto;
    height: 84%;
    max-width: 90%;
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph .glyph-unit .glyph-root {
    width: auto;
    height: calc(2.75rem * 0.9);
    max-width: 94%;
  }
  body.has-osk.glyph-diacritic[data-glyph] .osk-key.osk-glyph .glyph-dia {
    width: 0.83rem;
    height: 0.83rem;
  }
  body[data-page="puzzle"] #match-rows,
  body[data-page="puzzle"] .glyph-answer-row,
  body[data-page="play"] .play-phrase {
    --glyph-dia: 0.72rem;
    --glyph-dia-out: 1.1;
  }
  body[data-page="puzzle"] .question-prompt-phrase {
    --glyph-dia-out: 1.1;
  }
}

/* A side mark sits on the glyph's corner. Keep just enough padding for the
   part that still sticks out, so it does not drift into the next word. */
body[data-page="puzzle"],
body[data-page="play"] {
  --glyph-dia: 0.78rem;
  --glyph-dia-out: 1.08;
}
body[data-page="puzzle"] .question-prompt-phrase {
  --glyph-dia: 1.05rem;
}
body[data-page="puzzle"] #match-rows .token.glyph-token:has(.glyph-dia-right),
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token:has(.glyph-dia-right),
body[data-page="play"] .play-phrase .token.glyph-token:has(.glyph-dia-right),
body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text .token.glyph-token[class*="hl-"]:has(.glyph-dia-right),
body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text .token.glyph-token.selected:has(.glyph-dia-right) {
  padding-right: calc(var(--glyph-dia) * 0.36 + 0.16rem);
}
body[data-page="puzzle"] #match-rows .token.glyph-token:has(.glyph-dia-left),
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token:has(.glyph-dia-left),
body[data-page="play"] .play-phrase .token.glyph-token:has(.glyph-dia-left),
body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text .token.glyph-token[class*="hl-"]:has(.glyph-dia-left),
body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text .token.glyph-token.selected:has(.glyph-dia-left) {
  padding-left: calc(var(--glyph-dia) * 0.36 + 0.16rem);
}
body[data-page="puzzle"] #match-rows .token.glyph-token:has(.glyph-dia-above),
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token:has(.glyph-dia-above),
body[data-page="play"] .play-phrase .token.glyph-token:has(.glyph-dia-above) {
  padding-top: 0.16rem;
}
body[data-page="puzzle"] #match-rows .token.glyph-token:has(.glyph-dia-below),
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token:has(.glyph-dia-below),
body[data-page="play"] .play-phrase .token.glyph-token:has(.glyph-dia-below),
body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text .token.glyph-token[class*="hl-"]:has(.glyph-dia-below),
body[data-page="puzzle"][data-layout="v2"] #match-rows .sentence-item .text .token.glyph-token.selected:has(.glyph-dia-below) {
  padding-bottom: 0.28rem;
}
body[data-page="puzzle"] #match-rows .token.glyph-token:has(.glyph-dia-right.glyph-dia-stack-1),
body[data-page="puzzle"] #match-rows .token.glyph-token:has(.glyph-dia-left.glyph-dia-stack-1),
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token:has(.glyph-dia-right.glyph-dia-stack-1),
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token:has(.glyph-dia-left.glyph-dia-stack-1) {
  padding-top: calc(var(--glyph-dia) * var(--glyph-dia-out) + 0.12rem);
}
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-shoulder,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-diacritic .glyph-unit.has-corner {
  margin-top: 0.7rem;
}
body[data-page="puzzle"] .glyph-answer-slot:has(.glyph-dia-right),
body[data-page="puzzle"] .glyph-answer-slot:has(.glyph-dia-left),
body[data-page="puzzle"] .glyph-answer-slot:has(.glyph-dia-above),
body[data-page="puzzle"] .glyph-answer-slot:has(.glyph-dia-below) {
  padding: 0;
}

/* A cropped letter keeps the ink the same size and drops the empty canvas,
   so a mark anchored to the box sits on the drawing. */
.glyph-root.glyph-tight {
  width: auto;
  height: calc(2.75rem * var(--tight-scale, 1));
}
#match-rows .skin-logogram .glyph-root.glyph-tight,
#match-rows .glyph-root.glyph-tight {
  width: auto;
  height: calc(2.3rem * var(--tight-scale, 1));
}
body[data-page="puzzle"] .question-prompt-phrase .skin-logogram .glyph-root.glyph-tight,
body[data-page="puzzle"] .question-prompt-phrase .glyph-root.glyph-tight {
  width: auto;
  height: calc(2.3rem * var(--tight-scale, 1));
}
.glyph-answer-slot .skin-logogram .glyph-root.glyph-tight,
.glyph-answer-slot .glyph-root.glyph-tight {
  width: auto;
  height: calc(2.3rem * var(--tight-scale, 1));
}
body[data-page="play"] .play-phrase .glyph-root.glyph-tight {
  width: auto;
  height: calc(2.75rem * var(--tight-scale, 1));
}
.reveal-glyph.skin-logogram .glyph-root.glyph-tight,
.reveal-glyph .glyph-root.glyph-tight {
  width: auto;
  height: calc(1.5rem * var(--tight-scale, 1));
}
.osk-key .glyph-root.glyph-tight {
  width: auto;
  max-width: 94%;
  height: 90%;
  aspect-ratio: auto;
}

/* Letters share one baseline. A mark underneath hangs below that line
   instead of lifting its own glyph. */
body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .sentence-item .text,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase,
body[data-page="play"][data-glyph] .play-phrase {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 0.12rem;
}
body[data-page="puzzle"][data-glyph] .question-prompt-phrase,
body[data-page="play"][data-glyph] .play-phrase {
  justify-content: center;
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] #match-rows .skin-diacritic .glyph-unit.has-stack-below,
body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] #match-rows .sentence-item .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] #match-rows .sentence-item .glyph-unit.has-stack-below,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .skin-diacritic .glyph-unit.has-stack-below,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .glyph-unit.has-stack-below,
body[data-page="play"][data-glyph] .play-phrase .glyph-unit.has-below,
body[data-page="play"][data-glyph] .play-phrase .glyph-unit.has-stack-below,
body[data-page="play"][data-glyph] .play-phrase .skin-diacritic .glyph-unit.has-below,
body[data-page="play"][data-glyph] .play-phrase .skin-diacritic .glyph-unit.has-stack-below,
body[data-page="play"][data-glyph] .play-phrase .skin-logogram .glyph-unit.has-below {
  margin-bottom: 0;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token:has(.glyph-dia-below),
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token:has(.glyph-dia-below),
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token:has(.glyph-dia-below),
body[data-page="puzzle"][data-layout="v2"][data-glyph] #match-rows .sentence-item .text .token.glyph-token[class*="hl-"]:has(.glyph-dia-below),
body[data-page="puzzle"][data-layout="v2"][data-glyph] #match-rows .sentence-item .text .token.glyph-token.selected:has(.glyph-dia-below) {
  padding-bottom: 0;
}
body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .sentence-item .text:has(.has-below),
body[data-page="puzzle"][data-glyph] .question-prompt-phrase:has(.has-below),
body[data-page="play"][data-glyph] .play-phrase:has(.has-below) {
  padding-bottom: 1.25rem;
  row-gap: 1.35rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .sentence-item .text:has(.has-stack-below),
body[data-page="puzzle"][data-glyph] .question-prompt-phrase:has(.has-stack-below),
body[data-page="play"][data-glyph] .play-phrase:has(.has-stack-below) {
  padding-bottom: 2.5rem;
  row-gap: 2.55rem;
}
@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .sentence-item .text {
    flex-wrap: nowrap;
  }
}
@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-glyph] #match-rows .skin-logogram .glyph-root.glyph-tight,
  body[data-page="puzzle"][data-glyph] #match-rows .glyph-root.glyph-tight,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-logogram .glyph-root.glyph-tight,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .glyph-root.glyph-tight,
  body[data-page="puzzle"] .question-prompt-phrase .glyph-root.glyph-tight {
    width: auto;
    height: calc(2.15rem * var(--tight-scale, 1));
  }
}

/* The highlight is the token box. The word already reserves room for a
   diacritic, so the wash stays on that box. Stretching it again left a
   slab of colour above the mark. */
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token[class*="hl-"],
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token[class*="hl-"],
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token[class*="hl-"],
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.selected,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.selected,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.selected {
  position: relative;
  z-index: 0;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token[class*="hl-"]::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token[class*="hl-"]::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token[class*="hl-"]::before,
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.selected::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.selected::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.selected::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  pointer-events: none;
}
/* A mark under the letter is kept outside the word box so the letters stay
   on one baseline. The wash has to follow it down, or the mark stays bare. */
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-dia-below)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-dia-below)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-dia-below)::before {
  bottom: calc(var(--glyph-dia) * var(--glyph-dia-out) * -1 - 0.06rem);
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-dia-below.glyph-dia-stack-1)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-dia-below.glyph-dia-stack-1)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-dia-below.glyph-dia-stack-1)::before {
  bottom: calc(var(--glyph-dia) * var(--glyph-dia-out) * -2 - 0.1rem);
}
/* Diacritic marks hang off the letter, so the colour and the ring have to
   be the same box. The ring was staying on the letter while the colour
   reached the mark, which drew two shapes. */
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.selected:has(.glyph-dia),
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.selected:has(.glyph-dia),
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.selected:has(.glyph-dia) {
  outline: none;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.selected:has(.glyph-dia)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.selected:has(.glyph-dia)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.selected:has(.glyph-dia)::before {
  outline: 2px solid var(--token-selected);
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token[class*="hl-pat-"]:has(.glyph-dia),
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token[class*="hl-pat-"]:has(.glyph-dia),
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token[class*="hl-pat-"]:has(.glyph-dia) {
  border-color: transparent;
  box-shadow: none;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.hl-pat-1:has(.glyph-dia)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.hl-pat-1:has(.glyph-dia)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.hl-pat-1:has(.glyph-dia)::before {
  box-shadow: inset 0 0 0 2px var(--hl-pattern-ink);
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.hl-pat-2:has(.glyph-dia)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.hl-pat-2:has(.glyph-dia)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.hl-pat-2:has(.glyph-dia)::before {
  box-shadow: inset 0 0 0 2px var(--hl-pattern-ink);
  outline: 2px dashed var(--hl-pattern-ink);
  outline-offset: -2px;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.hl-pat-3:has(.glyph-dia)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.hl-pat-3:has(.glyph-dia)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.hl-pat-3:has(.glyph-dia)::before {
  outline: 2px dotted var(--hl-pattern-ink);
  outline-offset: -2px;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.hl-pat-4:has(.glyph-dia)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.hl-pat-4:has(.glyph-dia)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.hl-pat-4:has(.glyph-dia)::before {
  box-shadow: inset 0 0 0 3px var(--hl-pattern-ink);
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.hl-pat-7:has(.glyph-dia)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.hl-pat-7:has(.glyph-dia)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.hl-pat-7:has(.glyph-dia)::before {
  box-shadow: inset 0 0 0 2px var(--hl-pattern-ink);
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.hl-pat-8:has(.glyph-dia)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token.hl-pat-8:has(.glyph-dia)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.hl-pat-8:has(.glyph-dia)::before {
  box-shadow: inset 4px 0 0 var(--hl-pattern-ink);
}

/* The word is one highlight. Marks that sit in the letter box are already
   inside it. A corner mark hangs just outside, so the same wash reaches it
   instead of painting a second chip on the mark. */
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-corner)::before,
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-corner)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-corner)::before {
  top: -0.48rem;
  right: -0.48rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-below)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-below)::before {
  bottom: -1.4rem;
}
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-below)::before {
  bottom: -1.65rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-above)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-above)::before {
  top: -1.4rem;
}
body[data-page="puzzle"][data-glyph] .question-prompt-phrase .token.glyph-token:is([class*="hl-"], .selected):has(.glyph-aff.glyph-above)::before {
  top: -1.65rem;
}

/* V2 letters sit a little taller than they are wide. Marks are square badges. */
.skin-v2 { --g-aspect: 0.94; }
.skin-v2 .glyph-root {
  height: 2.75rem;
  width: calc(2.75rem * var(--g-aspect));
}
/* Thick strokes were meeting the rounded tile. Shrink the drawing, not the box. */
.skin-v2 .glyph-root:not(.glyph-echo):not(.glyph-turn):not(.glyph-flip) {
  transform: scale(0.82);
  transform-origin: center center;
}
.skin-v2 .glyph-aff:not(.glyph-salt) {
  filter: drop-shadow(0 0 0.55px #f7f4ee) drop-shadow(0 0 0.55px #f7f4ee);
}
#match-rows .skin-v2 .glyph-root,
.glyph-answer-slot .skin-v2 .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-root {
  height: 2.3rem;
  width: calc(2.3rem * var(--g-aspect));
}
.osk-key.osk-glyph .skin-v2 .glyph-root {
  height: 2.85rem;
  width: calc(2.85rem * var(--g-aspect));
}
.reveal-glyph.skin-v2 .glyph-root {
  height: 1.5rem;
  width: calc(1.5rem * var(--g-aspect));
}
.skin-v2 .glyph-aff {
  width: 1.2rem;
  height: 1.2rem;
}
/* A repeated letter keeps the same ink size. Its extra line sits beside it. */
.skin-v2 .glyph-aff.glyph-salt {
  width: calc(2.75rem * 8 / 34);
  height: 2.75rem;
}
.skin-v2 .glyph-aff.glyph-salt.glyph-above,
.skin-v2 .glyph-aff.glyph-salt.glyph-below {
  width: calc(2.75rem * var(--g-aspect));
  height: calc(2.75rem * var(--g-aspect) * 8 / 32);
}
#match-rows .skin-v2 .glyph-aff,
.glyph-answer-slot .skin-v2 .glyph-aff {
  width: 1.1rem;
  height: 1.1rem;
}
#match-rows .skin-v2 .glyph-aff.glyph-salt,
.glyph-answer-slot .skin-v2 .glyph-aff.glyph-salt,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-salt {
  width: calc(2.3rem * 8 / 34);
  height: 2.3rem;
}
#match-rows .skin-v2 .glyph-aff.glyph-salt.glyph-above,
#match-rows .skin-v2 .glyph-aff.glyph-salt.glyph-below,
.glyph-answer-slot .skin-v2 .glyph-aff.glyph-salt.glyph-above,
.glyph-answer-slot .skin-v2 .glyph-aff.glyph-salt.glyph-below,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-salt.glyph-above,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-salt.glyph-below {
  width: calc(2.3rem * var(--g-aspect));
  height: calc(2.3rem * var(--g-aspect) * 8 / 32);
}
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff {
  width: 1.1rem;
  height: 1.1rem;
}
.reveal-glyph.skin-v2 .glyph-aff.glyph-salt {
  width: calc(1.5rem * 8 / 34);
  height: 1.5rem;
}
.reveal-glyph.skin-v2 .glyph-aff.glyph-salt.glyph-above,
.reveal-glyph.skin-v2 .glyph-aff.glyph-salt.glyph-below {
  width: calc(1.5rem * var(--g-aspect));
  height: calc(1.5rem * var(--g-aspect) * 8 / 32);
}
.osk-key.osk-glyph .skin-v2 .glyph-aff.glyph-salt {
  position: static;
  width: calc(2.85rem * 8 / 34);
  height: 2.85rem;
  margin: 0;
  transform: none;
}
.osk-key.osk-glyph .skin-v2 .glyph-aff.glyph-salt.glyph-above,
.osk-key.osk-glyph .skin-v2 .glyph-aff.glyph-salt.glyph-below {
  width: calc(2.85rem * var(--g-aspect));
  height: calc(2.85rem * var(--g-aspect) * 8 / 32);
}
.osk-key.osk-glyph .glyph-unit:has(.glyph-salt.glyph-above),
.osk-key.osk-glyph .glyph-unit:has(.glyph-salt.glyph-below) {
  flex-direction: column;
  align-items: center;
}
.osk-key.osk-glyph .glyph-salt.glyph-below {
  order: 2;
}
body[data-glyph] .osk-key.osk-glyph .skin-v2 .glyph-aff.osk-mark {
  width: 1.15rem;
  height: 1.15rem;
}
body[data-glyph] .skin-v2 .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-unit.has-above,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-unit.has-above,
body[data-page="play"] .play-phrase .skin-v2 .glyph-unit.has-above,
body[data-glyph] .skin-v2 .glyph-unit.has-below,
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-unit.has-below,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-unit.has-below,
body[data-page="play"] .play-phrase .skin-v2 .glyph-unit.has-below {
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
}
body[data-glyph] .skin-v2 .glyph-aff.glyph-above,
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-above,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-above,
body[data-page="play"] .play-phrase .skin-v2 .glyph-aff.glyph-above {
  position: absolute;
  left: 50%;
  top: 0;
  right: auto;
  bottom: auto;
  margin: 0;
  transform: translate(-50%, -84%);
  align-self: auto;
}
body[data-glyph] .skin-v2 .glyph-aff.glyph-below,
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-below,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-below,
body[data-page="play"] .play-phrase .skin-v2 .glyph-aff.glyph-below {
  position: absolute;
  left: 50%;
  bottom: 0;
  top: auto;
  right: auto;
  margin: 0;
  transform: translate(-50%, 84%);
  align-self: auto;
}
.skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside):not(.glyph-salt) {
  margin-inline: 0;
}
.skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside):not(.glyph-salt):not(:last-child) {
  transform: translateX(0.1rem);
}
.skin-v2 .glyph-unit > .glyph-root ~ .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside):not(.glyph-salt) {
  transform: translateX(-0.1rem);
}
body[data-glyph] .skin-v2 .glyph-unit.has-corner,
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-unit.has-corner,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-unit.has-corner,
body[data-page="play"] .play-phrase .skin-v2 .glyph-unit.has-corner {
  position: relative;
}
body[data-glyph] .skin-v2 .glyph-aff.glyph-corner,
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-corner,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-corner,
body[data-page="play"] .play-phrase .skin-v2 .glyph-aff.glyph-corner {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  bottom: auto;
  margin: 0;
  transform: translate(62%, -62%);
}
/* The mark sits in a band inside the word. A pair line only keeps the
   band that line uses, and every word on the line keeps it so the letters
   stay on one baseline. */
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-unit,
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-unit,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-unit {
  position: relative;
  box-sizing: content-box;
}
body[data-page="puzzle"][data-glyph] .letter-row.glyph-answer-row {
  align-items: center;
  padding-block: 0.2rem;
}
body[data-page="puzzle"][data-glyph] .glyph-answer-slot {
  box-sizing: border-box;
  height: 2.7rem;
  min-height: 2.7rem;
  max-height: 2.7rem;
  padding: 0;
  align-self: center;
}
body[data-page="puzzle"][data-glyph] .glyph-answer-slot:has(.glyph-aff),
body[data-page="puzzle"][data-glyph] .glyph-answer-slot:has(.glyph-dia) {
  height: auto;
  max-height: none;
  padding: 0.16rem 0.14rem;
}
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit.has-corner,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit.has-inside {
  padding-top: 1.15rem;
}
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit.has-below {
  padding-bottom: 1.15rem;
}
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-logogram .glyph-unit.has-above,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-logogram .glyph-unit.has-corner {
  margin-top: 1.25rem;
}
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-logogram .glyph-unit.has-below {
  margin-bottom: 1.15rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .sentence-item .text:has(.skin-v2 .glyph-unit.has-above, .skin-v2 .glyph-unit.has-corner) .skin-v2 .glyph-unit,
body[data-page="play"][data-glyph] .play-phrase:has(.skin-v2 .glyph-unit.has-above, .skin-v2 .glyph-unit.has-corner) .skin-v2 .glyph-unit {
  padding-top: 1.15rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .sentence-item .text:has(.skin-v2 .glyph-unit.has-below) .skin-v2 .glyph-unit,
body[data-page="play"][data-glyph] .play-phrase:has(.skin-v2 .glyph-unit.has-below) .skin-v2 .glyph-unit {
  padding-bottom: 1.15rem;
}
body[data-page="puzzle"] .question-prompt-phrase:has(.skin-v2 .glyph-unit.has-above, .skin-v2 .glyph-unit.has-corner) .skin-v2 .glyph-unit {
  padding-top: 1.15rem;
}
body[data-page="puzzle"] .question-prompt-phrase:has(.skin-v2 .glyph-unit.has-below) .skin-v2 .glyph-unit {
  padding-bottom: 1.15rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .sentence-item .text:has(.skin-v2 .has-below),
body[data-page="puzzle"][data-glyph] .question-prompt-phrase:has(.skin-v2 .has-below),
body[data-page="play"][data-glyph] .play-phrase:has(.skin-v2 .has-below),
body[data-page="puzzle"][data-glyph] #match-rows .match-cell[data-column="language"] .sentence-item .text:has(.skin-v2 .has-stack-below),
body[data-page="puzzle"][data-glyph] .question-prompt-phrase:has(.skin-v2 .has-stack-below),
body[data-page="play"][data-glyph] .play-phrase:has(.skin-v2 .has-stack-below) {
  padding-bottom: 0;
  row-gap: 0.12rem;
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-above,
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-aff.glyph-above,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-above,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-above {
  top: 0.04rem;
  transform: translateX(-50%);
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-below,
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-aff.glyph-below,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-below,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-below {
  bottom: 0.04rem;
  transform: translateX(-50%);
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-corner,
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-aff.glyph-corner,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-corner,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-corner {
  top: 0;
  right: 0;
  left: auto;
  transform: translate(34%, -34%);
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-corner ~ .glyph-aff.glyph-corner,
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-aff.glyph-corner ~ .glyph-aff.glyph-corner,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-corner ~ .glyph-aff.glyph-corner,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-corner ~ .glyph-aff.glyph-corner {
  transform: translate(-18%, -34%);
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-above ~ .glyph-aff.glyph-above,
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-aff.glyph-above ~ .glyph-aff.glyph-above,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-above ~ .glyph-aff.glyph-above,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-above ~ .glyph-aff.glyph-above {
  transform: translate(calc(-50% + 0.7rem), 0.1rem);
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside),
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside),
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside),
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside) {
  margin-inline: 0;
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside):not(:last-child),
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside):not(:last-child),
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside):not(:last-child),
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-unit > .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside):not(:last-child) {
  transform: translateX(0.1rem);
}
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-unit > .glyph-root ~ .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside),
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-unit > .glyph-root ~ .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside),
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit > .glyph-root ~ .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside),
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-unit > .glyph-root ~ .glyph-aff:not(.glyph-above):not(.glyph-below):not(.glyph-corner):not(.glyph-inside) {
  transform: translateX(-0.1rem);
}
/* An infix belongs on the letter. Beside it, one word reads as two glyphs. */
body[data-glyph] .skin-v2 .glyph-unit.has-inside,
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-unit.has-inside,
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-unit.has-inside,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-unit.has-inside,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-unit.has-inside {
  position: relative;
}
body[data-glyph] .skin-v2 .glyph-aff.glyph-inside,
body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-inside,
body[data-page="play"][data-glyph] .play-phrase .skin-v2 .glyph-aff.glyph-inside,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-inside,
body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-inside {
  position: absolute;
  left: 50%;
  top: 0;
  right: auto;
  bottom: auto;
  margin: 0;
  z-index: 2;
  transform: translate(-50%, -100%);
  align-self: auto;
}
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-inside {
  top: 0.04rem;
  transform: translateX(-50%);
}
.hint-structure-body .reveal-glyph,
.hint-rule-body .reveal-glyph {
  vertical-align: middle;
  margin: 0 0.18rem;
}
body[data-glyph] .glyph-mark-host > .glyph-aff,
body[data-page="puzzle"] .glyph-mark-host > .glyph-aff,
body[data-page="puzzle"] #reveal .glyph-mark-host > .glyph-aff,
body[data-glyph] .skin-v2 .glyph-mark-host > .glyph-aff.glyph-corner,
body[data-glyph] .skin-v2 .glyph-mark-host > .glyph-aff.glyph-above,
body[data-glyph] .skin-v2 .glyph-mark-host > .glyph-aff.glyph-below,
body[data-glyph] .skin-v2 .glyph-mark-host > .glyph-aff.glyph-inside,
body[data-page="puzzle"] #reveal .glyph-mark-host > .glyph-aff.glyph-corner,
body[data-page="puzzle"] #reveal .glyph-mark-host > .glyph-aff.glyph-above,
body[data-page="puzzle"] #reveal .glyph-mark-host > .glyph-aff.glyph-below,
body[data-page="puzzle"] #reveal .glyph-mark-host > .glyph-aff.glyph-inside {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  margin: 0;
  align-self: center;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.skin-v2,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.skin-v2,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .token.glyph-token.skin-v2,
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token.skin-v2 {
  padding: 0.08rem 0.12rem;
  box-sizing: border-box;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.skin-v2.selected,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.skin-v2.selected,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .token.glyph-token.skin-v2.selected,
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token.skin-v2.selected {
  outline: none;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.skin-v2:is([class*="hl-"], .selected)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected)::before,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .token.glyph-token.skin-v2:is([class*="hl-"], .selected)::before,
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected)::before,
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff)::before,
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff)::before,
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-above)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-above)::before,
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-above)::before,
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-below)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-below)::before,
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-below)::before,
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-corner)::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-corner)::before,
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token.skin-v2:is([class*="hl-"], .selected):has(.glyph-aff.glyph-corner)::before {
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
body[data-page="puzzle"][data-glyph] #match-rows .token.glyph-token.skin-v2.selected::before,
body[data-page="play"][data-glyph] .play-phrase .token.glyph-token.skin-v2.selected::before,
body[data-page="puzzle"][data-glyph] .glyph-answer-slot .token.glyph-token.skin-v2.selected::before,
body[data-page="puzzle"] .question-prompt-phrase .token.glyph-token.skin-v2.selected::before {
  outline: 2px solid var(--token-selected);
  outline-offset: 0;
}
@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-root,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-root,
  body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-root {
    height: 2.15rem;
    width: calc(2.15rem * var(--g-aspect));
  }
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-v2 .glyph-root {
    height: 1.7rem;
    width: calc(1.7rem * var(--g-aspect));
  }
  body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff,
  body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff {
    width: 1.05rem;
    height: 1.05rem;
  }
  body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-salt,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-salt,
  body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-salt {
    width: calc(2.15rem * 8 / 34);
    height: 2.15rem;
  }
  body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-salt.glyph-above,
  body[data-page="puzzle"][data-glyph] #match-rows .skin-v2 .glyph-aff.glyph-salt.glyph-below,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-salt.glyph-above,
  body[data-page="puzzle"][data-glyph] .glyph-answer-slot .skin-v2 .glyph-aff.glyph-salt.glyph-below,
  body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-salt.glyph-above,
  body[data-page="puzzle"] .question-prompt-phrase .skin-v2 .glyph-aff.glyph-salt.glyph-below {
    width: calc(2.15rem * var(--g-aspect));
    height: calc(2.15rem * var(--g-aspect) * 8 / 32);
  }
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-v2 .glyph-aff.glyph-salt {
    width: calc(1.7rem * 8 / 34);
    height: 1.7rem;
  }
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-v2 .glyph-aff.glyph-salt.glyph-above,
  body.has-osk[data-glyph] .osk-key.osk-glyph .skin-v2 .glyph-aff.glyph-salt.glyph-below {
    width: calc(1.7rem * var(--g-aspect));
    height: calc(1.7rem * var(--g-aspect) * 8 / 32);
  }

  body[data-page="puzzle"][data-glyph] #match-rows.pair-glyphs-compact .glyph-root {
    width: calc(1.75rem * var(--pair-glyph-scale, 1));
    height: calc(2.15rem * var(--pair-glyph-scale, 1));
  }

  body[data-page="puzzle"][data-glyph] #match-rows.pair-glyphs-compact .skin-v2 .glyph-root {
    width: calc(2.15rem * var(--g-aspect) * var(--pair-glyph-scale, 1));
    height: calc(2.15rem * var(--pair-glyph-scale, 1));
  }

  body[data-page="puzzle"][data-glyph] #match-rows.pair-glyphs-compact .glyph-aff {
    width: calc(1.15rem * var(--pair-glyph-scale, 1));
    height: calc(1.9rem * var(--pair-glyph-scale, 1));
  }

  body[data-page="puzzle"][data-glyph] #match-rows.pair-glyphs-compact .skin-v2 .glyph-aff {
    width: calc(1.05rem * var(--pair-glyph-scale, 1));
    height: calc(1.05rem * var(--pair-glyph-scale, 1));
  }
  body[data-page="puzzle"][data-glyph] #match-rows.pair-glyphs-compact .skin-v2 .glyph-aff.glyph-salt {
    width: calc(2.15rem * 8 / 34 * var(--pair-glyph-scale, 1));
    height: calc(2.15rem * var(--pair-glyph-scale, 1));
  }
  body[data-page="puzzle"][data-glyph] #match-rows.pair-glyphs-compact .skin-v2 .glyph-aff.glyph-salt.glyph-above,
  body[data-page="puzzle"][data-glyph] #match-rows.pair-glyphs-compact .skin-v2 .glyph-aff.glyph-salt.glyph-below {
    width: calc(2.15rem * var(--g-aspect) * var(--pair-glyph-scale, 1));
    height: calc(2.15rem * var(--g-aspect) * 8 / 32 * var(--pair-glyph-scale, 1));
  }
}

/* Compact completion panel. The puzzle sheet already carries the theme shadow. */
body[data-page="puzzle"] .puzzle-solved-card.daily-cta-card {
  gap: 0.42rem;
  padding: 0.52rem 0.65rem 0.55rem;
  text-align: left;
  align-items: stretch;
  border-width: 1.5px;
  border-top-width: 1.5px;
  border-style: solid;
  border-color: var(--home-border, var(--line));
  border-top-color: var(--home-border, var(--line));
  border-radius: var(--home-card-radius, 12px);
  box-shadow: none;
  background: var(--home-card-bg, var(--panel));
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-solved-header {
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem 0.75rem;
  flex-wrap: wrap;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-solved-title-wrap {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 0.15rem 0.7rem;
  flex: 1 1 auto;
}

body[data-page="puzzle"] #puzzle-solved-card .daily-cta-heading {
  justify-content: flex-start;
  text-align: left;
  font-size: 1.12rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body[data-page="puzzle"] #puzzle-solved-card .daily-cta-solved-mark {
  width: 1.12rem;
  height: 1.12rem;
}

body[data-page="puzzle"] #puzzle-solved-card .daily-cta-solved-mark svg {
  width: 0.68rem;
  height: 0.68rem;
}

body[data-page="puzzle"] .puzzle-solved-summary {
  margin: 0;
  min-width: min(100%, 14rem);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--home-muted-text, var(--muted));
}

body[data-page="puzzle"] .puzzle-solved-summary[hidden] {
  display: none !important;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-options {
  gap: 0;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  transform: none;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button svg {
  position: relative;
  z-index: 1;
  width: 0.74rem;
  height: 0.74rem;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button:hover,
body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button.is-flash {
  background: transparent;
  color: var(--home-card-bg, #fff);
  transform: none;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button:hover::before,
body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button.is-flash::before {
  background: var(--home-heading, #3d342c);
  border-color: var(--home-heading, #3d342c);
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button:focus-visible,
body[data-page="puzzle"] #puzzle-solved-card .puzzle-bonus-btn:focus-visible {
  outline: 2px solid var(--home-focus, var(--accent));
  outline-offset: 2px;
}

body[data-page="puzzle"] .puzzle-bonus-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.85rem;
  row-gap: 0.06rem;
  align-items: center;
  margin: 0;
  padding: 0.46rem 0.55rem 0.46rem 0.7rem;
  border-radius: calc(var(--home-card-radius, 12px) * 0.65);
  background: color-mix(in srgb, #d7f0e6 42%, var(--home-card-bg, #fff));
  text-align: left;
}

body[data-page="puzzle"] .puzzle-bonus-kicker {
  grid-column: 1;
  grid-row: 1;
}

body[data-page="puzzle"] .puzzle-bonus-copy {
  grid-column: 1;
  grid-row: 2;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-bonus-btn {
  grid-column: 2;
  grid-row: 1 / span 2;
}

body[data-page="puzzle"] .puzzle-bonus-offer[hidden] {
  display: none !important;
}

body[data-page="puzzle"] .puzzle-bonus-kicker {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--home-primary, var(--accent));
}

body[data-page="puzzle"] .puzzle-bonus-copy {
  margin: 0;
  max-width: 40rem;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 550;
  line-height: 1.35;
  color: var(--home-heading, var(--ink));
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-bonus-btn {
  margin-top: 0;
  align-self: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.32rem 0.75rem;
  border: 0;
  border-radius: var(--home-button-radius, 999px);
  background: var(--home-primary, #173d59);
  color: var(--home-button-text, #fff);
  font-size: 0.9rem;
  font-weight: 750;
  box-shadow: none;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-bonus-btn:hover {
  background: var(--home-primary-hover, #0d2e47);
  border-color: transparent;
}

body[data-page="puzzle"] #puzzle-solved-card .puzzle-bonus-btn-arrow {
  display: none;
}

@media (max-width: 640px) {
  body[data-page="puzzle"] .puzzle-solved-card.daily-cta-card {
    gap: 0.28rem;
    padding: 0.36rem 0.48rem 0.4rem;
  }

  body[data-page="puzzle"] #puzzle-solved-card .puzzle-solved-header {
    align-items: center;
    gap: 0.2rem 0.4rem;
  }

  body[data-page="puzzle"] #puzzle-solved-card .daily-cta-heading {
    font-size: 1rem;
  }

  body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-options {
    margin-left: auto;
  }

  body[data-page="puzzle"] #puzzle-solved-card .puzzle-share-button {
    width: 36px;
    height: 36px;
  }

  body[data-page="puzzle"] .puzzle-bonus-offer {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.45rem;
    row-gap: 0;
    padding: 0.28rem 0.4rem 0.28rem 0.5rem;
    align-items: center;
  }

  body[data-page="puzzle"] .puzzle-bonus-copy {
    font-size: 0.8rem;
    line-height: 1.25;
  }

  body[data-page="puzzle"] #puzzle-solved-card .puzzle-bonus-btn {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: auto;
    max-width: 7.6rem;
    min-height: 2rem;
    padding: 0.22rem 0.55rem;
    font-size: 0.75rem;
    line-height: 1.15;
    white-space: normal;
  }

  body[data-page="puzzle"] #puzzle-solved-card .puzzle-bonus-btn-label {
    white-space: normal;
  }
}

body[data-page="puzzle"] #puzzle-bonus-solved-card.puzzle-solved-card.daily-cta-card {
  gap: 0.22rem;
  margin-top: 0.7rem;
  margin-bottom: 0.85rem;
  padding: 0.5rem 0.7rem 0.5rem 0.8rem;
  text-align: left;
  align-items: stretch;
  border-width: 1.5px;
  border-left-width: 4px;
  border-style: solid;
  border-color: var(--home-border, var(--line));
  border-left-color: color-mix(in srgb, var(--good, #2f7d4c) 72%, #1c6a48);
  border-radius: var(--home-card-radius, 12px);
  box-shadow: none;
  background: color-mix(in srgb, #d7f0e6 48%, var(--home-card-bg, #fff));
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .daily-cta-heading {
  justify-content: flex-start;
  text-align: left;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .daily-cta-solved-mark {
  width: 1.05rem;
  height: 1.05rem;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .daily-cta-solved-mark svg {
  width: 0.64rem;
  height: 0.64rem;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-copy,
body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-stats,
body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-next,
body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-tomorrow {
  display: none !important;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-copy,
body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-stats,
body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-tomorrow {
  margin: 0;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-weight: 550;
  line-height: 1.3;
  color: var(--home-heading, var(--ink));
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-copy {
  font-size: 0.86rem;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-stats,
body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-tomorrow {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--home-muted-text, var(--muted));
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem 0.45rem;
  margin-top: 0.12rem;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-share-btn {
  min-height: 44px;
  margin: 0;
  padding: 0.3rem 0.85rem;
  border: 0;
  border-radius: var(--home-button-radius, 999px);
  background: var(--home-primary, #173d59);
  color: var(--home-button-text, #fff);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.2;
  box-shadow: none;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-share-btn:hover {
  background: var(--home-primary-hover, #0d2e47);
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-share-options {
  gap: 0;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  transform: none;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button svg {
  position: relative;
  z-index: 1;
  width: 0.74rem;
  height: 0.74rem;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button:hover,
body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button.is-flash {
  background: transparent;
  color: var(--home-card-bg, #fff);
  transform: none;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button:hover::before,
body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button.is-flash::before {
  background: var(--home-heading, #3d342c);
  border-color: var(--home-heading, #3d342c);
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-share-btn:focus-visible,
body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button:focus-visible,
body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-next:focus-visible {
  outline: 2px solid var(--home-focus, var(--accent));
  outline-offset: 2px;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-left: auto;
  padding: 0.3rem 0.35rem;
  color: var(--home-primary, #173d59);
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-next:hover {
  text-decoration: underline;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-next[hidden],
body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-tomorrow[hidden] {
  display: none !important;
}

body[data-page="puzzle"] .glyph-answer-slot.is-locked,
body[data-page="puzzle"] .glyph-answer-slot.is-locked:hover,
body[data-page="puzzle"] .glyph-answer-slot.is-locked:focus,
body[data-page="puzzle"] .glyph-answer-slot.is-locked:focus-visible,
body[data-page="puzzle"] .glyph-answer-slot:disabled {
  opacity: 1;
  cursor: default;
  pointer-events: none;
  outline: none;
  box-shadow: none;
  border-style: solid;
  border-color: var(--good, #2f9e5a);
  background: transparent;
}

@keyframes mastery-arrive {
  0% { background-color: color-mix(in srgb, #d7f0e6 82%, var(--home-card-bg, #fff)); }
  100% { background-color: color-mix(in srgb, #d7f0e6 48%, var(--home-card-bg, #fff)); }
}

@keyframes mastery-check {
  0% { transform: scale(0.72); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

body[data-page="puzzle"] #puzzle-bonus-solved-card.is-celebrating {
  animation: mastery-arrive 0.9s ease-out;
}

body[data-page="puzzle"] #puzzle-bonus-solved-card.is-celebrating .daily-cta-solved-mark {
  animation: mastery-check 0.7s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="puzzle"] #puzzle-bonus-solved-card.is-celebrating,
  body[data-page="puzzle"] #puzzle-bonus-solved-card.is-celebrating .daily-cta-solved-mark {
    animation: none;
  }
}

@media (max-width: 640px) {
  body[data-page="puzzle"] #puzzle-bonus-solved-card.puzzle-solved-card.daily-cta-card {
    gap: 0.12rem;
    margin-top: 0.4rem;
    margin-bottom: 0.45rem;
    padding: 0.36rem 0.5rem 0.38rem;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-copy {
    font-size: 0.78rem;
    line-height: 1.25;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-stats {
    font-size: 0.74rem;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.35rem;
    margin-top: 0.04rem;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-share-btn,
  body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-next {
    width: auto;
    min-height: 2.15rem;
    margin-left: 0;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-share-btn {
    padding: 0.22rem 0.7rem;
    font-size: 0.8rem;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-next {
    margin-left: auto;
    padding: 0.15rem 0.1rem;
    font-size: 0.8rem;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .mastery-share-options {
    justify-content: flex-end;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .puzzle-share-button {
    width: 36px;
    height: 36px;
  }

  body[data-page="puzzle"] #puzzle-bonus-solved-card .daily-cta-heading {
    font-size: 0.98rem;
  }
}

/* Highlight chips are inline-block so their padding stays inside the line
   when an English solution wraps. */
body[data-page="puzzle"] #match-rows .match-cell[data-column="english"] .sentence-item .text .token[class*="hl-"] {
  display: inline-block;
  padding: 0.02em 0.1em;
  margin: 0.16em 0.03em;
  line-height: 1.2;
  vertical-align: baseline;
}

.play-board-switch {
  align-items: center;
  flex-wrap: wrap;
}

.player-board-switch[hidden] {
  display: none !important;
}

.player-board-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.15rem 0 0.7rem;
}

.player-board-switch button {
  font: inherit;
  padding: 0.28rem 0.72rem;
  border: 1px solid var(--line, #c8c2b4);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.player-board-switch button.is-active {
  font-weight: 700;
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 10%, transparent);
}

body[data-page="puzzle"] .player-board-switch {
  margin: 0.1rem 0 0.35rem;
}

.play-board-label {
  margin-right: 0.15rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.combined-intro {
  margin: 0.15rem 0 0.2rem;
  text-align: center;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

body[data-page="puzzle"][data-board="combined"] .match-headers {
  display: none !important;
}

body[data-page="puzzle"][data-board="combined"] .match-headers .column-stack[data-column="english"] {
  grid-column: auto;
  justify-self: end;
}

body[data-page="puzzle"][data-board="combined"] .match-header-submit {
  display: flex;
  justify-content: center;
}

body[data-page="puzzle"][data-board="combined"] #btn-submit-match.btn.primary.check-both {
  position: static;
  transform: none;
  display: inline-flex !important;
  justify-self: center;
  align-items: center;
  width: auto;
  height: auto;
  min-height: 0;
  margin: -0.28rem auto 0;
  padding: 0.48rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: #1f7a3a;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: none;
}

body[data-page="puzzle"][data-board="combined"] #btn-submit-match.btn.primary.check-both:hover {
  transform: none;
  background: #1a6b32;
  color: #fff;
  box-shadow: none;
}

body[data-page="puzzle"][data-board="combined"] #btn-submit-match.btn.primary.check-both[hidden],
body[data-page="puzzle"][data-board="combined"] #btn-submit-match[hidden] {
  display: none !important;
}

body[data-page="puzzle"][data-board="combined"] .combined-check-note {
  margin: -0.35rem 0 0;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
}

body[data-page="puzzle"][data-board="combined"] .combined-check-note.bad {
  color: #d94b3a;
}

body[data-page="puzzle"][data-board="combined"] .combined-check-note.ok {
  color: #1f7a3a;
}

body[data-page="puzzle"][data-board="combined"] .combined-check-note[hidden] {
  display: none !important;
}

body[data-page="puzzle"][data-board="combined"] #match-rows > #puzzle-bonus-solved-card,
body[data-page="puzzle"][data-board="combined"] #match-rows > #puzzle-solved-card {
  width: 100%;
  margin: 0;
  padding: 0.9rem 0.75rem 0.8rem;
  text-align: center;
  align-items: center;
  border-width: 1px;
  border-left-width: 1px;
  border-top-width: 1px;
  border-style: solid;
  border-color: color-mix(in srgb, #2e9d4b 38%, var(--line));
  border-left-color: color-mix(in srgb, #2e9d4b 38%, var(--line));
  border-top-color: color-mix(in srgb, #2e9d4b 38%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, #2e9d4b 14%, var(--bg1));
  box-shadow: none;
}

body[data-page="puzzle"][data-board="combined"] #match-rows > #puzzle-bonus-solved-card .daily-cta-heading {
  justify-content: center;
  text-align: center;
  width: 100%;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
}

body[data-page="puzzle"][data-board="combined"] #match-rows > #puzzle-bonus-solved-card .mastery-actions {
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
}

body[data-page="puzzle"][data-board="combined"] #match-rows > #puzzle-bonus-solved-card .mastery-share-btn {
  min-height: 0;
  padding: 0.48rem 1.15rem;
  border: 0;
  border-radius: 999px;
  background: #1f7a3a;
  color: #fff;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body[data-page="puzzle"][data-board="combined"] #match-rows > #puzzle-bonus-solved-card .mastery-share-btn:hover {
  background: #1a6b32;
  color: #fff;
}

body[data-page="puzzle"][data-board="combined"] .match-board > .answers-block {
  order: 3;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  border-top: 0;
}

body[data-page="puzzle"][data-board="combined"] .match-board > .answers-block:has(#question-rows:empty):not(:has(.puzzle-solved-card:not([hidden]))) {
  display: none;
}

body[data-page="puzzle"][data-board="combined"] .match-board > .clues-head {
  margin-top: 0.15rem;
  padding-top: 0.12rem;
  border-top: 0;
}

body[data-board="combined"] .question-stack:empty {
  display: none;
}

body[data-page="puzzle"][data-board="combined"] .puzzle-page {
  width: min(720px, calc(100% - 1.5rem));
  margin-left: auto;
  margin-right: auto;
}

body[data-page="puzzle"][data-board="combined"] .daily-top {
  margin-bottom: 0.08rem;
}

body[data-board="combined"] #match-rows {
  gap: 0.88rem;
  min-width: 0;
  padding-top: 0.85rem;
  overflow: visible;
}

body[data-page="puzzle"][data-board="combined"] .home-page .daily-card,
body[data-page="puzzle"][data-board="combined"] .daily-card {
  padding-top: 0.32rem;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  border: 0 !important;
  box-shadow: none !important;
  outline: none;
}

body[data-page="puzzle"][data-board="combined"] .match-board {
  padding-inline: 0;
}

.task-row {
  position: relative;
  border-radius: 12px;
  padding: 0.85rem 0.28rem 0.32rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

.task-row.task-decode {
  background: color-mix(in srgb, #2e9d4b 14%, var(--bg1));
  border: 1px solid color-mix(in srgb, #2e9d4b 38%, var(--line));
  margin-top: 2px;
  padding-top: 1.05rem;
  padding-bottom: 0.28rem;
}

.task-row.task-encode {
  background: color-mix(in srgb, #2e9d4b 14%, var(--bg1));
  border: 1px solid color-mix(in srgb, #2e9d4b 38%, var(--line));
  margin-top: 8px;
  padding-top: 1.45rem;
  padding-bottom: 6px;
}

body[data-page="puzzle"][data-board="combined"] .task-encode .task-prompt .sentence-item .text {
  margin-bottom: 0;
}

body[data-page="puzzle"][data-board="combined"] .task-encode .glyph-answer-row {
  margin-top: 0;
}

.task-row.task-encode.is-active,
.task-row.task-decode.is-active {
  border-color: color-mix(in srgb, #2e9d4b 38%, var(--line));
  box-shadow: none;
}

.task-row.correct {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #2e9d4b 55%, transparent);
}

.task-row.incorrect {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c44848 55%, transparent);
}

body[data-page="puzzle"][data-board="combined"] .task-row.task-decode.correct,
body[data-page="puzzle"][data-board="combined"] .task-row.task-encode.correct {
  border-color: #1f7a3a;
  box-shadow: inset 0 0 0 2px #1f7a3a;
}

body[data-page="puzzle"][data-board="combined"] .task-row.task-decode.incorrect,
body[data-page="puzzle"][data-board="combined"] .task-row.task-encode.incorrect {
  border-color: #d94b3a;
  box-shadow: inset 0 0 0 2px #d94b3a;
}

.task-kicker {
  margin: 0 0 0.18rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-decode .task-kicker {
  color: #1f7a3a;
}

.task-encode .task-kicker {
  color: #1f7a3a;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .board-line {
  display: grid !important;
  grid-template-columns: minmax(0, min(var(--pair-left, 34%), 34%)) 1.05rem minmax(0, 1fr) !important;
  gap: 0.28rem 0.4rem;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.board-line {
  grid-template-columns: minmax(0, min(var(--pair-left, 34%), 34%)) 1.05rem minmax(0, 1fr) !important;
  align-items: start;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .clue-row.board-line {
  grid-template-columns: var(--pair-left, max-content) auto minmax(0, 1fr) !important;
  column-gap: 0.28rem;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .clue-row .match-cell[data-column="language"] .sentence-item .text {
  justify-content: center;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .board-line > * {
  min-width: 0;
  max-width: 100%;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .match-mark {
  display: flex !important;
  visibility: visible !important;
  align-self: center;
  justify-content: center;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--ink) 55%, var(--muted));
}

body[data-page="puzzle"][data-board="combined"] .task-decode .match-mark {
  background: transparent;
  color: #1f7a3a;
}

body[data-page="puzzle"][data-board="combined"] .task-encode .match-mark {
  background: transparent;
  color: #1f7a3a;
}

body[data-board="combined"] .match-mark svg {
  display: block;
  width: 14px;
  height: 14px;
}

.task-check {
  justify-self: end;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f7f4ee;
  background: #243042;
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  cursor: pointer;
}

.task-check:disabled {
  background: #1f7a3a;
  cursor: default;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row,
body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.letter-row-hidden-breaks {
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  max-width: 100%;
  gap: 0.32rem 0.7rem;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-run,
body[data-page="puzzle"][data-board="combined"] .task-answer .letter-word:not(.glyph-answer-slot) {
  display: inline-flex;
  flex: 0 1 auto;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0.12rem;
  max-width: 100%;
  min-width: max-content;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-run.may-break,
body[data-page="puzzle"][data-board="combined"] .task-answer .letter-word:not(.glyph-answer-slot).may-break {
  flex-wrap: wrap;
  min-width: 0;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.answer-short {
  --entry-size: 33px;
  --entry-height: 38px;
  --entry-font: 18px;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.answer-medium {
  --entry-size: 30px;
  --entry-height: 35px;
  --entry-font: 17px;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.answer-long {
  --entry-size: 27px;
  --entry-height: 31px;
  --entry-font: 15px;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.answer-very-long {
  --entry-size: 25px;
  --entry-height: 29px;
  --entry-font: 14px;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-box,
body[data-page="puzzle"][data-board="combined"] .task-answer .letter-run .letter-box,
body[data-page="puzzle"][data-board="combined"] .task-answer .letter-word .letter-box {
  flex: 0 0 1.9rem;
  width: 1.9rem !important;
  min-width: 1.9rem;
  max-width: 1.9rem;
  height: 2.15rem;
  line-height: 2.15rem;
  font-size: 1.08rem;
  border-radius: 4px;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-box[data-kind="space"] {
  flex: 0 0 0.2rem;
  width: 0.2rem !important;
  min-width: 0.2rem;
  max-width: 0.2rem;
  height: 0.2rem;
  margin: 0;
  border: 0;
  background: transparent;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-word.correct .letter-box,
body[data-page="puzzle"][data-board="combined"] .task-answer .letter-box.correct {
  border-color: #2f9e5a;
  border-width: 2px;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .letter-word.incorrect .letter-box,
body[data-page="puzzle"][data-board="combined"] .task-answer .letter-box.incorrect {
  border-color: #d94b3a;
  border-width: 2px;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-row {
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-end;
  width: auto;
  max-width: 100%;
  gap: 0.16rem;
  margin: 0;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot,
body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot:has(.glyph-aff),
body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot:has(.glyph-dia) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box !important;
  flex: 0 0 2.55rem !important;
  width: 2.55rem !important;
  min-width: 2.55rem !important;
  max-width: 2.55rem !important;
  height: 2.7rem !important;
  min-height: 2.7rem !important;
  max-height: 2.7rem !important;
  padding: 0 !important;
  overflow: visible;
  border: 2px solid #b8b8b8;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot .glyph-token,
body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot .reveal-glyph {
  color: #1a1a1a;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot:has(.glyph-root) {
  background: color-mix(in srgb, var(--home-pill-text, var(--home-heading, #1c2a3a)) 6%, #fff);
}

body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.is-active,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.is-active {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  border-color: var(--accent);
  color: #1a1a1a;
}

html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot {
  border-color: #8a8a8a;
  background: #fff;
  color: #1a1a1a;
}

html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot .glyph-token,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot .glyph-root,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot .glyph-aff {
  color: #1a1a1a;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.correct,
body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.correct.is-active,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.correct,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.correct.is-active {
  border-color: #2f9e5a;
  border-width: 2px;
}

body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.incorrect,
body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.incorrect.is-active,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.incorrect,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] .task-answer .glyph-answer-slot.incorrect.is-active {
  border-color: #d94b3a;
  border-width: 2px;
}

body[data-page="puzzle"][data-board="combined"] .task-prompt .glyph-root,
body[data-page="puzzle"][data-board="combined"] .task-row .match-cell:not(.task-answer) .glyph-root {
  width: 1.7rem;
  height: 2.15rem;
}

body[data-board="combined"] .row-label,
body[data-board="combined"] .clue-label,
body[data-board="combined"] .solution-label {
  position: absolute;
  top: 0;
  left: 18px;
  z-index: 2;
  transform: translateY(-42%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100% - 36px);
  height: 1.7rem;
  margin: 0;
  padding: 0 0.78rem;
  border-radius: 999px;
  border: 1.5px solid var(--row-label-border, color-mix(in srgb, #1f7a3a 55%, var(--line)));
  background: var(--home-card-bg, var(--card, var(--bg1)));
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--row-label, #1f7a3a);
}

body[data-board="combined"] .task-decode .row-label,
body[data-board="combined"] .task-encode .row-label {
  transform: translateY(calc(-42% - 3px));
}

body[data-board="combined"] .row-label.row-lang {
  left: auto;
  right: 18px;
  max-width: calc(50% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-weight: 600;
}

html[data-theme="dark"] body[data-board="combined"] .task-decode .row-label,
html[data-theme="dark"] body[data-board="combined"] .task-encode .row-label {
  color: #d9f8e3;
  border-color: color-mix(in srgb, #b7ebc9 80%, var(--line));
}

body[data-board="combined"] .clue-label,
body[data-board="combined"] .solution-label {
  border-color: color-mix(in srgb, var(--ink) 22%, var(--line));
  color: var(--ink);
}

body[data-page="puzzle"][data-board="combined"] #match-rows > #reveal.reveal {
  position: relative;
  overflow: visible;
  width: 100%;
  margin: 0;
  padding: 1.45rem 1.8rem 0.75rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, var(--line));
  border-radius: 12px;
  background: #f8f4ec;
  color: var(--ink);
  box-shadow: none;
}

html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] #match-rows > #reveal.reveal {
  background: var(--home-card-bg, var(--bg1));
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
}

body[data-page="puzzle"][data-board="combined"] #match-rows > #reveal.reveal[hidden] {
  display: none !important;
}

body[data-board="combined"] .clue-group {
  position: relative;
  overflow: visible;
  border: 1px solid var(--clue-border, var(--translation-pair-border, rgba(28, 36, 32, 0.16)));
  border-radius: 12px;
  background: var(--clue-bg, var(--translation-pair-bg, #f8f4ec));
  padding: 1.45rem 0.28rem 0.06rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  color: var(--clue-ink, var(--translation-pair-text, #1c2420));
}

body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .clue-row {
  margin: 0;
  padding: 0.14rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .clue-row + .clue-row {
  border-top: 1px solid var(--clue-line, color-mix(in srgb, var(--translation-pair-text, #1c2420) 14%, transparent));
}

html[data-theme="dark"] body[data-board="combined"] .clue-group {
  background: var(--home-card-bg, var(--bg1));
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
}

body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .glyph-token,
body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .reveal-glyph,
body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .sentence-item .text {
  color: var(--clue-ink, var(--translation-pair-text, #1c2420));
}

body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .match-mark {
  color: color-mix(in srgb, var(--clue-ink, var(--translation-pair-text, #1c2420)) 55%, var(--translation-pair-muted, #6a645c));
}

html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .glyph-token,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .reveal-glyph,
html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .sentence-item .text {
  color: var(--ink);
}

html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .match-mark {
  color: color-mix(in srgb, var(--ink) 72%, transparent);
}

html[data-theme="dark"] body[data-page="puzzle"][data-board="combined"] #match-rows .clue-group .clue-row + .clue-row {
  border-top-color: color-mix(in srgb, var(--ink) 18%, transparent);
}

body[data-page="puzzle"][data-board="combined"] #match-rows .sentence-item {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .sentence-item .text {
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: break-word;
  word-break: normal;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .match-cell[data-column="language"] .sentence-item .text,
body[data-page="puzzle"][data-board="combined"] .task-prompt .text {
  display: flex;
  flex-wrap: wrap !important;
  align-items: flex-end;
  justify-content: flex-start;
  column-gap: 0.18rem;
  row-gap: 0.15rem;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .match-cell[data-column="english"] .sentence-item .text {
  display: block;
  line-height: 1.4;
  font-size: 0.98rem;
}

body[data-page="puzzle"][data-board="combined"] .task-decode .task-prompt .text,
body[data-page="puzzle"][data-board="combined"] .task-encode .glyph-answer-row {
  justify-content: center;
}

body[data-page="puzzle"][data-board="combined"] .task-encode .task-answer {
  justify-content: center;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-encode .task-prompt .sentence-item .text {
  text-align: center;
  font-weight: 700;
}

@media (max-width: 800px) {
  body[data-page="puzzle"][data-board="combined"] .puzzle-page {
    width: 100%;
  }

  body[data-page="puzzle"][data-board="combined"] #btn-submit-match.btn.primary.check-both {
    margin: -0.2rem auto 0;
    padding: 0.42rem 0.95rem;
    font-size: 0.86rem;
  }

  body[data-page="puzzle"][data-board="combined"] #match-rows .board-line {
    grid-template-columns: minmax(0, min(var(--pair-left, 42%), 42%)) 0.85rem minmax(0, 1fr) !important;
    gap: 0.2rem 0.28rem;
  }

  body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.board-line {
    grid-template-columns: minmax(0, min(var(--pair-left, 42%), 42%)) 0.85rem minmax(0, 1fr) !important;
  }

  body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.answer-short {
    --entry-size: 31px;
    --entry-height: 36px;
    --entry-font: 17px;
  }

  body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.answer-medium {
    --entry-size: 28px;
    --entry-height: 32px;
    --entry-font: 16px;
  }

  body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.answer-long {
    --entry-size: 25px;
    --entry-height: 29px;
    --entry-font: 14px;
  }

  body[data-page="puzzle"][data-board="combined"] .task-answer .letter-row.answer-very-long {
    --entry-size: 23px;
    --entry-height: 27px;
    --entry-font: 13px;
  }

  body[data-page="puzzle"][data-board="combined"] .puzzle-page {
    padding-left: 0.04rem;
    padding-right: 0.04rem;
  }

  body[data-page="puzzle"][data-board="combined"] .daily-card {
    padding-left: 0.06rem;
    padding-right: 0.06rem;
  }

  body[data-page="puzzle"][data-board="combined"] .task-row,
  body[data-page="puzzle"][data-board="combined"] .clue-group {
    padding-left: 0.04rem;
    padding-right: 0.04rem;
  }

  body[data-page="puzzle"][data-board="combined"] #match-rows .task-encode .task-prompt {
    box-sizing: border-box;
    padding-left: 14px;
    padding-right: 14px;
  }

  body[data-page="puzzle"][data-board="combined"] #match-rows .task-encode .task-prompt .sentence-item .text {
    white-space: normal;
    overflow-wrap: break-word;
  }

  body[data-page="puzzle"][data-board="combined"] #match-rows .match-cell[data-column="english"] .sentence-item .text {
    font-size: 0.92rem;
    line-height: 1.35;
  }

}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.board-line.is-stacked {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas: "prompt" "answer" !important;
  align-items: center;
  justify-items: center;
  row-gap: 0.35rem;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.is-stacked > .match-cell:not(.task-answer) {
  grid-area: prompt;
  align-self: center;
  justify-self: center;
  width: max-content;
  max-width: 100%;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.is-stacked > .task-prompt .sentence-item {
  flex: 0 1 auto;
  width: auto;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.is-stacked > .task-answer {
  grid-area: answer;
  padding-top: 0;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.is-encode {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas: "prompt" "answer" !important;
  justify-items: stretch;
  row-gap: 7px;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.is-encode > .task-prompt {
  grid-area: prompt;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-grid.is-encode > .task-answer {
  grid-area: answer;
}

body[data-page="puzzle"][data-board="combined"] {
  --board-glyph: 2.07rem;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .glyph-root,
body[data-page="puzzle"][data-board="combined"] .glyph-answer-slot .glyph-root {
  height: var(--board-glyph) !important;
  width: calc(var(--board-glyph) * var(--g-aspect)) !important;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .glyph-aff:not(.glyph-salt),
body[data-page="puzzle"][data-board="combined"] .glyph-answer-slot .glyph-aff:not(.glyph-salt) {
  width: 0.99rem !important;
  height: 0.99rem !important;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .glyph-aff.glyph-salt,
body[data-page="puzzle"][data-board="combined"] .glyph-answer-slot .glyph-aff.glyph-salt {
  height: var(--board-glyph) !important;
  width: calc(var(--board-glyph) * 8 / 34) !important;
}

body[data-page="puzzle"][data-board="combined"] .osk-key.osk-glyph .glyph-root {
  height: 2.565rem !important;
  width: calc(2.565rem * var(--g-aspect)) !important;
}

body[data-page="puzzle"][data-board="combined"] #match-rows .task-answer .glyph-answer-slot .glyph-root {
  height: 2.3rem !important;
  width: calc(2.3rem * var(--g-aspect)) !important;
}

@media (max-width: 640px), ((max-width: 900px) and (pointer: coarse)) {
  body[data-page="puzzle"][data-board="combined"] {
    --board-glyph: 1.935rem;
  }

  body[data-page="puzzle"][data-board="combined"] #match-rows .glyph-aff:not(.glyph-salt),
  body[data-page="puzzle"][data-board="combined"] .glyph-answer-slot .glyph-aff:not(.glyph-salt) {
    width: 0.945rem !important;
    height: 0.945rem !important;
  }

  body[data-page="puzzle"][data-board="combined"] .osk-key.osk-glyph .glyph-root {
    height: 1.53rem !important;
    width: calc(1.53rem * var(--g-aspect)) !important;
  }

  body[data-page="puzzle"][data-board="combined"] .task-answer .letter-box,
  body[data-page="puzzle"][data-board="combined"] .task-answer .letter-run .letter-box,
  body[data-page="puzzle"][data-board="combined"] .task-answer .letter-word .letter-box {
    flex: 0 0 1.6rem;
    width: 1.6rem !important;
    min-width: 1.6rem;
    max-width: 1.6rem;
    height: 1.65rem;
    line-height: 1.65rem;
    font-size: 1.05rem;
  }

  body[data-page="puzzle"][data-board="combined"] .task-answer .letter-box[data-kind="space"] {
    flex: 0 0 0.2rem;
    width: 0.2rem !important;
    min-width: 0.2rem;
    max-width: 0.2rem;
    height: 0.2rem;
    line-height: 0.2rem;
    font-size: 0;
  }

  body[data-page="puzzle"][data-board="combined"] #match-rows .task-answer .glyph-answer-slot .glyph-root {
    height: 2.15rem !important;
    width: calc(2.15rem * var(--g-aspect)) !important;
  }

  body[data-page="puzzle"][data-board="combined"] #match-rows .task-answer .glyph-answer-slot .glyph-aff:not(.glyph-salt) {
    width: 1.15rem !important;
    height: 1.9rem !important;
  }
}
