/* Organic molecules — scoped styles (all classes prefixed om-) */
.om-modebox { display: flex; flex-direction: column; gap: 12px; }
.om-modebox:empty { display: none; }
.om-ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- stage cards ---------- */
.om-ov { overflow: hidden; }
.om-card {
  position: absolute; padding: 10px 12px; border-radius: 12px;
  background: rgba(14, 19, 40, .82); color: #e8ebf7; border: 1px solid rgba(255, 255, 255, .12);
  font-size: 13px; line-height: 1.4; box-sizing: border-box;
}
.om-card-name { top: 12px; inset-inline-start: 12px; max-width: min(340px, 48%); pointer-events: none !important; }
.om-card-title { font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.om-card-sub { margin-top: 3px; font-size: 12.5px; color: #aab3d1; }
.om-card-struct { top: 12px; inset-inline-end: 12px; width: 282px; max-width: 48%; }
.om-card-atom { bottom: 12px; inset-inline-end: 12px; width: 262px; max-width: calc(100% - 24px); }
.om-card-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.om-card-foot { margin-top: 6px; font-size: 11.5px; color: #aab3d1; line-height: 1.35; }
.om-struct-cond { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 14px; overflow-wrap: anywhere; margin-bottom: 4px; }
[dir="rtl"] .om-struct-cond { text-align: right; }
.om-skel { display: block; width: 100%; height: 150px; }
.om-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.om-x {
  margin-inline-start: auto; width: 26px; height: 26px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .1); color: #fff; font-size: 17px; line-height: 1;
}
.om-x:hover { background: rgba(255, 255, 255, .2); }
.om-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.om-dl dt { color: #aab3d1; }
.om-dl dd { margin: 0; font-weight: 600; }

/* ---------- 3D labels ---------- */
.label-3d.om-atom { font-size: 10.5px; padding: 0 4px; background: rgba(10, 14, 30, .55); }
.label-3d.om-num {
  background: var(--subject); font-size: 11px; font-weight: 700; border-radius: 999px;
  min-width: 18px; text-align: center; padding: 0 5px; box-shadow: 0 0 0 2px rgba(255,255,255,.75);
}
.label-3d.om-angle { background: rgba(253, 224, 71, .94); color: #1c1917; font-size: 11px; padding: 0 5px; }
.label-3d.om-iso { white-space: pre-line; text-align: center; line-height: 1.3; font-size: 12px; padding: 3px 9px; }
.label-3d.om-iso.on { background: var(--subject); }

/* ---------- panel ---------- */
.om-name { font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.om-name-en { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.om-class { font-size: 13px; color: var(--ink-2); white-space: pre-line; margin-top: 6px; line-height: 1.45; }
.ctl-group > .om-sublabel { font-size: 12px; font-weight: 600; color: var(--muted); }
.ctl-group > .om-sublabel + .ctl { margin-top: 4px; }
.ctl-formula.om-condensed { font-size: 15px; overflow-wrap: anywhere; }
.ctl-note.om-small { font-size: 12px; color: var(--muted); }
.om-muted { color: var(--muted); font-size: 13px; }
.om-legend i { border-radius: 50% !important; }

.om-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.om-chip {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px 2px 10px; border-radius: 999px;
  background: var(--subject-soft); color: var(--ink); font-size: 13px; font-weight: 600;
}
[dir="rtl"] .om-chip { padding: 2px 10px 2px 3px; }
.om-chip button {
  border: 0; background: transparent; width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--ink-2);
}
.om-chip button:hover { background: rgba(0, 0, 0, .08); color: var(--bad); }

.om-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.om-preset {
  display: flex; align-items: center; gap: 7px; text-align: start; padding: 6px 8px; min-height: 36px;
  border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.2;
}
.om-preset:hover { background: var(--surface-2); }
.om-preset i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.om-preset[aria-pressed="true"] { border-color: var(--subject); background: var(--subject-soft); }

.om-fg-item + .om-fg-item { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.om-fg-name { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.om-fg-name i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.om-fg-formula { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 17px; margin: 4px 0; }
[dir="rtl"] .om-fg-formula { text-align: right; }
.om-fg-def { font-size: 13px; color: var(--ink-2); line-height: 1.45; }

.om-iso-list { display: flex; flex-direction: column; gap: 6px; }
.om-iso-row {
  display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer;
  text-align: start; color: var(--ink);
}
.om-iso-row:hover { background: var(--surface-2); }
.om-iso-row[aria-pressed="true"] { border-color: var(--subject); background: var(--subject-soft); }
.om-iso-name { font-weight: 600; font-size: 13.5px; }
.om-iso-bp { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.om-bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.om-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #60a5fa, #f97316); transition: width .7s ease; }

.om-quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.om-quiz-opts .btn { white-space: normal; min-height: 42px; line-height: 1.2; padding: 4px 8px; }
.om-quiz-opts .btn:disabled { cursor: default; }
.om-quiz-opts .btn.om-right { background: #dcfce7; border-color: var(--ok); color: #14532d; }
.om-quiz-opts .btn.om-wrong { background: #fee2e2; border-color: var(--bad); color: #7f1d1d; }

@media (max-width: 860px) {
  .om-card-name { max-width: calc(100% - 24px); }
  .om-card-struct { top: auto; bottom: 12px; inset-inline-end: auto; inset-inline-start: 12px; width: 230px; max-width: calc(50% - 18px); }
  .om-card-struct .om-card-foot { display: none; }
  .om-skel { height: 120px; }
  .om-card-atom { width: 230px; max-width: calc(50% - 18px); font-size: 12px; }
}
@media (max-width: 520px) {
  .om-card { padding: 8px 9px; }
  .om-card-title { font-size: 14px; }
  .om-card-struct, .om-card-atom { max-width: calc(50% - 16px); }
  .om-skel { height: 96px; }
}
