:root {
  color-scheme: light;
  --background: #f4f5f7;
  --surface: #fff;
  --ink: #252a34;
  --muted: #68717e;
  --accent: #252a34;
  --tint: #eceef2;
  --line: #e5e7ec;
  --card-shadow: 0 6px 24px #252a3404;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
p, h1, h2, h3 { margin: 0; }
.app-shell { max-width: 480px; height: 100svh; height: 100dvh; margin: auto; padding: max(22px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); display: flex; flex-direction: column; }
.header { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
.brand { font-size: 20px; font-weight: 750; letter-spacing: -.025em; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.help-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; padding: 8px; background: transparent; color: var(--muted); border-radius: 50%; }
.help-button svg { width: 28px; height: 28px; }
.home { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.home-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; padding: clamp(20px, 4svh, 40px) 2px 20px; }
.home-content:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.home h1 { font-size: clamp(34px, 10vw, 44px); line-height: 1.4; letter-spacing: -.035em; font-weight: 750; }
.home-lead { color: var(--muted); margin-top: 14px; font-size: 16px; line-height: 1.8; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 24px; }
.mode-button { min-height: 48px; padding: 10px 8px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 13px; font-weight: 650; line-height: 1.4; }
.mode-button[aria-pressed="true"] { color: white; background: var(--accent); border-color: var(--accent); }
.mode-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.session-card { margin-top: 16px; padding: 24px; background: var(--surface); border-radius: 24px; box-shadow: var(--card-shadow); }
.session-label { color: var(--muted); font-size: 14px; }
.session-size { font-size: 96px; font-weight: 700; letter-spacing: -.065em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.session-size span { margin-left: 12px; font-size: 23px; letter-spacing: 0; }
.session-caption { padding-top: 20px; margin-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.8; }
.resume-summary { margin-top: 18px; }
.resume-summary p { font-size: 14px; line-height: 1.8; color: var(--muted); }
.home-actions { display: grid; gap: 12px; }
.home-actions { flex-shrink: 0; padding-top: 16px; }
#start { position: relative; padding-inline: 38px; }
#start::after { content: ''; position: absolute; width: 20px; height: 20px; top: calc(50% - 10px); right: 20px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14m-6-6 6 6-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (max-width: 360px) { .brand { font-size: 18px; } .header-actions { gap: 4px; } }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; min-height: 44px; padding: 8px 6px; border-radius: 10px; }
.study { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.study-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; display: flex; flex-direction: column; scroll-padding-block: 12px; padding: 0 2px 2px; }
.study-card { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; min-height: 320px; margin-top: 24px; background: var(--surface); border-radius: 24px; padding: 24px; box-shadow: var(--card-shadow); }
.answer-open .study-card { justify-content: flex-start; }
.study-content:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.progress-section { position: relative; flex-shrink: 0; }
.progress-labels { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 7px; margin-top: 12px; appearance: none; border: 0; border-radius: 20px; overflow: hidden; background: var(--line); color: var(--accent); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 20px; transition: width .2s; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 20px; }
.review-note { margin-top: 12px; font-size: 13px; color: var(--accent); }
.word-section { flex-shrink: 0; text-align: center; padding-top: clamp(36px, 10svh, 84px); }
.answer-open .word-section { padding-top: 28px; }
#word { font: 700 clamp(32px, 11vw, 52px)/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.04em; overflow-wrap: anywhere; text-wrap: balance; }
.audio-button { min-width: 100px; min-height: 44px; padding: 10px 18px; margin-top: 24px; border: 0; border-radius: 24px; background: var(--tint); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; }
.audio-button svg { width: 21px; height: 21px; }
.pronunciation { margin-top: 12px; color: var(--muted); font-family: "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.audio-button[aria-busy="true"] { color: var(--ink); background: #dfe4eb; box-shadow: 0 0 0 3px var(--background); }
.recall-hint { display: grid; place-content: center; min-height: 122px; color: var(--muted); text-align: center; font-size: 14px; line-height: 1.8; padding: 32px 0 12px; margin-top: 36px; }
.answer { flex-shrink: 0; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 28px; animation: appear .18s ease-out; }
.part { font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.answer h2 { font-size: 23px; line-height: 1.65; font-weight: 650; letter-spacing: -.015em; }
.example { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
summary { cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; min-height: 44px; padding: 10px 28px 10px 0; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; position: absolute; right: 4px; top: 17px; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
details[open] > summary::after { transform: rotate(45deg); }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#example-en { font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow-wrap: anywhere; }
#example-ja { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.actions { flex-shrink: 0; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 24px; background: var(--background); }
.button { display: block; width: 100%; min-height: 60px; padding: 17px 12px; font-size: 16px; font-weight: 650; border: 1px solid transparent; border-radius: 16px; line-height: 1.45; transition: background .15s, transform .1s; }
.primary { color: white; background: var(--accent); }
.secondary { color: var(--ink); background: #e7e9ee; }
.button:active { transform: scale(.99); }
@media (hover: hover) { .primary:hover, .mode-button[aria-pressed="true"]:hover { background: #3c4350; } .secondary:hover, .audio-button:hover, .help-button:hover, .mode-button:hover { background: #dfe3ea; } .text-button:hover { color: var(--ink); background: var(--tint); } }
.rating-prompt { font-size: 13px; line-height: 1.7; text-align: center; margin-bottom: 16px; color: var(--muted); }
.rating-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rating-buttons .button { font-size: 13px; padding-inline: 6px; }
.complete { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.results { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; padding-top: clamp(24px, 4svh, 40px); margin-bottom: 24px; }
.results h1 { font-size: 34px; text-align: center; letter-spacing: -.02em; }
.complete-lead { color: var(--muted); font-size: 16px; text-align: center; margin-top: 14px; }
.stats { background: var(--surface); border-radius: 24px; margin: 32px 0 0; padding: 12px 24px; box-shadow: var(--card-shadow); }
.stats div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 15px 0; }
.stats div + div { border-top: 1px solid var(--line); }
.stats dt { font-size: 16px; }
.stats dd { margin: 0; font-size: 34px; font-weight: 700; }
.stats small { font-size: 18px; margin-left: 3px; }
.remaining { margin-top: 24px; }
.remaining p { margin-top: 10px; color: var(--muted); font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.complete-actions { flex-shrink: 0; margin-top: auto; display: grid; gap: 8px; padding-top: 16px; }
.result-message { margin-top: 24px; color: var(--muted); font-size: 14px; line-height: 1.8; }
@media (max-height: 720px) { .results .stats { margin-top: 20px; padding: 8px 14px; } .results .stats div { padding: 8px 0; } }
.notice { flex-shrink: 0; max-height: 18dvh; overflow-y: auto; font-size: 13px; line-height: 1.7; color: var(--muted); }
.notice:not(:empty) { margin-bottom: 12px; padding: 10px 12px; background: var(--tint); border-radius: 8px; }
dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100svh - 48px); border: 1px solid var(--line); border-radius: 24px; padding: 24px; color: var(--ink); background: var(--surface); box-shadow: 0 16px 64px #252a3420; }
dialog::backdrop { background: #252a3460; backdrop-filter: blur(4px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-header h2 { font-size: 22px; }
.steps { margin: 20px 0; padding-left: 22px; }
.steps li, dialog p { font-size: 14px; line-height: 1.85; }
.steps li + li { margin-top: 8px; }
dialog h3 { font-size: 16px; margin: 22px 0 8px; }
.fine-print { color: var(--muted); margin-top: 24px; }
@media (max-height: 720px) { .header { margin-bottom: 16px; } .home-content { padding-top: 12px; } .home h1 { font-size: 34px; } .session-card { margin-top: 22px; padding: 20px; } .session-size { font-size: 72px; } .study-card { margin-top: 20px; min-height: 280px; } .word-section { padding-top: 24px; } .audio-button { margin-top: 18px; } .recall-hint { min-height: 76px; margin-top: 16px; } }
@media (max-height: 720px) { .answer-open .word-section { padding-top: 8px; } .answer-open #word { font-size: clamp(30px, 10vw, 42px); } .answer-open .audio-button { margin-top: 16px; } .answer { padding-top: 20px; margin-top: 20px; } }
@media (min-width: 700px) and (min-height: 600px) { body { background: #e9ecf1; } .app-shell { background: var(--background); height: min(880px, calc(100dvh - 64px)); margin: 32px auto; padding: 24px 28px 28px; border: 1px solid #e0e4ea; border-radius: 28px; box-shadow: 0 16px 60px #252a3408; } }
@media (max-height: 520px) { .app-shell { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom)); } .header { margin-bottom: 8px; } .actions { padding-top: 12px; } .rating-prompt { margin-bottom: 8px; } .study-card { min-height: 220px; margin-top: 16px; padding: 20px; } .word-section { padding-top: 8px; } .recall-hint { padding-top: 20px; margin-top: 0; min-height: 60px; } .notice:not(:empty) { margin-top: 8px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
