/* Recharge 2027 app styles. Design tokens up top; everything reads from them. */
:root {
  --purple: #4a2d73;
  --purple-2: #602A83;
  --green: #B2D235;
  --ink: #1a1523;
  --bg: #ffffff;
  --bg-soft: #f6f4fa;
  --line: #e4e0ec;
  --muted: #6b6478;
  --card-shadow: 0 1px 3px rgba(26, 21, 35, 0.08);
  --radius: 14px;
  --tap: 44px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Avenir Next Rounded", "Nunito", "Varela Round", var(--font-body);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #efeaf7;
    --bg: #17121f;
    --bg-soft: #221b2e;
    --line: #372e47;
    --muted: #a79fb5;
    --card-shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h2.display { font-size: 1.7rem; margin: 0 0 12px; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px calc(10px);
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--purple); color: #fff;
}
.header-title {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-display); font-size: 1.15rem; min-height: var(--tap);
}
.header-title strong { color: var(--green); }
.battery-mark {
  display: inline-block; width: 26px; height: 14px;
  border: 2px solid #fff; border-radius: 4px; position: relative;
}
.battery-mark::after {
  content: ""; position: absolute; right: -5px; top: 3px;
  width: 3px; height: 6px; background: #fff; border-radius: 1px;
}
.battery-mark-fill {
  position: absolute; inset: 2px; width: 60%;
  background: var(--green); border-radius: 2px;
}
.bell-btn {
  position: relative; background: none; border: 0; cursor: pointer;
  min-width: var(--tap); min-height: var(--tap); color: #fff;
}
.badge {
  position: absolute; top: 4px; right: 2px;
  min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--green); color: var(--ink);
  border-radius: 9px; font-size: 12px; font-weight: 700; line-height: 18px;
}

/* Happening now bar */
.now-bar { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 19; padding: 0; }
.now-bar-inner {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; cursor: pointer; min-height: var(--tap);
  padding: 8px 16px; background: var(--purple-2); color: #fff; text-align: left;
}
.now-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--green); white-space: nowrap;
}
.now-title { font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: pulse 2s ease-in-out infinite; flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Sections */
.section { padding: 20px 16px; max-width: 640px; margin: 0 auto; }
.section-intro { color: var(--muted); margin-top: 0; }
.card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
  box-shadow: var(--card-shadow);
}
.card h3 { margin: 0 0 6px; font-family: var(--font-display); }

/* Welcome */
.welcome { text-align: center; padding-top: 24px; }
.welcome h1 { font-size: 2.4rem; margin: 0 0 4px; }
.accent { color: var(--purple-2); }
@media (prefers-color-scheme: dark) { .accent { color: var(--green); } }
.welcome-meta { color: var(--muted); margin: 0 0 4px; }
.welcome-line { margin: 0 0 24px; }
.btn {
  display: inline-block; border: 0; border-radius: 999px; cursor: pointer;
  min-height: var(--tap); padding: 10px 26px; font-weight: 700; margin: 4px;
}
.btn-primary { background: var(--purple-2); color: #fff; }
.btn-ghost { background: none; border: 2px solid var(--purple-2); color: var(--purple-2); }
@media (prefers-color-scheme: dark) {
  .btn-ghost { border-color: var(--green); color: var(--green); }
}
.flywheel-banner {
  background: var(--purple); color: #fff; border-radius: var(--radius);
  padding: 16px; margin: 0 0 20px; text-align: left;
}
.flywheel-banner h3 { margin: 0 0 4px; color: var(--green); font-family: var(--font-display); }
.flywheel-banner a { color: var(--green); font-weight: 700; }

/* Schedule timeline */
.timeline-item {
  display: flex; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-item.past { opacity: 0.45; }
.timeline-item.now { position: relative; }
.timeline-item.now::before {
  content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px;
  width: 4px; background: var(--green); border-radius: 2px;
}
.timeline-time { flex: 0 0 76px; font-weight: 700; color: var(--purple-2); }
@media (prefers-color-scheme: dark) { .timeline-time { color: var(--green); } }
.timeline-body { flex: 1; }
.timeline-title { font-weight: 700; }
.timeline-detail { color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
.timeline-link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--purple-2); font-weight: 700; text-decoration: underline; min-height: var(--tap); }
@media (prefers-color-scheme: dark) { .timeline-link { color: var(--green); } }
.now-chip {
  display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; background: var(--green); color: #1a1523;
  border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}

/* Filters */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  border: 1.5px solid var(--line); background: var(--bg-soft);
  border-radius: 999px; padding: 8px 16px; min-height: 40px; cursor: pointer;
  font-size: 0.92rem; font-weight: 600;
}
.chip.active { background: var(--purple-2); border-color: var(--purple-2); color: #fff; }

/* Workshop cards */
.ws-card { cursor: pointer; }
.ws-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ws-title { margin: 0; font-size: 1.05rem; font-family: var(--font-display); }
.ws-meta { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }
.tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  border-radius: 5px; padding: 2px 8px; margin-right: 6px;
  background: var(--purple-2); color: #fff; white-space: nowrap;
}
.tag.room { background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.save-btn {
  border: 2px solid var(--purple-2); background: none; color: var(--purple-2);
  border-radius: 999px; min-height: 40px; padding: 6px 14px; cursor: pointer; font-weight: 700;
  flex-shrink: 0;
}
.save-btn.saved { background: var(--green); border-color: var(--green); color: #1a1523; }
@media (prefers-color-scheme: dark) {
  .save-btn { border-color: var(--green); color: var(--green); }
  .save-btn.saved { color: #1a1523; }
}
.ws-photo { display: block; width: 120px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); margin: 0 0 10px; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }

/* Micro-eval */
.eval-row { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }
.eval-q { font-weight: 700; margin: 0 0 6px; }
.eval-stars { display: flex; gap: 4px; }
.eval-star { background: none; border: 0; font-size: 1.6rem; cursor: pointer; min-width: var(--tap); min-height: var(--tap); opacity: 0.35; }
.eval-star.lit { opacity: 1; }
.eval-note { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-top: 8px; font: inherit; background: var(--bg); color: var(--ink); }
.eval-done { color: var(--muted); font-size: 0.9rem; }

/* Bingo */
.battery-big {
  width: 180px; height: 84px; margin: 12px auto; position: relative;
  border: 4px solid var(--ink); border-radius: 12px;
}
.battery-big::after {
  content: ""; position: absolute; right: -14px; top: 24px;
  width: 10px; height: 28px; background: var(--ink); border-radius: 3px;
}
.battery-big-fill {
  position: absolute; top: 5px; bottom: 5px; left: 5px;
  background: linear-gradient(90deg, var(--green), #cbe95a);
  border-radius: 6px; max-width: calc(100% - 10px);
  transition: width 0.6s ease;
}
.battery-pct { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.bingo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.bingo-tile {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); padding: 14px 10px; text-align: center;
  min-height: 84px; display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.bingo-tile.done { border-color: var(--green); background: var(--green); color: #1a1523; font-weight: 700; }
.bingo-tile .tick { font-size: 1.2rem; }
.field-label { display: block; font-weight: 700; margin: 12px 0 4px; }
input[type=text], input[type=email] {
  width: 100%; min-height: var(--tap); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: inherit;
  background: var(--bg); color: var(--ink);
}
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; }
.check-row input { width: 22px; height: 22px; margin-top: 2px; flex-shrink: 0; }
.claim-screen { text-align: center; padding: 20px 0; }
.claim-screen h3 { font-size: 1.8rem; font-family: var(--font-display); margin: 8px 0; }

/* Sponsors */
.tier-title {
  font-family: var(--font-display); font-size: 1.1rem;
  margin: 20px 0 8px; color: var(--purple-2);
}
@media (prefers-color-scheme: dark) { .tier-title { color: var(--green); } }
.sponsor-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sponsor-logo {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: var(--purple-2); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sponsor-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
a.sponsor-row { color: inherit; text-decoration: none; }
.sponsor-text { display: flex; flex-direction: column; min-width: 0; }
.sponsor-name { font-weight: 600; }
a.sponsor-row .sponsor-name { color: var(--purple-2); }
@media (prefers-color-scheme: dark) { a.sponsor-row .sponsor-name { color: var(--green); } }
.sponsor-blurb { font-size: 0.9rem; }

/* Sponsor bar: sits directly above the bottom nav */
.sponsor-bar {
  position: fixed; left: 0; right: 0; z-index: 29;
  bottom: calc(58px + env(safe-area-inset-bottom));
  height: 48px; width: 100%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--bg-soft); border: 0; border-top: 1px solid var(--line);
}
.sponsor-bar-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.sponsor-bar-slot { display: flex; align-items: center; min-width: 0; }
.sponsor-bar-logo { height: 32px; width: auto; max-width: 160px; object-fit: contain; }
.sponsor-bar-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.has-sponsor-bar { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }

/* Help */
.help-phone { font-size: 1.5rem; font-weight: 700; }
.help-phone a { color: var(--purple-2); }
@media (prefers-color-scheme: dark) { .help-phone a { color: var(--green); } }
.lunch-list { list-style: none; margin: 0; padding: 0; }
.lunch-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lunch-loc { color: var(--muted); }

/* Announcements */
.announce-item { border-left: 4px solid var(--green); }
.announce-time { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.announce-item a { color: var(--purple-2); font-weight: 700; }
@media (prefers-color-scheme: dark) { .announce-item a { color: var(--green); } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(20, 12, 32, 0.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--bg); border-radius: 18px 18px 0 0; width: 100%; max-width: 640px;
  max-height: 85vh; overflow-y: auto; padding: 20px 18px 30px; position: relative;
}
.modal-close {
  position: absolute; top: 8px; right: 8px; background: var(--bg-soft);
  border: 0; border-radius: 50%; width: var(--tap); height: var(--tap);
  font-size: 1.4rem; cursor: pointer;
}

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: var(--bg); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1; background: none; border: 0; cursor: pointer;
  min-height: 58px; font-size: 0.68rem; font-weight: 600; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.bottom-nav button.active { color: var(--purple-2); }
@media (prefers-color-scheme: dark) { .bottom-nav button.active { color: var(--green); } }
.nav-icon { font-size: 1.25rem; }

/* Install guides */
.install-guides ol { padding-left: 20px; }
