:root {
  --leaf: #178a48;
  --leaf-deep: #0b3320;
  --leaf-bright: #2bb862;
  --moss: #6aad74;
  --lawn: #d4eccf;
  --sky: #d9eef5;
  --mist: #eef8f1;
  --ink: #101c15;
  --muted: #5a6f62;
  --water: #0f8fa3;
  --water-soft: #cfeef3;
  --sun: #e0b84a;
  --danger: #c24535;
  --ok: #178a48;
  --warn: #9a6b16;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(11, 51, 32, 0.09);
  --radius: 1.1rem;
  --shadow: 0 10px 28px rgba(11, 51, 32, 0.07);
  --font-display: "Space Grotesk", "Figtree", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --font-brand: "Outfit", "Figtree", sans-serif;
  --font-size-root: 14px;
  --section-gap: 3rem; /* stejná mezera mezi sekcemi jako Bootstrap pt-5 */
}

* { box-sizing: border-box; }

html {
  font-size: var(--font-size-root);
}

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
  background-color: #f5f8f2;
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 45%,
    rgba(255, 255, 255, 0.1) 100%
  );
  overflow-x: hidden;
}

/* Foto pozadí — mírně přesahuje viewport, ať zmizí zaoblené rohy v JPG */
body::before {
  content: "";
  position: fixed;
  inset: -8vmax;
  pointer-events: none;
  z-index: 0;
  background-color: #f5f8f2;
  background-image: url("bg-window-v4.jpg?v=5");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* měkké světlo u okna */
body::after {
  content: "";
  position: fixed;
  top: -10vh;
  left: 50%;
  width: min(65vw, 640px);
  height: min(50vh, 420px);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
  animation: sunBreathe 10s ease-in-out infinite;
}

@keyframes leafDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-140px, 70px, 0); }
}

@keyframes sunBreathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes statusPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    background: #2f9d5c;
    box-shadow: 0 0 0 0 rgba(43, 184, 98, 0.45);
  }
  70% {
    transform: scale(1);
    opacity: 0.7;
    background: #3bb86a;
    box-shadow: 0 0 0 6px rgba(43, 184, 98, 0);
  }
}

@keyframes waterShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.app-shell,
.login-wrap {
  position: relative;
  z-index: 1;
}

h1, h2, h3 {
  font-family: var(--font-brand);
  letter-spacing: -0.02em;
  color: var(--leaf-deep);
  font-weight: 700;
}

.brand {
  font-family: var(--font-brand);
  font-size: clamp(1.28rem, 1.8vw, 1.55rem);
  margin: 0;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--leaf-deep);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.55rem;
  text-decoration: none;
  color: inherit;
}

.brand-lockup:hover .brand {
  color: var(--leaf);
}

.brand-mark-img {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  display: block;
  border-radius: 50%;
  box-shadow: none;
  object-fit: contain;
  background: transparent;
}

.sidebar-head .brand-mark-img {
  width: 2.65rem;
  height: 2.65rem;
}

.mobile-topbar-brand .brand-mark-img {
  width: 1.45rem;
  height: 1.45rem;
  box-shadow: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-mark::before {
  display: none;
}

.sidebar {
  background: transparent;
  border-right: 0;
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  /* stejný horní odstup jako main-panel / hlavička */
  padding: clamp(0.85rem, 2vw, 1.45rem) clamp(0.7rem, 1.4vw, 1.1rem) clamp(1.1rem, 2.5vw, 1.85rem);
  animation: rise 0.55s ease both;
  overflow: hidden;
}

.sidebar-nav-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: 0;
  padding-bottom: 0.5rem;
  margin-top: 2.3rem;
}

.sidebar-nav-foot {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(11, 51, 32, 0.12);
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.sidebar-head .brand-lockup {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.55rem;
}

.sidebar-head .brand {
  font-size: clamp(1.22rem, 1.55vw, 1.42rem);
}

.sidebar-kicker {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  white-space: normal;
}

.sidebar-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: -0.15rem -0.25rem 0 0;
  border: 0;
  border-radius: 0.75rem;
  background: rgba(11, 51, 32, 0.06);
  color: var(--leaf-deep);
  font-size: 1.05rem;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-close:active {
  background: rgba(11, 51, 32, 0.12);
}

/* Mobilní horní lišta + off-canvas menu */
.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3.35rem;
  padding:
    max(0.45rem, env(safe-area-inset-top))
    max(0.75rem, env(safe-area-inset-right))
    0.45rem
    max(0.65rem, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid rgba(11, 51, 32, 0.08);
  box-shadow: 0 6px 18px rgba(11, 51, 32, 0.05);
}

.mobile-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border: 0;
  border-radius: 0.8rem;
  background: rgba(23, 138, 72, 0.1);
  color: var(--leaf-deep);
  font-size: 1.45rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mobile-nav-toggle:active {
  background: rgba(23, 138, 72, 0.18);
}

.mobile-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-brand);
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--leaf-deep);
  text-decoration: none;
  line-height: 1;
}

.mobile-topbar-brand:hover {
  color: var(--leaf);
}

.mobile-topbar-spacer {
  width: 2.65rem;
  flex: 0 0 auto;
  margin-left: auto;
}

.mobile-topbar-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.mobile-topbar-temp {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--leaf-deep);
  letter-spacing: -0.02em;
}

.mobile-topbar-temp i {
  color: var(--leaf);
  font-size: 1rem;
}

.mobile-topbar-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--muted);
}

.app-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.75rem;
  margin: 0 0 1.75rem;
  padding: 0 0 1.15rem;
  border-bottom: 1px solid rgba(11, 51, 32, 0.07);
  position: relative;
  z-index: 30;
}

.app-chrome-intro {
  flex: 1 1 12rem;
  min-width: 0;
}

.app-chrome-intro:not(:has(*)) {
  display: none;
}

.app-chrome-intro .page-hero,
.app-chrome-intro .page-hero-inline {
  margin-bottom: 0;
}

.app-chrome-intro .page-hero h1 {
  font-family: var(--font-brand);
  font-size: clamp(1.1rem, 1.5vw, 1.28rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--leaf-deep);
  margin: 0 0 0.05rem;
  line-height: 1.05;
}

.app-chrome-intro .page-hero p {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(90, 111, 98, 0.78);
  line-height: 1.2;
  margin: 0;
}

.app-statusbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  margin: 0;
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  flex: 0 1 auto;
}

.app-statusbar-block {
  display: grid;
  grid-template-columns: auto minmax(0, auto);
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  row-gap: 0.05rem;
  align-items: center;
  min-width: 0;
  padding: 0.2rem 1.15rem;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  position: relative;
}

.app-statusbar-block + .app-statusbar-block::before,
.app-statusbar-user::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 1.55rem;
  background: rgba(11, 51, 32, 0.1);
}

.app-statusbar-user {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding-left: 1.15rem;
  z-index: 50;
}

.app-statusbar-block-icon {
  grid-row: 1 / span 2;
  grid-column: 1;
  align-self: center;
  font-size: 1.35rem;
  line-height: 1;
  color: rgba(23, 138, 72, 0.55);
  opacity: 0.9;
}

.app-statusbar-wx .app-statusbar-block-icon.bi-sun-fill,
.app-statusbar-wx .app-statusbar-block-icon.bi-sun {
  color: rgba(180, 140, 40, 0.7);
}

.app-statusbar-datetime {
  grid-template-columns: minmax(0, auto);
}

.app-statusbar-datetime .app-statusbar-block-text {
  grid-column: 1;
}

.app-statusbar-block-text {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.08rem;
  min-width: 0;
  line-height: 1.1;
}

.app-statusbar-primary {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  color: rgba(11, 51, 32, 0.82);
  line-height: 1.15;
  white-space: nowrap;
}

.app-statusbar-secondary {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(90, 111, 98, 0.68);
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.app-statusbar-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 14rem;
  margin: 0;
  padding: 0.55rem 0.85rem 0.55rem 0.7rem;
  border: 1px solid transparent;
  background: rgba(11, 51, 32, 0.03);
  color: rgba(11, 51, 32, 0.78);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.app-statusbar-user-trigger:hover,
.app-statusbar-user.is-open .app-statusbar-user-trigger,
.app-statusbar-user:focus-within .app-statusbar-user-trigger {
  color: var(--leaf-deep);
  background: rgba(23, 138, 72, 0.08);
  border-color: rgba(23, 138, 72, 0.14);
}

.app-statusbar-user-trigger > .bi-person {
  color: rgba(23, 138, 72, 0.55);
  font-size: 0.95rem;
}

.app-statusbar-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-statusbar-user-caret {
  font-size: 0.65rem;
  opacity: 0.45;
  transition: transform 0.18s ease, opacity 0.15s ease;
}

.app-statusbar-user.is-open .app-statusbar-user-caret {
  opacity: 0.75;
  transform: rotate(180deg);
}

.app-statusbar-user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 60;
  min-width: 12rem;
  margin: 0;
  padding: 0.45rem 0.3rem 0.3rem;
  border-radius: 0 0 0.85rem 0.85rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(11, 51, 32, 0.08);
  border-top-color: transparent;
  box-shadow: 0 12px 28px rgba(11, 51, 32, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.app-statusbar-user.is-open .app-statusbar-user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.app-statusbar-user-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: rgba(26, 43, 34, 0.88);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.app-statusbar-user-item i {
  color: rgba(23, 138, 72, 0.6);
  font-size: 0.9rem;
}

.app-statusbar-user-item:hover {
  background: rgba(23, 138, 72, 0.07);
  color: var(--leaf-deep);
}

.app-statusbar-user-item.is-logout {
  color: rgba(140, 60, 48, 0.88);
}

.app-statusbar-user-item.is-logout i {
  color: rgba(180, 75, 58, 0.8);
}

.app-statusbar-user-item.is-logout:hover {
  background: rgba(194, 69, 53, 0.07);
  color: var(--danger);
}

.app-statusbar-user-logout {
  margin: 0;
  width: 100%;
}

@media (max-width: 767.98px) {
  .app-statusbar {
    display: none;
  }

  .app-chrome {
    margin-bottom: 1.35rem;
    padding-bottom: 0.95rem;
  }
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1045;
  background: rgba(8, 18, 12, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

body.nav-open .nav-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.nav-open {
  overflow: hidden;
}

/*
 * .app-shell má z-index:1 (nad pozadím). To ale „uvězní“ sidebar
 * pod backdropem — při otevřeném menu kontext zrušíme, ať je
 * zatmavení/blur jen na obsahu a menu zůstane ostré.
 */
body.nav-open .app-shell {
  z-index: auto;
}

/* Modal mimo .app-shell (JS → body) — nehýbat stacking kontextem při otevření */
html {
  scrollbar-gutter: stable;
}

body.modal-open {
  padding-right: 0 !important;
}

body.nav-open .sidebar {
  z-index: 1050;
}

.login-card .login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  margin-bottom: 0;
}

.login-card .login-brand .brand {
  font-family: var(--font-brand);
  font-size: clamp(1.35rem, 3vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--leaf-deep);
  line-height: 1.15;
}

.login-card .login-brand .brand-mark-img {
  width: 3.25rem;
  height: 3.25rem;
}

.login-card .login-brand .sidebar-kicker {
  margin: 0;
  text-align: center;
  white-space: normal;
}

.login-card .login-lead {
  margin: 1.35rem 0 1.75rem;
  padding: 0;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(90, 111, 98, 0.82);
}

.sidebar .nav-link {
  color: var(--muted);
  border-radius: 0.75rem;
  padding: 0.55rem 0.55rem;
  margin-bottom: 0.1rem;
  font-weight: 600;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: transparent;
  transition:
    background 0.28s ease,
    color 0.28s ease;
}

.sidebar .nav-link span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.2;
}

.sidebar .nav-link .material-symbols-rounded {
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.42rem;
  line-height: 1;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
  opacity: 0.9;
  color: rgba(11, 51, 32, 0.8);
  overflow: hidden;
  transition: opacity 0.28s ease, color 0.28s ease;
  user-select: none;
}

.sidebar .nav-link:hover .material-symbols-rounded {
  opacity: 1;
}

.sidebar .nav-link.active .material-symbols-rounded {
  opacity: 1;
  color: var(--leaf-deep);
}

.page-hero-icon {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
  font-size: 1.22em;
  line-height: 1;
  vertical-align: -0.18em;
  margin-right: 0.4rem;
  color: inherit;
}

.sidebar .nav-link i::before {
  display: block;
  width: 1.35rem;
  text-align: center;
  line-height: 1.35rem;
}

.sidebar .nav-link:hover i {
  opacity: 1;
  color: var(--leaf);
}

.sidebar .nav-link.active i {
  opacity: 1;
  color: var(--leaf);
}

.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.75rem;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.icon-chip.leaf {
  background: rgba(27, 122, 69, 0.12);
  color: var(--leaf);
}

.icon-chip.water {
  background: rgba(26, 138, 156, 0.12);
  color: var(--water);
}

.icon-chip.sun {
  background: rgba(224, 184, 74, 0.22);
  color: #9a6b16;
}

.pump-card {
  overflow: hidden;
  min-height: 220px;
  padding: 0 !important;
  background: #fff !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.pump-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 92% 62%;
  padding: 1.35rem 0.35rem 0.35rem 0;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  transform: translateX(6%) scale(0.86);
  transform-origin: right center;
}

.pump-card-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  height: 100%;
  padding: 1.25rem 1.35rem;
  background: transparent;
}

.pump-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.pump-mode-chip .bi {
  font-size: 0.85rem;
}

.pump-mode-timer {
  background: rgba(15, 143, 163, 0.12);
  color: var(--water);
}

.pump-mode-manual {
  background: rgba(154, 107, 22, 0.14);
  color: var(--warn);
}

.partizan-card {
  position: relative;
  overflow: hidden;
  padding: 0 !important;
  min-height: 220px;
  background: #0e1a14 !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  isolation: isolate;
}

.partizan-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #0e1a14;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.partizan-card-fallback {
  background-image:
    linear-gradient(145deg, rgba(23, 138, 72, 0.35), rgba(15, 143, 163, 0.25));
}

.partizan-card-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  height: 100%;
  padding: 1.25rem 1.35rem;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(8, 18, 12, 0.62) 0%,
    rgba(8, 18, 12, 0.12) 45%,
    rgba(8, 18, 12, 0.78) 100%
  );
}

.partizan-card .stretched-link {
  z-index: 2;
}

.partizan-card .icon-chip.leaf {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.camera-card .icon-chip.water {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.camera-tile-spinner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(8, 18, 12, 0.25);
}

.camera-tile-spinner[hidden] {
  display: none !important;
}

.partizan-card .stat-label {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.partizan-card .partizan-live-label {
  color: #fff !important;
  font-size: 1.25rem;
  margin-top: 0;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.partizan-card .partizan-meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.partizan-preview-card {
  overflow: hidden;
  padding: 0 !important;
  background: #0b1410 !important;
}

.pool-cam-card {
  max-width: none;
}

.pool-cam-viewer {
  /* přesný 16:9 rám — bez min-height, jinak vznikají černé pruhy */
  aspect-ratio: 16 / 9;
  min-height: 0;
  background: #0b1410;
}

.pool-cam-video {
  object-fit: cover;
  background: #0b1410;
  /* iOS: <video> layer jinak přebije tlačítka nad sebou */
  pointer-events: none;
}

.pool-cam-go2rtc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  background: #0b1410;
  z-index: 0;
  pointer-events: none;
}

.pool-cam-go2rtc.is-active {
  display: block;
}

.pool-cam-go2rtc video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b1410;
}

.pool-cam-go2rtc .info {
  display: none !important;
}

.partizan-preview-err {
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  margin: 0;
}

.partizan-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1410;
  border-radius: 0;
  overflow: hidden;
}

.partizan-viewer-video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #0b1410;
  border: 0;
  border-radius: 0;
  pointer-events: none;
}

.partizan-viewer-video::-webkit-media-controls,
.partizan-viewer-video::-webkit-media-controls-enclosure,
.partizan-viewer-video::-webkit-media-controls-panel,
.partizan-viewer-video::-webkit-media-controls-timeline {
  display: none !important;
  opacity: 0 !important;
}

.partizan-viewer-actions {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 30;
  pointer-events: auto;
}

.partizan-viewer-actions-always,
.partizan-viewer:hover .partizan-viewer-actions,
.partizan-viewer:focus-within .partizan-viewer-actions {
  opacity: 1;
}

/* Touch / mobil — tlačítka vždy viditelná a větší */
@media (hover: none), (max-width: 767.98px) {
  .partizan-viewer-actions {
    opacity: 1;
    right: max(0.65rem, env(safe-area-inset-right));
    bottom: max(0.65rem, env(safe-area-inset-bottom));
  }

  .partizan-viewer-actions .btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.55rem 0.7rem;
    font-size: 1.15rem;
    border-radius: 0.85rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

.partizan-viewer-actions .btn {
  border: none;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.partizan-viewer:fullscreen,
.partizan-viewer:-webkit-full-screen,
.partizan-viewer.is-cam-fs {
  aspect-ratio: auto !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  background: #0b1410 !important;
  margin: 0 !important;
}

/* CSS immersive — na body, nad celou appkou */
.partizan-viewer.is-cam-fs {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.partizan-viewer.is-cam-fs .partizan-viewer-video,
.partizan-viewer.is-cam-fs .pool-cam-go2rtc,
.partizan-viewer.is-cam-fs .pool-cam-go2rtc video,
.partizan-viewer:fullscreen .partizan-viewer-video,
.partizan-viewer:fullscreen .pool-cam-go2rtc,
.partizan-viewer:fullscreen .pool-cam-go2rtc video,
.partizan-viewer:-webkit-full-screen .partizan-viewer-video {
  object-fit: cover;
  background: #0b1410;
}

.partizan-viewer.is-cam-fs .partizan-viewer-actions,
.partizan-viewer:fullscreen .partizan-viewer-actions,
.partizan-viewer:-webkit-full-screen .partizan-viewer-actions {
  opacity: 1;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
}

html.cam-fs-active,
html.cam-fs-active body {
  overflow: hidden !important;
  overscroll-behavior: none;
  background: #0b1410 !important;
}

/* Výzva: otočení nemá user-gesture → klepnutím schová lištu prohlížeče */
.cam-fs-hint {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  pointer-events: auto;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 11rem;
  padding: 0.85rem 1.25rem;
  border: 0;
  border-radius: 1rem;
  background: rgba(8, 16, 12, 0.72);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.cam-fs-hint.is-visible {
  display: flex;
}

.cam-fs-hint i {
  font-size: 1.45rem;
  margin-bottom: 0.15rem;
}

.cam-fs-hint small {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

.partizan-viewer.is-cam-fs:fullscreen,
.partizan-viewer.is-cam-fs:-webkit-full-screen {
  padding: 0 !important;
}

/* Landscape: vyplň výšku coverem, bez černých pruhů */
@media (orientation: landscape) and (max-width: 1024px) {
  .pool-cam-viewer:not(.is-cam-fs),
  .partizan-preview-card .partizan-viewer:not(.is-cam-fs) {
    aspect-ratio: auto;
    height: min(85dvh, 100vw * 9 / 16 + 4rem);
    min-height: 0;
  }
}

/* —— Kamery 2×2 —— */
.surveillance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
}

.surveillance-tile {
  position: relative;
  overflow: hidden;
  min-height: clamp(160px, 28vh, 320px);
  aspect-ratio: 16 / 10;
  border-radius: 1rem;
  background: #0b1410;
  isolation: isolate;
  box-shadow: 0 10px 28px rgba(20, 40, 28, 0.12);
}

.surveillance-tile-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #0b1410;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.45s ease;
}

.surveillance-tile:hover .surveillance-tile-media {
  transform: scale(1.03);
}

.surveillance-tile.is-empty .surveillance-tile-media,
.surveillance-tile.is-offline .surveillance-tile-media {
  background-image:
    linear-gradient(145deg, rgba(23, 138, 72, 0.28), rgba(15, 143, 163, 0.18));
}

.surveillance-tile.is-empty {
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(11, 20, 16, 0.72);
}

.surveillance-tile-spinner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(8, 18, 12, 0.22);
}

.surveillance-tile-spinner[hidden] {
  display: none !important;
}

.surveillance-tile-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 0.9rem 1rem;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(6, 14, 10, 0.7) 0%,
    rgba(6, 14, 10, 0.08) 42%,
    rgba(6, 14, 10, 0.82) 100%
  );
}

.surveillance-tile-name {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.surveillance-tile-foot {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
}

.surveillance-tile .stretched-link {
  z-index: 3;
}

@media (max-width: 767.98px) {
  .surveillance-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .surveillance-tile {
    min-height: clamp(160px, 26vh, 280px);
    border-radius: 0.85rem;
  }

  .surveillance-tile-name {
    font-size: 0.92rem;
  }
}

.pump-hero-card {
  overflow: hidden;
  padding: 0 !important;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  position: relative;
  background:
    linear-gradient(160deg, rgba(212, 236, 207, 0.4), rgba(255, 255, 255, 0.25)),
    var(--surface);
}

.pump-hero-corner {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pump-hero-img {
  width: 100%;
  flex: 1;
  min-height: 260px;
  object-fit: contain;
  object-position: center;
  padding: 1rem 1.25rem 0.25rem;
  background: transparent;
}

.pump-hero-caption {
  text-align: center;
  padding: 0.75rem 1rem 1.15rem;
}

.sidebar .nav-link:hover {
  background: rgba(27, 122, 69, 0.1);
  color: var(--leaf-deep);
}

.sidebar .nav-link.active {
  background: linear-gradient(120deg, rgba(27, 122, 69, 0.14), rgba(26, 138, 156, 0.1));
  color: var(--leaf-deep);
  font-weight: 700;
}

.main-panel {
  padding: clamp(0.85rem, 2vw, 1.45rem) clamp(1.25rem, 3vw, 2.4rem) clamp(1.25rem, 3vw, 2.4rem);
  animation: rise 0.65s ease 0.05s both;
}

.page-hero {
  margin-bottom: 1.75rem;
  position: relative;
}

.page-hero h1 {
  font-size: clamp(1.08rem, 1.5vw, 1.3rem);
  margin: 0 0 0.35rem;
  font-weight: normal;
  letter-spacing: -0.02em;
}

.section-title {
  font-family: var(--font-brand);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--leaf-deep);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

/* Jednotná mezera mezi hlavními sekcemi stránky */
.main-panel > .mb-4,
.main-panel > section.mb-4 {
  margin-bottom: var(--section-gap) !important;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 0.75rem;
}

.section-head .section-title {
  margin: 0;
}

.page-hero p {
  color: var(--muted);
  margin: 0;
  max-width: 38rem;
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 500;
}

.systems-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.05rem 0 0;
  max-width: none;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0;
  color: rgba(90, 111, 98, 0.82);
}

.systems-status-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #3aa86a;
  box-shadow: 0 0 0 3px rgba(58, 168, 106, 0.14);
}

.systems-status.is-ok {
  color: rgba(90, 111, 98, 0.82);
}

.systems-status.is-warn {
  color: rgba(154, 107, 22, 0.9);
}

.systems-status.is-warn .systems-status-dot {
  background: #c49a2a;
  box-shadow: 0 0 0 3px rgba(196, 154, 42, 0.16);
  animation: none;
}

.stat-card {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.35rem;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  animation: rise 0.6s ease both;
}

/* Stejná výška dlaždic v jednom řádku (jen obsahové sloupce, ne .main-panel) */
.main-panel .row > [class*="col-"]:has(> .stat-card),
.main-panel .row > [class*="col-"]:has(> .device-tile) {
  display: flex;
}

.main-panel .row > [class*="col-"] > .stat-card,
.main-panel .row > [class*="col-"] > .device-tile {
  flex: 1 1 auto;
  width: 100%;
  align-self: stretch;
}

.row > [class*="col-"] > .stat-card:nth-child(1),
.row > [class*="col-"]:nth-child(1) .stat-card { animation-delay: 0.04s; }
.row > [class*="col-"]:nth-child(2) .stat-card { animation-delay: 0.09s; }
.row > [class*="col-"]:nth-child(3) .stat-card { animation-delay: 0.14s; }
.row > [class*="col-"]:nth-child(4) .stat-card { animation-delay: 0.19s; }
.row > [class*="col-"]:nth-child(5) .stat-card { animation-delay: 0.24s; }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(11, 51, 32, 0.1);
}

.stat-card.tone-water {
  background:
    linear-gradient(135deg, rgba(207, 238, 243, 0.55), rgba(255, 255, 255, 0.45)),
    var(--surface);
  background-size: 200% 200%;
  animation: rise 0.6s ease both, waterShimmer 7s ease-in-out infinite;
}

.stat-card.tone-leaf {
  background:
    linear-gradient(150deg, rgba(212, 236, 207, 0.5), rgba(255, 255, 255, 0.5)),
    var(--surface);
}

.stat-card.tone-sun {
  background:
    linear-gradient(150deg, rgba(224, 184, 74, 0.18), rgba(255, 255, 255, 0.55)),
    var(--surface);
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.1;
  color: var(--leaf-deep);
  margin-top: 0.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-value.water { color: var(--water); }
.stat-value.on { color: var(--leaf); }

.temp-reading {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.temp-reading > i {
  font-size: 1em;
  line-height: 1;
  opacity: 0.78;
  transform: translateY(0.04em);
}

.temp-reading > span {
  font-variant-numeric: tabular-nums;
}

.temps-stats-anchor {
  scroll-margin-top: 1.25rem;
}

.stat-card:has(.stretched-link) {
  cursor: pointer;
}

.temps-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.temps-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: auto;
  width: 100%;
}

.temps-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

.temps-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.temps-item:first-child {
  padding-top: 0;
}

.temps-item-icon {
  flex: 0 0 auto;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--leaf);
  width: 1.25rem;
  text-align: center;
  align-self: center;
}

.temps-item-icon.water {
  color: var(--water);
}

.temps-item-icon.sun {
  color: #c49a2a;
}

.temps-item-label {
  flex: 1 1 auto;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.temps-item-hum {
  font-size: 0.78em;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.temps-item-value {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--leaf-deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.temps-item-value.water {
  color: var(--water);
}

.weather-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.weather-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
  opacity: 0.9;
}

.weather-card > * {
  position: relative;
  z-index: 1;
}

.weather-chip {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: rgba(224, 184, 74, 0.2);
  color: #9a6b16;
}

.weather-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.weather-place {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  margin-top: 0.08rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.weather-days {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.15rem;
  margin-top: auto;
  align-items: end;
}

.weather-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0;
  min-width: 0;
  background: none;
  border: 0;
  text-align: center;
}

.weather-day-name {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.weather-day.is-today .weather-day-name {
  color: var(--leaf-deep);
  font-weight: 800;
}

.weather-day-icon {
  font-size: 2.9rem;
  line-height: 1;
  color: var(--water);
}

.weather-day.is-today .weather-day-icon {
  color: #c49a2a;
}

.weather-tmax {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.weather-day.is-today .weather-tmax {
  color: var(--leaf-deep);
}

.weather-empty {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: auto;
}

/* Jemná SVG sada podle aktuálního počasí */
.weather-sky-clear::before {
  background-image: url("weather/clear.svg");
}
.weather-sky-partly::before {
  background-image: url("weather/partly.svg");
}
.weather-sky-cloudy::before {
  background-image: url("weather/cloudy.svg");
}
.weather-sky-fog::before {
  background-image: url("weather/fog.svg");
}
.weather-sky-drizzle::before {
  background-image: url("weather/drizzle.svg");
}
.weather-sky-rain::before {
  background-image: url("weather/rain.svg");
}
.weather-sky-snow::before {
  background-image: url("weather/snow.svg");
}
.weather-sky-storm::before {
  background-image: url("weather/storm.svg");
}

.weather-alerts {
  position: relative;
  margin-top: 0.65rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(30, 42, 28, 0.08);
  min-height: 2.6rem;
}

.weather-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink);
  min-width: 0;
  width: 100%;
}

.weather-alerts .weather-alert {
  position: absolute;
  left: 0;
  right: 0;
  top: 0.85rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1.1s ease;
}

.weather-alerts .weather-alert.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

.weather-alert-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.28rem;
  background: #c9a227;
}

.weather-alert-yellow .weather-alert-dot { background: #c9a227; }
.weather-alert-orange .weather-alert-dot { background: #d97706; }
.weather-alert-red .weather-alert-dot { background: #c2410c; }
.weather-alert-green .weather-alert-dot { background: #6b8f3c; }

.weather-alert-body {
  min-width: 0;
  flex: 1;
}

.weather-alert-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
}

.weather-alert-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 500;
  flex: 1;
  font-size: 0.84rem;
  line-height: 1.35;
}

.weather-alert-text strong {
  color: var(--ink);
  font-weight: 650;
}

.weather-alert-desc {
  margin: 0.28rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* stejná velikost jako „aktuální teplota“ u TC (ne em z menšího parentu) */
  font-size: 0.78rem !important;
  line-height: 1.45 !important;
}

.weather-alert-count {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .weather-alerts .weather-alert {
    transition: none;
  }
}

.badge-demo {
  background: rgba(224, 184, 74, 0.28);
  color: var(--warn);
  border-radius: 0.45rem;
  font-weight: 700;
  font-size: 0.72rem;
}

.badge-area {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted, #5a6b63);
  background: rgba(23, 138, 72, 0.08);
  border: 1px solid rgba(23, 138, 72, 0.12);
}

.badge-online,
.badge-offline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-online {
  background: rgba(23, 138, 72, 0.09);
  color: #1a6b3c;
  border: 1px solid rgba(23, 138, 72, 0.12);
}

.badge-online::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #2f9d5c;
  flex-shrink: 0;
  animation: statusPulse 2.4s ease-in-out infinite;
}

.badge-offline {
  background: rgba(194, 69, 53, 0.12);
  color: var(--danger);
}

.badge-offline::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  opacity: 0.85;
}

.activity-card {
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(11, 51, 32, 0.06);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(11, 51, 32, 0.04);
  padding: 1.1rem 1.25rem;
  animation: rise 0.7s ease 0.18s both;
}

.activity-card h2,
.history-title {
  font-family: var(--font-brand);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  color: var(--leaf-deep);
}

.activity-list li {
  border-color: var(--line) !important;
}

.backup-stat {
  background: rgba(238, 248, 241, 0.7);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  height: 100%;
}

.backup-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.backup-stat-value {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--leaf-deep);
  word-break: break-all;
}

.history-item {
  gap: 0.75rem;
  padding: 0.42rem 0;
}

.history-item-line {
  border-bottom: 1px solid rgba(11, 51, 32, 0.05);
}

@keyframes historyItemIn {
  from {
    opacity: 0;
    transform: translateY(-0.65rem);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 3.5rem;
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
  }
}

.history-item-enter {
  animation: historyItemIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: top center;
}

.history-list-shift .history-item:not(.history-item-enter) {
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.history-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(16, 28, 21, 0.78);
  line-height: 1.35;
}

.history-text.is-warn {
  color: var(--danger);
  opacity: 0.85;
}

.history-meta {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(90, 111, 98, 0.7);
  white-space: nowrap;
}

.history-empty {
  font-size: 0.85rem;
  color: var(--muted);
}

.samples-list {
  margin: 0;
}

.samples-item {
  padding: 0.55rem 0;
}

.samples-item-line {
  border-bottom: 1px solid rgba(11, 51, 32, 0.05);
}

.samples-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.samples-source {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
}

.samples-temp {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--leaf-deep);
  font-variant-numeric: tabular-nums;
}

.samples-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.65rem;
  margin-top: 0.18rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(90, 111, 98, 0.78);
}

.samples-meta time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 650;
}

.samples-origin {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.temp-chart-card {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  border: 1px solid rgba(11, 51, 32, 0.07);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(11, 51, 32, 0.05);
  padding: 1.15rem 1.2rem 1rem;
}

.temp-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
  margin-bottom: 0.45rem;
}

.temp-chart-title-row {
  margin: 0;
}

.temp-chart-heading {
  min-width: 0;
  flex: 1 1 12rem;
}

.temp-chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 1 auto;
}

.temp-chart-controls-top {
  width: 100%;
  margin-bottom: 0.55rem;
}

.temp-chart-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  margin-bottom: 0.95rem;
  min-height: 2rem;
}

.temp-chart-card > .temp-chart-meta {
  margin-bottom: 1rem;
}

.temp-chart-meta .temp-chart-sub {
  margin: 0;
  line-height: 1.2;
}

.temp-chart-meta .temp-chart-legend,
.temp-chart-toolbar .temp-chart-legend {
  margin-bottom: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
  align-items: center;
}

.temp-chart-controls .range-switch {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.85);
}

.temp-chart-controls .range-switch-item {
  min-width: 3.2rem;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
}

.temp-chart-controls .range-sample-btn {
  height: 2.2rem;
  padding: 0 0.85rem;
  font-size: 0.78rem;
  box-shadow: none;
}

.temp-chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.temp-chart-title {
  font-family: var(--font-brand);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--leaf-deep);
}

.temp-chart-sub {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.temp-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.temp-chart-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(11, 51, 32, 0.1);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.temp-chart-pill.is-off {
  opacity: 0.45;
}

.temp-chart-pill:hover {
  background: #fff;
  border-color: rgba(23, 138, 72, 0.28);
}

.temp-chart-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

.temp-chart-canvas-wrap {
  position: relative;
  height: min(340px, 52vw);
  min-height: 240px;
}

.btn-garden {
  background: linear-gradient(135deg, var(--leaf-bright), var(--leaf));
  border: none;
  color: #fff;
  min-width: 8rem;
  padding: 0.78rem 1.25rem;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  border-radius: 0.75rem;
  box-shadow: 0 8px 20px rgba(23, 138, 72, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-garden:hover {
  background: linear-gradient(135deg, var(--leaf), var(--leaf-deep));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(23, 138, 72, 0.28);
}

.btn-garden:disabled,
.btn-garden-outline:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.btn-garden-outline {
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid rgba(23, 138, 72, 0.28);
  color: var(--leaf-deep);
  min-width: 8rem;
  padding: 0.72rem 1.25rem;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: -0.01em;
  border-radius: 0.75rem;
  box-shadow: 0 4px 14px rgba(11, 51, 32, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-garden-outline:hover {
  background: #fff;
  border-color: rgba(23, 138, 72, 0.45);
  color: var(--leaf-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(11, 51, 32, 0.1);
}

.backup-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.backup-toolbar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.btn-garden-sm {
  min-width: 0;
  padding: 0.42rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 650;
  border-radius: 0.65rem;
  box-shadow: 0 4px 12px rgba(23, 138, 72, 0.16);
}

.btn-garden-outline.btn-garden-sm {
  padding: 0.38rem 0.85rem;
  box-shadow: 0 2px 8px rgba(11, 51, 32, 0.05);
}

.btn-garden-sm:hover {
  box-shadow: 0 6px 14px rgba(23, 138, 72, 0.22);
}

.btn-garden-outline.btn-garden-sm:hover {
  box-shadow: 0 4px 12px rgba(11, 51, 32, 0.08);
}

.backup-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.backup-actions form {
  display: inline-flex;
  margin: 0;
}

.backup-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid rgba(11, 51, 32, 0.1);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--leaf-deep);
  line-height: 1;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.backup-action i {
  font-size: 1.05rem;
}

.backup-action:hover {
  background: #fff;
  border-color: rgba(23, 138, 72, 0.35);
  color: var(--leaf);
  transform: translateY(-1px);
}

.backup-action.is-danger {
  color: var(--danger);
}

.backup-action.is-danger:hover {
  border-color: rgba(194, 69, 53, 0.35);
  color: var(--danger);
  background: rgba(194, 69, 53, 0.06);
}

.users-form .form-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--leaf-deep);
  margin-bottom: 0.28rem;
}

.users-form .form-control {
  border-radius: 0.65rem;
  border-color: rgba(11, 51, 32, 0.14);
  padding: 0.5rem 0.75rem;
}

.users-form .form-control:focus {
  border-color: rgba(23, 138, 72, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(23, 138, 72, 0.12);
}

.users-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.users-checks .form-check {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.users-table .users-name {
  font-weight: 650;
  color: var(--leaf-deep);
}

.users-table tr.is-selected td {
  background: rgba(23, 138, 72, 0.07);
}

.users-table .users-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.users-table .users-row:hover td {
  background: rgba(23, 138, 72, 0.05);
}

.users-modal {
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(11, 51, 32, 0.12);
  overflow: hidden;
}

.users-modal .modal-header,
.users-modal .modal-footer {
  border-color: rgba(11, 51, 32, 0.08);
  padding: 1rem 1.15rem;
}

.users-modal .modal-body {
  padding: 1.15rem;
}

.users-modal .modal-title {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--leaf-deep);
}

.btn-off {
  background: var(--danger);
  border: none;
  color: #fff;
  min-width: 8rem;
  padding: 0.78rem 1.25rem;
  font-weight: 700;
  border-radius: 0.75rem;
}

.btn-outline-success {
  border-radius: 0.75rem !important;
  border-color: rgba(27, 122, 69, 0.35) !important;
  color: var(--leaf-deep) !important;
}

.btn-outline-success:hover {
  background: rgba(27, 122, 69, 0.1) !important;
  color: var(--leaf-deep) !important;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.login-card {
  width: min(440px, 100%);
  background: var(--surface-strong);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  border-radius: 1.6rem;
  box-shadow: var(--shadow);
  padding: 2.3rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: rise 0.6s ease both;
}

.login-card .form-control {
  border-radius: 0.9rem;
  border-color: var(--line);
  padding: 0.75rem 0.95rem;
  background: rgba(255, 255, 255, 0.72);
}

.login-card .form-control:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 0.2rem rgba(27, 122, 69, 0.14);
}

.raw-dps {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  background: rgba(238, 248, 241, 0.9);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
}

.alert {
  border-radius: 1rem;
  border: none;
  backdrop-filter: blur(8px);
}

@media (max-width: 767.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    width: min(20rem, 86vw);
    max-width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    margin: 0;
    padding:
      max(1rem, env(safe-area-inset-top))
      1.15rem
      max(1.25rem, env(safe-area-inset-bottom))
      max(1.15rem, env(safe-area-inset-left));
    background: #f7fbf8;
    border-right: 1px solid rgba(11, 51, 32, 0.08);
    box-shadow: 12px 0 36px rgba(11, 51, 32, 0.14);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-105%);
    transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    animation: none;
    display: flex;
    flex-direction: column;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .app-shell > .row > .sidebar {
    flex: 0 0 auto;
    width: min(20rem, 86vw);
    max-width: min(20rem, 86vw);
  }

  .app-shell > .row > .main-panel {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
  }

  .main-panel {
    padding-top: 1rem;
  }

  .stat-value { font-size: 1.35rem; }
  body::after {
    width: 80vw;
    height: 45vh;
    top: -4vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }
}

.device-card-removed { opacity: 0.72; }
.device-card-off { border-style: dashed; }
.device-tech { margin-top: 0.25rem; }
.device-tech summary {
  cursor: pointer;
  color: var(--muted, #6b7c72);
  font-size: 0.85rem;
  font-weight: 600;
  list-style: none;
}
.device-tech summary::-webkit-details-marker { display: none; }
.device-tech summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}
.device-tech[open] summary::before { transform: rotate(90deg); }

/* Settings device tiles */
.device-tile {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--surface-strong);
  border: 1px solid rgba(11, 51, 32, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise 0.55s ease both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.device-tile.is-off {
  background: rgba(255, 255, 255, 0.55);
  border-style: dashed;
}

.device-tile.is-removed {
  opacity: 0.62;
}

.device-tile-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
}

.device-tile-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.8rem;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.device-tile-icon.tone-leaf {
  background: rgba(27, 122, 69, 0.12);
  color: var(--leaf);
}

.device-tile-icon.tone-water {
  background: rgba(26, 138, 156, 0.12);
  color: var(--water);
}

.device-tile-icon.tone-sun {
  background: rgba(224, 184, 74, 0.22);
  color: #9a6b16;
}

.device-tile-titles {
  min-width: 0;
}

.device-tile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-tile-kind {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.device-tile-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.device-tile-status::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
}

.device-tile-status.is-on {
  color: var(--ok);
  background: rgba(23, 138, 72, 0.12);
}

.device-tile-status.is-warn {
  color: var(--warn);
  background: rgba(154, 107, 22, 0.12);
}

.device-tile-status.is-off {
  color: var(--muted);
  background: rgba(90, 111, 98, 0.12);
}

.device-tile-rename {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  margin: 0;
}

.device-tile-controls {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.device-tile-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  align-items: center;
  margin: 0;
}

.device-tile-field-area {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.device-tile-field-name {
  min-width: 0;
}

.device-tile-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted, #5a6b63);
  cursor: pointer;
  user-select: none;
}

.device-tile-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #178a48;
  cursor: pointer;
}

.device-tile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.device-tile-actions form {
  margin: 0;
  min-width: 0;
}

.device-tile-actions .device-tile-btn {
  width: 100%;
}

.device-tile-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.15rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(11, 51, 32, 0.1);
}

.device-tile-footer form {
  margin: 0;
  min-width: 0;
}

.device-tile-footer .device-tile-btn {
  width: 100%;
}

@media (max-width: 575.98px) {
  .device-tile-editor {
    gap: 0.4rem;
  }
}

.area-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.area-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 5.75rem 5.75rem;
  gap: 0.45rem;
  padding: 0 0.1rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.area-list-head span:last-child {
  grid-column: 3 / -1;
}

.area-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 5.75rem 5.75rem;
  gap: 0.45rem;
  align-items: center;
}

.area-list-edit {
  display: contents;
}

.area-list-delete {
  display: contents;
}

.area-list-edit > input[type="hidden"],
.area-list-delete > input[type="hidden"],
.area-list-row-add > input[type="hidden"] {
  display: none;
}

.area-list-row-add {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 5.75rem;
  gap: 0.45rem;
  align-items: center;
  margin: 0;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(11, 51, 32, 0.1);
}

.area-list .form-control {
  height: 2.2rem;
  min-width: 0;
  font-size: 0.88rem;
  border-radius: 0.7rem;
}

.area-list .device-tile-btn {
  width: 100%;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .area-list-head {
    display: none;
  }

  .area-list-row,
  .area-list-row-add {
    grid-template-columns: 1fr 1fr;
  }

  .area-list-edit > .device-tile-btn,
  .area-list-delete > .device-tile-btn,
  .area-list-row-add > .device-tile-btn {
    grid-column: 1 / -1;
  }
}

.device-tile-input,
.device-tile-dps input {
  width: 100%;
  min-width: 0;
  height: 2.2rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(11, 51, 32, 0.12);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select.device-tile-input {
  appearance: auto;
  cursor: pointer;
}

.device-tile-input:focus,
.device-tile-dps input:focus {
  border-color: rgba(23, 138, 72, 0.45);
  box-shadow: 0 0 0 0.18rem rgba(23, 138, 72, 0.12);
}

.device-tile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 2.2rem;
  padding: 0 0.7rem;
  border-radius: 0.7rem;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.device-tile-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.device-tile-btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(11, 51, 32, 0.12);
  color: var(--ink);
}

.device-tile-btn-ghost:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(23, 138, 72, 0.28);
}

.device-tile-btn-primary {
  background: linear-gradient(135deg, var(--leaf), #1a9a55);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(23, 138, 72, 0.22);
}

.device-tile-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.device-tile-btn-danger {
  background: rgba(194, 69, 53, 0.06);
  border-color: rgba(194, 69, 53, 0.22);
  color: var(--danger);
}

.device-tile-btn-danger:hover:not(:disabled) {
  background: rgba(194, 69, 53, 0.12);
}

.device-tile-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.device-tile-tech-row {
  position: relative;
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(11, 51, 32, 0.07);
}

.device-tile-tech-row .device-tile-tech {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  min-width: 0;
}

.device-tile-tech-row .device-tile-tech summary {
  padding-right: 5.75rem;
}

.device-tile-tech-row .device-tile-check {
  position: absolute;
  top: 0.55rem;
  right: 0;
  z-index: 1;
}

.device-tile-tech {
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(11, 51, 32, 0.07);
}

.device-tile-tech summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.35rem 0;
  user-select: none;
}

.device-tile-tech summary::-webkit-details-marker { display: none; }

.device-tile-tech summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 0.15s ease;
}

.device-tile-tech[open] summary::before {
  transform: rotate(90deg);
}

.device-tile-meta {
  display: grid;
  gap: 0.35rem;
  margin: 0.55rem 0 0;
}

.device-tile-meta > div {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.78rem;
}

.device-tile-meta dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.device-tile-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.device-tile-meta code {
  font-size: 0.74rem;
  color: var(--ink);
}

.device-tile-note {
  margin: 0.7rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 0.7rem;
  background: rgba(217, 238, 245, 0.55);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.device-tile-dps {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.55rem;
}

.device-tile-dps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.device-tile-dps label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

@media (max-width: 420px) {
  .device-tile-actions {
    grid-template-columns: 1fr;
  }
}

.heat-pump-card-bg {
  object-position: 88% 58%;
  transform: translateX(4%) scale(0.84);
  transform-origin: right center;
  padding-top: 1.5rem;
}

.thermo-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem 1.5rem;
}

.thermo-hero-text {
  flex: 1 1 16rem;
  min-width: 0;
}

.thermo-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.range-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.2rem;
  padding: 0.22rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(11, 51, 32, 0.1);
  box-shadow: 0 6px 18px rgba(11, 51, 32, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.range-switch-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.range-switch-item:hover {
  color: var(--leaf-deep);
  background: rgba(27, 122, 69, 0.08);
}

.range-switch-item.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--leaf) 0%, #1a9a55 100%);
  box-shadow: 0 4px 12px rgba(23, 138, 72, 0.28);
}

.range-sample-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 2.45rem;
  padding: 0 0.95rem;
  border: 1px solid rgba(11, 51, 32, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--leaf-deep);
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(11, 51, 32, 0.06);
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.range-sample-btn:hover {
  background: #fff;
  border-color: rgba(23, 138, 72, 0.35);
  transform: translateY(-1px);
}

.thermo-sample-form {
  margin: 0;
}

@media (max-width: 575.98px) {
  .temp-chart-controls {
    width: 100%;
  }
  .temp-chart-controls .range-switch {
    flex: 1 1 auto;
    display: grid;
  }
  .temp-chart-controls .range-switch-item {
    min-width: 0;
    padding-inline: 0.5rem;
  }
  .thermo-hero {
    align-items: stretch;
  }
  .thermo-toolbar {
    width: 100%;
  }
  .range-switch {
    flex: 1 1 auto;
  }
  .range-switch-item {
    min-width: 0;
    padding-inline: 0.55rem;
  }
}

/* PWA install prompt */
.pwa-install-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 1080;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pwa-install-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.pwa-install-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 520px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(11, 51, 32, 0.1);
  box-shadow: 0 16px 40px rgba(11, 51, 32, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.pwa-install-icon {
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #178a48;
  box-shadow: 0 4px 12px rgba(11, 51, 32, 0.16);
}

.pwa-install-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pwa-install-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.pwa-install-copy strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
}

.pwa-install-copy span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

.pwa-install-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
}

.pwa-install-dismiss {
  color: var(--muted) !important;
  text-decoration: none !important;
  padding-top: 0;
  padding-bottom: 0;
}

.pwa-install-tip-flash {
  color: var(--leaf-deep) !important;
  font-weight: 650;
}

@media (max-width: 480px) {
  .pwa-install-inner {
    flex-wrap: wrap;
  }
  .pwa-install-actions {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem;
  }
}

/* —— Čerpadlo: power toggle + denní timeline —— */
.pump-page-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.pump-status-card {
  display: flex;
  flex-direction: column;
}

.pump-status-schedules {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.pump-status-schedules .pump-schedule-card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: calc(var(--radius) - 0.2rem);
}

.heat-filter-ref {
  padding: 0.75rem 0.85rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.25rem);
  background: rgba(255, 255, 255, 0.55);
}

.pump-status-word {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--muted);
  line-height: 1.1;
}

.pump-status-word.is-on {
  color: var(--leaf);
}

.pump-power-form {
  margin: 0;
  flex: 0 0 auto;
}

.pump-power-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.pump-power-track {
  width: 5.6rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(11, 51, 32, 0.12);
  border: 1px solid rgba(11, 51, 32, 0.1);
  position: relative;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  box-shadow: inset 0 1px 3px rgba(11, 51, 32, 0.08);
}

.pump-power-toggle.is-on .pump-power-track {
  background: linear-gradient(135deg, var(--leaf-bright), var(--leaf));
  box-shadow: 0 8px 22px rgba(23, 138, 72, 0.35);
}

.pump-power-knob {
  position: absolute;
  top: 0.28rem;
  left: 0.28rem;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--muted);
  box-shadow: 0 4px 14px rgba(11, 51, 32, 0.18);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
  font-size: 1.05rem;
}

.pump-power-toggle.is-on .pump-power-knob {
  transform: translateX(2.55rem);
  color: var(--leaf);
}

.pump-power-caption {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 5.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pump-power-caption-on {
  text-align: right;
  opacity: 0.45;
}

.pump-power-toggle.is-on .pump-power-caption-off {
  opacity: 0.45;
}

.pump-power-toggle.is-on .pump-power-caption-on {
  opacity: 1;
  color: var(--leaf);
}

.pump-power-toggle:not(.is-on) .pump-power-caption-off {
  opacity: 1;
}

.pump-timer-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.pump-timer-hint-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
}

.pump-timer-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(11, 51, 32, 0.08);
  color: var(--muted);
}

.pump-timer-pill.is-on {
  background: rgba(23, 138, 72, 0.14);
  color: var(--leaf-deep);
}

.pump-auto-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
}

.pump-auto-label {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink);
}

.pump-schedule-list {
  display: grid;
  gap: 0.85rem;
}

.pump-schedule-card {
  padding: 1rem 1.1rem 0.85rem;
  border-radius: calc(var(--radius) - 0.15rem);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.pump-schedule-card.is-disabled {
  opacity: 0.55;
}

.pump-schedule-card.is-live {
  border-color: rgba(23, 138, 72, 0.35);
  box-shadow: 0 0 0 1px rgba(23, 138, 72, 0.12);
}

.pump-schedule-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.pump-schedule-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.pump-schedule-range {
  margin-top: 0.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.pump-schedule-range .bi {
  color: var(--leaf);
  margin-right: 0.15rem;
}

.pump-schedule-arrow {
  color: var(--muted);
  font-weight: 500;
  margin: 0 0.15rem;
}

.pump-schedule-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pump-mini-toggle-form {
  margin: 0;
}

.pump-sched-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(11, 51, 32, 0.1);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(16, 28, 21, 0.72);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pump-sched-btn:hover {
  background: rgba(23, 138, 72, 0.1);
  border-color: rgba(23, 138, 72, 0.22);
  color: var(--leaf-deep);
}

.pump-sched-btn .bi {
  font-size: 0.9rem;
}

.pump-sched-btn.is-danger:hover {
  background: rgba(176, 58, 58, 0.1);
  border-color: rgba(176, 58, 58, 0.22);
  color: var(--danger);
}

.pump-mini-toggle {
  appearance: none;
  border: 0;
  padding: 0;
  width: 2.55rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(11, 51, 32, 0.14);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  vertical-align: middle;
}

.pump-mini-toggle.is-on {
  background: var(--leaf);
}

.pump-mini-knob {
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(11, 51, 32, 0.2);
  transition: transform 0.2s ease;
}

.pump-mini-toggle.is-on .pump-mini-knob {
  transform: translateX(1.1rem);
}

.pump-day-clock {
  margin-top: 0.15rem;
  position: relative;
}

.pump-day-rail {
  position: relative;
  height: 1.35rem;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent calc(100% / 24 - 1px),
      rgba(11, 51, 32, 0.06) calc(100% / 24 - 1px),
      rgba(11, 51, 32, 0.06) calc(100% / 24)
    ),
    rgba(11, 51, 32, 0.06);
  overflow: hidden;
}

.pump-day-block {
  position: absolute;
  top: 0.18rem;
  bottom: 0.18rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--leaf-bright), var(--water));
  box-shadow: 0 2px 8px rgba(15, 143, 163, 0.25);
  min-width: 0.35rem;
}

.pump-day-block.is-interactive {
  cursor: grab;
  touch-action: none;
  z-index: 2;
  user-select: none;
}

.pump-day-clock.is-dragging .pump-day-block.is-interactive {
  cursor: grabbing;
  box-shadow: 0 4px 14px rgba(15, 143, 163, 0.4);
}

.pump-day-handle {
  position: absolute;
  top: -0.12rem;
  bottom: -0.12rem;
  width: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(11, 51, 32, 0.18);
  cursor: ew-resize;
  touch-action: none;
  z-index: 3;
}

.pump-day-handle.is-start {
  left: -0.1rem;
}

.pump-day-handle.is-end {
  right: -0.1rem;
}

.pump-day-now {
  position: absolute;
  top: -0.15rem;
  height: calc(1.35rem + 0.3rem);
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  border-radius: 1px;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.pump-day-now::before {
  content: "";
  position: absolute;
  top: -0.15rem;
  left: 50%;
  width: 0.42rem;
  height: 0.42rem;
  margin-left: -0.21rem;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.pump-day-block.is-muted {
  background: rgba(11, 51, 32, 0.22);
  box-shadow: none;
}

.pump-day-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding: 0 0.1rem;
}

.pump-day-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pump-editor-form .form-control::placeholder {
  color: rgba(90, 111, 98, 0.38);
  opacity: 1;
}

.pump-editor-form .form-control::-webkit-input-placeholder {
  color: rgba(90, 111, 98, 0.38);
}

.pump-editor-form .form-control::-moz-placeholder {
  color: rgba(90, 111, 98, 0.38);
  opacity: 1;
}

.pump-day-pill {
  margin: 0;
  cursor: pointer;
}

.pump-day-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pump-day-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(11, 51, 32, 0.12);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pump-day-pill input:checked + span {
  background: rgba(23, 138, 72, 0.14);
  border-color: rgba(23, 138, 72, 0.35);
  color: var(--leaf-deep);
}

.pump-enable-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  cursor: pointer;
  min-height: 2.4rem;
}

.pump-enable-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pump-enable-ui {
  width: 2.7rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(11, 51, 32, 0.14);
  position: relative;
  flex: 0 0 auto;
  transition: background 0.2s ease;
}

.pump-enable-ui::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(11, 51, 32, 0.2);
  transition: transform 0.2s ease;
}

.pump-enable-switch input:checked + .pump-enable-ui {
  background: var(--leaf);
}

.pump-enable-switch input:checked + .pump-enable-ui::after {
  transform: translateX(1.15rem);
}

.pump-enable-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 576px) {
  .pump-schedule-card-head {
    flex-direction: column;
  }
  .pump-schedule-actions {
    width: 100%;
  }
  .pump-sched-btn span {
    display: none;
  }
  .pump-sched-btn {
    min-width: 2.2rem;
    padding: 0.35rem;
  }
}

.heat-pool-temp {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.75rem;
}

.heat-pool-temp-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.heat-pool-temp-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--water);
  line-height: 1;
}

.heat-pool-temp-target {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--muted);
}

.heat-target-form .heat-target-input {
  max-width: 7.5rem;
}

.heat-tile-mid {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 0.35rem 0;
}

.heat-tile-foot {
  flex: 0 0 auto;
}

.heat-tile-temps {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  max-width: 62%;
  margin-right: auto;
  padding-right: 0.5rem;
}

.heat-tile-row {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.45rem;
}

.heat-tile-label {
  font-size: 0.78em;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  line-height: 1.25;
  min-width: 0;
}

.heat-tile-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--water);
}

.heat-tile-value.on {
  color: var(--leaf);
}

.heat-tile-value.heat-tile-target {
  font-size: 1.2rem;
  color: var(--leaf-deep);
}

.heat-filter-ref-title {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink);
}

.heat-filter-ref-title .bi {
  color: var(--water);
}

.heat-filter-block {
  background: rgba(11, 51, 32, 0.18);
  box-shadow: none;
}

.heat-filter-block.is-bg {
  top: 0.28rem;
  bottom: 0.28rem;
  opacity: 0.55;
  z-index: 0;
}

.pump-day-rail .pump-day-block:not(.heat-filter-block) {
  z-index: 1;
}

.pump-power-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


.light-panel {
  max-width: 42rem;
}

.light-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.light-panel-body {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(11, 51, 32, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.light-controls .form-label,
.light-field .form-label {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

.light-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0;
}

.light-white-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.light-slider-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.light-temp-hints {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.light-temp-range {
  background: linear-gradient(90deg, #ffb347, #fff6e8, #cfe9ff);
  border-radius: 999px;
  height: 0.45rem;
}

.light-ps-picker {
  display: grid;
  grid-template-columns: minmax(0, 14rem) 3.25rem;
  gap: 0.65rem;
  align-items: start;
  max-width: 18rem;
}

.light-ps-main {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.light-ps-sv {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.85rem;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  border: 1px solid rgba(11, 51, 32, 0.1);
}

.light-ps-sv-white,
.light-ps-sv-black {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.light-ps-sv-white {
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}

.light-ps-sv-black {
  background: linear-gradient(to top, #000, rgba(0, 0, 0, 0));
}

.light-ps-cursor,
.light-ps-hue-cursor {
  position: absolute;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.light-ps-cursor {
  top: 0;
  left: 0;
}

.light-ps-hue {
  position: relative;
  height: 1rem;
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
  border: 1px solid rgba(11, 51, 32, 0.1);
  background: linear-gradient(
    90deg,
    #ff0000 0%,
    #ffff00 17%,
    #00ff00 33%,
    #00ffff 50%,
    #0000ff 67%,
    #ff00ff 83%,
    #ff0000 100%
  );
}

.light-ps-hue-cursor {
  top: 50%;
  left: 0;
}

.light-ps-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.85rem;
  border: 1px solid rgba(11, 51, 32, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.light-ps-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .light-ps-picker {
    grid-template-columns: minmax(0, 1fr) 3rem;
    max-width: 100%;
  }
}

/* Pračka — bohatá dlaždice (bez nutnosti detailu) */
.washer-card .pump-card-bg {
  object-position: 96% 55%;
  transform: translateX(4%) scale(0.82);
  transform-origin: right center;
  padding: 0.85rem 0.2rem 0.35rem 0;
}
.washer-card .pump-card-overlay {
  background: transparent;
}
.washer-card .pump-card-overlay > .d-flex:first-child {
  position: relative;
  z-index: 2;
  padding-right: 0.15rem;
}
.washer-card .badge-online,
.washer-card .badge-offline,
.washer-card .badge-demo {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.washer-tile-body {
  color: var(--ink, #163028);
  max-width: 58%;
  position: relative;
  z-index: 2;
}
.washer-tile-remaining {
  font-family: var(--font-display);
  font-size: 2.45rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink, #163028);
}
.washer-tile-remaining.is-active { color: var(--leaf, #1b7a45); }
.washer-tile-remaining.is-done { color: var(--leaf, #1b7a45); }
.washer-tile-remaining-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.washer-tile-state {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
}
.washer-tile-state.on { color: var(--leaf, #1b7a45); }
.washer-tile-state.is-done { color: var(--leaf, #1b7a45); }
.washer-tile-program {
  margin-top: 0.15rem;
  font-size: 0.95rem;
  color: var(--ink, #163028);
}
.washer-tile-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.1rem;
}
.washer-tile-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.washer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(26, 138, 156, 0.1);
  border: 1px solid rgba(26, 138, 156, 0.18);
  color: var(--water, #1a8a9c);
  font-size: 0.8rem;
  font-weight: 600;
}
