:root {
    --ink: #17212b;
    --muted: #6d7580;
    --line: #e3e1dc;
    --paper: #fffefa;
    --canvas: #f5f2eb;
    --red: #9f2f3f;
    --red-dark: #792230;
    --blue: #334f7d;
    --gold: #d79b42;
    --green: #347358;
    --shadow: 0 18px 48px rgba(43, 35, 28, .09);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; overflow-x: hidden; background: var(--canvas); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--red); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
input, select, textarea { max-width: 100%; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.page-content { padding-block: 52px 72px; }
.site-header { position: sticky; z-index: 20; top: 0; padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid rgba(23,33,43,.08); background: rgba(255,254,250,.94); backdrop-filter: blur(16px); }
.header-inner { min-height: 76px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); width: fit-content; }
.brand:hover { color: var(--ink); }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 18px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 5px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: var(--red); font-family: Georgia, serif; font-size: 23px; box-shadow: 0 7px 18px rgba(159,47,63,.22); }
.main-nav { display: flex; gap: 8px; padding: 4px; border-radius: 12px; background: #eeebe5; }
.main-nav a, .main-nav > span { padding: 6px 17px; border-radius: 9px; color: #5d6268; font-size: 14px; font-weight: 650; }
.main-nav a.active { background: var(--paper); color: var(--ink); box-shadow: 0 3px 12px rgba(43,35,28,.08); }
.main-nav .nav-disabled { color: #a29d95; cursor: not-allowed; }
.user-menu { justify-self: end; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.user-menu form { margin: 0; }
.link-button { border: 0; padding: 0; color: var(--red); background: none; cursor: pointer; }
.link-button:hover { color: var(--red-dark); }

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 5vw, 54px); font-weight: 500; line-height: 1.04; letter-spacing: -.025em; }
.eyebrow { margin-bottom: 10px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.stat-card { min-width: 150px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,254,250,.65); display: grid; }
.stat-card strong { font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.stat-card span { color: var(--muted); font-size: 12px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; margin-bottom: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 28px rgba(43,35,28,.04); }
.search-field { flex: 1 1 330px; }
input, select { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid #d9d6cf; border-radius: 11px; color: var(--ink); background: #fff; outline: none; }
textarea { width: 100%; padding: 13px; resize: vertical; border: 1px solid #d9d6cf; border-radius: 11px; color: var(--ink); background: #fff; outline: none; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51,79,125,.12); }
input:disabled, select:disabled, textarea:disabled, button:disabled { cursor: not-allowed; opacity: .62; }
.filter-bar select { width: auto; min-width: 160px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.button-primary { color: #fff; background: var(--red); }
.button-primary:hover { color: #fff; background: var(--red-dark); }
.button-quiet { border-color: var(--line); color: var(--ink); background: #fff; }
.button-wide { width: 100%; margin-top: 8px; }
.compact-filter { width: fit-content; }

.dictionary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.word-card { min-height: 194px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--paper); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.word-card:hover { transform: translateY(-3px); border-color: #cec7bd; color: var(--ink); box-shadow: var(--shadow); }
.word-card.has-quality-error, .entry-hero.has-quality-error { border-color: #d8aeb4; box-shadow: inset 0 0 0 1px rgba(138,44,57,.06), var(--shadow); }
.word-card-link { flex: 1; display: flex; flex-direction: column; color: var(--ink); }
.word-card-link:hover { color: var(--ink); }
.word-card-top { display: flex; align-items: center; gap: 8px; }
.word-card-top .tag:first-of-type { margin-left: auto; }
.entry-id { color: #99928a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.tag { padding: 5px 8px; border-radius: 8px; color: var(--blue); background: #eaf0f8; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.tag-muted { color: #6c675f; background: #efede8; }
.tag-accent { color: #794e12; background: #f8ead1; }
.word-card h2 { margin: 25px 0 8px; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.translation-preview { min-height: 42px; margin-bottom: 17px; color: #444a50; line-height: 1.45; }
.translation-preview span { color: #bbb3a9; }
.domain-list { display: flex; flex-wrap: wrap; gap: 6px; }
.domain-list span { padding: 4px 7px; border-radius: 6px; color: #77716a; background: #f2efe9; font-size: 10px; }
.dictionary-progress { min-width: 0; }
.word-card .dictionary-progress { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.dictionary-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.dictionary-progress-heading .section-label, .dictionary-progress-heading .word-state { margin: 0; }
.dictionary-progress-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dictionary-progress-actions form { margin: 0; }
.dictionary-progress-actions .button { width: 100%; min-height: 36px; padding: 6px 9px; font-size: 11px; }
.dictionary-progress-actions .button:disabled { border-color: #d7d2ca; color: #9a958d; background: #e9e5de; cursor: not-allowed; opacity: .78; }
.dictionary-progress.is-saving { opacity: .65; }
.progress-error { margin: 8px 0 0; color: #8a2c39; font-size: 11px; line-height: 1.4; }
.dictionary-quality { min-width: 0; }
.word-card .dictionary-quality { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dictionary-quality-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.dictionary-quality-heading .section-label { margin: 0; }
.word-quality-state { padding: 5px 8px; border-radius: 8px; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.word-quality-state.ok { color: #286047; background: #deeee6; }
.word-quality-state.error { color: #8a2c39; background: #f5dfe2; }
.dictionary-quality-message { margin: 0 0 9px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.dictionary-quality-message:empty { display: none; }
.dictionary-quality-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dictionary-quality-actions form { margin: 0; }
.dictionary-quality-actions .button { width: 100%; min-height: 36px; padding: 6px 9px; font-size: 11px; }
.button-quality-error { border-color: #d9bdc1; color: #812b37; background: #fff; }
.button-quality-ok { border-color: #a9cbb9; color: #286047; background: #edf6f0; }
.dictionary-quality-actions .button:disabled { border-color: #d7d2ca; color: #9a958d; background: #e9e5de; cursor: not-allowed; opacity: .78; }
.dictionary-quality.is-saving { opacity: .65; }
.quality-error { margin: 8px 0 0; color: #8a2c39; font-size: 11px; line-height: 1.4; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 34px; font-size: 14px; }
.pagination span { color: var(--muted); }
.pagination a { font-weight: 700; }
.empty-state { padding: 64px 30px; border: 1px dashed #cbc5bc; border-radius: 18px; text-align: center; color: var(--muted); background: rgba(255,254,250,.45); }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 18px; }
.empty-state p { margin: 0; }
.empty-state.compact { padding: 28px; text-align: left; }

.back-link { display: inline-block; margin-bottom: 26px; font-size: 14px; font-weight: 700; }
.entry-page-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.entry-page-actions .back-link { margin-bottom: 0; }
.entry-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; padding: 38px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.entry-hero h1 { margin: 26px 0 8px; font-size: clamp(46px, 7vw, 76px); }
.entry-domains { align-self: end; padding: 20px; border-radius: 16px; background: #f4f1ea; }
.entry-sidebar { align-self: end; display: grid; gap: 12px; }
.entry-sidebar .dictionary-progress { padding: 16px; border-radius: 16px; background: #f4f1ea; }
.entry-sidebar .dictionary-quality { padding: 16px; border-radius: 16px; background: #f4f1ea; }
.entry-sidebar .entry-domains { align-self: stretch; }
.section-label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.content-section { margin-top: 42px; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.section-heading > span { display: grid; place-items: center; min-width: 25px; height: 25px; padding-inline: 7px; border-radius: 20px; color: var(--muted); background: #e9e5de; font-size: 11px; }
.translation-list { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--paper); }
.translation-row { display: flex; justify-content: space-between; gap: 30px; padding: 18px 20px; }
.translation-row + .translation-row { border-top: 1px solid var(--line); }
.translation-row span { color: var(--muted); font-size: 13px; text-align: right; }
.dictionary-edit-heading { margin-bottom: 24px; }
.dictionary-edit-heading p:last-child { max-width: 700px; }
.dictionary-edit-form { display: grid; gap: 20px; }
.dictionary-edit-form > ul, .edit-field ul, .edit-collection ul, .translation-editor > ul { margin: 7px 0 0; padding: 0; list-style: none; color: var(--red); font-size: 12px; }
.edit-panel { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 8px 28px rgba(43,35,28,.04); }
.edit-panel .section-heading { margin-bottom: 20px; }
.edit-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.edit-field { min-width: 0; }
.edit-field-wide { grid-column: 1 / -1; }
.edit-field label, .edit-field-label { display: block; margin-bottom: 7px; color: #4c5156; font-size: 12px; font-weight: 700; }
.edit-armenian-field input { min-height: 58px; font-family: Georgia, serif; font-size: 28px; }
.edit-subsection { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.edit-subsection-first { margin-top: 0; padding-top: 0; border-top: 0; }
.edit-collection-items { display: grid; gap: 8px; }
.edit-collection-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 8px; }
.edit-collection-row > ul { grid-column: 1 / -1; }
.edit-remove-button { display: grid; place-items: center; width: 38px; min-height: 38px; padding: 0; border: 1px solid #d9bdc1; border-radius: 10px; color: #812b37; background: #fff; cursor: pointer; font-size: 21px; line-height: 1; }
.edit-remove-button:hover { border-color: #c999a1; background: #fbf0f2; }
.edit-add-button { margin-top: 9px; }
.translation-editors, .translation-editor-items { display: grid; gap: 14px; }
.translation-editor { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fbfaf7; }
.translation-editor > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.translation-editor-fields { grid-template-columns: minmax(0, 1fr) 110px; }
.translation-editor-fields .edit-field-wide:last-child { grid-column: 1 / -1; }
.edit-advanced { padding: 0; }
.edit-advanced > summary { padding: 20px 24px; cursor: pointer; color: var(--blue); font-weight: 700; }
.edit-advanced-content { padding: 0 24px 24px; }
.edit-form-actions { position: sticky; z-index: 10; bottom: 12px; display: flex; justify-content: flex-end; gap: 10px; padding: 12px; border: 1px solid rgba(23,33,43,.08); border-radius: 16px; background: rgba(255,254,250,.94); box-shadow: 0 12px 35px rgba(43,35,28,.12); backdrop-filter: blur(14px); }
.compact-sentence-list { display: grid; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--paper); }
.compact-sentence-list a { display: grid; grid-template-columns: auto minmax(180px, .8fr) minmax(220px, 1fr); align-items: center; gap: 14px; padding: 17px 20px; color: var(--ink); }
.compact-sentence-list a + a { border-top: 1px solid var(--line); }
.compact-sentence-list a:hover { background: #faf7f1; }
.compact-sentence-list a > span:last-child { color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #aaa; }

.sentence-list { display: grid; gap: 18px; }
.sentence-card { border: 1px solid var(--line); border-radius: 20px; background: var(--paper); overflow: hidden; scroll-margin-top: 96px; }
.sentence-card:target { outline: 3px solid rgba(215,155,66,.35); }
.sentence-card > header { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fbf9f4; }
.sentence-card > header > div { display: flex; align-items: center; gap: 10px; }
.sentence-card time { color: var(--muted); font-size: 11px; }
.status-badge { padding: 5px 8px; border-radius: 8px; font-size: 10px; font-weight: 750; }
.status-in_set { color: #286047; background: #deeee6; }
.status-rejected { color: #8a2c39; background: #f5dfe2; }
.status-practice-disabled { color: #625c54; background: #e7e3dc; }
.sentence-header-actions { justify-content: flex-end; }
.sentence-status-form { margin: 0; }
.sentence-status-form.is-saving { opacity: .65; }
.status-error { color: #8a2c39; font-size: 11px; }
.button-small { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 11px; }
.button-reject { border-color: #d9bdc1; color: #812b37; background: #fff; }
.button-reject:hover { border-color: #c999a1; color: #70222d; background: #fbf0f2; }
.button-restore { border-color: #a9cbb9; color: #286047; background: #edf6f0; }
.button-restore:hover { border-color: #77a98f; color: #1f513b; background: #deeee6; }
.sentence-pair { display: grid; grid-template-columns: 1fr 1fr; }
.sentence-pair p { min-height: 92px; margin: 0; padding: 24px; font-size: 21px; line-height: 1.5; }
.sentence-pair p:first-child { border-right: 1px solid var(--line); font-family: Georgia, serif; font-size: 25px; }
.sentence-meta { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 16px 20px; border-top: 1px solid var(--line); background: #fbfaf7; }
.sentence-meta > div { min-width: 0; padding-inline: 14px; }
.sentence-meta > div + div { border-left: 1px solid var(--line); }
.sentence-meta dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.sentence-meta dd { margin: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.sentence-meta dd span { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.trace-details { border-top: 1px solid var(--line); }
.trace-details summary { padding: 15px 20px; cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 700; }
.trace-details summary span { margin-left: 5px; color: var(--muted); }
.table-wrap { overflow-x: auto; padding: 0 20px 20px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font-size: 9px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); }
.trace-label { margin: 0 20px 10px; }
.trace-details > .small { margin: 0 20px 18px; }

.practice-page .page-content { padding-block: 24px 48px; }
.practice-session-progress { margin-bottom: 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,254,250,.86); box-shadow: 0 8px 24px rgba(57,45,33,.06); }
.practice-session-progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.practice-session-progress-copy strong { color: var(--ink); font-size: 14px; }
.practice-session-progress-actions { display: flex; align-items: center; gap: 12px; }
.practice-session-progress-actions form { margin: 0; }
.practice-session-stop { padding: 2px 0; border: 0; color: #8a6570; background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.practice-session-stop:hover { color: var(--red-dark); }
.practice-session-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e9e4dc; }
.practice-session-progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .25s ease; }
.practice-sentence-id { position: absolute; right: 14px; bottom: 10px; z-index: 0; padding: 4px 7px; border-radius: 7px; color: #8a857e; background: rgba(251,249,244,.9); pointer-events: none; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.practice-card { position: relative; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.practice-prompt { position: relative; isolation: isolate; min-height: 170px; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; padding: 30px 38px 42px; overflow-x: auto; overscroll-behavior-inline: contain; white-space: pre-wrap; -webkit-overflow-scrolling: touch; font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4.5vw, 47px); line-height: 1.5; text-align: center; }
.practice-prompt-russian { font-family: inherit; font-size: clamp(27px, 4vw, 42px); }
.practice-prompt > span:not(.practice-sentence-id) { position: relative; z-index: 2; }
.practice-copy-button { position: absolute; top: 12px; right: 14px; z-index: 3; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(51,79,125,.1); border-radius: 10px; color: rgba(51,79,125,.68); background: rgba(255,254,250,.66); cursor: pointer; transition: color .15s ease, background .15s ease, box-shadow .15s ease; }
.practice-copy-button:hover { color: var(--blue); background: rgba(243,246,250,.92); box-shadow: 0 4px 12px rgba(43,35,28,.06); }
.practice-copy-button svg { display: block; width: 17px; height: 17px; transform: translateX(1px); stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.practice-copy-button.is-copied { color: #3f7b5f; background: rgba(237,246,240,.88); }
.practice-copy-button.is-copied svg { display: none; }
.practice-copy-button.is-copied span::after { content: "✓"; display: block; font-size: 16px; line-height: 1; }
.practice-prompt > * { transition: opacity .2s ease, filter .2s ease; }
.practice-card.is-loading-next .practice-prompt > * { opacity: .12; filter: blur(2px); }
.practice-card.is-loading-next .practice-prompt::before { content: ""; position: absolute; z-index: 4; inset: 0; background: linear-gradient(105deg, rgba(255,254,250,.35) 25%, rgba(255,255,255,.82) 45%, rgba(255,254,250,.35) 65%); background-size: 220% 100%; animation: practice-next-shimmer 1.15s linear infinite; pointer-events: none; }
.practice-card.is-loading-next .practice-prompt::after { content: ""; position: absolute; z-index: 5; top: calc(50% - 22.5px); left: calc(50% - 22.5px); box-sizing: border-box; width: 45px; height: 45px; border: 4px solid #e5ddd2; border-top-color: var(--red); border-radius: 50%; animation: generation-spin 1s linear infinite; pointer-events: none; }
.practice-footer .button.is-loading { pointer-events: none; opacity: .65; }
.practice-footer .button.is-disabled { border-color: #d7d2ca; color: #918c84; background: #e7e3dc; cursor: not-allowed; opacity: .8; }
.practice-token { z-index: 2; flex-shrink: 0; display: inline-block; position: relative; padding-inline: 3px; border-radius: 8px; color: var(--ink); white-space: nowrap; transition: color .15s ease, background .15s ease, box-shadow .15s ease; }
.practice-token::after { content: ""; position: absolute; right: 3px; bottom: 8px; left: 3px; height: 2px; border-radius: 2px; background: rgba(51,79,125,.3); transition: background .15s ease; }
.practice-token:hover, .practice-token.revealed { color: var(--red-dark); background: #f7e9e7; }
.practice-token:hover::after, .practice-token.revealed::after { background: var(--red); }
.practice-token.learned { color: #286047; background: #edf6f0; }
.practice-token.learned::after { background: #5d997b; }
.practice-token.learned:hover, .practice-token.learned.revealed { color: #1f513b; background: #dcece3; box-shadow: inset 0 0 0 1px rgba(40,96,71,.16); }
.practice-token.learned:hover::after, .practice-token.learned.revealed::after { background: #286047; }
.practice-token.rated-known { color: #1f513b; background: #dcece3; box-shadow: inset 0 0 0 1px rgba(40,96,71,.2); }
.practice-token.rated-known::after { background: #286047; }
.practice-token.rated-unknown { color: #812b37; background: #f5dfe2; box-shadow: inset 0 0 0 1px rgba(129,43,55,.16); }
.practice-token.rated-unknown::after { background: #b45e6a; }
.practice-token.rated-known:hover, .practice-token.rated-known.revealed { color: #17432f; background: #cfe5d8; }
.practice-token.rated-unknown:hover, .practice-token.rated-unknown.revealed { color: #70222d; background: #edcfd4; }
.practice-token.word-error { color: #8a2c39; background: #f5dfe2; text-decoration: line-through; text-decoration-thickness: 1px; }
.practice-token.word-error::after { background: #b56470; }
.practice-token.is-loading { pointer-events: none; opacity: .55; }
.practice-instruction { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--muted); background: #fbf9f4; font-size: 12px; }
.practice-translation-toggle { flex: 0 0 auto; padding: 4px 0; border: 0; color: var(--blue); background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }
.practice-translation-toggle:hover { color: var(--red); }
.practice-sentence-translation { padding: 15px 18px 17px; border-top: 1px solid var(--line); background: #f4f1ea; }
.practice-sentence-translation[hidden] { display: none; }
.practice-sentence-translation .section-label { margin-bottom: 6px; }
.practice-sentence-translation p { margin: 0; color: var(--ink); font-size: 18px; line-height: 1.5; }
.practice-sentence-translation p[lang="hy"] { font-family: Georgia, "Times New Roman", serif; font-size: 21px; }
.word-reveal { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr); border-top: 1px solid var(--line); background: #fbf9f4; }
.word-reveal-copy { padding: 20px 24px; }
.word-reveal-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.word-reveal-title strong { font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.word-reveal-title span { color: var(--muted); font-size: 14px; }
.word-reveal-category { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px; }
.word-reveal-category-label { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.word-reveal-category .tag { padding: 3px 7px; font-size: 9px; }
.word-reveal dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.word-reveal dl > div { min-width: 0; padding: 10px 12px; border-radius: 10px; background: #f0ede7; }
.word-reveal dt { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.word-reveal dd { margin: 0; overflow-wrap: anywhere; font-size: 16px; }
.word-reveal-notes { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; margin-top: 12px; padding: 11px 13px; border-left: 3px solid #d79b42; border-radius: 4px 10px 10px 4px; color: #625743; background: #fbf3e4; }
.word-reveal-notes-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; background: #b77b25; font-family: Georgia, serif; font-size: 13px; font-weight: 700; }
.word-reveal-notes p { margin: 0; font-size: 12px; line-height: 1.45; }
.word-reveal-notes p + p { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(183,123,37,.18); }
.word-reveal-notes strong { display: block; margin-bottom: 2px; color: #826022; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.word-reveal-notes span { overflow-wrap: anywhere; }
.word-rating { display: flex; flex-direction: column; justify-content: center; padding: 20px 24px; border-left: 1px solid var(--line); background: #f7f3ec; }
.word-rating > p:not(.word-state) { margin-bottom: 13px; color: #4d5359; font-size: 13px; font-weight: 700; }
.word-rating.is-saving .rating-actions { opacity: .72; }
.rating-error { margin: 10px 0 0; color: #8a2c39; font-size: 12px; line-height: 1.4; }
.word-state { width: fit-content; margin-bottom: 10px; padding: 5px 8px; border-radius: 8px; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.word-state.learned { color: #286047; background: #deeee6; }
.word-state.unlearned { color: #8a2c39; background: #f5dfe2; }
.rating-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rating-actions form { margin: 0; }
.rating-actions .button { width: 100%; }
.button-unknown { border-color: #d9bdc1; color: #812b37; background: #fff; }
.button-unknown:hover { border-color: #c999a1; color: #70222d; background: #fbf0f2; }
.button-known { color: #fff; background: var(--green); }
.button-known:hover { color: #fff; background: #285d46; }
.rating-actions .button:disabled { border-color: #d7d2ca; color: #9a958d; background: #e9e5de; cursor: not-allowed; opacity: .78; }
.practice-word-quality { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.practice-word-quality form { margin: 0; }
.practice-word-quality .button { width: 100%; min-height: 36px; padding: 6px 10px; font-size: 11px; }
.pronoun-note { align-self: center; margin: 0; padding: 20px 24px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.55; }
.practice-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 24px; margin-top: 14px; }
.practice-footer-note { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.practice-footer .button span { margin-left: 8px; }
.practice-service-details { grid-column: 1 / -1; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 254, 250, .7); }
.practice-service-details > summary { padding: 12px 16px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; }
.practice-service-details[open] > summary { border-bottom: 1px solid var(--line); }
.practice-service-body { padding: 14px; }
.practice-service-body .sentence-card { box-shadow: none; }
.practice-empty { max-width: 650px; margin: 80px auto 0; padding: 54px; border: 1px solid var(--line); border-radius: 24px; text-align: center; background: var(--paper); box-shadow: var(--shadow); }
.practice-empty .brand-mark { margin: 0 auto 24px; }
.generation-indicator { display: block; width: 45px; height: 45px; margin: 0 auto 24px; border: 4px solid #e5ddd2; border-top-color: var(--red); border-radius: 50%; animation: generation-spin 1s linear infinite; }
.practice-empty > p:not(.eyebrow) { margin: 0 auto 24px; color: var(--muted); line-height: 1.6; }
.practice-session-start { margin-top: 42px; }
.practice-session-form { max-width: 430px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0 auto; text-align: left; }
.practice-session-form label { grid-column: 1 / -1; color: #4c5156; font-size: 12px; font-weight: 700; }
.practice-session-form input { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--ink); background: #fff; font: inherit; }
.practice-topic-picker { grid-column: 1 / -1; display: grid; gap: 7px; margin-bottom: 8px; }
.practice-topic-label { color: #4c5156; font-size: 12px; font-weight: 700; }
.practice-topic-select { position: relative; border: 1px solid #d9d6cf; border-radius: 12px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.practice-topic-select[open] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51,79,125,.12); }
.practice-topic-select > summary { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 13px; cursor: pointer; list-style: none; text-align: left; }
.practice-topic-select > summary::-webkit-details-marker { display: none; }
.practice-topic-select > summary > span { min-width: 0; display: grid; gap: 2px; }
.practice-topic-select > summary strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.practice-topic-select > summary small { color: var(--muted); font-size: 10px; }
.practice-topic-select > summary svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.practice-topic-select[open] > summary svg { transform: rotate(180deg); }
.practice-topic-picker.has-selection .practice-topic-select > summary strong { color: var(--blue); }
.practice-topic-panel { padding: 0 8px 8px; border-top: 1px solid var(--line); }
.practice-topic-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px 8px; }
.practice-topic-panel > header span { color: var(--muted); font-size: 10px; }
.practice-topic-panel > header button { flex: 0 0 auto; padding: 5px 7px; border: 0; color: var(--red); background: transparent; cursor: pointer; font-size: 10px; font-weight: 750; }
.practice-topic-panel > header button:hover { color: var(--red-dark); }
.practice-topic-panel > header button:disabled { color: #aaa49c; opacity: 1; }
.practice-topic-options { max-height: 248px; display: grid; gap: 3px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.practice-topic-options label { position: relative; min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 9px; cursor: pointer; color: #41464b; font-size: 12px; transition: color .12s ease, background .12s ease; }
.practice-topic-options label:hover { background: #f4f1ea; }
.practice-topic-options label:has(input:checked) { color: #263f67; background: #edf2f8; }
.practice-topic-options input { position: absolute; top: 50%; left: 19px; width: 1px; min-height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; transform: translate(-50%, -50%); }
.practice-topic-check { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid #cfcac2; border-radius: 6px; color: transparent; background: #fff; font-size: 12px; font-weight: 800; transition: color .12s ease, border-color .12s ease, background .12s ease; }
.practice-topic-options input:checked + .practice-topic-check { border-color: var(--blue); color: #fff; background: var(--blue); }
.practice-topic-options input:focus-visible + .practice-topic-check { outline: 3px solid rgba(51,79,125,.22); outline-offset: 2px; }
.practice-topic-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-topic-count { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.practice-topic-picker > small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.practice-direction-picker { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; padding: 0; border: 0; }
.practice-direction-picker legend { margin-bottom: 8px; color: #4c5156; font-size: 12px; font-weight: 700; }
.practice-direction-picker label { position: relative; grid-column: auto; cursor: pointer; }
.practice-direction-picker input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.practice-direction-picker span { min-height: 66px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.practice-direction-picker b { color: var(--ink); font-size: 15px; }
.practice-direction-picker small { color: var(--muted); font-size: 10px; font-weight: 500; }
.practice-direction-picker input:checked + span { border-color: rgba(51,79,125,.55); background: #f1f5fa; box-shadow: inset 0 0 0 1px rgba(51,79,125,.18); }
.practice-direction-picker input:focus-visible + span { outline: 3px solid rgba(51,79,125,.22); outline-offset: 2px; }
.practice-session-complete .brand-mark { color: #fff; background: var(--green); }
@keyframes generation-spin { to { transform: rotate(360deg); } }
@keyframes practice-next-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.import-heading p:last-child { max-width: 780px; line-height: 1.6; }
.import-active-card { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; padding: 22px 24px; border: 1px solid #e3c995; border-radius: 18px; background: #fbf3e4; }
.import-active-card .generation-indicator { flex: 0 0 auto; width: 38px; height: 38px; margin: 0; }
.import-active-card h2 { margin-bottom: 6px; font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.import-active-card p:last-child { margin: 0; color: #625743; font-size: 13px; line-height: 1.5; }
.import-form-card { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 8px 28px rgba(43,35,28,.04); }
.import-form-card.is-locked { background: #f1eee8; }
.import-form-card form > label { display: block; margin-bottom: 8px; color: #4c5156; font-size: 12px; font-weight: 700; }
.import-form-card textarea { min-height: 250px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.import-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 14px; }
.import-form-footer p { max-width: 680px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-history { display: grid; gap: 14px; }
.import-history-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.import-history-card > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: #fbf9f4; }
.import-history-card > header > div { display: flex; align-items: center; gap: 10px; }
.import-history-card time { color: var(--muted); font-size: 11px; }
.import-history-body { display: grid; grid-template-columns: minmax(270px, .7fr) minmax(300px, 1fr) auto; align-items: center; gap: 18px; padding: 18px; }
.import-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.import-summary > div { display: grid; padding: 10px 12px; border-radius: 10px; background: #f4f1ea; }
.import-summary strong { font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.import-summary span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.import-history-card details { min-width: 0; }
.import-history-card summary { cursor: pointer; color: var(--blue); font-size: 12px; font-weight: 700; }
.import-history-card pre { max-height: 220px; overflow: auto; margin: 12px 0 0; padding: 12px; border-radius: 10px; color: #4b4f53; background: #f4f1ea; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; line-height: 1.45; }
.import-history-card form { margin: 0; }
.import-error { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 10px; color: #812b37; background: #f5dfe2; font-size: 12px; overflow-wrap: anywhere; }
.import-status-pending, .import-status-processing { color: #794e12; background: #f8ead1; }
.import-status-completed { color: #286047; background: #deeee6; }
.import-status-failed { color: #8a2c39; background: #f5dfe2; }
.import-status-rolled_back { color: #625c54; background: #e7e3dc; }

.auth-page { background: radial-gradient(circle at 15% 15%, rgba(215,155,66,.22), transparent 28%), radial-gradient(circle at 85% 85%, rgba(51,79,125,.17), transparent 32%), #eee9df; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(100%, 430px); padding: 34px; border: 1px solid rgba(255,255,255,.75); border-radius: 26px; background: rgba(255,254,250,.94); box-shadow: 0 28px 80px rgba(57,45,33,.16); }
.auth-brand { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.auth-brand > div { display: grid; }
.auth-brand strong { font-family: Georgia, serif; font-size: 21px; }
.auth-brand p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.brand-mark-large { width: 45px; height: 45px; font-size: 27px; }
.auth-heading { padding: 28px 0 20px; }
.auth-heading h1 { margin-bottom: 8px; font-size: 35px; }
.auth-heading > p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.stack-form { display: grid; gap: 8px; }
.stack-form > div { display: grid; gap: 7px; }
.stack-form label { margin-top: 8px; color: #4c5156; font-size: 12px; font-weight: 700; }
.stack-form ul { margin: 2px 0 0; padding: 0; list-style: none; color: var(--red); font-size: 11px; }
.form-alert, .flash { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; font-size: 13px; }
.form-alert { color: #812b37; background: #f5dfe2; }
.flash-success { color: #285d45; background: #deeee6; }
.flash-error { color: #8a2c39; background: #f5dfe2; }
.auth-switch { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.auth-switch a { font-weight: 750; }
.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; }

@media (max-width: 900px) {
    .dictionary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .header-inner { grid-template-columns: 1fr auto; }
    .main-nav { order: 3; grid-column: 1 / -1; width: 100%; margin-bottom: 12px; justify-content: center; }
    .entry-hero { grid-template-columns: 1fr; }
    .entry-sidebar { align-self: auto; }
    .entry-domains { align-self: auto; }
    .sentence-meta { grid-template-columns: 1fr 1fr; gap: 15px 0; }
    .sentence-meta > div:nth-child(3) { border-left: 0; }
}

@media (max-width: 650px) {
    .shell { width: calc(100% - 24px); }
    .page-content { padding-block: 28px 48px; }
    .header-inner { min-height: auto; padding-top: 10px; gap: 10px 14px; }
    .brand { gap: 9px; }
    .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 21px; }
    .brand strong { font-size: 16px; }
    .brand small { display: none; }
    .main-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; padding: 3px; }
    .main-nav a, .main-nav > span { min-height: 34px; display: grid; place-items: center; padding: 5px 3px; font-size: 11px; }
    .user-menu > span { display: none; }
    .link-button { min-width: 44px; min-height: 44px; padding: 8px; }
    h1 { font-size: clamp(34px, 11vw, 44px); overflow-wrap: anywhere; }
    .page-heading { flex-direction: column; align-items: stretch; gap: 20px; margin-bottom: 24px; }
    .stat-card { min-width: 0; width: 100%; padding: 13px 16px; grid-template-columns: auto 1fr; align-items: baseline; gap: 10px; }
    .stat-card strong { font-size: 25px; }
    .filter-bar { flex-direction: column; padding: 10px; margin-bottom: 20px; }
    .filter-bar select, .compact-filter { width: 100%; }
    .search-field { flex-basis: auto; }
    .filter-bar .button { width: 100%; }
    input, select, .button { min-height: 48px; }
    .dictionary-grid { grid-template-columns: 1fr; }
    .word-card { min-height: 0; padding: 18px; }
    .word-card h2 { margin-top: 20px; overflow-wrap: anywhere; }
    .word-card-top { flex-wrap: wrap; }
    .word-card-top .tag:first-of-type { margin-left: 0; }
    .word-card-top .entry-id + .tag { margin-left: auto; }
    .translation-preview { min-height: 0; }
    .pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; text-align: center; }
    .pagination span { grid-column: 1 / -1; grid-row: 1; }
    .pagination a { min-height: 44px; display: grid; place-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
    .pagination a:only-of-type { grid-column: 1 / -1; }
    .back-link { min-height: 44px; display: inline-flex; align-items: center; margin-bottom: 16px; }
    .entry-page-actions { align-items: stretch; margin-bottom: 16px; }
    .entry-page-actions .back-link { margin-bottom: 0; }
    .entry-page-actions .button { min-height: 44px; padding-inline: 12px; }
    .entry-hero { gap: 22px; padding: 20px; border-radius: 20px; }
    .entry-hero h1 { margin-top: 22px; font-size: clamp(42px, 14vw, 62px); }
    .entry-domains { padding: 16px; }
    .content-section { margin-top: 32px; }
    .section-heading h2 { font-size: 25px; }
    .translation-row { flex-direction: column; gap: 6px; }
    .translation-row span { text-align: left; }
    .edit-panel { padding: 18px 14px; border-radius: 16px; }
    .edit-field-grid, .translation-editor-fields { grid-template-columns: 1fr; gap: 14px; }
    .edit-field-wide, .translation-editor-fields .edit-field-wide:last-child { grid-column: auto; }
    .translation-editor { padding: 14px; }
    .translation-editor > header { align-items: flex-start; }
    .edit-advanced > summary { min-height: 52px; display: flex; align-items: center; padding: 16px; }
    .edit-advanced-content { padding: 0 14px 18px; }
    .edit-form-actions { bottom: 8px; display: grid; grid-template-columns: 1fr 1fr; padding: 8px; }
    .compact-sentence-list a { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 16px; }
    .compact-sentence-list a > strong { overflow-wrap: anywhere; }
    .compact-sentence-list a > span:last-child { grid-column: 2; overflow-wrap: anywhere; }
    .sentence-card { border-radius: 16px; }
    .sentence-card > header { flex-direction: column; align-items: flex-start; padding: 13px 16px; }
    .sentence-card > header > div { flex-wrap: wrap; }
    .sentence-header-actions { width: 100%; justify-content: space-between; }
    .sentence-status-form .button { min-height: 36px; }
    .sentence-card time { flex: 0 0 auto; padding-top: 4px; }
    .sentence-pair { grid-template-columns: 1fr; }
    .sentence-pair p { min-height: 0; padding: 19px 16px; font-size: 18px; overflow-wrap: anywhere; }
    .sentence-pair p:first-child { border-right: 0; border-bottom: 1px solid var(--line); font-size: 22px; }
    .sentence-meta { grid-template-columns: 1fr 1fr; gap: 0; padding: 8px; }
    .sentence-meta > div { padding: 10px 8px; }
    .sentence-meta > div + div { border-left: 0; }
    .sentence-meta > div:nth-child(even) { border-left: 1px solid var(--line); }
    .sentence-meta > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
    .trace-details summary { min-height: 48px; display: flex; align-items: center; padding: 13px 16px; }
    .table-wrap { padding: 0 16px 16px; -webkit-overflow-scrolling: touch; }
    .table-wrap table { min-width: 620px; }
    .trace-label { margin-inline: 16px; }
    .trace-details > .small { margin-inline: 16px; }
    .practice-page .page-content { padding-top: 14px; }
    .practice-session-progress { margin-bottom: 10px; padding: 10px 12px; }
    .practice-session-progress-copy { align-items: flex-start; gap: 8px; }
    .practice-session-progress-copy > span { line-height: 1.35; }
    .practice-session-progress-actions { flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 3px; }
    .practice-prompt { min-height: 145px; justify-content: flex-start; padding: 42px 18px; font-size: clamp(28px, 8.5vw, 38px); line-height: 1.55; text-align: left; }
    .practice-prompt-russian { font-size: clamp(25px, 7.5vw, 34px); }
    .practice-instruction { min-height: 38px; justify-content: flex-start; padding: 9px 12px; font-size: 11px; }
    .practice-card.has-selected-word .practice-instruction { min-height: 38px; justify-content: flex-end; padding: 9px 12px; }
    .practice-card.has-selected-word .practice-instruction > span:first-child { display: none; }
    .practice-sentence-id { right: 10px; bottom: 8px; }
    .practice-copy-button { top: 8px; right: 10px; }
    .word-reveal { grid-template-columns: 1fr; }
    .word-rating, .pronoun-note { border-top: 1px solid var(--line); border-left: 0; }
    .practice-token { padding-inline: 2px; }
    .practice-token::after { right: 2px; bottom: 5px; left: 2px; }
    .word-reveal-copy, .word-rating, .pronoun-note { padding: 18px; }
    .word-reveal-title { flex-wrap: wrap; margin-bottom: 16px; }
    .word-reveal-title strong { font-size: 30px; }
    .word-reveal dl { grid-template-columns: 1fr; }
    .rating-question { display: none; }
    .rating-actions { gap: 8px; }
    .practice-footer { grid-template-columns: 1fr; align-items: stretch; }
    .practice-footer-note { display: none; }
    .practice-footer .button { width: 100%; }
    .practice-empty { margin-top: 30px; padding: 36px 22px; }
    .practice-session-form { grid-template-columns: 1fr; }
    .practice-session-form label { grid-column: auto; }
    .practice-topic-picker { grid-column: auto; }
    .practice-session-form .button { width: 100%; }
    .practice-direction-picker { grid-column: auto; grid-template-columns: 1fr; }
    .import-active-card { align-items: flex-start; padding: 18px; }
    .import-active-card .generation-indicator { width: 32px; height: 32px; }
    .import-form-card { padding: 18px 14px; }
    .import-form-footer { align-items: stretch; flex-direction: column; gap: 14px; }
    .import-form-footer .button { width: 100%; }
    .import-history-body { grid-template-columns: 1fr; gap: 14px; }
    .import-summary { grid-template-columns: repeat(2, 1fr); }
    .import-history-card > header { align-items: flex-start; }
    .import-history-card > header > div { align-items: flex-start; flex-direction: column; }
    .import-history-card form .button { width: 100%; }
    .auth-shell { min-height: 100vh; min-height: 100svh; padding: 16px 12px; }
    .auth-card { padding: 24px; border-radius: 22px; }
    .auth-heading { padding-block: 24px 18px; }
    .auth-heading h1 { font-size: 34px; }
    .stack-form label { font-size: 13px; }
}

@media (max-width: 380px) {
    .shell { width: calc(100% - 16px); }
    .page-content { padding-top: 22px; }
    .header-inner { gap: 8px; }
    .user-menu { gap: 0; }
    .entry-hero { padding: 16px; }
    .sentence-card > header { flex-direction: column; gap: 7px; }
    .sentence-meta { grid-template-columns: 1fr; }
    .sentence-meta > div:nth-child(even) { border-left: 0; }
    .sentence-meta > div:nth-child(n + 2) { border-top: 1px solid var(--line); }
    .auth-card { padding: 20px 18px; }
    .auth-brand { padding-bottom: 20px; }
}
