:root {
  --bg: #0e1420;
  --bg2: #141c2c;
  --card: #182132;
  --card2: #1f2a3e;
  --line: #2a3650;
  --text: #eaf0fb;
  --muted: #9fb0cc;
  --brand: #5b8cff;
  --brand2: #7aa2ff;
  --good: #37d19a;
  --warn: #ffb547;
  --radius: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: radial-gradient(1200px 700px at 50% -10%, #1a2740, var(--bg)); color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 20px 18px calc(30px + env(safe-area-inset-bottom)); }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0; }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
a { color: var(--brand2); }

.brandrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.brandrow img { width: 34px; height: 34px; }
.brandrow .name { font-weight: 800; letter-spacing: -.01em; }

.card { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; box-shadow: 0 20px 40px -24px rgba(0,0,0,.6); }
.hero { text-align: center; padding: 26px 18px; }
.hero .sub { color: var(--muted); font-size: 15px; }

.btn { display: block; width: 100%; text-align: center; background: linear-gradient(180deg, var(--brand2), var(--brand)); color: #08101f; border: 0; border-radius: 14px; padding: 15px; font-weight: 800; font-size: 16px; box-shadow: 0 10px 24px -10px rgba(91,140,255,.7); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.sm { padding: 10px 14px; width: auto; display: inline-block; font-size: 14px; }
.btnrow { display: flex; gap: 10px; margin-top: 14px; }
.btnrow > * { flex: 1; }

label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 16px 0 8px; }
input[type=number], input[type=range], select { width: 100%; }
input[type=number] { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px; font: inherit; }
input[type=range] { -webkit-appearance: none; height: 8px; border-radius: 999px; background: var(--line); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand2); border: 3px solid #0e1420; box-shadow: 0 2px 6px rgba(0,0,0,.4); }

.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { flex: 1 1 auto; text-align: center; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.chip.on { background: linear-gradient(180deg, #26406e, #1c3159); border-color: var(--brand); color: #fff; }
.chip .em { display: block; font-size: 20px; margin-bottom: 2px; }

.big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.progress { display: flex; gap: 6px; margin: 6px 0 12px; }
.progress i { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.progress i.on { background: var(--brand); }

canvas { width: 100%; height: auto; background: #0b111c; border: 1px solid var(--line); border-radius: 14px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.tip { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tip:last-child { border-bottom: 0; }
.tip .i { color: var(--brand2); }

.item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; }
.item .cat { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.item .nm { font-weight: 700; margin-top: 1px; }
.item .why { font-size: 13px; color: var(--muted); margin-top: 4px; }
.item .price { font-weight: 800; white-space: nowrap; }
.badge { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: #3a2c12; color: var(--warn); border: 1px solid #5a4420; border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.findlink { font-size: 13px; font-weight: 600; margin-top: 6px; display: inline-block; }
.totalbar { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.totalbar .big { font-size: 24px; }
.within { color: var(--good); font-weight: 700; font-size: 13px; }
.over { color: var(--warn); font-weight: 700; font-size: 13px; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 6px; }
.toolbtn { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 11px; padding: 9px 12px; font-weight: 600; font-size: 13px; }
.toolbtn:active { transform: translateY(1px); }
.toolbtn.danger { background: #2a1618; border-color: #5a2830; color: #ff9a92; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.4; }
canvas.plan { touch-action: none; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 22px 0 6px; }
.footer b { color: var(--brand2); }
.disclaim { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
