:root {
  color-scheme: light;
  --bg: #f1f2f4;
  --sidebar: #ebecef;
  --card: #ffffff;
  --ink: #303030;
  --heading: #1a1a1a;
  --muted: #616161;
  --line: #e3e3e3;
  --input-line: #8a8a8a;
  --primary: #1a1a1a;
  --green: #047857;
  --green-soft: #ecfdf5;
  --rust: #b91c1c;
  --amber: #fff1e3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Noto Sans SC", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: #005bd3; text-decoration: none; }
.sidebar a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid #005bd3;
  outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -.3px; color: var(--heading); }
h2 { font-size: 17px; font-weight: 650; line-height: 1.35; margin: 4px 0 6px; color: var(--heading); }
h3 { font-size: 15px; font-weight: 650; line-height: 1.4; color: var(--heading); }
p { color: var(--muted); }
strong { font-weight: 600; color: var(--heading); }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; font-size: 16px; font-weight: 700; letter-spacing: -.3px; color: var(--heading); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 38px; background: var(--primary); color: #ffffff; border-radius: 9px; font-size: 18px; font-weight: 700; position: relative; }
.brand-mark span { font-size: 11px; align-self: flex-start; margin-top: 4px; }
.brand-sub { display: block; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.sidebar > .eyebrow { margin: 24px 0 8px; }
nav { display: grid; gap: 4px; }
.nav-button { border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 9px 10px; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--ink); }
.nav-button:hover { background: #e3e5e9; }
.nav-button.active { background: #ffffff; color: var(--heading); font-weight: 650; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.nav-number { font-variant-numeric: tabular-nums; opacity: .6; font-size: 12px; }
.side-note { margin-top: auto; border-top: 1px solid #d4d6db; padding-top: 16px; }
.side-note p { margin: 6px 0 10px; font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 7px; }
.pill { display: inline-block; border: 1px solid #d4d4d8; background: #f4f4f5; padding: 2px 9px; border-radius: 999px; font-size: 12px; color: var(--ink); font-weight: 600; }
.side-foot { padding-top: 16px; font-size: 12px; line-height: 1.5; }
main { padding: 0 24px 32px; min-width: 0; max-width: 1400px; width: 100%; margin: 0 auto; }
.topbar { min-height: 56px; border-bottom: 1px solid var(--line); background: var(--card); margin: 0 -24px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.connection { font-size: 13px; color: var(--green); font-weight: 600; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar .toolbar { justify-content: flex-end; }
.topbar select { width: auto; background: var(--card); }
.quiet, .primary, .cancel { border-radius: 8px; padding: 7px 14px; border: 1px solid #d4d4d8; font-size: 13px; font-weight: 600; line-height: 1.4; min-height: 36px; transition: background .12s, border-color .12s; }
.quiet { background: var(--card); color: var(--ink); }
.quiet:hover { background: #f7f7f8; border-color: #a1a1aa; }
.primary { background: var(--primary); border-color: var(--primary); color: #ffffff; }
.primary:hover { background: #303030; border-color: #303030; }
.cancel { color: var(--rust); border-color: #f4c7c3; background: var(--card); }
.cancel:hover { background: #fee9e8; border-color: var(--rust); }
button:active { transform: translateY(1px); }
.trial-banner { padding: 10px 14px; border-radius: 8px; background: #cdfee1; color: #0c5132; margin-top: 16px; font-size: 13px; font-weight: 500; }
.trial-banner.urgent { background: var(--amber); color: #5e4200; border-left: 4px solid #d97706; }
.hero { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 20px 0 18px; }
.hero .eyebrow { margin-bottom: 8px; }
.hero-copy { max-width: 680px; margin-top: 8px; font-size: 14px; line-height: 1.6; }
.hero-seal { flex-shrink: 0; border: 1px solid var(--line); padding: 14px 18px; border-radius: 12px; min-width: 180px; text-align: center; background: var(--card); color: var(--green); box-shadow: var(--shadow); }
.hero-seal > span { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--heading); }
.hero-seal > span:nth-child(2) { font-size: 13px; margin: 2px 0; color: var(--muted); }
.hero-seal > div { font-size: 12px; margin-top: 6px; color: var(--green); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); margin-bottom: 20px; box-shadow: var(--shadow); }
.metrics article { padding: 16px 18px; border-right: 1px solid var(--line); }
.metrics article:last-child { border: 0; }
.metrics span { display: block; font-size: 12px; color: var(--muted); }
.metrics strong { display: block; font-size: 22px; font-weight: 700; line-height: 1.3; margin: 4px 0 4px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; color: var(--heading); }
.metric-accent { background: var(--green-soft); }
.metric-accent strong { color: var(--green); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.section-heading p { font-size: 13px; }
.section-heading .toolbar { justify-content: flex-end; max-width: 400px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > h3 { margin-bottom: 12px; }
.card > p { margin-bottom: 12px; }
.card-heading { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.card-heading .step { background: var(--green-soft); color: var(--green); width: 26px; height: 26px; font-weight: 700; line-height: 26px; border-radius: 50%; text-align: center; font-size: 13px; }
.card-heading .step + h3 { margin-right: auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 14px; }
.span-2 { grid-column: span 2; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; line-height: 1.45; }
input, select, textarea { border: 1px solid var(--input-line); background: #ffffff; border-radius: 8px; padding: 7px 10px; max-width: 100%; width: 100%; font-size: 14px; min-height: 36px; line-height: 1.4; }
input::placeholder { color: #8c8c8c; }
select { font-size: 13px; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; margin: 8px 0 12px; }
input[type=checkbox] { width: 16px; height: 16px; min-height: 16px; accent-color: var(--primary); margin: 2px 0 0; }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; }
.check > span { flex: 1; }
.accounting-note { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.accounting-note p { margin-top: 6px; font-size: 13px; line-height: 1.55; }
.text-button { background: transparent; border: 0; border-bottom: 1px solid var(--muted); padding: 2px 0; margin-top: 14px; color: var(--muted); font-size: 13px; }
.notice { background: #fff1e3; color: #5e4200; border-left: 3px solid #d97706; border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.5; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; min-width: 620px; }
th { font-weight: 600; color: var(--muted); background: #f8fafc; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
tr:last-child td { border: 0; }
.cell-sub { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.progress { height: 7px; background: #e5e7eb; border-radius: 20px; min-width: 90px; overflow: hidden; }
.progress span { display: block; background: var(--green); height: 100%; border-radius: 20px; }
.movement-tag { display: inline-block; background: var(--green-soft); color: var(--green); padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.movement-tag.return { background: #fff1e3; color: #9a3412; }
.empty-state { color: var(--muted); padding: 16px 6px; line-height: 1.6; }
.warning-card { border-color: #f4d6a8; }
.alert { padding: 10px 12px; background: #fee9e8; color: #8e1f0b; border-radius: 8px; margin: 8px 0; font-size: 13px; }
.alert strong { display: block; color: inherit; }
.alert.resolved { background: var(--green-soft); color: var(--green); }
.return-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.profit-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.waterfall-card { position: sticky; top: 16px; }
.profit-total { font-size: 30px; font-weight: 700; line-height: 1.3; color: var(--green); margin: 8px 0 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#profitStatus { font-size: 13px; color: var(--rust); margin-bottom: 16px; line-height: 1.5; }
.waterfall-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.waterfall-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.waterfall-top strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.waterfall-track { height: 5px; max-width: 100%; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.waterfall-track span { display: block; background: var(--green); height: 100%; border-radius: 4px; }
.waterfall-row.negative .waterfall-track span { background: #ef4444; }
.waterfall-row.total { background: var(--green-soft); margin-top: 6px; padding: 10px; border-radius: 6px; }
.form-note { font-size: 12px; margin-bottom: 12px; }
.full { width: 100%; margin-top: 12px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan { display: flex; flex-direction: column; align-items: flex-start; position: relative; overflow: hidden; }
.plan > span { font-size: 15px; font-weight: 600; }
.plan > strong { font-size: 30px; font-weight: 700; margin: 8px 0 4px; color: var(--heading); }
.plan > strong > span { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.plan > p { font-size: 14px; color: var(--ink); }
.plan > div:not(.pill) { font-size: 13px; color: var(--green); font-weight: 600; }
.plan.recommended { border: 2px solid var(--primary); }
.recommended .pill { align-self: flex-end; margin-bottom: 6px; background: var(--green-soft); color: #0c5132; border-color: #a3e6c7; }
.savings-amount { font-size: 28px; font-weight: 700; color: var(--green); margin: 10px 0; }
.result-line { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 13px; }
#billingState { font-size: 15px; font-weight: 600; color: var(--green); margin-bottom: 12px; }
#csvReport ul { padding-left: 20px; }
#csvReport li { margin-bottom: 8px; font-size: 13px; }
.valid { color: var(--green); }
.invalid { color: var(--rust); }
footer { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 0 8px; border-top: 1px solid var(--line); margin-top: 20px; color: var(--muted); font-size: 12px; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: 680px; width: calc(100% - 32px); padding: 12px 18px; background: #1a1a1a; color: #ffffff; border-radius: 10px; z-index: 100; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-size: 13px; }
#toast.error { background: var(--rust); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
[hidden] { display: none !important; }
@media (max-width: 1180px) { .shell { grid-template-columns: 200px minmax(0, 1fr); } main { padding: 0 18px 24px; } .topbar { margin: 0 -18px; padding: 0 18px; } .hero-seal { display: none; } .metrics { grid-template-columns: 1fr 1fr; } .metrics article:nth-child(2) { border-right: 0; } .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); } .profit-layout { grid-template-columns: 1fr; } .waterfall-card { position: static; } }
@media (max-width: 900px) { .shell { display: block; } .sidebar { position: static; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); } .sidebar > .eyebrow, .side-note, .side-foot { display: none; } .brand { margin-bottom: 10px; } .sidebar nav { display: flex; overflow-x: auto; gap: 6px; } .nav-button { flex-shrink: 0; padding: 8px 10px; } .two-col { grid-template-columns: 1fr; } .plan-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { main { padding: 0 14px 20px; } .topbar { margin: 0 -14px; padding: 10px 14px; flex-wrap: wrap; } .fields { grid-template-columns: 1fr; } .span-2 { grid-column: span 1; } .nav-number { display: none; } }
