:root {
  --ink: #101828; --ink-soft: #475467; --ink-faint: #98a2b3;
  --line: #e4e7ec; --paper: #ffffff; --wash: #f6f8fb;
  --brand: #0f3d5c; --brand-soft: #e8f1f7; --accent: #f0a202;
  --good: #067647; --good-soft: #ecfdf3;
  --warn: #b54708; --warn-soft: #fffaeb;
  --bad: #b42318; --bad-soft: #fef3f2;
  --grow: #175cd3; --grow-soft: #eff8ff;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--wash); line-height: 1.55;
}
a { color: var(--brand); }
h1, h2, h3 { margin: 0 0 .5em; letter-spacing: -0.015em; }
.wrap { max-width: 880px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.wrap--narrow { max-width: 420px; }

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.25rem; background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; text-decoration: none; color: var(--ink); display: flex; gap: .5rem; align-items: center; }
.topbar .brand-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: .85rem;
}
.topbar nav { margin-left: auto; display: flex; gap: 1rem; align-items: center; font-size: .88rem; }
.topbar nav a { text-decoration: none; color: var(--ink-soft); }
.plan-chip { font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }
.plan-chip--demo { background: #fff1ec; color: #e2542a; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.25rem;
}
.card h2 { font-size: 1.2rem; }
.muted { color: var(--ink-soft); font-size: .88rem; }

label { display: block; font-size: .85rem; font-weight: 600; margin: 1rem 0 .3rem; }
label:first-of-type { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], select {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: .95rem; background: var(--paper);
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
small.hint { display: block; color: var(--ink-faint); font-size: .78rem; margin-top: .25rem; }

.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 650;
  padding: .72rem 1.35rem; border-radius: 11px;
  background: linear-gradient(180deg, #ff6a3d 0%, #e2542a 100%); color: #fff;
  text-decoration: none; font-size: .92rem;
  box-shadow: 0 1px 2px rgba(226,84,42,.28), 0 6px 16px rgba(226,84,42,.24);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .22s cubic-bezier(.2,.7,.3,1),
              background-color .18s, border-color .18s, color .18s;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(226,84,42,.3), 0 12px 26px rgba(226,84,42,.3);
}
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { background: #cdd5df; box-shadow: none; cursor: not-allowed; }
.btn--ghost {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); box-shadow: none;
}
.btn--ghost:hover {
  border-color: var(--brand); color: var(--brand); background: var(--brand-soft);
  box-shadow: 0 4px 12px rgba(16,24,40,.08);
}
.btn--sm { padding: .48rem .95rem; font-size: .82rem; }
.card { transition: box-shadow .22s cubic-bezier(.2,.7,.3,1); }

.download-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem 1.5rem; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 13px; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.download-bar__label { flex: 1; min-width: 220px; }
.download-bar__label strong { display: block; margin-bottom: .15rem; }
.download-bar__label span { font-size: .86rem; color: var(--ink-soft); }
.download-bar .results-tools { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 640px) {
  .download-bar .results-tools { width: 100%; }
  .download-bar .results-tools .btn { width: 100%; text-align: center; }
}

.upgrade-card { border: 2px solid var(--accent); }
.upgrade-card h2 { margin-bottom: .5rem; }
.upgrade-card .btn { margin-right: .5rem; margin-top: .5rem; }

.allowance-note {
  background: var(--brand-soft); border: 1px solid #bcd7e8; color: var(--ink-soft);
  border-radius: 10px; padding: .7rem 1rem; font-size: .87rem; margin-bottom: 1.25rem;
}
.upgrade-inline {
  background: var(--warn-soft); border: 1px solid #fedf89; color: #7a2e0e;
  border-radius: 10px; padding: .8rem 1rem; font-size: .88rem; line-height: 1.55;
}
.upgrade-inline a { color: #7a2e0e; }

.demo-hint { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.demo-hint summary { cursor: pointer; font-size: .82rem; color: var(--ink-faint); }
.demo-hint p { margin: .6rem 0 0; font-size: .82rem; }
.demo-hint code { background: var(--wash); padding: .1rem .35rem; border-radius: 4px; }

.or-divider {
  display: flex; align-items: center; gap: .8rem;
  margin: 1.4rem 0 1rem; color: var(--ink-faint); font-size: .78rem;
}
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.error {
  background: var(--bad-soft); color: var(--bad); border: 1px solid #fca5a5;
  border-radius: 9px; padding: .7rem .9rem; font-size: .87rem; margin-bottom: 1rem;
}
.notice {
  background: var(--good-soft); color: var(--good); border: 1px solid #6ee7b7;
  border-radius: 9px; padding: .7rem .9rem; font-size: .87rem; margin-bottom: 1rem;
}

table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--good); }
.neg { color: var(--bad); }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); }

.demo-banner {
  background: var(--warn-soft); border: 1px solid #fedf89; color: #7a2e0e;
  border-radius: 10px; padding: .8rem 1rem; font-size: .87rem; margin-bottom: 1.25rem;
}

.status { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.status--waste  { background: var(--bad-soft);  color: var(--bad); }
.status--reduce { background: var(--warn-soft); color: var(--warn); }
.status--watch  { background: #fff4e5;          color: #8a5200; }
.status--good   { background: var(--good-soft); color: var(--good); }
.status--grow   { background: var(--grow-soft); color: var(--grow); }
