/* ==========================================================================
   a2zimg — "clean classroom paper" design system
   One shared stylesheet for the whole site. No per-page CSS forks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --paper: #FAF7F0;
  --ink: #22301F;
  --board: #2F5D46;
  --pencil: #F2B63C;
  --line: #DCD5C3;
  --danger: #B4552D;

  --ink-soft: rgba(34, 48, 31, 0.72);
  --ink-shadow: rgba(34, 48, 31, 0.18);
  --grid-line: rgba(34, 48, 31, 0.05);

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --radius: 9px;
  --shadow-card: 4px 4px 0 var(--ink-shadow);
  --shadow-btn: 3px 3px 0 var(--ink-shadow);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;

  --container: 1120px;
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* --------------------------------------------------------------------------
   Custom scrollbar — matches the paper/ink/board theme
   -------------------------------------------------------------------------- */
/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--board) var(--paper);
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 13px;
  height: 13px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
  border-left: 1px solid var(--line);
}

::-webkit-scrollbar-thumb {
  background: var(--board);
  border: 3px solid var(--paper);   /* inset padding so the thumb looks slim */
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #244b38;              /* slightly darker board */
}

::-webkit-scrollbar-thumb:active {
  background: var(--ink);
}

::-webkit-scrollbar-corner {
  background: var(--paper);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--board);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--ink);
}

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

/* App-like smooth page transitions. Chrome/Edge animate a soft cross-fade
   between pages; other browsers simply navigate normally — nothing breaks.
   The header and footer are named so they stay steady while the content
   cross-fades, which makes navigation feel like a single app. */
@view-transition {
  navigation: auto;
}

.site-header { view-transition-name: site-header; }
.site-footer { view-transition-name: site-footer; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
}

/* Respect users who prefer reduced motion — no animation for them. */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

hr {
  border: 0;
  border-top: 1.5px solid var(--line);
  margin: var(--space-5) 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section {
  margin: var(--space-5) 0;
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1023px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 599px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   4. Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--ink);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}

.brand {
  text-decoration: none;
  line-height: 1.15;
}

.brand .wordmark {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--board);
}

.brand .tagline {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-toggle {
  display: none;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-btn);
  padding: 0.4rem 0.8rem;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-4);
}

.site-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: var(--pencil);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--board);
}

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    width: 100%;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    border-top: 1.5px solid var(--line);
    padding: var(--space-2) 0;
  }

  .site-nav a {
    display: block;
    padding: 0.6rem 0;
    border-bottom: none;
    border-left: 3px solid transparent;
    padding-left: var(--space-2);
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    border-left-color: var(--pencil);
  }
}

/* --------------------------------------------------------------------------
   5. Footer (chalkboard)
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--board);
  color: #fff;
  margin-top: var(--space-6);
  border-top: 2px solid var(--ink);
}

.site-footer .container {
  padding-top: var(--space-5);
  padding-bottom: var(--space-4);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

@media (max-width: 767px) {
  .footer-cols {
    grid-template-columns: 1fr;
  }
}

.site-footer h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pencil);
  margin-bottom: var(--space-2);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: var(--space-1);
}

.site-footer a {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--pencil);
  text-decoration: underline;
}

.footer-privacy-line {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.9);
}

/* Suggestion box: a footer button that opens a popup modal */
.suggest-cta {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.suggest-thanks,
.suggest-error {
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  font-size: 0.9rem;
}

.suggest-thanks { background: #EAF3EC; border: 1.5px solid var(--board); color: var(--board); }
.suggest-error  { background: #F7ECE6; border: 1.5px solid var(--danger); color: var(--danger); }

.suggest-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(34, 48, 31, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
}

.suggest-modal[hidden] { display: none; }

.suggest-dialog {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.suggest-dialog h2 {
  color: var(--ink);
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: 1.2rem;
  margin-bottom: var(--space-1);
}

.suggest-lead {
  margin-bottom: var(--space-3);
  color: var(--ink);
  opacity: 0.85;
  font-size: 0.92rem;
}

.suggest-dialog label {
  display: block;
  font-weight: 600;
  margin: var(--space-2) 0 0.25rem;
  font-size: 0.9rem;
}

.suggest-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.suggest-close:hover { color: var(--danger); }

/* Honeypot — visually hidden, kept in the layout for bots to find. */
.suggest-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Top navigation loading bar */
#pageProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 1200;
  background: var(--pencil);
  box-shadow: 0 0 8px var(--pencil);
  opacity: 0;
  pointer-events: none;
}

#pageProgress.loading {
  opacity: 1;
  width: 92%;
  transition: width 8s cubic-bezier(0.1, 0.6, 0.2, 1);
}

#pageProgress.done {
  opacity: 0;
  width: 100%;
  transition: width 0.2s ease, opacity 0.3s ease 0.1s;
}

@media (prefers-reduced-motion: reduce) {
  #pageProgress.loading { transition: none; width: 92%; }
}

/* Spinner (generator preview + any async area) */
.pg-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 260px;
  color: var(--board);
  font-weight: 600;
}

.pg-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--board);
  border-radius: 50%;
  animation: pg-spin 0.8s linear infinite;
}

@keyframes pg-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .pg-spinner { animation-duration: 2s; }
}

/* Animated toast shown after a suggestion is submitted */
.sg-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 460px);
  padding: 14px 18px;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 10px 30px rgba(34, 48, 31, 0.35);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  pointer-events: auto;
  cursor: pointer;
}

.sg-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.sg-toast-ok  { background: var(--board); }
.sg-toast-bad { background: var(--danger); }

.sg-toast-icon {
  font-size: 1.25rem;
  animation: sg-pop 0.5s ease 0.15s both;
}

@keyframes sg-pop {
  0%   { transform: scale(0.3); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .sg-toast { transition: opacity 0.2s ease; transform: translate(-50%, 0); }
  .sg-toast-icon { animation: none; }
}

/* --------------------------------------------------------------------------
   6. Display headings
   -------------------------------------------------------------------------- */
.display {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* Pencil underline-highlight for the key phrase inside an H1 */
.hl {
  box-shadow: inset 0 -0.38em 0 var(--pencil);
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 42em;
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-btn);
  padding: 0.55rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.12s ease;
  margin-top: 21px;
}

.btn:hover {
  background: var(--pencil);
  color: var(--ink);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

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

.btn-primary:hover {
  background: var(--pencil);
  color: var(--ink);
}

.btn-primary:focus-visible {
  outline-color: var(--pencil);
}

.btn-small {
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

.btn[disabled],
.btn[disabled]:hover {
  opacity: 0.5;
  cursor: not-allowed;
  background: #fff;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   8. Cards
   -------------------------------------------------------------------------- */
.card {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
}

.card > :last-child {
  margin-bottom: 0;
}

/* Clickable card (category grids) */
a.card {
  display: block;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

a.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink-shadow);
}

a.card:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.card h3 a {
  color: var(--ink);
}

/* Breadcrumb trail (Home › Printables › Page) */
.breadcrumbs {
  margin: var(--space-3) 0 0;
  font-size: 0.85rem;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
}

.breadcrumbs li + li::before {
  content: "\203A";
  margin-right: 0.35em;
  color: var(--line-strong, var(--line));
}

.breadcrumbs a {
  color: var(--board);
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.card-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--board);
  margin-bottom: var(--space-1);
}

/* Preview card for printables (3:4 image on top) */
.preview-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-card img,
.preview-card .preview-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-bottom: 1.5px solid var(--ink);
}

.preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 25px, var(--line) 25px, var(--line) 26.5px),
    #fff;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

.preview-card .preview-body {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.preview-card .preview-body .btn {
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   9. Forms & tool controls
   -------------------------------------------------------------------------- */
label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.field {
  margin-bottom: var(--space-3);
}

.hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: var(--space-1);
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  width: 100%;
  max-width: 100%;
}

textarea {
  min-height: 8em;
  resize: vertical;
}

/* No hard outline ring on text fields — a soft border + glow instead.
   Still a clearly visible focus state, so keyboard users are not left guessing. */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--board);
  box-shadow: 0 0 0 3px rgba(47, 93, 70, 0.15);
}

/* Segmented control (radio group styled as buttons) */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.segmented label {
  margin: 0;
  padding: 0.45rem 1rem;
  font-weight: 600;
  cursor: pointer;
  border-right: 1.5px solid var(--ink);
}

.segmented label:last-of-type {
  border-right: 0;
}

.segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.segmented input[type="radio"]:checked + span,
.segmented label:has(input:checked) {
  background: var(--board);
  color: #fff;
}

.segmented label:has(input:focus-visible) {
  outline: 3px solid var(--pencil);
  outline-offset: -3px;
}

/* Tool panel: the control surface at the top of tool pages */
.tool-panel {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.tool-panel h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--board);
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

/* Tool page intro */
.tool-head {
  padding: 26px 0 18px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

/* Side-by-side numeric fields inside a panel */
.field-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field-row > div {
  flex: 1;
  min-width: 110px;
}

/* Extra button variants used by tools */
.btn-accent {
  background: var(--pencil);
}

.btn-ghost {
  box-shadow: none;
  border-style: dashed;
  background: transparent;
}

/* Inline warning box (toggled by tool JS via .show) */
.warn {
  display: none;
  margin-top: 10px;
  font-size: 13.5px;
  background: #FBEDE3;
  border: 1.5px solid var(--danger);
  color: #7A3A1D;
  border-radius: 6px;
  padding: 8px 10px;
}

.warn.show {
  display: block;
}

/* --------------------------------------------------------------------------
   10. FAQ (details/summary)
   -------------------------------------------------------------------------- */
.faq details {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  overflow: hidden;
}

.faq summary {
  padding: 0.75rem var(--space-3);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--board);
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details[open] summary {
  border-bottom: 1.5px solid var(--line);
  background: var(--paper);
}

.faq .faq-answer {
  padding: var(--space-3);
}

.faq .faq-answer > :last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   11. Notices
   -------------------------------------------------------------------------- */
.notice {
  border: 1.5px solid var(--ink);
  border-left-width: 6px;
  border-radius: var(--radius);
  background: #fff;
  padding: var(--space-3);
}

.notice-warning {
  border-left-color: var(--danger);
  color: var(--ink);
}

.notice-warning strong {
  color: var(--danger);
}

.notice-info {
  border-left-color: var(--board);
}

/* Privacy strip ("runs in your browser") */
.privacy-strip {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-weight: 600;
}

.privacy-strip a {
  color: var(--pencil);
}

/* --------------------------------------------------------------------------
   12. Prose (SEO content blocks)
   -------------------------------------------------------------------------- */
.prose {
  max-width: 46em;
}

.prose h2 {
  margin-top: var(--space-5);
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

/* --------------------------------------------------------------------------
   13. Utilities
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* --------------------------------------------------------------------------
   14. Seating Chart Maker (.scm) — ported from the tested single-file tool.
   Class names .seat/.off/.toggle/.selected/.dragover/.blank are used by its
   JS and must not change.
   -------------------------------------------------------------------------- */
.scm {
  --seat: #FFFFFF;
  --seat-empty: #EFEAE0;
}

.scm .chart-area {
  margin-top: 22px;
}

.scm .board-bar {
  background: var(--board);
  color: #EAF3EE;
  border: 1.5px solid var(--ink);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 8px;
}

.scm .chart {
  border: 1.5px solid var(--ink);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--seat);
  padding: 16px;
}

.scm .chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 12px;
}

.scm .chart-meta strong {
  font-size: 16px;
}

.scm .seats {
  display: grid;
  gap: 10px;
}

/* Under 480px with more than 4 columns: scroll horizontally instead of
   squeezing seats. The tool JS sets data-cols on the grid when rendering;
   the track minimum is raised to 72px with !important to beat the inline
   grid-template-columns style. */
@media (max-width: 479px) {
  .scm .seats[data-cols="5"],
  .scm .seats[data-cols="6"],
  .scm .seats[data-cols="7"],
  .scm .seats[data-cols="8"],
  .scm .seats[data-cols="9"],
  .scm .seats[data-cols="10"],
  .scm .seats[data-cols="11"],
  .scm .seats[data-cols="12"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .scm .seats[data-cols="5"]  { grid-template-columns: repeat(5,  minmax(72px, 1fr)) !important; }
  .scm .seats[data-cols="6"]  { grid-template-columns: repeat(6,  minmax(72px, 1fr)) !important; }
  .scm .seats[data-cols="7"]  { grid-template-columns: repeat(7,  minmax(72px, 1fr)) !important; }
  .scm .seats[data-cols="8"]  { grid-template-columns: repeat(8,  minmax(72px, 1fr)) !important; }
  .scm .seats[data-cols="9"]  { grid-template-columns: repeat(9,  minmax(72px, 1fr)) !important; }
  .scm .seats[data-cols="10"] { grid-template-columns: repeat(10, minmax(72px, 1fr)) !important; }
  .scm .seats[data-cols="11"] { grid-template-columns: repeat(11, minmax(72px, 1fr)) !important; }
  .scm .seats[data-cols="12"] { grid-template-columns: repeat(12, minmax(72px, 1fr)) !important; }
}

.scm .seat {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--seat);
  min-height: 58px;
  padding: 8px 6px 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  word-break: break-word;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.scm .seat::before { /* desk edge */
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
}

.scm .seat.blank {
  color: #9AA093;
  font-weight: 500;
}

.scm .seat.off {
  background: var(--seat-empty);
  border-style: dashed;
  color: #9AA093;
  cursor: pointer;
}

.scm .seat.off::before {
  display: none;
}

.scm .seat.selected {
  outline: 3px solid var(--pencil);
  outline-offset: 1px;
}

.scm .seat.dragover {
  background: #FDF3DC;
}

.scm .seat .toggle {
  position: absolute;
  top: 2px;
  right: 4px;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 2px 4px;
  font: inherit;
  font-size: 11px;
  color: #9AA093;
  cursor: pointer;
  line-height: 1;
}

.scm .seat .toggle:hover {
  color: var(--danger);
}

.scm .legend {
  font-size: 12.5px;
  color: #5C6656;
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   15. Printable worksheet sheet — shared by the spelling (.swg) and
   handwriting (.hs) tools: white sheet, name/date header, title, empty state.
   -------------------------------------------------------------------------- */
.sheet {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
  margin-top: 22px;
}

.ws-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 15px;
}

.ws-top > span {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.ws-top .fill {
  display: inline-block;
  border-bottom: 1.5px solid var(--ink);
  width: 11em;
}

.ws-top .fill.short {
  width: 6em;
}

.ws-title {
  text-align: center;
  font-weight: 700;
  font-size: 19px;
  margin: 14px 0 2px;
}

.ws-instr {
  text-align: center;
  font-size: 13.5px;
  color: #5C6656;
  margin: 0 0 20px;
}

.ws-empty {
  color: #9AA093;
  text-align: center;
  margin: 24px 0;
  font-size: 16px;
}

/* ----- Spelling Worksheet Generator (.swg) --------------------------------
   Grade presets set the type size and row spacing via CSS variables. */
.swg .sheet {
  --ws-size: 26px;
  --ws-gap: 28px;
}

.swg .sheet.grade-k1  { --ws-size: 34px; --ws-gap: 40px; }
.swg .sheet.grade-g23 { --ws-size: 26px; --ws-gap: 28px; }
.swg .sheet.grade-g45 { --ws-size: 21px; --ws-gap: 20px; }

.swg .ws-rows {
  display: grid;
  gap: var(--ws-gap);
}

.swg .ws-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8em;
  font-size: var(--ws-size);
  line-height: 1.25;
  break-inside: avoid;
}

.swg .ws-num {
  font-size: 14px;
  color: #9AA093;
  min-width: 1.4em;
}

/* Style: trace the word — light, traceable copies on a baseline rule */
.swg .style-trace .ws-row {
  border-bottom: 1.5px solid #C9C2B2;
  padding-bottom: 4px;
}

.swg .trace {
  color: #B5B0A4;
  letter-spacing: 0.05em;
}

/* Style: fill missing letters — blanked letters become writing gaps */
.swg .miss-word {
  letter-spacing: 0.08em;
}

.swg .miss {
  display: inline-block;
  width: 0.75em;
  border-bottom: 2px solid var(--ink);
  margin: 0 0.08em;
}

/* Style: write 3x — solid model word, then three empty writing slots */
.swg .model {
  font-weight: 600;
}

.swg .style-write .slot {
  display: inline-block;
  flex: 1;
  min-width: 3.5em;
  border-bottom: 1.5px solid #8B857A;
  align-self: stretch;
}

/* --------------------------------------------------------------------------
   16. Handwriting Sheet Maker (.hs)
   Each practice row is a 3-line guide: top rule, dashed midline, baseline.
   Audience (kids/adults) and line size set the guide height via --hs-h;
   kids mode uses a rounded school font, adults mode stays neutral.
   -------------------------------------------------------------------------- */
.hs-sheet {
  --hs-h: 48px;
  --rule-strong: #4A5646;
  --rule-light: #B5B0A4;
  /* Long nowrap practice text must clip at the sheet edge instead of
     stretching the page; the JS warns when a line is too wide to fit. */
  overflow-x: hidden;
}

.hs-sheet.aud-kids.size-small  { --hs-h: 36px; }
.hs-sheet.aud-kids.size-medium { --hs-h: 48px; }
.hs-sheet.aud-kids.size-large  { --hs-h: 64px; }

.hs-sheet.aud-adults.size-small  { --hs-h: 20px; }
.hs-sheet.aud-adults.size-medium { --hs-h: 26px; }
.hs-sheet.aud-adults.size-large  { --hs-h: 34px; }

.hs-sheet.aud-kids .hs-text {
  font-family: "Comic Sans MS", "Comic Neue", "Segoe UI", sans-serif;
}

.hs-sheet.aud-adults {
  --rule-strong: #8B857A;
  --rule-light: #C9C4B8;
}

.hs .hs-pair {
  break-inside: avoid;
  margin-bottom: calc(var(--hs-h) * 0.5);
}

.hs .hs-row {
  position: relative;
  height: var(--hs-h);
  border-top: 1px solid var(--rule-light);
  border-bottom: 1.5px solid var(--rule-strong);
  margin-bottom: calc(var(--hs-h) * 0.42);
}

.hs .hs-pair .hs-row:last-child {
  margin-bottom: 0;
}

.hs .hs-mid {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed var(--rule-light);
}

.hs .hs-text {
  position: absolute;
  left: 10px;
  bottom: -0.21em;
  font-size: calc(var(--hs-h) * 0.96);
  line-height: 1;
  white-space: nowrap;
  color: var(--ink);
}

/* Letter styles: solid model vs traceable outline letters */
.hs-sheet.style-trace .hs-text {
  color: #C9C4B8;
}

@supports (-webkit-text-stroke: 1px black) {
  .hs-sheet.style-trace .hs-text {
    color: transparent;
    -webkit-text-stroke: 1.3px #8B857A;
  }
}

/* --------------------------------------------------------------------------
   17. Print — hide chrome, show only the printable sheet
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   17. Printable Generator Platform
   -------------------------------------------------------------------------- */
.generator-page .tool-panel > div > div + div {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1.5px solid var(--line);
}

.generator-page textarea {
  min-height: 7em;
}

.generator-actions {
  margin-top: var(--space-3);
}

.preset-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.preset-card .btn-row {
  margin-top: auto;
}

.preset-meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.generator-preview-section {
  margin: var(--space-5) 0;
}

.generator-preview-bar {
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.generator-preview {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-3) 0 var(--space-4);
}

.generator-sheet {
  --pg-paper-width: 8.5in;
  --pg-paper-height: 11in;
  --pg-font: var(--font-body);
  --pg-title-font: var(--font-body);
  --pg-ink: var(--ink);
  --pg-muted: var(--ink-soft);
  --pg-line: var(--line);
  --pg-accent: var(--board);
  --pg-soft: #F6F1E6;
  --pg-bg: #fff;
  --pg-radius: 6px;
  --pg-border-width: 1.5px;
  --pg-cell-height: 0.34in;
  --pg-page-padding: 0.45in;
  --pg-title-align: center;

  width: var(--pg-paper-width);
  min-height: var(--pg-paper-height);
  margin: 0 auto;
  padding: var(--pg-page-padding);
  background: var(--pg-bg);
  color: var(--pg-ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  font-family: var(--pg-font);
  line-height: 1.35;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.pg-sheet-head {
  text-align: var(--pg-title-align);
  margin-bottom: 0.22in;
  border-bottom: var(--pg-border-width) solid var(--pg-line);
  padding-bottom: 0.14in;
}

.pg-sheet-title {
  font-family: var(--pg-title-font);
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 0.08in;
  color: var(--pg-ink);
}

.pg-sheet-meta {
  font-size: 13px;
  color: var(--pg-muted);
  margin: 0;
}

.pg-body-with-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(1.5in, 0.34fr);
  gap: 0.22in;
  align-items: start;
}

.pg-body-copies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.22in;
}

.pg-copy-title {
  font-size: 15px;
  margin-bottom: 0.08in;
  color: var(--pg-muted);
  text-align: center;
}

.pg-grid-table {
  display: grid;
  border-top: var(--pg-border-width) solid var(--pg-ink);
  border-left: var(--pg-border-width) solid var(--pg-ink);
  border-radius: var(--pg-radius);
  overflow: hidden;
  background: var(--pg-bg);
}

.pg-grid-cell {
  min-width: 0;
  min-height: var(--pg-cell-height);
  border-right: var(--pg-border-width) solid var(--pg-ink);
  border-bottom: var(--pg-border-width) solid var(--pg-ink);
  padding: 0.06in 0.08in;
  display: flex;
  align-items: center;
  gap: 0.05in;
  color: var(--pg-ink);
  background: var(--pg-bg);
  overflow: hidden;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.pg-grid-column-head,
.pg-grid-row-head,
.pg-grid-corner {
  background: var(--pg-soft);
  color: var(--pg-ink);
  font-weight: 700;
  font-size: 12px;
}

.pg-grid-column-head,
.pg-grid-corner {
  justify-content: center;
  text-align: center;
}

.pg-grid-row-head {
  justify-content: flex-start;
}

.pg-grid-write-cell {
  justify-content: center;
}

.pg-cell-box {
  width: 0.16in;
  height: 0.16in;
  border: var(--pg-border-width) solid var(--pg-accent);
  border-radius: 3px;
  flex: none;
}

.pg-cell-line {
  display: block;
  width: 100%;
  min-width: 0.28in;
  border-bottom: var(--pg-border-width) solid var(--pg-line);
  height: 0.14in;
}

.pg-icon {
  display: inline-flex;
  width: 0.18in;
  height: 0.18in;
  align-items: center;
  justify-content: center;
  border: var(--pg-border-width) solid var(--pg-accent);
  border-radius: 999px;
  color: var(--pg-accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  flex: none;
}

.pg-side-panel {
  border: var(--pg-border-width) solid var(--pg-ink);
  border-radius: var(--pg-radius);
  background: var(--pg-bg);
  padding: 0.14in;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.pg-side-title {
  font-size: 15px;
  margin-bottom: 0.12in;
  color: var(--pg-ink);
}

.pg-side-lines {
  display: grid;
  gap: 0.13in;
}

.pg-side-line {
  display: block;
  border-bottom: var(--pg-border-width) solid var(--pg-line);
  min-height: 0.14in;
}

.pg-sheet-foot {
  margin-top: 0.2in;
  padding-top: 0.1in;
  border-top: var(--pg-border-width) solid var(--pg-line);
  color: var(--pg-muted);
  font-size: 11px;
  text-align: right;
}

.pg-worksheet-instructions {
  text-align: center;
  color: var(--pg-muted);
  font-size: 13px;
  margin: -0.08in 0 0.18in;
}

.pg-worksheet-body {
  display: grid;
  gap: calc(var(--wl-gap, 0.12in) * var(--wl-line-spacing, 1));
}

.pg-practice-set {
  display: grid;
  gap: calc(var(--wl-gap, 0.12in) * var(--wl-line-spacing, 1));
  break-inside: avoid;
}

.pg-prompt-block {
  border: var(--pg-border-width) solid var(--pg-line);
  border-radius: var(--pg-radius);
  background: var(--pg-soft);
  padding: 0.14in;
  margin-bottom: 0.12in;
}

.pg-prompt-center {
  text-align: center;
}

.pg-prompt-left {
  text-align: left;
}

.pg-prompt-text {
  margin: 0 0 0.08in;
  color: var(--pg-ink);
}

.pg-prompt-text:last-child {
  margin-bottom: 0;
}

.pg-writing-line {
  --wl-height: 0.48in;
  --wl-gap: 0.12in;
  --wl-guide: var(--pg-line);
  --wl-baseline: var(--pg-accent);
  --wl-font-size: 28px;
  --wl-font-weight: 400;
  --wl-letter-spacing: 0;
  --wl-line-spacing: 1;

  position: relative;
  height: var(--wl-height);
  color: var(--pg-ink);
  overflow: hidden;
  break-inside: avoid;
}

.pg-guide-layer,
.pg-guide {
  position: absolute;
  left: 0;
  right: 0;
}

.pg-guide-layer {
  inset: 0;
}

.pg-guide {
  border-top: 1px solid var(--wl-guide);
}

.pg-guide-base {
  border-top-color: var(--wl-baseline);
}

.pg-writing-text {
  position: absolute;
  left: 0.08in;
  right: 0.08in;
  bottom: 0.02in;
  font-family: var(--pg-font);
  font-size: var(--wl-font-size);
  font-weight: var(--wl-font-weight);
  letter-spacing: var(--wl-letter-spacing);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.pg-writing-trace .pg-writing-text {
  color: rgba(34, 48, 31, 0.34);
}

.pg-trace-dotted .pg-writing-text {
  color: transparent;
  -webkit-text-stroke: 1px rgba(34, 48, 31, 0.45);
  text-shadow: 0.08em 0 0 rgba(34, 48, 31, 0.2);
}

@supports (-webkit-text-stroke: 1px black) {
  .pg-trace-outline .pg-writing-text {
    color: transparent;
    -webkit-text-stroke: 1px rgba(34, 48, 31, 0.58);
  }
}

@media (max-width: 767px) {
  .generator-preview {
    margin-left: calc(var(--space-3) * -1);
    margin-right: calc(var(--space-3) * -1);
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
}

.print-only {
  display: none;
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .container {
    max-width: none;
    padding: 0;
  }

  /* Seating chart print sheet */
  .scm .chart-area {
    margin-top: 0;
  }

  .scm .board-bar {
    background: #fff;
    color: #000;
    border-color: #000;
  }

  .scm .chart {
    border-color: #000;
    box-shadow: none;
    padding: 8px;
  }

  .scm .seat {
    border-color: #000;
    box-shadow: none;
    background: #fff !important;
    min-height: 52px;
  }

  .scm .seat.off {
    border-style: dashed;
    color: #bbb;
  }

  .scm .seat .toggle {
    display: none;
  }

  /* Worksheet print sheet (spelling + handwriting tools) */
  .sheet {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin-top: 0;
  }

  .generator-preview {
    overflow: visible;
    padding: 0;
  }

  .generator-preview-section {
    margin: 0;
  }

  .generator-sheet {
    width: var(--pg-paper-width);
    min-height: var(--pg-paper-height);
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .generator-sheet * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
