:root {
  --navy: #0b2545;
  --navy-deep: #07192f;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --cyan: #22d3ee;
  --gold: #f5b942;
  --coral: #ff6b4a;
  --ink: #142033;
  --muted: #5b6b7f;
  --line: #dbe4f0;
  --bg: #f4f7fb;
  --card: #ffffff;
  --shadow: 0 12px 30px rgba(11, 37, 69, 0.08);
  --radius: 20px;
  --font: "Segoe UI", "Trebuchet MS", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; }

a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--navy); }

.public-body {
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(34, 211, 238, 0.18), transparent 50%),
    radial-gradient(900px 320px at 100% 0%, rgba(13, 148, 136, 0.16), transparent 46%),
    var(--bg);
}

.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-header {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy) 58%, #135e6b);
  color: #fff;
  padding: calc(1.15rem + env(safe-area-inset-top, 0px)) 0 1.3rem;
}

.public-header-inner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  min-width: 0;
}

.public-brand:hover { color: inherit; }

.event-logo,
.fallback-mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 6px;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--cyan);
}

.event-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.public-main {
  flex: 1;
  padding: 1.25rem 0 2.5rem;
}

.public-footer {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1rem 0 calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.hero {
  margin-bottom: 1.25rem;
}

.hero.compact { margin-bottom: 1rem; }

.hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 0.4rem;
  line-height: 1.25;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.hero-kicker {
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.hero h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero-copy, .subtle {
  color: var(--muted);
  margin-bottom: 0;
}

.track-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
}

.track-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.2;
  box-shadow: var(--shadow);
}

.track-chip:hover,
.track-chip:focus-visible {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.track-chip.is-active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.track-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: rgba(13, 148, 136, 0.12);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  margin-bottom: 0.4rem;
}

.selected-session .track-badge {
  margin: 0.35rem 0 0;
  align-self: flex-start;
}

.category-grid, .session-list {
  display: grid;
  gap: 1rem;
}

.category-card, .session-card, .question-card, .thank-you-card, .empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.category-card, .session-card {
  display: block;
  padding: 1.2rem 1.15rem;
  color: inherit;
  min-height: 148px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.category-card:hover, .session-card:hover,
.category-card:focus-visible, .session-card:focus-visible {
  transform: translateY(-2px);
  border-color: #b7e4df;
  color: inherit;
  box-shadow: 0 16px 32px rgba(11, 37, 69, 0.12);
}

.category-index {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 0.45rem;
}

.category-card h3, .session-card h3 {
  font-size: 1.12rem;
  margin-bottom: 0.4rem;
}

.category-card p, .session-card p {
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.category-cta {
  color: var(--teal-dark);
  font-weight: 700;
}

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  gap: 1rem;
}

.session-card .speaker { margin: 0; font-weight: 600; color: var(--navy); }
.session-card .when { margin: 0.2rem 0 0; font-size: 0.9rem; }
.chevron { font-size: 1.4rem; color: var(--teal); }

.selected-session {
  margin-top: 0.9rem;
  background: rgba(13, 148, 136, 0.1);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
}

.question-card {
  padding: 1rem;
  margin-bottom: 0.9rem;
}

fieldset.question-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-inline-size: 0;
  box-sizing: border-box;
}

.question-header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  background: var(--bg);
}

.question-text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.q-num {
  display: inline-flex;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  margin: 0.1rem 0 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

fieldset.question-card .rating-grid {
  padding: 0.9rem 1rem 1rem;
  background: #fff;
}

.rating-option, .btn-eval, .category-card, .session-card {
  touch-action: manipulation;
}

.rating-option {
  margin: 0;
  cursor: pointer;
  display: block;
  position: relative;
  min-width: 0;
}

.question-card.needs-rating {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.rating-option input { position: absolute; opacity: 0; pointer-events: none; }

.rating-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 72px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #fff;
  padding: 0.4rem 0.15rem;
  text-align: center;
}

.rating-value {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.rating-label {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.28rem;
  line-height: 1.15;
}

.rating-label-short { display: none; }

.rating-option input:focus-visible + .rating-face {
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
}

.rating-1 input:checked + .rating-face { border-color: #ef4444; background: #fef2f2; color: #b91c1c; }
.rating-2 input:checked + .rating-face { border-color: #f97316; background: #fff7ed; color: #c2410c; }
.rating-3 input:checked + .rating-face { border-color: #f5b942; background: #fffbeb; color: #a16207; }
.rating-4 input:checked + .rating-face { border-color: #14b8a6; background: #f0fdfa; color: #0f766e; }
.rating-5 input:checked + .rating-face { border-color: #0d9488; background: #ccfbf1; color: #115e59; }

.comments-box { min-height: 110px; border-radius: 14px; font-size: 16px; }
.comment-count { text-align: right; color: var(--muted); font-size: 0.8rem; margin-top: 0.35rem; }
.eval-progress { color: var(--muted); font-size: 0.9rem; margin: 0.75rem 0 0; }
.eval-actions {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0 calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 70%, rgba(244, 247, 251, 0));
  z-index: 2;
}

.btn-eval {
  --bs-btn-bg: var(--teal);
  --bs-btn-border-color: var(--teal);
  --bs-btn-hover-bg: var(--teal-dark);
  --bs-btn-hover-border-color: var(--teal-dark);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-padding-y: 0.8rem;
  --bs-btn-padding-x: 1.2rem;
  --bs-btn-font-weight: 700;
  --bs-btn-border-radius: 14px;
}

.back-link { margin-top: 1rem; text-align: center; }

.thank-you-card {
  text-align: center;
  padding: 2rem 1.25rem;
}

.check-circle {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ccfbf1;
  color: var(--teal-dark);
  font-size: 2rem;
}

.empty-state { padding: 1.5rem; text-align: center; color: var(--muted); }

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, var(--navy-deep), #104b5a);
}

.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 24px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

.auth-brand { text-align: center; margin-bottom: 1.2rem; }
.auth-brand h1 { margin: 0.4rem 0 0; }
.auth-brand p { color: var(--muted); }
.brand-mark { width: 48px; height: 48px; }
.auth-brand .brand-mark { width: 56px; height: 56px; margin: 0 auto; display: block; }

.admin-body { background: #eef3f8; }
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 250px;
  background: linear-gradient(180deg, var(--navy-deep), var(--navy));
  color: #fff;
  padding: 1.2rem 1rem;
  display: none;
  flex-direction: column;
}

.brand { display: flex; gap: 0.7rem; align-items: center; margin-bottom: 1.4rem; }
.brand span { display: block; color: #9fb3c8; font-size: 0.8rem; }

.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.admin-nav .nav-link, .admin-offcanvas .nav-link {
  color: #d5e4f2;
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}
.admin-nav .nav-link.active, .admin-offcanvas .nav-link.active {
  background: rgba(34, 211, 238, 0.16);
  color: #fff;
}
.sidebar-footer { display: grid; gap: 0.7rem; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.admin-topbar h1 { font-size: 1.15rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user {
  background: #f0fdfa;
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-weight: 600;
}
.admin-content { padding: 1.1rem; }
.admin-offcanvas { background: var(--navy); color: #fff; }

.panel {
  background: #fff;
  border-radius: 18px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.panel-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
}

.filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  flex: 1 1 14rem;
  min-width: 0;
}

.filter-actions {
  display: flex;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.filter-actions .btn {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  padding: 0.55rem 1rem;
}

.panel-toolbar .btn-eval,
.filter-actions .btn-eval {
  width: auto;
}

.eval-form .btn-eval,
.thank-you-card .btn-eval,
.auth-form .btn-eval {
  width: 100%;
}

.reco-grid {
  display: grid;
  gap: 0.75rem;
}

.reco-card {
  border-radius: 14px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.reco-card strong { display: block; margin-bottom: 0.25rem; }
.reco-card p { margin: 0; color: var(--muted); }
.reco-card.good { background: #f0fdfa; border-color: #99f6e4; }
.reco-card.warn { background: #fff7ed; border-color: #fed7aa; }
.reco-card.info { background: #eff6ff; border-color: #bfdbfe; }

@media (min-width: 768px) {
  .reco-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: #fff;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.stat-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
  .stat-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.order-controls { display: flex; gap: 0.25rem; }
.stat-card span { color: var(--muted); font-size: 0.85rem; display: block; }
.stat-card strong { font-size: 1.7rem; }

.logo-preview { height: 72px; border-radius: 12px; background: #f8fafc; padding: 6px; }
.answer-row, .question-insight, .comment-card.inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.answer-row:last-child, .question-insight:last-child { border-bottom: 0; }
.question-insight { display: block; }
.question-insight h3 { font-size: 1rem; }
.rating-pill {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.rating-pill.rating-1 { background: #fee2e2; color: #b91c1c; }
.rating-pill.rating-2 { background: #ffedd5; color: #c2410c; }
.rating-pill.rating-3 { background: #fef3c7; color: #a16207; }
.rating-pill.rating-4 { background: #ccfbf1; color: #0f766e; }
.rating-pill.rating-5 { background: #99f6e4; color: #115e59; }

.dist-bars { display: grid; gap: 0.35rem; }
.dist-bars > div { display: grid; grid-template-columns: 20px 1fr 30px; gap: 0.4rem; align-items: center; }
.dist-bars .bar { background: #eef2f6; border-radius: 99px; height: 8px; overflow: hidden; }
.dist-bars .bar span { display: block; height: 100%; background: var(--teal); }

.qr-box { display: flex; justify-content: center; padding: 1rem; }
.qr-box img, .qr-box canvas { width: 260px !important; height: 260px !important; }
.eval-url { font-weight: 700; word-break: break-all; }
.qr-print { display: none; }

@media print {
  body * { visibility: hidden; }
  .qr-print, .qr-print * { visibility: visible; }
  .qr-print {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    text-align: center;
    padding: 2rem;
  }
  .qr-print img, .qr-print canvas { width: 320px !important; height: 320px !important; }
}

@media (min-width: 768px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-title { font-size: 1.7rem; }
  .hero-title { font-size: 1.85rem; }
  .admin-content { padding: 1.4rem 1.6rem; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .eval-form .btn-eval,
  .thank-you-card .btn-eval,
  .auth-form .btn-eval { width: 100%; }
}

@media (min-width: 992px) {
  .admin-sidebar { display: flex; }
  .rating-label { font-size: 0.72rem; }
  .stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .rating-label-full { display: none; }
  .rating-label-short { display: block; }
  .rating-face { min-height: 68px; }
}
