.math-area {max-width:1240px;margin:24px auto 64px;padding:0 24px;color:#172334;letter-spacing:0}
.math-area * {box-sizing:border-box;min-width:0}
.math-heading,.math-lesson-heading {display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.math-heading h1 {font-size:28px;margin:4px 0 0}.math-eyebrow {font-size:13px;color:#087f89;font-weight:700}
.math-area h2 {font-size:20px;margin:0 0 16px}.math-area h3 {font-size:17px;margin:8px 0}
.math-area p {line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.math-notice {font-size:13px;padding:12px 16px;border-left:3px solid #08949c;background:#edf8f8}
.math-layout {display:grid;grid-template-columns:238px minmax(0,1fr);gap:28px;margin-top:28px}
.math-history {border-right:1px solid #dce4eb;padding-right:22px}.math-history h2 {font-size:16px}
.math-history nav {display:grid;gap:8px;margin-top:16px;max-height:650px;overflow:auto}
.math-area button {padding:10px 16px;background:#fff;border:1px solid #ccd6e1;border-radius:6px;cursor:pointer;font:inherit;font-size:14px;font-weight:650;color:inherit;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.math-area button:hover:not(:disabled) {border-color:#087f89;background:#f0fafa}
.math-area button:disabled {opacity:.55;cursor:wait}.math-area :focus-visible {outline:3px solid #3687e9;outline-offset:3px}
.math-history nav button {text-align:left;display:grid;gap:5px;width:100%;padding:12px}
.math-history nav button span,.math-muted {font-size:13px;color:#586779}.math-history nav [aria-current] {border-color:#087f89;background:#ecf8f6}
.math-content {min-height:430px}.math-area label {display:block;font-size:14px;font-weight:650;margin:18px 0 8px}
.math-area textarea,.math-area select,.math-area input {width:100%;max-width:100%;font:inherit;font-size:16px;padding:12px;border:1px solid #bfcbd7;border-radius:6px;background:#fff;color:#172334}
.math-area textarea {resize:vertical;line-height:1.8}.math-area select {max-width:320px;margin-bottom:16px}
.math-area .math-primary {background:#087f89;color:white;border-color:#087f89}.math-area .math-primary:hover:not(:disabled) {background:#066c75;color:white}
.math-upload {border-bottom:1px solid #dce4eb;padding-bottom:20px}.math-photo {display:block;max-width:100%;max-height:440px;object-fit:contain;margin:16px auto;background:#fff;border:1px solid #dce4eb}
.math-actions {display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.math-error {background:#fff0ef;color:#8e2e2a;border-left:3px solid #c04a41;padding:12px;margin:16px 0;overflow-wrap:anywhere}
.math-error[hidden] {display:none}.math-progress {background:#eef4fc;padding:16px;margin:16px 0;border-left:3px solid #3c75c4}.math-progress p {margin-bottom:0;font-size:14px}
.math-original {border-bottom:1px solid #dce4eb;padding:16px 0}.math-original summary {cursor:pointer;font-weight:650}
.math-steps {display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.math-steps span {font-size:13px;color:#66788a;border-bottom:3px solid #dce4eb;padding:8px}
.math-steps [aria-current] {color:#087f89;border-color:#087f89}
.math-chat {display:grid;gap:16px;margin:16px 0;max-height:700px;overflow:auto;scrollbar-gutter:stable;padding-right:6px}
.math-message {border:1px solid #dce4eb;border-radius:8px;padding:18px;background:white;overflow:hidden}
.math-message>span {font-size:12px;font-weight:700;color:#087f89}.math-message p {margin:10px 0}.math-message strong {display:block;line-height:1.8;overflow-wrap:anywhere}
.math-student {margin-left:32px;background:#eef4fc;border-color:#d8e5f5}.math-student>span {color:#315e9c}
.math-rule {color:#596875;font-size:14px}.math-formula {overflow-x:auto;padding:8px 0}.math-area .katex-display {overflow-x:auto;overflow-y:hidden;padding:4px 0;max-width:100%}
.math-complete {padding:16px;background:#e7f5ee;border-left:3px solid #279060}
@media(max-width:720px) {.math-area{padding:0 16px;margin-top:18px}.math-layout{grid-template-columns:1fr;gap:24px}.math-history{border-right:0;border-bottom:1px solid #dce4eb;padding:0 0 16px}.math-history nav{max-height:160px}.math-heading h1{font-size:24px}.math-student{margin-left:12px}.math-message{padding:14px}.math-actions>button{flex:1 1 auto}.math-content{min-height:300px}}
