/* ==========================================================================
   Langua design system
   Palette: aegean blue #1e6091, sun gold #f9a826, sea foam #f4f9fc
   Mobile-first: bottom tab bar < 768px, left sidebar >= 768px
   ========================================================================== */

:root {
    --lg-primary: #1e6091;
    --lg-primary-dark: #14456b;
    --lg-accent: #f9a826;
    --lg-accent-dark: #d88c0e;
    --lg-bg: #f4f9fc;
    --lg-surface: #ffffff;
    --lg-text: #1f2d3d;
    --lg-text-muted: #5f7285;
    --lg-success: #2e9e5b;
    --lg-danger: #d64545;
    --lg-radius: 16px;
    --lg-shadow: 0 2px 10px rgba(30, 96, 145, 0.10);
    --lg-header-h: 3.5rem;
    --lg-bottomnav-h: 3.75rem;
    --lg-sidebar-w: 13rem;
}

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--lg-bg);
    color: var(--lg-text);
    margin: 0;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--lg-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--lg-primary);
    border-color: var(--lg-primary-dark);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--lg-accent);
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--lg-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: linear-gradient(135deg, var(--lg-primary) 0%, var(--lg-primary-dark) 100%);
    color: #fff;
    box-shadow: var(--lg-shadow);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.app-brand-icon {
    font-size: 1.5rem;
}

.app-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-header-link {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
}

.app-header-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.app-logout-form {
    margin: 0;
}

/* --------------------------------------------------------------------------
   User menu (Radzen profile menu in the header)
   -------------------------------------------------------------------------- */

/* The Radzen theme paints the trigger with its own primary color and padding,
   which clashes with (and overflows) the app header — blend it in instead. */
.app-header .user-menu .rz-profile-menu {
    background: transparent;
    padding: 0;
}

.app-header .user-menu .rz-profile-menu > .rz-navigation-item > .rz-navigation-item-wrapper {
    background: transparent;
    border-radius: 10px;
    padding: 0.25rem 0.5rem;
    transition: background 0.15s ease;
}

.app-header .user-menu .rz-profile-menu > .rz-navigation-item > .rz-navigation-item-wrapper:hover,
.app-header .user-menu .rz-profile-menu > .rz-navigation-item > .rz-navigation-item-wrapper.rz-navigation-item-wrapper-active {
    background: rgba(255, 255, 255, 0.15);
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu-trigger .rz-gravatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.user-menu-name {
    color: #fff;
    font-size: 0.9rem;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Caret of the trigger sits on the blue header. */
.user-menu .rz-profile-menu .rz-navigation-item-icon-children {
    color: #fff;
}

/* Item icons inside the dropdown (white panel) use the brand color. */
.user-menu .rz-navigation-menu .rz-navigation-item-icon {
    color: var(--lg-primary);
}

@media (max-width: 640px) {
    .user-menu-name {
        display: none;
    }
}

.app-main {
    flex: 1;
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem 1rem calc(var(--lg-bottomnav-h) + 1.5rem);
    box-sizing: border-box;
}

/* Logged-out pages have no bottom tab bar to clear. */
.app-main--public {
    padding-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   Navigation: bottom tab bar (mobile-first)
   -------------------------------------------------------------------------- */

.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--lg-bottomnav-h);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: var(--lg-surface);
    border-top: 1px solid rgba(30, 96, 145, 0.15);
    box-shadow: 0 -2px 10px rgba(30, 96, 145, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
}

.app-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    text-decoration: none;
    color: var(--lg-text-muted);
    font-size: 0.7rem;
    border-top: 3px solid transparent;
}

.app-nav-item.active {
    color: var(--lg-primary);
    border-top-color: var(--lg-accent);
    font-weight: 600;
}

.app-nav-icon {
    font-size: 1.35rem;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   Desktop: left sidebar
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
    .app-nav {
        top: var(--lg-header-h);
        bottom: 0;
        right: auto;
        width: var(--lg-sidebar-w);
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        border-top: none;
        border-right: 1px solid rgba(30, 96, 145, 0.15);
        padding: 1rem 0;
        box-shadow: none;
    }

    .app-nav-item {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        border-top: none;
        border-left: 3px solid transparent;
    }

    .app-nav-item.active {
        border-top-color: transparent;
        border-left-color: var(--lg-accent);
        background: rgba(30, 96, 145, 0.06);
    }

    .app-main:not(.app-main--public) {
        /* Fill the space right of the fixed sidebar (margins are not part of
           width, so never combine width:100% with a sidebar margin), cap at a
           readable width and center within the remaining space. */
        width: calc(100% - var(--lg-sidebar-w));
        max-width: 56rem;
        margin: 0 0 0 calc(var(--lg-sidebar-w) + max(0rem, (100% - var(--lg-sidebar-w) - 56rem) / 2));
        padding: 1.5rem 2rem 2rem;
    }

    /* Logged out: no sidebar exists, so keep the content viewport-centered. */
    .app-main--public {
        padding: 1.5rem 2rem 2rem;
    }
}

/* --------------------------------------------------------------------------
   Cards & shared bits
   -------------------------------------------------------------------------- */

.lg-card {
    background: var(--lg-surface);
    border-radius: var(--lg-radius);
    box-shadow: var(--lg-shadow);
    padding: 1.25rem;
}

/* --------------------------------------------------------------------------
   Forms / validation (Identity pages)
   -------------------------------------------------------------------------- */

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* --------------------------------------------------------------------------
   Error UI
   -------------------------------------------------------------------------- */

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: var(--lg-radius);
}

.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten.";
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    bottom: 0;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Typography helpers
   -------------------------------------------------------------------------- */

.page-title {
    font-size: 1.5rem;
    margin: 0.25rem 0 1rem;
}

.section-title {
    font-size: 1.15rem;
    margin: 1.5rem 0 0.75rem;
}

.text-muted {
    color: var(--lg-text-muted);
}

/* --------------------------------------------------------------------------
   Landing
   -------------------------------------------------------------------------- */

.landing {
    text-align: center;
    max-width: 28rem;
    margin: 2rem auto;
}

.landing-mascot {
    font-size: 4rem;
    display: block;
}

.landing-tagline {
    font-size: 1.1rem;
    color: var(--lg-text-muted);
}

.landing-features {
    list-style: none;
    padding: 0;
    text-align: left;
    display: inline-block;
    line-height: 2;
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-greeting {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-greeting h1 {
    font-size: 1.35rem;
    margin: 0;
}

.dashboard-greeting p {
    margin: 0;
}

.dashboard-mascot {
    font-size: 2.5rem;
}

.dashboard-level {
    margin-top: 1rem;
}

.dashboard-level-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.level-badge {
    background: var(--lg-accent);
    color: #4a3000;
    font-weight: 700;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

.xp-text {
    font-size: 0.85rem;
    color: var(--lg-text-muted);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.5rem;
    gap: 0.15rem;
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--lg-text-muted);
}

.dashboard-next {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-next h3 {
    margin: 0.25rem 0 0;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--lg-text);
    transition: transform 0.1s ease;
}

.action-card:hover {
    transform: translateY(-2px);
}

.action-icon {
    font-size: 1.75rem;
}

/* --------------------------------------------------------------------------
   Course path (Learn)
   -------------------------------------------------------------------------- */

.course-path {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.unit-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.unit-icon {
    font-size: 2rem;
}

.unit-title {
    font-size: 1.15rem;
    margin: 0;
}

.unit-progress-text {
    font-size: 0.8rem;
    color: var(--lg-text-muted);
}

.unit-lessons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lesson-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border: 2px solid rgba(30, 96, 145, 0.15);
    border-radius: 12px;
    background: var(--lg-surface);
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    color: var(--lg-text);
    transition: border-color 0.15s ease, transform 0.1s ease;
}

.lesson-chip:hover {
    border-color: var(--lg-primary);
    transform: translateX(3px);
}

.lesson-chip.completed {
    border-color: var(--lg-success);
    background: rgba(46, 158, 91, 0.06);
}

.lesson-chip-icon {
    font-size: 1.25rem;
}

.lesson-chip-title {
    flex: 1;
}

.lesson-chip-xp {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lg-accent-dark);
}

.lesson-chip.completed .lesson-chip-xp {
    color: var(--lg-success);
}

/* --------------------------------------------------------------------------
   Lesson player
   -------------------------------------------------------------------------- */

.lesson-header {
    margin-bottom: 0.75rem;
}

.lesson-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lesson-intro {
    font-size: 1.05rem;
    margin: 0;
}

.lesson-tip {
    background: rgba(249, 168, 38, 0.12);
    border-radius: 10px;
    padding: 0.75rem;
    margin: 0;
}

.lesson-start {
    align-self: center;
    min-width: 60%;
}

.lesson-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.lesson-close {
    border: none;
    background: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--lg-text-muted);
}

.lesson-progress-text {
    font-size: 0.85rem;
    color: var(--lg-text-muted);
    white-space: nowrap;
}

.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.6rem;
}

.letter-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.75rem 0.4rem;
    border: 2px solid rgba(30, 96, 145, 0.15);
    border-radius: 12px;
    background: var(--lg-surface);
    cursor: pointer;
}

.letter-card:hover {
    border-color: var(--lg-primary);
}

.letter-glyph {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--lg-primary);
}

.letter-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.letter-sound {
    font-size: 0.72rem;
    color: var(--lg-text-muted);
    text-align: center;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.word-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 10px;
    background: rgba(30, 96, 145, 0.04);
}

.word-texts {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.word-greek {
    font-weight: 600;
    font-size: 1.05rem;
}

.word-translit {
    font-size: 0.78rem;
    color: var(--lg-text-muted);
}

.word-german {
    text-align: right;
    font-size: 0.92rem;
    display: flex;
    flex-direction: column;
}

.word-notes {
    font-size: 0.72rem;
    color: var(--lg-text-muted);
    max-width: 14rem;
}

.grammar-table {
    border-collapse: collapse;
    width: 100%;
}

.grammar-table th, .grammar-table td {
    border: 1px solid rgba(30, 96, 145, 0.2);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.grammar-table th {
    background: rgba(30, 96, 145, 0.08);
}

/* --------------------------------------------------------------------------
   Exercises
   -------------------------------------------------------------------------- */

.exercise-prompt {
    font-size: 1.15rem;
    font-weight: 600;
}

.exercise-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exercise-option {
    padding: 0.8rem 1rem;
    border: 2px solid rgba(30, 96, 145, 0.2);
    border-radius: 12px;
    background: var(--lg-surface);
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: border-color 0.15s ease;
}

.exercise-option:hover:not(:disabled) {
    border-color: var(--lg-primary);
}

.exercise-option.correct {
    border-color: var(--lg-success);
    background: rgba(46, 158, 91, 0.1);
}

.exercise-option.wrong {
    border-color: var(--lg-danger);
    background: rgba(214, 69, 69, 0.08);
}

.exercise-fill {
    display: flex;
    gap: 0.5rem;
}

.exercise-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 2px solid rgba(30, 96, 145, 0.25);
    border-radius: 10px;
    font-size: 1rem;
}

.exercise-feedback {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 12px;
}

.exercise-feedback.correct {
    background: rgba(46, 158, 91, 0.12);
    border: 1px solid var(--lg-success);
}

.exercise-feedback.wrong {
    background: rgba(214, 69, 69, 0.08);
    border: 1px solid var(--lg-danger);
}

.feedback-answer {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0.25rem 0;
}

.feedback-hint {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
}

.feedback-next {
    margin-top: 0.75rem;
}

.exercise-pronunciation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.exercise-translit {
    color: var(--lg-text-muted);
    margin: 0;
}

.exercise-transcript {
    font-style: italic;
    color: var(--lg-text-muted);
}

.speak-button {
    border: none;
    background: rgba(30, 96, 145, 0.08);
    border-radius: 50%;
    width: 2.4rem;
    height: 2.4rem;
    font-size: 1.1rem;
    cursor: pointer;
}

.speak-button:hover {
    background: rgba(30, 96, 145, 0.18);
}

.mic-button {
    position: relative;
    overflow: hidden;
    border: none;
    background: var(--lg-primary);
    color: #fff;
    border-radius: 50%;
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: var(--lg-shadow);
    transition: transform 0.1s ease;
}

/* Input level indicator: fills from the bottom while the mic is open.
   --mic-level is driven client-side by languaSpeech.startLevelMeter. */
.mic-level {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--mic-level, 0%);
    background: rgba(255, 255, 255, 0.4);
    transition: height 70ms linear;
    pointer-events: none;
}

.mic-icon {
    position: relative;
}

/* Transcription in flight: calm the button down while ⏳ is shown. */
.mic-button.busy {
    animation: none;
    opacity: 0.75;
    cursor: wait;
}

.mic-button:hover:not(:disabled) {
    transform: scale(1.06);
}

.mic-button.listening {
    background: var(--lg-danger);
    animation: mic-pulse 1.2s infinite;
}

@keyframes mic-pulse {
    0% { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0.5); }
    70% { box-shadow: 0 0 0 14px rgba(214, 69, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0); }
}

.mic-unsupported {
    font-size: 1.2rem;
    opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Lesson completion & confetti
   -------------------------------------------------------------------------- */

.lesson-done {
    position: relative;
}

.lesson-done-card {
    text-align: center;
    max-width: 26rem;
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.lesson-done-mascot {
    font-size: 3rem;
}

.lesson-done-xp {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--lg-accent-dark);
    margin: 0;
}

.lesson-done-levelup {
    font-weight: 700;
    color: var(--lg-primary);
}

.lesson-done-score {
    color: var(--lg-text-muted);
    margin: 0;
}

.lesson-done-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.75rem;
}

.achievement-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(249, 168, 38, 0.15);
    border: 1px solid var(--lg-accent);
    border-radius: 12px;
    padding: 0.6rem 0.9rem;
    text-align: left;
}

.achievement-toast p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--lg-text-muted);
}

.achievement-icon {
    font-size: 1.75rem;
}

.confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    top: -12px;
    left: calc(var(--i) * 4.2%);
    width: 9px;
    height: 14px;
    background: hsl(calc(var(--i) * 47deg), 85%, 60%);
    opacity: 0.9;
    animation: confetti-fall 2.8s ease-in calc(var(--i) * 0.08s) forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(70vh) rotate(720deg);
        opacity: 0;
    }
}

/* --------------------------------------------------------------------------
   Flashcards
   -------------------------------------------------------------------------- */

.flashcard-scene {
    perspective: 1200px;
    max-width: 22rem;
    margin: 1rem auto;
    cursor: pointer;
}

.flashcard {
    position: relative;
    width: 100%;
    height: 15rem;
    transform-style: preserve-3d;
    transition: transform 0.45s ease;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--lg-radius);
    box-shadow: var(--lg-shadow);
    padding: 1rem;
    text-align: center;
}

.flashcard-front {
    background: var(--lg-surface);
}

.flashcard-back {
    background: var(--lg-primary);
    color: #fff;
    transform: rotateY(180deg);
}

.flashcard-greek {
    font-size: 1.8rem;
    font-weight: 700;
}

.flashcard-translit {
    color: var(--lg-text-muted);
}

.flashcard-german {
    font-size: 1.5rem;
    font-weight: 700;
}

.flashcard-notes {
    font-size: 0.85rem;
    opacity: 0.85;
}

.flashcard-tap-hint {
    position: absolute;
    bottom: 0.6rem;
    font-size: 0.7rem;
    color: var(--lg-text-muted);
}

.flashcard-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.flashcard-btn-again, .flashcard-btn-known {
    min-width: 8rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    border: 2px solid;
}

.flashcard-btn-again {
    border-color: var(--lg-danger);
    color: var(--lg-danger);
    background: #fff;
}

.flashcard-btn-known {
    border-color: var(--lg-success);
    background: var(--lg-success);
    color: #fff;
}

.flashcards-empty, .flashcards-done {
    text-align: center;
    max-width: 26rem;
    margin: 2rem auto;
}

.flashcards-empty-icon {
    font-size: 3rem;
    display: block;
}

/* --------------------------------------------------------------------------
   Langua avatar & chat
   -------------------------------------------------------------------------- */

.speak-page {
    display: flex;
    flex-direction: column;
    /* Viewport minus header, bottom nav and .app-main padding (1rem top +
       1.5rem clearance), with 0.5rem slack so rounding or an unexpected
       scrollbar never tips the page into overflow. */
    height: calc(100dvh - var(--lg-header-h) - var(--lg-bottomnav-h) - 3rem);
    min-height: 22rem;
    max-height: 52rem;
}

@media (min-width: 768px) {
    .speak-page {
        /* Viewport minus header and .app-main padding (1.5rem + 2rem) + slack. */
        height: calc(100dvh - var(--lg-header-h) - 4rem);
    }
}

.speak-avatar-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.avatar {
    position: relative;
    width: 8.5rem;
    height: 7.5rem;
}

.avatar-svg {
    width: 100%;
    height: 100%;
}

.avatar-eyes {
    animation: avatar-blink 4.5s infinite;
    transform-origin: center 92px;
}

@keyframes avatar-blink {
    0%, 94%, 100% { transform: scaleY(1); }
    96%, 98% { transform: scaleY(0.08); }
}

.avatar-mouth {
    transform-origin: 100px 132px;
}

.avatar.speaking .avatar-mouth {
    animation: avatar-talk 0.32s infinite alternate ease-in-out;
}

@keyframes avatar-talk {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(2.4); }
}

.avatar.thinking .avatar-svg {
    animation: avatar-bob 1.4s infinite ease-in-out;
}

@keyframes avatar-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.avatar-thinking-dots {
    opacity: 0;
    transition: opacity 0.2s;
}

.avatar.thinking .avatar-thinking-dots {
    opacity: 1;
    animation: avatar-dots 1.4s infinite;
}

@keyframes avatar-dots {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

.avatar-listen-ring {
    display: none;
    position: absolute;
    inset: -6px;
    border: 3px solid var(--lg-accent);
    border-radius: 50%;
}

.avatar.listening .avatar-listen-ring {
    display: block;
    animation: mic-pulse 1.2s infinite;
}

.speak-status {
    font-size: 0.85rem;
    color: var(--lg-text-muted);
    margin-bottom: 0.5rem;
}

.convo-toggle {
    border: 2px solid var(--lg-primary);
    background: var(--lg-surface);
    color: var(--lg-primary);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background 0.15s ease;
}

.convo-toggle:hover {
    background: rgba(30, 96, 145, 0.08);
}

.convo-toggle.active {
    background: var(--lg-danger);
    border-color: var(--lg-danger);
    color: #fff;
}

/* Live partial transcript while the user is still speaking. */
.chat-bubble.interim {
    opacity: 0.6;
    border: 1px dashed rgba(255, 255, 255, 0.6);
}

/* Typing caret on the streaming Langua reply. */
.chat-caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: var(--lg-primary);
    animation: caret-blink 0.8s steps(1) infinite;
}

@keyframes caret-blink {
    50% { opacity: 0; }
}

/* --- Chat management (multi-chat on the Speak page) --- */

.chat-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.chat-toolbar-btn {
    border: 1px solid var(--lg-border, #d6e4ee);
    background: var(--lg-surface, #fff);
    border-radius: 0.5rem;
    padding: 0.3rem 0.55rem;
    font-size: 1rem;
    cursor: pointer;
}

.chat-toolbar-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.chat-current-title {
    flex: 1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-list {
    background: var(--lg-surface, #fff);
    border: 1px solid var(--lg-border, #d6e4ee);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    max-height: 40vh;
    overflow-y: auto;
    box-shadow: var(--lg-shadow);
}

.chat-list-empty {
    padding: 0.75rem 1rem;
    color: var(--lg-text-muted);
    font-size: 0.9rem;
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--lg-border, #eef4f9);
}

.chat-list-item:last-child {
    border-bottom: none;
}

.chat-list-item.active {
    background: rgba(30, 96, 145, 0.08);
}

.chat-item-open {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.35rem 0.25rem;
    cursor: pointer;
    min-width: 0;
}

.chat-item-title {
    font-weight: 600;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-meta {
    font-size: 0.78rem;
    color: var(--lg-text-muted);
}

.chat-item-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem;
    opacity: 0.75;
}

.chat-item-btn:hover:not(:disabled) {
    opacity: 1;
}

.chat-rename-input {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--lg-primary);
    border-radius: 0.4rem;
    font-size: 0.95rem;
}

/* Beta ribbon: diagonal banner across the top-left corner, links to /beta. */
.beta-ribbon {
    position: fixed;
    top: 14px;
    left: -34px;
    z-index: 200; /* above the sticky header */
    transform: rotate(-45deg);
    background: #e67e22;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-decoration: none;
    text-align: center;
    width: 130px;
    padding: 0.22rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.beta-ribbon:hover {
    background: #d35400;
    color: #fff;
}

/* Bottom-left mini footer: build version + legal links, on every page. */
.app-footer {
    position: fixed;
    left: 0.5rem;
    bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.68rem;
    color: var(--lg-text-muted);
    opacity: 0.75;
    z-index: 2; /* above the landing background slider */
}

.app-footer a {
    color: inherit;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
    color: var(--lg-primary);
}

@media (max-width: 768px) {
    /* Keep clear of the mobile bottom tab bar. */
    .app-footer {
        bottom: calc(var(--lg-bottomnav-h, 0px) + 0.25rem);
    }
}

/* Legal pages (Impressum, AGB, Datenschutz). */
.legal-page {
    max-width: 46rem;
    margin: 1rem auto 2.5rem;
}

.legal-page h1 { margin-bottom: 1rem; }

.legal-page h3 { margin-top: 1.25rem; }

.legal-updated {
    margin-top: 1.5rem;
    color: var(--lg-text-muted);
    font-size: 0.85rem;
}

/* GDPR cookie notice (information banner — only necessary cookies exist). */
.cookie-notice {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.2rem;
    max-width: 40rem;
    width: calc(100% - 2rem);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--lg-surface, #fff);
    border-radius: var(--lg-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    z-index: 50;
}

.cookie-notice[hidden] { display: none; }

.cookie-notice button { white-space: nowrap; }

@media (max-width: 768px) {
    .cookie-notice {
        bottom: calc(var(--lg-bottomnav-h, 0px) + 0.75rem);
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

/* Pricing page. */
.pricing-title { text-align: center; }

.pricing-free-banner {
    text-align: center;
    margin-bottom: 1rem;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    padding-top: 1.6rem;
}

.pricing-card .btn { margin-top: auto; }

.pricing-card-highlight { border: 2px solid var(--lg-primary); }

.pricing-badge {
    position: absolute;
    top: -0.8rem;
    background: var(--lg-primary);
    color: #fff;
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.pricing-price {
    font-size: 2rem;
    font-weight: 800;
    margin: 0.25rem 0 0;
}

.pricing-period, .pricing-hint {
    font-size: 0.9rem;
    color: var(--lg-text-muted);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    padding: 0;
    text-align: left;
    line-height: 1.9;
}

.pricing-footnote {
    text-align: center;
    color: var(--lg-text-muted);
    margin-top: 1rem;
}

/* Billing banners (dashboard, Speak) + subscription page. */
.billing-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    border-left: 4px solid var(--lg-primary);
}

.billing-banner-warn { border-left-color: #d9534f; }

.subscription-state { font-size: 1.05rem; }

.subscription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.subscription-invoices { margin-top: 1rem; }

.admin-form-row {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.admin-form-row label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-weight: 600;
}

/* Landing page: auto-rotating country background slider (crossfade + Ken Burns). */
.landing-slider {
    position: fixed;
    inset: 0;
    /* 0, not -1: a negative z-index would paint BEHIND the opaque body
       background. The header is sticky with z-index 100, the landing card
       gets z-index 1 — the slider sits between page background and content. */
    z-index: 0;
    overflow: hidden;
    background: #1e3a52;
}

.landing-slide {
    position: absolute;
    inset: -5%; /* room for the Ken Burns zoom, no visible edges */
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.landing-slide.active {
    opacity: 1;
    animation: landing-kenburns 20s ease-out forwards;
}

.landing-slide-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The video has its own motion — no Ken Burns on top. */
.landing-slide-video.active {
    animation: none;
}

@keyframes landing-kenburns {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.landing-slider::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(12, 32, 52, 0.30), rgba(12, 32, 52, 0.55));
}

.landing-slider-dots {
    position: absolute;
    bottom: 1.2rem;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    z-index: 1;
}

.landing-dot {
    opacity: 0.45;
    font-size: 1.15rem;
    transition: opacity 0.4s, transform 0.4s;
}

.landing-dot.active {
    opacity: 1;
    transform: scale(1.3);
}

/* Keep the landing card readable on top of the imagery. */
.landing-over-slider {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* With the background slider active, the landing must fit the viewport —
   a page scrollbar over a fixed full-screen image looks broken. The card
   is compacted and vertically centered; only if a screen is genuinely too
   small (safe center) does scrolling return. */
.app-main:has(.landing-slider) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-content: safe center;
    padding-bottom: 1rem; /* logged-out page has no bottom nav */
}

.app-main:has(.landing-slider) .landing {
    margin: 0 auto;
}

.landing-over-slider .landing-mascot {
    font-size: 3rem;
}

.landing-over-slider h1 {
    font-size: 2.1rem;
    margin: 0.25rem 0 0.5rem;
}

.landing-over-slider .landing-tagline {
    font-size: 1.02rem;
    margin-bottom: 0.75rem;
}

.landing-over-slider .landing-features {
    line-height: 1.75;
    margin: 0.5rem 0;
}

.landing-over-slider p {
    margin-bottom: 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
    .landing-slide { transition: none; }
    .landing-slide.active { animation: none; }
}

/* Identity pages: shared brand card (AuthCard) over a calm background. */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #d7e7f2 0%, #eef5fa 60%, #f4f9fc 100%);
    background-size: cover;
    background-position: center;
}

.auth-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(18, 42, 66, 0.35);
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 26rem;
    margin: 2.5rem auto;
    background: rgba(255, 255, 255, 0.93);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--lg-radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    padding: 1.6rem 1.8rem 1.8rem;
}

.auth-brand {
    display: block;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--lg-primary);
    text-decoration: none;
    margin-bottom: 0.3rem;
}

.auth-title {
    text-align: center;
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 1.1rem;
}

.auth-card .form-control:focus {
    border-color: var(--lg-primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 96, 145, 0.2);
}

.auth-card .btn-primary {
    background: var(--lg-primary);
    border-color: var(--lg-primary);
}

.auth-card .btn-primary:hover {
    background: var(--lg-primary-dark, #174a70);
    border-color: var(--lg-primary-dark, #174a70);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--lg-text-muted);
    font-size: 0.85rem;
    margin: 1rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--lg-border, #d6e4ee);
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.92rem;
}

.auth-links a {
    color: var(--lg-primary);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Manage section: card look + pill navigation. */
.manage-shell {
    max-width: 52rem;
    margin: 0 auto;
}

.manage-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.manage-nav .nav-link {
    border: 1px solid var(--lg-border, #d6e4ee);
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 0.9rem;
    color: var(--lg-text, #223);
    background: var(--lg-surface, #fff);
}

.manage-nav .nav-link.active {
    background: var(--lg-primary);
    border-color: var(--lg-primary);
    color: #fff;
}

/* Landing page: visual-first hero in the lower third (mouflon stays visible). */
.landing-hero {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 4.5rem; /* above the slide dots and the mini footer */
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    padding: 0 1rem;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}

.landing-hero-brand {
    font-size: 2.6rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
}

.landing-hero .landing-cta {
    margin-top: 0.4rem;
    text-shadow: none;
}

/* Fresh install without backgrounds/video: centered, normal colors. */
.landing-hero--plain {
    position: static;
    margin: 4rem auto 0;
    color: var(--lg-text, #223);
    text-shadow: none;
}

.landing-hero--plain .landing-hero-brand {
    color: var(--lg-primary);
}

.landing-hero--plain .landing-slogan {
    color: var(--lg-primary);
}

.landing-slogan {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    min-height: 1.5em; /* text swaps must not shift the layout */
    transition: opacity 0.45s ease;
}

.landing-slogan.fade-out {
    opacity: 0;
}

.landing-cta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Landing page: available languages. */
.landing-languages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0.25rem;
}

.landing-language {
    border: 1px solid var(--lg-border, #d6e4ee);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--lg-surface, #fff);
}

/* Dashboard: which language am I learning (click = switch on /learn). */
.dashboard-language {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    border: 1px solid var(--lg-border, #d6e4ee);
    background: var(--lg-surface, #fff);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lg-primary);
    cursor: pointer;
}

/* Language picker on the Learn page (visible once a second course exists). */
.course-picker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.course-picker-label {
    font-weight: 600;
    color: var(--lg-text-muted);
}

.course-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 2px solid var(--lg-border, #d6e4ee);
    background: var(--lg-surface, #fff);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.course-pill.active {
    border-color: var(--lg-primary);
    background: rgba(30, 96, 145, 0.08);
    color: var(--lg-primary);
}

.course-pill:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Admin group divider in the sidebar (shown to admins only). */
.app-nav-section {
    margin: 1rem 0 0.25rem;
    padding: 0 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lg-text-muted);
}

.profile-toggle input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--lg-primary);
    cursor: pointer;
}

.speak-banner {
    margin-bottom: 0.75rem;
    background: rgba(249, 168, 38, 0.12);
    border: 1px solid var(--lg-accent);
}

.speak-banner p {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
}

.chat-transcript {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.5rem 0.15rem;
}

.chat-bubble {
    max-width: 85%;
    padding: 0.65rem 0.9rem;
    border-radius: 16px;
    box-shadow: var(--lg-shadow);
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: var(--lg-surface);
    border-bottom-left-radius: 4px;
}

.chat-bubble.user {
    align-self: flex-end;
    background: var(--lg-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-greek {
    margin: 0;
    font-size: 1rem;
}

.chat-german {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--lg-text-muted);
    border-top: 1px dashed rgba(30, 96, 145, 0.25);
    padding-top: 0.35rem;
}

.chat-actions {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.chat-action {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.1rem 0.25rem;
    border-radius: 6px;
}

.chat-action:hover {
    background: rgba(30, 96, 145, 0.08);
}

.chat-hint {
    align-self: center;
    background: rgba(249, 168, 38, 0.15);
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    max-width: 90%;
}

.chat-error {
    align-self: center;
    color: var(--lg-danger);
    font-size: 0.9rem;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.6rem;
}

.chat-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 2px solid rgba(30, 96, 145, 0.25);
    border-radius: 999px;
    font-size: 1rem;
}

.chat-send {
    border: none;
    background: var(--lg-accent);
    color: #4a3000;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-send:disabled {
    opacity: 0.4;
    cursor: default;
}

/* --------------------------------------------------------------------------
   Profile
   -------------------------------------------------------------------------- */

.profile-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.profile-avatar {
    font-size: 2.25rem;
}

.profile-name-edit {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    min-width: 14rem;
}

.profile-saved {
    color: var(--lg-success);
    font-size: 0.85rem;
}

.profile-stats {
    grid-template-columns: repeat(3, 1fr);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: 0.75rem;
}

.achievement-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 0.6rem;
}

.achievement-card p {
    font-size: 0.75rem;
    color: var(--lg-text-muted);
    margin: 0;
}

.achievement-card.locked {
    opacity: 0.45;
    filter: grayscale(1);
}

.achievement-date {
    font-size: 0.72rem;
    color: var(--lg-success);
}

.profile-settings {
    display: flex;
    flex-direction: column;
}

.profile-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(30, 96, 145, 0.1);
}

.profile-setting-row:last-child {
    border-bottom: none;
}

.profile-logout {
    color: var(--lg-danger);
}

/* --------------------------------------------------------------------------
   Admin area
   -------------------------------------------------------------------------- */

.admin-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.admin-nav-link {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 2px solid rgba(30, 96, 145, 0.2);
    background: var(--lg-surface);
    color: var(--lg-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.admin-nav-link:hover {
    border-color: var(--lg-primary);
}

.admin-nav-link.active {
    background: var(--lg-primary);
    border-color: var(--lg-primary);
    color: #fff;
    font-weight: 600;
}

.admin-stats {
    grid-template-columns: repeat(2, 1fr);
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .admin-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
}

.admin-user-cell {
    display: flex;
    flex-direction: column;
}

.admin-user-cell .text-muted {
    font-size: 0.8rem;
}

.role-badge {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(30, 96, 145, 0.1);
    color: var(--lg-primary);
    margin-right: 0.25rem;
}

.role-badge--admin {
    background: rgba(249, 168, 38, 0.2);
    color: var(--lg-accent-dark);
}

.role-badge--locked {
    background: rgba(214, 69, 69, 0.12);
    color: var(--lg-danger);
}

.admin-ok {
    color: var(--lg-success);
    font-weight: 600;
}

.admin-warn {
    color: var(--lg-danger);
    font-weight: 600;
}

.access-denied {
    text-align: center;
    max-width: 28rem;
    margin: 2rem auto;
}

.access-denied-icon {
    font-size: 3rem;
    display: block;
}
