:root {
    --bg: #f8f8fc;
    --text: #151531;
    --muted: #6f7493;
    --white: #ffffff;
    --line: rgba(96, 69, 184, 0.14);
    --shadow: 0 20px 55px rgba(29, 46, 89, 0.12);
    --radius: 24px;
    --event-primary: #1d2e59;
    --event-accent: #b83cb5;
    --event-gradient: linear-gradient(135deg, #0057a8 0%, #6045b8 55%, #b83cb5 100%);
    --event-on-gradient: #ffffff;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Manrope', sans-serif; color: var(--text); background: radial-gradient(circle at top, rgba(184, 60, 181, 0.08), transparent 28%), var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
input, textarea, select { width: 100%; border: 1px solid #dde1f0; border-radius: 18px; padding: 14px 16px; background: #fff; color: var(--text); }
textarea { resize: vertical; }
select[multiple] { min-height: 172px; padding-top: 10px; padding-bottom: 10px; }
label span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.92rem; font-weight: 700; }
code { background: rgba(29, 46, 89, 0.08); padding: 2px 6px; border-radius: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 18px; padding: 14px 20px; cursor: pointer; font-weight: 800; }
.btn-primary { color: var(--event-on-gradient); background: var(--event-gradient); box-shadow: 0 18px 30px rgba(96, 69, 184, 0.22); }
.btn-secondary { color: var(--text); background: rgba(29, 46, 89, 0.07); }
.text-link { color: #4158c7; font-weight: 700; }
.brand-pill, .pill-soft, .status-badge, .mini-label { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 14px; font-size: 0.84rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.brand-pill, .pill-soft { background: rgba(184, 60, 181, 0.10); color: #7c58ba; }
.pill-soft.live i { font-size: 0.6rem; }
.status-badge, .mini-label { background: rgba(0, 87, 168, 0.08); color: #3466ba; }
.alert { padding: 14px 18px; border-radius: 18px; margin-bottom: 16px; }
.alert.success { background: rgba(52, 186, 97, 0.12); color: #18663b; }
.alert.danger { background: rgba(224, 82, 92, 0.12); color: #8b2331; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 18px; }
.action-bar, .panel-head, .card-header-between, .hero-topline, .event-card__head, .admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.meta-line, .meta-stack { color: var(--muted); font-size: 0.95rem; }
.meta-stack { display: flex; flex-wrap: wrap; gap: 14px; }
.section-kicker { color: #6c63c7; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px; }

.landing-shell, .subpage-shell { max-width: 1200px; margin: 0 auto; padding: 32px 20px 120px; }
.hero-card, .card, .event-card, .panel-card, .metric-card, .auth-card, .install-card, .install-help { position: relative; background: rgba(255, 255, 255, 0.96); border: 1px solid rgba(96, 69, 184, 0.16); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card, .panel-card, .auth-card, .install-card, .install-help { padding: 28px; }
.hero-card h1 { font-size: clamp(2rem, 5vw, 4rem); margin: 12px 0; max-width: 12ch; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; margin-top: 24px; }
.event-card { overflow: hidden; padding: 24px; }
.event-card { position: relative; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.event-card:hover { transform: translateY(-4px); box-shadow: 0 26px 60px rgba(29, 46, 89, 0.16); }
.event-card__link { position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.event-card > *:not(.event-card__link) { position: relative; z-index: 2; }
.card-glow { position: absolute; inset: auto -20% -20% auto; width: 180px; height: 180px; background: radial-gradient(circle, rgba(184, 60, 181, 0.18), transparent 70%); pointer-events: none; }
.event-card h2, .panel-card h2, .card h2, .auth-card h1, .install-card h1 { margin: 8px 0 12px; }

.public-body { min-height: 100vh; }
.event-app { min-height: 100vh; padding-bottom: 110px; }
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 20px; background: var(--event-gradient); color: var(--event-on-gradient); box-shadow: 0 10px 40px rgba(29, 46, 89, 0.18); }
.app-brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.app-brand img, .brand-fallback { width: 58px; height: 58px; border-radius: 18px; object-fit: cover; background: rgba(255,255,255,0.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.brand-fallback { display: grid; place-items: center; font-weight: 800; }
.app-brand strong { display: block; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-brand span { display: block; opacity: 0.9; font-size: 0.82rem; }
.icon-button { width: 46px; height: 46px; border-radius: 16px; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); color: var(--event-on-gradient); font-size: 1.2rem; }
.event-content { max-width: 1200px; margin: 0 auto; padding: 20px; display: grid; gap: 18px; }
.card { padding: 26px; overflow: hidden; }
.app-hero { background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,248,252,0.96)); }
.now-card { border-color: rgba(184, 60, 181, 0.35); }
.live-hero-card { padding-top: 22px; padding-bottom: 22px; }
.live-hero-card h2 { margin: 10px 0 10px; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.live-hero-card p { margin: 0 0 14px; line-height: 1.7; }
.cta-band { border-radius: 26px; padding: 22px 24px; color: var(--event-on-gradient); background: var(--event-gradient); box-shadow: var(--shadow); }
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile-card { background: rgba(255,255,255,0.95); border: 1px solid rgba(96, 69, 184, 0.18); border-radius: 22px; box-shadow: var(--shadow); padding: 20px 14px; display: grid; gap: 10px; justify-items: center; text-align: center; font-weight: 800; }
.tile-card i { font-size: 1.5rem; color: #644fc4; }
.speaker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.speaker-card, .partner-card, .gallery-card { background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,248,252,0.96)); border: 1px solid rgba(96, 69, 184, 0.14); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.speaker-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 18px; margin-bottom: 14px; }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.partner-grid.compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.list-stack { display: grid; gap: 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; background: rgba(248,248,252,0.8); border: 1px solid rgba(96, 69, 184, 0.12); border-radius: 20px; }
.list-row.tall { align-items: flex-start; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.gallery-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; margin-bottom: 12px; }
.agenda-timeline { display: grid; gap: 16px; }
.agenda-item { display: grid; grid-template-columns: 145px 1fr; gap: 18px; padding: 18px; background: rgba(248,248,252,0.92); border: 1px solid rgba(96, 69, 184, 0.12); border-radius: 22px; }
.agenda-item.current { background: linear-gradient(135deg, rgba(0,87,168,0.08), rgba(184,60,181,0.10)); border-color: rgba(184, 60, 181, 0.28); }
.agenda-time { font-weight: 800; color: var(--event-primary); }
.agenda-type { display: inline-flex; background: rgba(96, 69, 184, 0.10); color: #6c63c7; border-radius: 999px; padding: 6px 10px; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; margin-bottom: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 10px; color: #5260be; font-weight: 800; margin-bottom: 18px; }
.inline-highlight { margin-top: 14px; padding: 14px 16px; border-radius: 18px; background: rgba(0,87,168,0.08); }
.prose-card p { line-height: 1.75; }

.bottom-nav { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(92vw, 680px); display: none; padding: 10px; gap: 10px; border-radius: 28px; background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); box-shadow: 0 14px 38px rgba(29, 46, 89, 0.16); border: 1px solid rgba(96, 69, 184, 0.16); z-index: 18; }
.bottom-nav a { flex: 1; display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: 18px; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.bottom-nav a.active, .bottom-nav a:hover { color: var(--event-on-gradient); background: var(--event-gradient); }
.fab-button { position: fixed; right: 20px; bottom: 102px; width: 68px; height: 68px; border-radius: 24px; display: grid; place-items: center; color: var(--event-on-gradient); background: var(--event-gradient); box-shadow: 0 18px 34px rgba(96, 69, 184, 0.30); z-index: 19; }

.app-drawer { position: fixed; inset: 0 auto 0 0; width: min(86vw, 420px); transform: translateX(-105%); transition: transform 0.25s ease; z-index: 30; }
.app-drawer.open { transform: translateX(0); }
.drawer-card { height: 100%; background: rgba(255,255,255,0.98); padding: 28px; border-radius: 0 34px 34px 0; box-shadow: 0 28px 90px rgba(29, 46, 89, 0.22); }
.drawer-nav { display: grid; gap: 14px; margin-top: 28px; }
.drawer-nav a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; font-weight: 700; }
.drawer-nav a:hover { background: rgba(96, 69, 184, 0.08); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(21, 21, 49, 0.38); opacity: 0; visibility: hidden; transition: 0.25s ease; z-index: 25; }
.drawer-backdrop.open { opacity: 1; visibility: visible; }

.auth-page, .install-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-shell, .install-shell { width: min(1100px, 100%); display: grid; gap: 24px; }
.auth-card { max-width: 480px; margin: 0 auto; }
.demo-box { margin-top: 18px; padding: 14px 16px; border-radius: 18px; background: rgba(0,87,168,0.08); }

.admin-body { min-height: 100vh; background: linear-gradient(180deg, #eef1fb 0%, #f8f8fc 100%); }
.admin-shell { display: grid; grid-template-columns: 320px 1fr; min-height: 100vh; }
.admin-sidebar { padding: 28px; color: #fff; background: linear-gradient(180deg, #1d2e59 0%, #2d3c70 45%, #6045b8 100%); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.admin-sidebar .brand-pill { background: rgba(255,255,255,0.14); color: #fff; }
.admin-sidebar p { color: rgba(255,255,255,0.76); }
.admin-nav { display: grid; gap: 10px; }
.admin-nav a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; color: rgba(255,255,255,0.86); font-weight: 700; }
.admin-nav a.active, .admin-nav a:hover { background: rgba(255,255,255,0.14); color: #fff; }
.admin-main { padding: 28px; }
.admin-topbar { margin-bottom: 22px; }
.admin-search { width: min(360px, 100%); }
.admin-grid.top { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 22px; }
.metric-card { padding: 24px; }
.metric-card span { color: var(--muted); display: block; margin-bottom: 8px; }
.metric-card strong { font-size: 2rem; }
.panel-card { margin-bottom: 22px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 15px 12px; border-bottom: 1px solid #edf0f9; vertical-align: top; text-align: left; }
.action-links { display: flex; flex-wrap: wrap; gap: 12px; }
.action-links a { font-weight: 700; color: #4d59bc; }
.checkbox { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.checkbox input { width: auto; }
.wysiwyg { min-height: 180px; }
.theme-configurator { display: grid; gap: 18px; padding: 24px; border: 1px solid rgba(96, 69, 184, 0.14); border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,246,252,0.95)); }
.module-configurator { display: grid; gap: 18px; padding: 24px; border: 1px solid rgba(96, 69, 184, 0.14); border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,246,252,0.95)); }
.module-config-list { display: grid; gap: 14px; }
.module-config-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr); gap: 16px; padding: 18px; border: 1px solid rgba(96, 69, 184, 0.12); border-radius: 20px; background: rgba(255,255,255,0.95); }
.module-config-meta { display: grid; gap: 8px; }
.module-config-meta strong { display: inline-flex; align-items: center; gap: 10px; }
.module-config-meta p { margin: 0; color: var(--muted); line-height: 1.6; }
.module-config-controls { display: grid; gap: 12px; align-content: center; }
.theme-grid { align-items: end; }
.theme-input { display: grid; gap: 8px; }
.theme-input-row { display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: center; }
.theme-input-row input[type="color"] { width: 78px; height: 52px; padding: 6px; border-radius: 16px; cursor: pointer; }
.theme-input-row input[type="text"] { text-transform: uppercase; }
.theme-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.theme-swatch { display: grid; gap: 10px; border: 1px solid rgba(96, 69, 184, 0.16); border-radius: 18px; padding: 12px; background: #fff; color: var(--text); cursor: pointer; text-align: left; font-weight: 800; box-shadow: 0 10px 20px rgba(29, 46, 89, 0.06); }
.theme-swatch:hover { transform: translateY(-1px); }
.theme-swatch-preview { display: block; height: 52px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.24); box-shadow: inset 0 0 0 1px rgba(21, 21, 49, 0.06); }
.theme-preview-stack { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr); gap: 18px; align-items: start; }
.theme-preview-card, .theme-feedback-card { background: #fff; border: 1px solid rgba(96, 69, 184, 0.14); border-radius: 24px; overflow: hidden; box-shadow: 0 18px 34px rgba(29, 46, 89, 0.08); }
.theme-preview-card { display: grid; }
.theme-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; background: var(--theme-preview-gradient, var(--event-gradient)); color: var(--theme-preview-on-gradient, var(--event-on-gradient)); }
.theme-preview-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.theme-preview-brand strong, .theme-preview-brand span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-preview-brand span { opacity: 0.85; font-size: 0.85rem; }
.theme-preview-logo, .theme-preview-user { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: rgba(255,255,255,0.16); color: inherit; font-weight: 800; }
.theme-preview-user { width: 42px; height: 42px; font-size: 1rem; }
.theme-preview-body { display: grid; gap: 18px; padding: 20px; }
.theme-preview-body h3 { margin: 8px 0 10px; }
.theme-preview-body p { margin: 0; color: var(--muted); }
.theme-preview-cta { display: grid; gap: 6px; padding: 16px 18px; border-radius: 20px; background: var(--theme-preview-gradient, var(--event-gradient)); color: var(--theme-preview-on-gradient, var(--event-on-gradient)); }
.theme-preview-cta span { opacity: 0.92; font-size: 0.92rem; }
.theme-preview-nav { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 20px 20px; }
.theme-preview-nav-item { display: inline-flex; align-items: center; justify-content: center; min-width: 92px; padding: 10px 14px; border-radius: 16px; background: rgba(96, 69, 184, 0.08); color: var(--muted); font-weight: 800; }
.theme-preview-nav-item.is-active { background: var(--theme-preview-gradient, var(--event-gradient)); color: var(--theme-preview-on-gradient, var(--event-on-gradient)); }
.theme-feedback-card { display: grid; gap: 14px; padding: 20px; }
.theme-feedback-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-feedback-card p { margin: 0; color: var(--muted); }
.theme-feedback-card strong { color: var(--text); }
.theme-feedback-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.theme-feedback-badge.is-excellent { background: rgba(31, 167, 95, 0.14); color: #18663b; }
.theme-feedback-badge.is-good { background: rgba(0, 87, 168, 0.12); color: #245da8; }
.theme-feedback-badge.is-fair { background: rgba(219, 146, 23, 0.14); color: #8a5a08; }
.theme-feedback-badge.is-poor { background: rgba(224, 82, 92, 0.14); color: #8b2331; }
.theme-contrast-meter { height: 12px; border-radius: 999px; background: #edf0f9; overflow: hidden; }
.theme-contrast-fill { height: 100%; border-radius: inherit; }
.theme-contrast-fill.is-excellent { background: linear-gradient(90deg, #1fa75f, #54c67f); }
.theme-contrast-fill.is-good { background: linear-gradient(90deg, #2c76db, #5d95e5); }
.theme-contrast-fill.is-fair { background: linear-gradient(90deg, #e0a11f, #edc34c); }
.theme-contrast-fill.is-poor { background: linear-gradient(90deg, #e0525c, #f28a90); }
.theme-feedback-note { font-size: 0.92rem; line-height: 1.6; }
.wysiwyg-shell { display: grid; gap: 12px; }
.wysiwyg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: 1px solid #dde1f0; border-radius: 18px; background: linear-gradient(180deg, #fff, #f7f8fe); }
.wysiwyg-button { border: 1px solid rgba(96, 69, 184, 0.18); border-radius: 14px; padding: 10px 12px; background: #fff; color: var(--text); font-weight: 800; cursor: pointer; box-shadow: 0 8px 18px rgba(29, 46, 89, 0.06); }
.wysiwyg-button:hover { background: rgba(96, 69, 184, 0.08); }
.wysiwyg-editor { min-height: 260px; border: 1px solid #dde1f0; border-radius: 18px; padding: 16px; background: #fff; color: var(--text); line-height: 1.7; overflow-wrap: anywhere; }
.wysiwyg-editor:focus { outline: 2px solid rgba(96, 69, 184, 0.24); outline-offset: 2px; }
.wysiwyg-editor.is-empty::before { content: attr(data-placeholder); color: #97a0bb; }
.wysiwyg-editor p,
.wysiwyg-editor ul,
.wysiwyg-editor ol,
.wysiwyg-editor blockquote,
.wysiwyg-editor h2,
.wysiwyg-editor h3,
.wysiwyg-editor h4 { margin: 0 0 14px; }
.wysiwyg-editor ul,
.wysiwyg-editor ol { padding-left: 22px; }
.wysiwyg-editor blockquote { padding-left: 14px; border-left: 4px solid rgba(96, 69, 184, 0.22); color: #4f5677; }
.wysiwyg-editor a { color: #4158c7; text-decoration: underline; }
.wysiwyg-source { display: none; }

@media (max-width: 960px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { border-radius: 0 0 32px 32px; }
    .grid.two, .tile-grid, .agenda-item { grid-template-columns: 1fr; }
    .admin-topbar, .panel-head, .card-header-between, .hero-topline, .action-bar { flex-direction: column; align-items: flex-start; }
    .module-config-row { grid-template-columns: 1fr; }
    .theme-preview-stack { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .landing-shell, .subpage-shell, .event-content, .admin-main { padding-left: 16px; padding-right: 16px; }
    .hero-card, .panel-card, .auth-card, .install-card, .install-help, .card { padding: 22px; }
    .bottom-nav { display: flex; }
    .theme-input-row { grid-template-columns: 1fr; }
}
