:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-soft: #eef2ee;
  --ink: #121615;
  --muted: #68726f;
  --line: #dde4df;
  --brand: #103c39;
  --accent: #b5812b;
  --green: #14746f;
  --shadow: 0 14px 34px rgba(16, 60, 57, 0.09);
  --radius: 8px;
  --nav-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(221, 228, 223, 0.9);
  background: rgba(247, 248, 245, 0.92);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  font-size: 14px;
  letter-spacing: 0.02em;
}

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

.source-pill {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.app-main {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.hero,
.detail-hero {
  display: grid;
  gap: 18px;
}

.hero-copy,
.page-head,
.detail-copy {
  padding: 16px 0;
}

.kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.14;
  letter-spacing: 0;
}

h1 {
  font-size: 38px;
  font-weight: 920;
}

h2 {
  font-size: 24px;
  font-weight: 900;
}

h3 {
  font-size: 18px;
  font-weight: 900;
}

.lead,
.page-head p,
.detail-copy p,
.info-card p,
.source-card p,
.doc-row em {
  color: var(--muted);
}

.lead,
.page-head p,
.detail-copy p {
  margin: 14px 0 0;
  font-size: 17px;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.button.primary {
  background: var(--brand);
  color: #fff;
}

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

.hero-card,
.doc-row,
.info-card,
.source-card,
.spec-card,
.source-row,
.wide-link {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(16, 60, 57, 0.04);
}

.hero-card {
  display: block;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.hero-card img {
  width: 100%;
  aspect-ratio: 0.92;
  object-fit: cover;
  object-position: top;
  background: var(--surface-soft);
}

.hero-card span,
.hero-card strong {
  display: block;
  padding: 0 16px;
}

.hero-card span {
  padding-top: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-card strong {
  padding-bottom: 16px;
  color: var(--ink);
  font-size: 18px;
}

.quick-panel {
  display: grid;
  gap: 10px;
  margin: 18px 0 28px;
}

.quick-panel div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
}

.quick-panel p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.metric {
  display: block;
  font-size: 26px;
  font-weight: 920;
  line-height: 1;
}

.content-section,
.spec-stack,
.safety-grid,
.source-list,
.detail-sections {
  display: grid;
  gap: 12px;
}

.content-section {
  margin-top: 22px;
}

.content-section.flush {
  margin-top: 0;
}

.section-title {
  margin-bottom: 4px;
}

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

.doc-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  min-height: 118px;
  padding: 10px;
  color: inherit;
  text-decoration: none;
}

.doc-row img {
  width: 82px;
  height: 98px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top;
  background: var(--surface-soft);
}

.doc-row small,
.doc-row strong,
.doc-row em {
  display: block;
}

.doc-row small {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-row strong {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.2;
}

.doc-row em {
  margin-top: 5px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-style: normal;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.wide-link {
  display: block;
  padding: 15px;
  color: var(--brand);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.page-head {
  margin-bottom: 8px;
}

.back-link {
  width: max-content;
  display: inline-flex;
  margin-bottom: 2px;
  color: var(--green);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.detail-image {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-image img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  object-position: top;
}

.detail-image figcaption {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag-row span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.detail-sections {
  margin-top: 20px;
}

.info-card {
  padding: 18px;
}

.step {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 920;
}

.info-card p {
  margin: 10px 0 0;
}

.info-card ul {
  margin: 14px 0 0;
  padding-left: 19px;
  color: #35413f;
}

.info-card li + li {
  margin-top: 7px;
}

.source-card {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
}

.source-card p,
.source-card h2 {
  margin-bottom: 0;
}

.next-prev {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.next-prev a {
  min-height: 72px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.next-prev small,
.next-prev strong {
  display: block;
}

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

.next-prev strong {
  margin-top: 3px;
  font-size: 16px;
}

.spec-card {
  padding: 18px;
}

.spec-card dl {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.spec-card dl div {
  display: grid;
  gap: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.spec-card dt {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.spec-card dd {
  margin: 0;
  color: #3c4744;
}

.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  color: inherit;
  text-decoration: none;
}

.source-row span {
  font-weight: 900;
}

.source-row small {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
}

.bottom-nav a[aria-current] {
  background: var(--surface-soft);
  color: var(--brand);
}

.bottom-nav span {
  height: 24px;
  font-size: 21px;
  line-height: 1;
}

.bottom-nav small {
  font-size: 11px;
  font-weight: 850;
}

@media (min-width: 760px) {
  :root {
    --nav-height: 0px;
  }

  .app-shell {
    padding-bottom: 0;
  }

  .app-header {
    min-height: 70px;
    padding: 14px 28px;
  }

  .app-main {
    padding: 28px 28px 56px;
  }

  .bottom-nav {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: center;
    min-height: 620px;
  }

  h1 {
    font-size: 62px;
  }

  .quick-panel {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .doc-row {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .doc-row img {
    width: 96px;
    height: 116px;
  }

  .detail-hero {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: end;
  }

  .back-link {
    grid-column: 1 / -1;
  }

  .detail-sections,
  .safety-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .source-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

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

@media (min-width: 1080px) {
  .doc-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .spec-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
