html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

* {
  font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif !important;
}

@media (min-width: 1200px) {
  .container {
    max-width: 880px;
  }
}

p {
  font-size: 1.5rem;
}

.navbar-brand {
  padding: 8px;
  padding-right: 30px;
  padding-left: 15px;
}

colors[["sz"]] <- "#E17832"
colors[["taz"]] <- "#A53237"
colors[["faz"]] <- "#006E78"

.navbar-nav li:nth-child(1) a {color: black !important;}
.navbar-nav li:nth-child(2) a {color: #006E78 !important;}
.navbar-nav li:nth-child(3) a {color: #1e5f46 !important;}
.navbar-nav li:nth-child(4) a {color: #A53237 !important;}
.navbar-nav li:nth-child(5) a {color: #E17832 !important;}

.nav li {
  text-align: center;
}

details {
  padding-top: 0.5em;
}

summary {
  display: list-item;
  cursor: pointer;
  font-size: 2.2rem;
  padding-top: 0.5em;
}

details[open] {
  padding-top: 0.5em;
}

details[open] summary {
  margin-bottom: 0.5em;
}

.irs-bar, .irs-single {
  background: #006E78 !important;
  border-color: #006E78 !important;
}

#startpage-table {
  margin-top: 30px;
  margin-bottom: 30px;
  text-align: center;
  color: #006E78;
  b {
    font-size: 3rem;
  }
  .col-12 {
    margin-bottom: 25px;
  }
}

.popup {
  position: relative;
  display: inline;
  cursor: pointer;
  color: #006E78;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.popup .popuptext {
  visibility: hidden;
  opacity: 0;
  width: min(500px, calc(100vw - 48px));
  padding: 14px 18px;
  background-color: #fbfdfd;
  color: #243b3f;
  border: 1px solid rgba(0, 110, 120, 0.18);
  border-top: 4px solid #006E78;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.14);
  position: absolute;
  z-index: 1000;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.55;
  text-align: left;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.popup .popuptext::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 16px;
  height: 16px;
  background-color: #fbfdfd;
  border-left: 1px solid rgba(0, 110, 120, 0.18);
  border-top: 1px solid rgba(0, 110, 120, 0.18);
  transform: translateX(-50%) rotate(45deg);
}

.popup .popuptext b {
  color: #006E78;
}

.popup:hover .popuptext,
.popup:focus-within .popuptext {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.container-fluid {
  max-width: 1500px;
  padding: 5px;
}

.topic-intro {
  margin-bottom: 15px;
}

.topic-controls {
  margin-top: 30px;
  margin-bottom: 100px;
}

.topic-controls .row {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.topic-control-column {
  display: flex;
  justify-content: center;
}

.topic-control-column .form-group {
  width: min(100%, 340px);
}

.topic-chart-block {
  margin-bottom: 20px;
  padding-left: 4vw;
  padding-right: 4vw;
}

.topic-chart-block + .topic-chart-block {
  margin-top: 12px;
}

.topic-chart-block-last {
  margin-bottom: 250px;
}

.key-events-panel {
  max-width: 1180px;
  margin: 26px auto 44px;
  padding: 24px 0 0;
  border-top: 1px solid rgba(0, 110, 120, 0.18);
}

.key-events-panel h3 {
  margin: 0 0 18px;
  color: #243b3f;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.25;
}

.key-events-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.key-events-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  min-width: 0;
}

.key-events-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  background: #4B5F6A;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.key-events-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.key-events-date {
  color: #5f6f73;
  font-size: 1.08rem;
  line-height: 1.25;
}

.key-events-label {
  margin-top: 4px;
  color: #243b3f;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}

.key-events-description {
  margin-top: 5px;
  color: #5f6f73;
  font-size: 1.08rem;
  line-height: 1.45;
}

#start__stats_panel .start-dictionary-controls {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.start-dictionary-button-label {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 100%;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1040px) {
  .key-events-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 699px) {
  body {
    font-size: 15px;
  }

  p {
    font-size: 1.25rem;
    line-height: 1.45;
  }

  summary {
    font-size: 1.7rem;
  }

  .navbar-brand {
    padding-right: 12px;
  }

  .navbar-brand img {
    height: 28px !important;
  }

  .navbar .container-fluid,
  .navbar-nav,
  .navbar-nav > li,
  .navbar-nav > li > a {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .navbar > .container-fluid .navbar-header,
  .navbar > .container-fluid .navbar-brand {
    margin-left: 0;
    margin-right: 0;
  }

  .navbar-nav {
    width: 100%;
  }

  .fluid-page > .row,
  .container > .row,
  .container-fluid > .row {
    margin-left: 0;
    margin-right: 0;
  }

  .topic-intro {
    margin-bottom: 0;
    padding-left: 18px;
    padding-right: 18px;
  }

  .topic-controls {
    margin-top: 24px;
    margin-bottom: 36px;
  }

  .topic-controls .row {
    display: block;
    margin-left: 0;
    margin-right: 0;
  }

  .topic-control-column {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 14px;
  }

  .topic-control-column .form-group,
  .topic-control-column .selectize-control {
    width: 100%;
  }

  .topic-dictionary-control {
    display: block;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .topic-dictionary-control .form-group {
    width: 100%;
  }

  .topic-dictionary-control .selectize-control,
  .topic-dictionary-control .selectize-input,
  .topic-dictionary-control .selectize-dropdown {
    width: 100% !important;
    max-width: 100% !important;
  }

  .topic-control-column .selectize-input {
    min-height: 44px;
    white-space: normal;
  }

  .topic-control-column .selectize-input input {
    width: 1px !important;
  }

  .topic-control-column .selectize-input > .item,
  .topic-control-column .selectize-dropdown-content .option {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
  }

  .start-dictionary-button {
    height: auto !important;
    line-height: 1.22 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .topic-chart-block,
  .topic-chart-block-last {
    margin-bottom: 72px;
    margin-top: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .topic-chart-block .shiny-plot-output,
  .topic-chart-block .plotly,
  .topic-chart-block .js-plotly-plot {
    width: 100% !important;
  }

  .topic-chart-block .shiny-plot-output,
  .topic-chart-block .html-widget,
  .topic-chart-block .plotly,
  .topic-chart-block .js-plotly-plot {
    height: 500px !important;
  }

  .key-events-panel {
    margin: 18px 0 26px;
    padding-top: 18px;
  }

  .key-events-panel h3 {
    margin-bottom: 14px;
    font-size: 1.4rem;
  }

  .key-events-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .key-events-list li {
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 10px;
  }

  .key-events-number {
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }

  .key-events-date,
  .key-events-description {
    font-size: 1.05rem;
  }

  .key-events-label {
    font-size: 1.15rem;
    line-height: 1.35;
  }

  .popup .popuptext {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 18px;
    width: auto;
    max-height: 62vh;
    overflow-y: auto;
    transform: none;
    font-size: 1.2rem;
  }

  .popup .popuptext::before {
    display: none;
  }

  .popup:hover .popuptext,
  .popup:focus-within .popuptext {
    transform: none;
  }
}

@media screen and (max-width: 475px) {
  #start__stats_panel .start-dictionary-controls,
  html body.bslib-page-navbar div.container-fluid div.tab-content div.tab-pane.active div.container div#start__stats_panel.shiny-html-output div.start-dictionary-controls {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    max-width: 100% !important;
    padding-left: 18px;
    padding-right: 18px;
  }

  #start__stats_panel .start-dictionary-controls > .start-dictionary-button,
  html body.bslib-page-navbar div.container-fluid div.tab-content div.tab-pane.active div.container div#start__stats_panel.shiny-html-output div.start-dictionary-controls > .start-dictionary-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex: none !important;
    flex-basis: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 54px !important;
    padding: 10px 12px !important;
    line-height: 1.25 !important;
  }

  .start-dictionary-button-label {
    align-self: stretch;
    hyphens: auto;
    line-height: 1.25;
  }

  #startpage-table {
    gap: 10px;
    margin-top: 22px !important;
  }

  #startpage-table .start-stat-tile {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    padding: 6px 18px !important;
  }

  #startpage-table .start-stat-card {
    min-height: 0 !important;
    padding: 18px 16px !important;
  }

  #startpage-table .start-stat-value {
    font-size: 2.25rem !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  #startpage-table .start-stat-label {
    margin-top: 8px !important;
    font-size: 1.3rem !important;
    line-height: 1.45 !important;
  }

  #startpage-table .start-stat-detail {
    margin-top: 8px !important;
    font-size: 1.15rem !important;
    line-height: 1.45 !important;
  }
}

