:root {
  --ink: #111827;
  --muted: #56657d;
  --soft: #eef3f7;
  --line: #d7e0ea;
  --panel: #ffffff;
  --teal: #006f73;
  --blue: #285ea8;
  --hold: #b3362d;
  --review: #a06b00;
  --pass: #19784b;
  --shadow: 0 18px 46px rgba(34, 54, 82, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #f8fafc;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 30;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
}

.skip-link:focus {
  top: 16px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.94);
  backdrop-filter: blur(12px);
}

.section-inner,
.header-inner {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.nav-links,
.button-row,
.control-row,
.section-heading,
.footer-inner,
.panel-title {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--teal);
  border-radius: var(--radius);
  color: var(--teal);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav-links {
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.nav-links a,
.button {
  text-decoration: none;
}

.hero {
  padding: 42px 0 34px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f7 100%);
}

.hero-grid,
.tool-grid,
.rule-board {
  display: grid;
  gap: 24px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  align-items: center;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.06;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.18;
}

.hero-lead {
  max-width: 760px;
  margin-bottom: 20px;
  color: #43546f;
  font-size: 18px;
}

.boundary-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 820px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.boundary-list li {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: #174b56;
  font-size: 14px;
  font-weight: 900;
}

.hero-panel,
.input-panel,
.result-panel,
.score-card,
.metric-grid article,
.result-block,
.example-card,
.rule-list article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.hero-panel {
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-title,
.section-heading {
  justify-content: space-between;
  gap: 18px;
}

.panel-title {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.panel-title strong {
  color: var(--teal);
}

.status-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid #e6edf4;
}

.status-row p {
  margin-bottom: 0;
  color: #43546f;
  font-size: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.status.hold {
  background: var(--hold);
}

.status.review {
  background: var(--review);
}

.status.pass {
  background: var(--pass);
}

.tool-section,
.examples-section {
  padding: 58px 0;
}

.section-band {
  padding: 58px 0;
  background: linear-gradient(180deg, #eef3f7 0%, #f8fafc 100%);
}

.tool-grid {
  grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
  align-items: start;
}

.input-panel,
.result-panel {
  padding: 20px;
  box-shadow: 0 12px 34px rgba(34, 54, 82, 0.08);
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.section-heading p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 8px;
  color: #27384f;
  font-size: 13px;
  font-weight: 900;
}

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

textarea {
  min-height: 300px;
  resize: vertical;
  padding: 14px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

input {
  min-height: 42px;
  padding: 9px 11px;
}

textarea:focus,
input:focus,
button:focus-visible {
  outline: 3px solid rgba(0, 111, 115, 0.22);
  outline-offset: 2px;
}

.control-row {
  align-items: stretch;
  flex-direction: column;
  margin-top: 14px;
}

.button-row {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
}

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

.button.secondary {
  color: var(--ink);
  background: #fff;
}

.button.ghost {
  color: var(--muted);
  background: transparent;
}

.privacy-note {
  margin: 14px 0 0;
  padding: 11px 12px;
  border: 1px solid #b9d5d5;
  border-radius: var(--radius);
  color: #154b4d;
  background: #effafa;
  font-size: 13px;
  font-weight: 800;
}

.score-card {
  padding: 18px;
  color: #fff;
  background: #184b56;
  border-color: #184b56;
}

.score-card span,
.metric-grid span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.score-card strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.score-card p {
  margin: 9px 0 0;
  color: #dcebed;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.metric-grid article {
  padding: 14px;
}

.metric-grid span {
  color: var(--muted);
}

.metric-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.1;
}

.privacy-receipt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.64fr);
  gap: 14px;
  margin: 12px 0;
  padding: 15px;
  border: 1px solid #b9d5d5;
  border-radius: var(--radius);
  background: #effafa;
}

.privacy-receipt span {
  display: block;
  margin-bottom: 5px;
  color: #154b4d;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.privacy-receipt strong {
  display: block;
  margin-bottom: 5px;
  color: #123f43;
  font-size: 18px;
  line-height: 1.18;
}

.privacy-receipt p {
  margin-bottom: 0;
  color: #315f62;
  font-size: 14px;
}

.privacy-receipt dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

.privacy-receipt dl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #cbe1e1;
  border-radius: 6px;
  background: #ffffff;
}

.privacy-receipt dt {
  color: #4f6266;
  font-size: 12px;
  font-weight: 900;
}

.privacy-receipt dd {
  margin: 0;
  color: #006f73;
  font-size: 13px;
  font-weight: 900;
}

.next-step-panel {
  margin: 12px 0;
  padding: 15px;
  border: 1px solid #cbd8e6;
  border-radius: var(--radius);
  background: #ffffff;
}

.next-step-panel span {
  display: block;
  margin-bottom: 5px;
  color: #56657d;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.next-step-panel strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.18;
}

.next-step-panel p {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.next-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.next-step-actions .button {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 13px;
}

.result-block {
  margin-top: 12px;
  padding: 16px;
}

.stack-list,
.rule-list,
.example-grid {
  display: grid;
  gap: 10px;
}

.stack-item {
  padding: 12px;
  border: 1px solid #e2eaf2;
  border-radius: var(--radius);
  background: #f8fbfd;
}

.stack-item strong,
.stack-item span {
  display: block;
}

.stack-item strong {
  margin-bottom: 4px;
}

.stack-item span,
.stack-item p,
.rule-list p,
.example-card p {
  color: var(--muted);
  font-size: 14px;
}

.stack-item p,
.rule-list p,
.example-card p {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) {
  width: 27%;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  width: 24%;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
  width: 15%;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
  width: 34%;
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid #e7eef5;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: #5c697c;
  background: #f4f7fa;
  font-size: 12px;
  text-transform: uppercase;
}

.confidence {
  display: inline-flex;
  min-width: 50px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eaf8f7;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

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

.rule-list article {
  padding: 14px;
}

.rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.rule-meta span {
  padding: 4px 7px;
  border-radius: 6px;
  color: #264159;
  background: #eef3f7;
  font-size: 12px;
  font-weight: 900;
}

.rule-list h4,
.example-card h3 {
  margin: 0 0 7px;
  font-size: 16px;
}

.missing-fields {
  margin-top: 8px;
  color: #7a4d00;
  font-size: 13px;
  font-weight: 800;
}

.example-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.example-card {
  padding: 18px;
}

.example-card .status {
  margin-bottom: 12px;
}

.app-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner strong {
  color: var(--ink);
}

@media (max-width: 940px) {
  .hero-grid,
  .tool-grid,
  .rule-board,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .boundary-list,
  .metric-grid,
  .privacy-receipt {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-links {
    display: none;
  }

  .section-heading,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .section-inner,
  .header-inner {
    width: min(100% - 24px, 1160px);
  }

  .header-inner {
    min-height: 64px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding: 30px 0;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 28px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .boundary-list,
  .metric-grid,
  .privacy-receipt {
    grid-template-columns: 1fr;
  }

  .button,
  .button-row,
  .next-step-actions,
  .next-step-actions .button {
    width: 100%;
  }

  .status-row {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 240px;
  }

  .data-table {
    min-width: 680px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
