.math-result-dialog { width: min(820px, calc(100vw - 32px)); max-height: min(88vh, 900px); border: 1px solid #405676; border-radius: 20px; background: #0c1727; padding: 0; color: #edf5ff; }
.math-result-dialog::backdrop { background: rgba(3, 8, 15, .78); backdrop-filter: blur(4px); }
.math-result-dialog > form { display: grid; max-height: inherit; grid-template-rows: auto auto minmax(0, 1fr); padding: 20px; }
.math-result-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.math-result-dialog-head small { color: #66ddbb; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.math-result-dialog-head h2 { margin: 5px 0 0; font-size: 24px; }
.math-result-dialog-head button { min-width: 72px; min-height: 44px; border: 1px solid #48617f; border-radius: 11px; background: #17283d; color: #fff; font: inherit; font-weight: 850; }
.math-result-dialog-status { min-height: 20px; margin: 10px 0; color: #95a9bf; font-size: 12px; }

.math-result-sheet { display: grid; gap: 12px; overflow: auto; padding-right: 4px; }
.math-result-sheet-context { margin: 0; color: #9fb1c7; font-size: 13px; }
.math-result-sheet-summary { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; border: 1px solid #365071; border-radius: 16px; background: linear-gradient(135deg, #122b4a, #123b39); padding: 17px; }
.math-result-sheet-summary > strong { color: #7cb1ff; font-size: 42px; }
.math-result-sheet-summary div { display: grid; gap: 4px; }
.math-result-sheet-summary span { color: #aabbd0; font-size: 12px; }
.math-result-sheet-reward { grid-column: 1 / -1; margin: 0; border-radius: 10px; background: #16483b; padding: 10px 12px; color: #83e4c3; font-size: 12px; font-weight: 900; }
.math-result-sheet-filters { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #3c5874; border-radius: 12px; padding: 3px; }
.math-result-sheet-filters button { min-height: 48px; border: 0; border-radius: 9px; background: transparent; color: #9cadc1; font: inherit; font-size: 14px; font-weight: 900; }
.math-result-sheet-filters button.is-active { border: 1px solid #7c70ff; background: #171e4a; color: #938aff; }
.math-result-sheet-weakness, .math-result-sheet-questions > article { border: 1px solid #344a65; border-radius: 14px; background: #101e30; padding: 14px; }
.math-result-sheet h3 { margin: 0 0 8px; font-size: 15px; }
.math-result-sheet-weakness p, .math-result-sheet-explanation { margin: 0; color: #b1c0d1; font-size: 12px; line-height: 1.6; }
.math-result-sheet .student-math-frac,.math-result-sheet-questions .student-math-frac{display:inline-grid;grid-template-rows:1fr 2px 1fr;grid-template-areas:"numerator" "fraction-bar" "denominator";align-items:center;min-width:1.5em;margin:0 .08em;vertical-align:middle;font-size:.78em;line-height:1;text-align:center;white-space:nowrap;break-inside:avoid}.math-result-sheet [data-math-fraction="vertical"]>[data-fraction-slot="numerator"],.math-result-sheet-questions [data-math-fraction="vertical"]>[data-fraction-slot="numerator"]{grid-area:numerator;padding:0 .15em .1em}.math-result-sheet [data-math-fraction="vertical"]>[data-fraction-bar],.math-result-sheet-questions [data-math-fraction="vertical"]>[data-fraction-bar]{grid-area:fraction-bar;width:100%;height:2px;border-radius:2px;background:currentColor}.math-result-sheet [data-math-fraction="vertical"]>[data-fraction-slot="denominator"],.math-result-sheet-questions [data-math-fraction="vertical"]>[data-fraction-slot="denominator"]{grid-area:denominator;padding:.1em .15em 0}.math-result-sheet .student-math-mixed-fraction,.math-result-sheet-questions .student-math-mixed-fraction{display:inline-flex;align-items:center;white-space:nowrap;break-inside:avoid}
.math-result-sheet-questions { display: grid; gap: 9px; }
.math-result-sheet-questions > h3 { margin: 3px 0 0; }
.math-result-sheet-questions article { display: grid; gap: 10px; }
.math-result-sheet-questions article.is-wrong { border-color: #7a5534; }
.math-result-sheet-questions header { display: flex; justify-content: space-between; gap: 12px; }
.math-result-sheet-questions header span { color: #a9bad0; font-size: 11px; }
.math-result-sheet-questions header b { color: #7ee2c2; font-size: 11px; }
.math-result-sheet-questions article.is-wrong header b { color: #ffc277; }
.math-result-sheet-prompt { margin: 0; color: #f0f6fd; font-size: 14px; line-height: 1.65; }
.math-result-sheet-visual { overflow: hidden; border: 1px solid #365071; border-radius: 12px; background: #f8fbff; }
.math-result-sheet-visual .student-math-canvas { display: block; max-width: 100%; height: auto; margin: auto; }
.math-result-sheet-visual .student-math-visual-table { width: 100%; border-collapse: collapse; color: #24344d; }
.math-result-sheet-visual .student-math-visual-table td { border: 1px solid #cbd8e8; padding: 8px; text-align: center; }
.math-result-sheet-visual .student-math-semantic-geometry { display: block; width: min(100%, 640px); height: auto; margin: auto; }
.math-result-sheet-visual .student-math-semantic-title { fill: #24344d; font: 900 18px Pretendard, sans-serif; }
.math-result-sheet-visual .student-math-semantic-label { fill: #24344d; font: 800 16px Pretendard, sans-serif; paint-order: stroke; stroke: #f8fbff; stroke-width: 5px; stroke-linejoin: round; }
.math-result-sheet dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0; }
.math-result-sheet dl div { border-radius: 9px; background: #182a3f; padding: 9px; }
.math-result-sheet dt { color: #8197af; font-size: 9px; }
.math-result-sheet dd { margin: 4px 0 0; font-size: 12px; font-weight: 850; }
.math-result-sheet-explanation { border-left: 3px solid #426d9d; padding-left: 10px; }
.math-result-sheet-empty { margin: 0; border: 1px dashed #46617e; border-radius: 12px; padding: 30px; color: #9aadc1; text-align: center; }

.parent-math-dialog .math-result-sheet { gap: 14px; }
.parent-math-dialog .math-result-sheet-summary { grid-template-columns: auto minmax(0, 1fr); gap: 18px; border-color: #365b72; background: #0d2935; padding: 18px; }
.parent-math-dialog .math-result-sheet-summary > strong { color: #65dfbd; font-size: 46px; line-height: 1; }
.parent-math-dialog .math-result-sheet-summary div { gap: 8px; }
.parent-math-dialog .math-result-sheet-summary b { color: #f4f7fb; font-size: 18px; }
.parent-math-dialog .math-result-sheet-summary span { line-height: 1.65; }
.parent-math-dialog .math-result-sheet h3 { font-size: 18px; }
.parent-math-dialog .math-result-sheet-questions { gap: 12px; }
.parent-math-dialog .math-result-sheet-questions > h3 { margin: 8px 0 2px; }
.parent-math-dialog .math-result-sheet-questions article { gap: 13px; border: 0; border-bottom: 1px solid #29445f; border-radius: 0; background: transparent; padding: 16px 0 20px; }
.parent-math-dialog .math-result-sheet-questions article.is-wrong { border-color: #29445f; background: transparent; }
.parent-math-dialog .math-result-sheet-questions header { align-items: center; justify-content: flex-start; }
.parent-math-dialog .math-result-sheet-questions header span { font-size: 12px; }
.parent-math-dialog .math-result-sheet-questions header b { order: -1; border: 1px solid #397361; border-radius: 999px; padding: 5px 9px; }
.parent-math-dialog .math-result-sheet-questions article.is-wrong header b { border-color: #a9445b; color: #ff7f96; }
.parent-math-dialog .math-result-sheet-prompt { font-size: 16px; font-weight: 850; }
.parent-math-dialog .math-result-sheet dl { gap: 8px; }
.parent-math-dialog .math-result-sheet dl div { border-radius: 10px; padding: 11px; }
.parent-math-dialog .math-result-sheet dt { color: #9aacc1; font-size: 10px; }
.parent-math-dialog .math-result-sheet dd { margin-top: 6px; color: #67dfbd; font-size: 16px; font-weight: 900; }
.parent-math-dialog .math-result-sheet article.is-wrong dl div:first-child dd { color: #ff748d; }
.parent-math-dialog .math-result-sheet-explanation { border: 1px solid #315f6b; border-radius: 10px; padding: 11px 12px; color: #67dfbd; }

@media (max-width: 600px) {
  .math-result-dialog { width: 100%; max-width: none; max-height: 100vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .math-result-dialog > form { padding: 16px; }
  .math-result-sheet-summary { grid-template-columns: 1fr; }
  .math-result-sheet-summary > strong { font-size: 42px; }
  .parent-math-dialog .math-result-sheet-summary { grid-template-columns: auto minmax(0, 1fr); }
}
