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

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        sans-serif;
    min-height: 100vh;
    background: #0e0e10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 150px 60px 20px;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

h1 {
    color: #ed4267;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.search-container {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(237, 66, 103, 0.3);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #ed4267;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #ff6b6b;
    transform: translateY(-50%) scale(1.05);
}

.search-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Clipboard Toggle */
.clipboard-label {
    font-size: 0.78rem;
    color: #cfcfcf;
    letter-spacing: 0.02em;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
}
.clipboard-toggle input:checked ~ .clipboard-label {
    color: #ff8aab;
}
.clipboard-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.clipboard-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.clipboard-toggle input {
    display: none;
}

.toggle-slider {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.clipboard-toggle input:checked + .toggle-slider {
    background: #ed4267;
}

.clipboard-toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
}

.clipboard-icon {
    width: 20px;
    height: 20px;
    fill: rgba(255, 255, 255, 0.5);
    transition: fill 0.3s ease;
}

.clipboard-toggle input:checked ~ .clipboard-icon {
    fill: #ed4267;
}

/* Word breakdown section — shows the input text segmented via Intl.Segmenter.
   Users can highlight any substring to re-run the dictionary lookup against
   it, without losing their original input. */
.segmented-section {
    margin-top: 1rem;
    padding: 0.75rem 1rem 0.9rem;
    background: linear-gradient(
        180deg,
        rgba(237, 66, 103, 0.05),
        rgba(237, 66, 103, 0.02)
    );
    border: 1px solid rgba(237, 66, 103, 0.18);
    border-radius: 10px;
}

.segmented-section.hidden {
    display: none;
}

.segmented-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.55rem;
    gap: 0.75rem;
}

.segmented-section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ed4267;
    font-weight: 600;
}

.segmented-section-hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.45);
}

.segmented-preview {
    font-size: 1.85rem;
    line-height: 1.7;
    color: #ececf0;
    cursor: text;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.segmented-preview .seg {
    display: inline;
    color: #ececf0;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
    text-decoration-skip-ink: none;
    transition: text-decoration-thickness 0.12s ease;
}

.segmented-preview .seg:hover {
    text-decoration-thickness: 5px;
}

/* Pastel 4-tone cycle for morpheme underlines — pink, mint, peach, lavender. */
.segmented-preview .seg:nth-child(4n + 1) {
    text-decoration-color: #ff8aab;
}
.segmented-preview .seg:nth-child(4n + 2) {
    text-decoration-color: #7ed4be;
}
.segmented-preview .seg:nth-child(4n + 3) {
    text-decoration-color: #ffbb6e;
}
.segmented-preview .seg:nth-child(4n + 4) {
    text-decoration-color: #a594ff;
}

.segmented-preview ::selection {
    background: rgba(237, 66, 103, 0.45);
    color: #ffffff;
}

/* Results */
.results {
    margin-top: 2rem;
    text-align: left;
}

.loading,
.error,
.no-results {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2rem;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ed4267;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    color: #ff6b6b;
}

.entry {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.entry-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.term {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.reading {
    font-size: 1.2rem;
    color: #ed4267;
}

.word-class {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.dictionary {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1rem;
}

.senses {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sense {
    padding-left: 0.5rem;
    border-left: 3px solid rgba(237, 66, 103, 0.5);
}

.sense-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sense-number {
    background: #ed4267;
    color: #fff;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.pos {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.glossary {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.glossary li {
    margin-bottom: 0.25rem;
}

.examples {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.example {
    margin-bottom: 0.5rem;
}

.example:last-child {
    margin-bottom: 0;
}

.example-jp {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.example-en {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* AI Section */
.ai-section {
    margin-top: 0.75rem;
    margin-bottom: -0.4rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-generate-btn {
    background: rgba(237, 66, 103, 0.12);
    border: 1px solid rgba(237, 66, 103, 0.4);
    color: #ff8aa3;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
    font-weight: 500;
}

.ai-generate-btn:hover:not(.disabled) {
    background: rgba(237, 66, 103, 0.2);
    border-color: rgba(237, 66, 103, 0.6);
    color: #fff;
}

.ai-generate-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ai-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    display: none;
}

.ai-spinner.active {
    display: block;
    animation: spin 0.8s linear infinite;
}

.ai-result {
    width: 100%;
}
.ai-result:empty {
    display: none;
}

.ai-sentence {
    background: rgba(102, 126, 234, 0.15);
    padding: 1rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-top: 0.5rem;
}

.ai-error {
    color: #ff6b6b;
    font-size: 0.9rem;
}

/* History Sidebar */
.history-sidebar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
}

.history-trigger {
    width: 32px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.history-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    width: 36px;
}

.history-trigger svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.5);
    transition: fill 0.3s ease;
}

.history-sidebar:hover .history-trigger svg,
.history-sidebar.open .history-trigger svg {
    fill: #ed4267;
}

.history-panel {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    max-height: 400px;
    background: rgba(22, 33, 62, 0.95);
    border-radius: 0 12px 12px 0;
    backdrop-filter: blur(20px);
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.history-sidebar:hover .history-panel,
.history-sidebar.open .history-panel {
    width: 220px;
    opacity: 1;
}

.history-header {
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.history-list {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
}

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.history-item {
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid transparent;
}

.history-item:hover {
    background: rgba(237, 66, 103, 0.15);
    color: #fff;
    border-left-color: #ed4267;
}

.history-empty {
    padding: 20px 16px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    text-align: center;
    font-style: italic;
    white-space: nowrap;
}

/* ── Login overlay ─────────────────────────────────────────────────────────── */

.login-overlay {
    position: fixed;
    inset: 0;
    background: #0e0e10;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-overlay.hidden {
    display: none;
}

.login-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

/* ── Auth bar (top-right) ──────────────────────────────────────────────────── */

.auth-bar {
    position: fixed;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 200;
}

.auth-bar.hidden {
    display: none;
}

.auth-email {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.auth-signout-btn {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-signout-btn:hover {
    background: rgba(237, 66, 103, 0.2);
    color: #ed4267;
}

/* ── View tabs ─────────────────────────────────────────────────────────────── */

.view-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 4px;
}

.view-tab {
    flex: 1;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-tab.active {
    background: rgba(237, 66, 103, 0.2);
    color: #ed4267;
    font-weight: 600;
}

.view-tab:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
}

.hidden {
    display: none !important;
}

/* ── Save word button ──────────────────────────────────────────────────────── */

.save-word-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.3);
    line-height: 1;
    padding: 0 4px;
    transition:
        color 0.2s ease,
        transform 0.1s ease;
    margin-left: auto;
}

.save-word-btn:hover {
    color: #ed4267;
    transform: scale(1.2);
}

.save-word-btn.saved {
    color: #ed4267;
}

/* ── Saved words view ──────────────────────────────────────────────────────── */

.saved-words-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.saved-word-entry {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    backdrop-filter: blur(10px);
}

.saved-word-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}

.unsave-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.unsave-btn:hover {
    color: #ed4267;
    background: rgba(237, 66, 103, 0.15);
}

.saved-glossary {
    margin-top: 0.4rem;
}

/* ── Decks view ───────────────────────────────────────────────────────────── */

.decks-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#decksFilteredList {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.deck-entry {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.deck-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.deck-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.deck-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.deck-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-left: auto;
}

.deck-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.deck-delete-btn:hover {
    color: #ed4267;
    background: rgba(237, 66, 103, 0.15);
}

.deck-toggle-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.2s ease;
}

.deck-toggle-btn:hover {
    color: #ed4267;
}

.deck-words {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.deck-words.open {
    max-height: none;
    padding: 0.5rem 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.deck-words .saved-word-entry {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.deck-words .saved-word-entry:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(237, 66, 103, 0.15);
}

.deck-words .saved-word-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}

.deck-words .saved-word-header .term {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.deck-words .saved-word-header .reading {
    font-size: 0.95rem;
    color: #ed4267;
}

.deck-words .dictionary {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.4rem;
}

.deck-words .saved-glossary {
    margin-top: 0.25rem;
    padding-left: 1.25rem;
    list-style-type: none;
}

.deck-words .saved-glossary li {
    position: relative;
    padding-left: 0.5rem;
    margin-bottom: 0.2rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    line-height: 1.5;
}

.deck-words .saved-glossary li::before {
    content: "";
    position: absolute;
    left: -0.6rem;
    top: 0.55em;
    width: 5px;
    height: 5px;
    background: rgba(237, 66, 103, 0.5);
    border-radius: 50%;
}

.deck-remove-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.deck-remove-btn:hover {
    color: #ed4267;
    background: rgba(237, 66, 103, 0.12);
}

/* ── Deck pagination ─────────────────────────────────────────────────────── */

.deck-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.deck-page-btn {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-page-btn:hover:not(:disabled) {
    background: rgba(237, 66, 103, 0.2);
    color: #ed4267;
}

.deck-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.deck-page-info {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ── Quiz view ────────────────────────────────────────────────────────────── */

.quiz-content {
    margin-top: 1rem;
    text-align: left;
}

.quiz-title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
}

.quiz-deck-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-deck-btn {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.quiz-deck-btn:hover {
    background: rgba(237, 66, 103, 0.15);
    border-color: rgba(237, 66, 103, 0.3);
}

.quiz-deck-name {
    font-weight: 600;
}

.quiz-deck-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

.quiz-deck-tags {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.quiz-deck-tags .deck-tag-pill {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    cursor: pointer;
}

.quiz-deck-score {
    width: 100%;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.quiz-deck-score-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-deck-score-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    width: 50px;
    flex-shrink: 0;
    text-align: right;
}

.quiz-deck-score-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.quiz-deck-score-fill {
    height: 100%;
    background: #ed4267;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.quiz-deck-score-pct {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    width: 30px;
    flex-shrink: 0;
}

.quiz-deck-no-score {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 0.25rem;
}

/* Quiz filters */
.quiz-filters {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quiz-filter-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.quiz-filter-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.quiz-date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-date-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
    color-scheme: dark;
}

.quiz-date-input:focus {
    border-color: rgba(237, 66, 103, 0.5);
}

.quiz-date-separator {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

.quiz-word-search-row {
    display: flex;
    gap: 8px;
}

.quiz-word-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}

.quiz-word-input:focus {
    border-color: rgba(237, 66, 103, 0.5);
}

.quiz-word-search-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-word-search-btn:hover {
    background: rgba(237, 66, 103, 0.2);
    color: #ed4267;
}

.quiz-clear-filters-btn {
    align-self: flex-end;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 0;
    transition: color 0.2s ease;
}

.quiz-clear-filters-btn:hover {
    color: #ed4267;
}

/* Score number input filter */
.quiz-score-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
    color-scheme: dark;
}

.quiz-score-input:focus {
    border-color: rgba(237, 66, 103, 0.5);
}

/* Unattempted toggle */
.quiz-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.quiz-toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ed4267;
    cursor: pointer;
}

.quiz-toggle-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Progress bar */
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.quiz-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: #ed4267;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.quiz-progress-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* Quiz card */
.quiz-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.quiz-term {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-step {
    margin-bottom: 1.5rem;
}
.quiz-step:last-child {
    margin-bottom: 0;
}

.quiz-label {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.quiz-input-row {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.quiz-reading-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    outline: none;
    transition: all 0.2s ease;
}

.quiz-reading-input:focus {
    border-color: rgba(237, 66, 103, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.quiz-reading-input:disabled {
    opacity: 0.6;
}

.quiz-reading-input.quiz-input-correct {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.quiz-reading-input.quiz-input-incorrect {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.quiz-submit-btn {
    padding: 12px 24px;
    flex-shrink: 0;
    background: #ed4267;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-submit-btn:hover:not(:disabled) {
    background: #ff6b6b;
    transform: translateY(-1px);
}

.quiz-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Multiple choice options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quiz-option-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-option-btn:hover:not(:disabled) {
    background: rgba(237, 66, 103, 0.12);
    border-color: rgba(237, 66, 103, 0.3);
}

.quiz-option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.quiz-option-btn.quiz-option-correct {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.15);
    color: #fff;
}

.quiz-option-btn.quiz-option-incorrect {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
    color: #fff;
}

/* Feedback */
.quiz-feedback {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.quiz-correct {
    color: #2ecc71;
    font-weight: 600;
}

.quiz-incorrect {
    color: #e74c3c;
    font-weight: 500;
}

.quiz-incorrect strong {
    color: #ed4267;
}

.quiz-next-btn {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.quiz-next-btn:hover {
    background: rgba(237, 66, 103, 0.2);
    color: #ed4267;
}

/* Results */
.quiz-results {
    text-align: center;
    margin-bottom: 48px;
}

.quiz-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quiz-result-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.quiz-result-score {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.quiz-result-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
}

.quiz-result-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.quiz-result-fill {
    height: 100%;
    background: #ed4267;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.quiz-retry-btn {
    padding: 12px 32px;
    background: #ed4267;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-retry-btn:hover {
    background: #ff6b6b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(237, 66, 103, 0.3);
}

/* ── Deck tags in search results ──────────────────────────────────────────── */

.entry-decks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.deck-tag {
    font-size: 0.7rem;
    color: #ed4267;
    background: rgba(237, 66, 103, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* ── Merge picker ────────────────────────────────────────────────────────── */

.deck-merge-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.deck-merge-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
}

.merge-picker-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    background: rgba(22, 33, 62, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    width: 280px;
    z-index: 50;
}

.merge-picker-header {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    font-weight: 600;
}

.merge-picker-search {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
    margin-bottom: 8px;
    transition: border-color 0.2s ease;
}

.merge-picker-search:focus {
    border-color: rgba(102, 126, 234, 0.5);
}

.merge-picker-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.merge-picker-list::-webkit-scrollbar {
    width: 4px;
}

.merge-picker-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.merge-picker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.merge-picker-item:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.merge-picker-item:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.merge-picker-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

/* ── Tag filter bar ──────────────────────────────────────────────────────── */

.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-filter-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid var(--tag-color, #ed4267);
    border-radius: 20px;
    background: transparent;
    color: var(--tag-color, #ed4267);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-filter-btn:hover {
    background: color-mix(in srgb, var(--tag-color, #ed4267) 15%, transparent);
}

.tag-filter-btn.active {
    background: var(--tag-color, #ed4267);
    color: #fff;
}

.tag-exclude-btn.active {
    background: rgba(231, 76, 60, 0.2);
    border-color: #e74c3c;
    color: #e74c3c;
    text-decoration: line-through;
}

.tag-filter-empty {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* ── Deck tag pills ──────────────────────────────────────────────────────── */

.deck-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 1.25rem 0.6rem;
}

.deck-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    background: color-mix(in srgb, var(--tag-color, #ed4267) 20%, transparent);
    color: var(--tag-color, #ed4267);
    border: 1px solid
        color-mix(in srgb, var(--tag-color, #ed4267) 40%, transparent);
}

.tag-remove-x {
    background: none;
    border: none;
    color: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.tag-remove-x:hover {
    opacity: 1;
}

.deck-add-tag-btn {
    background: none;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-add-tag-btn:hover {
    border-color: rgba(237, 66, 103, 0.5);
    color: #ed4267;
    background: rgba(237, 66, 103, 0.08);
}

/* ── Tag picker dropdown ─────────────────────────────────────────────────── */

.tag-picker-dropdown {
    background: rgba(22, 33, 62, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 320px;
}

.tag-picker-create {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tag-picker-input {
    padding: 8px 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}

.tag-picker-input:focus {
    border-color: rgba(237, 66, 103, 0.5);
}

.tag-picker-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tag-color-swatch:hover {
    transform: scale(1.15);
}

.tag-color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.tag-picker-create-btn {
    padding: 6px 16px;
    background: #ed4267;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.tag-picker-create-btn:hover {
    background: #ff6b6b;
}

.tag-picker-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 10px 0;
}

.tag-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
}

.tag-picker-item {
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid
        color-mix(in srgb, var(--tag-color, #ed4267) 40%, transparent);
    border-radius: 20px;
    background: color-mix(in srgb, var(--tag-color, #ed4267) 12%, transparent);
    color: var(--tag-color, #ed4267);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-picker-item:hover {
    background: color-mix(in srgb, var(--tag-color, #ed4267) 25%, transparent);
}

/* ── Role picker (first-login overlay) ──────────────────────────────────── */
.role-picker-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.role-picker-btn {
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    background: #ed4267;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.role-picker-btn:hover {
    background: #d63852;
}

.role-picker-btn[data-role="teacher"] {
    background: #3a86ff;
}

.role-picker-btn[data-role="teacher"]:hover {
    background: #2f6fd9;
}

/* ── Teacher app (minimalist, Japanese) ─────────────────────────────────── */
.teacher-app {
    max-width: 760px;
    margin: 56px auto;
    padding: 0 24px 80px;
    font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
    color: #e8e8ea;
    font-size: 1.05rem;
}

.teacher-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.teacher-back-btn {
    padding: 8px 16px;
    font-size: 0.95rem;
    color: #b8b8c0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}

.teacher-back-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.03);
}

.teacher-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    color: #fff;
    letter-spacing: 0.01em;
}

.teacher-subtitle {
    font-size: 0.9rem;
    color: #7a7a85;
    margin-left: auto;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.teacher-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.teacher-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease;
}

.teacher-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.teacher-list-item-main {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    line-height: 1.4;
}

.teacher-list-item-sub {
    font-size: 0.9rem;
    color: #7a7a85;
    margin-top: 3px;
}

.teacher-word-marks {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 0.9rem;
}

.teacher-word-mark {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.teacher-mark-label {
    color: #8a8a95;
    font-size: 0.85rem;
}

.teacher-mark-correct {
    color: #4ade80;
    font-weight: 700;
    font-size: 1.05rem;
}

.teacher-mark-incorrect {
    color: #f87171;
    font-weight: 700;
    font-size: 1.05rem;
}

.teacher-mark-pending {
    color: #5a5a65;
    font-weight: 700;
}

.teacher-empty {
    padding: 56px 20px;
    text-align: center;
    color: #5a5a65;
    font-size: 1.05rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.teacher-unenroll-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1;
    color: #6a6a75;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.teacher-unenroll-btn:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.6);
    background: rgba(248, 113, 113, 0.08);
}

.teacher-primary-btn {
    padding: 13px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: #3a86ff;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.1s ease;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.teacher-primary-btn:hover {
    background: #2f6fd9;
}

.teacher-primary-btn:active {
    transform: translateY(1px);
}

.teacher-primary-btn:disabled {
    background: #3a3a44;
    color: #888;
    cursor: not-allowed;
}

.teacher-danger-btn {
    padding: 13px 24px;
    font-size: 1.05rem;
    font-weight: 500;
    color: #f87171;
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.4);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.teacher-danger-btn:hover {
    color: #fff;
    background: #ef4444;
    border-color: #ef4444;
}

.teacher-active-student {
    margin-bottom: 14px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #b8b8c0;
    background: rgba(58, 134, 255, 0.08);
    border: 1px solid rgba(58, 134, 255, 0.25);
    border-radius: 8px;
}

.teacher-active-student strong {
    color: #fff;
    font-weight: 600;
    margin-left: 4px;
}

.teacher-score-pill {
    display: inline-block;
    padding: 3px 10px;
    margin-left: 4px;
    font-size: 0.85rem;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 8px;
}

.teacher-score-pill.teacher-score-none {
    color: #6a6a75;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
}

.teacher-score-card {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, 0.2);
    border-radius: 10px;
}

.teacher-score-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #4ade80;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.teacher-score-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 1rem;
    color: #ccc;
}

.teacher-score-row strong {
    color: #fff;
    font-weight: 500;
}

.teacher-score-card.teacher-score-empty {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: #7a7a85;
    font-size: 0.95rem;
}

.teacher-list-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.teacher-tag-pill {
    display: inline-block;
    padding: 3px 11px;
    font-size: 0.85rem;
    color: var(--tag-color, #ed4267);
    background: color-mix(in srgb, var(--tag-color, #ed4267) 12%, transparent);
    border: 1px solid
        color-mix(in srgb, var(--tag-color, #ed4267) 35%, transparent);
    border-radius: 10px;
}

.teacher-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.teacher-page-btn {
    padding: 7px 16px;
    font-size: 0.95rem;
    color: #b8b8c0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.teacher-page-btn:hover:not(:disabled) {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.04);
}

.teacher-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.teacher-page-info {
    font-size: 0.95rem;
    color: #7a7a85;
    min-width: 50px;
    text-align: center;
}

.teacher-filter-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.teacher-filter-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #7a7a85;
    text-transform: none;
    letter-spacing: 0;
}

/* Student view: "assigned by" pill (replaces the inline owner badge next to deck name) */
.deck-assigned-by-pill {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 10px;
}

/* Synthetic "assigned by" filter chip — distinct from real tag chips */
.tag-filter-btn.assigner-chip {
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.06);
    border-color: rgba(45, 212, 191, 0.3);
}

.tag-filter-btn.assigner-chip:hover {
    background: rgba(45, 212, 191, 0.15);
    border-color: rgba(45, 212, 191, 0.5);
}

.tag-filter-btn.assigner-chip.active {
    background: rgba(45, 212, 191, 0.25);
    border-color: #2dd4bf;
    color: #fff;
}

.teacher-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.teacher-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #7a7a85;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Header row that holds the section title and the student cap counter side by side. */
.teacher-section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}

.teacher-section-title-row .teacher-section-title {
    margin-bottom: 0;
}

.teacher-cap-counter {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.teacher-cap-counter.cap-reached {
    color: #ffb4b4;
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
}

.teacher-primary-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.teacher-form-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 18px;
}

.teacher-form-label {
    font-size: 0.92rem;
    font-weight: 500;
    color: #9a9aa5;
}

.teacher-form-input,
.teacher-form-textarea {
    padding: 12px 15px;
    font-size: 1.05rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    font-family: inherit;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.teacher-form-input:focus,
.teacher-form-textarea:focus {
    outline: none;
    border-color: #3a86ff;
    background: rgba(255, 255, 255, 0.06);
}

.teacher-form-input::placeholder,
.teacher-form-textarea::placeholder {
    color: #555560;
}

.teacher-form-textarea {
    min-height: 80px;
    resize: vertical;
}

.teacher-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 1rem;
    color: #aaa;
}

.teacher-toggle-row input[type="checkbox"] {
    accent-color: #3a86ff;
}

.teacher-status-found {
    font-size: 0.95rem;
    color: #4ade80;
    margin-top: -8px;
    margin-bottom: 8px;
}

.teacher-status-notfound {
    font-size: 0.95rem;
    color: #2dd4bf;
    margin-top: -8px;
    margin-bottom: 8px;
}

.teacher-running-list {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.teacher-running-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 1rem;
    color: #ccc;
}

.teacher-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.teacher-error {
    color: #f87171;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* ── Assigned (non-owned) deck markers ──────────────────────────────────── */
.deck-entry.deck-assigned .deck-name::before {
    content: "🔒 ";
    font-size: 0.85em;
    opacity: 0.7;
}

.deck-owner-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 0.72rem;
    color: #888;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* ── Guest mode: auth bar layout, login button, close X, toast ─────────────── */
.auth-bar-guest,
.auth-bar-authed {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-howto-link {
    font-size: 0.85rem;
    color: #ed4267;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 6px;
    transition:
        color 0.15s,
        background 0.15s;
}
.auth-howto-link:hover {
    color: #ff6b85;
    background: rgba(237, 66, 103, 0.08);
}
.auth-login-btn {
    background: #4f8cff;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.auth-login-btn:hover {
    background: #6aa0ff;
}
.login-card {
    position: relative;
    padding-top: 48px;
}
.login-close-btn {
    position: absolute;
    top: 8px;
    right: -25px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
}
.login-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}
.login-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 32, 0.95);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition:
        opacity 0.2s,
        transform 0.2s;
    z-index: 1100;
    pointer-events: none;
}
.login-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Introduction / How-To page ────────────────────────────────────────────── */
.intro-page {
    max-width: 980px;
    margin: 48px auto 80px;
    padding: 0 20px;
    color: #e6e6e6;
}
.intro-header {
    text-align: center;
    margin-bottom: 28px;
}
.intro-header h1 {
    font-size: 2rem;
    margin: 0 0 8px;
}
.intro-sub {
    color: #999;
    font-size: 1rem;
    margin: 0;
}
.intro-role-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.intro-role-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s;
}
.intro-role-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
.intro-role-btn.active {
    background: #4f8cff;
    border-color: #4f8cff;
    color: #fff;
}
.intro-features {
    display: grid;
    gap: 18px;
}
.intro-feature {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 18px 20px;
    opacity: 0;
    transform: translateY(8px);
    animation: introFadeIn 0.35s ease forwards;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.intro-feature-text h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: #fff;
}
.intro-feature-text p {
    margin: 0;
    color: #bbb;
    font-size: 0.92rem;
    line-height: 1.5;
}
.intro-feature-media {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.intro-feature-media video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    display: block;
}
.intro-feature-media figcaption {
    color: #888;
    font-size: 0.78rem;
    line-height: 1.4;
    font-style: italic;
}
@keyframes introFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.intro-back-row {
    margin-bottom: 15px;
}
.intro-footer {
    margin-top: 32px;
    text-align: center;
}
.intro-back-link {
    color: #4f8cff;
    text-decoration: none;
    font-size: 0.9rem;
}
.intro-back-link:hover {
    text-decoration: underline;
}

/* ── Invited / Enrolled status pills + teacher list right column ──────────── */
.teacher-list-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.student-status-pill {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}
.student-status-enrolled {
    background: rgba(46, 160, 67, 0.16);
    color: #6cd07a;
    border-color: rgba(46, 160, 67, 0.4);
}
.student-status-invited {
    background: rgba(255, 255, 255, 0.04);
    color: #8a8a8a;
    border-color: rgba(255, 255, 255, 0.1);
}

/* ── Student "my teacher" banner ──────────────────────────────────────────── */
.my-teacher-bar {
    position: fixed;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 30, 32, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #ddd;
    backdrop-filter: blur(6px);
    z-index: 100;
    max-width: 560px;
    white-space: nowrap;
}
.my-teacher-label {
    white-space: nowrap;
}
.my-teacher-label strong {
    color: #fff;
    font-weight: 600;
}
.my-teacher-unenroll-btn {
    background: transparent;
    color: #cc7a7a;
    border: 1px solid rgba(204, 122, 122, 0.4);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
}
.my-teacher-unenroll-btn:hover {
    background: rgba(204, 122, 122, 0.12);
    color: #ff9999;
}

/* ── Quiz end-of-results per-word breakdown ──────────────────────────────── */
.quiz-breakdown {
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.quiz-breakdown-title {
    margin: 0 0 4px;
    font-size: 1rem;
    color: #ddd;
    font-weight: 600;
}
.quiz-breakdown-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.2fr) 2fr 2fr;
    gap: 14px;
    align-items: start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
}
.quiz-breakdown-term {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    word-break: break-all;
}
.quiz-breakdown-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.85rem;
}
.quiz-breakdown-label {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.quiz-ans {
    color: #ddd;
    word-break: break-word;
}
.quiz-ans-correct {
    color: #6cd07a;
}
.quiz-ans-wrong {
    color: #ed4267;
}
.quiz-ans-expected {
    color: #aaa;
    font-style: italic;
}
@media (max-width: 640px) {
    .quiz-breakdown-row {
        grid-template-columns: 1fr;
    }
}

/* ── App footer ────────────────────────────────────────────────────────────── */
.yomitan-footer {
    width: 100%;
    max-width: 960px;
    margin: auto auto 0;
    padding: 24px 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    color: #888;
    font-size: 0.82rem;
    line-height: 1.5;
}
.yomitan-footer-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}
.yomitan-footer-links a {
    color: #cfcfcf;
    text-decoration: none;
}
.yomitan-footer-links a:hover {
    color: #ed4267;
}
.yomitan-footer-sep {
    color: #555;
}
.yomitan-footer-disclaimer {
    margin: 0;
    color: #777;
    font-size: 0.75rem;
}
.yomitan-footer-disclaimer a {
    color: #999;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.18);
}
.yomitan-footer-disclaimer a:hover {
    color: #ed4267;
    text-decoration-color: #ed4267;
}

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    body {
        padding: 80px 16px 16px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 1.25rem;
    }

    /* Auth bar: tighten so it doesn't crowd the h1 */
    .auth-bar {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    .auth-howto-link {
        font-size: 0.78rem;
        padding: 4px 4px;
    }
    .auth-login-btn,
    .auth-signout-btn {
        font-size: 0.78rem;
        padding: 5px 10px;
    }
    .auth-email {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.78rem;
    }

    /* "My teacher" banner: flow inline, tight layout, label truncates */
    .my-teacher-bar {
        position: static;
        margin: 0 0 16px;
        max-width: none;
        width: 100%;
        font-size: 0.8rem;
        padding: 8px 12px;
        gap: 8px;
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.08);
        white-space: normal;
    }
    .my-teacher-bar .my-teacher-label {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .my-teacher-bar .student-status-pill {
        font-size: 0.65rem;
        padding: 2px 8px;
        flex-shrink: 0;
    }
    .my-teacher-bar .my-teacher-unenroll-btn {
        font-size: 0.72rem;
        padding: 3px 10px;
        flex-shrink: 0;
    }

    /* History sidebar: pin smaller trigger to corner, panel slides full-width */
    .history-sidebar {
        top: auto;
        bottom: 16px;
        left: 0;
        transform: none;
    }

    /* Search row: stack the input and clipboard toggle */
    .search-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .clipboard-toggle {
        align-self: flex-end;
    }

    /* View tabs: distribute evenly */
    .view-tabs {
        gap: 6px;
    }
    .view-tab {
        flex: 1;
        font-size: 0.85rem;
        padding: 8px 6px;
    }

    /* Results & cards take full width */
    .container {
        max-width: 100%;
    }

    /* Segmented preview a touch smaller */
    .segmented-preview {
        font-size: 1.4rem;
    }
    .segmented-section-header {
        font-size: 0.75rem;
    }

    /* Login overlay card padded for small screens */
    .login-card {
        margin: 16px;
        padding: 28px 24px;
    }

    /* Teacher app: roster items stack pill/buttons below name */
    .teacher-list-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .teacher-list-item-right {
        margin-left: auto;
    }
    .teacher-section-title-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Quiz UI: tighten paddings */
    .quiz-question,
    .quiz-results {
        padding: 16px;
    }
    .quiz-title {
        font-size: 1.25rem;
    }
    .quiz-results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Footer */
    .yomitan-footer {
        margin-top: 48px;
        padding: 20px 16px 0;
        font-size: 0.78rem;
    }

    /* Toast: full-width on phone */
    .login-toast {
        left: 16px;
        right: 16px;
        transform: translateY(20px);
        max-width: none;
        font-size: 0.85rem;
    }
    .login-toast.show {
        transform: translateY(0);
    }
}

/* ── Quiz option number prefix ─────────────────────────────────────────────── */
.quiz-opt-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #aaa;
    font-family: "SF Mono", Menlo, Consolas, monospace;
}
.quiz-opt-text {
    flex: 1;
    min-width: 0;
}
.quiz-option-btn.quiz-option-correct .quiz-opt-num,
.quiz-option-btn.quiz-option-incorrect .quiz-opt-num {
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
}

/* ── Quiz next button (Enter keyboard hint) ─────────────────────────────────── */
.quiz-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.quiz-next-kbd {
    /* slightly brighter than option numbers since this is the active action */
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ddd;
    font-size: 0.85rem;
}

/* Subtle hint showing the correct reading after a wrong reading answer */
.quiz-answer-hint {
    color: #aaa;
    font-size: 0.95rem;
}
.quiz-answer-hint strong {
    color: #6cd07a;
    font-weight: 600;
}

/* ── Teacher: search + tag controls ────────────────────────────────────────── */
.teacher-search-row {
    margin: 8px 0 12px;
}
.teacher-search-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e6e6e6;
    font-size: 0.9rem;
}
.teacher-search-input:focus {
    outline: none;
    border-color: rgba(237, 66, 103, 0.5);
    background: rgba(255, 255, 255, 0.06);
}
.teacher-inline-btn {
    margin-left: 10px;
    background: transparent;
    color: #aaa;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    transition:
        color 0.15s,
        border-color 0.15s;
}
.teacher-inline-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}
.teacher-add-tag-btn {
    background: transparent;
    color: #888;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.7rem;
    cursor: pointer;
    margin-left: 4px;
    transition:
        color 0.15s,
        border-color 0.15s;
}
.teacher-add-tag-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}
.teacher-tag-remove {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 6px;
    padding: 0;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
}
.teacher-tag-remove:hover {
    color: #ed4267;
}
.teacher-tag-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 0;
    background: transparent;
    border: none;
}
.teacher-tag-pick-btn {
    background: rgba(255, 255, 255, 0.04);
    color: #e6e6e6;
    border: 1px solid var(--tag-color, #888);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.72rem;
    cursor: pointer;
}
.teacher-tag-pick-btn:hover {
    background: var(--tag-color, rgba(255, 255, 255, 0.1));
    color: #fff;
}

/* App subtitle under the Yomitan-Lite h1 */
.app-subtitle {
    color: #999;
    font-size: 0.95rem;
    text-align: center;
    margin: -1.25rem 0 1.75rem;
    font-weight: 400;
}

/* Top-left "Yomitan-Lite" home link (mirrors the auth-bar position on the right) */
.home-link {
    position: fixed;
    top: 16px;
    left: 20px;
    color: #ed4267;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.2px;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition:
        background 0.15s,
        color 0.15s;
    z-index: 200;
}
.home-link:hover {
    background: rgba(237, 66, 103, 0.08);
    color: #ff8aab;
}
@media (max-width: 720px) {
    .home-link {
        top: 10px;
        left: 10px;
        font-size: 0.85rem;
        padding: 4px 6px;
    }
}

/* ── Review intro screen ──────────────────────────────────────────────────── */
.review-intro {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 24px;
}
.review-stats {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    margin: 1rem 0;
}
.review-stat-num {
    font-size: 3rem;
    font-weight: 700;
    color: #ed4267;
    line-height: 1;
}
.review-stat-label {
    color: #aaa;
    font-size: 0.95rem;
}
.review-intro-sub {
    color: #bbb;
    font-size: 0.9rem;
    margin: 1rem auto 1.5rem;
    max-width: 480px;
    line-height: 1.55;
}

/* ── Review stage breakdown ───────────────────────────────────────────────── */
.review-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.review-stage {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 18px;
    text-align: center;
}
.review-stage-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 6px;
}
.review-stage-label {
    font-size: 0.85rem;
    color: #ddd;
    font-weight: 600;
    margin-bottom: 2px;
}
.review-stage-sub {
    font-size: 0.7rem;
    color: #888;
}
/* Subtle stage tints — left border + matching tag color */
.review-stage-new { border-left: 3px solid rgba(255, 255, 255, 0.25); }
.review-stage-learning { border-left: 3px solid #f0b232; }
.review-stage-reviewing { border-left: 3px solid #2dd4bf; }
.review-stage-mastered { border-left: 3px solid #6cd07a; }

.review-empty-note {
    color: #aaa;
    font-size: 0.9rem;
    margin: 0 auto;
    max-width: 480px;
}
