/* "Midnight & Gold" dark theme for every page: violet→indigo actions, gold for money and highlights. */
:root {
  --bg: #0b0a16;
  --card: #151327;
  --ink: #ffffff;
  --muted: #9693b0;
  --line: #262340;
  --brand: #8b5cf6;
  --brand-ink: #ffffff;
  --brand-soft: rgba(139,92,246, 0.14);
  --cyan: #fbbf24;
  --accent: #ffb648;
  --good: #34d399;
  --danger: #ff5a6e;
  --danger-soft: rgba(255, 90, 110, 0.14);
  --warn-soft: rgba(255, 182, 72, 0.13);
  --hot: linear-gradient(90deg, #8b5cf6, #6366f1);
  --radius: 18px;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--cyan); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); letter-spacing: -0.03em; font-weight: 900; }
h2 { font-weight: 850; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 520px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: rgba(11, 10, 22, 0.85); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.logo { font-weight: 850; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.logo-img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--hot); color: #fff; display: grid; place-items: center; font-size: 16px; box-shadow: -2px -2px 0 var(--cyan); }
.top nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a, .top nav button { font: inherit; font-size: 0.9rem; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 999px; background: none; border: 0; cursor: pointer; }
.top nav a.on, .top nav a:hover, .top nav button:hover { color: var(--ink); background: #221f3a; }

main { padding: 24px 0 64px; }
section { margin-bottom: 28px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }

.stat { padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 0.85rem; }

/* Buttons */
.btn {
  font: inherit; font-weight: 700; font-size: 0.95rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; min-height: 44px; border-radius: 999px; border: 1px solid transparent;
  background: var(--hot); color: #fff; cursor: pointer; text-decoration: none; text-align: center;
  transition: transform 0.12s, filter 0.12s;
}
.btn:active { transform: scale(0.97); }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.ghost { background: #221f3a; color: var(--ink); border-color: transparent; }
.btn.soft { background: #221f3a; color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 0.85rem; }
.btn.block { width: 100%; }

/* Forms */
label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 11px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 12px; background: #0e0c1c; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.check input { accent-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; min-height: 20px; height: 20px; margin-top: 2px; flex: none; }
.hint { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.prefix { position: relative; }
.prefix span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.prefix input { padding-left: 26px; }

/* Bits */
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.good { background: rgba(52, 211, 153, 0.15); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--accent); border-color: transparent; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; background: var(--warn-soft); }
.banner.good { background: rgba(52, 211, 153, 0.13); }
.banner.bad { background: var(--danger-soft); }
.code {
  font: 800 1.05rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.06em;
  background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; display: inline-block; word-break: break-all;
}
.big-code { font-size: clamp(2rem, 11vw, 3.2rem); letter-spacing: 0.18em; padding: 14px 18px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.empty { color: var(--muted); text-align: center; padding: 18px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.tabs button { font: inherit; font-weight: 600; font-size: 0.9rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: #fff; color: #000; border-color: #fff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; border-top: 0; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  background: #fff; color: #000; padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
  max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.toast.bad { background: var(--danger); color: #fff; }
.spacer { height: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.foot { border-top: 1px solid var(--line); padding: 20px 0 32px; font-size: 0.85rem; color: var(--muted); }
.foot a { color: var(--muted); margin-right: 14px; }

/* Landing */
.hero { padding: 36px 0 12px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.steps { counter-reset: s; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps .card { position: relative; padding-left: 60px; }
.steps .card::before { counter-increment: s; content: counter(s); position: absolute; left: 18px; top: 18px; width: 28px; height: 28px; border-radius: 50%; background: var(--hot); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 0.9rem; }

/* Pick card */
.pick h3 { margin: 0; }
.pick .meta { font-size: 0.85rem; color: var(--muted); }
.pick .offer { font-weight: 700; margin: 8px 0; }
.share-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
@media (min-width: 560px) { .share-row { grid-template-columns: repeat(4, 1fr); } }

.dev { background: var(--warn-soft); color: var(--accent); border-radius: 10px; padding: 12px; font-size: 0.85rem; word-break: break-all; margin-top: 12px; }
.hidden { display: none !important; }

.stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 480px) {
  .top nav a, .top nav button { font-size: 0.82rem; padding: 6px 7px; }
  .logo { font-size: 1.1rem; }
  .stats .stat { padding: 12px 10px; }
  .stats .stat b { font-size: 1.25rem; }
  .stats .stat span { font-size: 0.75rem; line-height: 1.3; display: block; }
}

.grid > .card + .card { margin-top: 0; }
@media (max-width: 400px) {
  .top .wrap { gap: 6px; }
  .top nav { gap: 0; flex-wrap: nowrap; }
  .top nav a, .top nav button { font-size: 0.78rem; padding: 6px 5px; }
  .logo-mark { width: 24px; height: 24px; font-size: 14px; }
}

/* Bottom tab bar shared by app-style pages (business dashboard). */
.tabbar-x { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(11, 10, 22, 0.94); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; backdrop-filter: blur(10px); }
.tabbar-x button { background: none; border: 0; color: var(--muted); font-family: inherit; font-weight: 600; font-size: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.tabbar-x button svg { width: 24px; height: 24px; }
.tabbar-x button.on { color: #fff; }
.has-tabbar main { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.has-tabbar .foot { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.glow { background: radial-gradient(circle at 0 0, rgba(139,92,246, 0.35), transparent 55%), radial-gradient(circle at 100% 100%, rgba(251,191,36, 0.16), transparent 55%), var(--card); }
.big-num { color: #fbbf24; font-size: clamp(2.4rem, 11vw, 3.2rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1; display: block; }

/* Back: one level up to the page this one belongs to. */
.backbar { padding-top: 10px; padding-bottom: 4px; }
.backlink { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px 0 10px; border-radius: 999px; background: #221f3a; color: var(--ink); font-weight: 700; font-size: 0.92rem; text-decoration: none; }
.backlink:hover { background: #2c2850; }
.top nav a, .top nav button { white-space: nowrap; }
/* Small phones: the icon alone is the logo, so the menu fits on one line. */
@media (max-width: 400px) { .top .logo-name { display: none; } }
