:root {
    --bg: #f5f7fb;
    --text: #142033;
    --muted: #64748b;
    --blue: #2563eb;
    --purple: #7c3aed;
    --card: #ffffff;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.topbar {
    height: 72px;
    padding: 0 32px;
    background: #111827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    color: white;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand span {
    font-size: 24px;
}

.brand small {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 22px;
    font-weight: 700;
    opacity: 0.86;
}

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 34px 28px;
}

.hero {
    min-height: 430px;
    border-radius: 30px;
    padding: 46px;
    color: white;
    background: radial-gradient(circle at top left, #60a5fa, transparent 35%),
                linear-gradient(135deg, var(--blue), var(--purple));
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 32px;
    align-items: center;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.25);
}

.eyebrow {
    font-size: 14px;
    text-transform: uppercase;
    opacity: 0.8;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.hero h1 {
    font-size: 52px;
    margin: 12px 0 18px;
    line-height: 1.05;
}

.hero p {
    font-size: 19px;
    line-height: 1.6;
    opacity: 0.94;
}

.hero-actions {
    margin-top: 28px;
    display: flex;
    gap: 14px;
}

.primary-btn,
.secondary-btn {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
}

.primary-btn {
    background: white;
    color: var(--blue);
}

.secondary-btn {
    background: rgba(255,255,255,0.14);
    color: white;
    border: 1px solid rgba(255,255,255,0.35);
}

.hero-card {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(12px);
    border-radius: 22px;
    padding: 26px;
}

.hero-card h3 {
    margin-top: 0;
    font-size: 26px;
}

.hero-card li {
    margin: 10px 0;
}

.section {
    margin-top: 34px;
}

.section h1,
.section h2 {
    margin: 0 0 8px;
    font-size: 34px;
}

.section-subtitle {
    color: var(--muted);
    margin-bottom: 22px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.module-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.module-tag {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 900;
}

.module-card h3 {
    margin: 14px 0 4px;
    font-size: 23px;
}

.module-zh {
    color: var(--muted);
    font-weight: 800;
}

.module-card p {
    color: var(--muted);
    line-height: 1.55;
}

.practice-panel {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.practice-panel h1 {
    margin: 14px 0 4px;
}

.practice-panel h2 {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 22px;
}

.placeholder-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 20px;
    margin: 24px 0;
}

footer {
    max-width: 1180px;
    margin: 20px auto 40px;
    padding: 0 28px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

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

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

    .topbar {
        padding: 0 18px;
    }

    nav a {
        margin-left: 12px;
    }
}

/* ================================
   Mobile UI Optimization
   Target: phones and small tablets
   ================================ */

@media (max-width: 768px) {
    body {
        background: #f7f8fc;
    }

    .topbar {
        height: auto;
        min-height: 64px;
        padding: 14px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .brand span {
        font-size: 22px;
    }

    .brand small {
        font-size: 11px;
    }

    nav {
        width: 100%;
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    nav a {
        margin-left: 0;
        white-space: nowrap;
        font-size: 14px;
        padding: 8px 10px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.1);
    }

    main {
        padding: 18px 14px;
    }

    .hero {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 28px 20px;
        border-radius: 22px;
        gap: 22px;
    }

    .eyebrow {
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .hero h1 {
        font-size: 34px;
        line-height: 1.08;
        margin: 10px 0 14px;
    }

    .hero p {
        font-size: 16px;
        line-height: 1.55;
    }

    .hero-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 22px;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        text-align: center;
        padding: 13px 16px;
        border-radius: 14px;
        font-size: 15px;
    }

    .hero-card {
        padding: 20px;
        border-radius: 18px;
    }

    .hero-card h3 {
        font-size: 22px;
    }

    .hero-card ul {
        padding-left: 20px;
        margin-bottom: 0;
    }

    .hero-card li {
        font-size: 14px;
        line-height: 1.45;
    }

    .section {
        margin-top: 24px;
    }

    .section h1,
    .section h2 {
        font-size: 28px;
        line-height: 1.15;
    }

    .section-subtitle {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 18px;
    }

    .module-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .module-card {
        border-radius: 18px;
        padding: 20px;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    }

    .module-card:hover {
        transform: none;
    }

    .module-tag {
        font-size: 11px;
        padding: 5px 8px;
    }

    .module-card h3 {
        font-size: 21px;
        margin-top: 12px;
    }

    .module-zh {
        font-size: 15px;
    }

    .module-card p {
        font-size: 15px;
        line-height: 1.5;
    }

    .practice-panel {
        border-radius: 20px;
        padding: 22px;
    }

    .practice-panel h1 {
        font-size: 28px;
    }

    .practice-panel h2 {
        font-size: 19px;
    }

    .placeholder-box {
        padding: 18px;
        border-radius: 14px;
    }

    footer {
        margin: 12px auto 28px;
        padding: 0 16px;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
        text-align: center;
    }
}

/* Extra-small phones */
@media (max-width: 420px) {
    .topbar {
        padding: 12px 14px;
    }

    main {
        padding: 14px 10px;
    }

    .hero {
        padding: 24px 18px;
        border-radius: 20px;
    }

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

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

    .hero-card {
        padding: 18px;
    }

    .section h1,
    .section h2 {
        font-size: 25px;
    }

    .module-card {
        padding: 18px;
    }

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

    .practice-panel {
        padding: 20px;
    }
}

.sentence-builder-app h3 {
    margin-top: 24px;
    margin-bottom: 10px;
}

.sb-toolbar {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 18px 0;
    flex-wrap: wrap;
}

.sb-toolbar select {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
}

.small-btn,
.primary-action,
.secondary-action {
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 800;
    cursor: pointer;
}

.small-btn {
    background: #eef2ff;
    color: #4338ca;
}

.sb-prompt {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    font-weight: 700;
    color: #334155;
}

.chunk-zone {
    min-height: 76px;
    padding: 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.answer-zone {
    background: #eef2ff;
    border-color: #818cf8;
}

.chunk {
    border: 1px solid #cbd5e1;
    background: white;
    color: #172033;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.chunk:hover {
    transform: translateY(-1px);
}

.sb-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.primary-action {
    background: #2563eb;
    color: white;
}

.secondary-action {
    background: #e5e7eb;
    color: #111827;
}

.result-box {
    margin-top: 22px;
    border-radius: 18px;
    padding: 18px;
    line-height: 1.55;
}

.result-box.correct {
    background: #ecfdf5;
    border: 1px solid #86efac;
}

.result-box.incorrect {
    background: #fff7ed;
    border: 1px solid #fdba74;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .chunk-zone {
        min-height: 96px;
        align-items: flex-start;
    }

    .chunk {
        width: 100%;
        border-radius: 14px;
        text-align: left;
    }

    .sb-actions {
        flex-direction: column;
    }

    .primary-action,
    .secondary-action,
    .small-btn {
        width: 100%;
    }
}

.auth-panel {
    max-width: 560px;
    margin: 0 auto;
}

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

.auth-form label {
    font-weight: 800;
    color: #334155;
}

.auth-form input,
.auth-form select {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    background: white;
}

.auth-message {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
}

.auth-message.success {
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
}

.auth-message.error {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
}

.auth-note {
    margin-top: 20px;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .auth-panel {
        margin: 0;
    }

    .auth-form input,
    .auth-form select,
    .auth-form button {
        width: 100%;
    }
}

.projection-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.projection-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.projection-header h2 {
    margin: 6px 0 4px;
    color: #172033;
}

.projection-status {
    color: #64748b;
    font-weight: 700;
    margin: 0;
}

.projection-overall {
    text-align: right;
    background: #eef2ff;
    border-radius: 18px;
    padding: 16px 18px;
    min-width: 220px;
}

.projection-overall span {
    display: block;
    font-size: 1.3rem;
    font-weight: 900;
    color: #1e3a8a;
}

.projection-overall small {
    color: #475569;
    font-weight: 700;
}

.projection-legacy,
.projection-message,
.projection-coverage {
    color: #334155;
    line-height: 1.55;
}

.projection-message {
    background: #f8fafc;
    border-left: 4px solid #818cf8;
    border-radius: 12px;
    padding: 12px 14px;
}

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

.projection-section-row {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 14px;
    background: #f8fafc;
}

.projection-section-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #172033;
    margin-bottom: 10px;
}

.coverage-bar-wrap {
    width: 100%;
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.coverage-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 999px;
}

.projection-section-row small {
    color: #64748b;
    font-weight: 700;
}

@media (max-width: 768px) {
    .projection-header {
        flex-direction: column;
    }

    .projection-overall {
        width: 100%;
        text-align: left;
    }

    .projection-sections {
        grid-template-columns: 1fr;
    }
}

.visual-engagement {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 14px 18px;
    margin: 18px 0 22px;
}

.streak-display,
.credit-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.streak-icons {
    font-size: 1.55rem;
    letter-spacing: 2px;
    line-height: 1;
}

.streak-icons.broken {
    margin-left: 6px;
}

.coin-icon {
    font-size: 1.55rem;
}

.credit-number {
    font-size: 1.45rem;
    font-weight: 950;
    color: #172033;
}

.visual-engagement .engagement-label {
    font-size: 0.82rem;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .visual-engagement {
        flex-direction: column;
        align-items: flex-start;
    }

    .streak-icons {
        font-size: 1.35rem;
    }
}

.visual-engagement {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 14px 18px;
    margin: 18px 0 22px;
}

.streak-display,
.credit-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.streak-icons {
    font-size: 1.55rem;
    letter-spacing: 2px;
    line-height: 1;
}

.streak-icons.broken {
    margin-left: 6px;
}

.coin-icon {
    font-size: 1.55rem;
}

.credit-number {
    font-size: 1.45rem;
    font-weight: 950;
    color: #172033;
}

.visual-engagement .engagement-label {
    font-size: 0.82rem;
    font-weight: 900;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 768px) {
    .visual-engagement {
        flex-direction: column;
        align-items: flex-start;
    }

    .streak-icons {
        font-size: 1.35rem;
    }
}

.visual-engagement {
    overflow: hidden;
}

.streak-display {
    flex: 1;
    min-width: 0;
}

.streak-icons {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    max-width: 100%;
}

.streak-icons.broken {
    display: none;
}

.account-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.avatar-menu {
    position: relative;
}

.avatar-button {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 950;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-button:hover {
    background: #dbeafe;
}

.avatar-dropdown {
    position: absolute;
    right: 0;
    top: 48px;
    min-width: 160px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    padding: 8px;
    z-index: 1000;
}

.avatar-dropdown a,
.avatar-dropdown button {
    width: 100%;
    display: block;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: white;
    color: #172033;
    font-weight: 800;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.avatar-dropdown a:hover,
.avatar-dropdown button:hover {
    background: #f1f5f9;
}

.account-box {
    margin-top: 20px;
}

.account-profile {
    display: flex;
    gap: 18px;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
}

.account-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 950;
}

.account-login-btn {
    display: inline-block;
    text-decoration: none;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .avatar-dropdown {
        right: auto;
        left: 0;
    }

    .account-profile {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Account navigation and account page */

.account-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.account-cluster {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 999px;
    padding: 7px 10px;
    font-weight: 900;
}

.avatar-menu {
    position: relative;
}

.avatar-button {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 950;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-button:hover {
    background: #dbeafe;
}

.avatar-dropdown {
    position: absolute;
    right: 0;
    top: 48px;
    min-width: 230px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    padding: 10px;
    z-index: 1000;
}

.avatar-dropdown-header {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
}

.avatar-dropdown-header small {
    display: block;
    color: #64748b;
    margin-top: 2px;
}

.avatar-small {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.avatar-dropdown a,
.avatar-dropdown button {
    width: 100%;
    display: block;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: white;
    color: #172033;
    font-weight: 800;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.avatar-dropdown a:hover,
.avatar-dropdown button:hover {
    background: #f1f5f9;
}

.account-page-header {
    margin-bottom: 22px;
}

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

.account-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.account-card-header h3 {
    margin: 0;
    color: #172033;
}

.account-card-header p {
    margin: 6px 0 16px;
    color: #64748b;
    line-height: 1.5;
}

.account-profile.compact {
    align-items: center;
}

.account-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 950;
    flex: 0 0 auto;
}

.account-profile {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 0;
    color: #334155;
}

.metric-row strong {
    color: #172033;
    text-align: right;
}

.credit-big {
    display: flex;
    align-items: baseline;
    gap: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

.credit-big span {
    font-size: 1.5rem;
}

.credit-big strong {
    font-size: 2rem;
    color: #9a3412;
}

.credit-big small {
    color: #9a3412;
    font-weight: 800;
}

.account-note {
    margin-top: 14px;
    background: #f8fafc;
    border-left: 4px solid #818cf8;
    border-radius: 12px;
    padding: 12px;
    color: #475569;
    line-height: 1.5;
}

.danger-action {
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 900;
    cursor: pointer;
}

.danger-action:hover {
    background: #fecaca;
}

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }

    .avatar-dropdown {
        right: 0;
        min-width: 220px;
    }

    .nav-credit-pill {
        display: none;
    }

    .account-profile {
        flex-direction: column;
    }
}

/* Clean account navigation and account dashboard patch */

.account-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.account-cluster {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 999px;
    padding: 7px 10px;
    font-weight: 900;
}

.avatar-menu {
    position: relative;
}

.avatar-button {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 950;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-dropdown {
    position: absolute;
    right: 0;
    top: 48px;
    min-width: 230px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    padding: 10px;
    z-index: 1000;
}

.avatar-dropdown-header {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
}

.avatar-dropdown-header small {
    display: block;
    color: #64748b;
    margin-top: 2px;
}

.avatar-small {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.avatar-dropdown a,
.avatar-dropdown button {
    width: 100%;
    display: block;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: white;
    color: #172033;
    font-weight: 800;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.avatar-dropdown a:hover,
.avatar-dropdown button:hover {
    background: #f1f5f9;
}

.account-page-header {
    margin-bottom: 22px;
}

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

.account-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.account-card-header h3 {
    margin: 0;
    color: #172033;
}

.account-card-header p {
    margin: 6px 0 16px;
    color: #64748b;
    line-height: 1.5;
}

.account-profile {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.account-profile.compact {
    align-items: center;
}

.account-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 950;
    flex: 0 0 auto;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 0;
    color: #334155;
}

.metric-row strong {
    color: #172033;
    text-align: right;
}

.credit-big {
    display: flex;
    align-items: baseline;
    gap: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 12px;
}

.credit-big span {
    font-size: 1.5rem;
}

.credit-big strong {
    font-size: 2rem;
    color: #9a3412;
}

.credit-big small {
    color: #9a3412;
    font-weight: 800;
}

.account-note {
    margin-top: 14px;
    background: #f8fafc;
    border-left: 4px solid #818cf8;
    border-radius: 12px;
    padding: 12px;
    color: #475569;
    line-height: 1.5;
}

.danger-action {
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 900;
    cursor: pointer;
}

.danger-action:hover {
    background: #fecaca;
}

@media (max-width: 768px) {
    .account-grid {
        grid-template-columns: 1fr;
    }

    .nav-credit-pill {
        display: none;
    }

    .account-profile {
        flex-direction: column;
    }
}

.voice-practice-app {
    max-width: 900px;
    margin: 0 auto;
}

.voice-prompt-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    margin: 20px 0;
}

.voice-prompt-card strong {
    color: #334155;
}

.voice-prompt-card p {
    margin-bottom: 0;
    font-size: 1.08rem;
    line-height: 1.6;
}

.recording-console {
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
    margin-top: 18px;
}

.recording-status {
    font-weight: 900;
    color: #64748b;
    margin-bottom: 10px;
}

.recording-status.recording {
    color: #dc2626;
}

.recording-status.complete {
    color: #166534;
}

.recording-status.error {
    color: #991b1b;
}

.recording-status.uploading {
    color: #1e3a8a;
}

.recording-timer {
    font-size: 3rem;
    font-weight: 950;
    color: #172033;
    letter-spacing: 0.04em;
    margin-bottom: 18px;
}

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

.record-btn,
.stop-btn {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 900;
    cursor: pointer;
}

.record-btn {
    background: #2563eb;
    color: white;
}

.stop-btn {
    background: #fee2e2;
    color: #991b1b;
}

.record-btn:disabled,
.stop-btn:disabled,
.primary-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.recording-note {
    color: #64748b;
    font-size: 0.92rem;
    margin-top: 14px;
    line-height: 1.5;
}

.audio-preview {
    margin-top: 22px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
}

.audio-preview audio {
    width: 100%;
    margin: 8px 0 16px;
}

.upload-result {
    margin-top: 22px;
    border-radius: 18px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.upload-result.success {
    background: #ecfdf5;
    border-color: #86efac;
}

.upload-result.error {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.upload-result a {
    color: #2563eb;
    font-weight: 800;
}

@media (max-width: 768px) {
    .recording-timer {
        font-size: 2.4rem;
    }

    .recording-actions button {
        width: 100%;
    }
}

.admin-page {
    max-width: 1180px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.admin-stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.admin-stat-card span {
    display: block;
    color: #64748b;
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.admin-stat-card strong {
    font-size: 2rem;
    color: #172033;
}

.admin-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

.admin-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    overflow-x: auto;
    margin-bottom: 18px;
}

.admin-card h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.admin-table th {
    text-align: left;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 8px;
}

.admin-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 10px 8px;
    vertical-align: top;
}

.admin-table a {
    color: #2563eb;
    font-weight: 800;
}

.admin-search {
    display: flex;
    gap: 10px;
    margin: 18px 0;
}

.admin-search input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 1rem;
}

@media (max-width: 900px) {
    .admin-stats-grid,
    .admin-two-column {
        grid-template-columns: 1fr;
    }

    .admin-header {
        flex-direction: column;
    }
}

.admin-login-card {
    max-width: 460px;
    margin: 40px auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.admin-login-form {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.admin-login-form label {
    font-weight: 800;
    color: #334155;
}

.admin-login-form input {
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 1rem;
}

.nav-inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.nav-link-button {
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.nav-link-button:hover {
    text-decoration: underline;
}

.nav-inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.nav-link-button {
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.nav-link-button:hover {
    text-decoration: underline;
}

.nav-inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.nav-link-button {
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.nav-link-button:hover {
    text-decoration: underline;
}

.admin-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-settings-form {
    display: grid;
    gap: 12px;
    max-width: 420px;
    margin-top: 18px;
}

.admin-settings-form label {
    font-weight: 900;
    color: #334155;
}

.admin-settings-form input {
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 1rem;
}
