/* Słówko — responsive interface, including compact iPhone layouts. */
:root {
  --page: #f6f7f3; --paper: #ffffff; --ink: #202e2b; --muted: #6b7771;
  --line: #e3e8df; --green: #286448; --green-dark: #1c4a34;
  --mint: #e6f2df; --lime: #d4ebba; --error: #a54032; --error-bg: #fff3ed;
  --radius: 24px; --shadow: 0 8px 32px #253e2d06;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px; color: var(--ink); background: var(--page); color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; }
button, input, select, summary, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #669e61; outline-offset: 4px; }
input:focus-visible { outline: none; }
[hidden] { display: none !important; }
.icon { display: inline-block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex-shrink: 0; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; left: 16px; top: -70px; z-index: 100; padding: 14px; background: var(--ink); color: white; border-radius: 12px; }
.skip-link:focus { top: 12px; }
.app-header { background: #ffffffaa; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1196px; margin: auto; padding: 0 28px; height: 90px; display: flex; align-items: center; gap: 32px; }
.brand { text-decoration: none; font-weight: 800; font-size: 29px; letter-spacing: -1.4px; display: inline-flex; gap: 10px; align-items: center; margin-right: auto; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--green); color: var(--lime); display: grid; place-items: center; transform: rotate(-5deg); }
.brand-mark .icon { width: 27px; height: 27px; stroke-width: 3; }
.brand-dot { color: var(--green); }
.top-nav { display: flex; gap: 8px; padding: 5px; border: 1px solid var(--line); background: #f5f7f1; border-radius: 14px; }
.nav-button { border: none; display: flex; gap: 9px; align-items: center; border-radius: 10px; color: var(--muted); padding: 11px 18px; background: transparent; font-weight: 650; font-size: 14px; min-height: 44px; }
.nav-button.active { color: var(--green-dark); background: white; box-shadow: 0 2px 8px #17221b0a; }
.nav-button:hover { color: var(--green); }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); flex-shrink: 0; }
.icon-button:hover { background: var(--mint); border-color: #ceddc4; }
.app-main { max-width: 1196px; margin: auto; padding: 43px 28px 20px; }
.page-heading { display: flex; gap: 24px; justify-content: space-between; align-items: center; margin: 0 0 34px; }
.eyebrow { font-size: 10px; letter-spacing: 1.8px; font-weight: 750; display: flex; align-items: center; gap: 8px; color: var(--green); margin: 0 0 12px; }
.tiny-line { width: 20px; height: 2px; background: var(--green); display: inline-block; }
h1 { font-size: clamp(30px, 3.5vw, 43px); font-weight: 700; letter-spacing: -1.65px; line-height: 1.14; margin: 0; }
.page-subtitle { color: var(--muted); font-size: 15px; margin: 12px 0 0; line-height: 1.5; }
.set-badge { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); background: #eff2e9; padding: 14px 18px; border-radius: 17px; flex-shrink: 0; }
.set-number { font-size: 32px; font-weight: 750; letter-spacing: -2px; color: var(--green); }
.set-badge strong { font-size: 14px; font-weight: 700; display: block; }
.set-badge div > span { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.workspace { display: grid; grid-template-columns: 263px minmax(0, 1fr); gap: 27px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 17px; }
.progress-card, .scope-card { border: 1px solid var(--line); background: var(--paper); border-radius: 20px; padding: 23px; }
.section-overline { font-size: 10px; font-weight: 750; letter-spacing: 1.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; margin: 0; }
.section-overline .icon { width: 17px; height: 17px; color: var(--green); }
.progress-ring { --progress: 0%; width: 152px; height: 152px; padding: 9px; margin: 24px auto 25px; border-radius: 50%; background: conic-gradient(var(--green) var(--progress), #edf1e9 0); }
.ring-inner { height: 100%; width: 100%; border-radius: 50%; background: white; display: flex; justify-content: center; align-items: center; flex-direction: column; }
.ring-inner > strong { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ring-inner strong span { font-size: 18px; font-weight: 450; margin-left: 1px; }
.ring-inner > span { font-size: 11px; color: var(--muted); margin-top: 7px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; text-align: center; margin: 0 0 20px; }
.stats-grid > div + div { border-left: 1px solid var(--line); }
.stats-grid strong { display: block; font-size: 26px; line-height: 1; letter-spacing: -.7px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats-grid div:first-child strong { color: var(--green); }
.stats-grid span { display: block; font-size: 11px; color: var(--muted); margin-top: 7px; }
.accuracy-row { border-top: 1px solid var(--line); padding-top: 17px; font-size: 11px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.accuracy-row strong { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.global-progress { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.5; margin: 13px 0 0; }
.global-progress:empty { display: none; }
.scope-card { padding: 21px; }
.select-input { background: white; color: var(--ink); border: 1px solid #d9e0d4; border-radius: 10px; min-height: 46px; width: 100%; padding: 9px 32px 9px 12px; font-size: 13px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%236b7771' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; text-overflow: ellipsis; }
.scope-card .select-input { margin-top: 12px; }
.scope-help { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 11px 0 13px; }
.text-button { border: 0; background: transparent; padding: 5px 0; display: inline-flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 550; min-height: 34px; text-decoration: none; }
.text-button:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.text-button .icon { width: 15px; height: 15px; }
.quiet-note { display: flex; align-items: start; gap: 10px; padding: 0 12px; color: var(--muted); }
.quiet-note .icon { width: 18px; height: 18px; margin-top: 3px; opacity: .75; }
.quiet-note p { font-size: 11px; line-height: 1.7; margin: 0; }
.content { min-width: 0; }
.quiz-card { border: 1px solid var(--line); background: white; border-radius: var(--radius); padding: 29px 36px 30px; box-shadow: var(--shadow); min-height: 497px; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.category-badge { background: #f0f4eb; color: #4c6747; padding: 7px 11px; border-radius: 8px; font-size: 11px; font-weight: 650; line-height: 1.4; }
.direction { color: #939d96; font-size: 11px; letter-spacing: 1.2px; display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.direction b { color: var(--ink); font-weight: 650; }
.direction .icon { width: 18px; height: 18px; }
.question-block { padding: 45px 0 35px; min-height: 201px; display: flex; justify-content: center; flex-direction: column; text-align: center; }
.question-overline { font-size: 10px; letter-spacing: 1.6px; color: var(--muted); font-weight: 600; margin: 0 0 17px; }
.question-overline.retry { color: #95623d; }
#polish-word { font-size: clamp(27px, 3vw, 38px); line-height: 1.2; font-weight: 650; letter-spacing: -1.1px; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
#polish-word.long { font-size: 29px; line-height: 1.3; }
.word-cue { font-size: 12px; line-height: 1.5; margin: 14px 0 0; color: #6c7656; }
.answer-label { font-size: 12px; font-weight: 650; display: flex; align-items: center; justify-content: space-between; margin: 0 0 9px; }
.answer-label span { font-size: 11px; font-weight: 400; color: var(--muted); }
.input-wrap { display: flex; align-items: center; border: 1.5px solid #dbe3d6; border-radius: 13px; background: #fafbf8; padding-right: 15px; transition: box-shadow .15s, border-color .15s; }
.input-wrap:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px #28644810; background: white; }
#answer { background: transparent; min-width: 0; width: 100%; padding: 17px 18px; height: 60px; border: 0; border-radius: 13px; color: var(--ink); font-size: 19px; letter-spacing: .1px; }
#answer::placeholder { color: #929b93; font-size: 16px; }
.input-icon { display: grid; place-items: center; font-size: 23px; font-weight: 700; }
.input-wrap.is-correct { border-color: #5f9874; background: #f4f9ef; color: var(--green); }
.input-wrap.is-wrong { border-color: #d8a08c; background: #fffaf6; color: var(--error); }
.answer-hint { font-size: 11px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.input-error { color: var(--error); font-size: 12px; margin: 9px 0 0; }
.quiz-actions { margin-top: 26px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.button { border-radius: 12px; min-height: 49px; border: 1px solid transparent; padding: 13px 20px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 650; line-height: 1.35; transition: background .15s, transform .12s; }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--green); color: white; border-color: var(--green); }
.button-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
#check-button { min-width: 170px; }
.button-primary .icon { width: 18px; height: 18px; }
.button-quiet { color: var(--muted); background: transparent; padding-left: 0; padding-right: 12px; }
.button-quiet:hover { color: var(--ink); }
.button-secondary { background: white; border-color: #d8e0d2; color: var(--ink); }
.button-secondary:hover { background: #f1f5ec; }
.button-danger { background: #fff3ec; border-color: #e8c6b9; color: #984532; }
.button-danger:hover { background: #fae5db; }
.next-button { margin-left: auto; }
.feedback { margin-top: 20px; padding: 19px 21px; border: 1px solid #dbe9ce; border-radius: 14px; background: #f2f8ec; color: #2f593d; animation: appear .18s ease-out; }
.feedback.is-wrong { color: #8d422f; background: var(--error-bg); border-color: #f0d8ca; }
.feedback-heading { display: flex; align-items: center; gap: 9px; }
.feedback-heading h3 { font-size: 15px; margin: 0; font-weight: 750; }
#feedback-symbol { width: 22px; height: 22px; border-radius: 50%; font-size: 14px; background: #daebcc; display: grid; place-items: center; font-weight: 700; }
.is-wrong #feedback-symbol { background: #f3d7c8; }
.solution-label { font-size: 10px; letter-spacing: 1px; margin: 16px 0 5px; font-weight: 700; text-transform: uppercase; opacity: .8; }
.solution { font-size: 23px; font-weight: 750; line-height: 1.3; letter-spacing: -.3px; color: var(--ink); overflow-wrap: anywhere; margin: 0; }
.feedback-description { font-size: 12px; line-height: 1.65; margin: 9px 0 0; }
.typed-answer { font-size: 12px; margin: 8px 0 0; line-height: 1.55; overflow-wrap: anywhere; }
.variant-note { font-size: 11px; line-height: 1.55; margin: 9px 0 0; opacity: .9; }
.learning-rule { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 24px 22px; }
.rule-check { width: 32px; height: 32px; border: 1px solid #d1e0c5; border-radius: 50%; color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.rule-check .icon { width: 17px; height: 17px; }
.learning-rule p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.75; }
.learning-rule strong { color: #596a59; font-weight: 650; }
.done-card { border: 1px solid var(--line); padding: 43px 30px; border-radius: var(--radius); text-align: center; background: white; }
.done-illustration { width: 90px; height: 100px; border-radius: 18px; background: var(--lime); display: grid; place-items: center; margin: 4px auto 29px; transform: rotate(-8deg); position: relative; }
.done-illustration .icon { width: 53px; height: 53px; stroke-width: 2.6; color: var(--green); }
.done-illustration span { position: absolute; width: 31px; height: 31px; border-radius: 50%; background: var(--green); color: white; bottom: -5px; right: -12px; border: 4px solid white; display: grid; place-items: center; font-size: 13px; }
.centered { justify-content: center; }
.done-card h2 { font-size: 33px; letter-spacing: -1px; line-height: 1.2; margin: 10px 0 12px; }
.done-card > p:not(.eyebrow) { color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 390px; margin: 0 auto; }
.done-actions { display: flex; flex-direction: column; gap: 11px; margin: 25px auto 0; max-width: 330px; align-items: stretch; }
.done-actions .text-button { align-self: center; }
.app-footer { margin-top: 31px; border-top: 1px solid var(--line); padding: 17px 0 max(12px, env(safe-area-inset-bottom)); display: flex; gap: 18px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.app-footer .text-button { font-size: 11px; }
.save-status { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 6px; height: 6px; background: #83a273; border-radius: 50%; flex-shrink: 0; }
.status-dot.offline { background: #b68a55; }
.status-dot.warning { background: var(--error); }
.library-view { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 28px 0; background: white; overflow: hidden; }
.library-heading h2 { font-size: 25px; font-weight: 650; letter-spacing: -.8px; margin: 11px 0 22px; }
.library-toolbar { display: flex; align-items: center; gap: 10px; }
.search-field { display: flex; align-items: center; min-width: 0; flex: 1; min-height: 46px; border: 1px solid #d9e0d4; border-radius: 10px; padding: 0 12px; color: var(--muted); background: #fafbf8; }
.search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 2px #28644810; }
.search-field .icon { width: 17px; height: 17px; }
.search-field input { width: 100%; min-width: 0; border: 0; background: transparent; font-size: 13px; padding: 13px 0 13px 9px; color: var(--ink); }
.library-toolbar .select-input { width: 131px; flex-shrink: 0; }
.library-count { font-size: 11px; color: var(--muted); margin: 18px 0 10px; }
.word-list { padding: 0; margin: 0; list-style: none; }
.word-row { display: flex; gap: 13px; align-items: center; padding: 17px 0; border-top: 1px solid var(--line); }
.word-row-main { flex: 1; min-width: 0; }
.word-row-main strong { font-size: 14px; line-height: 1.4; font-weight: 600; display: block; overflow-wrap: anywhere; }
.word-english { font-size: 14px; color: var(--green); margin: 5px 0; line-height: 1.5; overflow-wrap: anywhere; }
.word-meta { font-size: 10px; color: var(--muted); line-height: 1.5; margin: 0; }
.word-state { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.state-chip { font-size: 10px; line-height: 1.4; white-space: nowrap; padding: 6px 9px; border-radius: 6px; color: var(--muted); background: #f3f5ef; }
.state-chip.learned { background: var(--mint); color: var(--green); }
.restore-button { width: 36px; height: 36px; border-radius: 10px; color: var(--muted); }
.restore-button .icon { width: 16px; height: 16px; }
.empty-state { text-align: center; padding: 48px 12px; color: var(--muted); }
.empty-state > .icon { width: 32px; height: 32px; }
.empty-state h3 { font-size: 17px; color: var(--ink); }
.empty-state p { font-size: 13px; line-height: 1.6; }
dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 24px; padding: 28px; background: white; box-shadow: 0 24px 100px #20322c26; max-height: min(90dvh, 920px); }
dialog::backdrop { background: #14251fb0; backdrop-filter: blur(3px); }
.settings-dialog { width: 580px; max-width: calc(100vw - 28px); }
.dialog-heading { display: flex; gap: 18px; align-items: center; justify-content: space-between; }
.dialog-heading h2 { font-size: 25px; line-height: 1.2; letter-spacing: -.8px; margin: 8px 0 0; }
.settings-section { margin-top: 25px; }
.settings-section h3, .danger-zone h3 { font-size: 15px; margin: 0 0 9px; font-weight: 700; }
.settings-section p, .help-details p, .danger-zone p { color: var(--muted); line-height: 1.7; font-size: 13px; margin: 0 0 12px; }
.settings-section strong, .help-details strong { color: #4a5e4b; font-weight: 650; }
.backup-actions { display: flex; gap: 10px; margin: 15px 0 12px; }
.backup-actions .button { flex: 1; }
.settings-section .small-note { font-size: 11px; line-height: 1.7; }
.help-details { border-top: 1px solid var(--line); margin-top: 19px; }
.help-details summary { padding: 18px 0 2px; cursor: pointer; font-size: 14px; font-weight: 650; }
.help-details[open] summary { margin-bottom: 13px; }
.danger-zone { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 23px; }
.danger-zone .button { margin-top: 2px; }
.version-label { font-size: 10px; color: #8c968f; text-align: center; margin: 26px 0 0; }
.confirm-dialog { width: 460px; max-width: calc(100vw - 30px); }
.confirm-dialog h2 { font-size: 22px; letter-spacing: -.5px; line-height: 1.25; margin: 0 0 15px; }
.confirm-dialog p { line-height: 1.7; color: var(--muted); font-size: 14px; margin: 0 0 25px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #223c2e; color: white; max-width: calc(100vw - 30px); width: max-content; border-radius: 13px; box-shadow: 0 8px 30px #14231b25; padding: 14px 20px; font-size: 13px; line-height: 1.6; z-index: 30; }
.notice { border: 1px solid #eac6a8; background: #fff3df; padding: 15px 22px; color: #89562b; font-size: 13px; line-height: 1.6; margin: 15px auto; width: min(1140px, calc(100% - 32px)); border-radius: 12px; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 960px) {
  .workspace { grid-template-columns: 225px minmax(0, 1fr); gap: 20px; }
  .quiz-card { padding: 25px; }
  .progress-card { padding: 21px 17px; }
  .scope-card { padding: 19px 17px; }
  .set-badge { padding: 12px; }
  .set-badge div > span { font-size: 10px; }
  .page-heading { gap: 12px; }
  .page-subtitle { font-size: 13px; }
  .question-block { padding-top: 35px; }
  .library-view { padding: 23px 21px 0; }
  .library-toolbar { flex-direction: column; align-items: stretch; }
  .library-toolbar .select-input { width: 100%; }
}
@media (max-width: 700px) {
  .header-inner { height: 70px; padding: 0 18px; gap: 13px; }
  .brand { font-size: 25px; gap: 8px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 10px; }
  .brand-mark .icon { width: 23px; height: 23px; }
  .top-nav { gap: 2px; padding: 3px; border-radius: 12px; }
  .nav-button { padding: 8px 10px; font-size: 12px; gap: 5px; min-height: 40px; }
  .nav-button .icon { width: 17px; height: 17px; }
  .settings-button { width: 39px; height: 39px; border: 0; background: transparent; }
  .app-main { padding: 26px 18px 12px; }
  .page-heading { margin-bottom: 23px; }
  .eyebrow { font-size: 9px; letter-spacing: 1.3px; margin-bottom: 10px; }
  h1 { font-size: 32px; letter-spacing: -1.35px; }
  .page-subtitle { font-size: 12px; margin-top: 9px; max-width: 290px; }
  .set-badge { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 17px; }
  .sidebar { width: 100%; gap: 11px; }
  .progress-card { position: relative; padding: 16px 17px; border-radius: 16px; display: grid; grid-template-columns: 68px 1fr auto; column-gap: 14px; align-items: center; }
  .progress-card > .section-overline { display: none; }
  .progress-ring { width: 64px; height: 64px; padding: 5px; margin: 0; }
  .ring-inner > strong { font-size: 19px; letter-spacing: -.7px; }
  .ring-inner strong span { font-size: 10px; }
  .ring-inner > span { display: none; }
  .stats-grid { margin: 0; gap: 0; }
  .stats-grid strong { font-size: 23px; }
  .stats-grid span { font-size: 9px; margin-top: 6px; }
  .stats-grid > div { padding: 0 9px; }
  .accuracy-row { display: flex; flex-direction: column-reverse; border: 0; padding: 0 0 0 15px; gap: 6px; border-left: 1px solid var(--line); }
  .accuracy-row strong { font-size: 21px; font-weight: 600; }
  .accuracy-row span { font-size: 0; }
  .accuracy-row span::after { content: "trafność"; font-size: 9px; }
  .global-progress { grid-column: 1 / -1; text-align: left; margin: 11px 0 0; font-size: 10px; }
  .scope-card { border: 0; padding: 0; background: transparent; display: flex; align-items: center; gap: 10px; }
  .scope-card label { letter-spacing: 1px; font-size: 9px; flex-shrink: 0; }
  .scope-card .select-input { margin: 0; background-color: #ffffffb0; font-size: 12px; min-height: 43px; }
  .scope-help, .quiet-note, #reset-scope { display: none; }
  .content { width: 100%; }
  .quiz-card { padding: 20px 21px 22px; border-radius: 19px; min-height: unset; }
  .quiz-top { gap: 10px; }
  .category-badge { font-size: 10px; padding: 6px 9px; }
  .direction { font-size: 10px; gap: 5px; }
  .direction .icon { width: 16px; height: 16px; }
  .question-block { min-height: 156px; padding: 28px 0 25px; }
  .question-overline { font-size: 8px; letter-spacing: 1.2px; margin-bottom: 13px; line-height: 1.7; }
  #polish-word { font-size: 29px; letter-spacing: -.8px; }
  #polish-word.long { font-size: 24px; letter-spacing: -.6px; }
  .word-cue { font-size: 10px; margin-top: 11px; }
  .answer-label { font-size: 11px; }
  .answer-label span { font-size: 10px; }
  #answer { font-size: 18px; padding: 16px 14px; height: 56px; }
  #answer::placeholder { font-size: 14px; }
  .answer-hint { font-size: 10px; }
  .quiz-actions { margin-top: 21px; }
  .button { min-height: 49px; font-size: 13px; padding: 13px 17px; border-radius: 11px; }
  #check-button { min-width: 149px; }
  .learning-rule { padding: 18px 6px 0; gap: 10px; justify-content: flex-start; }
  .learning-rule p { font-size: 10px; }
  .rule-check { width: 28px; height: 28px; }
  .feedback { margin-top: 16px; padding: 17px; }
  .feedback-heading h3 { font-size: 14px; }
  .solution { font-size: 21px; }
  .feedback-description { font-size: 11px; }
  .app-footer { margin-top: 22px; padding-top: 13px; gap: 7px; flex-wrap: wrap; font-size: 10px; }
  .app-footer .text-button { font-size: 10px; }
  .app-footer .text-button .icon { width: 13px; height: 13px; }
  .library-view { padding: 22px 19px 0; border-radius: 19px; }
  .library-heading h2 { font-size: 23px; margin-bottom: 18px; }
  .library-toolbar { flex-direction: row; flex-wrap: wrap; }
  .library-toolbar .select-input { width: 100%; }
  .search-field { flex-basis: 100%; }
  .search-field input { font-size: 16px; }
  .library-toolbar .select-input { font-size: 16px; }
  .word-row { gap: 9px; padding: 16px 0; }
  .word-row-main strong, .word-english { font-size: 13px; }
  .word-meta { font-size: 9px; }
  .word-state { flex-direction: column; gap: 7px; }
  .state-chip { font-size: 9px; padding: 5px 7px; }
  dialog { padding: 24px 21px; border-radius: 20px; }
  .dialog-heading h2 { font-size: 23px; }
  .backup-actions { gap: 8px; }
  .backup-actions .button { padding: 12px 10px; font-size: 12px; }
  .backup-actions .icon { width: 17px; height: 17px; }
  .done-card { padding: 36px 21px; border-radius: 19px; }
  .done-card h2 { font-size: 29px; }
  .done-card > p:not(.eyebrow) { font-size: 13px; }
}
@media (max-width: 370px) {
  .header-inner { padding: 0 12px; gap: 8px; }
  .brand { font-size: 23px; gap: 6px; }
  .brand-mark { width: 30px; height: 30px; }
  .nav-button { padding: 8px; font-size: 11px; }
  .nav-button .icon { display: none; }
  .app-main { padding-left: 13px; padding-right: 13px; }
  .progress-card { padding: 13px; column-gap: 8px; grid-template-columns: 60px 1fr auto; }
  .progress-ring { width: 58px; height: 58px; }
  .accuracy-row { padding-left: 12px; }
  .quiz-card { padding-left: 17px; padding-right: 17px; }
  h1 { font-size: 29px; }
  .scope-card label { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .app-header, .sidebar, .app-footer, .quiz-actions, .learning-rule, dialog, .toast { display: none !important; }
  body, .app-main { background: white; }
  .app-main { padding: 0; }
  .workspace { display: block; }
  .quiz-card, .library-view { box-shadow: none; }
}

@media (max-width: 700px) {
  .nav-button .icon { display: none; }
  .nav-button span { white-space: nowrap; }
}
@media (max-width: 370px) {
  .brand { font-size: 22px; }
  .brand-mark { width: 28px; height: 28px; }
  .settings-button { width: 35px; }
}

@media (max-width: 700px) {
  .scope-card .select-input { font-size: 16px; }
}

/* Vocabulary TXT management, v1.1 */
.vocab-launch { justify-content: center; font-size: 13px; min-height: 46px; }
.library-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.library-heading h2 { margin-bottom: 0; }
.library-heading > .button { min-height: 44px; padding: 10px 13px; }
.vocab-dialog { width: 650px; max-width: calc(100vw - 28px); overflow-y: auto; overscroll-behavior: contain; }
.vocab-summary { font-size: 12px; color: var(--muted); margin: 16px 0 23px; line-height: 1.6; }
.txt-format { display: flex; align-items: flex-start; gap: 14px; }
.txt-tag { display: inline-flex; background: #eef4e5; border: 1px solid #dce8d0; color: #3f6335; padding: 13px 10px; border-radius: 12px; font-size: 13px; font-weight: 750; }
.txt-format strong { font-size: 15px; }
.txt-format p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 5px 0 0; }
.txt-example { border: 1px solid var(--line); background: #f6f7f3; border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; white-space: pre-wrap; }
.vocab-file-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 20px 0; }
#vocab-file-name { overflow-wrap: anywhere; }
.vocab-text-label { display: block; margin: 20px 0 10px; }
#vocab-text { display: block; width: 100%; resize: vertical; min-height: 118px; max-height: 350px; padding: 14px; border: 1px solid #cad6c5; border-radius: 12px; font-family: ui-monospace, monospace; font-size: 16px; line-height: 1.6; color: var(--ink); background: white; }
#vocab-text:focus-visible { outline: 2px solid #669e61; outline-offset: 2px; }
.vocab-dialog .small-note { font-size: 12px; color: var(--muted); line-height: 1.7; }
.vocab-preview { margin-top: 20px; border: 1px solid #d9e6cf; border-radius: 14px; padding: 18px; background: #f5f8f0; }
.vocab-preview h3 { font-size: 14px; line-height: 1.7; margin: 0 0 8px; }
#vocab-preview-list { list-style: none; padding: 0; margin: 0; }
#vocab-preview-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; border-top: 1px solid #e1e8da; padding: 9px 0; font-size: 13px; overflow-wrap: anywhere; }
#vocab-preview-list li > * { flex: 1; min-width: 0; }
#vocab-preview-list li span { text-align: right; }
#confirm-vocab-import { margin-top: 8px; width: 100%; justify-content: center; }
.vocab-result { white-space: pre-wrap; overflow-wrap: anywhere; padding: 15px; border-radius: 12px; border: 1px solid #cfe0c1; background: #f0f7e9; font-size: 14px; line-height: 1.7; }
.vocab-result.is-error { background: #fff5ef; border-color: #eecdb7; }
.vocab-help { margin-top: 24px; }
#clear-own-txt { color: #913e31; line-height: 1.6; text-align: left; }
@media (max-width: 700px) {
  .vocab-launch { align-self: flex-start; min-height: 40px; padding: 8px 14px; font-size: 12px; }
  .vocab-dialog { padding: 23px 19px; }
  .vocab-dialog .dialog-heading h2 { font-size: 26px; }
  .txt-example { font-size: 12px; padding: 12px; }
  .vocab-summary { font-size: 11px; margin-bottom: 20px; }
  .vocab-dialog .backup-actions { flex-direction: column; align-items: stretch; }
  .vocab-dialog .backup-actions .button { justify-content: center; }
  .vocab-preview { padding: 14px; }
}
