:root {
  color-scheme: light;
  --paper: #f4f8fc;
  --sheet: #ffffff;
  --ink: #102a43;
  --muted: #526a7d;
  --line: #c8d6e2;
  --blue: #185fa5;
  --blue-dark: #124b82;
  --blue-soft: #dcecf9;
  --marker: #ffd43b;
  --marker-soft: #fff3a6;
  --teal: #18765b;
  --teal-soft: #d9f2e9;
  --berry: #a23b63;
  --danger: #a32a32;
  --shadow: 0 12px 36px rgba(16, 42, 67, 0.13);
  --ad-pad: 0px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ui-scale: 1;
  --letter-size: clamp(1.32rem, 7.1vw, 2.25rem);
  font-family: "Atkinson Hyperlegible Next", Verdana, Arial, sans-serif;
  font-size: calc(16px * var(--ui-scale));
  background: var(--paper);
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:root[data-text-size="extra"] {
  --ui-scale: 1.08;
  --letter-size: clamp(1.5rem, 7.8vw, 2.45rem);
}

:root[data-text-size="largest"] {
  --ui-scale: 1.16;
  --letter-size: clamp(1.62rem, 8.3vw, 2.65rem);
}

:root[data-contrast="highest"] {
  --paper: #ffffff;
  --sheet: #ffffff;
  --ink: #000000;
  --muted: #222222;
  --line: #000000;
  --blue: #004b87;
  --blue-dark: #00345e;
  --blue-soft: #d9efff;
  --marker: #ffdf00;
  --marker-soft: #fff176;
  --teal: #006644;
  --teal-soft: #d7f5e8;
  --berry: #8a004f;
  --shadow: 0 0 0 2px #000000;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--paper);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

:focus-visible {
  outline: 4px solid var(--marker);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: calc(var(--safe-top) + 8px);
  left: 12px;
  transform: translateY(-180%);
  padding: 12px 16px;
  border: 3px solid var(--ink);
  background: var(--marker);
  color: #000000;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.app-shell {
  min-height: 100dvh;
  padding-bottom: calc(86px + var(--safe-bottom) + var(--ad-pad));
}

.app-shell.is-puzzle {
  padding-bottom: calc(20px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: calc(72px + var(--safe-top));
  padding: calc(12px + var(--safe-top)) 16px 12px;
  border-bottom: 2px solid var(--ink);
  background: color-mix(in srgb, var(--sheet) 96%, transparent);
  backdrop-filter: blur(12px);
}

.brand-button,
.text-size-button,
.back-button {
  min-height: 48px;
  border: 0;
  background: transparent;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px;
  text-align: left;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 17px);
  grid-template-rows: repeat(2, 17px);
  overflow: hidden;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  gap: 2px;
}

.brand-mark span {
  display: grid;
  place-items: center;
  background: var(--sheet);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.brand-mark span:first-child,
.brand-mark span:nth-child(2) {
  background: var(--marker);
  color: #000000;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 800;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.text-size-button {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--sheet);
  font-size: 0.82rem;
  font-weight: 800;
}

.text-size-button .aa {
  font-size: 1.2rem;
  line-height: 1;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  color: var(--blue-dark);
  font-weight: 800;
}

.back-button svg {
  width: 24px;
  height: 24px;
}

.puzzle-bar-title {
  min-width: 0;
  flex: 1;
}

.puzzle-bar-title strong,
.puzzle-bar-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.puzzle-bar-title strong {
  font-size: 1rem;
}

.puzzle-bar-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.main {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.paper {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.paper::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: var(--blue);
  content: "";
}

.daily-paper {
  padding: clamp(24px, 7vw, 46px) clamp(22px, 7vw, 52px) 28px;
}

.date-line {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.daily-paper h1,
.screen-title {
  margin: 0;
  max-width: 15ch;
  font-size: clamp(2rem, 9vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.theme-stamp {
  display: inline-block;
  margin: 22px 0 8px;
  padding: 5px 9px 4px;
  border: 2px solid currentColor;
  border-radius: 4px;
  color: var(--theme-accent, var(--blue));
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
}

.daily-note {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.plain-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 13px 19px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.primary-button {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 4px 4px 0 var(--ink);
}

.primary-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.secondary-button {
  background: var(--marker);
  color: #000000;
  box-shadow: 4px 4px 0 var(--ink);
}

.plain-button {
  background: var(--sheet);
  color: var(--ink);
}

.danger-button {
  border-color: var(--danger);
  background: var(--sheet);
  color: var(--danger);
}

.wide-button {
  width: 100%;
}

.comfort-panel {
  margin-top: 20px;
  padding: 20px 18px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--blue-soft);
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.section-heading,
.comfort-panel h2 {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.comfort-panel p,
.section-intro {
  margin: 7px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmented.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segment-button {
  min-height: 54px;
  padding: 8px 6px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--sheet);
  font-weight: 800;
  line-height: 1.12;
}

.segment-button[aria-pressed="true"] {
  background: var(--ink);
  color: #ffffff;
}

.segment-button .size-sample {
  display: block;
  margin-bottom: 2px;
  font-weight: 800;
}

.segment-button[data-value="large"] .size-sample { font-size: 1rem; }
.segment-button[data-value="extra"] .size-sample { font-size: 1.18rem; }
.segment-button[data-value="largest"] .size-sample { font-size: 1.36rem; }

.section-block {
  margin-top: 30px;
}

.text-link {
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.continue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 17px 18px 17px 24px;
  border: 2px solid var(--ink);
  border-left: 10px solid var(--teal);
  border-radius: 8px;
  background: var(--sheet);
}

.continue-row strong,
.continue-row span {
  display: block;
}

.continue-row strong {
  font-size: 1.08rem;
}

.continue-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.continue-row button {
  min-width: 104px;
}

.index-list {
  margin-top: 12px;
  border-top: 2px solid var(--ink);
  background: var(--sheet);
}

.index-row {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 12px 5px 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.index-row::after {
  width: 12px;
  height: 12px;
  border-right: 3px solid var(--ink);
  border-top: 3px solid var(--ink);
  transform: rotate(45deg);
  content: "";
}

.index-colour {
  align-self: stretch;
  border-radius: 2px;
  background: var(--row-accent, var(--blue));
}

.index-copy strong,
.index-copy span {
  display: block;
}

.index-copy strong {
  font-size: 1.04rem;
}

.index-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: var(--ad-pad);
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: calc(72px + var(--safe-bottom));
  padding: 5px 6px var(--safe-bottom);
  border-top: 2px solid var(--ink);
  background: var(--sheet);
}

.nav-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  padding: 4px 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.nav-button svg {
  width: 25px;
  height: 25px;
}

.nav-button[aria-current="page"] {
  background: var(--marker);
  color: #000000;
}

.screen-heading {
  margin: 4px 0 24px;
}

.screen-title {
  max-width: none;
}

.group-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 4px 16px 12px;
  scrollbar-width: thin;
}

.group-tab {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 9px 14px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--sheet);
  font-weight: 800;
}

.group-tab[aria-pressed="true"] {
  background: var(--ink);
  color: #ffffff;
}

.stat-ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 2px solid var(--ink);
  background: var(--sheet);
}

.stat-cell {
  min-height: 134px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-cell:nth-child(2n) { border-right: 0; }
.stat-cell:nth-last-child(-n + 2) { border-bottom: 0; }

.stat-cell strong,
.stat-cell span {
  display: block;
}

.stat-cell strong {
  font-size: clamp(2.7rem, 13vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.stat-cell span {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 14px;
}

.day-mark {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--sheet);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.day-mark.done {
  border-color: var(--ink);
  background: var(--marker);
  color: #000000;
}

.bookmark-list {
  border-top: 2px solid var(--ink);
}

.bookmark {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.bookmark-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 48px;
  background: var(--line);
  color: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  font-weight: 800;
}

.bookmark.earned .bookmark-mark {
  background: var(--marker);
  color: #000000;
}

.bookmark strong,
.bookmark span {
  display: block;
}

.bookmark span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.settings-list {
  border-top: 2px solid var(--ink);
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row strong,
.setting-row span {
  display: block;
}

.setting-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.35;
}

.switch {
  position: relative;
  width: 64px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--sheet);
}

.switch::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
  transition: transform 150ms ease;
}

.switch[aria-pressed="true"] {
  background: var(--teal-soft);
}

.switch[aria-pressed="true"]::after {
  transform: translateX(26px);
  background: var(--teal);
}

.privacy-note {
  padding: 18px;
  border-left: 8px solid var(--teal);
  background: var(--teal-soft);
  line-height: 1.5;
}

.version-note {
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.puzzle-main {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 14px clamp(8px, 3vw, 24px) 28px;
}

.puzzle-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, 570px);
  margin: 0 auto 9px;
}

.puzzle-progress {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.puzzle-instruction {
  width: min(100%, 570px);
  margin: 0 auto 12px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.puzzle-layout {
  display: grid;
  gap: 18px;
}

.grid-column {
  min-width: 0;
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: min(100%, 570px);
  aspect-ratio: 1;
  margin: 0 auto;
  padding: clamp(5px, 1.8vw, 10px);
  border: clamp(5px, 1.5vw, 9px) solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  gap: clamp(2px, 0.8vw, 5px);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.letter-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--sheet);
  color: var(--ink);
  font-size: var(--letter-size);
  font-weight: 800;
  line-height: 1;
  touch-action: none;
}

.letter-cell.found {
  background: var(--marker);
  color: #000000;
}

.letter-cell.selecting,
.letter-cell.tap-start {
  background: var(--blue);
  color: #ffffff;
  box-shadow: inset 0 0 0 3px var(--marker);
}

.letter-cell.hinted {
  z-index: 1;
  box-shadow: inset 0 0 0 5px var(--berry);
}

.selection-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  width: min(100%, 570px);
  margin: 8px auto 0;
  padding: 8px 14px;
  border-bottom: 2px solid var(--line);
  color: var(--blue-dark);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}

.word-panel {
  min-width: 0;
}

.word-panel h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.word-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}

.word-item {
  position: relative;
  min-width: 0;
  min-height: 50px;
  padding: 13px 7px 11px 28px;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.word-item::before {
  position: absolute;
  top: 50%;
  left: 5px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  transform: translateY(-50%);
  content: "";
}

.word-item.found {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 2px;
}

.word-item.found::before {
  border-color: var(--ink);
  background: var(--marker);
  box-shadow: inset 3px -3px 0 -1px var(--marker);
}

.word-item.found::after {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 9px;
  height: 5px;
  border-bottom: 3px solid #000000;
  border-left: 3px solid #000000;
  transform: translateY(-70%) rotate(-45deg);
  content: "";
}

.puzzle-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.puzzle-tools button {
  min-width: 0;
}

.sheet-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px 12px calc(18px + var(--safe-bottom));
  background: rgba(4, 19, 32, 0.72);
}

.sheet {
  width: min(100%, 560px);
  max-height: min(88dvh, 760px);
  overflow-y: auto;
  padding: 24px;
  border: 3px solid var(--ink);
  border-radius: 12px 12px 7px 7px;
  background: var(--sheet);
  box-shadow: 8px 8px 0 var(--ink);
}

.sheet h2 {
  margin: 0;
  font-size: clamp(1.65rem, 7vw, 2.4rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.sheet > p {
  margin: 9px 0 20px;
  color: var(--muted);
  line-height: 1.48;
}

.sheet-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.difficulty-list {
  border-top: 2px solid var(--ink);
}

.difficulty-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 10px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.difficulty-button strong,
.difficulty-button span {
  display: block;
}

.difficulty-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.difficulty-button b {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--marker);
  color: #000000;
}

.completion-backdrop {
  align-items: center;
}

.completion-sheet {
  position: relative;
  overflow: hidden;
  text-align: left;
}

.completion-sheet::before {
  position: absolute;
  top: 46px;
  right: -16px;
  left: -16px;
  z-index: 0;
  height: 74px;
  transform: rotate(-2deg);
  background: var(--marker);
  content: "";
}

.completion-sheet > * {
  position: relative;
  z-index: 1;
}

.complete-kicker {
  margin: 0 0 14px;
  font-weight: 800;
}

.completion-sheet h2 {
  max-width: 10ch;
  color: #000000;
}

.complete-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 32px 0 8px;
  border: 2px solid var(--ink);
}

.complete-summary div {
  padding: 13px;
}

.complete-summary div + div {
  border-left: 1px solid var(--line);
}

.complete-summary strong,
.complete-summary span {
  display: block;
}

.complete-summary strong {
  font-size: 1.8rem;
}

.complete-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 90;
  right: 16px;
  bottom: calc(88px + var(--safe-bottom) + var(--ad-pad));
  left: 16px;
  width: fit-content;
  max-width: min(520px, calc(100% - 32px));
  margin: auto;
  padding: 13px 17px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: 4px 4px 0 var(--marker);
  font-weight: 800;
  line-height: 1.35;
}

.is-puzzle .toast {
  bottom: calc(16px + var(--safe-bottom));
}

@media (min-width: 760px) {
  .main {
    padding-top: 30px;
  }

  .daily-paper {
    min-height: 390px;
  }

  .puzzle-layout {
    grid-template-columns: minmax(460px, 570px) minmax(230px, 1fr);
    align-items: start;
    justify-content: center;
  }

  .word-panel {
    position: sticky;
    top: calc(94px + var(--safe-top));
    padding: 12px 14px 16px;
    border: 2px solid var(--ink);
    background: var(--sheet);
  }

  .word-list {
    grid-template-columns: 1fr;
  }

  .sheet-backdrop {
    align-items: center;
  }
}

@media (max-width: 390px) {
  .brand-copy small,
  .text-size-button .text-size-label {
    display: none;
  }

  .text-size-button {
    min-width: 52px;
    justify-content: center;
  }

  .main {
    padding-right: 12px;
    padding-left: 12px;
  }

  .daily-paper {
    padding-right: 21px;
    padding-left: 25px;
  }

  .segmented {
    gap: 4px;
  }

  .segment-button {
    padding-right: 3px;
    padding-left: 3px;
    font-size: 0.76rem;
  }

  .puzzle-main {
    padding-right: 5px;
    padding-left: 5px;
  }

  .group-tabs {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .puzzle-status,
  .puzzle-instruction,
  .word-panel {
    margin-right: 5px;
    margin-left: 5px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .topbar {
    position: relative;
    min-height: calc(58px + var(--safe-top));
    padding-top: calc(6px + var(--safe-top));
    padding-bottom: 6px;
  }

  .puzzle-main {
    padding-top: 8px;
  }

  .letter-grid {
    width: min(430px, 100%);
  }

  .selection-readout,
  .puzzle-status,
  .puzzle-instruction {
    width: min(430px, 100%);
  }
}

@media (min-width: 760px) and (max-height: 520px) and (orientation: landscape) {
  .puzzle-layout {
    grid-template-columns: minmax(430px, 480px) minmax(250px, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
