:root {
  color-scheme: light;
  --page: #f5f6f8;
  --surface: #ffffff;
  --soft: #f0f2f5;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d8dde5;
  --accent: #e85d3f;
  --accent-dark: #bd3f28;
  --focus: #2563eb;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--page); }
button, input { font: inherit; }
a { color: inherit; }

.site { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 24px; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; font-size: .95rem; font-weight: 750; text-decoration: none; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--accent); color: #fff; font-size: 1.05rem; font-weight: 800; }

.nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.nav a { padding: 8px 10px; border-radius: 7px; color: var(--muted); font-size: .78rem; font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.active { background: #feece8; color: var(--accent-dark); }

.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 26px rgba(27, 39, 55, .07); }
.hero { padding: 42px 48px 30px; border-bottom: 1px solid var(--line); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.12; letter-spacing: -.025em; }
.lead { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; }
form { display: grid; align-content: center; gap: 17px; padding: 38px 48px 42px; }
label { display: grid; gap: 7px; color: #475467; font-size: .82rem; font-weight: 650; }
input[type="number"] { width: 100%; height: 48px; border: 1px solid #b9c1cc; border-radius: 8px; padding: 10px 13px; background: #fff; color: var(--ink); font-size: 1.05rem; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .04); }
input[type="number"]:hover { border-color: #8993a1; }
input[type="number"]:focus { border-color: var(--focus); outline: 3px solid rgba(37, 99, 235, .14); }

.actions, .toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
button { min-height: 40px; border: 1px solid var(--accent); border-radius: 8px; padding: 9px 15px; background: var(--accent); color: #fff; cursor: pointer; font-size: .85rem; font-weight: 700; transition: background 140ms ease, border-color 140ms ease, transform 140ms ease; }
button:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
button:active { transform: translateY(1px); }
button.secondary { border-color: #c4cad3; background: #fff; color: #344054; }
button.secondary:hover { border-color: #98a2b3; background: var(--soft); }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 2px; }
.toggle { color: var(--muted); font-size: .8rem; font-weight: 500; }
.toggle input { accent-color: var(--accent); }

.formula-block { padding: 12px 14px; border-radius: 8px; background: var(--soft); }
.formula-block > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.detail { min-height: 20px; overflow-wrap: anywhere; color: #475467; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .78rem; line-height: 1.5; }

.result-card { position: relative; display: grid; min-height: 330px; place-items: center; padding: 46px 36px 34px; border-left: 1px solid var(--line); background: #272d3a; color: #fff; }
.result-label { position: absolute; top: 22px; left: 24px; color: #aeb7c6; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.ring { display: grid; width: 230px; height: 230px; place-items: center; border-radius: 50%; background: conic-gradient(var(--ring-color, var(--accent)) var(--pct, 0%), #424a59 0); transition: background 220ms ease-out; }
.ring-inner { display: grid; width: 210px; height: 210px; place-content: center; border-radius: 50%; background: #272d3a; padding: 22px; text-align: center; }
.result { overflow-wrap: anywhere; font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 750; line-height: 1; letter-spacing: -.05em; }
.caption { max-width: 175px; margin-top: 11px; color: #c7ced9; font-size: .82rem; line-height: 1.4; }

.examples { padding: 38px 48px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.section-heading p { margin-bottom: 18px; color: var(--muted); font-size: .84rem; }
h2 { margin-bottom: 18px; font-size: 1.35rem; letter-spacing: -.015em; }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
button.example { width: 100%; min-height: 58px; border-color: var(--line); padding: 11px 13px; background: #fff; color: #344054; font-size: .78rem; font-weight: 600; text-align: left; }
button.example:hover { border-color: #aeb6c2; background: var(--soft); color: var(--ink); }

.article { max-width: 780px; padding: 4px 48px 46px; color: #475467; font-size: .96rem; line-height: 1.7; }
.article h2 { color: var(--ink); }
.article p { max-width: 68ch; }
.article strong { color: var(--ink); }
.guide-directory { padding: 38px 48px; border-top: 1px solid var(--line); }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.guide-grid a, .related a { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; color: var(--accent-dark); font-weight: 650; text-decoration: none; }
.guide-grid a:hover, .related a:hover { background: var(--soft); }
.article-page article { color: #475467; }
.article-hero { padding: 42px 48px 32px; border-bottom: 1px solid var(--line); }
.eyebrow { margin-bottom: 8px; color: var(--accent-dark); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.article-body { max-width: 820px; margin: 0 auto; padding: 38px 48px 52px; font-size: 1rem; line-height: 1.75; }
.article-body h2 { margin-top: 36px; color: var(--ink); }
.article-body h3 { margin: 24px 0 6px; color: var(--ink); font-size: 1.05rem; }
.article-body li { margin-bottom: 7px; }
.article-body a { color: var(--accent-dark); text-underline-offset: 3px; }
.quick-answer { margin: 26px 0; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; padding: 18px 20px; background: #fff4f1; }
.quick-answer strong, .quick-answer code { display: block; }
.quick-answer code { margin-top: 7px; overflow-wrap: anywhere; color: var(--ink); font-size: .92rem; }
.article-body table { width: 100%; border-collapse: collapse; margin: 18px 0 28px; font-size: .9rem; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--soft); color: var(--ink); }
.related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 36px; }
.related strong { grid-column: 1 / -1; }

.network-footer { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 22px 0 32px; color: var(--muted); font-size: .78rem; }
.network-footer__links { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-bottom: 15px; }
.network-footer__links a { text-decoration-color: #aeb6c2; text-underline-offset: 3px; }

@media (max-width: 840px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 18px; }
  .nav { justify-content: flex-start; }
  .workspace { grid-template-columns: 1fr; }
  .result-card { min-height: 260px; border-top: 1px solid var(--line); border-left: 0; }
  .example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .site, .network-footer { width: min(100% - 24px, 1080px); }
  .site { padding-top: 14px; }
  .topbar { margin-bottom: 14px; }
  .nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .nav a { flex: 0 0 auto; }
  .panel { border-radius: 10px; }
  .hero, form, .examples, .article, .guide-directory, .article-hero, .article-body { padding-right: 22px; padding-left: 22px; }
  .hero { padding-top: 28px; padding-bottom: 24px; }
  h1 { font-size: 1.8rem; }
  form { padding-top: 26px; padding-bottom: 28px; }
  .result-card { min-height: 225px; padding: 30px 22px; }
  .example-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading p { margin-top: -8px; }
  .guide-grid, .related { grid-template-columns: 1fr; }
  .article-body { overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
