html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    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;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.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;
}

/* ===== QuizApp Layout ===== */

.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 0 0 0;
    gap: 0.5rem;
}

.app-header h1 {
    margin: 0 0 0.25rem 0;
    font-size: 1.4rem;
    color: #1b6ec2;
}

.app-content {
    flex: 1;
    padding: 1.5rem 0;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #f0f0f0;
}

.nav-link.active {
    background-color: #1b6ec2;
    color: white;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #1b6ec2;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #155a9e;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #565e64;
}

.btn-success {
    background-color: #198754;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #146c43;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #bb2d3b;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem;
    line-height: 1;
}

/* ===== Quiz Page ===== */

.quiz-page {
    max-width: 700px;
    margin: 0 auto;
}

.loading, .no-questions {
    text-align: center;
    padding: 3rem 1rem;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-counter {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.bookmark-btn {
    color: #f5a623;
}

.bookmark-btn.bookmarked {
    color: #e8950e;
}

.directions {
    font-size: 0.9rem;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    padding: 0.6rem 1rem;
    background: #e8f4fd;
    border-left: 3px solid #2196F3;
    border-radius: 4px;
    color: #37474f;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.choices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.choice-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    transition: all 0.2s;
    min-height: 44px;
}

.choice-btn:hover:not(:disabled) {
    border-color: #1b6ec2;
    background: #f0f7ff;
}

.choice-btn.selected {
    border-color: #1b6ec2;
    background: #e3f0ff;
}

.choice-btn.correct {
    border-color: #198754;
    background: #d1e7dd;
}

.choice-btn.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
}

.choice-btn:disabled {
    cursor: default;
}

.choice-label {
    font-weight: 700;
    min-width: 2rem;
    color: #666;
}

.choice-text {
    flex: 1;
}

.feedback {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.feedback.correct {
    background: #d1e7dd;
    border: 1px solid #badbcc;
}

.feedback.incorrect {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
}

.feedback-status {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.explanation {
    color: #444;
    line-height: 1.5;
}

.navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* Quiz Results */
.quiz-results {
    text-align: center;
    padding: 3rem 1rem;
}

.score-display {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1.5rem 0;
}

.score {
    color: #1b6ec2;
}

.percentage {
    color: #666;
    font-size: 1.5rem;
    margin-left: 0.5rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* ===== MDAS Text Input ===== */

.text-input-section {
    margin-bottom: 1.5rem;
}

.text-input-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.text-answer-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.text-answer-input:focus {
    border-color: #1b6ec2;
}

.hint-text {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

/* ===== Topic Badge ===== */

.topic-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: #6c757d;
    color: white;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

/* ===== Voice/TTS Controls ===== */

.voice-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.6rem 0.8rem;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #d6e9ff;
}

.voice-controls .btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
}

.voice-state {
    font-size: 0.8rem;
    color: #1b6ec2;
    font-weight: 500;
    margin-left: auto;
}

.btn-voice-active {
    background: #198754 !important;
    border-color: #198754 !important;
    color: white !important;
}

.btn-autoreview-active {
    background: #fd7e14 !important;
    border-color: #fd7e14 !important;
    color: white !important;
}

.tts-warning {
    font-size: 0.85rem;
    color: #856404;
    background: #fff3cd;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.read-explanation-btn {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.speaking-indicator {
    font-size: 0.8rem;
    color: #1b6ec2;
    font-weight: 500;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tts-status-message {
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* ===== Reminder Settings ===== */

.reminder-section {
    margin-top: 1rem;
}

.reminder-section .form-group {
    margin-bottom: 1rem;
}

.interval-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.interval-option {
    padding: 0.4rem 0.8rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.interval-option:hover {
    border-color: #1b6ec2;
}

.interval-option.selected {
    border-color: #1b6ec2;
    background: #e3f0ff;
    font-weight: 600;
}

.permission-status {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.permission-granted {
    background: #d1e7dd;
    color: #0f5132;
}

.permission-denied {
    background: #f8d7da;
    color: #842029;
}

.permission-default {
    background: #fff3cd;
    color: #664d03;
}

.web-limitation-note {
    font-size: 0.83rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.75rem;
    padding: 0.5rem;
    border-left: 3px solid #dee2e6;
}

.scheduled-times-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.scheduled-time-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: #e3f0ff;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ===== Settings Page ===== */

.settings-page {
    max-width: 600px;
    margin: 0 auto;
}

.setting-group {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.setting-group h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #333;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #555;
}

.setting-item select,
.setting-item input[type="text"],
.setting-item input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.file-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.4rem;
}

.settings-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1.2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: #f0f0f0;
    color: #1b6ec2;
}

.tab-btn.active {
    color: #1b6ec2;
    border-bottom: 2px solid #1b6ec2;
    margin-bottom: -2px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    color: #333;
    cursor: pointer;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-row select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.session-name-badge {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
}

/* ===== Session History Page ===== */

.session-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-card {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.session-card:hover {
    border-color: #1b6ec2;
}

.session-card .session-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.session-card .session-meta {
    font-size: 0.85rem;
    color: #666;
}

/* ===== Card Set Selection Page ===== */

.cardset-selection-page {
    max-width: 700px;
    margin: 0 auto;
}

.cardset-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cardset-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cardset-item:hover {
    border-color: #1b6ec2;
    box-shadow: 0 2px 8px rgba(27, 110, 194, 0.1);
}

.cardset-info {
    flex: 1;
    cursor: pointer;
    min-width: 0;
}

.cardset-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1b6ec2;
    margin-bottom: 0.25rem;
}

.cardset-description {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    margin-bottom: 0.35rem;
}

.cardset-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #888;
}

.card-count {
    font-weight: 500;
}

.custom-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #e3f0ff;
    color: #1b6ec2;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.page-actions {
    margin-top: 1.5rem;
}

/* ===== Flashcard Page ===== */

.flashcard-card-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

.flashcard-term-card {
    position: relative;
    min-height: 150px;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #1b6ec2;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-term {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    word-break: break-word;
    line-height: 1.4;
}

.flashcard-term-card .bookmark-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    background: #fff3e0;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    transition: color 0.2s;
}

.flashcard-term-card .bookmark-btn.bookmarked {
    color: #f5a623;
}

.description-toggle {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    color: #1b6ec2;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.description-toggle:hover {
    background: #e8f4fd;
}

.description-panel {
    margin-top: 0.5rem;
    margin-left: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-prop {
    line-height: 1.5;
}

.prop-label {
    font-weight: 700;
    color: #555;
}

.prop-value {
    color: #222;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-menu {
        width: 100%;
        overflow-x: auto;
    }

    .score-display {
        font-size: 2rem;
    }

    .results-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .choice-btn {
        padding: 0.75rem;
    }

    .question-text {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

/* ===== Skip to content (WCAG 2.1 AA) ===== */

.skip-to-content {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: #1b6ec2;
    color: white;
    font-weight: bold;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
}

/* ===== Focus indicators (WCAG 2.1 AA) ===== */

:focus-visible {
    outline: 3px solid #1b6ec2;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid #1b6ec2;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(27, 110, 194, 0.2);
}

/* ===== Page container layout ===== */

.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header h1 {
    flex: 1;
    margin: 0;
    font-size: 1.4rem;
    min-width: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== Card ===== */

.card {
    padding: 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    margin-bottom: 1rem;
}

/* ===== Empty state ===== */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

/* ===== Action bar ===== */

.action-bar {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-outline {
    border: 1px solid #1b6ec2;
    color: #1b6ec2;
    background: transparent;
    border-radius: 6px;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #e3f0ff;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    min-height: 44px;
}

/* ===== Session cards ===== */

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.session-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.score-complete {
    color: #198754;
    font-weight: 600;
}

.score-incomplete {
    color: #6c757d;
}

.status-complete {
    color: #198754;
    font-weight: 500;
}

.status-active {
    color: #1b6ec2;
    font-weight: 500;
}

/* ===== Session detail ===== */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.summary-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.summary-value {
    font-weight: 600;
}

.score-value {
    color: #1b6ec2;
    font-size: 1.1rem;
}

.questions-section {
    margin-top: 1.5rem;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-review-item {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
}

.question-review-item.correct {
    border-left-color: #198754;
    background: #f0fdf4;
}

.question-review-item.incorrect {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.question-review-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.question-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: #666;
}

.result-badge {
    font-weight: 700;
}

.question-review-text {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.answer-summary {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.answer-correct { color: #198754; font-weight: 600; }
.answer-wrong { color: #dc3545; font-weight: 600; }
.correct-answer { color: #198754; }

.choices-review {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.choice-review {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.choice-letter { font-weight: 700; min-width: 1.5rem; }

.choice-correct { background: #d1e7dd; }
.choice-wrong { background: #f8d7da; }

.explanation-box {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== Incorrect questions page ===== */

.stats-bar {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.incorrect-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.incorrect-item {
    background: #fff5f5;
    border: 1px solid #f5c2c7;
}

.incorrect-item-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.incorrect-count {
    font-weight: 700;
    color: #dc3545;
}

.incorrect-question-text {
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.correct-answer-label {
    font-size: 0.9rem;
    color: #444;
}

.explanation-details {
    margin-top: 0.5rem;
}

.explanation-details summary {
    cursor: pointer;
    color: #1b6ec2;
    font-size: 0.9rem;
}

.explanation-text {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

/* ===== Navigator page ===== */

.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-group label {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-group select {
    padding: 0.35rem 0.6rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.navigator-count {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.navigator-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
}

.navigator-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.9rem;
}

.navigator-table thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    background: #f1f3f5;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

.navigator-table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #eceff1;
    vertical-align: middle;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.navigator-table tbody tr:last-child td {
    border-bottom: none;
}

.navigator-table .col-num { width: 3.5rem; font-weight: 600; text-align: right; }
.navigator-table .col-result { width: 4.5rem; text-align: center; }
.navigator-table .col-category { width: 22%; color: #555; }
.navigator-table .col-question { width: auto; }

.navigator-table .question-text {
    display: inline-block;
    max-width: calc(100% - 1.25rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.navigator-row {
    cursor: pointer;
    transition: background-color 0.12s;
}

.navigator-row:hover {
    filter: brightness(0.97);
}

.navigator-row:focus-visible {
    outline: 2px solid #1b6ec2;
    outline-offset: -2px;
}

.navigator-row[aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.7;
}

.item-bookmark {
    font-size: 0.8rem;
    color: #f5a623;
    margin-left: 0.35rem;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
}

.result-correct { background: #d1e7dd; color: #0f5132; }
.result-incorrect { background: #f8d7da; color: #842029; }

.nav-item-correct { background: #eaf5ef; }
.nav-item-incorrect { background: #fdecee; }
.nav-item-skipped { background: #fff8e1; }
.nav-item-unvisited { background: white; }

/* ===== Info text ===== */

.info-text {
    color: #666;
    font-size: 0.9rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #dee2e6;
}

/* ===== Bookmark indicator ===== */

.bookmark-indicator { color: #f5a623; }

/* ===== Flashcard study page extras ===== */

.flashcard-study-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.completion-panel {
    text-align: center;
    padding: 3rem 1rem;
}

.completion-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.progress-bar-section {
    margin-bottom: 0.75rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #555;
}

.filter-bar {
    margin-bottom: 1rem;
}

.navigation-controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.jump-nav-section {
    margin-top: 1rem;
    text-align: center;
}

.jump-nav-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.jump-input {
    width: 80px;
    padding: 0.4rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 1rem;
}

/* ===== Flashcard settings extras ===== */

.flashcard-settings-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.settings-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.settings-section h2 {
    font-size: 1.05rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

/* ===== Responsive ===== */

@media (max-width: 600px) {
    .navigator-table {
        font-size: 0.85rem;
    }

    .navigator-table thead th,
    .navigator-table tbody td {
        padding: 0.5rem 0.4rem;
    }

    .navigator-table .col-num { width: 2.4rem; }
    .navigator-table .col-result { width: 2.6rem; }
    .navigator-table .col-category { width: 5rem; }

    .result-badge {
        width: 1.4rem;
        height: 1.4rem;
        font-size: 0.85rem;
    }

    .page-header h1 {
        font-size: 1.2rem;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .session-card-actions {
        justify-content: flex-end;
    }
}

/* ===== Offline Indicator Banner ===== */
.offline-banner {
    background-color: #f0ad4e;
    color: #333;
    text-align: center;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 9999;
}
/* ===== Locked Content Badge ===== */

.locked-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
    white-space: nowrap;
}

/* ===== Upgrade Prompt Modal ===== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-dialog h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-dialog p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (prefers-color-scheme: dark) {
    .locked-badge {
        background: #374151;
        color: #d1d5db;
    }
    .modal-dialog {
        background: #1f2937;
        color: #f9fafb;
    }
    .modal-dialog p {
        color: #9ca3af;
    }
}

/* ===== Account Actions (FR-063 online-gated) ===== */

.account-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.account-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ===== Locked card set items ===== */

.cardset-item--locked {
    opacity: 0.65;
    cursor: pointer;
}

.cardset-list--locked {
    margin-top: 1rem;
}

/* ===== First-launch offline tip (R-8) ===== */

.first-launch-tip {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #f9fafb;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    z-index: 900;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    max-width: 90vw;
}

.btn-close-tip {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.btn-close-tip:hover { color: #f9fafb; }
