:root {
    --primary-gold: #ffcc00; /* The gold color from the top bar */
    --dark-text: #333;
    --light-text: #fff;
    --border-light: #eee;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --body-bg: #f5f5f5; /* A very light grey for overall background */
    --card-bg: #fff;
    --ink: #123f93;
    --ink-soft: #123f93;
    --coral: #f4564e;
    --sun: #ffd35a;
    --mint: #43c59e;
    --sky: #7bc8ff;
}
/* Reinforce the HTML hidden attribute — author display rules (e.g. display:flex on
   .nav-button) would otherwise override the UA stylesheet's [hidden]{display:none}. */
[hidden] { display: none !important; }

body {
    font-family: 'Fredoka', 'Arial', sans-serif;
    font-weight: 500;
    margin: 0;
    padding: 0;
    background-color: var(--body-bg);
    display: flex; /* Use flexbox for the main layout */
    justify-content: center; /* Center the app container */
    align-items: flex-start; /* Align to top */
    min-height: 100vh; /* Full viewport height */
    overflow: hidden;
    overscroll-behavior: none;
}

/* Outer container to simulate phone screen */
#app-container {
    width: 100%;
    max-width: 450px; /* Typical phone width range */
    background-color: #fff; /* White background for the app content */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 100dvh; /* Ensures it stretches if content is short */
    height: 100dvh;
    overflow: hidden;
}

/* Header Styling */
.app-header {
    display: none; /* Hide the yellow banner */
}

.menu-icon, .notification-icon {
    font-size: 1.5em;
    cursor: pointer;
}

/* Main Content Area */
.main-content {
    flex-grow: 1; /* Allows main content to take available vertical space */
    padding: 16px 16px 20px;
    padding-bottom: 116px;
    overflow-y: auto; /* Enables scrolling if content overflows */
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background:
        linear-gradient(180deg, #fff7ed 0%, #f8efe7 42%, #f4eadf 100%);
}

.dashboard-hero {
    position: relative;
    min-height: 154px;
    margin: 0 0 16px;
    padding: 20px 142px 20px 18px;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(135deg, #55cbb3 0%, #43bfa3 100%);
    border: 1px solid rgba(31, 30, 51, 0.08);
    box-shadow: 0 16px 32px rgba(31, 30, 51, 0.14);
}

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

.dashboard-eyebrow {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
}
.hero-brand-line {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.4px;
    color: rgba(255, 255, 255, 0.68);
    text-transform: uppercase;
}

.dashboard-hero h1 {
    margin: 0;
    max-width: 12ch;
    color: #0f4d44;
    font-size: 2rem;
    line-height: 1.0;
    font-weight: 700;
}

.dashboard-hero p {
    margin: 9px 0 0;
    max-width: 24ch;
    color: rgba(15, 77, 68, 0.82);
    font-size: 0.95rem;
    line-height: 1.35;
}

.dashboard-hero-character {
    position: absolute;
    right: 8px;
    bottom: 4px;
    width: 145px;
    height: 145px;
    object-fit: contain;
    object-position: center center;
    padding-top: 10px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.18);
    filter: drop-shadow(0 8px 16px rgba(31, 30, 51, 0.15));
}

.hero-progress-ring-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hero-ring-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-ring {
    width: 56px;
    height: 56px;
    transform: rotate(-90deg);
}
.hero-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.35);
    stroke-width: 5.5;
}
.hero-ring-fill {
    fill: none;
    stroke: #ffe45c;
    stroke-width: 5.5;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 113.1;
    transition: stroke-dashoffset 0.8s ease;
}
.hero-ring-label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
    display: none;
}
.hero-ring-pct {
    position: absolute;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.voice-dashboard .dashboard-hero-character {
    right: 22px;
    bottom: 18px;
    width: 104px;
    height: 104px;
    object-fit: contain;
    border-radius: 0;
}

.options-section {
    margin-bottom: 18px;
    position: relative; /* For positioning the add button */
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.options-section h2 {
    color: var(--dark-text);
    font-size: 1.8em;
    margin: 0 0 2px;
    text-align: center;
}

.dashboard-progress-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.dashboard-progress-summary span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 45px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(29, 27, 42, 0.08);
    box-shadow: 0 8px 18px rgba(31, 30, 51, 0.06);
    color: var(--ink-soft);
    font-size: 0.78rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.dashboard-progress-summary strong {
    color: var(--ink);
    font-size: 1.08rem;
}

.search-label {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--dark-text);
    margin-bottom: 15px;
}

.add-button {
    display: none; /* Hidden as requested */
}

.add-button:hover {
    background-color: #45a049;
}

.back-button {
    margin-left: 0;
    margin-top: 8px;
    padding: 8px 14px;
    background: #e0e7ff;
    border: 1px solid #b7c2ff;
    border-radius: 20px;
    color: #1f3a93;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.refresh-button {
    align-self: center;
    min-height: 34px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid rgba(31, 30, 51, 0.1);
    background: rgba(255, 255, 255, 0.78);
    color: #123f93;
    font-weight: 860;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(31, 30, 51, 0.06);
}

.refresh-button:active {
    transform: translateY(1px);
}

.back-button.hidden {
    display: none;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(31, 30, 51, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 20px rgba(31, 30, 51, 0.07);
    transition: all 0.25s ease;
    width: min(90%, 360px);
}

.search-bar.collapsed {
    width: 34px;
    height: 31px;
    padding: 7px;
    justify-content: center;
    gap: 0;
    cursor: pointer;
}

.search-bar.collapsed .search-input {
    display: none;
}

.search-input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 8px 4px;
    font-size: 1em;
    background: transparent;
    color: #444;
}

.search-input::placeholder {
    color: #8b8498;
}

.search-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #ffcf7b 0%, #ff8f70 100%);
    color: #4a2b21;
    font-size: 1.2em;
    box-shadow: 0 2px 6px rgba(123, 61, 110, 0.25);
}

.dashboard-filter-row {
    display: flex;
    width: 100%;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: none;
}

.dashboard-filter-row::-webkit-scrollbar {
    display: none;
}

.dashboard-filter-chip {
    flex: 0 0 auto;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 8px;
    border: 1px solid rgba(31, 30, 51, 0.1);
    background: rgba(255, 255, 255, 0.78);
    color: #123f93;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(31, 30, 51, 0.05);
}

.dashboard-filter-chip strong {
    min-width: 24px;
    padding: 4px 6px;
    border-radius: 8px;
    background: rgba(31, 30, 51, 0.08);
    color: #1d1b2a;
    font-size: 0.78rem;
    line-height: 1;
}

.dashboard-filter-chip.active {
    border-color: rgba(244, 86, 78, 0.24);
    background: linear-gradient(135deg, #ff7b5d, #f4564e);
    color: #fff;
    box-shadow: 0 12px 24px rgba(244, 86, 78, 0.22);
}

.dashboard-filter-chip.active strong {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}


/* Lessons List (Container for cards) */
.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Space between lesson cards */
    padding: 0 2px 14px; /* Pull cards away from screen edges */
}

/* Individual Lesson Card Styling (The items like "A / An", "Science Experiment") */
.lesson-card {
    display: flex;
    align-items: center;
    position: relative;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 255, 0.96));
    border: 1px solid rgba(31, 30, 51, 0.08);
    box-shadow: 0 8px 20px rgba(31, 30, 51, 0.13);
    border-radius: 18px;
    padding: 12px 42px 12px 12px;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.lesson-card.has-thumbnail {
    align-items: center;
    height: auto;
    overflow: visible;
    padding: 10px 42px 10px 10px;
}

.lesson-card.is-completed {
    background:
        linear-gradient(135deg, #f3fbf5 0%, #e6f7ec 100%);
    border-color: rgba(92, 183, 91, 0.28);
    box-shadow: 0 10px 24px rgba(112, 151, 70, 0.15);
}

.lesson-badge {
    position: absolute;
    top: 9px;
    right: 9px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.lesson-badge.free {
    background: #e7f8ed;
    color: #11623a;
    border: 1px solid #bce7cd;
}

.lesson-badge.completed {
    background: linear-gradient(135deg, #e9fff0, #fff0b8);
    color: #226238;
    border: 1px solid #9fd98a;
    box-shadow: 0 6px 12px rgba(70, 143, 68, 0.14);
}

.lesson-badge.in-progress {
    background: #fff7de;
    color: #8a5a00;
    border: 1px solid #f6d98b;
}

.lesson-badge.start {
    background: #eef4ff;
    color: #2b5fb0;
    border: 1px solid #cfe0fb;
}

.lesson-badge.locked {
    background: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
}

.lesson-card:hover {
    transform: translateY(-3px);
    border-color: rgba(123, 200, 255, 0.55);
    box-shadow: 0 14px 28px rgba(31, 30, 51, 0.13);
}

.continue-label {
    align-self: flex-start;
    margin: 4px 4px 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #8a8472;
}

#continue-card-slot { margin: 0 0 16px; }

.continue-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
    text-align: left;
    cursor: pointer;
    border-radius: 18px;
    border: 1.5px solid #ffe39a;
    background: linear-gradient(135deg, #ffffff 0%, #fff6d8 100%);
    padding: 13px;
    font-family: inherit;
    box-shadow: 0 12px 26px rgba(180, 140, 30, 0.16);
    transition: transform 0.15s ease;
}

.continue-card:active { transform: scale(0.985); }

.continue-thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: #eaf4ff;
}

.continue-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.continue-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #123f93;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.continue-percent { font-size: 0.78rem; color: #9a8a55; }

.continue-go {
    flex: 0 0 auto;
    background: #f4564e;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 9px 15px;
    border-radius: 13px;
    box-shadow: 0 6px 14px rgba(244, 86, 78, 0.3);
}

.lesson-thumb-frame {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #fcfcfc;
    border: 1px solid rgba(31, 30, 51, 0.09);
    box-shadow: 0 5px 14px rgba(31, 30, 51, 0.13);
    margin-right: 13px;
    overflow: hidden;
    flex-shrink: 0;
}

.lesson-thumbnail {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    display: block;
}

.lesson-info {
    flex-grow: 1; /* Allows info to take available space */
    min-width: 0;
    text-align: left;
    padding: 12px 0;
}



.lesson-info h3 {
    margin: 0 0 5px 0;
    padding-right: 58px;
    font-size: 1.03em;
    color: var(--ink);
    line-height: 1.16;
}

.lesson-info p {
    margin: 0;
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.lesson-progress {
    display: grid;
    gap: 5px;
    margin-top: 8px;
    max-width: 230px;
}

.lesson-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #5f6070;
    font-size: 0.68em;
    line-height: 1;
}

.lesson-progress-meta strong {
    color: #26324a;
    font-weight: 800;
}

.lesson-progress-track {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(38, 50, 74, 0.12);
}

.lesson-progress-fill {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #7ed957, #43c59e);
    transition: width 180ms ease;
}

.lesson-stars {
    display: inline-flex;
    gap: 3px;
    margin-top: 8px;
    line-height: 1;
}

.lesson-star {
    color: rgba(38, 50, 74, 0.10);
    font-size: 1.18em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.lesson-star.earned {
    color: #f4b400;
    text-shadow: 0 1px 0 rgba(116, 80, 0, 0.18);
}

.forward-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.35em;
    color: rgba(31, 30, 51, 0.42);
    margin-left: 0;
}

@media (max-width: 360px) {
    .main-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .dashboard-hero {
        min-height: 148px;
        padding-right: 116px;
    }

    .dashboard-hero h1 {
        font-size: 1.7rem;
    }

    .dashboard-hero-character {
        right: 6px;
        width: 108px;
        height: 108px;
    }

    .dashboard-progress-summary {
        gap: 6px;
    }

    .dashboard-progress-summary span {
        font-size: 0.72rem;
        padding: 7px 5px;
    }
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: min(430px, calc(100% - 20px));
    background: rgba(255, 251, 246, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(29, 27, 42, 0.08);
    border-left: 1px solid rgba(29, 27, 42, 0.04);
    border-right: 1px solid rgba(29, 27, 42, 0.04);
    border-radius: 18px 18px 0 0;
    padding: 8px 18px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    gap: 12px;
    box-shadow: 0 -10px 24px rgba(31, 30, 51, 0.08);
    z-index: 30;
    pointer-events: auto;
}

.nav-button {
    border: none;
    background: transparent;
    border: none;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink-soft);
    padding: 8px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-button img {
    width: 51px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.nav-button[data-nav-target="login"] img {
    border-radius: 12px;
}

.nav-emoji {
    width: 51px;
    height: 48px;
    display: grid;
    place-items: center;
    font-size: 35px;
    line-height: 1;
}

.nav-button.active {
    background: linear-gradient(135deg, rgba(255, 123, 93, 0.2), rgba(244, 86, 78, 0.2));
    color: var(--ink);
    transform: translateY(-2px);
}

.nav-button:active {
    transform: translateY(0);
}

/* Account screen (in-app) */
#account-screen {
    display: none;
    margin: -20px;
    padding: 20px 20px 0;
    min-height: 100%;
    background: linear-gradient(180deg, #fff8ef 0%, #fffdf8 42%, #f9eee3 100%);
}

#account-screen .account-screen {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#account-screen .account-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 22px;
    padding: 22px;
    border: 1px solid rgba(29, 27, 42, 0.12);
    box-shadow: 0 18px 40px rgba(31, 30, 51, 0.16);
    /* margin-top: 100px; */
}

#account-screen .account-title {
    margin: 0 0 6px;
    font-size: 1.2em;
    color: #1d1b2a;
}

#account-screen .account-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 700;
    color: #1d1b2a;
    font-size: 23px;
}

#account-screen .account-brand img {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
}

#account-screen .account-subtitle {
    margin: 0 0 14px;
    color: #3d3952;
    font-size: 0.9em;
}

#account-screen .auth-mode-switch {
    display: flex;
    justify-content: flex-start;
    margin: 14px 0 8px;
}

#account-screen .auth-mode-button {
    border: 1px solid rgba(29, 27, 42, 0.12);
    border-radius: 12px;
    background: rgba(29, 27, 42, 0.06);
    color: #1d1b2a;
    font-size: 0.95em;
    font-weight: 700;
    padding: 11px 14px;
    cursor: pointer;
}

#account-screen .auth-mode-button.is-active {
    color: white;
    background: linear-gradient(135deg, #ff7b5d, #f4564e);
    box-shadow: 0 14px 30px rgba(244, 86, 78, 0.18);
    border-color: transparent;
}

#account-screen .auth-panel[hidden] {
    display: none;
}

#account-screen .status-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 6px;
}

#account-screen .status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(29, 27, 42, 0.08);
    font-size: 0.95em;
}

#account-screen .status-item span {
    color: #3d3952;
}

#account-screen .status-item strong {
    color: #1d1b2a;
}

#account-screen .login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 30px;
    
    
}

#account-screen .field-hint {
    font-size: 0.78em;
    color: #888;
    margin-top: -4px;
}

#account-screen .login-form button {
    color: white;
    background: linear-gradient(135deg, #ff7b5d, #f4564e);
    box-shadow: 0 14px 30px rgba(244, 86, 78, 0.28);
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95em;
    font-weight: 700;
}

#account-screen label {
    font-weight: 700;
    font-size: 0.9em;
    color: #333;
}

#account-screen input {
    border-radius: 12px;
    border: 1px solid rgba(29, 27, 42, 0.18);
    padding: 12px 14px;
    font-size: 1em;
}

#account-screen .button-row {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

#account-screen .primary-button,
#account-screen .secondary-button,
#account-screen .google-button,
#account-screen .ghost-button {
    border: 20px;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    color: white;
    
}

#account-screen .primary-button {
    color: white;
    background: linear-gradient(135deg, #ff7b5d, #f4564e);
    box-shadow: 0 14px 30px rgba(244, 86, 78, 0.28);
}

#account-screen .secondary-button {
    background: rgba(29, 27, 42, 0.06);
    color: #1d1b2a;
}

#account-screen .google-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    padding: 14px 18px;
    background: #ffffff;
    color: #1d1b2a;
    border: 1px solid rgba(29, 27, 42, 0.16);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(31, 30, 51, 0.1);
    font-size: 1em;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

#account-screen .google-button:hover {
    border-color: rgba(29, 27, 42, 0.24);
    box-shadow: 0 16px 34px rgba(31, 30, 51, 0.14);
    transform: translateY(-1px);
}

#account-screen .google-button:focus-visible {
    outline: 3px solid rgba(66, 133, 244, 0.28);
    outline-offset: 3px;
}

#account-screen .google-button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

#account-screen .google-button-logo {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
}

#account-screen .ghost-button {
    color: #1d1b2a;
    background: rgba(29, 27, 42, 0.06);
    /* box-shadow: 0 14px 30px rgba(244, 86, 78, 0.28); */
    border: none;
    margin-top: 20px;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.95em;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0;
  }
  
  .status-locked {
    background: rgba(255, 232, 192, 0.95);
    color: #8a4b00;
    border: 1px solid rgba(207, 138, 19, 0.28);
  }
  
  .status-unlocked {
    background: rgba(229, 255, 237, 0.95);
    color: #0f6a3f;
    border: 1px solid rgba(15, 106, 63, 0.18);
  }
  
.login-card {
    position: relative;
    overflow: hidden;
    background:
      linear-gradient(180deg, rgba(255, 247, 237, 0.86) 0%, rgba(255, 255, 255, 0.92) 46%, rgba(248, 252, 255, 0.94) 100%);
    border-radius: 0;
    padding: 0 0 110px;
    min-height: calc(100dvh - 20px);
}

.account-hero {
    position: relative;
    border-radius: 8px;
    padding: 18px;
    color: #1f1d2c;
    overflow: hidden;
    border: 1px solid rgba(31, 30, 51, 0.08);
    box-shadow: 0 18px 34px rgba(31, 30, 51, 0.13);
}

.account-hero::after {
    content: none;
}

.account-hero.is-premium {
    background: #a9e2d8;
}

.account-hero.is-limited {
    background: #a9e2d8;
}

.account-hero-top {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.profile-avatar-wrap {
    display: grid;
    justify-items: center;
    gap: 7px;
    flex: 0 0 auto;
}

.profile-mark {
    appearance: none;
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    padding: 0;
    border: 3px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(6px);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 14px 24px rgba(31, 30, 51, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.profile-mark:hover,
.profile-mark:focus-visible {
    transform: translateY(-2px);
    outline: none;
    box-shadow: 0 18px 30px rgba(36, 29, 48, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.profile-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.avatar-edit-label {
    min-height: 24px;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: #2a2738;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.card-header {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.74;
}

.card-header h2 {
    margin: 0;
    font-size: clamp(1.34rem, 7vw, 1.9rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.hero-subtitle {
    margin: 8px 0 0;
    max-width: 30ch;
    color: rgba(31, 29, 44, 0.8);
    font-size: 0.95rem;
    line-height: 1.45;
}

.account-access-row {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.45);
    font-size: 0.84rem;
    font-weight: 700;
    color: #2a2738;
    text-transform: capitalize;
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.account-stat {
    padding: 14px 12px;
    border-radius: 8px;
    background: #fff9ef;
    border: 1.5px solid rgba(255, 122, 89, 0.22);
    box-shadow: 0 10px 22px rgba(31, 30, 51, 0.1);
}

.account-stat-wide {
    grid-column: 1 / -1;
}

.account-stat-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a6c61;
}

.account-stat-value {
    display: block;
    color: #201d2d;
    font-size: 1.28rem;
    line-height: 1.35;
    word-break: break-word;
}

.account-stat-wide .account-stat-value {
    font-size: 1rem;
}

.premium-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 8px;
    background: #ffffff;
    border: 1.5px solid rgba(31, 30, 51, 0.14);
    box-shadow: 0 10px 22px rgba(31, 30, 51, 0.1);
}

.avatar-panel[hidden] {
    display: none;
}

.avatar-panel {
    background: #fffdf8;
}

.avatar-panel .section-heading {
    align-items: flex-start;
    gap: 12px;
}

.avatar-panel-close {
    width: auto;
    min-width: 84px;
    flex: 0 0 auto;
    padding: 10px 12px;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 12px;
}

.avatar-choice {
    appearance: none;
    min-width: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 10px 18px rgba(36, 29, 48, 0.08);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.avatar-choice:hover,
.avatar-choice:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 122, 89, 0.68);
    outline: none;
    box-shadow: 0 14px 24px rgba(36, 29, 48, 0.12);
}

.avatar-choice.is-selected {
    border-color: #ff7a59;
    background: #fff5ee;
    box-shadow: 0 14px 26px rgba(239, 68, 68, 0.18);
}

.avatar-choice:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.avatar-choice img {
    width: 100%;
    aspect-ratio: 1;
    display: block;
    border-radius: 6px;
    object-fit: cover;
}

.avatar-choice span {
    display: block;
    margin-top: 8px;
    color: #241d30;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.avatar-save-status {
    min-height: 1.2em;
    margin: 12px 2px 0;
    color: #746969;
    font-size: 0.9rem;
}

.premium-title {
    margin: 0 0 8px 0;
    color: #2a2235;
    font-size: 1.12rem;
}

.premium-sub {
    margin: 0 0 12px 0;
    color: #5a4d45;
    line-height: 1.55;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.section-heading .premium-sub {
    margin-bottom: 0;
}

.progress-percent {
    min-width: 62px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff3cf;
    color: #563800;
    text-align: center;
}

.profile-progress-bar {
    height: 12px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 8px;
    background: rgba(31, 30, 51, 0.08);
}

.profile-progress-bar span {
    display: block;
    height: 100%;
    min-width: 8px;
    border-radius: inherit;
    background: linear-gradient(90deg, #43c59e 0%, #7bc8ff 100%);
}

.account-detail-list {
    display: grid;
    gap: 10px;
}

.account-detail-list div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px;
    border-radius: 8px;
    background: rgba(248, 252, 255, 0.9);
    border: 1px solid rgba(31, 30, 51, 0.06);
}

.account-detail-list span {
    color: #7a6c61;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.account-detail-list strong {
    color: #201d2d;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.premium-list {
    margin: 0 0 14px 18px;
    padding: 0;
    color: #3f384c;
    line-height: 1.7;
}

.price-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid rgba(42, 34, 53, 0.08);
}

.price-label {
    color: #6b5f59;
    font-size: 0.9rem;
}

.price-value {
    font-weight: 800;
    color: #241d30;
    text-align: right;
}

.trial-countdown-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 8px;
    background: #fff7de;
    color: #5f3d00;
}

.trial-countdown-row span {
    font-size: 0.9rem;
    font-weight: 700;
}

.trial-countdown-row strong {
    color: #241d30;
    font-size: 1.05rem;
    text-align: right;
}

.cta-row,
.account-actions {
    display: grid;
    gap: 10px;
}

.cta-row {
    margin-top: 16px;
}

.account-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 18px;
}

.primary-btn,
.ghost-btn {
    width: 100%;
    border-radius: 8px;
    padding: 13px 16px;
    font-size: 0.96rem;
    font-weight: 800;
    cursor: pointer;
}

.primary-btn {
    border: none;
    color: white;
    background: linear-gradient(135deg, #ff7a59 0%, #ef4444 100%);
    box-shadow: 0 16px 26px rgba(239, 68, 68, 0.24);
}

.primary-btn:disabled {
    cursor: wait;
    opacity: 0.72;
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #241d30;
    border: 1px solid rgba(36, 29, 48, 0.12);
    box-shadow: 0 10px 20px rgba(36, 29, 48, 0.06);
}

.payment-status {
    min-height: 1.35em;
    margin: 12px 2px 0;
    color: #746969;
    font-size: 0.9rem;
    line-height: 1.5;
}

.payment-status[data-state="pending"] {
    color: #8a5a00;
}

.payment-status[data-state="success"] {
    color: #0f6a3f;
}

.payment-status[data-state="error"] {
    color: #9f1239;
}

.account-note {
    margin: 14px 2px 0;
    color: #746969;
    text-align: center;
}

@media (max-width: 480px) {
    #account-screen {
        margin: -20px;
        padding: 0;
    }

    .login-card {
        min-height: 100dvh;
        padding: 18px 16px 110px;
    }

    .account-hero {
        border-radius: 0 0 8px 8px;
        margin: -18px -16px 0;
        padding: 20px 16px 18px;
    }

    .account-hero-top {
        align-items: flex-start;
    }

    .profile-mark {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
    }

    .account-stats {
        grid-template-columns: 1fr;
    }

    .account-stat-wide {
        grid-column: auto;
    }

    .account-actions {
        grid-template-columns: 1fr;
    }

    .avatar-panel .section-heading {
        display: grid;
    }

    .avatar-panel-close {
        width: 100%;
    }

    .card-header h2 {
        font-size: 1.32rem;
    }
}

/* ---- Category Tiles (home screen) ---- */

#category-tiles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 2px 14px;
}

.category-tile {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 14px;
    width: 100%;
    padding: 16px 52px 16px 16px;
    border-radius: 18px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-tile-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.category-tile:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px rgba(31, 30, 51, 0.08);
}

.category-tile[data-category="units"] {
    background: #FFF1C9;
    color: #6B4A12;
    border: 1.5px solid #F0D89B;
    box-shadow: 0 6px 14px rgba(110, 80, 30, 0.14);
}

.category-tile[data-category="units"] .category-tile-count {
    background: #FFE2A0;
    color: #6B4A12;
}

.category-tile[data-category="quiz"] {
    background: #D8F3E8;
    color: #0B5E45;
    border: 1.5px solid #A9DFC7;
    box-shadow: 0 6px 14px rgba(20, 100, 70, 0.14);
}

.category-tile[data-category="quiz"] .category-tile-count {
    background: #BCE9D6;
    color: #0B5E45;
}

.category-tile[data-category="order"] {
    background: #DCEEFD;
    color: #1B4D7A;
    border: 1.5px solid #AED3F2;
    box-shadow: 0 6px 14px rgba(20, 70, 120, 0.14);
}

.category-tile[data-category="order"] .category-tile-count {
    background: #BFDFF9;
    color: #1B4D7A;
}

.category-tile[data-category="voice"] {
    background: #FFD7C9;
    color: #8A3B22;
    border: 1.5px solid #F4B79E;
    box-shadow: 0 6px 14px rgba(140, 60, 30, 0.16);
}

.category-tile[data-category="voice"] .category-tile-count {
    background: #FFCBB8;
    color: #8A3B22;
}

.category-tile--community {
    background: #EDE7FF;
    color: #3D2080;
    border: 1.5px solid #C9B8F5;
    box-shadow: 0 6px 14px rgba(61, 32, 128, 0.12);
}

.category-tile--vocab {
    min-height: 112px;
    background: #FFEAF2;
    color: #4A2434;
    border: 1.5px solid #F5BFD2;
    box-shadow: 0 6px 14px rgba(130, 45, 78, 0.12);
}

.category-tile--community .category-tile-count {
    background: #D5C4F7;
    color: #3D2080;
}

.category-tile-name {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 3px;
}

.category-tile-sub {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.3;
    margin-bottom: 10px;
}

.category-tile-count {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.category-tile-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    opacity: 0.7;
    line-height: 1;
}

.tile-icon-wrap {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.tile-progress-bar-wrap {
    height: 6px;
    border-radius: 999px;
    background: rgba(0,0,0,0.10);
    margin-top: 8px;
    overflow: hidden;
}
.tile-progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: rgba(0,0,0,0.25);
    transition: width 0.6s ease;
}

/* ---- Category back button ---- */

.category-back-row {
    padding: 0 2px 4px;
}

.category-back-row.hidden {
    display: none;
}

.category-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f7faf9;
    border: 1px solid rgba(11, 94, 69, 0.18);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #0B5E45;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10);
    cursor: pointer;
    font-family: inherit;
}

.category-back-btn:active {
    transform: scale(0.97);
}

/* ---- Best-after sub-label on activity cards ---- */

.card-sub-label {
    margin: 0 0 6px;
    font-size: 0.75rem;
    color: #6b7898;
    font-weight: 600;
    letter-spacing: 0.01em;
}
