/* A separate scrolling explanation keeps the mobile question in place. */
.explanation-sheet:not([open]){display:none}
.explanation-sheet[open]{
  position:fixed;inset:auto 0 0;margin:0 auto;padding:0;
  width:100%;max-width:740px;height:72vh;height:72dvh;
  max-height:calc(100vh - env(safe-area-inset-top,0px) - 12px);
  max-height:calc(100dvh - env(safe-area-inset-top,0px) - 12px);
  display:grid;grid-template-rows:24px auto minmax(0,1fr) auto;
  border:1px solid var(--line);border-bottom:0;border-radius:22px 22px 0 0;
  background:var(--panel,#fff);color:var(--ink);overflow:hidden;
  box-shadow:0 -12px 48px #18342b26;overscroll-behavior:contain;
}
.explanation-sheet::backdrop{background:#152f2738}
.explanation-sheet[open].is-expanded{height:94vh;height:94dvh}
.explanation-sheet-handle{
  width:100%;height:24px;padding:0;border:0;background:transparent;
  display:grid;place-items:center;cursor:ns-resize;touch-action:manipulation;
}
.explanation-sheet-grip{height:4px;width:38px;border-radius:99px;background:#cbd4cc}
.explanation-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px 12px 20px;border-bottom:1px solid var(--line)}
.explanation-sheet-heading{display:flex;align-items:center;gap:10px;min-width:0;flex-wrap:wrap}
.explanation-sheet-heading h2{font-size:17px;line-height:1.5;margin:0;font-weight:750}
.explanation-sheet-type{font-size:11px;color:var(--muted);background:var(--bg);padding:3px 7px;border-radius:6px}
.explanation-sheet-dismiss{width:42px;height:42px;flex:none;border:1px solid var(--line);background:#fff;border-radius:50%;color:var(--muted);font-size:27px;line-height:1}
.explanation-sheet-body{min-height:0;overflow-y:auto;overflow-x:hidden;padding:20px 20px 28px;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.explanation-sheet-body:focus-visible{outline-offset:-4px}
.explanation-sheet-body .result{margin:0 0 12px;font-size:19px}
.explanation-sheet-selected{font-size:13px;line-height:1.7;color:var(--wrong);margin:0 0 17px;white-space:pre-line;overflow-wrap:anywhere;word-break:keep-all}
.explanation-sheet-body .explanation-content{font-size:14px;line-height:1.9}
.explanation-sheet-body .answer-line{font-size:15px;line-height:1.9}
.explanation-sheet-body .wrong-title{font-size:14px}
.explanation-sheet-body .source-note{font-size:11px;margin-top:24px}
.explanation-sheet-footer{display:flex;gap:9px;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line);background:#fff}
.explanation-sheet-footer button{flex:1;min-height:46px;padding:11px 10px;font-size:13px}
@media(min-width:741px){.explanation-sheet[open]{display:none}}
