.chem-workspace { padding: 18px; border: 1px solid var(--line, #d8d8d0); border-radius: 14px; min-width: 0; }
.chem-workspace h3 { margin: 0 0 14px; }
.chem-workspace label { display: block; font-size: 14px; }
.cw-equations { width: 100%; margin: 8px 0; font-family: monospace; white-space: pre-wrap; tab-size: 4; }
.cw-symbols, .cw-toolbar, .cw-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; align-items: center; }
.chem-workspace button { font: inherit; font-size: 13px; color: inherit; border: 1px solid var(--line, #d8d8d0); background: transparent; border-radius: 7px; padding: 8px 10px; cursor: pointer; min-height: 36px; }
.chem-workspace button[aria-pressed="true"] { background: #245bf5; color: white; border-color: #245bf5; }
.chem-workspace button:disabled { opacity: .4; cursor: default; }
.chem-workspace button:focus-visible, .cw-canvas:focus-visible { outline: 3px solid #245bf5; outline-offset: 2px; }
.cw-label input { margin: 6px 0 12px; width: 100%; }
.cw-canvas { width: 100%; height: auto; display: block; border: 1px solid #a5aab3; border-radius: 8px; touch-action: none; background: white; }
.cw-canvas [data-item] { pointer-events: bounding-box; }
.cw-status { font-size: 12px; margin-left: auto; }
.chem-draft { margin: 20px 0; }
.chem-draft summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
/* Preserve line breaks and alignment in chemistry source text and options. */
body[data-chemistry] .q-p, body[data-chemistry] .lq-t, body[data-chemistry] .q-table td,
body[data-chemistry] .q-table th, body[data-chemistry] .opt > span:first-of-type { white-space: pre-wrap; tab-size: 4; }

.chem-answer-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.chem-answer-preview svg { display: block; width: 100%; border: 1px solid #a5aab3; }

.q-source-notes { margin: 14px 0; font-size: 13px; }
.q-source-notes summary { cursor: pointer; font-weight: 600; }
.q-source-notes p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
