/* lato-latin-ext-400-normal */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/lato-latin-ext-400-normal.woff2) format('woff2'), url(/assets/lato-latin-ext-400-normal.woff) format('woff');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* lato-latin-400-normal */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/lato-latin-400-normal.woff2) format('woff2'), url(/assets/lato-latin-400-normal.woff) format('woff');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}/* lato-latin-ext-700-normal */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/assets/lato-latin-ext-700-normal.woff2) format('woff2'), url(/assets/lato-latin-ext-700-normal.woff) format('woff');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* lato-latin-700-normal */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/assets/lato-latin-700-normal.woff2) format('woff2'), url(/assets/lato-latin-700-normal.woff) format('woff');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}/* Layout and look taken over from v1, colors per glueckkanja brand guide. */

:root {
  /* glueckkanja palette (brand guide) */
  --gk-mid-blue: #0072C6;
  --gk-light-blue: #5CBBFF;
  --gk-dark-blue: #000520;
  --gk-yellow: #FCD116;
  --gk-red: #E44418;
  --gk-green: #ACD653;
  --gk-light-grey: #F5F5F5;
  --gk-grey: #7F7F7F;

  /* Roles used in this app */
  --default-dark: var(--gk-mid-blue);       /* header, primary buttons */
  --default-link: var(--gk-mid-blue);
  --default-highlight: var(--gk-yellow);    /* link underline, special highlights */
  --default-font: var(--gk-dark-blue);
  --default-heading: var(--gk-dark-blue);
  --default-background: var(--gk-light-grey);
  --default-secondary: var(--gk-grey);      /* secondary buttons/text */
  --default-error: var(--gk-red);           /* error banner */

  /* Bootstrap components (cards, dialogs) use these instead of the body color. */
  --bs-body-color: var(--default-font);
  --bs-heading-color: var(--default-heading);
}

/* iOS 26 tints the area under the status bar with the page (html) background:
   blue here keeps the top edge in the solid header color. The content area stays grey (body). */
html {
  background-color: var(--default-dark);
}

body {
  background-color: var(--default-background);
  color: var(--default-font);
  font-size: 1.2em;
  font-family: "Lato", sans-serif;
  /* Disables the browser's own pull-to-refresh; ours is in pull-to-refresh.js. */
  overscroll-behavior-y: contain;
}

/* No double-tap zoom (taps also react without delay); pinch zoom: viewport meta + ui.js disableZoom. */
html {
  touch-action: manipulation;
}

/* Bootstrap utilities like .d-flex use !important and would override [hidden]. */
[hidden] {
  display: none !important;
}

/* Full-height page layout so the start page can use the free space below its content. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

#start-page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

#start-page > .container {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Account not allowed (guest, see ui.js showMembersOnly): only the members-only hint remains. */
body.is-members-only #start-page-intro,
body.is-members-only #start-page-sign-in,
body.is-members-only #install-button,
body.is-members-only #install-hint-ios,
body.is-members-only #install-banner {
  display: none !important;
}

/* Logo area: takes the remaining height (at most the lower half, pushed to the bottom),
   never smaller than 6rem; the image is scaled down with its aspect ratio kept,
   so it never overlaps buttons or footer. */
.start-logo {
  position: relative;
  flex: 1 1 0;
  min-height: 6rem;
  max-height: 50dvh;
  margin-top: auto;
}

/* Image uses the centered middle 70% of the logo area in both directions. */
.start-logo img {
  position: absolute;
  inset: 15%;
  width: 70%;
  height: 70%;
  object-fit: contain;
}

header {
  padding-top: env(safe-area-inset-top);
  background-color: var(--default-dark);
}

header, section {
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
}

.container {
  max-width: 500px;
}

h1, h2, h3 {
  color: var(--default-heading);
  font-style: normal;
  font-weight: 700;
}

p.first {
  font-size: 1.3em;
}

a {
  color: var(--default-link);
  text-decoration: underline;
  text-decoration-color: var(--default-highlight);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3rem;
}

/* Profile values: only as wide as their text, so the update highlight covers just the value. */
p[data-field],
h1[data-field] {
  width: fit-content;
}

/* The content area switches between contact and social media view (ui.js enableViewToggle).
   cursor: pointer is also needed for iOS to deliver taps on non-link elements. */
main {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Changed value after an update: lights up briefly in GK yellow (fade in, short hold, fade out).
   Duration must match HIGHLIGHT_DURATION_MS in ui.js. */
.is-updated {
  position: relative;
  isolation: isolate; /* keeps the box (z-index -1) behind the text but inside this element */
}

/* The rounded box is a pseudo-element around the text: padding 5px top/bottom, 12px left/right,
   without moving the layout. */
.is-updated::before {
  content: '';
  position: absolute;
  inset: -5px -12px;
  z-index: -1;
  border-radius: 0.5rem;
  background-color: color-mix(in srgb, var(--gk-yellow) 45%, transparent); /* softer, see-through */
  opacity: 0;
  animation: gk-highlight 1.4s ease-in-out;
}

@keyframes gk-highlight {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  55%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Social media link text: long URLs wrap anywhere and are cut after 2 lines with "…". */
a[data-field="socialMedia"] {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

a.link-incognito {
  color: inherit;
  text-decoration: inherit;
}

/* Buttons in corporate colors (overrides Bootstrap's button variables). */

.btn-primary {
  --bs-btn-bg: var(--default-dark);
  --bs-btn-border-color: var(--default-dark);
  --bs-btn-hover-bg: color-mix(in srgb, var(--default-dark), var(--gk-dark-blue) 15%);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--default-dark), var(--gk-dark-blue) 15%);
  --bs-btn-active-bg: color-mix(in srgb, var(--default-dark), var(--gk-dark-blue) 25%);
  --bs-btn-active-border-color: color-mix(in srgb, var(--default-dark), var(--gk-dark-blue) 25%);
  --bs-btn-disabled-bg: var(--default-dark);
  --bs-btn-disabled-border-color: var(--default-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--default-dark);
  --bs-btn-border-color: var(--default-dark);
  --bs-btn-hover-bg: var(--default-dark);
  --bs-btn-hover-border-color: var(--default-dark);
  --bs-btn-active-bg: var(--default-dark);
  --bs-btn-active-border-color: var(--default-dark);
}

.btn-outline-secondary {
  --bs-btn-color: var(--default-secondary);
  --bs-btn-border-color: var(--default-secondary);
  --bs-btn-hover-bg: var(--default-secondary);
  --bs-btn-hover-border-color: var(--default-secondary);
  --bs-btn-active-bg: var(--default-secondary);
  --bs-btn-active-border-color: var(--default-secondary);
}

/* Text buttons ("Continue in browser") look like the links above. */
.btn-link {
  --bs-btn-color: var(--default-link);
  --bs-btn-hover-color: var(--default-link);
  --bs-btn-active-color: var(--default-link);
  text-decoration-color: var(--default-highlight);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3rem;
}

/* Section and field icons (Bootstrap Icons, inline SVG). */

.svg:before {
  padding-right: 0.8em;
}

.svg:after {
  padding-left: 0.4em;
  vertical-align: middle;
}

p.svg-email:before {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26' fill='currentColor' class='bi bi-envelope-at' viewBox='0 0 16 16'><path d='M2 2a2 2 0 0 0-2 2v8.01A2 2 0 0 0 2 14h5.5a.5.5 0 0 0 0-1H2a1 1 0 0 1-.966-.741l5.64-3.471L8 9.583l7-4.2V8.5a.5.5 0 0 0 1 0V4a2 2 0 0 0-2-2H2Zm3.708 6.208L1 11.105V5.383l4.708 2.825ZM1 4.217V4a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v.217l-7 4.2-7-4.2Z'/><path d='M14.247 14.269c1.01 0 1.587-.857 1.587-2.025v-.21C15.834 10.43 14.64 9 12.52 9h-.035C10.42 9 9 10.36 9 12.432v.214C9 14.82 10.438 16 12.358 16h.044c.594 0 1.018-.074 1.237-.175v-.73c-.245.11-.673.18-1.18.18h-.044c-1.334 0-2.571-.788-2.571-2.655v-.157c0-1.657 1.058-2.724 2.64-2.724h.04c1.535 0 2.484 1.05 2.484 2.326v.118c0 .975-.324 1.39-.639 1.39-.232 0-.41-.148-.41-.42v-2.19h-.906v.569h-.03c-.084-.298-.368-.63-.954-.63-.778 0-1.259.555-1.259 1.4v.528c0 .892.49 1.434 1.26 1.434.471 0 .896-.227 1.014-.643h.043c.118.42.617.648 1.12.648Zm-2.453-1.588v-.227c0-.546.227-.791.573-.791.297 0 .572.192.572.708v.367c0 .573-.253.744-.564.744-.354 0-.581-.215-.581-.8Z'/></svg>");
}

p.svg-phone:before {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='26' fill='currentColor' class='bi bi-phone' viewBox='0 0 16 16'><path d='M11 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h6zM5 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H5z'/><path d='M8 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2z'/></svg>");
}

.svg-contact:after {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='currentColor' class='bi bi-person-fill' viewBox='0 0 16 16'><path d='M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z'/></svg>");
}

.svg-business:after {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='currentColor' class='bi bi-briefcase' viewBox='0 0 16 16'><path d='M6.5 1A1.5 1.5 0 0 0 5 2.5V3H1.5A1.5 1.5 0 0 0 0 4.5v8A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-8A1.5 1.5 0 0 0 14.5 3H11v-.5A1.5 1.5 0 0 0 9.5 1h-3zm0 1h3a.5.5 0 0 1 .5.5V3H6v-.5a.5.5 0 0 1 .5-.5zm1.886 6.914L15 7.151V12.5a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5V7.15l6.614 1.764a1.5 1.5 0 0 0 .772 0zM1.5 4h13a.5.5 0 0 1 .5.5v1.616L8.129 7.948a.5.5 0 0 1-.258 0L1 6.116V4.5a.5.5 0 0 1 .5-.5z'/></svg>");
}

/* Heading icon for social media links that are not LinkedIn (Bootstrap Icons "globe", from v1). */
.svg-website:after {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='currentColor' class='bi bi-globe' viewBox='0 0 16 16'><path d='M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm7.5-6.923c-.67.204-1.335.82-1.887 1.855A7.97 7.97 0 0 0 5.145 4H7.5V1.077zM4.09 4a9.267 9.267 0 0 1 .64-1.539 6.7 6.7 0 0 1 .597-.933A7.025 7.025 0 0 0 2.255 4H4.09zm-.582 3.5c.03-.877.138-1.718.312-2.5H1.674a6.958 6.958 0 0 0-.656 2.5h2.49zM4.847 5a12.5 12.5 0 0 0-.338 2.5H7.5V5H4.847zM8.5 5v2.5h2.99a12.495 12.495 0 0 0-.337-2.5H8.5zM4.51 8.5a12.5 12.5 0 0 0 .337 2.5H7.5V8.5H4.51zm3.99 0V11h2.653c.187-.765.306-1.608.338-2.5H8.5zM5.145 12c.138.386.295.744.468 1.068.552 1.035 1.218 1.65 1.887 1.855V12H5.145zm.182 2.472a6.696 6.696 0 0 1-.597-.933A9.268 9.268 0 0 1 4.09 12H2.255a7.024 7.024 0 0 0 3.072 2.472zM3.82 11a13.652 13.652 0 0 1-.312-2.5h-2.49c.062.89.291 1.733.656 2.5H3.82zm6.853 3.472A7.024 7.024 0 0 0 13.745 12H11.91a9.27 9.27 0 0 1-.64 1.539 6.688 6.688 0 0 1-.597.933zM8.5 12v2.923c.67-.204 1.335-.82 1.887-1.855.173-.324.33-.682.468-1.068H8.5zm3.68-1h2.146c.365-.767.594-1.61.656-2.5h-2.49a13.65 13.65 0 0 1-.312 2.5zm2.802-3.5a6.959 6.959 0 0 0-.656-2.5H12.18c.174.782.282 1.623.312 2.5h2.49zM11.27 2.461c.247.464.462.98.64 1.539h1.835a7.024 7.024 0 0 0-3.072-2.472c.218.284.418.598.597.933zM10.855 4a7.966 7.966 0 0 0-.468-1.068C9.835 1.897 9.17 1.282 8.5 1.077V4h2.355z'/></svg>");
}

.svg-linkedin:after {
  content: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='currentColor' class='bi bi-linkedin' viewBox='0 0 16 16'><path d='M0 1.146C0 .513.526 0 1.175 0h13.65C15.474 0 16 .513 16 1.146v13.708c0 .633-.526 1.146-1.175 1.146H1.175C.526 16 0 15.487 0 14.854V1.146zm4.943 12.248V6.169H2.542v7.225h2.401zm-1.2-8.212c.837 0 1.358-.554 1.358-1.248-.015-.709-.52-1.248-1.342-1.248-.822 0-1.359.54-1.359 1.248 0 .694.521 1.248 1.327 1.248h.016zm4.908 8.212V9.359c0-.216.016-.432.08-.586.173-.431.568-.878 1.232-.878.869 0 1.216.662 1.216 1.634v3.865h2.401V9.25c0-2.22-1.184-3.252-2.764-3.252-1.274 0-1.845.7-2.165 1.193v.025h-.016a5.54 5.54 0 0 1 .016-.025V6.169h-2.4c.03.678 0 7.225 0 7.225h2.4z'/></svg>");
}

/* iOS share icon in the install hint (Bootstrap Icons "box-arrow-up"). */
.icon-share {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.15em;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='%230072C6' viewBox='0 0 16 16'><path fill-rule='evenodd' d='M3.5 6a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5h-2a.5.5 0 0 1 0-1h2A1.5 1.5 0 0 1 14 6.5v8a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 14.5v-8A1.5 1.5 0 0 1 3.5 5h2a.5.5 0 0 1 0 1z'/><path fill-rule='evenodd' d='M7.646.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 1.707V10.5a.5.5 0 0 1-1 0V1.707L5.354 3.854a.5.5 0 1 1-.708-.708z'/></svg>") no-repeat center / contain;
}

/* Pull-to-refresh spinner, slides down from the top. */

/* Fixed square box + border-radius 50% = circle (padding around an inline spinner made it oval). */
.pull-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 0.5rem);
  left: 50%;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6rem;
  height: 6rem;
  transform: translate(-50%, 0);
  opacity: 0;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

/* After release the indicator moves to one third of the screen height (centered there). */
.pull-indicator.is-refreshing,
.pull-indicator.is-success,
.pull-indicator.is-error {
  top: calc(100dvh / 3); /* same target as refreshPositionOffset() in pull-to-refresh.js */
  transform: translate(-50%, -50%);
  opacity: 1;
  transition: top 0.3s ease-out, transform 0.3s ease-out, opacity 0.2s ease-out;
}

/* Fade-out after the result icon (pull-to-refresh.js waits for it before resetting). */
.pull-indicator.is-leaving {
  opacity: 0;
}

/* Released before the end position: circle slides back up and fades out. */
.pull-indicator.is-returning {
  transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

/* Page dimming via --pull-dim (0 = normal, 1 = greyed out, 40% opacity):
   - while pulling: set by pull-to-refresh.js, follows the finger (no transition)
   - while refreshing (release until the result icon disappears): 1, page does not react to taps
   - released early / pushed back up: fades back in */
header,
main {
  opacity: calc(1 - 0.6 * var(--pull-dim, 0));
  filter: grayscale(var(--pull-dim, 0));
  transition: opacity 0.3s, filter 0.3s;
}

body.is-pulling > header,
body.is-pulling > main {
  transition: none;
}

body.is-refreshing {
  --pull-dim: 1;
}

body.is-refreshing > header,
body.is-refreshing > main {
  pointer-events: none;
}

/* Label fixed below the circle's refresh position (center at 1/3 height + half of the 6rem circle):
   fades in step by step while pulling, fades out on release. */
.pull-label {
  position: fixed;
  top: calc(100dvh / 3 + 3rem + 0.6rem + 5dvh); /* + 5% of the screen height as gap to the circle */
  left: 50%;
  z-index: 1030;
  transform: translateX(-50%);
  pointer-events: none;
  white-space: nowrap;
  /* GK icon style: flat yellow shape with an offset dark-blue outline (see ::before), no shadow */
  padding: 0.35rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--gk-yellow);
  color: var(--gk-dark-blue);
  /* 1.2rem, but scaled down on narrow screens so the single line always fits */
  font-size: min(1.2rem, 5.5vw);
  opacity: 0;
  transition: opacity 0.5s ease-out;   /* fade-out */
}

.pull-label::before {
  content: '';
  position: absolute;
  inset: 0;
  transform: translate(-4px, -4px);
  border: 2px solid var(--gk-dark-blue);
  border-radius: inherit;
}

/* Return from the Entra ID sign-in page (ui.js showSignInProgress): label shown below the
   spinner while the sign-in completes and the profile loads; fades in and out. */
body.is-signing-in .pull-label {
  opacity: 1;
}

/* While pulling, the opacity follows the finger (set by pull-to-refresh.js), no delay. */
body.is-pulling .pull-label {
  transition: none;
}

/* One icon per state: spinner (pulling/refreshing), checkbox (success), skull (error).
   All icons lie on top of each other in the center; switching cross-fades them quickly
   (old one shrinks and fades out, new one grows in). */
.pull-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3.6rem;
  height: 3.6rem;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out, filter 0.25s ease-out;
}

/* While pulling, the spinner stays greyed out until the end position is reached ("armed",
   releasing now starts the refresh); then it fades into color. */
.pull-indicator:not(.is-armed):not(.is-refreshing) .pull-icon-spinner {
  filter: grayscale(1) opacity(0.5);
}

/* 70% of the spinner size */
.pull-icon-success,
.pull-icon-error {
  width: 2.52rem;
  height: 2.52rem;
}

.pull-indicator:not(.is-success):not(.is-error) .pull-icon-spinner,
.pull-indicator.is-success .pull-icon-success,
.pull-indicator.is-error .pull-icon-error {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Spinner: outer ring turns clockwise, the two green dots orbit the other way.
   transform-origin is the center of the 300x300 viewBox. */
.spinner-ring,
.spinner-dots {
  transform-origin: 150px 150px;
}

.pull-indicator.is-refreshing .spinner-ring {
  animation: pull-spin 1.6s linear infinite;
}

.pull-indicator.is-refreshing .spinner-dots {
  animation: pull-spin 1.1s linear infinite reverse;
}

@keyframes pull-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Debug line in dev environment: version, build, OS, display mode. */

/* Bottom status lines (info + debug), stacked. Last item of the body flex column, sticky at the
   bottom of the screen: the page keeps room for them without measuring, and they stay visible
   while scrolling. */
.status-footer {
  position: sticky;
  bottom: 0;
  flex: none;
  z-index: 1000;
  padding: 0 0.5rem calc(env(safe-area-inset-bottom) + 0.2rem);
  text-align: center;
  pointer-events: none;
}

/* Installed PWA on iPhone (iOS 26, status bar black-translucent): after rotating back to portrait,
   WebKit sometimes switches the viewport height back and forth between the full screen and the
   screen without the status bar area (62pt) on every frame, until the screen is touched. Everything
   bound to the bottom of the viewport (fixed, sticky, 100dvh) jumped up and down with it.
   Here the page height uses the large viewport (100lvh, full screen, not affected) and the status
   lines stay in the page flow at the end of the page instead of sticking to the viewport bottom
   (on long pages, e.g. landscape, they come after the content). */
@media (display-mode: standalone) {
  body {
    min-height: 100lvh;
  }

  .status-footer {
    position: static;
  }
}

/* Info line: e.g. "Last updated 15 days ago" (data older than refresh.dataMaxAgeDays). */
.info {
  padding-top: 0.2rem;
  color: var(--gk-grey);
  font-size: 1rem;
}

/* Debug line (environment 'dev'): smaller and lighter, below the menu button. */
.debug {
  padding-top: 0.2rem;
  color: #adb5bd;
  font-size: 0.65rem;
}

/* Menu button row between info and debug line: fixed place at the bottom right, with some
   distance to the right edge and to the bottom. */
.menu-bar {
  display: flex;
  justify-content: flex-end;
  padding-right: calc(env(safe-area-inset-right) + 0.75rem);
  padding-bottom: 0.75rem;
}

/* 52px touch target around the 36px icon; the footer ignores taps (pointer-events: none), the
   button does not. */
.menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--default-font);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

/* Hover only with a mouse: on touch screens it would stick after the tap. */
.menu-button:focus-visible {
  background-color: rgb(0 5 32 / 8%);
}

@media (hover: hover) {
  .menu-button:hover {
    background-color: rgb(0 5 32 / 8%);
  }
}

/* Info line ("Last updated 44 days ago") not with the menu: the menu shows the age after the
   "Last update" time instead. The menu button keeps its place (the line is above it). */
.status-footer:has(#menu-button[aria-expanded="true"]) #info {
  display: none !important;
}

/* Open menu: "menu_open" icon instead of "menu". */
.menu-button[aria-expanded="true"] .menu-icon-open,
.menu-button[aria-expanded="false"] .menu-icon-close {
  display: none;
}

/* Menu (ui.js enableMenu). While it rises (or sinks back) it lies over the card in the content area;
   once open it replaces the card in the page flow, so long content scrolls normally. */
main {
  position: relative;
}

#menu {
  flex: 1 0 auto;
  background-color: var(--default-background);
  cursor: auto;
}

#menu.is-animating {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

body.is-menu-open #profile,
body.is-menu-open #start-page {
  display: none !important;
}

/* App logo (color) right of the heading text, like the icons of the card headings. */
.menu-logo {
  height: 1.3em;
  width: auto;
  margin-left: 0.3em;
  vertical-align: -0.3em;
}

/* Profile, last update, app version: smaller than the body text; long user names (UPN) wrap
   instead of overflowing. */
.menu-value {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

/* Values after the label in GK grey (like the info line), so they look lighter than the label. */
.menu-value > span {
  color: var(--gk-grey);
}

/* Remaining debug details below the app version: light grey like the debug line. */
.menu-details {
  margin-top: 5px;
  color: #adb5bd;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.menu-actions {
  margin-top: 3rem;
}

/* Bottom banner ("No internet connection"). */

.banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0.6rem 1rem calc(env(safe-area-inset-bottom) + 0.6rem);
  background-color: var(--default-error);
  color: #ffffff;
  text-align: center;
  font-size: 0.9rem;
}

/* Cards at the bottom: stale-data question, install banner. */

.bottom-card {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(env(safe-area-inset-bottom) + 1rem);
  z-index: 1050;
  max-width: 468px;
  margin: 0 auto;
  font-size: 1rem;
}

/* Touch screens: the small card buttons ("Later" / "Sign in", "Not now" / "Install") are 25% larger
   than Bootstrap's btn-sm (0.875rem font, 0.25rem / 0.5rem padding). */
@media (pointer: coarse) {
  .bottom-card .btn-sm {
    --bs-btn-font-size: 1.09rem;
    --bs-btn-padding-y: 0.3125rem;
    --bs-btn-padding-x: 0.625rem;
  }
}

/* QR code: as wide as the column allows (90%), but on short screens (e.g. iPhone SE, 667px) only as
   large as the height left for it: header, the three headings, the link and the status lines below
   (menu button always, info and debug line only when shown) stay on the screen without scrolling. */
body:has(#info:not([hidden])) {
  --info-line-height: 1.75rem;
}

body:has(#debug:not([hidden])) {
  --debug-line-height: 2.25rem; /* two lines on narrow screens */
}

img[data-field="socialMediaQr"] {
  --qr-status-lines: calc(var(--info-line-height, 0px) + var(--debug-line-height, 0px));
  --qr-safe-areas: calc(env(safe-area-inset-top) + env(safe-area-inset-bottom));
  width: max(8rem, min(90%, calc(100dvh - 28.5rem - var(--qr-status-lines) - var(--qr-safe-areas))));
}

/* Landscape layout for phones (little height, a lot of width). Tablets and desktops (taller than
   500px) keep the portrait layout. The same media query is used in ui.js (landscapeLayout). */
@media (orientation: landscape) and (max-height: 500px) {
  /* Slimmer header: py-4 (Bootstrap utility, !important) and logo height reduced. */
  header > .container {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  header img {
    height: 28px;
  }

  /* Profile: contact information and billing address side by side, social media below.
     The tap toggle works as in portrait (collapses both, opens social media). */
  #profile > .container {
    max-width: 960px;
  }

  #profile .profile-group-half {
    width: 50%;
  }

  /* Smaller headings, so "Contact information" fits on one line in half the width. */
  #profile h1 {
    font-size: 1.6rem;
  }

  /* Long e-mail addresses wrap instead of overflowing the column. */
  #profile .profile-group-half a {
    overflow-wrap: anywhere;
  }

  /* Billing address and social media headings: same top margin as "Contact information"
     (mt-3 instead of mt-4), saves height. */
  .profile-group-billing > :first-child,
  .profile-group-social > :first-child {
    margin-top: 1rem !important;
  }

  /* Social media: heading with the link below it on the left, QR code on the right from the
     heading's height down (same columns as contact information / billing address). */
  #profile .profile-group-social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
  }

  .social-media-link {
    grid-column: 1;
    grid-row: 2;
    text-align: start !important;
  }

  .social-media-link > p {
    margin-top: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    text-align: start !important;
  }

  .social-media-qr {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 1rem !important;
  }

  /* QR code: sized to the height left below header and the first headings row and above the
     status lines (variables see above), at least 8rem. */
  img[data-field="socialMediaQr"] {
    width: max(8rem, min(90%, calc(100dvh - 16rem - var(--qr-status-lines) - var(--qr-safe-areas))));
  }

  /* Start page: text and buttons on the left, logo on the right. */
  #start-page > .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2rem;
    align-content: center;
    max-width: 960px;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  #start-page > .container > * {
    grid-column: 1;
  }

  #start-page > .container > .start-logo {
    grid-column: 2;
    grid-row: 1 / span 4;
    max-height: none;
    margin-top: 0;
  }
}
