:root { --bg:#0b1020; --ink:#111827; --card:#ffffff; --muted:#6b7280; --gold:#facc15; --blue:#1f5fbf; --green:#16a34a; --red:#dc2626; --line:#e5e7eb; --soft:#f3f4f6; }
* { box-sizing: border-box; }
html, body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--soft); }
a { color: var(--blue); }
h1 { font-size: 1.5rem; margin: .4rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: .2rem 0 .5rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: .08em; }
.hidden { display: none !important; }
.card { background: var(--card); border-radius: 14px; padding: 14px 16px; margin: 0 0 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); display: block; color: inherit; text-decoration: none; }
.card.narrow { max-width: 460px; margin: 40px auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #d1d5db; background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 44px; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.gold { background: var(--gold); border-color: #eab308; }
.btn.danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn.big { width: 100%; font-size: 1.1rem; padding: 14px; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.link { background: none; border: 0; color: var(--blue); padding: 4px 6px; font-size: .85rem; cursor: pointer; }
.input { width: 100%; font-size: 16px; padding: 11px 12px; border: 1px solid #d1d5db; border-radius: 10px; margin: 0 0 10px; background: #fff; font-family: inherit; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 2px 8px; margin-right: 4px; }
.tag.vip { background: #fef3c7; color: #92400e; } .tag.hot { background:#fee2e2; color:#991b1b } .tag.warm { background:#ffedd5; color:#9a3412 } .tag.cold { background:#e0f2fe; color:#075985 }
.note { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; border-radius: 10px; padding: 8px 10px; font-size: .9rem; }
.note.warn { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.row { display: flex; align-items: center; gap: 10px; } .row.gap { flex-wrap: wrap; margin-bottom: 12px; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: all .2s; z-index: 100; max-width: 90vw; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%); } #toast.warn { background: #b91c1c; } #toast.ok { background: #15803d; }
body.plain { padding: 16px; }

/* ---------- App shell ---------- */
body.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body.app .view { flex: 1; width: 100%; }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.brand { font-weight: 800; letter-spacing: .02em; } .spark { color: var(--gold); }
.pill { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 4px 10px; background: #374151; cursor: pointer; }
.pill.ok { background: #14532d; } .pill.warn { background: #92400e; } .pill.off { background: #7f1d1d; }
.view { max-width: 720px; margin: 0 auto; padding: 14px; }
.view.loading { opacity: .6; }
.tabs { position: sticky; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 2px 6px; text-decoration: none; color: var(--muted); font-size: .7rem; min-height: 58px; }
.tab .ico { font-size: 1.35rem; line-height: 1.1; }
.tab.on { color: var(--ink); font-weight: 700; } .tab.on .ico { color: #ca8a04; }
.tab.scan-tab .ico { background: var(--gold); color: var(--ink); border-radius: 12px; padding: 0 10px; }
.hero { background: linear-gradient(135deg, #111827, #1e3a8a); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.hero .muted { color: #cbd5e1; }
.sect { margin-top: 18px; }
.ann.pinned { border-left: 4px solid var(--gold); }
.seg { display: flex; background: #e5e7eb; border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.seg a { flex: 1; text-align: center; padding: 8px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; }
.seg a.on { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.session { display: flex; gap: 12px; align-items: flex-start; }
.session .when { min-width: 64px; font-weight: 700; } .session .when small { display: block; color: var(--muted); font-weight: 400; }
.session .what { flex: 1; } .session p { margin: 2px 0 4px; }
.star { border: 0; background: none; font-size: 1.5rem; color: #d1d5db; cursor: pointer; padding: 4px 6px; min-width: 44px; min-height: 44px; }
.star.on { color: #eab308; }
.mapwrap { position: relative; width: 100%; background: #fff; border-radius: 12px; overflow: hidden; }
.mapimg { display: block; width: 100%; height: auto; }
.hot { position: absolute; border: 2px solid rgba(31,95,191,.55); background: rgba(31,95,191,.08); border-radius: 6px; cursor: pointer; padding: 2px; display: flex; align-items: center; justify-content: center; text-align: center; }
.hot span { font-size: clamp(8px, 1.8vw, 13px); font-weight: 700; color: #1e3a8a; background: rgba(255,255,255,.8); border-radius: 4px; padding: 1px 3px; }
.hot.booth { border-color: rgba(22,163,74,.6); background: rgba(22,163,74,.1); }
.hot.on { background: rgba(250,204,21,.45); border-color: #ca8a04; }
.boothlist .row { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; }
.booth { display: inline-block; min-width: 42px; text-align: center; background: var(--ink); color: var(--gold); border-radius: 8px; padding: 3px 6px; }
.vendor { display: flex; gap: 12px; } .vendor p { margin: 4px 0; }
.boothbadge { min-width: 58px; height: 58px; border-radius: 12px; background: var(--ink); color: var(--gold); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.boothbadge small { font-size: .6rem; text-transform: uppercase; color: #cbd5e1; } .boothbadge b { font-size: 1.3rem; }
.ring { --p: 0; width: 150px; height: 150px; border-radius: 50%; margin: 10px auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(closest-side, #fff 78%, transparent 79%), conic-gradient(#16a34a calc(var(--p) * 1%), #e5e7eb 0); }
.ring b { font-size: 2rem; } .big { font-size: 1.1rem; font-weight: 600; } .big.done { color: var(--green); }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stamp { background: #fff; border: 2px dashed #d1d5db; border-radius: 12px; padding: 10px; display: flex; gap: 8px; align-items: center; font-size: .85rem; position: relative; }
.stamp b { background: #e5e7eb; border-radius: 6px; padding: 2px 6px; } .stamp i { margin-left: auto; color: var(--green); font-style: normal; font-weight: 800; font-size: 1.2rem; }
.stamp.on { border: 2px solid #16a34a; background: #f0fdf4; } .stamp.on b { background: #16a34a; color: #fff; }
.thread h3 { margin-bottom: 2px; } .back { display: inline-block; margin-bottom: 6px; text-decoration: none; }
.post { background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; } .post.pinned { border-left: 4px solid var(--gold); }
.post.reply { background: var(--soft); margin: 8px 0 0 14px; } .post .who { font-weight: 700; font-size: .85rem; } .post p { margin: 4px 0; white-space: pre-wrap; }
.acts { display: flex; align-items: center; gap: 6px; }
.composer { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; } .composer .input { margin: 0; }
.myqr { display: block; width: 220px; height: 220px; margin: 8px auto; background: #fff; }
.check { display: flex; gap: 8px; align-items: flex-start; } .check input { width: 22px; height: 22px; margin-top: 2px; }

/* ---------- Scanner ---------- */
.scanhome { display: flex; flex-direction: column; align-items: stretch; }
.boothline { text-align: center; margin: 0 0 10px; }
.scanbtn { align-self: center; width: min(62vw, 240px); height: min(62vw, 240px); border-radius: 50%; border: 0; background: radial-gradient(circle at 35% 30%, #fde047, #eab308); color: var(--ink);
  font-size: 2.4rem; font-weight: 900; letter-spacing: .08em; box-shadow: 0 10px 30px rgba(234,179,8,.45), inset 0 -6px 0 rgba(0,0,0,.12); cursor: pointer; margin: 8px 0 10px; touch-action: manipulation; }
.scanbtn:active { transform: scale(.97); }
.scanbtn.live { width: 120px; height: 120px; font-size: 1.3rem; background: #1f2937; color: #fff; box-shadow: none; }
.cambox { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #000; border-radius: 16px; overflow: hidden; }
.cam { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame { position: absolute; inset: 16% 22%; border: 4px solid rgba(250,204,21,.9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s; }
.flash.ok { background: rgba(22,163,74,.65); opacity: 1; transition: none; } .flash.bad { background: rgba(220,38,38,.6); opacity: 1; transition: none; }
.scanstatus { text-align: center; font-weight: 600; min-height: 1.4em; }
.lastcard { border-left: 6px solid var(--green); } .lastcard .lc-top { justify-content: flex-start; } .lastcard.pending { border-left-color: #d97706; } .lastcard.bad { border-left-color: var(--red); }
.lc-top { display: flex; gap: 10px; align-items: center; justify-content: space-between; } .lc-top .check { font-size: 1.6rem; color: var(--green); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid #d1d5db; background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; min-height: 40px; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; }
.manual { display: flex; gap: 8px; } .manual .input { margin: 0; }
.lead .lc-top { align-items: flex-start; }

/* ---------- Admin ---------- */
body.admin { background: #f8fafc; }
.adm { display: flex; min-height: 100vh; }
.adm nav { width: 220px; background: var(--ink); color: #fff; padding: 16px 10px; flex-shrink: 0; }
.adm nav a { display: block; color: #e5e7eb; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-size: .95rem; }
.adm nav a.on { background: #374151; color: #fff; font-weight: 700; }
.adm main { flex: 1; padding: 20px 26px; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); } .stat b { display: block; font-size: 1.8rem; } .stat span { color: var(--muted); font-size: .85rem; }
table.t { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: .9rem; }
table.t th, table.t td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { background: #f1f5f9; font-size: .78rem; text-transform: uppercase; color: #475569; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form label { display: block; font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: 2px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; } .toolbar .input { width: auto; flex: 1; min-width: 200px; margin: 0; }
.winner { font-size: 1.8rem; font-weight: 800; color: #15803d; }
.mapedit { position: relative; user-select: none; cursor: crosshair; } .mapedit .draft { position: absolute; border: 2px dashed #dc2626; background: rgba(220,38,38,.1); }
@media (max-width: 800px) {
  .adm { flex-direction: column; } .adm nav { width: auto; display: flex; overflow-x: auto; padding: 8px; } .adm nav a { white-space: nowrap; }
  .adm main { padding: 12px; } .grid2, .grid3 { grid-template-columns: 1fr; }
  table.t { display: block; overflow-x: auto; }
}

/* Speakers */
.spk { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.spkchip { display: inline-flex; align-items: center; gap: 6px; background: #fff7ed; color: #9a3412; border-radius: 999px; padding: 3px 10px 3px 3px; font-size: .82rem; font-weight: 600; text-decoration: none; }
.spkchip img, .spkchip .av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.av { display: inline-flex; align-items: center; justify-content: center; background: #c2410c; color: #fff; font-weight: 800; }
.speaker { display: flex; gap: 12px; align-items: center; }
.spkphoto { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; font-size: 1.4rem; }
.spkphoto.big { width: 120px; height: 120px; font-size: 3rem; margin: 6px auto; display: flex; }
.tag.spk-tag { background: #ffedd5; color: #9a3412; }
.bio { white-space: pre-wrap; line-height: 1.5; }
