﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #2c3e7f;
    --primary-light: #5b7cc8;
    --secondary-dark: #1a2450;
    --accent-color: #6c9ef0;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --border-color: #bdc3c7;

    --spacing-xs: 0.35rem;
    --spacing-sm: 0.65rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.35rem;

    --card-radius: 14px;
    --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    --transition: all 0.25s ease;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
    color: var(--text-dark);
    line-height: 1.35;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
}

.container {
    width: min(1120px, 100%);
    margin: 0 auto;
    height: 100dvh;
    padding: clamp(0.45rem, 1.3vw, 0.9rem);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: clamp(0.35rem, 1vh, 0.65rem);
}

.header {
    color: var(--text-light);
    text-align: center;
    flex-shrink: 0;
}

.header h1 {
    font-size: clamp(1.65rem, 3.3vw, 2.45rem);
    line-height: 1.05;
    margin-bottom: 0.1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header .subtitle {
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.1;
    opacity: 0.95;
}

.main-content {
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.screen {
    display: none;
    width: 100%;
    max-width: 1040px;
    min-height: 0;
}

.screen.active {
    display: flex;
    align-items: stretch;
}

.screen-welcome.active {
    align-items: center;
    justify-content: center;
}

.screen-quiz.active {
    align-items: stretch;
}

#difficulty-screen {
    display: none;
}

#btn-next {
    display: none;
}

.welcome-box,
.quiz-container,
.results-box {
    background: #ffffff;
    border-radius: var(--card-radius);
    box-shadow: var(--soft-shadow);
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: clamp(0.6rem, 1.7vw, 1.1rem);
    overflow: hidden;
}

.welcome-box {
    display: grid;
    grid-template-rows: auto auto auto auto;
    align-content: center;
    align-self: center;
    height: auto;
    max-width: min(760px, 100%);
    gap: clamp(0.3rem, 1vh, 0.55rem);
}

.welcome-box h2 {
    color: var(--primary-dark);
    font-size: clamp(1.2rem, 2.6vw, 1.9rem);
    line-height: 1.2;
}

.welcome-box > p {
    font-size: clamp(0.98rem, 1.9vw, 1.12rem);
}

.welcome-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(0.28rem, 0.8vh, 0.5rem);
    align-content: start;
}

.feature {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    padding: clamp(0.42rem, 0.9vh, 0.62rem);
    border-radius: 10px;
    border-left: 4px solid var(--primary-light);
    background: linear-gradient(135deg, rgba(91, 124, 200, 0.08) 0%, rgba(108, 158, 240, 0.08) 100%);
}

.feature .icon {
    font-size: clamp(1.2rem, 2.4vw, 1.7rem);
    min-width: 1.8rem;
}

.feature p {
    font-size: clamp(0.92rem, 1.7vw, 1rem);
}

.difficulty-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.45rem, 1.2vh, 0.75rem);
    margin: clamp(0.45rem, 1.2vh, 0.75rem) 0;
}

@media (max-width: 600px) {
    .difficulty-options {
        grid-template-columns: 1fr;
    }
}

.btn-difficulty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: clamp(0.8rem, 2vh, 1.2rem) clamp(0.6rem, 1.5vw, 1rem);
    background: linear-gradient(135deg, rgba(91, 124, 200, 0.15) 0%, rgba(108, 158, 240, 0.15) 100%);
    border: 2px solid var(--primary-light);
    color: var(--primary-dark);
    text-transform: none;
    letter-spacing: 0;
    font-size: clamp(0.98rem, 1.65vw, 1.1rem);
    min-height: auto;
}

.btn-difficulty:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(91, 124, 200, 0.25) 0%, rgba(108, 158, 240, 0.25) 100%);
    border-color: var(--accent-color);
}

.btn-difficulty strong {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
}

.btn-difficulty span {
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    font-weight: 500;
    opacity: 0.8;
}

.feature p {
    font-size: clamp(0.92rem, 1.7vw, 1rem);
}

.quiz-container {
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: clamp(0.3rem, 1vh, 0.55rem);
}

.data-source-banner {
    display: none;
    position: fixed;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 1000;
    max-width: min(380px, calc(100vw - 1rem));
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.86rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.data-source-banner.visible {
    display: block;
}

.data-source-banner.using-csv {
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.35);
    color: #1f7a43;
}

.data-source-banner.using-fallback {
    background: rgba(243, 156, 18, 0.14);
    border-color: rgba(243, 156, 18, 0.35);
    color: #8a5a00;
}

.progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--light-bg);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--accent-color) 100%);
    transition: width 0.25s ease;
}

.question-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: clamp(0.92rem, 1.65vw, 1.02rem);
}

.question-number {
    color: var(--primary-dark);
    font-weight: 700;
}

.question-level,
.score {
    border-radius: 999px;
    padding: 0.32rem 0.62rem;
    font-weight: 700;
}

.question-level {
    background: rgba(44, 62, 127, 0.11);
    color: var(--primary-dark);
}

.score {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-light) 100%);
    color: #fff;
}

.question-box {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: clamp(0.3rem, 1vh, 0.55rem);
    overflow: hidden;
}

.question-text {
    color: var(--primary-dark);
    font-size: clamp(1.25rem, 2.8vw, 2.2rem);
    line-height: 1.2;
}

.options {
    min-height: 0;
    display: grid;
    gap: clamp(0.3rem, 0.9vh, 0.55rem);
    align-content: stretch;
    overflow: hidden;
}

.option {
    border: 2px solid var(--border-color);
    border-radius: 11px;
    background: var(--light-bg);
    padding: clamp(0.4rem, 0.9vh, 0.7rem);
    transition: var(--transition);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 62px;
}

.option:hover:not(.disabled) {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, rgba(91, 124, 200, 0.11) 0%, rgba(108, 158, 240, 0.11) 100%);
}

.option input[type='radio'] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option label {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
}

.option .radio-custom {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option input[type='radio']:checked + label {
    font-weight: 700;
    color: var(--primary-dark);
}

.option input[type='radio']:checked + label .radio-custom {
    background: var(--primary-light);
    border-color: var(--primary-dark);
}

.option input[type='radio']:checked + label .radio-custom::after {
    content: '✓';
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
}

.option.selected {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, rgba(91, 124, 200, 0.2) 0%, rgba(108, 158, 240, 0.2) 100%);
}

.option.correct {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.14) 0%, rgba(46, 204, 113, 0.09) 100%);
}

.option.incorrect {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.14) 0%, rgba(231, 76, 60, 0.09) 100%);
}

.option.disabled {
    opacity: 0.64;
    cursor: not-allowed;
}

.option.eliminated {
    opacity: 0.28;
    filter: grayscale(0.3);
}

.option-text {
    font-size: clamp(1.08rem, 1.95vw, 1.3rem);
    line-height: 1.22;
}

.question-feedback {
    min-height: 62px;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 2px solid transparent;
    font-size: clamp(1rem, 1.7vw, 1.16rem);
    line-height: 1.25;
    font-style: italic;
    visibility: hidden;
}

.question-feedback.visible {
    visibility: visible;
}

.question-feedback.correct {
    border-color: rgba(46, 204, 113, 0.45);
    background: rgba(46, 204, 113, 0.12);
    color: #1f7a43;
}

.question-feedback.incorrect {
    border-color: rgba(231, 76, 60, 0.45);
    background: rgba(231, 76, 60, 0.1);
    color: #b03a2e;
}

.question-feedback.suggestion {
    border-color: rgba(91, 124, 200, 0.45);
    background: rgba(91, 124, 200, 0.1);
    color: #2c3e7f;
}

.quiz-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    align-items: center;
}

.quiz-actions #btn-previous {
    justify-self: start;
}

.quiz-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
}

.quiz-actions #btn-next {
    justify-self: end;
}

.hint-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.results-box {
    display: grid;
    grid-template-rows: auto auto auto auto 1fr;
    gap: clamp(0.3rem, 1vh, 0.55rem);
}

.results-header {
    text-align: center;
}

.results-header h2 {
    color: var(--primary-dark);
    font-size: clamp(1.25rem, 2.3vw, 1.85rem);
    margin-bottom: 0.28rem;
}

.final-score {
    display: flex;
    justify-content: center;
}

.score-circle {
    width: clamp(84px, 13vh, 122px);
    height: clamp(84px, 13vh, 122px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(91, 124, 200, 0.3);
}

.score-value {
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 700;
    margin-right: 0.2rem;
}

.score-label {
    font-size: clamp(0.92rem, 1.85vw, 1.2rem);
    font-weight: 700;
    align-self: flex-start;
    margin-top: 0.55rem;
}

.results-message {
    text-align: center;
    font-size: clamp(0.95rem, 1.65vw, 1.08rem);
    font-weight: 700;
    border-radius: 10px;
    padding: 0.45rem 0.6rem;
}

.results-message.excellent {
    color: var(--success-color);
    background: rgba(46, 204, 113, 0.1);
}

.results-message.good {
    color: var(--primary-light);
    background: rgba(91, 124, 200, 0.1);
}

.results-message.fair {
    color: var(--warning-color);
    background: rgba(243, 156, 18, 0.1);
}

.results-message.poor {
    color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
}

.results-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.summary-item {
    border-left: 4px solid var(--primary-light);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(91, 124, 200, 0.1) 0%, rgba(108, 158, 240, 0.1) 100%);
    padding: 0.45rem;
    text-align: center;
}

.summary-item strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 0.1rem;
}

.summary-item span {
    color: var(--accent-color);
    font-size: clamp(1.05rem, 2.1vw, 1.42rem);
    font-weight: 700;
}

.results-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.results-actions .btn {
    flex: 0 1 auto;
    min-width: 180px;
}

.results-tips {
    min-height: 0;
    border-left: 4px solid var(--accent-color);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(91, 124, 200, 0.05) 0%, rgba(108, 158, 240, 0.05) 100%);
    padding: 0.45rem 0.55rem;
}

.results-tips h3 {
    color: var(--primary-dark);
    font-size: clamp(0.95rem, 1.85vw, 1.1rem);
    margin-bottom: 0.2rem;
}

.results-tips ul {
    list-style: none;
    display: grid;
    gap: 0.12rem;
}

.results-tips li {
    position: relative;
    padding-left: 1.2rem;
    font-size: clamp(0.84rem, 1.45vw, 0.98rem);
    line-height: 1.18;
}

.results-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: 700;
}

.btn {
    border: none;
    border-radius: 9px;
    padding: clamp(0.62rem, 1.3vh, 0.9rem) clamp(0.95rem, 2.6vw, 1.5rem);
    font-size: clamp(1.05rem, 1.95vw, 1.2rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(91, 124, 200, 0.38);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(91, 124, 200, 0.5);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--primary-dark);
    border: 2px solid var(--primary-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-light);
    color: #fff;
}

.btn-hint {
    background: #f2ebd3;
    color: #5d4a18;
    border: 2px solid #d7bf86;
    padding: 0.58rem 0.45rem;
    min-height: 50px;
    font-size: clamp(0.92rem, 1.45vw, 1rem);
}

.btn-hint:hover:not(:disabled) {
    background: #e9ddb8;
}

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

.hint-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(25, 35, 75, 0.55);
    z-index: 1200;
}

.hint-modal.visible {
    display: flex;
}

.hint-modal-content {
    width: min(620px, 100%);
    background: #ffffff;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: var(--soft-shadow);
    display: grid;
    gap: 0.7rem;
}

.hint-modal-content h3 {
    color: var(--primary-dark);
    font-size: 1.3rem;
}

.hint-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.hint-card {
    border: 2px solid #d6deef;
    border-radius: 12px;
    background: #f3f6fc;
    padding: 0.75rem;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 0.3rem;
    min-height: 110px;
    transition: var(--transition);
}

.hint-card strong {
    font-size: 1.02rem;
    color: var(--primary-dark);
}

.hint-card span {
    font-size: 0.93rem;
    color: #415c8f;
    line-height: 1.25;
}

.hint-card:hover:not(:disabled) {
    border-color: #7ea1de;
    background: #e8eefb;
}

.hint-card:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.footer {
    text-align: center;
    color: var(--text-light);
    opacity: 0.86;
    font-size: clamp(0.78rem, 1.35vw, 0.9rem);
}

/* Report screen styling: match quiz aesthetic and allow scrolling */
#report-screen {
    display: none; /* controlled via .screen.active */
}

#report-screen.active {
    display: flex;
    align-items: stretch;
}

.report-panel {
    background: #ffffff;
    border-radius: var(--card-radius);
    box-shadow: var(--soft-shadow);
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: clamp(0.75rem, 1.8vw, 1.1rem);
    overflow-y: auto;
    overflow-x: hidden;
}

.welcome-report-action {
    margin-top: 12px;
}

.btn-full {
    width: 100%;
}

.report-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.report-title {
    margin: 0;
    color: var(--primary-dark);
}

.report-session-summary {
    margin-bottom: 1rem;
}

.report-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.report-toolbar-meta {
    display: grid;
    gap: 0.2rem;
}

.report-toolbar-title {
    font-size: 1rem;
}

.report-toolbar-subtitle {
    font-size: 0.83rem;
    color: #6b7280;
}

.report-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.report-detail {
    display: none;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.report-detail.visible {
    display: block;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.125rem;
}

.report-kpi-grid-6 {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.report-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.report-section-title {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.report-bars {
    display: grid;
    gap: 0.45rem;
}

.report-bar-row {
    display: block;
    margin-bottom: 0.6rem;
}

.report-bar-label {
    font-size: 0.8rem;
    color: #4b5563;
}

.report-bar-label {
    display: block;
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-bar-value {
    font-size: 0.8rem;
    color: #374151;
    text-align: right;
    font-weight: 700;
}

.report-bar-row .report-progress {
    width: calc(100% - 56px);
    display: inline-block;
    vertical-align: middle;
}

.report-bar-row .report-bar-value {
    display: inline-block;
    width: 48px;
    margin-left: 8px;
    vertical-align: middle;
}

.report-progress {
    width: 100%;
    height: 14px;
}

.report-progress::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 999px;
}

.report-progress::-webkit-progress-value {
    border-radius: 999px;
}

.report-progress::-moz-progress-bar {
    border-radius: 999px;
}

.progress-good::-webkit-progress-value,
.progress-good::-moz-progress-bar {
    background: var(--success-color);
}

.progress-medium::-webkit-progress-value,
.progress-medium::-moz-progress-bar {
    background: #d69e2e;
}

.progress-risk::-webkit-progress-value,
.progress-risk::-moz-progress-bar {
    background: var(--danger-color);
}

.progress-info::-webkit-progress-value,
.progress-info::-moz-progress-bar {
    background: var(--primary-light);
}

.report-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.55rem;
}

.mode-charts {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.mode-chart {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem;
    background: #fff;
}

.mode-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}

.mode-chart-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.mode-chart-count {
    font-size: 0.82rem;
    color: #6b7280;
}

.mode-chart-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}

.mode-chart-title {
    width: 130px;
    font-size: 0.86rem;
    color: #4b5563;
}

.mode-chart-bar {
    background: #eef2f7;
    border-radius: 999px;
    height: 12px;
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
}

.mode-chart-bar-fill {
    background: var(--primary-light);
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 600ms ease;
}

.mode-chart-bar-fill.approval {
    background: var(--success-color);
}

.mode-chart-value {
    width: 56px;
    text-align: right;
    font-weight: 700;
}

.report-mode-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem;
    background: #f8fafc;
}

.report-mode-name {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-mode-score {
    font-size: 1.6rem;
    line-height: 1;
    color: var(--primary-dark);
    font-weight: 800;
    margin: 0.25rem 0;
}

.report-mode-meta {
    font-size: 0.8rem;
    color: #64748b;
}

.report-errors-list {
    display: grid;
    gap: 0.4rem;
}

.report-error-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.88rem;
}

.report-kpi-value {
    font-size: 1.125rem;
    font-weight: 700;
}

.report-question-card {
    padding: 0.625rem;
    margin-bottom: 0.5rem;
}

.report-question-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
    gap: 0.5rem;
}

.report-status {
    font-weight: 700;
}

.status-correct {
    color: var(--success-color);
}

.status-incorrect {
    color: var(--danger-color);
}

.report-question-text {
    margin-bottom: 0.375rem;
}

.report-question-meta {
    font-size: 0.82rem;
    color: #4b5563;
}

.report-empty {
    padding: 0.75rem;
}

.report-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.report-item-title {
    font-weight: 700;
}

.report-item-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-item-date {
    font-size: 0.78rem;
    color: #6b7280;
    flex: 0 0 auto;
    margin-left: 0.6rem;
    white-space: nowrap;
}

.report-item-score {
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.report-item-actions {
    display: flex;
    gap: 0.5rem;
}

.report-btn-grow {
    flex: 1;
}

.report-detail-notes {
    color: #374151;
}

/* Reuse card styling similar to welcome/quiz boxes */
.card, .report-card {
    background: #ffffff;
    border-radius: var(--card-radius);
    box-shadow: var(--soft-shadow);
    padding: 0.85rem;
    border: 1px solid var(--border-color);
}

#reports-list .report-card button {
    padding: 0.5rem 0.6rem;
}

@media (min-width: 769px) {
    .options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(0, 1fr));
    }

    #results-screen.active {
        justify-content: center;
        align-items: center;
    }

    .results-box {
        max-width: 760px;
        height: auto;
        max-height: calc(100dvh - 7.5rem);
        padding: clamp(1rem, 1.8vw, 1.45rem);
        gap: clamp(0.55rem, 1.1vh, 0.85rem);
        grid-template-rows: auto auto auto auto auto;
        overflow-y: auto;
    }

    .results-summary {
        gap: 0.6rem;
    }

    .results-tips {
        padding: 0.62rem 0.7rem;
    }
}

@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100dvh;
    }

    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .container {
        min-height: 100dvh;
        height: auto;
        padding: 0.35rem;
    }

    .header h1 {
        font-size: 1.56rem;
    }

    .header .subtitle {
        display: none;
    }

    .screen {
        max-width: 100%;
        min-height: 0;
    }

    .screen-welcome.active {
        min-height: 100%;
        align-items: center;
        justify-content: center;
    }

    .welcome-box,
    .quiz-container,
    .results-box {
        padding: 0.55rem;
    }

    .welcome-box {
        gap: 0.4rem;
        width: min(680px, 100%);
        margin: auto 0;
    }

    .welcome-features {
        gap: 0.2rem;
    }

    .quiz-container {
        height: auto;
        min-height: 100%;
        grid-template-rows: auto auto auto auto auto;
        gap: 0.35rem;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .question-box {
        grid-template-rows: auto auto auto;
        gap: 0.3rem;
        overflow: visible;
    }

    .quiz-actions {
        flex-direction: row;
        gap: 0.4rem;
        justify-content: stretch;
        position: static;
        padding-top: 0.15rem;
    }

    .hint-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.3rem;
    }

    .hint-actions .btn {
        flex: 0 0 auto;
    }

    .hint-actions .btn:last-child {
        font-size: 0.78rem;
        line-height: 1.1;
        letter-spacing: 0;
        padding-left: 0.32rem;
        padding-right: 0.32rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .btn {
        width: 100%;
        flex: 1;
        font-size: 0.95rem;
        padding: 0.62rem 0.5rem;
        min-height: 48px;
    }

    .question-info {
        font-size: 0.9rem;
        gap: 0.28rem;
    }

    .question-level,
    .score {
        padding: 0.24rem 0.48rem;
    }

    .question-box {
        gap: 0.3rem;
    }

    .question-text {
        font-size: clamp(1.05rem, 3.9vw, 1.28rem);
        line-height: 1.22;
        display: -webkit-box;
        line-clamp: 3;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: visible;
    }

    .options {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 0.3rem;
        overflow: visible;
    }

    .option {
        padding: 0.48rem 0.5rem;
        min-height: auto;
    }

    .option-text {
        font-size: 0.92rem;
        line-height: 1.18;
        display: block;
        overflow: visible;
        white-space: normal;
    }

    .question-feedback {
        min-height: 42px;
        font-size: 0.88rem;
        padding: 0.36rem 0.46rem;
        line-height: 1.12;
        display: -webkit-box;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

    .results-actions {
        gap: 0.4rem;
    }

    .results-actions .btn {
        min-width: 100%;
        flex: 1;
    }

    .results-tips li {
        font-size: 0.86rem;
    }

    .footer {
        display: none;
    }

    .data-source-banner {
        top: auto;
        right: 0.5rem;
        bottom: 0.5rem;
        max-width: calc(100vw - 1rem);
        font-size: 0.82rem;
        padding: 0.5rem 0.6rem;
    }

    .hint-cards {
        grid-template-columns: 1fr;
    }

    .report-grid-2 {
        grid-template-columns: 1fr;
    }

    .report-bar-row {
        grid-template-columns: 64px minmax(0, 1fr) 42px;
    }

}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.34rem;
    }

    .welcome-box,
    .quiz-container,
    .results-box {
        border-radius: 11px;
        padding: 0.5rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.58rem 0.4rem;
        min-height: 46px;
    }

    .results-actions {
        flex-direction: column;
        gap: 0.35rem;
    }

    .results-actions .btn {
        width: 100%;
        flex: 0 0 auto;
    }

    .question-info {
        font-size: 0.84rem;
    }

    .option-text {
        font-size: 0.88rem;
    }

    .question-text {
        font-size: 1rem;
    }
}

@media (max-height: 760px) {
    .footer {
        display: none;
    }
}
