/* Molecule Studio (/studio): a drawing panel and a 3D view side by side, with the properties underneath. */
.st-intro { padding: 36px 0 20px; }
.st-intro h1 { margin: 0 0 6px; font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.st-intro p { margin: 0; max-width: 62ch; color: var(--muted); font-size: 1.05rem; line-height: 1.55; }
.st-wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding: 0 24px 40px; }

.st-app { background: var(--surface, #fff); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 14px 40px rgba(11, 27, 63, .08); }
.st-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; background: var(--wash); border-bottom: 1px solid var(--line); border-radius: 18px 18px 0 0; }

.st-search { flex: 1 1 400px; display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; min-width: 0; }
.st-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(26, 77, 216, .16); }
.st-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.st-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 1rem; color: var(--ink); padding: 9px 0; }
.st-search input::placeholder { color: var(--muted); }

.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 15px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: .93rem; font-weight: 620; cursor: pointer; white-space: nowrap; }
.st-btn:hover { border-color: var(--ink-2); }
.st-btn:focus-visible, .st-chip:focus-visible, .st-seg button:focus-visible, .st-menu summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.st-btn svg { width: 16px; height: 16px; flex: none; }
.st-btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; min-height: 38px; }
.st-btn-primary:hover { background: #1a2d57; border-color: #1a2d57; }
.st-btn-small { min-height: 34px; padding: 0 11px; font-size: .86rem; }
.st-select select { min-height: 42px; padding: 0 34px 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background-color: #fff; font: inherit; font-size: .93rem; font-weight: 600; color: var(--ink); cursor: pointer; max-width: 200px; }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.st-menu { position: relative; }
.st-menu summary { list-style: none; }
.st-menu summary::-webkit-details-marker { display: none; }
.st-menu[open] summary { border-color: var(--ink-2); }
.st-menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; display: grid; min-width: 240px; padding: 6px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px rgba(11, 27, 63, .16); }
.st-menu-panel button { padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: .92rem; text-align: left; color: var(--ink-2); cursor: pointer; }
.st-menu-panel button:hover { background: var(--wash); color: var(--ink); }

.st-status { margin: 0; padding: 9px 18px; font-size: .92rem; color: var(--muted); border-bottom: 1px solid var(--line); background: #fff; }
.st-status:empty { display: none; }
.st-status[data-state="bad"] { color: var(--danger); background: var(--danger-tint); }
.st-status[data-state="busy"] { color: var(--brand-ink); background: var(--brand-soft); }
.st-status[data-state="ok"] { color: var(--success); background: var(--success-tint); }

.st-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.st-pane { display: flex; flex-direction: column; min-width: 0; height: clamp(460px, 64vh, 700px); }
.st-pane + .st-pane { border-left: 1px solid var(--line); }
.st-pane > header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-height: 54px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.st-pane h2 { margin: 0; font-size: 1.02rem; }
.st-pane > header > span { color: var(--muted); font-size: .85rem; flex: 1 1 220px; }

.st-frame { position: relative; flex: 1; min-height: 0; background: #fff; }
.st-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.st-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; text-align: center; color: var(--muted); background: #fff; }
.st-loading[hidden] { display: none; }

.st-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.st-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.st-seg button { padding: 7px 11px; border: 0; border-left: 1px solid var(--line); background: transparent; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.st-seg button:first-child { border-left: 0; }
.st-seg button:hover { background: var(--wash); }
.st-seg button.on { background: var(--ink); color: #fff; }
.st-chip { padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.st-chip:hover { border-color: var(--ink-2); }
.st-chip.on { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-ink); }

.st-3d-wrap { position: relative; flex: 1; min-height: 0; background: radial-gradient(circle at 50% 45%, #ffffff, #eef3fa 80%); }
.st-3d { position: absolute; inset: 0; }
.st-3d-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 30px; text-align: center; color: var(--muted); font-size: .98rem; line-height: 1.55; pointer-events: none; }
.st-3d-msg[hidden] { display: none; }

.st-info { padding: 18px 20px 20px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.st-info[hidden] { display: none; }
.st-info-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.st-info-head h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.015em; }
.st-formula { margin: 2px 0 0; color: var(--muted); font-size: 1.05rem; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.st-rule { display: grid; gap: 2px; padding: 9px 14px; border-radius: 12px; font-size: .88rem; max-width: 360px; background: var(--canvas); }
.st-rule:empty { display: none; }
.st-rule strong { font-size: .95rem; }
.st-rule span { color: var(--muted); font-size: .8rem; }
.st-rule[data-ok="1"] { background: var(--success-tint); color: var(--success); }
.st-rule[data-ok="0"] { background: var(--warn-tint); color: var(--warn); }
.st-props { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.st-props > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash); }
.st-props dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.st-props dd { margin: 3px 0 0; font-size: 1.2rem; font-weight: 720; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.st-smiles { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.st-smiles > span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.st-smiles code { flex: 1 1 260px; min-width: 0; padding: 8px 12px; border-radius: 8px; background: var(--wash); border: 1px solid var(--line); font-size: .86rem; overflow-wrap: anywhere; }

.st-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.st-steps > div { display: grid; gap: 6px; align-content: start; }
.st-steps span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: .9rem; }
.st-steps strong { font-size: 1.05rem; }
.st-steps p { margin: 0; color: var(--ink-2); line-height: 1.55; font-size: .96rem; }
.st-next { margin-top: 36px; }
.st-next h2 { margin: 0 0 14px; font-size: 1.2rem; }
.st-next-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.st-next-links a { display: grid; gap: 3px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-decoration: none; }
.st-next-links a:hover { border-color: var(--teal); }
.st-next-links span { color: var(--muted); font-size: .9rem; }

@media (max-width: 960px) {
  .st-wrap { padding: 0 12px 28px; }
  .st-panes { grid-template-columns: 1fr; }
  .st-pane { height: 480px; }
  .st-pane + .st-pane { border-left: 0; border-top: 1px solid var(--line); }
  .st-actions { margin-left: 0; }
  .st-steps, .st-next-links { grid-template-columns: 1fr; }
  .st-tools { margin-left: 0; }
}
html[data-theme="dark"] .st-app { background: var(--surface); }
