:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #102344;
  background: #eaf4fb;
  font-synthesis: none;
  --blue: #0877ee;
  --blue-dark: #0d3fc5;
  --ink: #102344;
  --muted: #607b93;
  --line: #d7e7f2;
  --panel: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 52px rgba(31, 84, 122, 0.11);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #eaf4fb; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.98) 0, transparent 31%),
    radial-gradient(circle at 100% 42%, rgba(94, 195, 255, 0.14), transparent 30%),
    linear-gradient(145deg, #edf8ff, #dcebf6);
}

button, input { font: inherit; }

button {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(18, 139, 240, 0.3);
  outline-offset: 2px;
}

.is-hidden { display: none !important; }
.eyebrow { display: block; color: #5d7f9b; font-size: 0.7rem; font-weight: 850; letter-spacing: 0.14em; margin-bottom: 4px; }
.eyebrow.light { color: rgba(255, 255, 255, 0.72); }

/* Prva prijava */
.auth-screen {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(440px, 1.08fr);
  min-height: 100vh;
  min-height: 100dvh;
  background: #f5faff;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 7vw, 100px);
  color: white;
  background:
    radial-gradient(circle at 76% 17%, rgba(87, 222, 255, 0.6), transparent 17%),
    linear-gradient(145deg, #0732a6 0%, #0756d6 44%, #09a5ef 100%);
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 40%;
  transform: rotate(-14deg);
}

.auth-visual::before { width: 620px; height: 380px; right: -310px; bottom: -40px; }
.auth-visual::after { width: 460px; height: 290px; right: -210px; bottom: 50px; }

.auth-orb {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-bottom: 44px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 35px rgba(0, 33, 130, 0.22);
  backdrop-filter: blur(10px);
}
.auth-orb img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 5px 9px rgba(0, 25, 105, .2)); }

.auth-copy { position: relative; z-index: 1; max-width: 510px; }
.auth-copy h1 { margin: 0; font-size: clamp(2.8rem, 5.5vw, 5.7rem); line-height: 0.96; letter-spacing: -0.055em; }
.auth-copy p { max-width: 460px; margin: 28px 0 0; color: rgba(255, 255, 255, 0.82); font-size: clamp(1rem, 1.6vw, 1.25rem); line-height: 1.65; }
.auth-lines { position: absolute; inset: auto 0 0; height: 32%; opacity: 0.48; }
.auth-lines i { position: absolute; bottom: -40px; width: 45%; aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, 0.17); border-radius: 50%; }
.auth-lines i:nth-child(1) { left: -8%; }
.auth-lines i:nth-child(2) { left: 15%; bottom: -55%; }
.auth-lines i:nth-child(3) { left: 42%; bottom: -25%; }

.auth-panel { display: grid; place-items: center; padding: 42px 8vw; }
.auth-card { width: min(100%, 430px); }
.auth-card h2 { margin: 0 0 12px; color: #113bb5; font-size: clamp(2rem, 3vw, 2.8rem); line-height: 1.08; letter-spacing: -0.04em; }
.auth-card > p:not(.form-error) { margin: 0 0 30px; color: var(--muted); line-height: 1.6; }
.auth-card > small { display: block; margin-top: 16px; color: #7890a4; text-align: center; }
.mobile-logo { display: none; }
.mobile-logo img { width: 49px; height: 49px; object-fit: contain; }
.field { display: grid; gap: 8px; margin-top: 17px; color: #304e68; font-size: 0.83rem; font-weight: 750; }
.field input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid #ccdeeb;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 6px 20px rgba(39, 88, 122, 0.06);
}
.field input:focus { border-color: #3b9bf0; }
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-toggle { position: absolute; top: 6px; right: 6px; width: 42px; height: 42px; border: 0; border-radius: 10px; color: #557795; background: transparent; cursor: pointer; }
.form-error { min-height: 21px; margin: 12px 0 0; color: #c42a46; font-size: 0.82rem; }
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 58px;
  padding: 0 18px 0 22px;
  border: 0;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, #0a8ff0, #075bd4);
  box-shadow: 0 13px 28px rgba(8, 113, 226, 0.28);
  font-weight: 850;
  cursor: pointer;
}
.auth-submit b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: rgba(255, 255, 255, 0.16); font-size: 1.15rem; }
.auth-submit:disabled { opacity: 0.65; cursor: wait; }

/* Glavna aplikacija */
.app-shell { max-width: 1540px; margin: auto; padding: 18px; }
.topbar, .floorplan-card, .blinds-card, .quick-card, .scenes-card {
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.topbar { min-height: 88px; display: grid; grid-template-columns: minmax(300px, 1fr) auto; align-items: center; gap: clamp(18px, 2.4vw, 34px); margin-bottom: 16px; padding: 12px 18px 12px 16px; }
.brand { display: flex; align-items: center; min-width: 0; gap: 13px; }
.brand-logo { display: grid; place-items: center; width: 60px; height: 60px; flex: 0 0 60px; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.brand-logo img { width: 58px; height: 58px; object-fit: contain; }
.brand-logo:hover { filter: brightness(1.04) saturate(1.04); }
.brand-logo:focus-visible { outline: 3px solid rgba(14, 126, 226, .28); outline-offset: 3px; }
.brand-copy { display: grid; align-content: center; min-width: 0; gap: 4px; }
.brand-copy small { display: block; min-height: 14px; color: #5d7890; line-height: 1.15; }
.topbar h1, .section-heading h2, .settings-modal h2 { margin: 0; color: #103ec0; letter-spacing: -0.03em; }
.topbar h1 { font-size: clamp(1.45rem, 2.35vw, 2rem); font-weight: 520; line-height: 1.05; white-space: nowrap; }
.topbar-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 58px; white-space: nowrap; }
.connection-pill { display: flex; align-items: center; gap: 8px; height: 46px; min-height: 46px; padding: 0 14px; border: 1px solid #d6e8f4; border-radius: 14px; color: #42627d; background: #f6fbff; font-size: 0.74rem; }
.connection-pill span { width: 8px; height: 8px; border-radius: 50%; background: #24c27e; box-shadow: 0 0 0 5px rgba(36, 194, 126, 0.12); }
.connection-pill.device { color: #087648; background: #effcf6; }
.connection-pill.offline { color: #a33c4a; background: #fff4f5; }
.connection-pill.offline span { background: #e34b5e; box-shadow: 0 0 0 5px rgba(227, 75, 94, 0.12); }
.time-block { display: grid; align-content: center; min-width: 116px; height: 46px; min-height: 46px; padding-left: 14px; border-left: 1px solid #cbdce9; text-align: right; }
.time-block strong { display: block; color: #0d42cd; font-size: 1.65rem; line-height: 1; }
.time-block span { display: block; margin-top: 6px; color: #55728e; font-size: 0.78rem; }
.icon-button { width: 46px; height: 46px; flex: 0 0 46px; border: 1px solid #d2e3ef; border-radius: 14px; color: #345f85; background: linear-gradient(145deg, #fff, #f1f7fb); box-shadow: 0 5px 12px rgba(36, 83, 117, .08); font-size: 1.15rem; cursor: pointer; }

.dashboard { display: grid; grid-template-columns: minmax(0, 2.18fr) minmax(330px, 1fr); gap: 16px; }
.floorplan-card, .blinds-card, .quick-card, .scenes-card { padding: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { font-size: 1.34rem; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.status-pill, .count { border-radius: 999px; color: #1779d5; background: #eaf6ff; font-size: 0.76rem; font-weight: 780; }
.status-pill { display: flex; align-items: center; gap: 7px; padding: 8px 11px; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #1fb77a; }
.status-pill.online { color: #087648; background: #effcf6; }
.status-pill.offline { color: #a33c4a; background: #fff1f3; }
.status-pill.offline i { background: #e34b5e; box-shadow: 0 0 0 4px rgba(227,75,94,.11); }
.floorplan-status-dot { display:grid; place-items:center; width:20px; height:20px; flex:0 0 20px; }
.floorplan-status-dot i { width:8px; height:8px; border-radius:50%; background:#1fb77a; box-shadow:0 0 0 4px rgba(31,183,122,.12); }
.floorplan-status-dot.offline i { background:#e34b5e; box-shadow:0 0 0 4px rgba(227,75,94,.12); }
.count { display: grid; place-items: center; min-width: 32px; height: 32px; }
.section-help { margin: -3px 0 13px; color: #68849b; font-size: 0.78rem; }
.collapse-button { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 4px 11px 4px 5px; border: 1px solid #c9e0ef; border-radius: 12px; color: #1d6198; background: #f7fbfe; font-size: .72rem; font-weight: 800; cursor: pointer; }
.collapse-button span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: white; background: linear-gradient(145deg, #22adf3, #0871df); font-size: 1.15rem; line-height: 1; }
.collapse-button:hover { border-color: #86c3ea; background: #eef8fe; }
.floorplan-card.is-collapsed .section-heading { margin-bottom: 0; }
.floorplan-content[hidden] { display: none; }

.floorplan { position: relative; overflow: hidden; aspect-ratio: 1.335; border: 1px solid #e0edf4; border-radius: 18px; background: #e8f0f4; }
.floorplan > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; pointer-events: none; }
#map-controls, #plan-labels, #plan-temperatures, #physical-blinds, #room-zones { position: absolute; inset: 0; }
#room-zones { z-index: 1; pointer-events: none; }
#physical-blinds { z-index: 2; pointer-events: none; }
#plan-labels { z-index: 3; pointer-events: none; }
#plan-temperatures { z-index: 4; pointer-events: none; }
.plan-temperature[data-layout-handle] { pointer-events: auto; }
#map-controls { z-index: 5; pointer-events: none; }
.room-zone { position: absolute; inset: 0; display: block; clip-path: var(--room-shape); background: var(--room-overlay); }
.physical-blind { position: absolute; display: block; transform: translate(-50%, -50%); border: 1px solid rgba(0, 84, 223, .92); border-radius: 999px; background: linear-gradient(90deg, #075ee8 0%, #00c8ff 38%, #e9fbff 50%, #00b9ff 62%, #075ee8 100%); box-shadow: 0 0 0 2px rgba(255,255,255,.82), 0 0 0 4px rgba(0,111,232,.26), 0 0 14px rgba(0,151,255,.72); }
.physical-blind.horizontal { width: var(--blind-length); height: clamp(7px, .86vw, 13px); }
.physical-blind.vertical { width: clamp(7px, .86vw, 13px); height: var(--blind-length); background: linear-gradient(180deg, #075ee8 0%, #00c8ff 38%, #e9fbff 50%, #00b9ff 62%, #075ee8 100%); }
.plan-label { position: absolute; display: grid; justify-items: center; transform: translate(-50%, -50%); color: #1748a8; text-align: center; text-shadow: 0 1px 5px #fff, 0 1px 5px #fff; }
.plan-label b { font-size: clamp(0.54rem, 1.05vw, 0.9rem); }
.plan-label small { margin-top: 1px; font-size: clamp(0.45rem, 0.8vw, 0.69rem); font-weight: 800; }
.plan-temperature { --temperature-accent:#1787ca; position:absolute; display:flex; align-items:flex-start; justify-content:center; min-width:clamp(44px,5.625vw,71px); padding:clamp(3px,.44vw,6px) clamp(6px,.81vw,11px); transform:translate(-50%,-50%); border:1px solid color-mix(in srgb,var(--temperature-accent) 36%,white); border-radius:clamp(9px,1.06vw,14px); color:color-mix(in srgb,var(--temperature-accent) 88%,#173b63); background:rgba(255,255,255,.88); box-shadow:0 6px 17px rgba(25,67,98,.16),inset 0 1px rgba(255,255,255,.95); backdrop-filter:blur(7px) saturate(130%); font-variant-numeric:tabular-nums; white-space:nowrap; }
.plan-temperature strong { font-size:clamp(.7rem,1.3125vw,1.1rem); line-height:1; letter-spacing:-.035em; }
.plan-temperature small { margin:0 0 0 3px; font-size:clamp(.48rem,.725vw,.69rem); font-weight:850; line-height:1; }
.plan-temperature.tone-kitchen { --temperature-accent:#299b75; }
.plan-temperature.tone-living { --temperature-accent:#c18a16; }
.plan-temperature.tone-bedroom1 { --temperature-accent:#bd557d; }
.plan-temperature.tone-bedroom2 { --temperature-accent:#547fb9; }
.plan-temperature.tone-toilet { --temperature-accent:#198eaa; }
.plan-temperature.is-unavailable { color:#71899b; border-color:#cad9e3; background:rgba(241,247,250,.88); }
.map-control { position: absolute; z-index: 4; display: grid; grid-template-columns: clamp(30px, 3vw, 39px) repeat(2, clamp(34px, 3.75vw, 48px)); align-items: center; gap: 3px; padding: 3px; border: 1px solid rgba(173, 213, 240, 0.96); border-radius: 13px; background: rgba(255, 255, 255, 0.93); box-shadow: 0 7px 18px rgba(27, 73, 109, 0.18); transform: translate(-50%, -50%); backdrop-filter: blur(5px); pointer-events: auto; }
.map-control.edge-left { transform: translate(0, -50%); }
.map-control.edge-right { transform: translate(-100%, -50%); }
.map-blind-id { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; color: white; background: linear-gradient(145deg, #12a8f5, #086ce5); font-size: clamp(0.54rem, 0.9vw, 0.72rem); }
.map-blind-id[data-layout-handle], .plan-temperature[data-layout-handle] { touch-action:none; user-select:none; cursor:grab; }
.map-control.is-layout-dragging, .plan-temperature.is-layout-dragging { z-index:30; outline:2px solid rgba(21,144,224,.72); outline-offset:3px; filter:saturate(1.08); cursor:grabbing; }
.map-control.is-layout-dragging { box-shadow:0 12px 28px rgba(12,76,128,.3); }
.plan-temperature.is-layout-dragging { box-shadow:0 10px 24px rgba(12,76,128,.3),inset 0 1px rgba(255,255,255,.95); }
.map-control .direction-button { min-width: 0; min-height: 0; width: clamp(34px, 3.75vw, 48px); height: clamp(34px, 3.75vw, 48px); border-radius: 10px; font-size: clamp(1.05rem, 1.8vw, 1.5rem); }

.blind-list { display: grid; gap: 7px; }
.blind-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 70px 56px 56px; align-items: center; gap: 7px; min-height: 70px; padding: 6px; border: 1px solid #d8e8f3; border-radius: 16px; background: #fbfdff; transition: border 160ms, background 160ms, box-shadow 160ms; }
.blind-row.is-running { border-color: #9ed3f6; background: #f1faff; }
.blind-row.is-locked { border-color: #cbbdf2; background: #faf7ff; }
.blind-id { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; color: white; background: linear-gradient(145deg, #12a8f5, #086ce5); box-shadow: 0 6px 13px rgba(4, 104, 205, 0.18); font-weight: 850; }
.blind-info { min-width: 0; }
.blind-name-line { display: flex; align-items: center; min-width: 0; gap: 7px; }
.blind-name, .blind-status { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blind-name { min-width: 0; color: #1748bd; font-weight: 730; }
.blind-countdown { display: inline-grid; place-items: center; min-width: 37px; height: 23px; flex: 0 0 auto; padding: 0 7px; border: 1px solid var(--room-line, #bfdced); border-radius: 8px; color: var(--room-dark, #145f9c); background: rgba(255,255,255,.78); box-shadow: 0 3px 8px rgba(34, 77, 109, .08); font-size: .68rem; font-variant-numeric: tabular-nums; line-height: 1; }
.blind-position { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 68px; height: 50px; padding: 0 5px; border: 1px solid var(--room-line, #bfdced); border-radius: 13px; color: var(--room-dark, #145f9c); background: rgba(255,255,255,.84); box-shadow: inset 0 1px 0 #fff, 0 4px 11px rgba(34, 77, 109, .09); font-variant-numeric: tabular-nums; }
.blind-position strong { min-width: 31px; font-size: .72rem; font-weight: 850; letter-spacing: -.03em; text-align: center; }
.mini-blind { position: relative; width: 25px; height: 34px; flex: 0 0 25px; overflow: hidden; border: 2px solid #b9cdd8; border-radius: 5px; background: linear-gradient(180deg, #dff6ff 0 72%, #a8dcae 72% 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.8); }
.mini-blind::before { content: ""; position: absolute; z-index: 2; top: 1px; right: 1px; left: 1px; height: 3px; border-radius: 2px; background: #7895a5; box-shadow: 0 1px 2px rgba(29,65,84,.25); }
.mini-blind::after { content: ""; position: absolute; z-index: 1; right: 2px; bottom: 2px; left: 2px; height: 1px; background: rgba(64,112,134,.3); }
.mini-blind-shade { position: absolute; z-index: 1; top: 4px; right: 2px; left: 2px; height: 100%; border-bottom: 2px solid #718b99; background: repeating-linear-gradient(180deg, #dce5e9 0 3px, #879daa 3px 4px); box-shadow: 0 2px 3px rgba(39,72,89,.18); transition: height 220ms linear; }
.blind-row.is-running .blind-position, .blind-row.is-locked .blind-position { border-color: var(--room-accent, #168fe8); background: var(--room-soft, #eef8ff); }
.blind-status { margin-top: 3px; color: #7a91a5; font-size: 0.7rem; }
.blind-row.is-running .blind-status { color: #0873d8; font-weight: 750; }
.blind-row.is-locked .blind-status { color: #7653ca; }
.room-kitchen { --room-accent: #1597b8; --room-dark: #116d86; --room-soft: #e2f7fb; --room-line: #addfe8; --room-overlay: rgba(51, 193, 218, .15); }
.room-balcony { --room-accent: #47a875; --room-dark: #337c58; --room-soft: #e6f7ed; --room-line: #b9dfca; --room-overlay: rgba(90, 190, 129, .15); }
.room-dining { --room-accent: #cf8651; --room-dark: #98623c; --room-soft: #fff0e5; --room-line: #ebcbb4; --room-overlay: rgba(235, 152, 91, .14); }
.room-balcony2 { --room-accent: #806bc2; --room-dark: #6553a0; --room-soft: #f0edfc; --room-line: #d1c8ec; --room-overlay: rgba(139, 116, 204, .14); }
.room-living { --room-accent: #bd9128; --room-dark: #8b6a1d; --room-soft: #fff7dd; --room-line: #eadba8; --room-overlay: rgba(232, 189, 70, .14); }
.room-bedroom1 { --room-accent: #bd6f8a; --room-dark: #8f5268; --room-soft: #fbedf2; --room-line: #e7c4d0; --room-overlay: rgba(211, 112, 145, .13); }
.room-bedroom2 { --room-accent: #6686bb; --room-dark: #4e6893; --room-soft: #edf3fb; --room-line: #c7d5e9; --room-overlay: rgba(102, 137, 190, .14); }
.blind-row.room-tone { border-color: var(--room-line); background: linear-gradient(100deg, var(--room-soft), #fff 76%); }
.blind-row.motion-up { --motion-rgb: 18, 143, 229; border-color: #58b6ed; background: linear-gradient(100deg, #e5f6ff, #fff 78%); animation: blind-motion-pulse 1.35s ease-in-out infinite; }
.blind-row.motion-down { --motion-rgb: 221, 67, 91; border-color: #ed9aaa; background: linear-gradient(100deg, #fff0f3, #fff 78%); animation: blind-motion-pulse 1.35s ease-in-out infinite; }
.blind-row.motion-auto { --motion-rgb: 126, 91, 205; border-color: #b8a2ea; background: linear-gradient(100deg, #f3efff, #fff 78%); animation: blind-motion-pulse 1.35s ease-in-out infinite; }
.blind-row.motion-up .blind-status { color: #0873d8; font-weight: 780; }
.blind-row.motion-down .blind-status { color: #bd354c; font-weight: 780; }
.blind-row.motion-auto .blind-status { color: #704fc1; font-weight: 780; }
@keyframes blind-motion-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--motion-rgb), .08); } 50% { box-shadow: 0 0 0 4px rgba(var(--motion-rgb), .18), 0 7px 18px rgba(var(--motion-rgb), .10); } }
.map-control.room-tone { border-color: var(--room-line); background: var(--room-soft); }
.room-tone .blind-id, .room-tone .map-blind-id { background: linear-gradient(145deg, var(--room-accent), var(--room-dark)); }
.blind-row.room-tone .blind-name { color: var(--room-dark); }
.direction-button { position: relative; display: grid; place-items: center; min-width: 56px; min-height: 56px; padding: 0 0 3px; overflow: hidden; border: 1px solid #badcf4; border-radius: 16px; color: #0d60d6; background: linear-gradient(150deg, #fff, #e9f6ff); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 5px 13px rgba(31, 91, 133, .10); font-size: 1.52rem; font-weight: 900; line-height: 1; touch-action: none; user-select: none; cursor: pointer; transition: transform 100ms, color 100ms, background 100ms, border-color 100ms, box-shadow 100ms; }
.room-tone .direction-button { border-color: var(--room-line); color: var(--room-dark); background: linear-gradient(150deg, #fff, var(--room-soft)); }
.direction-button:hover { transform: translateY(-1px); border-color: #74bdf0; background: linear-gradient(150deg, #fff, #e2f4ff); box-shadow: inset 0 1px 0 #fff, 0 8px 16px rgba(31, 91, 133, .13); }
.room-tone .direction-button:hover { border-color: var(--room-accent); background: linear-gradient(150deg, #fff, var(--room-soft)); }
.direction-button:active, .direction-button.is-active { transform: translateY(1px) scale(.98); color: white; border-color: #0a6edb; background: linear-gradient(145deg, #17adf4, #0769df); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 5px 12px rgba(5, 104, 211, 0.24); }
.direction-button[data-direction="down"]:active, .direction-button[data-direction="down"].is-active { border-color: #d03b50; background: linear-gradient(145deg, #f36c78, #d93d55); box-shadow: 0 7px 15px rgba(207, 48, 72, 0.25); }
.direction-button.is-locked { color: #7751d0; border-color: #cbbbf3; background: #f0eaff; box-shadow: none; }
.direction-button:disabled { opacity: 0.72; cursor: not-allowed; }
.control-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 13px 3px 1px; color: #71899d; font-size: 0.69rem; }
.control-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: #1aa8ec; }
.legend-dot.auto { background: #8666dc; }

.quick-card, .scenes-card { min-height: 218px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.primary-action { display: flex; align-items: center; gap: 13px; min-height: 69px; padding: 10px 16px; border: 0; border-radius: 17px; color: white; background: linear-gradient(145deg, #25b7fb, #0672ed); box-shadow: 0 10px 25px rgba(8, 122, 241, 0.23); text-align: left; cursor: pointer; }
.primary-action.down { background: linear-gradient(145deg, #1599eb, #075bcf); }
.primary-action b, .primary-action small, .sync-action b, .sync-action small, .scene-button b, .scene-button small { display: block; }
.primary-action b { font-size: 1.02rem; }
.primary-action small { margin-top: 3px; color: rgba(255, 255, 255, 0.76); font-size: 0.67rem; font-weight: 550; }
.action-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; background: rgba(255, 255, 255, 0.16); font-size: 1.5rem; }
.primary-action:hover { filter: brightness(1.04); transform: translateY(-1px); }
.primary-action:disabled, .sync-action:disabled { opacity: 0.5; filter: grayscale(0.25); cursor: not-allowed; transform: none; }
.sync-action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 59px; margin-top: 12px; padding: 9px 13px; border: 1px solid #cfe1ef; border-radius: 15px; color: #184988; background: #f7fbff; text-align: left; cursor: pointer; }
.sync-action > span:first-child { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; color: #0877e8; background: #e8f6ff; font-size: 1.25rem; }
.sync-action b { font-size: 0.84rem; }
.sync-action small { margin-top: 2px; color: #71889b; font-size: 0.64rem; line-height: 1.25; }

.scene-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.scene-button { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 67px; padding: 9px; border: 1px solid #cfe1ef; border-radius: 16px; color: #17439c; background: #f8fcff; text-align: left; cursor: pointer; }
.scene-button:hover { border-color: #86c5ed; background: #f0f9ff; }
.scene-button.is-active { border-color: #1889ea; background: #eaf7ff; box-shadow: inset 0 0 0 1px #1889ea; }
.scene-button b { font-size: 0.82rem; }
.scene-button small { margin-top: 3px; color: #7189a1; font-size: 0.62rem; white-space: nowrap; }
.scene-button > i { opacity: 0; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: white; background: #1689e9; font-size: 0.68rem; font-style: normal; }
.scene-button.is-active > i, .scene-button.settings > i { opacity: 1; }
.scene-button.settings > i { color: #3980bc; background: #e6f3fb; font-size: 1.1rem; }
.scene-button.settings { grid-template-columns: 42px minmax(0, 1fr); }
.scene-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: #0a74df; background: #eaf7ff; font-size: 1.25rem; }
.scene-icon.winter { color: #3582da; background: #e8f4ff; }
.scene-icon.summer { color: #e5a20a; background: #fff6d9; }
.text-button { padding: 7px 10px; border: 0; border-radius: 10px; color: #c14556; background: #fff0f2; font-size: 0.72rem; font-weight: 750; cursor: pointer; }
.next-event { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 12px; padding: 8px 11px; border-radius: 14px; background: #f4f8fb; }
.next-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #55768f; background: #e7f0f6; }
.next-event small, .next-event b { display: block; }
.next-event small { color: #7f95a7; font-size: 0.57rem; font-weight: 850; letter-spacing: 0.1em; }
.next-event b { margin-top: 2px; color: #315875; font-size: 0.73rem; }

footer { display: flex; justify-content: flex-start; align-items: center; padding: 17px 7px 4px; color: #69849a; font-size: 0.7rem; }

/* Glavni sistemi: žaluzine i klima */
.app-view-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: 7px; width: fit-content; margin: 0 0 13px 6px; padding: 4px; border: 1px solid rgba(201,222,236,.9); border-radius: 15px; background: rgba(255,255,255,.72); box-shadow: none; backdrop-filter: blur(12px); }
.app-view-tab { position: relative; display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 8px; min-width: 210px; min-height: 38px; padding: 4px 11px 4px 5px; border: 1px solid transparent; border-radius: 11px; color: #53718a; background: transparent; text-align: left; cursor: pointer; }
.app-view-tab:hover { color: #164c9e; background: #f4faff; }
.app-view-tab.is-active { color: #0c45b8; border-color: #b8d9ef; background: white; box-shadow: none; }
.app-view-tab b, .app-view-tab small { display: block; }
.app-view-tab b { font-size: .84rem; }
.app-view-tab small { margin-top: 2px; color: #7890a3; font-size: .62rem; }
.view-tab-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: white; background: linear-gradient(145deg,#25b6f6,#0872e5); font-size: 1rem; font-weight: 900; }
.view-tab-icon.climate { color: #c4432e; background: linear-gradient(145deg,#fff4e9,#ffe2d1); font-size: 1.12rem; }
.view-tab-icon.climate.cooling { color:#176bd9; background:linear-gradient(145deg,#e9f8ff,#d8efff); }
.view-tab-icon.climate.heating { color:#d85828; background:linear-gradient(145deg,#fff5dc,#ffe5b5); }
.view-tab-icon.climate.unknown { color:#71899c; background:linear-gradient(145deg,#f2f6f9,#e7eef3); }
.view-status { width: 8px; height: 8px; border-radius: 50%; background: #22b879; box-shadow: 0 0 0 4px rgba(34,184,121,.12); }
.view-status.offline { background: #d4a44d; box-shadow: 0 0 0 4px rgba(212,164,77,.13); }

/* Danfoss Icon2 klima */
.climate-dashboard { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
.climate-hero, .climate-modes, .climate-zones-card, .climate-info-card { border: 1px solid rgba(255,255,255,.92); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.climate-hero { position: relative; display: grid; grid-template-columns: minmax(280px,1fr) auto auto; align-items: center; gap: 18px; min-height: 88px; overflow: hidden; padding: 13px 20px; box-shadow:none; }
.climate-hero::before { display:none; }
.climate-hero-copy { position: relative; }
.climate-hero h2 { margin: 3px 0 6px; color: #1242b3; font-size: clamp(1.55rem,2.5vw,2.25rem); letter-spacing: -.04em; }
.climate-hero p { margin: 0; color: #668198; font-size: .78rem; }
.climate-summary { position: relative; display: flex; align-items: center; min-width: 285px; gap: 13px; padding: 12px 18px 12px 12px; border: 1px solid #f0d8c7; border-radius: 19px; background: rgba(255,250,246,.9); }
.climate-summary small, .climate-summary b, .climate-summary span { display: block; }
.climate-summary small { color: #a17256; font-size: .57rem; font-weight: 850; letter-spacing: .1em; }
.climate-summary b { margin-top: 2px; color: #9b3c29; font-size: 1.02rem; }
.climate-summary > div > span { margin-top: 3px; color: #856b5d; font-size: .65rem; }
.system-orb { display: grid; place-items: center; width: 54px; height: 54px; flex: 0 0 54px; border-radius: 17px; color: white; background: linear-gradient(145deg,#ff9a55,#df4b31); box-shadow: 0 9px 20px rgba(220,78,47,.22); font-size: 1.7rem; }
.system-orb.cooling { background: linear-gradient(145deg,#39bcf4,#1569dc); box-shadow: 0 9px 20px rgba(24,112,218,.22); }
.system-orb.unknown { color: #607c91; background: #e8f0f5; box-shadow: none; }
.climate-refresh { display: grid; justify-items: center; gap: 2px; min-width: 68px; height: 62px; padding: 7px 10px; border: 1px solid #cde0ed; border-radius: 16px; color: #326184; background: #f7fbfe; cursor: pointer; }
.climate-refresh span { font-size: 1.35rem; line-height: 1; }
.climate-refresh b { font-size: .61rem; }
.climate-refresh:disabled { opacity: .55; cursor: wait; }
.climate-refresh.is-loading span { animation: climate-spin .8s linear infinite; }
@keyframes climate-spin { to { transform: rotate(360deg); } }

.climate-modes, .climate-zones-card { padding: 20px; }
.climate-cloud-note { color: #7890a3; font-size: .66rem; }
.climate-mode-actions { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 9px; }
.climate-mode-actions button { display: grid; grid-template-columns: 37px minmax(0,1fr); align-items: center; column-gap: 9px; min-height: 64px; padding: 8px 10px; border: 1px solid #d7e5ee; border-radius: 16px; color: #295379; background: #fbfdff; text-align: left; cursor: pointer; }
.climate-mode-actions button > span { grid-row: 1 / 3; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; color: #1975c5; background: #eaf7ff; font-size: 1.05rem; }
.climate-mode-actions button b, .climate-mode-actions button small { display: block; }
.climate-mode-actions button b { font-size: .75rem; }
.climate-mode-actions button small { margin-top: 2px; color: #7b91a3; font-size: .57rem; }
.climate-mode-actions button:hover { border-color: #8fc6e8; background: #f2faff; }
.climate-mode-actions button.is-active { border-color: #278dd8; color: #0d4da1; background: #eaf7ff; box-shadow: inset 0 0 0 1px #278dd8; }
.climate-mode-actions button:disabled { opacity: .55; cursor: not-allowed; }

.climate-zone-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.climate-zone { --zone-accent:#ef724d; position: relative; display: grid; gap: 14px; min-width: 0; min-height: 248px; padding: 16px; overflow: hidden; border: 1px solid #e1e9ee; border-radius: 20px; background: linear-gradient(155deg,#fff 0%,#fffbf8 100%); box-shadow: 0 8px 20px rgba(44,72,92,.07); }
.climate-zone::before { content:""; position:absolute; inset:0 0 auto; height:4px; background:var(--zone-accent); }
.climate-zone:nth-child(2) { --zone-accent:#e7a937; }
.climate-zone:nth-child(3) { --zone-accent:#ae77c9; }
.climate-zone:nth-child(4) { --zone-accent:#698ac1; }
.climate-zone:nth-child(5) { --zone-accent:#41a18c; }
.climate-zone-head { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.climate-room-icon { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; color:var(--zone-accent); background:color-mix(in srgb,var(--zone-accent) 12%,white); font-weight:900; }
.zone-state { display:flex; align-items:center; gap:5px; padding:5px 8px; border-radius:999px; color:#607b90; background:#eef4f7; font-size:.58rem; font-weight:800; }
.zone-state i { width:6px; height:6px; border-radius:50%; background:#8aa0b1; }
.zone-state.active { color:#a7442d; background:#fff0e9; }
.zone-state.active i { background:#ee714d; box-shadow:0 0 0 4px rgba(238,113,77,.12); }
.climate-zone-name { margin: -4px 0 0; color:#17449d; font-size:1rem; }
.current-temperature { display:flex; align-items:flex-start; color:#173b63; font-variant-numeric:tabular-nums; }
.current-temperature strong { font-size:clamp(2.1rem,3.2vw,3rem); line-height:.9; letter-spacing:-.07em; }
.current-temperature span { margin:2px 0 0 4px; color:#6c879c; font-size:.92rem; font-weight:750; }
.temperature-caption { margin:-9px 0 0; color:#8196a7; font-size:.61rem; }
.target-control { display:grid; grid-template-columns:44px minmax(62px,1fr) 44px; align-items:center; gap:6px; margin-top:auto; }
.target-control button { width:44px; height:44px; border:1px solid #d3e2eb; border-radius:13px; color:#155ea8; background:#f7fbfe; font-size:1.35rem; cursor:pointer; }
.target-control button:hover { border-color:#7fbce4; background:#eaf7ff; }
.target-control button:disabled { opacity:.45; cursor:not-allowed; }
.target-value { display:grid; place-items:center; min-height:44px; border:1px solid #eadfd8; border-radius:13px; color:#9c462e; background:#fff8f3; }
.target-value small,.target-value b { display:block; }
.target-value small { color:#a78270; font-size:.49rem; font-weight:850; letter-spacing:.08em; }
.target-value b { margin-top:1px; font-size:.86rem; font-variant-numeric:tabular-nums; }
.target-value.is-pending { border-color:#8fc7e9; color:#155ea8; background:#edf8ff; box-shadow:inset 0 0 0 1px rgba(39,141,216,.08); }
.target-value.is-pending small { color:#2377b5; }
.zone-footer { display:flex; justify-content:space-between; gap:8px; padding-top:10px; border-top:1px solid #e8eef2; color:#71899b; font-size:.77rem; }
.zone-footer b { color:#42627a; }
.climate-loading { display:grid; justify-items:center; gap:10px; padding:48px 20px; color:#71899d; }
.climate-loading span { width:28px; height:28px; border:3px solid #d8eaf5; border-top-color:#1689e9; border-radius:50%; animation:climate-spin .8s linear infinite; }
.climate-loading p { margin:0; font-size:.73rem; }
.climate-empty { display:grid; justify-items:center; padding:45px 20px; color:#6d879b; text-align:center; }
.climate-empty > span { display:grid; place-items:center; width:52px; height:52px; border-radius:16px; color:#df633f; background:#fff0e8; font-size:1.6rem; font-weight:850; }
.climate-empty h3 { margin:12px 0 4px; color:#17439b; }
.climate-empty p { margin:0; font-size:.72rem; }
.climate-info-card { display:flex; align-items:flex-start; gap:12px; padding:17px 20px; }
.climate-info-icon { display:grid; place-items:center; width:31px; height:31px; flex:0 0 31px; border-radius:10px; color:#176eb4; background:#e8f6ff; font-weight:900; }
.climate-info-card b { color:#315976; font-size:.76rem; }
.climate-info-card p { margin:3px 0 0; color:#7890a2; font-size:.66rem; line-height:1.45; }

/* Postavke */
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(8, 28, 55, 0.48); backdrop-filter: blur(9px); }
.settings-modal { overflow: hidden; width: min(920px, 100%); max-height: min(880px, calc(100dvh - 36px)); border: 1px solid rgba(255, 255, 255, 0.82); border-radius: 25px; background: #f9fcfe; box-shadow: 0 35px 100px rgba(3, 25, 57, 0.3); }
.settings-modal > header { display: flex; justify-content: space-between; align-items: center; padding: 21px 24px; border-bottom: 1px solid #dce9f2; background: white; }
.settings-modal h2 { font-size: 1.75rem; }
.modal-close { width: 41px; height: 41px; border: 1px solid #d7e5ee; border-radius: 13px; color: #52718a; background: #f7fafc; font-size: 1.55rem; cursor: pointer; }
.settings-modal form { overflow: auto; max-height: calc(100dvh - 132px); padding: 4px 24px 24px; }
.settings-section { padding: 22px 0; border-bottom: 1px solid #dfeaf2; }
.settings-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 15px; }
.settings-number { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; color: #0c72db; background: #e9f6ff; font-size: 0.72rem; font-weight: 900; }
.settings-heading h3 { margin: 0; color: #174596; font-size: 1.04rem; }
.settings-heading p { margin: 3px 0 0; color: #71899d; font-size: 0.75rem; }
.schedule-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; }
.schedule-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; padding: 13px; border: 1px solid #d9e8f2; border-radius: 16px; background: white; }
.schedule-group:last-child { grid-template-columns: repeat(2, 1fr); }
.schedule-group h4 { grid-column: 1 / -1; margin: 0 0 2px; color: #184786; font-size: 0.77rem; }
.schedule-group label { display: grid; gap: 5px; color: #6d8699; font-size: 0.65rem; font-weight: 730; }
.schedule-group input { min-width: 0; width: 100%; height: 41px; padding: 0 8px; border: 1px solid #cfe0ec; border-radius: 10px; color: #174f88; background: #fafdff; font-size: .86rem; font-weight: 740; }
.blind-schedule-list { display: grid; gap: 9px; }
.blind-schedule-row { display: grid; align-items: end; gap: 10px; padding: 11px; border: 1px solid var(--room-line, #d9e8f2); border-radius: 16px; background: linear-gradient(100deg, var(--room-soft, #f3f9fd), #fff 72%); }
.blind-schedule-row.fields-3 { grid-template-columns: minmax(165px, 1.15fr) repeat(3, minmax(132px, 1fr)); }
.blind-schedule-row.fields-2 { grid-template-columns: minmax(165px, 1.15fr) repeat(2, minmax(150px, 1fr)); }
.schedule-blind { display: flex; align-items: center; gap: 10px; min-width: 0; align-self: center; }
.schedule-blind .blind-id { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; background: linear-gradient(145deg, var(--room-accent, #12a8f5), var(--room-dark, #086ce5)); font-size: .74rem; }
.schedule-blind strong, .schedule-blind small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-blind strong { color: var(--room-dark, #174f88); font-size: .86rem; }
.schedule-blind small { margin-top: 3px; color: #7890a3; font-size: .61rem; }
.blind-schedule-row label { display: grid; gap: 5px; min-width: 0; color: #617c91; font-size: .7rem; font-weight: 730; }
.blind-schedule-row input { min-width: 0; width: 100%; height: 43px; padding: 0 10px; border: 1px solid var(--room-line, #cfe0ec); border-radius: 10px; color: var(--room-dark, #174f88); background: rgba(255,255,255,.9); font-size: .86rem; font-weight: 740; }
.duration-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.duration-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 87px; align-items: center; gap: 9px; padding: 8px; border: 1px solid #dce9f2; border-radius: 13px; background: white; }
.duration-row .blind-id { width: 34px; height: 34px; border-radius: 11px; font-size: 0.75rem; }
.duration-row span { min-width: 0; overflow: hidden; color: #315978; font-size: 0.74rem; text-overflow: ellipsis; white-space: nowrap; }
.duration-input { display: flex; align-items: center; gap: 4px; }
.duration-input input { width: 60px; height: 37px; padding: 0 7px; border: 1px solid #cadeeb; border-radius: 9px; color: #174f88; text-align: right; }
.duration-input small { color: #71899d; }
.pin-map { margin: 20px 0 0; border: 1px solid #d8e7f0; border-radius: 16px; background: white; }
.pin-map summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; color: #24537d; list-style: none; cursor: pointer; }
.pin-map summary::-webkit-details-marker { display: none; }
.pin-map summary b, .pin-map summary small { display: block; }
.pin-map summary small { margin-top: 3px; color: #8498a8; font-size: 0.65rem; font-weight: 500; }
.pin-table { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; padding: 4px 16px 14px; }
.pin-row { display: grid; grid-template-columns: minmax(110px, 1.3fr) 1fr 1fr; align-items: center; gap: 6px; padding: 8px 2px; border-top: 1px solid #edf3f7; color: #506d83; font-size: 0.7rem; }
.pin-row b { color: #1350a4; }
.pin-device { min-width: 0; }
.pin-device b, .pin-device small { display: block; }
.pin-device small { overflow: hidden; margin-top: 2px; color: #6e8799; text-overflow: ellipsis; white-space: nowrap; }
.settings-footer { position: sticky; bottom: -24px; display: flex; justify-content: space-between; gap: 10px; margin: 22px -24px -24px; padding: 14px 24px; border-top: 1px solid #dbe8f0; background: rgba(255, 255, 255, 0.96); }
.secondary-button, .save-button { min-height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 790; cursor: pointer; }
.secondary-button { border: 1px solid #d0e0eb; color: #4c708d; background: #f8fbfd; }
.save-button { border: 0; color: white; background: linear-gradient(135deg, #139fea, #0864da); box-shadow: 0 8px 18px rgba(4, 105, 210, 0.2); }

.toast-region { position: fixed; z-index: 40; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100% - 36px)); pointer-events: none; }
.toast { animation: toast-in 220ms ease-out; display: grid; grid-template-columns: 33px 1fr; align-items: center; gap: 9px; min-height: 57px; padding: 10px 13px; border: 1px solid rgba(255, 255, 255, 0.8); border-radius: 15px; color: white; background: rgba(15, 53, 87, 0.94); box-shadow: 0 15px 35px rgba(4, 28, 53, 0.24); backdrop-filter: blur(10px); }
.toast > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: rgba(255, 255, 255, 0.14); }
.toast b, .toast small { display: block; }
.toast b { font-size: 0.78rem; }
.toast small { margin-top: 2px; color: rgba(255, 255, 255, 0.72); font-size: 0.66rem; }
.toast.error { background: rgba(142, 30, 49, 0.95); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Cloud objekti i administracija */
body.modal-open { overflow: hidden; }
.signed-user { display: block; margin-top: 4px; color: #6a8297; font-size: 0.72rem; }
.unit-switcher { display: grid; gap: 3px; min-width: 205px; color: #6c8498; font-size: 0.56rem; font-weight: 850; letter-spacing: 0.11em; }
.unit-switcher select { width: 100%; height: 46px; padding: 0 34px 0 12px; border: 1px solid #d0e2ee; border-radius: 14px; color: #1646a9; background: #f8fcff; font-size: 0.78rem; font-weight: 760; letter-spacing: 0; }
.empty-state { display: grid; justify-items: center; padding: 80px 20px; border: 1px solid rgba(255,255,255,.92); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; color: white; background: linear-gradient(145deg,#29b9fa,#0768df); font-size: 38px; }
.empty-state h2 { margin: 20px 0 7px; color: #123fb5; }
.empty-state p { margin: 0; color: #6c8498; }
.admin-modal { width: min(1080px, 100%); }
.admin-content { overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; max-height: calc(100dvh - 120px); padding: 20px 24px 28px; }
.admin-panel, .device-credentials { padding: 17px; border: 1px solid #d8e7f0; border-radius: 17px; background: white; }
.admin-panel h3, .device-credentials h3 { margin: 0 0 13px; color: #174596; font-size: 1rem; }
.admin-wide, .device-credentials { grid-column: 1 / -1; }
.admin-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.admin-form label, .assignment-form label, .device-credentials label { display: grid; gap: 5px; color: #5e788e; font-size: .69rem; font-weight: 730; }
.admin-form input, .admin-form select, .assignment-form select, .device-credentials input, .device-credentials textarea { width: 100%; min-width: 0; min-height: 42px; padding: 8px 11px; border: 1px solid #cfe0ec; border-radius: 10px; color: #174f88; background: #fafdff; }
.admin-form .save-button { grid-column: 1 / -1; }
.assignment-form { display: grid; grid-template-columns: 1fr 1fr auto auto; align-items: end; gap: 10px; }
.assignment-form .check-label { display: flex; align-items: center; min-height: 42px; white-space: nowrap; }
.assignment-form input[type="checkbox"] { width: 18px; height: 18px; accent-color: #0877ee; }
.admin-heading { display: flex; justify-content: space-between; align-items: center; }
.admin-unit-list { display: grid; gap: 7px; }
.admin-unit-list h4 { margin: 10px 0 2px; color: #6c8498; font-size: .63rem; letter-spacing: .1em; }
.admin-list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 55px; padding: 8px 10px; border: 1px solid #e1ebf2; border-radius: 12px; background: #f9fcfe; }
.admin-list-row b, .admin-list-row small { display: block; }
.admin-list-row b { color: #1748bd; font-size: .8rem; }
.admin-list-row small { margin-top: 3px; color: #71899d; font-size: .66rem; }
.admin-list-row i { color: #4e7696; font-size: .58rem; font-style: normal; font-weight: 850; letter-spacing: .08em; }
.access-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.access-tag { padding: 4px 7px; border: 1px solid #beddf1; border-radius: 999px; color: #1762a8; background: #edf8ff; font-size: .61rem; cursor: pointer; }
.admin-list-row .secondary-button { min-height: 36px; padding: 0 11px; font-size: .67rem; }
.firmware-panel .admin-heading p { margin: 4px 0 0; color: #6f879a; font-size: .72rem; }
.firmware-upload-form { display: grid; grid-template-columns: .8fr 1.25fr 1.7fr auto; gap: 10px; align-items: end; margin-top: 14px; }
.firmware-upload-form label { display: grid; gap: 5px; color: #5e788e; font-size: .69rem; font-weight: 730; }
.firmware-upload-form input { width: 100%; min-width: 0; min-height: 42px; padding: 8px 11px; border: 1px solid #cfe0ec; border-radius: 10px; color: #174f88; background: #fafdff; }
.firmware-upload-form input[type="file"] { padding: 6px; }
.firmware-upload-form .save-button { min-height: 42px; white-space: nowrap; }
.firmware-warning { margin: 10px 0 0; padding: 9px 11px; border: 1px solid #f2d699; border-radius: 10px; color: #805f18; background: #fff9e9; font-size: .68rem; line-height: 1.45; }
.firmware-warning code { color: inherit; font-weight: 800; }
.firmware-release-list, .ota-job-list { display: grid; gap: 7px; margin-top: 12px; }
.firmware-release-row, .ota-job-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 11px; border: 1px solid #e1ebf2; border-radius: 12px; background: #f9fcfe; }
.firmware-release-row b, .firmware-release-row small, .ota-job-row b, .ota-job-row small { display: block; }
.firmware-release-row b, .ota-job-row b { color: #1748bd; font-size: .78rem; }
.firmware-release-row small, .ota-job-row small { margin-top: 3px; color: #71899d; font-size: .65rem; line-height: 1.35; overflow-wrap: anywhere; }
.admin-device-info { min-width: 210px; }
.admin-device-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; flex-wrap: wrap; }
.admin-device-actions select { min-height: 36px; max-width: 190px; padding: 0 9px; border: 1px solid #cfe0ec; border-radius: 9px; color: #174f88; background: #fff; font-size: .67rem; }
.danger-button { color: #b3263a; border-color: #efc6cd; background: #fff7f8; }
.ota-status { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: #2e668d; background: #eaf5fb; font-size: .62rem; font-style: normal; font-weight: 850; }
.ota-installed { color: #087d51; background: #e7f8f1; }
.ota-failed { color: #b3263a; background: #fff0f2; }
.ota-cancelled { color: #687b88; background: #edf2f5; }
.ota-downloading { color: #7154b8; background: #f1ecff; }
.admin-empty { margin: 0; color: #71899d; font-size: .72rem; }
.device-credentials { border-color: #9ad8bf; background: #f3fff9; }
.device-credentials p { margin: -5px 0 13px; color: #587b69; font-size: .72rem; }
.device-credentials textarea { min-height: 72px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .73rem; }
.device-credentials label + label { margin-top: 9px; }
.device-credentials button { margin-top: 11px; }

@media (max-width: 1040px) {
  .dashboard { grid-template-columns: minmax(0, 1.55fr) minmax(315px, 1fr); }
  .floorplan-card { grid-column: 1 / -1; }
  .quick-card { grid-column: 1; }
  .scenes-card { grid-column: 2; }
  .blinds-card { grid-column: 1 / -1; }
  .blind-list { grid-template-columns: repeat(2, 1fr); }
  .climate-zone-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .climate-mode-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100dvh; padding: 34px 22px; background: radial-gradient(circle at 50% 0, #dff4ff, transparent 36%), #f7fbfe; }
  .mobile-logo { display: grid; place-items: center; width: 57px; height: 57px; margin-bottom: 32px; border: 1px solid #d7eafa; border-radius: 18px; background: linear-gradient(145deg, #fff, #edf8ff); box-shadow: 0 10px 25px rgba(7, 115, 222, 0.16); }
  .dashboard { grid-template-columns: 1fr; }
  .floorplan-card, .blinds-card, .quick-card, .scenes-card { grid-column: 1; }
  .floorplan-card { order: 1; }
  .blinds-card { order: 2; }
  .quick-card { order: 3; }
  .scenes-card { order: 4; }
  .schedule-grid { grid-template-columns: 1fr; }
  .blind-schedule-row.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .blind-schedule-row.fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-blind { grid-column: 1 / -1; }
  .climate-hero { grid-template-columns: 1fr auto; }
  .climate-hero-copy { grid-column: 1 / -1; }
  .climate-zone-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 600px) {
  .app-shell { padding: 9px; }
  .topbar { min-height: 74px; grid-template-columns: 1fr; gap: 9px; padding: 11px 12px; border-radius: 18px; }
  .brand { gap: 10px; }
  .brand-logo { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; }
  .brand-logo img { width: 44px; height: 44px; }
  .eyebrow { font-size: 0.58rem; }
  .topbar h1 { font-size: 1.03rem; }
  .topbar-meta { gap: 9px; }
  .connection-pill { width: 12px; min-width: 12px; min-height: 12px; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .connection-pill.device, .connection-pill.offline { background: transparent; }
  .connection-pill span { width: 10px; height: 10px; }
  .connection-pill b { display: none; }
  .time-block { min-width: 68px; padding-left: 11px; }
  .time-block strong { font-size: 1.24rem; }
  .time-block span { display: none; }
  .icon-button { width: 38px; height: 38px; }
  .floorplan-card, .blinds-card, .quick-card, .scenes-card { padding: 12px; border-radius: 18px; }
  .dashboard { gap: 9px; }
  .section-heading h2 { font-size: 1.13rem; }
  .status-pill { display: none; }
  .collapse-button { min-height: 36px; padding-right: 7px; }
  .collapse-button b { display: none; }
  .section-help { font-size: 0.69rem; line-height: 1.35; }
  .floorplan { border-radius: 13px; }
  .blind-list { grid-template-columns: 1fr; }
  .blind-row { grid-template-columns: 40px minmax(44px, 1fr) 66px 52px 52px; gap: 5px; padding: 5px; }
  .blind-row > .blind-id { width: 38px; height: 38px; }
  .blind-row .direction-button { min-width: 52px; min-height: 52px; }
  .blind-position { min-width: 64px; padding: 0 4px; }
  .mini-blind { width: 23px; flex-basis: 23px; }
  .blind-position strong { min-width: 29px; font-size: .68rem; }
  .quick-actions { grid-template-columns: 1fr; }
  .primary-action { min-height: 61px; }
  .scene-actions { grid-template-columns: 1fr; }
  .scene-button { min-height: 58px; }
  .scene-button small { white-space: normal; }
  footer { padding-bottom: 8px; }
  .app-view-tabs { grid-template-columns:repeat(2,1fr); width:100%; margin:0 0 9px; border-radius:16px; }
  .app-view-tab { min-width:0; min-height:38px; grid-template-columns:30px minmax(0,1fr) auto; gap:6px; padding:4px; }
  .view-tab-icon { width:30px; height:30px; border-radius:9px; }
  .app-view-tab small { display:none; }
  .climate-dashboard { gap:9px; }
  .climate-hero,.climate-modes,.climate-zones-card,.climate-info-card { border-radius:18px; }
  .climate-hero { grid-template-columns:1fr auto; gap:10px; min-height:0; padding:16px 13px; }
  .climate-hero h2 { font-size:1.38rem; }
  .climate-hero p { font-size:.68rem; }
  .climate-summary { min-width:0; padding:9px; }
  .system-orb { width:44px; height:44px; flex-basis:44px; border-radius:14px; }
  .climate-summary > div > span { display:none; }
  .climate-refresh { min-width:50px; width:50px; height:52px; padding:5px; }
  .climate-refresh b { display:none; }
  .climate-modes,.climate-zones-card { padding:12px; }
  .climate-cloud-note { display:none; }
  .climate-mode-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .climate-zone-grid { grid-template-columns:1fr; }
  .climate-zone { min-height:0; grid-template-columns:1fr; align-items:center; gap:8px 10px; padding:13px; }
  .climate-zone-head { grid-column:1 / -1; }
  .climate-zone-name { grid-column:1 / -1; }
  .current-temperature { grid-column:1 / -1; }
  .current-temperature strong { font-size:2rem; }
  .temperature-caption { display:none; }
  .target-control { grid-column:1 / -1; margin:0; }
  .zone-footer { grid-column:1 / -1; }
  .modal-backdrop { align-items: end; padding: 0; }
  .settings-modal { max-height: 94dvh; border-radius: 22px 22px 0 0; }
  .settings-modal > header { padding: 17px; }
  .settings-modal form { max-height: calc(94dvh - 75px); padding: 2px 17px 18px; }
  .schedule-group { grid-template-columns: 1fr; }
  .schedule-group:last-child { grid-template-columns: repeat(2, 1fr); }
  .schedule-group h4 { grid-column: 1 / -1; }
  .blind-schedule-row.fields-3, .blind-schedule-row.fields-2 { grid-template-columns: 1fr; }
  .schedule-blind { grid-column: 1; }
  .duration-grid, .pin-table { grid-template-columns: 1fr; }
  .settings-footer { bottom: -18px; margin: 18px -17px -18px; padding: 12px 17px calc(12px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* GEApp klimatizacija 2.4.1 */
.climate-hero { grid-template-columns:minmax(280px,1fr) auto; }
.climate-hero-copy { z-index:1; }
.climate-hero .hvac-relay-control { position:relative; z-index:1; }
.climate-modes.is-collapsed .section-heading { margin-bottom:0; }
.climate-modes-content[hidden] { display:none; }
.climate-modes-content { display:grid; gap:13px; }
.climate-system-row { display:flex; justify-content:flex-end; }
.climate-refresh.compact { display:flex; align-items:center; justify-content:center; min-width:94px; width:auto; height:38px; gap:6px; padding:6px 12px; border-radius:12px; }
.climate-refresh.compact span { font-size:1.05rem; }
.climate-refresh.compact b { font-size:.65rem; }
.hvac-mode-switch { display:grid; justify-items:stretch; min-width:250px; padding:7px; border:1px solid #cbdce8; border-radius:17px; color:#375f7d; background:rgba(245,249,252,.82); box-shadow:0 10px 24px rgba(34,77,111,.10),inset 0 1px rgba(255,255,255,.9); backdrop-filter:blur(18px) saturate(135%); cursor:pointer; transition:transform 180ms,box-shadow 180ms,border-color 180ms; }
.hvac-mode-switch:hover:not(:disabled) { transform:translateY(-1px); border-color:#91b9d3; box-shadow:0 13px 28px rgba(34,77,111,.15),inset 0 1px rgba(255,255,255,.95); }
.hvac-switch-track { position:relative; display:flex; align-items:center; justify-content:flex-end; min-height:42px; padding:0 16px 0 52px; overflow:hidden; border-radius:12px; color:white; background:linear-gradient(135deg,#45bcf0,#1769d7); transition:background 220ms; }
.hvac-switch-track i { position:absolute; left:6px; width:31px; height:31px; border-radius:10px; background:white; box-shadow:0 4px 11px rgba(9,50,94,.24); transition:left 220ms,transform 220ms; }
.hvac-switch-track b { font-size:.78rem; letter-spacing:.06em; }
.hvac-mode-switch.heating .hvac-switch-track { justify-content:flex-start; padding:0 52px 0 16px; background:linear-gradient(135deg,#ff9a4a,#e65331); }
.hvac-mode-switch.heating .hvac-switch-track i { left:calc(100% - 37px); }
.hvac-mode-switch.unknown .hvac-switch-track { justify-content:center; padding:0 12px; background:#8195a5; }
.hvac-mode-switch.unknown .hvac-switch-track i { display:none; }
.hvac-mode-switch:disabled { opacity:.62; cursor:not-allowed; }
.climate-system-status { display:flex; align-items:center; min-width:250px; gap:10px; padding:8px 12px; border:1px solid #d5e3ec; border-radius:15px; background:rgba(248,251,253,.78); box-shadow:inset 0 1px rgba(255,255,255,.9); }
.climate-system-status > span:last-child { display:grid; gap:1px; }
.climate-system-status small { color:#728a9c; font-size:.5rem; font-weight:850; letter-spacing:.1em; }
.climate-system-status b { color:#526d80; font-size:.73rem; }
.climate-system-status em { color:#8196a6; font-size:.55rem; font-style:normal; }
.system-status-icon { display:grid; place-items:center; width:35px; height:35px; flex:0 0 35px; border-radius:11px; color:#5f7687; background:#e7eef3; font-size:1rem; }
.climate-system-status.cooling { border-color:#b9ddf2; background:rgba(237,248,255,.84); }
.climate-system-status.cooling .system-status-icon { color:white; background:linear-gradient(145deg,#3dc1f5,#176bd9); box-shadow:0 7px 15px rgba(23,107,217,.2); }
.climate-system-status.cooling b { color:#1769b6; }
.climate-system-status.heating { border-color:#f1d0bf; background:rgba(255,247,241,.86); }
.climate-system-status.heating .system-status-icon { color:white; background:linear-gradient(145deg,#ffa156,#df5132); box-shadow:0 7px 15px rgba(223,81,50,.2); }
.climate-system-status.heating b { color:#ae482f; }
.admin-row-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.admin-row-actions > i { color:#57728a; font-size:.57rem; font-style:normal; font-weight:850; letter-spacing:.08em; }
.admin-list-row .access-tags { margin-top:6px; }

.climate-zone { min-height:300px; gap:9px; padding:15px; border-color:rgba(203,220,232,.78); background:radial-gradient(circle at 16% 0%,color-mix(in srgb,var(--zone-accent) 10%,transparent),transparent 35%),linear-gradient(145deg,rgba(255,255,255,.94),rgba(244,249,253,.82)); box-shadow:0 16px 34px rgba(41,77,104,.11),inset 0 1px rgba(255,255,255,.95); backdrop-filter:blur(22px) saturate(135%); transition:transform 180ms,box-shadow 180ms,border-color 180ms; }
.climate-zone:hover { transform:translateY(-2px); border-color:color-mix(in srgb,var(--zone-accent) 30%,#cbdce8); box-shadow:0 20px 42px rgba(41,77,104,.16),inset 0 1px rgba(255,255,255,.98); }
.climate-zone::before { height:3px; opacity:.9; }
.climate-zone-head { align-items:center; }
.climate-room-icon { width:auto; min-width:96px; height:38px; padding:0 13px; border:1px solid color-mix(in srgb,var(--zone-accent) 20%,transparent); border-radius:12px; white-space:nowrap; font-size:.76rem; box-shadow:inset 0 1px rgba(255,255,255,.8); }
.thermostat-dial { position:relative; width:min(190px,100%); height:132px; margin:0 auto; }
.thermostat-dial svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.thermostat-dial path { fill:none; stroke-width:8; stroke-linecap:round; }
.dial-track { stroke:#dfe8f0; }
.dial-value { stroke:var(--zone-accent); filter:drop-shadow(0 2px 4px color-mix(in srgb,var(--zone-accent) 30%,transparent)); }
.thermostat-dial .current-temperature { position:absolute; inset:24px 0 auto; display:grid; grid-template-columns:auto auto; justify-content:center; align-items:start; }
.thermostat-dial .current-temperature strong { font-size:2.8rem; line-height:1; }
.thermostat-dial .current-temperature span { margin-top:5px; }
.thermostat-dial .current-temperature small { grid-column:1 / -1; margin-top:7px; color:#8195a5; font-size:.52rem; font-weight:850; letter-spacing:.12em; text-align:center; }
.climate-zone .target-control { margin-top:-3px; }
.climate-zone .target-control button { background:rgba(248,252,255,.84); box-shadow:0 6px 13px rgba(42,76,101,.08),inset 0 1px white; backdrop-filter:blur(10px); transition:transform 150ms,background 150ms,box-shadow 150ms; }
.climate-zone .target-control button:hover:not(:disabled) { transform:translateY(-1px); box-shadow:0 9px 17px rgba(42,76,101,.13),inset 0 1px white; }
.climate-zone .target-value { box-shadow:inset 0 1px rgba(255,255,255,.9); }

html[data-theme="night"] { color-scheme:dark; color:#e7f0fa; background:#081421; --ink:#e7f0fa; --muted:#91a8bb; --line:#263d52; --panel:rgba(15,30,47,.94); --shadow:0 18px 52px rgba(0,0,0,.28); }
html[data-theme="night"] body { background:radial-gradient(circle at 8% 0%,rgba(31,67,101,.48),transparent 32%),radial-gradient(circle at 100% 42%,rgba(21,102,151,.18),transparent 30%),linear-gradient(145deg,#0a1726,#0d2335); }
html[data-theme="night"] .topbar,
html[data-theme="night"] .floorplan-card,
html[data-theme="night"] .blinds-card,
html[data-theme="night"] .quick-card,
html[data-theme="night"] .scenes-card,
html[data-theme="night"] .climate-hero,
html[data-theme="night"] .climate-modes,
html[data-theme="night"] .climate-zones-card,
html[data-theme="night"] .climate-info-card { border-color:#263e53; background:var(--panel); }
html[data-theme="night"] .app-view-tabs { border-color:#29445a; background:rgba(12,27,43,.86); }
html[data-theme="night"] .app-view-tab { color:#9ab1c4; }
html[data-theme="night"] .app-view-tab:hover { color:#dcecff; background:#142c43; }
html[data-theme="night"] .app-view-tab.is-active { color:#80bcff; border-color:#345b79; background:#12283d; box-shadow:none; }
html[data-theme="night"] .brand-copy small,
html[data-theme="night"] .time-block span,
html[data-theme="night"] .climate-hero p,
html[data-theme="night"] .section-help,
html[data-theme="night"] .climate-cloud-note,
html[data-theme="night"] footer { color:#91a9bd; }
html[data-theme="night"] .topbar h1,
html[data-theme="night"] .section-heading h2,
html[data-theme="night"] .climate-hero h2,
html[data-theme="night"] .time-block strong { color:#72b4ff; }
html[data-theme="night"] .unit-switcher select,
html[data-theme="night"] .icon-button,
html[data-theme="night"] .collapse-button,
html[data-theme="night"] .climate-refresh { color:#a8c8e2; border-color:#2c4960; background:#12283b; }
html[data-theme="night"] .connection-pill { border-color:#29475d; background:#12283b; }
html[data-theme="night"] .climate-mode-actions button { color:#b6d0e6; border-color:#29475e; background:#11263a; }
html[data-theme="night"] .climate-mode-actions button:hover,
html[data-theme="night"] .climate-mode-actions button.is-active { color:#83c4ff; border-color:#2e83c5; background:#123551; }
html[data-theme="night"] .climate-mode-actions button small { color:#829aaf; }
html[data-theme="night"] .climate-mode-actions button > span { color:#75beff; background:#183b55; }
html[data-theme="night"] .climate-zone { border-color:#294154; background:radial-gradient(circle at 16% 0%,color-mix(in srgb,var(--zone-accent) 12%,transparent),transparent 35%),linear-gradient(145deg,rgba(20,40,59,.96),rgba(15,33,50,.9)); box-shadow:0 18px 38px rgba(0,0,0,.23),inset 0 1px rgba(255,255,255,.04); }
html[data-theme="night"] .climate-room-icon { background:color-mix(in srgb,var(--zone-accent) 18%,#14283b); }
html[data-theme="night"] .dial-track { stroke:#294154; }
html[data-theme="night"] .current-temperature { color:#eaf5ff; }
html[data-theme="night"] .target-control button { color:#8bc6ff; border-color:#31516a; background:#142c41; }
html[data-theme="night"] .target-value { color:#ff9d78; border-color:#68483c; background:#30251f; }
html[data-theme="night"] .target-value small { color:#bd8b78; }
html[data-theme="night"] .target-value.is-pending { color:#82c7ff; border-color:#2f6f9d; background:#12334d; }
html[data-theme="night"] .target-value.is-pending small { color:#75baf0; }
html[data-theme="night"] .zone-footer { border-color:#294154; color:#8da5b8; }
html[data-theme="night"] .hvac-mode-switch { border-color:#2b475d; background:#102437; }
html[data-theme="night"] .climate-system-status { border-color:#2b475d; background:rgba(16,36,55,.82); box-shadow:inset 0 1px rgba(255,255,255,.04); }
html[data-theme="night"] .climate-system-status small,
html[data-theme="night"] .climate-system-status em { color:#829caf; }
html[data-theme="night"] .climate-system-status.unknown b { color:#aac1d2; }
html[data-theme="night"] .system-status-icon { color:#a9bfd0; background:#1b3448; }
html[data-theme="night"] .climate-system-status.cooling { border-color:#28587a; background:rgba(16,45,67,.88); }
html[data-theme="night"] .climate-system-status.heating { border-color:#674538; background:rgba(49,35,29,.88); }
html[data-theme="night"] .blind-row,
html[data-theme="night"] .sync-action,
html[data-theme="night"] .scene-button,
html[data-theme="night"] .next-event { color:#b5cee2; border-color:#29465c; background:#11273a; }
html[data-theme="night"] .blind-row.room-tone { border-color:color-mix(in srgb,var(--room-accent) 42%,#29465c); background:linear-gradient(100deg,color-mix(in srgb,var(--room-accent) 12%,#11273a),#11273a 78%); }
html[data-theme="night"] .blind-position,
html[data-theme="night"] .blind-countdown { color:#a9c9e2; border-color:#36556d; background:#152d42; box-shadow:none; }
html[data-theme="night"] .direction-button { border-color:#31516b; color:#88c5ff; background:linear-gradient(150deg,#17334a,#10263a); box-shadow:none; }
html[data-theme="night"] .room-tone .direction-button { color:color-mix(in srgb,var(--room-accent) 70%,white); border-color:color-mix(in srgb,var(--room-accent) 38%,#29465c); background:linear-gradient(150deg,#17334a,#10263a); }
html[data-theme="night"] .blind-status,
html[data-theme="night"] .control-legend,
html[data-theme="night"] .scene-button small,
html[data-theme="night"] .sync-action small,
html[data-theme="night"] .next-event small { color:#849db1; }
html[data-theme="night"] .next-event b,
html[data-theme="night"] .sync-action b { color:#b8d5ea; }
html[data-theme="night"] .floorplan { border-color:#29465b; background:#102335; }
html[data-theme="night"] .plan-temperature { color:color-mix(in srgb,var(--temperature-accent) 68%,white); border-color:color-mix(in srgb,var(--temperature-accent) 42%,#29465b); background:rgba(12,31,46,.9); box-shadow:0 6px 15px rgba(0,0,0,.28),inset 0 1px rgba(255,255,255,.05); }
html[data-theme="night"] .plan-temperature.is-unavailable { color:#8199aa; border-color:#345066; background:rgba(17,39,57,.9); }
html[data-theme="night"] .settings-modal,
html[data-theme="night"] .admin-modal { color:#dceaf5; border-color:#2a455b; background:#0e2132; }
html[data-theme="night"] .settings-modal > header,
html[data-theme="night"] .admin-modal > header { border-color:#29465b; background:#12283b; }
html[data-theme="night"] input,
html[data-theme="night"] select,
html[data-theme="night"] textarea { color:#e1edf7; border-color:#315068; background:#132b40; }
html[data-theme="night"] .auth-screen,
html[data-theme="night"] .auth-panel { background:radial-gradient(circle at 50% 0,#173d59,transparent 38%),#0b1b2a; }
html[data-theme="night"] .auth-card h2 { color:#72b4ff; }
html[data-theme="night"] .auth-card > small { color:#829caf; }
html[data-theme="night"] .schedule-group,
html[data-theme="night"] .duration-row,
html[data-theme="night"] .pin-map,
html[data-theme="night"] .admin-panel,
html[data-theme="night"] .device-credentials { border-color:#29465b; background:#12283b; }
html[data-theme="night"] .settings-section { border-color:#29465b; }

@media (max-width:700px) {
  .climate-hero { grid-template-columns:1fr auto; }
  .climate-modes .section-heading { align-items:center; }
  .climate-modes .heading-actions { margin-left:auto; }
  .climate-system-row { justify-content:stretch; }
  .hvac-mode-switch,.climate-system-status { width:100%; min-width:0; }
  .climate-zone { min-height:286px; }
  .climate-zone-head { grid-column:1 / -1; }
  .thermostat-dial { grid-column:1 / -1; }
  .target-control,.zone-footer { grid-column:1 / -1; }
}

@media (max-width:600px) {
  .climate-hero { grid-template-columns:1fr; }
  .climate-hero .hvac-relay-control { grid-column:1 / -1; min-width:0; width:100%; }
  .climate-modes .section-heading { align-items:flex-start; }
  .climate-modes .heading-actions { flex-wrap:wrap; justify-content:flex-end; gap:6px; }
  .climate-refresh.compact { min-width:39px; width:39px; height:37px; padding:5px; }
  .climate-refresh.compact b { display:none; }
  .climate-system-status { padding:7px 9px; }
}

@media (max-width: 920px) {
  .topbar { grid-template-columns: 1fr; gap: 12px; }
  .topbar-meta { width: 100%; min-height: 46px; justify-content: flex-end; padding-top: 10px; border-top: 1px solid #dfebf4; }
  .unit-switcher { margin-right: auto; }
}

@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 10px 11px; }
  .topbar-meta { display: flex; min-height: 40px; gap: 7px; padding-top: 8px; }
  .unit-switcher { min-width: 0; flex: 1; }
  .unit-switcher span, .signed-user { display: none; }
  .unit-switcher select { height: 38px; padding-left: 9px; font-size: .7rem; }
  .time-block { min-width: 0; height: 40px; min-height: 40px; padding-left: 6px; }
  .icon-button { width: 40px; height: 40px; flex-basis: 40px; }
  .admin-content { grid-template-columns: 1fr; max-height: calc(94dvh - 75px); padding: 14px 17px 22px; }
  .admin-wide, .device-credentials { grid-column: 1; }
  .admin-form, .assignment-form { grid-template-columns: 1fr; }
  .firmware-upload-form { grid-template-columns: 1fr; }
  .firmware-upload-form .save-button { width: 100%; }
  .admin-device-row { align-items: stretch; flex-direction: column; }
  .admin-device-actions { justify-content: stretch; }
  .admin-device-actions select, .admin-device-actions button { flex: 1 1 145px; max-width: none; }
  .admin-form .save-button { grid-column: 1; }
  .assignment-form .check-label { min-height: 32px; }
}
