:root {
  color-scheme: light;
  --navy: #12243b;
  --navy-soft: #213752;
  --paper: #f4f1ea;
  --paper-deep: #ebe6dc;
  --champagne: #eee4c8;
  --gold: #ae8e3f;
  --red: #963c38;
  --ink: #152238;
  --muted: #68706f;
  --rule: #d4ccbd;
  --white: #fffefa;
  --ru-font: "PT Sans", "Noto Sans", "Segoe UI", Arial, sans-serif;
  --editorial-font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --shadow: 0 30px 80px rgba(15,31,51,.15), 0 3px 14px rgba(15,31,51,.06);
  --card-shadow: 0 18px 45px rgba(15,31,51,.095), 0 2px 7px rgba(15,31,51,.055);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-press: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html { background: #d8d1c5; font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 50% -10%, #f0ece4 0, #d8d1c5 68%); font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif; font-synthesis: none; -webkit-font-smoothing: antialiased; }
body.drawer-open { overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: transform .18s var(--ease-press), box-shadow .24s var(--ease-out), filter .2s ease, background-color .24s ease, border-color .24s ease; }
button:active:not(:disabled) { transform: scale(.975); }
.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; }

.app-shell { position: relative; width: min(100%, 540px); min-height: 100dvh; margin: 0 auto; overflow: clip; background: linear-gradient(150deg, rgba(255,255,255,.42), transparent 34%), var(--paper); box-shadow: var(--shadow); }
.drawer-backdrop { position: fixed; z-index: 45; inset: 0; border: 0; background: rgba(8,18,31,.46); backdrop-filter: blur(5px); cursor: pointer; animation: backdrop-in .24s ease both; }
.drawer-backdrop[hidden] { display: none; }
.edge-open-button { position: fixed; z-index: 32; top: 42%; left: max(0px, calc(50% - 270px)); width: 18px; height: 68px; padding: 0; border: 0; background: transparent; cursor: ew-resize; }
.edge-open-button span { display: block; width: 3px; height: 54px; border-radius: 0 5px 5px 0; background: linear-gradient(var(--gold), var(--red)); box-shadow: 1px 0 5px rgba(18,36,59,.18); opacity: .68; }
.control-drawer { position: fixed; z-index: 50; top: 0; bottom: 0; left: max(0px, calc(50% - 270px)); width: min(84vw,360px); padding: max(22px,env(safe-area-inset-top)) 20px max(22px,env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; pointer-events: none; visibility: hidden; background: linear-gradient(155deg, #fffefa 0, #f5f1e9 58%, #eae4d9 100%); border-right: 1px solid rgba(174,142,63,.46); box-shadow: 24px 0 64px rgba(8,18,31,.28); transform: translate3d(calc(-100% - max(16px, calc((100vw - 540px)/2))),0,0); transition: transform .36s var(--ease-out), visibility 0s linear .36s; will-change: transform; }
.control-drawer.open { pointer-events: auto; visibility: visible; transform: translateX(0); transition-delay: 0s; }
.drawer-header { position: relative; padding: 50px 0 20px; border-bottom: 1px solid rgba(182,151,74,.38); }
.drawer-position-line { display: grid; grid-template-columns: 38px max-content 38px minmax(0,1fr); align-items: center; gap: 7px; }
.drawer-position-line > strong { color: var(--navy); font-family: var(--editorial-font); font-size: 1.02rem; letter-spacing: .02em; white-space: nowrap; }
.drawer-close { position: absolute; top: 0; right: 0; width: 42px; height: 42px; border: 1px solid rgba(182,151,74,.46); border-radius: 50%; background: rgba(255,253,247,.72); color: var(--navy); font-family: var(--editorial-font); font-size: 1.55rem; line-height: 1; cursor: pointer; }
.drawer-page-controls { padding: 20px 0 18px; }
.drawer-mode { width: 100%; min-height: 48px; }
.drawer-install { width: 100%; min-height: 44px; margin-top: 12px; border-top: 1px solid rgba(182,151,74,.36); }
.text-button { border: 0; background: transparent; color: var(--red); font-size: .82rem; font-weight: 700; }
.mode-button { min-height: 44px; padding: 9px 16px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: linear-gradient(145deg, var(--navy-soft), var(--navy)); box-shadow: inset 0 1px rgba(255,255,255,.14), 0 8px 20px rgba(18,36,59,.18); color: var(--white); font-size: .82rem; font-weight: 750; letter-spacing: .05em; cursor: pointer; }
.mode-button[data-mode="main"] { border-color: rgba(255,255,255,.12); background: linear-gradient(145deg, #ae4b46, var(--red)); }

.view { position: relative; padding: 18px 18px 30px; transform-origin: center center; }
.view.mouse-swiping { user-select: none; cursor: grabbing; }
@media (hover:hover) and (pointer:fine) {
  #studyView .verb-card,
  #detailView .detail-stack { cursor: grab; }
  #studyView.mouse-swiping .verb-card,
  #detailView.mouse-swiping .detail-stack { cursor: grabbing; }
}
.block-door-view { padding: 0; background: var(--navy); }
.block-door { width: 100%; min-height: 100dvh; display: flex; flex-direction: column; padding: max(26px,env(safe-area-inset-top)) 28px max(30px,env(safe-area-inset-bottom)); border: 0; border-top: 7px solid var(--red); background: linear-gradient(to bottom,var(--navy) 0 67.5%,var(--paper) 67.5% 100%); color: var(--white); text-align: left; cursor: pointer; }
.block-door-top { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0 18px; border-bottom: 1px solid rgba(255,255,255,.2); }
.block-door-top b { color: var(--gold); font-size: .72rem; letter-spacing: .055em; }
.block-door-top i { color: rgba(255,255,255,.68); font-size: .72rem; font-style: normal; text-align: right; }
.block-door-kicker { margin-top: 70px; color: var(--red); font-size: .76rem; font-weight: 850; letter-spacing: .08em; }
.block-door-centre { display: grid; grid-template-columns: minmax(0,1fr) minmax(160px,1.35fr); align-items: center; gap: 26px; margin-top: 30px; }
.block-door-centre > strong { color: var(--gold); font-family: var(--editorial-font); font-size: clamp(6.8rem,30vw,9rem); font-weight: 700; line-height: .82; letter-spacing: -.06em; }
.block-door-centre > span { display: grid; gap: 11px; padding: 13px 0 13px 22px; border-left: 5px solid var(--red); }
.block-door-centre b { font-family: var(--editorial-font); font-size: clamp(1.5rem,6.4vw,2rem); line-height: 1.1; }
.block-door-centre i { overflow-wrap: anywhere; font-size: clamp(1rem,4.2vw,1.35rem); font-style: normal; font-weight: 800; line-height: 1.2; }
.block-door-rule { margin-top: 40px; border-top: 1px solid var(--gold); }
.block-door-go { margin-top: 56px; font-family: var(--ru-font); font-size: clamp(2rem,9vw,2.7rem); font-weight: 800; }
.block-door-begin { margin-top: 10px; color: rgba(255,255,255,.64); font-size: .76rem; }
.block-door-lower { display: grid; gap: 11px; margin: auto -28px -30px; min-height: 32.5dvh; padding: 54px 28px 28px 54px; border-top: 4px solid var(--red); background: var(--paper); color: var(--navy); }
.block-door-lower::before { content:""; position: absolute; width: 4px; height: 64px; margin-left: -26px; background: var(--gold); }
.block-door-lower i { font-size: clamp(1rem,4.6vw,1.3rem); font-style: normal; line-height: 1.35; }
.block-door-lower strong { color: var(--red); font-family: var(--editorial-font); font-size: clamp(1.35rem,5.7vw,1.8rem); line-height: 1.3; }
.block-door-lower b { align-self: end; padding-top: 22px; border-top: 1px solid var(--gold); font-size: .78rem; letter-spacing: .04em; }
@media (min-width:1080px){.block-door { min-height: 100vh; }.block-door-centre > strong { font-size: 8rem; }.block-door-lower { min-height: 31vh; }}
.round-button { width: 42px; height: 42px; border: 1px solid var(--rule); border-radius: 50%; background: linear-gradient(145deg, #fffef9, #f5f0e6); box-shadow: inset 0 1px white, 0 3px 8px rgba(18,36,59,.07); font-family: var(--editorial-font); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.round-button:disabled { opacity: .28; cursor: default; }
.jump-button { width: 38px; height: 38px; font-size: 1.55rem; }
.drawer-word { min-width: 0; overflow: hidden; white-space: nowrap; color: var(--navy); font-family: var(--ru-font); font-size: .875rem; font-weight: 750; line-height: 1; text-align: left; }
.page-scrubber { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 42px; align-items: center; gap: 9px; }
.page-scrubber input { width: 100%; height: 34px; margin: 0; accent-color: var(--red); cursor: ew-resize; touch-action: none; }
.page-scrubber output { display: grid; place-items: center; min-height: 36px; border: 1px solid rgba(174,142,63,.42); border-radius: 10px; background: var(--white); box-shadow: inset 0 1px white, 0 3px 9px rgba(18,36,59,.05); color: var(--navy); font-family: var(--editorial-font); font-size: .78rem; font-weight: 700; }

.verb-card { border: 1px solid rgba(174,142,63,.24); border-radius: 20px; background: var(--white); box-shadow: var(--card-shadow); overflow: hidden; }
.verb-hero { position: relative; padding: 26px 23px 23px; color: var(--white); background: linear-gradient(145deg, var(--navy-soft) 0, var(--navy) 58%, #0d1c30 100%); box-shadow: inset 0 -1px rgba(182,151,74,.34); }
.verb-hero::before { content: ""; position: absolute; left: 23px; top: 27px; width: 3px; height: 26px; background: var(--red); box-shadow: 3px 0 0 rgba(182,151,74,.38); }
.meta-row { display: flex; align-items: center; justify-content: space-between; padding-left: 14px; margin-bottom: 23px; }
.verb-id { font-weight: 800; font-size: .88rem; letter-spacing: .06em; }
.aspect-badge { padding-bottom: 3px; border-bottom: 1px solid rgba(182,151,74,.62); color: #d6bd72; font-family: var(--editorial-font); font-weight: 700; font-size: 1.2rem; letter-spacing: .025em; }
.headline-row { display: flex; align-items: start; gap: 12px; }
.headline-copy { min-width: 0; flex: 1; }
.word-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ru-heading { min-width: 0; max-width: 100%; white-space: nowrap; font-family: var(--ru-font); font-stretch: condensed; }
.headline-copy h1 { flex: 1; margin: 0; font-size: clamp(2.25rem, 10vw, 3.35rem); font-weight: 750; line-height: 1; letter-spacing: -.035em; text-shadow: 0 2px 12px rgba(0,0,0,.2); }
.speakable { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.speakable::after { content: ""; display: inline-block; width: .78em; height: .78em; margin-left: .38em; vertical-align: -.06em; background: currentColor; opacity: .52; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm12.2-1.8a6.8 6.8 0 010 9.6M18.8 4.6a10.5 10.5 0 010 14.8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm12.2-1.8a6.8 6.8 0 010 9.6M18.8 4.6a10.5 10.5 0 010 14.8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; transition: opacity .18s ease, transform .22s var(--ease-out); }
.speakable:hover::after, .speakable:focus-visible::after { opacity: .86; }
.speakable:focus-visible { outline: 2px solid rgba(174,142,63,.48); outline-offset: 4px; border-radius: 3px; }
.speakable:active::after { transform: scale(.84); }
.speakable.is-speaking::after { opacity: 1; animation: audio-pulse .9s ease-in-out infinite; }
.verb-hero .speakable::after { color: #d8bd6a; }
.form-value.speakable::after { width: .72em; height: .72em; margin-left: .28em; opacity: .38; }
.list-verb.speakable::after { width: .72em; height: .72em; color: var(--red); opacity: .48; }
.meaning { margin: 15px 0 0; font-size: clamp(1.18rem, 4.8vw, 1.5rem); line-height: 1.45; }
.star-button { flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: rgba(255,255,255,.055); color: #d6bd72; filter: drop-shadow(0 2px 5px rgba(0,0,0,.16)); font-size: 1.72rem; line-height: 1; cursor: pointer; }
.star-button[aria-pressed="true"] { color: var(--gold); }
.pair-link { display: flex; max-width: 100%; align-items: baseline; gap: 9px; margin-top: 23px; padding: 12px 0 0; border: 0; border-top: 1px solid rgba(255,255,255,.14); background: transparent; color: #dce2e8; font-weight: 750; font-size: 1rem; text-align: left; cursor: pointer; }
.pair-link #pairLabel { flex: 0 0 auto; }
.pair-link #pairVerb { min-width: 0; color: var(--white); font-family: var(--ru-font); font-size: 1.08rem; }
.government { margin: 14px 0 0; color: var(--gold); font-weight: 800; font-size: .88rem; }

.examples { padding: 8px 22px 0; }
.example { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.example-number { display: grid; place-items: center; width: 18px; height: 18px; margin-top: 2px; border: 1px solid rgba(157,63,59,.28); border-radius: 50%; background: linear-gradient(145deg, #ad4b46, var(--red)); box-shadow: 0 2px 5px rgba(157,63,59,.15); color: white; font-size: .58rem; font-weight: 800; }
.example p { margin: 0; overflow-wrap: anywhere; }
.example .ru { font-family: var(--ru-font); font-size: 1.06rem; line-height: 1.5; }
.example .translation { margin-top: 7px; font-size: .95rem; line-height: 1.55; color: #303945; }

.conjugation { padding: 16px 22px 22px; }
.section-rule { display: flex; align-items: center; gap: 12px; }
.section-rule::after { content: ""; flex: 1; border-top: 1px solid rgba(182,151,74,.48); }
.section-rule h2 { margin: 0; color: var(--red); font-size: .83rem; }
.conjugation-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; margin-top: 0; }
.conjugation-grid > div { min-width: 0; }
.conjugation-grid > div + div { padding-left: 12px; border-left: 1px solid rgba(182,151,74,.25); }
.conjugation-grid h3 { margin: 0 0 9px; color: var(--muted); font-size: .73rem; font-weight: 600; }
.form-list { display: grid; gap: 8px; }
.form-row { display: grid; grid-template-columns: 31px minmax(0,1fr); align-items: center; gap: 5px; min-height: 19px; }
.form-label { min-width: 0; align-self: stretch; display: flex; align-items: center; padding-right: 4px; border-right: 1px solid rgba(182,151,74,.26); white-space: nowrap; color: var(--muted); font-size: .52rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; text-align: left; }
.form-label.stacked { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; font-size: .48rem; line-height: .9; }
.form-value { min-width: 0; overflow: hidden; white-space: nowrap; font-family: var(--ru-font); font-weight: 800; font-size: 1rem; line-height: 1.15; letter-spacing: -.02em; }
.reflexive-panel { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; align-items: baseline; margin: 0 0 23px; padding: 16px 22px; border-top: 1px solid rgba(182,151,74,.34); border-bottom: 1px solid rgba(182,151,74,.34); background: linear-gradient(135deg, rgba(238,232,221,.82), rgba(233,226,214,.82)); }
.reflexive-panel strong { min-width: 0; white-space: nowrap; font-family: var(--ru-font); font-size: 1.16rem; }
.reflexive-panel span:last-child { min-width: 0; padding-left: 12px; border-left: 1px solid rgba(182,151,74,.25); overflow-wrap: anywhere; font-size: .9rem; line-height: 1.45; }
.status-control { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 16px 0 2px; }
.status-choice { min-height: 58px; display: grid; grid-template-columns: 18px max-content; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--rule); border-radius: 13px; background: linear-gradient(145deg, #fffefa, #f6f2ea); box-shadow: inset 0 1px white, 0 4px 12px rgba(18,36,59,.05); color: var(--muted); cursor: pointer; }
.status-choice span { display: grid; width: 18px; height: 18px; place-items: center; font-weight: 900; line-height: 1; }
.status-choice b { font-size: .8rem; line-height: 1.2; white-space: nowrap; }
.status-choice.reviewing { grid-template-columns: max-content; }
.status-choice.active.learned { border-color: #3f765f; background: #e7f0ea; color: #2f624d; }
.status-choice.active.reviewing { border-color: var(--gold); background: #f2e8c9; color: #7d641f; }
.status-choice.active.not-learned { border-color: var(--red); background: #f4e5e2; color: #973a35; }

.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 6px 0 17px; }
.page-heading h1 { margin: 0; font-family: var(--editorial-font); font-size: 2rem; font-weight: 700; letter-spacing: -.015em; }
.page-heading .ru-heading { font-family: var(--ru-font); font-weight: 800; letter-spacing: -.025em; }
.eyebrow { margin: 0 0 5px; color: var(--red); font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.saved-list-button { min-width: 60px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border: 1px solid rgba(174,142,63,.42); border-radius: 999px; background: linear-gradient(145deg, #fffefa, #f5f0e6); box-shadow: inset 0 1px white, 0 5px 14px rgba(18,36,59,.065); color: var(--gold); cursor: pointer; }
.saved-list-button span { font-size: 1.05rem; line-height: 1; }
.saved-list-button b { color: var(--navy); font-size: .82rem; }
.saved-list-button[aria-pressed="true"] { border-color: var(--gold); background: var(--champagne); }
.outline-button { min-height: 42px; padding: 7px 12px; border: 1px solid rgba(18,36,59,.54); border-radius: 11px; background: rgba(255,255,255,.52); box-shadow: inset 0 1px white, 0 4px 12px rgba(18,36,59,.045); color: var(--navy); font-size: .82rem; font-weight: 800; letter-spacing: .03em; cursor: pointer; }
.search-box { display: flex; align-items: center; gap: 9px; background: rgba(255,254,250,.94); border: 1px solid rgba(174,142,63,.30); border-radius: 14px; box-shadow: inset 0 1px white, 0 7px 20px rgba(18,36,59,.055); padding: 13px 15px; margin-bottom: 15px; transition: border-color .2s ease, box-shadow .24s var(--ease-out); }
.search-box:focus-within { border-color: rgba(150,60,56,.58); box-shadow: inset 0 1px white, 0 9px 24px rgba(18,36,59,.07), 0 0 0 3px rgba(150,60,56,.08); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 1rem; }
.list-stage-container { overflow: hidden; }
.list-screen[hidden] { display: none; }
.list-screen.enter-forward { animation: list-screen-in-right .22s ease both; }
.list-screen.enter-back { animation: list-screen-in-left .22s ease both; }
@keyframes list-screen-in-right { from { opacity: .2; transform: translateX(28px); } }
@keyframes list-screen-in-left { from { opacity: .2; transform: translateX(-28px); } }
.list-subheading { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 11px; margin: 3px 0 16px; }
.list-subheading h2 { margin: 0; color: var(--navy); font-family: var(--editorial-font); font-size: 1.55rem; }
.list-back-button { width: 42px; height: 42px; border: 1px solid rgba(174,142,63,.42); border-radius: 50%; background: var(--white); box-shadow: 0 5px 14px rgba(18,36,59,.065); color: var(--navy); font-family: var(--editorial-font); font-size: 1.65rem; line-height: 1; cursor: pointer; }
.list-results-heading { grid-template-columns: 42px minmax(0,1fr); }
.all-words-navigation { margin-bottom: 10px; }
.all-words-button { width: 100%; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border: 1px solid rgba(18,36,59,.42); border-left: 3px solid var(--red); border-radius: 14px; background: linear-gradient(135deg, #fffefa, #f7f3eb); box-shadow: 0 7px 20px rgba(18,36,59,.06); text-align: left; cursor: pointer; }
.all-words-button > span:first-child { display: grid; gap: 3px; }
.all-words-button b { font-size: .94rem; }
.all-words-button small { color: var(--muted); font-size: .73rem; }
.all-words-meta { display: flex; align-items: center; gap: 12px; }
.all-words-meta > b { min-width: 28px; color: var(--navy); text-align: right; font-size: 1rem; }
.all-words-meta i { display: block; color: var(--red); font-style: normal; font-size: 1.15rem; transition: transform .16s ease; }
.range-buttons { display: grid; gap: 7px; }
.range-button { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border: 1px solid var(--rule); border-left: 3px solid rgba(174,142,63,.72); border-radius: 12px; background: rgba(255,254,250,.94); box-shadow: 0 4px 12px rgba(18,36,59,.04); color: var(--navy); white-space: nowrap; font-size: .9rem; font-weight: 750; text-align: left; cursor: pointer; }
.range-button i { color: var(--red); font-family: var(--editorial-font); font-size: 1.25rem; font-style: normal; }
.range-button.active { border-color: var(--red); background: linear-gradient(145deg, #ad4b46, var(--red)); box-shadow: inset 0 1px rgba(255,255,255,.14); color: var(--white); }
.status-folders { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-bottom: 16px; }
.folder-button { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: linear-gradient(145deg, #fffefa, #f6f2ea); box-shadow: inset 0 1px white, 0 4px 12px rgba(18,36,59,.04); color: var(--muted); text-align: left; cursor: pointer; }
.folder-button span { font-size: .78rem; font-weight: 750; line-height: 1.25; }
.folder-button b { min-width: 25px; text-align: right; font-size: 1rem; color: var(--navy); }
.folder-button.active { border-color: var(--navy); box-shadow: inset 3px 0 var(--navy); color: var(--navy); }
.folder-button.active.learned { border-color: #3f765f; box-shadow: inset 3px 0 #3f765f; }
.folder-button.active.reviewing { border-color: var(--gold); box-shadow: inset 3px 0 var(--gold); }
.folder-button.active.not-learned { border-color: var(--red); box-shadow: inset 3px 0 var(--red); }
.swipe-guide { margin: -5px 0 6px; color: var(--muted); font-size: .75rem; font-weight: 650; text-align: right; }
.list-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 35px; color: var(--muted); font-size: .82rem; font-weight: 750; }
.list-result-heading b { color: var(--navy); }
.verb-list { overflow: hidden; border: 1px solid rgba(174,142,63,.28); border-radius: 16px; background: var(--white); box-shadow: 0 13px 34px rgba(18,36,59,.07), inset 0 1px white; }
.list-row-wrap { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--paper-deep); }
.list-row-wrap:last-child { border-bottom: 0; }
.list-row-wrap::before { content: attr(data-swipe-target); position: absolute; inset: 0; display: flex; align-items: center; padding: 0 16px; color: white; font-size: .78rem; font-weight: 800; }
.list-row-wrap[data-swipe-direction="right"]::before { justify-content: flex-start; }
.list-row-wrap[data-swipe-direction="left"]::before { justify-content: flex-end; }
.list-row-wrap[data-swipe-status="learned"] { background: #3f765f; }
.list-row-wrap[data-swipe-status="reviewing"] { background: #a98732; }
.list-row-wrap[data-swipe-status="notLearned"] { background: var(--red); }
.list-row { position: relative; z-index: 1; width: 100%; display: grid; grid-template-columns: 45px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 72px; padding: 12px 13px; border: 0; background: var(--white); text-align: left; touch-action: pan-y; cursor: pointer; transition: transform .2s var(--ease-out), background .2s ease, filter .2s ease; }
.list-row-wrap:nth-child(odd) .list-row { background: #faf7f0; }
.list-row.dragging { transition: none; }
.list-id { color: var(--red); font-family: var(--editorial-font); font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
.list-copy { min-width: 0; display: grid; gap: 4px; }
.list-verb { min-width: 0; white-space: nowrap; font-family: var(--ru-font); font-weight: 800; font-size: 1rem; }
.list-meaning { overflow-wrap: anywhere; color: #3e4650; font-size: .84rem; line-height: 1.4; }
.list-state { max-width: 86px; padding: 6px 9px; border: 1px solid rgba(174,142,63,.48); border-radius: 999px; background: #f5ecd2; color: #765f25; font-size: .72rem; font-weight: 800; line-height: 1.2; text-align: center; }
.list-state.learned { border-color: #3f765f; background: #e7f0ea; color: #2f624d; }
.list-state.not-learned { border-color: var(--red); background: #f4e5e2; color: #973a35; }
.load-more-button { width: 100%; min-height: 48px; margin-top: 12px; border: 1px solid rgba(18,36,59,.48); border-radius: 12px; background: rgba(255,254,250,.66); box-shadow: inset 0 1px white; color: var(--navy); font-size: .82rem; font-weight: 800; cursor: pointer; }
.empty-state { padding: 44px 8px; color: var(--muted); text-align: center; }

.detail-view { padding-top: 18px; }
.detail-stack { display: grid; gap: 16px; }
.detail-block { min-width: 0; padding: 22px; border: 1px solid rgba(174,142,63,.24); border-left: 3px solid var(--red); border-radius: 17px; background: var(--white); box-shadow: var(--card-shadow); }
.detail-block > * { min-width: 0; }
.detail-block.imperfective { background: var(--white); }
.detail-block.perfective { border-left-color: var(--gold); background: linear-gradient(145deg, #f5edd7, #eee4c8); }
.detail-block.biaspectual { border-left-color: var(--navy); }
.detail-block.reflexive { background: linear-gradient(145deg, #eee8dd, var(--paper-deep)); }
.detail-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; color: var(--red); font-size: .76rem; font-weight: 800; }
.detail-heading-copy { min-width: 0; flex: 1; }
.detail-heading-copy h1 { max-width: 100%; }
.detail-block h2 { display: flex; min-width: 0; align-items: center; gap: 8px; margin: 0; font-family: var(--ru-font); font-size: clamp(1.75rem, 7.2vw, 2.45rem); font-weight: 800; line-height: 1.06; }
.detail-word { flex: 1; }
.detail-block .detail-meaning { margin: 7px 0 16px; overflow-wrap: anywhere; font-size: 1.08rem; line-height: 1.45; }
.detail-example { margin: 0 0 18px; padding: 14px 15px 12px; border: 1px solid rgba(18,36,59,.08); border-radius: 11px; background: rgba(235,230,220,.62); box-shadow: inset 3px 0 rgba(150,60,56,.46); }
.detail-block.perfective .detail-example { background: rgba(255,253,247,.58); box-shadow: inset 3px 0 rgba(182,151,74,.72); }
.detail-example p { margin: 0 0 6px; overflow-wrap: anywhere; line-height: 1.5; }
.detail-example p:first-child { font-family: var(--ru-font); }
.detail-example .translation { color: #3b4350; font-size: .93rem; }
.detail-audio { margin-left: 8px; vertical-align: middle; }
.settings-heading { align-items: center; }
.settings-card { overflow: hidden; border: 1px solid rgba(174,142,63,.27); border-top: 3px solid var(--navy); border-radius: 16px; background: var(--white); box-shadow: var(--card-shadow); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 86px; padding: 18px; }
.setting-row > span { display: grid; gap: 5px; }
.setting-row b { font-size: 1rem; }
.setting-row small { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.setting-row select { flex: 0 0 auto; min-width: 112px; border: 1px solid var(--rule); background: var(--paper); border-radius: 10px; padding: 10px 30px 10px 11px; color: var(--navy); font-size: .9rem; font-weight: 700; }
.swipe-moving { transition: none !important; }
.swipe-exit-left { animation: slide-left .18s ease both; }
.swipe-exit-right { animation: slide-right .18s ease both; }
.view-enter-right { animation: enter-from-right .34s var(--ease-out) both; }
.view-enter-left { animation: enter-from-left .34s var(--ease-out) both; }
@keyframes slide-left { to { opacity: .15; transform: translateX(-24px); } }
@keyframes slide-right { to { opacity: .15; transform: translateX(24px); } }
@keyframes enter-from-right { from { opacity: .18; transform: translateX(42px); } }
@keyframes enter-from-left { from { opacity: .18; transform: translateX(-34px); } }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes audio-pulse { 0%,100% { transform: scale(1); opacity: .68; } 50% { transform: scale(1.18); opacity: 1; } }

.drawer-nav { display: grid; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(182,151,74,.38); }
.nav-button { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 11px; min-height: 52px; padding: 9px 13px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.nav-button span { font-size: 1.08rem; text-align: center; }
.nav-button b { font-size: .84rem; letter-spacing: .03em; }
.nav-button.active { border-color: rgba(182,151,74,.42); background: rgba(255,253,247,.76); box-shadow: inset 3px 0 var(--red), 0 4px 13px rgba(18,36,59,.05); color: var(--red); }

.settings-group { margin: 0 0 24px; }
.settings-group > h2 { margin: 0 0 9px 4px; color: var(--muted); font-size: .875rem; font-weight: 700; letter-spacing: .04em; }
.settings-group .settings-card { border-top-width: 1px; box-shadow: 0 7px 24px rgba(18,36,59,.05); }
.settings-group .setting-row { min-height: 72px; padding: 16px; gap: 14px; }
.settings-group .setting-row > span { flex: 1; min-width: 0; }
.settings-group .setting-row small { font-size: .8125rem; }
.settings-card > * + * { border-top: 1px solid rgba(18,36,59,.09); }
.setting-action { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 16px; border: 0; background: transparent; font-size: 1rem; font-weight: 550; text-align: left; cursor: pointer; }
.setting-action > span:last-child:not(:first-child) { color: var(--muted); flex: 0 0 auto; }
.settings-card > .setting-action:not(:first-child) { border-top: 1px solid rgba(18,36,59,.09); }
.settings-note { margin: 9px 4px 0; color: #626866; font-size: .8125rem; line-height: 1.7; overflow-wrap: anywhere; }
.settings-switch { appearance: none; -webkit-appearance: none; flex: 0 0 46px; width: 46px; height: 28px; margin: 0; border: 1px solid #b6b8b5; border-radius: 99px; background: #d5d6d1; position: relative; cursor: pointer; transition: background .2s ease, border-color .2s ease; }
.settings-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 1px 4px #12243b30; transition: transform .24s var(--ease-out); }
.settings-switch:checked { border-color: var(--navy); background: var(--navy); }
.settings-switch:checked::after { transform: translateX(18px); }
.settings-segment { display: flex; padding: 3px; border: 1px solid var(--rule); border-radius: 11px; background: var(--paper); gap: 3px; }
.settings-segment button { min-height: 38px; padding: 6px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .875rem; font-weight: 650; cursor: pointer; }
.settings-segment button[aria-pressed=true] { color: var(--navy); background: white; box-shadow: 0 2px 6px #12243b15; }
.settings-type-preview { display: grid; gap: 7px; padding: 17px 20px; background: linear-gradient(135deg,#eee4c82e,#12243b05); }
.settings-type-preview [lang=ru] { font-family: var(--ru-font); font-size: 1.5rem; font-weight: 700; }
.settings-type-preview > span:last-child { font-size: 1rem; }
.settings-help summary, .settings-reset summary { padding: 18px 16px; min-height: 60px; cursor: pointer; font-size: 1rem; font-weight: 550; }
.settings-help summary::marker, .settings-reset summary::marker { color: var(--muted); font-size: .8em; }
.settings-help-copy { padding: 0 16px 18px; font-size: .9375rem; line-height: 1.8; }
.settings-help-copy p { margin: 0 0 14px; }
.settings-help-copy p:last-child { margin-bottom: 0; }
.settings-help-copy h3 { font-size: .9375rem; margin: 12px 0 3px; color: var(--navy); }
.settings-version { display: grid; grid-template-columns: auto 1fr; gap: 8px 15px; margin: 12px 0 0; font-size: .875rem; }
.settings-version dt { color: var(--muted); }
.settings-version dd { margin: 0; text-align: right; }
.settings-reset { margin-top: 30px; border-top: 1px solid var(--rule); }
.settings-reset > summary { padding-inline: 4px; font-size: .875rem; color: var(--muted); }
.settings-reset .settings-note { margin-top: 0; margin-bottom: 10px; }
.danger-action { color: var(--red); font-size: .9375rem; padding-inline: 4px; }
body.dialog-open { overflow: hidden; }
.settings-dialog { width: min(440px,calc(100vw - 32px)); max-height: min(88dvh,760px); padding: 26px 22px 22px; border: 1px solid var(--rule); border-radius: 20px; color: var(--ink); background: var(--white); box-shadow: var(--shadow); overflow-y: auto; }
.settings-dialog[open] { animation: settings-dialog-in .24s var(--ease-out) both; }
.settings-dialog::backdrop { background: #08121f99; backdrop-filter: blur(3px); }
.settings-dialog h2 { margin: 0 0 14px; font-size: 1.25rem; line-height: 1.5; }
.settings-dialog p { margin: 0 0 22px; font-size: .9375rem; line-height: 1.75; white-space: pre-line; }
.settings-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.settings-dialog-actions button { min-height: 44px; font-size: .875rem; letter-spacing: 0; }
.settings-dialog .danger-confirm { background: var(--red); }
.settings-dialog-error { color: var(--red); }
#reportFields label { display: block; margin: 16px 0 6px; font-size: .875rem; font-weight: 700; }
#reportFields input, #reportFields textarea { width: 100%; max-width: 100%; padding: 11px; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; font-size: 1rem; }
#reportFields textarea { resize: vertical; min-height: 100px; }
#reportFields { margin-bottom: 20px; }
.settings-feedback { position: fixed; z-index: 100; left: 50%; bottom: max(20px,env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: min(480px,calc(100vw - 36px)); padding: 14px 18px; border-radius: 13px; box-shadow: var(--shadow); background: var(--navy); color: white; font-size: .875rem; line-height: 1.6; pointer-events: none; }
.settings-feedback.is-error { background: #7c3431; }
.settings-feedback[hidden], #reportFields[hidden], #settingsDialogError[hidden] { display: none; }
html[data-text-size=large] .meaning { font-size: clamp(1.42rem,5.75vw,1.8rem); }
html[data-text-size=large] .example .ru { font-size: 1.27rem; }
html[data-text-size=large] .example .translation { font-size: 1.14rem; }
html[data-text-size=large] .list-meaning { font-size: 1rem; }
html[data-text-size=large] .detail-meaning { font-size: 1.3rem; }
html[data-text-size=large] .detail-example p:first-child { font-size: 1.2rem; }
html[data-text-size=large] .detail-example .translation { font-size: 1.12rem; }
html[data-text-size=large] .reflexive-panel span:last-child { font-size: 1.08rem; }
html[data-text-size=large] .form-row { min-height: 24px; }
html[data-text-size=large] .settings-type-preview [lang=ru] { font-size: 1.8rem; }
html[data-text-size=large] .settings-type-preview > span:last-child { font-size: 1.2rem; }
@keyframes settings-dialog-in { from { opacity: .2; transform: translateY(14px) scale(.98); } }
@media (max-width: 390px) { .setting-row-stack { flex-wrap: wrap; } .settings-group .setting-row select { min-width: 90px; max-width: 52%; font-size: .875rem; } .settings-group .setting-row { padding: 14px; gap: 10px; } }

.course-group { margin: 28px 0; }
.course-group > h2 { margin: 0 0 12px; font-size: .87rem; font-weight: 600; color: var(--muted); }
.course-list, .course-products { display: grid; gap: 16px; }
.course-card { display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 18px 16px; padding: 24px; border: 1px solid rgba(174,142,63,.35); border-radius: 18px; background: var(--white); box-shadow: var(--card-shadow); }
.course-card.is-current { border-top: 4px solid var(--navy); }
.course-mark { display: grid; place-items: center; width: 52px; height: 66px; border-radius: 4px 10px 10px 4px; background: var(--navy); color: #e2ca8f; font-family: var(--editorial-font); font-size: 1.25rem; letter-spacing: .06em; box-shadow: inset 4px 0 rgba(255,255,255,.1); }
.course-copy { min-width: 0; }
.course-eyebrow { font-size: .73rem; letter-spacing: .05em; color: var(--muted); }
.course-card h3, .course-product h3 { margin: 6px 0 8px; font-size: 1.18rem; line-height: 1.55; overflow-wrap: anywhere; }
.course-card p, .course-product p { margin: 0; font-size: .86rem; line-height: 1.75; color: var(--muted); }
.course-open { grid-column: 1 / -1; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 10px; color: var(--white); background: var(--navy); text-align: center; font-size: .95rem; cursor: pointer; transition: transform .25s var(--ease-out), background .25s; }
.course-open:active { transform: scale(.98); }
.course-empty { padding: 26px 22px; border-radius: 14px; background: rgba(23,38,61,.045); }
.course-empty h3 { margin: 0 0 10px; font-size: 1rem; font-weight: 600; }
.course-empty p { margin: 0; font-size: .88rem; line-height: 1.9; color: var(--muted); }
.course-product { padding: 22px; border: 1px solid rgba(23,38,61,.12); border-radius: 14px; background: var(--white); }
.course-product button, .course-owned { display: block; margin-top: 18px; }
.course-product button { min-height: 44px; width: 100%; }
.course-settings-link { margin-bottom: 24px; }
.course-loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 30px; background: #f8f5ee; color: var(--navy); }
.course-loading > div { max-width: 360px; text-align: center; line-height: 1.9; }
.course-loading button { margin-top: 16px; min-height: 48px; }
.course-loading[hidden], #courseEmpty[hidden], #purchaseRestorePanel[hidden], #billingNote[hidden] { display: none; }
button:disabled { opacity: .48; cursor: default; }
@media (max-width: 370px) { .course-card { padding: 20px 16px; gap: 16px 12px; } .course-card h3 { font-size: 1.08rem; } }

@media (hover:hover) {
  .mode-button:hover, .round-button:hover, .range-button:hover, .twenty-range-button:hover, .folder-button:hover, .status-choice:hover, .list-row:hover { filter: brightness(.985); transform: translateY(-1px); }
  .pair-link:hover { color: #fff; }
}

button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(181,72,66,.3); outline-offset: 2px; }
@media (min-width: 760px) {
  body { padding: 22px 0; }
  .app-shell { min-height: calc(100dvh - 44px); border-radius: 4px; }
  .control-drawer { top: 22px; bottom: 22px; }
  .edge-open-button { top: 34px; left: calc(50% - 326px); width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(174,142,63,.42); border-radius: 50%; background: rgba(255,254,250,.94); box-shadow: 0 8px 22px rgba(18,36,59,.15); cursor: pointer; }
  .edge-open-button span,
  .edge-open-button span::before,
  .edge-open-button span::after { width: 18px; height: 2px; border-radius: 2px; background: var(--navy); box-shadow: none; opacity: 1; }
  .edge-open-button span { position: relative; display: block; }
  .edge-open-button span::before,
  .edge-open-button span::after { content: ""; position: absolute; left: 0; }
  .edge-open-button span::before { top: -6px; }
  .edge-open-button span::after { top: 6px; }
}
@media (min-width: 1080px) {
  .control-drawer {
    top: 22px;
    right: calc(50% + 270px);
    bottom: 22px;
    left: auto;
    width: min(320px, calc(50vw - 292px));
    min-width: 248px;
    pointer-events: auto;
    visibility: visible;
    transform: none;
    transition: none;
    border-right-color: rgba(174,142,63,.32);
    border-radius: 16px 0 0 16px;
    box-shadow: -16px 0 44px rgba(8,18,31,.12);
  }
  .control-drawer.open { transform: none; }
  .drawer-close,
  .edge-open-button { display: none !important; }
  .drawer-header { padding-top: 12px; }
}
@media (max-width: 370px) { .conjugation { padding-inline: 16px; } .detail-block { padding: 17px 15px; } .status-choice b { font-size: .72rem; } .status-choice { gap: 3px; } .folder-button { display: grid; justify-items: start; gap: 4px; padding: 9px; } .folder-button b { min-width: 0; text-align: left; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
