:root {
    --bg: #f4efe6;
    --bg-soft: #fbf8f2;
    --panel: rgba(255, 255, 255, 0.8);
    --panel-strong: #fffdf8;
    --text: #1e2430;
    --muted: #637081;
    --line: rgba(30, 36, 48, 0.08);
    --accent: #d85d34;
    --accent-soft: #ffe2d6;
    --success: #e6f6ec;
    --success-text: #1f7a43;
    --error: #fde8e6;
    --error-text: #a53b2f;
    --info: #e8f0fc;
    --info-text: #245fb5;
    --shadow: 0 24px 60px rgba(48, 38, 25, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Outfit", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(216, 93, 52, 0.16), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(255, 214, 153, 0.28), transparent 28rem),
        linear-gradient(180deg, #f9f4ec 0%, #efe7da 100%);
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0 2rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand strong,
.section-head h1,
.section-head h2,
.hero h1 {
    font-family: "Zen Kaku Gothic New", sans-serif;
}

.brand small,
.eyebrow,
.flash,
.pill,
small {
    color: var(--muted);
}

.brand-mark {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #1f2430, #d85d34);
    color: white;
    font-weight: 700;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.15rem;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #d85d34, #ef8b45);
    color: white;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(216, 93, 52, 0.2);
}

.button.ghost {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    box-shadow: none;
    border: 1px solid var(--line);
}

.content {
    display: grid;
    gap: 1.5rem;
}

.hero,
.grid-two,
.review-layout,
.stats {
    display: grid;
    gap: 1.25rem;
}

.hero {
    grid-template-columns: 1.2fr 0.9fr;
    align-items: center;
    min-height: 70vh;
}

.hero-copy h1 {
    font-size: clamp(2.4rem, 4vw, 4.8rem);
    line-height: 1;
    margin: 0.4rem 0 1rem;
}

.hero-copy p,
.section-head p,
.compact-note p,
.empty-copy {
    color: var(--muted);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.hero-card,
.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

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

.stat-grid article,
.action-card,
.list-row,
.stat-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.78);
    border-radius: 20px;
    border: 1px solid var(--line);
}

.stat-grid article strong,
.action-card strong,
.list-row strong,
.stat-card strong,
.review-prompts strong {
    display: block;
    color: var(--text);
}

.section-head {
    display: grid;
    gap: 0.2rem;
}

.section-head.compact,
.list-row,
.review-prompts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    display: grid;
    gap: 0.35rem;
}

.stat-card strong {
    font-size: 2rem;
}

.stat-card.accent {
    background: linear-gradient(135deg, rgba(216, 93, 52, 0.12), rgba(255, 226, 214, 0.9));
}

.grid-two,
.review-layout {
    grid-template-columns: 1.3fr 0.85fr;
}

.list {
    display: grid;
    gap: 0.75rem;
}

.quick-actions {
    display: grid;
    gap: 1rem;
}

.chart-panel {
    display: grid;
    gap: 1.25rem;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.25rem;
}

.chart-panel-wide {
    min-width: 0;
}

.chart-panel-narrow {
    min-width: 0;
}

.chart-shell {
    position: relative;
    min-height: 360px;
    padding: 1.1rem 1rem 0.6rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(251, 248, 242, 0.92));
    border: 1px solid var(--line);
    border-radius: 22px;
}

.chart-shell canvas {
    width: 100%;
    height: 100%;
}

@media (max-width: 980px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

.action-card span {
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.stack-form label,
.script-picker {
    display: grid;
    gap: 0.45rem;
}

.alternatives-stack {
    display: grid;
    gap: 0.75rem;
}

.alternative-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.primary-choice {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    cursor: pointer;
}

.primary-choice span {
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
}

.kanji-tools,
.kanji-suggestions,
.jmdict-suggestions {
    display: grid;
    gap: 0.75rem;
}

.kanji-tools {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.kanji-status {
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(36, 95, 181, 0.08);
    color: var(--info-text);
}

.jmdict-status {
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: rgba(216, 93, 52, 0.08);
    color: var(--accent);
}

.kanji-status.is-error {
    background: rgba(165, 59, 47, 0.08);
    color: var(--error-text);
}

.jmdict-status.is-error {
    background: rgba(165, 59, 47, 0.08);
    color: var(--error-text);
}

.kanji-suggestions {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.jmdict-suggestions {
    grid-auto-flow: column;
    grid-auto-columns: minmax(16rem, 20rem);
    overflow-x: auto;
    align-items: stretch;
    padding-bottom: 0.25rem;
}

.kanji-suggestion-chip {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.kanji-suggestion-chip strong {
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: 1.3rem;
}

.kanji-suggestion-chip span {
    color: var(--muted);
    line-height: 1.45;
}

.jmdict-suggestion-card {
    display: grid;
    gap: 0.35rem;
    width: 100%;
    min-height: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.jmdict-suggestion-card strong {
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: 1.1rem;
}

.jmdict-suggestion-card span {
    color: var(--muted);
    line-height: 1.5;
}

.kanji-suggestion-chip.active {
    border-color: rgba(216, 93, 52, 0.45);
    box-shadow: 0 0 0 4px rgba(216, 93, 52, 0.08);
}

.jmdict-suggestion-card.active {
    border-color: rgba(216, 93, 52, 0.45);
    box-shadow: 0 0 0 4px rgba(216, 93, 52, 0.08);
}

.kana-preview-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.inline-note {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.reading-shell {
    display: grid;
    gap: 0.85rem;
    padding: 0.85rem 1rem 1rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(30, 36, 48, 0.12);
    border-radius: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reading-shell:focus-within {
    border-color: rgba(216, 93, 52, 0.35);
    box-shadow: 0 0 0 4px rgba(216, 93, 52, 0.08);
}

.reading-shell-divider {
    height: 1px;
    background: var(--line);
}

.reading-shell .reading-preview {
    display: grid;
    gap: 0.35rem;
}

.reading-shell .reading-preview small {
    color: var(--muted);
}

.kana-preview-value {
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: 1.8rem;
    color: var(--text);
}

.kana-preview-value.is-error {
    color: var(--error-text);
}

.kana-preview-hint {
    color: var(--muted);
    line-height: 1.5;
}

input {
    width: 100%;
    border: 1px solid rgba(30, 36, 48, 0.12);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    font: inherit;
    background: rgba(255, 255, 255, 0.92);
}

select {
    width: 100%;
    border: 1px solid rgba(30, 36, 48, 0.12);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    font: inherit;
    background: rgba(255, 255, 255, 0.92);
}

textarea {
    width: 100%;
    min-height: 7rem;
    border: 1px solid rgba(30, 36, 48, 0.12);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    font: inherit;
    line-height: 1.55;
    resize: vertical;
    background: rgba(255, 255, 255, 0.92);
}

.reading-shell input {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.reading-shell input:focus {
    outline: none;
}

.kana-input,
.kana {
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: 1.2rem;
}

.input-error {
    border-color: rgba(165, 59, 47, 0.45);
    color: var(--error-text);
}

.reading-shell.input-error {
    border-color: rgba(165, 59, 47, 0.45);
    box-shadow: 0 0 0 4px rgba(165, 59, 47, 0.08);
}

.script-picker {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem;
}

.choice-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
}

.choice-card input {
    width: auto;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(216, 93, 52, 0.1);
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 600;
}

.pill.strong {
    background: rgba(31, 36, 48, 0.08);
    color: var(--text);
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
}

.flash {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    font-weight: 500;
}

.flash.success {
    background: var(--success);
    color: var(--success-text);
}

.flash.error {
    background: var(--error);
    color: var(--error-text);
}

.flash.info {
    background: var(--info);
    color: var(--info-text);
}

.table-wrap {
    overflow-x: auto;
}

.vocabulary-page {
    position: relative;
    overflow: hidden;
}

.vocabulary-toolbar,
.pagination-bar,
.pagination-actions,
.side-modal-head,
.delete-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.vocabulary-toolbar,
.pagination-bar {
    justify-content: space-between;
}

.vocabulary-toolbar input {
    max-width: 24rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.95rem 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.clickable-row {
    cursor: pointer;
    transition: background 0.18s ease;
}

.clickable-row:hover,
.clickable-row.active {
    background: rgba(216, 93, 52, 0.08);
}

.clickable-row td strong,
.clickable-row td small {
    display: block;
}

.romaji-note {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.pagination-bar {
    margin-top: 1rem;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(30, 36, 48, 0.28);
    backdrop-filter: blur(4px);
}

.side-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: min(32rem, 100%);
    height: 100vh;
    padding: 1.5rem;
    background: #fffdf8;
    box-shadow: -24px 0 60px rgba(48, 38, 25, 0.18);
    display: grid;
    align-content: start;
    gap: 1.25rem;
    overflow-y: auto;
    z-index: 2;
}

.side-modal-head {
    justify-content: space-between;
    align-items: start;
}

.side-modal h2 {
    margin: 0.2rem 0 0;
    font-family: "Zen Kaku Gothic New", sans-serif;
}

.danger {
    background: linear-gradient(135deg, #b64333, #d85d34);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.admin-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1.25rem;
}

.admin-user-list {
    display: grid;
    gap: 1rem;
}

.admin-user-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--line);
}

.admin-user-head,
.admin-user-meta,
.admin-user-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-user-head strong,
.admin-mini-stat strong {
    font-size: 1.05rem;
}

.code-display {
    font-family: "Zen Kaku Gothic New", sans-serif;
    letter-spacing: 0.08em;
}

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

.admin-mini-stat {
    min-width: 7rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(251, 248, 242, 0.92);
    border: 1px solid var(--line);
}

.review-card {
    display: grid;
    gap: 1.75rem;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.review-mode-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 1.25rem;
}

.review-mode-card,
.review-deck-list,
.review-deck-link,
.review-empty-actions {
    display: grid;
    gap: 0.95rem;
}

.review-mode-card-primary {
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.96), rgba(255, 253, 249, 0.94));
}

.review-mode-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.review-deck-link {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 36, 48, 0.08);
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
}

.review-deck-link:hover {
    border-color: rgba(216, 93, 52, 0.35);
    box-shadow: 0 14px 32px rgba(216, 93, 52, 0.1);
}

.review-deck-link small {
    color: var(--muted);
}

.review-session-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.review-session-stat {
    display: grid;
    gap: 0.3rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 250, 240, 0.88);
    border: 1px solid rgba(63, 45, 28, 0.08);
    text-align: center;
}

.review-session-stat small {
    color: var(--muted);
    font-size: 0.78rem;
}

.review-session-stat strong {
    font-size: 1.45rem;
    line-height: 1;
}

@media (max-width: 720px) {
    .review-session-stats {
        grid-template-columns: 1fr;
    }
}

.review-card.is-success {
    background: linear-gradient(180deg, rgba(230, 246, 236, 0.96), rgba(247, 252, 248, 0.94));
    border-color: rgba(31, 122, 67, 0.18);
}

.review-card.is-error {
    background: linear-gradient(180deg, rgba(253, 232, 230, 0.98), rgba(255, 247, 246, 0.94));
    border-color: rgba(165, 59, 47, 0.2);
}

.review-scope-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.review-scope-inline strong {
    display: block;
    font-size: 1.15rem;
    font-family: "Zen Kaku Gothic New", sans-serif;
}

.review-layout {
    grid-template-columns: 1fr;
}

.review-head {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 0.7rem;
}

.review-prompt-word {
    display: grid;
    justify-items: center;
    text-align: center;
    padding: 1rem 0 0.25rem;
}

.review-prompt-word h1 {
    margin: 0;
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 1.05;
}

.review-ruby {
    display: inline-flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.55rem;
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 1.05;
}

.review-ruby rb,
.review-ruby rt {
    font-style: normal;
}

.review-ruby rt {
    font-size: clamp(0.95rem, 2vw, 1.4rem);
    color: var(--muted);
    letter-spacing: 0.04em;
}

.review-form {
    justify-items: center;
    text-align: center;
}

.review-form label {
    width: min(100%, 34rem);
    justify-items: center;
}

.review-answer-label {
    font-weight: 600;
    color: var(--text);
}

.review-form .reading-shell,
.review-form input[type="text"] {
    width: 100%;
}

.review-form input[type="text"] {
    text-align: center;
}

.review-feedback,
.review-feedback-grid,
.review-continue-form {
    display: grid;
}

.review-feedback {
    gap: 1rem;
    justify-items: center;
    text-align: center;
}

.review-feedback-copy {
    display: grid;
    gap: 0.5rem;
}

.review-feedback-copy strong {
    font-size: 1.5rem;
    font-family: "Zen Kaku Gothic New", sans-serif;
}

.review-feedback-copy p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
}

.review-feedback-grid {
    width: min(100%, 42rem);
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.review-feedback-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 36, 48, 0.08);
    border-radius: 18px;
}

.review-feedback-card strong {
    font-size: 1.35rem;
    font-family: "Zen Kaku Gothic New", sans-serif;
}

.review-note-card {
    width: min(100%, 42rem);
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(30, 36, 48, 0.08);
    border-radius: 18px;
    text-align: left;
}

.review-note-card p {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.65;
    color: var(--text);
}

.review-continue-form {
    gap: 0.65rem;
    justify-items: center;
}

.review-continue-form small {
    color: var(--muted);
}

.narrow {
    width: min(100%, 32rem);
    margin: 0 auto;
}

.center {
    text-align: center;
}

.review-empty-card {
    gap: 1rem;
    justify-items: center;
}

.deck-manager,
.deck-create-form,
.deck-summary-grid,
.deck-summary-actions,
.deck-context-panel,
.review-scope-form {
    display: grid;
    gap: 0.9rem;
}

.deck-manager {
    margin-bottom: 1.4rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(30, 36, 48, 0.08);
}

.deck-create-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.deck-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.deck-summary-card {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(30, 36, 48, 0.08);
    border-radius: 18px;
}

.deck-summary-card.active {
    border-color: rgba(216, 93, 52, 0.45);
    box-shadow: 0 14px 32px rgba(216, 93, 52, 0.12);
}

.deck-summary-card small {
    color: var(--muted);
}

.deck-summary-actions {
    grid-template-columns: repeat(3, auto);
    align-items: center;
    justify-content: start;
}

.deck-summary-actions a,
.deck-summary-actions button {
    appearance: none;
    border: none;
    background: none;
    color: #d85d34;
    font: inherit;
    padding: 0;
    cursor: pointer;
}

.deck-summary-actions form {
    margin: 0;
}

.deck-context-panel {
    margin-bottom: 1.4rem;
    padding: 1.15rem 1.2rem;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(30, 36, 48, 0.08);
    border-radius: 20px;
}

.pill-autocomplete {
    display: grid;
    gap: 0.8rem;
}

.pill-autocomplete-shell {
    position: relative;
    display: grid;
    gap: 0.75rem;
}

.pill-autocomplete-input {
    width: 100%;
}

.pill-autocomplete-suggestions {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    z-index: 10;
    display: grid;
    gap: 0.35rem;
    padding: 0.55rem;
    background: #fffdf8;
    border: 1px solid rgba(30, 36, 48, 0.12);
    border-radius: 18px;
    box-shadow: 0 20px 34px rgba(30, 36, 48, 0.14);
}

.pill-autocomplete-suggestions[hidden] {
    display: none !important;
}

.pill-autocomplete-option,
.pill-autocomplete-empty {
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
}

.pill-autocomplete-option {
    border: none;
    background: rgba(245, 238, 226, 0.88);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.pill-autocomplete-option.active,
.pill-autocomplete-option:hover {
    background: rgba(216, 93, 52, 0.14);
}

.pill-autocomplete-empty {
    color: var(--muted);
    background: rgba(245, 238, 226, 0.4);
}

.pill-autocomplete-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pill-autocomplete-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(216, 93, 52, 0.12);
    border: 1px solid rgba(216, 93, 52, 0.18);
    color: #9d4324;
}

.pill-autocomplete-pill-remove {
    appearance: none;
    border: none;
    background: rgba(216, 93, 52, 0.12);
    color: inherit;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.review-scope-panel {
    align-self: start;
}

@media (max-width: 900px) {
    .hero,
    .grid-two,
    .review-mode-grid,
    .review-layout,
    .stats,
    .admin-layout,
    .admin-actions-grid {
        grid-template-columns: 1fr;
    }

    .topbar,
    .section-head.compact,
    .list-row,
    .review-scope-inline {
        align-items: stretch;
        flex-direction: column;
    }

    .vocabulary-toolbar,
    .pagination-bar,
    .pagination-actions,
    .side-modal-head,
    .delete-form,
    .deck-summary-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .vocabulary-toolbar input,
    .vocabulary-toolbar select {
        max-width: none;
    }

    .side-modal {
        width: 100%;
    }

    .kanji-tools {
        grid-template-columns: 1fr;
    }

    .chart-shell {
        min-height: 300px;
        padding: 0.85rem 0.6rem 0.4rem;
    }

    .deck-create-form {
        grid-template-columns: 1fr;
    }
}
