:root {
  --bg: #080808;
  --card: #111111;
  --card2: #161616;
  --line: #232323;
  --accent: #FF6A00;
  --accent-dim: #b34a00;
  --text: #F5F5F5;
  --muted: #8A8A8A;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: 84px;
}
button { font-family: inherit; cursor: pointer; }

/* Topbar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card2); border: 1px solid var(--line);
  color: var(--accent); font-weight: 800;
}
.brand-name { font-weight: 700; }
.brand-sub { color: var(--muted); font-size: 12px; }
.balance-pill {
  background: var(--card2); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; font-weight: 700;
}

/* Layout */
main { padding: 16px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.section-title {
  color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: .08em; margin: 18px 2px 10px;
}
.loader, .empty {
  color: var(--muted); text-align: center; padding: 40px 0;
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.card-title { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { font-size: 20px; display: block; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* Buttons */
.btn {
  display: block; width: 100%; border: none; border-radius: 12px;
  padding: 14px; font-size: 15px; font-weight: 700; margin-top: 10px;
  background: var(--accent); color: #000; transition: opacity .15s;
}
.btn:active { opacity: .8; }
.btn.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.disabled { background: var(--card2); color: var(--muted); border: 1px dashed var(--line); }

/* Products */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.product img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--card2); display: block; }
.product .p-body { padding: 10px 12px 12px; }
.product .p-name { font-weight: 600; font-size: 14px; }
.product .p-meta { color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.product .p-price { color: var(--accent); font-weight: 800; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.chip {
  flex: 0 0 auto; background: var(--card2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 13px;
}
.chip.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

.search {
  width: 100%; background: var(--card2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 15px; margin-bottom: 10px;
}

/* Qty */
.qty { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 12px 0; }
.qty button {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font-size: 20px;
}
.qty b { font-size: 18px; min-width: 60px; text-align: center; }

/* License */
.key-box {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin: 8px 0;
  font-family: Consolas, monospace; font-size: 13px; word-break: break-all;
}
.key-box button { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 12px; }
.badge-status { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.badge-status.on { background: rgba(46,160,67,.15); color: #4caf50; }
.badge-status.off { background: rgba(244,67,54,.12); color: #f44336; }

/* Bottom nav */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: #0c0c0c; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav button {
  flex: 1; background: none; border: none; color: var(--muted);
  padding: 8px 0 10px; font-size: 18px; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottomnav button span { font-size: 11px; }
.bottomnav button.active { color: var(--accent); }
.badge {
  position: absolute; top: 2px; right: 22%; background: var(--accent); color: #000;
  font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 6px;
}

/* Toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: 86%;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); font-size: 14px;
}
.toast.err { border-color: #f44336; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tx { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.tx:last-child { border-bottom: none; }
.tx .plus { color: #4caf50; font-weight: 700; }
.tx .minus { color: #f44336; font-weight: 700; }
.hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 12px; }
