html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(0, 127, 182, .5);
}


.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* The confirmation dialog can open over another dialog (deleting a label from the label dialog). */
.confirm-dialog { z-index: 1070; }
.modal-backdrop ~ .modal-backdrop { z-index: 1065; }

/* Sensor status dots (legacy status images; 2026 design: a light left and dark right half with a short soft
   transition, and a thin white ring). */
.status-dot {
  --dot-light: #c4c9ce;
  --dot-dark: #9aa1a8;
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 3px; /* room for the ring */
  border-radius: 50%;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--dot-light) 0 46%, var(--dot-dark) 54% 100%);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, 0.12);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.status-ok { --dot-light: #3db54a; --dot-dark: #0e9441; }
.status-doubtful { --dot-light: #f7941d; --dot-dark: #f15a29; }
.status-error { --dot-light: #ed1c24; --dot-dark: #be1e2d; }
.status-no-connection { --dot-light: #27aae1; --dot-dark: #1475bc; }
.status-defect { --dot-light: #ffdd15; --dot-dark: #fdbd3b; }
.status-doubtful-purple { --dot-light: #92278f; --dot-dark: #662d91; }

/* Sensor table on the Sensoren page (2026 design): a blue panel, a navy header row, white and light-blue rows,
   blue grid lines and navy text. */
.sensor-panel {
  background-color: #1b9ad6;
  padding: 1px;
  margin-bottom: 0.75rem;
}

.sensor-panel .table-responsive { background-color: #fff; }

.sensor-table {
  --bs-table-color: #1f3c88;
  --bs-table-bg: #fff;
  --bs-table-border-color: #1b9ad6;
  --bs-table-hover-color: #1f3c88;
  --bs-table-hover-bg: rgba(27, 154, 214, 0.28);
  margin-bottom: 0;
  border-color: #1b9ad6;
}

.sensor-table > thead > tr > th {
  --bs-table-bg: #1f3c88;
  --bs-table-color: #fff;
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
}

.sensor-table > tbody > tr:nth-of-type(even) > * { --bs-table-bg: #cde9f8; }

.sensor-table a { color: #1f3c88; }
.sensor-table .sensor-module { color: #4a64a8; }

.sensor-icon {
  display: inline-flex;
  padding: 0.15rem;
  border-radius: 0.25rem;
  vertical-align: middle;
}
a.sensor-icon:hover, a:hover > .sensor-icon { color: #1b9ad6; }

@media (max-width: 575.98px) {
  .sensor-panel { margin-left: -0.75rem; margin-right: -0.75rem; }
  .sensor-table { font-size: 0.8125rem; }
  .sensor-table > thead > tr > th { white-space: normal; vertical-align: bottom; }
  .sensor-table .status-dot { width: 1.15rem; height: 1.15rem; }
}

@media print {
  .sensor-panel { background: none; padding: 0; }
  .sensor-table, .sensor-table * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Measurement chart on the sensor details page (legacy height 370px). */
.sensor-chart {
  height: 370px;
  width: 100%;
}

.trend-chart { height: 460px; width: 100%; }
/* The legacy vertical trend was a 601 x 700 image (1012 x 1179 enlarged); the extra height holds the legend on top. */
.trend-chart-vertical { width: 100%; max-width: 760px; aspect-ratio: 601 / 728; margin-inline: auto; }
/* Holding a finger on the paper adds a label: no iOS callout or text selection there. */
.trend-chart-vertical { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.trend-chart-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--bs-secondary-color);
}
.trend-container:fullscreen { padding: 1rem; }
.trend-container:fullscreen .trend-chart { height: calc(100vh - 2rem); }
.trend-container:fullscreen .trend-chart-vertical { height: calc(100vh - 2rem); width: auto; max-width: none; margin: 0 auto; }

@media print {
  header, footer, .d-print-none { display: none !important; }
  /* Fixed paper sizes, centred; trend-chart.js redraws the chart at exactly these sizes on beforeprint. */
  .trend-chart { width: 18cm; height: 16cm; margin-inline: auto; }
  .trend-chart-vertical { width: 18cm; height: auto; max-width: none; margin-inline: auto; }
}

/* GPS map on the sensor overview: full width, 3:2 on phones and tablets and 3:1 on a PC (from lg), where 3:2 was
   too high (decided 2026-10-30; legacy was 270px high). */
.location-map {
  width: 100%;
  aspect-ratio: 3 / 2;
}
@media (min-width: 992px) {
  .location-map { aspect-ratio: 3 / 1; }
}
.label-search-text {
  white-space: pre-line;
  min-width: 12rem;
}

/* ---- Home page (2026 web design): login card on the right, on phones above the bands, contact card below. ---- */
.home-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "login" "content" "contact";
}

.home-layout > .home-content { grid-area: content; }
.home-layout > .home-login { grid-area: login; }
.home-layout > .home-contact { grid-area: contact; }

@media (min-width: 992px) {
  .home-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "content login" "content contact";
    align-items: start;
  }
}

/* The text in bands: light blue, dark blue with faint diagonal lines, white. The light blue is the house blue
   rather than the design's brighter cyan, so white text stays readable (contrast 4.6:1). */
.home-band {
  padding: 1.5rem 1.75rem;
}

.home-band-light {
  background: var(--lo-blue);
  color: #fff;
}

/* The designer's dark blue background (images/bg/dark-{800,1600}.jpg), for the dark bands and the contact card. */
.home-band-dark,
.contact-card,
.login-panel {
  background: #1b2c5e url("/images/bg/dark-1600.jpg") center / cover no-repeat; /* without image-set() */
  background: #1b2c5e image-set(url("/images/bg/dark-800.jpg") 1x, url("/images/bg/dark-1600.jpg") 2x) center / cover no-repeat;
  color: #fff;
}

.contact-card {
  border: 0;
  border-radius: 0;
  background-position: left bottom;
}

.contact-card .card-body {
  padding: 1.5rem 1.75rem;
}

.contact-card-title {
  color: var(--lo-cyan);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.contact-card address {
  font-weight: 700;
  line-height: 1.6;
}

.contact-card a {
  color: inherit;
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

/* Login page: the login card and the contact details on the dark background, filling the content area. */
.login-panel {
  display: flex;
  align-items: center;
  min-height: 60vh;
  margin-top: .25rem;
  padding: 3rem 1.5rem;
}

/* The panel is the dark background already: the contact details sit directly on it. */
.login-panel .contact-card {
  background: none;
}

@media (max-width: 575.98px) {
  .login-panel {
    min-height: 0;
    padding: 1.5rem .75rem;
  }
}

/* Beside a form (Contact, sign-up): the card as high as the form, as in the design. */
@media (min-width: 992px) {
  .contact-aside > .contact-card {
    height: 100%;
  }
}

@media print {
  .contact-card,
  .login-panel {
    background: none;
    color: inherit;
  }
}

.home-band-white {
  background: #fff;
  color: var(--lo-navy);
}

.home-band-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
}

.home-band-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0;
}

/* The legacy icons are red and blue: a white tile keeps them visible on the blue bands. */
.home-band-icon {
  margin-left: auto;
  height: 3rem;
  width: auto;
  padding: .25rem;
  background: #fff;
  border-radius: .5rem;
  box-sizing: content-box;
}

/* The photo tiles between the bands: four in a row with white lines between them (the client's request), 2 x 2 on
   phones, where a row of four would be too small and one tile per gap too large for the ~160 px sources. */
.home-photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  background: #fff;
}

.home-photos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@media (max-width: 575.98px) {
  .home-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-band-icon {
    height: 2.25rem;
  }
}

.home-band ul {
  padding-left: 1.25rem;
}

.home-band > :last-child {
  margin-bottom: 0;
}

.home-band-button {
  --bs-btn-color: #fff;
  --bs-btn-bg: #1d3f8f;
  --bs-btn-border-color: #1d3f8f;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #17336f;
  --bs-btn-hover-border-color: #17336f;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #142c60;
  --bs-btn-active-border-color: #142c60;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: .6rem 2.5rem;
  border-radius: .5rem;
}

@media (max-width: 575.98px) {
  .home-band {
    padding: 1.25rem 1rem;
  }
}

@media print {
  .home-band {
    background: none;
    color: inherit;
    padding-inline: 0;
  }
}

/* The legacy banner above the navbar. */
.site-banner {
  padding-top: .5rem;
}

/* ---- Legacy look: house colours (style.css links/bold #007FB6, menu text #243751, chevron cyan). ---- */
:root {
  --lo-blue: #007fb6;
  --lo-blue-dark: #00658f;
  --lo-navy: #243751;
  --lo-cyan: #109cd9;
  --bs-primary: #007fb6;
  --bs-primary-rgb: 0, 127, 182;
  --bs-primary-text-emphasis: #003349;
  --bs-primary-bg-subtle: #cce5f0;
  --bs-primary-border-subtle: #99cce2;
  --bs-link-color: #007fb6;
  --bs-link-color-rgb: 0, 127, 182;
  --bs-link-hover-color: #00658f;
  --bs-link-hover-color-rgb: 0, 101, 143;
  --bs-focus-ring-color: rgba(0, 127, 182, .25);
}

.btn-primary {
  --bs-btn-bg: var(--lo-blue);
  --bs-btn-border-color: var(--lo-blue);
  --bs-btn-hover-bg: var(--lo-blue-dark);
  --bs-btn-hover-border-color: var(--lo-blue-dark);
  --bs-btn-active-bg: #005a80;
  --bs-btn-active-border-color: #005a80;
  --bs-btn-disabled-bg: var(--lo-blue);
  --bs-btn-disabled-border-color: var(--lo-blue);
  --bs-btn-focus-shadow-rgb: 0, 127, 182;
}

.btn-outline-primary {
  --bs-btn-color: var(--lo-blue);
  --bs-btn-border-color: var(--lo-blue);
  --bs-btn-hover-bg: var(--lo-blue);
  --bs-btn-hover-border-color: var(--lo-blue);
  --bs-btn-active-bg: var(--lo-blue-dark);
  --bs-btn-active-border-color: var(--lo-blue-dark);
  --bs-btn-disabled-color: var(--lo-blue);
  --bs-btn-disabled-border-color: var(--lo-blue);
  --bs-btn-focus-shadow-rgb: 0, 127, 182;
}

.btn-link {
  --bs-btn-color: var(--lo-blue);
  --bs-btn-hover-color: var(--lo-blue-dark);
}

/* Bootstrap writes these colours literally instead of through --bs-primary. */
.form-check-input:checked {
  background-color: var(--lo-blue);
  border-color: var(--lo-blue);
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: #80bfdb;
}

.form-switch .form-check-input:focus:not(:checked) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2380bfdb'/%3e%3c/svg%3e");
}

.dropdown-menu {
  --bs-dropdown-link-active-bg: var(--lo-blue);
}

/* ---- Legacy menu bar (Images/menubackground.jpg, menuitem.png): light grey, navy line, bold uppercase. ---- */
.site-navbar {
  background: linear-gradient(#f6f6f6, #ebebeb);
  border-bottom: 3px solid var(--lo-navy);
  --bs-navbar-color: var(--lo-navy);
  --bs-navbar-hover-color: var(--lo-navy);
  --bs-navbar-active-color: var(--lo-navy);
  --bs-navbar-brand-color: var(--lo-navy);
  --bs-navbar-brand-hover-color: var(--lo-navy);
  --lo-nav-hover-bg: #e2e2e2;
}

.site-navbar .navbar-nav .nav-link {
  color: var(--bs-navbar-color);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  border-radius: .25rem;
}

@media (min-width: 992px) {
  .site-navbar .navbar-nav .nav-link {
    padding-inline: .75rem;
  }
}

.site-navbar .navbar-nav .nav-link::before {
  content: "»";
  color: var(--lo-cyan);
  margin-right: .35rem;
}

.site-navbar .navbar-nav .nav-link:hover,
.site-navbar .navbar-nav .nav-link.active,
.site-navbar .navbar-nav .show > .nav-link {
  background-color: var(--lo-nav-hover-bg);
}

/* Per-host branding (Branding:Hosts:{host}:NavbarColor): a coloured bar with white text, no chevrons (legacy grube). */
.site-navbar.navbar-branded {
  background: var(--brand-navbar);
  border-bottom-color: rgba(0, 0, 0, .25);
  --bs-navbar-color: rgba(255, 255, 255, .9);
  --bs-navbar-hover-color: #fff;
  --bs-navbar-active-color: #fff;
  --bs-navbar-brand-color: #fff;
  --bs-navbar-brand-hover-color: #fff;
  --lo-nav-hover-bg: rgba(255, 255, 255, .15);
}

.site-navbar.navbar-branded .navbar-nav .nav-link::before {
  content: none;
}

/* ---- Legacy page background (Images/bg.gif: dark navy tile) with the site in a white column on top. ---- */
body {
  background: #032f4f url("/images/bg.gif") repeat;
}

body.plain-background {
  background: #fff;
}

/* Phone: the white column is the full width, so the tile would only show when dragging past the edge. */
@media (max-width: 575.98px) {
  html {
    overscroll-behavior-x: none;
  }

  body {
    background: #fff;
  }
}

.site-page {
  background-color: #fff;
  box-shadow: 0 0 1.25rem rgba(0, 0, 0, .35);
}

@media print {
  body, .site-page {
    background: #fff;
    box-shadow: none;
  }

  /* At A4 width Bootstrap's containers fall to their 540 px step: the page then had white margins on the left and
     cut wide content (the 18 cm trend chart) off on the right. On paper the content uses the full width. */
  .site-page,
  .site-page .container {
    max-width: none;
  }
}

/* Language flags (legacy Images/Languages gifs, now SVG): same height, a hairline so white stripes show. */
.language-flag {
  /* One 3:2 size, so the names line up; the 2:1 British flag is trimmed a little at the sides. */
  height: .9rem;
  width: 1.35rem;
  object-fit: cover;
  vertical-align: -.1rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
}

/* Collapsed menu: the current page (styled as a menu item) and user, the location, then the menu icon. */
.site-navbar > .container-fluid {
  column-gap: .5rem;
}

.site-navbar .site-navbar-toggler {
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: .5rem;
  border: 0;
  padding: .25rem 0;
}

/* Only below lg: from lg on, Bootstrap hides the toggler and display: flex would bring it back. */
@media (max-width: 991.98px) {
  .site-navbar .site-navbar-toggler {
    display: flex;
  }
}

/* Touch only (the keyboard uses the menu icon): no ring framing the bar after every tap. */
.site-navbar .site-navbar-toggler:focus {
  box-shadow: none;
}

/* As high as the location dropdown beside it. */
.site-navbar .site-navbar-menu {
  line-height: 1;
  font-size: 1rem;
  padding: .2rem .5rem;
}

.site-navbar .current-page {
  color: var(--bs-navbar-active-color);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding-left: .5rem;
  white-space: nowrap;
}

.site-navbar .current-page::before {
  content: "»";
  color: var(--lo-cyan);
  margin-right: .35rem;
}

.site-navbar.navbar-branded .current-page::before {
  content: none;
}

/* Every menu item starts with "»" so they line up, also the dropdowns; on desktop the flag stays without one. */
@media (min-width: 992px) {
  .site-navbar .navbar-nav .language-toggle::before {
    content: none;
  }
}

/* Collapsed menu: the logged-in user, always visible. */
.site-navbar .current-user {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  max-width: 50%;
  margin-left: auto;
  color: var(--bs-navbar-color);
  font-size: .8rem;
}

.site-navbar .site-device {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 0 1 16rem;
  min-width: 0;
}

/* Phone: page and user on the first row, the location and the menu icon on the second. */
@media (max-width: 575.98px) {
  .site-navbar .has-device .site-navbar-toggler {
    flex-basis: 100%;
  }

  .site-navbar .has-device .site-device {
    flex: 1 1 0;
    margin-top: .25rem;
  }
}

/* Desktop: the menu's parts become items of the bar, so the location can sit between them and fill it. */
@media (min-width: 992px) {
  .site-navbar.navbar-expand-lg .navbar-collapse {
    display: contents !important;
  }

  .site-navbar .navbar-collapse > .navbar-nav:first-child {
    order: 1;
  }

  .site-navbar .site-device {
    order: 2;
    flex: 1 1 auto;
    min-width: 8rem;
    margin-inline: .5rem;
  }

  .site-navbar .navbar-collapse > .navbar-nav:last-child {
    order: 3;
  }

  .site-navbar .nav-user .navbar-text {
    white-space: nowrap;
  }
}

/* Small desktops: closer menu items, so the location keeps room. */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-navbar .has-device .navbar-nav .nav-link {
    padding-inline: .4rem;
  }
}

/* The menu's own user entry is then only for screen readers. */
@media (max-width: 991.98px) {
  .site-navbar .nav-user {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}
