/* Customer dashboard (/dashboard/). Same brand tokens as styles.css, own layout. */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #0f1b33;
  --muted: #5b6780;
  --faint: #8a94a8;
  --line: #e3e8f1;
  --line-strong: #c9d2e3;
  --accent: #2557f6;
  --accent-dark: #1a43cc;
  --accent-soft: #eaf0ff;
  --ocean: #02c8e6;
  --ocean-deep: #0192eb;
  --ok: #12a150;
  --ok-soft: #e7f7ee;
  --warn: #b86e00;
  --warn-bar: #f29d0b;
  --warn-soft: #fff4e0;
  --bad: #d23b3b;
  --bad-soft: #fdecec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,27,51,.04), 0 8px 24px -14px rgba(15,27,51,.18);
  --side: 252px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .tab { font-variant-numeric: tabular-nums; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.logo { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; padding: 4px 10px 18px; }
.logo b { color: var(--accent); font-weight: 700; }
.logo img { margin-right: 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text);
  text-decoration: none; font-weight: 550; transition: background .12s;
}
.nav a .i { color: var(--muted); }
.nav a:hover { background: var(--bg); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav a[aria-current="page"] .i { color: var(--accent); }
.nav a .tag { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: #fff; }
.nav a .ext { margin-left: auto; width: 15px; height: 15px; color: var(--faint); }
.side-card {
  margin-top: auto; border-radius: var(--radius); padding: 16px; color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, rgba(2,227,226,.55), transparent 60%), var(--accent);
}
.side-card p { margin: 0 0 4px; font-weight: 700; }
.side-card small { display: block; opacity: .85; font-size: 13px; margin-bottom: 12px; line-height: 1.4; }
.side-card .btn { width: 100%; background: #fff; color: var(--accent); border-color: #fff; box-shadow: none; }
.side-card .btn:hover { background: #f1f5ff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; height: 66px; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top .burger { display: none; }
.top .logo { display: none; padding: 0; font-size: 18px; }
.demo { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--warn); background: var(--warn-soft); padding: 4px 10px; border-radius: 99px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.bal { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.bal .i { color: var(--muted); }
.bal span { display: flex; flex-direction: column; line-height: 1.15; }
.bal small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bal b { font-size: 17px; letter-spacing: -0.01em; }
.acct { position: relative; }
.acct summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.acct summary::-webkit-details-marker { display: none; }
.acct summary:hover { background: var(--bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--ocean-deep)); font-size: 14px; }
.acct-mail { font-weight: 600; font-size: 14px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.acct-menu p { margin: 0; padding: 8px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.acct-menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 550; }
.acct-menu a:hover { background: var(--bg); }

.content { width: 100%; max-width: 1200px; margin: 0 auto; padding: 30px 28px 64px; }
.scrim { display: none; }

/* ---------- Buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: #fff; font-weight: 650;
  padding: 11px 18px; border-radius: 11px; text-decoration: none; border: 1.5px solid var(--accent); cursor: pointer; white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(37,87,246,.7); transition: background .12s, border-color .12s, transform .12s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--bg); border-color: var(--line-strong); }
.btn-line { background: var(--surface); color: var(--accent); border-color: var(--accent); box-shadow: none; }
.btn-line:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 9px; }
.btn-lg { padding: 14px 22px; font-size: 16px; width: 100%; }
.btn .i { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); background: var(--bg); }
.icon-btn .i { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 650; }
.field > span small { font-weight: 500; color: var(--faint); margin-left: 4px; }
.input, .select {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6780' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15,27,51,.08), 0 0 0 1px var(--line); }
.seg .off { color: var(--ok); font-size: 12px; font-weight: 700; margin-left: 4px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.chip .i { width: 12px; height: 12px; stroke-width: 2.6; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--accent-soft); color: var(--accent); }
.chip.mute { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Page pieces ---------- */
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.page-ic .i { width: 24px; height: 24px; }
.page-head h1 { font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 750; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-h { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h2 { font-size: 13px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); }
.card-h a { font-weight: 650; font-size: 14px; text-decoration: none; }
.card-h a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }

.alert { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: 12px; margin-bottom: 18px; background: var(--warn-soft); border: 1px solid #f6d9a6; }
.alert > .i { color: var(--warn); width: 20px; height: 20px; }
.alert p { margin: 0; flex: 1 1 260px; }
.alert b { font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.kpi small { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; font-size: 13px; }
.kpi small .i { width: 15px; height: 15px; }
.kpi b { display: block; font-size: 28px; font-weight: 750; letter-spacing: -0.02em; margin: 6px 0 2px; }
.kpi b span { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi p { margin: 0; font-size: 13px; color: var(--muted); }

.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.sec-h h2 { font-size: 18px; font-weight: 700; }
.sec-h a { font-weight: 650; font-size: 14px; text-decoration: none; }

/* Product cards */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 26px; }
.pcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--ocean)); }
.pcard.low::before { background: var(--warn-bar); }
.pcard-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ptype { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.pcard-top h3 { font-size: 16px; font-weight: 700; }
.pcard-top p { margin: 0; font-size: 13px; color: var(--muted); }
.pcard-top .chip { margin-left: auto; }
.pcard-num { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pcard-num b { font-size: 30px; font-weight: 750; letter-spacing: -0.02em; line-height: 1; }
.pcard-num span { color: var(--muted); font-weight: 600; }
.meter { height: 8px; border-radius: 99px; background: #edf1f7; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--ocean)); }
.low .meter i, .meter.low i { background: var(--warn-bar); }
.pcard-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); margin: 12px 0 18px; }
.pcard-meta .i { width: 14px; height: 14px; }
.pcard-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.pcard.add { border: 1.5px dashed var(--line-strong); box-shadow: none; background: transparent; align-items: center; justify-content: center; text-align: center; text-decoration: none; color: var(--muted); min-height: 220px; transition: border-color .12s, background .12s; }
.pcard.add::before { display: none; }
.pcard.add:hover { border-color: var(--accent); background: var(--surface); color: var(--accent); }
.pcard.add .ptype { margin-bottom: 12px; width: 48px; height: 48px; border-radius: 50%; }
.pcard.add b { color: var(--text); font-size: 16px; }

.cols { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; align-items: start; }
.cols > .card + .card { margin-top: 0; }

/* Chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: #edf1f7; }
.chart .grid text, .chart .xl text { fill: var(--faint); font-size: 11px; }
.chart .bar { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.on { fill: var(--accent-dark); }
.tip { position: absolute; pointer-events: none; background: var(--text); color: #fff; font-size: 12.5px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); opacity: 0; transition: opacity .1s; }
.tip b { display: block; font-size: 14px; }
.tip.on { opacity: 1; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .ptype { width: 34px; height: 34px; border-radius: 9px; }
.mini-list .ptype .i { width: 16px; height: 16px; }
.mini-list div { flex: 1; min-width: 0; }
.mini-list b { display: block; font-size: 14px; font-weight: 650; }
.mini-list small { color: var(--muted); font-size: 12.5px; }
.mini-list .amt { font-weight: 700; font-size: 14px; }

/* ---------- Generator ---------- */
.gen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
.gen .card + .card { margin-top: 0; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pick button, .opt {
  text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 11px; padding: 11px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; transition: border-color .12s, background .12s;
}
.pick button:hover, .opt:hover { border-color: var(--line-strong); }
.pick button[aria-pressed="true"], .opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.pick b { font-size: 14px; font-weight: 700; }
.pick small { font-size: 12.5px; color: var(--muted); }
.pick small.lowtxt { color: var(--warn); font-weight: 650; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.step { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.step:first-of-type { padding-top: 0; margin-top: 0; border-top: 0; }
.step-t { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 12px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 750; flex: none; }
.qty-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qty-row .input { width: 110px; }
.qty-row .btn-ghost[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; display: flex; gap: 7px; align-items: flex-start; }
.hint .i { width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }

.out { position: sticky; top: 86px; }
.creds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.cred { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 8px 8px 12px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.cred div { flex: 1; min-width: 0; }
.cred small { display: block; font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cred code { display: block; font: 600 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred .icon-btn { width: 30px; height: 30px; }
.cred-btns { display: flex; gap: 4px; }
.list-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.list-h b { font-size: 14px; }
.list-h div { display: flex; gap: 8px; }
textarea.list {
  width: 100%; height: 280px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 11px; padding: 12px 14px;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #0f1b33; color: #d8e3ff; white-space: pre; overflow-wrap: normal; overflow-x: auto;
}
.curl { margin-top: 14px; display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 12px; }
.curl .i { color: var(--muted); }
.curl code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.datafoot { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.datafoot.low { background: var(--warn-soft); }
.datafoot div { flex: 1 1 180px; }
.datafoot small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.datafoot b { font-size: 18px; }
.datafoot .meter { margin-top: 6px; background: rgba(255,255,255,.8); }
.empty { text-align: center; padding: 40px 20px; }
.empty .page-ic { margin: 0 auto 14px; }
.empty h2 { font-size: 20px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 0 18px; }
.iplist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.iplist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.iplist li:last-child { border-bottom: 0; }
.iplist code { flex: 1; font: 13.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iplist .flag { font-size: 12.5px; color: var(--muted); }

/* ---------- Buy ---------- */
.buy { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.buy .card + .card { margin-top: 18px; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.opt { padding: 14px; gap: 4px; position: relative; }
.opt b { font-size: 15px; font-weight: 700; }
.opt span.note { font-size: 13px; color: var(--muted); line-height: 1.4; }
.opt span.price { font-size: 13.5px; margin-top: 6px; color: var(--muted); }
.opt span.price strong { color: var(--text); font-size: 15px; }
.opt .chip { align-self: flex-start; margin-top: 6px; }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; }
.size { border: 1.5px solid var(--line); background: var(--surface); border-radius: 11px; padding: 12px 10px; cursor: pointer; text-align: center; display: flex; flex-direction: column; gap: 1px; position: relative; transition: border-color .12s; }
.size:hover { border-color: var(--line-strong); }
.size[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.size b { font-size: 16px; font-weight: 750; }
.size span { font-size: 14px; font-weight: 600; }
.size small { font-size: 12px; color: var(--muted); }
.size .flag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 10.5px; font-weight: 750; padding: 1px 7px; border-radius: 99px; background: var(--ok); color: #fff; white-space: nowrap; }
.size .flag.c { background: var(--text); }
.pays { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pays .opt { flex-direction: row; align-items: center; gap: 12px; }
.pays .opt .i { width: 22px; height: 22px; color: var(--accent); }
.pays .opt div { display: flex; flex-direction: column; }
.pays .opt small { color: var(--muted); font-size: 12.5px; }
.pays .opt .chip { margin: 0 0 0 auto; align-self: center; }
.tiers { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.tiers td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tiers td:last-child { text-align: right; font-weight: 650; }
.tiers tr.on td { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 11px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--bg); cursor: pointer; font-size: 20px; color: var(--muted); }
.stepper button:hover { color: var(--text); }
.stepper input { width: 84px; height: 44px; border: 0; text-align: center; font-weight: 700; font-size: 16px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.stepper input:focus { outline: none; background: var(--accent-soft); }

.sum { position: sticky; top: 86px; }
.sum .card { padding: 0; overflow: hidden; }
.sum-top { padding: 20px 22px; background: radial-gradient(90% 130% at 100% 0%, rgba(2,227,226,.35), transparent 60%), var(--accent); color: #fff; }
.sum-top small { opacity: .85; font-weight: 600; font-size: 13px; }
.sum-top h3 { font-size: 20px; margin: 2px 0 0; }
.sum-body { padding: 18px 22px 22px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 14.5px; }
.sum-row span { color: var(--muted); }
.sum-row b { font-weight: 650; text-align: right; }
.sum-row.disc b { color: var(--ok); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin: 10px 0 16px; padding-top: 14px; }
.sum-total span { font-weight: 650; }
.sum-total b { font-size: 30px; font-weight: 780; letter-spacing: -0.02em; }
.sum-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.sum-note .i { width: 15px; height: 15px; margin-top: 2px; color: var(--ok); }
.buybar { display: none; }
.topup { display: flex; align-items: center; gap: 12px; }
.topup div { flex: 1; }
.topup b { font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.topup p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.switch { width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; flex: none; border: 0; cursor: not-allowed; opacity: .7; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); }

/* ---------- Tables ---------- */
.table { overflow-x: auto; margin: 0 -24px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 24px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 14px 24px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.r, table.t th.r { text-align: right; }
table.t .pname { display: flex; align-items: center; gap: 10px; font-weight: 650; }
table.t .pname .ptype { width: 30px; height: 30px; border-radius: 8px; }
table.t .pname .ptype .i { width: 15px; height: 15px; }
table.t code { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }

/* ---------- Settings ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.set-grid .card + .card { margin-top: 0; }
.add-row { display: flex; gap: 8px; }
.add-row .input { flex: 1; }
.ips { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.ips li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 14px; }
.ips code { flex: 1; font: 600 14px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ips li.none { color: var(--muted); font-size: 14px; justify-content: center; padding: 14px; border-style: dashed; }
.pw-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pw-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pw-row:first-child { padding-top: 0; }
.pw-row div { flex: 1; min-width: 0; }
.pw-row b { display: block; font-size: 14.5px; }
.pw-row code { font: 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14.5px; margin: 0 0 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: #fff; padding: 11px 16px; border-radius: 11px; font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 50; box-shadow: 0 12px 30px -10px rgba(15,27,51,.5); max-width: calc(100vw - 32px); }
.toast .i { color: #6ee7a8; width: 17px; height: 17px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols, .gen, .buy { grid-template-columns: minmax(0, 1fr); }
  .out, .sum { position: static; }
  .buybar {
    display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(15,27,51,.2);
  }
  .buybar div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .buybar small { color: var(--muted); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .buybar b { font-size: 20px; font-weight: 780; }
  .buy { padding-bottom: 70px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: min(var(--side), 84vw); transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(15,27,51,.2); }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(15,27,51,.35); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .top { padding: 0 16px; gap: 10px; }
  .top .burger { display: inline-grid; }
  .top .logo { display: inline-flex; }
  .top .demo { display: none; }
  .acct-mail { display: none; }
  .set-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .content { padding: 20px 16px 48px; }
  .bal { padding: 4px 4px 4px 10px; gap: 8px; }
  .bal > .i, .bal small { display: none; }
  .bal b { font-size: 15px; }
  .bal .btn .lbl { display: none; }
  .page-head { margin-bottom: 18px; gap: 12px; }
  .page-head > .page-ic { display: none; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .kpi { padding: 14px 16px; }
  .kpi b { font-size: 22px; }
  .card { padding: 18px 16px; }
  .table { margin: 0 -16px; }
  table.t th, table.t td { padding-left: 16px; padding-right: 16px; }
  .form-grid, .creds, .pays { grid-template-columns: 1fr; }
  .pick { grid-template-columns: 1fr 1fr; }
  .opts { grid-template-columns: 1fr 1fr; gap: 8px; }
  .opt { padding: 11px 12px; }
  .opt b { font-size: 14px; }
  .opts .opt span.note { display: none; }
  .opt span.price { margin-top: 2px; font-size: 12.5px; }
  .opt span.price strong { font-size: 14px; }
  .sizes { grid-template-columns: repeat(3, 1fr); }
  .size { padding: 11px 4px; }
  .size b { font-size: 15px; }
}
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
  .sizes { grid-template-columns: repeat(2, 1fr); }
}

/* Hidden until static/auth.js has confirmed the signed-in user */
.auth-wait .app { visibility: hidden; }

/* Live data states */
.loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 20px; color: var(--muted); text-align: center; }
.loading > .i { width: 28px; height: 28px; }
.loading p { margin: 0; }
.spin { animation: px-spin 1s linear infinite; }
@keyframes px-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.alert.info { background: var(--accent-soft); border-color: transparent; }
.alert.info > .i { color: var(--accent); }
.empty .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.steps-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.steps-list b { font-weight: 650; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

/* Tabs on the Residential / Mobile / ISP pages */
.tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; width: max-content; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 9px; color: var(--muted); font-weight: 650; font-size: 15px; text-decoration: none; white-space: nowrap; }
.tabs a .i { width: 17px; height: 17px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 520px) { .tabs { width: 100%; } .tabs a { flex: 1; justify-content: center; padding: 9px 10px; } }
