:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #edf1ef;
  --ink: #17211f;
  --muted: #62706c;
  --line: #d9e0dc;
  --accent: #007f72;
  --accent-dark: #075c54;
  --copper: #a55f2b;
  --yellow: #c29216;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(19, 34, 31, 0.10);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101615;
    --surface: #17211f;
    --surface-soft: #202b29;
    --ink: #eef5f2;
    --muted: #a7b4af;
    --line: #31403c;
    --accent: #2bb8a6;
    --accent-dark: #77d8ce;
    --copper: #d3925f;
    --yellow: #e0ba47;
    --red: #ff8f83;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #edf1ef;
  --ink: #17211f;
  --muted: #62706c;
  --line: #d9e0dc;
  --accent: #007f72;
  --accent-dark: #075c54;
  --copper: #a55f2b;
  --yellow: #c29216;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(19, 34, 31, 0.10);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101615;
  --surface: #17211f;
  --surface-soft: #202b29;
  --ink: #eef5f2;
  --muted: #a7b4af;
  --line: #31403c;
  --accent: #2bb8a6;
  --accent-dark: #77d8ce;
  --copper: #d3925f;
  --yellow: #e0ba47;
  --red: #ff8f83;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

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

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--surface);
  padding: 10px 12px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  flex: 1;
  gap: 2px;
  overflow-x: auto;
}

.main-nav a {
  border-radius: 6px;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.language-switcher select {
  width: auto;
  min-width: 72px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 780;
}

main {
  min-height: calc(100vh - 220px);
}

.hero {
  min-height: min(720px, calc(100vh - 68px));
  display: grid;
  align-items: end;
  padding: clamp(72px, 11vw, 128px) 28px 54px;
  background:
    linear-gradient(90deg, rgba(12, 19, 18, 0.86), rgba(12, 19, 18, 0.52), rgba(12, 19, 18, 0.20)),
    url("/static/img/hero-lab.png") center / cover no-repeat;
  color: #f7fbf9;
}

.hero-content,
.page-hero,
.section,
.site-footer,
.product-hero,
.shop-page {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-content {
  padding-bottom: 20px;
}

.hero h1,
.page-hero h1,
.product-hero h1,
.shop-page h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(42px, 8vw, 92px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 690px;
  color: #d8e5e1;
  font-size: clamp(18px, 2.5vw, 25px);
}

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

.hero .eyebrow {
  color: #7de0d2;
}

.hero-actions,
.card-actions,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.small-button {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 13px;
}

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

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.hero .secondary-button {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.text-link {
  color: var(--accent-dark);
  font-weight: 760;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.section {
  padding: 64px 0;
}

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

h2,
h3 {
  margin: 0 0 10px;
  line-height: 1.15;
  letter-spacing: 0;
}

.section-head h2,
.page-hero h1,
.product-hero h1,
.shop-page h1 {
  color: var(--ink);
}

.page-hero {
  padding: 84px 0 34px;
}

.page-hero p,
.product-hero p,
.section p,
.shop-page p {
  max-width: 760px;
  color: var(--muted);
}

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

.product-card,
.resource-card,
.contact-card,
.verify-panel,
.verify-result,
.metric,
.table-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-card {
  overflow: hidden;
}

.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--surface-soft);
}

.product-card div {
  padding: 18px;
}

.product-card h3 {
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent-dark);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.good {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.badge.warn {
  border-color: color-mix(in srgb, var(--yellow) 55%, var(--line));
  background: color-mix(in srgb, var(--yellow) 14%, transparent);
  color: var(--yellow);
}

.badge.muted {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.band {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.focus-grid {
  width: min(1160px, calc(100% - 32px));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 0 auto;
}

.focus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 94px;
  padding: 18px;
  border-inline: 1px solid var(--line);
  color: var(--muted);
  font-weight: 760;
}

.focus-item span {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--copper);
}

.two-up,
.product-hero,
.verify-layout,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.product-hero {
  padding: 72px 0 30px;
  align-items: center;
}

.product-hero img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.link-list,
.resource-list {
  display: grid;
  gap: 10px;
}

.link-list a {
  display: block;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  color: var(--accent-dark);
  font-weight: 760;
  text-decoration: none;
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.table-block {
  margin-bottom: 18px;
  padding: 18px;
}

.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

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

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

.resource-card,
.contact-card,
.verify-panel,
.verify-result,
.metric {
  padding: 20px;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px 180px;
  gap: 12px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.verify-panel {
  display: grid;
  gap: 14px;
}

.verify-result {
  min-height: 220px;
}

.verify-result pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 12px;
}

.result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.shop-page {
  display: grid;
  min-height: calc(100vh - 260px);
  align-content: center;
  justify-items: start;
  padding: 80px 0;
}

.admin-login {
  display: grid;
  max-width: 460px;
  gap: 14px;
}

.admin-hero {
  display: grid;
  gap: 14px;
  align-items: start;
}

.editor-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-block: 22px;
  padding: 22px;
}

.editor-language-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.editor-language-panel strong {
  display: block;
}

.language-tabs {
  display: inline-flex;
  gap: 6px;
}

.language-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.language-tabs a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.editor-form {
  display: grid;
  gap: 18px;
}

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

.wide-field {
  grid-column: 1 / -1;
}

.form-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline-actions {
  justify-content: flex-end;
}

.editor-table {
  min-width: 980px;
}

.editor-table input,
.editor-table select {
  min-width: 130px;
}

.editor-table .short-input {
  min-width: 78px;
  max-width: 120px;
}

.new-row {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}

.delete-cell {
  display: inline-flex;
  align-items: center;
  grid-template-columns: none;
  gap: 7px;
  white-space: nowrap;
}

.delete-cell input {
  width: auto;
  min-height: 0;
}

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

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 34px;
}

.flash-stack {
  width: min(1160px, calc(100% - 32px));
  display: grid;
  gap: 8px;
  margin: 18px auto 0;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 10px 12px;
}

.flash.error {
  border-color: color-mix(in srgb, var(--red) 40%, var(--line));
  color: var(--red);
}

.flash.success {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent-dark);
}

.site-footer {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding: 34px 0 48px;
}

.site-footer p {
  margin: 4px 0 0;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 16px;
}

.site-footer a {
  color: var(--muted);
  font-weight: 680;
  text-decoration: none;
}

code {
  border-radius: 4px;
  background: var(--surface-soft);
  padding: 1px 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  .site-header {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 18px;
  }

  .main-nav {
    order: 3;
    width: 100%;
  }

  .product-grid,
  .focus-grid,
  .two-up,
  .product-hero,
  .verify-layout,
  .contact-grid,
  .resource-grid,
  .metric-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 680px;
  }

  .section,
  .page-hero,
  .product-hero {
    padding-block: 42px;
  }

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

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

@media (max-width: 560px) {
  .hero-content,
  .page-hero,
  .section,
  .site-footer,
  .product-hero,
  .shop-page {
    width: min(100% - 22px, 1160px);
  }

  .hero {
    padding-inline: 12px;
  }

  .section-head,
  .resource-row,
  .result-title {
    align-items: flex-start;
    flex-direction: column;
  }

  table {
    min-width: 560px;
  }
}
