/* ProfitKit — shared styles. System fonts only, no external requests. */
:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --text: #0f172a;
  --muted: #5b6475;
  --border: #e3e7ef;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eef0ff;
  --good: #0f9d6b;
  --bad: #d4364a;
  --c-cost: #64748b;
  --c-fees: #f59e0b;
  --c-ship: #0ea5e9;
  --c-ads: #a855f7;
  --c-profit: #10b981;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e14;
    --surface: #121722;
    --surface-2: #19202d;
    --text: #e6e9f0;
    --muted: #9aa3b5;
    --border: #252d3c;
    --brand: #818cf8;
    --brand-ink: #0b0e14;
    --brand-soft: #1c2140;
    --good: #34d399;
    --bad: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--brand); text-underline-offset: 2px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: .2em 0 .35em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.1rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }

/* Header / nav */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); z-index: 5; }
@media (min-width: 860px) { .site-header { position: sticky; top: 0; } }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px 0; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .92rem; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }

/* Breadcrumb + hero */
.crumbs { font-size: .85rem; color: var(--muted); margin: 18px 0 0; }
.crumbs a { color: var(--muted); }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 760px; }
.updated { font-size: .85rem; color: var(--muted); }

/* Calculator layout */
.calc { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 20px 0 8px; }
@media (min-width: 860px) { .calc { grid-template-columns: 1.1fr .9fr; align-items: start; } .results { position: sticky; top: 76px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card h2 { margin: 0 0 14px; font-size: 1.1rem; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 520px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .88rem; font-weight: 600; }
.field .hint { font-size: .78rem; color: var(--muted); }
.input { position: relative; display: flex; align-items: center; }
.input .unit { position: absolute; left: 12px; color: var(--muted); font-size: .95rem; pointer-events: none; }
.input .unit.right { left: auto; right: 12px; }
input[type="number"], select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  appearance: none;
  -moz-appearance: textfield;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.input.has-unit input { padding-left: 30px; }
.input.has-unit-right input { padding-right: 44px; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
input.invalid { border-color: var(--bad); }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; }
.seg label { flex: 1; text-align: center; padding: 8px 6px; border-radius: 8px; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--text); }
.seg label:has(input:checked) { background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* Results */
.big { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--brand-soft); border-radius: 12px; margin-bottom: 14px; }
.big .label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.big .value { font-size: 2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.value.pos { color: var(--good); }
.value.neg { color: var(--bad); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.kpi .label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 6px 0 10px; }
.bar span { display: block; height: 100%; transition: width .25s ease; }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .88rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .amt { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.legend .pct { width: 52px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.lines { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 14px; }
.lines td { padding: 6px 0; border-top: 1px solid var(--border); }
.lines td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.lines tr.total td { font-weight: 700; }
.note { font-size: .8rem; color: var(--muted); margin: 12px 0 0; }
.warn { font-size: .85rem; background: #fff7e6; color: #8a5300; border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
@media (prefers-color-scheme: dark) { .warn { background: #2a2110; color: #f5c46b; } }
.warn[hidden] { display: none; }

/* Content */
.content { max-width: 780px; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: .35em; }
.formula { font-family: var(--mono); font-size: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; white-space: pre; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin: 0 0 1em; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { background: var(--surface-2); font-weight: 650; }
table.data tr:last-child td { border-bottom: 0; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 16px 14px; color: var(--text); }
.faq details > div p:last-child { margin-bottom: 0; }

/* Tool cards on home */
.tools { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 20px 0; }
@media (min-width: 640px) { .tools { grid-template-columns: 1fr 1fr; } }
.tool { display: block; text-decoration: none; color: var(--text); transition: transform .15s ease, border-color .15s ease; }
.tool:hover { transform: translateY(-2px); border-color: var(--brand); }
.tool .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 10px; }
.tool .ico svg { width: 22px; height: 22px; }
.tool h2 { margin: 0 0 6px; font-size: 1.15rem; }
.tool p { color: var(--muted); margin: 0; font-size: .95rem; }

.related { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.related a { display: inline-block; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: .9rem; font-weight: 500; }

/* Footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--border); background: var(--surface); font-size: .9rem; color: var(--muted); }
.site-footer .wrap { padding-top: 24px; padding-bottom: 28px; display: grid; gap: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer a { color: var(--muted); }

/* ---------- v2 visual layer ---------- */
:root { --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%); --hero-bg: radial-gradient(1200px 400px at 10% -10%, #e0e7ff 0%, transparent 60%), radial-gradient(900px 400px at 100% 0%, #fce7f3 0%, transparent 55%); }
@media (prefers-color-scheme: dark) { :root { --hero-bg: radial-gradient(1200px 400px at 10% -10%, #1e1b4b 0%, transparent 60%), radial-gradient(900px 400px at 100% 0%, #3b0d2a 0%, transparent 55%); } }
body { background-image: var(--hero-bg); background-repeat: no-repeat; }
.site-header { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
@media (max-width: 859px) { .nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; } .nav::-webkit-scrollbar { display: none; } .nav a { white-space: nowrap; } }

.hero { padding: 6px 0 4px; }
.hero h1 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 4px 0 0; }
.badges li { font-size: .8rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.badges li::before { content: "✓ "; color: var(--good); }
.byline { font-size: .88rem; color: var(--muted); }

.home-hero { text-align: center; padding: 48px 0 12px; max-width: 820px; margin: 0 auto; }
.home-hero h1 { font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1.1; margin: .3em 0; }
.home-hero .lead { margin: 0 auto; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: 6px 12px; border-radius: 999px; }
.hero-ctas { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 22px 0 8px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 18px; border-radius: 12px; font-weight: 650; text-decoration: none; background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(79, 70, 229, .3); transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(79, 70, 229, .38); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.stats { list-style: none; display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; padding: 0; margin: 22px 0 0; }
.stats li { display: flex; flex-direction: column; align-items: center; }
.stats strong { font-size: 1.6rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats span { font-size: .85rem; color: var(--muted); }

@media (min-width: 900px) { .tools-3 { grid-template-columns: repeat(3, 1fr); } }
.tool { position: relative; overflow: hidden; }
.tool::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); opacity: .85; }
.tool .go { display: inline-block; margin-top: 12px; font-weight: 650; font-size: .9rem; color: var(--brand); }
.tool .tag { position: absolute; top: 16px; right: 16px; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #dcfce7; color: #166534; }
@media (prefers-color-scheme: dark) { .tool .tag { background: #14532d; color: #bbf7d0; } }
.tool-etsy .ico { background: #ffedd5; color: #c2410c; }
.tool-ebay .ico { background: #dbeafe; color: #1d4ed8; }
.tool-shopify .ico { background: #dcfce7; color: #15803d; }
.tool-amazon .ico { background: #fef3c7; color: #b45309; }
.tool-paypal .ico { background: #e0f2fe; color: #0369a1; }
.tool-freelance .ico { background: #f3e8ff; color: #7e22ce; }
@media (prefers-color-scheme: dark) { .tool .ico { background: var(--brand-soft) !important; color: var(--brand) !important; } }

.results { position: relative; overflow: hidden; }
@media (min-width: 860px) { .results { position: sticky; top: 76px; } }
.results::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.big { background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 50%, var(--surface))); }

.takeaways { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 12px; padding: 14px 18px; margin: 24px 0; }
.takeaways h2 { margin: 0 0 8px; font-size: 1.05rem; }
.takeaways ul { margin: 0; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--brand-soft); border-radius: 14px; padding: 16px; margin: 28px 0; }
.cta strong { width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.content h2 { scroll-margin-top: 80px; }
