:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-soft: #f0f3ef;
  --ink: #181b1f;
  --text: #2b3237;
  --muted: #6b7470;
  --line: #d9ddd6;
  --line-strong: #bfc7bd;
  --green: #1f6f63;
  --green-strong: #154f47;
  --blue: #315d7a;
  --gold: #8a6d22;
  --coral: #9b4d40;
  --shadow: 0 18px 48px rgba(24, 27, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body {
  margin: 0;
}

a {
  color: var(--green-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

.site-header,
.site-footer,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-strong);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

nav a:hover {
  color: var(--green-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 38px;
  align-items: center;
  min-height: 560px;
  padding: 52px 0 48px;
}

.hero-copy h1,
.page-head h1,
.article-head h1 {
  max-width: 850px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.35rem, 5vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p,
.page-head p,
.article-head p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 760;
  text-decoration: none;
}

.button:hover {
  background: var(--green-strong);
}

.text-link {
  font-weight: 760;
  overflow-wrap: anywhere;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin: 34px 0 0;
}

.hero-stats div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.hero-stats dt {
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 850;
}

.hero-stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-visual {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fbfbf8;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section,
.page-head,
.article-shell {
  padding: 44px 0 76px;
}

.section-band {
  width: 100%;
  padding: 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-soft);
}

.section-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-head-row {
  display: flex;
  max-width: none;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-head h2,
.split-section h2,
.faq-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.85rem;
  line-height: 1.18;
}

.section-head p {
  color: var(--muted);
}

.topic-grid,
.post-grid,
.post-list {
  display: grid;
  gap: 16px;
}

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

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

.topic-card,
.post-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.topic-card span {
  color: var(--coral);
  font-size: 0.84rem;
  font-weight: 850;
}

.topic-card h2,
.topic-card h3,
.post-card h2,
.post-card h3 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.25;
}

.topic-card a,
.post-card h2 a,
.post-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.topic-card p,
.post-card p {
  margin: 0;
  color: var(--muted);
}

.post-card time,
.article-meta {
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 720;
}

.archive-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.archive-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

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

.tag-row span,
.tag-row a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
  text-decoration: none;
}

.read-link {
  align-self: flex-start;
  font-weight: 760;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1.15fr);
  gap: 30px;
  align-items: start;
  border-top: 1px solid var(--line);
}

.check-list {
  padding: 22px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.check-list p {
  margin-top: 0;
}

.article-shell {
  max-width: 1100px;
}

.article-head {
  max-width: 850px;
  margin-bottom: 34px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.article-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 760px);
  gap: 34px;
  align-items: start;
}

.toc-panel {
  position: sticky;
  top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.toc-panel p {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 800;
}

.toc-panel nav ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 16px;
}

.toc-panel a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.article-body {
  color: var(--text);
  font-size: 1.06rem;
}

.article-body h2,
.article-body h3 {
  color: var(--ink);
  line-height: 1.22;
}

.article-body h2 {
  margin-top: 38px;
  font-size: 1.58rem;
}

.article-body h3 {
  margin-top: 28px;
  font-size: 1.24rem;
}

.article-body code {
  border-radius: 5px;
  background: #e7ece5;
  padding: 0.12em 0.3em;
}

.article-body pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 8px;
  background: #101820;
  color: #edf6f3;
}

.faq-section,
.cta-panel,
.related-section {
  margin-top: 42px;
}

.faq-section details {
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.faq-section summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 780;
}

.faq-section p {
  margin-bottom: 0;
  color: var(--muted);
}

.cta-panel {
  padding: 22px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.cta-panel p {
  margin-top: 0;
}

.cta-panel a {
  font-weight: 800;
}

.compact {
  gap: 12px;
}

.compact-card {
  min-height: 150px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

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

.site-footer p {
  max-width: 520px;
  margin: 6px 0 0;
}

@media (max-width: 980px) {
  .topic-grid,
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .toc-panel {
    position: static;
  }
}

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

  .hero,
  .split-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 34px;
  }

  .section-head-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .site-header,
  .site-footer,
  main {
    width: min(100% - 24px, 1180px);
  }

  .hero-copy h1,
  .page-head h1,
  .article-head h1 {
    font-size: 2.25rem;
  }

  .hero-stats,
  .topic-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .section-band {
    padding: 22px;
  }

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

/* Distinct fieldbook surfaces, with per-site visual identity */
.template-hugo_fieldbook main {
  width: min(1180px, calc(100% - 32px));
}

.site-llm-api-reliability {
  --bg: #f4f7f5;
  --surface-soft: #e8f0ec;
  --green: #1f6f63;
  --green-strong: #143f3a;
  --blue: #2a5f7d;
  --gold: #7b6c22;
  --coral: #9b4d40;
}

.site-ai-cost-controls {
  --bg: #fbf7ee;
  --surface-soft: #f4ead8;
  --green: #7b5a14;
  --green-strong: #5f3f08;
  --blue: #285e7a;
  --gold: #a66d12;
  --coral: #a64f2e;
  --line: #dfd1ba;
  --line-strong: #c8aa7f;
}

.site-ai-cost-controls .brand-mark {
  background: var(--gold);
}

.field-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.72fr);
  gap: 34px;
  align-items: center;
  min-width: 0;
  min-height: 560px;
  padding: 50px 0 54px;
}

.field-hero-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.field-hero-copy p {
  max-width: 700px;
  color: var(--muted);
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

.reliability-hero {
  border-bottom: 1px solid var(--line);
}

.cost-hero {
  border-bottom: 1px solid var(--line-strong);
}

.incident-board,
.cost-ledger {
  min-width: 0;
  min-height: 380px;
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(24, 27, 31, 0.13);
}

.incident-board {
  padding: 24px;
  border: 1px solid #223d38;
  background: #12201d;
  color: #edf6f3;
}

.incident-status {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.pulse {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  background: #77e0c8;
  box-shadow: 0 0 0 6px rgba(119, 224, 200, 0.14);
}

.incident-status strong {
  color: #ffffff;
}

.incident-status em {
  color: #9eb8b0;
  font-style: normal;
  font-weight: 760;
}

.incident-board ol {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.incident-board li {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.incident-board li span {
  color: #77e0c8;
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.incident-board li strong {
  color: #ffffff;
  overflow-wrap: anywhere;
}

.cost-ledger {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 24px;
  border: 1px solid #c7a36f;
  background: linear-gradient(180deg, #fffaf0 0%, #f6ead4 100%);
}

.ledger-head,
.ledger-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 70px;
  gap: 12px;
  align-items: center;
}

.ledger-head {
  color: #7a5a23;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.ledger-row {
  padding: 15px;
  border: 1px solid #dac5a2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.ledger-row strong {
  color: #2c2418;
  overflow-wrap: anywhere;
}

.ledger-row em {
  justify-self: end;
  color: #7a4d13;
  font-style: normal;
  font-weight: 850;
}

.bar {
  display: block;
  height: 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, #2d6f67 0%, #b9822e 68%, #a64f2e 100%);
}

.bar.wide {
  width: 96%;
}

.bar.mid {
  width: 68%;
}

.bar.low {
  width: 38%;
}

.ledger-total {
  margin-top: 10px;
  padding: 18px;
  border-radius: 8px;
  background: #2c2418;
  color: #fff7e9;
}

.ledger-total span,
.ledger-total strong {
  display: block;
}

.ledger-total span {
  color: #e0c79e;
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.field-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.field-stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.field-stat strong,
.field-stat span {
  display: block;
}

.field-stat strong {
  color: var(--ink);
  font-size: 1.45rem;
}

.field-stat span {
  color: var(--muted);
}

.field-map {
  padding: 34px;
  border-radius: 8px;
}

.site-llm-api-reliability .field-map {
  border: 1px solid #cad9d2;
  background: #eef4f1;
}

.site-ai-cost-controls .field-map {
  border: 1px solid #dec8a4;
  background: #f6ead4;
}

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

.field-lane-grid article {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.field-lane-grid span {
  color: var(--coral);
  font-weight: 850;
}

.field-lane-grid h3 {
  margin: 10px 0 8px;
  color: var(--ink);
}

.field-lane-grid p {
  margin: 0;
  color: var(--muted);
}

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

.field-note {
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.field-note time {
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 820;
}

.field-note h3 {
  margin: 8px 0;
  line-height: 1.25;
}

.field-note h3 a {
  color: var(--ink);
  text-decoration: none;
}

.field-note p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .field-hero,
  .field-note-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
  }

  nav {
    width: 100%;
    gap: 12px 16px;
  }

  .field-hero {
    width: 100%;
    max-width: 366px;
    min-height: auto;
    padding-top: 28px;
    overflow: hidden;
  }

  .field-hero-copy,
  .incident-board,
  .cost-ledger {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .field-hero-copy {
    max-width: 340px;
  }

  .field-hero-copy h1 {
    max-width: 100%;
    font-size: 1.85rem;
    word-break: break-word;
  }

  .field-hero-copy p {
    max-width: 100%;
  }

  .field-overview,
  .field-lane-grid {
    grid-template-columns: 1fr;
  }

  .field-map {
    padding: 22px;
  }

  .incident-board,
  .cost-ledger {
    max-width: 340px;
    overflow: hidden;
    min-height: auto;
    padding: 18px;
  }

  .incident-status {
    grid-template-columns: 16px minmax(0, 1fr);
  }

  .incident-status em {
    grid-column: 2;
    justify-self: start;
  }

  .incident-board li {
    grid-template-columns: 1fr;
  }

  .ledger-head {
    display: none;
  }

  .ledger-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .bar {
    max-width: 100%;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
