/* ============================================================================
 * chem_atom.css
 * Root Atom Card, Classical Bohr SVG, Drawers, Docked Rail & Mobile Bottom Sheet
 * Part of [OAW-Chem] platform styles (<= 280 lines)
 * ============================================================================ */

/* Stage Workspace Layout */
.chem-curtain-pulled .chem-stage-workspace {
  display: flex; flex-direction: row; width: 100%; height: 100%; min-height: 0; flex: 1;
  position: relative; box-sizing: border-box; overflow: hidden;
}

.chem-atom-card-holder {
  flex: 1; display: flex; justify-content: center; align-items: flex-start;
  padding: 24px 16px; box-sizing: border-box; max-width: 860px; margin: 0 auto;
}

/* Root Atom Card */
.chem-root-atom-card {
  width: 100%; max-width: 580px; background: var(--bg-elevated);
  border: 1px solid var(--border-grid); border-radius: var(--radius-card, 12px);
  padding: 16px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  box-sizing: border-box; display: flex; flex-direction: column; gap: 12px;
}

.chem-atom-prose p {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; margin: 0; line-height: 1.45; font-size: 0.84rem;
}

/* Masthead */
.chem-atom-masthead {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; border-bottom: 1px solid var(--border-grid); padding-bottom: 12px;
}

.chem-atom-title {
  margin: 0 0 6px 0; font-family: var(--font-serif); font-size: 1.45rem;
  font-weight: 700; color: var(--ink-primary);
}

.chem-atom-symbol { font-family: var(--font-mono); color: var(--ink-secondary); }

.chem-atom-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.chem-pill {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px;
  background: var(--bg-recessed); border-radius: var(--radius-pill);
  color: var(--ink-secondary); border: 1px solid var(--border-grid);
}

.chem-pill.block-s { border-color: var(--chem-block-s); color: var(--chem-block-s); }
.chem-pill.block-p { border-color: var(--chem-block-p); color: var(--chem-block-p); }
.chem-pill.block-d { border-color: var(--chem-block-d); color: var(--chem-block-d); }
.chem-pill.block-f { border-color: var(--chem-block-f); color: var(--chem-block-f); }

.chem-edit-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  background: transparent; border: 1px solid var(--border-grid);
  border-radius: var(--radius-ui, 6px); font-size: 0.76rem; font-weight: 500;
  color: var(--ink-secondary); cursor: pointer; transition: all 120ms ease;
}

.chem-edit-btn:hover {
  background: var(--bg-recessed); color: var(--accent-link); border-color: var(--accent-link);
}

/* Visualizer Wrapper & Bohr Model SVG */
.chem-atom-visualizer-container {
  display: flex; justify-content: center; align-items: center; width: 100%;
}

.chem-atom-bohr-wrapper {
  position: relative; width: 320px; height: 320px; display: flex;
  justify-content: center; align-items: center;
}

.chem-bohr-svg { overflow: visible; user-select: none; }

.chem-shell-ring {
  fill: none; stroke: var(--border-grid); stroke-width: 1.2px; stroke-dasharray: 3 3;
}

.chem-shell-ring.valence-shell {
  stroke: var(--chem-valence); stroke-width: 1.6px; stroke-dasharray: none;
}

.chem-shell-label {
  font-size: 9px; font-family: var(--font-mono); fill: var(--ink-muted);
}

:root, [data-theme="white"], [data-theme="paper"] {
  --chem-nucleus-fill: #eff6ff; --chem-nucleus-stroke: #3b82f6; --chem-nucleus-ink: #1e3a8a;
}
[data-theme="dark-paper"], [data-theme="dark"] {
  --chem-nucleus-fill: rgba(59, 130, 246, 0.20); --chem-nucleus-stroke: #60a5fa; --chem-nucleus-ink: #dbeafe;
}

.chem-nucleus-circle {
  fill: var(--chem-nucleus-fill, #eff6ff); stroke: var(--chem-nucleus-stroke, #3b82f6);
  stroke-width: 1.5px; cursor: pointer; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.12));
}

.chem-nucleus-text, .chem-nucleus-label {
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
  text-anchor: middle; dominant-baseline: central; fill: var(--chem-nucleus-ink, #1e3a8a);
}

.chem-electron-dot {
  fill: var(--accent-link); stroke: var(--bg-elevated); stroke-width: 1px;
}

.chem-electron-dot.valence-pulse {
  fill: var(--chem-valence); animation: chemValencePulse 1.8s infinite ease-in-out;
}

@keyframes chemValencePulse {
  0%, 100% { r: 4px; filter: drop-shadow(0 0 2px var(--chem-valence)); }
  50% { r: 5.5px; filter: drop-shadow(0 0 7px var(--chem-valence)); }
}

.chem-dot-touch-target { fill: transparent; cursor: pointer; }

.chem-bohr-tooltip {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  background: var(--bg-recessed); border: 1px solid var(--border-grid);
  border-radius: var(--radius-ui, 6px); padding: 4px 10px; font-size: 0.74rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); pointer-events: none; white-space: nowrap;
}

.chem-bohr-tooltip.hidden { display: none; }

/* Accordion Drawers */
.chem-atom-drawers { display: flex; flex-direction: column; gap: 8px; }

.chem-drawer-accordion {
  border: 1px solid var(--border-grid); border-radius: var(--radius-ui, 8px);
  background: var(--bg-recessed); overflow: hidden;
}

.chem-drawer-summary {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; font-size: 0.84rem; font-weight: 600; cursor: pointer;
  color: var(--ink-primary); user-select: none; list-style: none !important;
}

.chem-drawer-summary::-webkit-details-marker,
.chem-drawer-summary::marker { display: none !important; }

.chem-drawer-body {
  padding: 10px 14px 14px 14px; font-size: 0.82rem; color: var(--ink-secondary);
  border-top: 1px solid var(--border-grid); background: var(--bg-elevated);
}

.chem-constants-table {
  width: 100%; border-collapse: collapse; font-size: 0.8rem;
}

.chem-constants-table th {
  text-align: left; padding: 4px 8px; color: var(--ink-muted); font-weight: 500;
}

.chem-constants-table td {
  padding: 4px 8px; color: var(--ink-primary); font-weight: 600;
}

.chem-sources-list {
  list-style: none; margin: 8px 0 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px;
}

.chem-source-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--accent-link);
  text-decoration: none; font-size: 0.78rem;
}

.chem-source-badge {
  font-size: 0.68rem; padding: 1px 6px; background: var(--bg-recessed);
  border-radius: var(--radius-pill); border: 1px solid var(--border-grid);
}

.chem-orbital-row {
  display: flex; justify-content: space-between; padding: 4px 0;
  border-bottom: 1px dashed var(--border-grid); font-family: var(--font-mono); font-size: 0.8rem;
}

/* Floating bottom-right pill & element rail removed in Sprint 8.2 (Browser-Style + New Tab model) */
.chem-element-rail-container, .chem-element-rail, .chem-mobile-rail-trigger, .chem-mobile-rail-drawer {
  display: none !important;
}

:root {
  --chem-het-o: #dc2626; --chem-het-n: #2563eb; --chem-het-p: #d97706;
  --chem-het-s: #ca8a04; --chem-het-f: #16a34a; --chem-het-cl: #0d9488; --chem-het-br: #b91c1c;
  --chem-rb: #9333ea; --chem-cs: #d97706; --chem-ba: #059669;
  --chem-kr: #0891b2; --chem-os: #0284c7; --chem-ir: #4f46e5; --chem-pt: #64748b;
}
[data-theme="dark"], [data-theme="dark-paper"], [data-theme="blueprint"] {
  --chem-het-o: #f87171; --chem-het-n: #60a5fa; --chem-het-p: #fbbf24;
  --chem-het-s: #eab308; --chem-het-f: #4ade80; --chem-het-cl: #2dd4bf; --chem-het-br: #f87171;
}

.chem-empty-tree-card {
  position: absolute; max-width: 420px; z-index: 2; box-sizing: border-box;
  padding: 14px 16px; border-radius: 10px; text-align: left;
  background: var(--bg-elevated, #ffffff);
  border: 1px solid var(--border-hairline, var(--border-grid, #e2e8f0));
  color: var(--ink-secondary, #475569);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.chem-empty-kicker {
  font-family: var(--font-mono, monospace); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted, #64748b);
  margin-bottom: 6px;
}
.chem-empty-body { margin: 0; font-size: 0.78rem; line-height: 1.48; color: var(--ink-secondary, #475569); }

/* Enriched Element & Molecule Drawer Sections */
.chem-specs-summary {
  margin: 0 0 6px; font-size: 0.71rem; line-height: 1.44; color: var(--ink-secondary);
}
.chem-specs-aliases {
  margin: 0 0 5px; font-size: 0.68rem; color: var(--ink-muted); line-height: 1.35;
}
.chem-specs-aliases span { font-weight: 600; color: var(--ink-primary); }
.chem-specs-orbitals { margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--border-grid); }
.chem-specs-subhead { display: block; font-size: 0.66rem; font-weight: 700; color: var(--ink-muted); margin-bottom: 2px; }
.chem-orbital-label { color: var(--ink-muted); font-family: var(--font-sans); font-size: 0.68rem; }
.chem-orbital-value { font-family: var(--font-mono); font-size: 0.69rem; font-weight: 600; color: var(--ink-primary); text-align: right; }
.chem-specs-note-row {
  margin-top: 6px; padding: 5px 7px; border-radius: 6px;
  background: var(--bg-recessed); border: 1px solid var(--border-hairline, var(--border-grid));
}
.chem-specs-note-lbl {
  display: block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--accent-link); margin-bottom: 2px;
}
.chem-specs-note-val { margin: 0; font-size: 0.69rem; line-height: 1.42; color: var(--ink-secondary); }
.chem-cite-badge { font-family: var(--font-mono); font-size: 0.60rem; color: var(--ink-muted); font-weight: 700; }


