:root {
  --ink: #17233f;
  --muted: #5d6980;
  --paper: #f7f9fc;
  --surface: #ffffff;
  --line: #dce3ed;
  --brand: #175e63;
  --brand-dark: #0e4549;
  --brand-soft: #e2f2f1;
  --accent: #d99645;
  --danger: #a23d45;
  --focus: #156fce;
  --shadow: 0 18px 55px rgba(28, 48, 79, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 90% 0, #e6f2f3 0, transparent 34rem), var(--paper); line-height: 1.55; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .62; }
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 14px; border-radius: 8px; color: white; background: var(--focus); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.site-header { border-bottom: 1px solid rgba(220, 227, 237, .82); background: rgba(255, 255, 255, .82); backdrop-filter: blur(16px); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: white; background: linear-gradient(145deg, var(--brand), #258d87); font-family: Georgia, serif; font-size: 1.55rem; box-shadow: 0 8px 20px rgba(23, 94, 99, .22); }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; font-size: 1.12rem; }
.brand small { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.usage { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #3c9c72; box-shadow: 0 0 0 4px #dff3e9; }

.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(310px, .7fr); gap: 52px; align-items: end; padding-block: 72px 42px; }
.eyebrow, .step { margin: 0 0 8px; color: var(--brand); font-size: .76rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { max-width: 790px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.25rem, 5vw, 4.35rem); font-weight: 500; letter-spacing: -.045em; line-height: 1.02; }
.lede { max-width: 680px; margin: 24px 0 0; color: var(--muted); font-size: 1.12rem; }
.privacy-callout { display: flex; gap: 15px; padding: 22px; border: 1px solid #cae2df; border-radius: 18px; background: rgba(240, 249, 248, .86); }
.privacy-callout h2 { margin: 0 0 6px; font-size: 1rem; }
.privacy-callout p { margin: 5px 0; color: #486568; font-size: .87rem; }
.callout-icon { flex: 0 0 38px; display: grid; place-items: center; height: 38px; border-radius: 12px; background: white; }
.fixture-banner { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; padding: 12px 16px; border: 1px solid #e3bc82; border-radius: 12px; color: #674516; background: #fff6e7; font-size: .9rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr); gap: 24px; align-items: stretch; }
.card, .results, .science-notes article { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.card { padding: clamp(22px, 4vw, 34px); }
.card-heading, .section-heading { display: flex; justify-content: space-between; gap: 22px; align-items: start; }
.card-heading h2, .section-heading h2, .science-notes h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.025em; }
.limit { padding-top: 25px; color: var(--muted); font-size: .76rem; }
label[for="smiles-input"], label[for="compound-name-input"] { display: block; margin: 25px 0 8px; font-weight: 700; font-size: .9rem; }
textarea { width: 100%; resize: vertical; min-height: 130px; padding: 16px; border: 1px solid #bdc8d7; border-radius: 12px; color: var(--ink); background: #fbfcfe; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .93rem; line-height: 1.55; }
textarea:focus { border-color: var(--focus); background: white; }
#compound-name-input { width: 100%; min-height: 45px; padding: 10px 13px; border: 1px solid #bdc8d7; border-radius: 11px; color: var(--ink); background: #fbfcfe; }
#compound-name-input:focus { border-color: var(--focus); background: white; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: .78rem; }
.input-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .78rem; }
.input-meta p { margin: 7px 0; }
.input-meta output { flex: 0 0 auto; margin-top: 7px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 13px 0 24px; color: var(--muted); font-size: .85rem; }
.text-button { padding: 2px 0; border: 0; border-bottom: 1px solid currentColor; color: var(--brand); background: transparent; }
.form-error { margin: -8px 0 16px; color: var(--danger); font-weight: 650; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 45px; padding: 10px 17px; border-radius: 11px; font-weight: 700; }
.primary-button { width: 100%; border: 1px solid var(--brand); color: white; background: var(--brand); }
.primary-button:hover { background: var(--brand-dark); }
.secondary-button { border: 1px solid #b8c7d7; color: var(--ink); background: white; }
.secondary-button:hover { border-color: var(--brand); color: var(--brand); }
.danger-button { margin-top: 24px; border: 1px solid #e4bfc1; color: var(--danger); background: #fff8f8; }

.status-badge { padding: 5px 10px; border-radius: 999px; font-size: .74rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.status-badge.idle { color: #526173; background: #edf1f5; }
.status-badge.queued, .status-badge.processing { color: #71501e; background: #fff0d6; }
.status-badge.completed { color: #1d694c; background: #e1f3e9; }
.status-badge.failed { color: var(--danger); background: #fbe6e7; }
.status-panel { min-height: 230px; display: grid; align-content: center; justify-items: center; padding: 28px 12px 12px; text-align: center; }
.status-panel h3 { margin: 18px 0 6px; font-size: 1.03rem; }
.status-panel p { max-width: 430px; margin: 0; color: var(--muted); font-size: .89rem; }
.progress-graphic { display: flex; gap: 8px; align-items: center; justify-content: center; width: 86px; height: 86px; border-radius: 50%; background: var(--brand-soft); }
.progress-graphic span { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: .6; }
.progress-graphic.active span { animation: pulse 1.2s infinite ease-in-out; }
.progress-graphic.active span:nth-child(2) { animation-delay: .16s; }
.progress-graphic.active span:nth-child(3) { animation-delay: .32s; }
@keyframes pulse { 0%, 70%, 100% { transform: translateY(0); opacity: .35; } 35% { transform: translateY(-7px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; } }

.results { margin-top: 28px; padding: clamp(22px, 4vw, 36px); }
.section-heading { align-items: end; }
.section-heading p:not(.eyebrow) { max-width: 670px; margin: 8px 0 0; color: var(--muted); }
.score-guide { margin-top: 25px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfe; }
.score-guide summary { padding: 16px 18px; color: var(--brand-dark); font-weight: 750; cursor: pointer; }
.score-guide-content { padding: 0 18px 20px; }
.score-guide-content > p { color: var(--muted); }
.table-shell { margin-top: 25px; overflow: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; min-width: 1010px; border-collapse: separate; border-spacing: 0; font-size: .82rem; }
th, td { padding: 13px 14px; border-bottom: 1px solid #e6ebf2; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; z-index: 1; color: #445268; background: #f3f6f9; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbfb; }
td:first-child, td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.feedback-card { margin-top: 28px; padding: 24px; border-radius: 14px; background: #f3f8f8; }
.feedback-card fieldset { margin: 0; padding: 0; border: 0; }
.feedback-card legend { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.feedback-card p { margin: 5px 0 16px; color: var(--muted); font-size: .84rem; }
.feedback-options { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 17px; }
.feedback-options label { display: inline-flex; gap: 7px; align-items: center; padding: 8px 11px; border: 1px solid #cbd8dc; border-radius: 999px; background: white; font-size: .84rem; }
#feedback-status { margin-left: 12px; color: var(--brand); font-size: .84rem; }

.science-notes, .public-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 28px; }
.science-notes { margin-bottom: 28px; }
.public-info { margin-bottom: 72px; }
.science-notes article, .public-info article { padding: clamp(23px, 4vw, 34px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.science-notes p:last-child { margin-bottom: 0; color: var(--muted); }
.public-info h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.025em; }
.public-info p { color: var(--muted); }
.public-info a { color: var(--brand); }
.citation-note { font-size: .84rem; }
#copy-citation-status { display: inline-block; margin-left: 10px; color: var(--brand); font-size: .84rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); background: white; }
footer .shell { min-height: 88px; display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: .84rem; }

[hidden] { display: none !important; }
@media (max-width: 860px) {
  .hero, .workspace, .science-notes, .public-info { grid-template-columns: 1fr; }
  .hero { gap: 30px; padding-top: 50px; }
  .status-panel { min-height: 180px; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 68px; }
  .usage { font-size: .76rem; }
  .usage .status-dot { display: none; }
  h1 { font-size: 2.25rem; }
  .hero { padding-block: 40px 28px; }
  .card-heading, .section-heading, footer .shell { align-items: stretch; flex-direction: column; }
  .limit { padding-top: 0; }
  .section-heading .secondary-button { width: 100%; }
  .input-meta { display: block; }
  .feedback-options { display: grid; }
  #feedback-status { display: block; margin: 10px 0 0; }
  footer .shell { justify-content: center; padding-block: 20px; }
}
