:root {
  color-scheme: light;
  --ink: #102526;
  --muted: #586b69;
  --paper: #f5f4ee;
  --panel: #ffffff;
  --line: #d9ded7;
  --energy: #e7ff69;
  --teal: #0b6b64;
  --teal-dark: #074b48;
  --shadow: 0 18px 55px rgba(16, 37, 38, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.65; }
a { color: inherit; }
.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--panel); padding: .7rem 1rem; }
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid rgba(217, 222, 215, .86); background: rgba(245, 244, 238, .92); backdrop-filter: blur(14px); }
.nav { width: min(1160px, calc(100% - 2.5rem)); min-height: 74px; margin: auto; display: flex; align-items: center; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; font-size: 1rem; font-weight: 780; letter-spacing: -.02em; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--energy); font-size: 14px; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 1.6rem; }
.nav-links a { font-size: .92rem; font-weight: 650; text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--teal); }
.nav-links .nav-action { padding: .62rem 1rem; border-radius: 999px; background: var(--ink); color: white; }
.hero, main > section { width: min(1100px, calc(100% - 2.5rem)); margin-inline: auto; }
.hero { padding: 7.5rem 0 5.5rem; }
.eyebrow, .kicker { color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.045em; }
h1 { max-width: 920px; margin: .6rem 0 1.4rem; font-size: clamp(3rem, 8vw, 6.8rem); font-weight: 790; }
.hero-lead { max-width: 760px; margin: 0; color: var(--muted); font-size: clamp(1.15rem, 2.4vw, 1.55rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.button { display: inline-flex; padding: .82rem 1.2rem; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: white; font-weight: 750; text-decoration: none; }
.button.secondary { background: transparent; color: var(--ink); }
main > section { padding: 5.5rem 0; border-top: 1px solid var(--line); }
h2 { max-width: 780px; margin: .55rem 0 2rem; font-size: clamp(2rem, 5vw, 4.2rem); }
h3 { margin: .5rem 0; font-size: 1.35rem; }
.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--line); box-shadow: var(--shadow); }
.metric-strip div { min-height: 170px; padding: 2rem; display: flex; flex-direction: column; justify-content: space-between; background: var(--panel); }
.metric-strip strong { font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.06em; }
.metric-strip span, p, li, dd { color: var(--muted); }
.three-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.three-columns article, .card { padding: 2rem; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.65); }
.step { display: inline-block; color: var(--teal); font: 800 .78rem/1 monospace; }
.split-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
.split-panel p { max-width: 560px; font-size: 1.08rem; }
.wide-copy { max-width: 760px; font-size: 1.15rem; }
.text-link { color: var(--teal-dark); font-weight: 780; text-decoration-thickness: 1px; text-underline-offset: .28em; }
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.card { display: block; color: inherit; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card span { color: var(--teal); font-weight: 750; }
.prose { max-width: 850px; }
.prose h2 { margin-top: 3.6rem; font-size: clamp(1.8rem, 4vw, 3rem); }
.prose p, .prose li, .prose dd { font-size: 1.04rem; }
.prose li { margin: .55rem 0; }
.prose dt { margin-top: 1.2rem; font-weight: 800; }
.prose dd { margin-left: 0; }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .9em; }
pre { overflow-x: auto; padding: 1.4rem; border-radius: 14px; background: var(--ink); color: #ecfff4; line-height: 1.55; }
aside { margin: 2rem 0; padding: 1.4rem 1.6rem; border-left: 4px solid var(--teal); background: #e9f2ee; }
aside p { margin-bottom: 0; }
.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.pipeline span { padding: .7rem 1rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; }
.pipeline b { color: var(--teal); }
.tool-shell { max-width: 820px; margin-bottom: 5rem; padding: clamp(2rem, 6vw, 4rem); border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.gateway-state { display: flex; gap: .6rem; align-items: center; color: var(--muted); font-size: .9rem; }
.tool-shell h2 { margin-top: 1.3rem; }
.status-dot { width: .62rem; height: .62rem; border-radius: 50%; background: #d99b18; box-shadow: 0 0 0 5px rgba(217,155,24,.14); }
.status-dot.ready { background: #16856f; box-shadow: 0 0 0 5px rgba(22,133,111,.14); }
.tool-shell form { margin: 2rem 0; }
.file-field { display: grid; gap: .35rem; padding: 1.4rem; border: 1px dashed #9aaba7; border-radius: 16px; background: #f8faf6; cursor: pointer; }
.file-field span { color: var(--muted); font-size: .9rem; }
.file-field input { margin-top: .8rem; max-width: 100%; }
.feedback { min-height: 1.6rem; margin: .85rem 0 1.2rem; font-size: .92rem; }
.feedback[data-kind="success"] { color: var(--teal-dark); }
.feedback[data-kind="error"] { color: #a23b32; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
.analysis-progress { padding: .8rem 1rem; border-radius: 12px; background: #e9f2ee; color: var(--teal-dark); }
.analysis-result { margin: 2rem 0; padding-top: 2rem; border-top: 1px solid var(--line); }
.result-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.result-heading h3 { font-size: 2rem; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.result-actions .button { padding: .6rem .9rem; }
.text-button { border: 0; background: transparent; color: #8a302a; text-decoration: underline; text-underline-offset: .22em; }
.result-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; margin: 1.5rem 0 2rem; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.result-metrics div { padding: 1rem; background: var(--paper); }
.result-metrics dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.result-metrics dd { margin: .3rem 0 0; color: var(--ink); font-weight: 780; }
.signature-labels { display: grid; gap: .7rem; padding: 0; list-style: none; }
.signature-labels li { display: grid; gap: .2rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.signature-labels span { font-size: .88rem; color: var(--muted); }
.result-boundary { margin-top: 1.5rem; font-size: .88rem; }
.site-footer { margin-top: 4rem; background: var(--ink); color: white; }
.footer-inner { width: min(1100px, calc(100% - 2.5rem)); margin: auto; padding: 3.4rem 0; display: flex; gap: 2rem; justify-content: space-between; }
.site-footer p { max-width: 600px; margin: 0; color: #bed0cc; }
.site-footer a { color: white; }

@media (max-width: 720px) {
  .nav { align-items: stretch; flex-direction: column; gap: .8rem; padding: 1rem 0; }
  .nav-links { width: 100%; margin-left: 0; gap: .45rem; flex-wrap: nowrap; justify-content: space-between; }
  .nav-links a { font-size: .8rem; }
  .nav-links .nav-action { padding: .42rem .7rem; }
  .hero { padding-top: 5rem; }
  .metric-strip, .three-columns, .split-panel, .card-grid { grid-template-columns: 1fr; }
  .split-panel { gap: 1rem; }
  .footer-inner { flex-direction: column; }
  .result-heading { display: block; }
  .result-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}
/* Account forms share the upload workspace and remain usable on narrow screens. */
#account-panel { margin-bottom: 1.5rem; }
#account-form { display: grid; gap: 1rem; max-width: 32rem; }
#account-form label { display: grid; gap: .4rem; font-weight: 600; }
#account-form input { padding: .8rem; border: 1px solid #a6b5bc; border-radius: .5rem; font: inherit; width: 100%; box-sizing: border-box; }
#account-panel [hidden] { display: none; }
#account-message { overflow-wrap: anywhere; }
#iammeter-login { margin-top: 1.2rem; }
#account-panel button:disabled { opacity: .55; cursor: not-allowed; }
#nav-account { display: inline-flex; align-items: center; gap: .8rem; max-width: 14rem; }
#nav-account a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-shell form { display: grid; gap: 1rem; max-width: 32rem; }
.account-shell label { display: grid; gap: .5rem; }
.account-shell input { width: 100%; box-sizing: border-box; font: inherit; padding: .8rem; border: 1px solid #a6b5bc; border-radius: .5rem; }
.account-shell [hidden] { display: none !important; }
.account-shell dd { margin: .3rem 0 1.2rem; overflow-wrap: anywhere; }
.account-tabs { display: flex; gap: 1rem; }
.account-shell button:disabled { opacity: .55; cursor: not-allowed; }
#auth-feedback, #sent-address { overflow-wrap: anywhere; }
@media (max-width: 760px) { .nav-links { flex-wrap: wrap; } }
.auth-card { max-width: 460px; margin: 3rem auto; padding: 2rem; border-radius: 18px; }
.auth-card h1 { font-size: 1.8rem; margin: 0 0 .75rem; }
.auth-card form { margin: 1.5rem 0; }
.auth-card .button { width: 100%; box-sizing: border-box; justify-content: center; }
.auth-card .auth-divider { text-align: center; margin: 1rem 0; }
.auth-card .account-tabs { gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.auth-card .account-tabs button { padding: 0; font-size: .875rem; }
.auth-card .account-tabs button[aria-pressed="true"] { font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }
.auth-card .auth-hint, .auth-card #iammeter-status { font-size: .875rem; }
@media (max-width: 480px) { .auth-card { margin: 1.5rem auto; padding: 1.5rem; } }
.admin-users-shell { max-width: none; }
.admin-users-shell [hidden] { display: none !important; }
.users-table-scroll { overflow-x: auto; }
.users-table-scroll table { border-collapse: collapse; width: 100%; min-width: 780px; }
.users-table-scroll th, .users-table-scroll td { padding: .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; max-width: 280px; }
.users-table-scroll th { font-size: .875rem; }
.customer-report { min-width: 0; }
.customer-report svg { display: block; width: 100%; max-height: 280px; }
.customer-report figure { margin: 1rem 0; }
.customer-report figcaption { font-size: .85rem; color: #52646d; }
.customer-report .report-warning { background: #fff3cd; color: #664d03; padding: .8rem; border-radius: 8px; }
.customer-report .result-metrics { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.weekly-averages { width: 100%; border-collapse: collapse; font-size: .9rem; }
.weekly-averages th, .weekly-averages td { text-align: left; padding: .6rem .3rem; border-bottom: 1px solid #d6dedf; }
.weekly-averages caption { text-align: left; margin: .6rem 0; }
