/* Shared pages and the interface preview. */
html { scroll-padding-top: 14px; }
.site-header { position: relative; z-index: 3; }
.header-inner { grid-template-columns: auto 1fr auto; gap: clamp(.75rem, 3vw, 2rem); position: relative; }
.header-nav { justify-content: center; gap: clamp(.2rem, 1vw, .8rem); }
.header-nav a { text-decoration: none; }
.nav-category > summary {
  display: flex; align-items: center; gap: .45rem; padding: .5rem .65rem; cursor: pointer; border-radius: .4rem;
  font-size: .94rem; font-weight: 800; white-space: nowrap; list-style: none;
}
.nav-category > summary::-webkit-details-marker { display: none; }
.nav-category > summary::after { content: ""; width: .4rem; height: .4rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.nav-category > summary:hover, .nav-category[open] > summary, .nav-active > summary { background: var(--bluewash); color: var(--navy); }
.nav-category[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.nav-panel {
  position: absolute; top: calc(100% - .25rem); left: 50%; transform: translateX(-50%);
  width: min(52rem, 100%); padding: 1.2rem; border: 1.5px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px var(--ink); background: var(--white); z-index: 2;
}
.header-nav .nav-directory { display: inline-block; padding: .2rem 0 .65rem; color: var(--navy); }
.nav-columns { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.nav-columns p { font-weight: 800; font-size: .9rem; color: var(--navy); margin-bottom: .25rem; }
.nav-columns ul { list-style: none; padding: 0; margin: 0; }
.nav-columns li a { display: block; padding: .43rem 0; font-size: .92rem; line-height: 1.3; }
.nav-columns a[aria-current="page"] { text-decoration: underline; text-underline-offset: .2rem; color: var(--navy); }
.mobile-menu { display: none; }
.site-main { padding-bottom: var(--section-gap); min-height: 65vh; }
.site-footer .footer-inner { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.footer-inner nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.05rem; }
.footer-inner nav a { font-size: .88rem; text-decoration: none; padding: .2rem 0; font-weight: 700; }

.page-heading { padding-block-start: 1.8rem; }
.site-main > .page-heading + * { margin-block-start: var(--section-gap); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .3rem .65rem; margin-bottom: .95rem; color: var(--muted); font-size: .875rem; }
.breadcrumbs a { text-underline-offset: .15rem; }
.page-heading h1 { color: var(--navy); font-size: clamp(2.15rem, 5.8vw, 4.25rem); font-weight: 800; letter-spacing: -.055em; word-spacing: .02em; overflow-wrap: anywhere; }
.page-heading p { max-width: 48rem; margin-top: .7rem; color: var(--muted); font-size: clamp(1rem, 2vw, 1.13rem); }
.hero h1 { letter-spacing: -.066em; }
.hero p { max-width: 37rem; }

.preview .result-card { min-height: 0; }
.preview .result-heading { margin-bottom: .45rem; }
.preview .result-heading h2 { min-width: 0; }
.preview .match-count { flex: 0 0 auto; margin-left: auto; }
.sample-list .result-word { letter-spacing: .035em; }
.sample-list .result-item { gap: .6rem; }
.sample-list .result-score { flex-shrink: 0; white-space: nowrap; }
.preview-status { min-height: 1.25em; margin-top: .65rem; color: var(--navy); font-size: .875rem; }
.preview-status:empty { display: none; }
.preview-note {
  margin: 0 0 1.05rem; padding: .65rem .85rem; background: var(--bluewash); border-left: 3px solid var(--navy);
  color: var(--muted); font-size: .9rem;
}
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .8rem; }
.field-wide { grid-column: 1/-1; }
.field input, .field textarea, .field select {
  min-height: 44px; width: 100%; padding: .5rem .65rem; border: 1px solid var(--ink); border-radius: 7px; background: var(--white);
  color: var(--ink); font: inherit; font-size: 1rem; font-weight: 650; text-transform: none;
}
.field textarea { resize: vertical; }
.field select { background: var(--bluewash); }
.field-grid .field-hint { margin: 0; font-weight: 500; }
.field-grid .advanced { margin: 0; }
.field-grid .check-field { min-height: 36px; }
.feedback-box { grid-column: 1/-1; display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; }
.feedback-box .field { width: 9rem; }
.feedback-row { display: flex; flex-wrap: wrap; gap: .32rem; }
.feedback-tile[data-color="2"] { background: var(--lime); }
.feedback-tile[data-color="1"] { background: var(--yellow); }
.feedback-tile[data-color="0"] { background: var(--bluewash); }
.feedback-tile [data-symbol] { font-size: .76rem; }
.feedback-key { margin-bottom: 0; }
.panel-set .mode-tabs { margin-bottom: .8rem; }
.panel-content { min-width: 0; }

.content-section { margin-top: var(--section-gap); min-width: 0; }
.content-section > h2 { margin-bottom: .72rem; }
.content-section > p + p, .prose-card p + p { margin-top: .65rem; }
.guide-layout, .article-columns { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 1.25rem; align-items: start; }
.instruction-card, .example-card, .prose-card { padding: 1.25rem; }
.instruction-card { background: var(--bluewash); }
.example-card { background: var(--yellow); }
.example-code { font-weight: 800; overflow-wrap: anywhere; margin-bottom: .55rem; }
.example-code code { background: #fff9e1; border: 1px solid var(--ink); border-radius: 5px; padding: .12rem .32rem; }
.steps { padding-left: 1.35rem; margin: 0; }
.steps li { padding-left: .18rem; }
.steps li + li { margin-top: .53rem; }
.steps li::marker { color: var(--navy); font-weight: 800; }
.disclosure { border: 1px solid var(--ink); border-radius: .55rem; background: var(--white); }
.disclosure + .disclosure { margin-top: .55rem; }
.disclosure summary { padding: .68rem .85rem; cursor: pointer; font-weight: 800; }
.disclosure summary:hover { color: var(--navy); }
.disclosure > p, .disclosure-content { padding: 0 .85rem .8rem; }
.link-list, .pill-list { display: flex; flex-wrap: wrap; gap: .55rem; list-style: none; padding: 0; margin: 0; }
.link-list a, .pill-list a { display: inline-block; padding: .37rem .65rem; border: 1px solid var(--ink); border-radius: 6px; background: var(--white); color: var(--navy); text-decoration: none; font-size: .9rem; font-weight: 800; }
.link-list a:hover, .pill-list a:hover, .pill-list a[aria-current="page"] { color: var(--ink); background: var(--lime); }

.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.directory-card { display: flex; flex-direction: column; align-items: flex-start; gap: .38rem; min-width: 0; min-height: 0; padding: .95rem; text-decoration: none; }
.directory-card:hover { background: var(--bluewash); }
.directory-card strong { font-size: 1.07rem; color: var(--navy); line-height: 1.3; }
.directory-card > span:last-child { font-size: .93rem; color: var(--muted); }
.directory-glyph { min-width: 2.35rem; height: 2rem; display: inline-grid; place-items: center; padding: 0 .32rem; border: 1px solid var(--ink); border-radius: .3rem; color: var(--navy); font-weight: 800; box-shadow: 1px 1px var(--ink); }
.tone-blue { background: var(--bluewash); }
.tone-yellow { background: var(--yellow); }
.tone-lime { background: var(--lime); }
.tile-strip { display: flex; flex-wrap: wrap; gap: .32rem; margin: .7rem 0; }
.tile-strip > span:not(.visually-hidden) {
  display: inline-grid; place-items: center; width: 2.1rem; height: 2.2rem; background: var(--bluewash);
  border: 1px solid var(--ink); border-radius: .3rem; font-weight: 800; color: var(--navy);
}
.tile-strip > .tile-yellow:not(.visually-hidden) { background: var(--yellow); }
.tile-strip > .tile-lime:not(.visually-hidden) { background: var(--lime); }
.table-wrap { overflow-x: auto; border: 1px solid var(--ink); border-radius: .55rem; background: var(--white); }
.sample-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.sample-table th, .sample-table td { padding: .65rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.sample-table thead th { background: var(--bluewash); color: var(--navy); }
.sample-table tbody tr:last-child > * { border-bottom: 0; }
.clue-set { display: grid; gap: .55rem; }
.clue-set .disclosure + .disclosure { margin: 0; }
.prose { max-width: 48rem; }
.prose-layout { display: grid; grid-template-columns: minmax(0, 46rem) minmax(12rem, 1fr); gap: 1.5rem; align-items: start; }
.prose-layout > aside { margin-block-start: 0; }
.prose .content-section:first-child, .toc .content-section:first-child { margin-top: 0; }
.prose .content-section { scroll-margin-top: 1rem; }
.prose p { font-size: 1rem; line-height: 1.68; }
.toc { background: var(--bluewash); padding: .9rem; }
.toc h2 { font-size: 1.15rem; }
.toc ul { padding-left: 1.15rem; margin-bottom: 0; }
.toc li + li { margin-top: .42rem; }
.toc a { text-underline-offset: 3px; }
.practice-board { display: grid; gap: .9rem; width: min(100%, 36rem); }
.preview .practice-board { width: 100%; }
.puzzle-grid { display: grid; grid-template-columns: repeat(var(--size), minmax(0, 1fr)); gap: .3rem; width: min(100%, calc(var(--size) * 2.8rem)); }
.puzzle-grid > * { width: 100%; min-width: 0; aspect-ratio: 1; min-height: 32px; border: 1px solid var(--ink); border-radius: .3rem; background: var(--white); color: var(--navy); display: grid; place-items: center; text-align: center; font-size: 1.02rem; padding: .1rem; font-weight: 800; }
.puzzle-grid > button[aria-pressed="true"], .puzzle-grid > button[data-face="1"] { background: var(--yellow); }
.puzzle-grid > button[data-face="2"], .puzzle-grid > input[readonly] { background: var(--bluewash); }
.puzzle-grid > .edge { border-right-width: 2.5px; }
.puzzle-grid > .base-edge { border-bottom-width: 2.5px; }
.game-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.game-actions .field { flex: 1 1 12rem; }
.game-actions [role="status"] { flex-basis: 100%; color: var(--navy); font-size: .88rem; }
.contact-form { max-width: 38rem; display: grid; gap: .85rem; }

@media (max-width: 950px) {
  .header-inner { grid-template-columns: auto 1fr; min-height: 65px; gap: .3rem 0; }
  .header-action { display: none; }
  .header-nav { justify-content: flex-end; gap: .2rem; }
  .nav-category > summary { padding-inline: .5rem; font-size: .89rem; }
  .footer-inner nav { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .header-inner { position: static; }
  .mobile-menu { display: inline-flex; justify-self: end; min-height: 39px; }
  .header-nav { grid-row: 2; grid-column: 1/-1; flex-wrap: wrap; justify-content: stretch; border: 0; width: 100%; }
  .js .header-nav:not(.mobile-open) { display: none; }
  .nav-category { width: 100%; }
  .nav-category > summary { min-height: 42px; justify-content: space-between; }
  .nav-panel { position: static; transform: none; width: 100%; padding: .72rem; box-shadow: 2px 2px var(--ink); }
  .nav-columns { gap: .65rem; }
  .nav-columns li a { padding-block: .52rem; font-size: .9rem; }
  .site-header:has(.mobile-open) .header-nav { padding-bottom: .75rem; }
  .page-heading { padding-block-start: 1.2rem; }
  .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prose-layout, .guide-layout, .article-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .prose-layout { row-gap: var(--section-gap); }
  .prose-layout .toc { order: -1; margin-bottom: 1.3rem; }
}
@media (max-width: 535px) {
  .hero .hero-copy p { margin-top: .45rem; }
  .hero { padding-top: .95rem; }
  .hero h1 { font-size: clamp(2.2rem, 10vw, 3.2rem); }
  .nav-columns { grid-template-columns: 1fr; }
  .nav-columns > div + div { border-top: 1px solid var(--line); padding-top: .55rem; }
  .nav-columns ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .45rem; }
  .site-footer .footer-inner { grid-template-columns: 1fr auto; gap: .6rem; }
  .footer-inner nav { grid-row: 2; grid-column: 1/-1; }
  .field-grid { gap: .55rem; }
  .feedback-box { gap: .42rem; }
  .mode-tabs[role="tablist"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-tabs[role="tablist"] > button { grid-column: auto; }
  .directory-card { padding: .75rem; }
}
.directory-more { margin-top: 1rem; }
.board-heading { margin-bottom: .85rem; }
.game-toolbar { margin-bottom: .85rem; max-width: 15rem; }
.game-label { font-size: .95rem; }
.puzzle-grid.notes input:not([readonly]) { font-size: .73rem; color: var(--muted); }
@media (max-width: 535px) {
  .puzzle-grid[style="--size:9"] { gap: .18rem; }
  .puzzle-grid[style="--size:9"] > * { min-height: 0; font-size: .86rem; }
  .puzzle-grid[style="--size:9"].notes input:not([readonly]) { font-size: .63rem; }
}
.daily-card-surface { max-width: 56rem; background: var(--white); }
.daily-card-surface .disclosure-content > p + .clue-set { margin-top: .7rem; }
.word-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.word-board button[aria-pressed="true"] { background: var(--yellow); }
.gap-block { margin-top: 1rem; }
@media (max-width: 535px) {
  .word-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
  .sample-table th, .sample-table td { padding: .48rem; font-size: .85rem; }
}
.sitemap-links { columns: 3 14rem; padding-left: 1.2rem; }
.sitemap-links li { break-inside: avoid; padding: .24rem 0; }
.sitemap-links a { text-underline-offset: .16rem; }
.field select {
  appearance: none; padding-right: 1.9rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 51%), linear-gradient(135deg, var(--navy) 50%, transparent 51%);
  background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
html:not(.js) .mobile-menu { display: none; }

.lw-board-picker { margin-bottom: 1rem; }
.lw-board-picker [aria-pressed="true"] { background: var(--yellow); }

.boxed-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-areas: ". top ." "left center right" ". bottom .";
  gap: .5rem;
  padding: .8rem;
  margin: .8rem 0;
  border: 1px solid var(--navy);
  border-radius: .75rem;
  background: var(--bluewash);
}
.boxed-side input { width: 100%; min-width: 0; text-align: center; text-transform: uppercase; }
.boxed-side.side-top { grid-area: top; }
.boxed-side.side-right { grid-area: right; }
.boxed-side.side-bottom { grid-area: bottom; }
.boxed-side.side-left { grid-area: left; }
.boxed-center {
  grid-area: center;
  align-self: stretch;
  display: grid;
  place-content: center;
  padding: .3rem;
  border: 1px dashed var(--navy);
  border-radius: .5rem;
  background: var(--paper);
  font-size: .8rem;
  text-align: center;
  overflow-wrap: anywhere;
}
.boxed-center:empty::before { content: "□"; color: var(--navy); font-size: 1.5rem; }
.boxed-solution { text-align: start; }
.cipher-details { margin-block: 1rem; }
.cipher-details h3 { margin-block: .75rem .35rem; }
.cipher-details p { white-space: pre-wrap; overflow-wrap: anywhere; font-family: monospace; }
[data-word-tool] textarea {
  width: 100%;
  padding: .6rem;
  resize: vertical;
  border: 1px solid var(--navy);
  border-radius: .45rem;
  color: inherit;
  font: inherit;
}
.boxed-center [data-boxed-edge] {
  display: inline-block;
  margin: .1rem .06rem;
  padding-inline: .14rem;
  border-radius: .2rem;
  color: var(--ink);
  font-weight: 800;
}
.boxed-center [data-boxed-edge="top"], .boxed-side.side-top input { background: var(--yellow); }
.boxed-center [data-boxed-edge="right"], .boxed-side.side-right input { background: var(--lime); }
.boxed-center [data-boxed-edge="bottom"], .boxed-side.side-bottom input { background: #e6dfff; }
.boxed-center [data-boxed-edge="left"], .boxed-side.side-left input { background: #ffd9be; }
