/* SmartHome – Smart Life inspired dashboard. Mobile first, light + dark. */

:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f6f7fa;
  --surface-3: #eaedf3;
  --text: #151922;
  --text-2: #464e5f;
  --muted: #5f6779;      /* ≥ 4.5:1 on every light surface (WCAG AA) */
  --line: #e3e6ed;
  --accent: #1d4ed8;
  --accent-strong: #1e40af;
  --accent-soft: #e5edff;
  --on-accent: #ffffff;
  --ok: #11793d;
  --ok-soft: #e1f5e8;
  --warn: #9a5200;
  --warn-soft: #fff1db;
  --alarm: #c81e1e;
  --alarm-soft: #fde7e7;
  --overlay: rgba(12, 16, 24, .42);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, .22);
  --radius: 18px;
  --radius-sm: 12px;
  --tabbar-h: 62px;
  --c-blue: #2563eb; --c-orange: #ea6a12; --c-red: #e0473c; --c-amber: #d99a00; --c-teal: #0d9a95;
  --c-green: #1c9a50; --c-violet: #7b4fd8; --c-slate: #5a6476; --c-yellow: #cf9d00; --c-indigo: #4f5bd5;
  --c-pink: #d43f88;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1117; --surface: #171b23; --surface-2: #1d222c; --surface-3: #262c38; --text: #ebeef4;
    --text-2: #c3c9d5; --muted: #8e97a8; --line: #2a303c; --accent: #5b8cff; --accent-strong: #7aa2ff;
    --accent-soft: #1c2945; --ok: #3ccf7c; --ok-soft: #12301f; --warn: #f2a23a; --warn-soft: #36270f;
    --alarm: #ff5c5c; --alarm-soft: #3a1618; --overlay: rgba(0, 0, 0, .6);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
    --c-blue: #5b8cff; --c-orange: #ff8a3d; --c-red: #ff6b5e; --c-amber: #f5bb2c; --c-teal: #2cc7c0;
    --c-green: #3ccf7c; --c-violet: #a07cff; --c-slate: #95a0b4; --c-yellow: #f5c518; --c-indigo: #8792ff;
    --c-pink: #ff6fb1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1117; --surface: #171b23; --surface-2: #1d222c; --surface-3: #262c38; --text: #ebeef4;
  --text-2: #c3c9d5; --muted: #8e97a8; --line: #2a303c; --accent: #5b8cff; --accent-strong: #7aa2ff;
  --accent-soft: #1c2945; --ok: #3ccf7c; --ok-soft: #12301f; --warn: #f2a23a; --warn-soft: #36270f;
  --alarm: #ff5c5c; --alarm-soft: #3a1618; --overlay: rgba(0, 0, 0, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .25); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .6);
  --c-blue: #5b8cff; --c-orange: #ff8a3d; --c-red: #ff6b5e; --c-amber: #f5bb2c; --c-teal: #2cc7c0;
  --c-green: #3ccf7c; --c-violet: #a07cff; --c-slate: #95a0b4; --c-yellow: #f5c518; --c-indigo: #8792ff;
  --c-pink: #ff6fb1;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 30px; height: 30px; }
.muted { color: var(--muted); }
.mt { margin-top: 10px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ layout */
.app { min-height: 100vh; }
.main { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px); }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar-titles { flex: 1; min-width: 0; }
.topbar h1 { font-size: 23px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub:empty { display: none; }
.topbar-actions { display: flex; gap: 6px; }
.view { padding: 4px 16px 24px; max-width: 1180px; margin: 0 auto; outline: none; }
.demo-ribbon { margin: 0 16px 8px; padding: 6px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn);
               font-size: 12.5px; font-weight: 600; text-align: center; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
            color: var(--muted); font-size: 11px; font-weight: 600; }
.tabbar a.active { color: var(--accent); }
.tabbar .ic { width: 24px; height: 24px; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  .tabbar { display: none; }
  .main { padding-bottom: 32px; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px;
    background: var(--surface); border-right: 1px solid var(--line);
  }
  .topbar { padding: 22px 28px 12px; }
  .view { padding: 4px 28px 32px; }
  .demo-ribbon { margin: 0 28px 10px; }
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: #fff;
              background: linear-gradient(135deg, #3b82f6, #6366f1); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2);
              font-weight: 600; }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.side-user .avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3);
                     font-weight: 700; color: var(--text-2); }

/* ------------------------------------------------------------ buttons + inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
       border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface-3); color: var(--text);
       font-weight: 650; font-size: 14.5px; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--alarm-soft); color: var(--alarm); }
.btn-outline { background: transparent; border-color: var(--line); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0;
            background: var(--surface); color: var(--text-2); box-shadow: var(--shadow); flex: none; }
.icon-btn.flat { box-shadow: none; background: transparent; }
.icon-btn:hover { color: var(--accent); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field small, .field-help { color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=url], input[type=search],
input[type=email], input:not([type]),
select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .grid-2.stack-sm { grid-template-columns: 1fr; } }

.switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: var(--surface-3); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
                      background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.check-list { display: grid; margin: 4px 0 12px; }
/* device plans */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-head h3 { margin: 0; }
.plan-now { margin: 6px 0 10px; font-weight: 650; }
.plan-rows { display: grid; gap: 2px; border-radius: 14px; background: var(--surface-2); padding: 6px 14px; }
.plan-rows.off { opacity: .6; }
.plan-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: baseline; padding: 6px 0; }
.plan-row + .plan-row { border-top: 1px solid var(--line); }
.plan-time { font-weight: 750; font-variant-numeric: tabular-nums; }
.plan-days { color: var(--muted); font-size: 13.5px; }
.plan-last { margin-top: 8px; font-size: 13px; }
.plan-edit-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-edit-main { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plan-edit-main input[type=time] { width: 116px; }
.plan-edit-main select, .plan-num { flex: 1; min-width: 0; }
.plan-num { display: flex; align-items: center; gap: 8px; }
.plan-num input { width: 100%; min-width: 0; }
.plan-num small { color: var(--muted); white-space: nowrap; }
.plan-days-pick button { width: 36px; height: 36px; }
#plan-rows + .btn { margin-top: 12px; }
.plan-list-row .row-sub + .row-sub { color: var(--text); }
.ctl-row .btn-row { align-items: center; flex-wrap: nowrap; }
.inv-state.warn { color: var(--warn); font-weight: 650; }
.inv-state.alarm { color: var(--alarm); font-weight: 650; }
.check-list .check { margin-bottom: 10px; }
.check-list[hidden] { display: none; }

.seg { display: flex; gap: 3px; padding: 3px; border-radius: 13px; background: var(--surface-3); overflow-x: auto; }
.seg button { flex: 1; min-width: max-content; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent;
              color: var(--text-2); font-weight: 600; font-size: 13.5px; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; margin: 0; }
input[type=range].ct { -webkit-appearance: none; appearance: none; background: transparent; }
input[type=range].ct::-webkit-slider-runnable-track { height: 10px; border-radius: 10px;
  background: linear-gradient(90deg, #ffb35c, #fff3e0 50%, #cfe3ff); }
input[type=range].ct::-moz-range-track { height: 10px; border-radius: 10px; background: linear-gradient(90deg, #ffb35c, #fff3e0 50%, #cfe3ff); }
input[type=range].ct::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 2px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.range-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.range-head strong { font-size: 15px; }

/* ------------------------------------------------------------ sections + cards */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 2px 10px; }
.section-head h2 { font-size: 16.5px; font-weight: 720; letter-spacing: -.01em; }
.section-head .count { color: var(--muted); font-weight: 600; font-size: 13px; margin-left: 6px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 15.5px; margin-bottom: 6px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .ic { width: 40px; height: 40px; margin-bottom: 8px; opacity: .6; }
.empty p { margin: 0 0 16px; }
.btn-row.center { justify-content: center; flex-wrap: wrap; }
.adopt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adopt-head .link-btn { font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.adopt-rooms { margin: 4px 0 10px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px 0; color: var(--muted); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--surface-3); border-top-color: var(--accent);
           animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 6px; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .chips { margin: 0; padding: 4px 0 6px; flex-wrap: wrap; } }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 36px;
        border: 0; background: var(--surface); color: var(--text-2); font-weight: 620; font-size: 14px; box-shadow: var(--shadow); }
.chip.active { background: var(--text); color: var(--bg); }
.chip .ic { width: 17px; height: 17px; }
.chip-count { opacity: .6; font-weight: 600; font-size: 12.5px; }

/* summary strip */
.summary { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(148px, 1fr); gap: 10px; overflow-x: auto;
           scrollbar-width: none; margin: 4px -16px 0; padding: 4px 16px 8px; }
.summary::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .summary { margin: 4px 0 0; padding: 4px 0 8px; grid-auto-flow: row;
                            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
.sum { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface);
       box-shadow: var(--shadow); min-width: 0; text-align: left; border: 0; }
.sum-top { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.sum-top .ic { width: 18px; height: 18px; color: var(--kc, var(--accent)); }
.sum-value { font-size: 20px; font-weight: 720; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum.warn { background: var(--warn-soft); } .sum.warn .sum-value { color: var(--warn); }
.sum.alarm { background: var(--alarm-soft); } .sum.alarm .sum-value { color: var(--alarm); }

/* kind colours */
.k-blue { --kc: var(--c-blue); } .k-orange { --kc: var(--c-orange); } .k-red { --kc: var(--c-red); }
.k-amber { --kc: var(--c-amber); } .k-teal { --kc: var(--c-teal); } .k-green { --kc: var(--c-green); }
.k-violet { --kc: var(--c-violet); } .k-slate { --kc: var(--c-slate); } .k-yellow { --kc: var(--c-yellow); }
.k-indigo { --kc: var(--c-indigo); } .k-pink { --kc: var(--c-pink); }

/* ------------------------------------------------------------ device tiles */
/* Tile grid: columns follow the width of the content area (container queries).
   A column is a quarter of a phone width, a row 56 px; grid.js places every
   tile on its cell (XS 1×1, S 2×1, M 2×2, L 4×2, XL 4×4). */
.view { container-type: inline-size; }
.grid { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: 56px;
        grid-auto-flow: row dense; gap: 12px; }
@container (min-width: 540px) { .grid { --cols: 6; } }
@container (min-width: 720px) { .grid { --cols: 8; } }
@container (min-width: 940px) { .grid { --cols: 10; } }
@container (min-width: 1140px) { .grid { --cols: 12; } }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 0;
  grid-column: span 2; grid-row: span 2;
  padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s, background .2s, box-shadow .2s; text-align: left; border: 0; min-width: 0; user-select: none;
}
.tile:active { transform: scale(.975); }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tile-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--kc);
             background: color-mix(in srgb, var(--kc) 13%, transparent); transition: background .2s, color .2s; }
.tile-power { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0;
              background: var(--surface-3); color: var(--muted); transition: background .2s, color .2s, transform .1s; }
.tile-power:active { transform: scale(.9); }
.tile-power .ic { width: 19px; height: 19px; stroke-width: 2.2; }
.tile-body { min-width: 0; }
.tile-name { font-weight: 650; font-size: 14.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2;
             -webkit-box-orient: vertical; overflow: hidden; }
.tile-status { margin-top: 3px; color: var(--muted); font-size: 12.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-badges { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.tile-badge { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); }
.tile-badge .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.tile.is-on { background: color-mix(in srgb, var(--kc) 9%, var(--surface)); }
.tile.is-on .tile-icon { background: var(--kc); color: #fff; }
.tile.is-on .tile-power { background: var(--kc); color: #fff; }
.tile.is-on .tile-status { color: var(--text-2); }
.tile.is-open .tile-status { color: var(--c-violet); font-weight: 650; }
.tile.is-warn .tile-status { color: var(--warn); font-weight: 700; }
.tile.is-warn .tile-icon { background: var(--warn-soft); color: var(--warn); }
.tile.is-offline .tile-status { color: var(--warn); font-weight: 600; }
.tile.is-unpaired { box-shadow: none; background: transparent; border: 1.5px dashed var(--line); }
.tile.is-unpaired .tile-icon { filter: grayscale(1); opacity: .65; }
.tile.is-unpaired .tile-status { font-style: italic; }
.tile.is-alarm { background: var(--alarm-soft); animation: pulse 1.4s ease-in-out infinite; }
.tile.is-alarm .tile-icon { background: var(--alarm); color: #fff; }
.tile.is-alarm .tile-status { color: var(--alarm); font-weight: 750; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--alarm) 25%, transparent); } }
.tile-camera { padding: 0; overflow: hidden; background: #1a1f29; color: #fff; }
.tile-camera img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-camera .tile-overlay { position: relative; margin-top: auto; padding: 30px 14px 12px; display: flex; align-items: center; gap: 10px;
                             background: linear-gradient(180deg, transparent, rgba(0,0,0,.72)); }
.tile-camera .tile-status { color: rgba(255,255,255,.8); }
.tile-camera .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ccf7c; flex: none; }
.tile-camera.is-offline .live-dot { background: #f2a23a; }
.tile-camera .tile-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.35); }
.tile-camera .tile-placeholder .ic { width: 46px; height: 46px; }

/* scenes */
.scene-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 10px; overflow-x: auto;
               scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 8px; }
.scene-strip::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .scene-strip { margin: 0; padding: 4px 0 8px; grid-auto-flow: row;
                            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); } }
.scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .scene-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.scene {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 96px; padding: 14px;
  border-radius: var(--radius); border: 0; color: #fff; text-align: left; overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--g1), var(--g2)); transition: transform .12s, filter .15s;
}
.scene:active { transform: scale(.97); }
.scene.running { filter: brightness(1.15); }
.scene .ic { width: 26px; height: 26px; }
.scene-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.scene-meta { font-size: 12px; opacity: .85; margin-top: 2px; }
.scene-edit { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid;
              place-items: center; background: rgba(255,255,255,.2); color: #fff; }
.scene-edit .ic { width: 16px; height: 16px; }
.scene-add { background: transparent; color: var(--muted); border: 1.5px dashed var(--line); box-shadow: none; align-items: center;
             justify-content: center; flex-direction: row; }
.sc-blue { --g1: #3b82f6; --g2: #4f46e5; } .sc-orange { --g1: #f59e0b; --g2: #ea580c; } .sc-green { --g1: #22c55e; --g2: #0d9488; }
.sc-violet { --g1: #a855f7; --g2: #6d28d9; } .sc-red { --g1: #f97316; --g2: #dc2626; } .sc-teal { --g1: #14b8a6; --g2: #0e7490; }
.sc-pink { --g1: #ec4899; --g2: #be185d; } .sc-slate { --g1: #64748b; --g2: #334155; } .sc-amber { --g1: #fbbf24; --g2: #d97706; }
.sc-indigo { --g1: #6366f1; --g2: #312e81; }

/* automations */
.auto-list { display: flex; flex-direction: column; gap: 12px; }
.auto-card { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
             box-shadow: var(--shadow); cursor: pointer; }
.auto-card.disabled .auto-main { opacity: .55; }
.auto-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
             background: var(--accent-soft); color: var(--accent); }
.auto-main { flex: 1; min-width: 0; }
.auto-title { font-weight: 680; font-size: 15px; }
.auto-desc { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.auto-desc b { display: inline-block; min-width: 42px; color: var(--muted); font-weight: 650; font-size: 11.5px; text-transform: uppercase;
               letter-spacing: .04em; }
.auto-last { margin-top: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* lists / rows */
.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); min-height: 58px;
       color: var(--text); background: transparent; width: 100%; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.row:last-child { border-bottom: 0; }
button.row:hover, a.row:hover { background: var(--surface-2); }
.dev-row { padding: 0 16px 0 0; }
.dev-row .row-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 13px 0 13px 16px; border: 0; background: transparent;
                     color: var(--text); text-align: left; cursor: pointer; }
.dev-row .row-open:hover { background: var(--surface-2); }
.dev-row.is-off .row-open { opacity: .55; }
.dev-pick { margin: 0 0 0 16px; }
.dev-tools { margin-bottom: 12px; }
.dev-tools > .btn { flex: 0 0 auto; }
.row-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; flex: none; color: var(--kc, var(--accent));
            background: color-mix(in srgb, var(--kc, var(--accent)) 13%, transparent); }
.row-icon .ic { width: 20px; height: 20px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { display: flex; align-items: center; gap: 8px; color: var(--muted); flex: none; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 22px; font-size: 11.5px; font-weight: 700;
         background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.alarm { background: var(--alarm-soft); color: var(--alarm); }
.badge.info { background: var(--accent-soft); color: var(--accent); }

/* events */
.day-head { margin: 18px 4px 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ev { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--surface-3);
           color: var(--text-2); }
.ev-icon .ic { width: 17px; height: 17px; }
.ev.warning .ev-icon { background: var(--warn-soft); color: var(--warn); }
.ev.alarm .ev-icon { background: var(--alarm-soft); color: var(--alarm); }
.ev-main { flex: 1; min-width: 0; }
.ev-msg { font-size: 14px; overflow-wrap: anywhere; }
.ev-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ev-time { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: none; }

/* alarm banner */
.alarm-banner { position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 19; margin: 0 16px 10px; padding: 12px 14px;
                border-radius: 16px; background: #c81e1e; color: #fff; display: flex; align-items: center; gap: 12px;  /* same deep red in both themes: white text stays readable */
                box-shadow: 0 10px 30px color-mix(in srgb, var(--alarm) 35%, transparent); }
@media (min-width: 960px) { .alarm-banner { margin: 0 28px 12px; top: 78px; } }
.alarm-banner .pulse-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.alarm-banner .alarm-text { flex: 1; min-width: 0; font-weight: 650; }
.alarm-banner .alarm-text small { display: block; font-weight: 500; opacity: .85; }
.alarm-banner .btn { background: #fff; color: #b91c1c; font-weight: 750; }

/* ------------------------------------------------------------ sheet (device detail, editors) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: var(--overlay); opacity: 0; transition: opacity .25s; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(104%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom);
}
.sheet.open { transform: translateY(0); }
.sheet.tall { height: 94dvh; max-height: 94dvh; }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; width: min(560px, 92vw); max-height: 88vh; border-radius: 24px;
           transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .22s, opacity .22s; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet.wide { width: min(780px, 94vw); }
  .sheet.tall { height: auto; max-height: 90vh; }
}
.sheet-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sheet-handle { width: 40px; height: 5px; border-radius: 5px; background: var(--surface-3); margin: 8px auto 0; flex: none; }
@media (min-width: 760px) { .sheet-handle { display: none; } }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head .tile-icon { width: 44px; height: 44px; }
.sheet-titles { flex: 1; min-width: 0; }
.sheet-titles h2 { font-size: 17.5px; font-weight: 720; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.sheet-titles p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { padding: 18px 20px 24px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); flex: none; flex-wrap: wrap; }
.sheet-foot .spacer { flex: 1; }
@media (max-width: 479px) { .sheet-foot .hide-sm { display: none; } .sheet-foot { gap: 8px; padding: 10px 16px; } }
.sheet-section { margin-top: 22px; }
.sheet-section > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }

.hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 4px; text-align: center; }
.hero-state { font-size: 15px; font-weight: 650; color: var(--text-2); }
.hero-big { font-size: 44px; font-weight: 760; letter-spacing: -.03em; line-height: 1; }
.hero-big small { font-size: 20px; font-weight: 650; color: var(--muted); margin-left: 2px; }
.power-btn { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--surface-3);
             color: var(--muted); transition: background .2s, color .2s, box-shadow .2s, transform .1s; }
.power-btn:active { transform: scale(.95); }
.power-btn .ic { width: 40px; height: 40px; stroke-width: 2.2; }
.power-btn.on { background: var(--kc, var(--accent)); color: #fff; box-shadow: 0 10px 28px color-mix(in srgb, var(--kc, var(--accent)) 45%, transparent); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 30px; font-weight: 700; font-size: 16px;
               background: var(--surface-3); }
.status-pill.ok { background: var(--ok-soft); color: var(--ok); }
.status-pill.alarm { background: var(--alarm); color: #fff; animation: pulse 1.4s infinite; }
.status-pill.open { background: color-mix(in srgb, var(--c-violet) 14%, transparent); color: var(--c-violet); }
.status-pill.warn { background: var(--warn-soft); color: var(--warn); }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 2px 0 10px; }
.pills:empty { display: none; }
.big-icon { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; color: var(--kc);
            background: color-mix(in srgb, var(--kc) 13%, transparent); }
.big-icon .ic { width: 46px; height: 46px; stroke-width: 1.6; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.metric { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.metric-label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.metric-value { font-size: 22px; font-weight: 720; letter-spacing: -.01em; white-space: nowrap; }
.metric-value small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.metric.good .metric-value { color: var(--ok); } .metric.fair .metric-value { color: var(--warn); } .metric.bad .metric-value { color: var(--alarm); }
.q-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.ctl { margin-top: 18px; }
.ctl-label { font-size: 13px; font-weight: 650; color: var(--text-2); margin-bottom: 8px; }
.ctl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ctl-row:last-child { border-bottom: 0; }

/* thermostat */
.dial-wrap { position: relative; width: 236px; height: 236px; margin: 0 auto; }
.dial-wrap svg { width: 100%; height: 100%; }
.dial-track { fill: none; stroke: var(--surface-3); stroke-width: 16; stroke-linecap: round; }
.dial-value { fill: none; stroke: var(--c-orange); stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset .3s; }
.dial-current { fill: var(--surface); stroke: var(--text-2); stroke-width: 3; }
.dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.dial-center .t-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.dial-center .t-target { font-size: 48px; font-weight: 760; letter-spacing: -.03em; line-height: 1; }
.dial-center .t-target small { font-size: 20px; color: var(--muted); }
.dial-center .t-now { font-size: 13px; color: var(--text-2); }
.heat-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--c-orange); font-weight: 700; font-size: 12.5px; }
.heat-flag .ic { width: 15px; height: 15px; }
.dial.off .dial-value { stroke: var(--muted); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 6px; }
.stepper .icon-btn { width: 56px; height: 56px; }
.stepper .icon-btn .ic { width: 26px; height: 26px; stroke-width: 2.2; }

/* camera */
.cam { position: relative; border-radius: 16px; overflow: hidden; background: #0d1015; aspect-ratio: 16 / 9; }
.cam img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
           color: rgba(255,255,255,.7); font-size: 13.5px; text-align: center; padding: 16px; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 18px 12px 10px; color: #fff;
           font-size: 12.5px; font-weight: 650; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent); pointer-events: none; }
.cam-bar .rec { width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; animation: blink 1.2s infinite; }
.cam-tools { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.ptz { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(3, 52px); gap: 6px; justify-content: center; margin-top: 16px; }
.ptz button { border: 0; border-radius: 14px; background: var(--surface-3); color: var(--text); display: grid; place-items: center; }
.ptz button:active { background: var(--accent); color: #fff; }
.ptz .up { grid-column: 2; grid-row: 1; } .ptz .left { grid-column: 1; grid-row: 2; } .ptz .right { grid-column: 3; grid-row: 2; }
.ptz .down { grid-column: 2; grid-row: 3; } .ptz .mid { grid-column: 2; grid-row: 2; background: transparent; color: var(--muted); }
.cam-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .cam-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.cam-card { border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.cam-card .cam { border-radius: 0; }
.cam-card-foot { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 190px; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 10.5px; }
.chart .line { fill: none; stroke: var(--kc, var(--accent)); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--kc, var(--accent)); opacity: .12; }
.chart .dot { fill: var(--kc, var(--accent)); }
.mc-c0 { --kc: var(--c-blue); } .mc-c1 { --kc: var(--c-orange); } .mc-c2 { --kc: var(--c-green); } .mc-c3 { --kc: var(--c-violet); }
.mc-c4 { --kc: var(--c-teal); } .mc-c5 { --kc: var(--c-red); } .mc-c6 { --kc: var(--c-amber); } .mc-c7 { --kc: var(--c-indigo); }
.chart .mline { fill: none; stroke: var(--kc); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .mline.dashed { stroke-width: 1.6; stroke-dasharray: 5 4; opacity: .8; }
.chart .mdot { fill: var(--kc); stroke: var(--surface); stroke-width: 1.5; }
.chart .cursor { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip-multi { top: -4px; text-align: left; white-space: nowrap; line-height: 1.5; padding: 6px 10px; }
.tip-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.tip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--kc); flex: none; }
.temp-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.temp-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
             background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.temp-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--kc); }
.temp-chip.off { opacity: .45; } .temp-chip.off i { background: transparent; box-shadow: inset 0 0 0 2px var(--kc); }
.temp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.temp-table th, .temp-table td { padding: 9px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.temp-table th:first-child, .temp-table td:first-child { text-align: left; }
.temp-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.temp-table .tip-dot { display: inline-block; margin-right: 8px; }
.chart-empty { display: grid; place-items: center; height: 150px; color: var(--muted); font-size: 13.5px; background: var(--surface-2); border-radius: 14px; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); padding: 4px 8px; border-radius: 8px; background: var(--text); color: var(--bg);
             font-size: 12px; font-weight: 650; pointer-events: none; white-space: nowrap; }
.chart-tools { display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }

/* info table */
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
pre.raw { margin: 0; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 12px; overflow-x: auto; max-height: 260px; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--text-2); font-size: 13.5px; }
.note.warn { background: var(--warn-soft); }
.note.alarm { background: var(--alarm-soft); }
.note + .note { margin-top: 8px; }

/* builders (scene/automation editors) */
.builder { display: flex; flex-direction: column; gap: 10px; }
.builder-item { position: relative; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.builder-item[data-join] { margin-top: 14px; }
.builder-item[data-join]::before { content: attr(data-join); position: absolute; left: 50%; top: -20px; transform: translateX(-50%);
  padding: 1px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 750;
  letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.auto-sentence { padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: var(--accent-soft); color: var(--text);
  font-size: 14.5px; line-height: 1.45; }
.auto-sentence b { color: var(--accent); }
.match-seg { display: inline-flex; }
.match-seg button { height: 32px; font-size: 12.5px; }
.group-hint { margin: -4px 0 10px; font-size: 12.5px; }
.tpl-chips { margin-top: 2px; }
.tpl-chips .chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.builder-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.builder-head select { flex: 1; }
.builder-head .icon-btn { width: 36px; height: 36px; box-shadow: none; background: var(--surface); }
.builder-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 10px; }
.builder-fields .field { margin-bottom: 8px; }
.builder-empty { padding: 14px; border-radius: 14px; border: 1.5px dashed var(--line); color: var(--muted); text-align: center; font-size: 13.5px; }
.group-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.group-title h3 { font-size: 15px; }
.group-title small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-weight: 650; font-size: 13px; }
.days button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icon-pick button { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); }
.icon-pick button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-pick button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; background: linear-gradient(135deg, var(--g1), var(--g2)); }
.color-pick button.active { border-color: var(--text); }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 14px; width: 220px; margin: 0 auto 12px; }
.qr svg { width: 196px; height: 196px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); overflow-wrap: anywhere; }
.quota { height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; margin: 6px 0 4px; }
.quota span { display: block; height: 100%; background: var(--ok); border-radius: 10px; }
.quota.warn span { background: var(--warn); } .quota.bad span { background: var(--alarm); }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%);
          z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 440px); pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 24px; } }
.toast { pointer-events: auto; padding: 11px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
         box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out; max-width: 100%; }
.toast.error { background: var(--alarm); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
.toast small { display: block; font-weight: 500; opacity: .85; margin-top: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* login */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
             background: radial-gradient(1200px 600px at 20% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent), var(--bg); }
.auth-card { width: min(400px, 100%); padding: 32px 26px 26px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-lg); }
.auth-logo { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 19px; color: #fff; margin-bottom: 18px;
             background: linear-gradient(135deg, #3b82f6, #6366f1); }
.auth-logo svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-card h1 { font-size: 24px; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: 4px 0 22px; font-size: 14px; }
.auth-hint { color: var(--text-2); font-size: 14px; margin-bottom: 14px; }
.auth-back { display: block; text-align: center; margin-top: 14px; font-size: 14px; }
.flash { padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; font-size: 14px; font-weight: 600; background: var(--accent-soft); }
.flash-error { background: var(--alarm-soft); color: var(--alarm); }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.auth-dev { padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; margin-bottom: 14px; }
.auth-resend { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.auth-resend .auth-back { margin-top: 0; }
.mail-banner { display: flex; align-items: center; gap: 10px; margin: 0 16px 10px; padding: 10px 14px; border-radius: 12px;
               background: var(--alarm-soft); color: var(--alarm); font-size: 13.5px; font-weight: 600; }
.mail-banner a { color: inherit; text-decoration: underline; }
@media (min-width: 960px) { .mail-banner { margin: 0 28px 12px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ------------------------------------------------------------ tile sizes */
.tile.size-xs { grid-column: span 1; grid-row: span 1; flex-direction: column; align-items: center; justify-content: center;
                gap: 2px; padding: 5px 4px; text-align: center; border-radius: 16px; }
.tile.size-xs .tile-icon { width: 30px; height: 30px; flex: none; }
.tile.size-xs .tile-icon .ic { width: 16px; height: 16px; }
.tile.size-xs .tile-name { font-size: 11px; font-weight: 650; line-height: 1.2; -webkit-line-clamp: 1; max-width: 100%; }
.tile-xs-value { font-size: 16px; font-weight: 760; letter-spacing: -.02em; line-height: 30px; white-space: nowrap; }
.tile-xs-value.q-good { color: var(--ok); } .tile-xs-value.q-fair { color: var(--warn); } .tile-xs-value.q-bad { color: var(--alarm); }
button.tile-xs-toggle { border: 0; padding: 0; cursor: pointer; transition: transform .1s, background .2s, color .2s; }
button.tile-xs-toggle:active { transform: scale(.9); }
.tile.size-xs.is-offline .tile-name, .tile.size-xs.is-unpaired .tile-name { color: var(--muted); }
.tile.size-xs.is-open .tile-icon { background: var(--c-violet); color: #fff; }
.tile.size-xs.is-warn .tile-icon { background: var(--warn); color: #fff; }
.size-xs .tile-edit { top: -9px; right: -9px; gap: 2px; }
.size-xs .tile-edit button { min-width: 24px; height: 24px; padding: 0 5px; font-size: 10.5px; }
.size-xs .tile-edit button .ic { width: 12px; height: 12px; }
.scene.size-xs { grid-column: span 1; grid-row: span 1; flex-direction: column; align-items: center; justify-content: center;
                 min-height: 0; padding: 4px; gap: 2px; text-align: center; border-radius: 16px; }
.scene.size-xs .ic { width: 20px; height: 20px; }
.scene.size-xs .scene-name { font-size: 11px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile.size-sm { grid-column: span 2; grid-row: span 1; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; }
.tile.size-sm .tile-top { display: contents; }
.tile.size-sm .tile-icon { width: 38px; height: 38px; order: 0; }
.tile.size-sm .tile-icon .ic { width: 19px; height: 19px; }
.tile.size-sm .tile-body { flex: 1; order: 1; }
.tile.size-sm .tile-name { -webkit-line-clamp: 1; font-size: 13.5px; }
.tile.size-sm .tile-status { margin-top: 0; font-size: 12px; }
.tile.size-sm .tile-power { order: 2; width: 32px; height: 32px; }
.tile.size-sm .tile-badges { top: 4px; right: 4px; }
.tile.size-lg { grid-column: span 4; }
.tile.size-xl { grid-column: span 4; grid-row: span 4; }
.tile.size-xxl { grid-column: span 8; grid-row: span 6; }
.tile.size-lg, .tile.size-xl, .tile.size-xxl { gap: 8px; }
.tile.size-xxl .tile-big { font-size: 44px; }
.tile.size-xxl .tile-name { font-size: 17px; }
.tile-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tile-head .tile-body { flex: 1; }
.tile-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 0; }
.tile-big { font-size: 30px; font-weight: 760; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.tile-big small { font-size: 15px; color: var(--muted); font-weight: 650; margin-left: 2px; }
.tile-sub { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tile-sub b { color: var(--text-2); font-weight: 650; }
.tile-ctl { display: flex; align-items: center; gap: 10px; }
.tile-ctl .icon-btn { width: 38px; height: 38px; box-shadow: none; background: var(--surface-3); }
.tile.is-on .tile-ctl .icon-btn { background: color-mix(in srgb, var(--kc) 16%, var(--surface)); }
.tile-ctl strong { min-width: 64px; text-align: center; font-size: 18px; }
.tile-range { width: 100%; }
.tile-chart { flex: 1; min-height: 0; position: relative; }
.tile-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tile-chart .spark { fill: none; stroke: var(--kc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tile-chart .spark-area { fill: var(--kc); opacity: .1; }
.tile-chart .spark-label { fill: var(--muted); font-size: 10px; }
.tile-events { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.tile-events div { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; overflow: hidden; }
.tile-events span:first-child { overflow: hidden; text-overflow: ellipsis; }
.tile-events span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-caption { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-camera.size-sm { background: var(--surface); color: var(--text); }
.tile-camera.size-sm .tile-status { color: var(--muted); }
.tile-live { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--ok); }
.tile-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* scene tiles (boards) */
.scene.size-sm { grid-column: span 2; grid-row: span 1; flex-direction: row; align-items: center; min-height: 0; padding: 10px 12px; gap: 10px; }
.scene.size-sm .ic { width: 22px; height: 22px; }
.scene.size-md { grid-column: span 2; grid-row: span 2; min-height: 0; }
.scene.size-lg { grid-column: span 4; grid-row: span 2; min-height: 0; }
.scene.size-xl { grid-column: span 4; grid-row: span 4; min-height: 0; }
.scene.size-xxl { grid-column: span 8; grid-row: span 6; min-height: 0; }
.scene.size-xl .ic, .scene.size-xxl .ic { width: 40px; height: 40px; }
.scene.size-xl .scene-name { font-size: 20px; }
.scene.size-xxl .scene-name { font-size: 26px; }

/* ------------------------------------------------------------ edit mode */
.edit-bar { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; padding: 10px 14px; border-radius: 14px;
            background: var(--accent-soft); color: var(--text-2); font-size: 13.5px; }
.edit-bar .ic { color: var(--accent); }
.edit-bar span { flex: 1; }
.editing .tile, .editing .scene, .editing .sum { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.editing .tile > :not(.tile-edit), .editing .scene > :not(.tile-edit) { pointer-events: none; }
.editing .tile { animation: wiggle .6s ease-in-out infinite alternate; }
.editing .tile:nth-child(2n) { animation-delay: -.3s; }
@keyframes wiggle { from { transform: rotate(-.35deg); } to { transform: rotate(.35deg); } }
body.is-dragging .editing .tile { animation: none; }
.tile-edit { position: absolute; z-index: 3; top: 6px; right: 6px; display: flex; gap: 4px; }
.tile-edit button { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 15px; border: 0;
                    background: var(--text); color: var(--bg); font-size: 12px; font-weight: 800; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.tile-edit button .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.tile-edit .danger { background: var(--alarm); color: #fff; }
.size-sm .tile-edit { top: 50%; transform: translateY(-50%); }
.size-pop { position: fixed; z-index: 70; display: grid; grid-template-columns: repeat(6, 48px); gap: 4px; padding: 6px;
            border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.size-pop button { height: 50px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column;
                   align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 800; color: var(--text-2); }
.size-pop button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.size-glyph { display: grid; grid-template-columns: repeat(8, 3px); grid-auto-rows: 3px; gap: 1px; }
.size-glyph i { background: var(--line); border-radius: 1.5px; }
.size-glyph i.on { background: currentColor; }
.drag-source { opacity: .28; }
.drag-ghost { position: fixed !important; z-index: 1000; pointer-events: none; margin: 0 !important; opacity: .94; animation: none !important;
              transform: scale(1.04) rotate(.6deg); box-shadow: var(--shadow-lg) !important; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.room-section { margin-bottom: 4px; }
.section-grip { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 0;
                background: var(--surface-3); color: var(--muted); cursor: grab; touch-action: none; }
.editing .section-grip { display: inline-flex; }
.drop-empty { grid-column: 1 / -1; grid-row: span 1; display: grid; place-items: center; border: 1.5px dashed var(--line); border-radius: 14px;
              color: var(--muted); font-size: 13px; }
.grid:not(:empty) > .drop-empty:not(:only-child) { display: none; }
.hidden-tray .tile { opacity: .55; }
.home-block { position: relative; }
.block-grip { display: none; }
.editing .block-grip { display: inline-flex; }
.list .row[data-sort-row] { touch-action: pan-y; }
.row-grip { color: var(--muted); display: inline-grid; place-items: center; width: 30px; height: 30px; cursor: grab; }

/* ------------------------------------------------------------ home switcher + boards */
.home-switch { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0; border: 0; background: none; color: inherit;
               font: inherit; font-size: 23px; font-weight: 750; letter-spacing: -.02em; }
.home-switch span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-switch .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.home-row.active .row-title { color: var(--accent); }
.home-row .check-mark { color: var(--accent); }
.board-chips { margin-top: 4px; }
.pick-list .row { min-height: 52px; }
.pick-head { position: sticky; top: -18px; z-index: 2; background: var(--surface); padding: 6px 0 10px; }
.brand-home-btn { border: 0; background: none; color: inherit; font: inherit; padding: 0; text-align: left; cursor: pointer; }

/* ------------------------------------------------------------ small additions (homes, lists) */
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--accent);
            font: inherit; font-weight: 650; cursor: pointer; }
.link-btn .ic { width: 15px; height: 15px; }
.seg a { flex: 1; min-width: max-content; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px;
         padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 13.5px; }
.seg a.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg a .ic { width: 16px; height: 16px; }
.sum { position: relative; }
.tile-edit [role=button] { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
                           background: var(--text); color: var(--bg); font-size: 15px; font-weight: 800; cursor: pointer; }
.editing .sum > :not(.tile-edit) { pointer-events: none; }
.builder-grip { cursor: grab; touch-action: none; }
.row-grip { touch-action: none; }
.tile-metric { padding: 8px 12px; }
.tile-metric .metric-value { font-size: 26px; }
.brand-home-btn small { white-space: nowrap; }
.board-chips .chip { text-decoration: none; }

.tile-main { align-items: center; flex: none; }
.tile-side { flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.tile-big.q-good { color: var(--ok); } .tile-big.q-fair { color: var(--warn); } .tile-big.q-bad { color: var(--alarm); }
.tile.size-lg .tile-big, .tile.size-xl .tile-big, .tile.size-xxl .tile-big { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.size-lg .tile-ctl .icon-btn, .size-xl .tile-ctl .icon-btn, .size-xxl .tile-ctl .icon-btn { width: 36px; height: 36px; }
.editing .tile-power { visibility: hidden; }
@container (max-width: 380px) { .tile.size-lg .tile-big, .tile.size-xl .tile-big { font-size: 26px; } }
/* režim zobrazení (wall tablet) */
body.kiosk .sidebar, body.kiosk .tabbar, body.kiosk #topbar-actions, body.kiosk #topbar-back, body.kiosk .home-switch .ic,
body.kiosk .board-chips, body.kiosk [data-act="edit"], body.kiosk #dev-sim, body.kiosk details.more, body.kiosk .section-head > a,
body.kiosk [data-edit-start], body.kiosk [data-board-add], body.kiosk .empty .btn { display: none !important; }
body.kiosk .app { grid-template-columns: minmax(0, 1fr) !important; }
body.kiosk .home-switch { pointer-events: none; }
body.kiosk { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.kiosk #page-sub { font-size: 15px; font-weight: 650; color: var(--text-2); }
.kiosk-hold { position: fixed; z-index: 2000; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; pointer-events: none;
              border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: kiosk-spin linear forwards; }
@keyframes kiosk-spin { from { transform: rotate(0); } to { transform: rotate(720deg); border-color: var(--accent); } }
.kiosk-howto { margin: 6px 0 6px 18px; padding: 0; }
.ctl-help { display: block; font-size: 12.5px; font-weight: 500; margin-top: 2px; }
.tile-xl-icon { flex: 1; min-height: 0; display: grid; place-items: center; color: var(--kc); opacity: .28; }
.tile-xl-icon .ic { width: 72px; height: 72px; stroke-width: 1.4; }
.tile.is-open .tile-xl-icon, .tile.is-alarm .tile-xl-icon, .tile.is-on .tile-xl-icon { opacity: .75; }
.kiosk-howto li { margin: 2px 0; }

/* edit mode: keep names clear of the size / hide buttons */
.editing .tile.size-sm .tile-body { padding-right: 62px; }
.editing .tile.size-lg .tile-head .tile-body, .editing .tile.size-xl .tile-head .tile-body,
.editing .tile.size-xxl .tile-head .tile-body { padding-right: 58px; }
.editing .scene.size-sm > div { padding-right: 62px; }
body.kiosk .main { padding-bottom: 28px; }

/* ------------------------------------------------------------ "Dnes": weather + calendar tiles */
.widget { padding: 12px 14px; }
.widget-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; overflow: hidden; }
.widget-error { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.wx-ic { display: inline-grid; place-items: center; color: var(--c-slate); flex: none; }
.wx-ic .ic { width: 22px; height: 22px; }
.wx-sun { color: var(--c-amber); } .wx-moon, .wx-cloud-moon { color: var(--c-indigo); } .wx-cloud-sun { color: var(--c-amber); }
.wx-rain, .wx-drizzle { color: var(--c-blue); } .wx-snow { color: var(--c-teal); } .wx-storm { color: var(--c-violet); }
.wx-mid .ic { width: 30px; height: 30px; } .wx-big .ic { width: 44px; height: 44px; } .wx-huge .ic { width: 72px; height: 72px; }
.wx-t { font-size: 30px; font-weight: 760; letter-spacing: -.02em; line-height: 1; }
.wx-t-huge { font-size: 52px; }
.wx-label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.wx-place { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.wx-place .ic { width: 14px; height: 14px; }
.wx-xs { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.wx-xs b { font-size: 15px; }
.wx-row { display: flex; align-items: center; gap: 8px; min-width: 0; height: 100%; }
.wx-row .wx-t { font-size: 22px; }
.wx-row .wx-label { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-now { display: flex; align-items: center; gap: 12px; }
.wx-stale { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--warn-soft); color: var(--warn);
            font-weight: 800; font-size: 12px; margin-left: auto; align-self: flex-start; }
.wx-split { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; }
.wx-hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.wx-hours > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wx-hours span { color: var(--muted); }
.wx-days { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.wx-days > div { display: grid; grid-template-columns: minmax(0, 1fr) 24px 42px auto; align-items: center; gap: 6px; }
.wx-days .muted { font-size: 11.5px; text-align: right; }
.wx-days b small, .wx-week small { color: var(--muted); font-weight: 600; }
.wx-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.wx-facts span { display: inline-flex; align-items: center; gap: 4px; }
.wx-facts .ic { width: 14px; height: 14px; color: var(--muted); }
.wx-hero { display: flex; align-items: center; gap: 18px; }
.wx-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 58px; gap: 6px; overflow-x: auto; padding-bottom: 6px; text-align: center; }
.wx-strip > div { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 12px; background: var(--surface-2); font-size: 12.5px; }
.wx-strip span, .wx-strip small { color: var(--muted); }
.wx-week { display: flex; flex-direction: column; }
.wx-week > div { display: grid; grid-template-columns: 82px 26px minmax(0, 1fr) 34px minmax(50px, 90px) 34px; align-items: center; gap: 8px;
                 padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.wx-week > div:last-child { border-bottom: 0; }
.wx-wd { font-weight: 650; } .wx-wl { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-wl .ic { width: 12px; height: 12px; vertical-align: -1px; }
.wx-lo { color: var(--muted); text-align: right; } .wx-hi { font-weight: 700; }
.wx-bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); }
.wx-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, var(--c-teal), var(--c-amber)); }
@media (max-width: 420px) { .wx-week > div { grid-template-columns: 64px 24px minmax(0, 1fr) 30px 30px; } .wx-week .wx-bar { display: none; } }

.clk { flex: 1; display: flex; flex-direction: column; justify-content: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.clk b { font-weight: 760; letter-spacing: -.02em; }
.clk small { font-size: .45em; font-weight: 650; color: var(--muted); margin-left: 4px; }
.clk-xs { align-items: center; } .clk-xs b { font-size: 17px; }
.clk-sm b { font-size: 24px; } .clk-sm span { font-size: 12px; color: var(--muted); }
.clk-wd { color: var(--muted); font-weight: 600; text-transform: capitalize; } .clk-date { color: var(--muted); font-size: 13px; }
.clk-md .clk-time { font-size: 40px; } .clk-lg .clk-time { font-size: 52px; }
.clk-xl .clk-time { font-size: 72px; } .clk-xxl .clk-time { font-size: 96px; }
.clk-xl .clk-wd, .clk-xxl .clk-wd { font-size: 20px; } .clk-xl .clk-date, .clk-xxl .clk-date { font-size: 16px; }
.cal-xs { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.cal-xs span { font-size: 11px; font-weight: 750; color: var(--c-red); text-transform: uppercase; }
.cal-xs b { font-size: 22px; }
.cal-date { display: flex; flex-direction: column; }
.cal-day { font-size: 34px; font-weight: 780; letter-spacing: -.02em; line-height: 1; }
.cal-day-sm { font-size: 24px; }
.cal-sm { display: flex; flex-direction: column; min-width: 0; }
.cal-wd { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-daycols { padding-top: 8px; border-top: 1px solid var(--line); }
.wx-daycols small { color: var(--muted); font-weight: 600; }
.cal-name { font-size: 13px; color: var(--text-2); }
.cal-name b { color: var(--text); }
.cal-hol { color: var(--c-red); font-weight: 650; }
.cal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.cal-head .cal-name { text-align: right; }
.cal-list { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.cal-item { display: flex; gap: 8px; min-width: 0; }
.cal-when { flex: none; color: var(--muted); font-weight: 650; min-width: 54px; }
.cal-what { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-what .ic { width: 13px; height: 13px; flex: none; color: var(--accent); }
.cal-item.is-holiday .cal-what { color: var(--c-red); } .cal-item.is-holiday .cal-what .ic { color: var(--c-red); }
.cal-empty { font-size: 13px; }
.cal-list-big { font-size: 14.5px; gap: 8px; } .cal-list-big .cal-when { min-width: 82px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; text-align: center; font-size: 11px; }
.cal-month b { color: var(--muted); font-weight: 650; font-size: 10px; }
.cal-month span, .cal-month button { position: relative; padding: 2px 0; border-radius: 8px; line-height: 1.5; }
.cal-month .out { color: var(--muted); opacity: .55; }
.cal-month .weekend, .cal-month .holiday { color: var(--c-red); }
.cal-month .today { background: var(--accent); color: var(--on-accent) !important; font-weight: 750; }
.cal-month i { position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.cal-month .today i { background: var(--on-accent); }
.cal-month-big { font-size: 15px; gap: 4px; margin: 6px 0 4px; }
.cal-month-big b { font-size: 12px; }
.cal-month-big button { border: 0; background: none; color: inherit; font: inherit; padding: 9px 0; cursor: pointer; }
.cal-month-big button.selected:not(.today) { background: var(--accent-soft); color: var(--accent); font-weight: 750; }
.cal-month-big i { bottom: 4px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; }
.cal-nav h3 { text-transform: capitalize; font-size: 17px; }
.widget-add { flex-wrap: wrap; margin-top: 8px; }
body.kiosk [data-cal-add], body.kiosk .widget-add { display: none !important; }
