:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-muted: #eef3f8;
  --text: #111827;
  --muted: #5f6f86;
  --line: #d9e2ec;
  --line-strong: #b8c7d8;
  --blue: #2457d6;
  --blue-soft: #e9efff;
  --green: #0f7a55;
  --green-soft: #e8f6ef;
  --amber: #a35d00;
  --amber-soft: #fff4dd;
  --red: #b42318;
  --red-soft: #fff0ed;
  --ink: #172033;
  --shadow: 0 14px 36px rgba(24, 39, 75, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 28px;
  background: rgba(246, 248, 251, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand strong {
  font-size: 17px;
}

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

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.top-nav a {
  position: relative;
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: var(--surface-muted);
  color: var(--text);
  outline: none;
}

.top-nav a.active,
.top-nav a[aria-current] {
  border-color: rgba(36, 87, 214, 0.24);
  background: #ffffff;
  box-shadow:
    inset 0 -3px 0 var(--blue),
    0 1px 3px rgba(24, 39, 75, 0.08);
  color: var(--blue);
  font-weight: 800;
}

.top-nav a.active:hover,
.top-nav a[aria-current]:hover,
.top-nav a.active:focus-visible,
.top-nav a[aria-current]:focus-visible {
  border-color: rgba(36, 87, 214, 0.34);
  background: var(--blue-soft);
  color: var(--blue);
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.language-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.language-control select {
  appearance: none;
  min-width: 132px;
  height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.language-control svg {
  position: absolute;
  right: 11px;
  color: var(--muted);
  pointer-events: none;
}

main {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.simple-main {
  width: min(980px, calc(100% - 32px));
}

.page-hero {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 32px;
  box-shadow: var(--shadow);
}

.page-hero h1 {
  font-size: 38px;
}

.page-hero p {
  color: var(--muted);
  font-size: 17px;
}

.page-body {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.page-body .info-panel ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.page-body .info-panel li + li {
  margin-top: 7px;
}

.tool-shell,
.panel,
.info-panel,
.faq-section {
  scroll-margin-top: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 920px;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 0;
}

.lede {
  max-width: 880px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.privacy-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.2fr) minmax(360px, 1.35fr);
  gap: 16px;
  padding: 16px;
}

.panel {
  min-width: 0;
  padding: 22px;
}

.provider-builder {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.provider-builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.provider-builder-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.provider-builder-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.18fr);
  gap: 16px;
  padding: 16px;
}

.provider-builder-controls,
.provider-builder-output {
  min-width: 0;
}

.provider-code {
  min-height: 390px;
}

.panel-title {
  margin-bottom: 18px;
}

.panel-title p {
  margin-bottom: 0;
  color: var(--muted);
}

.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.input,
.textarea,
.code-output,
.code-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.input {
  height: 46px;
  padding: 0 12px;
}

.input.compact {
  height: 40px;
}

.textarea,
.code-input {
  min-height: 170px;
  padding: 12px;
  resize: vertical;
}

.textarea.small {
  min-height: 118px;
}

.code-output,
.code-input {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.code-output {
  min-height: 522px;
  padding: 14px;
  resize: vertical;
}

.help-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.radio-grid {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.radio-grid legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.radio-grid label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.radio-grid label:has(input:checked) {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.radio-grid input {
  margin-top: 4px;
}

.radio-grid strong,
.radio-grid small {
  display: block;
}

.radio-grid strong {
  color: var(--ink);
  font-size: 14px;
}

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

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

.crawler-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.filter-button.active,
.filter-button:hover,
.filter-button:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  outline: none;
}

.path-template-bar,
.validator-toolbar,
.example-buttons,
.minor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.path-template-bar {
  margin: 0 0 10px;
}

.path-template-bar span,
.example-buttons span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.minor-actions {
  margin-top: 8px;
}

.text-button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 0 8px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.text-button:hover,
.text-button:focus-visible {
  background: var(--blue-soft);
  outline: none;
}

.crawler-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.crawler-card.blocked {
  border-color: rgba(180, 35, 24, 0.28);
}

.crawler-card.allowed {
  border-color: rgba(15, 122, 85, 0.22);
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.crawler-meta {
  min-width: 0;
}

.crawler-meta p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.crawler-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tag.training {
  background: var(--red-soft);
  color: var(--red);
}

.tag.search {
  background: var(--green-soft);
  color: var(--green);
}

.tag.control {
  background: var(--amber-soft);
  color: var(--amber);
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 150px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active[data-value="allow"] {
  background: var(--green);
  color: #ffffff;
}

.segmented button.active[data-value="block"] {
  background: var(--red);
  color: #ffffff;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--ink);
}

.button:hover,
.button:focus-visible {
  filter: brightness(0.97);
  outline: 3px solid rgba(36, 87, 214, 0.18);
  outline-offset: 1px;
}

.status-line {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.output-meta,
.validation-summary {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.validation-summary.good {
  border-color: rgba(15, 122, 85, 0.24);
  background: var(--green-soft);
  color: var(--green);
}

.validation-summary.warn {
  border-color: rgba(163, 93, 0, 0.28);
  background: var(--amber-soft);
  color: var(--amber);
}

.validation-summary.bad {
  border-color: rgba(180, 35, 24, 0.26);
  background: var(--red-soft);
  color: var(--red);
}

.validator-toolbar {
  justify-content: space-between;
  margin-top: 12px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-top: 16px;
}

.result-list,
.check-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.result-item,
.check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.result-item strong,
.check-item strong {
  display: block;
  color: var(--ink);
}

.result-item p,
.check-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.dot.good {
  background: var(--green);
}

.dot.warn {
  background: var(--amber);
}

.dot.bad {
  background: var(--red);
}

.score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface-muted);
}

.score-card strong {
  display: block;
  color: var(--ink);
  font-size: 52px;
  line-height: 1;
}

.score-card p {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
}

.score-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.score-meter {
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.score-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 160ms ease;
}

.score-meter span.warn {
  background: var(--amber);
}

.score-meter span.bad {
  background: var(--red);
}

.readiness-breakdown {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.info-panel {
  padding: 22px;
}

.info-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.source-panel {
  grid-column: 1 / -1;
}

.source-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.source-links a {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.source-links a:hover,
.source-links a:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  outline: none;
}

.resource-section {
  margin-top: 16px;
}

.section-head {
  max-width: 860px;
}

.section-head p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.faq-section {
  margin-top: 16px;
  padding: 24px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer span {
  color: var(--ink);
  font-weight: 800;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--blue);
}

@media (max-width: 1180px) {
  .workspace,
  .analysis-grid,
  .content-grid,
  .provider-builder-grid {
    grid-template-columns: 1fr;
  }

  .code-output {
    min-height: 360px;
  }

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

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

@media (max-width: 760px) {
  .site-header,
  .tool-head,
  .provider-builder-head,
  .row,
  .score-card {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    position: static;
    padding: 14px 16px;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .header-actions,
  .language-control,
  .language-control select {
    width: 100%;
  }

  main {
    width: min(100% - 20px, 1400px);
    padding-top: 16px;
  }

  h1 {
    font-size: 34px;
  }

  .tool-head,
  .page-hero,
  .panel,
  .faq-section {
    padding: 18px;
  }

  .workspace {
    padding: 10px;
  }

  .crawler-card {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }

  .filter-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header {
    gap: 12px;
    padding: 12px;
  }

  .brand {
    width: 100%;
  }

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

  .top-nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-nav a {
    justify-content: center;
    min-height: 38px;
    padding: 0 8px;
    text-align: center;
  }

  main,
  .simple-main {
    width: min(100% - 16px, 1400px);
  }

  .tool-head,
  .page-hero,
  .panel,
  .info-panel,
  .faq-section {
    padding: 16px;
  }

  h1,
  .page-hero h1 {
    font-size: 30px;
    line-height: 1.12;
  }

  h2 {
    font-size: 20px;
  }

  .lede,
  .page-hero p {
    font-size: 15px;
  }

  .score-card,
  .result-item,
  .check-item {
    padding: 12px;
  }

  .path-template-bar,
  .example-buttons,
  .minor-actions,
  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .path-template-bar span,
  .example-buttons span {
    grid-column: 1 / -1;
  }

  .button,
  .filter-button,
  .text-button {
    width: 100%;
  }

  .code-output,
  .code-input {
    min-height: 300px;
    font-size: 12px;
  }

  .provider-code {
    min-height: 300px;
  }

  .score-card strong {
    font-size: 44px;
  }
}
