:root { --paper:var(--surface); --sunk:var(--surface-sunk); --line:var(--border); --graphite:var(--ink); --muted:var(--ink-muted); --edge:var(--border-control); --teal:var(--accent); --teal-deep:var(--accent-hover); --teal-soft:var(--accent-soft); --font:var(--font-sans); --s1:var(--space-1); --s2:var(--space-2); --s3:var(--space-3); --s4:var(--space-4); --s5:var(--space-5); --s6:var(--space-6); --s7:var(--space-7); }
*, *::before, *::after { box-sizing: border-box; }
/* Component display rules (.panel, .answer-full) must never beat a closed state. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--s4); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font: 400 1rem/1.55 var(--font);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Inline padding only, so main's own top padding (title breathing room) survives. */
.shell { width: 100%; max-width: 720px; margin: 0 auto; padding-inline: var(--s4); }

/* Header: brand + three jumps on one line */
.bar { border-bottom: 1px solid var(--line); }
.bar .shell { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--graphite); font-weight: 700; text-decoration: none; }
.brand svg { flex: none; }
.brand-name { display: none; }
.links { display: flex; gap: var(--s1); }
.links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s2);
  border-radius: 8px;
  color: var(--graphite);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}
.links a:hover { background: var(--sunk); color: var(--teal); }

main { display: grid; gap: var(--s6); padding-top: var(--s6); padding-bottom: var(--s6); }
.col-main { display: grid; gap: var(--s6); min-width: 0; }
/* Results follow the hints in reading order on every width: answer, then yesterday. */
.results { display: grid; gap: var(--s5); min-width: 0; }

/* Title: puzzle identity as one split stamp */
.intro { display: grid; gap: var(--s3); }
h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.stamp {
  display: inline-flex;
  align-items: stretch;
  justify-self: start;
  max-width: 100%;
  border: 1.5px solid var(--graphite);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
}
.stamp > * { display: flex; align-items: center; padding: 6px 12px; }
.stamp .num { background: var(--graphite); color: #fff; font-weight: 700; }
.lede { color: var(--muted); max-width: 36em; }
.demo { color: var(--muted); font-size: 0.8125rem; }

/* Section heads */
.sec-head { display: grid; gap: 2px; margin-bottom: var(--s3); }
.sec-head h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
.sec-head p { color: var(--muted); font-size: 0.9375rem; }

/* Groups and rows */
.groups { display: grid; gap: var(--s4); }
.group { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--paper); }
.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--sunk);
  border-bottom: 1px solid var(--line);
}
.group-head h3 { font-size: 0.9375rem; font-weight: 700; }
.group-head p { color: var(--muted); font-size: 0.875rem; }
.strength { display: inline-flex; gap: 3px; margin-left: auto; align-self: center; }
.strength i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.strength i.on { background: var(--teal); }

.rows { margin: 0; padding: 0; list-style: none; }
.row + .row { border-top: 1px solid var(--line); }
.row.is-open { background: #fbfcfc; }

.row-btn {
  display: grid;
  grid-template-columns: var(--glyph) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--s3);
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: var(--s3) var(--s4);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.row-btn:focus-visible { outline-offset: -3px; }
.row-btn:hover .pill { background: var(--teal-deep); border-color: var(--teal-deep); }
.row-btn[aria-expanded="true"]:hover .pill { background: var(--sunk); }

.glyph {
  display: grid;
  place-items: center;
  width: var(--glyph);
  height: var(--glyph);
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1;
}
.glyph-pos { background: var(--paper); border: 2px solid var(--edge); color: var(--graphite); }
.row-text { display: grid; gap: 2px; min-width: 0; }
.row-title { font-weight: 700; font-size: 1.0625rem; line-height: 1.25; }
.row-desc { color: var(--muted); font-size: 0.875rem; line-height: 1.35; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--teal);
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
}
.row-btn[aria-expanded="true"] .pill { background: var(--paper); color: var(--teal); }

/* Result: opens inside the row, indented to the text column */
.panel { display: grid; gap: var(--s2); padding: 0 var(--s4) var(--s4); }
@media (min-width: 400px) {
  .panel { padding-left: calc(var(--s4) + var(--glyph) + var(--s3)); }
}
mark {
  padding: 0 0.15em;
  background: linear-gradient(transparent 38%, var(--mark) 38%, var(--mark) 92%, transparent 92%);
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.res-big { font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.res-text { font-size: 1.125rem; font-weight: 600; line-height: 1.5; text-wrap: pretty; }
.res-note { color: var(--muted); font-size: 0.875rem; }

/* Feedback: a strip attached under the result */
.vote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin-top: var(--s1);
  padding: var(--s2) var(--s3);
  border-radius: 12px;
  background: var(--sunk);
}
.vote-q { font-size: 0.9375rem; font-weight: 600; margin-right: auto; }
.vote-btns { display: flex; gap: var(--s2); }
.vote-btns button {
  min-width: 60px;
  min-height: 44px;
  padding: 0 var(--s4);
  border: 1.5px solid var(--graphite);
  border-radius: 10px;
  background: var(--paper);
  color: var(--graphite);
  font: 600 0.9375rem/1 var(--font);
  cursor: pointer;
}
.vote-btns button:hover { border-color: var(--teal); color: var(--teal); }
.vote-btns button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: #fff; }
.vote.is-voted button[aria-pressed="false"] { opacity: 0.45; }
.vote.is-voted button { cursor: default; }
.vote-status { flex-basis: 100%; color: var(--teal-deep); font-size: 0.875rem; font-weight: 700; }
.vote-status:empty { display: none; }

/* Visual clue */
.visual figure { display: grid; gap: var(--s2); margin: 0; }
.img-slot { overflow: hidden; aspect-ratio: 3 / 2; border-radius: 12px; background: var(--sunk); }
.img-slot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.visual figcaption { font-size: 0.9375rem; }

/* Rail cards */
.panel-card { padding: var(--s5) var(--s4); border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.panel-card h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
.card-desc { margin-top: 2px; color: var(--muted); font-size: 0.9375rem; }

.answer { display: grid; gap: var(--s4); }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s2); max-width: 320px; }
.tile {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--edge);
  border-radius: 10px;
  background: var(--sunk);
  color: var(--graphite);
  font: 700 clamp(1.5rem, 1.1rem + 2vw, 1.875rem)/1 var(--font);
  cursor: pointer;
}
.tile::before {
  content: attr(data-pos);
  position: absolute;
  top: 4px;
  left: 6px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
}
.tile [data-letter]:empty::before { content: "?"; color: var(--edge); font-size: 0.8em; }
.tile:hover:not(.is-revealed) { border-color: var(--teal); background: var(--paper); }
.tile.is-revealed { border-color: var(--teal); background: var(--paper); box-shadow: inset 0 -7px 0 var(--mark); cursor: default; }
.answer.is-whole .tile { border-color: var(--teal); background: var(--teal); color: #fff; box-shadow: none; }
.answer.is-whole .tile::before { color: #bfe0e0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--s5);
  border: 1.5px solid var(--teal);
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font: 700 1rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--teal-deep); border-color: var(--teal-deep); }
.btn[aria-expanded="true"] { background: var(--paper); color: var(--teal); }
.btn[aria-expanded="true"]:hover { background: var(--sunk); }
.answer .btn { width: 100%; }

.answer-full { display: grid; gap: var(--s1); }
.answer-word { font-size: 1.75rem; font-weight: 700; letter-spacing: 0.1em; line-height: 1.15; }
.answer-meaning { font-size: 1rem; }

/* Yesterday */
.yday { background: var(--sunk); border-color: transparent; }
.yday-date { margin-top: var(--s2); font-weight: 600; }
.yday-date .num { color: var(--muted); }
.solved { display: flex; gap: 6px; margin: var(--s3) 0; }
.solved > [aria-hidden] {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--graphite);
  color: #fff;
  font-weight: 700;
  font-size: 1.25rem;
}
.yday-meaning { margin-bottom: var(--s2); }
.more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

.foot { padding: var(--s5) 0 var(--s6); border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; }

/* Yesterday page */
.yday-hero { display: grid; gap: var(--s4); justify-items: start; }
.yday-hero .solved { margin: var(--s2) 0 0; gap: var(--s2); width: 100%; }
.yday-hero .solved > [aria-hidden] {
  width: auto;
  height: auto;
  flex: 0 1 68px;
  aspect-ratio: 1;
  border-radius: 12px;
  box-shadow: inset 0 -7px 0 var(--mark);
  font-size: clamp(1.625rem, 1.2rem + 2.4vw, 2.375rem);
}
.yday-hero .yday-meaning { margin: 0; font-size: 1.125rem; max-width: 34em; }
.today-note { color: var(--muted); font-size: 0.875rem; }

@media (prefers-reduced-motion: no-preference) {
  .panel:not([hidden]), .answer-full:not([hidden]) { animation: open 0.18s ease-out; }
  @keyframes open { from { opacity: 0; transform: translateY(-3px); } }
}

@media (min-width: 480px) {
  .brand-name { display: inline; }
}

/* Desktop: keep one reading column; the header's jump links reach Answer and Yesterday */
@media (min-width: 1000px) {
  .shell { max-width: 760px; padding-inline: var(--s5); }
  main { padding-top: var(--s7); }
}

.vote-status.is-error { color:var(--state-error); }
.vote-status.is-pending { color:var(--ink-muted); }
.notice { background:var(--state-notice-soft);color:var(--state-notice);padding:12px 16px;border-radius:12px; }
.foot p + p { margin-top:8px; }
.tile::before { font-size:12px; }
.img-slot { position:relative; }
.image-signature { position:absolute;top:0;right:0;z-index:1;padding:4px 8px;background:var(--ink);color:var(--ink-on-accent);font-size:clamp(12px,2.4vw,13px);font-weight:600;line-height:1.2;border-radius:0 0 0 8px;pointer-events:none; }
.retry { margin-top:8px; }
.product-info { display:grid;gap:12px; }
.product-info h2 { margin-top:12px;font-size:1.2rem; }
.foot details { margin-top:8px; }
.foot summary { width:max-content;cursor:pointer;min-height:44px;padding-block:12px;color:var(--accent);font-weight:600; }
.foot details p { max-width:65ch;margin-top:8px; }

.privacy-links a,.cookie-settings a{color:inherit;text-decoration:underline;text-underline-offset:.16em}
.cookie-settings{position:fixed;z-index:10;inset:auto 1rem 1rem auto;width:min(30rem,calc(100% - 2rem));padding:1.1rem 1.25rem;border:1px solid #4a5558;border-radius:1rem;background:#fff;color:#1b2428;box-shadow:0 6px 24px #17272824}
.cookie-settings h2,.cookie-settings p{margin:0 0 .5rem}
.cookie-settings h2{font-size:1.1rem}
.cookie-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.7rem}
.cookie-actions .btn{font-size:.9rem;min-height:44px}
.policy{max-width:42rem;margin:2.5rem auto}
.policy h2{font-size:1.25rem;margin-top:1.5rem}
