:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5b6775;
  --line: #d8dee5;
  --paper: #ffffff;
  --canvas: #f4f7f8;
  --soft-blue: #eef3ff;
  --soft-teal: #e9f7f4;
  --soft-warm: #fff6e8;
  --blue: #2356c4;
  --blue-dark: #173e94;
  --teal: #0b736d;
  --green: #18754b;
  --amber: #9a5a00;
  --red: #b42318;
  --red-soft: #fff0ee;
  --radius: 6px;
  --shadow: 0 12px 30px rgba(23, 32, 42, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--blue);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue-dark);
}

button,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  min-height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #9db0ba;
  border-radius: 5px;
  background: var(--soft-teal);
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.nav-links a {
  color: #44505d;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-cta {
  padding: 8px 12px;
  border: 1px solid #adc0ff;
  border-radius: 5px;
  background: var(--soft-blue);
  color: var(--blue) !important;
  font-weight: 700;
}

.page-intro {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.52fr);
  gap: 44px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 760px;
  margin: 18px 0 0;
  color: #495563;
  font-size: 18px;
}

.privacy-note {
  margin: 0;
  padding: 16px 18px;
  border-left: 4px solid var(--teal);
  background: var(--soft-teal);
  color: #244943;
  font-size: 14px;
}

.tool-band {
  padding: 0 0 56px;
}

.tool-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  border: 1px solid #cdd6dd;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool-toolbar {
  min-height: 54px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fbfcfd;
}

.tool-title {
  margin: 0;
  font-size: 15px;
  font-weight: 780;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.local-badge::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.86fr);
  min-height: 630px;
}

.input-panel,
.result-panel {
  min-width: 0;
  padding: 24px;
}

.input-panel {
  border-right: 1px solid var(--line);
}

.panel-heading {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.25;
}

.panel-heading-spaced {
  margin-top: 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: #35404c;
  font-size: 13px;
  font-weight: 750;
}

select,
textarea {
  width: 100%;
  border: 1px solid #b9c3cc;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}

select {
  height: 42px;
  padding: 0 36px 0 11px;
}

textarea {
  min-height: 250px;
  resize: vertical;
  padding: 13px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
}

select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(35, 86, 196, 0.24);
  outline-offset: 2px;
}

.form-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid #aab4bf;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 720;
  text-decoration: none;
}

.button:hover {
  border-color: #7d8996;
  background: #f6f8fa;
}

.button-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

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

.button-subtle {
  border-color: transparent;
  background: transparent;
  color: #4c5967;
}

.field-footnote {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.result-panel {
  background: #fbfcfd;
}

.empty-result {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.empty-result img {
  width: 100%;
  max-height: 255px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  object-fit: cover;
  object-position: top;
}

.empty-result p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
}

.result-status {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left-width: 6px;
  border-radius: 5px;
  background: #fff;
}

.result-status[data-tier="GREEN"] {
  border-left-color: var(--green);
  background: #eef9f2;
}

.result-status[data-tier="AMBER"] {
  border-left-color: var(--amber);
  background: var(--soft-warm);
}

.result-status[data-tier="RED"] {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.result-label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.result-score {
  margin: 0;
  font-size: 25px;
  font-weight: 820;
  line-height: 1.2;
}

.result-summary {
  margin: 7px 0 0;
  color: #384552;
}

.finding-list {
  display: grid;
  gap: 10px;
}

.finding {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.finding-meta {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.finding h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.35;
}

.finding p {
  margin: 5px 0 0;
  color: #4a5663;
  font-size: 13px;
}

.finding code {
  display: block;
  max-height: 84px;
  overflow: auto;
  margin: 8px 0;
  padding: 8px;
  border-radius: 4px;
  background: #f3f5f7;
  color: #24303b;
  font-size: 12px;
  white-space: pre-wrap;
}

.unknowns {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.unknowns li {
  padding: 8px 0 8px 24px;
  border-bottom: 1px solid #e4e8ec;
  color: #465260;
  font-size: 13px;
  position: relative;
}

.unknowns li::before {
  position: absolute;
  left: 2px;
  content: "[ ]";
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.result-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.copy-status {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--green);
  font-size: 12px;
}

.upgrade-strip {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #b9c8f5;
  border-radius: 5px;
  background: var(--soft-blue);
}

.upgrade-strip h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.upgrade-strip p {
  margin: 0 0 12px;
  color: #394967;
  font-size: 13px;
}

.content-band {
  padding: 58px 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.content-band.alt {
  background: #eef2f4;
}

.content-wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.section-head {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.1;
}

.section-head p {
  margin: 12px 0 0;
  color: var(--muted);
}

.signal-grid,
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.signal,
.guide-link {
  min-width: 0;
  border-top: 3px solid var(--teal);
  padding: 18px 0 0;
}

.signal:nth-child(2),
.guide-link:nth-child(2),
.guide-link:nth-child(5) {
  border-top-color: var(--blue);
}

.signal:nth-child(3),
.guide-link:nth-child(3) {
  border-top-color: var(--amber);
}

.signal h3,
.guide-link h3 {
  margin: 0 0 7px;
  font-size: 17px;
}

.signal p,
.guide-link p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.guide-link {
  display: block;
  padding-bottom: 16px;
  color: var(--ink);
  text-decoration: none;
}

.guide-link:hover h3 {
  color: var(--blue);
}

.comparison {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.comparison th,
.comparison td {
  padding: 14px 16px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.comparison th {
  background: #f6f8fa;
  font-size: 13px;
}

.comparison td {
  font-size: 14px;
}

.cta-row {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  background: #17202a;
  color: #d7dee5;
}

.footer-wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 13px;
}

.site-footer a {
  color: #c9d7ff;
}

.case-hero {
  padding: 58px 0 34px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.case-hero-inner,
.case-layout {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.case-hero h1 {
  max-width: 900px;
  font-size: clamp(34px, 5vw, 54px);
}

.case-deck {
  max-width: 800px;
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.case-layout {
  padding: 44px 0 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 54px;
  align-items: start;
}

.case-article {
  min-width: 0;
}

.case-article h2 {
  margin: 38px 0 12px;
  font-size: 27px;
  line-height: 1.2;
}

.case-article h2:first-child {
  margin-top: 0;
}

.case-article h3 {
  margin: 24px 0 8px;
  font-size: 19px;
}

.case-article p,
.case-article li {
  color: #3f4b57;
}

.case-article pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 17px;
  border: 1px solid #cbd4dc;
  border-radius: 5px;
  background: #17202a;
  color: #eaf0f4;
  font-size: 13px;
  line-height: 1.55;
}

.risk-callout {
  margin: 20px 0;
  padding: 17px;
  border: 1px solid #efb9b2;
  border-left: 6px solid var(--red);
  border-radius: 5px;
  background: var(--red-soft);
}

.risk-callout strong {
  display: block;
  margin-bottom: 5px;
}

.case-rail {
  position: sticky;
  top: 84px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.case-rail h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.case-rail p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.case-rail .button {
  width: 100%;
  display: block;
  margin-top: 10px;
  text-align: center;
}

.source-list {
  padding-left: 19px;
}

.source-list li {
  margin: 7px 0;
}

.guide-index {
  min-height: calc(100vh - 170px);
  padding: 56px 0 74px;
}

@media (max-width: 900px) {
  .page-intro,
  .tool-grid,
  .case-layout {
    grid-template-columns: 1fr;
  }

  .page-intro {
    gap: 24px;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .signal-grid,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-rail {
    position: static;
  }
}

@media (max-width: 650px) {
  .nav-wrap {
    width: min(100% - 22px, 1180px);
    min-height: 54px;
  }

  .nav-links a:not(.nav-cta) {
    display: none;
  }

  .page-intro,
  .tool-shell,
  .content-wrap,
  .case-hero-inner,
  .case-layout,
  .footer-wrap {
    width: min(100% - 22px, 1180px);
  }

  .page-intro {
    padding-top: 34px;
  }

  h1 {
    font-size: 37px;
  }

  .intro-copy,
  .case-deck {
    font-size: 16px;
  }

  .tool-toolbar,
  .footer-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .input-panel,
  .result-panel {
    padding: 18px;
  }

  .form-grid,
  .signal-grid,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 230px;
  }

  .comparison {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  .site-header,
  .input-panel,
  .content-band,
  .site-footer,
  .result-actions,
  .upgrade-strip {
    display: none !important;
  }

  body,
  .result-panel,
  .tool-shell {
    background: #fff;
    box-shadow: none;
  }

  .tool-grid {
    display: block;
  }
}
