/* ── Variables ── */
:root {
  --green:      #005030;
  --green-dark: #003a22;
  --green-mid:  #00693e;
  --orange:     #f47321;
  --orange-lt:  #ff8c42;
  --bg:         #0d1f1a;
  --surface:    #112218;
  --surface2:   #1a3028;
  --text:       #e8f0ec;
  --text-dim:   #8aab97;
  --border:     #1f4033;
  --radius:     12px;
  --radius-sm:  8px;
  --font:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overscroll-behavior: none;
}
a { color: var(--orange); text-decoration: none; }

/* ── Layout ── */
#app { display: flex; flex-direction: column; min-height: 100dvh; }

/* ── Header ── */
.app-header {
  background: var(--green-dark);
  border-bottom: 2px solid var(--orange);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.app-header .logo {
  display: flex; align-items: center; gap: 10px;
}
.app-header .logo-mark {
  width: 36px; height: 36px;
  background: var(--orange);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #000; letter-spacing: -.5px;
}
.app-header .logo .title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.app-header .logo .subtitle { font-size: 10px; color: var(--text-dim); }

/* ── Page content ── */
.page { display: none; flex-direction: column; flex: 1; padding: 16px; gap: 16px; }
.page.active { display: flex; }

/* ── Bottom nav ── */
.bottom-nav {
  background: var(--green-dark);
  border-top: 1px solid var(--border);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: var(--safe-bottom);
  position: sticky; bottom: 0; z-index: 100;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 10px 4px 8px;
  gap: 4px; border: none; background: none;
  color: var(--text-dim); cursor: pointer;
  transition: color .15s;
  font-size: 10px; font-weight: 500;
}
.nav-btn .icon { font-size: 20px; }
.nav-btn.active { color: var(--orange); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--orange); margin-bottom: 12px;
}

/* ── Stat grid ── */
.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.stat-box {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 14px 8px; text-align: center;
}
.stat-box .num { font-size: 28px; font-weight: 800; color: var(--orange); }
.stat-box .lbl { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

.section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); margin-bottom: 8px;
}
.upcoming-badge {
  display: inline-block; font-size: 10px; font-weight: 800;
  background: #f0c400; color: #000;
  border-radius: 4px; padding: 2px 7px;
  letter-spacing: .04em; text-transform: uppercase;
}
.session-item.upcoming {
  border-color: #2d5a3f;
  background: #0f2a1e;
}
.session-date-block.upcoming {
  background: var(--green-mid);
}

/* ── Session list ── */
.session-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.session-item + .session-item { margin-top: 8px; }
.session-date-block {
  min-width: 44px; text-align: center;
  background: var(--green-mid);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
}
.session-date-block .mo { font-size: 9px; text-transform: uppercase; font-weight: 700; color: var(--text-dim); }
.session-date-block .dy { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.session-info { flex: 1; }
.session-info .track-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: var(--orange); color: #000;
  border-radius: 4px; padding: 1px 6px; margin-bottom: 4px;
}
.session-info .s-title { font-size: 14px; font-weight: 600; }
.session-info .s-meta  { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ── My Attendance ── */
.email-form { display: flex; gap: 8px; }
.email-form input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text); font-size: 14px;
}
.email-form input::placeholder { color: var(--text-dim); }
.btn {
  background: var(--orange); color: #000;
  border: none; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.btn:active { opacity: .8; }
.btn-outline {
  background: transparent; color: var(--orange);
  border: 1px solid var(--orange);
}

.profile-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 16px; margin-top: 8px;
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-role { color: var(--orange); font-size: 13px; margin-top: 2px; }
.profile-count { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

.history-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: none; }
.check-icon { color: var(--green-mid); font-size: 16px; }
.history-info .h-title { font-size: 13px; font-weight: 600; }
.history-info .h-date  { font-size: 11px; color: var(--text-dim); }

/* ── Announcements ── */
.announce-item {
  background: var(--surface);
  border-left: 3px solid var(--orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
}
.announce-item + .announce-item { margin-top: 10px; }
.announce-title { font-size: 14px; font-weight: 700; }
.announce-body  { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.announce-date  { font-size: 10px; color: var(--text-dim); margin-top: 6px; }

/* ── SMS opt-in ── */
.sms-form { display: flex; flex-direction: column; gap: 10px; }
.sms-form input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text); font-size: 14px;
}
.sms-form input::placeholder { color: var(--text-dim); }
.success-msg { color: #4caf7d; font-size: 13px; font-weight: 600; }
.error-msg   { color: #e05a5a; font-size: 13px; }

/* ── Supporter cards ── */
.supporter-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px; margin-bottom: 10px;
  text-decoration: none; color: var(--text);
  transition: background .15s;
}
.supporter-card:last-child { margin-bottom: 0; }
.supporter-card:active { background: #1a3028; }
.supporter-logo {
  width: 44px; height: 44px; min-width: 44px;
  background: var(--orange);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #000; letter-spacing: -.3px;
}
.supporter-info { flex: 1; }
.supporter-name { font-size: 13px; font-weight: 700; color: var(--text); }
.supporter-desc { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }
.supporter-arrow { color: var(--orange); font-size: 18px; font-weight: 700; }

/* ── Insights ── */
.insight-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 16px;
}
.insight-num-box {
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 12px 6px; text-align: center;
}
.insight-big { font-size: 26px; font-weight: 800; color: var(--orange); }
.insight-lbl { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.insight-section-title {
  font-size: 12px; font-weight: 700; color: var(--orange);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 10px;
}
.insight-top-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.insight-top-row:last-child { border-bottom: none; }
.insight-medal { font-size: 18px; }
.insight-top-name { font-size: 14px; font-weight: 700; flex: 1; }
.insight-top-role { font-size: 11px; color: var(--text-dim); }
.insight-top-count {
  font-size: 12px; font-weight: 700; color: var(--orange);
  background: var(--surface2); border-radius: 4px; padding: 2px 7px;
}
.insight-fact-card {
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 13px; color: var(--text-dim);
  line-height: 1.5; margin-bottom: 8px;
}
.insight-fact-card strong { color: var(--text); }
.insight-track-row {
  display: flex; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.insight-track-row:last-child { border-bottom: none; }
.insight-block { margin-bottom: 16px; }

/* ── Material cards ── */
.material-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 13px 14px; margin-bottom: 10px;
  text-decoration: none; color: var(--text);
  transition: background .15s;
}
.material-card:active { background: #1a3028; }
.material-track {
  background: var(--orange); color: #000;
  font-size: 10px; font-weight: 800;
  border-radius: 4px; padding: 3px 7px;
  white-space: nowrap; text-transform: uppercase;
  align-self: flex-start; margin-top: 2px;
}
.material-title { font-size: 13px; font-weight: 600; }
.material-desc  { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.material-arrow { color: var(--orange); font-size: 18px; font-weight: 700; margin-left: auto; }
.material-info  { flex: 1; }

/* ── LinkedIn feed cards ── */
#li-feed { display: flex; flex-direction: column; gap: 8px; }
.li-card {
  display: block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid #0a66c2;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 11px 13px;
  text-decoration: none;
  transition: background .15s;
}
.li-card:active { background: #1a3028; }
.li-tag {
  font-size: 10px; font-weight: 700; color: #4a9fd4;
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px;
}
.li-title {
  font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4;
}

/* ── Loading / empty ── */
.loading { color: var(--text-dim); font-size: 13px; text-align: center; padding: 32px; }
.empty   { color: var(--text-dim); font-size: 13px; text-align: center; padding: 24px; }

/* ── Install banner ── */
#install-banner {
  display: none;
  background: var(--green-mid);
  padding: 12px 16px;
  flex-direction: row; align-items: center; gap: 12px;
}
#install-banner.show { display: flex; }
#install-banner p { flex: 1; font-size: 13px; }
