/* Layout and interaction rules only. Swap theme.css to try colors, fonts, borders, and corners. */
:root {
  --time-column: 4.75rem;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-header {
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-end;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 0.8rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.15rem;
}

h2 {
  margin-bottom: 0;
}

.lede {
  max-width: 42rem;
  margin-bottom: 0;
}

.status {
  display: none;
}

.mobile-menu-button,
.mobile-search-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.mobile-search-button {
  font-size: 2rem;
}

.header-controls {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.theme-switcher {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
}

.theme-select {
  min-width: 7.25rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.layout {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(14rem, 0.55fr) minmax(0, 2.45fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 1.25rem;
  width: 100%;
  max-width: 1480px;
  min-height: 0;
  margin: 0 auto;
  padding: 0 1.25rem 1.25rem;
}

.panel {
  min-width: 0;
  min-height: 0;
}

.picker-panel,
.guide-panel {
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.picker-panel {
  overflow-x: hidden;
}

.guide-panel {
  overflow: hidden;
}

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

.compact-heading {
  margin-bottom: 0.75rem;
}

.country-flags {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.2rem;
  height: calc((1.8rem * 2) + 0.2rem);
  margin-bottom: 0.85rem;
  overflow: hidden;
  border-radius: 0 !important;
}

.country-flags[hidden] {
  display: none !important;
  height: 0;
  margin-bottom: 0;
}

.country-flags *,
.flag-button {
  border-radius: 0 !important;
}

.flag-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  min-height: 1.65rem;
  cursor: pointer;
  padding: 0.12rem;
}

.search {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.7rem 0.85rem;
}

.header-search {
  width: min(24rem, 42vw);
  margin-bottom: 0;
}

.search-results {
  flex: 0 0 auto;
  max-height: min(18rem, 34vh);
  margin-bottom: 0.85rem;
  overflow: auto;
  padding: 0.8rem;
}

.search-results-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.65rem;
}

.search-results-heading h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.show-results-list {
  display: grid;
  gap: 0.35rem;
}

.show-result {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) minmax(8rem, 0.6fr);
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  text-align: left;
}

.show-result-title,
.show-result-meta,
.show-result-time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-list {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  flex: 1 1 auto;
  gap: 0.55rem;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0;
  border-radius: 0 !important;
}

.channel-list *,
.channel-choice,
.country-group h3,
.country-channels {
  border-radius: 0 !important;
}

.country-group {
  display: grid;
  min-width: 0;
  gap: 0.35rem;
}

.country-group h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  margin: 0;
  padding: 0.42rem 0.5rem;
}

.country-channels {
  display: grid;
  min-width: 0;
  gap: 0.22rem;
}

.channel-choice {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0.42rem 0.5rem;
  cursor: pointer;
  text-align: left;
}

.search-channel-choice {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.channel-flag {
  flex: 0 0 auto;
  line-height: 1;
}

.channel-choice:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.channel-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: 0 !important;
}

.secondary-button {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.guide {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.empty-state {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 2rem;
  text-align: center;
}

.empty-state p {
  max-width: 34rem;
  margin: 0 auto;
}

.empty-state-notes {
  margin-top: auto !important;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0.65;
}

.guide-meta {
  flex-shrink: 0;
  margin-bottom: 0.65rem;
}

.schedule-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.schedule-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: var(--time-column) repeat(
        var(--guide-columns),
        minmax(13rem, 1fr)
      );
  min-width: calc(var(--time-column) + var(--guide-columns) * 13rem);
}

.time-header,
.guide-channel-heading {
  min-height: 3.15rem;
  padding: 0.45rem 0.55rem;
}

.guide-channel-heading {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  min-width: 0;
}

.guide-channel-flag {
  flex: 0 0 auto;
}

.guide-channel-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-channel-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  cursor: pointer;
}

.schedule-body {
  position: relative;
  min-width: calc(var(--time-column) + var(--guide-columns) * 13rem);
}

.time-axis {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--time-column);
  z-index: 2;
}

.time-label {
  position: absolute;
  right: 0.65rem;
  transform: translateY(-0.65rem);
}

.time-grid {
  position: absolute;
  inset: 0 0 0 var(--time-column);
  z-index: 0;
  pointer-events: none;
}

.time-grid span {
  position: absolute;
  left: 0;
  right: 0;
}

.schedule-columns {
  position: absolute;
  inset: 0 0 0 var(--time-column);
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--guide-columns), minmax(13rem, 1fr));
}

.schedule-column {
  position: relative;
}

.current-time-line {
  position: absolute;
  left: var(--time-column);
  right: 0;
  z-index: 3;
  pointer-events: none;
}

.current-time-line span {
  position: absolute;
  left: 0.35rem;
  top: -0.78rem;
  padding: 0.12rem 0.4rem;
}

.program-block {
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  overflow: hidden;
  padding: 0.65rem;
  cursor: pointer;
}

.program-time {
  margin-bottom: 0.28rem;
}

.program-title {
  margin-bottom: 0.35rem;
}

.program-subtitle {
  margin-bottom: 0.45rem;
}

.program-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-bottom: 0.45rem;
}

.program-tags span {
  padding: 0.16rem 0.42rem;
}

.program-description {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.program-description summary {
  cursor: pointer;
}

.program-description p {
  margin: 0.4rem 0 0;
}

.program-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(42rem, calc(100dvh - 2rem));
  overflow: auto;
  padding: 0;
}

.program-dialog-content {
  padding: 1.25rem 1.25rem 0;
}

.program-dialog-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 16rem;
  margin-bottom: 1rem;
  object-fit: cover;
}

.program-dialog-kicker {
  margin-bottom: 0.45rem;
}

.program-dialog h2 {
  margin-bottom: 0.35rem;
}

.program-dialog-subtitle {
  margin-bottom: 0.8rem;
}

.program-dialog-tags {
  margin-bottom: 1rem;
}

.program-detail-list {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1rem;
}

.program-detail-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.75rem;
}

.program-detail-row dt,
.program-detail-row dd {
  margin: 0;
}

.program-dialog-description {
  margin-bottom: 0;
}

.program-dialog form {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.25rem 1.25rem;
}

.empty-program {
  padding: 1rem;
}

@media (max-width: 860px) {.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.55rem 0.55rem 0.42rem;
}

.header-controls {
  gap: 0.45rem;
}

.header-search {
  width: min(18rem, calc(100vw - 7.5rem));
  padding: 0.55rem 0.7rem;
}

body:not([data-search-open="true"]) .header-search {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

body[data-search-open="true"] .header-controls {
  flex: 1 1 auto;
}

body[data-search-open="true"] .header-search {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

body[data-search-open="true"] .app-header > div:first-child {
  display: none;
}

.mobile-search-button {
  display: inline-flex;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: inherit !important;
  font-size: 2rem !important;
  font-weight: 760;
  outline: 0 !important;
}

.mobile-menu-button {
  display: none !important;
}

.mobile-search-button:hover,
.mobile-search-button:focus-visible,
.mobile-search-button[aria-expanded="true"] {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
  outline: 0 !important;
}

body[data-searching="true"] .picker-panel {
  display: none;
}

body[data-searching="true"] .guide-panel {
  left: 0.4rem !important;
}

.lede,
  .status {
  display: none;
}

.layout {
  position: relative;
  display: block;
  height: 100%;
  padding: 0 0.4rem 0.4rem;
  touch-action: pan-y;
}

.picker-panel,
  .guide-panel {
  position: absolute;
  top: 0.05rem;
  bottom: 0.4rem;
  padding: 0.65rem;
  transition:
        left 220ms ease,
        width 220ms ease,
        opacity 160ms ease;
}

.picker-panel {
  left: 0.4rem;
  z-index: 5;
  overflow: hidden;
  cursor: pointer;
}

.guide-panel {
  right: 0.4rem;
  opacity: 1;
  pointer-events: auto;
}

body[data-mobile-view="guide"] .picker-panel {
  width: calc(10vw - 0.4rem);
  padding-inline: 0;
}

body[data-mobile-view="guide"] .guide-panel {
  left: calc(10vw + 0.45rem);
}

body[data-mobile-view="guide"] .picker-panel > * {
  opacity: 0;
  pointer-events: none;
  transition: opacity 80ms ease;
}

body[data-mobile-view="picker"] .picker-panel {
  width: min(50vw, 22rem);
  cursor: default;
}

body[data-mobile-view="picker"] .guide-panel {
  left: calc(min(50vw, 22rem) + 0.55rem);
}

body[data-mobile-view="picker"] .picker-panel > * {
  opacity: 1;
  transition: opacity 120ms ease 90ms;
}

.schedule-wrap {
  --time-column: 0rem;
}

.time-header {
  width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
}

.time-axis {
  display: none;
}

.current-time-line span {
  display: none;
}

.search-results {
  max-height: 38vh;
}

.show-result {
  grid-template-columns: 1fr;
  gap: 0.18rem;
}

.channel-list {
  max-height: none;
}


}

