/* AW Formula. Every rule is scoped to the plugin's own classes; KaTeX's stylesheet (vendor/katex/katex.min.css)
   styles .katex itself. Colours of formulas follow the page (currentColor). */
.aw-formula { box-sizing: border-box; }
.aw-formula--display { display: block; position: relative; margin: 1em 0; max-width: 100%; text-align: center; overflow-x: auto; overflow-y: hidden; }
.aw-formula--inline { display: inline; }
.aw-formula--display .katex-display { margin: 0; }

/* Source text while nothing has been rendered (no JavaScript, library still loading), and the SMILES caption */
.aw-formula__tex,
.aw-formula__smiles code,
.aw-formula__source,
.aw-formula__caption code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95em; white-space: pre-wrap; overflow-wrap: anywhere; background: transparent; padding: 0; border: 0; border-radius: 0; color: inherit; }

/* Errors: the source stays, a short note follows it */
.aw-formula__error { display: inline-block; margin-left: 0.5em; font-family: inherit; font-size: 0.85em; color: #b32d2e; white-space: normal; }
.aw-formula--display .aw-formula__error { display: block; margin: 0.25em 0 0; }
.aw-formula--display .katex-error { white-space: pre-wrap; }

/* Structures */
.aw-formula--structure { display: inline-block; max-width: 100%; vertical-align: middle; text-align: center; }
.aw-formula--structure .aw-formula__smiles { display: block; }
.aw-formula--structure[data-aw-formula-state="done"] .aw-formula__smiles { line-height: 0; }
.aw-formula--structure svg { display: inline-block; max-width: 100%; height: auto; }
.aw-formula__caption { display: block; margin-top: 0.25em; font-size: 0.85em; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
.aw-formula--structure.aw-formula--theme-light { padding: 8px; border-radius: 8px; background: #ffffff; color: #222222; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); }
.aw-formula--structure.aw-formula--theme-dark { padding: 8px; border-radius: 8px; background: #141414; color: #ffffff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }
.aw-formula--structure svg { shape-rendering: geometricPrecision; }

/* Block wrappers */
.aw-formula-block { margin: 0 0 1em; }
.aw-formula-block--inline { line-height: 1.6; }
