@font-face {
  font-family: "Oswald";
  src: url("../fonts/Oswald-Variable.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #070708;
  --bg-2: #0d0e10;
  --card: #141518;
  --elev: #1c1e23;
  --line: #2a2d33;
  --line-2: #3a3e46;
  --text: #f4f5f6;
  --muted: #9aa0a8;
  --steel: #b7bec6;
  --steel-2: #d7dce2;
  --copper: #d4894a;
  --copper-2: #e8a56a;
  --copper-dim: rgba(212, 137, 74, 0.16);
  --ok: #7da87a;
  --ok-dim: rgba(125, 168, 122, 0.16);
  --danger: #c45c4a;
  --danger-dim: rgba(196, 92, 74, 0.16);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --nav-h: 64px;
  --font-d: "Oswald", Impact, sans-serif;
  --font-b: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font-b); min-height: 100%; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; display: block; }
a { color: var(--copper-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 400px at 50% -80px, rgba(180, 190, 200, 0.08), transparent 60%),
    var(--bg);
  padding-bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 7, 8, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 10px;
}
.topbar-row { display: flex; align-items: center; gap: 10px; }
.topbar img.wordmark { height: 34px; width: auto; margin: 0 auto; }
.icon-btn {
  width: 44px; height: 44px; border: 1px solid var(--line);
  background: var(--card); border-radius: 10px; color: var(--steel);
  display: grid; place-items: center; flex: 0 0 auto;
}
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.banner {
  background: var(--elev);
  color: var(--steel);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}
.banner strong { color: var(--copper-2); font-weight: 600; }

.page { padding: 16px; display: none; animation: fade .25s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.kicker {
  font-family: var(--font-d);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 4px;
}
h1, h2, .display {
  font-family: var(--font-d);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.1;
}
h1 { font-size: 28px; margin-bottom: 8px; }
h2 { font-size: 22px; margin: 22px 0 10px; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.45; margin-bottom: 14px; }
.example-flag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper-2);
  background: var(--copper-dim);
  border: 1px solid rgba(212, 137, 74, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

.hero-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
  margin: 12px 0 16px;
  box-shadow: var(--shadow);
}
.hero-card img { width: 100%; height: 220px; object-fit: cover; filter: saturate(0.9); }
.hero-card .shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 20%, rgba(0,0,0,0.82) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px;
}
.hero-card h3 { font-family: var(--font-d); text-transform: uppercase; font-size: 22px; letter-spacing: 0.04em; }

.toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 8px 0 16px;
}
.toggle button {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 8px 10px; font-size: 13px; font-weight: 600;
}
.toggle button.on { background: var(--elev); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.actions.triple { grid-template-columns: 1fr 1fr 1fr; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}
.card.media { padding: 0; overflow: hidden; }
.card.media img { width: 100%; height: 150px; object-fit: cover; }
.card.media .body { padding: 12px 14px 14px; }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.card p, .card .body p { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.price {
  font-family: var(--font-d);
  font-size: 32px;
  letter-spacing: 0.02em;
  color: var(--steel-2);
}
.price span { font-size: 14px; color: var(--muted); letter-spacing: 0.06em; }

.btn, .btn-ghost, .btn-steel {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border-radius: 12px; padding: 12px 14px;
  font-weight: 650; font-size: 14px; border: 1px solid transparent;
}
.btn { background: var(--copper); color: #1a1008; border-color: #e0a36a; }
.btn:active { transform: translateY(1px); }
.btn-steel { background: var(--elev); color: var(--text); border-color: var(--line-2); }
.btn-ghost { background: transparent; color: var(--steel-2); border-color: var(--line-2); }
.btn.small, .btn-steel.small, .btn-ghost.small { padding: 8px 10px; font-size: 13px; width: auto; }
.btn[disabled], .btn-steel[disabled] { opacity: 0.55; cursor: default; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--line-2); color: var(--steel); border-radius: 999px; padding: 4px 8px;
  background: var(--bg-2);
}
.chip.on { background: var(--copper-dim); color: var(--copper-2); border-color: rgba(212,137,74,.45); }
.chip-btn { cursor: pointer; }

.list-card { display: flex; gap: 12px; align-items: center; }
.list-card img, .thumb {
  width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: #000; flex: 0 0 auto;
}
.list-card h3 { font-family: var(--font-b); text-transform: none; letter-spacing: 0; font-weight: 650; }
.muted { color: var(--muted); font-size: 13px; }
.tiny { font-size: 11px; color: var(--muted); }

.hours-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.hours-row:last-child { border-bottom: 0; }

form .field { margin-bottom: 10px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--copper); }
textarea { min-height: 90px; resize: vertical; }
.thanks {
  background: var(--ok-dim); border: 1px solid rgba(125,168,122,.35);
  color: #d8edd6; padding: 12px; border-radius: 12px; font-size: 14px; line-height: 1.4;
}

.coupon-card {
  text-align: center; padding: 18px 16px;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.02) 0 8px, transparent 8px 16px),
    var(--card);
}
.coupon-card .code {
  font-family: var(--font-d); font-size: 28px; letter-spacing: 0.14em;
  margin: 8px 0; color: var(--steel-2);
}
.qr-wrap {
  width: 210px; height: 210px; margin: 12px auto; background: #fff; border-radius: 16px;
  display: grid; place-items: center; padding: 12px;
}
.qr-wrap img, .qr-wrap canvas { width: 100%; height: 100%; object-fit: contain; }
.redeemed { background: var(--danger-dim); border-color: rgba(196,92,74,.4); }
.stamp {
  font-family: var(--font-d); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--danger); font-size: 28px; transform: rotate(-12deg);
  border: 3px solid var(--danger); display: inline-block; padding: 4px 10px; margin: 8px 0;
}

.ex-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.ex-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ex-table td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ex-table tr.done td { opacity: 0.45; text-decoration: line-through; }
.check {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--bg); display: inline-grid; place-items: center;
}
.check.on { background: var(--copper); border-color: var(--copper); color: #1a1008; }

.leader li {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.leader li:first-child { color: var(--copper-2); font-weight: 650; }
.progress {
  height: 8px; background: var(--elev); border-radius: 99px; overflow: hidden; margin: 8px 0 4px;
}
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--copper), var(--copper-2)); }

.install {
  border: 1px dashed var(--line-2);
  background: var(--bg-2);
  padding: 12px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 14px;
}
.install strong { color: var(--text); }

.nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(480px, 100%);
  background: rgba(10, 10, 12, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
}
.nav button {
  border: 0; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 0;
}
.nav button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.nav button.on { color: var(--copper-2); }

.video-frame { margin: 10px 0; border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; background: #000; }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; }

.footer-note { text-align: center; color: var(--muted); font-size: 11px; margin: 22px 0 8px; line-height: 1.4; }
.hidden { display: none !important; }
.mt { margin-top: 10px; }

.table-wrap { overflow-x: auto; margin-top: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { color: var(--muted); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.admin-table .actions-inline { display: flex; flex-wrap: wrap; gap: 4px; }
.status-pill {
  display: inline-block; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: 999px; padding: 2px 8px; border: 1px solid var(--line-2);
}
.status-started_checkout { color: var(--steel-2); }
.status-confirmed_paid { color: var(--copper-2); background: var(--copper-dim); border-color: rgba(212,137,74,.4); }
.status-paid_out { color: #d8edd6; background: var(--ok-dim); border-color: rgba(125,168,122,.35); }
.status-rejected { color: #f0c4be; background: var(--danger-dim); border-color: rgba(196,92,74,.4); }
.tabs { display: flex; gap: 6px; margin: 12px 0; }
.tabs button { width: auto; }
.admin-shell { max-width: 980px; margin: 0 auto; padding: 16px 16px 80px; }
@media (min-width: 800px) {
  .admin-shell { padding-left: 24px; padding-right: 24px; }
}

.refer-hero {
  position: relative; overflow: hidden; padding: 20px 18px 18px; margin: 14px 0;
  border: 2px solid #b9d7a4; border-radius: 16px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.05) 0 2px, transparent 2px 9px),
    linear-gradient(135deg, #2f5a34 0%, #3f7a45 45%, #27492c 100%);
  box-shadow: inset 0 0 0 6px rgba(15,35,18,.35), 0 8px 24px rgba(60,140,70,.25);
}
.refer-hero > * { position: relative; z-index: 1; }
.refer-hero .kicker { color: #d9f0c6; }
.refer-hero .refer-amt { font-family: var(--font-d); text-transform: uppercase; font-size: 38px; color: #9dff7a; text-shadow: 0 2px 0 #12301a, 0 0 18px rgba(157,255,122,.45); margin: 4px 0 6px; }
.refer-hero p { color: #eaf5e2; }
.refer-hero .btn { width: 100%; background: #9dff7a; color: #0f2a14; border-color: #c8ffb0; font-weight: 700; }


.my-log-card {
  border-color: rgba(212, 137, 74, 0.45);
  background:
    linear-gradient(180deg, var(--copper-dim), var(--card) 64%);
}
.my-log-card .kicker { margin-bottom: 2px; }
.my-log-card h3 {
  font-family: var(--font-d);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 22px;
  margin-bottom: 6px;
}
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border-radius: 12px; padding: 12px 14px;
  font-weight: 650; font-size: 14px;
  background: var(--danger-dim); color: #f0c4be;
  border: 1px solid rgba(196, 92, 74, 0.45);
}
.btn-danger:active { transform: translateY(1px); }
.ex-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.ex-row textarea { min-height: 64px; }
.ex-row h3 {
  font-family: var(--font-b);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
  font-size: 14px;
}
.ex-row .ex-head { align-items: center; margin-bottom: 8px; }
.ex-row .ex-head .btn-ghost { width: auto; padding: 8px 10px; flex: 0 0 auto; }
#my-workout-error:empty { display: none; }
#my-workout-error {
  background: var(--danger-dim);
  border: 1px solid rgba(196, 92, 74, 0.4);
  color: #f0c4be;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 10px;
}

.ex-log-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ex-log-top .check { flex: 0 0 auto; margin-top: 2px; width: 28px; height: 28px; }
.ex-log h3 {
  font-family: var(--font-b);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
  font-size: 15px;
  margin-bottom: 2px;
}
.ex-log.is-done h3 { opacity: 0.5; text-decoration: line-through; }
.last-weight { color: var(--copper-2); }
.set-weights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}
.set-weights .field { margin-bottom: 0; }
#gym-weight-status:empty { display: none; }
#gym-weight-status { color: var(--ok); }

.video-card { margin: 14px 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.video-card video { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 70vh; object-fit: cover; }
