:root {
  /* Palette matched to the official FOSS4G 2026 Hiroshima site (2026.foss4g.org): brand red + charcoal on white. */
  --bg: #f7f8fa;
  --panel: #ffffff;
  --border: #e2e5ea;
  --text: #222222;
  --text-muted: #5f5f5f;
  --accent: #d7000f;
  --accent-grad: linear-gradient(149.59deg, #c10609 4.86%, #f10606 104.98%);
  --accent-contrast: #ffffff;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  flex: none;
}

.topbar-hero {
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 16px 20px;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
  flex: none;
}

.title-block {
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.title {
  font-size: 1rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lang-switch {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 2px 6px rgba(215, 0, 15, 0.35);
}

.topbar-toolbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 10px -6px rgba(15, 23, 42, 0.15);
  padding: 12px 16px 10px;
}

.program-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.program-tab {
  border: none;
  background: transparent;
  padding: 6px 4px;
  margin-bottom: -1px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.program-tab + .program-tab {
  margin-left: 14px;
}

.program-tab:hover {
  color: var(--text);
}

.program-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.day-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.day-tab {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.day-tab:hover {
  border-color: var(--accent);
}

.day-tab.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(215, 0, 15, 0.3);
}

.controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 180px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  fill: var(--text-muted);
  pointer-events: none;
}

.search-input, .track-select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.9rem;
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus, .track-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(215, 0, 15, 0.13);
}

.search-input {
  width: 100%;
  padding-left: 32px;
}

.track-select {
  flex: 0 1 220px;
}

.scroll-area {
  flex: 1;
  min-height: 0;
  /* No top/left padding: this is the scroll container, and sticky children only
     stick to the padding edge — any top/left padding would leave a gutter where
     scrolled-away content could still peek through underneath them. */
  padding: 0 16px 0 0;
  overflow: auto;
}

.timetable {
  padding-bottom: 8px;
}

.ai-footer {
  margin: 4px 0 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.tt-grid {
  display: flex;
  align-items: flex-start;
  min-width: max-content;
}

.tt-rooms-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex: none;
}

.tt-time-col {
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 10;
  width: 64px;
  flex: none;
  box-shadow: 1px 0 0 var(--border);
}

.tt-corner {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
  height: 40px;
}

.tt-time-body {
  position: relative;
  background: var(--bg);
}

.tt-time-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tt-now-time {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  z-index: 1;
}

.tt-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid var(--accent);
  z-index: 2;
  pointer-events: none;
}

.tt-now-line::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.tt-room-col {
  position: relative;
  border-left: 1px solid var(--border);
  width: 280px;
  flex: none;
}

.tt-room-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 40px;
  display: flex;
  align-items: center;
  background: var(--panel);
  border-bottom: 2px solid var(--border);
  border-left: 1px solid var(--border);
  padding: 0 10px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tt-room-body {
  position: relative;
  border-left: 1px solid var(--border);
  background-image: linear-gradient(var(--border) 1px, transparent 1px);
}

.tt-break-band {
  /* A single element spanning the whole .tt-rooms-wrap width, not one per
     room — it just needs to sit above the leftmost room column's own
     border to read as one clean, unbroken strip. */
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 2px 8px 2px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--break-color, var(--text-muted));
  background: var(--break-bg, rgba(15, 23, 42, 0.05));
  border-top: 2px solid var(--break-color, var(--border));
  border-bottom: 2px solid var(--break-color, var(--border));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tt-break-band:hover {
  background: var(--break-bg-hover, rgba(15, 23, 42, 0.09));
}

.tt-event {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 6px;
  border-left: 4px solid var(--accent);
  background: #eef3fe;
  padding: 5px 7px;
  overflow: hidden;
  cursor: pointer;
  font-size: 0.76rem;
  line-height: 1.25;
  z-index: 2;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.tt-event:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 3;
}

.tt-event.is-dimmed {
  opacity: 0.25;
  pointer-events: none;
}

.tt-event.is-jump-target {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  animation: tt-jump-pulse 1.4s ease;
  z-index: 4;
}

.tt-event.is-live {
  box-shadow: 0 0 0 1px rgba(215, 0, 15, 0.25), 0 2px 8px rgba(215, 0, 15, 0.2);
}

.tt-event.is-live .tt-event-time::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 4px;
  vertical-align: middle;
  animation: tt-live-pulse 1.6s ease-in-out infinite;
}

@keyframes tt-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes tt-jump-pulse {
  0% { box-shadow: 0 0 0 8px rgba(215, 0, 15, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(215, 0, 15, 0); }
}

.tt-event-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.tt-event-level {
  font-weight: 700;
}

.tt-event-title {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tt-event-speakers {
  margin-top: 2px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 24, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  background: var(--panel);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  padding: 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.modal-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 6px;
}

.modal-speakers {
  font-size: 0.9rem;
  margin: 0 0 16px;
  font-weight: 600;
}

.modal-body {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.modal-link {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
}

.modal-link:hover { text-decoration: underline; }

.modal-link-calendar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.modal-link-calendar:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(215, 0, 15, 0.06);
}

.modal-link-icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

@media (max-width: 640px) {
  .topbar-hero { padding: 10px 12px; }
  .brand { gap: 10px; }
  .brand-logo { height: 26px; }

  /* Header shows the logo only on mobile — the title/subtitle stay in the
     accessibility tree (for screen readers and the page heading) but are
     visually hidden rather than removed. */
  .title-block {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .lang-switch { padding: 2px; }
  .lang-btn { padding: 5px 11px; font-size: 0.72rem; }

  .topbar-toolbar { padding: 8px 10px; }
  .program-tabs { gap: 2px; margin-bottom: 8px; }
  .program-tab { font-size: 0.76rem; padding: 4px 2px; }
  .program-tab + .program-tab { margin-left: 10px; }

  .day-tabs { gap: 6px; }
  .day-tab { padding: 4px 11px; font-size: 0.76rem; }

  .controls { gap: 6px; margin-top: 8px; }
  .search-wrap { flex: 1 1 auto; min-width: 0; }
  .search-input { padding: 6px 10px 6px 28px; font-size: 0.8rem; }
  .search-icon { width: 13px; height: 13px; left: 8px; }
  .track-select { flex: 1 1 40%; min-width: 0; padding: 6px 8px; font-size: 0.8rem; }

  .scroll-area { padding-right: 8px; }
  .ai-footer { margin: 2px 0 10px; padding-top: 8px; font-size: 0.66rem; }

  /* Claw back width from the time gutter for the room columns on narrow screens. */
  .tt-time-col { width: 42px; }
  .tt-time-label { right: 4px; font-size: 0.64rem; }
  .tt-room-col { width: 210px; }
}
