:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1b1f24;
  --muted: #555b63;
  --body: #333a42;
  --border: #dad6cc;
  --border-soft: #e8e5de;
  --teal: #1f7a6d;
  --teal-soft: #e3f0ec;
  --terra: #c2562a;
  --cobalt: #2f5da8;
  --slate: #4a515b;
  --plum: #7a4ea3;
  --ochre: #b5841a;
  --warn: #a8431d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, .display {
  font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
  letter-spacing: -0.01em;
}
a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, svg .tile:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 1000;
}
.skip-link:focus { left: 16px; }
.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px 40px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.flag-details { display: inline-block; margin-left: 8px; }
.flag-details summary { cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; text-decoration: underline; }
.flag-details[open] { display: block; margin-top: 6px; padding: 8px 10px; background: var(--bg); border-radius: 8px; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.brand-link:hover { text-decoration: none; }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
.nav-pill:hover { background: var(--bg); text-decoration: none; }
.nav-pill.active { background: var(--ink); color: #fff; }
/* A shaded tray behind filter pills so the filter area reads as one control. */
.filter-panel { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 14px; }
.filter-panel.row { flex-direction: row; }
.filter-panel .nav-pill { background: var(--surface); border-color: var(--border-soft); }
.filter-panel .nav-pill:hover { border-color: var(--border); }
.filter-panel .nav-pill.active { background: var(--ink); border-color: var(--ink); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.card-highlight { border: 2px solid var(--ink); }
code { overflow-wrap: anywhere; }
fieldset { min-width: 0; max-width: 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #c9c5bc;
  background: var(--surface);
  color: var(--ink);
  font: 500 14px Inter, system-ui, sans-serif;
  cursor: pointer;
}
.btn:hover { background: #f1efe9; text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #2d333b; }
.btn-outline-dark { border-color: var(--ink); font-weight: 600; }
.btn-pill { border-radius: 999px; }
.btn-pill[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }

.banner {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--teal-soft);
  border: 1px solid var(--teal);
  color: #144f47;
  font-size: 14px;
}
.banner-warn {
  background: #fdf0eb;
  border-color: var(--warn);
  color: #7c2e12;
}

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; max-width: 100%; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; max-width: 100%; }
.row > *, .row-between > * { max-width: 100%; min-width: 0; }
select { max-width: 100%; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 16px; }
.studio-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.studio-controls { flex: 1 1 380px; min-width: 0; }
.studio-preview { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; min-width: 0; max-width: 100%; }
.field input[type='text'],
.field input[type='email'],
.field input[type='number'],
.field input[type='date'],
.field input[type='url'],
.field select,
.field textarea {
  min-height: 44px;
  max-width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #c9c5bc;
  background: #fff;
  color: var(--ink);
  font: 500 14px Inter, system-ui, sans-serif;
}
input[type='range'] { width: 100%; accent-color: var(--ink); }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1efe9;
  color: var(--body);
}
.muted { color: var(--muted); font-size: 13px; }
.tile:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }

.gap-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 16px;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.day-col {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 118px;
}
.day-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--bg);
}

table.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.compare-table th, table.compare-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
table.compare-table th { font-weight: 600; color: var(--muted); font-size: 13px; }

@media print {
  body { background: #fff; font-size: 12pt; }
  .topbar, body .no-print { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .card { break-inside: avoid; border: 1px solid #ccc; }
}

/* ---------------------------------------------------------------------------
   Public landing page (logged-out "/"), direction C "Bold mosaic".
   --------------------------------------------------------------------------- */
.lp { background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; }
.lp-wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
/* .lp-h is only used on h1–h3, which already get the display font from the global heading rule. */
.lp-h { letter-spacing: -0.02em; margin: 0; }
.lp-dark { background: var(--ink); color: var(--bg); }
.lp-dark a:not(.lp-btn):not(.lp-brand) { color: #9fd6cb; }
/* The global cobalt focus ring is ~2.6:1 on --ink; use a light ring on the dark bands. */
.lp-dark a:focus-visible { outline-color: #9fd6cb; }
.lp-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; }
.lp-brand { display: flex; align-items: center; gap: 10px; color: var(--bg); font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 700; font-size: 19px; }
.lp-brand:hover { text-decoration: none; }
.lp-btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; border-radius: 12px; font-weight: 700; font-size: 17px; border: 1px solid transparent; }
.lp-btn:hover { text-decoration: none; }
.lp-btn-light { background: var(--bg); color: var(--ink); }
.lp-btn-light:hover { background: #ffffff; }
.lp-btn-ghost { color: var(--bg); border-color: #555b63; font-weight: 600; }
.lp-btn-ghost:hover { border-color: var(--bg); }
.lp-btn-small { min-height: 44px; padding: 0 18px; font-size: 15px; font-weight: 600; color: var(--bg); border-color: var(--bg); }
.lp-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 48px; padding-bottom: 72px; }
.lp-hero-copy { flex: 1 1 min(480px, 100%); display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lp-hero h1 { font-size: 62px; line-height: 1.02; letter-spacing: -0.03em; }
.lp-lede { margin: 0; font-size: 19px; color: #d6d3cb; max-width: 520px; line-height: 1.5; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.lp-fine { margin: 0; font-size: 14px; color: #b9b5ac; }
.lp-hero-art { margin: 0; flex: 1 1 min(400px, 100%); max-width: 500px; width: 100%; }
.lp-hero-img { width: 100%; height: auto; display: block; border-radius: 16px; border: 1px solid rgba(246, 245, 241, 0.22); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28); background: var(--bg); }
.lp-editorial-art { margin: 14px 0 4px; max-width: 440px; }
.lp-editorial-img { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--border-soft); background: var(--bg); }
.lp-section { padding-top: 68px; padding-bottom: 68px; display: flex; flex-direction: column; gap: 28px; }
.lp-section-head { display: flex; flex-direction: column; gap: 8px; }
.lp-section h2 { font-size: 36px; line-height: 1.12; max-width: 760px; text-wrap: balance; }
.lp-preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.lp-preview-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lp-preview-copy { display: flex; flex-direction: column; gap: 6px; }
.lp-preview-copy h3 { font-size: 20px; line-height: 1.2; }
.lp-preview-copy p { margin: 0; font-size: 15px; color: var(--body); }
.lp-mock {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 146px;
  justify-content: center;
}
.lp-mock-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-mock-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.lp-mock-pill-ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lp-mock-dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }
.lp-mock-teal { background: var(--teal); color: #ffffff; }
.lp-mock-cobalt { background: var(--cobalt); color: #ffffff; }
.lp-mock-terra { background: #a8431d; color: #ffffff; }
.lp-mock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  font-size: 12px;
}
.lp-mock-text { flex: 1 1 auto; color: var(--ink); font-weight: 600; min-width: 0; }
.lp-mock-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.lp-mock-tracks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lp-mock-track {
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 1.25;
}
.lp-mock-track strong { font-size: 13px; }
.lp-mock-track span { opacity: 0.92; font-size: 11px; }
.lp-mock-ages { display: flex; flex-direction: column; gap: 7px; }
.lp-mock-age {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
}
.lp-compat { display: flex; flex-direction: column; gap: 22px; padding-top: 56px; padding-bottom: 56px; }
.lp-compat-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lp-compat-title { display: flex; flex-direction: column; gap: 6px; max-width: 680px; }
.lp-compat-title h2 { font-size: 32px; line-height: 1.15; }
.lp-compat-link { font-weight: 700; font-size: 15px; color: var(--cobalt); white-space: nowrap; }
.lp-compat-list { display: flex; flex-direction: column; gap: 14px; }
.lp-chip-more { background: var(--teal-soft); border-color: transparent; }
.lp-chip-more a { color: #144f47; font-weight: 600; text-decoration: none; }
.lp-chip-more a:hover { text-decoration: underline; }
.lp-trust-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.lp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.lp-card { color: #ffffff; border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 12px; min-height: 260px; }
.lp-card h3 { font-size: 28px; line-height: 1.15; }
.lp-card p { margin: 0; font-size: 17px; }
.lp-card-num { font-family: 'Space Grotesk', Inter, sans-serif; font-weight: 700; font-size: 15px; }
.lp-teal { background: var(--teal); }
.lp-cobalt { background: var(--cobalt); }
.lp-plum { background: var(--plum); }
.lp-band { background: var(--surface); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.lp-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; padding-top: 72px; padding-bottom: 72px; }
.lp-split-intro, .lp-split-curricula { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.lp-split h2 { font-size: 36px; line-height: 1.12; }
.lp-block { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.lp-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.lp-sub { margin: 0; color: var(--body); font-size: 17px; }
.lp-note { margin: 0; font-size: 14px; color: var(--muted); }
.lp-curricula-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.lp-count { font-size: 13px; font-weight: 600; color: #144f47; background: var(--teal-soft); padding: 3px 10px; border-radius: 999px; }
.lp-curricula-groups { display: flex; flex-direction: column; gap: 18px; }
.lp-curricula-group { display: flex; flex-direction: column; gap: 8px; }
.lp-group-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--body); font-family: Inter, system-ui, -apple-system, sans-serif; letter-spacing: 0; }
.lp-chips { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.lp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.lp-chip-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 1.5;
}
.lp-more { border-top: 1px solid var(--border-soft); padding-top: 14px; }
.lp-more summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--cobalt);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  list-style: none;
}
.lp-more summary::-webkit-details-marker { display: none; }
.lp-more summary::before {
  content: '▸';
  font-size: 12px;
  transition: transform 0.15s ease;
}
.lp-more[open] > summary::before { transform: rotate(90deg); }
.lp-more summary:hover { text-decoration: underline; }
.lp-all-levels {
  margin: 12px 0 0;
  padding: 16px 18px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 6px 20px;
  font-size: 13px;
  color: var(--body);
}
.lp-cta-copy { display: flex; flex-direction: column; gap: 8px; }
.lp-cta-note { font-size: 18px; }
.lp-privacy { display: flex; flex-direction: column; gap: 28px; padding-top: 72px; padding-bottom: 72px; }
.lp-privacy h2 { font-size: 32px; line-height: 1.15; }
.lp-privacy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.lp-privacy-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lp-privacy-item h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.lp-privacy-item p { margin: 0; color: var(--body); font-size: 15px; }
.lp-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-top: 80px; padding-bottom: 80px; }
.lp-cta h2 { font-size: 44px; line-height: 1.05; }
.lp-foot { border-top: 1px solid #2a2f36; }
.lp-foot .lp-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 24px; font-size: 14px; color: #b9b5ac; }
.lp-foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
@media (max-width: 860px) {
  .lp-split { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 640px) {
  .lp-hero { padding-top: 24px; padding-bottom: 48px; gap: 28px; }
  .lp-hero h1 { font-size: 42px; }
  .lp-lede { font-size: 17px; }
  .lp-section, .lp-split, .lp-compat, .lp-privacy, .lp-cta { padding-top: 48px; padding-bottom: 48px; }
  .lp-section h2, .lp-cta h2 { font-size: 30px; }
  .lp-split h2, .lp-compat-title h2 { font-size: 28px; }
  .lp-trust-grid { grid-template-columns: minmax(0, 1fr); }
  .lp-mock-tracks { grid-template-columns: minmax(0, 1fr); }
}

/* Core builder (/children/:id/core) and core summaries — mobile first. */
.core-stats { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.core-stats li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.core-start { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.core-start .card, .core-filters .field { min-width: 0; }
.core-start select, .core-filters select { width: 100%; max-width: 100%; min-width: 0; }
.core-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.core-check input { margin-top: 3px; }
.core-subject { margin: 8px 0 0; font-size: 18px; }
.core-strand { display: flex; flex-direction: column; gap: 8px; }
.core-strand-title { margin: 0; font-size: 15px; font-weight: 600; }
.core-tiles { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.core-tile {
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
  background: var(--surface);
}
.core-tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.core-badge { flex: none; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #f1efe9; color: var(--body); }
.core-state-core { border-left-color: var(--teal); }
.core-state-needed_first { border-left-color: var(--terra); }
.core-state-known, .core-state-mastered { border-left-color: var(--slate); }
.core-state-later { border-left-color: var(--border); }
.core-badge-core { background: var(--teal-soft); color: #144f47; }
.core-badge-needed_first { background: #fdf0eb; color: #7c2e12; }
.core-badge-known, .core-badge-mastered { background: #e7e9ec; color: #2a2f36; }
.core-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.core-ideas summary { cursor: pointer; font-size: 13px; color: var(--cobalt); }
.core-idea-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.core-alignment-body { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.studio-subject-tabs { gap: 8px; }
.core-lens-badge { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--cobalt); color: var(--cobalt); }
.core-summary-text { margin: 0; font-size: 13px; color: var(--body); }
.core-empty { margin: 0; padding: 14px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: 14px; }
/* Controls that need JavaScript (public/app.js adds the "js" class to <html>) stay hidden without it. */
html:not(.js) .js-only { display: none !important; }
.core-lens-picks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.core-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.core-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: end; }
.core-summary { display: flex; flex-direction: column; gap: 12px; }
.core-summary-strand { display: flex; flex-direction: column; gap: 6px; }
.core-chips { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.core-chip { font-size: 13px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border-soft); border-left: 4px solid var(--border); background: var(--surface); max-width: 100%; overflow-wrap: anywhere; }
.core-chip-state { color: var(--muted); font-size: 11px; margin-left: 4px; }
@media (min-width: 720px) {
  .core-start { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .core-tiles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .core-filters { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
}
@media (max-width: 640px) {
  .container { padding: 16px 16px 48px; }
  .topbar-inner { padding: 10px 16px; }
}

/* Quest drag-sort tokens: pointer drags must not scroll the page on touch screens. */
.quest-token { touch-action: none; }

/* Quest world: the region backdrop with its host, and guild badges (generated art, decorative). */
.quest-stage { position: relative; border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.quest-backdrop { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 14px; }
.quest-backdrop-short { aspect-ratio: 4 / 1; }
.quest-host { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); font-weight: 600; }
.quest-portrait { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.quest-badge { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 160px; }
.quest-badge-img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.quest-map { position: relative; border-radius: 16px; overflow: hidden; }
.quest-map-img { display: block; width: 100%; height: auto; }
.quest-map-pins { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-glow { fill: #E8A435; opacity: 0.35; }
.map-glow.map-resting { fill: #DAD6CC; opacity: 0.4; }
.map-glow.map-lit { opacity: 0.6; }
.map-lantern { stroke: #1B1F24; stroke-width: 0.4; fill: #F6F5F1; }
.map-lantern.map-ready { fill: #E8A435; }
.map-lantern.map-lit { fill: #FFD27A; }
.map-label { font-size: 2.4px; font-weight: 700; fill: #1B1F24; paint-order: stroke; stroke: #F6F5F1; stroke-width: 0.8px; }
.quest-map-pins a:focus-visible .map-glow { stroke: #1B1F24; stroke-width: 0.6; opacity: 1; }
.map-list { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding-left: 18px; }
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.quest-badge-empty { background: #E8E5DE; }
.quest-badge-locked figcaption { opacity: 0.7; }
@media (prefers-reduced-motion: no-preference) {
  .map-glow.map-ready { animation: lantern-glow 2.4s ease-in-out infinite; }
}
@keyframes lantern-glow { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.55; } }

/* Shared Five-Pillar UX components (CSP-clean, zero inline styles, 320px safe) */
.subnav-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
}
.subnav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 6px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.subnav-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.subnav-pill:hover { background: #efede6; text-decoration: none; }
.subnav-pill.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.chart-svg { display: block; width: 100%; height: auto; max-width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px; }
.stat-box { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.playpack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.playpack-card { border: 1px solid var(--border); border-left: 5px solid var(--teal); border-radius: 12px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.playpack-style-concrete { border-left-color: #1F7A6D; }
.playpack-style-narrative { border-left-color: #C2562A; }
.playpack-style-pattern { border-left-color: #2F5DA8; }
.playpack-style-procedural { border-left-color: #4A515B; }
.playpack-style-choice { border-left-color: #7A4EA3; }
.playpack-style-applied { border-left-color: #B5841A; }
.print-doc { max-width: 900px; margin: 0 auto; background: #fff; padding: 28px; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 18px; }
.print-sig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 20px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.print-sig-line { border-bottom: 1px solid var(--ink); min-height: 28px; margin-bottom: 4px; }
@media (max-width: 640px) {
  /* On phones the planning subnav and the main nav pills scroll sideways in one row instead of wrapping into a
     wall of ~20 pills above the content. */
  .subnav-inner { padding: 6px 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .subnav-pill { flex: 0 0 auto; white-space: nowrap; }
  .nav-links { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; min-width: 0; flex: 1 1 100%; padding-bottom: 2px; scrollbar-width: thin; }
  .nav-links > * { flex: 0 0 auto; white-space: nowrap; }
  .print-doc { padding: 16px; }
}
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .subnav-bar, .site-footer, body .no-print { display: none !important; }
  .container { max-width: 100%; padding: 0; gap: 12px; }
  .card, .print-doc { border: 1px solid #bbb; border-radius: 4px; padding: 12px; break-inside: avoid; box-shadow: none; }
  .table-scroll { overflow: visible; }
  a { color: #000; text-decoration: none; }
}

/* --- Method, routine and curriculum cards (Curricula lists, method profiles, Matched for <child>, App Stack) --- */
.methods-philosophy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.methods-phil-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.methods-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}
.methods-filter-grid .field {
  min-width: 0;
}
.methods-filter-grid select,
.methods-filter-grid input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.methods-cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.methods-routine-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.methods-meta-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
}
.methods-howto {
  line-height: 1.55;
  color: var(--ink);
}
.methods-details {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.methods-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--teal);
}
.methods-range-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.methods-level-block {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
}
@media (min-width: 720px) {
  .methods-philosophy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .methods-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .methods-meta-col {
    align-items: flex-end;
    text-align: right;
  }
}
@media (min-width: 960px) {
  .methods-philosophy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .methods-filter-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  }
  .methods-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.methods-rec-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.methods-reason-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--teal);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.methods-compare-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

/* --- Worldview filter bar & badges (CSP-clean) --- */
.wv-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.wv-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.wv-badge-secular {
  background: #e6f4f1;
  color: #14594f;
  border-color: #b7dfd6;
}
.wv-badge-neutral {
  background: #eef1f5;
  color: #374151;
  border-color: #d1d8e0;
}
.wv-badge-christian {
  background: #f5eefb;
  color: #5b2d8a;
  border-color: #d9c2f0;
}
.wv-badge-other_faith {
  background: #fef3e8;
  color: #8f4714;
  border-color: #f3cfa7;
}
.wv-badge-mixed {
  background: #f3f1ea;
  color: #4a4538;
  border-color: #d9d3c3;
}

/* --- Crowdsourced Community Signals (privacy-first aggregates & voting) --- */
.community-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  min-width: 0;
  max-width: 100%;
}
.community-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.community-stat {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--body);
}
.community-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.vote-form {
  margin: 0;
  display: inline-flex;
}
.vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: 600 12px Inter, system-ui, sans-serif;
  cursor: pointer;
}
.vote-btn:hover {
  background: #f1efe9;
}
.vote-btn.is-active {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: #144f47;
}
.vote-btn-down.is-active {
  background: #fdf0eb;
  border-color: var(--warn);
  color: #7c2e12;
}

/* ---------- Method Profiles, Side-by-Side Compare Mode & Redesigned Component Cards ---------- */

.mp-pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.mp-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.mp-pill:hover { background: #f1efe9; text-decoration: none; }
.mp-pill.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.mp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.mp-essence {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}
.mp-best-for {
  font-size: 14px;
  color: var(--body);
  margin: 0;
}
.mp-micro-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mp-style-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 16px;
}
.mp-honeycomb-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.mp-honeycomb-svg {
  width: 156px;
  height: auto;
  display: block;
}
.mp-style-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mp-style-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.mp-style-legend-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--body);
}
.mp-style-legend-pct {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.mp-mix-bar-svg {
  width: 100%;
  height: 10px;
  display: block;
  border-radius: 999px;
  overflow: hidden;
}

.mp-day-strip-svg {
  width: 100%;
  height: auto;
  display: block;
}
.mp-day-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mp-day-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--body);
}
.mp-day-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: none;
}
.mp-swatch-concrete { background: var(--teal); }
.mp-swatch-narrative { background: var(--terra); }
.mp-swatch-pattern { background: var(--cobalt); }
.mp-swatch-procedural { background: var(--slate); }
.mp-swatch-choice { background: var(--plum); }
.mp-swatch-applied { background: var(--ochre); }
.mp-swatch-open { background: #dad4c7; border: 1px solid #bfb8a8; }
.mp-swatch-rhythm { background: var(--cobalt); }
.mp-swatch-outdoors { background: var(--ochre); }

.mp-effort-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mp-effort-row {
  display: grid;
  grid-template-columns: minmax(98px, 120px) minmax(56px, 76px) auto minmax(56px, 76px);
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.mp-effort-label { font-weight: 600; color: var(--ink); }
.mp-effort-pole { font-size: 12px; color: var(--muted); }
.mp-effort-pole-left { text-align: right; }
.mp-effort-mobile-poles { display: none; }
.cmp-mobile-label { display: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 3px; }
.mp-effort-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mp-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: transparent;
  display: inline-block;
}
.mp-dot.is-filled { background: var(--ink); }

.mp-evidence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mp-evidence-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.mp-evidence-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f1efe9;
  border: 1px solid var(--border-soft);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.mp-ages-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mp-age-card {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-top: 3px solid var(--teal);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mp-age-band-0 { border-top-color: var(--teal); }
.mp-age-band-1 { border-top-color: var(--cobalt); }
.mp-age-band-2 { border-top-color: var(--plum); }
.mp-age-band-3 { border-top-color: var(--terra); }

.mp-ring-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.mp-ring-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mp-ring-sm {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.mp-ring-sm .ring-svg { width: 96px; height: 96px; display: block; }
.mp-ring-sm .mp-ring-hole {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}
.mp-ring-arrow { font-size: 20px; font-weight: 700; color: var(--muted); }

.mp-dark-callout {
  background: var(--ink);
  color: #ffffff;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mp-dark-callout .mp-micro-label { color: #b8c0cb; }
.mp-dark-callout p { color: #e6e8ec; margin: 0; }
.mp-btn-light {
  background: #ffffff;
  color: var(--ink);
  border-color: #ffffff;
}
.mp-btn-light:hover { background: #efede8; text-decoration: none; }

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

/* ---------- Redesigned Component Cards ---------- */

.mc-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}
.mc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mc-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.chip-method {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ink);
  color: #ffffff;
  text-decoration: none;
}
.chip-method:hover { opacity: 0.9; text-decoration: none; }
.chip-new {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--teal-soft);
  color: #14594f;
  border: 1px solid #b5d9cf;
}

.mc-style-time-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.style-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 5px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.style-pill-concrete { background: #e3f0ec; color: #14594f; border-color: #b7dad0; }
.style-pill-narrative { background: #fbece6; color: #8c3a19; border-color: #ecc6b8; }
.style-pill-pattern { background: #e8eef8; color: #1f4482; border-color: #c1d1ee; }
.style-pill-procedural { background: #eceef1; color: #2f353d; border-color: #cfd4dc; }
.style-pill-choice { background: #f2ecf7; color: #573378; border-color: #d6c3e6; }
.style-pill-applied { background: #f9f1de; color: #7a570e; border-color: #e4cf9b; }

.cadence-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.cadence-days {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cadence-day {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ece9e2;
  color: #82878f;
}
.cadence-day.is-on {
  background: var(--ink);
  color: #ffffff;
}

.mc-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.skill-hex-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.skill-hex-tile {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  color: var(--body);
  font-size: 12px;
  text-decoration: none;
  max-width: 100%;
}
.skill-hex-tile:hover {
  border-color: var(--teal);
  color: var(--ink);
  text-decoration: none;
}
.skill-hex-more { font-size: 12px; color: var(--muted); }
.skill-hex-more summary { cursor: pointer; font-weight: 600; }

/* ---------- Side-by-Side Compare Mode (/methods/compare) ---------- */

.cmp-selector-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.cmp-selector-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.cmp-selector-card {
  border-top: 4px solid var(--teal);
}
.cmp-accent-concrete { border-top-color: var(--teal); }
.cmp-accent-narrative { border-top-color: var(--terra); }
.cmp-accent-pattern { border-top-color: var(--cobalt); }
.cmp-accent-procedural { border-top-color: var(--slate); }
.cmp-accent-choice { border-top-color: var(--plum); }
.cmp-accent-applied { border-top-color: var(--ochre); }

.cmp-diff-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: #e6e8ec;
}
.cmp-blend-idea {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid #353c45;
  font-size: 14px;
  color: #ffffff;
}

.cmp-butterfly-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(136px, 168px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.cmp-butterfly-side {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.cmp-butterfly-side-right {
  grid-template-columns: minmax(0, 1fr) 38px;
}
.cmp-butterfly-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.cmp-bar-svg {
  width: 100%;
  height: 12px;
  display: block;
}
.cmp-pct {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.cmp-pct-right { text-align: right; }

.cmp-3col-style-row {
  display: grid;
  grid-template-columns: minmax(120px, 150px) repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}
.cmp-3col-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  align-items: center;
}

.cmp-day-trail {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

.cmp-effort-2-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 210px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.cmp-effort-2-row:last-child { border-bottom: none; }
.cmp-effort-3-row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.cmp-effort-3-row:last-child { border-bottom: none; }
.cmp-effort-center { text-align: center; }

.cmp-ages-2-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.cmp-ages-2-row:last-child { border-bottom: none; }
.cmp-ages-left { text-align: right; }
.cmp-ages-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.cmp-ages-3-row {
  display: grid;
  grid-template-columns: 72px repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.cmp-ages-3-row:last-child { border-bottom: none; }

.evidence-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.evidence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.evidence-chip.is-shared {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: #14594f;
  font-weight: 600;
}

@media (max-width: 1020px) {
  .mp-hero { grid-template-columns: 1fr; }
  .mp-ages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-comp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .mp-pill-strip { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .mp-honeycomb-row { grid-template-columns: 1fr; justify-items: start; }
  .mp-ages-grid { grid-template-columns: 1fr; }
  .mp-comp-grid { grid-template-columns: 1fr; }
  .mp-effort-row { grid-template-columns: minmax(0, 1fr) auto; }
  .mp-effort-pole { display: none; }
  .mp-effort-mobile-poles { display: block; }
  .cmp-mobile-label { display: block; }
  .cmp-selector-grid-2, .cmp-selector-grid-3 { grid-template-columns: 1fr; }
  .cmp-butterfly-row { grid-template-columns: minmax(0, 1fr) minmax(96px, 124px) minmax(0, 1fr); gap: 6px; }
  .cmp-butterfly-side { grid-template-columns: 30px minmax(0, 1fr); gap: 4px; }
  .cmp-butterfly-side-right { grid-template-columns: minmax(0, 1fr) 30px; }
  .cmp-butterfly-center { font-size: 12px; }
  .cmp-effort-2-row { grid-template-columns: 1fr; text-align: left; }
  .cmp-effort-center { text-align: left; }
  .cmp-ages-2-row { grid-template-columns: 1fr; }
  .cmp-ages-left { text-align: left; }
  .cmp-3col-style-row, .cmp-effort-3-row, .cmp-ages-3-row { grid-template-columns: 1fr; }
  .cmp-3col-cell { grid-template-columns: 1fr; }
}

/* Workbooks, Multi-Page OCR Scanner & Adaptive Step-Up UI */
.wb-section { margin-top: 20px; }
.wb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.wb-card { display: flex; flex-direction: column; gap: 10px; }
.wb-card-inactive { opacity: 0.85; }
.wb-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-card-title { margin: 2px 0; font-size: 1.1rem; }
.wb-card-meta { margin: 0; font-size: 0.9rem; }
.wb-stats-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.88rem; color: var(--muted, #555b63); }
.wb-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.wb-lifecycle-row { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--border, #e2ded6); }
.wb-score-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.badge-good { background: #e3f3ee; color: #145a4f; }
.badge-accent { background: #e6eefc; color: #1d478a; }
.badge-warn { background: #fdeee7; color: #9c3b15; }
.badge-neutral { background: #eceae4; color: #3d434a; }
.wb-rec-stack { display: flex; flex-direction: column; gap: 12px; }
.wb-rec-card { border-left: 4px solid #1f7a6d; }
.wb-rec-focus { border-left-color: #c2562a; }
.wb-rec-info { border-left-color: #2f5da8; }
.wb-rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.wb-rec-title { margin-top: 6px; font-size: 1.05rem; }
.wb-rec-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.wb-rec-rationale { margin: 8px 0 4px; }
.wb-next-list { margin: 6px 0 0 18px; }
.wb-cover-box { padding: 14px; border-radius: 10px; background: #f6f5f1; margin-bottom: 16px; }
.wb-cover-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.wb-picker-label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; font-weight: 600; }
.wb-filter-bar { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.wb-full-field { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.wb-summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 14px; }
.wb-stat-box { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: #f6f5f1; }
.wb-stat-box strong { font-size: 1.25rem; }
.wb-stat-box span { font-size: 0.82rem; color: var(--muted, #555b63); }
.wb-thumb-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.wb-thumb-card { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border, #dcd7cd); background: #fff; font-size: 0.85rem; }
.wb-redaction-bar { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.wb-manual-details { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border, #e2ded6); }
.wb-log-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.wb-table-wrap { overflow-x: auto; margin-top: 10px; }
.wb-warn-banner { border-left: 4px solid #c2562a; background: #fff8f4; margin-top: 12px; }
.wb-score-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.wb-live-score { text-align: right; padding: 8px 14px; border-radius: 10px; background: #f6f5f1; }
.wb-live-score strong { display: block; font-size: 1.5rem; }
.wb-low-conf-row { background: #fff8ee; }
.wb-input-sm { width: 110px; }
.wb-input-md { width: 150px; }
.wb-input-lg { width: 220px; }
.wb-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; margin-top: 16px; }
.wb-quote { margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid #1f7a6d; background: #f6f5f1; font-style: italic; }
.wb-skill-checks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.wb-stepup-card { border-left: 4px solid #2f5da8; margin-top: 16px; }
.wb-stepup-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.wb-catchup-list { margin: 8px 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
.wb-poll-card { border-left: 4px solid #2f5da8; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

/* Interactive Learning Labs (Beaver Watershed & Youth Homestead Club) — zero inline styles */
.lab-canvas-shell { padding: 12px; background: #f6f5f1; }
.lab-scene-canvas { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--border, #dcd7cd); background: #eef6f4; }
.lab-tier-list { display: flex; flex-direction: column; gap: 8px; }
.lab-tier-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border, #dcd7cd); background: #fff; text-decoration: none; color: inherit; }
.lab-tier-link:hover { border-color: #1f7a6d; background: #f4faf8; }
.lab-tier-recommended { border-color: #1f7a6d; background: #eef7f4; }
.lab-col-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.lab-col-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--border, #dcd7cd); background: #fff; }
.lab-col-title { font-size: 0.85rem; font-weight: 600; }
.lab-col-stack { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }
.lab-mat-chip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; font-size: 0.78rem; font-weight: 700; color: #fff; }
.lab-mat-stone { background: #6b7680; }
.lab-mat-stick { background: #8c5b32; }
.lab-mat-mud { background: #5c4934; }
.lab-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.lab-metric { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: #f6f5f1; border: 1px solid var(--border, #e2ded6); }
.lab-metric span { font-size: 0.82rem; color: var(--muted, #555b63); }
.lab-metric strong { font-size: 1.1rem; }
.lab-gauge-card { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border, #dcd7cd); display: flex; flex-direction: column; gap: 6px; }
.lab-gauge-head { display: flex; justify-content: space-between; font-size: 0.9rem; }
.lab-gauge-svg { width: 100%; height: 14px; display: block; }
.lab-gauge-track { fill: #e6e4dd; }
.lab-tone-teal { fill: #1f7a6d; }
.lab-tone-sage { fill: #589464; }
.lab-tone-amber { fill: #c47a2c; }
.lab-tone-navy { fill: #2f5da8; }
.lab-growth-svg { width: 100%; height: auto; display: block; }
.lab-chart-bg { fill: #f6f5f1; stroke: #dcd7cd; }
.lab-chart-line { stroke: #1f7a6d; stroke-width: 3; }
.lab-chart-dot { fill: #1f7a6d; }
.lab-carton-svg { width: 100%; max-width: 260px; height: auto; display: block; }
.lab-egg-filled { fill: #f3dfba; stroke: #a67c52; stroke-width: 2; }
.lab-egg-empty { fill: #eceae4; stroke: #c8c3b8; stroke-width: 1.5; stroke-dasharray: 3 2; }
.lab-punnett-table { width: 100%; border-collapse: collapse; text-align: center; }
.lab-punnett-table th, .lab-punnett-table td { border: 1px solid var(--border, #dcd7cd); padding: 8px; }
.lab-punnett-table th { background: #eef5f3; font-weight: 700; }
.lab-completion-card { padding: 14px; border-radius: 10px; border: 1px solid var(--border, #dcd7cd); border-left: 4px solid #1f7a6d; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.lab-caption-strip { padding: 10px 14px; border-radius: 8px; background: #fffdf7; border: 1px solid #d9d2c2; font-weight: 600; color: #1b1f24; }
.lab-safety-box { padding: 12px 14px; border-radius: 10px; background: #fdf6e9; border: 1px solid #e6c68a; border-left: 4px solid #c47a2c; display: flex; flex-direction: column; gap: 6px; }
.lab-tile-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; display: block; background: #ece9e0; }




/* Destructive confirm steps (<details> "Are you sure?" pattern) and danger buttons */
.btn-danger { background: #a3361c; border-color: #a3361c; color: #fff; font-weight: 600; }
.btn-danger:hover { background: #87301a; }
.wb-confirm { margin-top: 12px; }
.wb-confirm > summary { list-style: none; display: inline-flex; cursor: pointer; }
.wb-confirm > summary::-webkit-details-marker { display: none; }
.wb-confirm[open] > form { margin-top: 8px; padding: 12px; border: 1px solid #e3c9bf; border-radius: 8px; background: #fff8f4; }
.wb-thumb-img { width: 96px; height: auto; border-radius: 4px; border: 1px solid var(--border, #dcd7cd); }
.wb-added-row input::placeholder { color: #8a8f96; }
.wb-extra-skills { margin: 8px 0; }

/* Books shelf & book reports */
.list-stack-4 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.br-transcript { white-space: pre-wrap; }

/* === #16 Chalkboard Letter Studio === */
.chalk-board-shell { padding: 14px; background: #f3eadb; border-color: #c9a77c; }
.chalk-canvas-frame { padding: 10px; border-radius: 14px; background: linear-gradient(145deg, #9c6538, #7b4a22); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.28); }
.chalk-canvas { width: 100%; height: auto; display: block; border-radius: 10px; background: #1b2e27; touch-action: none; cursor: crosshair; }
.chalk-canvas:focus-visible { outline: 3px solid #ffe082; outline-offset: 2px; }
.chalk-tray { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 10px; background: #8c5930; color: #fff8eb; }
.chalk-tray-left { flex-direction: row-reverse; }
.chalk-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chalk-swatch { min-width: 48px; min-height: 48px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer; font-weight: 700; font-size: 0.78rem; color: #1b2e27; display: inline-flex; align-items: center; justify-content: center; }
.chalk-swatch-active { border-color: #fff; box-shadow: 0 0 0 3px #ffe082; }
.chalk-swatch-cream { background: #fff8e7; }
.chalk-swatch-peach { background: #ffd6a5; }
.chalk-swatch-mint { background: #caffbf; }
.chalk-swatch-sky { background: #a0c4ff; }
.chalk-swatch-lilac { background: #ffc6ff; }
.chalk-find-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 12px; }
.chalk-find-tile { min-height: 68px; min-width: 68px; border-radius: 12px; border: 2px solid #96b8ab; background: #1b2e27; color: #fff8e7; font-size: 2rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chalk-find-tile:hover, .chalk-find-tile:focus-visible { border-color: #ffe082; background: #243e35; outline: 2px solid #ffe082; outline-offset: 2px; }
.chalk-find-tile-hit { border-color: #a7f3d0; background: #1f5446; }
.chalk-demo-banner { padding: 10px 14px; border-radius: 10px; background: #eef7f4; border: 1px solid #98c7ba; color: #163b33; font-weight: 600; }
.chalk-stop-card { padding: 18px; border-radius: 12px; background: #f8f4e8; border: 2px solid #1f7a6d; }
.chalk-celebration-img { width: 100%; max-width: 360px; height: auto; border-radius: 10px; border: 1px solid #d9d0bd; display: block; }
.reporter-desk-banner { width: 100%; max-height: 140px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; display: block; }
.chalk-btn-touch { min-height: 48px; min-width: 48px; }
.chalk-print-sheet { display: flex; flex-direction: column; gap: 12px; }
.chalk-print-row { position: relative; padding: 10px 12px; border: 1px solid #dcd7cd; border-radius: 8px; background: #fff; }
.chalk-print-guides { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.chalk-line-sky { border-top: 1.5px solid #6baed6; }
.chalk-line-fence { border-top: 1.5px dashed #74c476; }
.chalk-line-grass { border-top: 2px solid #8c6d46; }
.chalk-line-worm { border-top: 1px dotted #a9746e; }
.chalk-print-sample { font-size: 1.45rem; font-weight: 700; letter-spacing: 0.18em; color: #3d4852; }
/* === End #16 Chalkboard Letter Studio === */

/* === #17 La Plaza Spanish === */
.plaza-shell { color: #1b1f24; }
.plaza-svg { width: 100%; height: auto; border-radius: 12px; border: 1px solid #d8d0c0; background: #f6f5f1; display: block; }
.plaza-svg-sky { fill: #eaf2fb; }
.plaza-svg-ground { fill: #f1e6d2; }
.plaza-svg-bunting { fill: none; stroke: #c2562a; stroke-width: 3; stroke-dasharray: 8 6; }
.plaza-svg-fountain { fill: #2f5da8; opacity: 0.85; }
.plaza-svg-parrot-body { fill: #1f7a6d; }
.plaza-svg-parrot-beak { fill: #e3b341; }
.plaza-svg-parrot-eye { fill: #1b1f24; }
.plaza-svg-bldg-group { cursor: pointer; }
.plaza-svg-bldg-group:focus-visible rect { stroke: #1b1f24; stroke-width: 4; }
.plaza-svg-bldg-built { fill: #fff8ec; stroke: #c2562a; stroke-width: 2.5; }
.plaza-svg-bldg-open { fill: #f6f5f1; stroke: #2f5da8; stroke-width: 2; }
.plaza-svg-bldg-future { fill: #ece9e0; stroke: #a8a296; stroke-width: 1.5; stroke-dasharray: 4 3; }
.plaza-svg-bldg-active { stroke: #1f7a6d; stroke-width: 3.5; }
.plaza-svg-roof-built { fill: #c2562a; }
.plaza-svg-roof-open { fill: #2f5da8; }
.plaza-svg-label { fill: #1b1f24; font-size: 10px; font-weight: 700; }

.plaza-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.plaza-word-card { padding: 12px; border-radius: 12px; border: 2px solid #dcd5c7; background: #fffdf8; display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.plaza-word-trigger { background: transparent; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #1b1f24; padding: 8px; border-radius: 10px; }
.plaza-word-trigger:focus-visible { outline: 3px solid #2f5da8; outline-offset: 2px; }
.plaza-touch-lg { min-height: 64px; min-width: 64px; }
.plaza-emoji-lg { font-size: 2rem; line-height: 1.1; }
.plaza-emoji { font-size: 1.5rem; }
.plaza-word-es { font-size: 1.1rem; color: #1b1f24; }
.plaza-alt-pill { padding: 6px 8px; border-radius: 8px; background: #eef4fb; border: 1px solid #2f5da8; color: #19386b; font-size: 0.85rem; font-weight: 600; }
.plaza-prompt-banner { padding: 12px 14px; border-radius: 10px; background: #fdf5e7; border: 1px solid #e3b341; border-left: 5px solid #c2562a; font-weight: 600; color: #1b1f24; }
.plaza-error-banner { background: #fdf0ec; border: 1px solid #c2562a; color: #7a240e; }
.plaza-warm-glow { border-color: #c2562a; box-shadow: 0 0 0 4px rgba(227, 179, 65, 0.45); background: #fff9ea; }
.plaza-card-matched { border-color: #1f7a6d; background: #eef7f5; }
.plaza-pot-active { outline: 3px solid #1b1f24; outline-offset: 2px; }
.plaza-paint-rojo { background: #fbe9e5; border-color: #c2562a; color: #7a240e; }
.plaza-paint-azul { background: #e8f0fc; border-color: #2f5da8; color: #173668; }
.plaza-paint-verde { background: #e6f5f2; border-color: #1f7a6d; color: #104940; }
.plaza-paint-amarillo { background: #fdf6dc; border-color: #b58918; color: #543e05; }
.plaza-karaoke-line { padding: 8px 12px; border-radius: 8px; border: 1px solid #e2dccf; background: #fff; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.plaza-karaoke-active { border-color: #c2562a; background: #fff7eb; }

/* Gender shape + colour chips (▲ teal masculine, ● orange feminine — accessible, never colour-alone) */
.plaza-chip { padding: 10px 14px; min-height: 44px; border-radius: 999px; border: 2px solid #8a8377; background: #fff; color: #1b1f24; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.plaza-chip-masc { border-color: #1f7a6d; background: #e5f5f2; color: #0e473f; }
.plaza-chip-fem { border-color: #c2562a; background: #fceee8; color: #7e2b0d; }
.plaza-chip-tray { min-height: 56px; padding: 10px; border-radius: 10px; border: 2px dashed #b9b1a1; background: #f6f5f1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.plaza-coin-btn { min-width: 56px; min-height: 44px; border-radius: 999px; font-weight: 700; border: 2px solid #c2562a; background: #fff9eb; color: #5e2c0b; }
.plaza-dialogue-choice { text-align: left; white-space: normal; min-height: 44px; justify-content: flex-start; }

/* Parent hub helpers */
.plaza-fieldset { border: 1px solid #dcd5c7; border-radius: 10px; padding: 10px 12px; }
.plaza-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.plaza-speaking-box { border-left: 4px solid #1f7a6d; background: #f4faf8; }
.plaza-word-print-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.plaza-word-print-card { padding: 10px; border: 1px solid #d8d0c0; border-radius: 8px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.plaza-hidden { display: none; }
.plaza-ml-8 { margin-left: 8px; }

@keyframes plaza-wiggle-kf {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}
.plaza-wiggle { animation: plaza-wiggle-kf 0.35s ease-in-out; }

@media (prefers-reduced-motion: reduce) {
  .plaza-wiggle { animation: none; }
}
.plaza-lola-row { display: flex; align-items: center; gap: 12px; }
.plaza-lola-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid #1f7a6d; flex-shrink: 0; background: #f6f5f1; }
.plaza-lola-speech { padding: 8px 12px; border-radius: 10px; background: #f6f5f1; border: 1px solid #d8d0c0; flex: 1; }
.plaza-backdrop-wrap { position: relative; border-radius: 12px; overflow: hidden; background-image: url('/static/art/la-plaza/plaza-backdrop.webp'); background-size: cover; background-position: center; }
.plaza-backdrop-wrap .plaza-svg { background: rgba(246, 245, 241, 0.72); }
.plaza-theme-scene-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; border: 1px solid #d8d0c0; display: block; }
/* === End #17 La Plaza Spanish === */

/* === Log sheet (shared by Family Home and Play & Observe) === */
.sheet {
  position: fixed;
  inset: auto 0 0 0;
  margin: 0 auto;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 10px 20px 24px;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 -12px 40px rgba(27, 31, 36, 0.22);
  z-index: 900;
}
.sheet::backdrop { background: rgba(27, 31, 36, 0.45); }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(27, 31, 36, 0.45); z-index: 899; }
.sheet[open] + .sheet-backdrop { display: block; }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sheet-title { margin: 2px 0 0; font-size: 24px; line-height: 1.2; }
.sheet-close { min-width: 44px; padding: 0; font-size: 20px; }
.sheet-body { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.sheet-legend { padding: 0; margin: 0 0 8px; font-weight: 600; font-size: 16px; }
.sheet [hidden] { display: none !important; }
.sheet fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sheet-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fbeae3; color: var(--warn); font-weight: 600; }
@media (min-width: 720px) {
  .sheet { inset: 6vh 0 auto 0; border-radius: 22px; padding: 18px 28px 28px; }
  .sheet-grab { display: none; }
}

.choice-list { display: flex; flex-direction: column; gap: 10px; }
.choice-card {
  display: block;
  position: relative;
  padding: 12px 16px;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}
.choice-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-card-label { display: block; font-weight: 600; font-size: 16px; }
.choice-card-desc { display: block; color: var(--body); font-size: 14px; }
.choice-card:hover { border-color: var(--border); }
.choice-card:has(input:checked) { border-color: var(--ink); background: #f1efe9; }
.choice-card:has(input:focus-visible) { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.choice-row .choice-card { text-align: center; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}
.chip-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-toggle-check { display: none; }
.chip-toggle:has(input:checked) { background: var(--ink); color: #fff; }
.chip-toggle:has(input:checked) .chip-toggle-check { display: inline; }
.chip-toggle:has(input:focus-visible) { outline: 3px solid var(--cobalt); outline-offset: 2px; }

.level-row { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.level-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.level-row-name { margin: 0; font-size: 16px; font-weight: 600; }
.level-row-joined { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--teal-soft); color: #145a4f; }
.level-row[hidden] { display: none; }

.sheet-save { width: 100%; min-height: 52px; font-size: 16px; }
.sheet-save:disabled { background: #e8e5de; border-color: #8a8f96; color: #3d4148; cursor: not-allowed; }
.sheet-photo-drop { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1.5px dashed var(--border); border-radius: 14px; background: #faf9f6; }
/* === End log sheet === */

/* === Family Home === */
.home-status { font-size: 17px; font-weight: 600; color: var(--body); }
.needs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.needs-item > .btn { flex: none; white-space: nowrap; }
.needs-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; }
.today-blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.today-block { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.today-block.is-done { background: #f6f5f1; }
.today-block-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.today-block-title { font-weight: 600; }
.home-mosaic { display: flex; align-items: center; gap: 14px; color: var(--ink); padding: 8px 0 0; }
.home-mosaic:hover { text-decoration: none; }
.home-mosaic-art { display: block; width: 168px; flex: none; }
.home-week-bar { max-width: 380px; }
.menu-more { position: relative; }
.menu-more > summary { list-style: none; }
.menu-more > summary::-webkit-details-marker { display: none; }
.menu-more-list { position: absolute; z-index: 20; left: 0; top: calc(100% + 6px); min-width: 200px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(27, 31, 36, 0.12); }
.menu-more-list a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.menu-more-list a:hover { background: #f1efe9; text-decoration: none; }
@media (max-width: 520px) {
  .home-mosaic { flex-direction: column; align-items: flex-start; }
}
/* === End Family Home === */

/* === Editorial Illustrations (Sign-In, Early Years, Methods, Empty States) === */
.signin-art-img { width: 100%; height: auto; max-height: 185px; object-fit: cover; display: block; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--bg); }
@media (max-width: 640px) {
  .signin-art-img { max-height: 120px; }
}

.ey-theme-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.ey-theme-tile { display: flex; flex-direction: column; background: var(--surface); border: 1.5px solid var(--border-soft); border-radius: 12px; overflow: hidden; color: var(--ink); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
.ey-theme-tile:hover { border-color: var(--teal); text-decoration: none; transform: translateY(-1px); }
.ey-theme-tile.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.ey-theme-tile.active:focus-visible { outline-offset: 4px; }
.ey-theme-img { width: 100%; aspect-ratio: 3 / 2; height: auto; object-fit: cover; display: block; background: var(--bg); }
.ey-theme-label { padding: 7px 8px; font-size: 0.82rem; font-weight: 600; line-height: 1.25; }
.ey-theme-tile.active .ey-theme-label { background: var(--ink); color: #fff; }
@media (max-width: 900px) { .ey-theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .ey-theme-grid { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
  .ey-theme-tile { flex: 0 0 132px; scroll-snap-align: start; }
}

.connect-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.connect-hero > div { flex: 1; min-width: 0; }
.connect-vignette-img { width: 210px; flex: none; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--bg); display: block; }
@media (max-width: 680px) {
  .connect-hero { flex-direction: column; }
  .connect-vignette-img { width: 100%; max-width: 280px; }
}

.method-spot-wrap { border-radius: 10px; overflow: hidden; border: 1px solid var(--border-soft); background: var(--bg); }
.method-spot-img { width: 100%; height: auto; aspect-ratio: 3 / 2; max-height: 150px; object-fit: cover; display: block; }
.mp-spot-img { width: 100%; max-width: 240px; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--bg); display: block; margin-bottom: 6px; }

.empty-state-card { display: flex; align-items: center; gap: 18px; }
.empty-state-img { width: 180px; flex: none; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--bg); display: block; }
@media (max-width: 600px) {
  .empty-state-card { flex-direction: column; align-items: flex-start; }
  .empty-state-img { width: 100%; max-width: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .ey-theme-tile { transition: none; }
  .ey-theme-tile:hover { transform: none; }
}
/* === End Editorial Illustrations === */

/* ---------------------------------------------------------------------------------------------------------
   Early Years: page tabs, Overview (Today row, What you've noticed, Recent moments, visit notes) and Daily rhythm
   (timeline, settings, picture strip, chooser). Colours of rhythm kinds live in views-early-years-day.ts. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fieldset-plain { padding: 0; border: 0; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }


/* Overview */
.today-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.today-card { border-top: 4px solid var(--border); }
.today-card-idea { border-top-color: var(--terra); }
.today-card-rhyme { border-top-color: var(--plum); }
.today-card-title { font-size: 18px; font-weight: 700; }
.now-items { list-style: none; margin: 0; padding: 0; }
.now-item { display: flex; align-items: center; gap: 12px; }
.now-item[hidden] { display: none; }
.stack-2 { display: flex; flex-direction: column; gap: 2px; }
.day-bar { display: block; width: 100%; height: 20px; }
.day-bar-mini { height: 14px; }
.day-bar rect.is-now { stroke: var(--ink); stroke-width: 3; vector-effect: non-scaling-stroke; }

.start-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.start-step { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.start-step-num { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; }
.start-step.is-done .start-step-num { background: var(--teal); }
.start-step.is-done { background: var(--teal-soft); }

.noticed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; }
.noticed-area { --area: var(--slate); display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border-soft); border-top: 4px solid var(--area); border-radius: 12px; background: var(--surface); }
.noticed-area.area-talking_listening { --area: var(--terra); }
.noticed-area.area-early_maths { --area: var(--cobalt); }
.noticed-area.area-movement_practical { --area: var(--teal); }
.noticed-area.area-feelings_social { --area: var(--plum); }
.noticed-area.area-making_exploring { --area: var(--ochre); }
.noticed-area-title { display: flex; align-items: flex-start; gap: 6px; font-size: 15px; font-weight: 700; }
.area-icon { flex: none; color: var(--area); margin-top: 2px; }
.noticed-link { margin-top: auto; font-size: 14px; font-weight: 600; }
.noticed-levels, .noticed-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.noticed-key { gap: 6px 14px; font-size: 13px; align-items: center; }
.noticed-key li { display: inline-flex; align-items: center; gap: 6px; }
.noticed-sq { --area: var(--slate); display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--area); background: transparent; }
.noticed-area .noticed-sq { border-color: var(--area); }
.noticed-sq.stage-developing { background: color-mix(in srgb, var(--area) 30%, #fff); }
.noticed-sq.stage-secure { background: var(--area); }

.moments { list-style: none; margin: 0; padding: 0; }
.moment { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.moment-day { font-size: 14px; font-weight: 600; }
.moment-level { color: var(--teal); }
.visit-card { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); }
.visit-card > .stack-4 { flex: 1 1 320px; }
.visit-lines { display: grid; gap: 22px; padding-top: 8px; }
.visit-lines span { display: block; border-bottom: 1px solid var(--border); }

/* Daily rhythm */
.rhythm-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .rhythm-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }
.rhythm-timeline { list-style: none; margin: 0; padding: 0; }
.rhythm-row { display: grid; grid-template-columns: 52px 32px minmax(0, 1fr); gap: 12px; padding: 14px 8px; border-top: 1px solid var(--border-soft); border-radius: 10px; scroll-margin-top: 80px; }
.rhythm-row.is-now { background: var(--teal-soft); }
.rhythm-time { font-size: 13px; line-height: 1.3; text-align: right; display: flex; flex-direction: column; }
.rhythm-title { font-size: 16px; font-weight: 700; }
.rhythm-body { min-width: 0; }
.chip-soft { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border-soft); color: var(--body); }
.badge-now { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--teal); color: #fff; }
.badge-now[hidden] { display: none; }
.rhythm-idea { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-left: 3px solid var(--ochre); border-radius: 8px; background: var(--bg); font-size: 14px; }
.btn-done { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); font-weight: 600; }
.rhythm-icon { flex: none; display: block; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented-option { position: relative; }
.segmented-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented-option span { display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--border); border-radius: 10px; font-weight: 600; background: var(--surface); }
.segmented-option input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.segmented-option input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 2px; }
[data-autosubmit-btn][hidden] { display: none; }
.picture-strip-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

.rhythm-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.rhythm-legend li { display: inline-flex; align-items: center; gap: 6px; }
.rhythm-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rhythm-choice { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface); }
.rhythm-choice.in-use { border: 2px solid var(--ink); }
.rhythm-choice-title { font-size: 16px; font-weight: 700; }
.badge-suggested { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); }
.badge-in-use { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: #fff; }
.btn-in-use:disabled { background: var(--bg); color: var(--body); border-color: var(--border); opacity: 1; cursor: default; }
.rhythm-choice-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.see-day > summary { list-style: none; cursor: pointer; }
.see-day > summary::-webkit-details-marker { display: none; }
.see-day[open] { flex-basis: 100%; }
.see-day-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.see-day-list li { display: grid; grid-template-columns: 84px 20px 1fr; gap: 8px; align-items: center; }
.see-day-time { color: var(--muted); }

.picture-strip-print ol { list-style: none; margin: 0; padding: 16px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; border: 2px dashed var(--border); border-radius: 16px; background: var(--surface); }
.picture-strip-print li { display: flex; flex-direction: column; align-items: center; gap: 6px; }
@media print {
  .picture-strip-print ol { border-color: #999; gap: 10px; padding: 10px; }
  .picture-strip-print svg rect, .rhythm-icon rect { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .visit-notes { border: none; padding: 0; }
}

/* First visit to Settings: family-wide settings fold away behind one disclosure. */
.first-run-more { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 16px 22px; }
.first-run-more > summary { cursor: pointer; }
.first-run-more-body { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }

/* Activities (per child), the welcome page after adding a child, and Home "Try this week". */
.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.activity-card { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface); overflow: hidden; min-width: 0; }
.activity-card.is-pack { border-top: 4px solid var(--teal); }
.activity-img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--bg); }
.activity-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.activity-title { font-size: 17px; font-weight: 700; }
.activity-actions { margin-top: auto; padding-top: 4px; }
.activity-all-link { align-self: flex-start; }
.activity-more { display: block; }
.activity-more[open] > summary { margin-bottom: 16px; }
.activity-more > summary { list-style: none; cursor: pointer; align-self: flex-start; }
.activity-more > summary::-webkit-details-marker { display: none; }
.activity-more .when-open { display: none; }
.activity-more[open] .when-open { display: inline; }
.activity-more[open] .when-closed { display: none; }

/* Learning Lab #18: La Ruta Secreta — Spanish Mystery & World Expedition */
.ruta-map-frame { background: #eef6fb; border-color: #c7dce8; }
.ruta-map-frame canvas.is-travel-ready { cursor: pointer; }
.ruta-board-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.95fr); gap: 16px; align-items: start; }
@media (max-width: 860px) {
  .ruta-board-grid { grid-template-columns: 1fr; }
}
.ruta-hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px dashed var(--teal);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ruta-hint-chip.is-revealed {
  border-style: solid;
  background: #e6f4f1;
  color: #124943;
}
.ruta-departure-board {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #1b2838;
  color: #f8e7b4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  display: grid;
  gap: 6px;
}
.ruta-choice-btn { text-align: left; justify-content: flex-start; white-space: normal; height: auto; padding-top: 10px; padding-bottom: 10px; }
.ruta-dest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.ruta-trait-list { list-style: none; padding: 0; }
.ruta-trait-item { padding: 8px 10px; font-size: 14px; }
.ruta-suspect-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: opacity 0.15s ease;
}
.ruta-suspect-row.is-eliminated { opacity: 0.45; text-decoration: line-through; }
@media print {
  .ruta-board-grid { grid-template-columns: 1fr; }
  .ruta-departure-board { background: #ffffff; color: #1b1f24; border: 1px solid #999; }
}

/* ---------------------------------------------------------------------------
   Play Path (parent's phone, ages 2–5): mood → path → one game at a time → wrap-up
   --------------------------------------------------------------------------- */
.pp-shell { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 88px; }
.pp-moods { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pp-mood { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 14px; border: 1.5px solid var(--border-soft); border-radius: 14px; background: var(--surface); cursor: pointer; min-height: 72px; }
.pp-mood input, .pp-pill input, .pp-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pp-mood-label { font-weight: 700; font-size: 17px; }
.pp-mood-hint { color: var(--muted); font-size: 13px; }
.pp-mood:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pp-mood:has(input:focus-visible), .pp-pill:has(input:focus-visible), .pp-choice:has(input:focus-visible) { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.pp-length { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pp-inline-legend { float: left; font-weight: 700; margin-right: 6px; padding: 0; }
.pp-pill { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface); font-weight: 600; cursor: pointer; }
.pp-pill:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.pp-section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-family: Inter, system-ui, sans-serif; }
.pp-path { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pp-path-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.pp-path-row + .pp-path-row::before { content: ''; position: absolute; left: 17px; top: -10px; height: 18px; border-left: 2px solid var(--border); }
.pp-path-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pp-swap { font-size: 13px; font-weight: 600; padding: 10px 4px; min-height: 44px; display: inline-flex; align-items: center; }
.pp-theme-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; color: #fff; }
.pp-theme-balance_movement, .pp-dot.pp-theme-balance_movement { background: var(--teal); }
.pp-theme-sounds_listening, .pp-dot.pp-theme-sounds_listening { background: var(--terra); }
.pp-theme-shapes, .pp-dot.pp-theme-shapes { background: #8a5a00; }
.pp-theme-colours, .pp-dot.pp-theme-colours { background: var(--plum); }
.pp-theme-memory, .pp-dot.pp-theme-memory { background: var(--cobalt); }
.pp-theme-fine_motor, .pp-dot.pp-theme-fine_motor { background: var(--slate); }
.pp-sticky { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); margin: 0; }
.pp-cta { width: 100%; min-height: 54px; font-size: 17px; border-radius: 14px; justify-content: center; }
.pp-fav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pp-fav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.pp-game { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 20px; overflow: hidden; }
.pp-game-head { padding: 16px 18px 18px; color: #fff; display: flex; flex-direction: column; gap: 6px; background: var(--teal); }
.pp-head-sounds_listening { background: var(--terra); }
.pp-head-shapes { background: #8a5a00; }
.pp-head-colours { background: var(--plum); }
.pp-head-memory { background: var(--cobalt); }
.pp-head-fine_motor { background: var(--slate); }
.pp-game-eyebrow { font-size: 13px; font-weight: 600; opacity: 0.92; }
.pp-game-title { font-size: 26px; line-height: 1.15; color: #fff; }
.pp-game-meta { font-size: 14px; opacity: 0.92; }
.pp-dots { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.pp-dots li { width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.45); }
.pp-dots li.is-done { background: rgba(255, 255, 255, 0.8); }
.pp-dots li.is-current { width: 26px; background: #fff; }
.pp-pause { color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.7); border-radius: 10px; padding: 6px 12px; font-weight: 600; font-size: 14px; min-height: 36px; display: inline-flex; align-items: center; }
.pp-pause:hover { color: #fff; background: rgba(255, 255, 255, 0.14); text-decoration: none; }
.pp-game-body { padding: 18px; }
.pp-steps { margin: 0; padding-left: 22px; font-size: 17px; display: flex; flex-direction: column; gap: 6px; }
.pp-today, .pp-look, .pp-safety, .pp-next { border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.pp-today { background: var(--teal-soft); }
.pp-look { background: #eef2f8; }
.pp-safety { background: #fdf5e4; border: 1px solid #efdcae; }
.pp-next { background: var(--bg); color: var(--body); }
.pp-legend { font-weight: 700; padding: 0; }
.pp-legend-small { font-size: 13px; color: var(--muted); padding: 0; }
.pp-stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-fit-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pp-choice { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 6px 8px; border: 1.5px solid var(--border-soft); border-radius: 12px; font-weight: 600; text-align: center; cursor: pointer; background: var(--surface); }
.pp-choice-small { min-height: 44px; font-size: 14px; font-weight: 500; }
.pp-choice:has(input:checked) { border-color: var(--ink); background: #f1efe9; }
.pp-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: stretch; }
.pp-actions .btn { min-height: 54px; justify-content: center; }

.pp-done-head { text-align: center; align-items: center; display: flex; flex-direction: column; }
.pp-done-icons { display: flex; gap: 8px; }
.pp-done-icons .pp-theme-icon { width: 44px; height: 44px; border-radius: 12px; }
.pp-done-list { list-style: none; margin: 0; padding: 4px 16px; }
.pp-done-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.pp-done-row + .pp-done-row { border-top: 1px solid var(--border-soft); }
.pp-done-row strong { flex: 1; }
.pp-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--slate); }
.pp-note summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); }
.pp-note[open] summary { margin-bottom: 10px; }
.pp-note textarea { width: 100%; font: inherit; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.pp-fav-toggle { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px 14px; background: var(--surface); font-size: 14px; }
.pp-fav-toggle input { margin-top: 3px; width: 20px; height: 20px; flex: none; }
.pp-link-quiet { text-align: center; font-size: 14px; }

/* Overview: Play now + Next to try */
.pp-play-now { display: flex; flex-direction: column; gap: 10px; }
.pp-next-try { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pp-next-try li { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pp-theme-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pp-theme-form select { min-height: 40px; border-radius: 10px; border: 1px solid var(--border); padding: 0 10px; font: inherit; background: var(--surface); }
@media (max-width: 380px) {
  .pp-moods, .pp-stage-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------------------
   Kid frame (every ages 5–7 Kid Mode screen): Grown-ups top-left, speaker top-right,
   guide bubble, play area, "Show a grown-up" ending. Picture-first, no scores or timers.
   --------------------------------------------------------------------------- */
.kf-page { max-width: 980px; padding-top: 16px; padding-bottom: 24px; }
.kf { background: #faf5ea; border: 1px solid #ece3cf; border-radius: 28px; padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.kf-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kf-bar-right { display: flex; align-items: center; gap: 10px; }
.kf-grownups { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--body); font-size: 14px; font-weight: 600; }
.kf-grownups:hover { text-decoration: none; border-color: var(--ink); }
.kf-round { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 0; cursor: pointer; }
.kf-speaker { width: 64px; height: 64px; background: var(--teal); color: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12); }
.kf-speaker:hover { background: #18665b; }
.kf-home { width: 52px; height: 52px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--border); }
.kf-home:hover { text-decoration: none; border-color: var(--ink); }
.kf-round:focus-visible, .kf-grownups:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.kf-guide { display: flex; align-items: center; gap: 12px; }
.kf-guide-avatar { width: 64px; height: auto; flex: none; }
.kf-bubble { position: relative; flex: 1; margin: 0; background: var(--surface); border-radius: 16px; padding: 14px 18px; font-size: 21px; font-weight: 700; line-height: 1.3; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05); }
.kf-bubble::before { content: ''; position: absolute; left: -9px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-right-color: var(--surface); border-left: 0; }
.kf-play { display: flex; flex-direction: column; gap: 16px; }
.kf-end { display: flex; align-items: center; gap: 16px; justify-content: center; background: var(--surface); border-radius: 20px; padding: 16px; }
.kf-end[hidden] { display: none; }
.kf-end-text { font-size: 22px; font-weight: 700; margin: 0; }
.kf .lab-caption-strip.kf-mirrored { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kf .lab-canvas-shell { position: relative; }
.kf-grownup-panel { border-top: 1px dashed var(--border); padding-top: 10px; }
.kf-grownup-panel > summary { cursor: pointer; color: var(--muted); font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 600px) {
  .kf { border-radius: 20px; padding: 12px; }
  .kf-bubble { font-size: 18px; }
  .kf-speaker { width: 56px; height: 56px; }
}
@media print {
  .kf { background: none; border: 0; padding: 0; }
  .kf-bar, .kf-guide, .kf-end { display: none; }
}

/* Picture Games (#19): Memory pairs and Colours */
.pg-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 560px; width: 100%; margin: 0 auto; }
.pg-grid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 640px; }
.pg-card { position: relative; aspect-ratio: 1 / 1; border: 0; padding: 0; background: none; cursor: pointer; perspective: 600px; border-radius: 16px; }
.pg-card-inner { position: absolute; inset: 0; transition: transform 0.35s ease; transform-style: preserve-3d; }
.pg-card.is-up .pg-card-inner { transform: rotateY(180deg); }
.pg-face { position: absolute; inset: 0; border-radius: 16px; display: flex; align-items: center; justify-content: center; backface-visibility: hidden; }
.pg-back { background: #2f5da8; border: 3px solid #1f437e; color: #dfe6f3; }
.pg-front { background: var(--surface); border: 3px solid #d9d2c1; transform: rotateY(180deg); flex-direction: column; gap: 4px; }
.pg-front img { width: 64%; height: auto; }
.pg-front-label { font-size: 14px; font-weight: 700; }
.pg-card.is-matched { visibility: hidden; }
.pg-card:focus-visible { outline: 4px solid var(--cobalt); outline-offset: 3px; }
.pg-basket { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 8px 14px; border: 2px dashed #d7b878; border-radius: 16px; background: #f2e5c6; flex-wrap: wrap; }
.pg-basket-pair { display: inline-flex; gap: 2px; }
.pg-basket-pair img { width: 36px; height: 36px; background: var(--surface); border-radius: 8px; padding: 3px; }
.pg-pots { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.pg-pot { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 128px; min-height: 128px; padding: 12px 8px; border: 2.5px solid #d9d4c7; border-radius: 18px; background: var(--surface); box-shadow: 0 4px 0 #e3ded2; font-size: 17px; font-weight: 700; cursor: pointer; }
.pg-pot.is-picked { border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.pg-pot:focus-visible, .pg-swatch:focus-visible, .pg-frog:focus-visible { outline: 4px solid var(--cobalt); outline-offset: 3px; }
.pg-pot-swatch { width: 56px; height: 48px; border: 3px solid #1b1f24; border-top-width: 6px; border-radius: 4px 4px 12px 12px; }
.pg-mix-row { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; }
.pg-bowl-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; }
.pg-bowl { width: 140px; height: 70px; border: 4px solid #1b1f24; border-top: 0; border-radius: 0 0 70px 70px; background: #efece4; overflow: hidden; display: flex; align-items: flex-end; }
.pg-bowl-fill { width: 100%; height: 72%; transition: background-color 0.3s ease; }
.pg-frog { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 20px; }
.pg-frog svg { width: 140px; height: auto; display: block; }
.pg-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pg-actions .btn { min-height: 56px; font-size: 18px; padding: 0 22px; border-radius: 16px; }
.pg-swatches { display: flex; justify-content: center; gap: 14px; }
.pg-swatch { width: 72px; height: 72px; border-radius: 999px; border: 4px solid var(--surface); box-shadow: 0 0 0 2px #cfc9bb; cursor: pointer; }
.pg-swatch.is-picked { box-shadow: 0 0 0 4px var(--ink); }
.pg-target { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; }
.pg-target-dot { width: 32px; height: 32px; border-radius: 999px; border: 3px solid #1b1f24; }
@media (max-width: 600px) {
  .pg-grid, .pg-grid[data-cols="4"] { gap: 10px; }
  .pg-pot { width: 100px; min-height: 108px; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-card-inner { transition: opacity 0.2s ease; transform: none !important; }
  .pg-card .pg-front { transform: none; opacity: 0; }
  .pg-card.is-up .pg-front { opacity: 1; }
  .pg-card.is-up .pg-back { opacity: 0; }
  .pg-bowl-fill { transition: none; }
}
.kf .plaza-framed .plaza-lola-row { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kf-shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.kf-shelf-tile { display: flex; flex-direction: column; background: var(--surface); border: 2px solid #e5dcc7; border-radius: 18px; overflow: hidden; color: var(--ink); font-weight: 700; font-size: 16px; min-height: 44px; }
.kf-shelf-tile:hover { text-decoration: none; border-color: var(--ink); }
.kf-shelf-tile:focus-visible { outline: 4px solid var(--cobalt); outline-offset: 3px; }
.kf-shelf-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--bg); }
.kf-shelf-tile span { padding: 10px 12px; line-height: 1.25; }
.pg-emoji { font-size: clamp(34px, 7vw, 56px); line-height: 1; }
.pg-basket-pair { font-size: 26px; background: var(--surface); border-radius: 10px; padding: 2px 6px; }
/* The kid frame's own show/hide: an element with [hidden] stays hidden whatever its display rule. */
.kf [hidden] { display: none !important; }
.pp-shell fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pg-grid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 380px; }
.pg-grid[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 760px; }
.pg-mix-row { margin-top: 32px; }

/* === Kid Mode Phase 2: Device Pairing, Settings -> Devices, Rolling Shelf & Tablet Screens === */
.kd-hidden {
  display: none;
}
.kd-narrow {
  max-width: 540px;
  margin-inline: auto;
}
.kd-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.kd-choice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border, #e2dfd8);
  border-radius: 12px;
  background: var(--surface, #fff);
  cursor: pointer;
}
.kd-choice-card:has(input:checked) {
  border-color: var(--ink, #1c242b);
  background: #faf9f5;
}
.kd-choice-disabled {
  opacity: 0.58;
  cursor: not-allowed;
  background: #f6f4ef;
}
.kd-choice-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kd-host-highlight {
  color: #1f5f8b;
}
.kd-word-stack {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kd-word-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #f5f2eb;
  border: 1px solid #e6e1d7;
}
.kd-word-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.kd-word-badge-1 { background: #c55d2c; }
.kd-word-badge-2 { background: #1e7366; }
.kd-word-badge-3 { background: #9c4a2d; }
.kd-word-text {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.kd-waiting-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e7366;
}
.kd-info-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef4fa;
  border: 1px solid #d5e3f2;
  font-size: 0.92rem;
}
.kd-note-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f5ef;
  border: 1px solid #e5e0d5;
  font-size: 0.92rem;
}
.kd-done-card {
  text-align: center;
}
.kd-done-check {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  background: #e1f3ec;
  color: #186b57;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kd-summary-dl {
  margin: 0;
  text-align: left;
  border: 1px solid var(--border, #e2dfd8);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kd-summary-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.kd-summary-dl dt {
  color: var(--muted, #5c6670);
}
.kd-summary-dl dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}
.kd-pending-banner {
  padding: 12px 16px;
  border-radius: 12px;
  background: #eef4fa;
  border: 1px solid #cfe0f3;
}
.kd-device-signed-out {
  opacity: 0.72;
}
.kd-kid-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #e8f3ef;
  color: #165949;
}
.kd-tone-teal { background: #e3f4ef; color: #145a4c; }
.kd-tone-cobalt { background: #e6effb; color: #1b4d8a; }
.kd-tone-plum { background: #f2e8f6; color: #67317b; }
.kd-tone-amber { background: #fbf1de; color: #855210; }
.kd-tone-forest { background: #e6f2e7; color: #245c2c; }
.kd-tone-coral { background: #fbeae4; color: #8c391c; }
.kd-cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.kd-cap-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.kd-cap-seg {
  height: 6px;
  border-radius: 4px;
  background: #e5e1d8;
}
.kd-cap-fill-teal { background: #1e7366; }
.kd-cap-fill-cobalt { background: #2663a8; }
.kd-cap-fill-plum { background: #7b3f94; }
.kd-cap-fill-amber { background: #c27816; }
.kd-cap-fill-forest { background: #2e7d3a; }
.kd-cap-fill-coral { background: #c55d2c; }
.kd-muted-card {
  border-style: dashed;
  background: #faf9f5;
}
.kd-event-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kd-event-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 0.93rem;
}
.kd-event-time {
  min-width: 96px;
  flex-shrink: 0;
}
.kd-action-popover {
  position: relative;
}
.kd-action-popover > summary {
  list-style: none;
  cursor: pointer;
}
.kd-action-popover > summary::-webkit-details-marker {
  display: none;
}
.kd-inline-form {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2dfd8);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.kd-segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #f1eee7;
  border: 1px solid #e2dfd8;
}
.kd-shelf-row {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e6e2d9;
  background: #fdfcf9;
}
.kd-shelf-paused {
  opacity: 0.68;
}
.kd-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.kd-add-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #e4e0d7;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kd-add-card-disabled {
  opacity: 0.62;
  background: #f7f5f0;
}
.btn-danger-outline {
  border-color: #c75b45;
  color: #9e3722;
}
.kd-tablet-shell {
  max-width: 620px;
  margin: 24px auto;
}
.kd-tablet-card {
  padding: 24px;
  border-radius: 18px;
}
.kd-three-boxes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.kd-three-boxes input {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  padding: 12px 8px;
}
.kd-big-btn {
  width: 100%;
  padding: 12px 18px;
  font-size: 1.05rem;
}
.kd-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.kd-avatar-tile {
  width: 100%;
  padding: 20px 14px;
  border-radius: 16px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
}
.kd-avatar-tile:hover,
.kd-avatar-tile:focus-visible {
  border-color: currentColor;
}
.kd-avatar-symbol {
  font-size: 2.6rem;
  line-height: 1;
}
.kd-avatar-name {
  font-size: 1.2rem;
  font-weight: 700;
}
.kd-present-card {
  text-align: center;
  align-items: center;
}
.kd-present-box {
  font-size: 3.4rem;
  line-height: 1;
  transition: transform 0.3s ease;
}
.kd-present-unwrapping .kd-present-box {
  transform: scale(1.22) rotate(-6deg);
}
.kd-new-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #c55d2c;
  color: #fff;
}
.kd-focus-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #1c242b;
  color: #fff;
}
.kd-card-focus,
.kd-tile-focus {
  border: 2px solid #1e7366;
}
@media (max-width: 560px) {
  .kd-three-boxes {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .kd-present-box,
  .kd-present-unwrapping .kd-present-box {
    transition: none;
    transform: none;
  }
}

/* Log filter chips (migration 062): what produced an entry. */
.log-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.log-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.log-chip:hover { border-color: var(--ink); text-decoration: none; }
.log-chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }
.log-source { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border-soft); color: var(--muted); white-space: nowrap; }


/* ============================================================================
   Projects & Activities + Navigation Overhaul Design System (WCAG 2.2 AA / CSP)
   ============================================================================ */

/* --- 1. Per-child WCAG 2.2 AA accent palette (zero inline styles) --- */
.child-accent-teal {
  --child-accent: #186b5e;
  --child-accent-bg: #e3f2ee;
  --child-accent-ink: #114c43;
  --child-accent-border: #9bd0c4;
}
.child-accent-blue {
  --child-accent: #24549c;
  --child-accent-bg: #e7effb;
  --child-accent-ink: #193b70;
  --child-accent-border: #a7c3eb;
}
.child-accent-terracotta {
  --child-accent: #a6431d;
  --child-accent-bg: #fbece6;
  --child-accent-ink: #762d12;
  --child-accent-border: #e4b19d;
}
.child-accent-plum {
  --child-accent: #6c3e94;
  --child-accent-bg: #f2eaf8;
  --child-accent-ink: #4d296b;
  --child-accent-border: #c9aee0;
}
.child-accent-ochre {
  --child-accent: #8c610b;
  --child-accent-bg: #faf1dc;
  --child-accent-ink: #634306;
  --child-accent-border: #dfc384;
}
.child-accent-forest {
  --child-accent: #276933;
  --child-accent-bg: #e6f3e8;
  --child-accent-ink: #1a4b23;
  --child-accent-border: #a3d0aa;
}

/* --- 2. Simplified Topbar v2, Child Pills, Child Picker & Unified 3-Tier Nav --- */
.topbar-v2 {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-v2-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar-v2-inner > .brand-link {
  flex: none;
}
.topbar-v2-nav {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-v2-left,
.topbar-v2-util {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.topbar-v2-util {
  flex: none;
  margin-left: auto;
}
.topbar-signout {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}
.topbar-settings-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
}
.topbar-settings-svg {
  display: block;
}
.child-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 14px 4px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--border-soft);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.child-pill:hover {
  background: var(--child-accent-bg, var(--bg));
  border-color: var(--child-accent-border, var(--border));
  text-decoration: none;
}
.child-pill.active,
.child-pill[aria-current="page"] {
  background: var(--child-accent-bg, #e7effb);
  border-color: var(--child-accent, var(--cobalt));
  color: var(--child-accent-ink, var(--ink));
}
.child-pill-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--child-accent, var(--cobalt));
  color: #ffffff;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.child-picker {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.child-picker-narrow {
  display: none;
}
.child-picker > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  max-width: 100%;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.child-picker-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.child-picker > summary.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}
.child-picker > summary::-webkit-details-marker {
  display: none;
}
.child-picker[open] > summary {
  border-color: var(--ink);
  background: var(--bg);
  color: var(--ink);
}
@media (max-width: 840px) {
  .topbar-v2-left > .child-pill {
    display: none;
  }
  .child-picker-narrow {
    display: block;
  }
}
.child-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  max-width: min(280px, calc(100vw - 28px));
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(27, 31, 36, 0.14);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 40;
}
.child-picker-menu .child-pill {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  justify-content: flex-start;
  border-radius: 10px;
}
.child-picker-menu .child-pill > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.child-tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.child-tabs-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 22px;
  scrollbar-width: none;
}
.child-tabs-inner::-webkit-scrollbar,
.sub-links-inner::-webkit-scrollbar {
  display: none;
}
.child-tabs-inner[data-overflow-right="true"]:not([data-overflow-left="true"]),
.sub-links-inner[data-overflow-right="true"]:not([data-overflow-left="true"]) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent);
}
.child-tabs-inner[data-overflow-left="true"]:not([data-overflow-right="true"]),
.sub-links-inner[data-overflow-left="true"]:not([data-overflow-right="true"]) {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 20px);
  mask-image: linear-gradient(to right, transparent, #000 20px);
}
.child-tabs-inner[data-overflow-left="true"][data-overflow-right="true"],
.sub-links-inner[data-overflow-left="true"][data-overflow-right="true"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.child-tabs-inner > a,
.child-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  white-space: nowrap;
  scroll-snap-align: start;
}
.child-tabs-inner > a:focus-visible,
.child-tab:focus-visible,
.sub-links a:focus-visible,
.sub-link:focus-visible {
  outline-offset: -3px;
}
.child-tabs-inner > a:hover,
.child-tab:hover {
  color: var(--ink);
  text-decoration: none;
}
.child-tabs-inner > a.active,
.child-tabs-inner > a[aria-current="page"],
.child-tab.active,
.child-tab[aria-current="page"] {
  color: var(--child-accent-ink, var(--ink));
  border-bottom-color: var(--child-accent, var(--ink));
}

.sub-links {
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  max-width: 100%;
  min-width: 0;
}
.sub-links-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sub-links a,
.sub-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  color: var(--body);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.sub-links a:hover,
.sub-link:hover {
  background: var(--bg);
  text-decoration: none;
}
.sub-links a.active,
.sub-links a[aria-current="page"],
.sub-link.active,
.sub-link[aria-current="page"] {
  background: var(--child-accent-bg, var(--teal-soft));
  border-color: var(--child-accent-border, var(--teal));
  color: var(--child-accent-ink, #144f47);
}
.page-breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  min-width: 0;
  max-width: 100%;
}
.page-breadcrumbs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.page-breadcrumbs-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.page-breadcrumbs-list li + li::before {
  content: '›';
  color: var(--muted);
  opacity: 0.7;
  flex: none;
}
.page-breadcrumbs-list a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.page-breadcrumbs-list a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.page-breadcrumbs-list [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  .child-tabs-inner {
    gap: 2px;
  }
  .child-tabs-inner > a,
  .child-tab {
    font-size: 14px;
    padding: 9px 11px;
  }
}

/* --- 3. Redesigned 2-Column Home (/home) --- */
.home-grid-v2 {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px;
  align-items: start;
}
.needs-section-label {
  margin: 6px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.needs-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--child-accent, var(--border));
  background: var(--surface);
}
.needs-row-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1 1 220px;
}
.needs-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.today-child-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--child-accent, var(--cobalt));
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.weekly-checkin-card {
  background: linear-gradient(180deg, #fbfaf6 0%, #ffffff 100%);
  border: 1.5px solid var(--child-accent-border, var(--border));
  border-left: 5px solid var(--child-accent, var(--teal));
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- 4. Unified Projects & Activities Hub (/children/:id/projects) --- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 18px;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.proj-card-head {
  padding: 16px 18px;
  background: #232830;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.proj-card-head.proj-track-public_speaking {
  background: linear-gradient(135deg, #3b1724 0%, #632135 100%);
}
.proj-card-head.proj-track-personal_finance {
  background: linear-gradient(135deg, #2b4c3f 0%, #3f6b56 100%);
}
.proj-card-head.proj-track-entrepreneurship {
  background: linear-gradient(135deg, #1f6457 0%, #2c7f6e 100%);
}
.proj-card-head.proj-track-building_software,
.proj-card-head.proj-track-software_studio {
  background: linear-gradient(135deg, #16181d 0%, #2a3140 100%);
}
.proj-card-head.proj-track-research_notebook {
  background: linear-gradient(135deg, #213754 0%, #2f517a 100%);
}
.proj-card-head.proj-track-la_plaza {
  background: linear-gradient(135deg, #913f22 0%, #b85630 100%);
}
.proj-card-head.proj-track-leadership {
  background: linear-gradient(135deg, #4b336b 0%, #684691 100%);
}
.proj-card-head.proj-track-time_management {
  background: linear-gradient(135deg, #3e4752 0%, #566270 100%);
}
.proj-card-head.proj-track-world_studio,
.proj-card-head.proj-track-global_art {
  background: linear-gradient(135deg, #7c5611 0%, #8c610b 100%);
}
.proj-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.lab-shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lab-shelf-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
}
.waiting-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: #faf1dc;
  border: 1px solid #dfc384;
  color: #634306;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.offline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 14px;
}

/* --- 5. Parent Guide Page (Mockup 1) --- */
.guide-hero-dark {
  background: linear-gradient(135deg, #1b1f24 0%, #2b2330 60%, #441f2c 100%);
  color: #f6f5f1;
  border-radius: 20px;
  padding: 26px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.guide-hero-dark h1,
.guide-hero-dark h2 {
  margin: 0;
  color: #ffffff;
}
.guide-hero-dark p {
  color: #d6d3cb;
}
.guide-hero-dark a:focus-visible,
.guide-hero-dark button:focus-visible {
  outline: 3px solid #9fd6cb;
  outline-offset: 2px;
}
.guide-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 14px;
}
.guide-task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--child-accent, var(--teal));
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 20px;
  align-items: start;
}
.applause-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.applause-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #e2c987;
  background: #fdf6e2;
  color: #5c4007;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.applause-chip:hover {
  background: #faecc3;
}
.dev-rubric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.dev-rubric-table th,
.dev-rubric-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}
.dev-rubric-table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.dev-level-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dev-level-btn:hover {
  border-color: var(--ink);
  background: var(--bg);
}
.dev-level-btn.is-selected,
.dev-level-btn[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}
.season-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
}
.season-tile {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  min-width: 0;
}
.season-tile.is-done {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: #144f47;
}
.season-tile.is-current {
  background: #ffffff;
  border: 2px solid var(--ink);
  font-weight: 600;
}
.credit-banner {
  padding: 16px 20px;
  border-radius: 14px;
  background: #e6f3ec;
  border: 1.5px solid #186b5e;
  color: #114c43;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* --- 6. Age-Adaptive Kid Shelf (8-12 Projects + Play & 13+ Workspace) --- */
.shelf-8-12 {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.shelf-proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}
.shelf-proj-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 18px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.shelf-proj-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink);
  text-decoration: none;
}
.shelf-play-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(175px, 100%), 1fr));
  gap: 12px;
}
.shelf-waiting-bar {
  padding: 14px 18px;
  border-radius: 14px;
  background: #faf1dc;
  border: 1.5px solid #dfc384;
  color: #5c4007;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-13 {
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: var(--ink);
}
.ws-week-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-week-list > li {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ws-proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
  gap: 14px;
}
.ws-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ws-footer {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--body);
  font-size: 13px;
}

/* --- 7A. Kid Mode Place: The Stage (Public Speaking) --- */
.stage-shell {
  background: radial-gradient(circle at top center, #2d1b2e 0%, #19141d 70%);
  color: #f7f3eb;
  border-radius: 22px;
  border-left: 16px solid #6f1d2f;
  border-right: 16px solid #6f1d2f;
  border-top: 8px solid #4e1220;
  border-bottom: 6px solid #3c261c;
  padding: 24px;
  box-shadow: 0 14px 32px rgba(17, 11, 20, 0.25);
}
.stage-shell[data-mode="teen"] {
  background: #1b1f24;
  border: 1px solid #343b46;
  box-shadow: none;
}
.stage-shell a:focus-visible,
.stage-shell button:focus-visible,
.stage-shell input:focus-visible,
.stage-shell textarea:focus-visible,
.stage-shell [role="button"]:focus-visible {
  outline: 3px solid #f7d27a;
  outline-offset: 2px;
}
.stage-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.stage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.stage-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 280px;
  min-width: 0;
}
.stage-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e8c783;
}
.stage-title-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(247, 243, 235, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 22px;
  font-weight: 700;
}
.stage-date-pill {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(232, 199, 131, 0.16);
  border: 1px solid rgba(232, 199, 131, 0.4);
  color: #f5dfb0;
  font-size: 12px;
  font-weight: 600;
}
.stage-timer-panel {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.stage-clock {
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f7f3eb;
}
.stage-rehearsal-meta,
.stage-muted {
  font-size: 13px;
  color: #cdc5d4;
}
.stage-btn {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
.stage-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}
.stage-btn-primary {
  background: #e8c783;
  border-color: #e8c783;
  color: #1b1714;
  font-weight: 700;
}
.stage-btn-primary:hover {
  background: #f2d79c;
}
.stage-warmup-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.stage-warmup-line {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #f7e6bd;
}
.stage-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stage-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f7f3eb;
}
.cue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr));
  gap: 14px;
}
.cue-card {
  background: #fdf9ee;
  color: #1b1f24;
  border-radius: 14px;
  border: 1px solid #e2d5b8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 180px;
  display: flex;
}
.cue-card.cue-tilt-1 { transform: rotate(-1.2deg); }
.cue-card.cue-tilt-2 { transform: rotate(0.9deg); }
.cue-card.cue-tilt-3 { transform: rotate(-0.7deg); }
.cue-card.cue-tilt-4 { transform: rotate(1.1deg); }
.cue-card.cue-tilt-5 { transform: rotate(-0.9deg); }
.cue-card:hover,
.cue-card.is-flipped {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}
.cue-card.is-flipped {
  background: #ffffff;
  border-color: #e8c783;
}
.cue-card-front,
.cue-card-back {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cue-card-front {
  cursor: pointer;
}
.cue-card-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #6f1d2f;
  color: #ffffff;
}
.cue-card-summary {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.cue-card-preview {
  margin: 0;
  font-size: 13px;
  color: #4a515b;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.cue-card-hint {
  margin-top: auto;
  font-size: 12px;
  font-weight: 600;
  color: #6f1d2f;
}
.cue-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #333a42;
}
.cue-field input,
.cue-field textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #c9c5bc;
  font: 500 13px Inter, system-ui, sans-serif;
  color: #1b1f24;
  background: #ffffff;
}
.stage-audience-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.stage-audience-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}
.stage-chip-remove {
  border: 0;
  background: transparent;
  color: #f5dfb0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 999px;
}
.stage-audience-add {
  min-height: 36px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1.5px dashed rgba(232, 199, 131, 0.7);
  background: transparent;
  color: #f5dfb0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.stage-audience-picker {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stage-audience-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.stage-custom-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #e4dce9;
}
.stage-custom-label input {
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font: 500 14px Inter, system-ui, sans-serif;
}
.stage-inline-notice {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #4e2a1e;
  border: 1px solid #e8a87c;
  color: #fde8dc;
  font-size: 13px;
}
.stage-applause-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}
.applause-sticky {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fdf3c7;
  color: #2b2314;
  border: 1px solid #e2ca78;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.applause-sticky p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.applause-sticky footer {
  font-size: 12px;
  font-weight: 700;
  color: #6b4f15;
}
.stage-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.stage-waiting-banner {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(232, 199, 131, 0.2);
  border: 1px solid #e8c783;
  color: #fff4d6;
  font-size: 14px;
  font-weight: 600;
}
.stage-status-note {
  font-size: 13px;
  color: #d6efe9;
}

/* --- 7B. Kid Mode Place: Treasure Trail (Personal Finance) --- */
.trail-shell {
  background: #fbf7ec;
  border: 2px solid #e2d4b4;
  border-radius: 22px;
  padding: 24px;
  color: var(--ink);
}
.trail-shell[data-mode="teen"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.trail-inner,
.trail-teen-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.trail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.trail-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a5812;
}
.trail-title {
  margin: 2px 0 0;
  font-size: 22px;
}
.trail-goal-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: #186b5e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}
.trail-svg-wrap {
  background: #f5eedb;
  border: 1px solid #dfd0ae;
  border-radius: 16px;
  padding: 12px;
}
.trail-shell[data-mode="teen"] .trail-svg-wrap {
  background: var(--bg);
  border-color: var(--border-soft);
}
.trail-map-svg,
.trail-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}
.trail-path-line {
  fill: none;
  stroke: #c4ab76;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 2 12;
}
.trail-dot-filled {
  fill: #d4961a;
  stroke: #7a5209;
  stroke-width: 2;
}
.trail-dot-open {
  fill: #fffdf6;
  stroke: #b9a47a;
  stroke-width: 2;
}
.coin-trail-svg {
  display: block;
  width: 100%;
  height: auto;
}
.coin-trail-path {
  stroke: #c4ab76;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 2 10;
}
.coin-dot-filled {
  fill: #d4961a;
  stroke: #7a5209;
  stroke-width: 2;
}
.coin-dot-empty {
  fill: #fffdf6;
  stroke: #b9a47a;
  stroke-width: 2;
}
.trail-chest-box {
  fill: #9b5b2a;
  stroke: #5c3314;
  stroke-width: 2;
}
.trail-chest-clasp {
  fill: #f0c04a;
}
.trail-fox-head,
.trail-fox-ear {
  fill: #d6642b;
  stroke: #7a3110;
  stroke-width: 1.5;
}
.trail-fox-eye,
.trail-fox-nose {
  fill: #1b1f24;
}
.trail-section-heading {
  margin: 0 0 10px;
  font-size: 17px;
}
.trail-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 12px;
}
.trail-choice-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  border-radius: 14px;
  border: 2px solid #d7c7a1;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.trail-choice-card:hover {
  border-color: #186b5e;
  transform: translateY(-2px);
}
.trail-choice-card strong {
  font-size: 16px;
}
.trail-choice-card span {
  font-size: 13px;
  color: var(--muted);
}
.trail-jars-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.trail-jar-card {
  background: #ffffff;
  border: 1px solid #e2d4b4;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trail-jar-svg {
  width: 88px;
  height: 106px;
}
.trail-jar-lid {
  fill: #9c7b4b;
}
.trail-jar-glass {
  fill: #f6f4ee;
}
.trail-jar-outline {
  fill: none;
  stroke: #7c6f5b;
  stroke-width: 2.5;
}
.trail-liquid-save { fill: #1f7a6d; }
.trail-liquid-spend { fill: #c2562a; }
.trail-liquid-share { fill: #2f5da8; }
.trail-jar-title {
  font-size: 15px;
}
.trail-jar-amount {
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.trail-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.trail-teen-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trail-axis-line {
  stroke: var(--border);
  stroke-width: 2;
}
.trail-bar-filled {
  fill: #24549c;
}
.trail-bar-empty {
  fill: #e2dfd8;
}
.trail-bar-label {
  font-size: 11px;
  fill: var(--muted);
}
.trail-teen-log {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

/* --- 7C. Kid Mode Place: My Shop (Entrepreneurship) --- */
.shop-shell {
  background: #fcfaf4;
  border: 2px solid #d5cebe;
  border-radius: 20px;
  overflow: hidden;
  color: var(--ink);
}
.shop-shell[data-mode="teen"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.shop-awning {
  height: 28px;
  background: repeating-linear-gradient(
    90deg,
    #1f6e5c 0px,
    #1f6e5c 28px,
    #f8f4e8 28px,
    #f8f4e8 56px
  );
  border-bottom: 4px solid #164f42;
}
.shop-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.shop-header,
.shop-layout,
.shop-footer {
  padding-left: 22px;
  padding-right: 22px;
}
.shop-header {
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.shop-footer {
  padding-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.shop-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #186b5e;
}
.shop-title {
  margin: 2px 0 0;
  font-size: 24px;
}
.shop-open-sign {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 18px;
  border-radius: 12px;
  border: 2px solid #186b5e;
  font-family: 'Space Grotesk', Inter, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.shop-open-sign.is-open {
  background: #186b5e;
  color: #ffffff;
}
.shop-open-sign.is-closed {
  background: #f2ece6;
  border-color: #8f4a2e;
  color: #762d12;
}
.shop-sign-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}
.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px;
  align-items: start;
}
.shop-till-col,
.shop-side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.shop-till-form,
.shop-missions-box,
.shop-reviews-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shop-subhead {
  margin: 0;
  font-size: 16px;
}
.shop-entry-inputs {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 10px;
}
.shop-form-error,
.notebook-form-error {
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fdf0eb;
  border: 1px solid var(--warn);
  color: #7c2e12;
  font-size: 13px;
  font-weight: 600;
}
.shop-till-receipt {
  background: #fffef9;
  border: 1px dashed #9d9687;
  border-radius: 8px;
  padding: 18px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 14px;
  color: #1b1f24;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shop-receipt-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #bdb6a7;
}
.shop-receipt-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shop-receipt-empty {
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
}
.shop-receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.shop-receipt-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.shop-receipt-del {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}
.shop-receipt-totals {
  padding-top: 10px;
  border-top: 1px dashed #bdb6a7;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop-receipt-profit {
  padding-top: 6px;
  border-top: 2px solid #1b1f24;
  font-size: 16px;
}
.shop-mission-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shop-mission-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
}
.shop-mission-item.is-done {
  background: #e3f2ee;
  border-color: #9bd0c4;
}
.shop-mission-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.shop-mission-link {
  font-size: 13px;
  font-weight: 600;
}
.shop-reviews-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shop-review-sticky {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fef7d4;
  border: 1px solid #e6d17f;
  color: #36290c;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop-review-sticky p {
  margin: 0;
  font-size: 14px;
}
.shop-review-sticky footer {
  font-size: 12px;
  font-weight: 700;
  color: #6b5212;
}

/* --- 7D. Kid/Teen Mode Place: Software Studio (Dark IDE) --- */
.studio-ide {
  background: #16181d;
  color: #e6ebf2;
  border: 1px solid #2b303b;
  border-radius: 18px;
  overflow: hidden;
}
.studio-ide a:focus-visible,
.studio-ide button:focus-visible,
.studio-ide input:focus-visible,
.studio-ide textarea:focus-visible {
  outline: 3px solid #74c7b8;
  outline-offset: 2px;
}
.studio-ide-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 460px;
}
.studio-sidebar {
  background: #1e2128;
  border-right: 1px solid #2c313d;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.studio-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9ba4b5;
}
.studio-project-list,
.studio-issue-list,
.studio-check-list,
.studio-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.studio-project-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #d6dde8;
  font: 600 13px ui-monospace, 'SFMono-Regular', Menlo, monospace;
  cursor: pointer;
  text-align: left;
}
.studio-project-btn:hover {
  background: #272b34;
}
.studio-project-btn.is-active {
  background: #283344;
  border-color: #4f79b8;
  color: #ffffff;
}
.studio-proj-ver {
  font-size: 11px;
  color: #8fb8e8;
}
.studio-sidebar-section {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #2c313d;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-issue-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: #16181d;
  border: 1px solid #2c313d;
  font-size: 12px;
}
.studio-issue-item p {
  margin: 4px 0 0;
  color: #cfd6e2;
}
.studio-issue-author {
  font-weight: 700;
  color: #9dd4c8;
}
.studio-main {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.studio-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.studio-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #82c8bc;
}
.studio-proj-heading {
  margin: 2px 0 0;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 22px;
  color: #ffffff;
}
.studio-ver-pill {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #283344;
  color: #a9ccf5;
  vertical-align: middle;
}
.studio-release-bar {
  background: #1e2128;
  border: 1px solid #2c313d;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.studio-release-track {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 13px;
}
.studio-release-node {
  padding: 3px 9px;
  border-radius: 999px;
  background: #16181d;
  border: 1px solid #394050;
  color: #a4adbe;
}
.studio-release-node.is-done {
  border-color: #36786b;
  color: #8fd8c9;
}
.studio-release-node.is-current {
  background: #24549c;
  border-color: #6396e0;
  color: #ffffff;
  font-weight: 700;
}
.studio-stage-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.studio-stage-pill {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #353c4b;
  background: #16181d;
  color: #c2cad8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.studio-stage-pill.is-active {
  background: #186b5e;
  border-color: #4db3a2;
  color: #ffffff;
}
.studio-mini-btn,
.studio-ghost-btn,
.studio-action-btn,
.studio-ship-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #3c4454;
  background: #262b36;
  color: #edf1f7;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.studio-mini-btn:hover,
.studio-ghost-btn:hover,
.studio-action-btn:hover {
  background: #323947;
}
.studio-ship-btn {
  width: 100%;
  min-height: 44px;
  background: #2b3240;
  border-color: #4c566b;
  color: #cbd3e0;
  font-size: 14px;
}
.studio-ship-btn.is-ready {
  background: #1f7a6d;
  border-color: #4ec4b2;
  color: #ffffff;
  font-weight: 700;
}
.studio-panels-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}
.studio-checklist,
.studio-changelog,
.studio-spec-drawer,
.studio-sim-panel {
  background: #1e2128;
  border: 1px solid #2c313d;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.studio-sim-panel {
  border-color: #4f79b8;
  background: #1a2333;
}
.studio-sim-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #283852;
  color: #b8d3f8;
}
.studio-sim-prompt {
  margin: 0;
  font-size: 14px;
  color: #f0f4fa;
}
.studio-panel-title {
  margin: 0;
  font-size: 15px;
  color: #ffffff;
}
.studio-muted-note {
  margin: 0;
  font-size: 12px;
  color: #a4adbe;
}
.studio-check-row {
  padding: 8px 10px;
  border-radius: 8px;
  background: #16181d;
  border: 1px solid #2d3340;
}
.studio-check-row.is-checked {
  border-color: #36786b;
  background: #162624;
}
.studio-check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.studio-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #b7c0d0;
}
.studio-field input,
.studio-field textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #3c4454;
  background: #121419;
  color: #f2f5fa;
  font: 500 13px Inter, system-ui, sans-serif;
}
.studio-ship-box,
.studio-log-form,
.studio-new-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-log-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: #16181d;
  border: 1px solid #2c313d;
}
.studio-log-ver {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  color: #82c8bc;
  margin-right: 8px;
}
.studio-log-date {
  font-size: 11px;
  color: #9ba4b5;
}
.studio-log-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: #dce3ee;
}
.studio-error-banner {
  padding: 10px 14px;
  border-radius: 10px;
  background: #3d1f1b;
  border: 1px solid #d47a63;
  color: #fde3dc;
  font-size: 13px;
  font-weight: 600;
}
.studio-review-banner {
  padding: 10px 14px;
  border-radius: 10px;
  background: #17332e;
  border: 1px solid #4ec4b2;
  color: #d6f5ef;
  font-size: 14px;
  font-weight: 600;
}
.studio-status-line {
  font-size: 13px;
  color: #a9d9cf;
}
.studio-privacy-footer {
  padding-top: 12px;
  border-top: 1px solid #2c313d;
  font-size: 12px;
  color: #9ba4b5;
}

/* --- 7E. Kid/Teen Mode Place: Research Notebook (Olympiads & Science Fairs) --- */
.notebook-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid #24549c;
  border-radius: 16px;
  padding: 22px;
  color: var(--ink);
}
.notebook-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.notebook-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.notebook-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #24549c;
}
.notebook-title {
  margin: 2px 0 0;
  font-size: 22px;
}
.notebook-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
}
.notebook-stage-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.notebook-stage-tab:hover {
  border-color: var(--ink);
}
.notebook-stage-tab.is-active {
  background: #24549c;
  border-color: #24549c;
  color: #ffffff;
}
.notebook-stage-tab.is-locked {
  background: #f5f2eb;
  border-style: dashed;
  color: #6b5848;
}
.notebook-lock-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fbece6;
  color: #762d12;
}
.notebook-gate-banner {
  padding: 14px 16px;
  border-radius: 12px;
  background: #fdf0eb;
  border: 1.5px solid #a6431d;
  color: #762d12;
  font-size: 14px;
}
.notebook-stage-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.notebook-stage-heading {
  margin: 0 0 4px;
  font-size: 18px;
}
.notebook-approval-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notebook-approval-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.notebook-entry-form {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notebook-subhead {
  margin: 0;
  font-size: 15px;
}
.notebook-entry-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
}
.notebook-entries-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notebook-entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notebook-entry-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  border-left: 4px solid #24549c;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notebook-entry-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.notebook-stage-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f2eaf8;
  border: 1px solid #c9aee0;
  color: #4d296b;
  font-weight: 600;
}
.notebook-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

/* --- 8. Responsive & Reduced-Motion Rules for Overhaul Components --- */
@media (max-width: 840px) {
  .home-grid-v2,
  .guide-split,
  .shop-layout,
  .studio-ide-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .studio-sidebar {
    border-right: 0;
    border-bottom: 1px solid #2c313d;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 14px 14px 48px;
    gap: 14px;
  }
  .site-footer {
    padding: 14px 14px 32px;
  }
  .topbar-v2-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "brand util"
      "nav nav";
    align-items: center;
    gap: 6px 10px;
    padding: 8px 14px;
  }
  .topbar-v2-inner > .brand-link {
    grid-area: brand;
    font-size: 18px;
    gap: 8px;
  }
  .topbar-v2-util {
    grid-area: util;
    justify-self: end;
    margin-left: 0;
    gap: 4px;
    flex-wrap: nowrap;
  }
  .topbar-v2-util .nav-pill {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
  .topbar-v2-util .topbar-settings-icon {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }
  .topbar-signout {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }
  .topbar-v2-nav {
    grid-area: nav;
    border-top: 1px solid var(--border-soft);
    padding-top: 6px;
  }
  .topbar-v2-left {
    position: relative;
    width: 100%;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .topbar-v2-left .nav-pill {
    flex: none;
    min-height: 38px;
    padding: 0 12px;
    font-size: 13.5px;
    white-space: nowrap;
  }
  .child-picker {
    position: static;
  }
  .child-picker > summary {
    min-height: 38px;
    padding: 3px 10px 3px 5px;
    gap: 6px;
    font-size: 13.5px;
  }
  .child-picker-label {
    max-width: none;
  }
  .child-pill-avatar {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  .child-picker-menu {
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .child-tabs-inner {
    padding: 0 10px;
    gap: 2px;
    scroll-padding-inline: 22px;
  }
  .child-tabs-inner > a,
  .child-tab {
    min-height: 44px;
    padding: 10px 10px;
    font-size: 14px;
  }
  .sub-links {
    padding: 6px 8px;
  }
  .sub-links-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 22px;
    scrollbar-width: none;
    gap: 4px;
  }
  .sub-links a,
  .sub-link {
    flex: none;
    min-height: 36px;
    padding: 4px 11px;
    scroll-snap-align: start;
  }
  .page-breadcrumbs {
    font-size: 12.5px;
  }
  .page-breadcrumbs-list {
    gap: 4px;
  }
  .stage-shell {
    border-left-width: 6px;
    border-right-width: 6px;
    padding: 16px;
  }
  .trail-jars-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .shop-entry-inputs,
  .notebook-entry-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cue-card,
  .cue-card.cue-tilt-1,
  .cue-card.cue-tilt-2,
  .cue-card.cue-tilt-3,
  .cue-card.cue-tilt-4,
  .cue-card.cue-tilt-5,
  .cue-card:hover,
  .shelf-proj-card,
  .shelf-proj-card:hover,
  .trail-choice-card,
  .trail-choice-card:hover {
    transform: none;
    transition: none;
  }
}

@media print {
  .topbar-v2,
  .child-tabs,
  .sub-links,
  .page-breadcrumbs {
    display: none !important;
  }
}

/* --- 9. Workbook Page Benchmarks & Edition Linking (Parent-Only) --- */
.wb-bench-badge {
  background: var(--teal-soft);
  color: #145a4f;
  border: 1px solid #c3dfd7;
  font-size: 12px;
  font-weight: 600;
}
.wb-bench-parent-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.wb-edition-field {
  margin: 0;
}
.wb-edition-field-label {
  font-weight: 600;
  color: var(--ink);
}
.wb-edition-search {
  width: 100%;
  max-width: 100%;
  margin-bottom: 6px;
}
.wb-edition-select {
  width: 100%;
  max-width: 100%;
}
.wb-edition-help {
  margin-top: 2px;
}
.wb-edition-picker-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--bg);
}
.wb-edition-picker-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
.wb-edition-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wb-edition-banner {
  margin-top: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wb-edition-suggestion {
  border-left: 4px solid var(--cobalt);
}
.wb-edition-autolink {
  border-left: 4px solid var(--teal);
}
.wb-edition-banner-copy {
  margin: 0;
  color: var(--body);
  font-size: 14px;
}
.wb-edition-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.wb-edition-action-form {
  margin: 0;
}
.wb-bench-callout {
  margin-top: 16px;
  border-left: 4px solid var(--teal);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wb-bench-callout-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wb-bench-heading {
  margin: 0;
  font-size: 17px;
}
.wb-bench-callout-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.wb-bench-edition-meta {
  margin: 0;
}
.wb-bench-callout-summary {
  margin: 0;
  color: var(--body);
  font-size: 14px;
}
.wb-bench-callout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wb-bench-callout-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wb-bench-callout-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.wb-bench-callout-line {
  margin: 0;
  font-size: 14px;
  color: var(--body);
}
.wb-bench-disclosure {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.wb-bench-summary {
  cursor: pointer;
  padding: 12px 16px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wb-bench-disclosure[open] > .wb-bench-summary {
  border-bottom: 1px solid var(--border-soft);
}
.wb-bench-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wb-bench-empty {
  margin: 0;
}
.wb-bench-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wb-bench-page + .wb-bench-page {
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
.wb-bench-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wb-bench-page-title {
  margin: 0;
  font-size: 15px;
}
.wb-bench-pacing {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.wb-bench-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wb-bench-subhead {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.wb-bench-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
  color: var(--body);
}
.wb-bench-tricky-list li {
  color: var(--ink);
}
.wb-bench-skipped-list li {
  color: var(--body);
}
.wb-bench-table-wrap {
  overflow-x: auto;
}
.wb-bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wb-bench-table th,
.wb-bench-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.wb-bench-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
}
.wb-bench-table tbody th {
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
}
.wb-bench-score-disclosure {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.wb-bench-score-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}
.wb-bench-score-summary:hover {
  color: var(--ink);
}
.wb-bench-score-body {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wb-bench-score-copy {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}
.wb-bench-score-note {
  margin: 0;
}
.wb-bench-nudge {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.wb-bench-setting {
  margin-top: 4px;
}
.wb-bench-setting-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  cursor: pointer;
}
.wb-bench-setting-label input[type='checkbox'] {
  margin-top: 3px;
  flex-shrink: 0;
}
.wb-bench-slice-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--bg);
  align-self: flex-start;
}
.wb-bench-slice-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--body);
  text-decoration: none;
}
.wb-bench-slice-link:hover {
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}
.wb-bench-slice-link.is-active {
  background: var(--ink);
  color: #fff;
}
.wb-bench-errata-note {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--ochre);
  background: var(--bg);
  font-size: 13px;
  color: var(--body);
}


/* ── Library V2 hub, split pages, instant search & lazy scope maps ─────────── */
html.js .no-js-only { display: none !important; }

.lib-hub { max-width: 1080px; margin: 0 auto; }

.lib-subhead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.lib-breadcrumb { display: flex; align-items: center; gap: 6px; }
.lib-seg-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--border-soft);
  border: 1px solid var(--border);
}
.lib-seg-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--body);
  text-decoration: none;
}
.lib-seg-tab:hover { background: rgba(255, 255, 255, 0.7); text-decoration: none; color: var(--ink); }
.lib-seg-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }
.lib-seg-count { font-weight: 500; color: var(--muted); }

.lib-search-wrap { position: relative; max-width: 720px; }
.lib-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 4px 10px 4px 14px;
}
.lib-search-form:focus-within { box-shadow: 0 0 0 3px rgba(31, 122, 109, 0.18); border-color: var(--teal); }
.lib-search-icon { color: var(--muted); font-size: 18px; line-height: 1; }
.lib-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 4px;
  font-size: 15px;
  color: var(--ink);
}
.lib-search-input:focus { outline: none; }
.lib-search-input::-webkit-search-cancel-button,
.lib-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.lib-search-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 8px;
}
.lib-search-clear:hover { background: var(--bg); color: var(--ink); }

.lib-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(27, 31, 36, 0.12);
  padding: 10px;
  max-height: 70vh;
  overflow-y: auto;
}
.lib-dd-group { padding: 6px 4px; border-top: 1px solid var(--border-soft); }
.lib-dd-group:first-child { border-top: 0; padding-top: 2px; }
.lib-dd-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lib-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.lib-dd-item:hover,
.lib-dd-item.is-focused { background: var(--bg); text-decoration: none; }
.lib-dd-item mark { background: #f6e7b4; color: inherit; border-radius: 3px; padding: 0 2px; }
.lib-dd-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lib-dd-kind {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--border-soft);
  color: var(--body);
}
.lib-dd-kind-c { background: #e6eef9; color: var(--cobalt); }
.lib-dd-kind-r { background: #f8ebe4; color: var(--terra); }
.lib-dd-kind-s { background: #efe7f7; color: var(--plum); }
.lib-dd-kind-m { background: var(--teal-soft); color: var(--teal); }
.lib-dd-more { display: inline-block; padding: 4px 10px; font-size: 13px; }
.lib-dd-wv-banner {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--body);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lib-dd-wv-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lib-dd-wv-btn {
  border: 1px solid var(--teal);
  background: var(--surface);
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.lib-dd-wv-btn:hover { background: var(--teal-soft); }
#default-worldview:target {
  scroll-margin-top: 84px;
  padding: 10px 12px;
  margin: -10px -12px;
  border-radius: 10px;
  background: var(--teal-soft);
}
body:has(dialog.lib-scope-dialog[open]) { overflow: hidden; }
.lib-scope-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(82vh, 780px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 56px rgba(27, 31, 36, 0.24);
  overflow: hidden;
}
.lib-scope-dialog::backdrop {
  background: rgba(27, 31, 36, 0.45);
  backdrop-filter: blur(2px);
}
.lib-scope-dialog[open] {
  display: flex;
  flex-direction: column;
}
.lib-scope-dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: min(82vh, 780px);
  min-height: 0;
}
.lib-scope-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.lib-scope-dialog-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.lib-scope-dialog-close:hover { background: var(--bg); color: var(--ink); }
.lib-scope-dialog-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.lib-scope-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg);
  flex-shrink: 0;
}
.lib-dd-foot {
  margin-top: 6px;
  padding: 8px 10px 2px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lib-books-banner { border: 1.5px solid var(--teal); }
.lib-tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.lib-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.lib-tile:hover { border-color: var(--teal); transform: translateY(-1px); text-decoration: none; }
.lib-tile-title { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 18px; font-weight: 700; }
.lib-tile-count { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 24px; font-weight: 700; color: var(--ink); }

.lib-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.lib-family-card { display: flex; flex-direction: column; gap: 10px; }
.lib-family-list,
.lib-result-list,
.lib-tools-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lib-family-row,
.lib-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.lib-family-row:hover,
.lib-result-row:hover { background: var(--border-soft); text-decoration: none; }
.lib-family-foot { margin-top: auto; padding-top: 4px; }

.lib-bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.lib-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}
.lib-recent-chip:hover { border-color: var(--teal); text-decoration: none; }
.lib-recent-kind { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: var(--muted); }

.lib-filter-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lib-filter-search {
  flex: 1 1 240px;
  min-width: 180px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink);
}
.lib-sort-select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
}
.lib-chip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lib-chip-label {
  min-width: 72px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.lib-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.lib-chip:hover { border-color: var(--ink); text-decoration: none; }
.lib-chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.lib-chip-sm { padding: 3px 10px; font-size: 12px; }
.lib-settings-strip {
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}
.lib-setting-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  border: 1px solid var(--teal);
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.lib-setting-chip:hover { text-decoration: none; background: #d5e9e3; }
.lib-url-preview { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.lib-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.lib-routine-card,
.lib-cur-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.lib-in-use-badge { background: var(--teal-soft); color: var(--teal); border-color: var(--teal); }
.lib-pager { display: flex; justify-content: center; padding: 6px 0; }

@media (max-width: 720px) {
  .lib-tiles-grid { grid-template-columns: 1fr; }
  .lib-chip-label { width: 100%; }
}

/* Subscription & Billing (/billing and read-only mode banner) */
.billing-page-wrap {
  max-width: 960px;
  margin: 0 auto;
}
.billing-kid-screen {
  max-width: 620px;
  margin: 40px auto;
}
.billing-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.billing-inline-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.billing-status-actions {
  padding-top: 4px;
}
.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.billing-plan-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
}
.billing-plan-card.billing-plan-recommended {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}
.billing-plan-card.billing-plan-active {
  border-color: var(--ink);
  background: var(--surface-tint, #faf9f5);
}
.billing-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.billing-price-amount {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.billing-plan-cap,
.billing-usage-pill,
.billing-env-pill,
.billing-current-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}
.billing-env-pill {
  background: #fff6e0;
  border-color: #d99b26;
  color: #7c4d00;
}
.billing-current-pill {
  justify-content: center;
  width: 100%;
  padding: 8px 12px;
  background: var(--teal-soft);
  border-color: var(--teal);
  color: var(--teal);
}
.billing-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.billing-status-badge.badge-active {
  background: var(--teal-soft);
  color: var(--teal);
}
.billing-status-badge.badge-warn {
  background: #fff3d6;
  color: #7c4d00;
}
.billing-status-badge.badge-neutral {
  background: var(--border-soft);
  color: var(--ink);
}
.billing-features,
.billing-notes {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.billing-plan-action {
  margin-top: auto;
  padding-top: 8px;
}
.billing-readonly-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

