:root {
  --ink: #172033;
  --muted: #667085;
  --line: #d9e2ec;
  --paper: #f7faf8;
  --white: #ffffff;
  --navy: #102a43;
  --blue: #1769e0;
  --blue-dark: #0f4db3;
  --teal: #0f8b8d;
  --green: #1f8f63;
  --gold: #d99a1b;
  --danger: #b42318;
  --shadow: 0 14px 40px rgba(16, 42, 67, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

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

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

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1.13;
  margin: 0 0 16px;
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.15rem, 5vw, 4.6rem);
  max-width: 980px;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: var(--white);
}

textarea {
  resize: vertical;
}

button,
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  white-space: normal;
}

.button-primary {
  color: var(--white);
  background: var(--green);
  box-shadow: 0 10px 26px rgba(31, 143, 99, 0.24);
}

.button-primary:hover {
  color: var(--white);
  background: #197852;
}

.button-secondary {
  color: var(--navy);
  background: var(--white);
  border: 1px solid rgba(16, 42, 67, 0.18);
}

.button-dark {
  color: var(--white);
  background: var(--navy);
}

.button-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.full {
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 5vw, 60px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 226, 236, 0.8);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  font-size: 1.05rem;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
  box-shadow: inset -8px -8px 0 rgba(20, 184, 166, 0.32);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 800;
  font-size: 0.94rem;
}

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

.site-nav .nav-button {
  color: var(--white);
  background: var(--blue);
  padding: 9px 14px;
  border-radius: 8px;
}

.nav-toggle {
  display: none;
  background: var(--navy);
  color: var(--white);
}

.hero {
  min-height: 74vh;
  position: relative;
  display: grid;
  align-items: center;
  padding: clamp(76px, 11vw, 136px) clamp(18px, 6vw, 76px) clamp(42px, 6vw, 70px);
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center right;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 42, 67, 0.86) 0%, rgba(16, 42, 67, 0.68) 44%, rgba(16, 42, 67, 0.14) 100%);
}

.hero-inner {
  position: relative;
  max-width: 880px;
  color: var(--white);
}

.hero h1,
.hero p {
  color: var(--white);
}

.hero-copy {
  max-width: 760px;
  font-size: clamp(1.02rem, 2vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 900;
}

.hero .eyebrow {
  color: #9ff3e4;
}

.hero-search {
  max-width: 680px;
  margin-top: 28px;
}

.hero-search label {
  color: inherit;
  font-size: 0.9rem;
}

.hero-search div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.hero-search.standalone {
  color: var(--ink);
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(46px, 7vw, 88px) 0;
}

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

.split-section,
.content-layout,
.order-layout,
.payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}

.page-hero,
.guide-hero {
  padding: clamp(52px, 8vw, 90px) clamp(18px, 6vw, 76px);
  background: var(--paper);
}

.compact-hero h1,
.guide-hero h1 {
  max-width: 960px;
}

.compact-hero p,
.guide-hero > p {
  max-width: 760px;
  font-size: 1.08rem;
}

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

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

.category-tile,
.guide-card,
.quality-panel,
.estimator,
.payment-card,
.admin-panel,
.contact-panel,
.direct-answer,
.toc,
.prompt-box,
.comment,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.category-tile {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 20px;
  color: var(--ink);
}

.category-tile span {
  font-weight: 900;
}

.category-tile small {
  color: var(--muted);
}

.guide-card a {
  min-height: 230px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  color: var(--ink);
}

.guide-card h3 {
  margin: 0;
}

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

.card-kicker {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.text-link {
  font-weight: 900;
}

.process-band {
  width: 100%;
  max-width: none;
  padding-left: clamp(18px, 6vw, 76px);
  padding-right: clamp(18px, 6vw, 76px);
  background: var(--navy);
}

.process-band h2,
.process-band strong,
.process-band p {
  color: var(--white);
}

.process-grid div {
  padding: 18px;
  border-left: 3px solid var(--teal);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.support-band {
  align-items: center;
}

.quality-panel,
.payment-card,
.contact-panel {
  padding: 24px;
}

.assignment-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.assignment-cloud span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #e9f7f4;
  color: #126b5e;
  font-weight: 800;
}

.final-cta {
  text-align: center;
}

.final-cta .hero-actions {
  justify-content: center;
}

.estimator {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.estimator h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.estimator output {
  display: block;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--green);
  font-size: 1.55rem;
  font-weight: 900;
}

.pricing-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.pricing-row {
  display: grid;
  grid-template-columns: 1fr 160px 160px;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.pricing-row:last-child {
  border-bottom: 0;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 800;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.guide-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
}

.article {
  min-width: 0;
}

.article-body {
  color: #243047;
}

.article-body h2,
.article-body h3 {
  margin-top: 34px;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  overflow-x: auto;
}

.article-body th,
.article-body td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
}

.direct-answer,
.toc,
.prompt-box {
  padding: 20px;
  margin-bottom: 22px;
}

.direct-answer {
  border-left: 5px solid var(--green);
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toc strong {
  width: 100%;
}

.sidebar {
  min-width: 0;
}

.sticky-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
}

.support-cta {
  margin: 36px 0 18px;
  padding: 24px;
  border: 1px solid rgba(31, 143, 99, 0.24);
  border-radius: 8px;
  background: #f2fbf7;
}

.ethical-note,
.clinical-warning {
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  background: #fff9eb;
  border-radius: 8px;
  color: #5f4511;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--white);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 900;
}

.comments {
  margin-top: 40px;
}

.comment {
  padding: 16px;
  margin-bottom: 14px;
}

.admin-reply {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--paper);
}

.panel-form,
.order-form {
  display: grid;
  gap: 18px;
}

.order-form,
.installer,
.admin-login {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.form-steps,
.status-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.form-steps span,
.status-steps span {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.status-steps .done {
  color: var(--green);
  background: #ecfdf3;
}

.status-steps .current {
  color: var(--blue-dark);
  background: #edf4ff;
}

.dynamic-fields > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.addon-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.check-row input {
  width: auto;
}

.order-summary {
  display: grid;
  gap: 12px;
}

.order-summary div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.order-summary dt {
  color: var(--muted);
  font-weight: 800;
}

.order-summary dd {
  margin: 0;
  font-weight: 900;
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 800;
}

.notice-success {
  background: #ecfdf3;
  color: #067647;
}

.notice-error {
  background: #fef3f2;
  color: var(--danger);
}

.notice-info {
  background: #eff8ff;
  color: #175cd3;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper);
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 390px) 1fr;
  gap: 34px;
  padding: 44px clamp(18px, 6vw, 76px) 84px;
  color: var(--white);
  background: var(--navy);
}

.site-footer p,
.site-footer a {
  color: rgba(255, 255, 255, 0.86);
}

.site-footer .brand {
  color: var(--white);
}

.site-footer nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
}

.mobile-sticky-cta {
  display: none;
}

.system-message,
.installer,
.admin-login {
  width: min(560px, calc(100% - 36px));
  margin: 8vh auto;
}

.admin-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
  background: var(--paper);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 18px;
  background: var(--navy);
  color: var(--white);
}

.admin-sidebar .brand {
  color: var(--white);
  margin-bottom: 22px;
}

.admin-sidebar nav {
  display: grid;
  gap: 7px;
}

.admin-sidebar a {
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
}

.admin-sidebar a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-panel {
  padding: 22px;
  margin-bottom: 22px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  min-height: 42px;
}

.metric strong {
  display: block;
  font-size: 2rem;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.filter-row a {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--white);
  font-weight: 800;
}

.editor-form textarea[name="content_html"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--green);
  transition: width 0.3s ease;
}

.generation-steps {
  display: grid;
  gap: 8px;
}

.generation-steps li {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--paper);
}

.generation-steps .done {
  color: var(--green);
  font-weight: 900;
}

.generation-steps .current {
  color: var(--blue);
  font-weight: 900;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-moderation {
  display: grid;
  grid-template-columns: 1fr 180px minmax(240px, 360px) auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.readable {
  max-width: 860px;
}

.payment-methods {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.file-list {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.quality-check-panel {
  border-left: 5px solid var(--green);
}

.quality-check-panel:has(.quality-status.fail) {
  border-left-color: var(--danger);
}

.quality-status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 900;
}

.quality-status.pass {
  color: #067647;
  background: #ecfdf3;
}

.quality-status.fail {
  color: var(--danger);
  background: #fef3f2;
}

.quality-check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quality-check-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.quality-check-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.quality-check-item.pass strong {
  color: #067647;
}

.quality-check-item.fail {
  border-color: rgba(180, 35, 24, 0.32);
  background: #fff8f7;
}

.quality-check-item.fail strong {
  color: var(--danger);
}

.content-mode {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .site-nav {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 68px;
    display: none;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: grid;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .split-section,
  .content-layout,
  .order-layout,
  .payment-layout,
  .site-footer,
  .admin-body {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .guide-grid,
  .guide-grid.compact,
  .process-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticky-sidebar,
  .admin-sidebar {
    position: static;
    height: auto;
  }

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

  .comment-moderation {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body {
    padding-bottom: 58px;
  }

  h1 {
    font-size: 2rem;
  }

  .site-header {
    padding: 12px 16px;
  }

  .hero {
    min-height: 68vh;
    background-position: center;
  }

  .hero-overlay {
    background: rgba(16, 42, 67, 0.78);
  }

  .hero-search div,
  .form-grid,
  .form-steps,
  .status-steps,
  .pricing-row,
  .order-summary div,
  .category-grid,
  .guide-grid,
  .guide-grid.compact,
  .process-grid,
  .metric-grid,
  .site-footer nav {
    grid-template-columns: 1fr;
  }

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

  .hero-actions {
    display: grid;
  }

  .mobile-sticky-cta {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    z-index: 60;
    display: flex;
    justify-content: center;
    padding: 12px;
    border-radius: 8px;
    color: var(--white);
    background: var(--green);
    font-weight: 900;
    box-shadow: var(--shadow);
  }

  .admin-main {
    padding: 18px;
  }
}
