/* BuildAConf event app (PWA): /e/<slug>/app. Mobile first (360–430px), two skins:
   light (classic template) and dark (.premium). --ev is the event colour, set on <body>. */
body.app {
  --bg: #f4f3f8;
  --surface: #ffffff;
  --surface-2: #ecebf3;
  --fg: #15121f;
  --muted: #555068;
  --line: #e2dfec;
  --chip: #eeecf5;
  --ev-text: color-mix(in srgb, var(--ev) 82%, #000);
  --ev-soft: color-mix(in srgb, var(--ev) 12%, transparent);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 20px;
  --tabbar: 64px;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
body.app.premium {
  --bg: #08070d;
  --surface: #15131e;
  --surface-2: #1d1a29;
  --fg: #f5f3fb;
  --muted: #b5afc8;
  --line: rgba(255, 255, 255, .1);
  --chip: rgba(255, 255, 255, .08);
  --ev-text: color-mix(in srgb, var(--ev) 45%, #fff);
  --ev-soft: color-mix(in srgb, var(--ev) 22%, transparent);
  color-scheme: dark;
}
body.app a { color: inherit; }
body.app h1, body.app h2, body.app h3 { margin: 0; }
.app .ic { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app .ic-lg { width: 40px; height: 40px; color: var(--ev-text); }
.app .ic-inline { width: 18px; height: 18px; vertical-align: -4px; }
.app .ic-end { margin-inline-start: auto; color: var(--muted); width: 18px; height: 18px; }
.app .prewrap { white-space: pre-wrap; }
.app-muted { color: var(--muted); }

.app-ic-box { display: inline-grid; place-items: center; flex-shrink: 0; }

/* Demo strip: one line, expandable */
.app-demo { background: color-mix(in srgb, #ffd166 18%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, #ffd166 40%, transparent); font: 500 .75rem/1.4 var(--mono); }
.app-demo summary { list-style: none; cursor: pointer; padding: 6px 16px; text-align: center; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-demo summary::-webkit-details-marker { display: none; }
.app-demo summary::after { content: " ▾"; color: var(--muted); }
.app-demo[open] summary::after { content: " ▴"; }
.app-demo p { margin: 0; padding: 0 16px 8px; text-align: center; color: var(--muted); font-family: var(--body); font-size: .8rem; }

/* Top bar */
.app-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.app-brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.app-brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--ev), color-mix(in srgb, var(--ev) 40%, #22d3ee)); color: #fff; font: 800 .8rem var(--display); flex-shrink: 0; }
.app-brand-name { font: 700 1rem/1.2 var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-offline { font: 500 .7rem var(--mono); padding: 3px 8px; border-radius: 999px; background: #fde68a; color: #3b2a00; white-space: nowrap; }
.app-top .lang { margin-inline-start: auto; display: inline-flex; flex-shrink: 1; min-width: 0; max-width: 58%; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 3px; border-radius: 999px; background: var(--chip); }
.app-top .lang a { font: 500 .7rem var(--mono); padding: 5px 8px; border-radius: 999px; color: var(--muted); text-decoration: none; min-width: 24px; text-align: center; }
.app-top .lang a.active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }

/* Main */
.app-main { max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; display: grid; gap: 16px; }
.app-main > * { min-width: 0; }
.app-h1 { font: 800 1.45rem/1.15 var(--display); letter-spacing: -.02em; }
.app-page-title { font-size: 1.75rem; margin-top: 4px; }
.app-h2 { font: 700 1.1rem/1.25 var(--display); letter-spacing: -.01em; margin-bottom: 10px; }
.app-sec { display: grid; gap: 10px; }
.app-sec > .app-h2 { margin-bottom: 0; }
.app-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.app-center { text-align: center; display: grid; justify-items: center; gap: 10px; }
.app-empty { color: var(--muted); text-align: center; padding: 24px 8px; margin: 0; }
.app-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #ffd166 16%, transparent); border: 1px solid color-mix(in srgb, #ffd166 40%, transparent); font-size: .9rem; }
.app-prose { margin: 0; line-height: 1.6; }
.app-hint { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; margin: 0; }
.app-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--ev); background: var(--ev); color: #fff !important; font: 600 .95rem var(--body); text-decoration: none; cursor: pointer; }
.app-btn.ghost { background: transparent; color: var(--fg) !important; border-color: var(--line); }
.app-btn.small { min-height: 36px; padding: 6px 14px; font-size: .85rem; }
.app-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.app-iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0; background: transparent; color: var(--fg); cursor: pointer; flex-shrink: 0; }
.app-backbar { display: flex; align-items: center; gap: 6px; margin: -4px 0 0 -10px; }
.app-more-link { display: inline-flex; align-items: center; gap: 4px; justify-self: start; color: var(--ev-text) !important; font-weight: 600; font-size: .9rem; text-decoration: none; min-height: 32px; }
.app-more-link .ic { width: 16px; height: 16px; }

/* Home: hero */
.app-hero { position: relative; overflow: hidden; border-radius: 24px; min-height: 240px; display: flex; align-items: flex-end; color: #fff; isolation: isolate;
  background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--ev) 55%, #f472b6) 0, transparent 60%), linear-gradient(150deg, var(--ev), color-mix(in srgb, var(--ev) 35%, #0b0a12)); }
.app-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.app-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 7, 13, 0) 25%, rgba(8, 7, 13, .78)); }
.app-hero-body { padding: 20px; display: grid; gap: 8px; }
.app-hero-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.app-hero-meta span { font: 500 .72rem var(--mono); letter-spacing: .02em; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.app-hero-title { font: 800 clamp(1.8rem, 8vw, 2.4rem)/1.02 var(--display); letter-spacing: -.035em; text-wrap: balance; }
.app-hero-tag { margin: 0; color: rgba(255, 255, 255, .88); font-size: .95rem; line-height: 1.4; }

/* Home: now / next */
.app-now { display: grid; gap: 10px; }
.app-now-label { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 1.05rem var(--display); }
.app-now-label .ic { color: var(--ev-text); }
.app-kicker { margin: 4px 0 0; font: 600 .72rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.app-kicker-live { color: #ef4444; display: flex; align-items: center; gap: 6px; }
.app-kicker-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); animation: app-pulse 1.6s infinite; }
@keyframes app-pulse { 70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

/* Home: ticket CTA + tiles */
.app-ticket-cta { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); text-decoration: none; color: #fff !important; background: linear-gradient(120deg, var(--ev), color-mix(in srgb, var(--ev) 45%, #0e7490)); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--ev) 70%, transparent); }
.app-ticket-cta .app-ic-box { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .18); }
.app-ticket-cta .app-ic-box .ic { width: 28px; height: 28px; }
.app-ticket-cta > span:not(.app-ic-box) { display: grid; }
.app-ticket-cta strong { font: 700 1.05rem var(--display); }
.app-ticket-cta small { opacity: .85; }
.app-ticket-cta > .ic:last-child { margin-inline-start: auto; }
.app-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.app-tile { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 92px; padding: 12px 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .85rem; text-align: center; }
.app-tile .app-ic-box { width: 44px; height: 44px; border-radius: 14px; color: var(--ev-text); background: var(--ev-soft); }
.app-tile .ic { width: 24px; height: 24px; }

/* Sessions */
.app-sticky { position: sticky; top: 53px; z-index: 5; display: grid; gap: 8px; margin: 0 -16px; padding: 8px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.app-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.app-chips::-webkit-scrollbar { display: none; }
.app-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 600 .88rem var(--body); white-space: nowrap; cursor: pointer; text-decoration: none; text-transform: capitalize; }
.app-pill.small { min-height: 32px; padding: 4px 12px; font-size: .8rem; text-transform: none; }
.app-pill.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.app-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); }
.app-list { display: grid; gap: 10px; }
.app-session { position: relative; display: grid; gap: 8px; padding: 14px 52px 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--tc, var(--line)); }
.app-session.is-break { background: transparent; border-style: dashed; border-inline-start-width: 1px; padding-inline-end: 16px; }
.app-session.is-break .app-session-title { font-weight: 600; color: var(--muted); font-size: .95rem; }
.app-session.compact { padding-top: 12px; padding-bottom: 12px; background: var(--surface-2); }
.app-session-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.app-time { font: 600 .82rem var(--mono); color: var(--fg); margin-inline-end: 2px; }
.app-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: .75rem; font-weight: 500; }
.app-chip .ic { width: 14px; height: 14px; }
.app-track { color: var(--fg); background: color-mix(in srgb, var(--tc) 20%, transparent); }
.app-live { padding: 2px 8px; border-radius: 999px; background: #ef4444; color: #fff; font: 700 .68rem var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.app-session-title { font: 700 1.02rem/1.3 var(--display); letter-spacing: -.01em; }
.app-people { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.app-person { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); text-decoration: none; min-height: 28px; }
a.app-person span { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.app-star { position: absolute; top: 6px; inset-inline-end: 6px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.app-star.on { color: #f59e0b; }
.app-star.on .ic { fill: currentColor; }

/* Avatars */
.app-avatar { display: block; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.app-avatar-xs { width: 24px; height: 24px; font-size: .6rem; }
.app-avatar-lg { width: 100%; height: auto; aspect-ratio: 1; border-radius: 16px; font-size: 1.6rem; }
.app-avatar-xl { width: 120px; height: 120px; font-size: 2.4rem; }
.app-mono { display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 800; }
.app-mono.hue-0 { background: linear-gradient(135deg, #7c3aed, #22d3ee); }
.app-mono.hue-1 { background: linear-gradient(135deg, #db2777, #f59e0b); }
.app-mono.hue-2 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.app-mono.hue-3 { background: linear-gradient(135deg, #059669, #0e7490); }

/* Speakers */
.app-people-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.app-person-card { display: grid; gap: 4px; align-content: start; height: 100%; box-sizing: border-box; padding: 10px 10px 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.app-person-card strong { font: 700 .98rem/1.25 var(--display); margin-top: 6px; }
.app-person-card .app-muted { font-size: .8rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-person-card.featured { border-color: color-mix(in srgb, var(--ev) 55%, var(--line)); }
.app-profile { display: grid; justify-items: center; text-align: center; gap: 6px; }
.app-profile .app-avatar-xl { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px color-mix(in srgb, var(--ev) 60%, transparent); margin-bottom: 6px; }
.app-profile p { margin: 0; }

/* Sponsors: light plates so dark logos read on both skins */
.app-logos { display: grid; gap: 10px; }
.app-logos-xl { grid-template-columns: 1fr; }
.app-logos-lg, .app-logos-md, .app-logos-sm { grid-template-columns: repeat(2, 1fr); }
.app-logo { display: flex; align-items: center; justify-content: center; padding: 14px; border-radius: 18px; background: #fff; border: 1px solid #e6e3ee; text-decoration: none; }
.app-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.app-logo-xl { height: 120px; padding: 20px 28px; }
.app-logo-lg { height: 92px; }
.app-logo-md { height: 72px; }
.app-logo-sm { height: 60px; padding: 10px 12px; }
.app-logo-text { color: #15121f; font: 800 .95rem var(--display); text-align: center; }
.app-logo-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.app-logo-strip::-webkit-scrollbar { display: none; }
.app-logo-row { flex: 0 0 150px; height: 60px; padding: 10px 12px; box-sizing: border-box; scroll-snap-align: start; }
.app-tier-platinum .app-h2 { color: var(--ev-text); }

/* Venue */
.app-venue { display: grid; gap: 4px; }
.app-venue p { margin: 0; }
.app-venue-icon .ic { width: 28px; height: 28px; color: var(--ev-text); }
.app-map { width: 100%; aspect-ratio: 16 / 11; border: 0; border-radius: var(--radius); background: var(--surface-2); }

/* Info / FAQ */
.app-faq { border-bottom: 1px solid var(--line); }
.app-faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; min-height: 24px; }
.app-faq p { margin: 0 0 12px; color: var(--muted); }

/* More menu */
.app-menu { display: grid; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.app-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); font: 500 1rem var(--body); text-decoration: none; text-align: start; cursor: pointer; width: 100%; box-sizing: border-box; }
.app-row:last-child { border-bottom: 0; }
.app-row > .ic:first-child { color: var(--ev-text); }
.app-seg { margin-inline-start: auto; display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--chip); }
.app-seg a { font: 600 .75rem var(--mono); padding: 6px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); }
.app-seg a.active { background: var(--surface); color: var(--fg); }
.app-powered { text-align: center; font-size: .8rem; color: var(--muted); margin: 0; }

/* Ticket */
.app-ticket { --notch: 14px; border-radius: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .45); }
.app-ticket-top { position: relative; padding: 20px 20px 18px; color: #fff; background: linear-gradient(135deg, var(--ev), color-mix(in srgb, var(--ev) 40%, #0e7490)); }
.app-ticket-event { margin: 0; font: 800 1.35rem/1.15 var(--display); letter-spacing: -.02em; }
.app-ticket-meta { margin: 4px 0 0; font-size: .85rem; opacity: .9; }
.app-badge { display: inline-block; margin-bottom: 8px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .22); font: 600 .7rem var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.app-ticket-tear { position: relative; height: calc(var(--notch) * 2); margin: calc(var(--notch) * -1) 0; background: radial-gradient(circle at 0 50%, var(--bg) var(--notch), transparent calc(var(--notch) + .5px)) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, var(--bg) var(--notch), transparent calc(var(--notch) + .5px)) right / 51% 100% no-repeat; z-index: 1; }
.app-ticket-tear::after { content: ""; position: absolute; left: calc(var(--notch) + 8px); right: calc(var(--notch) + 8px); top: 50%; border-top: 2px dashed var(--line); }
.app-ticket-body { display: grid; gap: 12px; justify-items: center; padding: 18px 20px 20px; }
.app-ticket-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.app-ticket-row small { display: block; font: 500 .68rem var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.app-ticket-row strong { font: 700 1rem var(--display); overflow-wrap: anywhere; }
.app-qr { display: block; padding: 14px; border: 0; border-radius: 18px; background: #fff; cursor: zoom-in; box-shadow: 0 0 0 1px #e6e3ee; }
.app-qr svg { display: block; width: min(64vw, 240px); height: auto; }
.app-ticket-status { margin: 0; padding: 6px 12px; border-radius: 999px; background: var(--chip); font-weight: 600; font-size: .85rem; text-align: center; }
.app-ticket-status.ok { background: color-mix(in srgb, #10b981 18%, transparent); color: color-mix(in srgb, #10b981 70%, var(--fg)); }
.app-ticket-status.in { background: color-mix(in srgb, #6366f1 18%, transparent); }
.app-ticket-code { margin: 0; font: 500 .75rem var(--mono); letter-spacing: .1em; color: var(--muted); }
.app-qr-full { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; background: #fff; color: #15121f; text-align: center; }
.app-qr-full p { margin: 0; display: flex; gap: 6px; align-items: center; }
.app-qr-full .app-muted { color: #555068; font-size: .9rem; }
.app-qr-big svg { display: block; width: min(86vw, 420px); height: auto; }

/* Tab bar */
.app-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.app-tab { display: grid; justify-items: center; align-content: center; gap: 3px; min-width: 0; color: var(--muted); text-decoration: none; font: 600 .68rem/1.1 var(--body); }
.app-tab-label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.app-tab .app-ic-box { width: 54px; height: 30px; border-radius: 999px; transition: background .15s; }
.app-tab.active { color: var(--ev-text); }
.app-tab.active .app-ic-box { background: var(--ev-soft); }

/* Install banner */
.app-install { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 10px); z-index: 25; display: flex; align-items: center; gap: 10px; max-width: 536px; margin: 0 auto; padding: 10px 6px 10px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .5); font-size: .85rem; }
.app-install[hidden] { display: none; }
.app-install > div { display: grid; min-width: 0; flex: 1; }
.app-install strong { font: 700 .95rem var(--display); }
.app-install-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ev-soft); color: var(--ev-text); flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) { .app-kicker-live::before { animation: none; } .app-tab .app-ic-box { transition: none; } }

/* Right-to-left (ar, ur) */
[dir="rtl"] .app-session { padding: 14px 16px 14px 52px; }
[dir="rtl"] .app-session.is-break { padding-left: 16px; }
[dir="rtl"] .app .ic-end { transform: scaleX(-1); }
