/* These styles are generated from project.scss. */

.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

/* Manage-area walkthrough (static/js/tour.js) */
.tour-spotlight {
  position: absolute;
  z-index: 60;
  border-radius: 0.75rem;
  box-shadow: 0 0 0 9999px rgb(15 23 42 / 0.55);
  pointer-events: none;
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.tour-tooltip {
  position: absolute;
  z-index: 61;
  width: min(20rem, calc(100vw - 2rem));
  border-radius: 1rem;
  background: #fff;
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: 0 20px 45px rgb(15 23 42 / 0.35);
}
.tour-tooltip-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  border-radius: 1rem 1rem 0 0;
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}
.tour-count {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
}
.tour-title {
  margin-top: 0.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
}
.tour-body {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #475569;
}
.tour-buttons {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.tour-btn {
  min-height: 2.75rem;
  border-radius: 0.5rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.tour-btn-ghost {
  background: transparent;
  color: #64748b;
}
.tour-btn-ghost:hover {
  background: #f1f5f9;
}
.tour-btn-primary {
  background: #2563eb;
  color: #fff;
}
.tour-btn-primary:hover {
  background: #1d4ed8;
}
.tour-btn:first-child {
  margin-right: auto;
}

/* Flatpickr (vendored) in house colors. The brand-* custom properties
   are per-tenant (SPEC.md §3.1), so a branded show's calendar picks up
   its own accent automatically. */
.flatpickr-calendar {
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px -5px rgb(10 37 64 / 0.15);
  font-family: inherit;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--color-brand-600);
  border-color: var(--color-brand-600);
}
.flatpickr-day:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
  background: var(--color-brand-50);
  border-color: var(--color-brand-50);
}
.flatpickr-day.today {
  border-color: var(--color-brand-400);
}
.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
  background: var(--color-brand-100);
  border-color: var(--color-brand-400);
  color: var(--color-ink-900);
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--color-brand-600);
}
/* The visible alt input is a text input flatpickr manages; readonly
   here means "picker-driven", not "disabled" - keep it looking live. */
.flatpickr-input[readonly] {
  cursor: pointer;
  background-color: #fff;
}

/* ---- The TV board (voting/live_results_tv.html) ----------------------
   Read from twenty feet: type in viewport units, dark room-friendly
   palette, brand accents from the per-tenant custom properties. */
.tv-body {
  background: #060d1f;
  overflow: hidden;
}
.tv-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 3vh 3vw;
  color: #e8edf6;
  background:
    radial-gradient(90rem 50rem at 110% -20%, rgb(20 110 245 / 0.22), transparent 60%),
    radial-gradient(70rem 40rem at -20% 120%, rgb(20 110 245 / 0.14), transparent 60%),
    #060d1f;
}
/* Without JS the page must scroll through the stacked panels. */
.tv-root:not(.tv-js) {
  height: auto;
  min-height: 100vh;
}
.tv-body:has(.tv-root:not(.tv-js)) {
  overflow: auto;
}
.tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2vw;
  flex-wrap: wrap;
}
.tv-identity {
  display: flex;
  align-items: center;
  gap: 1.5vw;
  min-width: 0;
}
.tv-logo-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  border-radius: 1.2vh;
  padding: 1vh 1.2vh;
}
.tv-logo-chip img {
  height: 6vh;
  width: auto;
}
.tv-show-name {
  font-size: 4.5vh;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-tenant-name {
  font-size: 2.4vh;
  color: #93a4bd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-status {
  display: flex;
  align-items: center;
  gap: 1.2vw;
}
.tv-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.8vh;
  background: #059669;
  color: #fff;
  font-size: 2.4vh;
  font-weight: 700;
  padding: 1vh 1.8vh;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tv-live-dot {
  width: 1.4vh;
  height: 1.4vh;
  border-radius: 999px;
  background: #fff;
  animation: tv-pulse 1.6s ease-in-out infinite;
}
@keyframes tv-pulse {
  50% { opacity: 0.25; }
}
.tv-closed-badge {
  font-size: 2.4vh;
  font-weight: 700;
  color: #93a4bd;
  border: 1px solid #2c3b55;
  padding: 1vh 1.8vh;
  border-radius: 999px;
}
.tv-countdown {
  font-size: 2.4vh;
  color: #b9c6da;
}
.tv-main {
  display: flex;
  flex: 1;
  gap: 3vw;
  margin-top: 3vh;
  min-height: 0;
}
.tv-boards {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tv-total {
  font-size: 2.6vh;
  color: #93a4bd;
}
.tv-total-number {
  font-size: 4vh;
  font-weight: 800;
  color: #fff;
}
.tv-stage {
  margin-top: 2vh;
}
/* With JS, panels stack in one stage and crossfade: the outgoing one
   falls away while the incoming one rises a beat later, then its rows
   sweep in one by one. All TRANSITIONS, never animations - a throttled
   tab may skip the interpolation but still lands on the class's final
   styles, so the board can never freeze invisible (a paused animation
   at an opacity-0 keyframe did exactly that once). */
.tv-js .tv-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.tv-js .tv-panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(3vh) scale(0.985);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.tv-js .tv-panel.tv-panel-active {
  opacity: 1;
  transform: none;
  transition-delay: 0.25s;
}
.tv-js .tv-row {
  opacity: 0;
  transform: translateX(2vw);
  transition:
    opacity 0.45s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.tv-js .tv-panel-active .tv-row {
  opacity: 1;
  transform: none;
}
.tv-js .tv-panel-active .tv-row:nth-child(1) { transition-delay: 0.4s; }
.tv-js .tv-panel-active .tv-row:nth-child(2) { transition-delay: 0.47s; }
.tv-js .tv-panel-active .tv-row:nth-child(3) { transition-delay: 0.54s; }
.tv-js .tv-panel-active .tv-row:nth-child(4) { transition-delay: 0.61s; }
.tv-js .tv-panel-active .tv-row:nth-child(5) { transition-delay: 0.68s; }
.tv-js .tv-panel-active .tv-row:nth-child(6) { transition-delay: 0.75s; }
.tv-js .tv-panel-active .tv-row:nth-child(7) { transition-delay: 0.82s; }
.tv-js .tv-panel-active .tv-row:nth-child(8) { transition-delay: 0.89s; }
.tv-js .tv-panel-active .tv-row:nth-child(9) { transition-delay: 0.96s; }
.tv-js .tv-panel-active .tv-row:nth-child(10) { transition-delay: 1.03s; }
/* The notification bar: edge to edge across the very top, brand color
   in both modes. Negative margins bleed it through tv-root's padding
   so the flex height math stays untouched. */
.tv-banner {
  margin: -3vh -3vw 2.2vh;
  padding: 1.4vh 3vw;
  background: var(--color-brand-600, #146ef5);
  color: #fff;
  font-size: 2.6vh;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}
.tv-banner strong { color: #fff; font-weight: 800; }
.tv-banner a { color: #fff; text-decoration: underline; }
.tv-cat {
  font-size: 4.6vh;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-brand-300, #94c0ff);
}
.tv-list {
  margin-top: 1.2vh;
  display: flex;
  flex-direction: column;
  gap: 1vh;
}
.tv-row {
  display: flex;
  align-items: center;
  gap: 2vw;
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(255 255 255 / 0.08);
  border-radius: 1.6vh;
  padding: 1.2vh 2vw;
}
.tv-rank {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.4vh;
  height: 5.4vh;
  border-radius: 999px;
  font-size: 2.8vh;
  font-weight: 800;
  background: #1d2a42;
  color: #b9c6da;
}
.tv-rank-1 { background: #fbbf24; color: #431407; }
.tv-rank-2 { background: #cbd5e1; color: #1e293b; }
.tv-rank-3 { background: #d97706; color: #431407; }
.tv-carnum {
  flex-shrink: 0;
  font-size: 4.6vh;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  min-width: 12vh;
}
.tv-label {
  flex: 1;
  min-width: 0;
  font-size: 3vh;
  color: #d4ddeb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-votes {
  flex-shrink: 0;
  font-size: 3.4vh;
  font-weight: 800;
  color: var(--color-brand-300, #94c0ff);
}
.tv-empty {
  font-size: 3vh;
  color: #93a4bd;
  padding: 2vh 0;
}
.tv-dots {
  display: flex;
  gap: 1.2vh;
  justify-content: center;
  margin-top: auto;
  padding-top: 2vh;
}
.tv-dot {
  width: 1.6vh;
  height: 1.6vh;
  border-radius: 999px;
  background: #2c3b55;
  transition: background 0.3s;
}
.tv-dot-active {
  background: var(--color-brand-400, #5e9bfc);
}
.tv-wraps {
  margin-top: 6vh;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.04);
  border-radius: 2vh;
  padding: 5vh 4vw;
  text-align: center;
}
.tv-wraps-title {
  font-size: 5vh;
  font-weight: 800;
}
.tv-wraps-body {
  margin-top: 1.5vh;
  font-size: 2.8vh;
  color: #b9c6da;
}
.tv-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2vh;
  flex-shrink: 0;
}
.tv-qr-card {
  background: #fff;
  border-radius: 2vh;
  padding: 2.5vh;
  text-align: center;
  color: #0a2540;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.45);
}
.tv-qr svg {
  width: 26vh;
  height: 26vh;
  display: block;
  margin: 0 auto;
}
.tv-qr-title {
  margin-top: 1.5vh;
  font-size: 2.6vh;
  font-weight: 800;
}
.tv-qr-hint {
  margin-top: 0.4vh;
  font-size: 1.9vh;
  color: #425466;
}
.tv-powered {
  font-size: 1.8vh;
  color: #5b6c85;
}
/* Phones/tablets in portrait: stack the rail under the boards. */
@media (max-aspect-ratio: 1/1) {
  .tv-root {
    height: auto;
    min-height: 100vh;
  }
  .tv-body {
    overflow: auto;
  }
  .tv-main {
    flex-direction: column;
  }
}


/* ---- Light mode (/results/tv/light/) - outdoor screens in daylight. */
body.tv-light { background: #f4f7fb; }
.tv-light .tv-root {
  color: #0a2540;
  background:
    radial-gradient(90rem 50rem at 110% -20%, rgb(20 110 245 / 0.1), transparent 60%),
    radial-gradient(70rem 40rem at -20% 120%, rgb(20 110 245 / 0.07), transparent 60%),
    #f4f7fb;
}
.tv-light .tv-tenant-name,
.tv-light .tv-total,
.tv-light .tv-countdown { color: #5b6c85; }
.tv-light .tv-total-number { color: #0a2540; }
.tv-light .tv-row {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 12px rgb(10 37 64 / 0.06);
}
.tv-light .tv-carnum { color: #0a2540; }
.tv-light .tv-label { color: #334155; }
.tv-light .tv-cat { color: var(--color-brand-700, #0d5bd6); }
.tv-light .tv-votes { color: var(--color-brand-700, #0d5bd6); }
.tv-light .tv-rank { background: #e2e8f0; color: #475569; }
.tv-light .tv-rank-1 { background: #fbbf24; color: #431407; }
.tv-light .tv-rank-2 { background: #cbd5e1; color: #1e293b; }
.tv-light .tv-rank-3 { background: #d97706; color: #431407; }
.tv-light .tv-empty { color: #5b6c85; }
.tv-light .tv-closed-badge { color: #5b6c85; border-color: #cbd5e1; }
.tv-light .tv-dot { background: #cbd5e1; }
.tv-light .tv-dot-active { background: var(--color-brand-600, #146ef5); }
.tv-light .tv-logo-chip { border: 1px solid #e2e8f0; }
.tv-light .tv-qr-card {
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgb(10 37 64 / 0.12);
}
.tv-light .tv-wraps { background: #fff; border-color: #e2e8f0; }
.tv-light .tv-wraps-body { color: #5b6c85; }
.tv-light .tv-powered { color: #64748b; }

/* ---- Manage command palette (static/js/manage_search.js) ---------- */
.ms-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgb(10 37 64 / 0.45);
  padding: 10vh 1rem 0;
}
.ms-panel {
  margin: 0 auto;
  width: min(38rem, 100%);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 30px 80px rgb(10 37 64 / 0.35);
  overflow: hidden;
}
.ms-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  outline: none;
}
.ms-results {
  max-height: min(24rem, 60vh);
  overflow-y: auto;
  padding: 0.5rem;
}
.ms-hint {
  padding: 1rem 0.75rem;
  font-size: 0.875rem;
  color: #64748b;
}
.ms-section {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.ms-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  text-decoration: none;
}
.ms-row-active,
.ms-row:hover {
  background: var(--color-brand-50, #f0f6ff);
}
.ms-title {
  font-weight: 600;
  color: #0a2540;
}
.ms-crumb {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #64748b;
}
