/* Compact writing shows references on demand without changing the pad's layout. */
#open-answer-drawer{position:absolute;right:max(6px,env(safe-area-inset-right));top:auto;bottom:4px;z-index:24;width:48px;min-height:48px;padding:6px;border:1px solid #b5c9d5;border-radius:10px 0 0 10px;background:#183747;color:#fff;font-size:12px;line-height:1.4;box-shadow:0 3px 12px #18374724;overflow-wrap:anywhere}
.answer-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(90vw,420px);max-width:calc(100vw - 24px);height:100dvh;max-height:100dvh;padding:0;border:0;border-left:1px solid #cbd8df;border-radius:16px 0 0 16px;overflow:hidden;background:#fff;color:#183747}
.answer-drawer[open]{display:flex;flex-direction:column}
.answer-drawer::backdrop{background:#132d3e66}
.answer-drawer .dialog-heading{flex:none;gap:8px;padding:max(10px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 8px 12px}
.answer-drawer .dialog-heading h2{font-size:18px}
.answer-drawer .dialog-heading button{min-width:44px;min-height:44px}
.answer-drawer-body{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:8px max(10px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) 10px;overflow-wrap:anywhere}
.answer-drawer #revealed-answer-card{padding:8px;border:0}
.answer-drawer #prompt-tools,.answer-drawer #comparison-details{color:#183747;background:#edf2f5;border:1px solid #d6e0e6;padding:0 10px;border-radius:8px;margin:8px 0}
.answer-drawer #prompt-tools-body{padding-bottom:10px}
.answer-drawer #comparison-details .contrast-panel>h3{color:#183747}
.has-compact-answer #exercise[data-answer-revealed=true] .prompt-panel>#meaning,.has-compact-answer #exercise[data-answer-revealed=true] .prompt-panel>#secondary-meaning{display:block}
.has-compact-answer #exercise[data-answer-revealed=true] .prompt-panel>#secondary-meaning:empty{display:none}
.has-compact-answer #exercise #answer-box{display:none}
.has-compact-answer #exercise[data-answer-revealed=true] .prompt-panel{display:block;min-height:52px;padding:8px 52px 8px 10px}
.has-compact-answer #exercise[data-answer-revealed=true] .prompt-top{position:absolute;right:6px;top:4px;margin:0;min-height:44px}
.has-compact-answer #exercise[data-answer-revealed=true] #prompt-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.has-compact-answer #exercise[data-answer-revealed=true] #meaning{font-size:26px;line-height:1.35;margin:2px 0;overflow-wrap:anywhere}
.has-compact-answer #exercise[data-answer-revealed=true] .study-layout{display:flex;flex-direction:column}

.answer-drawer #character-info,.answer-drawer #show-guide{display:none}
/* One information page on PC; the same sections become the compact right drawer. */
.answer-drawer[data-presentation=page]{inset:0;margin:auto;width:min(900px,calc(100vw - 40px));height:min(90dvh,1000px);max-height:90dvh;border:1px solid #cbd8df;border-radius:16px}
.unified-character-info{min-width:0}.unified-character-info .character-stroke-section{margin:16px 0;border:1px solid #d6e0e6;border-radius:10px;padding:12px}.unified-character-info .character-stroke-section>h3{font-size:18px;margin:0 0 8px}
.unified-character-info .character-stroke-guide{min-width:0}.unified-character-info #guide-svg{width:min(100%,340px);max-height:40dvh;margin:8px auto}
.unified-character-info .source-note{overflow-wrap:anywhere}.unified-character-info .knowledge-field{min-width:0}.unified-character-info .guide-step{min-height:0;font-size:14px}
.unified-practice-controls{display:flex;gap:8px;margin:8px 0}.unified-practice-controls #trace{min-height:44px;padding:6px 10px;border:1px solid #b8c9d4;border-radius:8px;background:#fff;color:#183747}
.answer-drawer #comparison-details{display:none}

.answer-drawer:not([data-current-practice=true]) #prompt-tools{display:none}

/* Fit the top-layer dialog to the visible viewport at CSS or pinch zoom.
   Flexible controls wrap inside the drawer instead of clipping beside their labels. */
.answer-drawer,.answer-drawer[data-presentation=page]{box-sizing:border-box;inset:auto;left:var(--drawer-left,auto);top:var(--drawer-top,0);margin:0;width:var(--drawer-width,min(90vw,420px));height:var(--drawer-height,100dvh);max-width:none;max-height:none}
.answer-drawer .dialog-heading{min-width:0}.answer-drawer .dialog-heading h2{min-width:0;overflow-wrap:anywhere}.answer-drawer .dialog-heading button{flex-shrink:0}
.answer-drawer-body{flex:1;min-width:0;scrollbar-gutter:auto}
.answer-drawer .guide-render-choice,.answer-drawer .ink-controls label{flex-wrap:wrap;min-width:0}
.answer-drawer select,.answer-drawer input,.answer-drawer button{box-sizing:border-box;max-width:100%;min-width:0}
.answer-drawer .guide-render-choice select{flex:1 1 100%;width:100%}
.answer-drawer .guide-controls,.answer-drawer .guide-options{flex-wrap:wrap;min-width:0}
.quick-answer-glyph{font-size:104px;line-height:1.3;text-align:center;color:#183747}
.quick-answer-reading{font-size:24px;font-weight:700;text-align:center;margin:8px 0 20px}
.quick-answer-tip{line-height:1.6;margin:6px 0 18px}
.quick-answer-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 20px}
.quick-answer-actions button{flex:1 1 120px;min-height:44px;white-space:normal}
.quick-answer-details{border-top:1px solid #d6e0e6;padding-top:12px}
.quick-answer-details>summary{cursor:pointer;min-height:44px;line-height:1.6}
.writing-difference .contrast-glyph{cursor:default}.difference-ink{margin:12px 0}.difference-ink figcaption{font-size:14px}.writing-difference>button{margin-top:12px}
.answer-drawer[data-section=quick] #unified-practice-controls,.answer-drawer[data-section=quick] #prompt-tools{display:none}
