* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: #111;
    background: #fff;
}

/* ---------- Login ---------- */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f2f2f0;
}
.login-box {
    background: #fff;
    padding: 48px 40px;
    width: 360px;
    border: 1px solid #e0e0dd;
}
.login-box h1 {
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 24px;
}
.login-box input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 14px;
    border: 1px solid #ccc;
    font-size: 14px;
}
.login-box button {
    width: 100%;
    padding: 11px;
    background: #111;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.login-error {
    color: #b3261e;
    font-size: 13px;
    margin-bottom: 14px;
}

/* ---------- App shell ---------- */
.shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #efefec;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.brand-mark {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 32px;
}
.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.step-list li {
    border-top: 1px solid #d8d8d4;
    padding: 10px 0;
    font-size: 13px;
}
.step-list li:last-child { border-bottom: 1px solid #d8d8d4; }
.step-list a {
    color: #111;
    text-decoration: none;
}
.step-list li.disabled a {
    color: #a9a9a4;
    pointer-events: none;
}
.step-list li.active a { font-weight: 700; }
.sub-activities {
    list-style: none;
    padding: 6px 0 0 10px;
    margin: 0;
    font-size: 12px;
}
.sub-activities li { border: none; padding: 3px 0; color: #555; }
.sub-activities a { color: inherit; text-decoration: none; }
.sub-activities a:hover { text-decoration: underline; }

.sidebar-footer { margin-top: 32px; }
.note-box label {
    font-size: 12px;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}
.note-box textarea {
    width: 100%;
    height: 110px;
    padding: 8px;
    font-size: 12px;
    border: 1px solid #ccc;
    resize: vertical;
    font-family: inherit;
}
.note-status {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    height: 14px;
}
.sidebar-links {
    margin-top: 20px;
    font-size: 12px;
}
.sidebar-links a {
    display: block;
    color: #555;
    text-decoration: none;
    padding: 4px 0;
    border-top: 1px solid #d8d8d4;
}

/* ---------- Main content ---------- */
.main {
    flex: 1;
    padding: 40px 56px 80px;
    max-width: 760px;
}
.step-header {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px;
}
.learn-block {
    background: #f7f7f5;
    padding: 24px;
    margin-bottom: 40px;
    font-size: 14px;
    line-height: 1.6;
}
.learn-block p { margin: 0 0 14px; }
.learn-block p:last-child { margin-bottom: 0; }

.activity {
    margin-bottom: 56px;
    padding-top: 24px;
    border-top: 2px solid #111;
}
.activity-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.activity-intro { font-size: 14px; color: #555; margin: 0 0 24px; }

.question { margin-bottom: 26px; }
.question label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.question .hint {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
}
.question textarea {
    width: 100%;
    min-height: 84px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #ccc;
    resize: vertical;
}
.question textarea:focus {
    outline: none;
    border-color: #111;
}

.textarea-wrap { position: relative; }
.mic-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mic-btn:hover { border-color: #111; }
.mic-btn.is-listening {
    background: #c62828;
    border-color: #c62828;
    animation: mic-pulse 1.4s infinite;
}
.mic-btn-small { width: 24px; height: 24px; font-size: 11px; top: 6px; right: 6px; }
@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); }
}
.save-status {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    height: 14px;
}
.save-status.saved { color: #2e7d32; }
.save-status.error { color: #b3261e; }
.save-status.saving { color: #888; }

.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 12px;
    color: #888;
    padding: 12px 24px 0;
}
.top-bar a { color: #888; margin-left: 16px; }

/* ---------- Learn block extras ---------- */
.module-summary {
    background: #eceee2;
    padding: 18px 22px;
    margin-bottom: 24px;
    font-size: 14px;
}
.module-summary ul { margin: 8px 0 0; padding-left: 18px; }
.module-summary li { margin-bottom: 4px; }

.carousel-heading {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 28px 0 10px;
}
.carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.carousel-track {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #eef0e4, #d6d9b0);
}
.carousel-card {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 40px 44px;
    min-height: 160px;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    animation: carousel-fade-in 0.2s ease;
}
.carousel-card.is-active { display: flex; }
.carousel-card.has-icon { text-align: left; justify-content: flex-start; }
.carousel-card p { margin: 0; }
.carousel-icon-wrap { flex-shrink: 0; width: 56px; height: 56px; }
.carousel-icon { width: 100%; height: 100%; }
@keyframes carousel-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carousel-arrow {
    background: none;
    border: 1px solid #ccc;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.carousel-arrow:hover { border-color: #111; }
.carousel-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #777;
}

.house-heading, .anatomy-heading {
    font-size: 14px;
    font-weight: 700;
    margin: 32px 0 8px;
}

.anatomy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 16px;
}
.anatomy-layer { font-size: 13px; }
.anatomy-number { color: #999; font-size: 12px; }
.anatomy-title { font-weight: 700; margin-bottom: 4px; }
.anatomy-desc { color: #555; margin: 0 0 8px; }
.anatomy-items { margin: 0; padding-left: 16px; color: #333; }
.anatomy-items li { margin-bottom: 2px; }

/* ---------- Watch block ---------- */
.video-placeholder {
    background: #b3b3b3;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
    margin: 16px 0 24px;
}
.pillars-callout {
    font-size: 13px;
    font-weight: 700;
    color: #2952cc;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.pillars-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 32px;
    font-size: 14px;
}

/* ---------- Reflection ---------- */
.reflect-section {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 2px solid #111;
}
#reflect-btn {
    background: #111;
    color: #fff;
    border: none;
    padding: 12px 22px;
    font-size: 13px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
}
#reflect-btn:disabled { background: #999; cursor: default; }
.reflect-hint {
    font-size: 12px;
    color: #888;
    margin: 8px 0 0;
}
.reflect-result {
    margin-top: 18px;
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.6;
}
.reflect-result.is-success {
    background: #eef2ea;
    border-left: 3px solid #2e7d32;
}
.reflect-result.is-error {
    background: #f7eaea;
    border-left: 3px solid #b3261e;
    color: #7a1f18;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .login-box {
        width: calc(100% - 40px);
        max-width: 360px;
        padding: 32px 24px;
    }

    .shell {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-shrink: 1;
    }
    .main {
        max-width: 100%;
        padding: 24px 20px 60px;
    }

    .anatomy-grid, .pillars-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .carousel-wrap {
        flex-wrap: wrap;
        justify-content: center;
    }
    .carousel-track {
        order: 1;
        width: 100%;
        flex-basis: 100%;
    }
    .carousel-prev { order: 2; }
    .carousel-next { order: 3; }
    .carousel-counter {
        position: static;
        transform: none;
        order: 4;
        width: 100%;
        text-align: center;
        margin-top: 6px;
    }
    .carousel-card {
        padding: 24px 20px;
        flex-direction: column;
        text-align: center !important;
    }
    .carousel-card.has-icon { align-items: center; }

    .mic-btn { width: 34px; height: 34px; }
}
