/* ═══════════════════════════════════════════════════════════════
   Eventify AI - web design system
   Colours, type and components taken from the approved UI design
   (Eventify-AI-Design). Mobile-first; the attendee app switches to a
   desktop layout at 860px and the dashboard sidebar appears at 1024px.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #F5EFE4;          /* page (cream) */
  --surface: #FFFBF4;     /* cards */
  --fill: #EFE7D8;        /* subtle fills, chips */
  --input: #F5EFE4;
  --ink: #1E1A15;         /* text + dark surfaces */
  --ink-2: #3E362E;
  --muted: #6B6158;
  --line: #E3D9C8;
  --line-2: #EFE7D8;
  --accent: #B3401E;      /* terracotta */
  --accent-hover: #8C2F14;
  --accent-soft: #F6DCD2;
  --accent-ink: #7A2A12;
  --green: #1F5A45;
  --green-soft: #DCEBE3;
  --green-ink: #143D2F;
  --gold: #E3A72F;
  --gold-soft: #F7E7C2;
  --gold-ink: #6B4A0E;
  --brown: #8B5A3C;
  --dark-2: #2A241D;
  --dark-line: #3A3229;
  --dark-muted: #CFC4B4;
  --danger: #8F2A10;
  --radius: 16px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, .d { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }
.m { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Ethiopian "tibeb" border pattern used across the design */
.tb {
  background-color: var(--green);
  background-image: linear-gradient(135deg, var(--gold) 25%, transparent 25%), linear-gradient(225deg, var(--gold) 25%, transparent 25%),
    linear-gradient(315deg, var(--gold) 25%, transparent 25%), linear-gradient(45deg, var(--gold) 25%, transparent 25%);
  background-size: 12px 12px; background-position: -6px 0, -6px 0, 0 0, 0 0; height: 10px;
}
.tb.red { background-color: var(--accent); }

/* ───── Buttons ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1.5px solid transparent; font-weight: 600; font-size: 15px; background: var(--surface); color: var(--ink); white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s; text-decoration: none; }
.btn:hover { color: inherit; }
/* A button never makes its card wider than the screen: long labels are cut with "..." */
.btn { max-width: 100%; min-width: 0; }
.btn > span:not(.spinner) { overflow: hidden; text-overflow: ellipsis; }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #FFFBF4; }
.btn-primary:hover { background: var(--accent-hover); color: #FFFBF4; }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { background: #000; color: var(--bg); }
.btn-green { background: var(--green); color: #FFFBF4; }
.btn-green:hover { background: var(--green-ink); color: #FFFBF4; }
.btn-outline { background: var(--surface); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-2); }
.btn-ghost-dark { background: transparent; color: var(--bg); border-color: #5A4F43; }
.btn-ghost-dark:hover { color: #fff; border-color: var(--dark-muted); }
.btn-danger { background: var(--danger); color: #FFFBF4; }
.btn-danger-text { background: var(--surface); border-color: var(--line); color: var(--danger); }
.btn-lg { height: 56px; border-radius: 16px; font-size: 17px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); display: inline-flex;
  align-items: center; justify-content: center; color: var(--ink); flex-shrink: 0; }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-2); }
.link-btn { background: none; border: none; padding: 0; color: var(--accent); font-weight: 600; }

/* ───── Cards, chips, badges ───── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-dark { background: var(--ink); color: var(--bg); border-radius: 20px; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); display: inline-flex;
  align-items: center; gap: 6px; font-size: 15px; font-weight: 500; white-space: nowrap; color: var(--ink); }
.chip[aria-pressed="true"], .chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.chip.green[aria-pressed="true"] { background: var(--green); border-color: var(--green); }
.chip.soft-green { background: var(--green-soft); border-color: var(--green-soft); color: var(--green-ink); font-weight: 600; }
.chip.dashed { border-style: dashed; color: var(--muted); }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-scroll::-webkit-scrollbar { display: none; }
.tag { display: inline-flex; padding: 3px 10px; border-radius: 6px; background: var(--fill); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.badge.live, .badge.red { background: var(--accent-soft); color: var(--accent-ink); }
.badge.green, .badge.published, .badge.answered { background: var(--green-soft); color: var(--green-ink); }
.badge.gold, .badge.pinned { background: var(--gold-soft); color: var(--gold-ink); }
.badge.solid-red { background: var(--accent); color: #FFFBF4; letter-spacing: .06em; }
.badge.solid-green { background: var(--green); color: #FFFBF4; }
.badge.cancelled { background: #EADBD5; color: var(--danger); }
.eyebrow { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--accent); }
.dot.green { background: var(--green); }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(179,64,30,.45); } 50% { box-shadow: 0 0 0 6px rgba(179,64,30,0); } }

/* Avatars (initials) */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display);
  font-weight: 800; font-size: 16px; color: #FFFBF4; flex-shrink: 0; overflow: hidden; background: var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.c1 { background: var(--accent); } .avatar.c2 { background: var(--gold); color: var(--ink); }
.avatar.c3 { background: var(--green); } .avatar.c4 { background: var(--ink); } .avatar.c5 { background: var(--brown); }
.avatar.sq { border-radius: 10px; }
.avatar-stack { display: flex; } .avatar-stack .avatar { border: 2px solid var(--ink); margin-left: -10px; } .avatar-stack .avatar:first-child { margin-left: 0; }

/* ───── Forms ───── */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .label { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.input, .select, .textarea { width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 16px; outline: none; transition: border-color .15s; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink-2); }
.input::placeholder, .textarea::placeholder { color: #8A7F73; }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--accent); }
.field-error { color: var(--accent-ink); font-size: 13px; }
.form-grid { display: grid; gap: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.input-group { display: flex; gap: 10px; }
.input-prefix { min-width: 72px; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: var(--fill); border: 1.5px solid var(--line); }
.form-alert { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; font-weight: 600; }
.form-alert.ok { background: var(--green-soft); color: var(--green-ink); }
.check-row { display: flex; gap: 10px; align-items: center; font-size: 14px; }

/* Role picker on sign up */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-pick button { text-align: left; padding: 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.role-pick button strong { font-size: 17px; }
.role-pick button span { color: var(--muted); font-size: 14px; line-height: 1.3; }
.role-pick button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.role-pick button[aria-pressed="true"] span { color: var(--dark-muted); }

/* Email verification banner */
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin: 8px 0 12px; border-radius: 12px; background: var(--gold-soft); color: var(--gold-ink); font-size: 14px; }
.verify-banner span { flex: 1; min-width: 200px; }
.verify-banner .link-btn { color: var(--accent-ink); }

/* Share menu (desktop; phones use their own share sheet) */
.share-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(30,26,21,.45); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.share-sheet { width: min(100%, 440px); background: var(--surface); border-radius: 22px; padding: 20px; box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.share-grid .btn { padding: 0 8px; }
@media (min-width: 640px) { .share-backdrop { align-items: center; } }

/* ───── Toasts ───── */
#toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: toastIn .2s ease-out; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Loading + empty states */
.skeleton { background: linear-gradient(90deg, var(--fill) 25%, #F7F1E6 50%, var(--fill) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 16px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.spinner { width: 20px; height: 20px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═════════════ Attendee app shell ═════════════ */
.app-header { position: sticky; top: 0; z-index: 20; background: rgba(245,239,228,.92); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; }
.app-header-inner { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 20px; }
.brand:hover { color: var(--ink); }
.brand .ai { color: var(--accent); }
.brand-mark { width: 22px; height: 22px; transform: rotate(45deg); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; flex-shrink: 0; }
.brand-mark i:nth-child(1) { background: var(--accent); } .brand-mark i:nth-child(2) { background: var(--gold); }
.brand-mark i:nth-child(3) { background: var(--green); } .brand-mark i:nth-child(4) { background: var(--ink); }
.brand.on-dark { color: var(--bg); } .brand.on-dark .ai { color: var(--gold); } .brand.on-dark .brand-mark i:nth-child(4) { background: var(--bg); }
.top-nav { display: none; gap: 4px; margin-left: 24px; }
.top-nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.top-nav a[aria-current="page"] { background: var(--surface); color: var(--accent); }
.header-spacer { flex: 1; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 9px; right: 10px; border: 2px solid var(--surface); width: 10px; height: 10px; }
.app-main { max-width: 1120px; margin: 0 auto; padding: 8px 16px 112px; }
.narrow { max-width: 640px; margin: 0 auto; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); display: grid;
  grid-template-columns: repeat(4, 1fr); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.tabbar a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.page-title { font-size: 34px; font-weight: 800; line-height: 1.05; }
.page-head { display: flex; align-items: center; gap: 14px; margin: 16px 0 20px; }
.page-head .sub { color: var(--muted); font-size: 15px; }
.section-title { font-size: 22px; font-weight: 700; margin: 28px 0 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-title small { font-family: var(--font); font-size: 14px; font-weight: 700; color: var(--green); letter-spacing: 0; }

/* Explore */
.search-row { display: flex; gap: 12px; margin: 8px 0 16px; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); }
.search input { border: none; outline: none; background: transparent; flex: 1; min-width: 0; font-size: 16px; color: var(--ink); }
.filter-btn { width: 52px; height: 52px; border-radius: 14px; background: var(--ink); color: var(--bg); border: none; display: inline-flex; align-items: center; justify-content: center; }
.filters { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.feature-card { display: block; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.feature-card:hover { color: var(--ink); }
.feature-banner { position: relative; min-height: 190px; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; color: #FFFBF4; background: var(--accent) center/cover no-repeat; }
.feature-banner.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,26,21,.15), rgba(30,26,21,.7)); }
.feature-banner > * { position: relative; }
.feature-banner h3 { font-size: 34px; font-weight: 800; line-height: 1; max-width: 85%; }
.date-badge { position: absolute; top: 16px; right: 16px; background: var(--surface); color: var(--ink); border-radius: 12px; padding: 6px 12px; text-align: center; }
.date-badge small { display: block; font-family: var(--mono); font-weight: 600; font-size: 12px; }
.date-badge b { font-family: var(--display); font-size: 26px; line-height: 1; }
.feature-body { padding: 16px 20px 18px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.feature-body .title { font-weight: 700; font-size: 18px; }
.price { color: var(--accent); font-weight: 700; text-align: right; }
.price.free { color: var(--green); }
.event-list { display: grid; gap: 12px; }
.event-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center; padding: 10px 16px 10px 10px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.event-row:hover { color: var(--ink); border-color: var(--ink-2); }
.date-tile { width: 72px; height: 72px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #FFFBF4; background: var(--green); }
.date-tile small { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.date-tile b { font-family: var(--display); font-size: 30px; line-height: 1; }
.date-tile.t2 { background: var(--gold); color: var(--ink); } .date-tile.t3 { background: var(--ink); } .date-tile.t4 { background: var(--accent); }
.event-row .cat { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.event-row .title { font-weight: 700; font-size: 17px; line-height: 1.2; }
.event-row .meta { color: var(--muted); font-size: 14px; }

/* Event detail */
.hero { margin: 0 -16px; padding: 20px 16px 26px; background: var(--accent) center/cover no-repeat; color: #FFFBF4; position: relative; min-height: 260px; display: flex; flex-direction: column; }
.hero.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,26,21,.1), rgba(30,26,21,.75)); }
.hero > * { position: relative; }
.hero-actions { display: flex; justify-content: space-between; }
.hero h1 { font-size: 40px; font-weight: 800; line-height: 1; margin-top: 8px; }
.hero .eyebrow { margin-top: auto; padding-top: 60px; }
.info-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; }
.info-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--fill); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.info-row strong { display: block; font-size: 17px; }
.dark-banner { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--ink); color: var(--dark-muted); margin: 12px 0; }
.dark-banner b { color: var(--gold); }
.ticket-option { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px 18px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); }
.ticket-option + .ticket-option { margin-top: 12px; }
.ticket-option[aria-checked="true"] { border-color: var(--ink); }
.ticket-option[disabled] { opacity: .5; cursor: not-allowed; }
.ticket-option .name { font-weight: 700; font-size: 18px; }
.ticket-option .desc { color: var(--muted); font-size: 14px; }
.ticket-option .amount { margin-left: auto; font-family: var(--mono); font-weight: 600; font-size: 17px; white-space: nowrap; }
.radio { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid #B8AC9C; flex-shrink: 0; position: relative; }
[aria-checked="true"] .radio { border-color: var(--accent); background: var(--accent); }
[aria-checked="true"] .radio::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.sticky-buy-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.qty { display: flex; align-items: center; gap: 16px; }
.qty button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--fill); font-size: 22px; }
.qty b { font-size: 20px; min-width: 24px; text-align: center; }
.summary-box { background: var(--fill); border-radius: 16px; padding: 16px 18px; }

/* Tickets */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--fill); border-radius: 16px; padding: 6px; margin-bottom: 18px; }
.tabs button { height: 44px; border: none; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; }
.ticket-card { position: relative; border-radius: 22px; overflow: hidden; background: var(--ink); color: var(--bg); display: block; }
.ticket-card:hover { color: var(--bg); }
.ticket-card.light { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.ticket-card.light:hover { color: var(--ink); }
.ticket-card .body { padding: 18px 24px 16px; }
.ticket-card .perf { border-top: 2px dashed var(--dark-line); margin: 0 24px; position: relative; }
.ticket-card .perf::before, .ticket-card .perf::after { content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); }
.ticket-card .perf::before { left: -36px; } .ticket-card .perf::after { right: -36px; }
.ticket-card .foot { padding: 14px 24px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ticket-card h3 { font-size: 26px; font-weight: 800; line-height: 1.05; }
.ticket-card .ticket-link { display: block; color: inherit; }
.ticket-card .ticket-link:hover { color: inherit; }
.ticket-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.ticket-actions .btn { flex: 1 1 140px; }

/* QR fullscreen */
.qr-page { min-height: 100vh; background: var(--ink); color: var(--bg); padding: 20px 16px 40px; display: flex; flex-direction: column; align-items: center; }
.qr-top { width: 100%; max-width: 480px; display: flex; justify-content: space-between; align-items: center; }
.qr-card { width: min(100%, 320px); background: var(--surface); color: var(--ink); border-radius: 26px; overflow: hidden; margin-top: 24px; text-align: center; }
.qr-card img { width: 100%; padding: 20px 20px 4px; image-rendering: pixelated; }
.transfer-box { width: min(100%, 420px); margin-top: 18px; padding: 16px; border-radius: 18px; background: var(--dark-2); border: 1px solid var(--dark-line); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; text-align: left; }
.transfer-box .input { background: var(--ink); border-color: var(--dark-line); color: var(--bg); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--dark-2); font-weight: 700; }

/* Live hub */
.hub-grid { display: grid; gap: 14px; }
.hub-tile { border-radius: 22px; padding: 22px; color: #FFFBF4; display: flex; flex-direction: column; gap: 6px; min-height: 150px; justify-content: flex-end; }
.hub-tile:hover { color: #FFFBF4; }
.hub-tile h3 { font-size: 28px; font-weight: 800; }
.hub-tile.red { background: var(--accent); min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px; }
.hub-tile.green { background: var(--green); }
.hub-tile.gold { background: var(--gold); color: var(--ink); }
.hub-tile.gold:hover { color: var(--ink); }
.notice-ok { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 18px; background: var(--green-soft); color: var(--green-ink); font-weight: 700; }

/* People / Digital Room */
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.person-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.person-card:hover { color: var(--ink); border-color: var(--ink-2); }
.person-card .avatar { width: 56px; height: 56px; font-size: 20px; margin-bottom: 8px; }
.person-card .name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.person-card .role { color: var(--muted); font-size: 14px; line-height: 1.3; }
.person-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.match-pill { position: absolute; top: 18px; right: 14px; padding: 3px 10px; border-radius: 999px; background: var(--green); color: #FFFBF4; font-family: var(--mono); font-size: 12px; font-weight: 600; }

/* AI matches */
.matches-page { margin: -8px -16px 0; padding: 20px 16px 40px; background: var(--green); color: var(--bg); min-height: calc(100vh - 70px); }
.matches-page h1 { font-size: 40px; font-weight: 800; line-height: 1.05; }
.matches-page h1 span { color: var(--gold); }
.match-card { background: var(--surface); color: var(--ink); border-radius: 24px; padding: 18px 20px; display: grid; grid-template-columns: 28px 1fr; gap: 6px 14px; }
.match-card .rank { font-family: var(--display); font-size: 34px; font-weight: 800; color: #B8AC9C; line-height: 1; padding-top: 6px; }
.match-card .score { font-family: var(--mono); color: var(--green); font-weight: 700; }

/* Assistant chat */
.chat { display: flex; flex-direction: column; gap: 14px; padding-bottom: 12px; }
.bubble { max-width: 88%; padding: 14px 18px; border-radius: 20px; white-space: pre-wrap; line-height: 1.5; }
.bubble.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.err { align-self: flex-start; background: var(--accent-soft); color: var(--accent-ink); }
.composer { position: sticky; bottom: 80px; display: flex; gap: 10px; padding: 12px 0; background: var(--bg); }
.composer .input { border-radius: 999px; }
.send-btn { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); border: none; color: #FFFBF4; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions button { padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--green); background: transparent; color: var(--green); font-weight: 700; }

/* Q&A */
.q-card { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.q-card + .q-card { margin-top: 12px; }
.vote { width: 64px; min-height: 72px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 700; font-size: 16px; }
.vote[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #FFFBF4; }
.vote:disabled { cursor: default; }
.q-text { font-size: 17px; line-height: 1.4; }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 8px; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 18px; margin: 16px 0 20px; }
.profile-head .avatar { width: 76px; height: 76px; font-size: 28px; }
.progress { height: 10px; border-radius: 999px; background: var(--fill); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.progress.dark { background: var(--dark-line); } .progress.dark > i { background: var(--gold); }
.menu-list { border-radius: 20px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.menu-list a, .menu-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 18px 20px; font-size: 17px; font-weight: 700;
  color: var(--ink); background: none; border: none; border-top: 1px solid var(--line-2); text-align: left; }
.menu-list > :first-child { border-top: none; }
.photo-pick { display: flex; align-items: center; gap: 16px; }
.photo-circle { width: 76px; height: 76px; border-radius: 50%; border: 2px dashed #B8AC9C; display: flex; align-items: center; justify-content: center; background: var(--surface); overflow: hidden; color: var(--muted); }
.photo-circle img { width: 100%; height: 100%; object-fit: cover; }

/* Auth (bare layout) */
.bare-main { max-width: 480px; margin: 0 auto; padding: 24px 20px 48px; }
.auth-title { font-size: 40px; font-weight: 800; line-height: 1.05; margin: 20px 0 8px; }
.welcome { min-height: 100vh; background: var(--ink); color: var(--bg); display: flex; flex-direction: column; }
.welcome-inner { width: 100%; max-width: 1120px; margin: 0 auto; padding: 32px 20px; flex: 1; display: grid; gap: 32px; align-content: center; }
.welcome h1 { font-size: clamp(44px, 9vw, 76px); font-weight: 800; line-height: .98; }
.welcome h1 span { color: var(--gold); }
.welcome .lead { color: var(--dark-muted); font-size: 18px; max-width: 520px; }
.match-teaser { border: 1px solid var(--dark-line); background: var(--dark-2); border-radius: 22px; padding: 20px; display: grid; gap: 14px; max-width: 520px; }
.welcome-cta { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; display: grid; gap: 12px; }

/* ═════════════ Organizer dashboard shell ═════════════ */
.dash { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--ink); color: var(--bg); padding: 28px 18px; display: none; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--dark-muted); font-size: 15px; display: flex; align-items: center; gap: 12px; }
.side-nav a:hover { color: #fff; }
.side-nav a[aria-current="page"] { background: var(--bg); color: var(--ink); font-weight: 600; }
.side-nav .count { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #FFFBF4; font-size: 12px; font-weight: 700; }
.side-user { padding: 12px; border-radius: 12px; background: var(--dark-2); display: flex; align-items: center; gap: 10px; }
.side-user .avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 14px; background: var(--green); }
.dash-topbar { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--bg); padding: 10px 16px; display: flex; flex-direction: column; gap: 10px; }
.dash-topbar .row { display: flex; align-items: center; justify-content: space-between; }
.dash-topbar nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.dash-topbar nav a { padding: 8px 12px; border-radius: 10px; color: var(--dark-muted); white-space: nowrap; font-size: 14px; }
.dash-topbar nav a[aria-current="page"] { background: var(--bg); color: var(--ink); font-weight: 600; }
.dash-main { flex: 1; min-width: 0; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 22px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.dash-head .titles { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 2px; }
.dash-head h1 { font-size: 32px; font-weight: 800; line-height: 1.1; }
.dash-head .crumb { font-size: 14px; color: var(--muted); }
.dash-head .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dash-search { width: 280px; max-width: 100%; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--muted); }
.dash-search input { border: none; background: transparent; outline: none; font-size: 14px; flex: 1; min-width: 0; color: var(--ink); }
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker label { font-size: 13px; font-weight: 700; color: var(--muted); }
.picker select { height: 44px; min-width: 240px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat b small { font-size: 16px; color: var(--muted); font-weight: 700; }
.stat.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.stat.dark span { color: var(--dark-muted); }
.live-panel { border-radius: 20px; background: var(--ink); color: var(--bg); overflow: hidden; }
.live-panel .grid { padding: 24px 28px; display: grid; gap: 24px; align-items: center; }
.live-panel .label { font-size: 13px; color: var(--dark-muted); }
.live-panel .big { font-family: var(--display); font-size: 34px; font-weight: 800; }
.happening { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #F0A58A; letter-spacing: .06em; }
.panel { padding: 22px 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 20px; font-weight: 700; }
.grid-2 { display: grid; gap: 16px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; letter-spacing: .04em; font-weight: 600; padding: 0 12px 10px 0; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 14px 12px 14px 0; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table.boxed { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
.table.boxed th { background: var(--fill); padding: 16px 12px 14px 28px; color: var(--ink-2); }
.table.boxed td { padding: 14px 12px 14px 28px; }
.table .who { display: flex; gap: 12px; align-items: center; }
.table .sub { display: block; color: var(--muted); font-size: 13px; }
.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg button { height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 700; }
.check-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); font-weight: 700; font-size: 13px; }
.bars { display: flex; flex-direction: column; gap: 14px; }
.hbar { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; font-size: 14px; }
.hbar .track { height: 28px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--accent); }
.hbar.brown .track i { background: var(--brown); }
.funnel-row { display: flex; flex-direction: column; gap: 6px; }
.funnel-row .top { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; }
.funnel-row .top span { font-family: var(--mono); font-weight: 500; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .bar { transition: opacity .15s; } .chart .bar:hover { opacity: .8; }

/* Event form */
.fieldset { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 22px 24px 24px; margin: 0; min-width: 0; }
.fieldset legend { font-family: var(--display); font-size: 20px; font-weight: 700; padding: 0 8px; margin-left: -8px; }
.fieldset .input, .fieldset .select, .fieldset .textarea { background: var(--input); }
.tt-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 12px; align-items: start; }
.tt-row + .tt-row { margin-top: 12px; }
.tt-row .input { min-height: 46px; }
.tt-desc { grid-column: 1 / 4; }
.upload-zone { border: 2px dashed #B8AC9C; border-radius: 14px; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); background: var(--bg) center/cover no-repeat; cursor: pointer; text-align: center; padding: 12px; }
.upload-zone.has-img { border-style: solid; color: transparent; }
.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: center; list-style: none; }
.checklist .bad { color: #F0A58A; }
.preview-card { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.preview-card .top { background: var(--green) center/cover no-repeat; color: #FFFBF4; padding: 14px 16px; min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; }
.preview-card .top h3 { font-size: 24px; font-weight: 800; line-height: 1.05; }

/* Q&A moderation */
.mod-card { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 20px 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.mod-card .vote { width: 56px; min-height: 64px; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.screen-panel { border-radius: 20px; background: var(--ink); color: var(--bg); overflow: hidden; }
.screen-panel .inner { padding: 22px 26px; display: flex; flex-direction: column; gap: 12px; }
.screen-panel h3 { font-size: 26px; font-weight: 800; line-height: 1.15; }

/* Scanner */
.scan-wrap { display: grid; gap: 16px; }
.scanner { position: relative; background: #141210; border-radius: 22px; overflow: hidden; aspect-ratio: 1; max-width: 480px; width: 100%; color: var(--dark-muted); display: flex; align-items: center; justify-content: center; }
.scanner video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-result { border-radius: 22px; padding: 22px; color: #FFFBF4; display: flex; flex-direction: column; gap: 14px; }
.scan-result.valid { background: var(--green); }
.scan-result.used { background: var(--accent); }
.scan-result.invalid { background: var(--danger); }
.scan-result h3 { font-size: 30px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.scan-person { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.1); }

/* ═════════════ Hall screen (projector) ═════════════ */
.hall-body { background: var(--ink); }
.hall-body.hide-cursor, .hall-body.hide-cursor * { cursor: none !important; }
.hall { min-height: 100vh; display: flex; flex-direction: column; background: var(--ink); color: var(--bg); }
.hall-top { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 3vh 4vw; }
.hall-top .brand { font-size: clamp(18px, 1.8vw, 30px); }
.hall-event { font-family: var(--mono); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-size: clamp(13px, 1.3vw, 22px); text-align: right; }
.hall-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 2vh 7vw 4vh; transition: opacity .25s ease; }
.hall-main.fade { opacity: 0; }
.hall-label { font-family: var(--mono); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #F0A58A; font-size: clamp(14px, 1.4vw, 24px); margin-bottom: 2.5vh; }
.hall-question { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.12; font-size: clamp(34px, 5.2vw, 104px); color: #FFFBF4; }
.hall-question.hall-idle { color: var(--dark-muted); }
.hall-meta { margin-top: 3vh; color: var(--dark-muted); font-size: clamp(16px, 1.7vw, 30px); }
.hall-foot { padding: 2.5vh 4vw 4vh; color: var(--dark-muted); font-size: clamp(14px, 1.4vw, 24px); border-top: 1px solid var(--dark-line); }
.hall-foot b { color: var(--bg); }
.hall-fullscreen { position: fixed; right: 24px; bottom: 24px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--dark-line); background: var(--dark-2); color: var(--dark-muted); font-size: 14px; }

/* ═════════════ Responsive ═════════════ */
@media (min-width: 640px) {
  .people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 860px) {
  .top-nav { display: flex; }
  .tabbar { display: none; }
  .app-main { padding: 8px 24px 64px; }
  .composer { bottom: 0; }
  .hero { margin: 0; border-radius: 24px; padding: 24px 32px 32px; min-height: 320px; }
  .hero h1 { font-size: 56px; }
  .detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
  .detail-layout .buy-col { position: sticky; top: 90px; }
  .sticky-buy.mobile-only { display: none; }
  .explore-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .people-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hub-grid { grid-template-columns: 1fr 1fr; }
  .hub-grid .span-2 { grid-column: span 2; }
  .matches-page { margin: 0; border-radius: 28px; padding: 32px; }
  .match-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .match-list .match-card + .match-card { margin-top: 0; }
  .welcome-inner { grid-template-columns: 1.2fr 1fr; align-items: end; }
  .welcome-cta { grid-template-columns: 280px 280px; }
  #toasts { bottom: 32px; }
}
@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .dash { background: linear-gradient(to right, var(--ink) 248px, var(--bg) 248px); }
  .dash-topbar { display: none; }
  .dash-main { padding: 32px 40px 48px; }
  .grid-2 { grid-template-columns: 1.4fr 1fr; }
  .grid-2.even { grid-template-columns: 1fr 1fr; }
  .live-panel .grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
  .form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
  .form-layout .side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 20px; }
  .qa-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
  .scan-wrap { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 1023px) {
  .form-layout .side, .qa-layout aside { display: grid; gap: 16px; margin-top: 20px; }
}
@media (max-width: 639px) {
  .row-4 { grid-template-columns: 1fr 1fr; }
  .tt-row { grid-template-columns: 1fr 1fr 44px; }
  .tt-row .tt-name { grid-column: 1 / 3; }
  .tt-desc { grid-column: 1 / 3; }
  .page-title { font-size: 30px; }
  .hbar { grid-template-columns: 80px 1fr auto; }
  .dash-head h1 { font-size: 26px; }
  .table.boxed th, .table.boxed td { padding-left: 14px; }
}
