/* Faheem palette (packages/ui/tokens.ts): paper, white surfaces, one teal, amber for highlights */
:root {
  --paper: #FAF6EF; --surface: #FFFFFF; --rule: #ECE5DA;
  --teal: #1D6A5A; --teal-soft: #E3EFEB; --amber: #E8A33D; --amber-soft: #FBEFD9;
  --terracotta: #D96C4F; --ink: #2B2622; --ink-soft: #6B625A; --ink-faint: #A39A8F;
  --neutron: #8C857C;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif; }
.stage { max-width: 760px; margin: 0 auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.top h1 { margin: 0; font-size: 20px; color: var(--teal); }
.sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }
.atom-wrap { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; aspect-ratio: 1 / 1; max-height: 52vh; margin: 0 auto; width: 100%; }
#atom { width: 100%; height: 100%; display: block; }
.shell { fill: none; stroke: var(--rule); stroke-width: 2; }
.shell.hi { stroke: var(--teal); stroke-dasharray: 6 6; }
.shell-label { font-size: 13px; fill: var(--ink-faint); font-weight: 700; }
.p { fill: var(--terracotta); } .n { fill: var(--neutron); } .e { fill: var(--teal); }
circle.p, circle.n { stroke: #fff; stroke-width: 1.5; }
.tap { cursor: pointer; }
.hi-part { filter: drop-shadow(0 0 6px var(--amber)); }
.facts .fact { background: var(--teal-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.7; min-height: 64px; }
.fact strong { color: var(--teal); margin-inline-end: 6px; }
.legend, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { font: inherit; font-size: 13px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip[aria-pressed="true"], .chip.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.chip.small { padding: 4px 10px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.p { background: var(--terracotta); } .dot.n { background: var(--neutron); } .dot.e { background: var(--teal); }
.ring { width: 12px; height: 12px; border-radius: 50%; border: 2px dashed var(--teal); display: inline-block; }
.picker { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.el { font: inherit; font-weight: 700; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--rule); background: var(--paper); cursor: pointer; direction: ltr; }
.el[aria-checked="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numbers div { background: var(--paper); border-radius: 12px; padding: 8px; text-align: center; }
.numbers b { display: block; font-size: 22px; color: var(--teal); }
.numbers span { font-size: 11px; color: var(--ink-soft); line-height: 1.5; }
.config { margin: 0; text-align: center; font-weight: 700; direction: ltr; color: var(--ink); }
.iso span { font-size: 13px; color: var(--ink-soft); }
.tip { background: var(--amber-soft); border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.7; }
.side { display: flex; flex-direction: column; gap: 12px; }
.chip.on .ring { border-color: #fff; }
/* Wide frames (desktop, fullscreen): the atom beside the controls, filling the height */
@media (min-width: 640px) and (min-aspect-ratio: 5/4) {
  html, body { overflow: hidden; }
  .stage { max-width: none; height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr); padding: 12px 16px; }
  .top { grid-column: 1 / -1; }
  .atom-wrap { max-height: none; height: 100%; width: auto; aspect-ratio: 1 / 1; justify-self: center; }
  .side { overflow-y: auto; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
