:root {
  --bg: #0f1a14;
  --bg-2: #142319;
  --surface: #1a2b21;
  --surface-2: #213729;
  --line: #2c4734;
  --text: #e8f5ec;
  --muted: #9fb7a8;
  --primary: #10b981;
  --primary-2: #34d399;
  --primary-3: #047857;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --max: 1100px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4faf6;
    --bg-2: #ffffff;
    --surface: #ffffff;
    --surface-2: #ecf6f0;
    --line: #d4e6da;
    --text: #0f1a14;
    --muted: #4d6a57;
    --shadow: 0 8px 24px rgba(15, 26, 20, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding-bottom: 88px;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* ---------- App shell ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(15,26,20,0.95), rgba(15,26,20,0.85));
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: light) {
  .appbar { background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85)); }
}
.appbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  display: grid; place-items: center; color: #ecfdf5; font-weight: 800;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}
.brand-title { font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); }

.appbar-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  display: grid; place-items: center;
  transition: background .15s ease, transform .1s ease;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.97); }

.online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}
.online-dot.offline { background: var(--warn); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }

/* ---------- Main ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 16px; }
.page { display: none; animation: fade .25s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 20px 0 10px;
}
.section-title h2 { margin: 0; }
.section-title a { font-size: 13px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(4, 120, 87, 0.85), rgba(15, 26, 20, 0.65)),
    url('../assets/bg-auth.jpg') center/cover no-repeat;
  color: #ecfdf5;
  padding: 24px 20px 22px;
  box-shadow: var(--shadow);
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  margin-bottom: 10px;
}
.hero h1 { font-size: clamp(22px, 4.5vw, 32px); margin-bottom: 6px; }
.hero p { margin: 0; opacity: .9; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 14px; font-size: 13px;
}
.hero-meta span { display: inline-flex; gap: 6px; align-items: center; }

.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-top: 16px;
}
.cd-box {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 10px 6px; text-align: center;
}
.cd-num { font-size: 22px; font-weight: 800; line-height: 1; }
.cd-lbl { font-size: 11px; opacity: .8; margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

.hero-cta { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: 10px;
  border: 1px solid transparent; font-weight: 600; font-size: 14px;
  background: #fff; color: #064e3b;
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: #ecfdf5; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-ghost { background: transparent; color: #ecfdf5; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-2); }

/* ---------- Stats grid ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.stat-num { font-size: 22px; font-weight: 800; color: var(--primary-2); }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Cards / lists ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex; gap: 12px; align-items: center;
}
.row-thumb {
  width: 48px; height: 48px; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); flex-shrink: 0;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 14px; }
.row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.chip.green { color: var(--primary-2); border-color: rgba(16,185,129,0.4); background: rgba(16,185,129,0.08); }
.chip.amber { color: var(--warn); border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); }
.chip.gray  { color: var(--muted); }
.chip.pill { padding: 6px 10px; font-size: 12px; }

/* ---------- Agenda ---------- */
.day-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.day-tab {
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px;
}
.day-tab.active { background: var(--primary); border-color: var(--primary); color: white; }

.agenda-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: grid; grid-template-columns: 70px 1fr; gap: 12px;
}
.agenda-time { font-weight: 700; color: var(--primary-2); font-size: 13px; line-height: 1.2; }
.agenda-time small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; margin-top: 2px; }
.agenda-content .title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.agenda-content .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.agenda-speakers { display: flex; margin-top: 8px; }
.agenda-speakers img {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--surface); margin-left: -8px;
}
.agenda-speakers img:first-child { margin-left: 0; }

.agenda-item[data-type="keynote"]  { border-left: 3px solid var(--primary); }
.agenda-item[data-type="panel"]    { border-left: 3px solid #6366f1; }
.agenda-item[data-type="workshop"] { border-left: 3px solid var(--warn); }
.agenda-item[data-type="session"]  { border-left: 3px solid var(--primary-2); }
.agenda-item[data-type="break"]    { border-left: 3px solid var(--muted); opacity: .85; }
.agenda-item[data-type="social"]   { border-left: 3px solid #ec4899; }
.agenda-item[data-type="opening"], .agenda-item[data-type="closing"]  { border-left: 3px solid var(--primary-3); }

/* ---------- Speaker card ---------- */
.speakers-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.speaker-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
}
.speaker-photo {
  width: 80px; height: 80px; border-radius: 50%;
  margin: 0 auto 8px; overflow: hidden;
  border: 3px solid var(--surface-2);
  background: var(--surface-2);
}
.speaker-photo img { width: 100%; height: 100%; object-fit: cover; }
.speaker-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.speaker-role { font-size: 11px; color: var(--muted); margin-top: 4px; min-height: 26px; }

/* ---------- Search ---------- */
.search {
  position: relative; margin-bottom: 12px;
}
.search input {
  width: 100%; padding: 12px 14px 12px 40px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); font: inherit;
}
.search input:focus { outline: none; border-color: var(--primary); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Venue ---------- */
.venue-map {
  position: relative;
  height: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #064e3b, #052e16);
  margin-bottom: 12px;
  border: 1px solid var(--line);
}
.venue-map::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(16,185,129,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,185,129,0.18) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .6;
}
.venue-pin {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -100%);
  width: 32px; height: 32px; border-radius: 50% 50% 50% 0;
  background: var(--primary); transform-origin: center;
  rotate: -45deg;
  display: grid; place-items: center;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
.venue-pin::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: white;
}
.venue-info { display: grid; gap: 10px; }
.kv { display: flex; gap: 10px; padding: 10px; background: var(--surface-2); border-radius: var(--radius-sm); }
.kv-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--surface); display: grid; place-items: center; flex-shrink: 0; color: var(--primary-2); }
.kv-body { flex: 1; min-width: 0; }
.kv-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.kv-value { font-size: 14px; font-weight: 500; word-wrap: break-word; }

.gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-top: 12px;
}
.gallery img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

/* ---------- Sponsors ---------- */
.sponsor-tier { margin-top: 16px; }
.sponsor-tier h3 { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.sponsor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sponsor-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; display: grid; place-items: center; height: 80px;
}
.sponsor-card img { max-height: 40px; max-width: 100px; opacity: .9; filter: brightness(1.1); }
@media (prefers-color-scheme: light) { .sponsor-card img { filter: none; } }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 8px;
  overflow: hidden;
}
.faq-item summary {
  padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--primary-2); font-size: 18px; font-weight: 400; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0; padding: 0 14px 14px; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ---------- Ticket / profile ---------- */
.ticket {
  background: linear-gradient(135deg, var(--primary), var(--primary-3));
  border-radius: var(--radius);
  padding: 18px; color: #ecfdf5;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.ticket::before, .ticket::after {
  content: ""; position: absolute; width: 24px; height: 24px;
  background: var(--bg); border-radius: 50%;
  top: 50%; transform: translateY(-50%);
}
.ticket::before { left: -12px; }
.ticket::after { right: -12px; }
.ticket-name { font-size: 20px; font-weight: 800; }
.ticket-org { font-size: 13px; opacity: .9; }
.ticket-row { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.ticket-qr {
  width: 90px; height: 90px;
  background: white; border-radius: 10px; padding: 6px;
  display: grid; place-items: center;
  color: #064e3b; font-family: monospace; font-size: 9px; text-align: center;
}
.ticket-qr svg { display: block; }
.ticket-info { font-size: 12px; line-height: 1.6; }
.ticket-info strong { display: block; font-size: 11px; opacity: .85; font-weight: 500; }

/* ---------- Bottom nav ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 8px max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
}
.tabbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; color: var(--muted);
  background: transparent; border: none; border-radius: 10px;
  font-size: 11px; font-weight: 500; transition: color .15s ease, background .15s ease;
}
.tab.active { color: var(--primary-2); background: rgba(16,185,129,0.08); }
.tab svg { width: 22px; height: 22px; }

/* ---------- Toast / install ---------- */
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line);
  padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 13px; max-width: 90vw;
  display: flex; gap: 10px; align-items: center;
  z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast button { background: var(--primary); color: white; border: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 12px; }
.toast .close { background: transparent; color: var(--muted); padding: 6px; }

.empty {
  text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px;
}
.empty img { width: 120px; margin: 0 auto 12px; opacity: .8; }

/* utility */
.muted { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 6px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
