:root {
  color-scheme: light;
  --bg: #f3f1eb;
  --ink: #101212;
  --muted: #626865;
  --panel: #fffefa;
  --line: #cfd3cd;
  --line-dark: #171a18;
  --accent: #83fb99;
  --accent-dark: #173e24;
  --danger: #b83227;
  --warn: #9b6516;
  --good: #1d6843;
  --shadow: 0 18px 50px rgba(16, 18, 18, 0.07);
  --sans: "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.app-shell { padding: 24px 22px 44px; }
.workspace { width: min(1380px, 100%); margin: 0 auto; }

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line-dark);
}
.wordmark {
  color: var(--ink);
  font-size: .94rem;
  font-weight: 900;
  letter-spacing: -.03em;
  text-decoration: none;
}
.wordmark span { display: inline-block; margin-left: 3px; padding: 2px 5px; background: var(--accent); }
.brand-links, .footer-links { display: flex; gap: 18px; align-items: center; }
.brand-links a, .footer-links a { color: var(--ink); font-size: .82rem; font-weight: 700; text-decoration: none; }
.brand-links a:hover, .footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.masthead { margin-bottom: 24px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: clamp(30px, 7vw, 110px);
  padding: clamp(42px, 7vw, 92px) 0 46px;
  align-items: end;
}
.eyebrow, .section-kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin: 0;
  font-size: clamp(4.4rem, 11vw, 10.3rem);
  line-height: .78;
  letter-spacing: -.085em;
  font-weight: 900;
}
.hero-tagline {
  margin: 28px 0 0;
  max-width: 760px;
  font-size: clamp(1.25rem, 2.6vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -.045em;
  font-weight: 650;
}
.hero-aside { padding-bottom: 6px; }
.privacy-line {
  display: inline;
  background: var(--accent);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 3px 5px;
  font-size: .93rem;
  line-height: 1.8;
  font-weight: 800;
}
.hero-description { margin: 24px 0 0; color: #343a37; font-size: 1rem; line-height: 1.62; }

.panel {
  margin: 14px 0;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(18px, 2.5vw, 30px);
}
.panel-heading { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.panel-heading h2, .about-panel h2 { margin: 0 0 6px; font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1; letter-spacing: -.045em; }
.panel-heading p { margin: 0; color: var(--muted); line-height: 1.5; }

.lookup-form label { display: grid; gap: 8px; color: var(--muted); font-family: var(--mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; margin-top: 8px; }
.lookup-row textarea { min-height: 132px; padding: 16px 18px; border-right: 0; }
input, select, textarea { width: 100%; border: 1px solid var(--line-dark); border-radius: 0; color: var(--ink); background: #fff; }
textarea { display: block; min-height: 260px; padding: 14px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(131, 251, 153, .55); outline-offset: 0; }
button, .source-actions a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  border: 1px solid var(--line-dark); border-radius: 0; padding: 0 18px;
  color: #0c110d; background: var(--accent); font-weight: 850; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.lookup-row button { min-width: 145px; }
.ghost-button { background: transparent; color: var(--ink); }
button:hover, .source-actions a:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--line-dark); }
button:disabled, .source-actions a[aria-disabled="true"] { opacity: .45; pointer-events: none; transform: none; box-shadow: none; }
.validation-message { min-height: 22px; margin: 10px 0 0; color: var(--danger); font-weight: 750; }
.trust-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: .7rem; }
.trust-strip span::before { content: "●"; margin-right: 7px; color: var(--good); }

.results-panel { margin: 14px 0; }
.pattern-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pattern-summary p { margin: 0; color: var(--muted); line-height: 1.4; }
.pattern-chip { border: 1px solid var(--line-dark); padding: 7px 10px; color: var(--ink); background: var(--accent); font-family: var(--mono); font-size: .72rem; font-weight: 800; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-dark); }
table { width: 100%; min-width: 1080px; border-collapse: collapse; background: #fff; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .84rem; line-height: 1.4; }
th { color: var(--ink); background: #ebece7; font-family: var(--mono); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
td { overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
td a { color: var(--accent-dark); font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
.result-row td:first-child { min-width: 190px; }
.row-toggle { min-width: 28px; min-height: 28px; margin-right: 8px; padding: 0; color: var(--ink); background: transparent; border: 1px solid var(--line-dark); font-size: .95rem; vertical-align: middle; }
.result-detail-row[hidden] { display: none; }
.result-detail-row td { padding: 0; background: #f6f6f1; }
.result-details { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 0; border-top: 1px solid var(--line-dark); }
.detail-block { display: grid; gap: 10px; align-content: start; padding: 18px; border-right: 1px solid var(--line); }
.detail-block:last-child { border-right: 0; }
.detail-block h3 { margin: 0; color: var(--muted); font-family: var(--mono); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.detail-block ul { display: grid; gap: 8px; margin: 0; padding-left: 18px; }
.quiet-result { color: var(--muted); }
.pivot-links { display: flex; flex-wrap: wrap; gap: 7px; }
.pivot-links a { border: 1px solid var(--line-dark); padding: 7px 9px; color: var(--ink); background: #fff; font-size: .78rem; font-weight: 800; text-decoration: none; }
.pivot-links a:hover { background: var(--accent); }

.cve-details { padding: 16px 20px; }
.cve-details h3 { font-size: 1rem; margin: 18px 0 8px; }
.cve-details h3:first-child { margin-top: 0; }
.cve-details p, .cve-details li { max-width: 100ch; line-height: 1.6; }
.cve-details li { margin-bottom: 12px; }
.cve-description { white-space: pre-wrap; }

.about-panel { margin: clamp(54px, 7vw, 96px) 0 24px; padding: 0; border-top: 1px solid var(--line-dark); }
.about-panel > div:first-child { display: grid; grid-template-columns: .7fr 1.3fr; gap: 20px; padding: 28px 0; }
.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.about-grid article { min-height: 230px; padding: 24px 24px 30px 0; border-right: 1px solid var(--line-dark); }
.about-grid article:not(:first-child) { padding-left: 24px; }
.about-grid article:last-child { border-right: 0; }
.about-grid span { font-family: var(--mono); font-size: .7rem; }
.about-grid h3 { margin: 55px 0 12px; font-size: 1.45rem; letter-spacing: -.03em; }
.about-grid p { margin: 0; color: var(--muted); line-height: 1.55; }

.site-footer { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; margin-top: 60px; padding: 24px 0 8px; border-top: 1px solid var(--line-dark); }
.footer-wordmark { display: inline-block; margin-bottom: 8px; }
.site-footer p, .footer-links { margin: 0; color: var(--muted); font-size: .78rem; }

/* Existing hidden/internal support elements */
.internal-state, .decision-card, .keyed-option { display: none !important; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.metric { display: grid; gap: 8px; padding: 15px; }
.network-grid { display: grid; grid-template-columns: 1.1fr 1fr 1.15fr; gap: 12px; }
.hash-list { font-family: var(--mono); }
.auto-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.auto-empty { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.auto-card { display: grid; gap: 9px; min-height: 132px; padding: 13px; border: 1px solid var(--line); background: #fff; }
.auto-badge { padding: 4px 8px; color: #fff; background: #6c777d; font-size: .72rem; font-weight: 850; }
.risk-high { color: var(--danger); }
.risk-medium { color: var(--warn); }
.risk-low { color: var(--good); }

.terms-shell { max-width: 980px; margin: 0 auto; }
.terms-header { padding: 58px 0 32px; border-bottom: 1px solid var(--line-dark); }
.terms-header h1 { font-size: clamp(3.4rem, 8vw, 7.8rem); line-height: .86; }
.terms-meta { margin-top: 22px; color: var(--muted); font-family: var(--mono); font-size: .75rem; }
.terms-content { padding: 34px 0 50px; }
.terms-content section { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 34px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.terms-content h2 { margin: 0; font-size: 1rem; }
.terms-content p, .terms-content li { color: #343a37; line-height: 1.65; }
.terms-content ul { margin: 0; padding-left: 20px; }
.legal-emphasis { font-weight: 800; color: var(--ink) !important; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-aside { max-width: 680px; }
  .result-details { grid-template-columns: 1fr 1fr; }
  .about-panel > div:first-child { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .app-shell { padding: 14px 12px 30px; }
  .brand-links { gap: 12px; }
  .hero-grid { padding-top: 46px; gap: 30px; }
  h1 { font-size: clamp(4rem, 21vw, 6.8rem); }
  .lookup-row { grid-template-columns: 1fr; gap: 8px; }
  .lookup-row textarea { border-right: 1px solid var(--line-dark); }
  .lookup-row button { min-height: 52px; }
  .panel-heading { flex-direction: column; }
  .result-details, .about-grid { grid-template-columns: 1fr; }
  .detail-block, .about-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .about-grid article, .about-grid article:not(:first-child) { min-height: 0; padding: 22px 0; }
  .about-grid h3 { margin-top: 26px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .footer-links { flex-direction: column; align-items: flex-start; gap: 8px; }
  .terms-content section { grid-template-columns: 1fr; gap: 10px; }
}
