*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: #f1f5f9;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  margin: 0;
  padding: 0;
}

input, textarea {
  user-select: text !important;
  -webkit-user-select: text !important;
}

.app-frame {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  background-color: #ffffff;
  min-height: 100vh;
  position: relative;
}

@media (min-width: 768px) {
  .app-frame {
    border-left: 1px solid #cbd5e1;
    border-right: 1px solid #cbd5e1;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  }
}

/* 1. GÓRNY PASEK */
.top-fixed-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  max-width: 460px;
  margin: 0 auto;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px 6px;
  z-index: 40;
}
.header-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.header-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
}
.header-user {
  border-top: 1px solid #f1f5f9;
  padding-top: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.user-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.user-pwz {
  font-size: 11px;
  color: #64748b;
}
.badge-present {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dot-green {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
}

/* SELEKTOR DNI */
.days-picker {
  display: flex;
  background: #f1f5f9;
  padding: 2px;
  border-radius: 8px;
  gap: 3px;
  border: 1px solid #e2e8f0;
  margin-bottom: 6px;
}
.day-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  text-align: center;
}
.day-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* WYSZUKIWARKA */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 8px;
  padding: 7px 30px 7px 28px;
  font-size: 12px;
  outline: none;
  font-family: inherit;
  color: #0f172a;
  -webkit-appearance: none;
  appearance: none;
}
.search-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.search-icon {
  position: absolute;
  left: 8px;
  font-size: 11px;
  color: #94a3b8;
  pointer-events: none;
}
.search-clear-btn {
  position: absolute;
  right: 6px;
  border: none;
  background: #e2e8f0;
  color: #475569;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2. GŁÓWNY OBSZAR ROBOCZY (ZWIĘKSZONY PADDING-TOP POD POWIĘKSZONE LOGO) */
.main-scroll-body {
  padding-top: 195px;
  padding-bottom: 145px;
  padding-left: 12px;
  padding-right: 12px;
  background: #ffffff;
}

/* BANER INSTALACJI PWA */
.pwa-install-banner {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pwa-install-text {
  font-size: 11px;
  line-height: 1.3;
}
.pwa-install-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

/* SESJE */
.session-slot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
  padding-bottom: 10px;
}

.session-slot::before {
  content: '';
  position: absolute;
  left: 63px;
  top: 14px;
  bottom: -2px;
  width: 2px;
  background-color: #f1f5f9;
  z-index: 1;
}
.session-slot:last-child::before {
  display: none;
}

.time-col {
  width: 52px;
  text-align: right;
  flex-shrink: 0;
  padding-top: 1px;
}
.time-start {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.time-end {
  font-size: 9px;
  color: #94a3b8;
  line-height: 1.2;
}

.t-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  margin-top: 4px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.t-dot.live {
  border-color: #2563eb;
  background: #dbeafe;
}
.t-dot.break {
  border-color: #f59e0b;
  background: #fef3c7;
}

.session-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.card {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 10px;
  padding: 9px 11px;
}
.card.selected {
  background: #ecfdf5;
  border-color: #34d399;
}

.card.break-card {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 7px 10px;
}
.card.break-card .card-title {
  color: #475569;
  font-size: 11.5px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.card-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.card-speaker {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}
.badge-room {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}
.btn-add-plan {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
}
.btn-add-plan.in-plan {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
  font-weight: 800;
}
.badge-break {
  font-size: 9px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 2px 6px;
  border-radius: 4px;
}

/* GŁOSOWANIE & PIN */
.pin-box {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-top: 10px;
}
.pin-input {
  width: 120px;
  font-size: 20px;
  font-family: monospace;
  letter-spacing: 5px;
  font-weight: 800;
  text-align: center;
  padding: 6px;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  background: #ffffff;
}
.btn-primary {
  background: #0f172a;
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
}
.btn-primary:active {
  transform: scale(0.97);
}
.vote-btn {
  width: 100%;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 6px;
}
.vote-btn.selected {
  border-color: #10b981;
  background: #f0fdf4;
}
.vote-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: #dbeafe;
  width: 0%;
  z-index: 1;
  transition: width 0.3s ease;
}
.vote-badge-letter {
  width: 22px;
  height: 22px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 11px;
  margin-right: 8px;
}

/* Q&A */
.qa-box {
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  margin-top: 10px;
}
.qa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.qa-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #0f172a;
}
.qa-speaker-tag {
  font-size: 10px;
  font-weight: 700;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  padding: 2px 6px;
  border-radius: 6px;
}
.qa-item {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.qa-item-text {
  font-size: 11px;
  color: #0f172a;
  line-height: 1.3;
}
.btn-upvote {
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  white-space: nowrap;
}
.btn-upvote.active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

/* 3. DOLNY PASEK ZE SPONSORAMI */
.footer-fixed-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 460px;
  margin: 0 auto;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 6px));
  z-index: 50;
}
.sponsors-box {
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  border-radius: 8px;
  padding: 4px 6px;
  margin-bottom: 6px;
  overflow: hidden;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 24s linear infinite;
  will-change: transform;
  pointer-events: none;
}
@keyframes marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.marquee-track img {
  height: 14px;
  width: auto;
  margin-right: 24px;
  opacity: 0.6;
}

.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px;
}
.nav-item {
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 2px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.nav-item.active {
  background: #eff6ff;
  color: #1e3a8a;
  border-color: #bfdbfe;
}
.nav-item:active {
  transform: scale(0.96);
}

.toast {
  position: fixed;
  bottom: 110px;
  left: 20px;
  right: 20px;
  max-width: 420px;
  margin: 0 auto;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: center;
  z-index: 70;
}

.hidden { display: none !important; }

/* Wyróżnienie całej aktywnej karty sesji */
.card.is-live {
  border: 1.5px solid #2563eb !important;
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12) !important;
  position: relative;
}

/* Wskaźnik i kropka czasu na osi */
.session-slot.slot-live .time-start {
  color: #2563eb !important;
  font-weight: 800;
}

.t-dot.live {
  background: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Badge statusu */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #2563eb;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 8px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background-color: #60a5fa;
  border-radius: 50%;
  animation: pulse-live 1.4s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Styl interaktywnej karty */
.card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Modal Szczegółów */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
  position: relative;
  background: #ffffff;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 24px;
  overflow-y: auto;
  z-index: 1001;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Zawartość modala */
.modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.modal-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 12px;
}

.modal-speaker-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.modal-speaker-name {
  font-weight: 600;
  font-size: 13.5px;
  color: #1e293b;
}

.modal-desc {
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}