
/* Override app.css local font-face with CDN sources */
@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/materialicons/v142/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
}
@font-face {
    font-family: 'Framework7 Icons';
    font-style: normal;
    font-weight: 400;
    src: url(https://cdn.jsdelivr.net/npm/framework7-icons@5.0.5/fonts/Framework7Icons-Regular.woff2) format('woff2'),
         url(https://cdn.jsdelivr.net/npm/framework7-icons@5.0.5/fonts/Framework7Icons-Regular.woff) format('woff');
}
/*
@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    src: url(../fonts/CarosSoft.eot);
    src: url(../fonts/MaterialIcons-Regular.eot);    
     For IE6-8 
    src: local('Material Icons'), local('MaterialIcons-Regular'), url(../fonts/MaterialIcons-Regular.woff2) format('woff2'), url(../fonts/MaterialIcons-Regular.woff) format('woff'), url(../fonts/MaterialIcons-Regular.ttf) format('truetype');
}
*/
:root{
  --f7-list-item-text-max-lines: 5;
  --f7-theme-color: #0891B2;
  --f7-theme-color-rgb: 8, 145, 178;
  --f7-theme-color-shade: #0E7490;
  --f7-theme-color-tint: #06B6D4;

  /* Ocean theme palette */
  --ocean-theme: #0891B2;
  --ocean-dark: #0E7490;
  --ocean-light: #06B6D4;
  --ocean-bg: #ECFEFF;
  --ocean-page-bg: #F8FAFC;
  --ocean-text: #0F172A;
  --ocean-text-muted: #64748B;
  --ocean-green: #10B981;
  --ocean-green-bg: #D1FAE5;
  --ocean-red: #EF4444;
  --ocean-red-bg: #FEE2E2;
  --ocean-blue-bg: #DBEAFE;
  --ocean-card-bg: #FFFFFF;
  --ocean-border: #E2E8F0;

  /* Framework7 overrides */
  --f7-page-bg-color: var(--ocean-page-bg);
  --f7-bars-bg-color: var(--ocean-theme);
  --f7-bars-text-color: #ffffff;
  --f7-navbar-link-color: #ffffff;
  --f7-navbar-text-color: #ffffff;
  --f7-card-bg-color: var(--ocean-card-bg);
  --f7-card-border-radius: 16px;
  --f7-block-title-text-color: var(--ocean-text-muted);
  --f7-list-item-border-color: var(--ocean-border);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ocean-text);
}
 
.eventlogo {
    width: 25px;
    height:25px;
}

.odometer {
    font-size: 100px;
}

.alarm-info {
	font-weight: bold;
	font-size: 100px;	
}

.card-header {
	font-weight: bold;
	font-size: 18px;	
}

.flow {
  animation: shadow 1s infinite ease;
}

.shadow {
  animation: shadow 8s infinite ease;
}

@keyframes shadow {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 0.2;
  }
}

.add-button {
  position: absolute;
  top: 1px;
  left: 1px;
}


.bg-color-green {
  --f7-theme-color-bg-color: #abdbb6;
}

.bg-color-red {
  --f7-theme-color-bg-color: #dbabad;
}

.bg-color-orange {
  --f7-theme-color-bg-color: #dbd6ab;
}


.home_statusline .item-content,
.home_statusline .item-inner {
  padding-top: 0px;
  padding-bottom: 0px;
}

.home_statusline .item-title,
.home_statusline .item-after {
  line-height: 0.9;
  font-size: 16px;
}

/* (legacy .page-signin .header-logo etc. styles removed — see modern signin block below) */


.vacation-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 2px solid var(--f7-color-gray);
  color: var(--f7-color-gray);
}

/* Active (vacation mode ON) */
.vacation-btn.active {
  background-color: var(--f7-color-green);
  border-color: var(--f7-color-green);
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 128, 0, 0.3);
}

/* Icon size */
.vacation-btn i {
  font-size: 24px;
}

.custom-slider-item .item-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--f7-text-color);
  white-space: normal; /* allow wrapping */
 line-height: 1.3;        /* increase line spacing */  
  margin-bottom: 5px;      /* extra space below headline */  
}

.custom-slider-item .block-title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  line-height: 1.4;
}

.custom-slider-item .toggle-hint {
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--f7-text-color-secondary);
  margin-top: 10px;
}

/* Ensure description text wraps and has good spacing */
.custom-slider-item .item-description {
  margin-top: 4px;
  margin-bottom: 10px; /* more space below text */
  white-space: normal;
  word-break: break-word;
  color: var(--f7-text-muted-color);
  line-height: 1.3em;
}

/* Add space below slider */
.custom-slider-item .range-slider {
  margin-bottom: 14px;
}


.sublist {
  margin-left: 1.5rem;   /* leicht eingerückt */
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--f7-text-color-gray);
}
.sublist .subitem {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.sublist .key {
  font-weight: 500;
}
.sublist .value {
  color: var(--f7-theme-color);
}


/* Remove bottom border if you want a very clean look */
.home_lower .item-content:after {
  display: none;
}
/* Make the list fully compact */
.compact-list .item-content {
  min-height: unset;            /* remove default min height (44px on iOS) */
  padding-top: 0;
  padding-bottom: 0;
}

/* Tighten outer padding */
.compact-list {
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -2px;             /* slightly collapse remaining spacing */
  margin-bottom: -2px;
}


/* Tighten inner padding */
.compact-list .item-inner {
  padding-top: 0;
  padding-bottom: 0;
  margin-top: -2px;             /* slightly collapse remaining spacing */
  margin-bottom: -2px;
}

/* Reduce text line height */
.compact-list .item-title,
.compact-list .item-after {
  font-size: 0.9rem;
  line-height: 1.1;             /* << this is key to reduce vertical spacing */
  padding-top: 0;
  padding-bottom: 0;
}

/* Remove the F7 default borders (optional) */
.compact-list .item-content:after {
  display: none;
}

/* Remove any top/bottom margins on UL */
.compact-list ul {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 0.9;             /* << this is key to reduce vertical spacing */
}

/* Remove any top/bottom margins on UL */
.compact-list li {
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 0.9;             /* << this is key to reduce vertical spacing */
}

/* Reduce button height inside the list */
.compact-list .button {
  --f7-button-height: 24px;     /* smaller height variable */
  padding: 0 8px;
  font-size: 0.8rem;
}
 
.alarm-item {
  align-items: center;
  min-height: 46px;
  padding: 4px 0;
  transition: opacity 0.2s;
}

/* ===== Alarm List Styling ===== */
.alarm-item {
  align-items: center;
  min-height: 48px;
  padding: 4px 0;
  transition: opacity 0.25s, background 0.25s;
}

/* Left alarm icon box */
.alarm-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
}
.alarm-icon-box i {
  font-size: 20px;
  color: var(--f7-theme-color, #007aff);
}

/* Alarm title */
.alarm-title {
  font-weight: 600;
  margin-left: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.25;
  color: var(--f7-list-item-text-color, #000);
}

/* Right indicator bar (mail/push/voice/valve) */
.alarm-indicators {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  line-height: 1;
}
.indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: inherit;
}
.indicator i.f7-icons {
  font-size: 20px;
  line-height: 1;
  display: block;
  vertical-align: middle;
}
.indicator svg {
  width: 20px;
  height: 20px;
  display: block;
  vertical-align: middle;
}

/* === Alarm Icon Styling === */
.alarm-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px; /* slightly rounded */
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  margin-right: 8px;
}

.alarm-item .alarm-title {
  font-weight: 500;
  font-size: 15px;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.alarm-item .alarm-indicators {
  display: flex;
  gap: 6px;
  align-items: center;
}

.alarm-item .alarm-indicators .indicator i {
  font-size: 18px;
}

.alarm-item.inactive .alarm-title,
.alarm-item.inactive .alarm-icon-box {
  opacity: 0.5;
  filter: grayscale(70%);
}

.hidden {
  display: none !important;
}
#deviceCards .card {
  display: block !important;
}

#acc5_content .card {
  margin: 1rem auto;
  max-width: 400px;
}
.card img {
  border-radius: 12px;
}
.shadow-md {
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.buttons-center {
  display: flex;
  justify-content: center;      /* center horizontally */
  align-items: center;
  gap: 0.75rem;                 /* space between buttons */
  flex-wrap: wrap;              /* stack nicely on small screens */
  margin-top: 0.5rem;
}

.buttons-center .button {
  min-width: 150px;             /* optional: same width for both */
  flex: 0 0 auto;
}

.accordion-locked {
  pointer-events: none;
  opacity: 0.5;             /* optional: leicht ausgegraut */
  cursor: not-allowed;
}

.blink-dot{
  --size: 12px;
  --red:  #e53935;
  --green:#43a047;

  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: inline-block;
  background: var(--red);
  box-shadow: 0 0 6px rgba(229,57,53,0.8);
  animation: dotBlink 1s steps(1, end) infinite;
  vertical-align: middle;
}

@keyframes dotBlink{
  0%,49.9%{
    background: var(--red);
    box-shadow: 0 0 6px rgba(229,57,53,0.8);
  }
  50%,100%{
    background: var(--green);
    box-shadow: 0 0 6px rgba(67,160,71,0.8);
  }
}

/* Barrierefreiheit: Animation abschalten, wenn gewünscht */
@media (prefers-reduced-motion: reduce){
  .blink-dot{ animation: none; }
}

.hidden {
  display: none;
}

.block.text-align-center {
  text-align: center;
}

.margin-top {
  margin-top: 1rem;
}

.margin-bottom {
  margin-bottom: 1rem;
}

.margin-right-half {
  margin-right: 0.5rem;
}

.input-outline {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px;
}

/* 🔥 Shake Animation for invalid inputs */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

.page[data-name="auth"] .page-content {
  margin-top: 100px; /* Platz für Navbar + Tabs */
}

.navbar .subnavbar {
  top: 44px; /* direkt unter dem Navbar-Titel */
}

.tabbar a.tab-link {
  font-size: 15px;
  font-weight: 500;
  padding-top: 6px;
  padding-bottom: 6px;
}

.tabbar a.tab-link-active {
  border-bottom: 3px solid #007aff; /* iOS-Blau sichtbar */
  color: #007aff !important;
}

.loader-screen {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: var(--ocean-page-bg, #F8FAFC);
  color: var(--ocean-text, #0F172A);
}
/* Override Framework7's blue gradient that paints `.bg-template` in dark navy. The
   parent `.loader-screen` provides the actual page-themed background — keep the
   `.bg-template` div + the `.background-overlay` div fully transparent so they don't
   stack a navy/dark-translucent rectangle on top. */
.loader-screen .bg-template,
.loader-screen .background-overlay,
.page-home.bg-template {
  background: transparent !important;
  background-image: none !important;
}
html.dark .loader-screen { background: var(--ocean-page-bg, #0F172A); color: var(--ocean-text, #E2E8F0); }

.loader-logo {
  width: 120px; /* nach Bedarf anpassen */
  height: auto;
}

.background-overlay {
  position: absolute;
  top: 0; left: 0;
  right: 0; bottom: 0;
  z-index: -1;
  background: rgba(0,0,0,0.4); /* optional */
}

/* Beispiel für Spinner-Animation */
.loader-rectangles {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.loader-rectangles div {
  width: 6px;
  height: 20px;
  background-color: #00aaff;
  animation: bounce 1.2s infinite ease-in-out;
}

.loader-rectangles div:nth-child(2) {
  animation-delay: -1.1s;
}
.loader-rectangles div:nth-child(3) {
  animation-delay: -1.0s;
}

@keyframes bounce {
  0%, 80%, 100% { transform: scaleY(0.4); }
  40% { transform: scaleY(1.0); }
}

#qr-reader video {
    filter: contrast(1.5) brightness(0.9) grayscale(1);
    object-fit: cover; /* Verhindert Verzerrungen */
}

/* ===== Chart sizing ===== */
.chart-box,
.chart-view {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 35vh;
  max-height: 300px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .chart-box,
  .chart-view {
    height: 280px;
    max-height: 280px;
  }
}

/* ===== Device Switcher (Navbar Dropdown) ===== */
.device-switcher-title {
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.device-switcher-chevron {
  font-size: 14px !important;
  opacity: 0.6;
  transition: transform 0.2s;
  margin-left: 2px;
}
.device-switcher-title:active .device-switcher-chevron {
  opacity: 1;
}

/* Device item inside action sheet */
.device-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.device-switcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.device-switcher-dot.online {
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
}
.device-switcher-dot.offline {
  background: #EF4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
.device-switcher-dot.unknown {
  background: #94A3B8;
}
.device-switcher-name {
  flex: 1;
  font-size: 15px;
}
.device-switcher-active {
  font-weight: 600;
}
.device-switcher-check {
  font-size: 18px !important;
  color: var(--f7-theme-color);
}

/* Separator in side panel before device list */
.panel-devices-separator {
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 8px 16px;
}
.panel-devices-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
  padding: 4px 16px 8px;
}

/* ===== OCEAN GRADIENT THEME ===== */

/* Navbar gradient */
.navbar .navbar-bg {
  background: linear-gradient(135deg, var(--ocean-theme) 0%, var(--ocean-light) 100%) !important;
  box-shadow: 0 2px 12px rgba(8,145,178,0.25);
}
.navbar .navbar-inner .title,
.navbar .navbar-inner .left a,
.navbar .navbar-inner .right a {
  color: #ffffff !important;
}
.navbar .navbar-inner .left i,
.navbar .navbar-inner .right i {
  color: #ffffff !important;
}

/* Page background */
.page-content {
  background-color: var(--ocean-page-bg);
}
.page {
  background-color: var(--ocean-page-bg);
}

/* Cards - Ocean style */
.card {
  background: var(--ocean-card-bg);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  border: none;
}
.card .card-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ocean-text-muted);
}

/* Home sections - card-like appearance */
/* Constrain home page content on wide screens */
.flex-page {
  max-width: 600px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.home_upper {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px !important;
  padding: 12px 16px !important;
  margin: 0 16px 12px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

/* Summary / metric tiles */
.home_lower {
  margin: 0 16px 16px;
}

/* Status tile (full width) */
.metric-tile {
  background: var(--ocean-card-bg, #fff);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.03);
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}
.metric-tile-link:active {
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.metric-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.metric-icon-wrap i {
  font-size: 22px;
}
.metric-icon-status { background: var(--ocean-bg, #ECFEFF); }
.metric-icon-status i { color: var(--ocean-theme, #0891B2); }
.metric-icon-temp { background: #FFF7ED; }
.metric-icon-temp i { color: #EA580C; }
.metric-icon-pres { background: #EEF2FF; }
.metric-icon-pres i { color: #4F46E5; }
.metric-icon-water { background: var(--ocean-bg, #ECFEFF); }
.metric-icon-water i { color: var(--ocean-theme, #0891B2); }
.metric-icon-flow { background: #F0F9FF; }
.metric-icon-flow i { color: #0284C7; }
.metric-icon-rain { background: #EFF6FF; }
.metric-icon-rain i { color: #2563EB; }
.metric-icon-humid { background: #F0FDFA; }
.metric-icon-humid i { color: #0D9488; }
.metric-icon-bat { background: #F0FDF4; }
.metric-icon-bat i { color: #16A34A; }
.metric-icon-vacation { background: #FEFCE8; }
.metric-icon-vacation i { color: #CA8A04; }
.metric-icon-thresholds { background: #F1F5F9; }
.metric-icon-thresholds i { color: #475569; }

.home_statusline_thresholds { margin-top: 8px; }
.home_statusline_thresholds .thresholds-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ocean-text, #0F172A);
}
.home_statusline_thresholds .threshold-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.home_statusline_thresholds .threshold-item i {
  font-size: 18px;
  color: var(--ocean-text-muted, #64748B);
}
.home_statusline_thresholds .threshold-sep {
  color: var(--ocean-text-muted, #64748B);
  margin: 0 2px;
}
html.dark .metric-icon-thresholds { background: #1E293B; }
html.dark .metric-icon-thresholds i { color: #CBD5E1; }
html.dark .home_statusline_thresholds .thresholds-row { color: #F1F5F9; }
html.dark .home_statusline_thresholds .threshold-item i,
html.dark .home_statusline_thresholds .threshold-sep { color: #94A3B8; }

.metric-body {
  flex: 1;
  min-width: 0;
}
.metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ocean-text-muted, #64748B);
  line-height: 1.2;
}
.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ocean-text, #0F172A);
  line-height: 1.2;
  margin-top: 2px;
}
.metric-sub {
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
  margin-top: 1px;
}
.metric-chevron {
  font-size: 20px !important;
  color: var(--ocean-text-muted, #64748B);
  opacity: 0.4;
  flex-shrink: 0;
}

/* Metric grid: 2 columns */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.metric-grid .metric-tile {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  margin-bottom: 0;
  position: relative;
}
.metric-grid .metric-chevron {
  position: absolute;
  top: 12px;
  right: 10px;
  font-size: 16px !important;
}
.metric-grid .metric-value {
  font-size: 20px;
}

/* Full-width tiles above/below grid */
.home_lower > .metric-tile {
  /* already styled by .metric-tile */
}
.home_lower > .home_statusline_status .metric-value {
  font-size: 15px;
  font-weight: 600;
}

/* Valve control buttons - Ocean style */
.segmented-round .button.button-fill {
  background-color: var(--ocean-theme) !important;
  box-shadow: 0 4px 12px rgba(8,145,178,0.3);
}
.segmented-round .button.button-outline {
  border-color: var(--ocean-border);
  color: var(--ocean-text-muted);
}

/* Status chips */
.hom_status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Push subscribe banner */
.askedPush {
  background: linear-gradient(135deg, var(--ocean-bg), white);
  border: 1.5px solid var(--ocean-theme);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 16px 16px;
}
.askedPush .button {
  background: var(--ocean-theme) !important;
  color: white !important;
  border-radius: 20px;
  font-weight: 600;
}

/* Bottom toolbar - Ocean style */
.toolbar.tabbar {
  background: #ffffff;
  border-top: 1px solid var(--ocean-border);
  box-shadow: none;
}
.toolbar.tabbar .tab-link {
  color: var(--ocean-text-muted);
  font-size: 10px;
  font-weight: 500;
  position: relative;
}
.toolbar.tabbar .tab-link.tab-link-active {
  color: var(--ocean-theme) !important;
  border-bottom: none !important;
}
.toolbar.tabbar .tab-link.tab-link-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--ocean-theme);
  border-radius: 2px;
}
.toolbar.tabbar .tab-link i {
  font-size: 24px;
}

/* Side panel - Ocean theme */
.panel-ocean {
  background: linear-gradient(180deg, var(--ocean-dark) 0%, var(--ocean-theme) 100%) !important;
  --f7-page-bg-color: transparent;
  --f7-list-bg-color: transparent;
  --f7-list-border-color: rgba(255,255,255,0.15);
  --f7-list-item-border-color: rgba(255,255,255,0.1);
  --f7-block-title-text-color: rgba(255,255,255,0.6);
}
.panel-ocean .page,
.panel-ocean .page-content {
  background: transparent !important;
}
.panel-ocean .links-list a,
.panel-ocean .links-list a span {
  color: #ffffff !important;
}
.panel-ocean .links-list a i,
.panel-ocean .links-list a .f7-icons,
.panel-ocean .links-list a .material-icons {
  color: rgba(255,255,255,0.8) !important;
}
.panel-ocean .links-list a:hover,
.panel-ocean .links-list a.active {
  background: rgba(255,255,255,0.12);
}
.panel-ocean .links-list li:after,
.panel-ocean .links-list ul:before,
.panel-ocean .links-list ul:after {
  background-color: rgba(255,255,255,0.1) !important;
}

/* List styling */
.list .item-title {
  color: var(--ocean-text);
}
.list .item-after {
  color: var(--ocean-text);
  font-weight: 600;
}

/* Timeline / events */
.timeline .timeline-item-inner {
  background: var(--ocean-card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* SubDevices on Home */
.home_subdevices_section {
  background: var(--ocean-card-bg);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  padding: 4px 0;
}
.home_subdevices_section .card-header {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ocean-text-muted);
  padding: 12px 16px 4px;
}
.home_subdevices_list {
  --f7-list-bg-color: transparent;
}
.home_subdevices_list .item-inner {
  border-bottom: 1px solid var(--ocean-border, #E2E8F0);
  padding: 8px 0;
}
.home_subdevices_list li:last-child .item-inner {
  border-bottom: none;
}
/* SubDevice icon box with online dot */
.subdev-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ocean-bg, #ECFEFF);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.subdev-icon-box i {
  font-size: 22px;
  color: var(--ocean-theme, #0891B2);
}
.subdev-icon-box .subdev-icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}
.subdev-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ocean-green, #10B981);
  border: 2px solid var(--ocean-card-bg, #fff);
}
.subdev-entry .item-text {
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
}

/* Offline devices: greyed out */
.subdev-offline {
  opacity: 0.45;
}
.subdev-offline .subdev-icon-box {
  background: #F1F5F9;
}
.subdev-offline .subdev-icon-box i {
  color: #94A3B8;
}

/* Active alarm: red pulse */
.subdev-alarm {
  opacity: 1 !important;
  background: var(--ocean-red-bg, #FEE2E2) !important;
  animation: subdevAlarmPulse 2s ease-in-out infinite;
}
@keyframes subdevAlarmPulse {
  0%, 100% { background-color: var(--ocean-red-bg, #FEE2E2); }
  50% { background-color: #FECACA; }
}
.subdev-alarm .subdev-icon-box {
  background: #FCA5A5;
}
.subdev-alarm .subdev-icon-box i {
  color: #DC2626;
}
.subdev-alarm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ocean-red, #EF4444);
  margin-left: auto;
  text-decoration: none;
  cursor: pointer;
  animation: alarmBlink 1s steps(1, end) infinite;
}
.subdev-alarm-badge i {
  font-size: 18px !important;
  color: #fff !important;
  font-weight: 800;
}
.subdev-alarm-badge-expired {
  background: rgba(239, 68, 68, 0.55);
  animation: alarmBlinkSoft 1.4s ease-in-out infinite;
}
.subdev-alarm-badge-expired i {
  color: #fff !important;
}
.subdev-alarm-expired {
  background: rgba(239, 68, 68, 0.06) !important;
  border: 1px solid rgba(239, 68, 68, 0.20);
}
@keyframes alarmBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.2; }
}
@keyframes alarmBlinkSoft {
  0%, 100% { opacity: 0.95; }
  50%      { opacity: 0.45; }
}
html.dark .subdev-alarm-expired { background: rgba(239, 68, 68, 0.12) !important; }

.subdev-settings-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ocean-page-bg, #F8FAFC);
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.2s;
}
.subdev-settings-btn i {
  font-size: 24px;
  color: var(--ocean-text-muted, #64748B);
}
.subdev-settings-btn:active {
  background: var(--ocean-border, #E2E8F0);
}

/* ===== Device Health Bar ===== */
.device-health-bar {
  background: var(--ocean-card-bg, #fff) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  margin-top: 6px;
  box-shadow: none !important;
  border: 1px solid var(--ocean-border, #E2E8F0);
}

/* ===== Home Alarm Overlay — red blink behind sections + translucent "!" ===== */
.page[data-name="homepage"].home-has-alarm > .page-content {
  background: rgba(239, 68, 68, 0.42) !important;
  animation: home-alarm-blink 1.4s ease-in-out infinite;
}
.page[data-name="homepage"].home-has-alarm > .page-content::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(239, 68, 68, 0.10);
  pointer-events: none;
  z-index: 1;
}
@keyframes home-alarm-blink {
  0%, 100% { background-color: rgba(239, 68, 68, 0.42) !important; }
  50%      { background-color: rgba(239, 68, 68, 0.12) !important; }
}
.home-alarm-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 60px rgba(239, 68, 68, 0.55), 0 0 120px rgba(239, 68, 68, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1500;
  animation: home-alarm-pulse 1.4s ease-in-out infinite;
  pointer-events: auto;
}
.home-alarm-mark .material-icons {
  font-size: 160px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 4px 18px rgba(0,0,0,0.30);
  font-weight: 800;
}
@keyframes home-alarm-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.95; }
  50%      { transform: translate(-50%, -50%) scale(0.92); opacity: 0.55; }
}
html.dark .page[data-name="homepage"].home-has-alarm > .page-content {
  background: rgba(239, 68, 68, 0.50) !important;
}

/* ===== Home Status Footer (replaces tabbar on Home) ===== */
.home-status-footer {
  background: var(--ocean-card-bg, #fff) !important;
  border-top: 1px solid var(--ocean-border, #E2E8F0) !important;
  /* Use min-height (not fixed height) and add bottom safe-area padding so the icons
     don't poke out above the toolbar on iPhone (where the home indicator pushes the
     toolbar's bottom edge inward). */
  height: auto !important;
  min-height: 56px !important;
  padding-bottom: env(safe-area-inset-bottom, 0) !important;
  box-shadow: 0 -1px 4px rgba(15,23,42,0.04) !important;
}
.home-status-footer .toolbar-inner.home-status-footer-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 56px !important;
  padding: 0 20px !important;
  box-sizing: border-box !important;
}
.home-status-footer .health-bar-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  color: var(--ocean-text, #0F172A) !important;
  flex: 0 1 auto !important;
}
.home-status-footer .health-bar-right {
  font-size: 12px !important;
  color: var(--ocean-text-muted, #64748B) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 0 1 auto !important;
  white-space: nowrap !important;
}
.home-status-footer .hom_lora {
  display: inline-flex;
  align-items: center;
  color: var(--ocean-theme, #0891B2);
  margin-left: 4px;
}
.home-status-footer .hom_lora .material-icons {
  font-size: 16px;
}
.home-status-footer .hom_queue {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #B45309;
  font-weight: 600;
  font-size: 12px;
}
.home-status-footer .hom_queue .hom_queue_icon { font-size: 14px; }
html.dark .home-status-footer .hom_queue {
  background: rgba(245, 158, 11, 0.22);
  color: #FCD34D;
}
.home-status-footer .footer-darkmode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--ocean-text-muted, #64748B);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  margin-left: 4px;
}
.home-status-footer .footer-darkmode-btn:hover {
  background: rgba(8,145,178,0.08);
  color: var(--ocean-theme, #0891B2);
}
.home-status-footer .footer-darkmode-btn .material-icons {
  font-size: 20px;
}
html.dark .home-status-footer .footer-darkmode-btn:hover {
  background: rgba(255,255,255,0.06);
}
.health-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.health-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ocean-green, #10B981);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
  flex-shrink: 0;
}
.health-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.health-bar-right {
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
  display: flex;
  align-items: center;
  gap: 6px;
}
.health-sep {
  opacity: 0.4;
}

/* ===== Valve Control Arc + Slider ===== */
.valve-control-card {
  text-align: center;
  padding: 8px 0 16px;
}
.valve-arc-wrap {
  position: relative;
  width: 200px;
  height: 115px;
  margin: 0 auto 4px;
}
.valve-arc-svg {
  display: block;
}
.valve-arc-fill {
  transition: stroke-dashoffset 0.35s ease, stroke 0.35s ease;
}
.valve-arc-value {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  line-height: 1;
}
.valve-pct-text {
  font-size: 36px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
}
.valve-pct-unit {
  font-size: 16px;
  font-weight: 400;
  color: var(--ocean-text-muted, #64748B);
  margin-left: 2px;
}
.valve-status-line {
  font-size: 13px;
  font-weight: 600;
  min-height: 22px;
  margin: 4px 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.valve-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}
.valve-slider-wrap {
  flex: 1;
  position: relative;
}
.valve-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--ocean-red, #EF4444) 0%, #0891B2 50%, var(--ocean-dark, #0E7490) 100%);
  outline: none;
}
.valve-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ocean-theme, #0891B2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: border-color 0.2s;
}
.valve-range::-webkit-slider-thumb:active {
  border-color: var(--ocean-dark, #0E7490);
  box-shadow: 0 2px 12px rgba(8,145,178,0.35);
}
.valve-range::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ocean-theme, #0891B2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
}
.valve-quick-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.valve-quick-btn i {
  font-size: 20px;
  color: #fff;
}
.valve-btn-close {
  background: var(--ocean-red, #EF4444);
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}
.valve-btn-close:active {
  background: #DC2626;
}
.valve-btn-open {
  background: var(--ocean-dark, #0E7490);
  box-shadow: 0 2px 8px rgba(14,116,144,0.3);
}
.valve-btn-open:active {
  background: #155E75;
}

/* BVS (binary) motor — centred, larger pill-shaped buttons with labels for a more
   modern look than the bare 40 px round icons. Toggled by `.valve-binary` on the row. */
.valve-slider-row.valve-binary {
  justify-content: center;
  gap: 16px;
  padding: 8px 16px 4px;
}
.valve-slider-row.valve-binary .valve-quick-btn {
  width: auto;
  min-width: 120px;
  height: 52px;
  border-radius: 26px;
  padding: 0 22px;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}
.valve-slider-row.valve-binary .valve-quick-btn i {
  font-size: 22px;
}
.valve-slider-row.valve-binary .valve-btn-close {
  box-shadow: 0 4px 14px rgba(239,68,68,0.32);
}
.valve-slider-row.valve-binary .valve-btn-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239,68,68,0.40);
}
.valve-slider-row.valve-binary .valve-btn-open {
  box-shadow: 0 4px 14px rgba(14,116,144,0.32);
}
.valve-slider-row.valve-binary .valve-btn-open:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(14,116,144,0.40);
}
.valve-slider-row .valve-quick-label { display: none; }
.valve-slider-row.valve-binary .valve-quick-label { display: inline; }

/* Loader screen - Ocean theme */
.loader-rectangles div {
  background-color: var(--ocean-light);
}

/* Button overrides */
.button.button-fill {
  background-color: var(--ocean-theme);
}
.button.button-round {
  border-radius: 24px;
}

/* Gauge area refinement */
.home_section .block {
  margin: 0 0 16px;
}

/* ===== Signin page (modern) =================================== */
.page-signin.signin-modern {
  background:
    radial-gradient(circle at 18% 0%, rgba(103,232,249,0.55) 0%, transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(8,145,178,0.6) 0%, transparent 50%),
    linear-gradient(135deg, var(--ocean-dark, #0E7490) 0%, var(--ocean-theme, #0891B2) 55%, var(--ocean-light, #06B6D4) 100%);
  overflow: hidden;
}
.page-signin.signin-modern .page-content { background: transparent; }

.signin-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.signin-bg-orb-1 {
  width: 280px; height: 280px;
  top: -90px; left: -70px;
  background: #67E8F9;
}
.signin-bg-orb-2 {
  width: 380px; height: 380px;
  bottom: -160px; right: -110px;
  background: #0E7490;
}

.signin-page-content {
  position: relative;
  z-index: 1;
  padding: 0;
}
.signin-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 32px 22px calc(28px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.signin-brand {
  text-align: center;
  margin-bottom: 26px;
}
.signin-logo {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  background: rgba(255,255,255,0.96);
  padding: 12px;
  object-fit: contain;
  box-shadow: 0 14px 40px rgba(0,0,0,0.22), 0 4px 12px rgba(0,0,0,0.08);
}
.signin-brand-title {
  margin: 14px 0 0;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.signin-card {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 24px;
  padding: 26px 22px 22px;
  box-shadow:
    0 30px 60px -14px rgba(15,23,42,0.35),
    0 10px 24px -8px rgba(15,23,42,0.18);
}
.signin-card-header { text-align: center; margin-bottom: 20px; }
.signin-card-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ocean-text, #0F172A);
}
.signin-card-sub {
  margin: 0;
  color: var(--ocean-text-muted, #64748B);
  font-size: 14px;
}

.signin-form { display: flex; flex-direction: column; gap: 14px; }
.signin-field { display: flex; flex-direction: column; gap: 6px; }
.signin-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ocean-text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 4px;
}
.signin-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.signin-input-icon {
  position: absolute;
  left: 14px;
  font-size: 20px;
  color: var(--ocean-text-muted, #94A3B8);
  pointer-events: none;
}
input.signin-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  background: var(--ocean-page-bg, #F1F5F9);
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-size: 15px;
  color: var(--ocean-text, #0F172A);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
input.signin-input.has-trailing { padding-right: 48px; }
input.signin-input::placeholder {
  color: var(--ocean-text-muted, #94A3B8);
  font-weight: 400;
}
input.signin-input:focus {
  background: #fff;
  border-color: var(--ocean-theme, #0891B2);
  box-shadow: 0 0 0 4px rgba(8,145,178,0.12);
}
.signin-pw-toggle {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--ocean-text-muted, #64748B);
  cursor: pointer;
  user-select: none;
}
.signin-pw-toggle:active {
  background: rgba(15,23,42,0.05);
}
.signin-pw-toggle .material-icons { font-size: 20px; }

.signin-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 6px;
}
.signin-forgot-link {
  color: var(--ocean-theme, #0891B2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.signin-forgot-link:active { opacity: 0.6; }

.signin-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ocean-theme, #0891B2) 0%, var(--ocean-light, #06B6D4) 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
  box-shadow: 0 12px 24px -8px rgba(8,145,178,0.55), 0 4px 8px -2px rgba(8,145,178,0.25);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.2s ease;
}
.signin-primary-btn:active {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.96);
  box-shadow: 0 6px 14px -6px rgba(8,145,178,0.45);
}
.signin-primary-arrow { font-size: 20px; transition: transform 0.18s ease; }
.signin-primary-btn:hover .signin-primary-arrow { transform: translateX(2px); }

.signin-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 4px;
  color: var(--ocean-text-muted, #94A3B8);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.signin-divider::before,
.signin-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ocean-border, #E2E8F0);
}

.signin-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: 14px;
  background: transparent;
  color: var(--ocean-theme, #0891B2);
  border: 1.5px solid var(--ocean-border, #E2E8F0);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.signin-secondary-btn .material-icons { font-size: 20px; }
.signin-secondary-btn:active {
  background: var(--ocean-page-bg, #F1F5F9);
  border-color: var(--ocean-theme, #0891B2);
}

.signin-cid {
  text-align: center;
  margin-top: 22px;
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.4px;
}

/* Dark mode: keep card readable, adjust card surface */
html.dark .signin-card {
  background: rgba(30,41,59,0.92);
  border-color: rgba(148,163,184,0.18);
}
html.dark .signin-card-title { color: #F1F5F9; }
html.dark .signin-card-sub { color: #94A3B8; }
html.dark input.signin-input {
  background: rgba(15,23,42,0.6);
  color: #F1F5F9;
}
html.dark input.signin-input:focus {
  background: #0F172A;
  box-shadow: 0 0 0 4px rgba(6,182,212,0.18);
  border-color: var(--ocean-light, #06B6D4);
}
html.dark .signin-divider::before,
html.dark .signin-divider::after { background: rgba(148,163,184,0.22); }
html.dark .signin-secondary-btn {
  border-color: rgba(148,163,184,0.28);
  color: var(--ocean-light, #06B6D4);
}
/* ============================================================== */

/* Material Symbols Rounded — newer icon font for glyphs missing in legacy Material Icons.
   The Google Fonts CSS only delivers the font face; the helper class is on us. */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* Icon colors in status rows */
.home_statusline .item-title i,
.home_statusline .item-inner i {
  color: var(--ocean-theme);
  font-size: 18px;
  margin-right: 6px;
}

/* Alarm icon boxes - Ocean colors */
.alarm-icon-box.bg-green { background: var(--ocean-green-bg) !important; }
.alarm-icon-box.bg-green i { color: var(--ocean-green) !important; }
.alarm-icon-box.bg-red { background: var(--ocean-red-bg) !important; }
.alarm-icon-box.bg-red i { color: var(--ocean-red) !important; }

/* ===== Temperature Page ===== */
.temp-current-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.temp-current-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.temp-now-val {
  font-size: 42px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  line-height: 1;
}
.temp-now-unit {
  font-size: 20px;
  font-weight: 400;
  color: var(--ocean-text-muted, #64748B);
}
.temp-current-range {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ocean-text-muted, #64748B);
}
.temp-range-label {
  font-weight: 600;
}
.use-current-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.use-current-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.use-now-val {
  font-size: 42px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.use-now-unit {
  font-size: 20px;
  font-weight: 400;
  color: var(--ocean-text-muted, #64748B);
}
.use-current-range {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ocean-text-muted, #64748B);
}
.use-range-label { font-weight: 600; }

.temp-now-unit-sm {
  font-size: 12px;
}
.temp-tabs {
  display: flex;
  margin: 0 16px;
  background: var(--ocean-card-bg, #fff);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.temp-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}
.temp-tab-active {
  background: var(--ocean-theme, #0891B2);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(8,145,178,0.3);
}
.temp-chart-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

/* ===== Pressure Page ===== */
.pres-current-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.pres-current-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pres-now-val {
  font-size: 42px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  line-height: 1;
}
.pres-now-unit {
  font-size: 20px;
  font-weight: 400;
  color: var(--ocean-text-muted, #64748B);
}
.pres-current-range {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ocean-text-muted, #64748B);
}
.pres-range-label {
  font-weight: 600;
}
.pres-now-unit-sm {
  font-size: 12px;
}
.pres-tabs {
  display: flex;
  margin: 0 16px;
  background: var(--ocean-card-bg, #fff);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.pres-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}
.pres-tab-active {
  background: var(--ocean-theme, #0891B2);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(8,145,178,0.3);
}
.pres-chart-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

/* ===== Usage Page (jsusage) ===== */
/* Meter card — wraps the mechanical-style odometer reading */
.meter-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.meter-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.meter-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.meter-head-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ocean-blue-bg, #ECFEFF);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.meter-head-icon i {
  font-size: 18px;
  color: var(--ocean-theme, #0891B2);
}
.meter-head-gear {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ocean-text-muted, #64748B);
  background: rgba(15,23,42,0.04);
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.meter-head-gear:hover {
  background: var(--ocean-blue-bg, #ECFEFF);
  color: var(--ocean-theme, #0891B2);
  transform: rotate(30deg);
}
.meter-head-gear i {
  font-size: 22px;
}

/* Odometer drum */
.odometer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding: 4px 0 2px;
}
.odo-frame {
  display: inline-flex;
  align-items: stretch;
  background: linear-gradient(#0b1220, #1f2937);
  padding: 8px 6px;
  border-radius: 10px;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.6),
    0 1px 0 rgba(255,255,255,0.04);
  border: 1px solid #0a0f1a;
}
.odo-digit {
  font-family: "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  width: 26px;
  text-align: center;
  padding: 6px 0;
  color: #f8fafc;
  background: linear-gradient(#1e293b 0%, #0f172a 50%, #1e293b 100%);
  border-radius: 4px;
  margin: 0 1px;
  box-shadow:
    inset 0 4px 6px rgba(0,0,0,0.55),
    inset 0 -3px 6px rgba(255,255,255,0.04);
  text-shadow: 0 1px 0 rgba(0,0,0,0.7);
}
.odo-digit.odo-frac {
  color: #fee2e2;
  background: linear-gradient(#7f1d1d 0%, #450a0a 50%, #7f1d1d 100%);
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}
.odo-sep {
  align-self: center;
  font-family: "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  font-weight: 700;
  font-size: 30px;
  color: #f8fafc;
  margin: 0 2px;
}
.odo-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--ocean-dark, #0E7490);
  letter-spacing: 0.02em;
}

/* Footer line — last manual reading */
.meter-card-foot {
  margin-top: 12px;
  border-top: 1px solid rgba(15,23,42,0.06);
  padding-top: 10px;
}
.meter-foot-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ocean-text-muted, #64748B);
}
.meter-foot-key {
  font-weight: 600;
}
.meter-foot-val {
  color: var(--ocean-dark, #0E7490);
}
.meter-foot-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ocean-text-muted, #64748B);
  font-style: italic;
}

/* ===== Mein Gerät — header + reporting tiles ===== */
.mygd-header-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.mygd-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
}
.mygd-header-row + .mygd-header-row {
  border-top: 1px solid rgba(15,23,42,0.06);
}
.mygd-header-label {
  color: var(--ocean-text-muted, #64748B);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 14px;
}
.mygd-header-value {
  color: var(--ocean-text-muted, #64748B);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
}
.mygd-accordion {
  margin: 0 16px 24px;
}

/* Mein Gerät — Header (image left, info right) */
.mygd-header-flex {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mygd-header-image {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,145,178,0.05);
  border-radius: 12px;
  overflow: hidden;
}
.mygd-header-image img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
}
.mygd-header-info {
  flex: 1;
  min-width: 0;
}

/* FW update panel */
.mygd-fw-update {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(15,23,42,0.06);
  text-align: center;
}
.mygd-fw-update .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  padding: 0 18px;
}
.mygd-fw-update .button i { font-size: 18px; }
.mygd-fw-update-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
}

/* ===== Mein Account — Main device list ===== */
.myacc-mainlist-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.myacc-mainlist-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 12px;
  border: 2px dashed rgba(8,145,178,0.30);
  border-radius: 10px;
  color: var(--ocean-theme, #0891B2);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 12px;
  transition: all 0.15s;
}
.myacc-mainlist-add:hover {
  background: rgba(8,145,178,0.05);
  border-color: var(--ocean-theme, #0891B2);
}
.myacc-mainlist-add i { font-size: 28px; }

.myacc-main-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--ocean-card-bg, #fff);
}
.myacc-main-tile-current {
  border-color: rgba(8,145,178,0.40);
  background: rgba(8,145,178,0.04);
}
.myacc-main-thumb {
  flex-shrink: 0;
  width: 48px; height: 48px;
  background: rgba(8,145,178,0.06);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
a.myacc-main-thumb:hover {
  background: rgba(8,145,178,0.12);
  transform: scale(1.04);
}
.myacc-main-thumb img {
  max-width: 40px; max-height: 40px;
  object-fit: contain;
  pointer-events: none;
}
.myacc-main-info {
  flex: 1; min-width: 0;
}
.myacc-main-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--ocean-dark, #0E7490);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
a.myacc-main-name:hover {
  color: var(--ocean-theme, #0891B2);
  text-decoration: underline;
}
.myacc-main-eid {
  font-weight: 500;
  color: var(--ocean-text-muted, #64748B);
  font-family: "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.myacc-main-tile-current .myacc-main-thumb { cursor: default; }
.myacc-main-tile-current a.myacc-main-thumb:hover { transform: none; background: rgba(8,145,178,0.06); }
.myacc-main-current-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--ocean-theme, #0891B2);
  border-radius: 999px;
  vertical-align: middle;
}
.myacc-main-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
}
.myacc-main-status .myacc-status-sub {
  font-variant-numeric: tabular-nums;
}
.myacc-main-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ocean-text-muted, #64748B);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.myacc-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.myacc-status-dot.online   { background: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,0.18); }
.myacc-status-dot.offline  { background: #94a3b8; }
.myacc-status-dot.unknown  { background: #cbd5e1; }
.myacc-main-del {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--ocean-text-muted, #64748B);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.myacc-main-del:hover {
  background: rgba(220,38,38,0.10);
  color: rgb(220,38,38);
}
.myacc-main-del i { font-size: 20px; }
.myacc-main-del-disabled {
  pointer-events: none;
  opacity: 0.30;
  cursor: not-allowed;
}
html.dark .myacc-main-tile {
  background: var(--ocean-card-bg, #1e293b);
  border-color: rgba(255,255,255,0.10);
}
html.dark .myacc-main-tile-current {
  background: rgba(34,211,238,0.10);
  border-color: rgba(34,211,238,0.40);
}

/* Battery bar inside Sensorsettings tile */
.mygd-batt-bar {
  position: relative;
  height: 14px;
  background: rgba(15,23,42,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
}
.mygd-batt-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  border-radius: 999px;
  transition: width 0.5s ease, background 0.3s ease;
}
.mygd-batt-bar-fill.warn {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}
.mygd-batt-bar-fill.low {
  background: linear-gradient(90deg, #b91c1c, #dc2626);
}
.mygd-batt-numbers {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
  font-variant-numeric: tabular-nums;
}
html.dark .mygd-batt-bar { background: rgba(255,255,255,0.08); }

/* Rain home section — chart on top, big "Regenmenge" label below */
.rain-chart-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  padding: 16px 16px 18px;
  margin: 0 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rain-chart-card-link {
  cursor: pointer;
}
.rain-chart-card-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08), 0 6px 16px rgba(0,0,0,0.06);
}

/* ===== Rain detail page — same look as Temperature/Pressure ===== */
.rain-current-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.rain-current-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rain-now-val {
  font-size: 42px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rain-now-unit {
  font-size: 20px;
  font-weight: 400;
  color: var(--ocean-text-muted, #64748B);
}
.rain-current-range {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ocean-text-muted, #64748B);
}
.rain-range-label {
  font-weight: 600;
}
.rain-tabs {
  display: flex;
  margin: 0 16px;
  background: var(--ocean-card-bg, #fff);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.rain-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}
.rain-tab-active {
  background: var(--ocean-theme, #0891B2);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(8,145,178,0.3);
}
.rain-chart-card-page {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.rain-chart-card .chart-container { margin-bottom: 12px; }
.rain-total-label {
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(15,23,42,0.06);
}
.rain-total-value {
  display: inline-block;
  font-size: 42px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.rain-total-sub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ocean-text-muted, #64748B);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
html.dark .rain-chart-card { background: var(--ocean-card-bg, #1e293b); }
html.dark .rain-total-label { border-top-color: rgba(255,255,255,0.08); }

/* Compact home rain chart so the 30-day chart + temperature/range tiles fit
   above the fold on mobile without scrolling. */
.home_section_rain .chart-box {
  height: 22vh;
  max-height: 180px;
}

/* Device switcher action sheet — pinned to the top of the screen (just below the navbar)
   instead of the default iOS-style bottom sheet. Constrained width so the buttons have
   breathing room from the screen edges on iPhone (was edge-to-edge). */
.actions-modal.device-switcher-actions {
  top: 56px !important;
  bottom: auto !important;
  transform: translate3d(0, -16px, 0);
  transition: transform 200ms ease, opacity 200ms ease;
  border-radius: 14px;
  left: 16px !important;
  right: 16px !important;
  width: auto !important;
  max-width: 480px;
  margin: 0 auto !important;
  box-sizing: border-box;
}
.actions-modal.device-switcher-actions.modal-in {
  transform: translate3d(0, 0, 0);
}
.actions-modal.device-switcher-actions .actions-button,
.actions-modal.device-switcher-actions .actions-button-text {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* ===== Events / UserLogs page ===== */
.evt-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 8px;
}
.evt-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ocean-card-bg, #fff);
  color: var(--ocean-text-muted, #64748B);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ocean-border, #E2E8F0);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.evt-filter-chip:hover {
  background: rgba(8,145,178,0.06);
  color: var(--ocean-dark, #0E7490);
}
.evt-filter-chip-active {
  background: var(--ocean-theme, #0891B2);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(8,145,178,0.30);
}
.evt-table-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 14px;
  margin: 8px 16px 24px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.evt-table-head {
  display: grid;
  grid-template-columns: 96px 36px 1fr;
  gap: 10px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ocean-text-muted, #64748B);
  background: rgba(15,23,42,0.03);
  border-bottom: 1px solid var(--ocean-border, #E2E8F0);
}
.evt-row {
  display: grid;
  grid-template-columns: 96px 36px 1fr;
  gap: 10px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px solid rgba(15,23,42,0.05);
}
.evt-row:last-child { border-bottom: none; }
.evt-row:hover { background: rgba(8,145,178,0.04); }
.evt-when {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ocean-text-muted, #64748B);
  white-space: nowrap;
}
.evt-cat {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.evt-cat .material-icons { font-size: 18px; color: #fff; }
.evt-cat-actions { background: var(--ocean-theme, #0891B2); }
.evt-cat-alarms  { background: var(--ocean-red, #EF4444); }
.evt-cat-devices { background: var(--ocean-amber, #F59E0B); }
.evt-cat-other   { background: #94A3B8; }
.evt-what {
  font-size: 14px;
  font-weight: 500;
  color: var(--ocean-text, #0F172A);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.evt-what-sub {
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
  margin-top: 2px;
}
.evt-empty {
  padding: 28px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--ocean-text-muted, #64748B);
}
html.dark .evt-table-card { background: var(--ocean-card-bg, #1e293b); }
html.dark .evt-table-head { background: rgba(255,255,255,0.04); border-bottom-color: rgba(255,255,255,0.08); }
html.dark .evt-row { border-bottom-color: rgba(255,255,255,0.06); }
html.dark .evt-row:hover { background: rgba(8,145,178,0.10); }
html.dark .evt-filter-chip { background: var(--ocean-card-bg, #1e293b); border-color: rgba(255,255,255,0.10); }

/* Subdevices appear inline inside the header card, indented under the main device */
.mygd-subdev-inline {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(15,23,42,0.06);
  padding-left: 24px; /* indent the satellite block */
  position: relative;
}
.mygd-subdev-inline::before {
  /* subtle vertical guide line on the left, suggesting hierarchy */
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: 0;
  width: 2px;
  background: rgba(8,145,178,0.18);
  border-radius: 1px;
}

/* Device name in header */
.mygd-header-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  margin-bottom: 6px;
  word-break: break-word;
}

/* Subdevices list */
.mygd-subdev-empty {
  padding: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--ocean-text-muted, #64748B);
  font-style: italic;
}
.mygd-subdev-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--ocean-card-bg, #fff);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  margin-bottom: 8px;
}
.mygd-subdev-arrow {
  flex-shrink: 0;
  color: var(--ocean-text-muted, #64748B);
  display: flex;
  align-items: center;
  width: 22px;
  justify-content: center;
}
.mygd-subdev-arrow i { font-size: 22px; }
.mygd-subdev-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(8,145,178,0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mygd-subdev-thumb img {
  max-width: 40px;
  max-height: 40px;
  object-fit: contain;
}
.mygd-subdev-info {
  flex: 1;
  min-width: 0;
}
.mygd-subdev-name {
  font-weight: 600;
  color: var(--ocean-dark, #0E7490);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mygd-subdev-last {
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
  margin-top: 2px;
}
.mygd-subdev-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.mygd-subdev-actions a {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ocean-text-muted, #64748B);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.mygd-subdev-actions a:hover { background: rgba(15,23,42,0.06); }
.mygd-subdev-actions a i { font-size: 26px; }
.mygd-subdev-decouple:hover {
  background: rgba(220,38,38,0.10) !important;
  color: rgb(220,38,38) !important;
}

/* Add tile */
.mygd-subdev-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 12px;
  border: 2px dashed rgba(8,145,178,0.30);
  border-radius: 10px;
  color: var(--ocean-theme, #0891B2);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
  margin-top: 4px;
}
.mygd-subdev-add:hover {
  background: rgba(8,145,178,0.05);
  border-color: var(--ocean-theme, #0891B2);
}
.mygd-subdev-add i { font-size: 32px; }

/* Add device dialog */
.mygd-add-input-wrap input {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,0.20);
  border-radius: 8px;
  font-size: 18px;
  font-family: "SF Mono", Menlo, monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  outline: none;
  box-sizing: border-box;
}
.mygd-add-input-wrap input:focus {
  border-color: var(--ocean-theme, #0891B2);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.15);
}
.mygd-add-thumb-wrap {
  text-align: center;
  padding: 12px 0;
}
.mygd-add-thumb-img {
  width: 96px; height: 96px;
  object-fit: contain;
  background: rgba(8,145,178,0.05);
  border-radius: 12px;
  padding: 8px;
}
.mygd-add-sku {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  font-family: "SF Mono", Menlo, monospace;
  letter-spacing: 0.02em;
}
.mygd-add-name {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ocean-text-muted, #64748B);
}
.mygd-add-pair-content { text-align: center; padding: 8px 0; }
.mygd-add-pulse-icon {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(8,145,178,0.10);
  display: flex; align-items: center; justify-content: center;
  animation: mygd-pulse 1.6s ease-in-out infinite;
}
.mygd-add-pulse-icon i { font-size: 32px; color: var(--ocean-theme, #0891B2); }
@keyframes mygd-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(8,145,178,0.4); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(8,145,178,0); }
}
.mygd-add-step3-text {
  font-size: 14px;
  color: var(--ocean-text-muted, #64748B);
  line-height: 1.5;
}

html.dark .mygd-subdev-tile {
  background: var(--ocean-card-bg, #1e293b);
  border-color: rgba(255,255,255,0.10);
}
html.dark .mygd-subdev-add {
  border-color: rgba(34,211,238,0.40);
  color: #22D3EE;
}

.mygd-tile {
  background: rgba(8,145,178,0.04);
  border: 1px solid rgba(8,145,178,0.10);
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin: 12px 0;
}
.mygd-tile + .mygd-tile {
  margin-top: 16px;
}
.mygd-tile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.mygd-tile-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
}
.mygd-tile-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  font-variant-numeric: tabular-nums;
}
.mygd-tile-value > span:last-child {
  font-size: 14px;
  font-weight: 500;
  color: var(--ocean-text-muted, #64748B);
}
.mygd-tile-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ocean-text-muted, #64748B);
  letter-spacing: 0.04em;
}
.mygd-tile-scale-mid { opacity: 0.5; }
.mygd-tile-hint {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(8,145,178,0.10);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ocean-text-muted, #64748B);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.mygd-tile-hint i {
  font-size: 16px;
  color: var(--ocean-theme, #0891B2);
  flex-shrink: 0;
  margin-top: 1px;
}

.mygd-band-readout {
  font-weight: 600;
  color: var(--ocean-dark, #0E7490);
  font-variant-numeric: tabular-nums;
}

/* Tile variants */
.mygd-tile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mygd-tile-row .mygd-tile-title {
  margin-bottom: 0;
  font-size: 15px;
  color: #0F172A;
  font-weight: 600;
  letter-spacing: 0;
}
html.dark .mygd-tile-row .mygd-tile-title { color: #E2E8F0; }
.mygd-tile-toggle .mygd-tile-hint {
  margin-top: 8px;
  padding-top: 8px;
}
.mygd-tile-row-sub {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(8,145,178,0.10);
}
.mygd-tile-subtitle {
  font-size: 13px;
  color: var(--ocean-text-muted, #64748B);
  font-weight: 500;
}
.mygd-tile-fields {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(8,145,178,0.10);
}
.mygd-field {
  margin-bottom: 10px;
}
.mygd-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mygd-field-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 8px;
  background: var(--ocean-card-bg, #fff);
  color: var(--ocean-dark, #0E7490);
  font-size: 14px;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.mygd-field-input:focus {
  border-color: var(--ocean-theme, #0891B2);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.15);
}
html.dark .mygd-field-input {
  border-color: rgba(255,255,255,0.10);
  color: #E2E8F0;
}

/* Threshold value (low – high · unit) */
.mygd-tile-value .mygd-tile-sep {
  font-size: 14px;
  color: var(--ocean-text-muted, #64748B);
  font-weight: 500;
  padding: 0 4px;
}
.mygd-tile-value .mygd-tile-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--ocean-text-muted, #64748B);
}

/* Flush tile (e.g. alarm list — content extends edge to edge) */
.mygd-tile-flush {
  padding: 0;
  overflow: hidden;
}
.mygd-tile-flush .list {
  margin: 0;
}
.mygd-tile-flush .list ul {
  background: transparent;
}

html.dark .mygd-tile {
  background: rgba(34,211,238,0.06);
  border-color: rgba(34,211,238,0.18);
}
html.dark .mygd-tile-hint i { color: #22D3EE; }

/* ===== Initial Help Bubbles ===== */
.help-bubble {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(220,38,38,0.88);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(220,38,38,0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: help-pulse 2.4s ease-in-out infinite;
}
.help-bubble-mark {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.help-bubble:hover {
  background: rgba(220,38,38,1);
}
@keyframes help-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 14px rgba(220,38,38,0.55), 0 0 0 0 rgba(220,38,38,0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(220,38,38,0.65), 0 0 0 12px rgba(220,38,38,0);
  }
}
html.dark .help-bubble {
  background: rgba(248,113,113,0.92);
  box-shadow: 0 4px 16px rgba(248,113,113,0.5);
}
html.dark .help-bubble:hover {
  background: rgba(248,113,113,1);
}

.use-tabs {
  display: flex;
  margin: 0 16px;
  background: var(--ocean-card-bg, #fff);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.use-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}
.use-tab-active {
  background: var(--ocean-theme, #0891B2);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(8,145,178,0.3);
}
.use-chart-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

/* ===== SubDevice Edit Page ===== */
/* Hero card */
.subdev-hero {
  position: relative;
  margin: 16px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(8,145,178,0.18), 0 1px 3px rgba(0,0,0,0.06);
  background: var(--ocean-card-bg, #fff);
}
.subdev-hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 96px;
  background: linear-gradient(135deg, var(--ocean-theme, #0891B2) 0%, var(--ocean-light, #06B6D4) 100%);
}
.subdev-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.18) 0%, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.10) 0%, transparent 50%);
  pointer-events: none;
}
.subdev-hero-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 22px;
}
.subdev-hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: var(--ocean-card-bg, #fff);
  box-shadow: 0 6px 20px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
  z-index: 1;
}
.subdev-hero-icon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}
.subdev-hero-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--ocean-text, #0F172A);
  line-height: 1.2;
  text-align: center;
  margin-bottom: 4px;
}
.subdev-hero-type {
  font-size: 13px;
  color: var(--ocean-text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.subdev-hero-id {
  font-size: 13px;
  color: var(--ocean-text-muted, #64748B);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.subdev-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--ocean-green-bg, #D1FAE5);
  color: var(--ocean-green, #10B981);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.subdev-status-pill.is-offline {
  background: var(--ocean-red-bg, #FEE2E2);
  color: var(--ocean-red, #EF4444);
}
.subdev-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.18);
}
.subdev-status-pill.is-offline .subdev-status-dot {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.18);
}

/* ===== Sub-device temperature threshold tile ===== */
.subdev-temp-section {
  margin: 0 16px 16px;
}
.subdev-temp-section .subdev-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ocean-text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 4px 8px;
}
.subdev-temp-card {
  background: var(--ocean-card-bg, #fff);
  border: 1px solid var(--ocean-border, #E2E8F0);
  border-radius: 14px;
  padding: 14px 16px 16px;
}
.subdev-temp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.subdev-temp-head .material-icons {
  font-size: 22px;
  color: var(--ocean-theme, #0891B2);
}
.subdev-temp-vals {
  font-size: 16px;
  font-weight: 600;
  color: var(--ocean-text, #0F172A);
}
.subdev-temp-sep, .subdev-temp-unit {
  color: var(--ocean-text-muted, #64748B);
  font-weight: 500;
}
.subdev-temp-card .range-slider {
  margin: 4px 0 6px;
}
.subdev-temp-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ocean-text-muted, #94A3B8);
}
html.dark .subdev-temp-card {
  background: var(--ocean-card-bg-dark, #1E293B);
  border-color: var(--ocean-border-dark, #334155);
}
html.dark .subdev-temp-vals { color: #F1F5F9; }

/* ===== Past-alarm cards on home (etime>0, seen=1, main device) ===== */
.home_past_alarms_section .card-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--ocean-text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 4px 8px;
}
.home_past_alarms { display: flex; flex-direction: column; gap: 8px; }
.home-pastalarm-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ocean-card-bg, #fff);
  border: 1px solid var(--ocean-border, #E2E8F0);
  border-left: 3px solid #F59E0B;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.home-pastalarm-card:active {
  transform: scale(0.99);
  background: var(--ocean-page-bg, #F8FAFC);
}
.home-pastalarm-icon {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(245,158,11,0.12);
  color: #B45309;
  border-radius: 10px;
  flex: 0 0 auto;
}
.home-pastalarm-icon .material-icons { font-size: 20px; }
.home-pastalarm-count {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--ocean-amber, #F59E0B);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--ocean-card-bg, #fff);
}
html.dark .home-pastalarm-count { box-shadow: 0 0 0 2px var(--ocean-card-bg, #1e293b); }
.home-pastalarm-body { flex: 1; min-width: 0; }
.home-pastalarm-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ocean-text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.home-pastalarm-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ocean-text, #0F172A);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-pastalarm-time {
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
  margin-top: 2px;
}
.home-pastalarm-chevron {
  color: var(--ocean-text-muted, #94A3B8);
  font-size: 22px;
  flex: 0 0 auto;
}
html.dark .home-pastalarm-card {
  background: var(--ocean-card-bg-dark, #1E293B);
  border-color: var(--ocean-border-dark, #334155);
}
html.dark .home-pastalarm-title { color: #F1F5F9; }

/* Metric chips row */
.subdev-metric-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 16px 16px;
}
.subdev-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--ocean-card-bg, #fff);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.03);
}
.subdev-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.subdev-chip-icon i { font-size: 20px; }
.subdev-chip-temp .subdev-chip-icon { background: #FFF7ED; }
.subdev-chip-temp .subdev-chip-icon i { color: #EA580C; }
.subdev-chip-bat .subdev-chip-icon { background: #F0FDF4; }
.subdev-chip-bat .subdev-chip-icon i { color: #16A34A; }
.subdev-chip-volt .subdev-chip-icon { background: #FEFCE8; }
.subdev-chip-volt .subdev-chip-icon i { color: #CA8A04; }
.subdev-chip-text { min-width: 0; }
.subdev-chip-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ocean-text-muted, #64748B);
}
.subdev-chip-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--ocean-text, #0F172A);
  line-height: 1.2;
}

/* Quick stats */
.subdev-stats-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  margin: 0 16px 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.subdev-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.subdev-stat {
  text-align: center;
  padding: 4px 2px;
}
.subdev-stat-icon {
  font-size: 20px !important;
  color: var(--ocean-theme, #0891B2);
  margin-bottom: 4px;
}
.subdev-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ocean-text-muted, #64748B);
  margin-bottom: 2px;
}
.subdev-stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ocean-text, #0F172A);
}

/* Settings groups */
.subdev-settings-group {
  margin: 0 16px 16px;
}
.subdev-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ocean-text-muted, #64748B);
  margin-bottom: 8px;
  padding-left: 8px;
}
.subdev-form {
  background: var(--ocean-card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  margin: 0 !important;
  overflow: hidden;
}
.subdev-form ul { background: transparent; }
.subdev-form ul::before,
.subdev-form ul::after { display: none; }
.subdev-form .item-media {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ocean-bg, #ECFEFF);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}
.subdev-form .item-media i {
  font-size: 20px;
  color: var(--ocean-theme, #0891B2);
}
.subdev-form .item-content { padding: 14px 16px; }
.subdev-form .item-title.item-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ocean-text, #0F172A);
}
.subdev-form .item-input-wrap input { font-size: 15px; }

/* Danger zone */
.subdev-danger-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 16px 32px;
  padding: 16px;
  background: var(--ocean-card-bg, #fff);
  border: 1.5px solid var(--ocean-red-bg, #FEE2E2);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(239,68,68,0.06);
}
.subdev-danger-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ocean-red-bg, #FEE2E2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.subdev-danger-icon i {
  color: var(--ocean-red, #EF4444);
  font-size: 22px;
}
.subdev-danger-body { flex: 1; min-width: 0; }
.subdev-danger-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ocean-text, #0F172A);
  margin-bottom: 2px;
}
.subdev-danger-desc {
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
  line-height: 1.4;
}
.subdev-danger-btn {
  flex-shrink: 0;
  padding: 0 14px;
  height: 32px;
  line-height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--ocean-red, #EF4444) !important;
  color: var(--ocean-red, #EF4444) !important;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
}
.subdev-danger-btn:active {
  background: var(--ocean-red-bg, #FEE2E2);
}
@media (max-width: 420px) {
  .subdev-danger-card { flex-wrap: wrap; }
  .subdev-danger-btn { width: 100%; margin-top: 4px; }
}

/* "More options" link on subdeveditdetails (leads to /subdevmanage/) */
.subdev-manage-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 14px 16px;
  background: var(--ocean-card-bg, #fff);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ocean-text, #0F172A);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.03);
}
.subdev-manage-link i.material-icons {
  font-size: 22px;
  color: var(--ocean-theme, #0891B2);
}
.subdev-manage-link span { flex: 1; }
.subdev-manage-link .subdev-manage-chevron {
  color: var(--ocean-text-muted, #94A3B8);
  font-size: 20px;
}
.subdev-manage-link:active { background: var(--ocean-page-bg, #F8FAFC); }

/* ===== Save / Cancel footer for config forms ===== */
.config-form-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--ocean-border, #E2E8F0);
  z-index: 10;
  margin-top: 16px;
}
.config-form-footer .button,
.config-accordion-footer .button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  line-height: 1;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-transform: none;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.config-form-footer .button .material-icons,
.config-accordion-footer .button .material-icons {
  font-size: 20px;
  line-height: 1;
}
.config-form-footer .config-cancel-btn,
.config-accordion-footer .config-cancel-btn {
  background: var(--ocean-page-bg, #F1F5F9);
  color: var(--ocean-text-muted, #475569);
  border: none;
}
.config-form-footer .config-cancel-btn:active,
.config-accordion-footer .config-cancel-btn:active {
  background: var(--ocean-border, #E2E8F0);
  transform: scale(0.98);
}
.config-form-footer .config-save-btn,
.config-accordion-footer .config-save-btn {
  background: var(--ocean-theme, #0891B2);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(8,145,178,0.45);
}
.config-form-footer .config-save-btn:not([disabled]):active,
.config-accordion-footer .config-save-btn:not([disabled]):active {
  transform: scale(0.98);
  filter: brightness(0.96);
}
.config-form-footer .config-save-btn[disabled],
.config-accordion-footer .config-save-btn[disabled] {
  background: var(--ocean-border, #E2E8F0);
  color: var(--ocean-text-muted, #94A3B8);
  box-shadow: none;
  pointer-events: none;
}

/* Inline footer inside accordion content (setup page) */
.config-accordion-footer {
  display: flex;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--ocean-border, #E2E8F0);
  margin-top: 8px;
}
.config-accordion-footer .button {
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
}
.config-accordion-footer .button .material-icons {
  font-size: 18px;
}

/* Alarm blinking indicator */
@keyframes alarm-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}
.alarm-blink {
  color: var(--ocean-red, #EF4444);
  font-size: 18px !important;
  vertical-align: middle;
  animation: alarm-blink 1s ease-in-out infinite;
}
.subdev-alarm-badge .material-icons {
  animation: alarm-blink 1s ease-in-out infinite;
}

/* Inline alarm bar (per device) */
.device-alarm-bar {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 8px;
  cursor: pointer;
}
.device-alarm-bar:active {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
.device-alarm-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.device-alarm-inner .alarm-blink {
  font-size: 20px !important;
  flex-shrink: 0;
}
.device-alarm-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #991b1b;
}
/* Alarm bar in status area (full width) */
.device-alarm-ch0 {
  margin: 0 0 8px;
  border-radius: 12px;
}
/* Alarm bar on subdevice entry */
.subdev-alarm-inline {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.subdev-alarm-inline .alarm-blink {
  font-size: 18px !important;
}
.subdev-alarm-inline-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: #991b1b;
}
html.dark .device-alarm-bar,
html.dark .subdev-alarm-inline {
  background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
  border-color: #991b1b;
}
html.dark .device-alarm-text,
html.dark .subdev-alarm-inline-text { color: #fca5a5; }

/* Alarm dialog */
.alarm-dialog-body {
  padding: 4px 0;
}
.alarm-dialog-text {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alarm-dialog-meta {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 16px;
}
.alarm-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.alarm-dialog-actions .button {
  font-weight: 500;
}
.alarm-dialog-link {
  text-align: center;
  margin-top: 12px;
  font-size: 0.85rem;
}
.alarm-dialog-link a {
  color: var(--ocean-dark, #0E7490);
  text-decoration: underline;
}

/* Smooth transitions */
.tab-link,
.button,
a {
  transition: all 0.2s ease;
}

/* Home upper section alignment */
.home_upper_centered {
  position: relative;
  text-align: center;
}
.home-section-settings {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #94a3b8;
  z-index: 1;
}
.home-section-settings i {
  font-size: 22px;
}

/* Valve motor label (below gauge) */
.valve-motor-label {
  text-align: center;
  margin: 4px 0 8px;
}
.valve-motor-name-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.valve-motor-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ocean-green, #10B981);
  flex-shrink: 0;
}
.valve-motor-dot.motor-offline {
  background: var(--ocean-red, #EF4444);
}
.valve-motor-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1e293b;
}
.valve-control-card.motor-offline {
  opacity: 0.45;
  pointer-events: none;
}

/* Pipecheck home card */
.pipecheck-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
  color: #334155;
}
.pipecheck-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.pipecheck-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ocean-dark, #0E7490);
  margin-bottom: 10px;
}
.pipecheck-header i {
  font-size: 20px;
}
.pipecheck-chevron {
  margin-left: auto;
  color: #94a3b8;
  font-size: 18px !important;
}
.pipecheck-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
}
.pipecheck-result-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}
.pipecheck-result-left i {
  font-size: 18px;
}
.pipecheck-result-date {
  font-size: 0.8rem;
  color: #94a3b8;
}
.pipecheck-schedule {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #64748b;
}
.pipecheck-schedule i {
  font-size: 16px;
  color: #94a3b8;
}
.pipecheck-schedule a {
  color: var(--ocean-dark, #0E7490);
  text-decoration: underline;
  font-weight: 500;
}

/* JPC page */
.jpc-action-section {
  padding: 16px;
}
.jpc-action-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.jpc-action-text {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 12px;
}
.jpc-action-btn-wrap {
  text-align: center;
  margin-top: 16px;
}
.jpc-start-btn {
  background: var(--ocean-dark, #0E7490) !important;
  color: #fff !important;
  font-weight: 600;
}
.jpc-start-btn i {
  font-size: 18px;
  margin-right: 4px;
  vertical-align: middle;
}
.jpc-stop-btn {
  display: none;
  border-color: var(--ocean-red, #EF4444) !important;
  color: var(--ocean-red, #EF4444) !important;
}
.jpc-stop-btn i {
  font-size: 18px;
  margin-right: 4px;
  vertical-align: middle;
}
.jpc-progress {
  display: none;
  margin-top: 16px;
  text-align: center;
}
.jpc-progress p {
  color: #64748b;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.jpc-history-section {
  padding: 0 16px 16px;
}
.jpc-history-header {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 10px;
}
.jpc-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.jpc-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.jpc-entry-icon {
  flex-shrink: 0;
}
.jpc-entry-icon i {
  font-size: 22px;
}
.jpc-entry-body {
  flex: 1;
  min-width: 0;
}
.jpc-entry-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: #1e293b;
}
.jpc-entry-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}
.jpc-entry-date {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}
.jpc-empty {
  text-align: center;
  padding: 24px;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Gauge labels */
.gauge-label {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: -8px;
}
.gauge-sublabel {
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===================== DARK MODE ===================== */
.darkmode-icon { font-size: 22px !important; }
html.dark .darkmode-icon { color: #fbbf24; }

html.dark {
  --ocean-card-bg: #1e293b;
  --ocean-page-bg: #0f172a;
  --ocean-text: #e2e8f0;
  --ocean-text-sub: #94a3b8;
  --ocean-border: #334155;
}
html.dark .page-content, html.dark .page {
  background: var(--ocean-page-bg) !important;
  color: var(--ocean-text);
}
html.dark .navbar-bg {
  background: #0c4a5e !important;
}
html.dark .home_upper,
html.dark .metric-tile,
html.dark .device-health-bar,
html.dark .pipecheck-card,
html.dark .jpc-action-card,
html.dark .jpc-entry {
  background: var(--ocean-card-bg) !important;
  color: var(--ocean-text);
}
html.dark .metric-tile,
html.dark .home_upper {
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
html.dark .pipecheck-card {
  border-color: var(--ocean-border) !important;
}
html.dark .pipecheck-result {
  background: #334155 !important;
}
html.dark .pipecheck-schedule {
  border-top-color: rgba(255,255,255,0.1);
}
html.dark .pipecheck-header {
  color: #67e8f9;
}
html.dark .metric-label,
html.dark .gauge-sublabel,
html.dark .pipecheck-result-date,
html.dark .pipecheck-schedule,
html.dark .jpc-entry-sub,
html.dark .jpc-entry-date,
html.dark .jpc-history-header,
html.dark .jpc-action-text {
  color: var(--ocean-text-sub) !important;
}
html.dark .metric-value,
html.dark .gauge-label,
html.dark .valve-motor-name,
html.dark .jpc-entry-title,
html.dark .pipecheck-result-left {
  color: var(--ocean-text) !important;
}
html.dark .metric-sub {
  color: #64748b !important;
}
html.dark .health-bar-inner {
  background: var(--ocean-card-bg);
}
html.dark .health-label {
  color: var(--ocean-text-sub);
}
html.dark .valve-arc-value,
html.dark .valve-pct-text {
  color: var(--ocean-text) !important;
}
html.dark .panel {
  background: var(--ocean-page-bg) !important;
  color: var(--ocean-text);
}
html.dark .panel .links-list a {
  color: var(--ocean-text) !important;
}
html.dark .toolbar {
  background: var(--ocean-card-bg) !important;
}
html.dark .tab-link {
  color: var(--ocean-text-sub) !important;
}
html.dark .tab-link.tab-link-active {
  color: #22d3ee !important;
}
html.dark .home_subdevices_section {
  color: var(--ocean-text);
}
html.dark .subdev-entry .item-content {
  background: var(--ocean-card-bg);
}
html.dark .subdev-entry .item-title,
html.dark .card-header {
  color: var(--ocean-text) !important;
}
html.dark .subdev-entry .item-text {
  color: var(--ocean-text-sub) !important;
}
html.dark .home-section-settings {
  color: #64748b;
}
html.dark .jpc-action-card {
  border: 1px solid var(--ocean-border);
}
html.dark .home_subdevices_list,
html.dark .home_subdevices_list ul,
html.dark .home_messages {
  background: transparent !important;
}
html.dark .valve-range {
  background: #334155;
}
html.dark .askedPush {
  color: var(--ocean-text);
}
/* ===== Info Page — modern design ===== */
.page[data-name="info"] .page-content {
  padding-bottom: 24px;
}

/* Hero card with logo + version */
.info-hero-card {
  background: linear-gradient(135deg, var(--ocean-theme, #0891B2) 0%, var(--ocean-dark, #0E7490) 100%);
  border-radius: 16px;
  margin: 16px;
  padding: 28px 20px 24px;
  text-align: center;
  color: #fff;
  box-shadow: 0 4px 20px rgba(8,145,178,0.25);
}
.info-hero-logo img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
  padding: 8px;
  margin-bottom: 10px;
}
.info-hero-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.info-hero-tagline {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 14px;
}
.info-hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  font-size: 12px;
}
.info-hero-meta-label {
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.info-hero-meta-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Section title (between cards) */
.info-section-title {
  margin: 22px 16px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Generic info card */
.info-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 14px;
  margin: 0 16px;
  padding: 6px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}
.info-card-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15,23,42,0.06);
}
.info-card-row:last-child { border-bottom: none; }
.info-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(8,145,178,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.info-card-icon i {
  color: var(--ocean-theme, #0891B2);
  font-size: 20px;
}
.info-card-body {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ocean-text, #0F172A);
}
.info-card-title {
  font-weight: 600;
  margin-bottom: 2px;
}
.info-card-text {
  color: var(--ocean-text, #0F172A);
}
.info-card-link {
  color: var(--ocean-theme, #0891B2);
  text-decoration: none;
  font-weight: 500;
}
.info-card-link:hover { text-decoration: underline; }
.info-card-flag {
  width: 32px;
  height: 22px;
  border-radius: 4px;
  align-self: center;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Quote card (Bible message) */
.info-quote-card {
  background: var(--ocean-card-bg, #fff);
  border-radius: 14px;
  margin: 16px;
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-left: 4px solid var(--ocean-theme, #0891B2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.info-quote-mark {
  font-size: 56px;
  line-height: 0.8;
  color: var(--ocean-theme, #0891B2);
  opacity: 0.4;
  font-family: Georgia, serif;
  flex-shrink: 0;
  margin-top: -4px;
}
.info-quote-body { flex: 1; }
.info-quote-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ocean-text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.info-quote-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ocean-text, #0F172A);
  font-style: italic;
  margin: 0;
}
.info-quote-source {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-style: normal;
  color: var(--ocean-text-muted, #64748B);
}

/* Privacy accordion */
.info-accordion {
  margin: 0 16px;
  background: var(--ocean-card-bg, #fff);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}
.info-accordion .item-link {
  padding: 14px 16px;
}
.info-accordion .item-title {
  font-weight: 600;
  font-size: 14px;
}
.info-privacy-block {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ocean-text, #0F172A);
  padding: 4px 16px 16px;
}
.info-privacy-block h5 {
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ocean-dark, #0E7490);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.info-privacy-block p { margin: 6px 0; }
.info-privacy-block ul { padding-left: 20px; margin: 6px 0; }

/* Actions */
.info-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px 16px 0;
}
.info-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ocean-theme, #0891B2);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(8,145,178,0.25);
}
.info-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(8,145,178,0.35);
}
.info-action-btn i { font-size: 20px; }
.info-action-btn-secondary {
  background: transparent;
  color: var(--ocean-text-muted, #64748B) !important;
  border: 1px solid rgba(15,23,42,0.10);
  box-shadow: none;
  font-weight: 500;
}
.info-action-btn-secondary:hover {
  background: rgba(8,145,178,0.06);
  color: var(--ocean-theme, #0891B2) !important;
  border-color: rgba(8,145,178,0.25);
  box-shadow: none;
}

html.dark .info-card,
html.dark .info-quote-card,
html.dark .info-accordion {
  background: var(--ocean-card-bg, #1e293b);
}
html.dark .info-card-row { border-bottom-color: rgba(255,255,255,0.06); }
html.dark .info-card-body,
html.dark .info-card-text,
html.dark .info-quote-text,
html.dark .info-privacy-block { color: var(--ocean-text); }
html.dark .info-action-btn-secondary {
  border-color: rgba(255,255,255,0.10);
}
html.dark .info-action-btn-secondary:hover {
  background: rgba(8,145,178,0.18);
}

/* ===== Home Messages — prominent banner-style ===== */
.home_messages { padding: 0; margin: 0; list-style: none; }
.home_messages li {
  list-style: none;
  margin: 14px 16px;
  padding: 0;
}
.home-message-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--ocean-theme, #0891B2) 0%, var(--ocean-dark, #0E7490) 100%);
  border-radius: 16px;
  padding: 18px 18px 18px 20px;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 4px 16px rgba(8,145,178,0.30), 0 8px 32px rgba(8,145,178,0.18);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: home-message-glow 2.4s ease-in-out infinite;
}
.home-message-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 60%;
  height: 180%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.home-message-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(8,145,178,0.40), 0 12px 40px rgba(8,145,178,0.22);
}
.home-message-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  position: relative;
  z-index: 1;
}
.home-message-icon i {
  font-size: 28px;
  color: #fff !important;
  font-weight: 700;
}
.home-message-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.home-message-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.80;
  margin-bottom: 4px;
}
.home-message-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.home-message-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
}
.home-message-chevron {
  color: rgba(255,255,255,0.85) !important;
  font-size: 26px !important;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
@keyframes home-message-glow {
  0%, 100% { box-shadow: 0 4px 16px rgba(8,145,178,0.30), 0 8px 32px rgba(8,145,178,0.18); }
  50%      { box-shadow: 0 6px 22px rgba(8,145,178,0.45), 0 12px 40px rgba(8,145,178,0.26); }
}

/* Firmware-update messages: amber gradient */
.home-message-fw {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  box-shadow: 0 4px 16px rgba(245,158,11,0.30), 0 8px 32px rgba(245,158,11,0.18);
  animation: home-message-glow-fw 2.4s ease-in-out infinite;
}
@keyframes home-message-glow-fw {
  0%, 100% { box-shadow: 0 4px 16px rgba(245,158,11,0.30), 0 8px 32px rgba(245,158,11,0.18); }
  50%      { box-shadow: 0 6px 22px rgba(245,158,11,0.50), 0 12px 40px rgba(245,158,11,0.30); }
}

/* Warnings: red gradient with faster pulse */
.home-message-warn {
  background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
  box-shadow: 0 4px 16px rgba(239,68,68,0.30), 0 8px 32px rgba(239,68,68,0.18);
  animation: home-message-glow-warn 1.6s ease-in-out infinite;
}
@keyframes home-message-glow-warn {
  0%, 100% { box-shadow: 0 4px 16px rgba(239,68,68,0.35), 0 8px 32px rgba(239,68,68,0.22); }
  50%      { box-shadow: 0 6px 22px rgba(239,68,68,0.55), 0 12px 40px rgba(239,68,68,0.32); }
}

html.dark .home-message-title { color: #fff; }

/* ===== Add-Device Pair Flow tweaks ===== */
.mygd-add-step3-hint {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ocean-text-muted, #64748B);
  background: rgba(245,158,11,0.08);
  border-left: 3px solid var(--ocean-amber, #F59E0B);
  padding: 8px 10px;
  border-radius: 6px;
}
.mygd-add-queue-line {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ocean-text-muted, #64748B);
}
.mygd-add-queue-line i { font-size: 16px; }

/* ===== My Account → Add main device flow ===== */
.myacc-add-lwan-text,
.myacc-add-wifi-text,
.myacc-add-scope-text,
.myacc-add-wait-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ocean-text, #0F172A);
  margin: 12px 0 8px;
}
.myacc-add-wifi-hint,
.myacc-add-wait-hint {
  font-size: 12px;
  color: var(--ocean-text-muted, #64748B);
  background: rgba(245,158,11,0.08);
  border-left: 3px solid var(--ocean-amber, #F59E0B);
  padding: 8px 10px;
  border-radius: 6px;
  margin-top: 8px;
}
.myacc-add-webhook {
  margin: 8px 0 4px;
  padding: 10px 12px;
  background: rgba(8,145,178,0.06);
  border: 1px solid rgba(8,145,178,0.18);
  border-radius: 8px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--ocean-dark, #0E7490);
}
.myacc-add-scope-steps {
  margin: 8px 0 6px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ocean-text, #0F172A);
}
.myacc-add-scope-steps li { margin: 4px 0; }

/* ================================================================================
   Unified button system — consistent height/padding/icon-gap across the whole app.
   - Save / OK / Sichern / Speichern  → green (`color-green`, `.config-save-btn`,
                                         `.button-save`, or buttons whose label
                                         contains the words save/sichern/speichern/ok)
   - Cancel / Abbrechen / Close      → red   (`color-red`, `.config-cancel-btn`,
                                         `.button-cancel`)
   - Each button has gap:8px so a leading <i class="material-icons"> sits next to text.
   ============================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-transform: none;
  line-height: 1;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.button .material-icons,
.button i.material-icons {
  font-size: 18px;
  line-height: 1;
}
.button:active { transform: scale(0.98); }

/* Save / positive — green */
.button.color-green,
.button.button-fill.color-green,
.button-save,
.config-save-btn:not(.config-cancel-btn) {
  background: var(--ocean-green, #10B981) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px -4px rgba(16,185,129,0.45);
}
.button.button-outline.color-green {
  background: transparent !important;
  color: var(--ocean-green, #10B981) !important;
  border: 1.5px solid var(--ocean-green, #10B981) !important;
  box-shadow: none;
}
.button.color-green:not([disabled]):active,
.button-save:not([disabled]):active,
.config-save-btn:not([disabled]):active { filter: brightness(0.95); }
.button.color-green[disabled],
.button-save[disabled],
.config-save-btn[disabled] {
  background: var(--ocean-border, #E2E8F0) !important;
  color: var(--ocean-text-muted, #94A3B8) !important;
  box-shadow: none;
  pointer-events: none;
}

/* Cancel / destructive — red */
.button.color-red,
.button.button-fill.color-red,
.button-cancel,
.config-cancel-btn {
  background: var(--ocean-red, #EF4444) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px -4px rgba(239,68,68,0.45);
}
.button.button-outline.color-red {
  background: transparent !important;
  color: var(--ocean-red, #EF4444) !important;
  border: 1.5px solid var(--ocean-red, #EF4444) !important;
  box-shadow: none;
}
.button.color-red:not([disabled]):active,
.button-cancel:not([disabled]):active,
.config-cancel-btn:not([disabled]):active { filter: brightness(0.95); }

/* The two save buttons that are still tagged blue in HTML — recolour to green
   without editing each page (Speichern / Change Password). */
#mygd_com_store,
#button_password {
  background: var(--ocean-green, #10B981) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px -4px rgba(16,185,129,0.45);
}

/* Re-state config-form footer button sizing so it inherits the unified heights
   instead of the older 48 px. */
.config-form-footer .button,
.config-accordion-footer .button {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  padding: 0 18px;
}
.config-form-footer .button .material-icons,
.config-accordion-footer .button .material-icons { font-size: 18px; }

html.dark .button.color-green[disabled],
html.dark .config-save-btn[disabled] {
  background: rgba(255,255,255,0.08) !important;
  color: rgba(255,255,255,0.35) !important;
}
