/* ==========================================================================
   Geometrie & Winkel (lerneule Lernpfad) – Mobile-First (>= 44px)
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

html,
body {
    min-height: 100%;
    max-width: 100%;
    overflow-x: clip;
    font-family: var(--le-font-sans);
    background: var(--le-bg);
    color: var(--le-ink);
    -webkit-tap-highlight-color: transparent;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

.mono {
    font-family: var(--le-font-mono);
    font-variant-numeric: tabular-nums;
}

.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--le-border);
    padding: 8px 12px;
}

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

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

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--le-amber);
}

.brand-title {
    font-size: 1.04rem;
    font-weight: 900;
    line-height: 1.15;
}

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

.progress-pill {
    min-height: 36px;
    padding: 0 11px;
    border-radius: 999px;
    background: var(--le-amber-soft);
    color: #92400e;
    font-size: 0.78rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
}

.path-layout {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 12px 36px;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.card {
    background: var(--le-surface);
    border: 1px solid var(--le-border);
    border-radius: 20px;
    box-shadow: var(--le-shadow-sm);
}

.path-rail {
    position: sticky;
    top: 70px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rail-head h2 {
    font-size: 0.94rem;
    font-weight: 900;
}

.rail-reset-btn {
    min-height: 36px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--le-ink-muted);
}

.rail-bar {
    height: 8px;
    border-radius: 999px;
    background: var(--le-bg-soft);
    overflow: hidden;
}

.rail-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d97706, #16a34a);
    transition: width 0.25s ease;
}

.step-nav-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.step-nav-btn {
    min-height: 44px;
    padding: 6px 10px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    background: var(--le-bg);
    display: flex;
    align-items: center;
    gap: 9px;
    text-align: left;
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--le-ink);
}

.step-nav-btn.is-active {
    background: var(--le-amber-soft);
    border-color: var(--le-amber);
    color: #78350f;
}

.step-nav-btn.is-done .step-dot {
    background: var(--le-green);
    color: #ffffff;
}

.step-dot {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--le-border);
    color: var(--le-ink);
    font-size: 0.76rem;
    font-weight: 900;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.step-nav-btn.is-active .step-dot {
    background: var(--le-amber);
    color: #ffffff;
}

.lesson-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.lesson-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--le-border);
}

.step-tag {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--le-amber-soft);
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.step-tag.test {
    background: var(--le-indigo-soft);
    color: #3730a3;
}

.lesson-title {
    font-size: 1.38rem;
    font-weight: 900;
    line-height: 1.25;
}

.lesson-goal {
    font-size: 0.94rem;
    color: var(--le-ink-muted);
    font-weight: 600;
}

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

.info-block {
    padding: 14px 16px;
    border-radius: 14px;
    border-left: 5px solid var(--le-teal);
    background: var(--le-surface-alt);
    display: flex;
    flex-direction: column;
    gap: 5px;
    line-height: 1.55;
    font-size: 0.96rem;
}

.info-block strong.b-title {
    font-size: 0.92rem;
    font-weight: 900;
    color: #0f766e;
}

.info-block.kind-rule {
    background: #f0fdfa;
    border-left-color: var(--le-teal);
}

.info-block.kind-warning {
    background: #fff1f2;
    border-left-color: var(--le-rose);
}

.info-block.kind-warning strong.b-title {
    color: #9f1239;
}

.info-block.kind-story {
    background: #fffbeb;
    border-left-color: var(--le-amber);
}

.info-block.kind-story strong.b-title {
    color: #92400e;
}

.info-block code {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.08);
    font-family: var(--le-font-mono);
    font-weight: 800;
}

.lab-box {
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1.5px solid var(--le-border-strong);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lab-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lab-badge {
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--le-indigo-soft);
    color: #3730a3;
    font-size: 0.86rem;
    font-weight: 900;
}

.geo-svg {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    height: auto;
    display: block;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--le-border);
}

.thermo-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lab-slider {
    width: 100%;
    accent-color: var(--le-amber);
    min-height: 36px;
    cursor: pointer;
}

.quick-chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.lab-chip {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1.5px solid var(--le-border-strong);
    background: #ffffff;
    font-size: 0.84rem;
    font-weight: 800;
}

.lab-chip.is-on {
    background: var(--le-amber);
    border-color: var(--le-amber);
    color: #ffffff;
}

.equation-banner {
    padding: 12px 14px;
    border-radius: 12px;
    background: #ffffff;
    border: 1.5px solid var(--le-teal);
    font-size: 0.96rem;
    font-weight: 800;
    text-align: center;
}

.lab-caption {
    font-size: 0.86rem;
    color: var(--le-ink-muted);
    font-weight: 700;
}

.check-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
    border-top: 2px dashed var(--le-border);
}

.check-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.check-head h3 {
    font-size: 1.02rem;
    font-weight: 900;
}

.check-counter {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--le-green-soft);
    color: #166534;
    font-size: 0.78rem;
    font-weight: 900;
}

.checks-list,
.test-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.q-card {
    padding: 14px;
    border-radius: 16px;
    border: 1.5px solid var(--le-border);
    background: var(--le-surface-alt);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.q-card.is-right {
    background: #f0fdf4;
    border-color: var(--le-green);
}

.q-card.is-wrong {
    background: #fff1f2;
    border-color: var(--le-rose);
}

.q-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.q-prompt {
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.4;
}

.tip-btn {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid var(--le-border-strong);
    background: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    white-space: nowrap;
}

.q-tip {
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--le-amber-soft);
    color: #78350f;
    font-size: 0.84rem;
    font-weight: 700;
}

.opts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.opt-btn {
    min-height: 46px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1.5px solid var(--le-border-strong);
    background: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

.opt-btn.picked {
    background: var(--le-indigo-soft);
    border-color: var(--le-indigo);
    color: #312e81;
}

.opt-btn.correct {
    background: var(--le-green);
    border-color: var(--le-green);
    color: #ffffff;
}

.opt-btn.wrong {
    background: var(--le-rose);
    border-color: var(--le-rose);
    color: #ffffff;
}

.q-feedback {
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 0.86rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.85);
}

.pre-test-note {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--le-amber-soft);
    color: #78350f;
    font-size: 0.86rem;
    font-weight: 700;
}

.result-box {
    padding: 18px;
    border-radius: 18px;
    border: 2px solid var(--le-teal);
    background: #f0fdfa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-box.fail {
    border-color: var(--le-amber);
    background: #fffbeb;
}

.result-score {
    font-size: 1.25rem;
    font-weight: 900;
}

.review-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.jump-step-btn {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1.5px solid var(--le-amber);
    color: #78350f;
    font-size: 0.82rem;
    font-weight: 800;
}

.lesson-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--le-border);
}

.nav-btn {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 14px;
    font-size: 0.94rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.nav-btn.primary {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.25);
}

.nav-btn.secondary {
    background: var(--le-surface-alt);
    border: 1.5px solid var(--le-border-strong);
    color: var(--le-ink);
}

.nav-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

@media (max-width: 900px) {
    .path-layout {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px 10px 28px;
        gap: 12px;
    }

    .path-rail,
    .stage-col {
        min-width: 0;
        max-width: 100%;
    }

    .path-rail {
        position: static;
    }

    .step-nav-list {
        flex-direction: row;
        overflow-x: auto;
        max-width: 100%;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .step-nav-btn {
        flex-shrink: 0;
    }

    .lesson-card {
        padding: 15px 13px;
    }
}

@media (max-width: 520px) {
    .opts-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
