.math-page { max-width: 1040px; margin: 0 auto; padding: 24px 24px 56px; }
.math-nav { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; }
.math-support { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; min-height: 44px; padding: 6px 12px; border: 1px solid #ded5f4; border-radius: 10px; background: #f3effb; color: #514096; font-size: .85rem; font-weight: 600; text-decoration: none; text-align: center; }
.math-support:hover { background: #eae3f8; }
.math-support-provider { white-space: nowrap; }
.math-brand { display: inline-flex; gap: 9px; align-items: center; font-weight: 750; text-decoration: none; color: var(--text, #211f23); }
.math-brand img { width: 32px; height: 32px; }
.math-nav a:focus-visible, .math-page button:focus-visible, .math-page textarea:focus-visible { outline: 3px solid #6c5ce7; outline-offset: 4px; }
.math-intro { max-width: none; }
.math-eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: #6551cd; font-weight: 700; }
.math-page h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.035em; margin: 8px 0 10px; }
.math-intro > p:last-child { font-size: 1rem; line-height: 1.5; color: #66615c; margin: 0; }
.math-eyebrow { margin: 0; }
.math-rules { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.math-rules span { padding: 6px 10px; border-radius: 10px; background: #eeeafa; color: #473891; font-size: .85rem; }
.math-card { border: 1px solid #e6e1dc; background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 12px 36px #33225608; }
.math-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.math-page button { border: 1px solid #e2dce9; background: #fff; color: #3e3552; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 650; cursor: pointer; min-height: 46px; }
.math-page button.primary { background: #6c5ce7; color: #fff; border-color: #6c5ce7; }
.math-page button.is-copied { background: #eaf6ef; border-color: #95c8a7; color: #205a35; animation: copied-feedback .18s ease-out; }
@keyframes copied-feedback { from { opacity: .65; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .math-page button.is-copied { animation: none; } }
.math-page button:hover { filter: brightness(.96); }
.math-page button:disabled { opacity: .6; cursor: wait; }
.math-hint { font-size: .88rem; color: #716a64; line-height: 1.6; margin: 14px 0 24px; }
.math-page label { display: block; font-weight: 650; margin-bottom: 10px; }
.math-page textarea { display: block; box-sizing: border-box; width: 100%; min-height: 220px; overflow: hidden; resize: none; border: 1px solid #ddd6e6; border-radius: 14px; padding: 18px; background: #fdfcfb; color: #262329; font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.math-status { min-height: 1.5em; font-size: .9rem; line-height: 1.5; color: #51446e; margin: 10px 0; }
.math-bottom { display: flex; gap: 10px; flex-wrap: wrap; }
.math-secondary { margin-top: 12px; }
.math-shortcut { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.math-shortcut > button { flex-shrink: 0; }
.math-shortcut .math-hint { margin: 0; line-height: 1.5; }
.math-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.math-editor-heading label { margin: 0; }
.math-page [hidden] { display: none !important; }
.math-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #e6e1dc; margin-bottom: 16px; }
.math-page .math-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px; background: transparent; color: #716a64; min-width: 0; }
.math-page .math-tabs button[aria-selected="true"] { background: #f6f3ff; border-bottom-color: #6c5ce7; color: #473891; }
.math-page .math-tabs button:hover { background: #f6f3ff; }
.math-page [aria-pressed="true"] { background: #eeeafa; border-color: #6c5ce7; color: #473891; }
#file-drop { border: 2px dashed #c5bbeb; border-radius: 16px; padding: 30px 16px; text-align: center; background: #faf8ff; }
.math-file-list { padding: 0; list-style: none; }
.math-file-list li { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); align-items: center; gap: 12px; padding: 18px; margin: 12px 0; border: 1px solid #e6e1dc; border-radius: 14px; }
.math-file-list strong { grid-column: 1 / -1; overflow-wrap: anywhere; font-size: .98rem; line-height: 1.5; font-weight: 600; }
.math-file-list span { font-size: .88rem; color: #655a73; line-height: 1.5; }
.math-page .math-file-list button { font-size: .85rem; padding: 8px 12px; min-height: 44px; }
#file-status { font-size: .9rem; line-height: 1.6; color: #716a64; margin: 20px 0 16px; }
.file-toolbar { padding-bottom: 8px; }
#file-preview { margin-top: 28px; padding: 22px; border: 1px solid #e6e1dc; border-radius: 16px; background: #faf9fc; }
#preview-title { overflow-wrap: anywhere; font-size: 1rem; font-weight: 600; line-height: 1.5; margin: 0 0 18px; }
.math-page #preview-text { height: 320px; overflow: auto; resize: vertical; margin: 16px 0; }
#panel-text > .math-actions { margin-bottom: 16px; }
.math-page button:disabled { cursor: default; }
.math-details { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 38px 0; }
.math-details h2 { font-size: 1.12rem; margin-bottom: 10px; }
.math-details p { color: #716a64; line-height: 1.7; }
.math-footer { border-top: 1px solid #e6e1dc; padding-top: 24px; font-size: .95rem; line-height: 1.7; color: #716a64; }
.math-examples, .math-faq { margin: 40px 0; }
.math-examples h2, .math-faq h2 { font-size: 1.5rem; margin-bottom: 12px; }
.math-examples p, .math-faq p { color: #716a64; line-height: 1.7; }
.math-example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.math-example-grid article { padding: 20px; border: 1px solid #e6e1dc; border-radius: 16px; }
.math-example-grid h3 { font-size: 1.05rem; margin: 0; }
.math-example-grid p { font-size: .9rem; margin: 8px 0 16px; }
.math-example-grid small { display: block; color: #716a64; }
.math-example-grid code { display: block; overflow-wrap: anywhere; background: #eeeafa; padding: 10px; border-radius: 8px; margin: 6px 0 12px; font-size: .9rem; }
.math-faq details { padding: 18px 0; border-bottom: 1px solid #e6e1dc; }
.math-faq summary { font-weight: 650; cursor: pointer; }
.math-faq summary:focus-visible { outline: 3px solid #6c5ce7; outline-offset: 4px; }
@media (max-width: 600px) {
  .math-page { padding: 18px 16px 40px; }
  .math-nav { margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
  .math-support { order: 1; flex-basis: 100%; }
  .math-shortcut { flex-direction: column; align-items: stretch; gap: 8px; }
  .math-card { padding: 18px; border-radius: 18px; }
  .math-actions button { flex: 1 1 auto; }
  .math-details { grid-template-columns: 1fr; gap: 16px; }
  .math-example-grid { grid-template-columns: 1fr; }
  .math-page textarea { font-size: 16px; padding: 12px; }
  .math-file-list li { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px; gap: 8px; }
  .math-file-list span { grid-column: 1 / -1; }
  .math-page .math-file-list button { padding: 8px; overflow-wrap: anywhere; }
  #file-preview { padding: 14px; }
}
