:root {
  --bg: #f5f0e8;
  --surface: #fff;
  --surface2: #faf8f4;
  --text: #2c1e16;
  --text2: #7a6a50;
  --text3: #a89880;
  --border: #e0dcd4;
  --accent: #5a3e1b;
  --primary: #d4a574;
  --primary-dark: #b8864e;
  --danger: #c8401a;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(90,62,27,0.08);
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

/* ─── Layout ─── */
.view { min-height: 100vh; }
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 80px; }

.top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.logo-text { font-size: 16px; font-weight: 700; color: var(--accent); }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text2); }

.btn-back {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--text2);
  transition: all 0.15s;
}
.btn-back:hover { border-color: var(--primary); color: var(--accent); }

.btn-text {
  background: none; border: none; color: var(--text3); font-size: 13px;
  cursor: pointer; text-decoration: underline;
}
.btn-text:hover { color: var(--accent); }

/* ─── Login ─── */
#view-login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, #f5f0e8 0%, #ebe4d8 100%);
}

.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px 32px; width: 100%; max-width: 400px;
  box-shadow: 0 8px 32px rgba(90,62,27,0.1);
  text-align: center;
}

.login-card .logo-text { font-size: 20px; margin-bottom: 8px; }
.login-card h1 { font-size: 24px; color: var(--accent); margin-bottom: 4px; }
.login-card .subtitle { color: var(--text2); font-size: 14px; margin-bottom: 28px; }

.form-group { text-align: left; margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-group input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 16px; background: var(--surface2);
  transition: border-color 0.15s;
}
.form-group input:focus { outline: none; border-color: var(--primary); }

.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row button {
  white-space: nowrap; padding: 0 16px; border: 1px solid var(--primary);
  border-radius: 8px; background: var(--surface); color: var(--primary-dark);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.code-row button:hover { background: var(--primary); color: #fff; }
.code-row button:disabled { opacity: 0.5; cursor: not-allowed; background: var(--surface); color: var(--text3); }

.btn-primary {
  width: 100%; padding: 12px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 8px; transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }

.msg { margin-top: 12px; font-size: 13px; min-height: 20px; }
.msg.error { color: var(--danger); }
.msg.success { color: #4a8c5c; }

/* ─── Events Grid ─── */
h1 { font-size: 22px; color: var(--accent); margin-bottom: 20px; }
h2.section-title { font-size: 18px; color: var(--accent); margin: 24px 0 16px; }

.events-grid {
  display: flex; flex-direction: column; gap: 16px;
}

.event-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow); overflow: hidden;
  width: 100%;
}
.event-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(90,62,27,0.12); border-color: var(--primary); }
.event-cover { overflow: hidden; background: var(--surface2); }
.event-cover img { width: 100%; height: 100%; object-fit: cover; }
.event-card-body { padding: 20px; }

/* Desktop: image left, text right */
@media (min-width: 640px) {
  .event-card { display: flex; }
  .event-cover { width: 280px; min-width: 280px; aspect-ratio: auto; min-height: 180px; }
  .event-card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
}
/* Mobile: image top, text bottom */
@media (max-width: 639px) {
  .event-cover { width: 100%; aspect-ratio: 16/9; }
}
.event-card .event-date { font-size: 12px; color: var(--text3); margin-bottom: 8px; letter-spacing: 0.03em; }
.event-card .event-title { font-size: 18px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.event-card .event-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }
.event-meta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.event-meta-item { font-size: 12px; color: var(--text3); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty-state .hint { font-size: 13px; color: var(--text3); margin-top: 8px; }

/* ─── Home (public) ─── */
.home-hero {
  text-align: center; padding: 36px 20px 28px; margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(212,165,116,0.08) 0%, rgba(184,134,78,0.04) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.home-hero-title {
  font-size: 28px; font-weight: 800; color: var(--accent);
  margin-bottom: 8px; letter-spacing: 0.5px;
}
.home-hero-subtitle {
  font-size: 14px; color: var(--text2); line-height: 1.6;
}

.section-title-upcoming {
  border-left: 4px solid var(--primary); padding-left: 10px;
  margin-top: 32px;
}
.section-title-past {
  border-left: 4px solid var(--text3); padding-left: 10px;
  margin-top: 36px;
}

.status-badge.badge-upcoming {
  background: rgba(212,165,116,0.18); color: var(--primary-dark);
  border-color: var(--primary); margin-left: 6px;
}
.status-badge.badge-past {
  background: var(--surface2); color: var(--text3);
  border-color: var(--border); margin-left: 6px;
}

.event-cta {
  margin: 16px 0 20px; padding: 16px 20px; border-radius: 10px;
  text-align: center; font-size: 14px;
}
.event-cta p { line-height: 1.6; }
.event-cta .hint { font-size: 13px; color: var(--text3); margin-top: 4px; }
.event-cta a { color: var(--primary-dark); font-weight: 600; }
.event-cta-upcoming {
  background: rgba(212,165,116,0.12); border: 1px solid var(--primary);
  color: var(--accent);
}
.event-cta-past {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2);
}

.login-back {
  display: block; font-size: 13px; color: var(--text3);
  text-decoration: none; margin-bottom: 12px; text-align: left;
}
.login-back:hover { color: var(--accent); }

/* ─── Event Detail Hero (cover + info in one card) ─── */
.detail-hero {
  display: flex; gap: 0; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.detail-hero-cover {
  flex: 0 0 42%; max-width: 420px; padding: 16px;
  display: flex; align-items: flex-start;
}
.detail-hero-cover img {
  width: 100%; height: auto; display: block;
  border-radius: 10px; border: 1px solid var(--border);
}
.detail-hero-info {
  flex: 1; min-width: 0; padding: 28px 32px;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.detail-hero-info h1 { margin-bottom: 10px; }
.detail-hero-info .meta {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--text2); margin-bottom: 8px;
}
.detail-hero-info .meta span { display: flex; align-items: center; gap: 2px; }
.detail-hero-info .meta .status-badge { align-self: flex-start; }

.detail-org-list {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.detail-org-row { font-size: 13px; line-height: 1.5; }

.detail-extra-info {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
}
.detail-extra-row { font-size: 13px; line-height: 1.5; display: flex; align-items: center; gap: 4px; }
.detail-extra-row a { color: var(--primary); text-decoration: none; font-size: 13px; }
.detail-extra-row a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .detail-hero { flex-direction: column; }
  .detail-hero-cover { flex: none; max-width: 100%; width: 100%; padding: 12px 12px 0; }
  .detail-hero-info { padding: 20px; }
}

/* ─── Event Detail Cover (standalone fallback) ─── */
.detail-cover {
  border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.detail-cover img { width: 100%; display: block; }

/* ─── Event Detail Header ─── */
.event-detail-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.event-detail-header h1 { margin-bottom: 10px; }
.event-detail-header .meta {
  font-size: 13px; color: var(--text2); display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
}
.status-badge {
  font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text3);
}
.detail-address { font-size: 13px; color: var(--text3); margin-top: 10px; }
.detail-desc { margin-top: 12px; color: var(--text2); font-size: 14px; line-height: 1.7; }

/* Detail Info Grid */
.detail-info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.info-item { font-size: 13px; line-height: 1.5; }
.info-label {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--text3);
  background: var(--surface2); border-radius: 4px; padding: 1px 6px; margin-right: 6px;
  letter-spacing: 0.03em;
}

/* ─── Schedule ─── */
.schedule-section { margin-bottom: 16px; }
.schedule-session {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 10px;
}
.session-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--surface2); border-bottom: 1px solid var(--border);
}
.session-title { font-size: 15px; font-weight: 700; color: var(--accent); }
.session-time { font-size: 12px; color: var(--text3); }
.session-talks { padding: 8px 0; }
.sch-talk {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 20px;
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.sch-talk:last-child { border-bottom: none; }
.sch-order {
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text3); flex-shrink: 0;
}
.sch-speaker { font-weight: 600; color: var(--accent); white-space: nowrap; }
.sch-topic { color: var(--text2); }

.schedule-break {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  font-size: 13px; color: var(--text3); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px;
}
.break-time { font-weight: 600; }
.break-note { font-size: 12px; }

/* ─── Talks with PPT ─── */
.talks-with-ppt {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.talk-ppt-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--border); gap: 12px;
}
.talk-ppt-row:last-child { border-bottom: none; }
.talk-ppt-row:hover { background: var(--surface2); }
.talk-ppt-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.talk-ppt-detail { flex: 1; min-width: 0; }
.talk-ppt-speaker { font-weight: 600; color: var(--accent); font-size: 14px; }
.talk-ppt-topic { font-size: 13px; color: var(--text2); margin-top: 2px; }
.talk-ppt-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.speaker-row-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 1.5px solid var(--border);
}
.talk-ppt-role { font-size: 12px; color: var(--text3); margin-top: 2px; line-height: 1.4; }
.online-tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px; margin-left: 6px;
  background: rgba(59,130,246,0.12); color: #3b82f6;
  border: 1px solid rgba(59,130,246,0.3); vertical-align: middle;
  letter-spacing: 0.5px;
}
.btn-ppt-view, .btn-ppt-download {
  display: inline-block; padding: 5px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600; text-decoration: none;
  transition: all 0.15s; cursor: pointer; white-space: nowrap;
}
.btn-ppt-view {
  background: var(--surface); border: 1px solid var(--primary);
  color: var(--primary-dark, #8a6530);
}
.btn-ppt-view:hover { background: var(--primary); color: #fff; }
.btn-ppt-download {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text2);
}
.btn-ppt-download:hover { border-color: var(--accent); color: var(--accent); }
.ppt-na { font-size: 12px; color: var(--text3); }

@media (max-width: 600px) {
  .talk-ppt-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .talk-ppt-actions { align-self: flex-end; }
}

/* ─── Speakers Section ─── */
.speakers-section { margin-bottom: 16px; }
.speakers-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px;
}
.speaker-detail-card {
  display: flex; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color 0.15s;
}
.speaker-detail-card:hover { border-color: var(--primary); }
.sdc-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.sdc-info { flex: 1; min-width: 0; }
.sdc-name { font-size: 14px; font-weight: 700; color: var(--accent); }
.sdc-role { font-size: 11px; color: var(--text3); margin-top: 2px; line-height: 1.4; }
.sdc-topic { font-size: 12px; color: var(--text2); margin-top: 4px; line-height: 1.4; }

/* Speaker chips */
.speakers-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.speaker-chip {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 14px; font-size: 12px; color: var(--text2);
}

/* ─── PPT Grid ─── */
.ppt-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}

.ppt-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow);
}
.ppt-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.ppt-card .ppt-icon { font-size: 28px; margin-bottom: 8px; }
.ppt-card .ppt-name { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 4px; line-height: 1.4; }
.ppt-card .ppt-speaker { font-size: 12px; color: var(--text3); }
.ppt-card .ppt-type { font-size: 10px; color: var(--text3); background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; display: inline-block; margin-top: 6px; text-transform: uppercase; }

/* ─── PPT Viewer ─── */
.ppt-viewer-view { background: #1a1a1a; }
.ppt-bar { background: #222; border-color: #333; }
.ppt-bar .btn-back { color: #aaa; border-color: #444; }
.ppt-bar .btn-back:hover { color: #fff; border-color: #888; }
.ppt-view-title { color: #ccc; font-size: 14px; font-weight: 600; text-align: center; flex: 1; }

.ppt-container {
  max-width: 1000px; margin: 0 auto; padding: 16px;
  overflow-y: auto; height: calc(100vh - 52px);
}

.ppt-page-wrapper {
  position: relative; margin-bottom: 12px; background: #fff;
  border-radius: 8px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.ppt-page-wrapper canvas { display: block; width: 100%; height: auto; }

/* Watermark overlay */
.watermark-overlay {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  z-index: 10;
}
.watermark-text {
  position: absolute; font-size: 18px; font-weight: 700;
  color: rgba(90, 62, 27, 0.08); white-space: nowrap;
  transform: rotate(-30deg); user-select: none;
  font-family: var(--font);
}

/* ─── Sub-events (inline with talks) ─── */
.sub-events-section { margin-bottom: 16px; }
.sub-event-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.sub-event-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.sub-event-header-left {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.sub-event-tag {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 10px;
  border-radius: 20px; letter-spacing: 0.03em; flex-shrink: 0;
}
.tag-registered { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.tag-unregistered { background: var(--surface2); color: var(--text3); border: 1px solid var(--border); }
.sub-event-title { font-size: 16px; font-weight: 700; color: var(--accent); }
.sub-event-time { font-size: 13px; color: var(--text2); }
.sub-event-desc { font-size: 13px; color: var(--text3); line-height: 1.5; margin-top: 8px; }
.sub-event-hint { font-size: 12px; color: var(--text3); margin-top: 8px; }
.sub-event-talks { padding: 0; }

/* ─── Breadcrumb ─── */
.breadcrumb { margin-bottom: 12px; }
.breadcrumb a {
  font-size: 13px; color: var(--primary-dark); text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--accent); }

/* ─── Global Top Bar (with user widget) ─── */
.global-top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.top-bar-left .logo-text { text-decoration: none; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }

.btn-login-top {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background 0.15s;
}
.btn-login-top:hover { background: var(--primary-dark); }

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px; border-radius: 24px;
  background: var(--surface2); border: 1px solid var(--border);
  text-decoration: none; transition: all 0.15s;
}
.topbar-user:hover { border-color: var(--primary); background: var(--surface); }
.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-avatar .avatar-fallback { color: #fff; font-weight: 700; font-size: 14px; }
.topbar-user-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 110px; }
.topbar-name { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-phone { font-size: 11px; color: var(--text3); white-space: nowrap; }
.topbar-logout {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 12px; font-size: 12px; color: var(--text3);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.topbar-logout:hover { border-color: var(--danger, #c8401a); color: var(--danger, #c8401a); }

.topbar-admin-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); text-decoration: none; font-size: 16px;
  transition: all 0.15s;
}
.topbar-admin-link:hover { border-color: var(--primary); color: var(--accent); }

/* ─── Login (extended) ─── */
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.login-hint { font-size: 12px; color: var(--text3); margin-top: 12px; }

/* ─── Profile ─── */
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.profile-avatar-row {
  display: flex; align-items: center; gap: 18px;
  padding-bottom: 20px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.profile-avatar-wrap {
  position: relative; width: 84px; height: 84px; flex-shrink: 0;
}
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  background: var(--surface2); border: 2px solid var(--border);
  position: relative; z-index: 1;
}
.profile-avatar-fallback {
  position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800;
  border: 2px solid var(--border);
}
.profile-avatar-edit {
  position: absolute; bottom: 0; right: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 2px solid var(--surface);
  cursor: pointer; font-size: 13px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar-edit:hover { background: var(--primary-dark); }
.profile-name-block { flex: 1; min-width: 0; }
.profile-name { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.profile-phone { font-size: 13px; color: var(--text3); }
.profile-form .form-group { margin-bottom: 14px; }
.profile-form textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 16px; background: var(--surface2);
  font-family: inherit; resize: vertical;
}
.profile-form textarea:focus { outline: none; border-color: var(--primary); }

.radio-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.radio-pill, .checkbox-pill {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 10px;
  padding: 10px 16px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface2); cursor: pointer; font-size: 14px;
  transition: all 0.15s; user-select: none; line-height: 1;
}
.radio-pill > input, .checkbox-pill > input {
  width: 16px; height: 16px; margin: 0; cursor: pointer;
  flex-shrink: 0; appearance: auto; vertical-align: middle;
}
.radio-pill > span, .checkbox-pill > span {
  display: inline-block; line-height: 1; vertical-align: middle;
}
.radio-pill:has(input:checked),
.checkbox-pill:has(input:checked) {
  border-color: var(--primary); background: rgba(212,165,116,0.15);
  color: var(--accent); font-weight: 600;
}
.checkbox-col {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface);
}
.checkbox-col .checkbox-pill {
  display: flex !important;
  border: none !important; border-radius: 0 !important;
  background: var(--surface2) !important;
  padding: 11px 14px !important; margin: 0;
  width: auto; justify-content: flex-start; box-sizing: border-box;
  border-bottom: 1px solid var(--border) !important;
  border-right: 1px solid var(--border) !important;
}
.checkbox-col .checkbox-pill:nth-child(2n) { border-right: none !important; }
.checkbox-col .checkbox-pill:last-child { border-bottom: none !important; }
.checkbox-col .checkbox-pill:nth-last-child(2):nth-child(odd) { border-bottom: none !important; }
.checkbox-col .checkbox-pill:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: none !important; }

@media (max-width: 500px) {
  .checkbox-col { grid-template-columns: 1fr; }
  .checkbox-col .checkbox-pill { border-right: none !important; }
}

/* ─── Registration form ─── */
.reg-event-summary { margin: 0 0 20px; }
.reg-event-hero {
  padding: 20px 20px 16px;
  background: linear-gradient(135deg, #f5f0e8 0%, #ebe4d8 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: center; color: var(--accent);
}
.reg-hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #9ACD32, #7FB828);
  color: #fff; padding: 5px 14px; border-radius: 16px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
  border: 2px solid rgba(255,255,255,0.4); margin-bottom: 16px;
}
.reg-hero-tag-icon { width: 1em; height: 1em; }
.reg-hero-logos {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 8px;
}
.reg-hero-logo-name { height: 28px; }
.reg-hero-logo-sm { height: 22px; }
.reg-hero-x { color: rgba(200,230,200,0.3); font-size: 18px; font-weight: 300; }
.reg-hero-main-title {
  font-size: 28px; font-weight: 900; letter-spacing: 3px;
  color: var(--accent); margin-bottom: 10px;
}
.reg-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(212,165,116,0.12); border: 1.5px solid var(--primary);
  padding: 5px 16px; border-radius: 20px; font-size: 14px; font-weight: 700;
  letter-spacing: 2px; color: var(--primary-dark); margin-bottom: 12px;
}
.reg-hero-badge-icon { width: 1.2em; height: 1.2em; border-radius: 3px; }
.reg-hero-slogan {
  font-size: 30px; font-weight: 900; color: var(--accent);
  letter-spacing: 2px; margin-bottom: 4px; max-width: 80%; margin-left: auto; margin-right: auto;
}
.reg-hero-highlight {
  border-bottom: 2px solid var(--primary);
}
.reg-hero-subtitle {
  font-size: 26px; font-weight: 800; letter-spacing: 2px;
  color: var(--primary-dark); margin-bottom: 14px; max-width: 80%; margin-left: auto; margin-right: auto;
}
.reg-hero-info-line {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap;
  font-size: 13px; color: var(--text2); margin-bottom: 12px;
}
.reg-hero-org-line {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.reg-hero-org-item {
  display: inline-flex; align-items: center; gap: 8px;
}
.reg-hero-org-label {
  font-size: 12px; letter-spacing: 2px; color: var(--text3);
  font-weight: 500;
}
.reg-hero-org-logo { height: 24px; }
.reg-hero-org-logo-sm { height: 20px; }
.reg-hero-org-logo-nv { height: 54px; border-radius: 4px; }

@media (max-width: 500px) {
  .reg-event-hero { padding: 20px 16px; }
  .reg-hero-main-title { font-size: 26px; letter-spacing: 2px; }
  .reg-hero-slogan { font-size: 24px; }
  .reg-hero-subtitle { font-size: 21px; }
}
.reg-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.form-hint {
  font-size: 14px; color: var(--text3); margin: -2px 0 8px;
  line-height: 1.6;
}
.req { color: var(--danger); margin-left: 2px; }
.field-tag {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 3px; margin-left: 6px; vertical-align: middle; letter-spacing: 0.5px;
}
.tag-required { background: #e8f0e8; color: #4a8c5c; }
.tag-optional { background: #f0f0f0; color: #999; }
.form-group select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 16px; background: var(--surface2);
  font-family: inherit;
}
.form-group select:focus { outline: none; border-color: var(--primary); }
.form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 16px; background: var(--surface2);
  font-family: inherit; resize: vertical;
}
.form-group textarea:focus { outline: none; border-color: var(--primary); }

/* ─── My Registrations List ─── */
.registrations-list {
  display: flex; flex-direction: column; gap: 12px;
}
.reg-card {
  display: flex; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow);
}
.reg-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.reg-card-cover { width: 140px; flex-shrink: 0; background: var(--surface2); }
.reg-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reg-card-body { flex: 1; min-width: 0; padding: 14px 16px 14px 0; display: flex; flex-direction: column; gap: 6px; }
.reg-card-title { font-size: 16px; font-weight: 700; color: var(--accent); }
.reg-card-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text3); }
.reg-card-footer { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 6px; }

.reg-status-badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
}
.reg-status-pending { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.reg-status-approved { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.reg-status-rejected { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

.reg-ticket-tag {
  font-size: 11px; color: var(--primary-dark); font-family: ui-monospace, monospace;
  padding: 3px 8px; background: rgba(212,165,116,0.12); border-radius: 6px;
}
.reg-summary-link {
  font-size: 12px; color: var(--primary-dark); text-decoration: none;
  padding: 3px 8px; background: var(--surface2); border-radius: 6px;
}
.reg-summary-link:hover { color: var(--accent); }

/* ─── Registration Detail ─── */
.reg-status-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 12px 0 16px;
}
.reg-status-desc { font-size: 13px; color: var(--text2); }

.ticket-card {
  background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%);
  border: 2px dashed var(--primary); border-radius: var(--radius);
  padding: 24px; margin-bottom: 24px;
  position: relative;
}
.ticket-header { font-size: 14px; font-weight: 700; color: var(--accent); letter-spacing: 1px; margin-bottom: 8px; }
.ticket-code {
  font-size: 26px; font-weight: 800; color: var(--accent);
  font-family: ui-monospace, monospace; letter-spacing: 1px;
  margin-bottom: 14px; word-break: break-all;
}
.ticket-meta { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text2); }
.ticket-meta .info-label {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--text3);
  background: rgba(90,62,27,0.06); border-radius: 4px; padding: 1px 6px; margin-right: 4px;
}
.ticket-hint { font-size: 12px; color: var(--text3); margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--primary); }

.reg-event-link {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px;
  padding: 12px 16px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px;
}
.reg-event-link a { color: var(--primary-dark); text-decoration: none; font-size: 13px; }
.reg-event-link a:hover { color: var(--accent); }

.answers-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.answer-row {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.answer-row:last-child { border-bottom: none; }
.answer-label { font-size: 12px; color: var(--text3); margin-bottom: 4px; }
.answer-value { font-size: 14px; color: var(--text); line-height: 1.6; word-break: break-word; }

/* ─── Home (public) ─── */
.home-hero {
  text-align: center; padding: 36px 20px 28px; margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(212,165,116,0.08) 0%, rgba(184,134,78,0.04) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.home-hero-title {
  font-size: 28px; font-weight: 800; color: var(--accent);
  margin-bottom: 8px; letter-spacing: 0.5px;
}
.home-hero-subtitle { font-size: 14px; color: var(--text2); line-height: 1.6; }

.section-title-upcoming { border-left: 4px solid var(--primary); padding-left: 10px; margin-top: 32px; }
.section-title-past { border-left: 4px solid var(--text3); padding-left: 10px; margin-top: 36px; }

.status-badge.badge-not-open {
  background: #e3f2fd; color: #1565c0;
  border-color: #90caf9; margin-left: 6px;
}
.status-badge.badge-closed {
  background: #fff8e1; color: #ef6c00;
  border-color: #ffcc80; margin-left: 6px;
}
.status-badge.badge-live {
  background: #ffebee; color: #c62828;
  border-color: #ef9a9a; margin-left: 6px;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198,40,40,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(198,40,40,0); }
}

/* CTA variants for status states */
.cta-not-open { background: #e3f2fd; border: 1px solid #90caf9; color: #1565c0; }
.cta-closed { background: #fff8e1; border: 1px solid #ffcc80; color: #ef6c00; }
.cta-live { background: #ffebee; border: 1px solid #ef9a9a; color: #c62828; }

/* Form section divider in admin event modal */
.form-section-divider {
  margin: 20px -20px 12px;
  padding: 10px 20px;
  background: var(--surface2, #faf8f4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.5px;
}

.event-cta {
  margin: 16px 0 20px; padding: 18px 20px; border-radius: 10px; text-align: center;
}
.event-cta p { line-height: 1.6; font-size: 15px; }
.event-cta .hint { font-size: 13px; color: var(--text3); margin-top: 4px; }
.event-cta a { color: var(--primary-dark); font-weight: 600; }
.cta-upcoming { background: rgba(212,165,116,0.12); border: 1px solid var(--primary); color: var(--accent); }
.cta-past { background: var(--surface2); border: 1px solid var(--border); color: var(--text2); }
.cta-pending { background: #fff3e0; border: 1px solid #ffcc80; color: #e65100; }
.cta-approved { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
.cta-rejected { background: #ffebee; border: 1px solid #ef9a9a; color: #c62828; }

.login-back {
  display: block; font-size: 13px; color: var(--text3);
  text-decoration: none; margin-bottom: 12px; text-align: left;
}
.login-back:hover { color: var(--accent); }

/* ─── Help Modal (field instruction popup) ─── */
.help-modal-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; margin-left: 8px;
  font-size: 11px; font-weight: 600; color: var(--primary-dark);
  background: rgba(212,165,116,0.12); border: 1px solid var(--primary);
  border-radius: 12px; cursor: pointer; vertical-align: middle;
  transition: all 0.15s;
}
.help-modal-btn:hover { background: var(--primary); color: #fff; }

.help-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.2s;
}
.help-modal-overlay.visible { opacity: 1; }

.help-modal {
  background: var(--surface); border-radius: 16px;
  width: 100%; max-width: 460px; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  overflow: hidden;
}
.help-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.help-modal-header h3 { font-size: 16px; font-weight: 700; color: var(--accent); margin: 0; }
.help-modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; font-size: 16px; color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.help-modal-close:hover { background: var(--border); color: var(--text); }

.help-modal-body {
  padding: 20px; overflow-y: auto; flex: 1;
}
.help-modal-img {
  width: 100%; border-radius: 10px; border: 1px solid var(--border);
  margin-bottom: 16px;
}
.help-steps {
  padding-left: 20px; margin: 0; color: var(--text2);
  font-size: 14px; line-height: 2;
}
.help-steps li { margin-bottom: 4px; }

.help-modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface2);
}
.help-modal-action {
  display: block; text-align: center; text-decoration: none;
  padding: 12px; border-radius: 8px; font-size: 15px;
}

/* ─── Responsive ─── */
@media (max-width: 700px) {
  .container { padding: 16px 12px 60px; }
  /* events-grid now uses flex column, no grid override needed */
  .ppt-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .global-top-bar { padding: 8px 12px; }
  .event-detail-header { padding: 20px; }
  .home-hero-title { font-size: 22px; }
  .home-hero { padding: 24px 16px 20px; }

  .topbar-user-meta { display: none; }
  .topbar-user { padding: 2px; }
  .topbar-avatar { width: 36px; height: 36px; }
  .btn-login-top { padding: 7px 12px; font-size: 12px; }

  .reg-card { flex-direction: column; }
  .reg-card-cover { width: 100%; aspect-ratio: 16/9; }
  .reg-card-body { padding: 14px 16px; }

  .profile-avatar-row { gap: 14px; }
  .profile-avatar, .profile-avatar-wrap { width: 64px; height: 64px; }
  .profile-name { font-size: 18px; }
  .profile-card { padding: 18px; }

  .ticket-code { font-size: 20px; }
  .ticket-card { padding: 18px; }

  .detail-hero { flex-direction: column; }
  .detail-hero-cover { flex: none; max-width: 100%; padding: 12px 12px 0; }
  .detail-hero-info { padding: 18px; }
}
@media (max-width: 600px) {
  .talk-ppt-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .talk-ppt-actions { align-self: flex-end; }
}
