:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20211f;
  background: #f7f6f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100dvh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.language-gate { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; overflow: hidden; padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); background: radial-gradient(ellipse at 50% 38%, #fff 0, #fbfaf6 44%, #f0efe7 100%); opacity: 1; transition: opacity 280ms ease, transform 280ms ease; }
.language-gate.is-leaving { opacity: 0; transform: scale(1.018); pointer-events: none; }
.language-panel { position: relative; z-index: 1; width: min(100%, 440px); padding: 42px 38px 30px; border: 1px solid #e8e7de; border-radius: 24px; background: #ffffffd9; box-shadow: 0 24px 70px #33392c12, 0 3px 12px #33392c08; text-align: center; backdrop-filter: blur(10px); transform: translateY(-42px); }
.language-selector-back { position: absolute; z-index: 3; top: max(20px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); }
.language-mark { display: grid; width: 54px; height: 54px; place-items: center; margin: 0 auto 23px; border: 1px solid #e4e5dc; border-radius: 17px; background: #f3f5ef; color: #465242; font-family: "Noto Serif JP", "Yu Mincho", serif; font-size: 28px; box-shadow: inset 0 0 0 5px #ffffffb8; }
.language-panel .eyebrow { margin-bottom: 12px; }
.language-intro { margin: 13px 0 28px; color: #77796f; font-size: 15px; }
.language-options { display: grid; gap: 11px; }
.language-option { display: grid; grid-template-columns: 42px 1fr 24px; align-items: center; gap: 13px; width: 100%; min-height: 76px; padding: 12px 16px; border: 1px solid #e4e4db; border-radius: 14px; background: #fff; color: #30392f; text-align: left; transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.language-option:hover { transform: translateY(-2px); border-color: #b9c1af; background: #fcfdf9; box-shadow: 0 7px 18px #30392f0e; }
.language-option:focus-visible { outline: 3px solid #797d6450; outline-offset: 3px; }
.language-flag { display: grid; width: 42px; height: 30px; place-items: center; overflow: hidden; border-radius: 5px; background: #f5f4ee; box-shadow: 0 1px 3px #20211f24; }
.language-flag svg { display: block; width: 100%; height: 100%; }
.language-option-copy { display: flex; flex-direction: column; gap: 3px; }
.language-option-copy strong { font-size: 15px; font-weight: 700; }
.language-option-copy small { color: #85867e; font-size: 12px; }
.language-arrow { color: #85867e; font-size: 19px; transition: transform .16s ease; }
.language-option:hover .language-arrow { transform: translateX(3px); }
.language-decoration { position: absolute; color: #e7e8df; font-family: "Noto Serif JP", "Yu Mincho", serif; font-size: clamp(110px, 19vw, 240px); font-weight: 500; line-height: 1; user-select: none; }
.language-decoration-one { top: 7%; left: 8%; transform: rotate(-9deg); }
.language-decoration-two { right: 8%; bottom: 5%; transform: rotate(8deg); }
.language-loading { margin: 31px 2px 0; text-align: left; animation: loading-appear 180ms ease-out both; }
.loading-copy { display: flex; justify-content: space-between; color: #465242; font-size: 13px; font-weight: 650; }
.loading-track { height: 7px; margin-top: 11px; overflow: hidden; border-radius: 99px; background: #e9eae3; }
.loading-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #52614b, #89977b); transition: width 90ms linear; }
.loading-footnote { margin: 10px 0 0; color: #92948b; font-size: 11px; }
.app-shell.is-entering-app { animation: app-fade-in 420ms ease-out both; }
.app-shell.is-leaving-app { animation: app-fade-out 220ms ease-in both; pointer-events: none; }
.language-gate.is-initial-entry { animation: gate-fade-in 420ms ease-out; }
.language-gate.is-returning { animation: gate-fade-in 240ms ease-out both; }
@keyframes loading-appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes app-fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes app-fade-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes gate-fade-in { from { opacity: 0; } to { opacity: 1; } }
.language-back-button { position: fixed; z-index: 6; left: 28px; bottom: 27px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid #e1e0d8; border-radius: 999px; background: #ffffffed; color: #55574f; font-size: 13px; font-weight: 650; box-shadow: 0 5px 16px #20211f12; transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.language-back-button:hover { transform: translateY(-1px); border-color: #c8c9bd; background: #f0f1eb; }
.language-back-button:focus-visible { outline: 3px solid #797d6450; outline-offset: 2px; }
.language-back-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
#settings-button { width: 58px; height: 58px; padding: 0; justify-content: center; }

.app-shell { min-height: 100vh; min-height: 100dvh; }
.screen { min-height: 100vh; min-height: 100dvh; padding: 32px; }
::view-transition-group(root) { animation-duration: 280ms; animation-timing-function: linear; }
::view-transition-image-pair(root) { background-color: #f7f6f2; }
::view-transition-old(root) { animation: screen-transition-out 110ms ease-in both; }
::view-transition-new(root) { animation: screen-transition-in 155ms cubic-bezier(.2, .7, .25, 1) 125ms both; }
@keyframes screen-transition-out { to { opacity: 0; transform: translateY(-5px); } }
@keyframes screen-transition-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.home-screen { display: grid; place-items: center; position: relative; }
.home-content { width: min(100%, 380px); padding-bottom: 64px; text-align: center; display: flex; align-items: center; flex-direction: column; }
.eyebrow { color: #77796f; font-size: 11px; font-weight: 700; letter-spacing: .16em; margin: 0 0 12px; }
h1 { font-size: clamp(30px, 6vw, 42px); letter-spacing: -.045em; line-height: 1.1; margin: 0; }
.intro { color: #77796f; margin: 12px 0 38px; }
.field-label { align-self: flex-start; color: #53554e; font-size: 14px; font-weight: 650; margin: 0 0 8px; }
.home-content > .field-label { align-self: center; }
.session-label { margin-top: 22px; }
.session-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.session-option { flex: 1; min-height: 42px; border: 1px solid #deded5; border-radius: 999px; background: #fff; color: #53554e; font-weight: 650; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.session-option-wide { grid-column: 1 / -1; }
.session-option:hover { border-color: #a9ab9d; }
.session-option.is-selected { border-color: #30392f; background: #30392f; color: #fff; }
.session-option:focus-visible { outline: 3px solid #797d6450; outline-offset: 2px; }
.select-control, input, textarea { width: 100%; border: 1px solid #deded5; border-radius: 10px; background: #fff; color: #20211f; padding: 13px 14px; outline: none; }
.select-control:focus, input:focus, textarea:focus { border-color: #797d64; box-shadow: 0 0 0 3px #797d641c; }
.primary-button { border: 0; border-radius: 10px; background: #30392f; color: white; font-weight: 650; padding: 14px 20px; min-height: 50px; transition: background .15s ease, transform .15s ease; }
.primary-button:hover { background: #414b3f; }
.primary-button:active { transform: translateY(1px); }
.home-content .primary-button { width: 100%; margin-top: 14px; }
.subtle-text { color: #85867e; font-size: 13px; margin: 16px 0 0; }
#deck-count.is-empty-prompt { color: #b43d36; animation: empty-deck-blink 650ms ease-in-out 3 both; }
@keyframes empty-deck-blink { 0%, 100% { color: #b43d36; opacity: 1; } 50% { color: #b43d36; opacity: .2; } }
.deck-actions { position: fixed; z-index: 5; right: 28px; bottom: 28px; display: flex; align-items: flex-end; gap: 10px; }
.add-button { width: 58px; height: 58px; border: 0; border-radius: 50%; color: #fff; background: #30392f; font-size: 34px; font-weight: 300; line-height: 1; box-shadow: 0 6px 18px #20211f26; }
html:not(.native-app) .add-button { position: relative; padding: 0; font-size: 0; }
html:not(.native-app) .add-button::before { content: ""; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; background: linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat, linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat; }
.add-button:hover { background: #414b3f; }
.deck-tools { position: relative; }
.deck-management-actions { position: fixed; z-index: 5; right: 28px; bottom: 28px; }
.deck-tools-button { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid #deded5; border-radius: 50%; background: #fff; color: #30392f; box-shadow: 0 6px 18px #20211f18; }
.deck-tools-button:hover { background: #f0f1eb; border-color: #c8c9bd; }
.deck-tools-button:focus-visible { outline: 3px solid #797d6450; outline-offset: 2px; }
.deck-tools-button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.deck-action-menu { position: absolute; right: 0; bottom: calc(100% + 12px); display: flex; flex-direction: column; align-items: flex-end; gap: 9px; opacity: 0; pointer-events: none; transform: translateY(8px) scale(.98); transform-origin: bottom right; transition: opacity .16s ease, transform .16s ease; visibility: hidden; }
.deck-action-menu::before { content: ""; position: absolute; z-index: 0; inset: -16px -20px; }
.deck-action-menu::after { content: ""; position: absolute; z-index: 0; top: 100%; left: 0; right: 0; height: 12px; }
.deck-tools.is-open .deck-action-menu { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); visibility: visible; }
.deck-action { position: relative; z-index: 1; min-height: 42px; padding: 0 17px; border: 1px solid #e1e0d8; border-radius: 999px; background: #fff; color: #30392f; font-size: 14px; font-weight: 650; white-space: nowrap; box-shadow: 0 5px 16px #20211f12; transition: background .14s ease, border-color .14s ease; }
.deck-action:hover, .deck-action:focus-visible { background: #d2d8c9; border-color: #9da58f; outline: none; }

.practice-screen, .form-screen { display: flex; flex-direction: column; }
.screen-header { display: flex; align-items: center; justify-content: space-between; min-height: 38px; }
.screen-header .subtle-text { margin: 0; }
.text-button { border: 0; background: transparent; padding: 8px 0; color: #55574f; font-weight: 600; }
.text-button:hover { color: #20211f; }
.practice-content { flex: 1; width: min(100%, 580px); min-height: 0; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.deck-credit { max-width: 360px; margin: 8px auto 0; font-size: 11px; line-height: 1.45; text-align: center; }
.flashcard { position: relative; isolation: isolate; perspective: 1100px; width: 100%; min-height: 0; padding: 0; border: 0; border-radius: 18px; background: transparent; box-shadow: none; display: grid; place-items: center; text-align: center; color: inherit; white-space: pre-wrap; overflow: visible; touch-action: none; -webkit-tap-highlight-color: transparent; }
.flashcard:focus:not(:focus-visible) { outline: none; }
.flashcard:focus-visible { outline: 3px solid #797d6450; outline-offset: 3px; }
.flashcard, .flashcard * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.flashcard-inner { position: relative; z-index: 1; display: grid; grid-template-areas: "card"; width: 100%; transform-style: preserve-3d; transition: transform 400ms cubic-bezier(.2,.7,.3,1); }
.flashcard.is-render-reset .flashcard-inner { transition: none; }
.flashcard.is-flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face { position: relative; box-sizing: border-box; grid-area: card; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 356px; padding: 38px 30px; border: 1px solid #e3e2d9; border-radius: 18px; background: #fff; box-shadow: 0 2px 0 #e1e0d8, 0 7px 0 #eeede7, 0 18px 40px #20211f10; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flashcard-face::before { content: ""; position: absolute; z-index: 0; inset: 12px; border: 1px solid #f0efe9; border-radius: 11px; pointer-events: none; }
.flashcard-face::after { content: "文"; position: absolute; z-index: 0; right: 22px; bottom: 16px; color: #deded5; font-size: 16px; font-weight: 600; line-height: 1; pointer-events: none; }
.flashcard-back { transform: rotateY(180deg); }
.drag-miss-hint { position: absolute; z-index: 2; bottom: 14px; left: 0; right: 0; color: #9e332f; font-size: 13px; font-weight: 700; opacity: var(--drag-miss-opacity, 0); pointer-events: none; }
.flashcard:hover .flashcard-face { border-color: #c8c9bd; box-shadow: 0 2px 0 #d9d8ce, 0 7px 0 #e9e8e1, 0 20px 44px #20211f14; }
.flashcard.is-confirming-correct .flashcard-face { animation: reveal-blip 360ms ease-out both; border-color: #91ad82; }
.flashcard.is-correct-hold .flashcard-face { background: #dcebd6; border-color: #8daa7d; }
.flashcard.is-advancing { animation: card-out 170ms cubic-bezier(.4, 0, .8, .5) both; pointer-events: none; }
.flashcard.is-entering { animation: card-in 230ms cubic-bezier(.2, .7, .3, 1) both; }
.flashcard.is-dragging { cursor: grabbing; transform: translate3d(var(--drag-x, 0px), var(--drag-y, 0px), 0) rotate(var(--drag-rotation, 0deg)); opacity: var(--drag-opacity, 1); transition: none; }
.flashcard.is-dragging .flashcard-face { background: var(--flashcard-drag-bg, #fff); box-shadow: 0 5px 0 #d8d7ce, 0 12px 0 #e8e7df, 0 26px 48px #20211f24; }
.flashcard.is-drag-snap { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; transition: transform 180ms ease-out, opacity 180ms ease-out; }
.flashcard.is-swipe-exit-left, .flashcard.is-swipe-exit-right { transition: transform 190ms cubic-bezier(.35, .05, .75, .35); pointer-events: none; }
.flashcard.is-swipe-exit-down { opacity: 0; transform: translate3d(0, 115%, 0); transition: transform 190ms cubic-bezier(.35, .05, .75, .35), opacity 190ms ease-out; pointer-events: none; }
.flashcard.is-swipe-exit-left { transform: translate3d(-115%, 0, 0) rotate(-9deg); }
.flashcard.is-swipe-exit-right { transform: translate3d(115%, 0, 0) rotate(9deg); }
.flashcard.is-swipe-enter-from-left { animation: swipe-enter-from-left 220ms cubic-bezier(.2, .7, .3, 1) both; }
.flashcard.is-swipe-enter-from-right { animation: swipe-enter-from-right 220ms cubic-bezier(.2, .7, .3, 1) both; }
.flashcard.is-denied-jitter { animation: denied-jitter 320ms ease-out; }
.prompt-word { font-size: clamp(30px, 7vw, 48px); font-weight: 650; letter-spacing: -.04em; line-height: 1.2; overflow-wrap: anywhere; }
.romaji-word { display: block; }
.romaji-token { border-radius: 3px; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) and (pointer: fine) { .romaji-token:hover { background: #f3f5ef; } }
.hiragana-subtext { display: block; margin-top: 6px; color: #85867e; font-size: .58em; font-weight: 500; letter-spacing: .03em; line-height: 1.35; }
.reveal-hint { color: #85867e; font-size: 14px; margin-top: 24px; }
.swipe-reveal-hint { color: #a64e47; font-size: 13px; line-height: 1.4; margin: -8px 0 12px; min-height: 18px; text-align: center; transition: opacity 900ms ease-out; }
.swipe-reveal-hint.is-hidden { opacity: 0; visibility: hidden; }
.swipe-reveal-hint.is-fading { opacity: 0; }
.swipe-reveal-hint.is-attention { animation: reveal-needed-blink 1.1s ease-in-out 3; }
.answer-word { border-top: 1px solid #ecebe4; color: #55574f; font-size: 20px; line-height: 1.55; margin-top: 26px; padding-top: 22px; width: 100%; overflow-wrap: anywhere; }
.back-prompt-word { font-size: clamp(23px, 5vw, 34px); }
.remember-later-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 144px; margin: 18px 0 0; padding: 16px 20px; border: 1.5px dashed #dbb3ad; border-radius: 16px; background: #f5e9e6; color: #8c4540; text-align: center; font-size: 16px; font-weight: 700; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease, transform .16s ease; }
.remember-later-button:disabled { cursor: default; opacity: .5; }
.remember-later-button.is-active { opacity: 1; }
.remember-later-button.is-active:hover, .remember-later-button.is-active:focus-visible { background: #f4e0dc; border-color: #c98279; }
.remember-later-button:focus-visible { outline: 3px solid #b76c6450; outline-offset: 3px; }
.remember-later-button.is-drop-approaching { transform: translateY(calc(-1 * var(--drop-lift, 0px))); background: #f0d3ce; border-color: #b8473e; box-shadow: 0 0 0 4px #d98b8040; }
.practice-summary { width: min(100%, 580px); margin: auto; padding: 28px 0; text-align: center; }
@media (max-height: 700px) { .practice-content { justify-content: flex-start; } }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.practice-summary h1 { margin: 0 0 12px; }
.summary-correct { margin: 10px 0; color: #31472d; font-size: clamp(28px, 7vw, 42px); font-weight: 750; }
.summary-missed-list { display: grid; gap: 10px; padding: 0; list-style: none; text-align: center; }
.summary-missed-list li { border: 1px solid #e3e2d9; border-radius: 12px; background: #fff; padding: 12px 14px; text-align: center; }
.summary-missed-list strong, .summary-missed-list span { display: block; }
.summary-missed-list span { margin-top: 4px; color: #67695f; }
.answer-word.is-appearing { animation: answer-appear 260ms ease-out both; }
.practice-meaning + .practice-meaning { border-top: 1px solid #ecebe4; margin-top: 16px; padding-top: 16px; }
.practice-example { display: flex; flex-direction: column; gap: 2px; margin: 10px auto 0; color: #77796f; font-size: 15px; line-height: 1.45; }
.practice-example-romaji { color: #3e493b; font-weight: 650; }
.practice-example-hiragana { color: #77796f; font-size: 14px; }
.practice-example-translation { color: #77796f; font-size: 14px; }
.word-translation-popup { position: fixed; z-index: 1000; width: max-content; max-width: min(320px, calc(100vw - 20px)); padding: 7px 10px; border: 1px solid #d9ddd3; border-radius: 8px; background: #263127; box-shadow: 0 4px 14px #20211f2b; color: #fff; font-size: 13px; font-weight: 550; line-height: 1.35; text-align: center; white-space: normal; overflow-wrap: anywhere; transform: translate(-50%, -100%); pointer-events: none; }
.word-translation-popup[hidden] { display: none; }
.word-translation-line + .word-translation-line { border-top: 1px solid #ffffff30; margin-top: 5px; padding-top: 5px; }
@media (hover: none) { .word-translation-popup { pointer-events: auto; } }
@keyframes reveal-blip { 0% { background-color: #dcebd6; } 42% { background-color: #edf5e9; } 100% { background-color: #dcebd6; } }
@keyframes answer-appear { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes card-out { to { opacity: 0; transform: translateX(-16px) scale(.985); } }
@keyframes card-in { from { opacity: 0; transform: translateX(16px) scale(.985); } to { opacity: 1; transform: translateX(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .flashcard-inner { transition: none; } .flashcard.is-confirming-correct { animation: none; } }
@keyframes swipe-enter-from-left { from { transform: translate3d(-24%, 0, 0) rotate(-4deg); } to { transform: translate3d(0, 0, 0) rotate(0); } }
@keyframes swipe-enter-from-right { from { transform: translate3d(24%, 0, 0) rotate(4deg); } to { transform: translate3d(0, 0, 0) rotate(0); } }
@keyframes denied-jitter { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes reveal-needed-blink { 0%, 100% { color: #a64e47; text-shadow: none; } 50% { color: #c52d27; text-shadow: 0 0 7px #cf473d66; } }
.session-progress { width: 100%; margin-top: 18px; }
.progress-track { height: 34px; position: relative; }
.progress-line, .progress-fill, .progress-review-fill { height: 2px; left: 4px; position: absolute; top: 16px; }
.progress-line { background: #deded5; right: 4px; }
.progress-review-fill { background: #b9c8af; transition: left .25s ease, width .25s ease; }
.progress-fill { background: #68745f; transition: width .25s ease; }
.progress-points { inset: 0 4px; position: absolute; }
.progress-point { appearance: none; background: transparent; border: 0; border-radius: 50%; cursor: pointer; height: 26px; padding: 0; position: absolute; top: 4px; transform: translateX(-50%); width: 26px; }
.progress-point::before { content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%); border: 2px solid #c9cabf; border-radius: 50%; background: #f7f6f2; transition: width .18s ease, height .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.progress-point.is-reached::before { background: #68745f; border-color: #68745f; }
.progress-point.is-review-range::before { background: #b9c8af; border-color: #aebba4; }
.progress-point.is-current::before { width: 15px; height: 15px; box-shadow: 0 0 0 3px #dcebd6; }
.progress-point.is-guessing::before { width: 17px; height: 17px; background: #30392f; border-color: #fff; box-shadow: 0 0 0 3px #aebba4, 0 0 0 5px #dcebd6; }
.progress-point.is-reviewing::before { background: #68745f; border-color: #68745f; box-shadow: 0 0 0 3px #f0ddc9; }
.progress-point:not(:disabled):hover::before { background: #9aa68f; border-color: #68745f; }
.progress-point.is-review-range:not(:disabled):hover::before { background: #b9c8af; border-color: #aebba4; }
.progress-point.is-guessing:hover::before { background: #30392f; border-color: #fff; }
.progress-point:disabled { cursor: default; }
.progress-point:focus-visible { outline: 3px solid #797d6450; outline-offset: 3px; }
.progress-current-marker { position: absolute; top: -8px; z-index: 1; transform: translateX(-50%); color: #30392f; font-size: 10px; font-weight: 750; letter-spacing: .04em; line-height: 1; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.cards-remaining { color: #77796f; font-size: 13px; margin: 10px 0 0; text-align: center; }

.deck-screen { display: flex; flex-direction: column; }
#deck-screen { padding-top: 16px; }
#deck-screen > .screen-header { position: sticky; top: 0; z-index: 5; flex-shrink: 0; padding: 12px 0; background: #f7f6f2; box-shadow: 0 1px 0 #e3e2d9; }
.deck-list-content { display: flex; flex: 1; flex-direction: column; width: min(100%, 700px); min-height: 0; margin: 0 auto; padding-top: 24px; }
.deck-list-content h1 { font-size: clamp(28px, 5vw, 36px); }
.default-decks-description { color: #65675f; line-height: 1.55; margin: 12px 0 0; }
.default-decks-source { color: #77796f; line-height: 1.5; margin: 16px 0 0; }
.about-content p { color: #77796f; font-size: 15px; line-height: 1.55; margin: 16px 0 0; }
.about-content p a { color: #485143; font-weight: 650; text-underline-offset: 2px; }
.native-app .web-shortcut-hint { display: none; }
.native-app .deck-entry-hints { display: none; }
.default-decks-source a { color: #485143; font-weight: 650; text-underline-offset: 2px; }
.default-decks-status { min-height: 0; margin: 4px 0 0; }
.default-deck-list { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; margin-top: 6px; padding: 2px 8px 20px 2px; }
.default-deck-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 70px; padding: 14px 16px; border: 1px solid #e3e2d9; border-radius: 13px; background: #fff; color: #30392f; text-align: left; box-shadow: 0 3px 12px #20211f08; }
.own-deck-option { justify-content: flex-start; border-color: #c8c9bd; background: #f0f0eb; font-weight: 650; box-shadow: 0 3px 12px #20211f08; }
.own-deck-option:hover:not(:disabled) { background: #e7e8e1; }
.default-deck-option:hover:not(:disabled) { background: #f0f1eb; border-color: #c8c9bd; }
.default-deck-option:focus-visible { outline: 3px solid #797d6450; outline-offset: 2px; }
.default-deck-option:disabled { cursor: progress; opacity: .65; }
.default-deck-option strong { font-size: 15px; }
.default-deck-option span { color: #77796f; font-size: 13px; white-space: nowrap; }
.default-deck-list .default-deck-retry { align-self: flex-start; flex: 0 0 auto; width: max-content; min-width: 120px; min-height: 44px; border-color: #deded5; background: #fff; color: #485143; white-space: nowrap; }
.default-deck-list .default-deck-retry:hover { border-color: #c8c9bd; background: #f0f1eb; }
.default-deck-confirmation { width: min(100%, 460px); }
.default-deck-confirm-actions { display: flex; gap: 10px; margin-top: 22px; }
.default-deck-confirm-actions > button { flex: 1; min-width: 0; }
.default-deck-confirm-actions > button:disabled { cursor: wait; opacity: .65; }
.default-deck-confirm-status { min-height: 20px; margin: 12px 0 0; color: #77796f; font-size: 13px; line-height: 1.5; }
.word-list { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; margin-top: 22px; padding: 2px 8px 20px 2px; }
.deck-add-heading { margin: 24px 0 -10px; color: #485143; font-size: 17px; }
.word-row { display: grid; flex: 0 0 auto; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: stretch; gap: 12px; border: 1px solid #e3e2d9; border-radius: 13px; background: #fff; padding: 12px; }
.word-row.is-updated { animation: edited-entry-blip 2s ease-in both; }
@supports (animation-timing-function: linear(0, 1)) {
  .word-row.is-updated { animation-timing-function: linear(0 0%, .015 10%, .047 25%, .106 40%, .201 60%, .466 80%, .687 90%, 1 100%); }
}
@keyframes edited-entry-blip { 0% { background: #dcebd6; border-color: #94aa8b; } 100% { background: #fff; border-color: #e3e2d9; } }
.remove-word-button { align-self: center; width: 34px; height: 34px; border: 1px solid #ead5d2; border-radius: 50%; background: #fff8f7; color: #a93e38; font-size: 21px; line-height: 1; }
.remove-word-button:hover { background: #fbe9e7; border-color: #d8aaa5; }
.remove-word-button:focus-visible { outline: 3px solid #a93e3850; outline-offset: 2px; }
.edit-word-button { align-self: center; min-height: 34px; padding: 0 12px; border: 1px solid #deded5; border-radius: 999px; background: #fff; color: #485143; font-size: 13px; font-weight: 650; }
.edit-word-button:hover { background: #f0f1eb; border-color: #c8c9bd; }
.edit-word-button:focus-visible { outline: 3px solid #797d6450; outline-offset: 2px; }
.word-details { min-width: 0; padding-top: 1px; }
.deck-search-match { background: #f3df9b; color: inherit; border-radius: 2px; padding: 0; }
.word-details strong { display: block; color: #30392f; font-size: 16px; overflow-wrap: anywhere; }
.word-details .hiragana-subtext { font-size: 14px; margin-top: 2px; }
.word-details p { color: #65675f; font-size: 14px; line-height: 1.5; margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.deck-entry-fields { display: flex; flex-direction: column; gap: 8px; }
.deck-entry-fields input { min-width: 0; padding: 9px 11px; }
.deck-entry-meanings { display: flex; flex-direction: column; gap: 12px; }
.deck-entry-meaning-group { display: flex; flex-direction: column; gap: 7px; }
.deck-entry-meaning-control { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; }
.deck-entry-example-fields { display: flex; flex-direction: column; gap: 6px; padding-left: 12px; border-left: 2px solid #e8e9e1; }
.deck-entry-example-fields input { padding: 8px 10px; font-size: 13px; }
.deck-entry-spacer { width: 34px; }
.deck-entry-row { grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; border-style: dashed; border-color: #d8ddcf; background: #fbfcf9; }
.deck-entry-meaning-row { display: block; }
.deck-entry-actions { display: flex; gap: 8px; }
.deck-entry-action-group { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: stretch; gap: 5px; }
.deck-entry-actions button { width: 100%; min-width: 0; min-height: 42px; padding: 10px 12px; font-size: 13px; }
.deck-entry-actions .deck-add-meaning { border-color: #deded8; background: #f4f4f0; color: #65665f; }
.deck-entry-actions .deck-add-meaning:hover { border-color: #d2d2ca; background: #ecece6; }
.deck-add-card { width: auto; }
.deck-action-hint { color: #85867e; font-size: 11px; line-height: 1.35; text-align: center; }
.deck-entry-hints { display: flex; flex-direction: column; align-self: start; gap: 5px; color: #77796f; font-size: 11px; line-height: 1.3; }
.deck-entry-hints[hidden] { display: none; }
.deck-entry-hints span { white-space: nowrap; }
.deck-entry-hints kbd { display: inline-block; min-width: 39px; margin-right: 4px; padding: 2px 5px; border: 1px solid #deded5; border-radius: 5px; background: #fff; color: #53554e; font: inherit; font-weight: 650; text-align: center; }
.empty-word-list { color: #85867e; line-height: 1.5; text-align: center; padding: 35px 15px; }
.spelling-suggestions { width: min(100%, 570px); margin: 22px auto; padding: 18px; border: 1px solid #e3e2d9; border-radius: 14px; background: #fbfcf9; }
.spelling-suggestions h3 { margin: 0 0 12px; font-size: 17px; }
.spelling-suggestions ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.spelling-suggestion { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; width: 100%; padding: 10px 12px; text-align: left; background: #fff; color: #30392f; border: 1px solid #deded5; border-radius: 9px; cursor: pointer; }
.spelling-suggestion span { color: #696c62; font-size: 14px; }
.spelling-suggestion:hover, .spelling-suggestion:focus-visible { background: #edf1e8; border-color: #8b9781; }

.card-form { width: min(100%, 460px); margin: auto; display: flex; flex-direction: column; }
.add-deck-search { width: min(100%, 460px); margin: 28px auto 0; }
.add-deck-search h2 { font-size: 20px; }
.add-deck-matches { max-height: 360px; overflow-y: auto; margin-top: 14px; }
.add-deck-match { padding: 12px; margin-bottom: 8px; border: 1px solid #e3e2d9; border-radius: 13px; background: #fff; }
.overwrite-dialog { width: min(calc(100% - 32px), 430px); max-height: calc(100% - 32px); padding: 28px; border: 1px solid #deded5; border-radius: 20px; background: #fbfcf9; color: #30392f; box-shadow: 0 20px 70px #20211f40; }
.overwrite-dialog::backdrop { background: #202a2466; backdrop-filter: blur(3px); }
.overwrite-dialog h2 { margin: 0 0 14px; font-size: 26px; }
.overwrite-dialog p { line-height: 1.5; }
.overwrite-word { padding: 12px; border-radius: 10px; background: #edf1e8; font-weight: 650; overflow-wrap: anywhere; }
.overwrite-dialog .form-actions { margin-top: 22px; }
.card-form .eyebrow { margin-bottom: 12px; }
.card-form h1 { font-size: 34px; margin-bottom: 32px; }
.card-form input { margin-bottom: 22px; }
.english-meanings { display: flex; flex-direction: column; gap: 14px; }
.meaning-entry-group { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid #ecebe4; }
.meaning-entry-group > input { margin-bottom: 0; }
.meaning-example-fields { display: flex; flex-direction: column; gap: 7px; padding-left: 12px; border-left: 2px solid #e8e9e1; }
.meaning-example-fields input { margin-bottom: 0; }
.meaning-tab-hint { align-self: flex-end; margin: 8px 0 12px; color: #85867e; font-size: 12px; text-align: right; }
.enter-hint { align-self: center; margin: 8px 0 16px; color: #85867e; font-size: 12px; text-align: center; }
.form-actions { display: flex; gap: 10px; }
.form-actions .primary-button { flex: 1; width: auto; }
.secondary-button { flex: 1; min-height: 50px; padding: 14px 20px; border: 1px solid #ead5d2; border-radius: 10px; background: #fff8f7; color: #a93e38; font-weight: 650; }
.secondary-button:hover { background: #fbe9e7; border-color: #d8aaa5; }
.secondary-button:focus-visible { outline: 3px solid #a93e3850; outline-offset: 2px; }
.back-to-learning-button { align-self: center; margin-top: 14px; }
.add-feedback { position: fixed; z-index: 10; top: 18px; left: 50%; width: min(calc(100% - 32px), 460px); margin: 0; padding: 12px 16px; transform: translateX(-50%); border: 1px solid #bfd0b7; border-radius: 12px; background: #e7f0e2; color: #354b32; box-shadow: 0 6px 20px #20211f18; font-size: 14px; font-weight: 650; text-align: center; }
.add-feedback.is-visible { animation: add-feedback-in 180ms ease-out both; }
@keyframes add-feedback-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

.clear-screen { display: grid; place-items: center; }
.clear-confirmation { width: min(100%, 430px); text-align: center; }
.clear-confirmation h1 { font-size: clamp(30px, 6vw, 38px); }
.clear-description { color: #65675f; line-height: 1.6; margin: 18px 0 0; }
.clear-warning { color: #a3483f; font-size: 14px; font-weight: 600; margin: 10px 0 26px; }
.danger-button { width: 100%; min-height: 50px; padding: 14px 20px; border: 0; border-radius: 10px; background: #a93e38; color: #fff; font-weight: 650; }
.danger-button:hover { background: #8f302c; }
.danger-button:focus-visible { outline: 3px solid #a93e3850; outline-offset: 3px; }
.cancel-clear { display: block; margin: 14px auto 0; }

.settings-options { display: grid; gap: 12px; margin-top: 28px; }
.settings-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 20px; border: 1px solid #dedfd5; border-radius: 12px; background: #fff; color: #353b30; text-align: left; font-weight: 650; }
.settings-option:hover { background: #f0f2eb; }
.export-confirmation { text-align: left; }
.export-confirmation h1 { text-align: center; margin-bottom: 28px; }
.export-confirmation input { width: 100%; min-height: 48px; padding: 12px; border: 1px solid #cdd0c2; border-radius: 10px; font: inherit; }
.export-destination { line-height: 1.5; color: #65675f; overflow-wrap: anywhere; margin: 8px 0; }
.export-confirmation .primary-button { width: 100%; margin-top: 16px; }
button:disabled { cursor: wait; opacity: .6; }
.flashcard:disabled { cursor: default; opacity: 1; }

@media (max-width: 520px) {
  .language-panel { padding: 34px 23px 25px; border-radius: 20px; }
  .language-decoration-one { top: 4%; left: -10%; }
  .language-decoration-two { right: -9%; bottom: 2%; }
  .screen { padding: 22px max(22px, env(safe-area-inset-right)) 22px max(22px, env(safe-area-inset-left)); }
  .deck-entry-row { grid-template-columns: minmax(0, 1fr); }
  .deck-entry-actions { flex-direction: column; }
  .deck-entry-spacer { display: none; }
  .deck-entry-meaning-control { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .deck-entry-hints { flex-direction: row; flex-wrap: wrap; gap: 5px 12px; }
  .deck-actions { right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); }
  .deck-management-actions { right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); }
  .language-back-button { left: max(20px, env(safe-area-inset-left)); bottom: max(24px, env(safe-area-inset-bottom)); }
  .add-button, .deck-tools-button { width: 54px; height: 54px; }
  .deck-button { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .flashcard { min-height: 250px; }
  .progress-point { width: 18px; height: 18px; top: 8px; }
  .progress-point::before { width: 9px; height: 9px; }
  .progress-point.is-current::before { width: 12px; height: 12px; }
  .progress-point.is-guessing::before { width: 14px; height: 14px; }
  .progress-current-marker { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .language-gate, .language-option, .loading-fill, .app-shell.is-entering-app, .app-shell.is-leaving-app { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  ::view-transition-new(root) { animation-delay: 0ms !important; }
}

.export-destination-label { margin-top: 24px; }

.screen.is-export-success { animation: export-success-blink 360ms ease-out both; }
.screen.is-export-leaving { animation: export-screen-out 200ms ease-in both; pointer-events: none; }
.home-screen.is-export-returning, #deck-screen.is-export-returning { animation: export-screen-in 240ms ease-out both; pointer-events: none; }
.export-toast { position: fixed; z-index: 20; top: max(24px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 40px); padding: 16px 20px; border: 1px solid #bdd2b4; border-radius: 14px; background: #e7f2e2; color: #354b32; box-shadow: 0 8px 24px #20211f18; pointer-events: none; animation: export-toast-in 180ms ease-out both; }
.export-toast svg { width: 24px; height: 24px; flex: none; fill: none; stroke: #45733b; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.export-toast strong { font-size: 16px; }
.export-toast p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
@keyframes export-success-blink { 0%, 100% { background: transparent; } 40% { background: #e2efdc; } }
@keyframes export-screen-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes export-screen-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes export-toast-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.example-status {
  margin: 0.35rem 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #615d57;
}

.example-status.is-warning {
  color: #b42318;
  font-weight: 600;
  animation: example-warning-blink 0.8s ease-in-out 3;
}

.example-romaji-control { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.example-romaji-control input { flex: 1; min-width: 0; width: 0; margin-bottom: 0; }
.example-navigation { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; gap: 3px; }
.example-navigation-buttons { display: flex; gap: 4px; }
.example-english-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.example-english-control input { flex: 1; min-width: 0; width: 0; }
.example-counter { box-sizing: border-box; flex: 0 0 auto; width: 72px; color: #65675f; font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; line-height: 1; text-align: center; }
.example-previous-button, .example-next-button { display: grid; place-items: center; flex: 0 0 34px; width: 34px; min-width: 34px; min-height: 34px; padding: 0; border: 1px solid #cdd0c2; border-radius: 8px; background: #f3f5ef; color: #465242; }
.example-navigation-icon { display: block; width: 18px; height: 18px; }
.example-previous-button:hover:not(:disabled), .example-next-button:hover:not(:disabled) { background: #e8eddf; }
.example-previous-button:focus-visible, .example-next-button:focus-visible { outline: 3px solid #a93e3850; outline-offset: 2px; }
.example-previous-button:disabled, .example-next-button:disabled { cursor: default; }

.example-fields-locked {
  cursor: not-allowed;
  border-radius: 8px;
}

.example-fields-locked input:disabled {
  pointer-events: none;
  opacity: 0.55;
}

.example-fields-locked .example-previous-button:disabled, .example-fields-locked .example-next-button:disabled { opacity: 0.55; }

.example-fields-locked:focus-visible {
  outline: 2px solid #b42318;
  outline-offset: 3px;
}

@keyframes example-warning-blink {
  50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
  .example-status.is-warning { animation: none; }
}
