body { font-family: sans-serif; margin: 0; padding: 0 1.5rem 2rem; }
nav { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #ccc; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
nav a { text-decoration: none; color: #333; }
nav details.nav-dropdown { position: relative; }
nav details.nav-dropdown summary { cursor: pointer; color: #333; list-style: none; }
nav details.nav-dropdown summary::-webkit-details-marker { display: none; }
nav details.nav-dropdown .nav-dropdown-menu {
    position: absolute; top: 100%; left: 0; margin-top: 0.4rem; background: #fff;
    border: 1px solid #ccc; border-radius: 0.3rem; padding: 0.4rem;
    display: flex; flex-direction: column; gap: 0.3rem; z-index: 10; white-space: nowrap;
}
table { border-collapse: collapse; width: 100%; margin-top: 1rem; }
th, td { border: 1px solid #ccc; padding: 0.4rem 0.6rem; text-align: left; font-size: 0.9rem; }
form label { display: block; margin-bottom: 0.6rem; }
input, select, textarea { display: block; margin-top: 0.2rem; width: 100%; max-width: 480px; box-sizing: border-box; }
textarea { min-height: 4rem; }
button { margin-top: 0.8rem; padding: 0.4rem 1rem; }
.filters { margin-bottom: 1rem; display: flex; gap: 0.6rem; align-items: center; }
.filters select, .filters input { width: auto; margin: 0; }

#review-badge {
    display: inline-block; min-width: 1.4rem; padding: 0 0.35rem; margin-left: 0.2rem;
    background: #d13429; color: #fff; border-radius: 999px; font-size: 0.75rem;
    text-align: center; line-height: 1.4rem;
}
#review-badge:empty { display: none; }

.review-progress { color: #666; margin-bottom: 0.5rem; }
.review-badges { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.badge { background: #eee; border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.8rem; }
.review-content {
    font-size: 1.25rem; line-height: 1.6; padding: 1.5rem; border: 1px solid #ddd;
    border-radius: 0.75rem; min-height: 6rem; margin-bottom: 1rem;
}
.review-answer { padding: 1rem 1.5rem; border-radius: 0.75rem; background: #f8f4ed; margin-bottom: 1rem; }
.ox-mark { font-size: 2.5rem; font-weight: bold; margin: 0 0 0.5rem; }
.ox-mark.ox-correct { color: #2a7e3b; }
.ox-mark.ox-wrong { color: #d13429; }
.review-explanation { color: #444; }
.ox-guess-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.ox-guess-btn {
    padding: 1.5rem 0.25rem; font-size: 1.5rem; font-weight: bold; max-width: none;
    margin-top: 0; border: none; border-radius: 0.5rem; color: #fff;
}
.ox-guess-btn.ox-guess-o { background: #2a7e3b; }
.ox-guess-btn.ox-guess-x { background: #d13429; }
.rating-buttons form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.rating-btn {
    padding: 1rem 0.25rem; font-size: 1rem; max-width: none; margin-top: 0;
    border: none; border-radius: 0.5rem; color: #fff;
}
.rating-again { background: #d13429; }
.rating-hard { background: #ab7100; }
.rating-good { background: #2a7e3b; }
.rating-easy { background: #199485; }
.review-complete { text-align: center; padding: 3rem 1rem; }

.exam-nav { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 1rem; }
.exam-nav-item {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; border: 1px solid #ccc; border-radius: 0.3rem;
    font-size: 0.85rem; color: #333;
}
.exam-nav-item.exam-nav-answered { background: #eee; border-color: #999; }
.exam-nav-item.exam-nav-current { border-color: #199485; border-width: 2px; font-weight: bold; }
#exam-timer { font-weight: bold; font-variant-numeric: tabular-nums; }
.finish-btn {
    width: 100%; padding: 1rem; font-size: 1rem; max-width: none;
    background: #d13429; color: #fff; border: none; border-radius: 0.5rem;
}

.note-preview, .note-rendered {
    border: 1px solid #ddd; border-radius: 0.5rem; padding: 1rem 1.5rem;
    margin: 0.5rem 0 1rem; max-width: none; line-height: 1.6;
}
.note-preview:empty { display: none; }
.review-notes { margin-top: 1rem; }
.review-notes ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.mindmap-svg {
    width: 100%; height: 75vh; border: 1px solid #ddd; border-radius: 0.5rem; display: block;
}

.dday-banner {
    display: flex; align-items: baseline; gap: 1rem; padding: 1.25rem 1.5rem;
    background: #f8f4ed; border: 1px solid #ddd; border-radius: 0.75rem; margin-bottom: 1.5rem;
}
.dday-figure { font-size: 2.2rem; font-weight: bold; color: #199485; }
.dday-sub { color: #52514e; }
.dday-settings-link { margin-left: auto; }

.stat-tile {
    display: flex; align-items: baseline; gap: 0.8rem; padding: 1.25rem 1.5rem;
    border: 1px solid #ddd; border-radius: 0.75rem; margin-bottom: 1.5rem;
}
.stat-tile-number { font-size: 2rem; font-weight: bold; }
.stat-tile-label { color: #52514e; }
.stat-tile a { margin-left: auto; }

.muted-note { color: #898781; font-size: 0.85rem; font-weight: normal; }

.accuracy-table td { vertical-align: middle; }
.accuracy-bar-track {
    display: inline-block; width: 60%; max-width: 220px; height: 0.6rem;
    background: #e1e0d9; border-radius: 999px; overflow: hidden; vertical-align: middle;
}
.accuracy-bar-fill { height: 100%; }
.accuracy-good { background: #2a7e3b; }
.accuracy-warning { background: #ab7100; }
.accuracy-critical { background: #d13429; }
.accuracy-rate-label {
    display: inline-block; margin-left: 0.5rem; font-variant-numeric: tabular-nums;
}

.heatmap { display: flex; gap: 0.3rem; margin-bottom: 0.5rem; }
.heatmap-cell { width: 1.6rem; height: 1.6rem; border-radius: 0.25rem; }
.heatmap-legend { display: flex; align-items: center; gap: 0.3rem; color: #898781; font-size: 0.8rem; }
.heatmap-legend .heatmap-cell { width: 1rem; height: 1rem; }
.heat-0 { background: #ebedf0; }
.heat-1 { background: #c3e4de; }
.heat-2 { background: #7cc9bd; }
.heat-3 { background: #199485; }
.heat-4 { background: #0f5c52; }

@media (max-width: 480px) {
    body { padding: 0 0.75rem 1.5rem; }
    .rating-buttons form { grid-template-columns: repeat(2, 1fr); }
}
