/* Visible LEFT Android reference: Figma 136:8158 / 136:8195.
   The browser supplies OS chrome and keyboards. Only the ink region widens. */
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
.app{position:fixed;inset:var(--keyboard-top,0px) 0 auto;width:100%;height:var(--keyboard-height,100dvh);min-height:0;max-height:none;overflow:hidden}
.app-header{min-height:74px;padding:14px 24px;justify-content:flex-start;gap:20px;flex-shrink:0}
.nav-decks{font-size:16px;letter-spacing:0;gap:6px;min-height:44px;flex-shrink:0;color:var(--blue)}
.nav-decks svg{width:18px;height:18px}
.cloud-save{display:inline-flex;align-items:center;gap:6px;font-size:16px;color:var(--secondary);margin-left:auto;flex-shrink:0}
.cloud-save svg,.cloud-save .spinner{width:16px;height:16px}.cloud-save.saved{color:var(--green-edge)}.cloud-save.error{color:var(--amber)}
.content{min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable;padding:24px}
.menu-title-row{display:flex;justify-content:space-between;align-items:center;gap:20px}.menu-title-row .title{margin-bottom:12px}.copy-sync-settings p{margin-top:8px}
.deck-head,.deck-meta,.tag,.selection-detail,.menu-footer,.subtle-link,.button.small,.settings-wrap .small-note,.section-heading{font-size:16px}
.deck-title{font-size:16px;line-height:1.4}.count{font-size:18px}.setting-copy strong,.theme-choice,.connection-key{font-size:16px}.connection-key input{font-size:16px}.notice,.notice p,.reason-popup,.notice .button{font-size:16px}
.button.small,.subtle-link,.notice .button{min-height:44px}.demo-banner,.demo-banner button{font-size:16px}.demo-banner{flex-shrink:0}.demo-banner button{min-height:44px}
.notice>div{min-width:0}.notice strong,.notice p{overflow-wrap:anywhere}.settings-wrap{max-width:600px}.settings-bottom{flex-wrap:wrap}.settings-bottom .primary{min-height:52px}.theme-choice{min-height:44px}.setting-copy,.connection-key{min-width:0;overflow-wrap:anywhere}

/* Preferences and terminal states use the same bounded action column. */
.settings-mode .content{padding:24px 48px 20px}.settings-mode .settings-wrap{max-width:504px;min-width:0}
.settings-mode .title{font-size:24px;line-height:1.25;font-weight:800}.settings-mode .button,.settings-mode .primary{font-size:16px;min-height:44px}
.settings-mode .switch{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;background:transparent}
.settings-mode .switch::before{content:'';position:absolute;inset:9px 0;background:var(--line);border-radius:30px}.settings-mode .switch[aria-checked=true]::before{background:var(--green)}
.settings-mode .switch::after{top:12px}.settings-mode .switch[aria-checked=true]{background:transparent}
.app-actions{position:relative;z-index:10;flex:0 0 auto;width:100%;border:0;background:var(--paper);padding:16px 48px max(16px,env(safe-area-inset-bottom))}
.app-actions .review-bottom-inner{width:100%;max-width:504px;min-width:0;margin-inline:auto}.app-actions .primary{width:100%;min-height:54px;font-size:16px}
.app-actions .connection-actions{margin:0;gap:12px}.app-actions .connection-actions .primary{flex:1}.app-actions .button{font-size:16px;min-height:44px}

/* The normal review column is fluid up to 600px, without scaling its type. */
.app.review-mode,.app.settings-mode{max-width:600px;container-name:review;container-type:size}
:is(.review-mode,.settings-mode) .review-header{height:auto;min-height:76px;border:0;padding:16px 24px}
.review-header-inner{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;width:100%;max-width:552px;margin-inline:auto;gap:8px}
.review-header-left,.review-header-right{display:flex;align-items:center;gap:8px;min-width:0;flex-shrink:0}.review-header-right{justify-self:end}
.review-header .button,.review-header .nav-decks{min-height:44px;padding:10px 12px;border:0;border-radius:12px;font-size:16px;font-weight:700;gap:6px;white-space:nowrap}
.review-header .nav-decks{background:var(--soft);color:var(--secondary)}.review-header .button svg{width:18px;height:18px}
.header-counts{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;min-width:0;gap:4px 7px;font-size:16px;font-weight:750;font-variant-numeric:tabular-nums}
.header-count{white-space:nowrap}.header-count.new{color:var(--blue)}.header-count.learn{color:var(--red)}.header-count.due{color:var(--green-edge)}.count-separator{color:var(--secondary);font-size:16px;font-weight:400}
.review-save-state{display:grid;place-items:center;flex-shrink:0;color:var(--secondary)}.review-save-state.error{color:var(--amber)}.review-save-state svg,.review-save-state .spinner{width:16px;height:16px}
.review-mode .review-content{padding:24px 48px 20px}
.review-mode .content-inner{max-width:none;width:100%;min-width:0;min-height:100%;margin:0;display:flex;flex-direction:column}
.review-mode .review-layout,.review-mode.writing-result .review-layout{display:flex;flex-direction:column;align-items:stretch;gap:0;max-width:none;width:100%;margin:0;flex:1 0 auto;min-height:0;min-width:0}
.review-question{flex:0 0 auto;min-width:0}.review-mode .title{font-size:24px;font-weight:800;line-height:1.25;letter-spacing:-.5px;margin:0;overflow-wrap:anywhere}
.review-mode .task-box,.review-mode .task-box.large{margin:26px 0 0;padding:20px 18px;min-height:84px;border:2px solid var(--line);border-radius:20px}
.review-mode .task-box:has(.task-audio){padding-right:58px}
.review-mode .prompt,.review-mode .large .prompt{font:750 24px/1.45 'SF Pro Rounded','SF Pro Display',-apple-system,BlinkMacSystemFont,'Hiragino Sans',sans-serif;white-space:pre-line;overflow-wrap:anywhere}
.review-mode .prompt-reading{font-size:20px;line-height:1.5;margin-top:10px;overflow-wrap:anywhere}
.review-mode .task-audio{top:12px;right:10px}
.review-response{margin-top:auto;padding-top:24px;min-width:0}.answer-phase .review-response{margin-top:0;padding-top:20px}
.response-controls{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px;min-width:0}
.response-controls .input-modes,.response-controls .answer-forms{padding:3px;gap:3px;max-width:100%;flex-wrap:wrap}
.response-controls button{min-height:44px;padding:8px;font-size:16px}
.review-mode .answer-field{margin:0;min-width:0}.review-mode .answer-input{min-height:64px;max-height:144px;resize:none;border:2px solid var(--blue-edge);border-radius:15px;padding:16px 54px 16px 16px;font-size:20px;line-height:1.4}
.review-mode .answer-input::placeholder{font-size:16px}
.review-mode .field-clear{width:44px;height:44px;min-height:44px;right:7px;top:8px;border:1px solid var(--line);border-radius:10px}
.review-mode .field-label{display:block;font-size:16px;margin-bottom:8px}
.review-mode .feedback{position:relative;background:var(--soft);border:0;border-radius:24px;padding:24px;margin:0;min-width:0}
.review-mode .feedback-label{font-size:16px;line-height:1.3;font-weight:750;letter-spacing:0;text-transform:uppercase;margin-bottom:12px}
.answer-main-row,.example-main{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-width:0}
.review-mode .answer-main{font-size:32px;font-weight:800;line-height:1.4;min-width:0;overflow-wrap:anywhere}
.review-mode .answer-reading{font-size:20px;line-height:1.5;margin-top:12px;overflow-wrap:anywhere}
.answer-audio{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;min-height:44px;border:0;background:transparent;color:var(--blue);border-radius:10px;padding:10px}
.answer-audio svg{width:24px;height:24px}.review-mode .reference-body{font-size:20px;line-height:1.6;overflow-wrap:anywhere}.review-mode .reference-strokes{font-size:16px;color:var(--secondary);margin-top:10px}
.review-mode .example{margin-top:22px;padding-top:18px;font-size:20px;line-height:1.6}.example-main p{min-width:0;overflow-wrap:anywhere}.review-mode .example-translation{font-size:16px;line-height:1.6;color:var(--secondary);margin-top:10px}
.review-mode .typed-check{margin:0 0 18px;padding:0 0 18px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}
.review-mode .typed-check-header strong,.review-mode .typed-check-header>span,.review-mode .type-row-label{font-size:16px}.review-mode .type-answer-row>div{font-size:20px}.review-mode .set-check-summary,.review-mode .small-note{font-size:16px}
.review-mode .typed-check.compact-reference{margin:0 0 16px;padding:0;border:0}.type-submitted-answer,.type-submitted-set{font-size:20px;line-height:1.7;overflow-wrap:anywhere}.type-submitted-set{margin:6px 0 0;padding-left:26px}.type-submitted-set>li+li{margin-top:6px}
.type-submitted-answer>.type-good,.type-submitted-answer>.type-bad,.type-submitted-answer>.type-gap,.type-submitted-set .type-good,.type-submitted-set .type-bad,.type-submitted-set .type-gap,.reference-match{padding:2px;border-radius:2px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.review-mode .review-tools{margin:12px 0 0;padding:0;border:0;justify-content:flex-end}.review-mode .review-tools .subtle-link{min-height:44px;font-size:16px;padding:10px 0}

/* The footer is the final sibling of the scroll body, never part of its flow. */
.review-mode .review-bottom{position:relative;z-index:10;flex:0 0 auto;width:100%;border:0;background:var(--paper);padding:16px 48px max(16px,env(safe-area-inset-bottom))}
.review-mode .review-bottom-inner{width:100%;max-width:504px;margin-inline:auto;min-width:0}.review-mode .review-bottom .primary{min-height:54px;font-size:16px}
.review-mode .ratings{display:flex;flex-direction:column;gap:12px;margin:0}
.secondary-ratings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.secondary-ratings.rating-count-1{grid-template-columns:1fr}.secondary-ratings.rating-count-2{grid-template-columns:repeat(2,minmax(0,1fr))}.secondary-ratings.rating-count-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.review-mode .rating{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;width:100%;min-width:0;min-height:48px;padding:10px 8px;border:2px solid var(--line);border-radius:16px;font-size:16px;font-weight:750;line-height:1.2}
.review-mode .rating.good{min-height:54px;border:0;border-bottom:4px solid var(--green-edge);background:var(--green)}.review-mode .rating small{font-size:16px;line-height:1.2;margin:0}
.review-mode .history-banner{font-size:16px;margin-bottom:18px;min-width:0;flex-wrap:wrap}.review-mode .history-navigation{flex-wrap:wrap}.review-mode .history-navigation .button{min-height:44px;font-size:16px}
.review-mode .dialogue-wrap{max-width:none;width:100%;min-width:0}.review-mode .dialogue-title{flex-wrap:wrap}.review-mode .dialogue-list{margin:26px 0}.review-mode .dialogue-ja{font-size:24px;overflow-wrap:anywhere}.review-mode .dialogue-ru{font-size:20px;overflow-wrap:anywhere}.review-mode .speaker{font-size:16px}.review-mode .replay{width:44px;height:44px;flex-shrink:0}

/* Handwriting keeps useful squares; the body scrolls instead of flattening them. */
.review-mode .handwriting-grid{grid-template-columns:repeat(auto-fit,minmax(128px,1fr));gap:12px;justify-items:center}
.review-mode .handwriting-cell{max-width:192px;height:auto;aspect-ratio:1}
.review-mode .handwriting-cell-number{display:none}
.review-mode .handwriting-cell-clear,.review-mode .kp-field-clear{width:44px;height:44px;min-height:44px;font-size:24px}
.review-mode .ink-tools{gap:14px;margin:10px 0 16px}.review-mode .ink-tools .button{min-height:44px;font-size:16px}
.review-mode .kp,.review-mode.writing-result .kp{display:block;font-size:16px}
.review-mode .kp-drawbox,.review-mode.writing-result .kp-drawbox{width:100%;max-width:300px;height:auto;aspect-ratio:1}
.review-mode .kp>.kp-reference{display:flex;max-width:300px;margin-inline:auto}.review-mode .kp-head,.review-mode .kp-options{font-size:16px}
.review-mode .kp-result{width:100%;max-width:504px;margin:18px auto 0}.review-mode .kp-tools button,.review-mode .kp-replay{min-height:44px;font-size:16px}
.review-mode .kp-metric span,.review-mode .kp-metric small,.review-mode .kp-head span,.review-mode .kp-candidates small{font-size:16px}
.review-mode .kp-metric strong{font-size:20px}.review-mode .kp-issues,.review-mode .kp-correction ul,.review-mode .kp-comparison,.review-mode .kp-correction h4,.review-mode .kp-comparison h4{font-size:16px}
.review-mode .kp-stroke-number-label{font-size:16px}.review-mode .kp-head,.review-mode .kp-tools,.review-mode .kp-options{max-width:300px;margin-inline:auto}.review-mode .kp-head{justify-content:flex-end}.review-mode .kp-head span{font-size:18px;font-weight:750}

.app.ipad-handwriting{max-width:1120px}.ipad-handwriting .review-content{padding:20px 48px}.ipad-handwriting .review-layout{max-width:1024px!important;margin-inline:auto}
.ipad-handwriting .review-question{display:block;width:100%;max-width:504px;margin-inline:auto}.ipad-handwriting .review-question .title{flex:none}.ipad-handwriting .task-box,.ipad-handwriting .task-box.large{margin:24px 0 0;min-height:84px}
.ipad-handwriting .review-response{margin-top:0;padding-top:24px}.ipad-handwriting .handwriting-grid{gap:16px}
.ipad-handwriting .review-response>.answer-field,.ipad-handwriting .review-response>.feedback{width:100%;max-width:504px;margin-inline:auto}
.ipad-handwriting .kp-drawbox,.ipad-handwriting.writing-result .kp-drawbox,.ipad-handwriting .kp-head,.ipad-handwriting .kp-tools,.ipad-handwriting .kp-options,.ipad-handwriting .kp>.kp-reference{max-width:360px}

/* Collapse labels and spacing based on the actual app container, not a device UA. */
@container review (max-width:500px){
  :is(.review-mode,.settings-mode) .review-header{padding-inline:16px}.review-header .header-back>span,.review-header .header-settings>span{display:none}
  .review-header .header-back,.review-header .header-settings{min-width:44px;width:44px;padding:12px}.review-header .nav-decks{padding:10px 12px}.review-header .nav-decks>svg{display:none}
  .review-header-left,.review-header-right{gap:6px}.review-header-inner{gap:6px}.header-counts{gap:4px 5px}
  .review-mode .review-content,.review-mode .review-bottom,.settings-mode .content,.settings-mode .review-bottom{padding-inline:24px}.review-mode .rating{font-size:16px;gap:5px}.secondary-ratings{gap:10px}.ipad-handwriting .handwriting-grid{gap:12px}
}
@container review (max-width:370px){
  :is(.review-mode,.settings-mode) .review-header{padding-inline:12px}.review-header-inner,.review-header-left,.review-header-right{gap:4px}.review-header .nav-decks{padding-inline:10px}.header-counts{gap:3px 4px}
  .review-mode .review-content,.review-mode .review-bottom,.settings-mode .content,.settings-mode .review-bottom{padding-inline:16px}.response-controls button{padding-inline:8px}.review-mode .feedback{padding:20px 16px}
}
.app[data-keyboard-open=true] .review-header,.app.settings-mode[data-keyboard-open=true] .app-header{height:auto;min-height:60px;padding-top:8px;padding-bottom:8px}.app[data-keyboard-open=true] .review-content,.app.settings-mode[data-keyboard-open=true] .content{padding-top:12px;padding-bottom:12px}.app[data-keyboard-open=true] .review-bottom{padding-top:10px;padding-bottom:max(10px,env(safe-area-inset-bottom))}

/* Template-specific values retained from the visible original designs. */
.review-mode .task-box.large{min-height:138px;display:flex;align-items:center;justify-content:center}
.review-mode .task-box.large .prompt{font-family:'Noto Serif JP','Hiragino Mincho ProN',serif;font-size:58px;font-weight:400;line-height:1.43;text-align:center}
.review-mode[data-card-kind="kanji-writing"] .prompt{font-size:22px}

/* Keep the drawing surface ahead of optional comparison controls. */
.handwriting-input-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;font-size:18px;min-width:0}
.handwriting-input-heading strong{font-size:18px}.handwriting-input-heading .button{font-size:16px;min-height:44px}
.ink-answer-forms{justify-content:flex-start}.review-mode.handwriting-mode .prompt{font-size:22px}
.sample-switch-short{display:none}
@container review (max-width:500px){.demo-banner{padding:0 16px;min-height:44px;gap:8px}.demo-banner strong{white-space:nowrap}.sample-switch-long{display:none}.sample-switch-short{display:inline}}

.empty-actions{display:flex;flex-direction:column;gap:12px}.empty-actions>.button{align-self:center}
