/* AdaLogic BASIC — family-safe lab chrome. */

:root {
  --alb-ink: #0f1b2d;
  --alb-muted: #4a5d73;
  --alb-paper: #f4f7fb;
  --alb-panel: #ffffff;
  --alb-line: #c9d6e5;
  --alb-accent: #0b6bcb;
  --alb-accent-deep: #084a8c;
  --alb-warm: #e8f1fb;
  --alb-ok: #0369a1;
  --alb-bar: #102a43;
  --alb-bar-text: #e8f1fb;
  --alb-radius: 10px;
  --alb-font: "Trebuchet MS", "Segoe UI", Candara, sans-serif;
  --alb-mono: "Cascadia Code", "Consolas", "Liberation Mono", ui-monospace, monospace;
}

body.family-safe {
  background:
    url("./images/bg-page.svg") center top / cover no-repeat,
    radial-gradient(ellipse 90% 50% at 10% -10%, #b8d4f5 0%, transparent 50%),
    radial-gradient(ellipse 70% 40% at 100% 0%, #d7e8fa 0%, transparent 45%),
    linear-gradient(180deg, #e8eef6 0%, #d5e0ec 100%) !important;
  color: var(--alb-ink);
  font-family: var(--alb-font);
  font-size: 17px;
}

body.family-safe #container {
  width: min(960px, 94%);
  max-width: 960px;
  margin: 1.25rem auto 3rem;
  background: var(--alb-panel);
  color: var(--alb-ink);
  outline: none;
  border: 1px solid var(--alb-line);
  border-radius: var(--alb-radius);
  box-shadow: 0 12px 40px rgba(16, 42, 67, 0.08);
  overflow: hidden;
}

body.family-safe #content {
  padding: 1.25rem 1.5rem 2rem;
}

body.family-safe #header {
  background: transparent;
  padding: 0;
  border: 0;
}

body.family-safe h1,
body.family-safe h2,
body.family-safe h3,
body.family-safe #pageTitleH1 {
  color: var(--alb-ink);
  font-family: var(--alb-font);
  font-weight: 700;
  letter-spacing: -0.02em;
}

body.family-safe #pageTitleH1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0.4rem 0 0.75rem;
}

body.family-safe a {
  color: var(--alb-accent);
}
body.family-safe a:hover {
  background: var(--alb-warm);
  color: var(--alb-accent-deep);
}

body.family-safe .marquee {
  background: var(--alb-warm);
  background-image: url("./images/marquee-band.svg");
  background-size: cover;
  background-position: center;
  border: 1px solid var(--alb-line);
  border-radius: 8px;
  color: var(--alb-muted);
  font-family: var(--alb-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.75rem;
  margin: 0 0 1rem;
}
body.family-safe .marquee .blink {
  color: var(--alb-ok);
  animation: none;
  font-weight: 600;
}

body.family-safe .caption {
  color: var(--alb-muted);
}

/* Forum chrome bar */
body.family-safe .fcbar {
  background: var(--alb-bar) !important;
  background-image: url("./images/bar-chrome.svg") !important;
  background-size: cover !important;
  background-position: center !important;
  color: var(--alb-bar-text) !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 0.4rem !important;
  gap: 0.3rem;
  flex-wrap: nowrap !important;
}
body.family-safe .fcbrand {
  color: #fff !important;
  font-family: var(--alb-mono);
  font-weight: 600;
  font-size: 0.85rem !important;
  letter-spacing: 0.02em;
  text-decoration: none;
}
body.family-safe .fcbrand:hover {
  background: transparent !important;
  color: #9fd0ff !important;
}
body.family-safe .fcbar .ftab {
  color: var(--alb-bar-text) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 6px;
  font-family: var(--alb-font);
  font-size: 0.78rem !important;
  min-height: 26px;
  padding: 0.15rem 0.5rem !important;
}
body.family-safe .fcbar .ftab:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}
body.family-safe .fcbar .ftab-current {
  background: var(--alb-accent) !important;
  color: #fff !important;
}
body.family-safe .skin-sysbtn,
body.family-safe .fcbar .skin-sysbtn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--alb-bar-text) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 6px !important;
  font-family: var(--alb-font) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.55rem !important;
}
body.family-safe .skin-sysbtn:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

/* Cards / panels */
body.family-safe .denizencard,
body.family-safe .house-signpost,
body.family-safe .panel-stub,
body.family-safe .vault-tile,
body.family-safe .forum-thread,
body.family-safe .auth-box {
  background: var(--alb-paper);
  border: 1px solid var(--alb-line);
  border-radius: var(--alb-radius);
  box-shadow: none;
}
/* Sign-in dialog — light theme */
body.family-safe .auth-box {
  color: var(--alb-ink);
  outline: 0;
}
body.family-safe .auth-box h2 {
  color: var(--alb-ink);
}
body.family-safe .auth-box label {
  color: var(--alb-muted);
  font-family: var(--alb-font);
}
body.family-safe .auth-box input,
body.family-safe .auth-box select {
  background: #fff;
  color: var(--alb-ink);
  border: 1px solid var(--alb-line);
  border-radius: 8px;
  font-family: var(--alb-mono);
  padding: 0.55rem 0.7rem;
}
body.family-safe .auth-box input:focus,
body.family-safe .auth-box select:focus {
  border-color: var(--alb-accent);
  outline: 2px solid rgba(28, 176, 246, 0.25);
}
body.family-safe .auth-tabs button {
  background: var(--alb-paper);
  color: var(--alb-muted);
  border: 1px solid var(--alb-line);
  border-radius: 8px;
  font-family: var(--alb-font);
}
body.family-safe .auth-tabs button.on {
  background: var(--alb-accent);
  border-color: var(--alb-accent);
  color: #fff;
}
body.family-safe .auth-box .stub-note {
  color: var(--alb-muted);
  border: 1px dashed var(--alb-line);
  border-radius: 8px;
}
body.family-safe .auth-close { color: var(--alb-muted); }
body.family-safe .auth-sticky {
  background: var(--alb-panel);
  color: var(--alb-ink);
  border-color: var(--alb-line);
}
body.family-safe .denizencard {
  padding: 1rem 1.1rem;
  margin: 0 0 0.85rem;
}
body.family-safe .denizencard.featured {
  border-color: var(--alb-accent);
  background: linear-gradient(180deg, #fff, var(--alb-warm));
}
body.family-safe .badge {
  background: var(--alb-warm);
  color: var(--alb-accent-deep);
  border: 1px solid var(--alb-line);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
}
body.family-safe .badge.status { color: var(--alb-ok); }
body.family-safe .house-signpost {
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
  color: var(--alb-muted);
}

body.family-safe .vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
body.family-safe #footer,
body.family-safe #footer p {
  color: var(--alb-muted);
  font-size: 0.85rem;
}

/* Hero convenience strip on home */
body.family-safe .alb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}
body.family-safe .alb-hero-actions a {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
body.family-safe .alb-btn-primary {
  background: var(--alb-accent);
  color: #fff !important;
}
body.family-safe .alb-btn-primary:hover {
  background: var(--alb-accent-deep);
  color: #fff !important;
}
body.family-safe .alb-btn-ghost {
  background: var(--alb-warm);
  color: var(--alb-accent-deep) !important;
  border: 1px solid var(--alb-line);
}

body.family-safe .alb-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
  margin: 0 0 1.5rem;
}
body.family-safe .alb-quick a {
  display: block;
  padding: 0.85rem 0.95rem;
  background: var(--alb-paper);
  border: 1px solid var(--alb-line);
  border-radius: var(--alb-radius);
  text-decoration: none;
  color: var(--alb-ink);
}
body.family-safe .alb-quick a strong {
  display: block;
  color: var(--alb-accent-deep);
  margin-bottom: 0.2rem;
}
body.family-safe .alb-quick a span {
  color: var(--alb-muted);
  font-size: 0.85rem;
}

body.family-safe pre.code,
body.family-safe pre.code code {
  display: block;
  font-family: var(--alb-mono);
  font-size: 0.86rem;
  line-height: 1.45;
  background: #0f1b2d;
  color: #e8f1fb;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
}
body.family-safe pre.code code {
  padding: 0;
  background: transparent;
}
body.family-safe table.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.95rem;
}
body.family-safe table.doc-table th,
body.family-safe table.doc-table td {
  border: 1px solid var(--alb-line);
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
body.family-safe table.doc-table th {
  background: var(--alb-warm);
  color: var(--alb-accent-deep);
}
body.family-safe table.doc-table code {
  font-family: var(--alb-mono);
  font-size: 0.88em;
}

/* Toolkit / skill rows — light surfaces so dark blue text stays readable */
body.family-safe .skill-list li,
body.family-safe .gear-item,
body.family-safe .vendor-card {
  background: #eef3f8 !important;
  color: var(--alb-ink);
  border: 1px solid var(--alb-line);
  border-left: 3px solid var(--alb-accent);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin: 0.45rem 0;
}
body.family-safe .skill-list li strong,
body.family-safe .gear-item strong,
body.family-safe .vendor-card strong {
  color: var(--alb-accent-deep);
}
body.family-safe .skill-list li em,
body.family-safe .gear-item em,
body.family-safe .vendor-card em {
  color: var(--alb-muted);
  font-style: normal;
}
body.family-safe .skill-list .skill-lvl {
  color: var(--alb-accent);
}
body.family-safe .quiz-card,
body.family-safe .psx-panel,
body.family-safe .scene-planner,
body.family-safe .denizencard,
body.family-safe .chron-entry,
body.family-safe .act-row,
body.family-safe .lex-card {
  background: #f7fafc !important;
  color: var(--alb-ink);
  border-color: var(--alb-line) !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Forum thread rows — light and readable */
body.family-safe .thread-row {
  background: #ffffff;
  color: var(--alb-ink);
  border-bottom: 1px solid var(--alb-line);
  border-left: 4px solid var(--alb-accent);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
}
body.family-safe .thread-row .ttitle { color: var(--alb-ink); }
body.family-safe .thread-row .tmeta { color: var(--alb-muted); }
body.family-safe .thread-row.pinned { border-left-color: #ef4444; }

/* Examples gallery — thumbnail grid for lessons / games / apps */
body.family-safe .alb-ex-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
body.family-safe .alb-ex-filter {
  font: inherit;
  cursor: pointer;
  background: var(--alb-paper);
  color: var(--alb-ink);
  border: 1px solid var(--alb-line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}
body.family-safe .alb-ex-filter.on,
body.family-safe .alb-ex-filter:hover {
  background: var(--alb-accent);
  color: #fff;
  border-color: var(--alb-accent);
}
body.family-safe .alb-ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0 0 1.25rem;
}
body.family-safe .alb-ex-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
body.family-safe .alb-ex-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: var(--alb-ink);
  background: #fff;
  border: 1px solid var(--alb-line);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  width: 100%;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  animation: albExIn 0.45s ease both;
}
body.family-safe .alb-ex-grid .alb-ex-card:nth-child(2) { animation-delay: 0.04s; }
body.family-safe .alb-ex-grid .alb-ex-card:nth-child(3) { animation-delay: 0.08s; }
body.family-safe .alb-ex-grid .alb-ex-card:nth-child(4) { animation-delay: 0.12s; }
body.family-safe .alb-ex-grid .alb-ex-card:nth-child(5) { animation-delay: 0.16s; }
@keyframes albExIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
body.family-safe .alb-ex-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(16, 42, 67, 0.14);
}
body.family-safe .alb-ex-card:focus-visible {
  outline: 2px solid var(--alb-accent);
  outline-offset: 2px;
}
body.family-safe .alb-ex-thumb {
  position: relative;
}
body.family-safe .alb-ex-thumb::after {
  content: "▶ Run";
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #102a43;
  background: #7dd3fc;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
body.family-safe .alb-ex-card:hover .alb-ex-thumb::after,
body.family-safe .alb-ex-card:focus-visible .alb-ex-thumb::after {
  opacity: 1;
  transform: none;
}

/* Brand asset row (technology page) */
body.family-safe .brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 1.25rem;
}
body.family-safe .brand-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem;
  background: #fff;
  border: 1px solid var(--alb-line);
  text-decoration: none;
  color: var(--alb-ink);
  font-size: 0.82rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
body.family-safe .brand-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(16, 42, 67, 0.14);
}
body.family-safe .brand-item img {
  display: block;
  max-width: 190px;
  height: auto;
}
body.family-safe .brand-item.brand-dark {
  background: #101528;
}

/* Page-title logo */
body.family-safe .page-logo {
  display: inline-block;
  height: 1.35em;
  width: auto;
  vertical-align: -0.28em;
  margin-right: 0.45em;
}

/* "Made with ALB" showcase */
body.family-safe .alb-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 0 0 1.25rem;
}
body.family-safe .alb-showcase-card {
  margin: 0;
  background: #fff;
  border: 1px solid var(--alb-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  animation: albExIn 0.45s ease both;
}
body.family-safe .alb-showcase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(16, 42, 67, 0.14);
}
body.family-safe .alb-showcase-card a {
  display: block;
}
body.family-safe .alb-showcase-card img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--alb-line);
}
body.family-safe .alb-showcase-card figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--alb-ink);
}
body.family-safe .alb-showcase-card:nth-child(2) { animation-delay: 0.04s; }
body.family-safe .alb-showcase-card:nth-child(3) { animation-delay: 0.08s; }
body.family-safe .alb-showcase-card:nth-child(4) { animation-delay: 0.12s; }
body.family-safe .alb-showcase-card:nth-child(5) { animation-delay: 0.16s; }

/* Click-to-run modal */
body.alb-run-open { overflow: hidden; }
.alb-run-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.alb-run-modal[hidden] { display: none !important; }
.alb-run-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.62);
  backdrop-filter: blur(4px);
}
.alb-run-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(90vh, 820px);
  display: flex;
  flex-direction: column;
  background: #f7fbff;
  border-radius: 18px;
  border: 1px solid #c5d4e4;
  box-shadow: 0 24px 60px rgba(8, 24, 48, 0.35);
  overflow: hidden;
  animation: albRunIn 0.28s ease both;
}
@keyframes albRunIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.alb-run-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.1rem 0.65rem;
  background: linear-gradient(135deg, #102a43, #0b6bcb);
  color: #e8f1fb;
}
.alb-run-kind {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
  font-weight: 700;
}
.alb-run-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-style: italic;
  color: #fff;
}
.alb-run-head-btns { display: flex; gap: 0.4rem; }
.alb-run-x {
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  border: 0;
  background: rgba(255,255,255,0.12);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
}
/* fullscreen: let the panel truly fill the screen */
.alb-run-panel:fullscreen {
  width: 100%;
  max-height: none;
  height: 100%;
  border-radius: 0;
}
.alb-run-panel:fullscreen .alb-run-body { flex: 1; }
.alb-run-panel:fullscreen .alb-play-frame { height: 100%; }
.alb-run-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  background: #e8f1fb;
  border-bottom: 1px solid #c5d4e4;
}
.alb-run-tab {
  font: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  color: #334e68;
}
.alb-run-tab.on {
  background: #0b6bcb;
  color: #fff;
}
.alb-run-body {
  overflow: auto;
  flex: 1;
  padding: 0.85rem 1rem 1.1rem;
}
.alb-run-source {
  margin: 0;
  padding: 0.85rem;
  background: #0f1b2d;
  color: #c9d6e5;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  overflow: auto;
  max-height: 50vh;
  white-space: pre-wrap;
}
.alb-run-source-actions { margin: 0.65rem 0 0; }
.alb-run-loading { color: #4a657f; }
.alb-term, .alb-canvas-wrap, .alb-play-wrap {
  display: grid;
  gap: 0.55rem;
}
.alb-term-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #4a657f;
}
.alb-run-restart {
  font: inherit;
  cursor: pointer;
  border: 1px solid #c5d4e4;
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
}
.alb-term-out {
  background: #0f1b2d;
  color: #7dd3fc;
  border-radius: 12px;
  min-height: 200px;
  max-height: 42vh;
  overflow: auto;
  padding: 0.85rem 1rem;
  font-family: Consolas, "SF Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
}
.alb-term-out .in { color: #93c5fd; }
.alb-term-out .err { color: #fb7185; }
.alb-term-out .meta { color: #8aa0b8; }
.alb-term-in {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
}
.alb-term-in[hidden] { display: none !important; }
.alb-term-in label { font-size: 0.88rem; color: #334e68; }
.alb-term-in input {
  font: inherit;
  padding: 0.4rem 0.6rem;
  border: 1px solid #c5d4e4;
  border-radius: 8px;
}
.alb-term-in button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  background: #0b6bcb;
  color: #fff;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
}
.alb-term-note { margin: 0; font-size: 0.8rem; color: #64748b; }
.alb-term-err { color: #be123c; }
.alb-canvas-wrap canvas {
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  border: 1px solid #1e3a5f;
  background: #101018;
  justify-self: center;
}
.alb-play-frame {
  width: 100%;
  height: min(58vh, 520px);
  border: 1px solid #c5d4e4;
  border-radius: 12px;
  background: #fff;
}
body.family-safe .alb-ex-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  background: #102a43;
  overflow: hidden;
}
body.family-safe .alb-ex-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.family-safe .alb-ex-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem 0.85rem 0.95rem;
}
body.family-safe .alb-ex-kind {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--alb-accent);
  font-weight: 700;
}
body.family-safe .alb-ex-body strong {
  font-size: 1.05rem;
  color: var(--alb-accent-deep);
}
body.family-safe .alb-ex-body em {
  font-style: normal;
  color: var(--alb-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}
body.family-safe .alb-ex-meta {
  font-size: 0.8rem;
  color: var(--alb-muted);
  margin-top: 0.25rem;
}
body.family-safe .alb-ex-hint {
  font-size: 0.75rem;
  color: var(--alb-accent-deep);
  opacity: 0.85;
}

/* Desktop: dock the home bar to the bottom edge of the viewport */
@media (min-width: 900px) {
  body.family-safe .fcbar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1180px, 96vw) !important;
    z-index: 70;
    border-width: 1px 0 0;
    border-radius: 0 !important;
    box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.45);
    justify-content: space-between !important;
  }
  body.family-safe {
    padding-bottom: 42px;
  }
}

/* Mobile Styles (< 640px) */
@media (max-width: 640px) {
  body.family-safe {
    font-size: 16px;
  }

  body.family-safe #container {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding-bottom: 24px;
  }

  body.family-safe #content {
    padding: 1rem 1.25rem 1.5rem;
  }

  body.family-safe #pageTitleH1 {
    font-size: 1.5rem;
  }

  body.family-safe .fcbar {
    justify-content: flex-start !important;
  }

  body.family-safe .fcsys {
    width: 100%;
    justify-content: flex-end;
  }

  /* Touch-friendly interactions */
  body.family-safe a,
  body.family-safe button {
    min-height: 44px; /* iOS touch target minimum */
    min-width: 44px;
  }

  body.family-safe .alb-ex-card {
    min-height: 120px;
  }

  body.family-safe .alb-ex-card:active {
    transform: scale(0.98);
  }

  /* Responsive grids */
  body.family-safe .alb-ex-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  body.family-safe .alb-quick {
    grid-template-columns: 1fr;
  }

  body.family-safe .vault-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Mobile-friendly buttons */
  body.family-safe .alb-hero-actions {
    flex-direction: column;
  }

  body.family-safe .alb-hero-actions a {
    width: 100%;
    text-align: center;
    padding: 0.8rem 1rem;
  }

  /* Compact code blocks on mobile */
  body.family-safe pre.code,
  body.family-safe pre.code code {
    font-size: 0.82rem;
    padding: 0.75rem;
    margin: 0.5rem 0 1rem;
    overflow-x: auto;
  }

  /* Responsive tables */
  body.family-safe table.doc-table {
    font-size: 0.85rem;
  }

  body.family-safe table.doc-table th,
  body.family-safe table.doc-table td {
    padding: 0.35rem 0.5rem;
  }

  /* Mobile card enhancements */
  body.family-safe .denizencard,
  body.family-safe .panel-stub {
    padding: 1.25rem;
  }

  /* Scrollbar styling for mobile */
  body.family-safe ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  body.family-safe ::-webkit-scrollbar-track {
    background: #f1f5f9;
  }

  body.family-safe ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }

  body.family-safe ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }

  /* Mobile typography optimization */
  body.family-safe h1 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }

  body.family-safe h2 {
    font-size: 1.4rem;
    line-height: 1.4;
    margin-bottom: 0.65rem;
  }

  body.family-safe h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }

  body.family-safe p {
    line-height: 1.7;
    margin-bottom: 1rem;
  }

  body.family-safe li {
    line-height: 1.6;
    margin-bottom: 0.5rem;
  }

  /* Mobile spacing optimization */
  body.family-safe .marquee {
    padding: 0.6rem 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
  }

  body.family-safe .caption {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* Mobile form inputs */
  body.family-safe input,
  body.family-safe textarea,
  body.family-safe select {
    font-size: 16px; /* Prevents iOS zoom */
    padding: 0.75rem;
  }

  /* Mobile button sizing */
  body.family-safe button {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
  }

  /* Mobile-specific card enhancements */
  body.family-safe .denizencard {
    margin-bottom: 1rem;
    border-radius: 12px;
  }

  body.family-safe .alb-ex-card {
    border-radius: 16px;
  }

  /* Mobile input enhancements */
  body.family-safe input[type="text"],
  body.family-safe input[type="email"],
  body.family-safe input[type="password"],
  body.family-safe textarea {
    border-radius: 8px;
    border: 2px solid var(--alb-line);
    transition: border-color 0.2s ease;
  }

  body.family-safe input:focus,
  body.family-safe textarea:focus {
    outline: none;
    border-color: var(--alb-accent);
    box-shadow: 0 0 0 3px rgba(11, 107, 203, 0.1);
  }

  /* Mobile bottom sheet support */
  .mobile-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--alb-panel);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 999;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .mobile-bottom-sheet.active {
    transform: translateY(0);
  }

  .mobile-bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--alb-muted);
    border-radius: 2px;
    margin: 0.5rem auto;
  }

  /* Mobile swipeable cards */
  .mobile-swipeable {
    touch-action: pan-y;
    user-select: none;
  }

}

/* Tablet Styles (640px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  body.family-safe #container {
    width: 95%;
    max-width: 100%;
    margin: 1rem auto 2rem;
  }

  body.family-safe #content {
    padding: 1.5rem 2rem 2rem;
  }

  body.family-safe .alb-ex-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  body.family-safe .alb-quick {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  body.family-safe .vault-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  body.family-safe #container {
    padding-bottom: 0;
  }
}

/* Desktop Enhancements (> 1024px) */
@media (min-width: 1025px) {
  body.family-safe #container {
    width: min(1200px, 92%);
    max-width: 1200px;
    margin: 2rem auto 4rem;
  }

  body.family-safe #content {
    padding: 2rem 2.5rem 3rem;
  }

  body.family-safe #pageTitleH1 {
    font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  }

  /* Enhanced desktop grids with fluid sizing */
  body.family-safe .alb-ex-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  body.family-safe .alb-quick {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
  }

  body.family-safe .vault-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
  }

  /* Desktop hover enhancements */
  body.family-safe .alb-ex-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(16, 42, 67, 0.2);
  }

  /* Fluid desktop typography */
  body.family-safe h1 {
    font-size: clamp(2rem, 3vw, 2.8rem);
  }

  body.family-safe h2 {
    font-size: clamp(1.5rem, 2vw, 1.8rem);
  }

  /* Desktop spacing enhancements */
  body.family-safe .alb-hero-actions {
    gap: 0.75rem;
  }

  body.family-safe .alb-hero-actions a {
    padding: 0.65rem 1.25rem;
  }

  body.family-safe #container {
    padding-bottom: 0;
  }

  /* Desktop-specific enhancements */
  body.family-safe .denizencard:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 42, 67, 0.1);
  }

  body.family-safe .alb-quick a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 42, 67, 0.08);
  }
}

/* Homepage lab-member board — real accounts only */
body.family-safe .labmembercard {
  position: relative;
}

body.family-safe .labmember-rank {
  position: absolute;
  top: 0.7rem;
  right: 0.85rem;
  font: 900 0.85rem/1 var(--alb-mono);
  color: var(--alb-accent-deep);
  background: var(--alb-warm);
  border: 1px solid var(--alb-line);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
}

body.family-safe .labmember-link {
  color: var(--alb-accent-deep);
  text-decoration: none;
}
body.family-safe .labmember-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Friendly design system — clean gamified education look
   Rounded type, chunky pressable buttons, bright palette, light chrome.
   ========================================================================== */

:root {
  --alb-blue: #1cb0f6;
  --alb-blue-dark: #0284c7;
  --alb-sky: #1cb0f6;
  --alb-sky-dark: #1899d6;
  --alb-sun: #ffc800;
  --alb-coral: #ff4b4b;
  --alb-grape: #8540c0;
  --alb-friendly-font: "Baloo 2", "Nunito", "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
}

body.family-safe {
  font-family: var(--alb-friendly-font);
  background:
    radial-gradient(ellipse 90% 45% at 15% -8%, #d8ecff 0%, transparent 55%),
    radial-gradient(ellipse 70% 35% at 100% 0%, #e2f7d3 0%, transparent 50%),
    linear-gradient(180deg, #f0f6fc 0%, #e4edf6 100%) !important;
}

body.family-safe h1,
body.family-safe h2,
body.family-safe h3,
body.family-safe h4,
body.family-safe #pageTitleH1 {
  font-family: var(--alb-friendly-font);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--alb-ink);
}

body.family-safe #pageTitleH1 {
  font-size: 1.9rem;
}

/* ---- chunky pressable buttons (the friendly signature) -------------------- */
body.family-safe .alb-btn-primary,
body.family-safe .alb-btn-ghost,
body.family-safe .ws-btn,
body.family-safe .quiz-nav button,
body.family-safe .quiz-nav .begin,
body.family-safe .skin-sysbtn,
body.family-safe .alb-ex-filter,
body.family-safe .ws-cat,
body.family-safe .ws-sort,
body.family-safe .auth-tabs button {
  font-family: var(--alb-friendly-font);
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 12px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  cursor: pointer;
}

/* primary CTA — bright green with 3D bottom edge */
body.family-safe .alb-btn-primary,
body.family-safe .quiz-nav .begin,
body.family-safe .ws-btn-run,
body.family-safe .auth-box .begin {
  background: var(--alb-blue);
  border: 0;
  border-bottom: 4px solid var(--alb-blue-dark);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
body.family-safe .alb-btn-primary:hover,
body.family-safe .quiz-nav .begin:hover,
body.family-safe .ws-btn-run:hover {
  background: #1cb0f6;
  filter: none;
}
body.family-safe .alb-btn-primary:active,
body.family-safe .quiz-nav .begin:active,
body.family-safe .ws-btn-run:active,
body.family-safe .auth-box .begin:active {
  transform: translateY(3px);
  border-bottom-width: 1px;
}

/* secondary/ghost — white with border */
body.family-safe .alb-btn-ghost,
body.family-safe .ws-btn-src {
  background: var(--alb-panel);
  border: 2px solid var(--alb-line);
  border-bottom-width: 4px;
  color: var(--alb-sky-dark);
}
body.family-safe .alb-btn-ghost:hover,
body.family-safe .ws-btn-src:hover {
  background: var(--alb-warm);
}
body.family-safe .alb-btn-ghost:active,
body.family-safe .ws-btn-src:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
}

/* system buttons in the bar — subtle */
body.family-safe .skin-sysbtn {
  background: rgba(11, 107, 203, 0.08);
  border: 2px solid transparent;
  border-bottom: 3px solid rgba(11, 107, 203, 0.35);
  color: var(--alb-accent);
  font-size: 0.72rem;
  min-height: 0;
  padding: 3px 10px;
}
body.family-safe .skin-sysbtn:active {
  transform: translateY(2px);
  border-bottom-width: 1px;
}

/* ---- the bar: light, friendly, single strip ------------------------------- */
body.family-safe .fcbar {
  background: #ffffff !important;
  background-image: none !important;
  border-top: 2px solid var(--alb-line) !important;
  box-shadow: 0 -4px 14px rgba(15, 27, 45, 0.08);
}
body.family-safe .fcbrand {
  background: transparent !important;
  border-right: 1px solid var(--alb-line);
  color: var(--alb-blue) !important;
  font-weight: 800;
  font-size: 0.85rem !important;
  letter-spacing: 0;
}
body.family-safe .fcbrand:hover {
  color: var(--alb-blue-dark) !important;
}
body.family-safe .fcbar .ftab {
  color: var(--alb-muted) !important;
  font-family: var(--alb-friendly-font);
  font-weight: 700;
  border-radius: 8px;
  margin: 2px 1px;
}
body.family-safe .fcbar .ftab:hover {
  background: var(--alb-warm) !important;
  color: var(--alb-accent) !important;
}
body.family-safe .fcbar .ftab-current {
  background: var(--alb-blue) !important;
  color: #fff !important;
  box-shadow: none;
}

/* ---- marquee: soft pastel banner ------------------------------------------ */
body.family-safe .marquee {
  background: linear-gradient(90deg, #e8f8d9, #e0f2fe) !important;
  border: 1px solid #cfe6b8;
  border-radius: 12px;
  color: #1e3a8a !important;
  font-weight: 700;
}
body.family-safe .marquee p,
body.family-safe .marquee span {
  color: #1e3a8a !important;
}

/* ---- cards get the rounded friendly lift ---------------------------------- */
body.family-safe .ws-card,
body.family-safe .alb-ex-card,
body.family-safe .alb-quick a,
body.family-safe .denizencard,
body.family-safe .thread-row,
body.family-safe .event-card,
body.family-safe details.topic-card,
body.family-safe .arcade-card,
body.family-safe .member-card {
  border-radius: 14px;
  border: 1px solid #e3ebf5;
  box-shadow: 0 2px 6px rgba(15, 27, 45, 0.05);
}
body.family-safe .ws-card:hover,
body.family-safe .alb-ex-card:hover,
body.family-safe .alb-quick a:hover {
  border-color: #b9d8f8;
  box-shadow: 0 8px 20px rgba(15, 27, 45, 0.1);
}

/* links stay friendly blue, rounded focus */
body.family-safe #content a {
  color: var(--alb-sky-dark);
}
body.family-safe a:focus-visible {
  outline: 3px solid rgba(28, 176, 246, 0.4);
  border-radius: 6px;
}

/* ---- sign-in: clean white modal ------------------------------------------- */
body.family-safe .auth-box {
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
}
body.family-safe .auth-box h2 {
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}
body.family-safe .auth-box label {
  text-transform: none;
  font-size: 0.78rem;
  font-weight: 700;
}
body.family-safe .auth-box input,
body.family-safe .auth-box select {
  background: #f7f9fc;
  border: 2px solid #e3ebf5;
  border-radius: 12px;
  font-family: var(--alb-friendly-font);
  font-size: 0.9rem;
  padding: 0.65rem 0.8rem;
}
body.family-safe .auth-box input:focus,
body.family-safe .auth-box select:focus {
  border-color: var(--alb-sky);
  background: #fff;
  outline: 0;
}
body.family-safe .auth-tabs {
  gap: 6px;
}
body.family-safe .auth-tabs button {
  text-transform: none;
  font-size: 0.85rem;
  padding: 0.5rem 1.1rem;
  border: 2px solid #e3ebf5;
}
body.family-safe .auth-tabs button.on {
  background: var(--alb-sky);
  border-color: var(--alb-sky-dark);
  border-bottom-width: 4px;
}
body.family-safe .auth-box .quiz-nav .begin {
  width: 100%;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.7rem;
}
body.family-safe .auth-box .stub-note {
  border-radius: 10px;
  font-size: 0.78rem;
}

/* ---- mobile: bottom-docked bar everywhere, safe-area aware ---------------- */
@media (max-width: 899.98px) {
  body.family-safe .fcbar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    transform: none;
    z-index: 70;
    border-radius: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.family-safe {
    padding-bottom: 48px;
  }
  body.family-safe .fcbrand {
    display: none;
  }
  body.family-safe .fcbar .fcnav {
    width: auto;
    flex-basis: auto;
    border-top: 0;
  }
  body.family-safe .fcbar .fcmain {
    overflow-x: auto;
    scrollbar-width: none;
  }
  body.family-safe .fcbar .fcmain::-webkit-scrollbar {
    display: none;
  }
  body.family-safe .fcbar .fcmain li {
    flex: 0 0 auto;
  }
  body.family-safe .fcbar .ftab {
    font-size: 11px;
    min-height: 40px;
    padding: 0 10px;
  }
}

/* a11y: skip-to-content link — hidden until keyboard focus */
.skipnav{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}
.skipnav:focus{position:static;width:auto;height:auto;padding:8px 14px;background:#1cb0f6;color:#fff;z-index:9999;font-weight:700}
