/* =========================================================
   Material 3 Components — Sturm und Gewitterjagd Tirol
   Setzt m3.css voraus.
   ========================================================= */

/* ============ BUTTONS ============ */
/* Common ripple-like state layer */
.m3-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 24px;
  border-radius: var(--md-sys-shape-corner-full);
  font: var(--md-sys-typescale-label-large-weight) var(--md-sys-typescale-label-large-size)/var(--md-sys-typescale-label-large-line-height) var(--md-sys-typescale-label-large-font);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
              box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.m3-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  pointer-events: none;
}
.m3-btn:hover::before  { opacity: var(--md-sys-state-hover-opacity); }
.m3-btn:focus-visible::before { opacity: var(--md-sys-state-focus-opacity); outline: none; }
.m3-btn:active::before { opacity: var(--md-sys-state-pressed-opacity); }
.m3-btn .material-symbols-outlined { font-size: 18px; }

/* Filled */
.m3-btn--filled        { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.m3-btn--filled:hover  { box-shadow: var(--md-sys-elevation-level1); }

/* Tonal */
.m3-btn--tonal         { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }

/* Tonal Tertiary (Lime-Akzent) */
.m3-btn--tertiary      { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }

/* Outlined */
.m3-btn--outlined      { background: transparent; color: var(--md-sys-color-primary); border: 1px solid var(--md-sys-color-outline); }

/* Text */
.m3-btn--text          { background: transparent; color: var(--md-sys-color-primary); padding-left: 12px; padding-right: 12px; }

/* Elevated */
.m3-btn--elevated      { background: var(--md-sys-color-surface-container-low); color: var(--md-sys-color-primary); box-shadow: var(--md-sys-elevation-level1); }
.m3-btn--elevated:hover{ box-shadow: var(--md-sys-elevation-level2); }

/* Sizes */
.m3-btn--sm { min-height: 32px; padding: 6px 16px; font-size: var(--md-sys-typescale-label-medium-size); }
.m3-btn--lg { min-height: 56px; padding: 16px 32px; font-size: 16px; }
.m3-btn--block { display: flex; width: 100%; }

/* ============ ICON BUTTON ============ */
.m3-icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: var(--md-sys-shape-corner-full);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--md-sys-color-on-surface-variant);
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  -webkit-tap-highlight-color: transparent;
}
.m3-icon-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: currentColor; opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  pointer-events: none;
}
.m3-icon-btn:hover::before  { opacity: var(--md-sys-state-hover-opacity); }
.m3-icon-btn:active::before { opacity: var(--md-sys-state-pressed-opacity); }
.m3-icon-btn--filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.m3-icon-btn--tonal  { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.m3-icon-btn--lg { width: 48px; height: 48px; }

/* ============ FAB ============ */
.m3-fab {
  position: relative;
  min-width: 56px; height: 56px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  box-shadow: var(--md-sys-elevation-level3);
  font: var(--md-sys-typescale-label-large-weight) var(--md-sys-typescale-label-large-size)/1 var(--md-sys-typescale-label-large-font);
  transition: box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.m3-fab::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: currentColor; opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  pointer-events: none;
}
.m3-fab:hover::before  { opacity: var(--md-sys-state-hover-opacity); }
.m3-fab:hover          { box-shadow: var(--md-sys-elevation-level4); }
.m3-fab:active::before { opacity: var(--md-sys-state-pressed-opacity); }
.m3-fab--surface  { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-primary); }
.m3-fab--primary  { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.m3-fab--tertiary { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.m3-fab--extended { min-width: 80px; }
.m3-fab--sm  { width: 40px; min-width: 40px; height: 40px; border-radius: var(--md-sys-shape-corner-medium); padding: 0; }
.m3-fab--lg  { width: 96px; height: 96px; border-radius: var(--md-sys-shape-corner-extra-large); padding: 0; }
.m3-fab--lg .material-symbols-outlined { font-size: 36px; }

/* ============ CARD ============ */
.m3-card {
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 16px;
  position: relative;
  transition: box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}
.m3-card--elevated  { background: var(--md-sys-color-surface-container-low); box-shadow: var(--md-sys-elevation-level1); }
.m3-card--elevated:hover { box-shadow: var(--md-sys-elevation-level2); }
.m3-card--filled    { background: var(--md-sys-color-surface-container-highest); }
.m3-card--outlined  { background: var(--md-sys-color-surface); border: 1px solid var(--md-sys-color-outline-variant); }
.m3-card--clickable { cursor: pointer; -webkit-tap-highlight-color: transparent; text-decoration: none; color: inherit; display: block; }
.m3-card--clickable::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--md-sys-color-on-surface); opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  pointer-events: none;
}
.m3-card--clickable:hover::after  { opacity: var(--md-sys-state-hover-opacity); }
.m3-card--clickable:active::after { opacity: var(--md-sys-state-pressed-opacity); }

/* ============ CHIP ============ */
.m3-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-small);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-label-large-weight) var(--md-sys-typescale-label-large-size)/1 var(--md-sys-typescale-label-large-font);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  text-decoration: none;
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
              border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  -webkit-tap-highlight-color: transparent;
}
.m3-chip .material-symbols-outlined { font-size: 18px; }
.m3-chip::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--md-sys-color-on-surface); opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3);
  pointer-events: none;
}
.m3-chip:hover::before  { opacity: var(--md-sys-state-hover-opacity); }
.m3-chip:active::before { opacity: var(--md-sys-state-pressed-opacity); }
.m3-chip.is-selected, .m3-chip[aria-selected="true"] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}
.m3-chip--assist { /* base */ }
.m3-chip--input  { padding-left: 12px; padding-right: 12px; }
.m3-chip--suggestion { background: transparent; }

/* ============ TOP APP BAR ============ */
.m3-top-app-bar {
  position: sticky; top: 0; z-index: 30;
  height: 64px;
  padding: 0 4px 0 4px;
  display: flex; align-items: center; gap: 4px;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  transition: background var(--md-sys-motion-duration-short3);
}
.m3-top-app-bar--scrolled { background: var(--md-sys-color-surface-container); box-shadow: 0 1px 0 var(--md-sys-color-outline-variant); }
.m3-top-app-bar__leading { display: flex; align-items: center; }
.m3-top-app-bar__title {
  flex: 1;
  font: var(--md-sys-typescale-title-large-weight) var(--md-sys-typescale-title-large-size)/var(--md-sys-typescale-title-large-line-height) var(--md-sys-typescale-title-large-font);
  padding: 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m3-top-app-bar__trailing { display: flex; align-items: center; gap: 4px; padding-right: 4px; }

/* Admin: Paket- & Add-on-Test (früher „Umschalten“ im Legacy-Header) */
.m3-admin-test-tools {
  position: relative;
}
.m3-admin-test-tools > summary {
  list-style: none;
  cursor: pointer;
}
.m3-admin-test-tools > summary::-webkit-details-marker {
  display: none;
}
.m3-admin-test-tools__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  min-width: 240px;
  max-width: min(320px, 92vw);
  max-height: min(70dvh, 520px);
  overflow: auto;
  padding: 8px 0 10px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-level3);
}
.m3-admin-test-tools__label {
  margin: 0;
  padding: 4px 16px 8px;
  font: 600 11px/1.2 var(--md-ref-typeface-plain);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
}
.m3-admin-test-tools__label--divider {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.m3-admin-test-tools__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  font: 500 14px/1.3 var(--md-ref-typeface-plain);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
}
.m3-admin-test-tools__item:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}
.m3-admin-test-tools__item.is-active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.m3-admin-test-tools__item .material-symbols-outlined {
  font-size: 18px;
}
.m3-admin-test-tools__addons {
  padding: 0 8px 4px;
}
.m3-admin-test-tools__addon-form {
  margin: 0;
}
.m3-admin-test-tools__check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: var(--md-sys-shape-corner-small);
  font: 500 14px/1.3 var(--md-ref-typeface-plain);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
}
.m3-admin-test-tools__check:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 6%, transparent);
}
.m3-admin-test-tools__check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--md-sys-color-primary);
  cursor: pointer;
}
.m3-admin-test-tools__reset-form {
  margin: 6px 12px 0;
  padding-top: 8px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.m3-admin-test-tools__reset {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  background: transparent;
  font: 600 13px/1.2 var(--md-ref-typeface-plain);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
}
.m3-admin-test-tools__reset:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}
body.wk-page .m3-admin-test-tools__menu {
  background: rgba(18, 32, 46, 0.98);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}
body.wk-page .m3-admin-test-tools__item,
body.wk-page .m3-admin-test-tools__check {
  color: rgba(255, 255, 255, 0.92);
}
body.wk-page .m3-admin-test-tools__item.is-active {
  background: rgba(37, 99, 235, 0.35);
  color: #fff;
}
body.wk-page .m3-admin-test-tools__label--divider,
body.wk-page .m3-admin-test-tools__reset-form {
  border-color: rgba(255, 255, 255, 0.12);
}
body.wk-page .m3-admin-test-tools__reset {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
}

/* Center-aligned variant */
.m3-top-app-bar--center .m3-top-app-bar__title { text-align: center; }

/* Large variant: shrinks on scroll */
.m3-top-app-bar--large {
  height: auto;
  flex-wrap: wrap;
  padding-bottom: 28px;
}
.m3-top-app-bar--large .m3-top-app-bar__row { display: flex; align-items: center; width: 100%; padding: 4px 4px 0; gap: 4px; }
.m3-top-app-bar--large .m3-top-app-bar__title {
  font: 700 32px/40px var(--md-ref-typeface-brand);
  letter-spacing: -0.01em;
  padding: 16px 16px 0;
  flex: 0 0 100%;
}

/* ============ BOTTOM NAVIGATION BAR ============ */
.m3-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  height: 80px;
  background: var(--md-sys-color-surface-container);
  display: flex; align-items: stretch;
  padding: 12px 0 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  /* shadow above to lift it off content */
  box-shadow: 0 -1px 0 var(--md-sys-color-outline-variant);
}
.m3-bottom-nav__item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 4px;
  padding: 0 4px;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.m3-bottom-nav__indicator {
  width: 64px; height: 32px;
  border-radius: var(--md-sys-shape-corner-full);
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  position: relative;
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}
.m3-bottom-nav__indicator::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: currentColor; opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3);
}
.m3-bottom-nav__item:hover .m3-bottom-nav__indicator::before  { opacity: var(--md-sys-state-hover-opacity); }
.m3-bottom-nav__item:active .m3-bottom-nav__indicator::before { opacity: var(--md-sys-state-pressed-opacity); }
.m3-bottom-nav__indicator .material-symbols-outlined { font-size: 24px; }
.m3-bottom-nav__label {
  font: var(--md-sys-typescale-label-medium-weight) var(--md-sys-typescale-label-medium-size)/var(--md-sys-typescale-label-medium-line-height) var(--md-sys-typescale-label-medium-font);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
}
.m3-bottom-nav__item.is-active {
  color: var(--md-sys-color-on-surface);
}
.m3-bottom-nav__item.is-active .m3-bottom-nav__indicator {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.m3-bottom-nav__item.is-active .m3-bottom-nav__indicator .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.m3-bottom-nav__item.is-active .m3-bottom-nav__label {
  font-weight: 600;
}
.m3-bottom-nav__badge {
  position: absolute; top: -4px; right: 16px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  font: 600 10px/16px var(--md-ref-typeface-plain);
  display: inline-flex; align-items: center; justify-content: center;
}

/* Reserve space so content isn't covered */
body.has-bottom-nav { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* ============ NAVIGATION DRAWER (modal) ============ */
.m3-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: var(--md-sys-color-scrim);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
              visibility 0s var(--md-sys-motion-duration-medium2);
}
.m3-scrim.is-open { opacity: 0.4; visibility: visible; transition-delay: 0s; }

.m3-drawer {
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 90;
  width: min(360px, 90vw);
  background: var(--md-sys-color-surface-container-low);
  color: var(--md-sys-color-on-surface);
  padding: 12px 12px 12px 16px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--md-sys-motion-duration-long1) var(--md-sys-motion-easing-emphasized-decel);
  display: flex; flex-direction: column; gap: 4px;
}
.m3-drawer.is-open { transform: translateX(0); }
.m3-drawer__head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 8px;
  color: var(--md-sys-color-on-surface);
}
.m3-drawer__brand {
  display: inline-flex; align-items: center; gap: 12px;
  min-width: 0; flex: 1;
  text-decoration: none; color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.m3-drawer__brand-logo {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}
.m3-drawer__brand-mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  display: grid; place-items: center;
  font: 700 16px/1 var(--md-ref-typeface-brand);
  flex-shrink: 0;
}
.m3-drawer__brand-name {
  font: 700 18px/1.2 var(--md-ref-typeface-brand);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m3-drawer__head__close { margin-left: auto; flex-shrink: 0; }
.m3-drawer__section-label {
  padding: 18px 16px 8px;
  font: var(--md-sys-typescale-title-small-weight) var(--md-sys-typescale-title-small-size)/var(--md-sys-typescale-title-small-line-height) var(--md-sys-typescale-title-small-font);
  letter-spacing: var(--md-sys-typescale-title-small-tracking);
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
}
.m3-drawer__item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 56px;
  padding: 0 24px 0 16px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  font: var(--md-sys-typescale-label-large-weight) var(--md-sys-typescale-label-large-size)/var(--md-sys-typescale-label-large-line-height) var(--md-sys-typescale-label-large-font);
  -webkit-tap-highlight-color: transparent;
}
.m3-drawer__item::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: currentColor; opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3);
  pointer-events: none;
}
.m3-drawer__item:hover::before  { opacity: var(--md-sys-state-hover-opacity); }
.m3-drawer__item:active::before { opacity: var(--md-sys-state-pressed-opacity); }
.m3-drawer__item.is-active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.m3-drawer__item.is-active .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.m3-drawer__item .count {
  margin-left: auto;
  font: var(--md-sys-typescale-label-small-weight) var(--md-sys-typescale-label-small-size)/1 var(--md-sys-typescale-label-small-font);
}

body.no-scroll { overflow: hidden; }

/* ============ ADMIN SIDEBAR (Desktop) ============ */
.m3-admin-sidebar {
  position: sticky;
  top: 0;
  width: 280px;
  min-width: 280px;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--md-sys-color-surface);
  border-right: 1px solid var(--md-sys-color-outline-variant);
}
.m3-admin-sidebar__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 12px;
  flex-shrink: 0;
}
.m3-admin-sidebar__mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  display: grid;
  place-items: center;
  font-family: var(--md-ref-typeface-brand);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.m3-admin-sidebar__title {
  font: 700 18px/22px var(--md-ref-typeface-brand);
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.01em;
}
.m3-admin-sidebar__sub {
  margin-top: 2px;
  font: 400 12px/16px var(--md-ref-typeface-plain);
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.m3-admin-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 12px;
}
.m3-admin-sidebar__footer {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.m3-admin-sidebar__exit {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-full);
  text-decoration: none;
  font: 500 14px/20px var(--md-ref-typeface-plain);
  color: var(--md-sys-color-on-surface-variant);
  position: relative;
}
.m3-admin-sidebar__exit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3);
  pointer-events: none;
}
.m3-admin-sidebar__exit:hover::before { opacity: var(--md-sys-state-hover-opacity); }
.m3-admin-sidebar__exit--primary {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.m3-admin-sidebar__exit--primary .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* ============ NAVIGATION RAIL (Desktop, Admin) ============ */
.m3-rail {
  position: sticky; top: 0;
  width: 80px; min-width: 80px;
  height: 100vh;
  background: var(--md-sys-color-surface);
  display: flex; flex-direction: column;
  padding: 8px 0;
  align-items: center;
  gap: 4px;
  overflow-y: auto;
  border-right: 1px solid var(--md-sys-color-outline-variant);
}
.m3-rail__menu  { margin: 12px 0 8px; }
.m3-rail__fab   { margin-bottom: 16px; }
.m3-rail__item {
  position: relative;
  width: 80px;
  padding: 8px 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.m3-rail__indicator {
  position: relative;
  width: 56px; height: 32px;
  border-radius: var(--md-sys-shape-corner-full);
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  transition: background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}
.m3-rail__indicator::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: currentColor; opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3);
  pointer-events: none;
}
.m3-rail__item:hover .m3-rail__indicator::before  { opacity: var(--md-sys-state-hover-opacity); }
.m3-rail__item:active .m3-rail__indicator::before { opacity: var(--md-sys-state-pressed-opacity); }
.m3-rail__item.is-active .m3-rail__indicator {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.m3-rail__item.is-active .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24; }
.m3-rail__item.is-active { color: var(--md-sys-color-on-surface); }
.m3-rail__label {
  font: var(--md-sys-typescale-label-medium-weight) var(--md-sys-typescale-label-medium-size)/1 var(--md-sys-typescale-label-medium-font);
  letter-spacing: var(--md-sys-typescale-label-medium-tracking);
}
.m3-rail__brand {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  display: grid; place-items: center;
  font: 700 18px/1 var(--md-ref-typeface-brand);
  margin-bottom: 8px;
}
.m3-rail__divider { width: 56px; height: 1px; background: var(--md-sys-color-outline-variant); margin: 8px 0; }
.m3-rail__bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 12px; }
.m3-rail__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container);
  display: grid; place-items: center;
  font: 700 14px/1 var(--md-ref-typeface-plain);
}

/* ============ LIST ITEM ============ */
.m3-list { display: flex; flex-direction: column; }
.m3-list-item {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  min-height: 56px;
  padding: 8px 16px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.m3-list-item::before {
  content: ""; position: absolute; inset: 0;
  background: currentColor; opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3);
  pointer-events: none;
}
.m3-list-item:hover::before  { opacity: var(--md-sys-state-hover-opacity); }
.m3-list-item:active::before { opacity: var(--md-sys-state-pressed-opacity); }
.m3-list-item__leading { width: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--md-sys-color-on-surface-variant); }
.m3-list-item__body { flex: 1; min-width: 0; }
.m3-list-item__headline { font: var(--md-sys-typescale-body-large-weight) var(--md-sys-typescale-body-large-size)/var(--md-sys-typescale-body-large-line-height) var(--md-sys-typescale-body-large-font); }
.m3-list-item__support { font: var(--md-sys-typescale-body-medium-weight) var(--md-sys-typescale-body-medium-size)/var(--md-sys-typescale-body-medium-line-height) var(--md-sys-typescale-body-medium-font); color: var(--md-sys-color-on-surface-variant); }
.m3-list-item__trailing { color: var(--md-sys-color-on-surface-variant); font: var(--md-sys-typescale-label-small-weight) var(--md-sys-typescale-label-small-size)/1 var(--md-sys-typescale-label-small-font); }
.m3-divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 0; border: 0; }

/* ============ TEXT FIELDS (outlined) ============ */
.m3-field { position: relative; display: block; }
.m3-field input,
.m3-field select,
.m3-field textarea {
  width: 100%;
  height: 56px;
  padding: 18px 16px 6px;
  font: var(--md-sys-typescale-body-large-weight) var(--md-sys-typescale-body-large-size)/var(--md-sys-typescale-body-large-line-height) var(--md-sys-typescale-body-large-font);
  color: var(--md-sys-color-on-surface);
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  outline: none;
  transition: border-color var(--md-sys-motion-duration-short3);
}
.m3-field textarea { height: auto; min-height: 96px; resize: vertical; padding-top: 24px; }
.m3-field input:focus,
.m3-field select:focus,
.m3-field textarea:focus { border-color: var(--md-sys-color-primary); border-width: 2px; padding-left: 15px; padding-right: 15px; }
.m3-field label {
  position: absolute;
  top: 18px; left: 12px;
  padding: 0 4px;
  background: var(--md-sys-color-background);
  color: var(--md-sys-color-on-surface-variant);
  font: var(--md-sys-typescale-body-large-weight) var(--md-sys-typescale-body-large-size)/1 var(--md-sys-typescale-body-large-font);
  pointer-events: none;
  transition: top var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
              font-size var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-short3);
}
.m3-field input:focus + label,
.m3-field input:not(:placeholder-shown) + label,
.m3-field select:focus + label,
.m3-field select:not(:placeholder-shown) + label,
.m3-field textarea:focus + label,
.m3-field textarea:not(:placeholder-shown) + label {
  top: -8px;
  font-size: var(--md-sys-typescale-body-small-size);
  color: var(--md-sys-color-primary);
}
.m3-field__support {
  font: var(--md-sys-typescale-body-small-weight) var(--md-sys-typescale-body-small-size)/var(--md-sys-typescale-body-small-line-height) var(--md-sys-typescale-body-small-font);
  letter-spacing: var(--md-sys-typescale-body-small-tracking);
  color: var(--md-sys-color-on-surface-variant);
  padding: 4px 16px 0;
}

/* ============ SWITCH ============ */
.m3-switch {
  --switch-w: 52px;
  --switch-h: 32px;
  position: relative;
  display: inline-block;
  width: var(--switch-w); height: var(--switch-h);
  flex-shrink: 0;
}
.m3-switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.m3-switch__track {
  position: absolute; inset: 0;
  background: var(--md-sys-color-surface-container-highest);
  border: 2px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  transition: background var(--md-sys-motion-duration-short3), border-color var(--md-sys-motion-duration-short3);
  pointer-events: none;
}
.m3-switch__thumb {
  position: absolute;
  top: 8px; left: 8px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--md-sys-color-outline);
  transition: transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized),
              width var(--md-sys-motion-duration-short3),
              height var(--md-sys-motion-duration-short3),
              top var(--md-sys-motion-duration-short3),
              left var(--md-sys-motion-duration-short3),
              background var(--md-sys-motion-duration-short3);
  pointer-events: none;
}
.m3-switch input:checked ~ .m3-switch__track {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}
.m3-switch input:checked ~ .m3-switch__thumb {
  width: 24px; height: 24px;
  top: 4px; left: 24px;
  background: var(--md-sys-color-on-primary);
}

/* ============ SEGMENTED BUTTON ============ */
.m3-segmented {
  display: inline-flex;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  overflow: hidden;
  height: 40px;
}
.m3-segmented button {
  position: relative;
  flex: 1;
  padding: 0 16px;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font: var(--md-sys-typescale-label-large-weight) var(--md-sys-typescale-label-large-size)/1 var(--md-sys-typescale-label-large-font);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
  border: none;
  border-right: 1px solid var(--md-sys-color-outline);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.m3-segmented button:last-child { border-right: none; }
.m3-segmented button::before { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity var(--md-sys-motion-duration-short3); }
.m3-segmented button:hover::before { opacity: var(--md-sys-state-hover-opacity); }
.m3-segmented button.is-selected,
.m3-segmented button[aria-selected="true"] {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.m3-segmented button .material-symbols-outlined { font-size: 18px; }

/* ============ BADGES ============ */
.m3-badge {
  display: inline-flex; align-items: center;
  height: 16px; min-width: 16px; padding: 0 6px;
  border-radius: 8px;
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  font: 600 11px/16px var(--md-ref-typeface-plain);
}
.m3-badge--lg { height: 24px; min-width: 24px; padding: 0 8px; border-radius: 12px; font-size: 13px; line-height: 24px; }

.m3-icon-btn--badge {
  overflow: visible;
}
.m3-icon-btn--alert {
  color: var(--md-sys-color-error, #BA1A1A);
}
.m3-icon-btn--alert .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}
.m3-icon-btn__badge {
  position: absolute;
  top: 2px;
  right: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--md-sys-color-error, #BA1A1A);
  color: #fff;
  font: 700 11px/1 var(--md-ref-typeface-plain, system-ui, sans-serif);
  letter-spacing: 0;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--md-sys-color-surface, #fff);
}

/* ============ WARN LEVEL CHIPS ============ */
.m3-warn-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: var(--md-sys-shape-corner-small);
  font: var(--md-sys-typescale-label-large-weight) var(--md-sys-typescale-label-large-size)/1 var(--md-sys-typescale-label-large-font);
  letter-spacing: var(--md-sys-typescale-label-large-tracking);
}
.m3-warn-chip--1 { background: var(--md-sys-color-warn-1-container); color: var(--md-sys-color-on-warn-1-container); }
.m3-warn-chip--2 { background: var(--md-sys-color-warn-2-container); color: var(--md-sys-color-on-warn-2-container); }
.m3-warn-chip--3 { background: var(--md-sys-color-warn-3-container); color: var(--md-sys-color-on-warn-3-container); }
.m3-warn-chip--4 { background: var(--md-sys-color-warn-4-container); color: var(--md-sys-color-on-warn-4-container); }
.m3-warn-chip--5 { background: var(--md-sys-color-warn-5-container); color: var(--md-sys-color-on-warn-5-container); }

.m3-warn-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
}
.m3-warn-dot--1 { background: var(--md-sys-color-warn-1); }
.m3-warn-dot--2 { background: var(--md-sys-color-warn-2); }
.m3-warn-dot--3 { background: var(--md-sys-color-warn-3); }
.m3-warn-dot--4 { background: var(--md-sys-color-warn-4); }
.m3-warn-dot--5 { background: var(--md-sys-color-warn-5); }

/* ============ LAYOUT HELPERS ============ */
.m3-container { width: 100%; padding: 0 16px; }
@media (min-width: 600px)  { .m3-container { padding: 0 24px; } }
@media (min-width: 905px)  { .m3-container { max-width: 840px; margin: 0 auto; } }
@media (min-width: 1240px) { .m3-container { max-width: 1040px; } }
@media (min-width: 1440px) { .m3-container { max-width: 1240px; } }

.m3-stack { display: flex; flex-direction: column; gap: 16px; }
.m3-row   { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ============ KUNDEN-ÜBERSICHT — gemeinsame Spaltenbreite ============ */
.ku-dashboard {
  box-sizing: border-box;
  width: 100%;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.ku-dashboard__column {
  box-sizing: border-box;
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ku-dashboard__column > .m3-day-overview,
.ku-dashboard__column > #todayTilesHost,
.ku-dashboard__column > .m3-loc-section,
.ku-dashboard__column .m3-today-board,
.ku-dashboard__column > .ku-locations,
.ku-dashboard__column > .section {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}
.ku-dashboard__column > .m3-day-overview {
  margin: 16px 0 0;
}
.ku-dashboard__column .m3-day-overview {
  width: 100%;
}
.ku-dashboard__column > .m3-loc-section {
  margin-top: 12px;
}

/* ============ ORTS-KACHELN (Kundenübersicht) ============ */
.m3-loc-section {
  width: 100%;
  max-width: none;
  margin: 28px 0 0;
  padding: 0 0 16px;
  box-sizing: border-box;
}
.m3-loc-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.m3-loc-section__title {
  margin: 0;
  font: 700 20px/1.25 var(--md-ref-typeface-brand);
  color: var(--md-sys-color-on-surface);
}
.m3-loc-section__badge {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.m3-loc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) {
  .m3-loc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .m3-loc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.m3-loc-grid__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-large);
}

.m3-loc-tile.m3-card {
  padding: 12px 36px 12px 12px;
}
.m3-loc-tile {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 12px 36px 12px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  border: none;
  width: 100%;
  font: inherit;
  color: inherit;
  box-sizing: border-box;
}
.m3-loc-tile.m3-card--elevated {
  box-shadow: var(--md-sys-elevation-level1);
}
.m3-loc-tile:hover {
  box-shadow: var(--md-sys-elevation-level2);
}
.m3-loc-tile:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.m3-loc-tile.is-active,
.m3-loc-tile.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}
.m3-loc-tile__icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
}
.m3-loc-tile__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}
.m3-loc-tile__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m3-loc-tile__temps {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.m3-loc-tile__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.m3-loc-tile__remove .material-symbols-outlined {
  font-size: 18px;
}
.m3-loc-tile__remove:hover {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.m3-loc-add {
  margin-top: 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  overflow: hidden;
}
.m3-loc-add > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  color: var(--md-sys-color-primary);
}
.m3-loc-add > summary::-webkit-details-marker { display: none; }
.m3-loc-add[open] > summary {
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.m3-loc-add__body { padding: 16px; }

/* Legacy-Klasse cities-forecast-card darf Layout nicht zerstören */
.cities-forecast-card.m3-loc-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  max-width: none;
}
.cities-forecast-card.m3-loc-tile img.m3-loc-tile__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

/* ============ TAGESÜBERSICHT (7–14 Tage + Nacht dazwischen) ============ */
.m3-day-overview {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-level1);
}
.m3-day-overview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.m3-day-overview__title {
  margin: 0;
  font: 700 20px/1.25 var(--md-ref-typeface-brand);
  color: var(--md-sys-color-on-surface);
}
.m3-day-overview__badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}
.m3-day-overview__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
.m3-day-overview__chip {
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}
.m3-day-overview__legend {
  color: var(--md-sys-color-on-surface-variant);
  font-style: italic;
}

.m3-day-overview__track {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 12px 14px 16px;
  margin: 0;
  scroll-padding-inline: 16px 12px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--md-sys-color-outline) transparent;
}
.m3-day-overview__track::-webkit-scrollbar { height: 6px; }
.m3-day-overview__track::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: 999px;
}

/* Tageskachel */
.m3-day-tile.m3-card {
  flex: 0 0 auto;
  width: 92px;
  min-width: 92px;
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  scroll-snap-align: start;
  cursor: pointer;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font: inherit;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.m3-day-tile:hover {
  box-shadow: var(--md-sys-elevation-level2);
  border-color: var(--md-sys-color-primary);
}
.m3-day-tile:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.m3-day-tile.is-active,
.m3-day-tile.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary);
}
.m3-day-tile.is-trend {
  border-style: dashed;
  opacity: 0.92;
}
.m3-day-tile__dow {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.m3-day-tile__date {
  font-size: 11px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.2;
}
.m3-day-tile.is-active .m3-day-tile__date,
.m3-day-tile.active .m3-day-tile__date {
  color: inherit;
  opacity: 0.85;
}
.m3-day-tile__icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin: 2px 0;
}
.m3-day-tile__temps {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  line-height: 1.1;
}
.m3-day-tile__tmax {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.m3-day-tile__tmin {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}
.m3-day-tile__prec {
  font-size: 10px;
  font-weight: 600;
  color: var(--md-sys-color-tertiary);
  margin-top: 2px;
}
.m3-day-tile.is-active .m3-day-tile__prec,
.m3-day-tile.active .m3-day-tile__prec {
  color: inherit;
  opacity: 0.9;
}

/* Nacht zwischen zwei Tagen */
.m3-day-night-gap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 44px;
  min-width: 44px;
  padding: 0 2px;
  pointer-events: none;
}
.m3-day-night-gap__ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-highest);
  border: 2px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-level1);
}
.m3-day-night-gap__icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

@media (min-width: 600px) {
  .m3-day-tile.m3-card {
    width: 100px;
    min-width: 100px;
    padding: 14px 12px 12px;
  }
  .m3-day-night-gap {
    width: 48px;
    min-width: 48px;
  }
}

/* ============ MODAL DIALOG (Frontend + Kunde) ============ */
body.fe-dialog-open { overflow: hidden; }
.fe-dialog[hidden] { display: none !important; }
.fe-dialog {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fe-dialog__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(2px);
}
.fe-dialog__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-level3);
  overflow: hidden;
}
.fe-dialog__panel--scroll {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 640px);
}
.fe-dialog__panel--wide {
  max-width: min(600px, calc(100vw - 32px));
}
.fe-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
  flex-shrink: 0;
}
.fe-dialog__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.fe-dialog__title-icon {
  font-size: 24px;
  color: var(--md-sys-color-primary);
  font-variation-settings: 'FILL' 1;
  flex-shrink: 0;
}
.fe-dialog__head h2 {
  font: 700 20px/1.25 var(--md-ref-typeface-brand);
  margin: 0;
}
.fe-dialog__body {
  padding: 16px 20px 8px;
}
.fe-dialog__body--scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.fe-dialog__body p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface-variant);
}
.fe-dialog__steps {
  margin: 0;
  padding-left: 1.25em;
  font-size: 14px;
  line-height: 1.6;
  color: var(--md-sys-color-on-surface);
}
.fe-dialog__steps li { margin: 6px 0; }
.fe-dialog__foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-low);
  flex-shrink: 0;
}
.fe-dialog__foot a {
  display: block;
  text-align: center;
  padding: 10px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.fe-dialog__foot a:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 10%, transparent);
}

/* Admin user impersonation banner */
.m3-impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  font: 500 14px/20px var(--md-ref-typeface-plain);
  position: sticky;
  top: 0;
  z-index: 100;
}
.m3-impersonation-banner__text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.m3-impersonation-banner__text .material-symbols-outlined {
  font-size: 20px;
  flex-shrink: 0;
}
.m3-impersonation-banner__exit {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-on-tertiary-container);
  color: var(--md-sys-color-tertiary-container);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.m3-impersonation-banner__exit:hover {
  filter: brightness(1.08);
}
