:root {
  --bg-color: #050505;
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --primary: #4ade80;
  --primary-glow: rgba(74, 222, 128, 0.2);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --blur: blur(30px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  /* VERHINDERT PULL-TO-REFRESH etc. in Android: */
  overscroll-behavior-y: none;
  touch-action: none;
}

/* Multi-layered living 3D background scene */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--bg-mesh, var(--bg-color));
  transition: background 0.45s ease;
}
.bg-beams {
  position: absolute;
  inset: -25%;
  background: var(--beam-gradient, none);
  filter: blur(55px);
  animation: rotateBeams 34s linear infinite;
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-color, rgba(255, 255, 255, 0.04)) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color, rgba(255, 255, 255, 0.04)) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 40%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 40%, #000 35%, transparent 100%);
}
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  will-change: transform;
}
.orb-1 {
  width: 580px; height: 580px;
  top: -140px; left: -100px;
  background: var(--orb-1, rgba(56, 189, 248, 0.45));
  animation: floatOrb1 18s ease-in-out infinite alternate;
}
.orb-2 {
  width: 540px; height: 540px;
  top: 6%; right: -120px;
  background: var(--orb-2, rgba(168, 85, 247, 0.42));
  animation: floatOrb2 22s ease-in-out infinite alternate;
}
.orb-3 {
  width: 620px; height: 620px;
  bottom: -180px; left: 32%;
  background: var(--orb-3, rgba(45, 212, 191, 0.38));
  animation: floatOrb3 24s ease-in-out infinite alternate;
}
.orb-4 {
  width: 420px; height: 420px;
  bottom: 8%; left: -80px;
  background: var(--orb-4, rgba(251, 146, 60, 0.24));
  animation: floatOrb2 20s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(70px, 50px) scale(1.12); }
}
@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-65px, 60px) scale(1.08); }
}
@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(55px, -45px) scale(1.1); }
}
@keyframes rotateBeams {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.floating-voice-btn {
  position: fixed; left: 40px; bottom: 40px; z-index: 999;
  width: 75px; height: 75px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #22c55e); 
  border: none; color: #000; font-size: 30px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(74, 222, 128, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}
.floating-voice-btn:hover { transform: scale(1.1); box-shadow: 0 15px 40px rgba(74, 222, 128, 0.7); }

.app-container { position: relative; z-index: 10; height: 100vh; display: flex; flex-direction: column; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: center; padding: 15px 25px 0px; height: 75px; }
.logo { display: flex; align-items: center;}
.header-time { 
  font-size: 50px; font-weight: 300; letter-spacing: 2px; 
  background: linear-gradient(135deg, #ffffff, #a5b4fc); 
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; 
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.15)); 
  line-height: 1; font-variant-numeric: tabular-nums; 
}
.header-right {
  display: flex; align-items: center; gap: 20px; background: var(--panel-bg);
  padding: 8px 20px; border-radius: 100px; backdrop-filter: var(--blur); border: 1px solid var(--panel-border);
}
.header-date { font-size: 16px; font-weight: 400; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;}
.settings-btn { background: transparent; border: none; color: var(--text-main); font-size: 20px; cursor: pointer; transition: color 0.3s; }
.settings-btn:hover { color: var(--primary); }

/* --- VERSION BADGE: subtle developer watermark in header --- */
.header-version-badge {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: rgba(85, 245, 177, 0.38);
  background: rgba(85, 245, 177, 0.05);
  border: 1px solid rgba(85, 245, 177, 0.12);
  padding: 3px 8px;
  border-radius: 100px;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
  user-select: none;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.header-version-badge:hover {
  color: rgba(85, 245, 177, 0.70);
  border-color: rgba(85, 245, 177, 0.28);
}

/* Dashboard Grid - Fixiert auf 3x3 Raster */
.dashboard {
  flex: 1; 
  display: grid; 
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr)); /* Zwingt Widgets, brav im Screen zu bleiben */
  gap: 15px; /* Etwas kompakter für M10 Tablet */
  padding: 10px 25px 20px; 
  align-items: stretch;
  overflow: hidden;
}

/* Widgets */
.widget {
  background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: var(--radius-lg);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex; flex-direction: column; cursor: grab;
  /* FIX für Android Touch z-index bugs */
  transform: translateZ(0); 
}
.widget:active { cursor: grabbing; box-shadow: 0 20px 40px rgba(0,0,0,0.6); }

/* WICHTIG FÜR SORTABLE GHOST (Die Schattengrafik beim Dragen) */
.sortable-ghost { opacity: 0.4; transform: scale(0.95); background: rgba(74, 222, 128, 0.1); border-color: var(--primary); }

.widget[data-type="player"], .widget[data-type="weather"], .widget[data-type="sensor"], .widget[data-type="waste"], .widget[data-type="calendar"], .widget[data-type="system"], .widget[data-type="tasmota"], .widget[data-type="timer"], .widget[data-type="note"] {
    grid-column: span 1;
    grid-row: span 1;
}

.widget-header { padding: 15px 20px 0px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.widget-header h3 { font-size: 14px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; }

.widget-icon-3d {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* DRAG HANDLE STYLING (TOUCH AREA VERGRÖSSERT) */
.drag-handle { 
  color: var(--text-muted); font-size: 20px; opacity: 0.8; margin-left: auto; 
  padding: 10px; pointer-events: auto; cursor: grab;
  /* Verhindert Text-Markierung beim Touch */
  user-select: none; -webkit-user-select: none;
}
.drag-handle:active { cursor: grabbing; }

.widget-body { padding: 5px 20px 20px; flex: 1; display:flex; flex-direction: column; justify-content: space-between; }
.widget.hidden { display: none !important; }

/* Specific Widgets - Weather */
.weather-layout { justify-content: space-around; padding-top: 0; }
.weather-desc { font-size: 16px; font-weight: 500; letter-spacing: 0.5px; opacity: 0.9; text-align: center; }
.weather-main { display: flex; align-items: center; gap: 15px; justify-content: center; }
.weather-icon { font-size: 45px; filter: drop-shadow(0 10px 15px rgba(255,255,255,0.2)); }
.weather-icon.sunny { background: linear-gradient(135deg, #fde047, #f59e0b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 10px 20px rgba(250, 204, 21, 0.4)); }
.weather-icon.cloudy { background: linear-gradient(135deg, #e2e8f0, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 5px 15px rgba(148, 163, 184, 0.3)); }
.weather-icon.rainy { background: linear-gradient(135deg, #93c5fd, #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 10px 20px rgba(59, 130, 246, 0.4)); }
.weather-temp { font-size: 52px; font-weight: 300; letter-spacing: -2px; line-height: 1; }
.weather-condition { font-size: 14px; font-weight: 400; color: var(--primary); text-align:center;}
.weather-details { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 6px 4px; 
  width: 100%; 
  background: rgba(0,0,0,0.2); 
  padding: 8px 10px; 
  border-radius: var(--radius-md); 
  border: 1px solid var(--panel-border); 
}
.w-detail { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.w-detail i { color: var(--text-muted); font-size: 11px; margin-bottom: 1px; }
.w-detail small { font-size: 8.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; line-height: 1; }
.w-detail span { font-size: 11px; font-weight: 600; color: var(--text-main); white-space: nowrap; line-height: 1.1; }

/* Waste */
.waste-list { display: flex; flex-direction: column; justify-content: space-evenly; height:100%; gap: 8px; }
.waste-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(0,0,0,0.2); border-radius: var(--radius-md); border: 1px solid var(--panel-border); }
.waste-item.bio { border-left: 4px solid #4ade80; }
.waste-item.paper { border-left: 4px solid #60a5fa; }
.waste-item.plastic { border-left: 4px solid #facc15; }
.waste-item.residual { border-left: 4px solid #94a3b8; }
.waste-item.hazardous { border-left: 4px solid #f97316; }
.waste-item span:first-child { flex: 1; font-weight: 500; font-size: 14px; }
.waste-item span:last-child { color: var(--text-muted); font-size: 12px; text-align: right;}
.waste-item i { font-size: 16px; filter: drop-shadow(0 0 5px rgba(255,255,255,0.1)); }
.icon-bio { color: #4ade80; }
.icon-paper { color: #60a5fa; }
.icon-plastic { color: #facc15; }
.icon-residual { color: #94a3b8; }

/* Player */
.player-layout { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.audio-controls { display: flex; flex-direction: column; align-items: center; gap: 15px; width: 100%; }
.radio-select {
  width: 100%;
  max-width: 260px;
  background: rgba(0,0,0,0.35);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}
.radio-presets-widget {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  margin: 6px 0 2px;
}
.radio-presets-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tasmota-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0,0,0,0.3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
}
.t-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.t-name { font-size: 13px; font-weight: 600; }
.t-ip { font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.t-btn.danger { background: rgba(239,68,68,0.15); color: #fca5a5; padding: 8px 10px; }
.play-round-btn {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #22c55e); 
  border: none; color: #000; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 20px rgba(74, 222, 128, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.play-round-btn:hover { transform: scale(1.05); }

.volume-control { display: flex; align-items: center; gap: 15px; width: 100%; max-width: 250px; color: var(--text-muted); font-size: 14px; }
.volume-control input[type=range] { flex: 1; -webkit-appearance: none; background: transparent; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.2); outline: none; }
.volume-control input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; cursor: pointer; box-shadow: 0 0 10px rgba(0,0,0,0.5); }

.visualizer { display: flex; gap: 6px; height: 30px; align-items: flex-end; margin-bottom: 5px; }
.visualizer .bar { width: 8px; height: 5px; background: rgba(255,255,255,0.2); border-radius: 4px; transition: height 0.1s ease; }
.visualizer.active .bar { background: var(--primary); animation: equalize 1s infinite alternate ease-in-out; }
.visualizer.active .bar:nth-child(1) { animation-delay: -0.2s; }
.visualizer.active .bar:nth-child(2) { animation-delay: -0.4s; }
.visualizer.active .bar:nth-child(3) { animation-delay: -0.1s; }
.visualizer.active .bar:nth-child(4) { animation-delay: -0.7s; }
.visualizer.active .bar:nth-child(5) { animation-delay: -0.5s; }
.visualizer.active .bar:nth-child(6) { animation-delay: -0.3s; }
@keyframes equalize { 0% { height: 10px; } 100% { height: 40px; } }

/* System Status */
/* System Status - Circular */
.system-layout-circular {
  padding-top: 4px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 10px;
  justify-content: center;
  align-items: center;
  height: 100%;
}
.gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gauge-ring {
  position: relative;
  width: 88px;
  height: 88px;
}
.gauge-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}
.gauge-value {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.3;
  stroke-dashoffset: 251.3;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: stroke-dashoffset;
  transform: translateZ(0);
}
.gauge-cpu {
  stroke: #4ade80;
  filter: drop-shadow(0 0 3px rgba(74, 222, 128, 0.5));
}
.gauge-ram {
  stroke: #3b82f6;
  filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.5));
}
.gauge-temp {
  stroke: #f97316;
  filter: drop-shadow(0 0 3px rgba(249, 115, 22, 0.5));
}
.gauge-net {
  stroke: #a855f7;
  filter: drop-shadow(0 0 3px rgba(168, 85, 247, 0.5));
}
.gauge-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
}
.gauge-icon {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}
.gauge-value-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.gauge-label {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

@media (max-height: 760px) {
  .system-layout-circular { gap: 12px 10px; padding-top: 4px; }
  .gauge-ring { width: 84px; height: 84px; }
  .gauge-icon { font-size: 13px; }
  .gauge-value-text { font-size: 13px; }
  .gauge-label { font-size: 11px; margin-top: 6px; }
}

.val-green { color: #4ade80; }
.val-yellow { color: #facc15; }
.val-red { color: #ef4444; }


/* --- Tasmota Widget --- */
.tasmota-layout { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; align-content: start; }
.tasmota-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--panel-border); border-radius: var(--radius-md); padding: 12px; color: var(--text-main); display: flex; align-items: center; gap: 10px; font-family: inherit; font-size: 14px; cursor: pointer; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.tasmota-btn i { font-size: 18px; transition: color 0.3s; color: rgba(255,255,255,0.3); }
.tasmota-btn.active { background: rgba(74, 222, 128, 0.1); border-color: var(--primary); box-shadow: inset 0 0 15px rgba(74, 222, 128, 0.1); }
.tasmota-btn.active i { color: var(--primary); filter: drop-shadow(0 0 8px var(--primary)); }

.tasmota-list-settings { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; }
.tasmota-setting-item { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.3); padding: 10px 15px; border-radius: var(--radius-sm); border: 1px solid var(--panel-border); }
.tasmota-setting-item b { font-weight: 500; font-size: 14px; }
.tasmota-setting-item small { color: rgba(255,255,255,0.4); margin-left:10px; }
.btn-del { background: none; border: none; color: #ef4444; font-size:16px; cursor: pointer; padding: 5px; opacity: 0.7; transition: 0.2s; }
.btn-del:hover { opacity: 1; transform: scale(1.1); }


/* Settings Overlay */
.settings-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); z-index: 200; opacity: 0; visibility: hidden; transition: all 0.4s; }
.settings-overlay.open { opacity: 1; visibility: visible; }
.settings-panel { position: fixed; right: -860px; top: 0; bottom: 0; width: 860px; background: rgba(15,15,15,0.9); backdrop-filter: blur(40px); border-left: 1px solid var(--panel-border); transition: right 0.5s cubic-bezier(0.19, 1, 0.22, 1); display: flex; flex-direction: column; overflow: hidden; }
.settings-overlay.open .settings-panel { right: 0; }
.settings-header { display: flex; justify-content: space-between; align-items: center; padding: 30px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.settings-header h2 { font-weight: 400; font-size: 24px; }
.close-btn { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

/* Settings Tabbed Layout */
.settings-layout { display: flex; flex: 1; overflow: hidden; height: calc(100% - 90px); }
.settings-sidebar { width: 230px; background: rgba(10, 10, 10, 0.4); border-right: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; padding: 20px 10px; gap: 6px; overflow-y: auto; }
.settings-tab-btn { background: transparent; border: none; color: var(--text-muted); padding: 12px 18px; border-radius: 0; text-align: left; font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.settings-tab-btn i { font-size: 15px; width: 20px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.settings-tab-btn:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-main); }
.settings-tab-btn.active { background: rgba(0, 150, 255, 0.12) !important; color: var(--primary) !important; border-left: 3px solid var(--primary); border-radius: 0 !important; padding-left: 15px; }
.settings-body { flex: 1; padding: 30px; overflow-y: auto; background: rgba(0, 0, 0, 0.15); }
.settings-tab-content { display: none; animation: fadeInSettings 0.35s ease; }
.settings-tab-content.active { display: block; }
.section-title { font-size: 15px; color: var(--text-main); font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 8px; }
.setting-section { margin-bottom: 30px; }

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

/* Dashboard View Mode Settings */
.viewmode-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 15px 0 25px 0;
}

@media (max-width: 600px) {
  .viewmode-cards-grid {
    grid-template-columns: 1fr;
  }
}

.viewmode-card {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.viewmode-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 242, 254, 0.4);
  transform: translateY(-2px);
}

.viewmode-card.selected {
  background: rgba(0, 242, 254, 0.08);
  border-color: var(--primary);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.2);
}

.viewmode-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  align-self: flex-start;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.viewmode-card.selected .viewmode-badge {
  background: rgba(0, 242, 254, 0.15);
  color: var(--primary);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.viewmode-mockup {
  height: 90px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.viewmode-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  width: 100%;
  height: 100%;
}

.viewmode-mini-tile {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.viewmode-mini-coverflow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.viewmode-mini-prev {
  width: 38px;
  height: 56px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateX(-14px) scale(0.8) rotateY(30deg);
  opacity: 0.55;
}

.viewmode-mini-hero {
  width: 54px;
  height: 68px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.3), rgba(79, 172, 254, 0.2));
  border: 1.5px solid var(--primary);
  border-radius: 7px;
  z-index: 2;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 15px;
}

.viewmode-mini-next {
  width: 38px;
  height: 56px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateX(14px) scale(0.8) rotateY(-30deg);
  opacity: 0.55;
}

.viewmode-radio-circle {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.viewmode-card.selected .viewmode-radio-circle {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
}

.viewmode-card.selected .viewmode-radio-circle::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #000;
}

/* Custom Scrollbars inside settings */
.settings-sidebar::-webkit-scrollbar, .settings-body::-webkit-scrollbar { width: 5px; }
.settings-sidebar::-webkit-scrollbar-thumb, .settings-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; }

@media (max-width: 768px) {
  .settings-layout { flex-direction: column; }
  .settings-sidebar { width: 100%; height: auto; flex-direction: row; padding: 8px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
  .settings-tab-btn { padding: 8px 12px; font-size: 12px; border-radius: 0; }
  .settings-tab-btn.active { border-left: none; border-bottom: 3px solid var(--primary); border-radius: 0 !important; padding-left: 12px; padding-bottom: 5px; }
  .settings-body { padding: 20px 15px; }
}
.input-group { display: flex; flex-direction: column; gap: 10px; }
.input-group input, .setting-section input[type="text"] { width: 100%; background: rgba(0,0,0,0.4); border: 1px solid var(--panel-border); padding: 12px 18px; border-radius: 100px; color: #fff; font-family: inherit; font-size: 14px; outline: none; }
.input-group input:focus, .setting-section input[type="text"]:focus { border-color: var(--text-muted); }
.btn { background: var(--text-main); color: #000; border: none; padding: 12px 20px; border-radius: 100px; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 0.2s, background 0.2s; }
.btn:hover { transform: scale(1.05); background: var(--primary); }

.preset-btn { 
    border-radius: 8px !important; /* Viereckig mit leicht abgerundeten Ecken statt Pillen-Form */
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: var(--text-main) !important;
    padding: 4px !important;
    width: 45px !important;
    height: 45px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0px !important;
}

.preset-btn strong { font-size: 16px; color: #fff; line-height: 1 !important; margin: 0; }
.preset-btn span { color: rgba(255,255,255,0.8); line-height: 1 !important; margin: 0; }

.preset-btn.assigned {
  background: var(--primary) !important;
  color: #000 !important;
  border-width: 0 !important;
  box-shadow: 0 0 10px rgba(0,255,136,0.3);
}
.preset-btn.assigned strong, .preset-btn.assigned span {
    color: #000 !important;
}
.toggle-group { display: flex; flex-direction: column; gap: 15px; }
.toggle-label { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 300; cursor: pointer; }
.toggle-label input { display: none; }
.toggle-switch { width: 50px; height: 28px; background: rgba(0,0,0,0.4); border: 1px solid var(--panel-border); border-radius: 100px; position: relative; transition: 0.3s; }
.toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; background: var(--text-muted); border-radius: 50%; transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.toggle-label input:checked + .toggle-switch { background: var(--primary); border-color: var(--primary); }
.toggle-label input:checked + .toggle-switch::after { background: #000; transform: translateX(22px); }

::-webkit-scrollbar { width: 0px; }

/* --- RESPONISVE ANPASSUNGEN Lenovo M10 FHD Plus --- */

/* Damit das Grid sich immer genau an den Platz im Fully anpasst: */
.dashboard {
  /* Wir löschen das harte padding und machen es Tablet-optimiert */
  padding: 10px 25px 25px; 
  gap: 20px;
}

.widget-body {
  /* Dadurch füllen die Widgets den Screen sanfter aus, Schrift etwas kompakter bei kleinen CSS-Verhältnissen */
  padding: 5px 15px 15px; 
}

/* Dynamische Textgrößenanpassung basierend auf der Tablet-Ratio (Fluid Typography) */
.header-time { 
  font-size: clamp(35px, 4vw, 50px); 
}
.weather-temp { 
  font-size: clamp(45px, 6vw, 70px); 
}
.weather-icon { 
  font-size: clamp(35px, 5vw, 50px); 
}
.play-round-btn {
  width: clamp(50px, 6vw, 70px);
  height: clamp(50px, 6vw, 70px);
}

/* Sorgt dafür das die Tasmota-Buttons nicht zu riesig werden bei kleineren CSS Viewports */
.tasmota-layout {
  gap: 8px;
}
.tasmota-btn {
  padding: 8px 12px;
  font-size: 13px;
}

.weather-main { margin: 3px 0; }
.weather-details { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 4px 6px; 
  padding: 6px 8px; 
  margin-bottom: 3px; 
}
.w-detail i { font-size: 10px; }
.w-detail span { font-size: 10px; }

/* RADIKALER HÖHEN-FIX FÜR 800px VIEWPORT TABLETS */
.widget-body { 
  padding: 0px 15px 10px; 
}
.widget-header { 
  padding: 10px 15px 5px; 
}
.widget-header h3 { 
  font-size: 12px; 
}

/* Wetter-Widget extrem quetschen */
.weather-icon { font-size: clamp(30px, 3.5vw, 40px); }
.weather-temp { font-size: clamp(35px, 4.5vw, 48px); line-height: 0.9; }
.weather-desc { font-size: 13px; margin-bottom: 2px; }
.weather-condition { font-size: 12px; margin-bottom: 4px; }

/* Abfall deutlich komprimieren */
.waste-list { gap: 4px; }
.waste-item { padding: 6px 10px; }
.waste-item span:first-child { font-size: 12px; }
.waste-item span:last-child { font-size: 10px; }
.waste-item i { font-size: 12px; }

/* System Status zusammenziehen */
.system-layout { padding-top: 0px; justify-content: flex-start; gap: 8px;}
.bar-row { margin-bottom: 2px; }
.bar-info { margin-bottom: 2px; }
.bar-label { font-size: 11px; }
.bar-val { font-size: 11px; }
.segments { height: 8px; }

/* Player Button anpassen */
.play-round-btn {
  width: 45px; height: 45px; font-size: 16px;
}
.audio-controls { gap: 10px; }
.visualizer { height: 15px; margin-bottom:0;}

/* Tasmota Buttons */
.tasmota-btn { padding: 6px 10px; font-size: 11px; }
.tasmota-btn i { font-size: 14px; }

/* --- UI POLISH: EINSTELLUNGSMENÜ --- */

.settings-panel {
  width: 420px; /* Ein My breiter für mehr Übersicht */
}

/* Neue Trennlinien zwischen den Kategorien */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.08) 50%, 
    rgba(255,255,255,0) 100%
  );
  margin: 15px 0 25px 0;
  width: 100%;
}

.setting-section h3 {
  font-size: 15px; 
  color: var(--text-main); 
  font-weight: 500; 
  margin-bottom: 5px; 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  text-transform: none; /* Kein all-caps mehr, das wirkt auf Dauer schwer lesbar bei Menüs */
  letter-spacing: 0.5px;
}
.setting-section h3 i {
  color: var(--primary);
}

.setting-sub-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 8px;
  display: block;
}

/* Eingabefelder im Panel wieder modern zusammengefasst */
.setting-section .input-group {
    background: rgba(0,0,0,0.15);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.02);
}

.input-group input[type="text"], .input-group input[type="file"] {
    background: rgba(255,255,255,0.03); 
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}
.input-group input[type="text"]:focus {
    border-color: var(--primary-glow);
    background: rgba(255,255,255,0.08);
}

/* --- UI POLISH: EINSTELLUNGSMENÜ AKKORDEON --- */

.settings-panel {
  width: 440px; 
}

/* Neue Trennlinien zwischen den Kategorien */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.08) 50%, 
    rgba(255,255,255,0) 100%
  );
  margin: 10px 0 10px 0;
  width: 100%;
}



.setting-sub-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 8px;
  display: block;
}

.setting-section .input-group {
    background: rgba(0,0,0,0.15);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.02);
}

.input-group input[type="text"], .input-group input[type="file"] {
    background: rgba(255,255,255,0.03); 
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}
.input-group input[type="text"]:focus {
    border-color: var(--primary-glow);
    background: rgba(255,255,255,0.08);
}


/* --- FULLY KIOSK TABLET FIT PATCH ---
   Keep every widget inside the visible viewport. */
html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body {
  min-height: 100dvh;
}

.app-container {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.header {
  height: 58px;
  min-height: 58px;
  padding: 8px 18px 0;
}

.header-time {
  font-size: clamp(32px, 3.4vw, 44px);
}

.header-right {
  padding: 6px 14px;
  gap: 14px;
}

.header-date {
  font-size: clamp(12px, 1.2vw, 15px);
}

.dashboard {
  min-height: 0;
  height: calc(100dvh - 58px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 12px;
  padding: 8px 18px 14px;
  overflow: hidden;
}

.widget {
  min-height: 0;
  border-radius: 18px;
}

.widget-header {
  min-height: 34px;
  padding: 7px 12px 2px;
}

.widget-header h3 {
  font-size: 11px;
  letter-spacing: 0.7px;
}

.drag-handle {
  padding: 6px 8px;
  font-size: 16px;
}

.widget-body {
  min-height: 0;
  padding: 0 12px 10px;
  overflow: hidden;
}

.weather-layout { justify-content: center; gap: 7px; }
.weather-desc { font-size: 13px; }
.weather-main { gap: 12px; margin: 0; }
.weather-icon { font-size: clamp(30px, 3.6vw, 42px); }
.weather-temp { font-size: clamp(36px, 4.4vw, 52px); }
.weather-condition { font-size: 12px; margin-bottom: 0; }
.weather-details { padding: 5px 10px; margin-bottom: 0; }

.waste-list { justify-content: center; gap: 5px; }
.waste-item { padding: 6px 9px; min-height: 0; }
.waste-item span:first-child { font-size: 11px; }
.waste-item span:last-child { font-size: 10px; }

.system-layout { justify-content: center; gap: 7px; }
.bar-row { margin-bottom: 0; }
.segments { height: 7px; }

.player-layout { justify-content: center; gap: 6px; }
.radio-select { padding: 6px 10px; font-size: 11px; max-width: 240px; }
.radio-presets-widget { gap: 5px; margin: 2px 0; }
.preset-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  font-size: 12px !important;
}
.preset-btn strong { font-size: 13px; }
.preset-btn span { font-size: 8px !important; }
.audio-controls { gap: 6px; }
.play-round-btn { width: 38px; height: 38px; font-size: 14px; }
.visualizer { height: 12px; }
.visualizer .bar { width: 6px; }
.volume-control { max-width: 220px; gap: 10px; font-size: 11px; }

.tasmota-layout {
  gap: 6px;
  align-content: center;
  overflow: hidden;
}
.tasmota-btn {
  min-height: 36px;
  padding: 6px 9px;
  font-size: 11px;
}

@media (max-height: 760px) {
  .header { height: 50px; min-height: 50px; padding-top: 6px; }
  .dashboard { height: calc(100dvh - 50px); padding: 6px 14px 10px; gap: 10px; }
  .widget-header { min-height: 28px; padding-top: 5px; }
  .widget-body { padding-bottom: 7px; }
  .weather-details { display: none; }
  .visualizer { display: none; }
  .radio-presets-widget { gap: 4px; }
  .preset-btn { width: 32px !important; height: 32px !important; min-width: 32px !important; }
}

/* --- NEO AURORA COMMAND DECK v3 ---
   Cinematic wall-panel redesign for Lenovo/Fully Kiosk. */
:root {
  --bg-color: #030711;
  --panel-bg: rgba(9, 16, 31, 0.58);
  --panel-border: rgba(170, 214, 255, 0.14);
  --text-main: #f8fbff;
  --text-muted: rgba(218, 232, 255, 0.58);
  --primary: #55f5b1;
  --primary-glow: rgba(85, 245, 177, 0.28);
  --accent-blue: #66d9ff;
  --accent-violet: #9f7aea;
  --danger-soft: rgba(239, 68, 68, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --blur: blur(34px) saturate(145%);
}

html, body {
  background:
    radial-gradient(circle at 18% 0%, rgba(85, 245, 177, 0.18), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(102, 217, 255, 0.16), transparent 30%),
    radial-gradient(circle at 55% 100%, rgba(159, 122, 234, 0.16), transparent 35%),
    linear-gradient(145deg, #02040a 0%, #07111f 52%, #050816 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 78%);
}

.app-container { position: relative; z-index: 2; padding: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }

.header {
  height: 64px;
  min-height: 64px;
  padding: 10px 22px 0;
}

.logo { gap: 18px; }
.header-time {
  font-size: clamp(38px, 4.3vw, 58px);
  font-weight: 300;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 0%, #c8f7ff 42%, #55f5b1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 24px rgba(85,245,177,0.18));
}
.deck-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.05;
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,0.12);
}
.deck-title span {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(248,251,255,0.92);
}
.deck-title small {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.header-right {
  background: rgba(8, 16, 31, 0.58);
  border: 1px solid rgba(170,214,255,0.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 40px rgba(0,0,0,0.22);
}
.header-date { color: rgba(229, 241, 255, 0.7); }
.settings-btn { color: rgba(248,251,255,0.88); }

.dashboard {
  height: calc(100dvh - 64px);
  overflow-y: auto;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(320px, 1fr));
  grid-auto-rows: minmax(320px, 1fr);
  gap: 14px;
  padding: 10px 22px 18px;
}

.widget {
  position: relative;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.075), rgba(255,255,255,0.028) 42%, rgba(4,10,22,0.45)),
    var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.11),
    inset 0 -1px 0 rgba(255,255,255,0.03),
    0 22px 70px rgba(0,0,0,0.34);
  overflow: hidden;
}
.widget::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(85,245,177,0.14), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.07), transparent 38%);
  opacity: 0.92;
}
.widget::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.42), transparent);
  opacity: 0.75;
}
.widget > * { position: relative; z-index: 1; }

.widget[data-type="weather"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="sensor"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="waste"], .widget[data-type="calendar"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="system"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="tasmota"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="player"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="presence"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="timer"], .widget[data-type="note"] { grid-column: span 2; grid-row: span 1; }

.widget[data-type="tasmota"]::before {
  background:
    radial-gradient(circle at 8% 10%, rgba(85,245,177,0.2), transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(102,217,255,0.14), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 42%);
}
.widget[data-type="player"]::before {
  background:
    radial-gradient(circle at 50% 10%, rgba(159,122,234,0.24), transparent 38%),
    radial-gradient(circle at 10% 90%, rgba(85,245,177,0.12), transparent 36%);
}

.widget-header {
  min-height: 38px;
  padding: 10px 16px 2px;
}
.widget-header h3 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(233,244,255,0.62);
}
.drag-handle { opacity: 0.42; }
.widget-body { padding: 0 16px 14px; }

/* Weather: premium hero card */
.weather-layout { justify-content: center; gap: 8px; }
.weather-desc {
  font-size: 14px;
  color: rgba(248,251,255,0.78);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.weather-main { gap: 16px; }
.weather-icon { font-size: clamp(40px, 4.2vw, 62px); }
.weather-temp {
  font-size: clamp(52px, 6vw, 82px);
  font-weight: 250;
  letter-spacing: -4px;
  text-shadow: 0 0 34px rgba(102,217,255,0.18);
}
.weather-condition { font-size: 14px; font-weight: 700; }
.weather-details {
  background: rgba(0,0,0,0.18);
  border-color: rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Waste */
.waste-list { gap: 7px; }
.waste-item {
  background: rgba(2,7,18,0.36);
  border-color: rgba(255,255,255,0.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045);
}
.waste-item span:first-child { font-size: 12px; }

/* System */
.system-layout { gap: 9px; }
.bar-label { color: rgba(229,241,255,0.72); }
.segments { height: 8px; gap: 4px; }
.segment { background: rgba(255,255,255,0.09); border-radius: 999px; }
.segment.c-green.active { background: linear-gradient(90deg, #37f39b, #a7ffd5); box-shadow: 0 0 13px rgba(85,245,177,0.68); }
.segment.c-yellow.active { background: linear-gradient(90deg, #facc15, #fde68a); }
.segment.c-red.active { background: linear-gradient(90deg, #ef4444, #fca5a5); }

/* Smart Home: compact tactile control bay */
.tasmota-layout {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  align-content: center;
}
.tasmota-btn {
  width: 145px;
  min-width: 125px;
  flex: 0 1 145px;
  min-height: 68px;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border-radius: 20px;
  background: rgba(0,0,0,0.22);
  border-color: rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.tasmota-btn i { font-size: 22px; }
.tasmota-btn.active {
  background: linear-gradient(145deg, rgba(85,245,177,0.22), rgba(85,245,177,0.06));
  border-color: rgba(85,245,177,0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 28px rgba(85,245,177,0.16);
}
.tasmota-btn.active i { color: #75ffc1; }

/* Radio: cockpit controls */
.player-layout { gap: 8px; }
.radio-select {
  max-width: 100%;
  background: rgba(0,0,0,0.26);
  border-color: rgba(255,255,255,0.09);
  color: rgba(248,251,255,0.92);
}
.radio-presets-widget { gap: 7px; }
.preset-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.preset-btn.assigned {
  background: linear-gradient(145deg, #55f5b1, #66d9ff) !important;
  box-shadow: 0 0 22px rgba(85,245,177,0.22);
}
.play-round-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(145deg, #55f5b1 0%, #66d9ff 100%);
  box-shadow: 0 0 34px rgba(85,245,177,0.24), inset 0 1px 0 rgba(255,255,255,0.38);
}
.visualizer .bar { border-radius: 999px; }
.visualizer.active .bar { background: linear-gradient(180deg, #66d9ff, #55f5b1); }

/* Settings panel matches the deck */
.settings-overlay { background: rgba(0,0,0,0.54); }
.settings-panel {
  background: rgba(5, 10, 22, 0.88);
  border-left-color: rgba(170,214,255,0.15);
  box-shadow: -30px 0 90px rgba(0,0,0,0.42);
}
.accordion-header.active { color: #72ffc3; }

@media (max-height: 760px) {
  .header { height: 56px; min-height: 56px; }
  .dashboard { height: calc(100dvh - 56px); gap: 10px; padding: 8px 16px 12px; }
  .deck-title small { display: none; }
  .weather-temp { font-size: clamp(42px, 5vw, 62px); }
  .tasmota-btn { min-height: 44px; }
}

/* --- NEO DECK PREFERENCES CONSOLE --- */
.settings-overlay {
  background:
    radial-gradient(circle at 72% 18%, rgba(85,245,177,0.13), transparent 26%),
    radial-gradient(circle at 88% 82%, rgba(102,217,255,0.12), transparent 30%),
    rgba(0,0,0,0.62);
  backdrop-filter: blur(16px) saturate(120%);
}

.settings-panel {
  width: min(860px, 95vw);
  right: min(-860px, -95vw);
  background:
    linear-gradient(160deg, rgba(255,255,255,0.075), transparent 24%),
    radial-gradient(circle at 18% 0%, rgba(85,245,177,0.13), transparent 34%),
    rgba(3, 8, 20, 0.92);
  border-left: 1px solid rgba(170,214,255,0.22);
  box-shadow:
    -44px 0 120px rgba(0,0,0,0.58),
    inset 1px 0 0 rgba(255,255,255,0.08);
  scrollbar-width: none;
}

.settings-panel::before {
  content: '';
  position: sticky;
  top: 0;
  display: block;
  height: 2px;
  z-index: 5;
  background: linear-gradient(90deg, transparent, #55f5b1, #66d9ff, transparent);
  box-shadow: 0 0 28px rgba(85,245,177,0.45);
}

.settings-header {
  position: sticky;
  top: 2px;
  z-index: 4;
  padding: 24px 26px 18px;
  background: linear-gradient(180deg, rgba(3,8,20,0.96), rgba(3,8,20,0.78));
  backdrop-filter: blur(28px) saturate(145%);
  border-bottom: 1px solid rgba(255,255,255,0.075);
}

.settings-header h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fbff;
}
.settings-header h2 i {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #061012;
  background: linear-gradient(145deg, #55f5b1, #66d9ff);
  box-shadow: 0 0 30px rgba(85,245,177,0.23);
}
.settings-header p {
  margin: 7px 0 0 50px;
  font-size: 12px;
  color: rgba(229,241,255,0.55);
  letter-spacing: 0.04em;
}
.close-btn {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(248,251,255,0.8);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.close-btn:hover {
  transform: scale(1.04) rotate(3deg);
  background: rgba(85,245,177,0.12);
  color: #72ffc3;
}

.settings-content {
  padding: 16px 22px 28px;
}

.setting-section {
  position: relative;
  margin-bottom: 12px !important;
  padding: 20px;
  border-radius: 0;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.058), rgba(255,255,255,0.022)),
    rgba(2, 8, 20, 0.42);
  border: 1px solid rgba(170,214,255,0.11);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 14px 34px rgba(0,0,0,0.18);
}
.setting-section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 0% 0%, rgba(85,245,177,0.11), transparent 32%);
  opacity: 1;
}

.accordion-header {
  position: relative;
  z-index: 1;
  min-height: 58px;
  padding: 14px 16px;
  gap: 13px;
  display: flex;
  align-items: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: transparent;
  text-shadow: 0 0 22px rgba(85,245,177,0.18);
}
.accordion-header i:first-child {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #061012;
  background: linear-gradient(145deg, #55f5b1, #66d9ff);
  box-shadow: 0 0 26px rgba(85,245,177,0.22);
}

.accordion-body {
  position: relative;
  z-index: 1;
  padding: 0 16px 16px;
}
.accordion-body p {
  margin: 0 0 14px !important;
  padding: 10px 12px;
  border-radius: 0;
  background: rgba(102,217,255,0.055);
  border: 1px solid rgba(102,217,255,0.09);
  font-size: 12px !important;
  line-height: 1.35;
}
.section-divider { display: none; }

.toggle-group {
  gap: 9px;
}
.toggle-label {
  min-height: 48px;
  padding: 10px 12px 10px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.075);
  color: rgba(248,251,255,0.82);
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.toggle-label:hover {
  transform: translateX(-2px);
  background: rgba(255,255,255,0.055);
  border-color: rgba(85,245,177,0.16);
}
.toggle-switch {
  width: 54px;
  height: 30px;
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.38);
}
.toggle-switch::after {
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: rgba(229,241,255,0.52);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.toggle-label input:checked + .toggle-switch {
  background: linear-gradient(90deg, #55f5b1, #66d9ff);
  border-color: transparent;
  box-shadow: 0 0 20px rgba(85,245,177,0.18);
}
.toggle-label input:checked + .toggle-switch::after {
  background: #041014;
  transform: translateX(24px);
}

.setting-section .input-group {
  gap: 11px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.075);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}
.setting-sub-label {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(114,255,195,0.78);
}
.input-group input,
.setting-section input[type="text"],
.input-group input[type="file"],
.radio-presets-settings select {
  min-height: 43px;
  border-radius: 15px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.1);
  color: #f8fbff;
  padding: 11px 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.input-group input:focus,
.setting-section input[type="text"]:focus,
.radio-presets-settings select:focus {
  border-color: rgba(85,245,177,0.42);
  background: rgba(85,245,177,0.065);
  box-shadow: 0 0 0 3px rgba(85,245,177,0.08);
}
.input-group input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 11px;
  padding: 8px 11px;
  color: #051013;
  background: linear-gradient(145deg, #55f5b1, #66d9ff);
  font-family: inherit;
  font-weight: 800;
}
.btn {
  min-height: 43px;
  border-radius: 15px;
  background: linear-gradient(145deg, #55f5b1, #66d9ff);
  color: #031014;
  box-shadow: 0 10px 26px rgba(85,245,177,0.16), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn:hover {
  background: linear-gradient(145deg, #78ffd0, #8be4ff);
  transform: translateY(-1px) scale(1.02);
}

.tasmota-list-settings,
#radioList {
  gap: 9px;
  margin-top: 12px;
}
.tasmota-setting-item,
.tasmota-row {
  min-height: 50px;
  border-radius: 17px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.tasmota-setting-item b,
.t-name { color: rgba(248,251,255,0.94); }
.tasmota-setting-item small,
.t-ip { color: rgba(218,232,255,0.48); }
.btn-del,
.t-btn.danger {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.18);
  color: #fca5a5;
}

.radio-presets-settings {
  margin-top: 8px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.07);
}
.radio-presets-settings > div {
  min-height: 44px;
  padding: 6px 0;
}
.radio-presets-settings span {
  color: rgba(248,251,255,0.78);
  font-weight: 800;
}

@media (max-height: 760px) {
  .settings-header { padding: 18px 22px 14px; }
  .settings-header h2 { font-size: 21px; }
  .settings-content { padding: 12px 16px 22px; }
  .accordion-header { min-height: 50px; padding: 10px 14px; }
  .accordion-header i:first-child { width: 32px; height: 32px; }
  .toggle-label { min-height: 42px; }
}

/* Combined Weather & Sensors Layout */
.combined-weather-sensors-layout {
  display: grid !important;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  align-items: stretch;
  flex: 1;
  box-sizing: border-box;
}

.weather-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sensors-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-sizing: border-box;
}

.combined-weather-details {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 4px;
  padding: 4px;
}

@media (max-width: 768px) {
  .combined-weather-sensors-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
  }
  .weather-side {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-right: 0;
    padding-bottom: 12px;
  }
}

.weather-layout {
  gap: 6px;
}

.weather-details {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 7px;
  background: rgba(0,0,0,0.16);
}

.w-detail {
  min-width: 0;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.055);
}

.w-detail i {
  font-size: 11px;
  color: rgba(114,255,195,0.82);
}

.w-detail small {
  display: block;
  font-size: 8px;
  line-height: 1;
  color: rgba(218,232,255,0.46);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.w-detail span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.05;
  color: rgba(248,251,255,0.9);
}

@media (max-height: 760px) {
  .weather-details {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
  }
  .w-detail {
    padding: 4px 3px;
  }
  .w-detail small {
    display: none;
  }
  .w-detail span {
    font-size: 9px;
  }
}

/* --- ADAPTIVE DASHBOARD GRID CLEANUP ---
   The dashboard should feel arranged, not manually squeezed.
   Keep exactly two visual rows on the Lenovo/Fully landscape viewport. */
.dashboard {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  grid-auto-flow: row dense;
  align-items: stretch;
}

/* Balanced 16:10 landscape composition:
   Row 1: Weather | Waste | System
   Row 2: Smart Home wide | Radio */
.widget[data-type="weather"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="sensor"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="waste"], .widget[data-type="calendar"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="system"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="tasmota"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="player"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="presence"] { grid-column: span 2; grid-row: span 1; }
.widget[data-type="timer"], .widget[data-type="note"] { grid-column: span 2; grid-row: span 1; }

/* Weather details stay rich, but no longer dominate the whole dashboard. */
.weather-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 6px;
  padding: 6px;
}
.w-detail {
  padding: 4px 2px;
}
.w-detail i { font-size: 10px; }
.w-detail small { font-size: 7.5px; }
.w-detail span { font-size: 9.5px; }
.weather-temp { font-size: clamp(38px, 4.2vw, 56px); }
.weather-icon { font-size: clamp(30px, 3.4vw, 46px); }
.weather-main { gap: 10px; }

/* Very wide displays can give the weather more breathing room. */
@media (min-aspect-ratio: 17/9) {
  .dashboard { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .widget[data-type="weather"] { grid-column: span 2; }
  .widget[data-type="sensor"] { grid-column: span 2; }
  .widget[data-type="waste"], .widget[data-type="calendar"] { grid-column: span 2; }
  .widget[data-type="system"] { grid-column: span 2; }
  .widget[data-type="tasmota"] { grid-column: span 2; }
  .widget[data-type="player"] { grid-column: span 2; }
  .widget[data-type="presence"] { grid-column: span 2; }
  .widget[data-type="timer"], .widget[data-type="note"] { grid-column: span 2; }
}

/* If Fully Kiosk reports a squatter viewport, compress contents but keep two rows. */
@media (max-height: 760px) {
  .dashboard {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .widget[data-type="weather"],
  .widget[data-type="sensor"],
  .widget[data-type="waste"], .widget[data-type="calendar"],
  .widget[data-type="system"],
  .widget[data-type="player"],
  .widget[data-type="presence"],
  .widget[data-type="timer"],
  .widget[data-type="note"],
  .widget[data-type="tasmota"] { grid-column: span 2; }
  .weather-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .w-detail i { display: none; }
  .w-detail small { display: none; }
}

/* Portrait/fallback: let the dashboard scroll instead of cutting content. */
@media (max-aspect-ratio: 4/3) {
  body { overflow: hidden; }
  .dashboard {
    overflow-y: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(220px, auto);
    padding-bottom: 18px;
  }
  .widget[data-type="weather"],
  .widget[data-type="sensor"],
  .widget[data-type="waste"], .widget[data-type="calendar"],
  .widget[data-type="system"],
  .widget[data-type="player"],
  .widget[data-type="presence"],
  .widget[data-type="timer"],
  .widget[data-type="note"] {
    grid-column: span 1;
    grid-row: span 1;
  }
  .widget[data-type="tasmota"] { grid-column: span 2; }
}

/* --- WASTE WHEELIE BIN ICONS --- */
.waste-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.bin-icon {
  --bin-color: #94a3b8;
  --bin-glow: rgba(148, 163, 184, 0.28);
  position: relative;
  width: 24px;
  height: 28px;
  flex: 0 0 24px;
  display: inline-block;
  filter: drop-shadow(0 0 8px var(--bin-glow));
}

.bin-lid {
  position: absolute;
  left: 3px;
  top: 2px;
  width: 18px;
  height: 5px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bin-color) 92%, white 8%), var(--bin-color));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
  transform: skewX(-8deg);
}

.bin-lid::before {
  content: '';
  position: absolute;
  left: 6px;
  top: -3px;
  width: 7px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: color-mix(in srgb, var(--bin-color) 82%, black 18%);
}

.bin-body {
  position: absolute;
  left: 4px;
  top: 8px;
  width: 16px;
  height: 17px;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--bin-color) 88%, white 12%), color-mix(in srgb, var(--bin-color) 78%, black 22%));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 2px 0 0 rgba(255,255,255,0.14), inset -2px 0 0 rgba(0,0,0,0.12);
}

.bin-body::before,
.bin-body::after {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 1px;
  background: rgba(255,255,255,0.18);
}
.bin-body::before { left: 5px; }
.bin-body::after { right: 5px; }

.bin-wheel {
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #05070c;
  border: 1px solid rgba(255,255,255,0.24);
}
.bin-wheel.left { left: 5px; }
.bin-wheel.right { right: 5px; }

.bin-bio { --bin-color: #4ade80; --bin-glow: rgba(74, 222, 128, 0.35); }
.bin-paper { --bin-color: #60a5fa; --bin-glow: rgba(96, 165, 250, 0.35); }
.bin-plastic { --bin-color: #facc15; --bin-glow: rgba(250, 204, 21, 0.34); }
.bin-residual { --bin-color: #94a3b8; --bin-glow: rgba(148, 163, 184, 0.28); }
.bin-hazardous { --bin-color: #f97316; --bin-glow: rgba(249, 115, 22, 0.35); }

@media (max-height: 760px) {
  .bin-icon {
    width: 20px;
    height: 23px;
    flex-basis: 20px;
  }
  .bin-lid { left: 2px; width: 16px; height: 4px; }
  .bin-body { left: 3px; top: 7px; width: 14px; height: 14px; }
  .bin-wheel { width: 4px; height: 4px; }
}

/* --- RADIO WIDGET CLEANUP ---
   Senderauswahl lebt nur noch in den Präferenzen; das Widget bleibt als Schnellbedienung. */
.widget[data-type="player"] .player-layout {
  justify-content: center;
  gap: 12px;
}

.widget[data-type="player"] .radio-presets-widget {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  max-width: 210px;
  margin: 0 auto 2px;
}

.widget[data-type="player"] .preset-btn {
  width: 100% !important;
  height: 42px !important;
  min-width: 0 !important;
  border-radius: 14px !important;
}

.widget[data-type="player"] .audio-controls {
  gap: 8px;
}

.widget[data-type="player"] .play-round-btn {
  width: 48px;
  height: 48px;
}

.widget[data-type="player"] .volume-control {
  max-width: 230px;
}

@media (max-height: 760px) {
  .widget[data-type="player"] .player-layout { gap: 8px; }
  .widget[data-type="player"] .radio-presets-widget { gap: 6px; max-width: 190px; }
  .widget[data-type="player"] .preset-btn { height: 34px !important; }
  .widget[data-type="player"] .play-round-btn { width: 40px; height: 40px; }
}

/* --- LIVE RADIO WIDGET - NEO-AURORA STREAMER (v3.23.8) --- */
.widget[data-type="player"] .player-layout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  height: calc(100% - 35px);
  padding: 10px 12px;
}

/* Live Status Badge in Header */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.live-badge.live {
  background: rgba(74, 222, 128, 0.12);
  color: var(--primary, #55f5b1);
  border-color: var(--primary-glow, rgba(85, 245, 177, 0.4));
}

.live-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s ease;
}

.live-badge.live .dot {
  background: var(--primary, #55f5b1);
  box-shadow: 0 0 8px var(--primary, #55f5b1);
  animation: pulseLiveDot 1.5s infinite;
}

@keyframes pulseLiveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

/* Hero Card: Vinyl Disc + Live Station Info + Mini EQ */
.radio-card-hero {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md, 14px);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.radio-card-hero::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -20px;
  width: 90px;
  height: 90px;
  background: var(--primary-glow, rgba(85, 245, 177, 0.3));
  filter: blur(35px);
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.radio-card-hero.playing::before {
  opacity: 0.5;
}

/* Vinyl Disc Avatar */
.vinyl-wrapper {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #2d3748 18%, #1a202c 19%, #111827 50%, #000 100%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  position: relative;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.vinyl-disc.spinning {
  animation: spinVinylDisc 6s linear infinite;
  border-color: var(--primary, #55f5b1);
  box-shadow: 0 0 16px var(--primary-glow, rgba(85, 245, 177, 0.4));
}

@keyframes spinVinylDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-center-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary, #55f5b1);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.station-info {
  flex: 1;
  min-width: 0;
}

.station-name-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.station-stream-desc {
  font-size: 11px;
  color: var(--accent-blue, #38bdf8);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Mini Equalizer inside Hero Card */
.mini-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.mini-bar {
  width: 3px;
  background: var(--primary, #55f5b1);
  border-radius: 2px;
  height: 3px;
  transition: height 0.15s ease;
}

.mini-equalizer.active .mini-bar:nth-child(1) { animation: miniEqAnim 0.7s infinite alternate ease-in-out; }
.mini-equalizer.active .mini-bar:nth-child(2) { animation: miniEqAnim 0.9s infinite alternate 0.2s ease-in-out; }
.mini-equalizer.active .mini-bar:nth-child(3) { animation: miniEqAnim 0.6s infinite alternate 0.4s ease-in-out; }
.mini-equalizer.active .mini-bar:nth-child(4) { animation: miniEqAnim 0.8s infinite alternate 0.1s ease-in-out; }

@keyframes miniEqAnim {
  0% { height: 3px; }
  100% { height: 16px; }
}

/* Quick Presets Section */
.radio-preset-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preset-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
}

.preset-pills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.preset-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 5px 3px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
}

.preset-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.preset-pill:active {
  transform: translateY(0);
}

.preset-pill.active {
  background: rgba(74, 222, 128, 0.12);
  border-color: var(--primary, #55f5b1);
  box-shadow: 0 0 10px var(--primary-glow, rgba(85, 245, 177, 0.3));
}

.preset-pill .pill-num {
  font-size: 8px;
  font-weight: 800;
  color: var(--text-muted);
}

.preset-pill.active .pill-num {
  color: var(--primary, #55f5b1);
}

.preset-pill .pill-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Audio Controls Bar */
.audio-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.btn-secondary-action {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-secondary-action:active {
  transform: translateY(0);
}

.btn-play-hero {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary, #55f5b1), #22c55e);
  border: none;
  color: #000;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow, rgba(85, 245, 177, 0.35));
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.btn-play-hero:hover {
  transform: scale(1.06);
}

.btn-play-hero:active {
  transform: scale(0.96);
}

.btn-play-hero.playing {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  color: #fff;
}

.volume-slider-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 6px 10px;
  flex: 1;
  min-width: 70px;
  max-width: 130px;
  height: 36px;
}

.volume-slider-compact input[type="range"] {
  flex: 1;
  width: 100%;
  min-width: 30px;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  outline: none;
  transition: background 0.2s;
}

.volume-slider-compact input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--primary, #55f5b1);
  cursor: pointer;
  box-shadow: 0 0 6px var(--primary-glow, rgba(85, 245, 177, 0.4));
  transition: transform 0.1s, background-color 0.2s;
}

.volume-slider-compact input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: var(--primary, #55f5b1);
  cursor: pointer;
  box-shadow: 0 0 6px var(--primary-glow, rgba(85, 245, 177, 0.4));
}

/* Responsive adjustments for Radio widget inside narrow viewports / cards */
@media (max-width: 1024px), (max-aspect-ratio: 4/3) {
  .radio-controls-bar #chooseStationBtn span {
    display: none;
  }
  .radio-controls-bar #chooseStationBtn {
    padding: 0;
    width: 38px;
    justify-content: center;
    gap: 0;
    flex-shrink: 0;
  }
  .widget-volume-control {
    max-width: 80px;
  }
}

/* --- NEO TALK WIDGET --- */
.dashboard {
  overflow-y: auto;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(320px, 1fr));
  grid-auto-rows: minmax(320px, 1fr);
}
.widget[data-type="weather"] { grid-column: span 3; grid-row: span 1; }
.widget[data-type="sensor"] { grid-column: span 3; grid-row: span 1; }
.widget[data-type="waste"], .widget[data-type="calendar"] { grid-column: span 3; grid-row: span 1; }
.widget[data-type="system"] { grid-column: span 3; grid-row: span 1; }
.widget[data-type="tasmota"] { grid-column: span 3; grid-row: span 1; }
.widget[data-type="player"] { grid-column: span 3; grid-row: span 1; }
.widget[data-type="presence"] { grid-column: span 3; grid-row: span 1; }
.widget[data-type="timer"], .widget[data-type="note"] { grid-column: span 3; grid-row: span 1; }

@media (min-aspect-ratio: 17/9) {
  .dashboard { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .widget[data-type="weather"] { grid-column: span 3; }
  .widget[data-type="sensor"] { grid-column: span 3; }
  .widget[data-type="waste"], .widget[data-type="calendar"] { grid-column: span 3; }
  .widget[data-type="system"] { grid-column: span 3; }
  .widget[data-type="player"],
  .widget[data-type="presence"],
  .widget[data-type="timer"],
  .widget[data-type="note"],
  .widget[data-type="tasmota"] { grid-column: span 3; }
}

@media (max-height: 760px) {
  .dashboard {
    overflow-y: auto;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(270px, 1fr));
    grid-auto-rows: minmax(270px, 1fr);
  }
  .widget[data-type="weather"] { grid-column: span 3; }
  .widget[data-type="sensor"] { grid-column: span 3; }
  .widget[data-type="waste"], .widget[data-type="calendar"] { grid-column: span 3; }
  .widget[data-type="system"] { grid-column: span 3; }
  .widget[data-type="player"],
  .widget[data-type="presence"],
  .widget[data-type="timer"],
  .widget[data-type="note"],
  .widget[data-type="tasmota"] { grid-column: span 3; }
}

@media (max-aspect-ratio: 4/3) {
  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }
  .widget[data-type="weather"],
  .widget[data-type="sensor"],
  .widget[data-type="waste"], .widget[data-type="calendar"],
  .widget[data-type="system"],
  .widget[data-type="player"],
  .widget[data-type="presence"],
  .widget[data-type="timer"],
  .widget[data-type="note"] { grid-column: span 1; }
  .widget[data-type="tasmota"] { grid-column: span 2; }
}

/* --- TASMOTA OFF STATE: red, as visible as ON --- */
.tasmota-btn.off {
  background: linear-gradient(145deg, rgba(239,68,68,0.24), rgba(239,68,68,0.07));
  border-color: rgba(239,68,68,0.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 28px rgba(239,68,68,0.18);
}
.tasmota-btn.off i {
  color: #ff8b8b;
  filter: drop-shadow(0 0 8px rgba(239,68,68,0.88));
}

/* --- AM2301 TASMOTA SENSOR GAUGES --- */
.widget[data-type="fritzbox"],
.widget[data-type="sensor"] { grid-column: span 3; grid-row: span 1; }

.widget[data-type="sensor"]::before {
  background:
    radial-gradient(circle at 50% 8%, rgba(102,217,255,0.22), transparent 36%),
    radial-gradient(circle at 12% 92%, rgba(85,245,177,0.16), transparent 34%),
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 42%);
}

.sensor-layout {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding-top: 8px;
}

.sensor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex: 1 1 calc(50% - 10px);
  min-width: 100px;
  max-width: none;
  height: 100%;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
}

.sensor-extra-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: 2px;
}

.sensor-humidity {
  font-size: 9.5px;
  color: rgba(218, 232, 255, 0.65);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sensor-battery {
  font-size: 9.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sensor-card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(218, 232, 255, 0.85);
  text-align: center;
  margin-bottom: 2px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sensor-gauges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.sensor-gauge {
  --value: 0;
  --sweep: 0%;
  --color: #55f5b1;
  position: relative;
  width: 72px; /* Auf 72px verkleinert für edlere Kompaktheit */
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(3,8,20,0.96) 0 74%, transparent 75%), /* Ringstärke filigraner auf 26% verkleinert */
    conic-gradient(from 225deg, var(--color) 0 var(--sweep), rgba(255, 255, 255, 0.09) 0 75%, transparent 75% 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 15px color-mix(in srgb, var(--color) 15%, transparent); /* Sanfterer Glow */
}

.sensor-gauge::before {
  content: '';
  position: absolute;
  inset: 4px; /* Inset angepasst an den dünneren Ring */
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  background: radial-gradient(circle at 50% 25%, rgba(255,255,255,0.08), rgba(255,255,255,0.02) 54%, rgba(0,0,0,0.18));
}

.gauge-core {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px; /* Gap verkleinert für kompakteren Text */
  text-align: center;
}

.gauge-core i {
  color: var(--color);
  font-size: 11px; /* Icon-Größe fein abgestimmt */
  filter: drop-shadow(0 0 6px var(--color));
}

.gauge-core strong {
  font-size: 18px; /* Temperaturzahl perfekt eingepasst */
  line-height: 0.95;
  font-weight: 300;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.gauge-core small {
  font-size: 6.5px; /* Sublabel dezent verkleinert */
  line-height: 1;
  color: rgba(218,232,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sensor-meta {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(218,232,255,0.62);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-height: 760px) {
  .widget[data-type="player"],
  .widget[data-type="presence"],
  .widget[data-type="tasmota"],
  .widget[data-type="timer"],
  .widget[data-type="note"] { grid-column: span 3; }
  .sensor-layout { gap: 6px; }
  .sensor-gauges { gap: 6px; }
  .sensor-gauge { width: 64px; }
  .sensor-gauge::before { inset: 3px; }
  .gauge-core i { display: none; }
  .gauge-core strong { font-size: 16px; }
  .gauge-core small { font-size: 6px; }
  .sensor-meta { padding: 3px 6px; font-size: 8px; }
}

@media (max-aspect-ratio: 4/3) {
  .widget[data-type="weather"],
  .widget[data-type="waste"], .widget[data-type="calendar"],
  .widget[data-type="system"],
  .widget[data-type="sensor"],
  .widget[data-type="player"],
  .widget[data-type="fritzbox"],
  .widget[data-type="presence"],
  .widget[data-type="camera"],
  .widget[data-type="jarvis"],
  .widget[data-type="timer"],
  .widget[data-type="note"] { grid-column: span 1; }
  .widget[data-type="tasmota"] { grid-column: span 2; }
}

/* ==========================================================================
   FRITZ!BOX MONITOR WIDGET & CALL-TOAST STYLING
   ========================================================================== */
.fritzbox-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  height: 100%;
}

/* Status Banner: Router & Internet Connection Badges */
.fritz-status-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm, 10px);
}

.fritz-status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.fritz-status-item span {
  font-variant-numeric: tabular-nums;
}

.led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: background-color 0.3s, box-shadow 0.3s;
  display: inline-block;
}

.led-dot.green {
  background-color: #55f5b1;
  box-shadow: 0 0 8px #55f5b1;
}

.led-dot.red {
  background-color: #ff3366;
  box-shadow: 0 0 8px #ff3366;
}

.led-dot.orange {
  background-color: #ff9f1c;
  box-shadow: 0 0 8px #ff9f1c;
}

/* Dual Bandwidth Glow Cards */
.fritz-bandwidth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fritz-speed-card {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm, 10px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.fritz-speed-card.down {
  border-color: rgba(85, 245, 177, 0.15);
}

.fritz-speed-card.down:hover {
  border-color: rgba(85, 245, 177, 0.3);
  box-shadow: 0 0 12px rgba(85, 245, 177, 0.1);
}

.fritz-speed-card.up {
  border-color: rgba(192, 132, 252, 0.15);
}

.fritz-speed-card.up:hover {
  border-color: rgba(192, 132, 252, 0.3);
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.1);
}

.speed-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.speed-card-header .speed-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

.fritz-speed-card.down .speed-label i { color: #55f5b1; }
.fritz-speed-card.up .speed-label i { color: #c084fc; }

.speed-sync {
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.8;
  font-family: monospace;
}

.speed-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 2px 0 6px 0;
}

.speed-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: monospace;
  color: #fff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.speed-unit {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.speed-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.speed-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.speed-progress-fill.down {
  background: linear-gradient(90deg, #55f5b1, #2dd4bf);
  box-shadow: 0 0 8px rgba(85, 245, 177, 0.5);
}

.speed-progress-fill.up {
  background: linear-gradient(90deg, #c084fc, #e879f9);
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.5);
}

/* Guest WiFi Bar */
.fritz-guest-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm, 10px);
}

.guest-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guest-info i {
  font-size: 13px;
  transition: color 0.3s;
}

.guest-info i.active {
  color: #55f5b1 !important;
  filter: drop-shadow(0 0 6px rgba(85, 245, 177, 0.5));
}

.guest-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.1;
}

.guest-sub {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 1px;
}

.guest-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-guest-qr {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-guest-qr:hover {
  background: rgba(85, 245, 177, 0.15);
  border-color: rgba(85, 245, 177, 0.4);
  color: #55f5b1;
  transform: translateY(-1px);
}

/* Compact Toggle Switch */
.toggle-switch-compact {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  margin: 0;
}

.toggle-switch-compact input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch-compact .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 18px;
}

.toggle-switch-compact .slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch-compact input:checked + .slider {
  background-color: var(--primary, #55f5b1);
  box-shadow: 0 0 8px rgba(85, 245, 177, 0.4);
}

.toggle-switch-compact input:checked + .slider:before {
  transform: translateX(14px);
  background-color: #0f172a;
}

/* Recent Calls Section */
.fritz-call-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.call-title-text {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.call-count-badge {
  font-size: 9px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: monospace;
}

.fritz-call-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  max-height: 85px;
  padding-right: 2px;
}

.fritz-call-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm, 8px);
  font-size: 11px;
  animation: fadeInCall 0.35s ease;
  transition: background 0.15s, border-color 0.15s;
}

.fritz-call-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

@keyframes fadeInCall {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.call-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.call-icon {
  font-size: 11px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  shrink: 0;
}

.call-icon.inbound {
  background: rgba(85, 245, 177, 0.12);
  color: #55f5b1;
  border: 1px solid rgba(85, 245, 177, 0.25);
}

.call-icon.outbound {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.call-icon.missed {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.call-icon.connected {
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.25);
}

.call-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  min-width: 0;
}

.call-name {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.call-time {
  font-size: 9px;
  color: var(--text-muted);
}

.call-duration {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-family: monospace;
}

.call-duration.missed-badge {
  color: #f43f5e;
  font-weight: 600;
}

.no-calls {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 12px 0;
  opacity: 0.7;
}

/* Guest QR Modal Styling */
.fritz-qr-modal-content {
  max-width: 380px;
  width: 90%;
  padding: 24px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(85, 245, 177, 0.25);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.fritz-qr-container {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
  margin: 10px auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.fritz-qr-container svg {
  display: block;
  width: 180px;
  height: 180px;
}

.fritz-qr-credentials {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.5;
}

/* Theme Overrides for Fritz!Box Neo-Glow */
body.theme-cyberpunk .fritz-speed-card.down {
  border-color: rgba(255, 85, 0, 0.3);
  border-radius: 0;
}
body.theme-cyberpunk .fritz-speed-card.up {
  border-color: rgba(0, 240, 255, 0.3);
  border-radius: 0;
}
body.theme-cyberpunk .speed-progress-fill.down {
  background: #ff5500;
  box-shadow: 0 0 8px #ff5500;
}
body.theme-cyberpunk .speed-progress-fill.up {
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff;
}
body.theme-cyberpunk .fritz-guest-bar {
  border-radius: 0;
  border-color: rgba(255, 85, 0, 0.3);
}
body.theme-cyberpunk .btn-guest-qr {
  border-radius: 0;
}

body.theme-nordic .fritz-speed-card {
  background: #242933;
  border: 1px solid #3b4252;
  box-shadow: none;
}
body.theme-nordic .speed-progress-fill.down {
  background: #88c0d0;
  box-shadow: none;
}
body.theme-nordic .speed-progress-fill.up {
  background: #b48ead;
  box-shadow: none;
}
body.theme-nordic .fritz-guest-bar {
  background: #242933;
  border-color: #3b4252;
}

/* Theme Overrides for Live Radio Neo-Aurora */
body.theme-cyberpunk .radio-card-hero {
  border-radius: 0;
  border-color: rgba(255, 85, 0, 0.3);
}
body.theme-cyberpunk .preset-pill {
  border-radius: 0;
}
body.theme-cyberpunk .preset-pill.active {
  border-color: #ff5500;
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.4);
}
body.theme-cyberpunk .preset-pill.active .pill-num {
  color: #ff5500;
}
body.theme-cyberpunk .btn-play-hero {
  background: linear-gradient(135deg, #ff5500, #ff0055);
  box-shadow: 0 4px 12px rgba(255, 85, 0, 0.4);
}
body.theme-cyberpunk .btn-secondary-action {
  border-radius: 0;
}
body.theme-cyberpunk .volume-slider-compact {
  border-radius: 0;
}

body.theme-nordic .radio-card-hero {
  background: #242933;
  border-color: #3b4252;
}
body.theme-nordic .preset-pill {
  background: #242933;
  border-color: #3b4252;
}
body.theme-nordic .preset-pill.active {
  background: rgba(136, 192, 208, 0.15);
  border-color: #88c0d0;
  box-shadow: none;
}
body.theme-nordic .preset-pill.active .pill-num {
  color: #88c0d0;
}
body.theme-nordic .btn-play-hero {
  background: linear-gradient(135deg, #88c0d0, #81a1c1);
  box-shadow: none;
  color: #2e3440;
}
body.theme-nordic .btn-secondary-action {
  background: #242933;
  border-color: #3b4252;
}
body.theme-nordic .volume-slider-compact {
  background: #242933;
  border-color: #3b4252;
}

/* --- LIVE CALL TOAST OVERLAY --- */
.fritz-toast-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 20, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInToast 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 24px;
}

.fritz-toast-overlay[hidden] {
  display: none !important;
}

@keyframes fadeInToast {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fritz-toast-card {
  background: rgba(14, 20, 36, 0.9);
  border: 2px solid var(--primary, #ff007f);
  border-radius: var(--radius-lg, 24px);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px var(--primary-glow);
  transform: scale(1);
  animation: scaleToast 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleToast {
  from { transform: scale(0.85); }
  to { transform: scale(1); }
}

.fritz-toast-pulse {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: #030711;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  animation: ringPulse 1.2s infinite;
  flex-shrink: 0;
}

@keyframes ringPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 127, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(255, 0, 127, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 127, 0);
  }
}

.fritz-toast-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.fritz-toast-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.1em;
}

.fritz-toast-number {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 2px 0;
}

.fritz-toast-caller {
  font-size: 14px;
  color: var(--text-muted);
}

/* ==========================================================================
   ANWESENHEITSERKENNUNG WIDGET & AVATARS STYLING
   ========================================================================== */
.presence-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

.presence-avatars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 16px;
  width: 100%;
  justify-items: center;
  align-items: center;
}

.no-presence-devices {
  color: var(--text-muted);
  font-size: 11px;
  opacity: 0.7;
  grid-column: 1 / -1;
  text-align: center;
}

.presence-avatar-ring {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.presence-avatar-ring.active {
  background: rgba(85, 245, 177, 0.05);
  border: 2.5px solid var(--green, #55f5b1);
  animation: presenceGreenPulse 2s infinite;
}

.presence-avatar-img {
  transition: all 0.5s ease;
  filter: grayscale(100%);
  opacity: 0.35;
}

.presence-avatar-card.active .presence-avatar-img {
  filter: grayscale(0%);
  opacity: 1;
}

.presence-avatar-card.inactive .presence-avatar-img {
  filter: grayscale(100%);
  opacity: 0.35;
}

.presence-status-badge {
  transition: all 0.5s ease;
}

@keyframes presenceGreenPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(85, 245, 177, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(85, 245, 177, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(85, 245, 177, 0);
  }
}

/* Selectable Avatars in Settings Gallery */
.selectable-avatar-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.05);
  object-fit: cover;
}
.selectable-avatar-item:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.25);
}
.selectable-avatar-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow, rgba(0, 229, 255, 0.45));
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}


/* ==========================================================================
   HEADER WASTE REMINDER SYSTEM STYLING
   ========================================================================== */
.header-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  max-height: 48px;
}

.waste-alert-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  animation: wasteAlertPulse 2s infinite ease-in-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

/* Bin categories colors */
.waste-alert-residual {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}
.waste-alert-bio {
  background: rgba(85, 245, 177, 0.1);
  border-color: rgba(85, 245, 177, 0.3);
  color: #55f5b1;
  text-shadow: 0 0 8px rgba(85, 245, 177, 0.3);
}
.waste-alert-paper {
  background: rgba(102, 217, 255, 0.1);
  border-color: rgba(102, 217, 255, 0.3);
  color: #66d9ff;
  text-shadow: 0 0 8px rgba(102, 217, 255, 0.3);
}
.waste-alert-plastic {
  background: rgba(255, 214, 102, 0.1);
  border-color: rgba(255, 214, 102, 0.3);
  color: #ffd666;
  text-shadow: 0 0 8px rgba(255, 214, 102, 0.3);
}
.waste-alert-hazardous {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
  color: #fb923c;
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.3);
}

/* Animations */
@keyframes wasteAlertPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.05);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
}

.alert-icon-pulse {
  animation: alertIconShake 1.5s infinite ease-in-out;
}

@keyframes alertIconShake {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(-8deg); }
  40%, 80% { transform: rotate(8deg); }
}

/* Cyberpunk specific styling override */
body.theme-cyberpunk .waste-alert-pill {
  border-radius: 2px;
  font-family: monospace;
  text-transform: uppercase;
  animation: cyberpunkAlertPulse 1.5s infinite steps(2);
  clip-path: polygon(0 0, 95% 0, 100% 30%, 100% 100%, 8% 100%, 0 70%);
}
body.theme-cyberpunk .waste-alert-residual {
  background: rgba(255, 110, 0, 0.08);
  border-color: #ff6e00;
  color: #ff6e00;
  text-shadow: 0 0 5px rgba(255, 110, 0, 0.5);
}
body.theme-cyberpunk .waste-alert-bio {
  background: rgba(0, 255, 163, 0.08);
  border-color: #00ffa3;
  color: #00ffa3;
  text-shadow: 0 0 5px rgba(0, 255, 163, 0.5);
}
body.theme-cyberpunk .waste-alert-paper {
  background: rgba(0, 183, 255, 0.08);
  border-color: #00b7ff;
  color: #00b7ff;
  text-shadow: 0 0 5px rgba(0, 183, 255, 0.5);
}
body.theme-cyberpunk .waste-alert-plastic {
  background: rgba(255, 234, 0, 0.08);
  border-color: #ffea00;
  color: #ffea00;
  text-shadow: 0 0 5px rgba(255, 234, 0, 0.5);
}
body.theme-cyberpunk .waste-alert-hazardous {
  background: rgba(255, 140, 0, 0.08);
  border-color: #ff8c00;
  color: #ff8c00;
  text-shadow: 0 0 5px rgba(255, 140, 0, 0.5);
}

@keyframes cyberpunkAlertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; border-style: dashed; }
}

/* Retrowave specific styling override */
body.theme-retrowave .waste-alert-pill {
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  border-color: #ff007f;
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.5), 0 0 20px rgba(255, 0, 127, 0.3);
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.3);
}

/* Cozy Nordic Dark specific styling override */
body.theme-nordic .waste-alert-pill {
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  animation: nordicAlertPulse 3s infinite ease-in-out;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
body.theme-nordic .waste-alert-residual {
  background: rgba(60, 68, 77, 0.4);
  color: #e5f1ff;
  border-color: rgba(229, 241, 255, 0.15);
}
body.theme-nordic .waste-alert-bio {
  background: rgba(143, 169, 143, 0.25);
  color: #a3c4a3;
  border-color: rgba(143, 169, 143, 0.35);
}
body.theme-nordic .waste-alert-paper {
  background: rgba(122, 147, 165, 0.25);
  color: #92b0c4;
  border-color: rgba(122, 147, 165, 0.35);
}
body.theme-nordic .waste-alert-plastic {
  background: rgba(197, 172, 129, 0.25);
  color: #dbcaac;
  border-color: rgba(197, 172, 129, 0.35);
}
body.theme-nordic .waste-alert-hazardous {
  background: rgba(200, 140, 80, 0.25);
  color: #d4a574;
  border-color: rgba(200, 140, 80, 0.35);
}



/* =================================================== */
/* === AM2301 & PREMIUM CAMERA MONITOR WIDGET ===      */
/* =================================================== */

.widget[data-type="camera"] {
  grid-column: span 3; /* Gleiche Größe wie die anderen Widgets */
  grid-row: span 1;
}

/* Kiosk Tablet Landscape Optimierung */
@media (max-height: 760px) {
  .widget[data-type="camera"] {
    grid-column: span 3;
    grid-row: span 1;
  }
}

.camera-layout {
  padding: 8px !important;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.camera-grid {
  display: grid;
  gap: 8px;
  width: 100%;
  height: 100%;
  align-items: center;
}

.camera-grid.cols-1 { grid-template-columns: 1fr; }
.camera-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.camera-grid.cols-4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }

.no-cameras {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(218, 232, 255, 0.4);
  font-size: 13px;
  padding: 20px;
  font-style: italic;
}

.camera-card:hover .camera-feed-img {
  filter: brightness(1.15) contrast(1.05);
}

/* Blinking LIVE dot animation */
@keyframes ledBlink {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 10px #ff3b30; }
}

.led-dot.blinking {
  animation: ledBlink 1.6s infinite ease-in-out;
  background-color: #ff3b30;
}

/* =================================================== */
/* === FULLSCREEN CAMERA OVERLAY ===                   */
/* =================================================== */

.camera-fullscreen-overlay[hidden] {
  display: none !important;
}

.camera-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(3, 8, 20, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInFullscreen 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInFullscreen {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(20px); }
}

.fullscreen-content {
  position: relative;
  width: min(90vw, 1100px);
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.08);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleInFullscreen 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleInFullscreen {
  from { transform: scale(0.9) translateY(20px); }
  to { transform: scale(1) translateY(0); }
}

.fullscreen-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fullscreen-title {
  position: absolute;
  bottom: 15px;
  left: 20px;
  padding: 8px 16px;
  background: rgba(15, 18, 37, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.close-fullscreen-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10000;
}

.close-fullscreen-btn:hover {
  background: rgba(255,255,255,0.18);
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 0 15px rgba(255,255,255,0.25);
}

/* =================================================== */
/* === THEME OVERRIDES FOR CAMERA MONITORS ===         */
/* =================================================== */

/* 1. CYBERPUNK HUD THEME OVERRIDES */
body.theme-cyberpunk .camera-card {
  border-radius: 0px !important;
  border: 1px solid var(--primary) !important;
}
body.theme-cyberpunk .camera-live-dot {
  border-radius: 0px !important;
  border: 1px solid var(--primary) !important;
  font-family: monospace;
}
body.theme-cyberpunk .camera-live-dot .blinking {
  background-color: var(--primary) !important;
  animation: ledBlink 1s step-end infinite !important; /* Cyberpunk eckiger Step-Blink */
}
body.theme-cyberpunk .camera-name-badge {
  border-radius: 0px !important;
  border: 1px solid var(--primary) !important;
  background: rgba(3,8,20,0.92) !important;
  font-family: monospace;
  text-transform: uppercase;
}
body.theme-cyberpunk .close-fullscreen-btn {
  border-radius: 0px !important;
  border: 1px solid var(--primary) !important;
  background: rgba(3,8,20,0.9) !important;
  color: var(--primary) !important;
}
body.theme-cyberpunk .fullscreen-content {
  border-radius: 0px !important;
  border: 2px solid var(--primary) !important;
}
body.theme-cyberpunk .fullscreen-title {
  border-radius: 0px !important;
  border: 1px solid var(--primary) !important;
  background: rgba(3,8,20,0.95) !important;
  font-family: monospace;
  color: var(--primary) !important;
}

/* 2. COZY NORDIC DARK THEME OVERRIDES */
body.theme-nordic .camera-card {
  border-radius: 14px !important;
  border: 1px solid rgba(229, 241, 255, 0.08) !important;
}
body.theme-nordic .camera-name-badge {
  border-radius: 8px !important;
  background: rgba(43, 51, 62, 0.85) !important;
  border-color: rgba(255,255,255,0.06) !important;
}
body.theme-nordic .close-fullscreen-btn {
  border-radius: 12px !important;
  background: rgba(43, 51, 62, 0.8) !important;
  border-color: rgba(255,255,255,0.08) !important;
}
body.theme-nordic .fullscreen-content {
  border-radius: 20px !important;
  border-color: rgba(229, 241, 255, 0.1) !important;
}

/* 3. RETROWAVE SYNTH THEME OVERRIDES */
body.theme-retrowave .camera-card {
  border: 1px solid #ff007f !important;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.3) !important;
}
body.theme-retrowave .camera-card:hover {
  box-shadow: 0 0 18px rgba(255, 0, 127, 0.6) !important;
  transform: translateY(-2px);
}
body.theme-retrowave .camera-live-dot {
  border: 1px solid #00f0ff !important;
  color: #00f0ff !important;
}
body.theme-retrowave .camera-live-dot .blinking {
  background-color: #00f0ff !important;
  box-shadow: 0 0 10px #00f0ff !important;
}
body.theme-retrowave .camera-name-badge {
  border: 1px solid #ff007f !important;
  background: rgba(26,0,32,0.85) !important;
  color: #00f0ff !important;
  text-shadow: 0 0 5px #00f0ff;
}
body.theme-retrowave .fullscreen-content {
  border: 2px solid #ff007f !important;
  box-shadow: 0 0 35px rgba(255, 0, 127, 0.6) !important;
}
body.theme-retrowave .close-fullscreen-btn {
  border: 1px solid #00f0ff !important;
  background: rgba(26,0,32,0.85) !important;
  color: #ff007f !important;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4) !important;
}
body.theme-retrowave .close-fullscreen-btn:hover {
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.8) !important;
}
body.theme-retrowave .fullscreen-title {
  border: 1px solid #ff007f !important;
  background: rgba(26,0,32,0.9) !important;
  color: #00f0ff !important;
  text-shadow: 0 0 6px #00f0ff;
}

/* Collapse settings panel to 1 column on smaller mobile viewports */
@media (max-width: 768px) {
  .settings-panel {
    width: 95vw !important;
    right: -95vw !important;
  }
  .settings-content {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
}

/* --- FRITZ!BOX RADIO POPUP SYSTEM (v3.8.0) --- */
.fritz-round-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.fritz-round-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.fritz-round-btn:active {
  transform: scale(0.95);
}

/* responsive size override for round buttons */
.play-round-btn, .fritz-round-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  font-size: 16px !important;
}

/* Glassmorphism Popup Overlay */
.radio-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.65);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.radio-fullscreen-overlay[hidden] {
  display: none !important;
}

.radio-fullscreen-overlay .fullscreen-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: scaleUp 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
  aspect-ratio: auto !important;
  overflow: visible !important;
}

@keyframes scaleUp {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Station Buttons Grid */
.overlay-stations-grid {
  width: 100%;
}

.station-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--text-main) !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  min-width: 0;
  min-height: 70px;
  font-family: inherit;
  font-size: 0.95rem;
}

.station-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  transform: translateY(-2px);
}

.station-btn.active {
  background: rgba(85, 245, 177, 0.08);
  border-color: var(--primary);
  color: var(--text-main);
  box-shadow: 0 0 20px rgba(85, 245, 177, 0.15);
}

.station-btn i {
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.station-btn.active i {
  color: var(--accent-blue);
  filter: drop-shadow(0 0 5px var(--accent-blue));
}

.station-name {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-weight: 500;
  font-size: 0.95rem !important;
  line-height: 1.3 !important;
  min-height: 1.2em !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  max-width: 100%;
  color: var(--text-main) !important;
}

.station-status-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.station-btn.active .station-status-indicator {
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
  animation: pulsePulse 1.2s infinite alternate ease-in-out;
}

.station-btn.station-online .station-status-indicator {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.station-btn.station-offline {
  opacity: 0.62;
  border-color: rgba(239, 68, 68, 0.28) !important;
}

.station-btn.station-offline .station-status-indicator {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.station-health-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.station-health-badge.checking {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.14);
}

.station-health-badge.online {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.14);
}

.station-health-badge.offline {
  color: #f87171;
  background: rgba(239, 68, 68, 0.16);
}

.radio-status-error {
  color: #ef4444 !important;
}

@keyframes pulsePulse {
  0% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* --- THEME-SPECIFIC OVERRIDES FOR FRITZ!BOX RADIO --- */

/* 1. Theme Cyberpunk HUD Overrides */
body.theme-cyberpunk .fritz-round-btn {
  border-radius: 0 !important;
  background: rgba(255, 85, 0, 0.05) !important;
  border: 1px solid #ff5500 !important;
  color: #ff5500 !important;
  box-shadow: none !important;
  font-family: 'Courier New', monospace;
}
body.theme-cyberpunk .fritz-round-btn:hover {
  background: rgba(255, 85, 0, 0.15) !important;
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.3) !important;
}
body.theme-cyberpunk .radio-fullscreen-overlay .fullscreen-content {
  border-radius: 0 !important;
  background: rgba(10, 5, 0, 0.95) !important;
  border: 2px solid #ff5500 !important;
}
body.theme-cyberpunk .station-btn {
  border-radius: 0 !important;
  border-color: rgba(255, 85, 0, 0.3) !important;
  color: rgba(255, 85, 0, 0.6) !important;
  font-family: 'Courier New', monospace;
}
body.theme-cyberpunk .station-btn:hover {
  background: rgba(255, 85, 0, 0.08) !important;
  border-color: #ff5500 !important;
  color: #ff5500 !important;
}
body.theme-cyberpunk .station-btn.active {
  background: rgba(255, 85, 0, 0.12) !important;
  border-color: #ff5500 !important;
  color: #ff5500 !important;
  box-shadow: 0 0 15px rgba(255, 85, 0, 0.25) !important;
}
body.theme-cyberpunk .station-btn.active i {
  color: #ff5500 !important;
}
body.theme-cyberpunk .station-btn.active .station-status-indicator {
  background: #ff5500 !important;
  box-shadow: 0 0 8px #ff5500 !important;
}

/* 2. Theme Cozy Nordic Dark Overrides */
body.theme-nordic .fritz-round-btn {
  background: #2e3440 !important;
  border-color: #3b4252 !important;
  color: #d8dee9 !important;
  border-radius: 14px !important;
}
body.theme-nordic .fritz-round-btn:hover {
  background: #3b4252 !important;
  border-color: #4c566a !important;
  color: #eceff4 !important;
}
body.theme-nordic .radio-fullscreen-overlay .fullscreen-content {
  border-radius: var(--radius-md) !important;
  background: #2e3440 !important;
  border-color: #3b4252 !important;
}
body.theme-nordic .station-btn {
  border-radius: 12px !important;
  border-color: #3b4252 !important;
  background: #242933 !important;
  color: #d8dee9 !important;
}
body.theme-nordic .station-btn:hover {
  background: #2e3440 !important;
  border-color: #4c566a !important;
}
body.theme-nordic .station-btn.active {
  background: #3b4252 !important;
  border-color: #88c0d0 !important;
  color: #eceff4 !important;
  box-shadow: none !important;
}
body.theme-nordic .station-btn.active i {
  color: #88c0d0 !important;
}
body.theme-nordic .station-btn.active .station-status-indicator {
  background: #88c0d0 !important;
}

/* 3. Theme Retrowave Synth Overrides */
body.theme-retrowave .fritz-round-btn {
  background: rgba(255, 0, 127, 0.05) !important;
  border: 1px solid #ff007f !important;
  color: #ff007f !important;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.2) !important;
}
body.theme-retrowave .fritz-round-btn:hover {
  background: rgba(255, 0, 127, 0.15) !important;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.4) !important;
}
body.theme-retrowave .radio-fullscreen-overlay .fullscreen-content {
  background: rgba(15, 0, 30, 0.95) !important;
  border: 2px solid #ff007f !important;
  box-shadow: 0 0 35px rgba(255, 0, 127, 0.3) !important;
}
body.theme-retrowave .station-btn {
  border-color: rgba(255, 0, 127, 0.2) !important;
  color: #ff007f !important;
  background: rgba(255, 0, 127, 0.02) !important;
}
body.theme-retrowave .station-btn:hover {
  background: rgba(255, 0, 127, 0.08) !important;
  border-color: #ff007f !important;
  color: #ff007f !important;
}
body.theme-retrowave .station-btn.active {
  background: rgba(0, 240, 255, 0.08) !important;
  border-color: #00f0ff !important;
  color: #00f0ff !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2) !important;
}
body.theme-retrowave .station-btn.active i {
  color: #00f0ff !important;
}
body.theme-retrowave .station-btn.active .station-status-indicator {
  background: #00f0ff !important;
  box-shadow: 0 0 8px #00f0ff !important;
}

/* --- FRITZ!BOX RADIO MAIN SINGLE BUTTON SYSTEM (v3.8.0) --- */
.fritz-radio-main-btn {
  transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.fritz-radio-main-btn:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

.fritz-radio-main-btn:hover .radio-tower-icon-wrapper {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 15px rgba(85, 245, 177, 0.25);
}

.fritz-radio-main-btn:active {
  transform: translateY(1px);
}

/* Pulsing / active state when playing */
.fritz-radio-main-btn.playing .radio-tower-icon-wrapper {
  border-color: var(--primary) !important;
  box-shadow: 0 0 20px rgba(85, 245, 177, 0.4);
  animation: towerPulse 2s infinite ease-in-out;
}

.fritz-radio-main-btn.playing #widgetRadioTowerIcon {
  animation: towerRotate 4s infinite linear;
}

@keyframes towerPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes towerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Stop button visual overrides in grid */
.station-btn.stop-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: #ef4444 !important;
  transform: translateY(-2px);
}

/* Theme-specific Overrides for Main Button */
body.theme-cyberpunk .fritz-radio-main-btn {
  border-radius: 0 !important;
  background: rgba(255, 85, 0, 0.02) !important;
  border: 1px solid rgba(255, 85, 0, 0.2) !important;
  font-family: 'Courier New', monospace;
}
body.theme-cyberpunk .fritz-radio-main-btn:hover {
  background: rgba(255, 85, 0, 0.06) !important;
  border-color: #ff5500 !important;
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.2) !important;
}
body.theme-cyberpunk .fritz-radio-main-btn .radio-tower-icon-wrapper {
  border-radius: 0 !important;
  background: transparent !important;
  border: 1px solid rgba(255, 85, 0, 0.3) !important;
}
body.theme-cyberpunk .fritz-radio-main-btn:hover .radio-tower-icon-wrapper {
  border-color: #ff5500 !important;
  box-shadow: 0 0 10px rgba(255, 85, 0, 0.3) !important;
}
body.theme-cyberpunk .fritz-radio-main-btn.playing .radio-tower-icon-wrapper {
  border-color: #ff5500 !important;
  box-shadow: 0 0 15px rgba(255, 85, 0, 0.4) !important;
  animation: towerPulseCyber 1.5s infinite steps(4);
}
@keyframes towerPulseCyber {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

body.theme-nordic .fritz-radio-main-btn {
  border-radius: var(--radius-md) !important;
  background: #242933 !important;
  border: 1px solid #3b4252 !important;
}
body.theme-nordic .fritz-radio-main-btn:hover {
  background: #2e3440 !important;
  border-color: #4c566a !important;
  box-shadow: none !important;
}
body.theme-nordic .fritz-radio-main-btn .radio-tower-icon-wrapper {
  background: #2e3440 !important;
  border-color: #3b4252 !important;
}
body.theme-nordic .fritz-radio-main-btn:hover .radio-tower-icon-wrapper {
  border-color: #88c0d0 !important;
}
body.theme-nordic .fritz-radio-main-btn.playing .radio-tower-icon-wrapper {
  border-color: #88c0d0 !important;
}

body.theme-retrowave .fritz-radio-main-btn {
  background: rgba(255, 0, 127, 0.02) !important;
  border: 1px solid rgba(255, 0, 127, 0.2) !important;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.1) !important;
}
body.theme-retrowave .fritz-radio-main-btn:hover {
  background: rgba(255, 0, 127, 0.06) !important;
  border-color: #ff007f !important;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.3) !important;
}
body.theme-retrowave .fritz-radio-main-btn .radio-tower-icon-wrapper {
  background: rgba(255, 0, 127, 0.05) !important;
  border: 1px solid rgba(255, 0, 127, 0.3) !important;
}
body.theme-retrowave .fritz-radio-main-btn:hover .radio-tower-icon-wrapper {
  border-color: #00f0ff !important;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}
body.theme-retrowave .fritz-radio-main-btn.playing .radio-tower-icon-wrapper {
  border-color: #00f0ff !important;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

/* Dropdown Option contrast fixes */
.radio-select option,
select option {
  background-color: #0b101f;
  color: #f8fbff;
}

body.theme-cyberpunk select option,
body.theme-cyberpunk .radio-select option {
  background-color: #100d14;
  color: #ffd1a4;
}

body.theme-nordic select option,
body.theme-nordic .radio-select option {
  background-color: #242933;
  color: #eceff4;
}

body.theme-retrowave select option,
body.theme-retrowave .radio-select option {
  background-color: #140418;
  color: #ffedf6;
}

body.theme-terminal select option,
body.theme-terminal .radio-select option {
  background-color: #051208;
  color: #33ff33;
}

body.theme-stealth select option,
body.theme-stealth .radio-select option {
  background-color: #000000;
  color: #f3f4f6;
}

body.theme-jarvis select option,
body.theme-jarvis .radio-select option {
  background-color: #060f1e;
  color: #e0f8ff;
}



/* ==== CALENDAR WIDGET & MANUAL ADD FORM ==== */

.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.calendar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--primary); /* Neon green/teal aurora style border-left */
  transition: all 0.2s ease;
}

.calendar-item:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.12);
}

.calendar-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.calendar-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-item-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  background: var(--primary-glow);
  padding: 2px 6px;
  border-radius: 4px;
}

.calendar-item-date {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.calendar-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-item-actions {
  margin-left: 10px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.calendar-item-actions:hover {
  opacity: 1;
}

.calendar-item-del-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 12px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.calendar-item-del-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

.calendar-no-events {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  text-align: center;
}

/* Toast styling for custom calendar reminders */
.calendar-reminder-toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 15px 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--primary-glow);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
}

.calendar-reminder-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.calendar-reminder-icon {
  font-size: 20px;
  color: var(--primary);
  animation: alarm-shake 0.5s infinite alternate;
}

@keyframes alarm-shake {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(10deg); }
}

.calendar-reminder-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-reminder-info h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
}

.calendar-reminder-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.btn-add-event {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.btn-add-event:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.calendar-layout {
  padding: 5px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  overflow-y: auto;
  height: calc(100% - 35px); /* Matches header offset */
}








/* --- GEFAHRENBEREICH / DANGER ZONE --- */
.danger-zone-section {
  border: 1px solid #ff4d4d !important;
  background: rgba(255, 77, 77, 0.03) !important;
}

.danger-zone-btn {
  background: rgba(255, 77, 77, 0.15);
  color: #ff4d4d;
  border: 1px solid rgba(255, 77, 77, 0.3);
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.danger-zone-btn:hover {
  background: rgba(255, 77, 77, 0.25);
  border-color: #ff4d4d;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.2);
}

.danger-zone-btn:active {
  transform: scale(0.98);
}

/* Modal Checkbox */
.setting-checkbox-label {
  user-select: none;
}

.setting-checkbox-label input[type="checkbox"] {
  accent-color: #ff4d4d;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Confirm Button states */
.danger-confirm-btn:not([disabled]) {
  background: #ff4d4d !important;
  color: #fff !important;
  border-color: #ff4d4d !important;
  cursor: pointer !important;
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.4);
}

.danger-confirm-btn:not([disabled]):hover {
  background: #ff3333 !important;
  box-shadow: 0 0 20px rgba(255, 77, 77, 0.6);
}

.danger-confirm-btn:not([disabled]):active {
  transform: scale(0.98);
}

/* Keyframes and wave animations for calendar reminder modal */
@keyframes pulseWave {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ==========================================
   TIMER WIDGET STYLES
   ========================================== */
.widget[data-type="timer"] input[type="number"]::-webkit-inner-spin-button,
.widget[data-type="timer"] input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.widget[data-type="timer"] input[type="number"] {
  -moz-appearance: textfield;
}

.timer-preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 5px 6px;
  font-size: 10.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm);
}

.timer-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  transform: translateY(-1px);
}

.timer-preset-btn i {
  color: var(--primary);
  font-size: 12px;
}

/* Urgency pulse animation when timer is low */
@keyframes timer-pulse-low {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 107, 74, 0.2)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 0 8px rgba(255, 107, 74, 0.6)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 107, 74, 0.2)); }
}

.timer-active-container.low-time {
  animation: timer-pulse-low 1s infinite ease-in-out;
}

.timer-active-container.low-time #timerCountdownText {
  color: #ff6b4a !important;
  text-shadow: 0 0 10px rgba(255, 107, 74, 0.5);
}

/* Ensure Outfit/Michroma fonts apply correctly to timer header and numbers */
body.theme-orbital .widget[data-type="timer"] .widget-header h3 {
  font-family: 'Michroma', sans-serif;
}
body.theme-orbital #timerCountdownText,
body.theme-orbital .widget[data-type="timer"] input[type="number"] {
  font-family: 'JetBrains Mono', monospace;
}

/* --- Drum Picker (Scroll-Snap Trommelwähler) --- */
.timer-drum-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  height: 96px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

/* 3D gradient fading overlay to cover top and bottom lines */
.timer-drum-picker::before,
.timer-drum-picker::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  pointer-events: none;
  z-index: 10;
}
.timer-drum-picker::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0) 100%);
}
.timer-drum-picker::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0) 100%);
}

/* Theme overrides for gradient masks */
body.theme-nordic .timer-drum-picker::before {
  background: linear-gradient(to bottom, rgba(46, 52, 64, 0.95) 0%, rgba(46, 52, 64, 0) 100%);
}
body.theme-nordic .timer-drum-picker::after {
  background: linear-gradient(to top, rgba(46, 52, 64, 0.95) 0%, rgba(46, 52, 64, 0) 100%);
}
body.theme-stealth .timer-drum-picker::before {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
}
body.theme-stealth .timer-drum-picker::after {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Center selection indicator bar */
.timer-drum-picker::after {
  /* Note: Double after is not valid, we merge indicator into selection lines */
}

/* Let's define indicator lines */
.timer-drum-picker-indicator {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  pointer-events: none;
  z-index: 1;
}

.timer-drum-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 44px;
  height: 84px;
}

.timer-drum-label {
  font-size: 8px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  z-index: 5;
}

.timer-drum-viewport {
  width: 100%;
  height: 68px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  perspective: 1000px;
}

.timer-drum-viewport::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.timer-drum-item {
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-size: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text-muted);
  scroll-snap-align: center;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out, color 0.15s ease-out;
  transform-style: preserve-3d;
  opacity: 0.25;
}

/* Dynamic active state class */
.timer-drum-item.active {
  color: var(--primary);
  opacity: 1;
  transform: scale(1.15) translateZ(10px);
  text-shadow: 0 0 10px var(--primary-glow);
}

.timer-drum-colon {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 12px;
  opacity: 0.8;
  animation: pulse-colon 1.5s infinite;
}

@keyframes pulse-colon {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Empty spacer element for alignment at top/bottom */
.timer-drum-spacer {
  height: 30px;
}

/* --- Premium Glassmorphic Retro LCD Weather Station Widget --- */
.sensor-layout:has(.lcd-retro-container) {
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  flex-wrap: nowrap;
  gap: 0;
  align-items: stretch;
  padding-top: 0;
  flex: 1;
}

.sensor-layout:has(.modern-sensors-container) {
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  flex-wrap: nowrap;
  gap: 0;
  align-items: stretch;
  padding-top: 0;
  flex: 1;
}

.lcd-retro-container {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 100%;
  flex: 1;
  padding: 6px 0;
  box-sizing: border-box;
}

.lcd-retro-row {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
  padding: 8px 5px;
  box-sizing: border-box;
}

.lcd-retro-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 65px;
}

.lcd-retro-tag {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.lcd-indoor .lcd-retro-tag {
  color: #ff9f1c; /* amber */
}

.lcd-outdoor .lcd-retro-tag {
  color: #e2e8f0; /* white/light gray */
  opacity: 0.8;
}

.lcd-retro-icon {
  font-size: 26px;
}

.lcd-indoor .lcd-retro-icon {
  color: #ff9f1c;
  text-shadow: 0 0 10px rgba(255, 159, 28, 0.3);
}

.lcd-outdoor .lcd-retro-icon {
  color: #e2e8f0;
  text-shadow: 0 0 10px rgba(226, 232, 240, 0.2);
}

.lcd-retro-center {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex: 1;
}

.lcd-retro-right {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 12px;
  width: 95px;
  padding-right: 10px;
}

.lcd-retro-temp-box {
  display: flex;
  align-items: baseline;
  position: relative;
}

.lcd-trend-arrow {
  font-size: 13px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
}

.lcd-trend-up {
  color: #ef4444;
  filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.6));
}

.lcd-trend-down {
  color: #38bdf8;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.6));
}

.lcd-trend-stable {
  color: var(--text-muted);
  opacity: 0.35;
}

.lcd-retro-hum-box {
  display: flex;
  align-items: baseline;
  position: relative;
}

.lcd-comfort-badge {
  font-size: 13px;
  margin-left: 5px;
  display: inline-flex;
  align-items: center;
}

.lcd-comfort-ok {
  color: #4ade80;
  filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.6));
}

.lcd-comfort-wet {
  color: #38bdf8;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.6));
}

.lcd-comfort-dry {
  color: #fbbf24;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.6));
}

.lcd-retro-value {
  font-family: 'Share Tech Mono', 'JetBrains Mono', monospace;
  font-size: 38px;
  font-weight: bold;
  line-height: 1;
  letter-spacing: -0.01em;
}

.lcd-indoor .lcd-retro-value {
  color: #ffa500;
  text-shadow: 0 0 12px rgba(255, 165, 0, 0.45);
}

.lcd-outdoor .lcd-retro-value {
  color: #e2e8f0;
  text-shadow: 0 0 12px rgba(226, 232, 240, 0.25);
}

.lcd-retro-unit {
  font-family: 'Share Tech Mono', 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin-left: 2px;
}

.lcd-indoor .lcd-retro-unit {
  color: #ffa500;
}

.lcd-outdoor .lcd-retro-unit {
  color: #e2e8f0;
}

.lcd-retro-hum {
  font-family: 'Share Tech Mono', 'JetBrains Mono', monospace;
  font-size: 38px;
  font-weight: bold;
  line-height: 1;
  letter-spacing: -0.01em;
}

.lcd-indoor .lcd-retro-hum {
  color: #ffa500;
  text-shadow: 0 0 12px rgba(255, 165, 0, 0.45);
}

.lcd-outdoor .lcd-retro-hum {
  color: #e2e8f0;
  text-shadow: 0 0 12px rgba(226, 232, 240, 0.25);
}

.lcd-retro-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  width: 100%;
  margin: 2px 0;
}

.lcd-retro-battery {
  position: static;
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-weight: 600;
  margin-top: 6px;
  width: 100%;
  white-space: nowrap;
}

/* Lower bar for timestamps */
.lcd-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  color: rgba(218, 232, 255, 0.25);
  font-weight: 500;
}

.lcd-meta {
  letter-spacing: 0.01em;
}

.lcd-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 3px #10b981;
  display: inline-block;
}

.lcd-status-dot.offline {
  background-color: #ef4444;
  box-shadow: 0 0 3px #ef4444;
}

/* --- Timer Tabs & Indicators --- */
.timer-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.timer-tab {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.timer-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.timer-tab.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.timer-tab-indicator {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary-glow);
  animation: tab-pulse-active 1.5s infinite ease-in-out;
}

@keyframes tab-pulse-active {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* --- MODERN SENSOR ROW STYLE --- */
.modern-sensors-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  flex: 1;
  justify-content: stretch;
}

.modern-sensor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease;
  flex: 1;
}

.modern-sensor-row:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.sensor-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sensor-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  font-size: 17px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sensor-indoor .sensor-icon-circle {
  color: #ff9f43; /* Soft warm orange */
  background: rgba(255, 159, 67, 0.1);
}

.sensor-outdoor .sensor-icon-circle {
  color: #0abde3; /* Soft cool cyan */
  background: rgba(10, 189, 227, 0.1);
}

.sensor-name-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sensor-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.sensor-location-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.sensor-values-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.sensor-temp-display {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.sensor-temp-val {
  font-size: 38px;
  font-weight: 300;
  letter-spacing: -0.5px;
}

.sensor-indoor .sensor-temp-val {
  color: #ff9f43;
  text-shadow: 0 0 10px rgba(255, 159, 67, 0.2);
}

.sensor-outdoor .sensor-temp-val {
  color: #0abde3;
  text-shadow: 0 0 10px rgba(10, 189, 227, 0.2);
}

.sensor-temp-unit {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

.sensor-trend-arrow {
  margin-left: 4px;
  font-size: 14px;
}

.sensor-sub-details {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.sensor-hum-val {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.sensor-hum-val i {
  font-size: 10px;
  color: rgba(0, 150, 255, 0.8);
}

.sensor-comfort-badge {
  font-size: 11px;
}

.sensor-battery-val {
  font-size: 10px;
  font-weight: 600;
}

.modern-sensor-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  margin-top: auto;
}

.modern-meta-text {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Trend colors */
.lcd-trend-up {
  color: #ff4d4d !important;
}
.lcd-trend-down {
  color: #00e676 !important;
}
.lcd-trend-stable {
  color: var(--text-muted) !important;
  opacity: 0.5;
}

/* Comfort colors */
.lcd-comfort-ok {
  color: #00e676 !important;
}
.lcd-comfort-wet {
  color: #29b6f6 !important;
}
.lcd-comfort-dry {
  color: #ffa726 !important;
}

/* Tablet Responsive Optimization for Combined Weather & Sensors */
@media (max-width: 1280px) {
  .combined-weather-sensors-layout {
    gap: 12px;
  }
  .weather-side {
    padding-right: 6px;
  }
  .modern-sensor-row {
    padding: 10px 14px;
  }
  .sensor-icon-circle {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .sensor-info-left {
    gap: 10px;
  }
  .sensor-location-name {
    font-size: 13px;
  }
  .sensor-temp-val {
    font-size: 28px;
  }
  .sensor-temp-unit {
    font-size: 13px;
  }
  .sensor-sub-details {
    font-size: 10.5px;
    gap: 8px;
  }
}

/* === ONVIF PTZ CAMERA OVERLAY CONTROLS === */
.ptz-controls-overlay {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(15, 18, 37, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  width: 104px;
  height: 104px;
  justify-content: center;
  z-index: 100;
  box-sizing: border-box;
  user-select: none;
}

.ptz-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  padding: 0;
  margin: 0;
}

.ptz-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--primary);
  transform: scale(1.12);
  border-color: var(--primary);
}

.ptz-btn:active {
  transform: scale(0.92);
  background: var(--primary);
  color: #ffffff;
}

.ptz-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
  box-sizing: border-box;
}

body.theme-cyberpunk .ptz-controls-overlay {
  background: rgba(5, 5, 10, 0.85);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

body.theme-nordic .ptz-controls-overlay {
  background: rgba(46, 52, 64, 0.8);
  border-color: rgba(216, 222, 233, 0.2);
}

body.theme-jarvis .ptz-controls-overlay {
  background: rgba(4, 10, 22, 0.85);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

/* ==========================================================================
   POST-IT / NOTIZZETTEL WIDGET & ZOOM-MODAL
   ========================================================================== */

/* 1. Dashboard Widget */
.widget[data-type="note"] {
  cursor: pointer;
  user-select: none;
}

/* ==========================================================================
   NOTIZZETTEL / POST-IT COLOR THEMES & 2D STACK
   ========================================================================== */
:root {
  --note-paper-top: #fef9c3;
  --note-paper-mid: #fef08a;
  --note-paper-bottom: #fde047;
  --note-paper-border: rgba(202, 138, 4, 0.55);
  --note-paper-border-mid: rgba(202, 138, 4, 0.45);
  --note-paper-border-bottom: rgba(202, 138, 4, 0.5);
  --note-paper-glue: rgba(253, 224, 71, 0.65);
  --note-paper-glue-border: rgba(202, 138, 4, 0.4);
  --note-paper-text: #713f12;
  --note-paper-text-muted: #854d0e;
  --note-paper-card-shadow: rgba(234, 179, 8, 0.4);
  --note-paper-tool-bg: rgba(254, 240, 138, 0.65);
}

[data-note-theme="blue"] {
  --note-paper-top: #f0f9ff;
  --note-paper-mid: #e0f2fe;
  --note-paper-bottom: #bae6fd;
  --note-paper-border: rgba(2, 132, 199, 0.5);
  --note-paper-border-mid: rgba(2, 132, 199, 0.4);
  --note-paper-border-bottom: rgba(2, 132, 199, 0.45);
  --note-paper-glue: rgba(186, 230, 253, 0.75);
  --note-paper-glue-border: rgba(2, 132, 199, 0.35);
  --note-paper-text: #0369a1;
  --note-paper-text-muted: #0284c7;
  --note-paper-card-shadow: rgba(56, 189, 248, 0.4);
  --note-paper-tool-bg: rgba(224, 242, 254, 0.75);
}

[data-note-theme="green"] {
  --note-paper-top: #f0fdf4;
  --note-paper-mid: #dcfce7;
  --note-paper-bottom: #bbf7d0;
  --note-paper-border: rgba(22, 163, 74, 0.5);
  --note-paper-border-mid: rgba(22, 163, 74, 0.4);
  --note-paper-border-bottom: rgba(22, 163, 74, 0.45);
  --note-paper-glue: rgba(187, 247, 208, 0.75);
  --note-paper-glue-border: rgba(22, 163, 74, 0.35);
  --note-paper-text: #15803d;
  --note-paper-text-muted: #16a34a;
  --note-paper-card-shadow: rgba(74, 222, 128, 0.4);
  --note-paper-tool-bg: rgba(220, 252, 231, 0.75);
}

[data-note-theme="pink"] {
  --note-paper-top: #fdf2f8;
  --note-paper-mid: #fce7f3;
  --note-paper-bottom: #fbcfe8;
  --note-paper-border: rgba(219, 39, 119, 0.5);
  --note-paper-border-mid: rgba(219, 39, 119, 0.4);
  --note-paper-border-bottom: rgba(219, 39, 119, 0.45);
  --note-paper-glue: rgba(251, 207, 232, 0.75);
  --note-paper-glue-border: rgba(219, 39, 119, 0.35);
  --note-paper-text: #9d174d;
  --note-paper-text-muted: #be185d;
  --note-paper-card-shadow: rgba(244, 114, 182, 0.4);
  --note-paper-tool-bg: rgba(252, 231, 243, 0.75);
}

[data-note-theme="white"] {
  --note-paper-top: #ffffff;
  --note-paper-mid: #f8fafc;
  --note-paper-bottom: #e2e8f0;
  --note-paper-border: rgba(148, 163, 184, 0.55);
  --note-paper-border-mid: rgba(148, 163, 184, 0.45);
  --note-paper-border-bottom: rgba(148, 163, 184, 0.5);
  --note-paper-glue: rgba(226, 232, 240, 0.85);
  --note-paper-glue-border: rgba(148, 163, 184, 0.4);
  --note-paper-text: #334155;
  --note-paper-text-muted: #64748b;
  --note-paper-card-shadow: rgba(148, 163, 184, 0.4);
  --note-paper-tool-bg: rgba(241, 245, 249, 0.85);
}

[data-note-theme="purple"] {
  --note-paper-top: #faf5ff;
  --note-paper-mid: #f3e8ff;
  --note-paper-bottom: #e9d5ff;
  --note-paper-border: rgba(147, 51, 234, 0.5);
  --note-paper-border-mid: rgba(147, 51, 234, 0.4);
  --note-paper-border-bottom: rgba(147, 51, 234, 0.45);
  --note-paper-glue: rgba(233, 213, 255, 0.75);
  --note-paper-glue-border: rgba(147, 51, 234, 0.35);
  --note-paper-text: #6b21a8;
  --note-paper-text-muted: #7e22ce;
  --note-paper-card-shadow: rgba(192, 132, 252, 0.4);
  --note-paper-tool-bg: rgba(243, 232, 255, 0.75);
}

.note-widget-body {
  padding: 10px 14px 14px 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

/* 2D Block Stapel-Effekt (ausschließlich im Widget) */
.note-paper-stack {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 140px;
  margin: 1px 7px 7px 1px;
}

/* Unterste Schicht des 2D-Blocks */
.note-paper-stack::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  right: -7px;
  bottom: -7px;
  background: var(--note-paper-bottom);
  border: 1.5px solid var(--note-paper-border-bottom);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1;
  transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease;
}

/* Mittlere Schicht des 2D-Blocks */
.note-paper-stack::before {
  content: "";
  position: absolute;
  top: 3.5px;
  left: 3.5px;
  right: -3.5px;
  bottom: -3.5px;
  background: var(--note-paper-mid);
  border: 1.5px solid var(--note-paper-border-mid);
  border-radius: 6px;
  z-index: 2;
  transition: transform 0.2s ease, background 0.3s ease, border-color 0.3s ease;
}

/* Oberstes Blatt mit Handschrift-Vorschau */
.note-paper-preview {
  position: relative;
  z-index: 3;
  flex: 1;
  width: 100%;
  height: 100%;
  background: var(--note-paper-top);
  border-radius: 6px;
  border: 1.5px solid var(--note-paper-border);
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.3s ease, border-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2D Klebestreifen oben auf dem obersten Notizzettel */
.note-paper-glue {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  background: var(--note-paper-glue);
  border-bottom: 1.5px dashed var(--note-paper-glue-border);
  pointer-events: none;
  z-index: 4;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.widget[data-type="note"]:hover .note-paper-preview {
  transform: translate(-1.5px, -1.5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.widget[data-type="note"]:hover .note-paper-stack::after {
  transform: translate(1px, 1px);
}

.note-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.note-empty-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--note-paper-text-muted);
  font-size: 12px;
  font-weight: 600;
  opacity: 0.8;
  pointer-events: none;
  transition: color 0.3s ease;
}

.note-empty-placeholder i {
  font-size: 24px;
  opacity: 0.85;
}

.note-hover-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: var(--note-paper-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.3s ease;
}

.widget[data-type="note"]:hover .note-hover-badge {
  opacity: 1;
  transform: scale(1.05);
}

/* 2. Zoom Modal Overlay */
.note-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease-out;
}

.note-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.note-modal-card {
  width: 96vw;
  max-width: 1040px;
  height: 88vh;
  max-height: 780px;
  background: var(--note-paper-mid);
  border-radius: 12px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--note-paper-card-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.65);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease-out, background 0.3s ease;
}

.note-modal-card.zoomed-in {
  transform: scale(1);
  opacity: 1;
}

/* 3. Modal Header Toolbar */
.note-modal-header {
  background: var(--note-paper-bottom);
  border-bottom: 1px solid var(--note-paper-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  user-select: none;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.note-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--note-paper-text);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}

.note-modal-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.note-tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--note-paper-tool-bg);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--note-paper-border-mid);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Farb-Buttons */
.note-color-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.note-color-btn:active {
  transform: scale(0.9);
}

.note-color-btn.active {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--note-paper-text), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.note-color-btn.highlighter {
  position: relative;
  background: #facc15;
}

.note-color-btn.highlighter::after {
  content: "T";
  font-size: 10px;
  font-weight: 800;
  color: #713f12;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Größen-Buttons */
.note-size-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.note-size-btn.active {
  background: rgba(0, 0, 0, 0.12);
  border-color: var(--note-paper-border-mid);
}

.size-dot {
  background: #1e293b;
  border-radius: 50%;
  display: block;
}

.size-dot.dot-sm { width: 5px; height: 5px; }
.size-dot.dot-md { width: 9px; height: 9px; }
.size-dot.dot-lg { width: 14px; height: 14px; }

/* Werkzeug-Buttons (Radierer, Undo, Clear) */
.note-tool-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--note-paper-text);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-tool-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.note-tool-btn:active {
  transform: scale(0.92);
}

.note-tool-btn.active {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}

/* Fertig / Schließen Button */
.note-close-btn {
  background: #16a34a !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 6px 16px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.3) !important;
}

.note-close-btn:hover {
  background: #15803d !important;
}

/* 4. Canvas Zeichenfläche */
.note-canvas-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  background: var(--note-paper-mid);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: background 0.3s ease;
}

#noteCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none;
}

/* ==========================================================================
   VIEW MODE: DECK-CAROUSEL (COVERFLOW 3D ENGINE) & TAP-TO-FULLSCREEN
   ========================================================================== */

/* Verstecke Karussell-Elemente im Kachelraster-Modus */
body:not(.view-carousel) .carousel-nav-btn,
body:not(.view-carousel) .carousel-dock,
body:not(.view-carousel) .widget-carousel-zoom-btn {
  display: none !important;
}

body.view-carousel .drag-handle {
  display: none !important;
}

/* CAROUSEL STAGE & CONTAINER */
body.view-carousel .dashboard {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  perspective: 1400px !important;
  perspective-origin: center center !important;
  position: relative !important;
  overflow: hidden !important;
  touch-action: none !important;
  padding: 0 !important;
  margin: 0 !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  height: calc(100vh - 64px) !important;
  width: 100vw !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}

/* COVERFLOW WIDGET CARDS - 60 FPS GPU ACCELERATED */
body.view-carousel .widget {
  position: absolute !important;
  width: 680px !important;
  max-width: 86vw !important;
  height: 520px !important;
  max-height: 72vh !important;
  margin: 0 !important;
  border-radius: 24px !important;
  background: var(--panel-bg, rgba(13, 22, 38, 0.85)) !important;
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.18)) !important;
  box-shadow: var(--panel-shadow, 0 22px 48px rgba(0, 0, 0, 0.5)) !important;
  backdrop-filter: var(--blur, blur(26px)) !important;
  -webkit-backdrop-filter: var(--blur, blur(26px)) !important;
  cursor: pointer;
  transform-origin: center center;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.35s ease !important;
  will-change: transform, opacity;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  grid-column: unset !important;
  grid-row: unset !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 10;
}

body.view-carousel .widget.no-transition {
  transition: none !important;
}

/* Versteckte Widgets im Karussell-Modus zwingend ausblenden */
body.view-carousel .widget.hidden,
body.view-carousel .widget[style*="display: none"],
body.view-carousel .widget[style*="display:none"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transform: scale(0.001) !important;
}

body.view-carousel .widget-header {
  pointer-events: auto !important;
  padding: 16px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

body.view-carousel .widget-carousel-zoom-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main, #f0f6fc);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  margin-left: auto;
}

body.view-carousel .widget-carousel-zoom-btn:hover {
  background: var(--primary, #00f2fe);
  color: #000;
  box-shadow: 0 0 12px var(--primary-glow, rgba(0, 242, 254, 0.4));
}

body.view-carousel .widget-body {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 18px 22px !important;
}

/* 3D POSITIONS (Pure GPU Transforms & Opacity - No filter/blur repaints) */
body.view-carousel .widget.active {
  transform: translate3d(0, 0, 100px) rotateY(0deg) scale(1) !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 50 !important;
  pointer-events: auto !important;
  border-color: var(--primary, #00f2fe) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7), 0 0 25px var(--primary-glow, rgba(0, 242, 254, 0.25)) !important;
}

body.view-carousel .widget.prev-1 {
  transform: translate3d(-62%, 0, -60px) rotateY(30deg) scale(0.86) !important;
  opacity: 0.65 !important;
  visibility: visible !important;
  z-index: 40 !important;
}

body.view-carousel .widget.next-1 {
  transform: translate3d(62%, 0, -60px) rotateY(-30deg) scale(0.86) !important;
  opacity: 0.65 !important;
  visibility: visible !important;
  z-index: 40 !important;
}

body.view-carousel .widget.prev-2 {
  transform: translate3d(-110%, 0, -200px) rotateY(42deg) scale(0.74) !important;
  opacity: 0.35 !important;
  visibility: visible !important;
  z-index: 30 !important;
}

body.view-carousel .widget.next-2 {
  transform: translate3d(110%, 0, -200px) rotateY(-42deg) scale(0.74) !important;
  opacity: 0.35 !important;
  visibility: visible !important;
  z-index: 30 !important;
}

body.view-carousel .widget.hidden-left {
  transform: translate3d(-150%, 0, -350px) rotateY(50deg) scale(0.6) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 10 !important;
}

body.view-carousel .widget.hidden-right {
  transform: translate3d(150%, 0, -350px) rotateY(-50deg) scale(0.6) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: 10 !important;
}

/* Pause background orbs in carousel mode to preserve tablet GPU */
body.view-carousel .orb {
  animation-play-state: paused !important;
  filter: blur(50px) !important;
}

/* NAVIGATION ARROWS */
.carousel-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(13, 22, 38, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 70;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.carousel-nav-btn:hover {
  background: var(--primary, #00f2fe);
  color: #000;
  border-color: var(--primary, #00f2fe);
  box-shadow: 0 0 20px var(--primary-glow, rgba(0, 242, 254, 0.4));
  transform: translateY(-50%) scale(1.08);
}

.carousel-nav-btn.prev {
  left: 24px;
}

.carousel-nav-btn.next {
  right: 24px;
}

/* CAROUSEL BOTTOM DOCK & PILLS */
.carousel-dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  max-width: 92vw;
  background: rgba(10, 16, 28, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 35px;
  padding: 6px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
}

.carousel-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.carousel-pills::-webkit-scrollbar {
  display: none;
}

.carousel-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted, #8b9bb4);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.carousel-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.carousel-pill.active {
  color: #fff;
  background: var(--primary-glow, rgba(0, 242, 254, 0.2));
  border-color: var(--primary, #00f2fe);
  box-shadow: 0 0 12px var(--primary-glow, rgba(0, 242, 254, 0.3));
}

/* TAP-TO-FULLSCREEN DETAIL / FOCUS MODE (80% HERO-VIEW) */
body.card-fullscreen-mode {
  overflow: hidden !important;
}

body.card-fullscreen-mode header.header,
body.card-fullscreen-mode .carousel-dock,
body.card-fullscreen-mode .carousel-nav-btn {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

body.card-fullscreen-mode .dashboard {
  perspective: none !important;
  z-index: 1000 !important;
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 100vh !important;
  width: 100vw !important;
  transform-style: flat !important;
  background: rgba(4, 7, 14, 0.75) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  transition: background 0.3s ease;
}

body.card-fullscreen-mode .widget:not(.fullscreen) {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
  transition: opacity 0.2s ease;
}

body.card-fullscreen-mode .widget.fullscreen {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 82vw !important;
  max-width: 960px !important;
  height: 80vh !important;
  max-height: 720px !important;
  border-radius: 24px !important;
  border: 1.5px solid var(--primary, #00f2fe) !important;
  z-index: 9999 !important;
  filter: none !important;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85), 0 0 40px var(--primary-glow, rgba(0, 242, 254, 0.28)) !important;
  background: var(--bg-color, #0b0f19) !important;
  cursor: default !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  animation: cardFocusZoom 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes cardFocusZoom {
  from {
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0.6;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

body.card-fullscreen-mode .widget.fullscreen .widget-header {
  height: 60px !important;
  padding: 0 22px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer !important;
  border-top-left-radius: 22px !important;
  border-top-right-radius: 22px !important;
}

body.card-fullscreen-mode .widget.fullscreen .widget-body {
  height: calc(100% - 60px) !important;
  max-height: calc(100% - 60px) !important;
  padding: 20px 24px !important;
  overflow-y: auto !important;
}

/* ==========================================================================
   UNIFIED 3D-GLASS DESIGN SYSTEM (DARK & LIGHT)
   ========================================================================== */

body.theme-dark,
body.theme-light {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Outfit', 'Segoe UI', Roboto, sans-serif;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --blur: blur(28px) saturate(165%);
}

/* --- DARK: 3D AURORA GLASS --- */
body.theme-dark {
  --bg-color: #060913;
  --bg-mesh:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(14, 165, 233, 0.35), transparent 60%),
    radial-gradient(ellipse 70% 55% at 90% 15%, rgba(168, 85, 247, 0.32), transparent 60%),
    radial-gradient(ellipse 75% 65% at 75% 88%, rgba(20, 184, 166, 0.28), transparent 60%),
    radial-gradient(ellipse 65% 55% at 20% 85%, rgba(244, 63, 94, 0.18), transparent 60%),
    linear-gradient(135deg, #050814 0%, #0b132b 45%, #111827 100%);
  --orb-1: radial-gradient(circle, rgba(56, 189, 248, 0.55) 0%, rgba(56, 189, 248, 0) 70%);
  --orb-2: radial-gradient(circle, rgba(168, 85, 247, 0.50) 0%, rgba(168, 85, 247, 0) 70%);
  --orb-3: radial-gradient(circle, rgba(45, 212, 191, 0.45) 0%, rgba(45, 212, 191, 0) 70%);
  --orb-4: radial-gradient(circle, rgba(251, 146, 60, 0.26) 0%, rgba(251, 146, 60, 0) 70%);
  --grid-color: rgba(255, 255, 255, 0.045);
  --beam-gradient: conic-gradient(from 210deg at 50% 45%, transparent 0deg, rgba(56, 189, 248, 0.12) 45deg, rgba(168, 85, 247, 0.10) 95deg, transparent 150deg, rgba(45, 212, 191, 0.10) 240deg, transparent 310deg);
  --panel-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  --panel-border: rgba(255, 255, 255, 0.18);
  --panel-shadow: 0 22px 48px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --pill-bg: rgba(255, 255, 255, 0.08);
  --pill-border: rgba(255, 255, 255, 0.14);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.28);
}

/* --- LIGHT: 3D DAYLIGHT GLASS --- */
body.theme-light {
  --bg-color: #dce8f7;
  --bg-mesh:
    radial-gradient(ellipse 80% 60% at 12% 12%, rgba(56, 189, 248, 0.42), transparent 60%),
    radial-gradient(ellipse 70% 55% at 88% 16%, rgba(167, 139, 250, 0.36), transparent 60%),
    radial-gradient(ellipse 75% 65% at 78% 88%, rgba(45, 212, 191, 0.34), transparent 60%),
    radial-gradient(ellipse 65% 55% at 18% 84%, rgba(251, 146, 60, 0.22), transparent 60%),
    linear-gradient(135deg, #e0ecff 0%, #eef4ff 48%, #e4eef9 100%);
  --orb-1: radial-gradient(circle, rgba(14, 165, 233, 0.48) 0%, rgba(14, 165, 233, 0) 70%);
  --orb-2: radial-gradient(circle, rgba(139, 92, 246, 0.42) 0%, rgba(139, 92, 246, 0) 70%);
  --orb-3: radial-gradient(circle, rgba(20, 184, 166, 0.40) 0%, rgba(20, 184, 166, 0) 70%);
  --orb-4: radial-gradient(circle, rgba(251, 146, 60, 0.28) 0%, rgba(251, 146, 60, 0) 70%);
  --grid-color: rgba(15, 23, 42, 0.055);
  --beam-gradient: conic-gradient(from 210deg at 50% 45%, transparent 0deg, rgba(14, 165, 233, 0.14) 45deg, rgba(139, 92, 246, 0.12) 95deg, transparent 150deg, rgba(20, 184, 166, 0.12) 240deg, transparent 310deg);
  --panel-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.46));
  --panel-border: rgba(255, 255, 255, 0.88);
  --panel-shadow: 0 20px 42px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.96);
  --pill-bg: rgba(255, 255, 255, 0.62);
  --pill-border: rgba(15, 23, 42, 0.09);
  --text-main: #0f172a;
  --text-muted: #475569;
  --primary: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.22);
}

/* Shared 3D-Glass Widget & Chrome Surfaces */
body.theme-dark .widget,
body.theme-light .widget {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--panel-shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

body:not(.view-carousel).theme-dark .widget:hover,
body:not(.view-carousel).theme-light .widget:hover {
  transform: translateY(-2px);
}

body.theme-dark .header-right,
body.theme-light .header-right {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

/* Light-Mode Readability & Frost Adjustments */
body.theme-light .header-time {
  background: linear-gradient(135deg, #0f172a, #0284c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: none;
}

body.theme-light .deck-title span {
  color: #0f172a;
}

body.theme-light .deck-title small,
body.theme-light .widget-header h3,
body.theme-light .drag-handle {
  color: #475569;
}

body.theme-light .header-version-badge {
  color: rgba(2, 132, 199, 0.85);
  background: rgba(2, 132, 199, 0.10);
  border-color: rgba(2, 132, 199, 0.22);
}

body.theme-light .settings-btn {
  color: #0f172a !important;
}
body.theme-light .settings-btn:hover {
  color: #0284c7 !important;
}

body.theme-light .widget-header {
  border-bottom-color: rgba(15, 23, 42, 0.07);
}

body.theme-light .weather-temp {
  color: #0f172a !important;
}
body.theme-light .weather-desc,
body.theme-light .weather-condition {
  color: #334155 !important;
}
body.theme-light .weather-details {
  background: rgba(255, 255, 255, 0.45) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-radius: 14px;
}
body.theme-light .w-detail {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}
body.theme-light .w-detail i {
  color: #0284c7 !important;
}
body.theme-light .w-detail small {
  color: #475569 !important;
}
body.theme-light .w-detail span {
  color: #0f172a !important;
}

body.theme-light .speed-value,
body.theme-light .fritz-speed-card .speed-label,
body.theme-light .speed-unit {
  color: #0f172a !important;
}
body.theme-light .fritz-status-bar,
body.theme-light .fritz-guest-bar {
  background: rgba(255, 255, 255, 0.65) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

body.theme-light .stat-box,
body.theme-light .tasmota-btn,
body.theme-light .tasmota-card,
body.theme-light .preset-btn,
body.theme-light .fritz-speed-card,
body.theme-light .radio-card-hero,
body.theme-light .sensor-card,
body.theme-light .waste-item,
body.theme-light .calendar-event {
  background: rgba(255, 255, 255, 0.68) !important;
  border-color: rgba(15, 23, 42, 0.09) !important;
  color: #0f172a !important;
}

body.theme-light .tasmota-btn.active,
body.theme-light .tasmota-card.is-active,
body.theme-light .tasmota-card.on {
  background: rgba(2, 132, 199, 0.14) !important;
  border-color: rgba(2, 132, 199, 0.45) !important;
}

body.theme-light .settings-panel,
body.theme-light .modal-content {
  background: rgba(244, 248, 255, 0.90) !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  color: #0f172a !important;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18) !important;
}

body.theme-light .settings-sidebar {
  background: rgba(255, 255, 255, 0.55) !important;
  border-right-color: rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .settings-tab-btn {
  color: #475569 !important;
}

body.theme-light .settings-tab-btn.active {
  background: rgba(2, 132, 199, 0.12) !important;
  color: #0284c7 !important;
}

body.theme-light input,
body.theme-light select,
body.theme-light textarea,
body.theme-light .radio-select {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
}

body.theme-light .settings-header {
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.96), rgba(244, 248, 255, 0.84)) !important;
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .settings-header h2 {
  color: #0f172a !important;
}

body.theme-light .settings-header p {
  color: #475569 !important;
}

body.theme-light .setting-section {
  background: rgba(255, 255, 255, 0.68) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05) !important;
  color: #0f172a !important;
}

body.theme-light .accordion-header,
body.theme-light .section-title {
  color: #0f172a !important;
  text-shadow: none !important;
}

body.theme-light .close-btn {
  background: rgba(15, 23, 42, 0.07) !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
}

body.theme-light .close-btn:hover {
  background: rgba(2, 132, 199, 0.14) !important;
  color: #0284c7 !important;
}

body.theme-light.card-fullscreen-mode .widget.fullscreen .widget-header {
  background: rgba(255, 255, 255, 0.72) !important;
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}

/* Light-Mode Timer Widget */
body.theme-light .timer-tabs {
  background: rgba(255, 255, 255, 0.52) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}
body.theme-light .timer-tab {
  color: #475569 !important;
}
body.theme-light .timer-tab:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.5) !important;
}
body.theme-light .timer-tab.active {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
body.theme-light .timer-drum-picker {
  background: rgba(255, 255, 255, 0.65) !important;
  border-color: rgba(15, 23, 42, 0.09) !important;
  box-shadow: inset 0 2px 12px rgba(15, 23, 42, 0.06) !important;
}
body.theme-light .timer-drum-picker::before {
  background: linear-gradient(to bottom, rgba(240, 246, 255, 0.95) 0%, rgba(240, 246, 255, 0) 100%) !important;
}
body.theme-light .timer-drum-picker::after {
  background: linear-gradient(to top, rgba(240, 246, 255, 0.95) 0%, rgba(240, 246, 255, 0) 100%) !important;
}
body.theme-light .timer-drum-picker-indicator {
  border-top-color: rgba(2, 132, 199, 0.28) !important;
  border-bottom-color: rgba(2, 132, 199, 0.28) !important;
  background: rgba(2, 132, 199, 0.07) !important;
}
body.theme-light .timer-drum-label {
  color: #475569 !important;
}
body.theme-light .timer-drum-item {
  color: #64748b !important;
}
body.theme-light .timer-drum-item.active {
  color: #0284c7 !important;
  text-shadow: none !important;
}
body.theme-light .timer-preset-btn {
  background: rgba(255, 255, 255, 0.72) !important;
  border-color: rgba(15, 23, 42, 0.09) !important;
  color: #0f172a !important;
}
body.theme-light .timer-preset-btn:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: #0284c7 !important;
}
body.theme-light #timerCountdownText {
  color: #0f172a !important;
}

.weather-icon .weather-3d-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
}

.waste-bin-3d {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.26));
}

.waste-alert-bin-3d {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

/* 3D Stainless-Steel LED Power Push Buttons for Smart Home Devices */
.tasmota-3d-button {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    from 45deg,
    #cbd5e1 0deg,
    #f8fafc 45deg,
    #64748b 110deg,
    #e2e8f0 175deg,
    #475569 240deg,
    #f1f5f9 305deg,
    #cbd5e1 360deg
  );
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.42),
    inset 0 1px 1px rgba(255, 255, 255, 0.92),
    inset 0 -2px 4px rgba(15, 23, 42, 0.55);
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}

.tasmota-3d-led-ring {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #0f172a;
  border: 2.5px solid #ef4444;
  box-shadow:
    0 0 10px rgba(239, 68, 68, 0.8),
    inset 0 0 6px rgba(239, 68, 68, 0.55);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.tasmota-3d-cap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 32% 28%, #f8fafc 0%, #cbd5e1 48%, #64748b 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.88),
    0 2px 5px rgba(0, 0, 0, 0.45);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.tasmota-power-svg {
  width: 20px;
  height: 20px;
  color: #ef4444;
  filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.88));
  transition: color 0.25s ease, filter 0.25s ease;
}

.tasmota-btn:active .tasmota-3d-cap {
  transform: scale(0.93);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
}

.tasmota-btn.active .tasmota-3d-led-ring {
  border-color: #22c55e;
  box-shadow:
    0 0 14px rgba(34, 197, 94, 0.95),
    inset 0 0 8px rgba(34, 197, 94, 0.72);
}

.tasmota-btn.active .tasmota-power-svg {
  color: #22c55e;
  filter: drop-shadow(0 0 7px rgba(34, 197, 94, 0.95));
}

body.theme-light .tasmota-3d-button {
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 4px rgba(15, 23, 42, 0.35);
}

body.theme-light .tasmota-btn.active .tasmota-power-svg {
  color: #16a34a;
}

/* Light-Mode 3D-Glass Carousel */
body.theme-light.view-carousel .widget {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.62)) !important;
  border-color: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
}
body.theme-light.view-carousel .widget.active {
  border-color: rgba(2, 132, 199, 0.58) !important;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.16), 0 0 24px rgba(2, 132, 199, 0.22) !important;
}
body.theme-light.view-carousel .widget-header {
  background: rgba(255, 255, 255, 0.35) !important;
  border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}
body.theme-light.view-carousel .widget-carousel-zoom-btn {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}
body.theme-light.view-carousel .widget-carousel-zoom-btn:hover {
  background: #0284c7;
  color: #fff;
}
body.theme-light .carousel-nav-btn {
  background: rgba(255, 255, 255, 0.80);
  border-color: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}
body.theme-light .carousel-nav-btn:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}
body.theme-light .carousel-dock {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
body.theme-light .carousel-pill {
  color: #475569;
  background: rgba(15, 23, 42, 0.05);
}
body.theme-light .carousel-pill:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.10);
}
body.theme-light .carousel-pill.active {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.14);
  border-color: #0284c7;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.2);
}







