:root {
  --pgm-font-body: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
  --pgm-time-width: 13mm;
  --pgm-gap: 2mm;
  --pgm-gap-tight: 1.2mm;
  --pgm-border-radius: 2mm;
  --pgm-border-colour: #c7d1db;
  --pgm-accent: #0b4f6c;
  --pgm-card-bg: #ffffff;
  --pgm-card-shadow: 0 1px 1px rgba(12, 56, 80, 0.1);
  --pgm-font-scale: 1;
}

@media screen {
  :root {
    --pgm-font-scale: 1.25;
  }
}

@page {
  size: A4 portrait;
  margin: 6mm 5mm 7mm;
  @top-center {
    content: element(pgm-day-heading);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: auto;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--pgm-font-body);
  font-size: calc(9px * var(--pgm-font-scale));
  line-height: 1.3;
  background: #f5f7fa;
  background: #f5f7fa;
  color: #1d3340;
}

body::after {
  content: "";
  display: none;
}

.pgm-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 28px 32px 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom: 1px solid rgba(12, 56, 80, 0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}

.pgm-toolbar__title {
  width: 100%;
}

.pgm-toolbar h1 {
  margin: 0;
  font-size: calc(18px * var(--pgm-font-scale));
  line-height: 1.2;
  letter-spacing: 0.02em;
  width: 100%;
}

.pgm-toolbar h1::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 10px;
  background: rgba(12, 56, 80, 0.18);
}

.pgm-banner-wrap {
  padding: 8px 0 12px;
  text-align: center;
}

.pgm-banner {
  display: block;
  width: 100%;
  height: auto;
}

.pgm-updated,
.pgm-generated {
  margin: 2px 0 0;
  font-size: calc(8.5px * var(--pgm-font-scale));
  color: rgba(13, 55, 79, 0.75);
}

.pgm-timezone-note {
  margin: 2px 0 0;
  font-size: calc(8px * var(--pgm-font-scale));
  color: rgba(13, 55, 79, 0.6);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pgm-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: stretch;
  width: 100%;
}

.pgm-actions > fieldset,
.pgm-actions > .pgm-search {
  width: 100%;
}

.pgm-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pgm-search label {
  font-size: calc(9px * var(--pgm-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(12, 56, 80, 0.6);
}

.pgm-search input {
  font: inherit;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(12, 56, 80, 0.35);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 2px rgba(12, 56, 80, 0.08);
}

.pgm-search input:focus {
  border-color: rgba(11, 79, 108, 0.7);
  outline: none;
  box-shadow: 0 0 0 2px rgba(11, 79, 108, 0.15);
}

.pgm-search select {
  font: inherit;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(12, 56, 80, 0.35);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 2px rgba(12, 56, 80, 0.08);
}

.pgm-search select:focus {
  border-color: rgba(11, 79, 108, 0.7);
  outline: none;
  box-shadow: 0 0 0 2px rgba(11, 79, 108, 0.15);
}

.pgm-search__picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pgm-search__quickpick {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pgm-search__quickpick select {
  width: 100%;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(12, 56, 80, 0.35);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 2px rgba(12, 56, 80, 0.08);
  font: inherit;
}

.pgm-search__quickpick small {
  color: rgba(12, 56, 80, 0.6);
}


.pgm-intro {
  padding: 12px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.pgm-intro__meta {
  text-align: center;
}

@media screen and (max-width: 768px) {
  .pgm-toolbar {
    padding: 20px 18px 16px;
    position: static;
  }
  .pgm-actions {
    grid-template-columns: 1fr;
  }
  #pgmPrintButton {
    display: none;
  }
  .pgm-slot__time {
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: manual;
  }
  .pgm-slot__sessions {
    flex-wrap: wrap;
    gap: var(--pgm-gap-tight);
  }
  .pgm-slot__sessions > .pgm-session {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  .pgm-search input {
    font-size: 16px;
  }
  .pgm-search select {
    font-size: 16px;
  }
  .pgm-search__quickpick select {
    font-size: 16px;
  }
}

@media screen {
  .pgm-generated {
    display: none;
  }
}

@media print {
  :root {
    --pgm-font-scale: 1;
  }
}

.pgm-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(12, 56, 80, 0.25);
  border-radius: 12px;
  background: rgba(12, 56, 80, 0.05);
  min-width: 180px;
}

.pgm-toggle-group__title {
  margin: 0;
  font-size: calc(9px * var(--pgm-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(12, 56, 80, 0.6);
}

.pgm-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: calc(9px * var(--pgm-font-scale));
  color: rgba(12, 56, 80, 0.85);
}

.pgm-toggle input {
  margin: 0;
}

.pgm-toggle__hint {
  font-size: calc(8px * var(--pgm-font-scale));
  color: rgba(12, 56, 80, 0.6);
}

.pgm-toggle-group--days {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
  padding: 10px 14px;
}

.pgm-toggle--day {
  font-size: calc(9px * var(--pgm-font-scale));
}

body.pgm-hide-roles .pgm-roles {
  display: none !important;
}

body.pgm-hide-presentations .pgm-presentations {
  display: none !important;
}

.pgm-day--hidden {
  display: none !important;
}

.pgm-day--search-hidden {
  display: none !important;
}

.pgm-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: 999px;
  text-decoration: none;
  color: #0d5c7b;
  background: rgba(13, 92, 123, 0.08);
  border: 1px solid rgba(13, 92, 123, 0.28);
  transition: background 0.15s ease, border 0.15s ease, color 0.15s ease;
}

.pgm-download:hover,
.pgm-download:focus {
  background: rgba(13, 92, 123, 0.15);
  border-color: rgba(13, 92, 123, 0.45);
  color: #08445b;
  outline: none;
}

#pgmPrintButton {
  font: inherit;
  padding: 6px 14px;
  background: #0d5c7b;
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 3px 6px rgba(11, 79, 108, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  justify-self: end;
}

#pgmPrintButton:hover,
#pgmPrintButton:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(11, 79, 108, 0.35);
  outline: none;
}

#pgmPrintButton:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(11, 79, 108, 0.25);
}

.pgm-agenda {
  padding: 10px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pgm-day {
  background: #ffffff;
  border-radius: var(--pgm-border-radius);
  box-shadow: var(--pgm-card-shadow);
  padding: 10px 12px 12px;
}

.pgm-day h2 {
  margin: 0 0 6px;
  font-size: calc(12px * var(--pgm-font-scale));
  color: var(--pgm-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pgm-day__title {
  position: running(pgm-day-heading);
}

.pgm-day__title-continued {
  position: running(pgm-day-heading);
  height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
}


.pgm-slot {
  display: flex;
  flex-direction: column;
  gap: var(--pgm-gap-tight);
  margin-bottom: var(--pgm-gap);
  break-inside: avoid;
}

.pgm-slot--hidden {
  display: none !important;
}

.pgm-slot__row {
  display: grid;
  grid-template-columns: var(--pgm-time-width) 1fr;
  column-gap: var(--pgm-gap);
  align-items: stretch;
}

.pgm-slot__row--hidden {
  display: none !important;
}

.pgm-slot__time {
  font-weight: 600;
  font-size: calc(8px * var(--pgm-font-scale));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(12, 56, 80, 0.85);
  padding-right: 4px;
  padding-top: 2px;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: manual;
}

.pgm-session--empty {
  background: transparent;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0;
  height: 0;
  margin: 0;
  opacity: 0;
  display: block;
  pointer-events: none;
}

.pgm-slot__sessions {
  display: flex;
  gap: var(--pgm-gap);
}

.pgm-slot__sessions > .pgm-session {
  flex: 1 1 0;
  min-width: 0;
}

.pgm-session {
  background: var(--pgm-card-bg);
  border: 0.3mm solid rgba(12, 56, 80, 0.25);
  border-radius: var(--pgm-border-radius);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  row-gap: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  break-inside: avoid;
  break-inside: avoid-page;
  page-break-inside: avoid;
  vertical-align: top;
}

.pgm-session--hidden {
  display: none !important;
}

.pgm-session mark {
  background: #fde58a;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

.pgm-session__header h3 {
  margin: 0;
  font-size: calc(12px * var(--pgm-font-scale));
  line-height: 1.25;
  color: #062639;
}

.pgm-session__header p {
  margin: 1px 0 0;
  font-size: calc(9.5px * var(--pgm-font-scale));
  color: rgba(12, 56, 80, 0.8);
}

.pgm-session__place {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 1px 0 0;
  font-size: calc(9.5px * var(--pgm-font-scale));
  color: rgba(12, 56, 80, 0.8);
}

.pgm-session__stream,
.pgm-session__location-text {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.pgm-session__meta-sep {
  color: rgba(12, 56, 80, 0.5);
}

.pgm-session__price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  font-size: calc(9.5px * var(--pgm-font-scale));
  color: rgba(12, 56, 80, 0.88);
  font-weight: 600;
}

body.pgm-hide-stream .pgm-session__stream {
  display: none !important;
}

body.pgm-hide-stream .pgm-session__place[data-has-location="0"] {
  display: none !important;
}

.pgm-session__type {
  font-style: italic;
  font-size: calc(9.5px * var(--pgm-font-scale));
}

.pgm-roles {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  font-size: calc(8.5px * var(--pgm-font-scale));
  color: rgba(12, 56, 80, 0.75);
}

.pgm-roles li {
  margin: 0;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.pgm-presentations {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}

.pgm-presentations > li + li {
  margin-top: 2px;
}

.pgm-presentation__title {
  font-weight: 600;
  font-size: calc(10px * var(--pgm-font-scale));
  color: #0b344a;
  display: inline;
}

.pgm-presentation__authors {
  font-size: calc(9px * var(--pgm-font-scale));
  color: rgba(12, 56, 80, 0.82);
  display: inline;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.pgm-empty {
  margin: 24px auto;
  text-align: center;
  font-size: calc(12px * var(--pgm-font-scale));
  color: rgba(13, 55, 79, 0.7);
}

@media print {
  body {
    background: #ffffff;
    font-size: 9pt;
    padding: 0;
  }
  .pgm-toolbar {
    position: static;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
  }
  .pgm-has-banner .pgm-toolbar h1 {
    display: none;
  }
  .pgm-actions {
    display: none;
  }
  .pgm-intro {
    page-break-after: avoid;
    break-after: avoid-page;
    padding: 0 0 4mm;
    margin: 0 0 4mm;
    gap: 6mm;
  }
  .pgm-agenda {
    break-before: avoid-page;
    page-break-before: auto;
  }
  .pgm-day:first-of-type {
    margin-top: 0;
    break-before: avoid-page;
    page-break-before: auto;
  }
  .pgm-banner-wrap {
    padding: 0;
  }
  .pgm-banner {
    max-height: 80mm;
    width: 100%;
  }
  .pgm-toggle-group--days {
    display: none;
  }
  .pgm-agenda {
    padding: 0;
    gap: 16px;
  }
  .pgm-day {
    box-shadow: none;
    border: none;
    padding: 0 0 12px;
    break-inside: auto;
    page-break-inside: auto;
  }
  .pgm-slot {
    grid-template-columns: var(--pgm-time-width) repeat(4, minmax(0, 1fr));
    column-gap: var(--pgm-gap-tight);
    row-gap: var(--pgm-gap-tight);
  }
  .pgm-day__title {
    break-after: avoid-page;
    page-break-after: avoid;
  }
  .pgm-session {
    box-shadow: none;
  }
}
