/*
 * Design tokens follow the shadcn/ui system (zinc neutrals, 1px borders,
 * one radius scale, subtle shadows) with the Pregnancy Gurukul purple as primary.
 */
:root {
    --paper: #fafafa;
    --surface: #ffffff;
    --ink: #09090b;
    --muted: #71717a;
    --line: #18181b;
    --soft-line: #e4e4e7;
    --input: #e4e4e7;
    --secondary: #f4f4f5;
    --accent: #8e44ad;
    --accent-soft: #f6eefa;
    --accent-dark: #6d2f8a;
    --ring: rgba(142, 68, 173, 0.35);
    --good: #16a34a;
    --good-soft: #f0fdf4;
    --bad: #dc2626;
    --bad-soft: #fef2f2;
    --radius: 10px;
    --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lift: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --sidebar-width: 264px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Lato", "Anek Gujarati", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.site-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--soft-line);
    background: var(--surface);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    max-width: 880px;
    margin: 0 auto;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    color: var(--muted);
    font-size: 15px;
}

.brand {
    color: var(--ink);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 0.01em;
    text-decoration: none;
}

.brand span {
    color: var(--accent);
}

.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 40px 20px 140px;
}

/* App shell with side navigation (logged-in members) */

.icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
    background: var(--accent-soft);
    color: var(--accent);
    outline: 0;
}

.icon-button .icon {
    width: 22px;
    height: 22px;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: var(--sidebar-width);
    padding: 22px 16px 16px;
    overflow-y: auto;
    border-right: 1px solid var(--soft-line);
    background: var(--surface);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.sidebar .brand {
    font-size: 21px;
}

.sidebar-close {
    display: none;
}

.sidebar-week {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-soft), #f6eefa);
}

.sidebar-week-label {
    color: var(--accent-dark);
    font-size: 18px;
    font-weight: 900;
}

.sidebar-week-sub {
    color: var(--muted);
    font-size: 13px;
}

.sidebar-week-bar {
    height: 6px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
}

.sidebar-week-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}

.side-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}

.side-heading {
    margin: 18px 12px 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #3f3f46;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.side-link .icon {
    color: var(--muted);
}

.side-link:hover {
    background: var(--paper);
    color: var(--ink);
}

.side-link:focus-visible {
    outline: 3px solid var(--accent-soft);
    outline-offset: 1px;
}

.side-link.active {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.side-link.active .icon {
    color: var(--accent);
}

.side-link.active::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -16px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px 0;
    border-top: 1px solid var(--soft-line);
}

.avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--surface);
    font-weight: 900;
}

.sidebar-user-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.sidebar-user-text strong,
.sidebar-user-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-text strong {
    font-size: 15px;
}

.sidebar-user-text span {
    color: var(--muted);
    font-size: 13px;
}

.app-shell {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.app-topbar {
    display: none;
}

.app-container {
    max-width: 1040px;
    padding: 36px 36px 140px;
}

.has-sidebar .keypad {
    left: var(--sidebar-width);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(28, 27, 26, 0.35);
}

.sidebar-backdrop[hidden] {
    display: none;
}

@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-lift);
    }

    .sidebar-close {
        display: inline-flex;
    }

    .app-shell {
        margin-left: 0;
    }

    .app-topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--soft-line);
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(8px);
    }

    .app-topbar .brand {
        font-size: 20px;
    }

    .app-container {
        padding: 24px 20px 140px;
    }

    .has-sidebar .keypad {
        left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar {
        transition: none;
    }
}

.site-footer {
    padding: 24px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.site-footer p {
    margin: 0 0 6px;
}

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

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

.nav-link {
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.flash {
    margin-bottom: 24px;
    padding: 12px 16px;
    border: 1px solid #bfe3cd;
    border-radius: 12px;
    background: var(--good-soft);
    color: var(--good);
    font-weight: 700;
}

.muted {
    color: var(--muted);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

h1 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.intro {
    margin-bottom: 32px;
}

.intro p {
    margin: 0;
    max-width: 56ch;
    color: var(--muted);
}

.tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Home */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    border: 1px solid var(--soft-line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover,
.card:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lift);
}

.card:focus-visible {
    outline: 3px solid var(--accent-soft);
    outline-offset: 2px;
}

.card h2 {
    margin: 14px 0 6px;
    font-size: 20px;
    line-height: 1.3;
}

.card p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 16px;
    flex: 1;
}

.card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--soft-line);
    font-size: 14px;
    color: var(--muted);
}

.card-foot .play {
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

.coming-soon {
    margin-top: 40px;
}

.coming-soon h2 {
    font-size: 18px;
    margin: 0 0 12px;
}

.coming-soon ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.coming-soon li {
    padding: 6px 12px;
    border: 1px dashed var(--muted);
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
}

/* Activity page */

.back {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 15px;
    text-decoration: none;
}

.back:hover {
    color: var(--accent);
}

.sheet {
    padding: 32px 28px;
    border: 1px solid var(--soft-line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.sheet h1 {
    margin-top: 12px;
}

.instructions {
    margin: 0 0 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--soft-line);
    color: var(--muted);
}

.board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.slot,
.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 24px;
    font-weight: 600;
}

.slot {
    cursor: pointer;
    padding: 0;
}

.slot.active {
    background: var(--accent-soft);
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

.slot.correct,
.slot-input.correct {
    background: var(--good-soft);
    color: var(--good);
}

.slot.wrong,
.slot-input.wrong {
    background: var(--bad-soft);
    color: var(--bad);
}

.cell svg {
    width: 34px;
    height: 34px;
}

/* Symbol matching */

.strip {
    display: grid;
    grid-template-columns: repeat(var(--cols, 5), auto);
}

.strip-small .cell {
    width: 42px;
    height: 42px;
    font-size: 20px;
}

.slot svg {
    width: 34px;
    height: 34px;
}

.strip > * {
    margin: -1px;
}

.strip-key {
    margin-bottom: 8px;
}

.strip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
    justify-items: center;
    gap: 28px 16px;
    width: 100%;
}

/* Comparing numbers */

.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    width: 100%;
    max-width: 560px;
    border: 2px solid var(--line);
}

.compare-row {
    display: grid;
    grid-template-columns: 1fr 56px 1fr;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    font-size: 30px;
    font-weight: 500;
}

.compare-row span:first-child {
    text-align: right;
    padding-right: 14px;
}

.compare-row span:last-child {
    padding-left: 14px;
}

.compare-row .slot {
    border-radius: 50%;
    width: 56px;
    height: 56px;
}

/* Number pyramid */

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    justify-items: center;
    gap: 36px 16px;
    width: 100%;
}

.pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pyramid-row {
    display: flex;
    gap: 6px;
}

.pyramid .cell,
.slot-input {
    width: 64px;
    height: 48px;
    border: 2px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    color: var(--ink);
    background: var(--surface);
}

.slot-input:focus {
    background: var(--accent-soft);
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

/* Result, actions, keypad */

.result {
    margin-top: 24px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--accent-soft);
    font-weight: 600;
    text-align: center;
}

.result.perfect {
    background: var(--good-soft);
    color: var(--good);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn:focus-visible {
    outline: 3px solid var(--accent-soft);
    outline-offset: 2px;
}

.btn-primary,
.btn-primary:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--surface);
}

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

.keypad {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--soft-line);
    background: var(--surface);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.keypad[hidden] {
    display: none;
}

.keypad button {
    flex: 1;
    max-width: 72px;
    height: 56px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
}

.keypad button:active,
.keypad button.selected {
    background: var(--accent-soft);
}

.keypad button.selected {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

.keypad button svg {
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

.btn-small {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 14px;
}

/* Login */

.auth-sheet {
    max-width: 420px;
    margin: 32px auto 0;
    padding: 36px 32px;
}

.auth-sheet .instructions {
    padding-bottom: 0;
    border-bottom: 0;
}

.auth-sheet .btn {
    width: 100%;
    margin-top: 4px;
}

.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.small-link {
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.small-link:hover {
    text-decoration: underline;
}

.auth-switch {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 15px;
    text-align: center;
}

.auth-switch a {
    color: var(--accent);
    font-weight: 700;
}

.auth-sheet h1 {
    margin-top: 0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 15px;
    font-weight: 700;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.field input[aria-invalid="true"] {
    border-color: var(--bad);
}

.field-error {
    margin: 0;
    color: var(--bad);
    font-size: 15px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
}

.check input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 3px 0 0;
    accent-color: var(--accent);
}

.check a {
    color: var(--accent);
}

/* Forms: onboarding, profile, privacy */

.form-sheet {
    max-width: 560px;
    margin: 0 auto;
}

.steps {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.step-dot {
    width: 28px;
    height: 6px;
    border-radius: 999px;
    background: var(--soft-line);
}

.step-dot.active {
    background: var(--accent);
}

.step {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.step[hidden] {
    display: none;
}

.step legend {
    margin-bottom: 18px;
    padding: 0;
    font-size: 20px;
    font-weight: 900;
}

.field .label {
    font-size: 15px;
    font-weight: 700;
}

.optional {
    color: var(--muted);
    font-weight: 400;
}

.field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

#week-preview {
    color: var(--accent);
    font-weight: 700;
}

.field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

.field select:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.choice-row {
    display: flex;
    gap: 10px;
}

.pill-choice input {
    position: absolute;
    opacity: 0;
}

.pill-choice span {
    display: inline-block;
    min-width: 88px;
    padding: 10px 20px;
    border: 1px solid #e4e4e7;
    border-radius: 999px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.pill-choice input:checked + span {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.pill-choice input:focus-visible + span {
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.consents {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.step-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.step-actions {
    margin-top: 8px;
}

.step-actions [hidden] {
    display: none;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 900;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 18px 20px;
}

.form-grid .form-actions {
    grid-column: 1 / -1;
}

.link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border: 1px solid var(--soft-line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
}

.link-card:hover {
    border-color: var(--accent);
}

.link-card-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.link-card-text span {
    color: var(--muted);
    font-size: 15px;
}

.link-card .play {
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

.consent-list {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.consent-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--soft-line);
}

.consent-list li:first-child {
    padding-top: 0;
}

.consent-list p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.status-pill {
    flex-shrink: 0;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--paper);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.switch {
    flex-shrink: 0;
}

.switch input {
    appearance: none;
    position: relative;
    width: 48px;
    height: 28px;
    margin: 0;
    border-radius: 999px;
    background: #e4e4e7;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.switch input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.switch input:checked {
    background: var(--accent);
}

.switch input:checked::after {
    transform: translateX(20px);
}

.switch input:focus-visible {
    box-shadow: 0 0 0 4px var(--accent-soft);
    outline: 0;
}

.danger-zone {
    border-color: #f1cfcb;
}

.danger-zone .section-title {
    color: var(--bad);
}

.btn-danger,
.btn-danger:hover {
    border-color: var(--bad);
    background: var(--bad);
    color: var(--surface);
}

.btn-danger:hover {
    background: #9c2f28;
}

/* Legal pages */

.legal {
    max-width: 720px;
    margin: 0 auto;
}

.legal h2 {
    margin: 28px 0 8px;
    font-size: 19px;
}

.legal p,
.legal li {
    color: #3f3f46;
}

.draft-note {
    margin: 0 0 20px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff4dc;
    color: #8a5a00 !important;
    font-size: 14px;
    font-weight: 700;
}

/* Activities page sections */

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

.activity-group {
    margin-top: 36px;
}

.group-title {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 900;
}

/* Text activities: choice, reveal, build */

.quiz-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 640px;
}

.quiz-item {
    padding: 18px 20px;
    border: 1px solid var(--soft-line);
    border-radius: 14px;
    background: var(--surface);
}

.quiz-item.correct {
    border-color: var(--good);
    background: var(--good-soft);
}

.quiz-item.wrong {
    border-color: var(--bad);
    background: var(--bad-soft);
}

.quiz-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 0 8px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
    font-weight: 900;
}

.quiz-prompt {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.7;
}

.quiz-options,
.reveal-verdict {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
    border-radius: 12px;
}

.quiz-options.correct {
    background: var(--good-soft);
}

.quiz-options.wrong {
    background: var(--bad-soft);
}

.quiz-option {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid #e4e4e7;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 17px;
    cursor: pointer;
}

.quiz-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
}

.quiz-options.correct .quiz-option.selected {
    border-color: var(--good);
    background: var(--good);
    color: var(--surface);
}

.quiz-options.wrong .quiz-option.selected {
    border-color: var(--bad);
    color: var(--bad);
}

.quiz-option.answer {
    border-color: var(--good);
    color: var(--good);
    font-weight: 700;
}

.quiz-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.reveal-answer {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--accent-soft);
    font-size: 18px;
    font-weight: 700;
}

.reveal-label {
    color: var(--accent);
}

.build-label {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

.build-answer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 56px;
    margin-bottom: 12px;
    padding: 6px;
    border: 2px dashed #e4e4e7;
    border-radius: 12px;
}

.build-answer.correct {
    border: 2px solid var(--good);
    background: var(--good-soft);
}

.build-answer.wrong {
    border: 2px solid var(--bad);
    background: var(--bad-soft);
}

.build-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 44px;
}

.build-tile {
    min-width: 44px;
    min-height: 44px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 20px;
    cursor: pointer;
}

.build-answer .build-tile {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* Mini Sudoku and Quick Sums */

.sudoku {
    display: grid;
    grid-template-columns: repeat(var(--size, 6), 52px);
    border: 3px solid var(--line);
}

.sudoku-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border: 1px solid #e4e4e7;
    font-size: 24px;
    font-weight: 700;
}

.sudoku-cell.box-right {
    border-right: 3px solid var(--line);
}

.sudoku-cell.box-bottom {
    border-bottom: 3px solid var(--line);
}

.sudoku-cell.given {
    background: var(--paper);
}

.sudoku .slot-input {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    color: var(--accent);
}

.sums-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 24px;
    width: 100%;
    max-width: 560px;
}

.sum-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
}

@media (max-width: 420px) {
    .sudoku {
        grid-template-columns: repeat(var(--size, 6), 44px);
    }

    .sudoku-cell {
        height: 44px;
    }
}

/* My progress */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    border: 1px solid var(--soft-line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat:first-child {
    border: 0;
    background: linear-gradient(135deg, var(--accent-soft), #f6eefa);
}

.stat-value {
    color: var(--accent-dark);
    font-size: 36px;
    font-weight: 900;
    line-height: 1.1;
}

.stat-label {
    margin-top: 4px;
    font-weight: 700;
}

.stat-hint {
    color: var(--muted);
    font-size: 14px;
}

.progress-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 20px;
    align-items: start;
}

.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.calendar-head .section-title {
    margin: 0;
}

.calendar-nav {
    display: flex;
    gap: 4px;
}

.calendar-nav .icon-button {
    font-size: 26px;
    line-height: 1;
    text-decoration: none;
}

.calendar {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    table-layout: fixed;
}

.calendar th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.calendar td {
    text-align: center;
}

.calendar-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 40px;
    aspect-ratio: 1;
    border-radius: 10px;
    background: var(--paper);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.calendar-day.is-future {
    background: transparent;
    color: #a1a1aa;
}

.calendar-day.level-1 {
    background: #ead9f2;
    color: var(--accent-dark);
}

.calendar-day.level-2 {
    background: #c08fd6;
    color: var(--surface);
}

.calendar-day.level-3 {
    background: var(--accent);
    color: var(--surface);
}

.calendar-day.is-today {
    box-shadow: 0 0 0 2px var(--ink);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.calendar-legend .calendar-day {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.skill-row {
    margin-bottom: 16px;
}

.skill-row-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-weight: 700;
}

.skill-row-head .muted {
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.skill-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--paper);
}

.skill-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}

.progress-table-sheet {
    margin-top: 20px;
}

.table-wrap {
    overflow-x: auto;
}

.progress-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.progress-table th {
    padding: 8px 10px;
    border-bottom: 1px solid var(--soft-line);
    color: var(--muted);
    font-size: 13px;
    text-align: left;
}

.progress-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--soft-line);
}

.progress-table tr:last-child td {
    border-bottom: 0;
}

/* Journal */

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.prompt-card {
    margin-bottom: 24px;
}

.prompt-meta {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 14px;
}

.prompt-title {
    margin: 0 0 14px;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.3;
}

.prompt-body {
    padding: 16px 18px;
    border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--accent-soft);
}

.prompt-body p {
    margin: 0 0 6px;
    line-height: 1.7;
}

.prompt-body p:last-child {
    margin-bottom: 0;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.field textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    line-height: 1.7;
    resize: vertical;
}

.field textarea:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.journal-entry {
    margin-bottom: 12px;
}

.empty-state {
    padding: 28px;
    border: 1px dashed #e4e4e7;
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
}

.empty-state p {
    margin: 0;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    color: var(--muted);
}

.pagination a {
    color: var(--accent);
    font-weight: 700;
}

.delete-entry {
    margin-top: 20px;
    text-align: right;
}

.danger-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--bad);
    cursor: pointer;
}

/* Printables */

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.printable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.printable {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--soft-line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.printable img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    background: #fff;
    border-bottom: 1px solid var(--soft-line);
}

.printable-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
    padding: 14px;
}

.printable-body strong {
    font-size: 15px;
    line-height: 1.4;
}

.printable-body .btn {
    margin-top: auto;
}

/* About and founders */

.about-hero {
    max-width: 760px;
    padding: 8px 0 32px;
}

.about-hero h1 {
    margin: 16px 0;
    font-size: 40px;
    line-height: 1.15;
}

.about-text {
    max-width: 72ch;
}

.about-text p {
    margin: 0 0 14px;
    color: #3f3f46;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 20px;
}

.impact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-soft), #f6eefa);
}

.impact strong {
    color: var(--accent-dark);
    font-size: 34px;
    font-weight: 900;
    line-height: 1.1;
}

.impact span {
    color: var(--muted);
    font-size: 15px;
}

.impact-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.founder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
    gap: 20px;
}

.founder {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--soft-line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.founder-initials {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--surface);
    font-size: 22px;
    font-weight: 900;
}

.founder h3 {
    margin: 0;
    font-size: 20px;
}

.founder-role {
    margin: 4px 0 10px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
}

.founder p:last-child {
    margin: 0;
    color: var(--muted);
}

.landing-more {
    margin: 16px 0 0;
}

.landing-more a {
    color: var(--accent);
    font-weight: 700;
}

@media (max-width: 520px) {
    .founder {
        flex-direction: column;
    }

    .about-hero h1 {
        font-size: 32px;
    }
}

/* Landing page */

.container-wide {
    max-width: 1080px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 17px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 48px;
    padding: 16px 0 40px;
}

.hero h1 {
    margin: 16px 0 16px;
    font-size: 44px;
    line-height: 1.12;
}

.hero-lead {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 19px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.preview-card {
    padding: 20px;
    border: 1px solid var(--soft-line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lift);
}

.preview-card .week-card {
    margin-bottom: 20px;
}

.preview-heading {
    margin: 0 0 8px;
    font-weight: 900;
}

.preview-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.preview-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--soft-line);
}

.preview-text {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.preview-text span {
    color: var(--muted);
    font-size: 14px;
}

.preview-list .play {
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
}

.landing-section {
    padding: 48px 0 8px;
}

.landing-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.2;
}

.landing-lead {
    max-width: 60ch;
    margin: 0 0 24px;
    color: var(--muted);
}

.steps-grid,
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 20px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.steps-grid li,
.feature {
    padding: 24px;
    border: 1px solid var(--soft-line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.steps-grid h3,
.feature h3 {
    margin: 12px 0 6px;
    font-size: 19px;
}

.feature h3 {
    margin-top: 0;
}

.steps-grid p,
.feature p {
    margin: 0;
    color: var(--muted);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.skill-chips li {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
}

.skill-chips.soon li {
    border: 1px dashed #e4e4e7;
    background: transparent;
    color: var(--muted);
}

.faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.faq details {
    padding: 16px 20px;
    border: 1px solid var(--soft-line);
    border-radius: 14px;
    background: var(--surface);
}

.faq summary {
    font-weight: 700;
    cursor: pointer;
}

.faq details p {
    margin: 10px 0 0;
    color: var(--muted);
}

.faq a {
    color: var(--accent);
}

.cta-band {
    margin-top: 56px;
    padding: 40px 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--accent-soft), #f6eefa);
    text-align: center;
}

.cta-band h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 900;
}

.cta-band p {
    margin: 0 0 24px;
    color: var(--muted);
}

@media (max-width: 820px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero h1 {
        font-size: 34px;
    }
}

/* Home: pregnancy week */

.week-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    margin-bottom: 32px;
    padding: 22px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-soft), #f6eefa);
}

.week-label {
    margin: 0;
    color: var(--accent-dark);
    font-size: 22px;
    font-weight: 900;
}

.week-sub {
    margin: 2px 0 0;
    color: var(--muted);
}

.week-progress {
    flex: 1;
    min-width: 200px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.week-progress span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
}

/* Number–Symbol Coding */

.code-key {
    display: flex;
    gap: 10px;
}

.code-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols, 6), auto);
    gap: 4px;
}

.code-cell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid transparent;
    background-color: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 24px;
    font-weight: 500;
}

button.code-cell {
    cursor: pointer;
}

.mark-square {
    border-color: currentColor;
}

.mark-circle {
    border-color: currentColor;
    border-radius: 50%;
}

.mark-underline {
    border-bottom-color: currentColor;
}

.mark-cross {
    background-image: linear-gradient(to top right, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%);
}

.mark-dot::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    background: currentColor;
}

.code-cell.wrong {
    background-color: var(--bad-soft);
    color: var(--bad);
}

.code-cell.correct[class*="mark-"] {
    color: var(--good);
}

.keypad .code-cell {
    width: 36px;
    height: 36px;
    font-size: 20px;
}

/* Abacus */

.abacus {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.abacus-rods,
.abacus-number {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    justify-items: center;
}

.abacus-rods {
    padding-bottom: 4px;
    border-bottom: 3px solid var(--line);
}

.abacus-number {
    font-size: 32px;
    font-weight: 700;
}

.rod {
    display: flex;
    flex-direction: column;
    padding: 4px;
    border-radius: 8px;
}

.bead {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
}

.bead.filled {
    background: var(--ink);
}

.rod.correct {
    background: var(--good-soft);
}

.rod.correct .bead.filled {
    background: var(--good);
    border-color: var(--good);
}

.rod.wrong {
    background: var(--bad-soft);
}

.rod.wrong .bead {
    border-color: var(--bad);
}

.rod.wrong .bead.filled {
    background: var(--bad);
}

/* Shape Counting */

.count-picture {
    width: 100%;
    max-width: 440px;
    border: 2px solid var(--line);
}

.count-picture svg {
    display: block;
    fill: none;
    stroke: var(--ink);
    stroke-width: 2.5;
    stroke-linejoin: round;
}

.count-answers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.count-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.count-item .cell {
    border: 0;
}

/* Finding and Matching */

.match-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.match-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.match-letter {
    width: 24px;
    font-size: 22px;
    font-weight: 700;
}

.match-gap {
    width: 28px;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 24px);
    grid-template-rows: repeat(3, 24px);
    border: 1px solid var(--line);
}

.mini-grid i {
    border: 1px solid var(--line);
    background: var(--surface);
}

.mini-grid i.on {
    background: var(--ink);
}

/* Pattern Logic Puzzle */

.matrix-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.matrix {
    display: grid;
    grid-template-columns: repeat(3, 76px);
    grid-template-rows: repeat(3, 76px);
    border: 1px solid var(--line);
}

.matrix > div {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
}

.figure {
    width: 52px;
    height: 52px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.question-mark {
    font-size: 34px;
    font-weight: 700;
    color: var(--accent);
}

.choices {
    display: flex;
    gap: 8px;
    padding: 6px;
    border-radius: 12px;
}

.choice {
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid var(--soft-line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.choice .figure {
    width: 42px;
    height: 42px;
    vertical-align: middle;
}

.choice.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.choices.correct .choice.selected {
    border-color: var(--good);
    background: var(--good-soft);
    color: var(--good);
}

.choices.wrong {
    background: var(--bad-soft);
}

.choices.wrong .choice.selected {
    border-color: var(--bad);
    color: var(--bad);
}

/* Pattern Copy & Continuation */

.sequence-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sequence {
    display: flex;
}

.sequence .cell,
.sequence .slot {
    width: 28px;
    height: 40px;
    border-width: 0 0 2px;
}

.sequence .slot {
    width: 32px;
    margin-left: 4px;
    border: 2px dashed var(--muted);
}

.sequence svg {
    width: 26px;
    height: 26px;
}

/* Dot activities */

.dot-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
}

.dot-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 28px;
}

.dot-model {
    width: 150px;
}

.dot-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dot-work {
    width: 240px;
    border: 2px solid var(--soft-line);
    border-radius: 12px;
    touch-action: manipulation;
}

.dot-model svg,
.dot-work svg {
    display: block;
}

.dot-work.correct {
    border-color: var(--good);
    background: var(--good-soft);
}

.dot-work.wrong {
    border-color: var(--bad);
    background: var(--bad-soft);
}

.dot {
    fill: var(--ink);
}

.dot.selected {
    fill: var(--accent);
    stroke: var(--accent);
    stroke-width: 3;
}

.hit {
    fill: transparent;
    cursor: pointer;
}

.segment {
    stroke: var(--ink);
    stroke-width: 2.2;
    stroke-linecap: round;
}

.guide {
    stroke: var(--muted);
    stroke-width: 0.5;
    stroke-dasharray: 1.5 1.5;
}

/* Figure and Number Hunt */

.hunt {
    width: 100%;
    max-width: 300px;
    border: 2px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.hunt-picture svg {
    display: block;
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.6;
    font-family: Arial, Helvetica, sans-serif;
}

.hunt-digits {
    display: flex;
    border-top: 2px solid var(--line);
}

.hunt-digits button {
    flex: 1;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 20px;
    cursor: pointer;
}

.hunt-digits button.selected {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    box-shadow: inset 0 0 0 2px var(--accent);
    border-radius: 50%;
}

.hunt-digits.correct {
    background: var(--good-soft);
}

.hunt-digits.wrong {
    background: var(--bad-soft);
}

/* Two-Hand Coordination */

.hand-status {
    font-weight: 700;
}

.pips {
    display: flex;
    gap: 6px;
}

.pip {
    width: 14px;
    height: 14px;
    border: 2px solid var(--line);
    border-radius: 50%;
}

.pip.played {
    background: var(--ink);
}

.pip.correct {
    background: var(--good);
    border-color: var(--good);
}

.pip.wrong {
    background: var(--bad);
    border-color: var(--bad);
}

.hands {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 420px;
}

.hand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hand-label {
    color: var(--muted);
    font-size: 14px;
}

.pad {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    touch-action: none;
}

.pad.lit {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 6px var(--accent-soft);
}

.pad.hit {
    background: var(--good);
    border-color: var(--good);
}

.pad.miss {
    background: var(--bad-soft);
    border-color: var(--bad);
}

/* Small phones */

@media (max-width: 420px) {
    .slot,
    .cell {
        width: 44px;
        height: 44px;
        font-size: 21px;
    }

    .strip-small .cell {
        width: 38px;
        height: 38px;
    }

    .match-gap {
        width: 12px;
    }

    .container {
        padding: 24px 16px 140px;
    }

    .sheet {
        padding: 24px 16px;
    }

    .auth-sheet {
        margin-top: 8px;
        padding: 28px 20px;
    }

    h1 {
        font-size: 26px;
    }
}

/* Icons (Heroicons) used across the site */

.btn,
.with-icon,
.back,
.play,
.card-stat,
.quiz-option,
.status-pill,
.skill-chips li {
    display: inline-flex;
    align-items: center;
}

.btn {
    justify-content: center;
    gap: 8px;
}

.btn .icon,
.with-icon .icon,
.back .icon,
.quiz-option .icon {
    width: 18px;
    height: 18px;
}

.with-icon,
.back,
.quiz-option {
    gap: 6px;
}

.play {
    gap: 4px;
}

.play .icon,
.card-stat .icon,
.skill-chips li .icon,
.nav-link.with-icon .icon,
.eyebrow .icon {
    width: 16px;
    height: 16px;
}

.play .icon {
    transition: transform 0.15s ease;
}

.card:hover .play .icon,
.link-card:hover .play .icon {
    transform: translateX(3px);
}

.tag.with-icon,
.status-pill {
    gap: 4px;
}

.tag.with-icon .icon,
.status-pill .icon {
    width: 14px;
    height: 14px;
}

.icon-tile {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}

.icon-tile .icon {
    width: 22px;
    height: 22px;
}

.icon-tile-lg {
    width: 56px;
    height: 56px;
    border-radius: 16px;
}

.icon-tile-lg .icon {
    width: 28px;
    height: 28px;
}

.icon-tile-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.icon-tile-sm .icon {
    width: 18px;
    height: 18px;
}

.icon-tile-light {
    background: rgba(255, 255, 255, 0.85);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.card-stat {
    gap: 6px;
}

.group-title,
.section-title,
.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eyebrow {
    gap: 6px;
}

.group-title .icon,
.section-title .icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.danger-zone .section-title .icon {
    color: var(--bad);
}

.intro-with-icon,
.sheet-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sheet-head {
    margin-bottom: 8px;
}

.sheet-head h1,
.intro-with-icon h1 {
    margin: 6px 0 0;
}

.intro-with-icon p {
    margin: 4px 0 0;
}

.instructions .inline-icon {
    width: 18px;
    height: 18px;
    margin-right: 2px;
    color: var(--accent);
    vertical-align: -3px;
}

.week-card-text {
    flex: 0 1 auto;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
}

.stat-icon .icon {
    width: 22px;
    height: 22px;
}

.stat:first-child .stat-icon {
    background: rgba(255, 255, 255, 0.85);
    color: #d35400;
}

.impact-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
    color: var(--accent);
}

.empty-icon {
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    color: #a1a1aa;
}

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash .icon {
    width: 22px;
    height: 22px;
}

.skill-chips li {
    gap: 6px;
}

.feature .icon-tile,
.steps-grid li .icon-tile {
    margin-bottom: 14px;
}

.steps-grid h3 {
    margin-top: 0;
}

.printable-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.printable-actions .btn {
    flex: 1;
    margin-top: 0;
    padding-right: 10px;
    padding-left: 10px;
}

.hero-note.with-icon {
    display: flex;
}

.calendar-nav .icon-button .icon {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   shadcn/ui-style component layer
   Buttons, badges, cards, inputs, sidebar, tabs, alerts and quiz controls.
   Kept last so it refines the earlier, page-specific rules.
   ========================================================================== */

body {
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
}

h1 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.intro {
    margin-bottom: 28px;
}

.intro p,
.landing-lead,
.hero-lead {
    color: var(--muted);
}

/* Icons: Lucide, 2px stroke, sized like shadcn (16–18px) */

.icon {
    width: 18px;
    height: 18px;
}

.btn .icon,
.quiz-option .icon {
    width: 16px;
    height: 16px;
}

/* Buttons: default (primary), outline, destructive, sizes sm / lg */

.btn {
    height: 40px;
    padding: 0 16px;
    gap: 8px;
    border: 1px solid var(--input);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--input);
    background: var(--secondary);
    color: var(--ink);
}

.btn:focus-visible,
.icon-button:focus-visible,
.quiz-option:focus-visible,
.side-link:focus-visible,
.nav-link:focus-visible,
.card:focus-visible,
.link-card:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring);
}

.btn-primary,
.btn-primary:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

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

.btn-danger,
.btn-danger:hover {
    border-color: var(--bad);
    background: var(--bad);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-small {
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 14px;
}

.btn-large {
    height: 44px;
    padding: 0 24px;
    font-size: 16px;
}

.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.icon-button:hover {
    background: var(--secondary);
    color: var(--ink);
}

.icon-button .icon {
    width: 18px;
    height: 18px;
}

/* Badges */

.tag,
.status-pill {
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.status-pill {
    border-color: var(--soft-line);
    background: var(--surface);
    color: var(--muted);
}

/* Cards */

.card,
.sheet,
.link-card,
.stat,
.feature,
.steps-grid li,
.quiz-item,
.printable,
.faq details,
.founder,
.preview-card {
    border: 1px solid var(--soft-line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card {
    padding: 20px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus-visible {
    transform: none;
    border-color: #d4d4d8;
    box-shadow: var(--shadow-lift);
}

.card h2 {
    margin: 14px 0 4px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card p {
    font-size: 15px;
}

.card-foot {
    border-top-color: var(--soft-line);
    font-size: 13px;
}

.sheet {
    padding: 28px;
}

.link-card {
    padding: 16px 18px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.link-card:hover {
    border-color: #d4d4d8;
    box-shadow: var(--shadow-lift);
}

.link-card-text strong {
    font-size: 15px;
}

.link-card-text span {
    font-size: 14px;
}

.section-title,
.group-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.group-title .icon,
.section-title .icon {
    width: 20px;
    height: 20px;
}

.icon-tile {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.icon-tile .icon {
    width: 20px;
    height: 20px;
}

.icon-tile-lg {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.icon-tile-lg .icon {
    width: 24px;
    height: 24px;
}

.icon-tile-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.icon-tile-sm .icon {
    width: 16px;
    height: 16px;
}

/* Inputs */

.field label,
.field .label {
    font-size: 14px;
    font-weight: 700;
}

.field input,
.field select {
    height: 40px;
    padding: 0 12px;
}

.field input,
.field select,
.field textarea {
    border: 1px solid var(--input);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 15px;
}

.field textarea {
    padding: 10px 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    outline: 0;
    box-shadow: 0 0 0 3px var(--ring);
}

.field input[aria-invalid="true"] {
    border-color: var(--bad);
}

.field-hint,
.field-error {
    font-size: 13px;
}

.pill-choice span {
    min-width: 80px;
    padding: 8px 16px;
    border: 1px solid var(--input);
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 15px;
}

/* Alerts */

.flash {
    padding: 12px 16px;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: var(--good-soft);
    color: #166534;
    font-size: 15px;
}

.result {
    border: 1px solid var(--soft-line);
    border-radius: 10px;
    background: var(--secondary);
    color: var(--ink);
}

.result.perfect {
    border-color: #bbf7d0;
    background: var(--good-soft);
    color: #166534;
}

.draft-note {
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
}

/* Side navigation (shadcn sidebar) */

.sidebar {
    gap: 16px;
    padding: 16px 12px 12px;
    border-right: 1px solid var(--soft-line);
    background: var(--paper);
}

.sidebar .brand {
    font-size: 19px;
}

.side-nav {
    gap: 2px;
}

.side-heading {
    margin: 16px 10px 4px;
    font-size: 11px;
    letter-spacing: 0.06em;
}

.side-link {
    height: 36px;
    padding: 0 10px;
    gap: 10px;
    border-radius: 8px;
    color: #3f3f46;
    font-size: 15px;
    font-weight: 400;
}

.side-link .icon {
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.side-link:hover {
    background: var(--secondary);
    color: var(--ink);
}

.side-link.active {
    background: var(--surface);
    box-shadow: var(--shadow), 0 0 0 1px var(--soft-line);
    color: var(--ink);
    font-weight: 700;
}

.side-link.active .icon {
    color: var(--accent);
}

.side-link.active::before {
    display: none;
}

.sidebar-week {
    padding: 12px 14px;
    border: 1px solid #ead9f2;
    border-radius: 10px;
    background: var(--accent-soft);
}

.sidebar-week-label {
    font-size: 16px;
    font-weight: 700;
}

.sidebar-user {
    padding: 10px 6px 0;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 14px;
}

.app-topbar,
.site-header {
    background: rgba(255, 255, 255, 0.9);
}

/* Tabs (category filters) */

.category-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    border-radius: 10px;
    background: var(--secondary);
}

.category-tabs .nav-link {
    padding: 6px 12px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 14px;
}

.category-tabs .nav-link:hover {
    background: transparent;
    color: var(--ink);
}

.category-tabs .nav-link.active {
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.nav-link:hover,
.nav-link.active {
    background: var(--secondary);
    color: var(--ink);
}

/* Stats and progress */

.stat {
    padding: 18px 20px;
}

.stat:first-child {
    border: 1px solid #ead9f2;
    background: var(--accent-soft);
}

.stat-value {
    color: var(--ink);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 14px;
}

.stat-hint {
    font-size: 13px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.stat-icon .icon {
    width: 18px;
    height: 18px;
}

.week-card {
    padding: 18px 20px;
    border: 1px solid #ead9f2;
    border-radius: 12px;
    background: var(--accent-soft);
}

.week-label {
    font-size: 18px;
    font-weight: 700;
}

.calendar-day {
    border-radius: 6px;
}

.skill-bar,
.week-progress,
.sidebar-week-bar {
    background: rgba(9, 9, 11, 0.06);
}

/* Quiz controls */

.quiz-option {
    min-height: 40px;
    padding: 0 14px;
    gap: 6px;
    border: 1px solid var(--input);
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 16px;
}

.quiz-option:hover {
    background: var(--secondary);
}

.quiz-option.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.build-tile,
.keypad button {
    border: 1px solid var(--input);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.build-answer {
    border: 1px dashed #d4d4d8;
    border-radius: 10px;
}

/* Misc */

.skill-chips li {
    padding: 6px 12px;
    border: 1px solid var(--soft-line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
}

.skill-chips li .icon {
    color: var(--accent);
}

.skill-chips.soon li {
    border-style: dashed;
    border-color: #d4d4d8;
    color: var(--muted);
}

.empty-state {
    border: 1px dashed #d4d4d8;
    border-radius: 12px;
    background: var(--surface);
}

.prompt-body {
    border-left-width: 3px;
    border-radius: 0 10px 10px 0;
}

.cta-band,
.impact {
    border: 1px solid #ead9f2;
    background: var(--accent-soft);
}

.impact strong {
    color: var(--ink);
    font-weight: 700;
}

.site-footer {
    border-top: 1px solid var(--soft-line);
    font-size: 13px;
}

/* Large footer on public pages */

.lp-footer {
    margin-top: 0;
    background: #1f1326;
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
}

.lp-footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: 40px;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0 44px;
}

.lp-footer .brand {
    color: #fff;
    font-size: 24px;
}

.lp-footer .brand span {
    color: #d7a9ec;
}

.lp-footer-tagline {
    margin: 8px 0 14px;
    color: #f3d9a4;
    font-weight: 700;
}

.lp-footer-brand p {
    max-width: 40ch;
    margin: 0 0 20px;
    line-height: 1.65;
}

.btn.lp-footer-cta {
    border-color: #8e44ad;
    background: #8e44ad;
    box-shadow: none;
    color: #fff;
}

.btn.lp-footer-cta:hover {
    border-color: #a45cc4;
    background: #a45cc4;
    color: #fff;
}

.lp-footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lp-footer-col h2 {
    margin: 4px 0 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lp-footer-col a,
.lp-footer-col span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.lp-footer-col a:hover {
    color: #fff;
    transform: translateX(3px);
}

.lp-footer-col .icon {
    width: 16px;
    height: 16px;
    color: #d7a9ec;
}

.lp-footer-note {
    display: flex;
    gap: 8px;
    margin: 10px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.lp-footer-note .icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.lp-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px;
}

.lp-footer-bottom a {
    color: rgba(255, 255, 255, 0.85);
}

.lp-footer a:focus-visible {
    outline: 2px solid #d7a9ec;
    outline-offset: 3px;
    border-radius: 4px;
}

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

    .lp-footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .lp-footer-inner {
        grid-template-columns: 1fr;
        padding-top: 48px;
    }
}

/* ==========================================================================
   Activities added from the activity book: number games, word games, calm
   ========================================================================== */

/* Maths crossword */

.mathgrid {
    display: grid;
    grid-template-columns: repeat(5, 52px);
    grid-template-rows: repeat(5, 52px);
    gap: 4px;
}

.mg-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 900;
}

.mg-number,
.mg-input {
    border: 2px solid var(--line);
    background: #fff;
}

.mg-op {
    color: var(--accent);
}

.mg-block {
    background: transparent;
}

.mg-input .slot-input,
.magic-cell .slot-input,
.sg-cell .slot-input,
.bond-part .slot-input,
.chain-node .slot-input {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 22px;
}

/* Magic square */

.magic-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.magic-total {
    margin: 0;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 900;
}

.magic {
    display: grid;
    grid-template-columns: repeat(3, 64px);
    grid-template-rows: repeat(3, 64px);
    border: 3px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.magic-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d4d4d8;
    background: #fff;
    font-size: 26px;
    font-weight: 900;
}

.magic-cell.given {
    background: #fafafa;
}

/* Sum grid */

.sumgrid {
    display: grid;
    grid-template-columns: repeat(4, 56px);
    grid-template-rows: repeat(4, 56px);
    gap: 4px;
}

.sg-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 21px;
    font-weight: 900;
}

.sg-total {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.sg-corner {
    border: 0;
    background: transparent;
}

/* Shape sums and dice */

.shape-key {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #f0e4f5;
    border-radius: 16px;
    background: var(--accent-soft);
}

.shape-key-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 20px;
}

.shape-icon svg {
    display: block;
    width: 38px;
    height: 38px;
}

.shape-icon-lg svg {
    width: 56px;
    height: 56px;
}

.shape-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 560px;
}

.shape-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #f0e4f5;
    border-radius: 14px;
    background: #fff;
}

.shape-op {
    color: var(--muted);
    font-size: 22px;
    font-weight: 900;
}

.shape-row .slot-input {
    width: 64px;
    margin-left: auto;
}

.die {
    display: block;
    width: 44px;
    height: 44px;
    color: var(--ink);
}

/* Number chain */

.chain-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.chain {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.chain-node {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 52px;
    height: 52px;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: #fff;
    font-size: 20px;
    font-weight: 900;
}

.chain-start {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.chain-jump {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--secondary);
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 900;
}

/* Number bonds */

.bond-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    width: 100%;
}

.bond {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid #f0e4f5;
    border-radius: 18px;
    background: #fff;
}

.bond-total,
.bond-part {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 54px;
    height: 54px;
    border: 2px solid var(--line);
    border-radius: 50%;
    font-size: 22px;
    font-weight: 900;
}

.bond-total {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.bond-parts {
    display: flex;
    gap: 14px;
}

/* Find the pairs and word search grids */

.pairs-target {
    margin: 0;
    padding: 6px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.pairs-grid {
    display: grid;
    grid-template-columns: repeat(var(--size, 6), 48px);
    gap: 6px;
}

.pairs-cell {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid #e4e4e7;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 21px;
    font-weight: 900;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.pairs-cell:hover {
    border-color: var(--accent);
}

.pairs-cell.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: scale(1.06);
}

.pairs-cell.found {
    border-color: var(--good);
    background: var(--good-soft);
    color: var(--good);
}

.pairs-cell.missed {
    border-color: #f2b134;
    background: #fff7e0;
}

.pairs-cell.miss,
.spot-hit.miss {
    animation: lp-shake 0.4s ease;
}

.ws-grid .pairs-cell {
    font-size: 19px;
    font-weight: 700;
}

.ws-words {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.ws-word {
    padding: 6px 14px;
    border: 1px solid #e4e4e7;
    border-radius: 999px;
    background: #fff;
    font-size: 18px;
    font-weight: 700;
}

.ws-word.found {
    border-color: var(--good);
    background: var(--good-soft);
    color: var(--good);
    text-decoration: line-through;
}

/* Riddle crossword */

.cw-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), 52px);
    grid-template-rows: repeat(var(--rows), 52px);
    gap: 3px;
}

.cw-cell {
    position: relative;
}

.cw-cell .slot {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    font-size: 20px;
}

.cw-number {
    position: absolute;
    top: 2px;
    left: 4px;
    z-index: 1;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    pointer-events: none;
}

.cw-clues {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 640px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cw-clue {
    padding: 12px 16px;
    border: 1px solid #f0e4f5;
    border-radius: 14px;
    background: #fff;
}

.cw-clue strong {
    color: var(--accent);
    font-size: 13px;
}

.cw-clue p {
    margin: 4px 0 0;
    line-height: 1.7;
}

.keypad.keypad-wrap {
    flex-wrap: wrap;
    max-height: 40vh;
    overflow-y: auto;
}

.keypad.keypad-wrap button {
    flex: 0 0 auto;
    min-width: 52px;
    max-width: none;
    padding: 0 10px;
    font-size: 20px;
}

/* Shape mark pattern */

.shape-mark-cell {
    width: 56px;
    height: 56px;
    padding: 4px;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.shape-mark-cell svg {
    width: 100%;
    height: 100%;
}

.shape-mark-cell.correct {
    background: var(--good-soft);
    color: var(--good);
}

.shape-mark-cell.wrong {
    background: var(--bad-soft);
    color: var(--bad);
}

/* Mandala colouring */

.mandala-frame {
    width: min(100%, 460px);
    padding: 10px;
    border: 1px solid #f0e4f5;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.mandala {
    display: block;
    width: 100%;
    height: auto;
}

.mandala > * {
    cursor: pointer;
    transition: fill 0.25s ease;
}

.mandala > *:hover {
    opacity: 0.85;
}

.swatch {
    flex: 0 0 auto !important;
    width: 44px;
    max-width: 44px !important;
    height: 44px !important;
    border: 2px solid #e4e4e7 !important;
    border-radius: 50% !important;
    background: var(--swatch) !important;
}

.swatch.selected {
    outline: 3px solid var(--accent) !important;
    outline-offset: 2px;
}

/* Spot the difference */

.spot-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    width: 100%;
}

.spot-picture {
    overflow: hidden;
    border: 2px solid var(--line);
    border-radius: 16px;
    background: #fffaf5;
}

.spot-picture svg {
    display: block;
    width: 100%;
    height: auto;
}

.spot-hit {
    fill: transparent;
    cursor: pointer;
}

.spot-found,
.spot-missed {
    fill: none;
    stroke-width: 3.5;
    pointer-events: none;
}

.spot-found {
    stroke: var(--good);
}

.spot-missed {
    stroke: #f2b134;
    stroke-dasharray: 6 4;
}

/* Calm maze */

.maze-frame {
    width: min(100%, 420px);
    padding: 10px;
    border: 1px solid #f0e4f5;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--shadow);
}

.maze {
    display: block;
    width: 100%;
    height: auto;
    touch-action: manipulation;
}

.maze-walls {
    fill: none;
    stroke: var(--ink);
    stroke-width: 3;
    stroke-linecap: round;
}

.maze-trail {
    fill: none;
    stroke: var(--accent);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.35;
}

.maze-player {
    fill: var(--accent);
    transition: cx 0.15s ease, cy 0.15s ease;
}

.maze-done {
    border-color: var(--good);
    background: var(--good-soft);
}

@keyframes lp-shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

@media (max-width: 520px) {
    .mathgrid {
        grid-template-columns: repeat(5, 44px);
        grid-template-rows: repeat(5, 44px);
    }

    .pairs-grid {
        grid-template-columns: repeat(var(--size, 6), 42px);
    }

    .pairs-cell {
        width: 42px;
        height: 42px;
    }

    .cw-grid {
        grid-template-columns: repeat(var(--cols), 40px);
        grid-template-rows: repeat(var(--rows), 40px);
    }

    .cw-cell .slot {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .spot-pair {
        grid-template-columns: 1fr;
    }

    .chain-node {
        width: 46px;
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pairs-cell.miss,
    .spot-hit.miss {
        animation: none;
    }

    .maze-player {
        transition: none;
    }
}
