:root {
  color-scheme: light;
  --bar: #d5dde4;
  --bar-text: #37474f;
  --bar-pressed: #c3cdd6;
  /* Der aktive Tab hat die Farbe der Kopfzeilen darunter und geht in die Seite über. */
  --tab: #ffffff;
  --accent: #1976d2;
  --page: #eceff1;
  --muted: #546e7a;
  --bar-height: 44px;
}

/* Dunkle Farben wie bei GROHE Blue, damit Display und eingebettete Seiten zusammenpassen. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bar: #0a1016;
  --bar-text: #8fa3b5;
  --bar-pressed: #1c2a36;
  --tab: #16212b;
  --accent: #3d9be0;
  --page: #0e151c;
  --muted: #8fa3b5;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  grid-template-rows: var(--bar-height) minmax(0, 1fr);
  overflow: hidden;
  background: var(--page);
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
}

.bar {
  display: flex;
  gap: 4px;
  padding: 4px 4px 0;
  background: var(--bar);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tabs {
  display: flex;
  flex: 1 1 auto;
  gap: 4px;
  min-width: 0;
}

.tab,
.theme-toggle {
  border: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--bar-text);
  cursor: pointer;
  touch-action: manipulation;
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-toggle {
  display: grid;
  flex: 0 0 48px;
  place-items: center;
  padding: 0;
}

.theme-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Das Symbol zeigt, wohin ein Tipp umschaltet. */
:root[data-theme="dark"] .icon-moon,
:root:not([data-theme="dark"]) .icon-sun {
  display: none;
}

.tab:active,
.theme-toggle:active {
  background: var(--bar-pressed);
}

.tab[aria-selected="true"] {
  background: var(--tab);
  color: var(--accent);
  box-shadow: inset 0 3px var(--accent);
}

.tab:focus-visible,
.theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.panels {
  position: relative;
}

/* Inaktive Tabs nur unsichtbar machen statt display: none, damit die Seiten ihre echte
   Größe behalten und ihr Layout beim Laden im Hintergrund richtig berechnen. */
.panel {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.panel.is-active {
  visibility: visible;
}

.panel iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.panel.is-loading iframe {
  visibility: hidden;
}

.loading {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.panel.is-loading .loading {
  display: grid;
}
