:root {
  --ink: #20211d;
  --muted: #6d6a61;
  --paper: #f7f3e9;
  --paper-deep: #eee6d5;
  --white: #fffdf8;
  --wine: #7e3428;
  --wine-dark: #5b251e;
  --gold: #b7863f;
  --green: #277052;
  --green-pale: #e5f2e9;
  --red: #a83b32;
  --red-pale: #fae8e4;
  --blue: #345f73;
  --line: #d9cfbc;
  --shadow: 0 18px 50px rgba(55, 42, 23, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(183, 134, 63, .55);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.mode-view { min-height: 100vh; padding: 40px 20px; display: grid; place-items: center; background: linear-gradient(rgba(28,20,14,.78), rgba(28,20,14,.78)), url("img/kasten5.jpg") center / cover; }
.mode-card { width: min(920px, 100%); padding: clamp(30px, 6vw, 62px); background: var(--white); box-shadow: var(--shadow); }
.mode-card h1 { max-width: 700px; margin: 8px 0 14px; font: 400 clamp(2rem, 4vw, 3.35rem)/1.08 "Marcellus", Georgia, serif; }
.mode-card h1 em { color: var(--wine); font-style: normal; }
.mode-intro { max-width: 700px; color: var(--muted); line-height: 1.6; }
.mode-options { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.mode-option { min-height: 220px; padding: 26px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); display: grid; align-content: start; gap: 10px; text-align: left; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.mode-option:hover { border-color: var(--gold); box-shadow: 0 10px 24px rgba(80,50,32,.12); transform: translateY(-2px); }
.mode-option strong { color: var(--wine); font: 400 1.45rem "Marcellus", serif; }
.mode-option small { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.mode-symbol { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--wine); color: white; font-size: 1.4rem; }

.hero {
  min-height: 540px;
  color: white;
  position: relative;
  background:
    linear-gradient(90deg, rgba(27, 20, 14, .9) 0%, rgba(27, 20, 14, .68) 39%, rgba(27, 20, 14, .12) 76%),
    url("img/kasten5.jpg") 61% 47% / max(100%, 920px) auto no-repeat;
  background-color: #4b3928;
}
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 5px; background: linear-gradient(90deg, var(--wine), var(--gold), var(--wine)); }
.topbar { width: min(1200px, calc(100% - 48px)); margin: auto; padding: 24px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.24); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.storage-mode-button { min-height: 38px; padding: 8px 13px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(0,0,0,.2); color: white; font-size: .78rem; backdrop-filter: blur(7px); }
.storage-mode-button:hover { border-color: rgba(255,255,255,.75); }
.brand { padding: 0; border: 0; color: white; background: transparent; display: flex; align-items: center; gap: 12px; font: 1.08rem "Marcellus", Georgia, serif; letter-spacing: .09em; text-transform: uppercase; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.68); transform: rotate(45deg); }
.brand-mark span { transform: rotate(-45deg); }
.language-pill { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.2); backdrop-filter: blur(7px); border-radius: 999px; font-size: .84rem; }
.language-pill > span { color: #e9be69; }
.hero-content { width: min(1200px, calc(100% - 48px)); margin: auto; padding: 120px 0 72px; }
.hero-content h1 { max-width: 700px; margin: 12px 0 18px; font: 400 clamp(2.7rem, 6vw, 5.1rem)/.98 "Marcellus", Georgia, serif; text-wrap: balance; }
.hero-content h1 em { color: #e6c27c; font-style: normal; }
.hero-content > p:not(.eyebrow) { max-width: 570px; color: rgba(255,255,255,.87); font-size: 1.06rem; line-height: 1.65; }
.eyebrow, .panel-kicker, .breadcrumb, .box-label { color: var(--gold); font-weight: 700; font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; }

.app-shell { width: min(1260px, calc(100% - 48px)); min-height: 600px; margin: -34px auto 70px; display: grid; grid-template-columns: 245px minmax(0, 1fr); position: relative; z-index: 2; background: var(--white); box-shadow: var(--shadow); }
.language-panel { padding: 32px 22px; background: #eee7d9; border-right: 1px solid var(--line); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 5px 0 24px; font: 400 1.5rem "Marcellus", Georgia, serif; }
.panel-kicker { margin: 0; color: var(--wine); }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--wine); border-radius: 50%; background: transparent; color: var(--wine); font-size: 1.3rem; }
.language-list { display: grid; gap: 7px; }
.language-entry { min-width: 0; display: grid; grid-template-columns: 16px minmax(0, 1fr) 22px; align-items: center; gap: 3px; }
.language-entry.dragging { opacity: .48; }
.language-list.saving-order { opacity: .7; pointer-events: none; }
.language-drag-handle { color: #9a9284; cursor: grab; font-size: .9rem; letter-spacing: -3px; user-select: none; }
.language-drag-handle:active { cursor: grabbing; }
.language-option { width: 100%; min-width: 0; padding: 12px; border: 0; border-left: 3px solid transparent; background: transparent; color: var(--muted); display: flex; align-items: center; gap: 10px; text-align: left; }
.language-option.active { border-left-color: var(--wine); background: var(--white); color: var(--ink); box-shadow: 0 5px 20px rgba(55,42,23,.07); }
.language-option .language-initial { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: "Marcellus", serif; text-transform: uppercase; }
.language-option strong, .language-option small { display: block; }
.language-option small { margin-top: 2px; font-size: .7rem; }
.language-order-controls { display: grid; gap: 2px; }
.language-order-button { width: 22px; height: 20px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .72rem; line-height: 1; }
.language-order-button:hover { color: var(--wine); }
.sidebar-search { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.sidebar-search-title { margin: 0 0 2px; }
.sidebar-search label { display: grid; gap: 5px; color: var(--muted); font-size: .7rem; font-weight: 700; }
.sidebar-search input, .sidebar-search select { width: 100%; min-width: 0; }
.language-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.workspace { min-width: 0; padding: 38px 46px 42px; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.workspace-heading h2 { margin: 7px 0 6px; font: 400 clamp(1.8rem, 3vw, 2.5rem) "Marcellus", Georgia, serif; }
.workspace-heading p:last-child { margin-bottom: 0; color: var(--muted); }
.heading-actions, .inline-actions, .dialog-actions, .row-actions, .pagination, .direction-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }

.primary-button, .secondary-button, .danger-button, .action-button { min-height: 42px; padding: 10px 16px; border: 1px solid transparent; font-weight: 700; }
.primary-button { background: var(--wine); color: white; }
.primary-button:hover { background: var(--wine-dark); }
.secondary-button { border-color: var(--line); background: var(--white); color: var(--ink); }
.secondary-button:hover { border-color: var(--gold); }
.danger-button { background: var(--red); color: white; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--wine); text-decoration: underline; text-underline-offset: 4px; }
.danger-text { color: var(--red); }
.language-actions .text-button { color: var(--muted); font-size: .7rem; font-weight: 700; text-decoration: none; }
.language-actions .text-button:hover { color: var(--wine); }
.language-actions .danger-text, .language-actions .danger-text:hover { color: var(--red); }

.box-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.box-card { min-height: 226px; padding: 23px; border: 1px solid var(--line); position: relative; overflow: hidden; background: linear-gradient(145deg, #fffdf8 0%, #f4ecdc 100%); }
.box-card.clickable { cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.box-card.clickable:hover { border-color: var(--gold); box-shadow: 0 10px 24px rgba(80, 50, 32, .12); transform: translateY(-2px); }
.box-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--box-color, var(--wine)); }
.box-number { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: var(--box-color, var(--wine)); color: white; font: 1.55rem "Marcellus", serif; }
.box-card h3 { margin: 16px 0 4px; font: 400 1.45rem "Marcellus", serif; }
.box-count { margin: 0 0 5px; color: var(--wine); font-weight: 700; }
.box-meta { min-height: 34px; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.quiz-progress { margin-top: 26px; padding: 15px 17px; border: 1px solid var(--line); background: var(--paper); }
.quiz-progress-copy { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .78rem; }
.quiz-progress-copy strong { color: var(--ink); }
.quiz-progress-track { height: 8px; overflow: hidden; background: #ddd3c0; }
.quiz-progress-track span { height: 100%; display: block; background: var(--green); transition: width .2s ease; }
.vocabulary-quiz { margin-top: 18px; padding: 22px; border: 1px solid var(--line); background: var(--paper-deep); }
.quiz-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.quiz-column { min-width: 0; display: grid; align-content: start; gap: 9px; }
.quiz-column h3 { margin: 0 0 4px; color: var(--wine); font: 400 1.08rem "Marcellus", Georgia, serif; text-align: center; }
.quiz-card { width: 100%; min-height: 52px; padding: 10px 12px; border: 1px solid #cbbda5; color: var(--ink); background: var(--white); box-shadow: 0 2px 5px rgba(55,42,23,.07); font-weight: 600; line-height: 1.25; transition: color .18s, background .18s, border-color .18s, transform .18s; }
.quiz-card:hover:not(:disabled), .quiz-card:focus-visible:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.quiz-card.selected { color: #6b4b00; border-color: var(--gold); background: #fff2c9; box-shadow: 0 0 0 2px rgba(183,134,63,.2); }
.quiz-card.wrong { color: var(--red); border-color: #c97d74; background: var(--red-pale); animation: quiz-shake .27s ease; }
.quiz-card.matched { cursor: default; color: var(--green); border-color: #72a78c; background: var(--green-pale); box-shadow: none; }
.quiz-completion { margin-top: 20px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-left: 3px solid var(--green); background: var(--green-pale); color: var(--green); }
.quiz-completion button { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--green); color: white; background: var(--green); font-weight: 700; }
@keyframes quiz-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.local-storage-panel { margin-top: 24px; padding: 18px; border: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.local-storage-panel.needs-backup { border-color: #d6b36b; background: #fff8e7; }
.local-storage-panel .panel-kicker { margin-bottom: 5px; }
.local-storage-panel strong, .local-storage-panel small { display: block; }
.local-storage-panel small { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.local-storage-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; }
.empty-state { margin-top: 28px; padding: 34px; border: 1px dashed var(--line); text-align: center; background: var(--paper); }
.empty-state h3 { margin: 12px 0 7px; font: 400 1.5rem "Marcellus", serif; }
.empty-state p { color: var(--muted); }
.empty-symbol { color: var(--gold); font-size: 2rem; }

.toolbar { margin: 28px 0 18px; padding: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; background: var(--paper-deep); border: 1px solid var(--line); }
.toolbar label { display: flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 700; }
select, input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); }
select, input { min-height: 43px; padding: 9px 11px; }
textarea { padding: 12px; resize: vertical; line-height: 1.5; }
.toolbar select { width: auto; min-width: 260px; }
.toolbar input[type="search"] { width: min(280px, 32vw); min-width: 190px; }
.learning-toolbar { width: 100%; margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr) max-content max-content max-content; justify-content: stretch; }
.learning-toolbar > label:first-child { min-width: 0; }
.learning-toolbar > label:first-child input[type="search"] { width: 100%; min-width: 0; }
.learning-toolbar select { width: 130px; min-width: 130px; }
.solution-toggle.active { border-color: var(--gold); background: #fff8e7; color: var(--wine); box-shadow: inset 0 0 0 1px var(--gold); }
.reset-learning-button { margin-left: 0; }
.global-search-output { margin-top: 28px; }
.global-results-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.global-results-header label { display: flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 700; }
.global-results-header select { width: auto; min-width: 260px; }
.global-search-results { margin-top: 10px; }
.global-search-row { padding-top: 42px; }
.global-result-meta { margin: 0 0 9px; color: var(--wine); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.global-result-count { margin: 0; color: var(--muted); font-size: .8rem; font-weight: 700; }
.card-list { display: grid; gap: 12px; }
.vocabulary-row { padding: 18px 88px 18px 20px; border: 1px solid var(--line); position: relative; background: white; transition: opacity .2s ease, background .2s ease; }
.vocabulary-row.many-tools { padding-right: 215px; }
.vocabulary-row.reviewed { background: #f4f0e7; }
.vocabulary-row.pending-delete, .learning-row.pending-delete { padding: 12px 20px; background: var(--red-pale); }
.deletion-placeholder { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.deletion-placeholder span { color: var(--muted); font-size: .82rem; }
.vocabulary-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: baseline; gap: 16px; }
.vocabulary-grid.two-columns, .example-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.word-main { font: 400 1.25rem "Marcellus", serif; }
.example-grid { margin-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; color: var(--muted); font-size: .86rem; font-style: italic; }
.statistics { margin-top: 12px; display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .72rem; }
.pagination { justify-content: center; margin-top: 22px; }
.pagination span { color: var(--muted); font-size: .82rem; }

.direction-switch { margin: 24px 0 16px; }
.direction-switch span { margin-right: 5px; color: var(--muted); font-size: .78rem; }
.direction-switch button { padding: 8px 12px; border: 1px solid var(--line); background: white; }
.direction-switch button.active { border-color: var(--wine); background: var(--wine); color: white; }
.direction-switch button.active:disabled { opacity: 1; cursor: default; }
.dashboard-direction-switch { margin-bottom: 0; }
.fach-direction-switch + .toolbar { margin-top: 0; }
.learning-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.learning-title-row h2 { margin-right: 2px; }
.learning-box-navigation { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.learning-box-navigation button { width: 35px; height: 35px; padding: 0; border: 1px solid var(--line); background: white; color: var(--wine); font-weight: 700; }
.learning-box-navigation button:hover:not(:disabled) { border-color: var(--gold); background: var(--paper); }
.learning-box-navigation button.active,
.learning-box-navigation button.active:disabled { border-color: var(--wine); background: var(--wine); color: white; opacity: 1; cursor: default; }
.learning-row { padding: 20px 88px 20px 20px; border: 1px solid var(--line); position: relative; background: white; }
.learning-prompt { display: grid; grid-template-columns: minmax(140px, .9fr) minmax(220px, 1.2fr); align-items: start; gap: 18px; }
.learning-row .box-label { display: block; }
.learning-word { font: 400 1.35rem "Marcellus", serif; }
.learning-example { margin: 0; color: var(--muted); font-size: .86rem; font-style: italic; }
.prompt-word-actions { margin: 7px 0 5px; display: flex; align-items: center; gap: 6px; }
.word-reveal-button { margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; text-align: left; }
.word-reveal-button:hover .learning-word { color: var(--wine); }
.eye-icon { color: var(--gold); font-size: 1rem; filter: grayscale(1); }
.copy-prompt-button { width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--gold); display: grid; place-items: center; font-size: 1.05rem; }
.copy-prompt-button:hover:not(:disabled) { color: var(--wine); }
.copy-prompt-button:disabled { opacity: .3; cursor: default; }
.answer-wrap { display: grid; gap: 8px; }
.answer-input.correct { border-color: var(--green); background: var(--green-pale); color: var(--green); }
.answer-input.incorrect { border-color: var(--red); background: var(--red-pale); color: var(--red); }
.row-actions { margin-top: 14px; }
.action-button { min-width: 45px; padding-inline: 13px; border-color: var(--line); background: white; color: var(--ink); }
.action-button.positive { color: var(--green); border-color: rgba(39,112,82,.42); }
.action-button.negative { color: var(--red); border-color: rgba(168,59,50,.4); }
.action-button.training-action { color: var(--wine); border-color: rgba(113,56,43,.42); }
.action-button.skip-five { color: var(--blue); }
.action-button.discard-action { color: #756b62; border-color: rgba(117,107,98,.48); }
.action-button.selected { background: var(--paper-deep); box-shadow: inset 0 0 0 2px var(--gold); }
.action-button.positive.selected { background: var(--green-pale); box-shadow: inset 0 0 0 2px var(--green); }
.action-button.negative.selected { background: var(--red-pale); box-shadow: inset 0 0 0 2px var(--red); }
.solution { margin-top: 13px; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--paper); font-size: .86rem; }
.solution.correct { border-left-color: var(--green); background: var(--green-pale); }
.solution.incorrect { border-left-color: var(--red); background: var(--red-pale); }
.solution p { margin: 5px 0 0; color: var(--muted); font-style: italic; }
.vocabulary-tools { position: absolute; top: 13px; right: 13px; display: flex; gap: 5px; }
.icon-action { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--wine); display: grid; place-items: center; font-size: 1rem; }
.icon-action:hover { border-color: var(--gold); }
.icon-action.final-box-icon { color: var(--blue); font-size: .78rem; font-weight: 700; }
.icon-action.training-icon { color: var(--wine); font-size: .78rem; font-weight: 700; }
.icon-action.new-box-icon { color: var(--gold); font-size: .78rem; font-weight: 700; }
.icon-action.discard-icon { color: #756b62; font-size: .88rem; }
.icon-action.danger-icon { color: var(--red); font-size: .86rem; }
.round-footer { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.round-progress { margin: 0; color: var(--muted); font-size: .82rem; }
.round-summary { margin-top: 20px; padding: 20px; border: 1px solid var(--gold); background: #fff8e7; }
.round-summary h3 { margin: 0 0 7px; font: 400 1.3rem "Marcellus", serif; }
.loading-state { padding: 70px 20px; text-align: center; color: var(--muted); }

.app-dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; color: var(--ink); background: var(--white); box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(31,24,18,.72); backdrop-filter: blur(2px); }
.app-dialog form { padding: 30px; }
.app-dialog h2 { margin: 6px 0 10px; font: 400 1.9rem "Marcellus", serif; }
.app-dialog label { display: block; margin: 16px 0 6px; font-size: .8rem; font-weight: 700; }
.app-dialog label small { color: var(--muted); font-weight: 400; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.dialog-copy { color: var(--muted); font-size: .83rem; line-height: 1.5; }
.welcome-notes { margin-top: 20px; padding: 14px 18px; border-left: 3px solid var(--gold); background: var(--paper); }
.welcome-notes p { margin: 7px 0; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.help-steps { padding-left: 22px; color: var(--muted); line-height: 1.6; }
.help-steps li { margin-bottom: 10px; }
.help-steps strong { color: var(--ink); }
.app-dialog code { padding: 2px 5px; background: var(--paper-deep); }
.dialog-actions { margin-top: 24px; justify-content: flex-end; }
.inline-actions { margin-top: 10px; }
.wide-dialog { width: min(920px, calc(100% - 28px)); }
.import-preview { max-height: 330px; overflow: auto; margin-top: 20px; border: 1px solid var(--line); }
.import-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.import-table th, .import-table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.import-table th { position: sticky; top: 0; background: var(--paper-deep); z-index: 1; }
.import-row-warning { background: #fff4da; }
.import-row-error { background: var(--red-pale); }
.form-message { min-height: 20px; color: var(--red); font-size: .82rem; }

.auth-view { min-height: 100vh; padding: 40px 20px; display: grid; place-items: center; background: var(--paper); }
.auth-card { width: min(980px, 100%); min-height: 570px; display: grid; grid-template-columns: 1.08fr .92fr; background: var(--white); box-shadow: var(--shadow); }
.auth-picture { min-height: 420px; background: linear-gradient(rgba(35,24,15,.15), rgba(35,24,15,.15)), url("img/kasten1.jpg") center / cover; }
.auth-copy { padding: clamp(34px, 6vw, 70px); align-self: center; }
.auth-copy h1 { margin: 8px 0 16px; font: 400 clamp(2rem, 4vw, 3.2rem)/1.08 "Marcellus", serif; }
.auth-copy h1 em { color: var(--wine); font-style: normal; }
.auth-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.auth-copy label { display: block; margin: 15px 0 6px; font-size: .8rem; font-weight: 700; }
.auth-copy .primary-button { width: 100%; margin-top: 18px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: min(430px, calc(100% - 40px)); padding: 14px 18px; background: #27241f; color: white; box-shadow: var(--shadow); }

.quote-section { padding: 42px 24px 70px; text-align: center; }
.quote-section > span { display: block; height: 30px; color: var(--gold); font: 4rem Georgia, serif; }
.quote-section blockquote { margin: 10px 0; color: var(--wine); font: 400 clamp(1.6rem, 4vw, 2.6rem) "Marcellus", serif; }
.quote-section p { color: var(--muted); font-size: .85rem; }
.quote-section[hidden] { display: none; }

footer { padding: 18px max(24px, calc((100% - 1200px) / 2)); display: flex; justify-content: space-between; background: #27241f; color: #d4cbb9; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 940px) {
  .app-shell { grid-template-columns: 1fr; }
  .language-panel { padding: 18px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel-heading h2, .panel-heading .panel-kicker { display: none; }
  .panel-heading { display: contents; }
  .language-panel { display: flex; gap: 7px; overflow-x: auto; }
  .language-list { display: flex; gap: 6px; }
  .language-entry { min-width: 205px; flex: none; }
  .language-option { min-width: 0; }
  .language-panel .icon-button { flex: none; order: 2; }
  .language-actions { flex: none; align-items: center; margin: 0; padding: 0 0 0 5px; border: 0; }
  .language-panel { flex-wrap: wrap; overflow: visible; }
  .language-list { flex: 1 1 auto; overflow-x: auto; }
  .sidebar-search { width: 100%; flex: 1 0 100%; order: 4; margin-top: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar-search-title { grid-column: 1 / -1; }
  .box-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .mode-view { padding: 18px 12px; }
  .mode-card { padding: 28px 20px; }
  .mode-options { grid-template-columns: 1fr; }
  .mode-option { min-height: 0; }
  .hero { min-height: 540px; background-position: 60% center; }
  .topbar, .hero-content, .app-shell { width: calc(100% - 28px); }
  .topbar { padding: 18px 0; }
  .brand > span:last-child { display: none; }
  .language-pill { max-width: 100%; overflow: hidden; white-space: nowrap; }
  .topbar-actions { max-width: 76%; flex-wrap: wrap; }
  .storage-mode-button { margin-left: auto; padding: 7px 10px; font-size: .7rem; }
  .hero-content { padding: 145px 0 70px; }
  .app-shell { margin-top: -22px; }
  .workspace { padding: 28px 18px 34px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions button { flex: 1; }
  .box-grid { grid-template-columns: 1fr; }
  .quiz-progress-copy { align-items: flex-start; flex-direction: column; gap: 4px; }
  .vocabulary-quiz { padding: 12px; }
  .quiz-columns { gap: 8px; }
  .quiz-column { gap: 7px; }
  .quiz-card { min-height: 50px; padding: 8px 6px; font-size: .8rem; }
  .quiz-completion { align-items: stretch; flex-direction: column; }
  .local-storage-panel { align-items: stretch; flex-direction: column; }
  .local-storage-actions { justify-content: flex-start; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .learning-toolbar { grid-template-columns: 1fr; }
  .toolbar label { align-items: stretch; flex-direction: column; }
  .toolbar select { width: 100%; min-width: 0; }
  .toolbar input[type="search"] { width: 100%; min-width: 0; }
  .reset-learning-button { margin-left: 0; }
  .sidebar-search { grid-template-columns: 1fr; }
  .sidebar-search-title { grid-column: auto; }
  .global-results-header { align-items: stretch; flex-direction: column; }
  .global-results-header label { align-items: stretch; flex-direction: column; }
  .global-results-header select { width: 100%; min-width: 0; }
  .vocabulary-grid, .example-grid { grid-template-columns: 1fr; gap: 4px; }
  .example-grid span:empty { display: none; }
  .learning-prompt { grid-template-columns: 1fr; }
  .vocabulary-row, .learning-row { padding: 64px 16px 18px; }
  .vocabulary-row.many-tools { padding: 64px 16px 18px; }
  .edit-grid { grid-template-columns: 1fr; }
  .auth-view { padding: 0; }
  .auth-card { min-height: 100vh; grid-template-columns: 1fr; }
  .auth-picture { min-height: 230px; }
  .auth-copy { padding: 30px 24px 42px; }
  .app-dialog form { padding: 23px 18px; }
  .import-table th:nth-child(4), .import-table td:nth-child(4) { display: none; }
  footer { align-items: center; flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
