/* Kwantum Chemistry: area colours (dark mode is derived from --acc in fresh.css) and chemistry figure tweaks. */
:root[data-area="changes"] { --acc-strong: #A8370B; --acc: #C2410F; --acc-ink: #93300A; --acc-soft: #FBE7DC; --acc-tint: #FFF5EF; }
:root[data-area="nature"]  { --acc-strong: #1A6B3E; --acc: #23884F; --acc-ink: #1A6B3E; --acc-soft: #DFF2E6; --acc-tint: #F3FBF6; }
:root[data-area="society"] { --acc-strong: #1D4FA8; --acc: #2763C9; --acc-ink: #1D4FA8; --acc-soft: #E1EAFA; --acc-tint: #F4F7FE; }
:root[data-area="research"] { --acc-strong: #5B21B6; --acc: #6D28D9; --acc-ink: #5B21B6; --acc-soft: #EDE5FB; --acc-tint: #F8F5FE; }
:root[data-area="inorganic"] { --acc-strong: #A8370B; --acc: #C2410F; --acc-ink: #93300A; --acc-soft: #FBE7DC; --acc-tint: #FFF5EF; }
:root[data-area="physical"] { --acc-strong: #1D4FA8; --acc: #2763C9; --acc-ink: #1D4FA8; --acc-soft: #E1EAFA; --acc-tint: #F4F7FE; }
:root[data-area="organic"]  { --acc-strong: #1A6B3E; --acc: #23884F; --acc-ink: #1A6B3E; --acc-soft: #DFF2E6; --acc-tint: #F3FBF6; }
/* dark mode: the area colours above load after fresh.css, so re-derive the tints here (fixes white boxes in dark mode) */
:root[data-theme="dark"][data-area] {
  --acc-ink: color-mix(in srgb, var(--acc) 62%, #fff);
  --acc-soft: color-mix(in srgb, var(--acc) 26%, #1B1D23);
  --acc-tint: color-mix(in srgb, var(--acc) 12%, #121318);
  --accent: var(--acc-ink); --accent-soft: var(--acc-soft);
}
.chem-fig text { font-family: var(--font, "Lexend", sans-serif); }
.bench-screen .chem-fig { color: var(--ink); }
.compare .cmp-fig svg { max-width: 100%; height: auto; }
.bench .seg { flex-wrap: wrap; }

/* single formula in a group spans the row so long word-formulae fit */
.fgrid > .blk:only-child { grid-column: 1 / -1; }
.fgrid .fm, .blk .fm { overflow-x: auto; max-width: 100%; }

/* long area names: keep the top bar title clear of the buttons on phones */
.tb-brand { min-width: 0; flex-shrink: 1; }
.tb-brand > span:last-child { min-width: 0; overflow: hidden; }
.tb-brand b, .tb-brand small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .tb-brand { max-width: calc(100% - 150px); } }
.bench-screen .on-dark .chem-fig { color: #E7ECF5; }
/* organic structures: rows of labelled structural formulae */
.st-row { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: flex-end; justify-content: center; }
.st-row figure { margin: 0; text-align: center; max-width: 100%; }
.st-row figcaption { font-size: .9rem; font-weight: 600; margin-top: 4px; font-style: normal; }
.chem-fig.struct { max-width: 100%; height: auto; }
.qfig .chem-fig.struct { display: block; margin: 0 auto; }
.blk-fig .st-row figcaption::before { content: none; }

/* Quality check 2026-11-28: keep wide formulas and data tables on screen on phones */
.fbox { overflow-x: auto; }
.fbox-top { min-width: 0; }
.qstem { overflow-x: auto; }
.qstem table.info { margin-left: 0; margin-right: 0; }
@media (max-width: 520px) { .fbig .fm { font-size: 1.3rem; white-space: normal; } }
