/* Shared Math 2 workspace; all rules stay inside the explicit workspace. */
[data-math2-geometry] { display: grid; grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.4fr); gap: 24px; margin: 24px 0; color: var(--calc-text, #e7e9ee); font-family: system-ui, sans-serif; }
[data-math2-geometry] .m2-panel { min-width: 0; padding: 24px; border: 1px solid var(--calc-border, #384253); border-radius: 18px; background: var(--calc-bg-elevated, #182131); }
[data-math2-geometry] .m2-field { display: grid; gap: 8px; margin: 16px 0; }
[data-math2-geometry] .m2-field[hidden] { display: none; }
[data-math2-geometry] label { display: block; font-weight: 600; }
[data-math2-geometry] input, [data-math2-geometry] select, [data-math2-geometry] textarea { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--calc-border, #566176); border-radius: 9px; color: inherit; background: var(--calc-input-bg, #101827); font: inherit; }
[data-math2-geometry] input[aria-invalid="true"] { border-color: #fb7185; }
[data-math2-geometry] :focus-visible { outline: 3px solid #67c4eb; outline-offset: 3px; }
[data-math2-geometry] .m2-error { min-height: 24px; color: #ff8296; }
[data-math2-geometry] .m2-result-value { margin: 12px 0; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 700; overflow-wrap: anywhere; }
[data-math2-geometry] .m2-table-wrap { overflow-x: auto; max-width: 100%; margin-top: 20px; }
[data-math2-geometry] .m2-data-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
[data-math2-geometry] .m2-data-table caption { margin: 12px 0; text-align: left; font-weight: 700; }
[data-math2-geometry] .m2-data-table td, [data-math2-geometry] .m2-data-table th { padding: 10px; border-bottom: 1px solid var(--calc-border, #384253); text-align: left; white-space: nowrap; }
[data-math2-geometry] .m2-equation { font-family: ui-monospace, monospace; overflow-wrap: anywhere; line-height: 1.7; }
[data-math2-geometry] svg { display: block; max-width: 100%; width: 100%; height: auto; color: var(--calc-text, #e7e9ee); }
[data-math2-geometry] svg .m2-shape { fill: rgba(90, 184, 226, 0.12); stroke: #63b8de; stroke-width: 2; }
[data-math2-geometry] svg circle { fill: currentcolor; }
[data-math2-geometry] svg text { fill: currentcolor; font-size: 12px; }
[data-math2-geometry] .m2-diagonal { stroke: #d47c29; stroke-width: 2; stroke-dasharray: 5 4; }
[data-math2-geometry] .m2-guide { stroke: #d47c29; stroke-width: 1.5; stroke-dasharray: 4 3; }
[data-math2-geometry] .m2-angle-arc { fill: none; stroke: currentcolor; stroke-width: 2; }
[data-math2-geometry] .m2-axis { stroke: currentcolor; stroke-width: 1; opacity: 0.6; }
[data-math2-geometry] .m2-series { fill: none; stroke: #299bc2; stroke-width: 2; }
[data-math2-geometry] .m2-series-0 { stroke: #299bc2; fill: #299bc2; }
[data-math2-geometry] .m2-series-1 { stroke: #d47c29; fill: #d47c29; }
[data-math2-geometry] .m2-series.m2-series-0, [data-math2-geometry] .m2-series.m2-series-1 { fill: none; }
[data-math2-geometry] .m2-pole { stroke: #d65466; stroke-dasharray: 5 5; opacity: 0.7; }
[data-math2-geometry] .m2-bar { fill: #299bc2; }
[data-math2-geometry] .m2-net-panel { stroke: #299bc2; fill: rgba(41, 155, 194, 0.14); stroke-width: 2; }
[data-math2-geometry] .m2-marker { stroke: #d47c29; fill: #d47c29; }
[data-math2-geometry] svg .m2-unit-circle { fill: none; stroke: #299bc2; stroke-width: 2; }
[data-math2-geometry] .m2-explorer label, [data-math2-geometry] .m2-explorer input, [data-math2-geometry] .m2-explorer select { margin: 12px 0; }
[data-math2-geometry] .m2-visuals figure { margin: 24px 0; }
[data-math2-geometry] .m2-visuals figcaption { font-size: 0.9rem; line-height: 1.5; }
[data-math2-geometry] .m2-scenario-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
[data-math2-geometry] button { min-height: 44px; padding: 10px 16px; border: 1px solid var(--calc-border, #566176); border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
[data-math2-geometry] button:disabled { opacity: 0.5; cursor: default; }
[data-math2-geometry] .input-hint { line-height: 1.6; }
[data-theme="light"] [data-math2-geometry] { color: #1f2937; }
[data-theme="light"] [data-math2-geometry] .m2-panel { background: #fff; border-color: #d4dce7; }
[data-theme="light"] [data-math2-geometry] input, [data-theme="light"] [data-math2-geometry] select, [data-theme="light"] [data-math2-geometry] textarea { color: #1f2937; background: #f8fafc; border-color: #abb8c9; }
[data-theme="light"] [data-math2-geometry] .m2-error { color: #a91b37; }
[data-theme="light"] [data-math2-geometry] svg { color: #1f2937; }
[data-theme="light"] [data-math2-geometry] .m2-data-table td, [data-theme="light"] [data-math2-geometry] .m2-data-table th { border-color: #d4dce7; }
@media (width <= 760px) { [data-math2-geometry] { grid-template-columns: minmax(0, 1fr); } [data-math2-geometry] .m2-panel { padding: 18px; } }
@media print { [data-math2-geometry] { display: block; color: #111; } [data-math2-geometry] .m2-panel { break-inside: avoid; background: #fff; color: #111; } [data-math2-geometry] .m2-scenario-actions { display: none; } }
