/* ========================================
   1. ROOT VARIABLES & GLOBAL STYLES
======================================== */
:root {
    --ink: #203b36;
    --muted: #475b53;
    --green: #286b53;
    --green2: #dff0dc;
    --lime: #d9ef8f;
    --cream: #f7f7ef;
    --card: #fffefa;
    --orange: #f3a35c;
    --line: #e6e9de;
    --shadow: 0 12px 35px #22453814;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.5;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}
/* ========================================
   2. MAIN APPLICATION LAYOUT
======================================== */
.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 235px minmax(0, 1fr);
}
/* ========================================
   3. SIDEBAR
======================================== */
aside {
    background: #eef3e8;
    border-right: 1px solid #e2e8dc;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 25px;

    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    align-self: start;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
}

.logo {
    width: 43px;
    height: 43px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: var(--lime);
    font-size: 25px;
}

.brand-name {
    font: 900 20px Nunito, sans-serif;
}

.brand small {
    display: block;
    color: var(--muted);
    font: 700 10px 'DM Sans';
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-label {
    font-size: 10px;
    letter-spacing: 1.6px;
    color: #475b53;
    font-weight: 800;
    padding: 0 12px;
    margin-bottom: 6px;
}

.nav {
    display: grid;
    gap: 5px;
}

.nav button {
    border: 0;
    background: transparent;
    text-align: left;
    padding: 11px 13px;
    border-radius: 13px;
    color: #40584f;
    font-weight: 700;
}

.nav button.active,
.nav button:hover {
    background: var(--card);
    color: var(--green);
}

.side-spacer {
    flex: 1;
}

.side-note {
    background: var(--card);
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    font-size: 12px;
    color: var(--muted);
}

.profile {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 8px;
}

.avatar {
    height: 35px;
    width: 35px;
    border-radius: 50%;
    background: #f6cfaa;
    display: grid;
    place-items: center;
}

.profile strong {
    display: block;
    font-size: 12px;
}

.profile small {
    color: var(--muted);
    font-size: 10px;
}
/* ========================================
   4. MAIN CONTENT & TOP BAR
======================================== */
main {
    max-width: 1300px;
    width: 100%;
    padding: 26px 38px 55px;
    margin: 0 auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.crumb {
    font-size: 12px;
    color: var(--muted);
}

.crumb strong {
    color: var(--ink);
}

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

.pill {
    border: 1px solid var(--line);
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--card);
    font-size: 11px;
    font-weight: 800;
}

.hello {
    font: 900 clamp(27px, 3vw, 37px)/1.15 Nunito, sans-serif;
    letter-spacing: -1px;
    margin: 0;
}

.sub {
    color: var(--muted);
    margin: 9px 0 0;
    max-width: 620px;
    font-size: 14px;
}
/* ========================================
   5. HERO SECTION
======================================== */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 30px;
    background: var(--green);
    color: white;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    min-height: 225px;
    box-shadow: var(--shadow);
    margin: 22px 0 29px;
}

.eyebrow {
    display: inline-block;
    border: 1px solid #ffffff37;
    background: #ffffff12;
    padding: 5px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 800;
}

.hero h2 {
    font: 900 clamp(25px, 3vw, 36px)/1.12 Nunito, sans-serif;
    margin: 14px 0 8px;
}

.hero p {
    color: #d7e7dc;
    font-size: 13px;
    max-width: 430px;
}

.hero-art {
    display: grid;
    place-items: center;
    font-size: 100px;
}
/* ========================================
   6. BUTTONS
======================================== */
.btn {
    border: 0;
    border-radius: 12px;
    padding: 11px 15px;
    background: var(--lime);
    color: var(--ink);
    font-weight: 900;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary {
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    border-radius: 11px;
    padding: 10px 13px;
    font-weight: 800;
    font-size: 12px;
}
/* ========================================
   7. SECTION HEADINGS
======================================== */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin: 0 0 14px;
}

.section-head h2 {
    font: 900 22px Nunito;
    margin: 0;
}

.section-head p {
    font-size: 12px;
    color: var(--muted);
    margin: 3px 0;
}
/* ========================================
   8. DASHBOARD STATISTICS
======================================== */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.stat,
.panel,
.module-card,
.lesson-panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 17px;
}

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

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: #f8e7c9;
    display: grid;
    place-items: center;
    font-size: 20px;
}

.stat:nth-child(2) .stat-icon {
    background: #e2efd8;
}

.stat:nth-child(3) .stat-icon {
    background: #eee4fa;
}

.stat small {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.stat strong {
    font: 900 22px Nunito;
}
/* ========================================
   9. LEARNING MODULE CARDS
======================================== */
.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.module-card {
    cursor: pointer;
    min-height: 218px;
    display: flex;
    flex-direction: column;
    transition: 0.15s;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.module-art {
    height: 72px;
    border-radius: 12px;
    background: #f8e7ca;
    display: grid;
    place-items: center;
    font-size: 38px;
    position: relative;
    margin-bottom: 13px;
}

.module-card:nth-child(2) .module-art {
    background: #e2efd8;
}

.module-card:nth-child(3) .module-art {
    background: #e4eafa;
}

.tag {
    position: absolute;
    top: 7px;
    left: 7px;
    font-size: 8px;
    font-weight: 900;
    padding: 4px 6px;
    border-radius: 5px;
    background: white;
    color: #40584f;
}

.module-card h3 {
    font: 900 15px Nunito;
    margin: 0 0 4px;
}

.module-card p {
    color: var(--muted);
    font-size: 11px;
    margin: 0 0 13px;
}

.module-foot {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    font-size: 10px;
    color: var(--muted);
    font-weight: 700;
}

.progress {
    height: 5px;
    background: #e9ede5;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 8px;
}

.progress span {
    height: 100%;
    display: block;
    background: #79aa65;
}
/* ========================================
   10. DASHBOARD BOTTOM PANELS
======================================== */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}

.panel h3 {
    font: 900 17px Nunito;
    margin: 0;
}

.panel .desc {
    font-size: 12px;
    color: var(--muted);
    margin: 4px 0 14px;
}

.chat-preview {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rocky-mini {
    height: 45px;
    width: 45px;
    background: #f3c89c;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-size: 28px;
    flex-shrink: 0;
}

.bubble {
    background: #eef4e9;
    border-radius: 4px 14px 14px 14px;
    padding: 12px;
    font-size: 12px;
    color: #48635a;
}
/* ========================================
   11. PAGE NAVIGATION & SEARCH
======================================== */
.page {
    display: none;
}

.page.active {
    display: block;
}

.searchbar {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 15px;
    background: white;
    margin: 18px 0;
    outline: none;
}
/* ========================================
   12. LESSON PAGES
======================================== */
.lesson-hero {
    padding: 22px;
    background: #e2efd8;
    border-radius: 20px;
    display: flex;
    gap: 17px;
    align-items: center;
    margin-bottom: 16px;
}

.lesson-emoji {
    width: 75px;
    height: 75px;
    border-radius: 17px;
    background: white;
    display: grid;
    place-items: center;
    font-size: 42px;
    flex-shrink: 0;
}

.lesson-hero h2 {
    font: 900 24px Nunito;
    margin: 6px 0 3px;
}

.lesson-hero p {
    margin: 0;
    font-size: 12px;
    color: #40584f;
}

.step-indicator {
    display: flex;
    gap: 7px;
    margin: 16px 0;
}

.step-dot {
    height: 5px;
    flex: 1;
    border-radius: 5px;
    background: #e0e7dc;
}

.step-dot.done {
    background: #78a663;
}

.lesson-panel h3 {
    font: 900 20px Nunito;
    margin: 0 0 8px;
}

.lesson-panel p {
    font-size: 13px;
    color: #40584f;
}

.callout {
    border-left: 4px solid #e7a35d;
    padding: 12px 14px;
    background: #fff5e7;
    border-radius: 0 11px 11px 0;
    margin: 17px 0;
    font-size: 12px;
}
/* ========================================
   13. QUIZ & ANSWER FEEDBACK
======================================== */
.quiz-options {
    display: grid;
    gap: 9px;
    margin: 16px 0;
}

.quiz-option {
    border: 1.5px solid var(--line);
    background: white;
    border-radius: 11px;
    padding: 12px;
    text-align: left;
    color: var(--ink);
    font-weight: 700;
    font-size: 12px;
}

.quiz-option.correct {
    border-color: #5e9d4e;
    background: #e4f4dc;
}

.quiz-option.wrong {
    border-color: #d97a6e;
    background: #fff0ed;
}

.feedback {
    font-size: 12px;
    font-weight: 800;
    margin: 9px 0;
}

.lesson-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}
/* ========================================
   14. ASK ROCKY CHAT PAGE
======================================== */
.chat-page {
    max-width: 820px;
}

.chat-thread {
    display: grid;
    gap: 11px;
    margin: 18px 0;
    max-height: 410px;
    overflow: auto;
}

.chat-msg {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 4px 14px 14px 14px;
    background: #eef4e9;
    font-size: 13px;
    white-space: pre-wrap;
}

.chat-msg.user {
    justify-self: end;
    background: var(--green);
    color: white;
    border-radius: 14px 4px 14px 14px;
}

.chat-form {
    display: flex;
    gap: 8px;
}

.chat-form input {
    min-width: 0;
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 12px;
    background: white;
}

.chat-tip {
    font-size: 10px;
    color: var(--muted);
    margin-top: 11px;
}


/* Rocky's Conversation History */

.conversation-history {
    margin: 16px 0;
}

.conversation-history h3 {
    color: var(--green);
    font: 900 17px Nunito, sans-serif;
    margin: 0 0 12px;
}

.conversation-history-item {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--green2);
    color: var(--green);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.conversation-history-item:hover {
    background: #c8e5c8;
}

.conversation-history-item:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 2px;
}

/* ========================================
   15. LOGIN & ACCOUNT FORMS
======================================== */
.form-card {
    max-width: 520px;
    margin: 20px auto;
}

.form-grid {
    display: grid;
    gap: 12px;
    margin: 15px 0;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 5px;
}

.field input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    background: white;
}

.form-switch {
    font-size: 12px;
    color: var(--muted);
    margin-top: 15px;
}

.link-btn {
    border: 0;
    background: none;
    color: var(--green);
    font-weight: 900;
    padding: 0;
}
/* ========================================
   16. NOTIFICATIONS & ACCOUNT SETTINGS
======================================== */
.notice {
    padding: 11px 13px;
    border-radius: 11px;
    background: #fff5e7;
    font-size: 12px;
    color: #73512f;
    margin: 12px 0;
}

.success {
    background: #e5f4df;
    color: #315b31;
}

.account-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
/* ========================================
   17. LESSON COMPLETION SCREEN
======================================== */
.finish {
    text-align: center;
    padding: 34px 20px;
}

.finish .big {
    font-size: 62px;
}

.finish h2 {
    font: 900 28px Nunito;
    margin: 8px 0;
}

.finish p {
    color: var(--muted);
    font-size: 13px;
    max-width: 440px;
    margin: 0 auto 18px;
}
/* ========================================
   18. FOOTER
======================================== */
footer {
    border-top: 1px solid var(--line);
    margin-top: 30px;
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    color: #475b53;
    font-size: 10px;
}
/* ========================================
   19. RESPONSIVE DESIGN - TABLETS
======================================== */
@media (max-width: 950px) {
    .app {
        grid-template-columns: 195px 1fr;
    }

    main {
        padding: 23px;
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* ========================================
   20. RESPONSIVE DESIGN - MOBILE
======================================== */
@media (max-width: 680px) {
    .app {
        display: block;
    }

    aside {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 10px 12px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .brand {
        padding: 0;
    }

    .logo {
        width: 36px;
        height: 36px;
    }

    .brand-name {
        font-size: 16px;
    }

    .brand small,
    .nav-label,
    .side-spacer,
    .side-note,
    .profile {
        display: none;
    }

    .nav {
        display: flex;
        margin-left: auto;
        gap: 2px;
    }

    .nav button {
        padding: 8px;
        font-size: 11px;
    }

    .nav button .nav-text {
        display: none;
    }

    main {
        padding: 19px 14px 35px;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 23px;
        min-height: 0;
    }

    .hero-art {
        position: absolute;
        right: 0;
        bottom: -10px;
        opacity: 0.18;
    }

    .hero h2 {
        font-size: 28px;
    }

    .hero-copy {
        position: relative;
        z-index: 1;
    }

    .stats {
        gap: 7px;
    }

    .stat {
        display: block;
        padding: 10px;
    }

    .stat-icon {
        margin-bottom: 6px;
        width: 34px;
        height: 34px;
    }

    .stat strong {
        font-size: 18px;
    }

    .module-grid {
        gap: 9px;
    }

    .module-card {
        padding: 11px;
        min-height: 210px;
    }

    .module-card h3 {
        font-size: 13px;
    }

    .module-card p {
        font-size: 10px;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .lesson-hero {
        padding: 15px;
        align-items: flex-start;
    }

    .lesson-emoji {
        width: 57px;
        height: 57px;
        font-size: 31px;
    }

    .lesson-hero h2 {
        font-size: 20px;
    }

    .lesson-panel {
        padding: 17px;
    }

    .top-actions .pill:first-child {
        display: none;
    }
}

/* Module reward themes */
.theme-panel{margin:24px 0}
.theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.theme-choice{display:flex;align-items:center;gap:11px;text-align:left;border:1px solid var(--line);border-radius:13px;padding:12px;background:var(--card);color:var(--ink);cursor:pointer;min-width:0}
.theme-choice:disabled{opacity:.55;cursor:not-allowed}
.theme-choice.selected{border:2px solid var(--green);background:var(--green2)}
.theme-emoji{font-size:25px}
.theme-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.theme-copy strong{font:800 12px Nunito}
.theme-copy small{font-size:10px;color:var(--muted)}
.theme-status{font-size:11px;font-weight:900;color:var(--green)}
@media(max-width:680px){.theme-grid{grid-template-columns:1fr}}


/* Rocky's avatar shop */
.shop-page{max-width:1050px}
.shop-wallet{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:22px 0 28px;background:var(--green2)}
.shop-wallet-label{display:block;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em}
.shop-wallet strong{font:900 22px Nunito}
.shop-avatar-preview{width:92px;height:92px;display:grid;place-items:center;background:#ffffff9c;border-radius:22px}
.shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.shop-item{background:var(--card);border:1px solid var(--line);border-radius:17px;padding:15px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:7px;min-width:0}
.shop-item-active{border:2px solid var(--green);background:var(--green2)}
.shop-item-art{height:104px;width:100%;display:grid;place-items:center;background:var(--cream);border-radius:12px}
.shop-item strong{font:900 14px Nunito}
.shop-item p{font-size:11px;color:var(--muted);margin:0;min-height:32px}
.shop-item small{font-size:11px;font-weight:900;color:var(--green);margin-top:auto}
.shop-item button{margin-top:5px;width:100%;justify-content:center}
.shop-section-head{margin-top:30px}
.shop-message{background:var(--green2);border-radius:12px;padding:12px 15px;color:var(--ink);font-size:12px;margin-top:18px}
.raccoon-art{position:relative;display:inline-grid;place-items:center;flex:none}
.raccoon-art svg{width:100%;height:100%;overflow:visible}
.raccoon-art.small{width:34px;height:34px}
.raccoon-art.large{width:84px;height:84px}
.raccoon-head{fill:var(--fur)}
.raccoon-ears{fill:var(--fur);stroke:#454b4a;stroke-width:3;stroke-linejoin:round}
.raccoon-mask{fill:#454b4a}
.raccoon-accessory{position:absolute;z-index:2;display:block;filter:drop-shadow(0 2px 1px #0002);line-height:1;pointer-events:none}
.raccoon-art .raccoon-accessory{font-size:30px;top:-5%;left:50%;right:auto;transform:translateX(-50%)}
.raccoon-art.accessory-bow .raccoon-accessory{top:4%;left:75%;font-size:25px;transform:translateX(-50%) rotate(12deg)}
.raccoon-art.accessory-crown .raccoon-accessory{top:-7%;left:50%;font-size:29px;transform:translateX(-50%)}
.raccoon-art.accessory-glasses .raccoon-accessory{top:27%;left:50%;font-size:31px;transform:translateX(-50%)}
.raccoon-art.accessory-explorer .raccoon-accessory{top:-1%;left:50%;font-size:32px;transform:translateX(-50%)}
.raccoon-art.accessory-star .raccoon-accessory{top:5%;left:78%;font-size:24px;transform:translateX(-50%)}
.raccoon-art.accessory-scarf .raccoon-accessory{top:62%;left:50%;font-size:31px;transform:translateX(-50%)}
.raccoon-art.small .raccoon-accessory{font-size:14px}
.raccoon-art.small.accessory-bow .raccoon-accessory{font-size:12px}
.raccoon-art.small.accessory-crown .raccoon-accessory{font-size:14px}
.raccoon-art.small.accessory-glasses .raccoon-accessory{font-size:15px}
.raccoon-art.small.accessory-explorer .raccoon-accessory{font-size:15px}
.raccoon-art.small.accessory-star .raccoon-accessory{font-size:12px}
.raccoon-art.small.accessory-scarf .raccoon-accessory{font-size:15px}
.profile .avatar{background:transparent;width:38px;height:38px}
@media(max-width:850px){.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.shop-grid{grid-template-columns:1fr 1fr}.shop-item{padding:10px}.shop-wallet{padding:13px}}

/* Shop item detail panel */
.shop-details{display:grid;grid-template-columns:110px 1fr auto;align-items:center;gap:18px;margin-top:16px;border:1px solid var(--line)}
.shop-details[hidden]{display:none}
.shop-detail-preview{display:grid;place-items:center;min-height:100px;background:var(--cream);border-radius:14px}
.shop-detail-emoji{font-size:48px}
.shop-detail-copy h3{margin:0 0 6px;font:900 17px Nunito;color:var(--ink)}
.shop-detail-copy p{margin:5px 0;color:var(--muted);font-size:12px}
.shop-detail-copy button{margin-top:8px}
.shop-detail-close{align-self:start}
@media(max-width:600px){.shop-details{grid-template-columns:80px 1fr}.shop-detail-close{grid-column:2;justify-self:start}.shop-detail-preview{min-height:80px}}



/* Conversation history rows */
.conversation-history-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 8px;
}

/* Let the conversation title fill the available space */
.conversation-history-row .conversation-history-item {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

/* Delete conversation button */
.conversation-delete-btn {
    flex-shrink: 0;
    width: 48px;
    border: 1px solid #f1cccc;
    border-radius: 12px;
    background: #fff0f0;
    cursor: pointer;
    font-size: 19px;
    transition: background 0.2s ease;
}

.conversation-delete-btn:hover {
    background: #ffdada;
}

.conversation-delete-btn:focus-visible {
    outline: 3px solid #b94b4b;
    outline-offset: 2px;
}

