:root {
  --bg: #f3f1ec;
  --card: #ffffff;
  --ink: #1c1f24;
  --muted: #6b6f76;
  --line: #e2ded6;
  --accent: #f2a900;
  --accent-ink: #1c1f24;
  --ok: #2e7d4f;
  --bad: #b3261e;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: #d9d5cc; color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#frame { max-width: 480px; min-height: 100vh; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; position: relative; }
#top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--ink); color: #fff; }
#brand { font-weight: 800; font-size: 19px; display: flex; align-items: center; gap: 8px; flex: 1; }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; }
#trial-pill { font-size: 12px; background: #2d3139; padding: 4px 10px; border-radius: 99px; }
.icon { background: none; border: 0; color: #fff; font-size: 24px; padding: 0 6px; cursor: pointer; }
main { flex: 1; padding: 16px 16px 96px; }
#tabs { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
#tabs button { background: none; border: 0; padding: 14px 4px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
#tabs button.on { color: var(--ink); box-shadow: inset 0 3px 0 var(--accent); }
h1 { font-size: 24px; margin: 4px 0 6px; }
h2 { font-size: 18px; margin: 20px 0 8px; }
p.sub { color: var(--muted); margin: 0 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
label:first-child { margin-top: 0; }
input, select { width: 100%; font: inherit; font-size: 17px; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.row > .fit { flex: 0 0 auto; }
.btn { display: block; width: 100%; padding: 15px; border: 0; border-radius: 12px; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; background: var(--accent); color: var(--accent-ink); margin-top: 16px; }
.btn.ghost { background: transparent; border: 1.5px solid var(--ink); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.small { display: inline-block; width: auto; padding: 8px 14px; font-size: 15px; margin: 0; }
.x { flex: 0 0 44px; height: 48px; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; font-size: 20px; cursor: pointer; color: var(--bad); }
.add { background: none; border: 1.5px dashed var(--muted); border-radius: 10px; padding: 12px; width: 100%; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; margin-top: 8px; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); }
.trades { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade { border: 2px solid var(--line); background: #fff; border-radius: var(--radius); padding: 18px 12px; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.trade small { display: block; font-weight: 500; color: var(--muted); margin-top: 4px; }
.trade.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 169, 0, .25); }
.trade[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: flex; background: #e8e4dc; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px 6px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 0; font-weight: 600; font-size: 15px; }
.toggle input { width: 26px; height: 26px; flex: 0 0 26px; accent-color: var(--accent); }
.result { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 16px; position: sticky; bottom: 58px; margin-top: 14px; }
.result .total { font-size: 30px; font-weight: 800; }
.result .meta { display: flex; gap: 14px; flex-wrap: wrap; color: #c9ccd2; font-size: 14px; margin-top: 4px; }
.result .min { color: var(--accent); font-size: 13px; margin-top: 4px; }
.lines { width: 100%; border-collapse: collapse; font-size: 15px; }
.lines td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lines td:last-child { text-align: right; white-space: nowrap; }
.lines tr.sum td { font-weight: 800; font-size: 18px; border-bottom: 0; padding-top: 12px; }
.bidhead { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 12px; }
.bidhead img, .logo-empty { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #eee; display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.bidhead b { font-size: 18px; display: block; }
.load li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.load { padding-left: 20px; margin: 0; }
.listitem { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; }
.listitem small { color: var(--muted); display: block; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.plans { display: grid; gap: 10px; }
.plan { border: 2px solid var(--line); background: #fff; border-radius: var(--radius); padding: 16px; cursor: pointer; text-align: left; font: inherit; }
.plan.on { border-color: var(--accent); }
.plan b { font-size: 22px; }
.badge { display: inline-block; background: var(--ok); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }
.logo-up { display: flex; align-items: center; gap: 12px; }
.logo-up img, .logo-up .logo-empty { width: 64px; height: 64px; }
.demo-bar { background: #fff6dc; border: 1px solid #f0d78c; color: #6a5200; font-size: 13px; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; z-index: 20; max-width: 90vw; }
@media print {
  body, #frame { background: #fff; }
  #top, #tabs, .noprint, .demo-bar { display: none !important; }
  main { padding: 0; }
  .card { border: 0; }
}
