@charset "UTF-8";
:root {
  color-scheme: dark;
  --bg: #191c22;
  --card: #252932;
  --ink: #f0f3f8;
  --muted: #a8b0be;
  --accent: #75a7ff;
  --good: #3ecf8e;
  --bad: #ff7070;
  --border: #373d48;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.3; overflow-wrap: anywhere; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; color: var(--muted); }
svg { flex-shrink: 0; vertical-align: middle; }
.icon { width: 18px; height: 18px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--bg); border-radius: 8px; }
.skip-link:focus { top: 8px; }
.shell { width: 100%; max-width: 760px; margin: 0 auto; }
.app-header { margin-bottom: 24px; }
.brand { display: inline-block; color: var(--ink); font-size: 22px; font-weight: 650; margin-bottom: 18px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.brand-row .brand { margin-bottom: 0; }
.profile-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px; border-radius: 8px; font-size: 14px; }
.profile-link.active { background: #333e53; color: #c2d7ff; }
.profile-panel { padding: 16px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); overflow-wrap: anywhere; }
.profile-panel p:last-child { margin-bottom: 0; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-error { color: #efbd72; }
#profile-status { overflow-wrap: anywhere; }
.navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: #20242c; }
.navigation a { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; padding: 8px 4px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); text-align: center; }
.navigation a:hover { color: var(--ink); text-decoration: none; }
.navigation a.active { background: #333e53; color: #c2d7ff; }
.page-toolbar { margin-bottom: 24px; }
.search-box { display: block; }
.search-box input { display: block; width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--card); font-size: 16px; }
.search-box input::placeholder { color: var(--muted); }
.page-footer { margin-top: 24px; font-size: 12px; color: var(--muted); }
.level-filters { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 24px; }
.filter-pill { min-width: 0; min-height: 42px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--muted); font-size: 13px; }
.filter-pill:hover { border-color: var(--accent); }
.filter-pill.selected { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.level-section { margin-bottom: 32px; }
.level-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.level-heading h2 { margin: 0; font-size: 20px; }
.level-heading > span { font-size: 12px; color: var(--muted); }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.set-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; min-width: 0; min-height: 96px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); transition: border-color .15s, background .15s; }
.set-card:hover { border-color: var(--accent); background: #2b303b; text-decoration: none; }
.set-card-main { min-width: 0; }
.set-card strong { display: block; font-size: 16px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.set-meta { display: block; font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 6px; }
.set-mastery { display: block; min-width: 48px; font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.set-mastery small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 400; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; text-align: center; background: var(--card); color: var(--ink); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.button:hover { filter: brightness(1.1); text-decoration: none; }
.quiet-button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; min-height: 40px; color: var(--muted); background: var(--card); font-size: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin-bottom: 12px; font-size: 14px; }
.page-heading { margin-bottom: 20px; }
.page-heading p { font-size: 14px; }
.level-tag { display: inline-block; min-width: 30px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 12px; text-align: center; }
.detail-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.set-detail, .quiz-card, .flashcard, .completion { padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.detail-subtitle { font-size: 15px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.word-list-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }
.word-list-heading h2 { margin: 0; }
.dictionary-list { border: 1px solid var(--border); border-radius: 10px; background: var(--card); overflow: hidden; }
.dictionary-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.dictionary-row > summary { display: grid; grid-template-columns: 25px minmax(0,1fr) minmax(0,1.2fr) 32px 64px 12px; align-items: center; gap: 12px; padding: 14px; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.word-number { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.dictionary-lemma, .dictionary-translation { overflow-wrap: anywhere; }
.dictionary-lemma { font-weight: 600; }
.dictionary-lemma > small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.dictionary-translation { font-size: 13px; }
.word-status { color: var(--muted); font-size: 11px; text-align: right; }
.word-status.mastered { color: var(--good); }
.word-status.learning { color: #efbd72; }
.expand-plus { color: var(--muted); }
.dictionary-row[open] .expand-plus { transform: rotate(45deg); }
.word-expanded { padding: 0 14px 16px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.word-expanded > div:first-child { display: flex; align-items: center; gap: 8px; }
.sound-button { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: transparent; flex-shrink: 0; }
.example-box { margin-top: 14px; padding: 10px 12px; border-left: 2px solid var(--accent); background: var(--bg); text-align: left; }
.example-box p { margin: 0; font-size: 14px; color: var(--ink); }
.example-box p + p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.source-word-link { display: inline-block; margin-top: 12px; }
.word-sources { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; }
.word-source { margin-top: 6px; }
.word-source a, .source-word-link, .source-license a { text-decoration: underline; }
.review-label { display: block; font-size: 11px; margin-top: 4px; }
.review-label, .review-note, .word-status.review { color: #efbd72; }
.review-note { font-size: 12px; }
.fine-print { font-size: 12px; margin: 16px 0; }
.dictionary-filters { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.dictionary-filters .level-filters { flex: 1 1 340px; min-width: 0; }
.topic-select select, .direction-select select { max-width: 100%; min-height: 40px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); font-size: 13px; }
.results-label { margin: 12px 0; color: var(--muted); font-size: 13px; }
.study-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.study-heading h1 { margin-bottom: 16px; }
.study-counter { flex-shrink: 0; color: var(--muted); font-size: 16px; text-align: right; }
.study-counter strong { color: var(--ink); }
.study-counter > span { display: block; font-size: 12px; }
.study-progress { display: block; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden; margin-bottom: 16px; background: var(--border); }
.study-progress::-webkit-progress-bar { background: var(--border); }
.study-progress::-webkit-progress-value { background: var(--good); }
.study-progress::-moz-progress-bar { background: var(--good); }
.study-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.mode-tabs { display: flex; gap: 12px; }
.mode-tabs > a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--muted); font-size: 14px; }
.mode-tabs > a.active { color: var(--accent); }
.study-body { margin-top: 16px; }
.quiz-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.question-prompt { font-size: 24px; margin: 20px 0 6px; overflow-wrap: anywhere; }
.question-kind { font-size: 13px; margin-bottom: 16px; }
.answer-options { display: flex; flex-direction: column; gap: 10px; }
.answer-option { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #34373f; text-align: left; font-size: 15px; overflow-wrap: anywhere; }
.answer-option:hover:not(:disabled) { border-color: var(--accent); }
.answer-option:disabled { opacity: 1; }
.option-number { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.answer-option.is-correct { background: rgba(62,207,142,.18); border-color: var(--good); }
.answer-option.is-wrong { background: rgba(255,92,92,.18); border-color: var(--bad); }
.is-correct .option-number { color: var(--good); }
.is-wrong .option-number { color: var(--bad); }
.keyboard-hint, .study-bottom-note, .card-counter { font-size: 12px; color: var(--muted); margin-top: 14px; }
.answer-feedback { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; font-size: 14px; color: var(--good); }
.answer-feedback > span { font-size: 12px; color: var(--muted); }
.answer-feedback.incorrect { color: var(--bad); }
.answer-example { margin-top: 16px; }
.answer-example > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.next-question { width: 100%; margin-top: 16px; }
.next-question kbd { margin-left: auto; font-size: 11px; font-family: inherit; }
.flashcard { text-align: center; }
.flashcard-meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
#card-word { margin: 20px 0; font-size: 36px; overflow-wrap: anywhere; }
.card-translation { font-size: 22px; color: var(--ink); }
.card-definition { font-size: 14px; }
.flashcard-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.flashcard-controls > span { color: var(--muted); font-size: 12px; }
.completion { text-align: center; }
.completion-mark { color: var(--good); }
.completion h2 { color: var(--good); margin: 12px 0; font-size: 24px; }
.completion-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.progress-metrics { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.progress-metrics > div { flex: 1 1 140px; }
.progress-metrics strong { display: block; font-size: 24px; }
.progress-metrics strong small { font-size: 14px; color: var(--muted); }
.progress-metrics > div > span { font-size: 12px; color: var(--muted); }
.progress-panel { margin-bottom: 20px; }
.progress-set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--ink); border-bottom: 1px solid var(--border); }
.progress-set-row > div:first-of-type { flex: 1; min-width: 0; }
.progress-set-row strong, .progress-set-row small { display: block; overflow-wrap: anywhere; }
.progress-set-row small { color: var(--muted); font-size: 12px; }
.progress-set-row > span:nth-last-child(2) { white-space: nowrap; font-size: 12px; color: var(--muted); }
.progress-track { height: 5px; overflow: hidden; border-radius: 3px; background: var(--border); }
.progress-track > i { display: block; height: 100%; background: var(--good); }
.progress-set-row .progress-track { width: 12%; }
.backup-panel { padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); margin-top: 20px; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.import-label { cursor: pointer; }
.source-intro { margin-bottom: 20px; }
.source-cards { display: grid; gap: 20px; }
.info-card h2 { margin: 8px 0; }
.source-stat { color: var(--muted); font-size: 13px; }
.source-license { margin-top: 24px; overflow-wrap: anywhere; }
.text-link { display: inline-flex; align-items: center; gap: 6px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.taxonomy-panel { margin-top: 20px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; }
.taxonomy-panel > summary { cursor: pointer; }
.taxonomy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.taxonomy-grid strong, .taxonomy-grid span, .taxonomy-grid small { display: block; }
.taxonomy-grid small { color: var(--muted); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 24px 0; }
.pagination > span { color: var(--muted); font-size: 13px; text-align: center; }
.pagination small { display: block; font-size: 11px; }
.empty-state { padding: 24px 0; }
.empty-state h3 { margin: 12px 0; }
.loading-state { padding: 16px 0; }
.storage-notice { padding: 12px; margin-bottom: 16px; border: 1px solid #b9985f; border-radius: 8px; color: #efbd72; font-size: 13px; }
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 100; transform: translateX(-50%); max-width: calc(100vw - 32px); width: max-content; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); background: var(--card); opacity: 0; pointer-events: none; font-size: 14px; }
.toast.visible { opacity: 1; }
.noscript { text-align: center; padding: 16px; }
@media (max-width: 600px) {
  body { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  h1, .brand { font-size: 20px; }
  .set-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .topic-select select, .direction-select select { font-size: 16px; }
  .dictionary-row > summary { grid-template-columns: 24px minmax(0,1fr) minmax(0,1fr) 30px 10px; gap: 8px; padding: 12px; }
  .dictionary-row .word-status { display: none; }
  .word-number { font-size: 10px; }
  .dictionary-lemma { font-size: 14px; }
  .dictionary-filters { display: block; }
  .dictionary-filters .level-filters { margin-bottom: 12px; }
  .study-heading { gap: 10px; }
  .study-counter { font-size: 14px; }
  .study-counter > span { font-size: 11px; }
  .study-heading h1 { font-size: 19px; }
  .set-detail, .quiz-card, .flashcard, .completion { padding: 16px; }
  .quiz-card-meta { font-size: 10px; }
  .question-prompt { font-size: 22px; }
  .answer-option { font-size: 16px; padding: 14px; }
  .progress-set-row .progress-track, .progress-set-row > .icon { display: none; }
  .progress-set-row { gap: 8px; }
  .pagination { gap: 10px; }
  .pagination .button { padding: 8px 10px; font-size: 13px; }
  .pagination > span { font-size: 12px; }
  .flashcard-controls > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
