:root {
  color-scheme: light;
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-soft: #eef9fc;
  --text: #17191d;
  --muted: #727984;
  --line: #e8edf2;
  --primary: #44c0df;
  --primary-dark: #1799bd;
  --shadow: 0 14px 36px rgba(23, 25, 29, 0.1);
  --radius: 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101418;
  --surface: #181f25;
  --surface-soft: #142c34;
  --text: #f4f7fa;
  --muted: #a8b2bd;
  --line: #26313a;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { border: 0; border-radius: 999px; background: var(--primary); color: white; padding: 0.75rem 1rem; font-weight: 800; cursor: pointer; }

.app-shell { min-height: 100vh; padding-bottom: 92px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  display: grid;
  grid-template-columns: 44px 1fr 44px 44px;
  align-items: center;
  gap: 0.25rem;
  padding: 0 1rem;
  background: var(--primary);
  color: white;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}
.topbar h1 { margin: 0; text-align: center; font-size: 1.35rem; letter-spacing: 0; }
.icon, .icon-button { display: grid; place-items: center; min-width: 44px; min-height: 44px; color: white; background: transparent; font-size: 2rem; border-radius: 50%; }
.public-main { width: min(100%, 1040px); margin: 0 auto; padding: 1.25rem 1rem 2rem; }

.day-switch { display: flex; gap: 1rem; overflow-x: auto; padding: 0.85rem 0.25rem 1.2rem; scroll-snap-type: x mandatory; }
.day-pill {
  min-width: 10.2rem;
  scroll-snap-align: start;
  padding: 1.1rem 1rem;
  border: 1px solid #dff3f8;
  border-radius: 28px;
  background: var(--surface);
  text-align: center;
  box-shadow: 0 8px 22px rgba(68, 192, 223, 0.1);
}
.day-pill span { display: block; color: var(--text); text-transform: uppercase; font-weight: 900; }
.day-pill strong { display: inline-block; margin-top: 0.8rem; padding: 0.7rem 1rem; border-radius: 999px; background: var(--primary); color: white; }
.day-pill.active { outline: 3px solid rgba(68, 192, 223, 0.22); }

.hero-summary { text-align: center; padding: 0.8rem 0 1.25rem; border-top: 1px solid var(--line); }
.eyebrow { display: inline-block; padding: 0.35rem 0.85rem; background: var(--surface-soft); color: var(--primary-dark); border-radius: 999px; text-transform: uppercase; font-weight: 900; letter-spacing: 0.14em; }
.hero-summary h2 { margin: 0.9rem 0 0.45rem; font-size: clamp(1.8rem, 8vw, 3rem); }
.hero-summary p { margin: 0; color: var(--muted); font-size: 1.08rem; }

.chip-row { display: flex; gap: 0.65rem; overflow-x: auto; padding: 0.4rem 0 0.9rem; }
.chip { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; max-width: 86vw; padding: 0.65rem 1rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 800; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04); }
.chip::before { content: ""; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--badge, var(--primary)); margin-right: 0.45rem; }

.now-next h2, .timeline h2, .presentations h2 { font-size: 1.15rem; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.mini-card { padding: 0.9rem; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); min-height: 88px; }
.mini-card strong { color: var(--primary-dark); display: block; margin-bottom: 0.4rem; }
.mini-card span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.timeline { display: grid; gap: 1rem; }
.program-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  min-height: 132px;
}
.time-col { border-right: 1px solid var(--line); padding-right: 0.75rem; }
.time-col strong { display: block; font-size: 1.05rem; }
.time-col span { color: var(--muted); font-weight: 700; }
.card-main h3 { margin: 0.65rem 0 0.45rem; font-size: 1.08rem; line-height: 1.25; }
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.badge, .type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: white;
  background: var(--badge, var(--primary));
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}
.badge.muted, .type { background: var(--surface-soft); color: var(--primary-dark); }
.meta, .empty { color: var(--muted); margin: 0.25rem 0; }

.detail-card, .presentation-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.detail-card h2 { font-size: 1.65rem; margin: 0.9rem 0 0.5rem; }
.detail-time { color: var(--primary-dark); font-weight: 900; }
.presentation-code { display: inline-flex; padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--surface-soft); color: var(--primary-dark); font-weight: 900; }
.presentation-card h3 { margin: 0.65rem 0 0.4rem; font-size: 1.05rem; }
.presentation-card p { color: var(--muted); margin: 0; }

.search-form { display: grid; grid-template-columns: 1fr auto; gap: 0.65rem; margin-bottom: 1.25rem; }
.search-form input { min-height: 52px; border: 1px solid var(--line); border-radius: 999px; padding: 0 1rem; background: var(--surface); color: var(--text); min-width: 0; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 20;
  width: min(calc(100% - 24px), 720px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 0.45rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.bottom-nav a { display: grid; place-items: center; min-height: 56px; color: var(--muted); font-size: 1.45rem; border-radius: 22px; }
.bottom-nav span { display: block; font-size: 0.72rem; font-weight: 800; }
.bottom-nav a.active { color: var(--primary-dark); background: var(--surface-soft); }

.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.admin-card, .count-card, .create-panel { background: var(--surface); border-radius: 16px; padding: 1rem; box-shadow: var(--shadow); }
.admin-card label, .grid-form label, .inline-form label { display: grid; gap: 0.35rem; font-weight: 800; }
.admin-card input, .admin-card select, .grid-form input, .grid-form select, .grid-form textarea, .inline-form input, .inline-form select, .inline-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; min-height: 42px; padding: 0.55rem; background: var(--surface); color: var(--text); }
.admin-card { display: grid; gap: 0.9rem; width: min(100%, 460px); }
.error { color: #d83a42; font-weight: 900; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; padding: 1rem; background: #17232b; color: white; display: flex; flex-direction: column; gap: 0.45rem; }
.admin-sidebar a, .admin-sidebar button { color: white; background: transparent; text-align: left; padding: 0.7rem; border-radius: 8px; }
.admin-sidebar a:hover, .admin-sidebar button:hover { background: rgba(255, 255, 255, 0.1); }
.admin-main { padding: 1.5rem; min-width: 0; }
.count-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.count-card span { display: block; font-size: 2rem; font-weight: 900; color: var(--primary-dark); }
.admin-heading, .bulk-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.export-form { margin: 0; }
.download-link { color: var(--primary-dark); font-weight: 800; text-decoration: underline; }
.table-wrap { width: 100%; overflow-x: auto; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 980px; }
th, td { padding: 0.7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-soft); }
.grid-form, .inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem; padding-top: 1rem; }
.delete-form { margin-top: 0.5rem; }
.danger { background: #d83a42; }
.check { align-self: end; }

@media (min-width: 760px) {
  .public-main { padding-inline: 1.5rem; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .program-card { grid-template-columns: 86px 1fr; }
}

@media (max-width: 760px) {
  .admin-shell { display: block; }
  .admin-sidebar { position: static; height: auto; }
  .admin-main { padding: 1rem; }
  .topbar { grid-template-columns: 36px 1fr 42px 42px; padding-inline: 0.75rem; }
  .topbar h1 { font-size: 1.12rem; }
  .mini-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .program-card { grid-template-columns: 62px 1fr; padding: 0.85rem; }
  .time-col strong { font-size: 0.95rem; }
}
