:root {
  color-scheme: light;
  --ink: #29352f;
  --green: #507b38;
  --green-deep: #294731;
  --lime: #e3b548;
  --cream: #f4f3ef;
  --paper: #fffdfa;
  --coral: #d95c49;
  --sky: #79b7a4;
  --muted: #68766f;
  --line: rgba(41, 53, 47, .14);
  --soft: #edf4e8;
  --warning: #fff4d9;
  --danger: #fff0ec;
  --shadow: 0 24px 70px rgba(63, 83, 68, .15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 108px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.skip {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--paper);
  transform: translateY(-160%);
}
.skip:focus { transform: translateY(0); }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.reading { width: min(820px, calc(100% - 40px)); margin-inline: auto; }
.header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  padding: 12px clamp(18px, 5vw, 74px);
  border-bottom: 1px solid rgba(255,255,255,.65);
  background: rgba(245,244,237,.9);
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; text-decoration: none; }
.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  border: 1px solid rgba(41,53,47,.1);
  border-radius: 50%;
  background: #f1f1ef url("dailybalance-app-icon.png?v=20260805") center / cover no-repeat;
  box-shadow: 0 8px 22px rgba(41,53,47,.12);
}
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { line-height: 1; letter-spacing: -.045em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; gap: 28px; color: var(--muted); font-size: 14px; font-weight: 750; }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--green); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.article-language {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 76%, transparent);
}
.article-language::before { position: absolute; left: 12px; color: var(--green); content: "◎"; pointer-events: none; }
.article-language::after { position: absolute; right: 12px; color: var(--muted); content: "⌄"; pointer-events: none; }
.article-language select {
  min-height: 40px;
  max-width: 150px;
  padding: 0 33px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  appearance: none;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}
.article-language option { color: #17231d; background: #fff; }
.language-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}
.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 23px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 850;
  letter-spacing: -.02em;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(69,108,49,.22); }
.button-small { min-height: 42px; padding: 0 17px; font-size: 13px; }
.button-secondary { border-color: var(--line); background: color-mix(in srgb, var(--paper) 72%, transparent); color: var(--ink); }
.article-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 9vw, 126px) 0 clamp(58px, 7vw, 94px);
}
.article-hero::before, .article-hero::after {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  content: "";
  opacity: .28;
}
.article-hero::before { top: -250px; right: 3%; background: var(--lime); }
.article-hero::after { bottom: -310px; left: -130px; background: var(--sky); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .82fr); gap: clamp(38px, 6vw, 78px); align-items: center; }
.eyebrow { margin: 0 0 20px; color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.05em; }
h1 { max-width: 890px; margin: 0; font-size: clamp(50px, 7vw, 88px); line-height: .96; }
h1 em, h2 em { color: var(--green); font-weight: inherit; }
.lead { max-width: 760px; margin: 28px 0 0; color: #536963; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.62; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-aside { display: grid; gap: 16px; }
.hero-visual {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line);
  border-radius: 28px;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.hero-note {
  padding: 28px;
  border-radius: 28px;
  background: var(--green-deep);
  color: #fff;
  box-shadow: var(--shadow);
}
.hero-note .label { color: var(--lime); font-size: 11px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.hero-note strong { display: block; margin: 11px 0 8px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; line-height: 1.08; }
.hero-note p { margin: 0; color: rgba(255,255,255,.7); font-size: 14px; line-height: 1.6; }
.quick-nav { border-block: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 55%, transparent); }
.quick-nav .wrap { display: flex; gap: 10px; overflow-x: auto; padding-block: 15px; scrollbar-width: thin; }
.quick-nav a { flex: 0 0 auto; padding: 8px 13px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 800; text-decoration: none; }
.quick-nav a:hover { background: var(--soft); color: var(--green); }
.section { padding: clamp(66px, 8vw, 104px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-tint { background: color-mix(in srgb, var(--paper) 58%, transparent); }
.kicker { margin-bottom: 16px; color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.section h2 { margin: 0; font-size: clamp(36px, 5vw, 59px); line-height: 1.04; }
.section-intro { max-width: 780px; margin: 20px 0 0; color: var(--muted); font-size: 17px; }
.grid-2, .grid-3 { display: grid; gap: 16px; margin-top: 34px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 25px; border: 1px solid var(--line); border-radius: 24px; background: var(--paper); }
.card h3 { margin: 0 0 10px; font-size: 20px; letter-spacing: -.025em; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card ul { margin: 12px 0 0; padding-left: 20px; color: var(--muted); }
.card li + li { margin-top: 8px; }
.number { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 28px; border-radius: 14px; background: var(--soft); color: var(--green); font-family: Georgia, serif; font-size: 22px; }
.formula {
  margin-top: 30px;
  padding: clamp(25px, 4vw, 38px);
  border: 1px solid rgba(80,123,56,.2);
  border-radius: 28px;
  background: var(--green-deep);
  color: #fff;
}
.formula h3 { margin: 0 0 12px; font-family: Georgia, serif; font-size: 29px; font-weight: 500; letter-spacing: -.03em; }
.formula p { margin: 0; color: rgba(255,255,255,.72); }
.equation { display: block; margin: 18px 0; padding: 15px 18px; border-radius: 16px; background: rgba(255,255,255,.09); color: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: clamp(13px, 2vw, 16px); line-height: 1.55; overflow-wrap: anywhere; }
.formula-note { color: var(--lime) !important; font-size: 13px; font-weight: 750; }
.calculator { margin-top: 20px; padding: clamp(24px, 4vw, 34px); border: 1px solid var(--line); border-radius: 28px; background: var(--paper); box-shadow: 0 14px 46px rgba(63,83,68,.08); }
.calculator-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.calculator h3 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.calculator-head p { max-width: 590px; margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.calculator-fields { display: grid; grid-template-columns: minmax(160px, .55fr) 1fr; gap: 13px; margin-top: 22px; }
.calculator-fields-single { grid-template-columns: minmax(180px, 320px); }
.field { display: grid; gap: 7px; }
.field span { color: var(--muted); font-size: 12px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.field input, .field select { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--cream); color: var(--ink); }
.calculator-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.result { min-height: 108px; padding: 17px; border-radius: 18px; background: var(--soft); }
.result span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.result strong { display: block; margin-top: 7px; color: var(--green); font-family: Georgia, serif; font-size: clamp(23px, 4vw, 31px); font-weight: 500; line-height: 1.05; }
.calculator-disclaimer { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.table-wrap { margin-top: 30px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
table { width: 100%; min-width: 650px; border-collapse: collapse; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); color: var(--green-deep); font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.callout { margin-top: 26px; padding: 22px 24px; border: 1px solid #e4c56d; border-radius: 20px; background: var(--warning); }
.callout-danger { border-color: #edb5aa; background: var(--danger); }
.callout strong { display: block; margin-bottom: 5px; }
.risk-low { border-top: 5px solid var(--sky); }
.risk-high { border-top: 5px solid var(--coral); }
.check-list { display: grid; gap: 12px; margin-top: 28px; padding: 0; list-style: none; }
.check-list li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.check-list i { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--soft); color: var(--green); font-style: normal; font-weight: 900; }
.related { background: var(--green-deep); color: #fff; }
.related .kicker { color: var(--lime); }
.related h2 { color: #fff; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 30px; }
.related-card { display: flex; min-height: 150px; flex-direction: column; justify-content: space-between; padding: 21px; border: 1px solid rgba(255,255,255,.14); border-radius: 21px; background: rgba(255,255,255,.06); text-decoration: none; }
.related-card[aria-current="page"] { border-color: rgba(227,181,72,.7); background: rgba(227,181,72,.12); }
.related-card span { color: rgba(255,255,255,.55); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.related-card strong { margin-top: 14px; font-size: 18px; line-height: 1.25; }
.sources { color: var(--muted); font-size: 14px; }
.sources ol { padding-left: 22px; }
.sources li + li { margin-top: 9px; }
.sources a { color: var(--green); overflow-wrap: anywhere; }
.reviewed { margin-top: 22px; color: var(--muted); font-size: 12px; }
.footer { padding: 48px 0; background: #102e27; color: #fff; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 26px; align-items: end; }
.footer p { max-width: 610px; margin: 14px 0 0; color: rgba(255,255,255,.55); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; justify-content: flex-end; color: rgba(255,255,255,.74); font-size: 13px; font-weight: 750; }

@media (max-width: 920px) {
  .header { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-aside, .hero-note { max-width: 620px; }
  .grid-3, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .wrap, .reading { width: min(100% - 30px, 1120px); }
  .header { min-height: 70px; padding: 10px 15px; }
  .brand-copy small, .header .button { display: none; }
  .article-language select { max-width: 128px; }
  h1 { font-size: clamp(45px, 14vw, 65px); }
  .article-hero { padding-top: 60px; }
  .hero-visual { border-radius: 22px; }
  .hero-actions .button { width: 100%; }
  .grid-2, .grid-3, .related-grid, .calculator-results { grid-template-columns: 1fr; }
  .calculator-fields { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #f1f3ef;
    --green: #82b766;
    --green-deep: #17231a;
    --lime: #e3b548;
    --cream: #111713;
    --paper: #1b241e;
    --muted: #b1beb6;
    --line: rgba(241,243,239,.14);
    --soft: #243122;
    --warning: #302b1d;
    --danger: #38231f;
    --shadow: 0 24px 70px rgba(0,0,0,.3);
  }
  .header { border-bottom-color: rgba(255,255,255,.08); background: rgba(17,23,19,.9); }
  .brand-mark { border-color: rgba(255,255,255,.12); background-color: #ececea; }
  .lead { color: #b0c3bc; }
  .language-link, .button-secondary { background: rgba(255,255,255,.06); }
  .hero-note, .formula, .related { background: #18271e; }
  .field input, .field select { background: #141c17; }
  th { color: #d8edcf; }
}
