:root {
  --color-primary: #0F2942;
  --color-primary-dark: #081B30;
  --color-primary-light: #1B3A5C;
  --color-accent: #14B8A6;
  --color-accent-dark: #0F9488;
  --color-cta: #F97316;
  --color-cta-dark: #EA580C;
  --color-allowed: #16A34A;
  --color-flagged: #F59E0B;
  --color-blocked: #DC2626;
  --color-bg: #FFFFFF;
  --color-bg-soft: #F8FAFC;
  --color-bg-muted: #EEF2F7;
  --color-text: #0F172A;
  --color-text-muted: #5A6478;
  --color-border: #E2E8F0;
  --shadow-sm: 0 1px 2px rgba(15, 41, 66, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 41, 66, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 41, 66, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 1180px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 46px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--color-primary);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--color-accent-dark); text-decoration: none; }
.nav-links a.active { color: var(--color-accent-dark); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s, opacity 0.2s;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links li { width: 100%; border-top: 1px solid var(--color-border); }
  .nav-links a { display: block; padding: 16px 24px; }
  .nav-links .btn { margin: 12px 24px; display: inline-block; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  text-align: center;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-cta);
  color: #fff;
  border-color: var(--color-cta);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-cta-dark); border-color: var(--color-cta-dark); color: #fff; }

.btn-secondary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(ellipse at 80% -10%, rgba(20, 184, 166, 0.18), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(15, 41, 66, 0.06), transparent 55%),
    linear-gradient(180deg, #FBFCFE 0%, #F4F7FB 100%);
  padding: 80px 0 90px;
  border-bottom: 1px solid var(--color-border);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  margin-bottom: 18px;
}
.hero .lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  margin-bottom: 28px;
  max-width: 540px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
  background: rgba(20, 184, 166, 0.1);
  padding: 6px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}

@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0 64px; }
}

/* ---------- Decision Card (hero visual) ---------- */
.decision-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px;
  max-width: 460px;
  width: 100%;
  margin-left: auto;
}
.decision-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 16px;
}
.decision-card-head .label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}
.decision-card-head .file {
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--color-primary);
  background: var(--color-bg-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.decision-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.92rem;
}
.decision-row + .decision-row { border-top: 1px dashed var(--color-border); }
.decision-row .name { color: var(--color-primary); font-weight: 500; }
.decision-row .meta { color: var(--color-text-muted); font-size: 0.82rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
}
.badge-allowed { background: rgba(22, 163, 74, 0.12); color: var(--color-allowed); }
.badge-flagged { background: rgba(245, 158, 11, 0.15); color: #B45309; }
.badge-blocked { background: rgba(220, 38, 38, 0.12); color: var(--color-blocked); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Sections ---------- */
section { padding: 80px 0; }
section.alt { background: var(--color-bg-soft); }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head .eyebrow { margin-bottom: 12px; }
.section-head p { font-size: 1.08rem; color: var(--color-text-muted); }

@media (max-width: 700px) {
  section { padding: 56px 0; }
  .section-head { margin-bottom: 36px; }
}

/* ---------- Grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 880px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #CBD5E1; }
.card .icon-circle {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(20, 184, 166, 0.12);
  color: var(--color-accent-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.card p { color: var(--color-text-muted); margin: 0; font-size: 0.95rem; }

/* ---------- Problem list ---------- */
.problem-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 32px;
}
.problem-list li {
  display: flex; gap: 12px;
  padding: 16px 0;
  color: var(--color-text);
  font-size: 0.98rem;
  border-bottom: 1px solid var(--color-border);
}
.problem-list .x {
  flex: 0 0 22px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-blocked);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  margin-top: 2px;
}
@media (max-width: 700px) { .problem-list { grid-template-columns: 1fr; } }

/* ---------- How it works ---------- */
.steps { counter-reset: step; }
.step {
  position: relative;
  padding: 28px 28px 28px 80px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 28px; left: 28px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--color-text-muted); margin: 0; }

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 980px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}
.tier {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.tier.featured {
  border: 2px solid var(--color-accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}
.tier.featured .tier-badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
}
.tier h3 { font-size: 1.4rem; margin-bottom: 4px; }
.tier .tier-tag { color: var(--color-text-muted); font-size: 0.92rem; margin-bottom: 22px; }
.price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--color-border);
}
.price .amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}
.price .unit { color: var(--color-text-muted); font-size: 0.92rem; }
.price .custom { font-size: 1.4rem; font-weight: 700; color: var(--color-primary); }

.feature-list { list-style: none; padding: 0; margin: 0 0 28px; flex: 1; }
.feature-list li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--color-text);
}
.feature-list li::before {
  content: "";
  flex: 0 0 18px;
  width: 18px; height: 18px;
  margin-top: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2314B8A6'><path d='M16.7 5.3a1 1 0 010 1.4l-7.4 7.4a1 1 0 01-1.4 0L3.3 9.5a1 1 0 011.4-1.4l3.9 3.9 6.7-6.7a1 1 0 011.4 0z'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
}
.feature-list .group {
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 14px;
  padding-bottom: 4px;
}
.feature-list .group::before { display: none; }
.feature-list .group:first-child { margin-top: 0; }

.compare-note {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 32px;
}

.price-overage {
  margin: -12px 0 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
.price-overage strong { color: var(--color-primary); font-weight: 700; }

/* ---------- Value Band ---------- */
.value-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.value-item {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.value-figure {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.value-item p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .value-band { grid-template-columns: 1fr; }
}

/* ---------- CTA Band ---------- */
.cta-band {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(20, 184, 166, 0.25), transparent 50%),
    var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin: 0 0 8px; }
.cta-band p { color: rgba(255, 255, 255, 0.8); margin: 0; max-width: 580px; }
.cta-band .btn-primary { background: var(--color-cta); border-color: var(--color-cta); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.75);
  padding: 56px 0 32px;
  margin-top: 0;
  font-size: 0.9rem;
}
.site-footer a { color: rgba(255, 255, 255, 0.85); }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 24px;
}
.footer-brand p { color: rgba(255, 255, 255, 0.65); max-width: 320px; margin-top: 12px; }
.footer-col h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Forms ---------- */
.form {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  max-width: 560px;
  width: 100%;
}
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.form-row textarea { resize: vertical; min-height: 120px; }
.form .btn { width: 100%; }
.form-note { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 12px; text-align: center; }

/* ---------- Page Header (sub-pages) ---------- */
.page-head {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(20, 184, 166, 0.12), transparent 50%),
    linear-gradient(180deg, #FBFCFE 0%, #F4F7FB 100%);
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}
.page-head .eyebrow { margin-bottom: 12px; }
.page-head p { font-size: 1.1rem; color: var(--color-text-muted); max-width: 640px; margin: 0 auto; }

/* ---------- Contact layout ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: start;
}
.contact-info h3 { margin-top: 28px; }
.contact-info h3:first-child { margin-top: 0; }
.contact-info p { color: var(--color-text-muted); }
.contact-info a { font-weight: 600; }
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; gap: 36px; } }

/* Honeypot: off-screen for humans, irresistible to bots. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Screenshots ---------- */
.screenshot {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  overflow: hidden;
}

.hero .screenshot { max-width: 540px; margin-left: auto; }

.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 32px 0;
}
.showcase.reverse { direction: rtl; }
.showcase.reverse > * { direction: ltr; }
.showcase + .showcase { margin-top: 32px; }
.showcase h3 { font-size: 1.5rem; margin-bottom: 14px; }
.showcase p { color: var(--color-text-muted); font-size: 1.02rem; }
.showcase .eyebrow { margin-bottom: 14px; }
.showcase ul {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.showcase ul li {
  position: relative;
  padding: 6px 0 6px 26px;
  color: var(--color-text);
  font-size: 0.96rem;
}
.showcase ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 11px;
  width: 16px; height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2314B8A6'><path d='M16.7 5.3a1 1 0 010 1.4l-7.4 7.4a1 1 0 01-1.4 0L3.3 9.5a1 1 0 011.4-1.4l3.9 3.9 6.7-6.7a1 1 0 011.4 0z'/></svg>");
  background-repeat: no-repeat;
}
@media (max-width: 880px) {
  .showcase { grid-template-columns: 1fr; gap: 32px; padding: 16px 0; }
  .showcase.reverse { direction: ltr; }
  .showcase + .showcase { margin-top: 0; }
}

/* ---------- Tools ---------- */
.tool-panel {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
  max-width: 860px;
  margin: 0 auto;
}
.tool-panel > label,
.tier2-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.tool-hint {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-align: center;
  padding: 24px 0;
  margin: 0;
}

/* Type-ahead picker */
.picker { position: relative; }
.picker-input,
.qty-input,
.sg-input,
.unit-input,
.conv-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.picker-input:focus,
.qty-input:focus,
.sg-input:focus,
.unit-input:focus,
.conv-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.picker-input { font-size: 1.05rem; }

.picker-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 50;
  list-style: none;
  margin: 0; padding: 4px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
}
.picker-results.open { display: block; }
.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
}
.picker-item:hover,
.picker-item.active { background: var(--color-bg-muted); }
.picker-name { color: var(--color-primary); font-weight: 500; }
.picker-cas {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-left: auto;
}
.picker-empty { padding: 14px 12px; font-size: 0.92rem; color: var(--color-text-muted); }
.pill {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 100px;
}
.pill-ehs { background: rgba(245, 158, 11, 0.16); color: #B45309; }

/* Result cards */
.result-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}
.result-card.is-over { border-color: rgba(245, 158, 11, 0.55); }
.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 18px;
}
.result-head h3 { margin: 0 0 2px; font-size: 1.3rem; }
.result-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.verdict {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 100px;
  white-space: nowrap;
}
.verdict-ok { background: rgba(22, 163, 74, 0.12); color: var(--color-allowed); }
.verdict-flag { background: rgba(245, 158, 11, 0.16); color: #B45309; }

.result-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.result-table th,
.result-table td { text-align: left; padding: 11px 0; vertical-align: top; }
.result-table th {
  color: var(--color-text-muted);
  font-weight: 500;
  width: 46%;
  padding-right: 20px;
}
.result-table td { color: var(--color-text); }
.result-table tr + tr th,
.result-table tr + tr td { border-top: 1px dashed var(--color-border); }
.result-table code {
  font-size: 0.9rem;
  background: var(--color-bg-muted);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.result-basis {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--color-bg-soft);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}
.result-note {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--color-flagged);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: var(--color-text);
}
.result-note strong, .agg-note strong { color: #B45309; }
.agg-note {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: rgba(20, 184, 166, 0.08);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
}
.agg-note strong { color: var(--color-accent-dark); }

.result-cta {
  margin-top: 24px;
  padding: 22px 24px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.result-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  max-width: 520px;
}
.result-cta strong { color: #fff; }
.result-cta .btn { flex: 0 0 auto; }

/* Tier II multi-row */
.tier2-row {
  display: grid;
  grid-template-columns: 1fr 150px 170px auto;
  gap: 14px;
  align-items: end;
  padding: 16px 0;
}
.tier2-row + .tier2-row { border-top: 1px dashed var(--color-border); }
.tier2-row .tier2-sg { grid-column: 2 / 4; grid-row: 2; }
.tier2-remove {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  width: 42px; height: 44px;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  /* Span every row so it stays centred against the fields it removes,
     whether or not the specific-gravity row is showing. */
  grid-column: 4;
  grid-row: 1 / -1;
  align-self: center;
}
.tier2-remove:hover { border-color: var(--color-blocked); color: var(--color-blocked); }
.tier2-remove .rm-text { display: none; }
.tier2-actions { margin-top: 18px; }
.tier2-summary {
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--color-bg-muted);
  border-radius: var(--radius-md);
  font-size: 1.02rem;
  color: var(--color-primary);
}
.tier2-summary strong { color: var(--color-accent-dark); }

.math-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.math-total { font-size: 1.8rem; font-weight: 800; color: var(--color-primary); letter-spacing: -0.02em; }
.math-vs { color: var(--color-text-muted); font-size: 0.9rem; }
.math-thr { font-size: 1.05rem; color: var(--color-text-muted); font-weight: 600; }
.meter {
  height: 8px;
  background: var(--color-bg-muted);
  border-radius: 100px;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  background: var(--color-accent);
  border-radius: 100px;
  transition: width 0.25s ease;
}
.result-card.is-over .meter span { background: var(--color-flagged); }

@media (max-width: 760px) {
  .tier2-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tier2-row .tier2-chem { grid-column: 1 / -1; }
  .tier2-row .tier2-sg { grid-column: 1 / -1; grid-row: auto; }
  /* A 42px "×" is a poor tap target and reads as orphaned once it wraps to
     its own line — become a labelled full-width button instead. */
  .tier2-remove {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
    height: auto;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
  }
  .tier2-remove .rm-x { display: none; }
  .tier2-remove .rm-text { display: inline; }
  .tool-panel { padding: 24px 20px; }
}

/* Converter */
.conv-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: end;
  margin-top: 22px;
}
.conv-swap {
  padding-bottom: 12px;
  color: var(--color-text-muted);
  font-size: 1.3rem;
}
.conv-sg-row { margin-top: 18px; max-width: 260px; }
.conv-basis {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}
.conv-readout {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.conv-figure {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--color-accent-dark);
  letter-spacing: -0.02em;
}
.conv-unit { color: var(--color-text-muted); font-size: 1rem; }
.conv-formula { margin: 0 0 8px; }
.conv-formula code {
  font-size: 0.88rem;
  background: var(--color-bg-muted);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
}
.conv-worked { margin: 0; color: var(--color-text-muted); font-size: 0.95rem; }
.conv-worked strong { color: var(--color-primary); }
.conv-threshold {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}
.conv-threshold p { margin: 10px 0 0; color: var(--color-text-muted); font-size: 0.93rem; }
@media (max-width: 640px) {
  .conv-grid { grid-template-columns: 1fr; }
  .conv-swap { display: none; }
}

/* Provenance stamp — populated by tools.js from CHEM_META */
.data-provenance {
  max-width: 860px;
  margin: 20px auto 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-align: right;
}
.data-provenance:empty { display: none; }

/* Tool disclaimer + cross-links */
.tool-disclaimer {
  max-width: 860px;
  margin: 28px auto 0;
  padding: 18px 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-soft);
  font-size: 0.88rem;
  color: var(--color-text-muted);
}
.tool-disclaimer strong { color: var(--color-primary); }

.tool-card { display: flex; flex-direction: column; }
.tool-card h3 { margin-bottom: 8px; }
.tool-card p { flex: 1; }
.tool-card .tool-link {
  margin-top: 16px;
  font-weight: 600;
  font-size: 0.95rem;
}

.faq-block { max-width: 860px; margin: 0 auto; }
.faq-item { padding: 22px 0; border-bottom: 1px solid var(--color-border); }
.faq-item:first-child { padding-top: 0; }
.faq-item h3 { font-size: 1.08rem; margin-bottom: 8px; }
.faq-item p { margin: 0; color: var(--color-text-muted); font-size: 0.97rem; }
.faq-item p + p { margin-top: 10px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.muted { color: var(--color-text-muted); }
