:root {
    --bg: #0b0f16;
    --panel: #111827;
    --panel-2: #172033;
    --text: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(255,255,255,.12);
    --primary: #7c3aed;
    --primary-2: #a78bfa;
    --danger: #ef4444;
    --success: #22c55e;
    --radius: 22px;
    --shadow: 0 22px 80px rgba(0,0,0,.28);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
button, input, textarea { font: inherit; }
.app-body { min-height: 100vh; background: radial-gradient(circle at top left, rgba(124,58,237,.24), transparent 32rem), var(--bg); }
.public-body { min-height: 100vh; background: #080b10; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; background: rgba(8,11,16,.82); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 900; text-decoration: none; letter-spacing: -.03em; }
.topnav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topnav a, .link-button { color: var(--muted); text-decoration: none; border: 0; background: transparent; padding: 0; cursor: pointer; }
.topnav a:hover, .link-button:hover { color: var(--text); }
.nav-cta { color: var(--text) !important; background: var(--primary); padding: 9px 13px !important; border-radius: 999px; }
.inline-form { display: inline; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 32px auto 80px; }
.alert { padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; border: 1px solid var(--line); }
.alert.success { background: rgba(34,197,94,.12); color: #bbf7d0; }
.alert.error { background: rgba(239,68,68,.12); color: #fecaca; }
.page-head { display: flex; justify-content: space-between; gap: 22px; align-items: flex-start; margin-bottom: 24px; }
.page-head h1, .auth-card h1, .hero h1 { margin: 0; line-height: .96; letter-spacing: -.06em; }
.page-head h1 { font-size: clamp(2rem, 4vw, 4rem); }
.page-head p { color: var(--muted); }
.eyebrow { color: var(--primary-2) !important; font-weight: 800; text-transform: uppercase; font-size: .78rem; letter-spacing: .13em; margin: 0 0 10px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; min-height: 44px; padding: 0 18px; text-decoration: none; cursor: pointer; background: rgba(255,255,255,.06); color: var(--text); font-weight: 800; }
.btn.small { min-height: 36px; padding: 0 13px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.secondary { background: rgba(255,255,255,.06); }
.btn:hover { transform: translateY(-1px); }
.panel, .form-card { background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.035)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel { margin-bottom: 20px; }
.panel h2 { margin-top: 0; }
.grid { display: grid; gap: 18px; margin-bottom: 20px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.metric-card span { color: var(--muted); display: block; margin-bottom: 8px; }
.metric-card strong { font-size: 2rem; }
.split-panel { display: grid; grid-template-columns: 1fr minmax(220px, 320px); gap: 20px; }
.action-list { display: grid; gap: 10px; }
.action-list a { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; background: rgba(255,255,255,.04); }
.auth-card { width: min(980px, calc(100% - 32px)); margin: 70px auto; display: grid; grid-template-columns: 1fr minmax(320px, 440px); gap: 28px; align-items: center; }
.auth-card.compact { width: min(760px, calc(100% - 32px)); grid-template-columns: 1fr; }
.auth-card h1 { font-size: clamp(2.4rem, 7vw, 5.7rem); }
.auth-card p, .hero p, .feature-grid p, .panel p, .muted { color: var(--muted); }
.form-card, .form-grid { display: grid; gap: 16px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; color: #dbeafe; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid var(--line); background: rgba(0,0,0,.28); color: var(--text); border-radius: 14px; padding: 13px 14px; outline: none; }
input:focus, textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px rgba(124,58,237,.18); }
small { color: var(--muted); }
.checkline { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-weight: 500; }
.checkline input, .mini-check input { width: auto; margin-top: 3px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; }
.form-section h2 { margin: 14px 0 0; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-grid-form { display: grid; grid-template-columns: 1fr 1.4fr 110px auto; gap: 12px; align-items: center; }
.row-editor { display: grid; grid-template-columns: 1fr 1.4fr 100px 110px auto; gap: 10px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.event-editor { border-top: 1px solid var(--line); padding: 20px 0 10px; }
.delete-form { margin: 0 0 14px; }
.danger-link { background: transparent; border: 0; color: #fecaca; cursor: pointer; padding: 0; }
.admin-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.admin-row div { display: grid; gap: 4px; }
.admin-row span, .admin-row a { color: var(--muted); font-size: .92rem; }
.admin-row form { display: flex; gap: 10px; align-items: center; }
.landing { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; }
.landing-nav div { display: flex; gap: 14px; align-items: center; }
.landing-nav a { text-decoration: none; }
.hero { min-height: 62vh; display: grid; align-content: center; padding: 70px 0; }
.hero h1 { max-width: 980px; font-size: clamp(3rem, 9vw, 7.8rem); }
.hero p { max-width: 700px; font-size: clamp(1.1rem, 2vw, 1.45rem); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 24px 0 70px; }
.feature-grid article { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: rgba(255,255,255,.05); }
.landing-footer { display: flex; gap: 18px; padding: 30px 0; border-top: 1px solid var(--line); color: var(--muted); }
.landing-footer a { color: var(--muted); text-decoration: none; }
.hub-page { min-height: 100vh; background: radial-gradient(circle at top, color-mix(in srgb, var(--accent) 35%, transparent), transparent 28rem), #080b10; }
.hub-cover { height: 235px; background-size: cover; background-position: center; }
.hub-cover.fallback { background: linear-gradient(135deg, var(--accent), #111827); }
.hub-card { width: min(640px, calc(100% - 28px)); margin: -74px auto 0; background: rgba(15,23,42,.86); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,.16); border-radius: 30px 30px 0 0; padding: 24px 18px 34px; min-height: calc(100vh - 160px); box-shadow: var(--shadow); }
.avatar-wrap { display: flex; justify-content: center; margin-top: -74px; }
.avatar { width: 128px; height: 128px; border-radius: 32px; object-fit: cover; border: 6px solid rgba(15,23,42,.9); background: var(--accent); }
.avatar.placeholder { display: grid; place-items: center; font-size: 4rem; font-weight: 900; color: white; }
.hub-category { color: var(--accent); font-weight: 900; text-align: center; margin: 16px 0 8px; }
.hub-card h1 { text-align: center; font-size: clamp(2.2rem, 8vw, 4.2rem); line-height: .96; letter-spacing: -.06em; margin: 0; }
.hub-bio { text-align: center; color: #cbd5e1; line-height: 1.6; margin: 18px auto 22px; max-width: 540px; }
.contact-row, .social-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0; }
.contact-row a, .social-row a { text-decoration: none; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); border-radius: 999px; padding: 10px 13px; color: #e2e8f0; }
.hub-events { display: grid; gap: 12px; margin: 24px 0; }
.event-card { border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.06); border-radius: 22px; padding: 18px; }
.event-card span { color: var(--accent); font-weight: 900; }
.event-card h2 { margin: 8px 0; letter-spacing: -.03em; }
.event-card p { color: #cbd5e1; line-height: 1.5; }
.event-location { color: #f8fafc !important; font-weight: 700; }
.event-cta { display: inline-flex; margin-top: 8px; text-decoration: none; background: var(--accent); color: white; border-radius: 999px; padding: 10px 14px; font-weight: 900; }
.hub-links { display: grid; gap: 11px; margin: 22px 0; }
.hub-link { display: flex; min-height: 56px; align-items: center; justify-content: center; text-align: center; padding: 14px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--accent) 45%, rgba(255,255,255,.16)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, rgba(255,255,255,.08)), rgba(255,255,255,.05)); text-decoration: none; font-weight: 900; }
.hub-footer { text-align: center; margin-top: 24px; }
.hub-footer a { color: #94a3b8; font-size: .9rem; text-decoration: none; }
.not-found, .legal-page { width: min(820px, calc(100% - 32px)); margin: 70px auto; }
.legal-page { line-height: 1.65; color: #cbd5e1; }
.legal-page h1, .not-found h1 { font-size: clamp(2.3rem, 7vw, 5rem); letter-spacing: -.05em; color: white; }
@media (max-width: 820px) {
    .page-head, .split-panel, .auth-card, .feature-grid, .grid.three, .admin-row { grid-template-columns: 1fr; }
    .page-head { display: grid; }
    .form-grid, .inline-grid-form, .row-editor { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; gap: 12px; flex-direction: column; }
    .shell { width: min(100% - 22px, 1120px); margin-top: 22px; }
    .panel, .form-card { padding: 18px; border-radius: 18px; }
    .hero { padding: 42px 0; }
    .hero h1 { font-size: clamp(2.8rem, 16vw, 5rem); }
    .hub-cover { height: 205px; }
    .hub-card { width: min(100% - 18px, 640px); border-radius: 24px 24px 0 0; }
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px rgba(0,0,0,.28) inset;
    transition: background-color 9999s ease-in-out 0s;
}
input[type="color"] { height: 48px; padding: 7px; cursor: pointer; }
.quick-qr-card { display: grid; gap: 10px; justify-items: center; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.05); padding: 14px; min-width: 160px; }
.quick-qr-card img { width: 118px; height: 118px; border-radius: 14px; background: #fff; padding: 7px; }
.media-picker { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.035); padding: 18px; display: grid; gap: 14px; }
.media-picker h3 { margin: 0; }
.mode-switch { display: flex; gap: 12px; flex-wrap: wrap; }
.mode-switch label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 13px; color: var(--muted); background: rgba(255,255,255,.04); }
.mode-switch input { width: auto; }
.media-mode { display: grid; gap: 8px; }
.is-hidden { display: none !important; }
.media-preview { width: 92px; height: 92px; object-fit: cover; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.06); }
.media-preview.wide { width: min(100%, 320px); height: 118px; border-radius: 18px; }
.usage-panel { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 14%, rgba(255,255,255,.06)), rgba(255,255,255,.035)); }
.hub-page { padding-bottom: 54px; }
.hub-card { padding: 26px 20px 30px; border-radius: 34px; min-height: auto; margin-bottom: 44px; }
.hub-handle { text-align: center; color: color-mix(in srgb, var(--accent) 72%, #fff); font-weight: 900; letter-spacing: .02em; margin: 10px 0 6px; }
.icon-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0; }
.icon-row a, .share-button { width: 48px; height: 48px; border-radius: 16px; border: 1px solid rgba(255,255,255,.15); display: inline-grid; place-items: center; color: #f8fafc; text-decoration: none; background: rgba(255,255,255,.07); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.icon-row a:hover, .share-button:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 60%, rgba(255,255,255,.2)); background: color-mix(in srgb, var(--accent) 20%, rgba(255,255,255,.08)); }
.icon-row svg, .share-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-row .social-icons svg, .share-button svg { stroke-width: 1.85; }
.icon-row span, .share-button span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hub-qr-share { margin: 26px 0 20px; border: 1px solid rgba(255,255,255,.14); border-radius: 24px; background: rgba(255,255,255,.055); padding: 16px; display: grid; gap: 14px; }
.qr-box { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.qr-box img { width: 112px; height: 112px; border-radius: 18px; padding: 8px; background: #fff; }
.qr-box h2 { margin: 0 0 6px; letter-spacing: -.04em; }
.qr-box p { margin: 0; color: #cbd5e1; line-height: 1.45; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.share-button { position: relative; cursor: pointer; appearance: none; }
.share-button.is-done { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.5); }
.join-card { margin: 20px 0; padding: 16px; border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 36%, transparent), rgba(255,255,255,.05)); border: 1px solid color-mix(in srgb, var(--accent) 45%, rgba(255,255,255,.15)); display: grid; justify-items: center; gap: 12px; text-align: center; }
.join-card p { color: #e2e8f0; margin: 0; font-weight: 800; }
.hub-footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; color: #94a3b8; font-size: .88rem; margin-top: 18px; }
.hub-footer-links a { color: #94a3b8; text-decoration: none; }
.hub-footer-links a:hover { color: #f8fafc; }
.landing-footer { flex-wrap: wrap; }
@media (max-width: 560px) {
    .qr-box { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .hub-card h1 { font-size: clamp(2.3rem, 13vw, 3.4rem); }
    .quick-qr-card { width: 100%; }
}
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.compact-metrics { margin-bottom: 10px; }
.clean-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.clean-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: rgba(255,255,255,.04); }
.clean-list span { color: var(--muted); overflow-wrap: anywhere; }
.clean-list strong { color: var(--text); }
.icon-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0; }
.icon-grid a, .share-button { width: 48px; height: 48px; border-radius: 16px; border: 1px solid rgba(255,255,255,.15); display: inline-grid; place-items: center; color: #f8fafc; text-decoration: none; background: rgba(255,255,255,.07); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.icon-grid a:hover, .share-button:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 60%, rgba(255,255,255,.2)); background: color-mix(in srgb, var(--accent) 20%, rgba(255,255,255,.08)); }
.icon-grid svg, .share-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-grid span, .share-button span, .modal-close span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hub-qr-share h2 { color: #fff; }
.share-button { appearance: none; cursor: pointer; }
.share-button.is-done { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.5); }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(3,7,18,.72); backdrop-filter: blur(14px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(520px, 100%); position: relative; border-radius: 28px; border: 1px solid rgba(255,255,255,.16); background: linear-gradient(180deg, #161f34, #0f172a); box-shadow: 0 28px 90px rgba(0,0,0,.44); padding: 28px; color: #f8fafc; }
.modal-card h2 { margin: 0 0 10px; letter-spacing: -.04em; font-size: clamp(1.8rem, 5vw, 2.4rem); }
.modal-card p { color: #cbd5e1; line-height: 1.55; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.07); color: #fff; display: grid; place-items: center; cursor: pointer; }
.modal-close svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.copy-field { width: 100%; margin: 12px 0 16px; }
.modal-share-row { justify-content: flex-start; }
.modal-form { display: grid; gap: 14px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(15,23,42,.96); color: #f8fafc; padding: 12px 18px; box-shadow: 0 16px 50px rgba(0,0,0,.35); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 820px) {
    .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .icon-grid { display: grid; grid-template-columns: repeat(3, 48px); justify-content: center; }
    .modal-card { padding: 24px 18px; border-radius: 24px; }
    .modal-share-row { justify-content: center; }
}
.legal-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 34px; }
.legal-nav div { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.legal-nav a { text-decoration: none; color: var(--muted); }
.legal-nav .brand { color: var(--text); }
.legal-nav a:hover { color: var(--text); }
@media (max-width: 560px) {
    .legal-nav { align-items: flex-start; flex-direction: column; }
    .hub-qr-share .share-row { display: grid; grid-template-columns: repeat(3, 48px); justify-content: center; }
}
