:root {
  --bg: #14110F;
  --surface: #211C19;
  --surface-2: #2A2420;
  --line: #3A322D;
  --text: #FFF8F0;
  --muted: #CFC4B8;
  --faint: #A89B8E;
  --accent: #F59A3C;
  --accent-ink: #14110F;
  --green: #0B8A4A;
  --green-soft: #0B3D26;
  --green-text: #7FE0AE;
  --danger: #F27A6B;
  --nav-h: 64px;
  --radius: 14px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}
.screen { flex: 1; min-height: 0; overflow-y: auto; }
.pad { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Bottom navigation ---------- */
.nav {
  height: var(--nav-h);
  flex-shrink: 0;
  display: flex;
  border-top: 1px solid var(--surface-2);
  background: var(--bg);
}
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--faint);
  text-decoration: none;
}
.nav a[aria-current="page"] { color: var(--accent); }

/* ---------- Common pieces ---------- */
.logo { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.h1 { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.08; margin: 0; }
.h2 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 6px 0 0; }
.kicker { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 1px; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; color: var(--faint); }

.btn {
  min-height: 48px;
  border-radius: var(--radius);
  border: none;
  padding: 0 18px;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--text); }
.btn-outline { background: none; border: 1px solid var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }

.chip {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.pill-green { background: var(--green-soft); color: var(--green-text); }
.pill-accent { background: var(--bg); color: var(--accent); }

.card-box { background: var(--surface); border-radius: var(--radius); padding: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  font-size: 16px; /* avoids zoom on iPhone */
  width: 100%;
}
textarea.input { min-height: 96px; resize: vertical; }
.error { color: var(--danger); font-size: 14px; }
.notice { background: var(--green-soft); color: var(--green-text); border-radius: 12px; padding: 12px 14px; font-size: 14px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Feed ---------- */
.feed-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding: 12px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(rgba(20,17,15,0.85), rgba(20,17,15,0));
  pointer-events: none;
}
.feed-top > * { pointer-events: auto; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }

.feed { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.clip {
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  background: #000;
  overflow: hidden;
}
.clip video { width: 100%; height: 100%; object-fit: cover; }
.clip .tap { position: absolute; inset: 0; background: none; border: none; z-index: 1; }
.sound {
  position: absolute; top: 112px; right: 12px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(20,17,15,0.6); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.actions {
  position: absolute; right: 2px; bottom: 214px; z-index: 3;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.act {
  width: 68px; background: none; border: none; color: var(--text); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 700; padding: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.act .bubble {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(20,17,15,0.6);
  display: flex; align-items: center; justify-content: center;
}
.act.liked .bubble { color: var(--accent); }
.act.liked .bubble svg { fill: currentColor; }
.act.order .bubble { background: var(--green); }
.info {
  position: absolute; left: 0; right: 0; bottom: 44px; z-index: 2;
  padding: 40px 76px 16px 16px;
  background: linear-gradient(rgba(20,17,15,0), rgba(20,17,15,0.92) 38%);
  display: flex; flex-direction: column; gap: 5px;
}
.info .name { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.1; }
.info .caption { font-size: 14px; color: var(--text); }
.info .btns { display: flex; gap: 8px; margin-top: 6px; }
.info .btns .btn { min-height: 44px; font-size: 14px; }

/* ---------- Bottom sheet (comments) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 20; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 21;
  width: 100%; max-width: 480px; height: 78dvh;
  background: var(--bg); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--surface-2);
}
.sheet-head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--surface-2); }
.sheet-body { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.sheet-foot { padding: 12px 16px 16px; border-top: 1px solid var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.comment { display: flex; flex-direction: column; gap: 3px; }
.comment .who { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.comment .body { font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.comment .meta { display: flex; gap: 12px; font-size: 12px; color: var(--faint); }
.comment .meta button { background: none; border: none; color: var(--faint); font-size: 12px; padding: 4px 0; min-height: 32px; }
.badge-biz { background: var(--accent); color: var(--accent-ink); font-size: 11px; padding: 2px 7px; border-radius: 999px; }

/* ---------- Business page ---------- */
.banner { height: 230px; position: relative; background: var(--surface-2); flex-shrink: 0; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner .shade { position: absolute; inset: 0; background: linear-gradient(rgba(20,17,15,0.1), rgba(20,17,15,0.9)); }
.banner .back { position: absolute; top: 12px; left: 12px; background: rgba(20,17,15,0.65); }
.banner .title { position: absolute; left: 16px; right: 16px; bottom: 14px; }
.menu-row { display: flex; justify-content: space-between; gap: 12px; background: var(--surface); padding: 12px 14px; border-radius: 12px; }
.menu-row strong { color: var(--accent); white-space: nowrap; }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.thumbs a { aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--surface-2); position: relative; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Votes ---------- */
.option {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--surface); color: var(--text);
}
.option.mine { border-color: var(--accent); background: #2B1C0E; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; background: #8A7A6C; transition: width 0.4s; }
.option.mine .bar > div { background: var(--accent); }

/* ---------- Business list (diaspora) ---------- */
.biz-item {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 10px;
  text-decoration: none; color: var(--text);
}
.biz-item .ph { width: 56px; height: 56px; border-radius: 10px; background: var(--surface-2); overflow: hidden; flex-shrink: 0; }
.biz-item .ph img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Reporter app ---------- */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid var(--surface-2); scrollbar-width: none; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }
.list-item { background: var(--surface); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ---------- Video controls ---------- */
.paused-ico {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1;
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(20,17,15,0.55); color: var(--text);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.paused-ico[hidden] { display: none; }
.seek {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 44px;
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: rgba(20,17,15,0.92);
}
.seek input[type=range] { flex: 1; min-width: 0; height: 44px; margin: 0; accent-color: var(--accent); background: transparent; }
.seek-btn {
  flex-shrink: 0; min-width: 44px; height: 36px; border-radius: 10px; border: none;
  background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 700;
}
.seek-time { flex-shrink: 0; font-size: 11px; color: var(--muted); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Premium touches ---------- */
.pill-new { background: var(--accent); color: var(--accent-ink); }
.act.pop .bubble { animation: pop 0.35s ease-out; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.heart-burst {
  position: absolute; z-index: 6; width: 96px; height: 96px; margin: -48px 0 0 -48px;
  color: var(--accent); pointer-events: none; animation: burst 0.85s ease-out forwards;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}
.heart-burst svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
@keyframes burst {
  0% { transform: scale(0.3) rotate(-12deg); opacity: 0; }
  25% { transform: scale(1.15) rotate(-6deg); opacity: 1; }
  60% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1.3) translateY(-60px); opacity: 0; }
}
.swipe-hint {
  position: absolute; left: 50%; bottom: 290px; transform: translateX(-50%); z-index: 8;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(20,17,15,0.75); color: var(--text); border-radius: 16px; padding: 12px 18px;
  font-weight: 700; font-size: 14px; transition: opacity 0.6s;
}
.swipe-hint.fade { opacity: 0; pointer-events: none; }
.swipe-arrow { animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(6px); } 50% { transform: translateY(-6px); } }
.end-card { background: var(--bg); }
.install-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 10px); z-index: 25;
  width: calc(100% - 24px); max-width: 456px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 10px 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
}
.nav a { font-size: 11px; }
@media (prefers-reduced-motion: reduce) {
  .heart-burst, .act.pop .bubble, .swipe-arrow, .spinner { animation: none; }
}

/* ---------- Stats tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-n { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; }
.stat-l { font-size: 13px; color: var(--muted); }
.trend { font-size: 11px; font-weight: 700; color: var(--faint); }
.trend.up { color: var(--green-text); }
.trend.down { color: #FFB3A8; }
