:root {
  color-scheme: dark;
  --bg: #0d1219;
  --panel: #171f2a;
  --field: #111923;
  --text: #edf1f6;
  --muted: #a0adbd;
  --line: #2b3746;
  --gold: #ddc18a;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, summary { cursor: pointer; }
[hidden] { display: none !important; }
.shell { max-width: 1200px; margin: 0 auto; padding: 26px 40px 20px; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.brand { display: block; min-width: 0; text-decoration: none; font-size: 27px; line-height: 1.25; font-weight: 600; letter-spacing: -.6px; }
.header-right { flex: 0 0 auto; display: flex; align-items: center; gap: 18px; font-size: 12px; color: var(--muted); }
.about-link { border: 0; background: transparent; color: var(--gold); padding: 10px 4px; min-height: 44px; font-size: 12px; }
.about-link:hover { color: var(--text); }
.workbench { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr); gap: 40px; align-items: start; }
.input-panel { min-width: 0; padding-top: 20px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 11px; font-size: 10px; font-weight: 600; letter-spacing: 1.6px; color: var(--muted); }
.intro .eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--gold); }
.intro h1 { font-size: clamp(27px, 2.5vw, 32px); font-weight: 600; line-height: 1.2; letter-spacing: -.9px; margin: 0 0 16px; text-wrap: balance; }
.intro > p:last-child { color: var(--muted); font-size: 14px; line-height: 1.75; max-width: 36ch; margin: 0 0 30px; }
.identity-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { min-width: 0; }
form label { display: block; margin: 0 0 9px; font-size: 12px; font-weight: 500; color: #c3cdd9; }
form input, form textarea { display: block; width: 100%; padding: 13px 14px; margin: 0 0 22px; color: var(--text); background: var(--field); border: 1px solid #344151; border-radius: var(--radius); box-shadow: inset 0 1px 2px #0002; font-size: 14px; line-height: 1.5; caret-color: var(--gold); transition: border-color .16s, background .16s, box-shadow .16s; }
form input { height: 48px; }
form textarea { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; min-height: 108px; max-height: 220px; resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #8391a3; opacity: 1; }
input:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: #536276; }
input:focus, textarea:focus { border-color: var(--gold); outline: 2px solid #ddc18a24; outline-offset: 2px; background: #141e29; box-shadow: none; }
input:disabled, textarea:disabled { opacity: .72; }
.help { color: var(--muted); font-size: 12px; line-height: 1.7; margin: -4px 0 22px; }
.actions + .help { margin: 12px 0 0; }
.actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.actions button { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; min-height: 48px; padding: 12px 17px; border-radius: var(--radius); font-size: 13px; font-weight: 600; transition: background .16s, border-color .16s, box-shadow .16s; }
.primary { background: var(--gold); border: 1px solid var(--gold); color: #231e14; box-shadow: 0 3px 12px #0002, inset 0 1px 0 #fff2; }
.primary::after { content: "→"; font-size: 17px; line-height: 1; }
.primary:disabled::after { content: none; }
.primary:hover:not(:disabled) { background: #ecd3a1; border-color: #ecd3a1; box-shadow: 0 4px 16px #0003; }
.secondary { color: #c9d2de; background: transparent; border: 1px solid #3b4859; }
.secondary:hover:not(:disabled) { border-color: #64748b; background: #1b2531; }
button:focus-visible, summary:focus-visible, a:focus-visible, .zoom-viewport:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: wait; }
.workflow { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 26px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.workflow strong { color: #cbd4df; font-size: 12px; font-weight: 500; }
.workflow p { margin: 4px 0 0; max-width: 36ch; }
.result-panel { padding: 24px; min-width: 0; background: var(--panel); border: 1px solid #344052; border-radius: 20px; box-shadow: 0 12px 36px #0002, inset 0 1px 0 #ffffff05; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; min-height: 68px; margin-bottom: 13px; }
.result-heading > div:first-child { min-width: 0; padding-top: 3px; }
.result-heading .eyebrow { font-size: 9px; letter-spacing: 1.5px; margin-bottom: 7px; }
.result-heading h2 { margin: 0; font-size: 23px; line-height: 1.3; font-weight: 600; letter-spacing: -.5px; overflow-wrap: anywhere; }
.name-detail { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.score-area { flex: 0 0 auto; text-align: right; padding-left: 20px; border-left: 1px solid var(--line); }
.score-area > span { color: var(--muted); font-size: 11px; letter-spacing: .2px; }
#score { font-size: 46px; line-height: 1.12; font-weight: 550; letter-spacing: -1.9px; font-variant-numeric: tabular-nums; margin-top: 2px; }
#score.gold { color: var(--gold); }
.result-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.result-tools button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 9px; min-height: 34px; border: 1px solid transparent; border-radius: 7px; color: #b7c5d5; background: transparent; font-size: 11px; font-weight: 500; line-height: 1.4; white-space: nowrap; transition: background .16s, border-color .16s, color .16s; }
.result-tools button:nth-child(-n+2) { background: #202b39; border-color: #334258; color: #d5dfe9; }
.result-tools button:hover:not(:disabled) { background: #2a3748; border-color: #52627a; color: #fff; }
.tool-icon { width: 14px; height: 14px; flex: 0 0 auto; }
.result-tools button:disabled, .dialog-footer button:disabled { opacity: .45; cursor: default; }
.tool-feedback { color: var(--gold); background: #ddc18a09; border-left: 2px solid #ddc18a66; border-radius: 2px; padding: 7px 10px; font-size: 12px; line-height: 1.6; margin: 0 0 12px; overflow-wrap: anywhere; }
.molecule-stage { height: clamp(260px, 34vh, 320px); display: flex; align-items: center; justify-content: center; border: 1px solid #293545; border-radius: 14px; background: #111923; overflow: hidden; }
.molecule-stage img { display: block; width: 100%; height: 100%; object-fit: contain; max-width: 600px; padding: 10px; }
.image-trigger { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 13px; background: transparent; cursor: zoom-in; }
.image-trigger:focus-visible { outline-offset: -3px; }
.image-trigger img { margin: 0 auto; }
.placeholder { color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 29ch; padding: 20px; text-align: center; }
.explanation { text-align: center; padding: 15px 0 20px; }
.legend { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px; font-size: 10px; color: #b2bdca; }
.legend-bar { width: 72px; height: 4px; border-radius: 3px; background: linear-gradient(90deg, #57a0dc, #dce1e8, #c7a34d); }
.status { font-size: 11px; color: var(--muted); line-height: 1.65; margin: 8px 0 0; }
.status.error { color: #e5ce9c; }
.status.busy::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 7px; animation: status-pulse 1.8s ease-in-out infinite; }
@keyframes status-pulse { 50% { opacity: .35; } }
.properties dl { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 0; padding-top: 17px; border-top: 1px solid #344052; }
.properties dl > div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.properties dt { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.properties dd { font-size: 16px; letter-spacing: .1px; margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.properties small { color: var(--muted); font-size: 11px; }
.properties sub { font-size: .7em; }
details { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 11px; }
summary { color: #b6c4d4; font-size: 11px; width: fit-content; padding: 4px 0; }
summary:hover { color: var(--text); }
details code { display: block; overflow-wrap: anywhere; white-space: normal; color: #c6d1df; font-size: 12px; line-height: 1.7; padding: 12px 0 2px; }
.source { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 10px 0 0; }
.source a { color: var(--gold); text-underline-offset: 3px; }
.reconnect { margin-top: 12px; padding: 8px 12px; background: transparent; color: var(--gold); border: 1px solid var(--line); border-radius: 6px; }
.skip-link { position: absolute; top: -60px; left: 18px; padding: 10px; background: var(--panel); z-index: 5; }
.skip-link:focus { top: 10px; }
noscript { display: block; padding: 20px; color: var(--gold); }
/* Full-size image viewer */
.image-dialog { width: min(960px, calc(100vw - 40px)); max-width: none; max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid #46566c; border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: 0 24px 90px #0008; overflow: auto; }
.image-dialog::backdrop { background: #05080be0; }
.modal-open { overflow: hidden; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dialog-heading h2 { font-size: 22px; font-weight: 600; letter-spacing: -.4px; margin: 0; overflow-wrap: anywhere; }
.dialog-close { background: #202b39; border: 1px solid #34445a; border-radius: 9px; color: var(--text); font-size: 25px; line-height: 1; width: 40px; height: 40px; flex: 0 0 auto; }
.dialog-close:hover { background: #2a3748; }
.zoom-viewport { height: min(58dvh, 540px); overflow: auto; background: #111923; border-radius: 12px; border: 1px solid var(--line); overscroll-behavior: contain; }
.zoom-canvas { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; }
.zoom-canvas img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.zoom-150 .zoom-canvas { width: 150%; height: 150%; }
.zoom-200 .zoom-canvas { width: 200%; height: 200%; }
.zoom-250 .zoom-canvas { width: 250%; height: 250%; }
.zoom-300 .zoom-canvas { width: 300%; height: 300%; }
.dialog-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.dialog-footer button { border: 1px solid #3b4b60; background: #202b39; color: #c9d2de; border-radius: 8px; padding: 8px 11px; font-size: 12px; min-height: 36px; line-height: 1.4; }
.dialog-footer button:hover:not(:disabled) { background: #2a3748; border-color: #64748b; }
.zoom-controls { display: flex; align-items: center; gap: 6px; }
.zoom-controls button { min-width: 36px; }
.zoom-controls output { width: 48px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.image-note { color: var(--muted); font-size: 11px; margin: 12px 0 0; }
.image-dialog .tool-feedback { margin: 10px 0 0; }
.about-dialog { width: min(700px, calc(100vw - 40px)); max-width: none; max-height: calc(100dvh - 40px); padding: 28px; border: 1px solid #46566c; border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: 0 24px 90px #0008; overflow: auto; overscroll-behavior: contain; }
.about-dialog::backdrop { background: #05080be0; }
.about-dialog .dialog-heading { position: sticky; top: 0; z-index: 1; background: var(--panel); box-shadow: 0 -28px 0 var(--panel), 0 10px 12px var(--panel); }
.about-content { color: #bac6d4; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.about-definition { color: var(--gold); padding: 16px 18px; background: #ddc18a08; border-left: 2px solid #ddc18a66; border-radius: 3px; }
.about-definition strong { color: var(--text); font-size: 18px; font-weight: 600; }
.about-content section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.about-content h3 { color: var(--text); font-size: 15px; font-weight: 600; margin: 0 0 9px; }
.about-content p { margin: 0 0 12px; }
.about-content p:last-child { margin-bottom: 0; }
.about-success { margin-bottom: 22px; }
.about-gallery-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; color: var(--text); background: #ddc18a0d; border: 1px solid #ddc18a33; border-left: 3px solid #d4b778; border-radius: 3px; text-decoration: none; }
.about-gallery-link:hover { background: #ddc18a18; border-color: #d4b778; }
.about-gallery-copy { min-width: 0; }
.about-gallery-copy strong { display: block; font-size: 18px; font-weight: 600; line-height: 1.5; }
.about-gallery-name { display: block; margin-top: 4px; color: var(--gold); font-size: 16px; }
.about-gallery-arrow { flex-shrink: 0; color: #d4b778; font-size: 24px; line-height: 1; }
.about-gallery-wordmark { color: #d4b778; font-family: Baskerville, "Palatino Linotype", Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.08em; letter-spacing: 0; }
.about-scores { margin: 0 0 12px; }
.about-scores > div { margin-bottom: 12px; }
.about-scores dt { color: var(--gold); font-weight: 500; }
.about-scores dd { margin: 2px 0 0; }
@media (max-width: 1000px) and (min-width: 761px) {
  .shell { padding: 24px; }
  .workbench { grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); gap: 26px; }
  .identity-fields { grid-template-columns: 1fr; gap: 0; }
  .intro h1 { font-size: 29px; }
  .result-panel { padding: 20px; }
  .score-area { padding-left: 12px; }
  #score { font-size: 40px; }
  .result-heading h2 { font-size: 20px; }
  .result-tools { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { padding: 20px 18px; }
  .header { padding-bottom: 18px; margin-bottom: 25px; }
  .brand { font-size: 20px; }
  .workbench { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .input-panel { padding-top: 0; }
  .intro h1 { font-size: 27px; text-wrap: initial; }
  .intro > p:last-child { max-width: none; font-size: 13px; margin-bottom: 24px; }
  .identity-fields { gap: 12px; }
  form input, form textarea { font-size: 16px; margin-bottom: 18px; padding: 12px; }
  form textarea { min-height: 104px; }
  .help { font-size: 11px; margin-bottom: 19px; }
  .actions button { min-height: 48px; padding: 12px; }
  .workflow { display: none; }
  .result-panel { padding: 20px 16px; border-radius: 18px; }
  .result-heading { gap: 12px; min-height: 64px; margin-bottom: 12px; }
  .result-heading h2 { font-size: 20px; }
  .result-heading .eyebrow { font-size: 8px; letter-spacing: 1.15px; }
  .score-area { padding-left: 12px; }
  #score { font-size: 37px; letter-spacing: -1.4px; }
  .result-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 14px; }
  .result-tools button { min-height: 40px; font-size: 11px; }
  .molecule-stage { height: 260px; }
  .molecule-stage img { padding: 8px; }
  .legend { font-size: 9px; gap: 6px; }
  .legend-bar { width: 48px; }
  .explanation { padding: 14px 0 18px; }
  .properties dl { gap: 14px; }
  .properties dl > div + div { padding-left: 14px; }
  .properties dd { font-size: 15px; }
  .image-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 16px; border-radius: 14px; }
  .about-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 20px; border-radius: 14px; }
  .about-content { font-size: 13px; }
  .dialog-heading h2 { font-size: 19px; }
  .zoom-viewport { height: 52dvh; }
  .dialog-footer { gap: 10px; }
  .dialog-footer button { min-height: 40px; padding: 8px 10px; }
  .zoom-canvas img { padding: 10px; }
}
@media (max-width: 350px) {
  .shell { padding: 18px 14px; }
  .identity-fields { grid-template-columns: 1fr; gap: 0; }
  .score-area { padding-left: 8px; }
  #score { font-size: 32px; }
  .result-heading h2 { font-size: 18px; }
  .legend { font-size: 8px; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.usage-stat{margin:20px 0 0;color:var(--muted);font-size:12px;font-variant-numeric:tabular-nums;letter-spacing:.02em}.usage-stat [data-count]{color:inherit}
