@charset "UTF-8";
/**
 * Platform Main Stylesheet
 * V7.2 Multi-Site Platform
 *
 * Provides base styles that all sites inherit.
 * Sites can override by adding their own stylesheets.
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
  /* Colors — bridge to site tokens (--site-primary defined in each site's tokens.css) */
  --color-primary: var(--site-primary, #2563eb);
  --color-primary-dark: var(--site-primary-dark, #1d4ed8);
  --color-secondary: #64748b;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  /* Text */
  --color-text: #1f2937;
  --color-text-light: #4b5563;
  --color-text-muted: #6b7280;

  /* Background */
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-bg-hover: #f3f4f6;

  /* Border */
  --color-border: #e5e7eb;
  --color-border-dark: #d1d5db;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Courier New', Consolas, Monaco, monospace;

  /* Layout */
  --container-max: 1400px;
  --header-height: 80px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-button: 6px;
  --radius-card: 8px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;

  /* Motion Timing */
  --dur-instant: 80ms;
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  /* Shadow Scale — brand-tinted via color-mix */
  --shadow-sm: 0 1px 3px color-mix(in srgb, var(--color-primary) 6%, transparent);
  --shadow-md: 0 4px 6px color-mix(in srgb, var(--color-primary) 8%, transparent);
  --shadow-lg: 0 10px 15px color-mix(in srgb, var(--color-primary) 10%, transparent);
  --shadow-xl: 0 20px 25px color-mix(in srgb, var(--color-primary) 12%, transparent);
}

/* Print-only elements: hidden on screen, shown only when printing */
.print-only,
.worksheet-print-header {
  display: none !important;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* A10: cross-site harmony */
html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* RTL Support */
[dir="rtl"] {
  text-align: right;
}

/* A10: cross-site harmony */
::selection {
  background: color-mix(in srgb, var(--color-primary) 20%, white);
  color: var(--color-text);
}

/* A10: cross-site harmony */
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary, #2563eb) 60%, transparent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading, inherit);
  line-height: 1.25;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

h1 { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem); line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 1.5vw + 0.75rem, 1.75rem); line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; line-height: 1.4; }
h4 { font-size: 1.125rem; line-height: 1.45; }

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
}

.tool-site-shell .detail-page,
.tool-site-shell .detail-content-area {
  max-width: var(--container-max);
}

.tool-site-shell .page-header {
  border-radius: var(--radius-card);
}

.tool-site-shell .set-switcher,
.tool-site-shell #detail-atom-mount,
.tool-site-shell .intro,
.tool-site-shell .seo-card,
.tool-site-shell .guide-content-card,
.tool-site-shell .intro-content-card {
  border-radius: var(--radius-card);
}

.tool-site-shell .page-header h1,
.tool-site-shell .section-title {
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.main-content {
  flex: 1;
  padding: var(--spacing-xl) 0;
}

/* ============================================
   Tool Product Template Families v1
   ============================================ */
.tool-site-shell {
  --tool-page-bg: #f7fafc;
  --tool-surface: #ffffff;
  --tool-surface-soft: #f8fafc;
  --tool-accent: var(--color-primary);
  --tool-accent-strong: var(--color-primary-dark);
  --tool-ink: #172033;
  --tool-muted: #5b6678;
  --tool-line: #d8e0ea;
  --tool-max: 1400px;
  --tool-reading-max: 880px;
  --tool-card-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tool-accent) 7%, white) 0, var(--tool-page-bg) 320px),
    var(--tool-page-bg);
  color: var(--tool-ink);
  overflow-x: hidden;
}

body.site-1,
body.site-8,
body.site-17 {
  --tool-template-family: math-practice;
  --tool-page-bg: #f5faf8;
  --tool-surface-soft: #eef8f3;
  --tool-accent: #0f766e;
  --tool-accent-strong: #115e59;
  --tool-line: #cfe3dd;
}

body.site-3,
body.site-4,
body.site-5,
body.site-6,
body.site-10,
body.site-11,
body.site-14,
body.site-15,
body.site-16,
body.site-18 {
  --tool-template-family: grid-puzzle;
  --tool-page-bg: #f8faf7;
  --tool-surface-soft: #f1f5ea;
  --tool-accent: #4f6f52;
  --tool-accent-strong: #314c37;
  --tool-line: #dce6d4;
}

body.site-9 {
  --tool-template-family: coloring-print;
  --tool-page-bg: #fff8fb;
  --tool-surface-soft: #fff0f5;
  --tool-accent: #be185d;
  --tool-accent-strong: #9f1239;
  --tool-line: #f5cddd;
}

body.site-2,
body.site-13,
body.site-20,
body.site-21,
body.site-22,
body.site-23,
body.site-24,
body.site-29 {
  --tool-template-family: early-education;
  --tool-page-bg: #f7fbff;
  --tool-surface-soft: #edf7ff;
  --tool-accent: #2f6f91;
  --tool-accent-strong: #255d7a;
  --tool-line: #d2e5f1;
}

body.site-7,
body.site-12,
body.site-27 {
  --tool-template-family: generator-tool;
  --tool-page-bg: #f9faf7;
  --tool-surface-soft: #f0f4ef;
  --tool-accent: #64703f;
  --tool-accent-strong: #48512d;
  --tool-line: #dfe5d3;
}

.tool-site-shell .main-content {
  padding-top: 1.5rem;
}

.tool-site-shell .detail-page,
.tool-site-shell .home-page,
.tool-site-shell .list-page,
.tool-site-shell .category-page {
  width: min(var(--tool-max), calc(100% - 32px));
  margin: 0 auto;
}

.tool-site-shell .breadcrumb {
  margin: 0 0 1rem;
  color: var(--tool-muted);
}

.tool-site-shell .breadcrumb a {
  color: var(--tool-muted);
}

.tool-site-shell .page-header {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tool-accent) 10%, white), var(--tool-surface) 58%),
    var(--tool-surface);
  box-shadow: var(--tool-card-shadow);
}

.tool-site-shell .page-header h1 {
  max-width: 980px;
  margin-bottom: 0;
  color: var(--tool-ink);
  font-weight: 800;
}

.tool-site-shell .intro,
.tool-site-shell .body-content,
.tool-site-shell .set-switcher {
  max-width: var(--tool-max);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--tool-surface) 92%, var(--tool-surface-soft));
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.tool-site-shell .intro,
.tool-site-shell .body-content {
  padding: 1rem 1.25rem;
}

.tool-site-shell .intro p,
.tool-site-shell .body-content p,
.tool-site-shell .body-content li {
  max-width: var(--tool-reading-max);
  color: var(--tool-muted);
}

.tool-site-shell .set-switcher {
  padding: 0.875rem 1rem;
}

.tool-site-shell .set-switcher-label {
  color: var(--tool-ink);
  font-weight: 750;
}

.tool-site-shell .set-btn {
  min-width: 42px;
  min-height: 42px;
  border-radius: var(--radius-button);
  border: 1px solid var(--tool-line);
  background: var(--tool-surface);
  color: var(--tool-ink);
}

.tool-site-shell .set-btn.active,
.tool-site-shell .set-btn:hover {
  border-color: var(--tool-accent);
  background: var(--tool-accent);
  color: #ffffff;
  text-decoration: none;
}

.tool-site-shell #detail-atom-mount {
  width: 100%;
  max-width: var(--tool-max);
  margin: 1.25rem auto 1.75rem;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: var(--tool-surface);
  box-shadow: var(--tool-card-shadow);
}

.tool-site-shell .detail-atom-toolbar {
  gap: 0.625rem;
  border-radius: var(--radius-card);
}

.tool-site-shell .detail-atom-btn,
.tool-site-shell .btn {
  border-radius: var(--radius-button);
  font-weight: 750;
}

.tool-site-shell .detail-atom-btn-reveal {
  background: var(--tool-accent);
  border-color: var(--tool-accent);
  color: #ffffff;
}

.tool-site-shell .detail-atom-btn-reveal:hover {
  background: var(--tool-accent-strong);
  border-color: var(--tool-accent-strong);
}

.tool-site-shell .seo-components--primary {
  align-items: stretch;
}

.tool-site-shell .seo-card {
  border: 1px solid var(--tool-line);
  border-left: 4px solid var(--tool-accent);
  background: var(--tool-surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.tool-site-shell .seo-card h2,
.tool-site-shell .seo-card h3 {
  color: var(--tool-ink);
}

.tool-site-shell .seo-card p,
.tool-site-shell .seo-card li {
  color: var(--tool-muted);
}

body.site-1 .form-exercise,
body.site-8 .form-exercise,
body.site-17 .solver-container {
  --da-primary: var(--tool-accent);
}

body.site-3 #detail-atom-mount,
body.site-4 #detail-atom-mount,
body.site-5 #detail-atom-mount,
body.site-6 #detail-atom-mount,
body.site-10 #detail-atom-mount,
body.site-11 #detail-atom-mount,
body.site-14 #detail-atom-mount,
body.site-15 #detail-atom-mount,
body.site-16 #detail-atom-mount,
body.site-18 #detail-atom-mount {
  background:
    linear-gradient(180deg, var(--tool-surface) 0, color-mix(in srgb, var(--tool-surface-soft) 45%, white) 100%);
}

body.site-9 #detail-atom-mount {
  background:
    linear-gradient(180deg, #ffffff 0, color-mix(in srgb, var(--tool-surface-soft) 55%, white) 100%);
}

body.site-2 #detail-atom-mount,
body.site-13 #detail-atom-mount,
body.site-20 #detail-atom-mount,
body.site-21 #detail-atom-mount,
body.site-22 #detail-atom-mount,
body.site-23 #detail-atom-mount,
body.site-24 #detail-atom-mount,
body.site-29 #detail-atom-mount {
  background:
    linear-gradient(180deg, #ffffff 0, color-mix(in srgb, var(--tool-surface-soft) 50%, white) 100%);
}

/* Template family v1.3: early-learning activity system */
body.site-2 .form-header,
body.site-20 .form-header,
body.site-21 .form-header,
body.site-22 .form-header,
body.site-23 .form-header,
body.site-24 .form-header,
body.site-29 .sheet-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--tool-line);
  background: color-mix(in srgb, var(--tool-surface-soft) 68%, white);
}

body.site-2 .form-title,
body.site-20 .form-title,
body.site-21 .form-title,
body.site-22 .form-title,
body.site-23 .form-title,
body.site-24 .form-title,
body.site-29 .sheet-header {
  max-width: 980px;
  color: var(--tool-ink);
  font-size: clamp(1.2rem, 1vw + 1rem, 1.65rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

body.site-2 .form-exercise-container,
body.site-20 .form-exercise-container,
body.site-21 .form-exercise-container,
body.site-22 .form-exercise-container,
body.site-23 .form-exercise-container,
body.site-24 .form-exercise-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
}

body.site-2 .form-problem,
body.site-20 .form-problem,
body.site-21 .form-problem,
body.site-22 .form-problem,
body.site-23 .form-problem,
body.site-24 .form-problem {
  min-width: 0;
  min-height: 150px;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

body.site-2 .problem-question,
body.site-20 .problem-question,
body.site-21 .problem-question,
body.site-22 .problem-question,
body.site-23 .problem-question,
body.site-24 .problem-question {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  color: var(--tool-ink);
  font-size: 1.05rem;
  line-height: 1.45;
}

body.site-29 .sheet-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: transparent;
}

body.site-29 .sheet-block,
body.site-29 .sheet-reference-card,
body.site-29 .cheat-section {
  min-width: 0;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

/* Template family v1.3: coloring-print canvas system */
body.site-9 .canvas-container,
body.site-9 .creative-canvas,
body.site-9 .coloring-scene,
body.site-9 .coloring-scene-svg,
body.site-9 .problem-visual {
  max-width: 100%;
}

body.site-9 .canvas-container,
body.site-9 .creative-canvas {
  display: grid;
  place-items: center;
  min-height: clamp(440px, 60vh, 760px);
  padding: clamp(1rem, 2vw, 1.75rem);
  background: #ffffff;
}

body.site-9 .canvas-container svg,
body.site-9 .creative-canvas svg,
body.site-9 .coloring-scene-svg {
  width: min(100%, 980px);
  height: auto;
  max-height: 72vh;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: #ffffff;
}

/* Template family v1.3: generator/tool result system */
body.site-7 .card-grid,
body.site-7 .card-activity-grid,
body.site-27 .card-grid,
body.site-27 .card-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
}

body.site-7 .activity-card,
body.site-27 .activity-card {
  min-width: 0;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

body.site-12 .sheet-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tool-line);
  color: var(--tool-ink);
  font-size: clamp(1.15rem, 1vw + 1rem, 1.55rem);
  font-weight: 800;
  letter-spacing: 0;
}

body.site-12 .sheet-preview {
  display: grid;
  place-items: center;
  padding: clamp(1rem, 2vw, 1.5rem);
  overflow: auto;
}

body.site-12 .sheet-grid-svg,
body.site-12 .sheet-dots-svg {
  width: min(100%, 1100px);
  height: auto;
  border: 1px solid var(--tool-line);
  background: #ffffff;
}

/* ============================================
   Deep Beautification Layer v2
   Shared structure polish for generic tool-site pages.
   Site identity.css controls the colors; this layer controls hierarchy.
   ============================================ */
.tool-site-shell .deep-kicker {
  margin: 0 0 0.5rem;
  color: var(--site-accent, var(--tool-accent));
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-site-shell .deep-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--site-accent, var(--tool-accent)) 18%, transparent) 0 160px, transparent 161px),
    linear-gradient(135deg, color-mix(in srgb, var(--tool-accent) 12%, white), var(--tool-surface) 62%);
  box-shadow: var(--tool-card-shadow);
}

.tool-site-shell .homepage > .hero {
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 90% 12%, color-mix(in srgb, var(--site-accent, var(--tool-accent)) 14%, transparent) 0 150px, transparent 151px),
    linear-gradient(135deg, color-mix(in srgb, var(--tool-accent) 12%, white), var(--tool-surface) 62%);
  box-shadow: var(--tool-card-shadow);
}

.tool-site-shell .homepage > .hero .hero-stats,
.tool-site-shell .homepage .categories-grid,
.tool-site-shell .homepage .feature-grid,
.tool-site-shell .homepage .hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 0.85rem;
}

.tool-site-shell .homepage > .hero .stat-item,
.tool-site-shell .homepage .category-card,
.tool-site-shell .homepage .feature-card,
.tool-site-shell .homepage .hub-card {
  min-width: 0;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: var(--tool-surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.tool-site-shell .homepage > .hero .stat-item {
  padding: 0.85rem;
}

.tool-site-shell .homepage .category-card,
.tool-site-shell .homepage .feature-card,
.tool-site-shell .homepage .hub-card {
  padding: 1rem;
}

.tool-site-shell .homepage .category-card:hover,
.tool-site-shell .homepage .feature-card:hover,
.tool-site-shell .homepage .hub-card:hover {
  border-color: var(--tool-accent);
  text-decoration: none;
  transform: translateY(-1px);
}

.tool-site-shell .homepage .section-header {
  margin: 2rem 0 1rem;
}

.tool-site-shell .deep-home-hero h1,
.tool-site-shell .deep-detail-hero h1,
.tool-site-shell .deep-list-hero h1 {
  max-width: 980px;
  margin-bottom: 0.75rem;
  font-weight: 850;
}

.tool-site-shell .deep-home-actions,
.tool-site-shell .detail-command-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}

.tool-site-shell .deep-btn,
.tool-site-shell .detail-command-panel a,
.tool-site-shell .detail-command-panel button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-button);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
}

.tool-site-shell .deep-btn-primary,
.tool-site-shell .detail-command-panel .btn-print {
  border-color: var(--tool-accent);
  background: var(--tool-accent);
  color: #ffffff;
}

.tool-site-shell .deep-btn-primary:hover,
.tool-site-shell .detail-command-panel .btn-print:hover {
  border-color: var(--tool-accent-strong);
  background: var(--tool-accent-strong);
  color: #ffffff;
  text-decoration: none;
}

.tool-site-shell .deep-btn-secondary,
.tool-site-shell .detail-command-panel .btn-pdf,
.tool-site-shell .detail-command-panel .btn-answers {
  background: color-mix(in srgb, var(--site-accent, var(--tool-accent)) 12%, white);
  color: var(--tool-ink);
}

.tool-site-shell .deep-home-panel,
.tool-site-shell .deep-home-strip,
.tool-site-shell .deep-workflow,
.tool-site-shell .deep-detail-support {
  display: grid;
  gap: 0.875rem;
}

.tool-site-shell .deep-home-panel {
  align-content: center;
  padding: 1rem;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--tool-surface) 80%, var(--tool-surface-soft));
}

.tool-site-shell .deep-panel-row,
.tool-site-shell .deep-home-strip > div,
.tool-site-shell .deep-workflow > article,
.tool-site-shell .deep-detail-support > article {
  min-width: 0;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: var(--tool-surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.tool-site-shell .deep-panel-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem;
}

.tool-site-shell .deep-panel-row strong,
.tool-site-shell .deep-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--tool-accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 850;
}

.tool-site-shell .deep-home-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0 1.5rem;
}

.tool-site-shell .deep-home-strip > div {
  padding: 1rem;
}

.tool-site-shell .deep-home-strip strong {
  display: block;
  color: var(--tool-ink);
  font-size: 1.35rem;
  line-height: 1.1;
}

.tool-site-shell .deep-home-strip span,
.tool-site-shell .detail-command-copy span,
.tool-site-shell .deep-workflow p,
.tool-site-shell .deep-detail-support p {
  color: var(--tool-muted);
}

.tool-site-shell .deep-category-section .section-header,
.tool-site-shell .deep-list .page-header {
  margin-bottom: 1rem;
}

.tool-site-shell .deep-workflow,
.tool-site-shell .deep-detail-support {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--spacing-2xl) 0;
}

.tool-site-shell .deep-workflow > article,
.tool-site-shell .deep-detail-support > article {
  padding: 1rem;
}

.tool-site-shell .deep-workflow h2,
.tool-site-shell .deep-detail-support h2 {
  margin: 0.75rem 0 0.4rem;
  font-size: 1rem;
}

.tool-site-shell .deep-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tool-site-shell .deep-detail-meta span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid var(--tool-line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: color-mix(in srgb, var(--tool-surface-soft) 70%, white);
  color: var(--tool-muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.tool-site-shell .detail-command-panel {
  justify-content: space-between;
  padding: 0.9rem;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--tool-surface) 88%, var(--tool-surface-soft));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.tool-site-shell .detail-command-copy {
  display: grid;
  gap: 0.15rem;
  margin-right: auto;
}

.tool-site-shell .deep-tool-stage {
  border-radius: var(--radius-card);
}

.tool-site-shell .deep-subcategories .category-list,
.tool-site-shell .deep-content-pages .worksheet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 0.85rem;
}

.tool-site-shell .deep-subcategories .category-list li,
.tool-site-shell .deep-content-pages .worksheet-list li {
  list-style: none;
}

.tool-site-shell .deep-subcategories .category-list a,
.tool-site-shell .deep-content-pages .worksheet-list a {
  display: grid;
  gap: 0.25rem;
  min-height: 78px;
  padding: 1rem;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-card);
  background: var(--tool-surface);
  color: var(--tool-ink);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.tool-site-shell .deep-subcategories .category-list a:hover,
.tool-site-shell .deep-content-pages .worksheet-list a:hover {
  border-color: var(--tool-accent);
  text-decoration: none;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .tool-site-shell .detail-page,
  .tool-site-shell .home-page,
  .tool-site-shell .list-page,
  .tool-site-shell .category-page {
    width: min(100% - 20px, var(--tool-max));
  }

  .tool-site-shell .page-header,
  .tool-site-shell #detail-atom-mount {
    padding: 1rem;
  }

  .tool-site-shell .set-buttons {
    gap: 0.375rem;
  }

  .tool-site-shell .deep-home-hero,
  .tool-site-shell .deep-home-strip,
  .tool-site-shell .deep-workflow,
  .tool-site-shell .deep-detail-support {
    grid-template-columns: 1fr;
  }

  .tool-site-shell .detail-command-panel {
    align-items: stretch;
  }

  .tool-site-shell .detail-command-panel a,
  .tool-site-shell .detail-command-panel button,
  .tool-site-shell .deep-btn {
    width: 100%;
  }
}

/* ============================================
   Skip Link (Accessibility)
   ============================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Site Header
   ============================================ */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--spacing-lg);
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header .logo:hover {
  opacity: 0.85;
}

.logo-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: block;
}

/* Logo image: uses logo.svg which may be wide wordmark (320x96) or square icon (512x512).
   height is fixed, width adapts to aspect ratio.
   At 72px height with 320:96 ratio → renders ~240px wide. */
.logo-img {
  height: 72px;
  width: auto;
  max-width: 320px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.main-nav {
  flex: 1;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: var(--spacing-lg);
}

.main-nav a {
  color: var(--color-text);
  font-weight: 500;
  padding: var(--spacing-sm) 0;
}

.main-nav a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.main-nav a.active {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom: 2px solid var(--color-primary);
}

.lang-switcher {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.lang-switcher .lang-current {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

.lang-switcher .lang-current:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-dark);
}

.lang-switcher .lang-current[aria-expanded="true"] {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
}

.lang-switcher .lang-current[aria-expanded="true"] .lang-arrow {
  transform: rotate(180deg);
}

.lang-switcher .lang-code {
  min-width: 24px;
  text-align: center;
}

.lang-switcher .lang-arrow {
  transition: transform var(--transition-fast);
  color: var(--color-text-light);
}

.lang-switcher .lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 200px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-fast), visibility var(--transition-fast), transform var(--transition-fast);
  z-index: 1000;
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switcher .lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--color-bg-alt);
  min-height: 44px;
}

.lang-switcher .lang-option:last-child {
  border-bottom: none;
}

.lang-switcher .lang-option:hover {
  background: var(--color-bg-hover);
}

.lang-switcher .lang-option.active {
  background: var(--color-primary);
  color: white;
}

.lang-switcher .lang-option.active:hover {
  background: var(--color-primary-dark);
}

.lang-switcher .lang-native {
  font-weight: 600;
}

.lang-switcher .lang-name {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.lang-switcher .lang-option.active .lang-name {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
  margin-bottom: var(--spacing-md);
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: '/';
  margin-left: var(--spacing-xs);
  color: var(--color-text-muted);
}

[dir="rtl"] .breadcrumb li:not(:last-child)::after {
  content: '\\';
  margin-left: 0;
  margin-right: var(--spacing-xs);
}

.breadcrumb a {
  color: var(--color-text-light);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--spacing-xs);
  text-decoration: none;
}

.breadcrumb [aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
  margin-bottom: var(--spacing-xl);
}

.page-header .subtitle {
  color: var(--color-text-light);
  font-size: 1.125rem;
  margin-top: var(--spacing-sm);
}

/* ============================================
   SEO Content Blocks
   ============================================ */
.seo-components--primary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin: var(--spacing-2xl) 0;
}

.seo-components--secondary {
  margin: var(--spacing-xl) 0;
}

.seo-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-card);
  padding: var(--spacing-lg);
  border-left: 4px solid var(--color-primary);
  transition: box-shadow var(--transition-fast);
}

.seo-card:hover {
  box-shadow: var(--shadow-sm);
}

.seo-card h2,
.seo-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.seo-card p {
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: var(--spacing-sm);
}

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

.seo-card ul,
.seo-card ol {
  color: var(--color-text-light);
  line-height: 1.7;
  padding-left: 1.5em;
  margin-bottom: var(--spacing-sm);
}

/* Secondary SEO toggle */
.content-toggle {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.content-toggle summary {
  padding: var(--spacing-md) var(--spacing-lg);
  font-weight: 600;
  cursor: pointer;
  background: var(--color-bg-alt);
  transition: background var(--transition-fast);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.content-toggle summary::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
}

.content-toggle[open] summary::after {
  content: '−';
}

.content-toggle summary:hover {
  background: var(--color-bg-hover);
}

.content-toggle-panel {
  padding: var(--spacing-lg);
}

.seo-more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

.seo-more-grid .seo-block {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
}

@media (max-width: 768px) {
  .seo-components--primary {
    grid-template-columns: 1fr;
  }
  .seo-more-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  min-height: 44px;
}

.btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-dark);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
}

/* Action buttons (detail page) */
.btn-print,
.btn-pdf,
.btn-answers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              color var(--transition-fast);
  text-decoration: none;
  min-height: 44px;
}

.btn-print:hover,
.btn-pdf:hover,
.btn-answers:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-dark);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.btn-print {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.btn-print:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
}

/* ============================================
   Category List
   ============================================ */
.category-list,
.worksheet-list {
  list-style: none;
  display: grid;
  gap: var(--spacing-sm);
}

.category-list a,
.worksheet-list a {
  display: block;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.category-list a:hover,
.worksheet-list a:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

[dir="rtl"] .category-list a:hover,
[dir="rtl"] .worksheet-list a:hover {
  transform: translateX(-4px);
}

.category-list .name {
  font-weight: 500;
  display: block;
}

.category-list .description {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-top: var(--spacing-xs);
  display: block;
}

/* ============================================
   Empty State (no children in category)
   ============================================ */
.category-list:empty::before,
.category-grid:empty::before,
.worksheet-list:empty::before {
  content: attr(data-empty-message);
  display: block;
  text-align: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  background: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-card);
}

.category-list:empty::before { content: "No categories available yet."; }
.category-grid:empty::before { content: "No categories available yet."; }
.worksheet-list:empty::before { content: "No worksheets available yet."; }

/* ============================================
   Page Navigation
   ============================================ */
.page-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.page-navigation a,
.page-navigation .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ============================================
   Site Footer
   ============================================ */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-xl) 0;
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  text-align: center;
}

.site-footer p {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin: 0;
}

.site-footer nav ul {
  display: flex;
  list-style: none;
  gap: var(--spacing-lg);
}

.site-footer a {
  color: var(--color-text-light);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--spacing-xs) var(--spacing-sm);
  transition: color var(--transition-fast);
}

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

/* ============================================
   Intro & Content Sections
   ============================================ */
.intro,
.content,
.body-content {
  margin-bottom: var(--spacing-xl);
  /* Removed max-width: 800px - let container control width */
}

.intro p:last-child,
.content p:last-child,
.body-content p:last-child {
  margin-bottom: 0;
}

/* A10: cross-site harmony */
.prose, .content-section, .intro, .content-toggle-panel {
  max-width: 72ch;
}

.intro p, .content-section p, .body-content p,
.content-toggle-panel p, .seo-block p,
.prose p {
  max-width: 68ch;
}

/* ============================================
   Placeholder
   ============================================ */
.placeholder {
  background: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--spacing-xl);
  text-align: center;
  color: var(--color-text-light);
}

.placeholder pre {
  text-align: left;
  background: var(--color-bg);
  padding: var(--spacing-md);
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.75rem;
  margin-top: var(--spacing-md);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: var(--spacing-2xl) 0;
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--spacing-2xl);
}

.hero h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--spacing-md);
  color: var(--color-text);
}

.hero .subtitle {
  font-size: clamp(1rem, 1.2vw + 0.5rem, 1.25rem);
  color: var(--color-text-light);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   Homepage Hero — Compact override
   Overrides site-level .hero padding so categories
   are visible on the first screen.
   Specificity (.homepage .hero = 0,2,0) beats .hero (0,1,0),
   site skin.css .homepage .hero rules (equal spec, loaded later) can still override.
   ============================================ */
.homepage .hero {
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  margin-bottom: 0;
}
.homepage .hero h1,
.homepage .hero-title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  margin-bottom: 0.4rem;
}
.homepage .hero .subtitle,
.homepage .hero-subtitle {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.homepage .hero-stats {
  gap: 1rem;
  margin-top: 0.6rem;
  margin-bottom: 0;
}
.homepage .stat-item {
  gap: 2px;
}
.homepage .stat-number {
  font-size: 1.2rem;
}
.homepage .stat-label {
  font-size: 0.75rem;
}
.homepage .hero-actions {
  margin-top: 0.8rem;
}

/* ============================================
   Category Grid (Homepage)
   ============================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

/* ============================================
   Category Cards (Enhanced)
   ============================================ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.category-card {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition-fast),
              transform var(--transition-fast),
              border-color var(--transition-fast);
}

.category-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-primary);
  text-decoration: none;
}

.category-card h3 {
  font-size: 1.125rem;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.category-card p {
  color: var(--color-text-light);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: var(--spacing-md);
  flex: 1;
}

.category-meta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: auto;
}

/* ============================================
   Tool Site Shell Refresh v1
   Shared polish for the 2026-04 pilot rollout.
   ============================================ */
.tool-site-shell {
  --shell-page-bg: color-mix(in srgb, var(--site-background, #ffffff) 82%, #f8fafc);
  --shell-surface: var(--site-surface, #ffffff);
  --shell-surface-soft: color-mix(in srgb, var(--color-primary) 6%, #ffffff);
  --shell-border: color-mix(in srgb, var(--color-primary) 12%, var(--color-border));
  --shell-text: var(--site-text-primary, var(--color-text));
  --shell-muted: var(--site-text-secondary, var(--color-text-light));
  background: var(--shell-page-bg);
  color: var(--shell-text);
}

.tool-site-shell .main-content {
  padding: 0;
}

.tool-site-shell .site-header {
  height: auto;
  min-height: 68px;
  background: color-mix(in srgb, var(--shell-surface) 92%, transparent);
  border-bottom: 1px solid var(--shell-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.tool-site-shell .site-header .container {
  min-height: 68px;
}

.tool-site-shell .logo-img {
  height: 42px;
  max-width: 230px;
}

.tool-site-shell .logo-text,
.tool-site-shell .site-name {
  color: var(--shell-text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
}

.tool-site-shell .main-nav a {
  border-radius: 8px;
  color: var(--shell-muted);
  font-weight: 650;
  letter-spacing: 0;
  padding: 0.45rem 0.65rem;
}

.tool-site-shell .main-nav a:hover {
  background: var(--shell-surface-soft);
  color: var(--color-primary);
}

.tool-site-shell .main-nav a::after {
  display: none;
}

.tool-site-shell .homepage,
.tool-site-shell .list-page,
.tool-site-shell .detail-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.tool-site-shell .hero,
.tool-site-shell .page-header {
  max-width: 920px;
  margin: 0 auto 2rem;
  padding: 3rem 0 2.25rem;
  text-align: center;
}

.tool-site-shell .hero h1,
.tool-site-shell .page-header h1 {
  color: var(--shell-text);
  font-size: 2.35rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.12;
  margin-bottom: 0.9rem;
}

.tool-site-shell .hero .subtitle,
.tool-site-shell .page-header .subtitle {
  color: var(--shell-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 auto;
  max-width: 720px;
}

.tool-site-shell .intro-section,
.tool-site-shell .intro,
.tool-site-shell .body-content,
.tool-site-shell .content-toggle,
.tool-site-shell .seo-card {
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.tool-site-shell .intro-section,
.tool-site-shell .intro,
.tool-site-shell .body-content {
  margin: 0 auto 2rem;
  max-width: 920px;
  padding: 1.5rem;
}

.tool-site-shell .categories-section,
.tool-site-shell .subcategories,
.tool-site-shell .content-pages,
.tool-site-shell .seo-components {
  margin: 2.5rem 0;
}

.tool-site-shell .section-header {
  margin-bottom: 1.25rem;
  text-align: left;
}

.tool-site-shell .section-header h2,
.tool-site-shell .subcategories h2,
.tool-site-shell .content-pages h2 {
  color: var(--shell-text);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 0.35rem;
}

.tool-site-shell .categories-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.tool-site-shell .category-card,
.tool-site-shell .category-list a,
.tool-site-shell .worksheet-list a {
  background: var(--shell-surface);
  border: 1px solid var(--shell-border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  color: var(--shell-text);
}

.tool-site-shell .category-card {
  min-height: 150px;
  padding: 1.25rem;
}

.tool-site-shell .category-card:hover,
.tool-site-shell .category-list a:hover,
.tool-site-shell .worksheet-list a:hover {
  background: linear-gradient(180deg, var(--shell-surface), var(--shell-surface-soft));
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--shell-border));
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.09);
  transform: translateY(-2px);
}

.tool-site-shell .category-card h3 {
  color: var(--shell-text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
}

.tool-site-shell .category-card p,
.tool-site-shell .category-list .description {
  color: var(--shell-muted);
}

.tool-site-shell .category-meta {
  align-items: center;
  color: var(--color-primary);
  display: flex;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0;
}

.tool-site-shell .seo-components--primary {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.tool-site-shell .seo-card {
  border-left: 0;
  padding: 1.35rem;
}

.tool-site-shell .breadcrumb {
  margin-bottom: 1rem;
}

.tool-site-shell .actions {
  justify-content: center;
}

.tool-site-shell .btn-print,
.tool-site-shell .btn-pdf,
.tool-site-shell .btn-answers,
.tool-site-shell .set-btn {
  border-radius: 8px;
}

.tool-site-shell .site-footer {
  background: #111827;
  border-top: 0;
  color: #e5e7eb;
}

.tool-site-shell .site-footer a,
.tool-site-shell .site-footer p,
.tool-site-shell .footer-links h4,
.tool-site-shell .footer-tagline,
.tool-site-shell .footer-bottom p {
  color: #e5e7eb;
}

@media (max-width: 768px) {
  .tool-site-shell .homepage,
  .tool-site-shell .list-page,
  .tool-site-shell .detail-page {
    padding: 1.5rem 1rem 3rem;
  }

  .tool-site-shell .hero,
  .tool-site-shell .page-header {
    padding: 2rem 0 1.5rem;
    text-align: left;
  }

  .tool-site-shell .hero h1,
  .tool-site-shell .page-header h1 {
    font-size: 1.8rem;
  }

  .tool-site-shell .hero .subtitle,
  .tool-site-shell .page-header .subtitle {
    font-size: 1rem;
  }
}

/* ============================================
   Tool Site Family Skins
   These keep the shared shell consistent while making each vertical feel
   intentional without duplicating templates.
   ============================================ */
.tool-site-shell:is(.site-1, .site-8, .site-23) {
  --shell-page-bg: #f7fbff;
  --shell-surface-soft: #eef6ff;
}

.tool-site-shell:is(.site-1, .site-8, .site-23) .hero,
.tool-site-shell:is(.site-1, .site-8, .site-23) .page-header {
  text-align: center;
}

.tool-site-shell:is(.site-1, .site-8, .site-23) .category-card {
  min-height: 165px;
}

.tool-site-shell:is(.site-2, .site-4, .site-10, .site-11, .site-24) {
  --shell-page-bg: #f8fbff;
  --shell-surface-soft: #f1f7ff;
}

.tool-site-shell:is(.site-2, .site-4, .site-10, .site-11, .site-24) .category-card h3,
.tool-site-shell:is(.site-2, .site-4, .site-10, .site-11, .site-24) .category-list .name {
  line-height: 1.18;
}

.tool-site-shell:is(.site-3, .site-6, .site-14, .site-15, .site-16, .site-17, .site-18, .site-19) {
  --shell-page-bg: #fbfafc;
  --shell-surface-soft: #f8f2f7;
}

.tool-site-shell:is(.site-3, .site-6, .site-14, .site-15, .site-16, .site-17, .site-18, .site-19) .hero,
.tool-site-shell:is(.site-3, .site-6, .site-14, .site-15, .site-16, .site-17, .site-18, .site-19) .page-header {
  text-align: left;
}

.tool-site-shell:is(.site-3, .site-6, .site-14, .site-15, .site-16, .site-17, .site-18, .site-19) .hero .subtitle,
.tool-site-shell:is(.site-3, .site-6, .site-14, .site-15, .site-16, .site-17, .site-18, .site-19) .page-header .subtitle {
  margin-left: 0;
}

.tool-site-shell:is(.site-12, .site-20, .site-21, .site-22) {
  --shell-page-bg: #f8fbf6;
  --shell-surface-soft: #f0f8e8;
}

.tool-site-shell:is(.site-12, .site-20, .site-21, .site-22) .category-card {
  align-items: flex-start;
  text-align: left;
}

.tool-site-shell:is(.site-12, .site-20, .site-21, .site-22) .category-meta {
  justify-content: flex-start;
}

.tool-site-shell:is(.site-5, .site-7, .site-9, .site-27, .site-29) {
  --shell-page-bg: #fffafa;
  --shell-surface-soft: #fff4f5;
}

.tool-site-shell:is(.site-5, .site-7, .site-9, .site-27, .site-29) .category-card {
  min-height: 170px;
  text-align: center;
}

.tool-site-shell:is(.site-5, .site-7, .site-9, .site-27, .site-29) .category-meta {
  justify-content: center;
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Icon Alignment ── */
.icon {
  vertical-align: middle;
  display: inline-block;
}

/* ── Footer Grid ── */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--spacing-xl, 2rem);
  padding: var(--spacing-xl, 2rem) 0;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  margin-bottom: var(--spacing-sm, 0.5rem);
}

.footer-brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.footer-tagline {
  margin-top: var(--spacing-sm, 0.5rem);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.footer-links h4 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-bottom: var(--spacing-md, 1rem);
}

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

.footer-links li {
  margin-bottom: var(--spacing-sm, 0.5rem);
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast, 150ms ease);
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: var(--spacing-md, 1rem) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm, 0.5rem);
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-attribution a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

.footer-attribution a:hover {
  color: var(--color-primary);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg, 1.5rem);
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

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

/* ============================================
   Premium Platform Polish
   ============================================ */

/* Link hover underline animation */
.main-nav a {
  position: relative;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.main-nav a:hover::after,
.main-nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Page section spacing rhythm */
.page-section, .seo-components, .worksheets-section {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

/* Breadcrumb polish */
.breadcrumb {
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}
.breadcrumb a {
  transition: color 0.15s ease;
}
.breadcrumb a:hover {
  color: var(--color-primary);
}

/* Set switcher premium */
.set-switcher {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  align-items: center;
}
.set-btn {
  min-width: 40px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  transition: all 0.15s ease;
  cursor: pointer;
}
.set-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 5%, white);
}
.set-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

/* Page navigation premium */
.page-navigation {
  gap: 1rem;
  margin: 2rem 0;
  padding: 1rem 0;
}
.page-navigation .btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.2s ease;
}
.page-navigation .btn-nav:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ============================================
   Print Styles - Production-Ready Worksheet Output
   All sites share these rules. One fix = all sites fixed.
   ============================================ */

@media print {
  /* ===== FOUNDATION ===== */
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* @page rules owned by print-base.css — no duplicate here */

  html {
    font-size: 11pt !important;
  }

  body {
    background: white !important;
    color: #000 !important;
    font-size: 11pt !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-font-smoothing: auto;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }

  /* ===== HIDE NON-PRINT ELEMENTS ===== */
  /* Comprehensive list — mirrors print-base.css Section 5 for the
     browser Ctrl+P path where .print-view class is NOT present. */
  .no-print,
  .site-header,
  .site-footer,
  .actions,
  .page-navigation,
  .page-nav,
  .breadcrumb,
  .set-switcher,
  .intro,
  .intro-section,
  .body-content,
  .body-content--collapsible,
  .page-header,
  .page-header-section,
  .seo-components,
  .seo-components--primary,
  .seo-components--secondary,
  .seo-block,
  .lang-switcher,
  .skip-link,
  .interactive-toolbar,
  .sie-wrapper,
  .detail-atom-toolbar,
  .detail-region-toolbar,
  .check-plugin-wrapper,
  .progress-plugin-wrapper,
  .progress-plugin-container,
  .timer-plugin-container,
  .auto-save-plugin-container,
  .undo-redo-plugin-container,
  .hint-plugin-container,
  .mistake-highlight-plugin-container,
  .error-log-plugin-container,
  .local-storage-plugin-container,
  .favorites-plugin-container,
  .challenge-mode-plugin-wrapper,
  .achievement-plugin-wrapper,
  .focus-mode-plugin-wrapper,
  .crossword-nav-plugin-wrapper,
  .crossword-nav-panel,
  .maze-validation-plugin-wrapper,
  .classroom-mode-plugin-container,
  .ia-game-controls,
  .ia-live-region,
	  .content-type-badge,
	  .puzzle-stats,
	  .difficulty-badge,
  .score-panel,
  .score-retry,
  .stat-badge,
  .hero-stats,
  .category-meta,
  .subcategory-arrow,
  .canvas-palette,
  .brush-selector,
  .problem-feedback,
  .ws-result-icon,
  .variant-meta,
  .variant-chip,
  .btn-nav {
    display: none !important;
  }

  /* ===== SHOW PRINT-ONLY ELEMENTS ===== */
  .print-only {
    display: flex !important;
  }

  .worksheet-print-header {
    display: block !important;
    margin-bottom: 3mm !important; /* Tightened: was 4mm */
    padding-bottom: 2mm !important; /* Tightened: was 3mm */
    border-bottom: 2pt solid #000 !important;
  }

  .worksheet-print-header h1,
  .worksheet-print-header .print-title {
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    margin: 0 0 2mm !important;
    line-height: 1.2 !important;
  }

  .worksheet-print-meta {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 5mm !important;
    margin: 0 !important;
    font-size: 10pt !important;
    font-family: system-ui, sans-serif !important;
  }

  .worksheet-print-meta span {
    flex: 1 1 0 !important;
    border-bottom: 1pt solid #000 !important;
    padding-bottom: 1.5mm !important;
    min-height: 5mm !important; /* Tightened: was 7mm */
    color: #000 !important;
    font-weight: 500 !important;
  }

  /* ===== LAYOUT CONTAINERS ===== */
  .main-content {
    padding: 0 !important;
    margin: 0 !important;
  }

  .detail-page {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* ===== WORKSHEET CONTENT ===== */
  .worksheet-content {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: white !important;
    max-width: 100% !important;
    overflow: visible !important;
    border-radius: 0 !important;
  }

  .worksheet-content::before,
  .worksheet-content::after {
    display: none !important;
  }

  .worksheet-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 3mm !important;
    padding-bottom: 2mm !important;
    border-bottom: 1pt solid #000 !important;
  }

  .worksheet-title {
    font-size: 11pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  .worksheet-title::before {
    display: none !important;
  }

  .worksheet-meta {
    background: white !important;
    border: 1pt solid #000 !important;
    color: #000 !important;
    font-size: 9pt !important;
    padding: 1mm 3mm !important;
    border-radius: 2px !important;
  }

  /* ===== PROBLEMS GRID (Arithmetic / Form Exercises) ===== */
  .problems-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    column-count: auto !important;
    column-gap: 4mm !important;
    row-gap: 2mm !important;
    align-content: start !important;
    border-top: none !important;
  }

  .problem {
    background: white !important;
    border: 1pt solid #bbb !important;
    border-left: 2pt solid #000 !important;
    border-radius: 0 !important;
    font-size: 12pt !important;
    padding: 2mm 3mm !important;
    margin-bottom: 0 !important;
    min-height: 10mm !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    display: flex !important;
    align-items: center !important;
    gap: 3mm !important;
  }

  .problem::before,
  .problem::after {
    display: none !important;
  }

  .problem:hover {
    transform: none !important;
  }

  /* Problem number */
  .problem .num {
    background: #f0f0f0 !important;
    color: #000 !important;
    border: 1pt solid #666 !important;
    border-radius: 2px !important;
    font-size: 8pt !important;
    font-weight: 700 !important;
    min-width: 1.4rem !important;
    height: 1.4rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .problem .num::after {
    display: none !important;
  }

  /* Expression */
  .problem .expression {
    font-size: 12pt !important;
    color: #000 !important;
    font-weight: 600 !important;
    flex: 1 !important;
  }

  /* Answer blank line */
  .problem .blank {
    display: inline-block !important;
    border: none !important;
    border-bottom: 1.5pt solid #000 !important;
    min-width: 20mm !important;
    background: white !important;
    padding: 0 1mm !important;
    font-size: 12pt !important;
  }

  .problem .blank::before {
    display: none !important;
  }

  /* Hide answers in print (always print blank worksheet) */
  .problem .answer {
    display: none !important;
  }

  .answer-input,
  .problem .answer-input {
    display: none !important;
  }

  .show-answers .problem .answer {
    display: none !important;
  }

  .show-answers .problem .blank {
    display: inline-block !important;
  }

  .show-answers .problem {
    background: white !important;
    border-left-color: #000 !important;
  }

  .show-answers .problem::before {
    display: none !important;
  }

  /* ===== CATEGORY / LIST PAGE PRINT ===== */
  .category-card,
  .subcategory-card {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    box-shadow: none !important;
  }

  /* ===== BINGO CARDS ===== */
  .bingo-container {
    max-width: 300px !important;
    width: 300px !important;
    margin: 0 auto !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .bingo-header {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    margin-bottom: 0 !important;
    gap: 0 !important;
  }

  .bingo-header-cell {
    font-size: 11pt !important;
    color: #000 !important;
    padding: 3px !important;
    font-weight: 700 !important;
    text-align: center !important;
  }

  .bingo-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    border: 2pt solid #000 !important;
    border-radius: 0 !important;
    gap: 0 !important;
  }

  .bingo-cell {
    border: 1pt solid #000 !important;
    font-size: 9pt !important;
    background: white !important;
    color: #000 !important;
    padding: 4px !important;
    height: 55px !important;
    min-height: unset !important;
    aspect-ratio: unset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    word-break: break-word !important;
  }

  .bingo-cell.free {
    background: #e5e5e5 !important;
    color: #000 !important;
    font-weight: 700 !important;
  }

  /* ===== FLASHCARDS ===== */
  .flashcards-grid {
    column-count: 2 !important;
    column-gap: 1rem !important;
  }

  .flashcard {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    border: 1pt solid #000 !important;
    margin-bottom: 0.5rem !important;
    background: white !important;
  }

  /* ===== SUDOKU ===== */
  .sudoku-container {
    border: none !important;
    padding: 0 !important;
    page-break-inside: avoid !important;
  }

  .sudoku-grid {
    margin: 0 auto !important;
  }

  .sudoku-cell {
    background: white !important;
  }

  .sudoku-cell.given {
    background: #f0f0f0 !important;
    font-weight: 700 !important;
  }

  /* ===== WORD LIST ===== */
  .word-list-grid {
    column-count: 3 !important;
    column-gap: 1rem !important;
  }

  .word-list-item {
    break-inside: avoid !important;
    border: 1pt solid #ccc !important;
    background: white !important;
  }

  /* ===== WORD SEARCH ===== */
  .wordsearch-container {
    display: flex !important;
    gap: 8mm !important;
    justify-content: center !important;
    page-break-inside: avoid !important;
  }

  .wordsearch-grid-wrapper {
    flex: 0 0 auto !important;
  }

  .wordsearch-grid {
    background: #000 !important;
    padding: 1px !important;
    border-radius: 0 !important;
    gap: 1px !important;
  }

  .wordsearch-cell {
    background: white !important;
    color: #000 !important;
    font-size: 10pt !important;
    width: 24px !important;
    height: 24px !important;
    font-weight: 500 !important;
  }

  .show-answers .wordsearch-cell.word-letter {
    background: #ddd !important;
    font-weight: 700 !important;
  }

  .wordsearch-wordlist {
    min-width: 150px !important;
    max-width: 200px !important;
  }

  .wordlist-title {
    font-size: 10pt !important;
    color: #000 !important;
    margin-bottom: 3mm !important;
    padding-bottom: 2mm !important;
    border-bottom: 1pt solid #000 !important;
    font-weight: 700 !important;
  }

  .wordlist-items {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5mm !important;
  }

  .wordlist-item {
    padding: 1mm 2mm !important;
    background: white !important;
    border: 1pt solid #ccc !important;
    font-size: 9pt !important;
    color: #000 !important;
  }

  .show-answers .wordlist-item.found {
    background: #ddd !important;
    text-decoration: line-through !important;
  }

  /* ===== VOCABULARY LIST ===== */
  .vocabulary-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2mm !important;
  }

  .vocab-item {
    background: white !important;
    border: 1pt solid #ccc !important;
    border-left: 2pt solid #000 !important;
    border-radius: 0 !important;
    padding: 1.5mm 3mm !important;
    font-size: 10pt !important;
  }

  .vocab-item .num {
    color: #000 !important;
    font-size: 9pt !important;
    min-width: 1.5rem !important;
  }

  .vocab-item .word {
    color: #000 !important;
    font-size: 11pt !important;
  }

  /* ===== MATCHING EXERCISE ===== */
  .matching-container {
    display: flex !important;
    gap: 8mm !important;
    justify-content: center !important;
  }

  .matching-column {
    min-width: 180px !important;
    max-width: 220px !important;
  }

  .matching-column h3 {
    font-size: 10pt !important;
    color: #000 !important;
    border-bottom: 1pt solid #000 !important;
    margin-bottom: 3mm !important;
    padding-bottom: 2mm !important;
    font-weight: 700 !important;
  }

  .matching-item {
    padding: 1.5mm 2mm !important;
    margin-bottom: 1.5mm !important;
    font-size: 9pt !important;
    background: white !important;
    border: 1pt solid #ccc !important;
    border-radius: 0 !important;
  }

  .matching-item .num {
    width: 1.2rem !important;
    height: 1.2rem !important;
    line-height: 1.2rem !important;
    font-size: 8pt !important;
    background: white !important;
    color: #000 !important;
    border: 1pt solid #000 !important;
    border-radius: 50% !important;
  }

  /* ===== SPELLING EXERCISE ===== */
  .spelling-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2mm !important;
  }

  .spelling-item {
    padding: 1.5mm 3mm !important;
    font-size: 9pt !important;
    background: white !important;
    border: 1pt solid #ccc !important;
  }

  .spelling-item .num {
    color: #000 !important;
    font-size: 8pt !important;
  }

  .spelling-item .scrambled {
    color: #000 !important;
  }

  .spelling-item .blank {
    border-bottom: 1pt solid #000 !important;
    min-width: 3rem !important;
  }

  /* ===== DETAIL ATOM MOUNT (reset container for print) ===== */
  #detail-atom-mount {
    background: white !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* ===== CANVAS/SVG PRINT (Maze, Coloring) ===== */
  canvas {
    max-width: 100% !important;
    page-break-inside: avoid !important;
  }

  svg {
    max-width: 100% !important;
    page-break-inside: avoid !important;
  }

  /* ===== PAGE BREAK CONTROL ===== */
  h1, h2, h3 {
    page-break-after: avoid !important;
  }

  table, figure, img {
    page-break-inside: avoid !important;
  }
}

/* ============================================
   Responsive
   ============================================ */

/* ── Tablet (1024px) ── */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-md, 1rem);
  }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg, 1.5rem);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .hero {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .site-header .container {
    gap: var(--spacing-sm);
  }

  .site-header .logo {
    font-size: 1rem;
  }

  .main-nav ul {
    gap: var(--spacing-sm);
    font-size: 0.875rem;
  }

  .lang-switcher .lang-current {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
  }

  .lang-switcher .lang-dropdown {
    min-width: 180px;
  }

  .lang-switcher .lang-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .page-navigation {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .site-footer nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
  }

  .logo-icon {
    width: 36px;
    height: 36px;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  /* Touch targets - WCAG 2.5.8 */
  button, .btn, [role="button"], .set-btn {
    min-height: 44px;
  }
  .breadcrumb a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Breadcrumb horizontal scroll on mobile */
  .breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }
  .breadcrumb::-webkit-scrollbar {
    display: none;
  }
}

/* ── Small phones (320px) ── */
@media (max-width: 320px) {
  h1 { font-size: 1.25rem; }
  .hero { padding: 1rem; }
  .container { padding: 0 0.75rem; }
}

/* ============================================
   Intelligence Panel
   ============================================ */
.intelligence-panel {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  align-items: center;
}

.difficulty-badge,
.suggested-time,
.info-notice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.difficulty-badge svg,
.suggested-time svg,
.info-notice svg {
  flex-shrink: 0;
}

.difficulty-badge[data-level="easy"],
.difficulty-badge[data-level="starter"] {
  background: #dcfce7;
  color: #166534;
}

.difficulty-badge[data-level="medium"] {
  background: #fef3c7;
  color: #92400e;
}

.difficulty-badge[data-level="hard"] {
  background: #fee2e2;
  color: #991b1b;
}

.difficulty-badge[data-level="expert"],
.difficulty-badge[data-level="extreme"] {
  background: #ede9fe;
  color: #5b21b6;
}

.suggested-time {
  background: var(--color-bg-alt);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
}

.info-notice {
  background: var(--color-bg-alt);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
}

.badge-score {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 2px;
}

/* ============================================
   Loading States
   ============================================ */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.sie-mount-point:empty {
  min-height: 200px;
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-bg-hover) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-card);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sie-mount-point:empty {
    animation: none;
    background: var(--color-bg-alt);
  }
}

/* ============================================
   Platform Utility: Loading Skeleton
   ============================================ */

/* A10: cross-site harmony */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-alt, #f3f4f6) 25%, var(--color-bg-hover, #e5e7eb) 50%, var(--color-bg-alt, #f3f4f6) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeletonShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--color-bg-alt, #f3f4f6); }
}

/* ============================================
   Detail Atom Plugin Chrome Suppression
   ============================================ */

/* The printable tool pages keep the activity itself visible, but hide the
   auxiliary plugin chrome that belongs to the online solver UI. */
.tool-site-shell #detail-atom-mount :is(
  .check-plugin-wrapper,
  .progress-plugin-wrapper,
  .progress-plugin-container,
  .timer-plugin-container,
  .auto-save-plugin-container,
  .undo-redo-plugin-container,
  .hint-plugin-container,
  .mistake-highlight-plugin-container,
  .error-log-plugin-container,
  .local-storage-plugin-container,
  .favorites-plugin-container,
  .challenge-mode-plugin-wrapper,
  .achievement-plugin-wrapper,
  .focus-mode-plugin-wrapper,
  .crossword-nav-plugin-wrapper,
  .crossword-nav-panel,
  .maze-validation-plugin-wrapper,
  .classroom-mode-plugin-container,
  .ia-game-controls,
  .ia-streak-badge,
  .ia-data-panel,
  .streak-panel,
  .badge-display,
  .achievement-notification-container,
  .ia-live-region
) {
  display: none !important;
}

/* ============================================
   Platform Utility: Scroll-to-Top Button
   ============================================ */

/* A10: cross-site harmony */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary, #2563eb);
  color: white;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-fast) var(--ease-default), opacity var(--dur-fast) var(--ease-default);
  z-index: 50;
}

.scroll-to-top:hover { transform: translateY(-3px); }
.scroll-to-top.visible { display: flex; }

@media print { .scroll-to-top { display: none !important; } }

/* ============================================
   Mobile Navigation Toggle
   ============================================ */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle .nav-toggle-close { display: none; }

.nav-toggle[aria-expanded="true"] .nav-toggle-open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle-close { display: block; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }

  .main-nav.open { display: block; }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: var(--spacing-sm) 0;
  }

  .main-nav a {
    display: block;
    padding: var(--spacing-md) var(--spacing-lg);
    min-height: 44px;
    line-height: 1.5;
  }

  .main-nav a:hover {
    background: var(--color-bg-hover);
  }
}

/* ============================================
   Entrance Animation
   ============================================ */
.animate-fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease-out forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Dark Mode — DEFERRED
   ============================================ */
/* Dark mode removed (2026-03-19): Educational/print sites must always render in light mode.
   The prefers-color-scheme: dark override was causing input fields and solver cells to
   render as black blocks because --color-bg was set to #111827 but form elements and
   detail-atom components were not fully adapted. Dark mode requires full-chain adaptation
   (detail-atom, site skins, print profiles) before it can be safely enabled.
   See: docs/experts/visual/VISUAL-SYSTEM-AUDIT-V1.md Section 4.3 */

/* ============================================
   Reduced Motion Safety Net
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   RTL (Right-to-Left) Comprehensive Support
   Scoped via [dir="rtl"] set on <html> for ar/he.
   Base text-align rule is above in Reset section.
   ============================================ */

/* --- Header & Navigation --- */
[dir="rtl"] .site-header .container {
  flex-direction: row-reverse;
}

[dir="rtl"] .main-nav ul {
  flex-direction: row-reverse;
}

[dir="rtl"] .lang-switcher {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .lang-switcher .lang-dropdown {
  right: auto;
  left: 0;
}

/* --- Skip Link --- */
[dir="rtl"] .skip-link {
  left: auto;
  right: 0;
}

/* --- Breadcrumb (separator already handled above) --- */
[dir="rtl"] .breadcrumb ol {
  flex-direction: row-reverse;
}

/* --- Page Navigation (prev/next) --- */
[dir="rtl"] .page-navigation {
  flex-direction: row-reverse;
}

/* --- Actions toolbar --- */
[dir="rtl"] .actions {
  flex-direction: row-reverse;
}

/* --- Buttons with icons --- */
[dir="rtl"] .btn {
  flex-direction: row-reverse;
}

/* --- Category & Worksheet Lists --- */
[dir="rtl"] .category-list a,
[dir="rtl"] .worksheet-list a {
  padding: var(--spacing-md) var(--spacing-lg);
  text-align: right;
}

/* --- Footer --- */
[dir="rtl"] .site-footer nav ul {
  flex-direction: row-reverse;
}

/* --- Scroll-to-top button --- */
[dir="rtl"] .scroll-to-top {
  right: auto;
  left: 2rem;
}

/* --- Prose & Content max-width alignment --- */
[dir="rtl"] .prose,
[dir="rtl"] .content-section,
[dir="rtl"] .intro,
[dir="rtl"] .content-toggle-panel,
[dir="rtl"] .body-content {
  margin-left: auto;
  margin-right: 0;
}

/* --- Float direction swap --- */
[dir="rtl"] .float-left {
  float: right;
}

[dir="rtl"] .float-right {
  float: left;
}

/* --- Intelligence panel badge score --- */
[dir="rtl"] .badge-score {
  margin-left: 0;
  margin-right: 0.25rem;
}

/* --- Problem items: mirror left accent border --- */
[dir="rtl"] .problem {
  flex-direction: row-reverse;
}

/* --- Vocabulary items: mirror left accent border --- */
[dir="rtl"] .vocab-item {
  border-left: 1px solid var(--color-border);
  border-right: 2px solid var(--color-primary);
}

/* --- Placeholder pre block alignment --- */
[dir="rtl"] .placeholder pre {
  text-align: right;
  direction: rtl;
}

/* --- Mobile nav panel position --- */
@media (max-width: 768px) {
  [dir="rtl"] .site-header .container {
    flex-direction: row-reverse;
  }

  [dir="rtl"] .main-nav ul {
    flex-direction: column;
  }

  [dir="rtl"] .main-nav a {
    text-align: right;
  }

  [dir="rtl"] .page-navigation {
    flex-direction: column;
  }
}

/* --- Print RTL adjustments --- */
@media print {
  [dir="rtl"] .problem {
    border-left: 1pt solid #bbb !important;
    border-right: 2pt solid #000 !important;
    flex-direction: row-reverse !important;
  }

  [dir="rtl"] .vocab-item {
    border-left: 1pt solid #ccc !important;
    border-right: 2pt solid #000 !important;
  }

  [dir="rtl"] .worksheet-print-meta {
    flex-direction: row-reverse !important;
  }
}


/* ============================================================
   Mobile App Safe Area Support (Capacitor)
   Phase 0.6 — MOBILE-APP-MIGRATION-PLAYBOOK
   ============================================================ */

/* iOS Safe Area padding for notch / Home Indicator */
@supports (padding-top: env(safe-area-inset-top)) {
  .site-header {
    padding-top: env(safe-area-inset-top);
  }

  .main-content {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* When inside Capacitor App: extra bottom padding for gesture area */
  body.capacitor-app .main-content {
    padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
  }

  /* Hide web-only navigation elements in App context */
  body.capacitor-app .site-header__nav,
  body.capacitor-app .site-footer {
    display: none;
  }

  /* Ensure print is unaffected */
  @media print {
    body.capacitor-app .site-header__nav,
    body.capacitor-app .site-footer {
      display: none;
    }
  }
}

/* Mobile touch optimization (Capacitor context) */
body.capacitor-app {
  -webkit-touch-callout: none;  /* Disable long-press context menu on links */
  -webkit-user-select: none;    /* Prevent accidental text selection */
  user-select: none;
  overscroll-behavior: none;    /* Prevent pull-to-refresh in WebView */
}

/* Re-enable text selection for content areas */
body.capacitor-app .detail-content,
body.capacitor-app .main-content,
body.capacitor-app input,
body.capacitor-app textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* SSR Visual Preview — visible to crawlers but hidden from users */
.seo-visual-preview {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.seo-visual-preview svg {
  max-width: 300px;
  height: auto;
}

/* ============================================================
   Fleet30 Design Contract v1
   Final shared constraints for the production tool-site fleet.
   Keep this block late in the cascade so legacy site CSS cannot undo
   the global rail, radius, and typography rules.
   ============================================================ */
.tool-site-shell {
  --container-max: 1400px;
  --shell-rail: 1400px;
  --shell-prose: 1400px;
  --shell-readable: 880px;
  --radius-lg: 8px;
  --radius-xl: 8px;
  --radius-card: 8px;
  --radius-button: 8px;
  --shell-space-x: clamp(1rem, 2.4vw, 2rem);
  --shell-space-y: clamp(2rem, 4vw, 4rem);
}

.tool-site-shell,
.tool-site-shell * {
  letter-spacing: 0;
}

.tool-site-shell .container,
.tool-site-shell .site-header .container,
.tool-site-shell .site-footer .container,
.tool-site-shell .homepage,
.tool-site-shell .list-page,
.tool-site-shell .detail-page,
.tool-site-shell .detail-content-area,
.tool-site-shell .main-content > .container {
  max-width: var(--shell-rail) !important;
  width: 100%;
}

.tool-site-shell .container,
.tool-site-shell .site-header .container,
.tool-site-shell .site-footer .container {
  padding-left: var(--shell-space-x);
  padding-right: var(--shell-space-x);
}

.tool-site-shell .homepage,
.tool-site-shell .list-page,
.tool-site-shell .detail-page {
  padding: var(--shell-space-y) var(--shell-space-x) calc(var(--shell-space-y) + 1rem);
}

.tool-site-shell .hero,
.tool-site-shell .page-header,
.tool-site-shell .intro-section,
.tool-site-shell .intro,
.tool-site-shell .body-content,
.tool-site-shell .content-toggle,
.tool-site-shell .seo-components,
.tool-site-shell .detail-intro,
.tool-site-shell .guide-content-card,
.tool-site-shell .intro-content-card {
  max-width: var(--shell-prose);
}

.tool-site-shell .hero .subtitle,
.tool-site-shell .hero-subtitle,
.tool-site-shell .page-header .subtitle,
.tool-site-shell .section-subtitle,
.tool-site-shell .footer-tagline {
  max-width: var(--shell-readable);
}

.tool-site-shell .categories-section,
.tool-site-shell .subcategories,
.tool-site-shell .content-pages,
.tool-site-shell .worksheets-section,
.tool-site-shell .page-section,
.tool-site-shell .magical-lobby,
.tool-site-shell .activities-section {
  max-width: var(--shell-rail);
  margin-left: auto;
  margin-right: auto;
}

.tool-site-shell .categories-grid,
.tool-site-shell .category-grid,
.tool-site-shell .worksheet-grid,
.tool-site-shell .cards-grid,
.tool-site-shell .tools-grid {
  display: grid;
  gap: clamp(1rem, 1.7vw, 1.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.tool-site-shell .category-card,
.tool-site-shell .card,
.tool-site-shell .seo-card,
.tool-site-shell .content-toggle,
.tool-site-shell .intro-section,
.tool-site-shell .intro,
.tool-site-shell .body-content,
.tool-site-shell .guide-content-card,
.tool-site-shell .intro-content-card,
.tool-site-shell .stat-item,
.tool-site-shell .feature-card,
.tool-site-shell .tool-card,
.tool-site-shell .worksheet-card,
.tool-site-shell .lang-current,
.tool-site-shell .lang-dropdown,
.tool-site-shell input,
.tool-site-shell select,
.tool-site-shell textarea,
.tool-site-shell button,
.tool-site-shell .btn {
  border-radius: 8px !important;
}

.tool-site-shell .btn,
.tool-site-shell button,
.tool-site-shell input,
.tool-site-shell select,
.tool-site-shell textarea {
  min-height: 44px;
}

.tool-site-shell .hero h1,
.tool-site-shell .hero-title,
.tool-site-shell .page-header h1 {
  font-size: clamp(2rem, 3.2vw, 3.35rem);
  line-height: 1.08;
}

.tool-site-shell .site-header {
  min-height: 68px;
}

.tool-site-shell .site-header .container {
  min-height: 68px;
}

.tool-site-shell .site-footer {
  margin-top: 0;
}

.tool-site-shell.site-1,
.tool-site-shell.site-8,
.tool-site-shell.site-23 {
  --shell-page-bg: #f7fbff;
  --shell-surface-soft: #eef8f4;
}

.tool-site-shell.site-2,
.tool-site-shell.site-4,
.tool-site-shell.site-10,
.tool-site-shell.site-11,
.tool-site-shell.site-24 {
  --shell-page-bg: #fbfcf8;
  --shell-surface-soft: #f2f8ee;
}

.tool-site-shell.site-3,
.tool-site-shell.site-6,
.tool-site-shell.site-14,
.tool-site-shell.site-15,
.tool-site-shell.site-16,
.tool-site-shell.site-17,
.tool-site-shell.site-18 {
  --shell-page-bg: #fbfaf7;
  --shell-surface-soft: #f7f3ea;
}

.tool-site-shell.site-12,
.tool-site-shell.site-20,
.tool-site-shell.site-21,
.tool-site-shell.site-22,
.tool-site-shell.site-29 {
  --shell-page-bg: #f7fbf9;
  --shell-surface-soft: #eef7f2;
}

.tool-site-shell.site-5,
.tool-site-shell.site-7,
.tool-site-shell.site-9,
.tool-site-shell.site-13,
.tool-site-shell.site-27 {
  --shell-page-bg: #fffaf7;
  --shell-surface-soft: #fff2e9;
}

/* ============================================================
   Tool Product Contract v2
   Shared product-quality rules for active printable tool sites.
   This block is intentionally forceful because many site skins are
   generated and still contain stale 1200px, large-radius, and noisy
   decorative defaults.
   ============================================================ */
.tool-site-shell {
  background: var(--shell-page-bg, #fbfcfd) !important;
  overflow-x: hidden;
}

.tool-site-shell .detail-page,
.tool-site-shell .list-page,
.tool-site-shell .homepage,
.tool-site-shell .detail-content-area {
  max-width: 1400px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.tool-site-shell .detail-page {
  display: block;
}

.tool-site-shell .page-header,
.tool-site-shell .breadcrumb,
.tool-site-shell .set-switcher,
.tool-site-shell .intro,
.tool-site-shell .intro-section,
.tool-site-shell .body-content,
.tool-site-shell .seo-card,
.tool-site-shell .guide-content-card,
.tool-site-shell .intro-content-card,
.tool-site-shell #detail-atom-mount,
.tool-site-shell .detail-atom,
.tool-site-shell .detail-atom-container {
  border-radius: 8px !important;
}

.tool-site-shell .page-header,
.tool-site-shell .intro,
.tool-site-shell .intro-section {
  background: color-mix(in srgb, var(--shell-surface-soft, #eef4f7) 72%, white) !important;
  border: 1px solid color-mix(in srgb, var(--color-primary, #2563eb) 16%, #e5e7eb) !important;
  box-shadow: none !important;
}

.tool-site-shell .page-header {
  padding: clamp(1.5rem, 3vw, 2.5rem) !important;
  margin-bottom: 1.25rem !important;
  border-bottom-width: 1px !important;
}

.tool-site-shell .breadcrumb {
  background: rgba(255, 255, 255, 0.78) !important;
}

.tool-site-shell #detail-atom-mount {
  max-width: 1400px !important;
  margin: 1.25rem auto 2rem !important;
  padding: clamp(1rem, 2vw, 2rem) !important;
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06) !important;
  overflow: visible !important;
}

.tool-site-shell .detail-atom {
  max-width: 100% !important;
}

.tool-site-shell .detail-atom-toolbar,
.tool-site-shell .da-toolbar,
.tool-site-shell .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.tool-site-shell .btn,
.tool-site-shell button,
.tool-site-shell .set-btn {
  border-radius: 8px !important;
  letter-spacing: 0 !important;
}

.tool-site-shell .form-exercise-container {
  width: 100% !important;
  max-width: 1280px !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)) !important;
  gap: clamp(0.875rem, 1.4vw, 1.25rem) !important;
}

.tool-site-shell .form-problem {
  min-height: 176px;
  border-left-width: 4px !important;
  border-radius: 8px !important;
}

.tool-site-shell .problem-text {
  font-size: clamp(1.05rem, 1.1vw, 1.22rem) !important;
  line-height: 1.35 !important;
}

.tool-site-shell .problem-input,
.tool-site-shell .answer-input {
  min-width: 5.5rem;
  font-size: clamp(1.1rem, 1.3vw, 1.35rem) !important;
}

.tool-site-shell .problem-visual svg,
.tool-site-shell .form-problem svg {
  max-width: 100%;
  height: auto;
}

.tool-site-shell .canvas-container,
.tool-site-shell .coloring-scene-container,
.tool-site-shell .color-by-equation-container {
  width: 100%;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.5rem) 0;
}

.tool-site-shell .creative-canvas,
.tool-site-shell .coloring-scene-svg,
.tool-site-shell .color-equation-grid {
  max-width: min(100%, 920px) !important;
}

.tool-site-shell .coloring-scene-svg {
  width: min(100%, 760px) !important;
  min-height: 420px;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
}

.tool-site-shell .crossword-puzzle,
.tool-site-shell .puzzle-content {
  width: 100%;
}

.tool-site-shell .crossword-puzzle {
  border-radius: 8px !important;
  border-width: 1px !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.tool-site-shell .crossword-grid {
  width: min(100%, 620px) !important;
  margin: 0 auto;
}

.tool-site-shell .crossword-cell {
  min-width: clamp(24px, 3.2vw, 38px) !important;
  min-height: clamp(24px, 3.2vw, 38px) !important;
}

.tool-site-shell .crossword-clues {
  min-width: 0;
}

/* Template family v1.1: math practice needs a workbook surface with readable problems. */
body.site-1 #detail-atom-mount,
body.site-8 #detail-atom-mount,
body.site-17 #detail-atom-mount {
  --da-primary: var(--tool-accent);
  --da-primary-hover: var(--tool-accent-strong);
  --da-border: #cfded9;
  --da-bg-alt: #f2f8f5;
}

body.site-1 .form-exercise-container,
body.site-8 .form-exercise-container,
body.site-17 .form-exercise-container {
  max-width: 1320px !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr)) !important;
  gap: 1.25rem !important;
  align-items: stretch;
}

body.site-1 .form-problem,
body.site-8 .form-problem,
body.site-17 .form-problem {
  min-height: 210px;
  padding: 1.2rem !important;
  border: 1px solid #cfded9 !important;
  border-top: 5px solid var(--tool-accent) !important;
  border-left-width: 1px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfefd 100%) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

body.site-1 .problem-question,
body.site-8 .problem-question,
body.site-17 .problem-question {
  align-items: flex-start;
  gap: 0.75rem;
}

body.site-1 .problem-number,
body.site-8 .problem-number,
body.site-17 .problem-number {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e2f3ed;
  color: #0f4f49;
}

body.site-1 .problem-text,
body.site-8 .problem-text,
body.site-17 .problem-text {
  font-size: 1.2rem !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
}

body.site-1 .problem-visual,
body.site-8 .problem-visual,
body.site-17 .problem-visual {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  border: 1px dashed #bfd6cf;
  border-radius: 8px;
  background: #f7fcfa;
}

body.site-1 .problem-visual svg,
body.site-8 .problem-visual svg,
body.site-17 .problem-visual svg,
body.site-1 .form-problem svg,
body.site-8 .form-problem svg,
body.site-17 .form-problem svg {
  max-height: 150px;
  color: #113f3b;
}

body.site-1 .problem-input,
body.site-8 .problem-input,
body.site-17 .problem-input,
body.site-1 .answer-input,
body.site-8 .answer-input,
body.site-17 .answer-input {
  min-height: 46px;
  border-color: #b8cdc6 !important;
  background: #ffffff;
}

/* Template family v1.2: mature math sample system, led by easymathprint.com. */
body.site-1 .detail-atom,
body.site-8 .detail-atom,
body.site-17 .detail-atom {
  color: #14231f;
}

body.site-1 .form-header,
body.site-8 .form-header,
body.site-17 .form-header {
  margin-bottom: 1rem;
  padding: 0 0 0.9rem;
  border-bottom: 1px solid #d5e5df;
}

body.site-1 .form-title,
body.site-8 .form-title,
body.site-17 .form-title {
  font-size: 1.35rem;
  letter-spacing: 0;
}

body.site-1 .form-meta,
body.site-8 .form-meta,
body.site-17 .form-meta {
  min-height: 2rem;
}

body.site-1 .form-exercise-container,
body.site-8 .form-exercise-container,
body.site-17 .form-exercise-container {
  container-type: inline-size;
}

body.site-1 .form-problem,
body.site-8 .form-problem,
body.site-17 .form-problem {
  position: relative;
  justify-content: space-between;
}

body.site-1 .form-problem::after,
body.site-8 .form-problem::after,
body.site-17 .form-problem::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #0f766e, #88b77c);
  pointer-events: none;
}

body.site-1 .problem-question,
body.site-8 .problem-question,
body.site-17 .problem-question {
  width: 100%;
  min-height: 2.5rem;
}

body.site-1 .problem-content,
body.site-8 .problem-content,
body.site-17 .problem-content,
body.site-1 .problem-expression,
body.site-8 .problem-expression,
body.site-17 .problem-expression {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.site-1 .problem-options,
body.site-8 .problem-options,
body.site-17 .problem-options {
  padding-left: 2.75rem;
}

body.site-1 .option-label,
body.site-8 .option-label,
body.site-17 .option-label {
  border-radius: 8px;
  background: #f4faf7;
}

body.site-1 .problem-answer-space,
body.site-8 .problem-answer-space,
body.site-17 .problem-answer-space {
  min-height: 2.5rem;
  border-bottom: 2px solid #173d38;
}

@container (max-width: 520px) {
  body.site-1 .problem-options,
  body.site-8 .problem-options,
  body.site-17 .problem-options {
    padding-left: 0;
  }
}

/* Template family v1.1: grid puzzles need a stable board plus clear clue rail. */
body.site-3 #detail-atom-mount,
body.site-4 #detail-atom-mount,
body.site-5 #detail-atom-mount,
body.site-6 #detail-atom-mount,
body.site-10 #detail-atom-mount,
body.site-11 #detail-atom-mount,
body.site-14 #detail-atom-mount,
body.site-15 #detail-atom-mount,
body.site-16 #detail-atom-mount,
body.site-18 #detail-atom-mount {
  --da-primary: var(--tool-accent);
  --da-primary-hover: var(--tool-accent-strong);
  --da-border: #d8e3d1;
  --da-bg-alt: #f4f7ef;
}

body.site-3 .solver-title,
body.site-4 .solver-title,
body.site-5 .solver-title,
body.site-6 .solver-title,
body.site-10 .solver-title,
body.site-11 .solver-title,
body.site-14 .solver-title,
body.site-15 .solver-title,
body.site-16 .solver-title,
body.site-18 .solver-title,
body.site-3 .canvas-title,
body.site-4 .canvas-title,
body.site-5 .canvas-title,
body.site-6 .canvas-title,
body.site-10 .canvas-title,
body.site-11 .canvas-title,
body.site-14 .canvas-title,
body.site-15 .canvas-title,
body.site-16 .canvas-title,
body.site-18 .canvas-title {
  letter-spacing: 0;
}

body.site-3 .solver-board-container,
body.site-4 .solver-board-container,
body.site-5 .solver-board-container,
body.site-6 .solver-board-container,
body.site-10 .solver-board-container,
body.site-11 .solver-board-container,
body.site-14 .solver-board-container,
body.site-15 .solver-board-container,
body.site-16 .solver-board-container,
body.site-18 .solver-board-container,
body.site-3 .solver-nonogram-container,
body.site-4 .solver-nonogram-container,
body.site-5 .solver-nonogram-container,
body.site-6 .solver-nonogram-container,
body.site-10 .solver-nonogram-container,
body.site-11 .solver-nonogram-container,
body.site-14 .solver-nonogram-container,
body.site-15 .solver-nonogram-container,
body.site-16 .solver-nonogram-container,
body.site-18 .solver-nonogram-container,
body.site-3 .number-grid-container,
body.site-4 .number-grid-container,
body.site-5 .number-grid-container,
body.site-6 .number-grid-container,
body.site-10 .number-grid-container,
body.site-11 .number-grid-container,
body.site-14 .number-grid-container,
body.site-15 .number-grid-container,
body.site-16 .number-grid-container,
body.site-18 .number-grid-container,
body.site-3 .canvas-container,
body.site-4 .canvas-container,
body.site-5 .canvas-container,
body.site-6 .canvas-container,
body.site-10 .canvas-container,
body.site-11 .canvas-container,
body.site-14 .canvas-container,
body.site-15 .canvas-container,
body.site-16 .canvas-container,
body.site-18 .canvas-container {
  padding: 1.25rem;
  border: 1px solid #d8e3d1;
  border-radius: 8px;
  background: #fbfdf9;
  overflow-x: auto;
}

body.site-3 .solver-board,
body.site-4 .solver-board,
body.site-5 .solver-board,
body.site-6 .solver-board,
body.site-10 .solver-board,
body.site-11 .solver-board,
body.site-14 .solver-board,
body.site-15 .solver-board,
body.site-16 .solver-board,
body.site-18 .solver-board {
  max-width: min(100%, 680px);
  border-color: #223326;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

body.site-3 .number-grid,
body.site-4 .number-grid,
body.site-5 .number-grid,
body.site-6 .number-grid,
body.site-10 .number-grid,
body.site-11 .number-grid,
body.site-14 .number-grid,
body.site-15 .number-grid,
body.site-16 .number-grid,
body.site-18 .number-grid,
body.site-3 .nonogram-table,
body.site-4 .nonogram-table,
body.site-5 .nonogram-table,
body.site-6 .nonogram-table,
body.site-10 .nonogram-table,
body.site-11 .nonogram-table,
body.site-14 .nonogram-table,
body.site-15 .nonogram-table,
body.site-16 .nonogram-table,
body.site-18 .nonogram-table,
body.site-3 .creative-canvas,
body.site-4 .creative-canvas,
body.site-5 .creative-canvas,
body.site-6 .creative-canvas,
body.site-10 .creative-canvas,
body.site-11 .creative-canvas,
body.site-14 .creative-canvas,
body.site-15 .creative-canvas,
body.site-16 .creative-canvas,
body.site-18 .creative-canvas {
  border-color: #223326;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

body.site-3 .solver-clues,
body.site-4 .solver-clues,
body.site-5 .solver-clues,
body.site-6 .solver-clues,
body.site-10 .solver-clues,
body.site-11 .solver-clues,
body.site-14 .solver-clues,
body.site-15 .solver-clues,
body.site-16 .solver-clues,
body.site-18 .solver-clues,
body.site-3 .targets-section,
body.site-4 .targets-section,
body.site-5 .targets-section,
body.site-6 .targets-section,
body.site-10 .targets-section,
body.site-11 .targets-section,
body.site-14 .targets-section,
body.site-15 .targets-section,
body.site-16 .targets-section,
body.site-18 .targets-section {
  border-left: 5px solid var(--tool-accent);
  background: #f6f9f2;
}

/* Template family v1.2: mature grid/crossword sample system, led by crosswordprint.com. */
body.site-14 #detail-atom-mount {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdf8 100%) !important;
}

body.site-14 .detail-atom {
  color: #172114;
}

body.site-14 .card-grid,
body.site-14 .activity-card,
body.site-14 .crossword-puzzle,
body.site-14 .puzzle-content,
body.site-14 .crossword-clues,
body.site-14 .solver-clues {
  min-width: 0;
}

body.site-14 .activity-card {
  border-top-color: #4f6f52;
}

body.site-14 .crossword-puzzle {
  padding: 1rem;
  background: #ffffff;
}

body.site-14 .puzzle-content {
  align-items: start;
}

body.site-14 .crossword-grid,
body.site-14 .solver-board,
body.site-14 .number-grid {
  background: #ffffff;
  outline: 1px solid #223326;
  outline-offset: 0;
}

body.site-14 .crossword-cell,
body.site-14 .grid-cell,
body.site-14 .solver-cell {
  color: #172114;
}

body.site-14 .crossword-clues,
body.site-14 .solver-clues,
body.site-14 .targets-section {
  max-height: none;
  border-radius: 8px;
  border: 1px solid #d7e2cf;
  border-left: 5px solid #4f6f52;
  background: #f8fbf3;
}

body.site-14 .clue-item,
body.site-14 .target-item {
  font-size: 0.95rem;
  line-height: 1.55;
}

body.site-14 .clue-item + .clue-item {
  border-top-color: #dbe6d2;
}

@media (min-width: 1000px) {
  body.site-14 .puzzle-content {
    grid-template-columns: minmax(420px, 0.95fr) minmax(360px, 1.05fr) !important;
  }
}

@media (min-width: 1000px) {
  .tool-site-shell .puzzle-content {
    grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 1.05fr) !important;
    gap: clamp(1.25rem, 2.2vw, 2.25rem) !important;
  }
}

@media (max-width: 768px) {
  .tool-site-shell .container,
  .tool-site-shell .detail-page,
  .tool-site-shell .list-page,
  .tool-site-shell .homepage {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .tool-site-shell #detail-atom-mount {
    padding: 1rem !important;
  }

  .tool-site-shell .form-exercise-container {
    grid-template-columns: 1fr !important;
  }

  .tool-site-shell .page-header,
  .tool-site-shell .intro,
  .tool-site-shell .intro-section,
  .tool-site-shell .set-switcher {
    padding: 1rem !important;
  }
}

@media (min-width: 1500px) {
  .tool-site-shell .categories-grid,
  .tool-site-shell .category-grid,
  .tool-site-shell .worksheet-grid,
  .tool-site-shell .cards-grid,
  .tool-site-shell .tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .tool-site-shell {
    --shell-space-x: 1rem;
    --shell-space-y: 1.5rem;
  }

  .tool-site-shell .homepage,
  .tool-site-shell .list-page,
  .tool-site-shell .detail-page {
    padding-top: 1.5rem;
    padding-bottom: 3rem;
  }

  .tool-site-shell .hero h1,
  .tool-site-shell .hero-title,
  .tool-site-shell .page-header h1 {
    font-size: clamp(1.85rem, 9vw, 2.3rem);
  }
}
