@charset "UTF-8";
:root {
  --primary-background: white;
  --primary-color: black;
  --primary-faded-color: dimGrey;
  --primary-very-faded-color: #a8a8a8;
  --primary-contrast-color: #3b56c3;
  --primary-faded-contrast-color: #3f386e;
  --hatching-image: url("/static/light-mode-hatching.svg");
  --primary-alternate-background: #e8e8e8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary-background: rgb(20, 20, 20);
    --primary-color: #f4f4f4;
    --primary-faded-color: grey;
    --primary-very-faded-color: #595959;
    --primary-contrast-color: #ffdc11;
    --primary-faded-contrast-color: #d7b512;
    --hatching-image: url("/static/dark-mode-hatching.svg");
    --primary-alternate-background: #333333;
  }
}
:root {
  --unavailable-background: var(--primary-background);
  --unavailable-color: var(--primary-color);
  --available-background: var(--primary-contrast-color);
  --available-color: var(--primary-background);
  --heavy-border: 2px solid var(--primary-color);
  --light-border: 1px dotted var(--primary-color);
  --table-row-divider-border: 1px solid var(--primary-very-faded-color);
  --hatched-background: var(--hatching-image) top left / 12px repeat;
  background: var(--primary-background);
  color: var(--primary-color);
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  --body-padding: clamp(0.5rem, 2vw, 1rem);
}

a {
  color: var(--primary-contrast-color);
}
a:visited {
  color: var(--primary-faded-contrast-color);
}

h1, h2 {
  font-family: Rockwell, "Rockwell Nova", "Roboto Slab", "DejaVu Serif", "Sitka Small", serif;
}

h1 {
  text-align: center;
  font-size: 1.5rem;
  word-wrap: anywhere;
  overflow-wrap: anywhere;
}

p {
  margin: 0;
}

body {
  margin: 0;
  padding: var(--body-padding);
  padding-top: 0.3rem;
  display: grid;
  grid-template: "header" min-content "main  " 1fr "footer" min-content;
  gap: 0.5em;
  min-height: 100vh;
  max-width: 100vw;
  box-sizing: border-box;
}
body > * {
  margin: 0;
}
body > * + * {
  margin-block-start: 1rem;
}

main > *, header > *, footer > * {
  margin: 0;
}
main > * + *, header > * + *, footer > * + * {
  margin-block-start: 1rem;
}
main > *, header > *, footer > * {
  max-width: calc(100vw - 2 * var(--body-padding));
}

header {
  grid-area: header;
}

main {
  grid-area: main;
  margin: 0 auto;
}

footer {
  grid-area: footer;
  text-align: right;
  font-size: 0.8rem;
  margin: 0.25rem 0.25rem 0 0.25rem;
}
footer p {
  margin: 0;
}

main > form > * {
  margin: 0;
}
main > form > * + * {
  margin-block-start: 1rem;
}

summary h3 {
  display: inline-block;
  margin: 0;
}

dialog {
  margin: auto;
  --dialog-padding: 1rem;
  padding: var(--dialog-padding);
  background-color: var(--primary-background);
  color: var(--primary-color);
  border: medium solid currentColor;
}

dialog form:not(.dialog-close-form) {
  display: contents;
}

dialog button + button {
  margin-inline-start: 1em;
}

.dialog-close-form {
  float: right;
  padding: 0;
  margin: calc(-1 * var(--dialog-padding)) calc(-1 * var(--dialog-padding)) 0 0;
}

.dialog-close-form > button {
  margin: 0;
  display: block;
  border-width: 0 0 medium medium;
  border-color: var(--primary-color);
  border-style: solid;
  border-radius: 0;
  font-size: 1.5rem;
  background-color: var(--primary-background);
  color: var(--primary);
  box-shadow: none;
}

dialog h2 {
  margin-top: 0;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.65);
  }
}
input[type=button], input[type=submit], button {
  padding: 0.4rem 0.7rem;
  background-color: #ebebeb;
  border: 1px solid #606060;
  border-radius: 0.2rem;
  box-shadow: inset -2px -2px 1.5px 0px rgba(0, 0, 0, 0.5), inset 2px 2px 1.5px 0px rgb(255, 255, 255);
}
input[type=button]:hover, input[type=submit]:hover, button:hover {
  background-color: #d0d0d0;
}
input[type=button]:active, input[type=submit]:active, button:active {
  box-shadow: none;
}
input[type=button]:disabled, input[type=button]:disabled:hover, input[type=submit]:disabled, input[type=submit]:disabled:hover, button:disabled, button:disabled:hover {
  background-color: #ebebeb;
  box-shadow: none;
  border-color: #7f7f7f;
  color: #393939;
}

@media (prefers-color-scheme: dark) {
  input[type=button], input[type=submit], button {
    background-color: #313131;
    color: #ffffff;
    border-color: #8c8c8c;
    box-shadow: inset -3px -3px 1.5px 0px rgba(0, 0, 0, 0.6), inset 2px 2px 1.5px 0px rgba(255, 255, 255, 0.3);
  }
  input[type=button]:hover, input[type=submit]:hover, button:hover {
    background-color: #212121;
  }
  input[type=button]:active, input[type=submit]:active, button:active {
    box-shadow: none;
  }
  input[type=button]:disabled, input[type=button]:disabled:hover, input[type=submit]:disabled, input[type=submit]:disabled:hover, button:disabled, button:disabled:hover {
    background-color: #313131;
    box-shadow: none;
    border-color: #6c6c6c;
    color: #cdcdcd;
  }
}
.button-with-tooltip-wrapper {
  position: relative;
  font-size: 0;
}
.button-with-tooltip-wrapper .tooltip {
  display: none;
}
.button-with-tooltip-wrapper.show-tooltip button {
  border-color: currentColor !important;
}
.button-with-tooltip-wrapper.show-tooltip .tooltip {
  display: block;
  position: absolute;
  z-index: 3;
  width: max-content;
  max-width: min(20ch, 40vw);
  background-color: var(--primary-background);
  color: var(--primary-color);
  left: 70%;
  top: 100%;
  font-size: 1rem;
  padding: 0 8px;
  margin: 0;
  border: 1px solid var(--primary-color);
}
.button-with-tooltip-wrapper.show-tooltip.push-tooltip-up .tooltip {
  top: auto;
  bottom: 100%;
}
.button-with-tooltip-wrapper.show-tooltip.push-tooltip-left .tooltip {
  left: auto;
  right: 70%;
}

.hidden-respondant {
  color: var(--primary-faded-color);
}

#legend {
  display: flex;
  justify-content: center;
}
#legend #legend-color-bar {
  display: flex;
  min-width: 10em;
  margin: 0px 0.5em;
  border: var(--heavy-border);
}
#legend #legend-color-bar div {
  min-height: 1em;
  flex: 1;
}
#legend span {
  font-weight: bold;
}

#timespan-table-holder table {
  table-layout: fixed;
  width: max-content;
  margin: 0 auto;
}
#timespan-table-holder table col {
  width: 4rem;
}
#timespan-table-holder table col:first-child {
  width: 2.5rem;
}
#timespan-table-holder table.has-other-year thead th span.year {
  display: block;
}
#timespan-table-holder table tbody tr:not(.gap) {
  height: 0.8rem;
}
#timespan-table-holder table tbody tr:not(.gap) th {
  text-align: right;
  font-weight: normal;
  font-size: 0.6rem;
  color: var(--primary-faded-color);
  padding: 0 1px;
  background: var(--primary-background);
}
#timespan-table-holder table tbody tr:not(.gap) th span {
  position: absolute;
  overflow: visible;
  right: 0.15rem;
  top: -0.6rem;
}
#timespan-table-holder table tbody tr:not(.gap) td {
  font-size: 0.7rem;
  text-align: center;
  box-sizing: content-box;
}
#timespan-table-holder table tbody tr:not(.gap) td button {
  font-size: 0.7rem;
  display: block;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  background-color: transparent;
  color: inherit;
  box-shadow: none;
  border-radius: 0;
}
#timespan-table-holder table tbody tr:not(.gap) td[data-available-respondants] div.zero-text {
  display: none;
}
#timespan-table-holder table tbody tr:not(.gap) td[data-available-respondants="0"] div.zero-text {
  display: block;
}
#timespan-table-holder table tbody tr:not(.gap) td[data-available-respondants="0"] div.button-with-tooltip-wrapper {
  display: none;
}
#timespan-table-holder table tbody tr:not(.gap) td:not(.empty) {
  border-right: var(--heavy-border);
}
#timespan-table-holder table tbody tr:not(.gap) td.empty {
  border-right: var(--light-border);
}
#timespan-table-holder table tbody tr:not(.gap) td.last-empty {
  border-right: var(--heavy-border);
}
#timespan-table-holder table tbody tr:not(.gap) th + td:not(.empty) {
  border-left: var(--heavy-border);
}
#timespan-table-holder table tbody tr:not(.gap) th + td.empty {
  border-left: var(--light-border);
}
#timespan-table-holder table tbody tr:not(.gap).minutes-45 td:not(.empty), #timespan-table-holder table tbody tr:not(.gap):last-child td:not(.empty), #timespan-table-holder table tbody tr:not(.gap).before-gap td:not(.empty) {
  border-bottom: var(--heavy-border);
}
#timespan-table-holder table tbody tr:not(.gap).minutes-45 td.empty, #timespan-table-holder table tbody tr:not(.gap):last-child td.empty, #timespan-table-holder table tbody tr:not(.gap).before-gap td.empty {
  border-bottom: var(--light-border);
}
#timespan-table-holder table tbody tr:not(.gap).minutes-15 td:not(.empty) {
  border-bottom: var(--light-border);
}
#timespan-table-holder table tr.gap td {
  background-color: var(--primary-background);
  height: 1.5rem;
  border-right: var(--light-border);
}
#timespan-table-holder table tr.gap th + td {
  border-left: var(--light-border);
}
#timespan-table-holder table tbody tr:first-child td:not(.empty),
#timespan-table-holder table tbody tr.gap + tr td:not(.empty) {
  border-top: var(--heavy-border);
}
#timespan-table-holder table tbody tr:first-child td.empty,
#timespan-table-holder table tbody tr.gap + tr td.empty {
  border-top: var(--light-border);
}
#timespan-table-holder table tbody tr.minutes-0:not(.gap) th span {
  font-weight: bold;
  font-size: 0.75rem;
  color: var(--primary-color);
}
#timespan-table-holder table td.empty {
  background: transparent;
  color: transparent;
  font-size: 0.1rem;
}

#timespan-table-holder table {
  /* put hatching behind whole table so it lines up across cells */
  background: var(--hatched-background);
  border-spacing: 0;
}
#timespan-table-holder table td {
  padding: 0;
}

#calendar-holder table {
  min-width: 100%;
  border-spacing: 3px;
  margin: -3px;
  padding: 0;
  text-align: right;
}
#calendar-holder table th {
  font-size: 0.9rem;
}
#calendar-holder table td {
  padding: 3px 3px 3px 0;
}
#calendar-holder table td.invalid {
  color: var(--primary-faded-color);
}
#calendar-holder table td div label {
  text-align: right;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

@media (min-width: 300px) {
  #calendar-holder table {
    border-spacing: 5px;
  }
  #calendar-holder table td {
    padding: 4px 4px 4px 1px;
  }
}
#timespan-table-holder table,
#calendar-holder table {
  position: relative;
  background-clip: content-box;
  border-collapse: separate;
}
#timespan-table-holder table td,
#timespan-table-holder table th,
#calendar-holder table td,
#calendar-holder table th {
  background: var(--primary-background);
}
#timespan-table-holder table th,
#calendar-holder table th {
  z-index: 2;
}
#timespan-table-holder table thead th,
#calendar-holder table thead th {
  position: sticky;
  top: 0;
}
#timespan-table-holder table thead th span,
#calendar-holder table thead th span {
  display: block;
}
#timespan-table-holder table thead th span.year,
#calendar-holder table thead th span.year {
  display: none;
  font-size: 0.8em;
  color: var(--primary-faded-color);
}
#timespan-table-holder table thead th span.date,
#calendar-holder table thead th span.date {
  font-size: 0.8em;
}
#timespan-table-holder table thead td,
#calendar-holder table thead td {
  position: sticky;
  top: 0;
  left: 0;
}
#timespan-table-holder table tbody th,
#calendar-holder table tbody th {
  position: sticky;
  left: 0;
}
#timespan-table-holder table td div,
#calendar-holder table td div {
  position: relative;
}
#timespan-table-holder table td div input,
#calendar-holder table td div input {
  appearance: none;
  padding: 0;
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
#timespan-table-holder table td.selected:not(.deselecting), #timespan-table-holder table td.selectable.selecting, #timespan-table-holder table td.available:not(.marking-unavailable), #timespan-table-holder table td.marking-available:not(.empty),
#calendar-holder table td.selected:not(.deselecting),
#calendar-holder table td.selectable.selecting,
#calendar-holder table td.available:not(.marking-unavailable),
#calendar-holder table td.marking-available:not(.empty) {
  background-color: var(--primary-contrast-color);
  color: var(--primary-background);
}

#dates-fieldset #list-dates-view {
  display: none;
}
#dates-fieldset.list-view #list-dates-view {
  display: unset;
}
#dates-fieldset.list-view #calendar-dates-view {
  display: none;
}

table.date-select-calendar {
  border-collapse: collapse;
}
table.date-select-calendar th {
  min-width: 2em;
  text-align: center;
}

body.details-page #grid-view > *,
body.details-page #list-view > *,
body.response-page #grid-view > *,
body.response-page #list-view > * {
  margin: 0;
}
body.details-page #grid-view > * + *,
body.details-page #list-view > * + *,
body.response-page #grid-view > * + *,
body.response-page #list-view > * + * {
  margin-block-start: 1rem;
}
body.details-page:not(.list-view) #grid-view > *,
body.response-page:not(.list-view) #grid-view > * {
  margin: 0;
}
body.details-page:not(.list-view) #grid-view > * + *,
body.response-page:not(.list-view) #grid-view > * + * {
  margin-block-start: 1rem;
}
body.details-page:not(.list-view) #grid-view #timespan-table-holder table,
body.response-page:not(.list-view) #grid-view #timespan-table-holder table {
  width: max-content;
  height: max-content;
}
body.details-page:not(.list-view) #list-view,
body.response-page:not(.list-view) #list-view {
  display: none;
}
body.details-page.list-view #grid-view,
body.response-page.list-view #grid-view {
  display: none;
}
body.details-page.list-view #list-view,
body.response-page.list-view #list-view {
  display: block;
}

body.details-page #response-actions, body.details-page #display-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1em;
}
body.details-page #timespan-table-holder table.empty tbody tr:not(.gap) td:not(.empty) {
  background-color: var(--primary-background);
}
body.details-page #timespan-table-holder table.empty tbody tr:not(.gap) td:not(.empty) * {
  display: none;
}

body.response-page main #main-actions {
  text-align: center;
}
body.response-page main #main-actions p {
  margin: 0;
}
body.response-page main #main-actions p#buttons {
  display: flex;
  justify-content: space-between;
  width: max-content;
  max-width: 100%;
  flex-wrap: wrap;
  margin: 1em auto 0 auto;
}
body.response-page main #main-actions p#buttons * {
  margin: 0 0.6em 0.6em;
}
body.response-page span.response-display-name {
  font-weight: bold;
}

.hidden {
  display: none;
}

body:not(.touch-available) .touch-draw-ui,
body.touch-drawing-active #activate-touch-draw,
body:not(.touch-drawing-active) #deactivate-touch-draw {
  display: none;
}

body.touch-drawing-active #timespan-table-holder table,
body.touch-drawing-active #calendar-holder table {
  touch-action: pinch-zoom;
}

p.form-error {
  border: 3px solid red;
  padding: 4px 6px;
  font-weight: bold;
}

p.form-error::before {
  content: "⚠️ ";
}

#results-text-table,
#options-table,
#availability-table {
  border-collapse: separate;
  border-spacing: 0;
}
#results-text-table col,
#options-table col,
#availability-table col {
  text-align: right;
}
#results-text-table col#text-results-date-col,
#options-table col#text-results-date-col,
#availability-table col#text-results-date-col {
  width: 8.5rem;
}
#results-text-table col#text-results-time-col, #results-text-table col#text-results-end-time-col,
#options-table col#text-results-time-col,
#options-table col#text-results-end-time-col,
#availability-table col#text-results-time-col,
#availability-table col#text-results-end-time-col {
  width: 8rem;
}
#results-text-table col#text-results-length-col,
#options-table col#text-results-length-col,
#availability-table col#text-results-length-col {
  width: 7rem;
}
#results-text-table col#text-results-count-col,
#options-table col#text-results-count-col,
#availability-table col#text-results-count-col {
  width: 6rem;
}
#results-text-table col#text-results-date-col, #results-text-table col#text-results-list-col,
#options-table col#text-results-date-col,
#options-table col#text-results-list-col,
#availability-table col#text-results-date-col,
#availability-table col#text-results-list-col {
  text-align: left;
}
#results-text-table col#text-results-list-col,
#options-table col#text-results-list-col,
#availability-table col#text-results-list-col {
  min-width: 20rem;
}
#results-text-table th, #results-text-table td,
#options-table th,
#options-table td,
#availability-table th,
#availability-table td {
  padding: 0.6em 1.4em;
}
#results-text-table td,
#options-table td,
#availability-table td {
  border-bottom: var(--table-row-divider-border);
  text-align: right;
}
#results-text-table td:last-child,
#options-table td:last-child,
#availability-table td:last-child {
  border-right: none;
}
#results-text-table thead,
#options-table thead,
#availability-table thead {
  position: sticky;
  top: 0;
  background: var(--primary-background);
}
#results-text-table thead th,
#options-table thead th,
#availability-table thead th {
  text-align: left;
  vertical-align: bottom;
  border-bottom: var(--heavy-border);
}
#results-text-table thead th[colspan],
#options-table thead th[colspan],
#availability-table thead th[colspan] {
  border-bottom: var(--faded-border);
}
#results-text-table tbody tr:nth-child(2n),
#options-table tbody tr:nth-child(2n),
#availability-table tbody tr:nth-child(2n) {
  background: var(--primary-alternate-background);
}

#results-text-table td:first-child, #results-text-table td:last-child {
  text-align: left;
}

#options-table td:first-child, #options-table td:nth-child(2) {
  text-align: left;
}

#selected-timeslot-details {
  max-width: 40rem;
}
#selected-timeslot-details > dl > * {
  margin: 0;
}
#selected-timeslot-details > dl > * + * {
  margin-block-start: 1rem;
}
#selected-timeslot-details > dl > div > dt,
#selected-timeslot-details > dl > div > dd {
  display: inline;
}
#selected-timeslot-details > dl > div dt {
  font-weight: bold;
}
#selected-timeslot-details > dl > div dd {
  margin-left: 1ch;
}

#filters-dialog > *:not(.dialog-close-form) {
  margin: 0;
}
#filters-dialog > *:not(.dialog-close-form) + * {
  margin-block-start: 1rem;
}
#filters-dialog > p + ul {
  margin-block-start: 0 !important;
  padding-left: 1rem;
}
#filters-dialog > p + ul li {
  padding: 0;
}
