:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-alt: #eef4f0;
  --surface-wash: #fafbf9;
  --text: #13221a;
  --muted: #596960;
  --line: #d4ddd7;
  --line-strong: #b8c7bf;
  --accent: #0d7355;
  --accent-strong: #07513b;
  --accent-soft: #e4f2ed;
  --warning: #9d5a00;
  --danger: #9b2f2f;
  --shadow: 0 12px 32px rgba(19, 34, 26, 0.08);
  --shadow-soft: 0 4px 18px rgba(19, 34, 26, 0.045);
  --radius: 8px;
  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;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

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

button,
a,
input,
select,
textarea {
  outline-color: var(--accent);
}

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

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

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px clamp(16px, 5vw, 64px);
  padding-left: 0;
  padding-right: 0;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
  font-size: 0.92rem;
}

.nav a {
  color: var(--muted);
  font-weight: 650;
}

.nav a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.search-band,
.section,
.route-panel {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.search-band {
  padding: 64px 0 30px;
}

.search-copy {
  max-width: 780px;
}

.search-copy h1 {
  margin: 0 0 12px;
  max-width: 820px;
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.search-copy p,
.section-heading p,
.policy p,
.script-output p,
.status-line {
  color: var(--muted);
}

.search-copy p {
  margin: 0 0 26px;
  font-size: 1.12rem;
}

.search-shell {
  position: relative;
  max-width: 860px;
  margin-top: 28px;
}

.search-shell input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px 0 46px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 1.04rem;
}

.search-shell::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 999px;
  transform: translateY(-56%);
}

.search-shell::after {
  content: "";
  position: absolute;
  left: 31px;
  top: 50%;
  z-index: 1;
  width: 8px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transform: translateY(6px) rotate(45deg);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: 340px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-results.active {
  display: block;
}

.search-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result strong {
  display: block;
  color: var(--text);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quick-links a,
.source-chip,
.billing-tabs button,
.button {
  min-height: 38px;
  border-radius: 7px;
}

.quick-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 650;
}

.quick-links a:hover {
  border-color: #a9c9bd;
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-decoration: none;
}

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

.trust-row div {
  padding: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.trust-row dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trust-row dd {
  margin: 3px 0 0;
  font-weight: 700;
}

.section,
.route-panel {
  padding: 42px 0;
}

.section {
  scroll-margin-top: 96px;
}

.route-panel {
  scroll-margin-top: 96px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: 0;
}

.section-heading p {
  max-width: 560px;
  margin: 0;
}

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

.guide-card,
.guide-view,
.tool-form,
.script-output,
.table-wrap,
.checklist,
.policy {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.guide-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 18px;
}

.guide-card h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.guide-card p {
  margin: 0;
  color: var(--muted);
}

.guide-card:hover {
  border-color: #b7d2c8;
  box-shadow: 0 10px 28px rgba(19, 34, 26, 0.075);
}

.category-intro {
  max-width: 760px;
  margin: 0 0 20px;
  color: var(--muted);
}

.card-meta,
.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  color: #ffffff;
  background: var(--accent);
  border-radius: 7px;
  font-weight: 800;
}

.score.high {
  background: var(--danger);
}

.score.medium {
  background: var(--warning);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  color: #ffffff;
  background: var(--accent);
}

.button.primary:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.button.secondary {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #b9d7cc;
}

.button.secondary:hover {
  background: #d8ebe4;
  text-decoration: none;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: start;
  gap: 22px;
}

.tool-section .section-heading {
  display: block;
  max-width: 680px;
}

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  align-items: stretch;
  gap: 22px;
}

.split .section-heading {
  display: block;
  margin: 0;
}

.section-copy {
  display: grid;
  gap: 18px;
}

.tool-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.tool-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.tool-form input,
.tool-form select,
.tool-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid #c2cec7;
  border-radius: 7px;
}

.tool-form input:focus,
.tool-form select:focus,
.tool-form textarea:focus,
.search-shell input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 115, 85, 0.13);
}

.script-output {
  min-height: 100%;
  padding: 18px;
}

.script-output h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.script-box {
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.58;
  white-space: pre-wrap;
  margin: 0 0 14px;
  padding: 16px;
  background: var(--surface-wash);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.table-wrap {
  overflow: auto;
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.checklist {
  margin: 0;
  padding: 18px 18px 18px 36px;
}

.checklist li + li {
  margin-top: 9px;
}

.compact-form {
  align-self: stretch;
}

.policy {
  padding: 24px;
  background: var(--surface-wash);
}

.guide-view {
  padding: 24px;
  border-color: var(--line-strong);
}

.guide-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.guide-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0;
  line-height: 1.08;
}

.snapshot {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 24px;
}

.snapshot div {
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.snapshot dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.snapshot dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.guide-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 96px;
}

.guide-section h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #c6e0d7;
  font-weight: 700;
}

.billing-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.billing-tabs button {
  padding: 7px 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
}

.billing-tabs button[aria-selected="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.step-list {
  margin: 0;
  padding-left: 22px;
}

.step-list li + li {
  margin-top: 8px;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.feedback-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  justify-content: center;
  padding: 28px 16px 38px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

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

@media (max-width: 900px) {
  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

  .guide-grid,
  .split,
  .tool-workspace,
  .snapshot {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .guide-title {
    display: block;
  }

  .guide-title .button {
    margin-top: 12px;
  }
}

@media (max-width: 640px) {
  .search-band,
  .section,
  .route-panel {
    width: min(100% - 22px, 1180px);
  }

  .search-band {
    padding-top: 36px;
  }

  .search-copy p {
    font-size: 1rem;
  }

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

  .guide-view,
  .policy {
    padding: 18px;
  }

  .nav {
    gap: 8px 12px;
    font-size: 0.9rem;
  }

  .route-panel {
    scroll-margin-top: 156px;
  }

  .section {
    scroll-margin-top: 156px;
  }

  .guide-section {
    scroll-margin-top: 156px;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  tr {
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
}
