:root {
  --bg: #0a0d17;
  --panel: rgba(14, 19, 32, 0.9);
  --panel-2: rgba(19, 25, 42, 0.98);
  --text: #f4f7ff;
  --muted: #8c96ab;
  --cyan: #40f7ff;
  --pink: #ff3aa8;
  --lime: #b8ff3b;
  --danger: #ff506d;
  --line: rgba(64, 247, 255, 0.22);
  --shadow: 0 0 0 1px rgba(64, 247, 255, 0.13), 0 28px 70px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; min-height: 100dvh; background: radial-gradient(circle at 8% 8%, rgba(255, 58, 168, 0.16), transparent 27%), radial-gradient(circle at 94% 22%, rgba(64, 247, 255, 0.13), transparent 30%), linear-gradient(180deg, #080a11 0%, #0a0d17 100%); overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.15; background-image: linear-gradient(rgba(64, 247, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(64, 247, 255, 0.055) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, black, transparent 76%); }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, .word-card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.scanlines { position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: 0.09; background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255, 255, 255, 0.08) 4px); mix-blend-mode: overlay; }

.app-shell { width: min(440px, 100%); min-height: 100vh; min-height: 100svh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px max(17px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
@media all and (display-mode: standalone) {
  html, body, .app-shell { min-height: 100vh; }
}
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.topbar-actions { display: flex; gap: 7px; }
.eyebrow { font-size: 9px; letter-spacing: 0.22em; color: var(--cyan); opacity: 0.8; }
.brand {
  margin: 5px 0 0;
  color: var(--text);
  font-family: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 29px;
  font-weight: 900;
  font-stretch: condensed;
  letter-spacing: -0.11em;
  line-height: 1;
  text-shadow: 2px 0 0 rgba(64, 247, 255, 0.16), -1px 0 0 rgba(255, 58, 168, 0.14);
  transform: skewX(-3deg);
  transform-origin: left center;
}
.brand-slashes { display: inline-flex; margin-left: -0.02em; color: var(--pink); letter-spacing: 0; text-shadow: 0 0 10px rgba(255, 58, 168, 0.35); }
.brand-slashes i { display: block; font-style: normal; }
.brand-slashes i + i { margin-left: -0.4em; }
.brand-number { margin-left: 0.04em; color: var(--cyan); font-size: 1em; letter-spacing: inherit; text-shadow: 0 0 11px rgba(64, 247, 255, 0.32); vertical-align: baseline; }
.ghost-btn, .icon-btn, .text-btn, .action { border: 0; background: none; }
.ghost-btn { display: flex; align-items: center; gap: 6px; min-height: 37px; border: 1px solid var(--line); background: rgba(64, 247, 255, 0.055); color: var(--cyan); padding: 8px 10px; border-radius: 10px; font-size: 11px; }
.ghost-btn.icon-only { width: 37px; height: 37px; min-height: 37px; justify-content: center; padding: 0; }
.button-icon { color: var(--pink); font: 700 15px/1 ui-monospace, monospace; }
.settings-icon { color: var(--cyan); font-size: 14px; }
.hidden { display: none !important; }

.system-strip { display: flex; align-items: center; gap: 7px; min-height: 25px; margin-bottom: 11px; padding: 0 9px; border: 1px solid rgba(255, 255, 255, 0.045); border-left-color: rgba(255, 58, 168, 0.55); border-right-color: rgba(64, 247, 255, 0.4); background: rgba(8, 12, 21, 0.58); color: #727e94; font: 600 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.13em; text-transform: uppercase; }
.pulse-dot, .offline-label i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px rgba(184, 255, 59, 0.8); }
.system-line { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(64, 247, 255, 0.35), transparent); }
.app-version { color: var(--pink); white-space: nowrap; }
.signal-bars { display: flex; align-items: flex-end; gap: 2px; height: 10px; }
.signal-bars i { display: block; width: 2px; background: var(--cyan); opacity: 0.72; }
.signal-bars i:nth-child(1) { height: 3px; }
.signal-bars i:nth-child(2) { height: 5px; }
.signal-bars i:nth-child(3) { height: 7px; }
.signal-bars i:nth-child(4) { height: 10px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.05); border-top-color: var(--line); padding: 10px 5px; border-radius: 11px; text-align: center; backdrop-filter: blur(18px); }
.stat span { display: block; font: 700 18px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.stat small { display: block; margin-top: 5px; font-size: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.progress-wrap { margin-bottom: 11px; }
.progress-row + .progress-row { margin-top: 8px; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; letter-spacing: 0.12em; margin-bottom: 6px; }
.progress { height: 4px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.progress div { height: 100%; width: 0; transition: width 0.25s ease; }
.progress-known div { background: linear-gradient(90deg, #75d928, var(--lime)); box-shadow: 0 0 16px rgba(184, 255, 59, 0.58); }
.progress-learning div { background: linear-gradient(90deg, var(--danger), var(--pink)); box-shadow: 0 0 16px rgba(255, 58, 168, 0.5); }
.study-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: -1px 0 10px; padding: 3px; border: 1px solid rgba(64, 247, 255, 0.1); border-radius: 10px; background: rgba(5, 8, 15, 0.58); }
.study-mode-btn { min-height: 31px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #667187; font-size: 9px; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.study-mode-btn.is-active { border-color: rgba(64, 247, 255, 0.22); background: linear-gradient(90deg, rgba(64, 247, 255, 0.1), rgba(255, 58, 168, 0.06)); color: var(--cyan); box-shadow: inset 0 0 18px rgba(64, 247, 255, 0.035); }
.study-mode-btn[data-study-mode="learning"].is-active { border-color: rgba(255, 80, 109, 0.27); color: var(--danger); }
.study-mode-btn small { min-width: 18px; padding: 2px 5px; border-radius: 999px; background: rgba(255, 80, 109, 0.1); color: var(--danger); font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }

.word-card { position: relative; flex: 1 1 430px; min-height: 390px; max-height: 650px; border-radius: 22px; padding: 18px; background: radial-gradient(circle at 50% 45%, rgba(64, 247, 255, 0.055), transparent 38%), linear-gradient(180deg, rgba(22, 29, 49, 0.97), rgba(10, 14, 25, 0.98)); border: 1px solid rgba(64, 247, 255, 0.25); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; user-select: none; touch-action: none; overflow: hidden; will-change: transform, opacity; transition: transform 0.16s ease, opacity 0.16s ease, border-color 0.16s ease; }
.word-card::before { content: ""; position: absolute; width: 190px; height: 190px; right: -104px; top: -106px; border: 1px solid rgba(255, 58, 168, 0.42); transform: rotate(45deg); box-shadow: 0 0 45px rgba(255, 58, 168, 0.08); }
.word-card::after { content: ""; position: absolute; inset: auto 0 0 0; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), var(--pink), transparent); opacity: 0.7; }
.card-grid { position: absolute; inset: 48px 0 74px; opacity: 0.12; background: linear-gradient(90deg, transparent 49.8%, rgba(64, 247, 255, 0.28) 50%, transparent 50.2%), repeating-linear-gradient(0deg, transparent 0 42px, rgba(64, 247, 255, 0.11) 43px); mask-image: linear-gradient(90deg, transparent, black 30%, black 70%, transparent); }
.corner { position: absolute; width: 18px; height: 18px; pointer-events: none; }
.corner-tl { top: 10px; left: 10px; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.corner-br { right: 10px; bottom: 10px; border-right: 1px solid var(--pink); border-bottom: 1px solid var(--pink); }
.card-topline { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em; z-index: 1; }
.card-top-actions { display: flex; align-items: center; gap: 10px; }
.language-code { color: rgba(64, 247, 255, 0.55); font-size: 8px; }
.speech-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(64, 247, 255, 0.24); border-radius: 9px; background: rgba(64, 247, 255, 0.055); color: var(--cyan); transition: color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease; }
.speech-btn svg { width: 17px; height: 17px; fill: currentColor; }
.speech-btn svg path:last-child { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.speech-btn.is-speaking { color: var(--lime); border-color: rgba(184, 255, 59, 0.42); box-shadow: 0 0 14px rgba(184, 255, 59, 0.16); }
.speech-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn { width: 39px; height: 39px; border-radius: 50%; border: 1px solid rgba(64, 247, 255, 0.3); background: rgba(64, 247, 255, 0.06); color: var(--cyan); box-shadow: inset 0 0 24px rgba(64, 247, 255, 0.05); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.word-wrap { text-align: center; z-index: 1; padding: 18px 0 10px; }
.serbian-word { width: 100%; font-size: clamp(42px, 13vw, 65px); font-weight: 800; line-height: 1.04; letter-spacing: -0.045em; white-space: nowrap; word-break: normal; overflow-wrap: normal; text-wrap: nowrap; text-shadow: 0 0 26px rgba(64, 247, 255, 0.15); }
.serbian-word .stress-mark { color: var(--pink); text-shadow: 0 0 16px rgba(255, 58, 168, 0.42); }
.part { margin-top: 10px; text-transform: uppercase; letter-spacing: 0.18em; font-size: 9px; color: var(--pink); }
.stress-hint { min-height: 19px; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 9px; visibility: hidden; opacity: 0; transform: translateY(-3px); transition: opacity 0.18s ease, transform 0.18s ease; }
.stress-hint.is-visible { visibility: visible; opacity: 1; transform: translateY(0); }
.stress-hint > span { color: var(--cyan); font: 650 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.16em; }
.stress-hint strong { color: var(--muted); font: 700 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.03em; }
.stress-hint .stress-mark { color: var(--pink); text-shadow: 0 0 10px rgba(255, 58, 168, 0.32); }
.translation { margin-top: 14px; font-size: clamp(25px, 7.5vw, 31px); font-weight: 650; transition: filter 0.18s ease, opacity 0.18s ease; text-wrap: balance; overflow-wrap: anywhere; }
.translation.blurred { filter: blur(12px); opacity: 0; }
.translation.resetting { filter: blur(14px) !important; opacity: 0 !important; transition: none !important; }
.card-bottom { z-index: 1; }
.comment-preview { width: 100%; min-height: 43px; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 7px; padding: 8px 10px; text-align: left; color: var(--muted); background: rgba(6, 10, 18, 0.5); border: 1px solid rgba(255, 255, 255, 0.06); border-left-color: rgba(255, 58, 168, 0.38); border-radius: 9px; font-size: 11px; }
.comment-preview.has-comment { color: #c9d0df; border-left-color: var(--cyan); }
.comment-preview.is-concealed { border-left-color: rgba(255, 255, 255, 0.08); }
.comment-mark { color: var(--pink); font-size: 18px; line-height: 1; }
.comment-preview.is-concealed #commentText { filter: blur(7px); opacity: 0.48; user-select: none; transition: filter 0.18s ease, opacity 0.18s ease; }
.comment-preview:not(.is-concealed) #commentText { filter: blur(0); opacity: 1; transition: filter 0.18s ease, opacity 0.18s ease; }
.comment-preview.has-comment .comment-mark { color: var(--cyan); }
.comment-arrow { color: var(--cyan); font-size: 18px; }
#commentText { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-signal { display: grid; grid-template-columns: auto repeat(5, 1fr) auto; align-items: end; gap: 4px; margin: 12px 2px 10px; color: #536076; font: 600 7px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.1em; }
.card-signal i { display: block; height: 2px; background: rgba(64, 247, 255, 0.22); }
.card-signal i:nth-of-type(2), .card-signal i:nth-of-type(4) { background: rgba(255, 58, 168, 0.28); }
.hint { text-align: center; color: var(--muted); font-size: 10px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 11px; }
.action { min-height: 49px; border-radius: 13px; padding: 13px 10px; font-weight: 800; letter-spacing: 0.01em; }
.action.danger { color: #fff; background: linear-gradient(180deg, rgba(255, 80, 109, 0.26), rgba(255, 80, 109, 0.12)); border: 1px solid rgba(255, 80, 109, 0.35); }
.action.success { color: #0b1203; background: linear-gradient(180deg, #c6ff62, #9ce72f); box-shadow: 0 10px 34px rgba(184, 255, 59, 0.15); }
.secondary-actions { display: flex; justify-content: space-between; margin-top: 5px; }
.text-btn { color: var(--muted); padding: 7px 2px; font-size: 10px; }
footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: #50596d; font: 7px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: 0.1em; }
.offline-label { display: flex; align-items: center; gap: 5px; }
.offline-label i { width: 4px; height: 4px; }
.word-card.is-dragging { transform: translate3d(var(--drag-x, 0), var(--drag-y, 0), 0) rotate(var(--drag-rotation, 0)); transition: none; cursor: grabbing; }
.word-card.drag-left { border-color: rgba(255, 80, 109, 0.72); box-shadow: var(--shadow), -18px 0 46px rgba(255, 80, 109, 0.1); }
.word-card.drag-right { border-color: rgba(184, 255, 59, 0.72); box-shadow: var(--shadow), 18px 0 46px rgba(184, 255, 59, 0.1); }
.word-card.drag-up { border-color: rgba(64, 247, 255, 0.72); box-shadow: var(--shadow), 0 -18px 46px rgba(64, 247, 255, 0.13); }
.word-card.drag-down { border-color: rgba(255, 58, 168, 0.72); box-shadow: var(--shadow), 0 18px 46px rgba(255, 58, 168, 0.14); }
.word-card.feedback-known { animation: feedback-known 0.28s ease-out both; }
.word-card.feedback-again { animation: feedback-again 0.28s ease-out both; }
.word-card.feedback-skip { animation: feedback-skip 0.28s ease-out both; }
.word-card.swipe-out-left { transform: translate3d(-115%, 0, 0) rotate(-5deg); opacity: 0; border-color: rgba(255, 80, 109, 0.72); }
.word-card.swipe-out-right { transform: translate3d(115%, 0, 0) rotate(5deg); opacity: 0; border-color: rgba(184, 255, 59, 0.72); }
.word-card.swipe-out-up { transform: translate3d(0, -115%, 0); opacity: 0; border-color: rgba(64, 247, 255, 0.72); }
.word-card.card-enter-left { animation: card-enter-left 0.22s ease-out both; }
.word-card.card-enter-right { animation: card-enter-right 0.22s ease-out both; }
.word-card.card-enter-up { animation: card-enter-up 0.22s ease-out both; }
@keyframes card-enter-left { from { transform: translate3d(-30%, 0, 0); opacity: 0; } to { transform: translate3d(0, 0, 0); opacity: 1; } }
@keyframes card-enter-right { from { transform: translate3d(30%, 0, 0); opacity: 0; } to { transform: translate3d(0, 0, 0); opacity: 1; } }
@keyframes card-enter-up { from { transform: translate3d(0, 25%, 0); opacity: 0; } to { transform: translate3d(0, 0, 0); opacity: 1; } }
@keyframes feedback-known {
  0%, 100% { box-shadow: var(--shadow); }
  42% { box-shadow: var(--shadow), 0 0 0 2px rgba(184, 255, 59, 0.72), 0 0 54px 10px rgba(184, 255, 59, 0.28); }
}
@keyframes feedback-again {
  0%, 100% { box-shadow: var(--shadow); }
  42% { box-shadow: var(--shadow), 0 0 0 2px rgba(255, 80, 109, 0.78), 0 0 54px 10px rgba(255, 58, 168, 0.27); }
}
@keyframes feedback-skip {
  0%, 100% { box-shadow: var(--shadow); }
  42% { box-shadow: var(--shadow), 0 0 0 2px rgba(64, 247, 255, 0.78), 0 0 54px 10px rgba(64, 247, 255, 0.27); }
}
.sheet-dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; color: var(--text); background: transparent; }
.sheet-dialog::backdrop { background: rgba(1, 3, 8, 0.76); backdrop-filter: blur(8px); }
.sheet-dialog[open] { display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(440px, 100%); height: min(84dvh, 800px); padding: 10px 18px max(18px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(64, 247, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(64, 247, 255, 0.025) 1px, transparent 1px), linear-gradient(180deg, #151b2c, #090d17); background-size: 24px 24px, 24px 24px, auto; border: 1px solid rgba(64, 247, 255, 0.24); border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -26px 70px rgba(0, 0, 0, 0.54); overflow: hidden; }
#dictionaryDialog[open] { align-items: stretch; }
.dictionary-sheet { height: 100dvh; max-height: none; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; border: 0; border-radius: 0; box-shadow: none; }
.dictionary-sheet .sheet-handle { display: none; }
.dictionary-sheet .sheet-header { flex: 0 0 auto; }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 15px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.sheet-header h2 { margin: 5px 0 0; font-size: 22px; }
.sheet-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.close-btn { width: 37px; height: 37px; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 50%; background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 22px; }
.word-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 13px; border: 1px solid rgba(255, 58, 168, 0.17); border-radius: 14px; background: rgba(8, 11, 20, 0.64); }
.word-form label, .comment-field, .stress-field { display: flex; flex-direction: column; gap: 6px; }
.word-form label span, .comment-field span, .stress-field > span { color: var(--muted); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.word-form input, .search-field input, .comment-field textarea { width: 100%; min-width: 0; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 9px; background: rgba(5, 8, 15, 0.8); color: var(--text); }
.word-form input { height: 40px; padding: 0 10px; font-size: 12px; }
.word-form input::placeholder, .search-field input::placeholder, .comment-field textarea::placeholder { color: #515b6f; }
.wide-field { grid-column: 1 / -1; }
.add-word-btn { grid-column: 1 / -1; min-height: 42px; border: 0; border-radius: 10px; background: linear-gradient(90deg, rgba(64, 247, 255, 0.18), rgba(255, 58, 168, 0.17)); color: var(--cyan); font-weight: 750; }
.dictionary-sheet .word-form { flex: 0 0 auto; grid-template-columns: 1fr; margin: 0 -18px; padding: 13px 18px; border-left: 0; border-right: 0; border-radius: 0; }
.dictionary-sheet .word-form label, .dictionary-sheet .wide-field, .dictionary-sheet .add-word-btn { grid-column: 1; }
.stress-picker { min-height: 42px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 9px; background: rgba(5, 8, 15, 0.8); }
.stress-picker.is-empty { color: #515b6f; font-size: 11px; }
.stress-letter, .stress-letter-static { min-width: 25px; height: 28px; display: grid; place-items: center; padding: 0 4px; border-radius: 6px; font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.stress-letter { border: 1px solid rgba(64, 247, 255, 0.16); background: rgba(64, 247, 255, 0.045); color: var(--text); }
.stress-letter.is-selected { border-color: rgba(255, 58, 168, 0.58); background: rgba(255, 58, 168, 0.13); color: var(--pink); box-shadow: 0 0 12px rgba(255, 58, 168, 0.1); }
.stress-letter-static { min-width: 13px; padding: 0; color: #667086; }
.stress-field small { color: #5d687d; font-size: 9px; line-height: 1.35; }
.dictionary-toolbar { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.search-field { flex: 1; position: relative; }
.search-field span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--cyan); }
.search-field input { height: 39px; padding: 0 11px 0 31px; font-size: 12px; }
.editor-count { flex: 0 0 auto; color: var(--muted); font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.dictionary-list { height: calc(100% - 310px); min-height: 120px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: rgba(64, 247, 255, 0.3) transparent; }
#dictionaryDialog .dictionary-list { flex: 1 1 auto; height: auto; min-height: 0; margin: 0 -18px; padding-bottom: env(safe-area-inset-bottom); }
.dictionary-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 57px; padding: 9px 3px 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.055); }
#dictionaryDialog .dictionary-item { padding-left: 18px; padding-right: 18px; }
.dictionary-status { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; font: 800 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-known { color: var(--lime); border: 1px solid rgba(184, 255, 59, 0.38); background: rgba(184, 255, 59, 0.08); box-shadow: 0 0 14px rgba(184, 255, 59, 0.08); }
.status-learning { color: var(--danger); border: 1px solid rgba(255, 80, 109, 0.38); background: rgba(255, 80, 109, 0.08); box-shadow: 0 0 14px rgba(255, 58, 168, 0.08); }
.status-unseen { color: var(--cyan); border: 1px solid rgba(64, 247, 255, 0.2); background: rgba(64, 247, 255, 0.04); opacity: 0.58; }
.dictionary-word { font-weight: 750; font-size: 14px; }
.dictionary-word span { margin-left: 6px; color: var(--pink); font-size: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
.dictionary-translation { margin-top: 3px; color: var(--muted); font-size: 11px; }
.dictionary-item-actions { display: flex; gap: 6px; }
.edit-word-btn, .delete-word-btn { width: 37px; height: 37px; border-radius: 9px; }
.edit-word-btn { border: 1px solid rgba(64, 247, 255, 0.2); background: rgba(64, 247, 255, 0.06); color: var(--cyan); }
.delete-word-btn { border: 1px solid rgba(255, 80, 109, 0.18); background: rgba(255, 80, 109, 0.06); color: var(--danger); }
.empty-list { padding: 35px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.compact-sheet { height: auto; min-height: 380px; }
.comment-field textarea { min-height: 120px; padding: 12px; resize: none; line-height: 1.5; }
.comment-form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.delete-comment-btn, .save-comment-btn { min-height: 45px; padding: 0 18px; border-radius: 11px; font-weight: 750; }
.delete-comment-btn { border: 1px solid rgba(255, 80, 109, 0.22); background: rgba(255, 80, 109, 0.07); color: var(--danger); }
.delete-comment-btn:disabled { visibility: hidden; }
.save-comment-btn { flex: 1; border: 0; background: linear-gradient(180deg, #c6ff62, #9ce72f); color: #0b1203; }
#cardEditorDialog[open] { align-items: center; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
#cardEditorDialog::backdrop { background: rgba(3, 6, 12, 0.38); backdrop-filter: blur(12px) saturate(0.78); }
.edit-card-sheet { width: min(404px, 100%); height: auto; min-height: min(570px, 84dvh); max-height: calc(100dvh - 28px); overflow-y: auto; border: 1px solid rgba(64, 247, 255, 0.28); border-radius: 22px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62), 0 0 36px rgba(64, 247, 255, 0.07); animation: modal-pop 0.18s ease-out both; }
.edit-card-fields { display: grid; gap: 12px; }
.edit-card-fields label { display: flex; flex-direction: column; gap: 6px; }
.edit-card-fields label span { color: var(--muted); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; }
.edit-card-fields input, .edit-card-fields textarea { width: 100%; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 9px; background: rgba(5, 8, 15, 0.8); color: var(--text); }
.edit-card-fields input { height: 43px; padding: 0 11px; }
.edit-card-fields textarea { min-height: 105px; padding: 11px; resize: none; line-height: 1.5; }
.save-card-btn { width: 100%; min-height: 47px; margin-top: 15px; border: 0; border-radius: 11px; background: linear-gradient(180deg, #c6ff62, #9ce72f); color: #0b1203; font-weight: 800; }
.settings-dialog[open] { align-items: center; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
.settings-dialog::backdrop { background: rgba(3, 6, 12, 0.48); backdrop-filter: blur(12px) saturate(0.75); }
.settings-sheet { width: min(420px, 100%); height: auto; max-height: calc(100dvh - 28px); padding: 12px 18px max(18px, env(safe-area-inset-bottom)); border: 1px solid rgba(64, 247, 255, 0.28); border-radius: 22px; overflow-y: auto; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62), 0 0 36px rgba(64, 247, 255, 0.07); animation: modal-pop 0.18s ease-out both; }
.catalog-panel { padding: 12px; border: 1px solid rgba(64, 247, 255, 0.13); border-radius: 13px; background: rgba(5, 8, 15, 0.55); }
.catalog-url-field { display: flex; flex-direction: column; gap: 7px; }
.catalog-url-field > span { color: var(--muted); font-size: 9px; letter-spacing: 0.09em; text-transform: uppercase; }
.catalog-url-field > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.catalog-url-field input { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 9px; background: rgba(5, 8, 15, 0.82); color: var(--text); font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.catalog-url-field input:disabled { color: #647086; background: rgba(255, 255, 255, 0.025); cursor: not-allowed; opacity: 0.72; }
.catalog-url-field button { padding: 0 11px; border: 1px solid rgba(64, 247, 255, 0.22); border-radius: 9px; background: rgba(64, 247, 255, 0.07); color: var(--cyan); font-size: 10px; font-weight: 750; }
.catalog-url-field button:disabled { opacity: 0.45; cursor: wait; }
.catalog-status { min-height: 15px; margin-top: 7px; color: #667187; font-size: 9px; line-height: 1.4; }
.catalog-status.is-error { color: var(--danger); }
.catalog-status.is-success { color: var(--lime); }
.language-list { display: grid; gap: 8px; margin-top: 12px; }
.language-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 62px; padding: 10px 11px; border: 1px solid rgba(255, 255, 255, 0.07); border-left-color: rgba(64, 247, 255, 0.32); border-radius: 12px; background: rgba(10, 14, 24, 0.7); }
.language-item.is-active { border-color: rgba(184, 255, 59, 0.28); background: linear-gradient(90deg, rgba(184, 255, 59, 0.055), rgba(64, 247, 255, 0.035)); }
.language-copy { min-width: 0; }
.language-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.language-copy span { display: block; margin-top: 4px; color: var(--muted); font: 600 8px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.language-item button { min-width: 78px; min-height: 36px; padding: 0 10px; border: 1px solid rgba(64, 247, 255, 0.2); border-radius: 9px; background: rgba(64, 247, 255, 0.06); color: var(--cyan); font-size: 10px; font-weight: 750; }
.language-item.is-active button { border-color: rgba(184, 255, 59, 0.26); color: var(--lime); }
.language-item button:disabled { opacity: 0.48; cursor: wait; }
.sound-setting { min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(64, 247, 255, 0.12); border-radius: 13px; background: rgba(8, 12, 21, 0.64); cursor: pointer; }
.sound-setting > div { min-width: 0; }
.sound-setting strong { display: block; font-size: 12px; }
.sound-setting span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.sound-setting input { position: absolute; opacity: 0; pointer-events: none; }
.sound-setting i { position: relative; width: 42px; height: 24px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px; background: rgba(255, 255, 255, 0.055); transition: background 0.18s ease, border-color 0.18s ease; }
.sound-setting i::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: #667187; transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease; }
.sound-setting input:checked + i { border-color: rgba(64, 247, 255, 0.35); background: rgba(64, 247, 255, 0.12); }
.sound-setting input:checked + i::after { transform: translateX(18px); background: var(--cyan); box-shadow: 0 0 12px rgba(64, 247, 255, 0.48); }
.sound-setting input:focus-visible + i { outline: 2px solid var(--cyan); outline-offset: 2px; }
.reset-dialog[open] { align-items: center; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
.reset-dialog::backdrop { background: rgba(3, 6, 12, 0.48); backdrop-filter: blur(12px) saturate(0.75); }
.reset-sheet { width: min(404px, 100%); height: auto; padding: 12px 18px 18px; border: 1px solid rgba(255, 80, 109, 0.28); border-radius: 22px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.62), 0 0 36px rgba(255, 58, 168, 0.07); animation: modal-pop 0.18s ease-out both; }
.reset-description { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.reset-actions { display: grid; grid-template-columns: 0.82fr 1.18fr; gap: 9px; margin-top: 18px; }
.reset-cancel-btn, .reset-confirm-btn { min-height: 47px; border-radius: 11px; font-weight: 800; }
.reset-cancel-btn { border: 1px solid rgba(255, 255, 255, 0.09); background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.reset-confirm-btn { border: 1px solid rgba(255, 80, 109, 0.32); background: linear-gradient(180deg, rgba(255, 80, 109, 0.28), rgba(255, 58, 168, 0.13)); color: #fff; }
@keyframes modal-pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 560px) { .app-shell { border-left: 1px solid rgba(64, 247, 255, 0.06); border-right: 1px solid rgba(64, 247, 255, 0.06); } }
@media (max-width: 370px), (max-height: 760px) {
  .system-strip { display: none; }
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .topbar { margin-bottom: 9px; }
  .stats { margin-bottom: 10px; }
  .stat { padding: 8px 4px; }
  .word-card { min-height: 330px; padding: 15px; }
  .serbian-word { font-size: clamp(36px, 12vw, 52px); }
  .card-signal { margin: 8px 2px; }
  .action { min-height: 45px; }
  footer { display: none; }
}
@media (max-width: 340px) {
  .word-form { grid-template-columns: 1fr; }
  .word-form label, .wide-field, .add-word-btn { grid-column: 1; }
  .dictionary-list { height: calc(100% - 405px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
