:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #607167;
  --line: #d8e0d9;
  --surface: #ffffff;
  --surface-2: #f7f9f7;
  --surface-3: #edf3ee;
  --accent: #0f766e;
  --accent-2: #b7791f;
  --good: #16803f;
  --warn: #b7791f;
  --bad: #b42318;
  --shadow: 0 18px 50px rgba(25, 43, 34, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface-2);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(23, 32, 27, 0.1);
  background: rgba(247, 249, 247, 0.92);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}

.top-nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 18px;
}

.top-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.top-nav a:hover,
.site-footer a:hover,
.brand:hover {
  color: var(--accent);
}

main {
  width: 100%;
}

.home-workbench,
.tool-hero,
.section-band,
.article-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.home-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 68px);
  padding: 46px 0;
}

.home-copy h1,
.tool-hero h1,
.article-page h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(38px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

.tool-hero h1,
.article-page h1 {
  font-size: clamp(34px, 5vw, 60px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lede {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.tool-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.button.primary,
.tool-button {
  background: var(--accent);
  color: #fff;
}

.button.secondary,
.copy-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button:hover,
.tool-button:hover,
.copy-button:hover {
  transform: translateY(-1px);
}

.dns-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-toolbar {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}

.panel-toolbar span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--line);
}

.record-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.record-row.good {
  border-left-color: var(--good);
}

.record-row.warn {
  border-left-color: var(--warn);
}

.record-row span {
  color: var(--muted);
}

.section-band {
  padding: 58px 0;
}

.section-band.muted {
  border-top: 1px solid var(--line);
}

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

.section-heading h2,
.content-slice h2,
.faq-box h2,
.checklist h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: 0;
}

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

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

.tool-tile,
.guide-link {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.guide-link {
  min-height: 170px;
}

.tile-badge {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.tool-tile h2,
.guide-link h3 {
  margin: 18px 0 10px;
  font-size: 20px;
  line-height: 1.15;
}

.tool-tile a,
.guide-link a {
  text-decoration: none;
}

.tool-tile p,
.guide-link p,
.content-slice p,
.article-body p,
.faq-box p {
  color: var(--muted);
  line-height: 1.58;
}

.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 24px;
  align-items: end;
  padding: 48px 0 26px;
}

.mini-map {
  display: grid;
  grid-template-columns: 1fr 28px 1fr 28px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.mini-map span {
  display: grid;
  place-items: center;
  height: 48px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.mini-map i {
  display: block;
  height: 2px;
  background: var(--accent);
}

.tool-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 28px;
  align-items: start;
}

.input-pane,
.result-pane,
.faq-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-pane {
  padding: 18px;
}

.result-pane {
  min-height: 360px;
  overflow: hidden;
}

.field-stack {
  display: grid;
  gap: 14px;
}

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

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

.field textarea {
  min-height: 240px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

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

.segmented label,
.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 750;
}

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

.tool-error {
  min-height: 22px;
  margin-top: 12px;
  color: var(--bad);
  font-size: 13px;
  font-weight: 750;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 360px;
  padding: 28px;
  text-align: center;
}

.empty-state span {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--accent);
  font-weight: 950;
}

.result-summary {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 8px solid var(--line);
  border-radius: 999px;
  font-weight: 950;
}

.state-good .score-ring {
  border-color: rgba(22, 128, 63, 0.32);
  color: var(--good);
}

.state-warn .score-ring {
  border-color: rgba(183, 121, 31, 0.32);
  color: var(--warn);
}

.state-bad .score-ring {
  border-color: rgba(180, 35, 24, 0.26);
  color: var(--bad);
}

.result-summary h2 {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.15;
}

.result-summary p {
  margin: 0;
  color: var(--muted);
}

.result-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.result-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.check-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  align-items: start;
}

.check-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--line);
}

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

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

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

.check-item b {
  display: block;
  margin-bottom: 2px;
}

.check-item span {
  color: var(--muted);
  line-height: 1.45;
}

.record-code,
.fix-code,
.generated-code {
  position: relative;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101815;
  color: #e7f4ec;
  padding: 14px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-button {
  width: 100%;
  margin-top: 10px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 24px;
  align-items: start;
}

.content-slice {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.content-slice:first-child {
  border-top: 0;
  padding-top: 0;
}

.faq-box {
  padding: 18px;
}

details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

details:first-of-type {
  margin-top: 8px;
}

summary {
  cursor: pointer;
  font-weight: 850;
}

.related-guides {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 16px;
}

.related-guides h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.related-guides a {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.article-page {
  max-width: 840px;
  padding: 58px 0 80px;
}

.article-body {
  margin-top: 28px;
}

.article-body p {
  font-size: 18px;
}

.checklist {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin: 28px 0;
  padding: 22px;
}

.checklist ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer div {
  display: grid;
  gap: 4px;
}

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

@media (max-width: 1040px) {
  .tool-grid,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-workbench,
  .tool-hero,
  .tool-workbench,
  .two-column {
    grid-template-columns: 1fr;
  }

  .home-workbench {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

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

  .home-workbench,
  .section-band,
  .article-page {
    width: min(100% - 28px, 1180px);
  }

  .home-copy h1,
  .tool-hero h1,
  .article-page h1 {
    font-size: 38px;
  }

  .tool-grid,
  .guide-grid,
  .checkbox-row,
  .segmented {
    grid-template-columns: 1fr;
  }

  .mini-map {
    grid-template-columns: 1fr;
  }

  .mini-map i {
    display: none;
  }

  .site-footer {
    flex-direction: column;
  }
}
