/* Valgus v7 — kujundus „Õhk“: hele ja õhuline, tume režiim lülitiga, mõõdukalt kandilised nurgad. */
:root {
  color-scheme: light;
  --page: #eef0f4; --surface: #ffffff; --surface-2: #e6e9ef; --surface-3: #f5f6f9;
  --ink: #14161a; --ink-2: #3a404b; --muted: #5b6270;
  --line: #e1e5ec; --axis: #c4cad5; --ring: rgba(20,22,26,.08);
  --accent: #1d5fd1; --accent-soft: #e2ecfd; --on: #e8730c; --on-soft: #fdeede; --on-ink: #9a4a00;
  --good: #0f8a5f; --bad: #cf3636; --bad-soft: #fdecec;
  --s0: #aab1bd; --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s9: #14a5c4; --s10: #8fb31d; --s11: #b548c8; --s12: #a8642a;
  --day: #eda100; --night: #2a78d6; --night-band: rgba(42,120,214,.08);
  --unk: repeating-linear-gradient(135deg, #c4cad5 0 2px, transparent 2px 5px);
  --shadow: 0 1px 2px rgba(20,22,26,.04), 0 6px 20px rgba(20,22,26,.05);
  --glow: 0 8px 22px rgba(232,115,12,.24);
  --r: 10px; --r-s: 7px; --r-xs: 4px;
  --tl-name: 150px; --gap: 14px;
  --font: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e1014; --surface: #181b21; --surface-2: #262a33; --surface-3: #1e2229;
    --ink: #f1f3f6; --ink-2: #cdd2db; --muted: #9aa2b1;
    --line: #2a2f39; --axis: #3a404c; --ring: rgba(0,0,0,.4);
    --accent: #7fb0ff; --accent-soft: #1b2a44; --on: #ff9a3d; --on-soft: #3a2614; --on-ink: #ffc48a;
    --good: #3fcf9a; --bad: #ff7b7b; --bad-soft: #3a1c1c;
    --s0: #5b6270; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s9: #1a9fba; --s10: #7fa01f; --s11: #b65fd0; --s12: #b06a2c;
    --night: #3987e5; --night-band: rgba(57,135,229,.12);
    --unk: repeating-linear-gradient(135deg, #4a505c 0 2px, transparent 2px 5px);
    --shadow: 0 1px 2px rgba(0,0,0,.3);
    --glow: 0 8px 26px rgba(255,154,61,.22);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e1014; --surface: #181b21; --surface-2: #262a33; --surface-3: #1e2229;
  --ink: #f1f3f6; --ink-2: #cdd2db; --muted: #9aa2b1;
  --line: #2a2f39; --axis: #3a404c; --ring: rgba(0,0,0,.4);
  --accent: #7fb0ff; --accent-soft: #1b2a44; --on: #ff9a3d; --on-soft: #3a2614; --on-ink: #ffc48a;
  --good: #3fcf9a; --bad: #ff7b7b; --bad-soft: #3a1c1c;
  --s0: #5b6270; --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s9: #1a9fba; --s10: #7fa01f; --s11: #b65fd0; --s12: #b06a2c;
  --night: #3987e5; --night-band: rgba(57,135,229,.12);
  --unk: repeating-linear-gradient(135deg, #4a505c 0 2px, transparent 2px 5px);
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  --glow: 0 8px 26px rgba(255,154,61,.22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 500 15px/1.5 var(--font); transition: background .25s, color .25s; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--axis); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 4px; font-weight: 800; }
h2 { font-size: 16px; margin: 0; font-weight: 800; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
h2 .i { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 800; }
.fine { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; max-width: 72ch; }
.eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.empty { margin: 4px 0 14px; }
code { font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: var(--r-xs); word-break: break-all; }
code.block { display: block; padding: 9px 11px; margin: 6px 0 12px; }
.i { width: 18px; height: 18px; flex: none; vertical-align: -4px; }

/* ---------- raam */
.top { position: sticky; top: 0; z-index: 10; }
/* udu on pseudoelemendil: backdrop-filter päisel endal seoks alumise menüü (position: fixed) päise külge */
.top::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; text-decoration: none; margin-right: auto; }
.brand .i { width: 34px; height: 34px; padding: 7px; background: var(--on); color: #fff; border-radius: var(--r-s); }
.themebtn { order: 3; width: 40px; height: 40px; min-height: 0; padding: 0; background: var(--surface); border: 0; border-radius: var(--r-s); box-shadow: var(--shadow); color: var(--ink-2); position: relative; overflow: hidden; }
.themebtn .i { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; transition: transform .35s cubic-bezier(.3,1.4,.5,1), opacity .25s; }
.themebtn .i-moon { transform: translateY(26px) rotate(40deg); opacity: 0; }
:root[data-theme="dark"] .themebtn .i-sun { transform: translateY(-26px) rotate(-40deg); opacity: 0; }
:root[data-theme="dark"] .themebtn .i-moon { transform: none; opacity: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themebtn .i-sun { transform: translateY(-26px) rotate(-40deg); opacity: 0; }
  :root:not([data-theme="light"]) .themebtn .i-moon { transform: none; opacity: 1; }
}
.top nav { order: 2; display: flex; gap: 3px; padding: 4px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.top nav a { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 700; border-radius: var(--r-s); transition: background .15s, color .15s; }
.top nav a:hover { color: var(--ink); }
.top nav a.on { background: var(--ink); color: var(--surface); }
main { max-width: 1120px; margin: 0 auto; padding: 14px 16px 8px; }
footer { max-width: 1120px; margin: 0 auto; padding: 14px 16px 32px; display: flex; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--muted); }
footer a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
footer .i { width: 14px; height: 14px; }
.pagehead { margin: 6px 0 16px; }
.pagehead p { margin: 0; max-width: 70ch; }
.pagehead.ctl { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.pagehead .eyebrow { color: var(--muted); font-size: 13px; }
.ctl-btns { display: flex; gap: 8px; }
.ctl-btns form { display: flex; }

/* ---------- paneelid */
.panel { background: var(--surface); border-radius: var(--r); padding: 18px; margin-bottom: var(--gap); box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .ph { padding: 18px 18px 0; }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ph .muted { font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.cols2 > .panel { margin-bottom: 0; }
.panel .cols2 { margin-bottom: 0; }

/* ---------- vormid */
input, button, select { font: inherit; color: inherit; }
input[type=text], input:not([type]), input[type=email], input[type=url], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], select {
  width: 100%; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 11px; min-height: 42px; font-weight: 600; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button:focus-visible, a:focus-visible, summary:focus-visible, .col:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; min-height: 42px; padding: 0 16px;
  background: var(--surface-2); border: 0; border-radius: var(--r-s); font-weight: 700; font-size: 14px; transition: transform .12s, background .15s, opacity .15s; -webkit-tap-highlight-color: transparent; }
button:hover { background: var(--axis); }
button:active { transform: scale(.97); }
button:disabled { opacity: .4; cursor: default; transform: none; }
button.primary { background: var(--ink); color: var(--surface); }
button.primary:hover { opacity: .88; background: var(--ink); }
button.soft { background: var(--surface-2); }
button.ghost { background: none; color: var(--muted); }
button.ghost:hover { background: var(--surface-2); color: var(--ink); }
button.ghost.on { color: var(--ink); background: var(--surface-2); }
button.danger { background: var(--bad); color: #fff; }
button.link { background: none; padding: 0; min-height: 0; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
button.icon { background: none; padding: 0; min-height: 0; width: 40px; height: 40px; color: var(--muted); }
button.icon:hover { color: var(--bad); background: var(--bad-soft); }
button.sq { width: 42px; padding: 0; }
button.spin .i { animation: spin .9s linear infinite; }
.wide { width: 100%; }
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 0 16px; text-decoration: none; border-radius: var(--r-s); font-weight: 700; }
a.btn.primary { background: var(--ink); color: var(--surface); }
@keyframes spin { to { transform: rotate(360deg); } }
.f { display: grid; gap: 12px; }
.f label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.f .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.f label.check, .f label.radio { display: flex; align-items: flex-start; gap: 9px; color: var(--ink); font-size: 14px; font-weight: 500; }
.f fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.f > button { justify-self: start; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.f.row { grid-template-columns: 110px 80px 1fr 200px auto; align-items: end; }
.f.row2 { grid-template-columns: minmax(0, 320px) auto; align-items: end; justify-content: start; }
.inline { display: flex; align-items: flex-end; gap: 8px; }
.inline .grow { flex: 1; }
.lbl-row { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: -6px; }
.chipset { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chipset button { padding: 0 6px; }
.chipset .i { width: 15px; height: 15px; color: var(--accent); }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days label { display: block; position: relative; }
.days input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.days span { display: grid; place-items: center; height: 42px; border-radius: var(--r-s); background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 14px; transition: background .15s, color .15s; }
.days input:checked + span { background: var(--accent); color: var(--surface); }
.days input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset.side { background: var(--surface-3); border: 1px solid var(--line) !important; border-radius: var(--r-s); padding: 12px !important; }
fieldset.side legend { font-weight: 800; font-size: 13px; padding: 0 6px; display: flex; align-items: center; gap: 6px; }
fieldset.side legend .i { width: 15px; height: 15px; color: var(--accent); }
.switch { width: 48px; min-height: 0; height: 28px; padding: 3px; border-radius: 14px; background: var(--axis); justify-content: flex-start; }
.switch i { width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: transform .2s cubic-bezier(.3,1.4,.5,1); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch.on, .switch.on:hover { background: var(--accent); }
.switch.on i { transform: translateX(20px); }

/* ---------- filtrid */
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: var(--gap); }
.chips, .seg { display: flex; gap: 3px; padding: 4px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.chips a, .seg a { padding: 6px 13px; text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 700; border-radius: var(--r-s); white-space: nowrap; }
.chips a:hover, .seg a:hover { color: var(--ink); }
.chips a.on, .seg a.on { background: var(--ink); color: var(--surface); }
.seg { box-shadow: none; background: var(--surface-2); }
.seg a { padding: 4px 11px; font-size: 13px; }
.range { display: flex; align-items: center; gap: 6px; }
.range input { width: auto; min-height: 38px; padding: 5px 9px; background: var(--surface); }
.range button { min-height: 38px; background: var(--surface); box-shadow: var(--shadow); }

/* ---------- teated */
.note, .alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: var(--gap); background: var(--on-soft); color: var(--ink); border-radius: var(--r); font-size: 14px; }
.note .i { color: var(--on); } .note.ok { background: color-mix(in srgb, var(--good) 14%, var(--surface)); } .note.ok .i { color: var(--good); }
.alert { background: var(--bad-soft); } .alert .i { color: var(--bad); }
.badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--muted); }
.badge.ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.badge.on { color: var(--accent); background: var(--accent-soft); }

/* ---------- KPI */
.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.kpi { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lbl { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.val { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.kpi.hero .val { font-size: 42px; }
.val small { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.val.sm { font-size: 25px; }
.sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 4px; }
.sub .i { width: 14px; height: 14px; }
.split { display: flex; gap: 16px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.split span { display: inline-flex; align-items: center; gap: 6px; }
.split span:first-child .i { color: var(--day); } .split span:last-child .i { color: var(--night); }
.bar2 { display: flex; height: 8px; gap: 3px; margin: 5px 0 2px; }
.bar2 i { display: block; border-radius: var(--r-xs); animation: growx .7s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
.bar2 .d { background: var(--day); } .bar2 .n { background: var(--night); flex: 1; }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes growy { from { transform: scaleY(0); } }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } }

/* ---------- seeriate värvid */
.s0 { background: var(--s0); } .s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); }
.s4 { background: var(--s4); } .s5 { background: var(--s5); } .s6 { background: var(--s6); } .s7 { background: var(--s7); } .s8 { background: var(--s8); }
.k0 { stroke: var(--s0); fill: var(--s0); } .k1 { stroke: var(--s1); fill: var(--s1); } .k2 { stroke: var(--s2); fill: var(--s2); } .k3 { stroke: var(--s3); fill: var(--s3); }
.k4 { stroke: var(--s4); fill: var(--s4); } .k5 { stroke: var(--s5); fill: var(--s5); } .k6 { stroke: var(--s6); fill: var(--s6); } .k7 { stroke: var(--s7); fill: var(--s7); } .k8 { stroke: var(--s8); fill: var(--s8); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; flex: none; margin-right: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: var(--ink-2); align-items: center; }
.legend.col { flex-direction: column; align-items: flex-start; margin: 0; gap: 9px; font-weight: 700; }
.legend > span { display: inline-flex; align-items: center; }
.key { display: inline-block; width: 12px; height: 9px; border-radius: 3px; margin-right: 7px; }
.key.on { background: var(--ink-2); } .key.unk { background: var(--unk); outline: 1px solid var(--axis); outline-offset: -1px; }
.key.night { background: var(--night-band); outline: 1px solid var(--line); outline-offset: -1px; }

/* ---------- rõngad */
.ring { display: block; }
.ring-bg { fill: none; stroke: var(--surface-2); }
.ring-fg { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .9s linear; }
.ring-fg.warm { stroke: var(--on); }
.ring-num { font: 800 24px var(--font); fill: var(--ink); letter-spacing: -.02em; }
.ring-cap { font: 600 11px var(--font); fill: var(--muted); }
.ring.gauge { width: 92px; height: 92px; flex: none; }
.ring.gauge .ring-bg, .ring.gauge .ring-fg { stroke-width: 10; }
.ring.gauge .ring-fg { transition: stroke-dasharray .8s cubic-bezier(.2,.8,.2,1); }
.ring.big { width: 140px; height: 140px; flex: none; }
.ring.big .ring-bg, .ring.big .ring-fg { stroke-width: 10; }
.ring.big .ring-num { font-size: 30px; }

/* ---------- tuled */
.hero { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: var(--gap); display: flex; align-items: center; gap: 16px; }
.hero-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hero-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.hero-body .muted { font-size: 13.5px; }
.hero-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--accent); text-decoration: none; }
.hero-note .i { width: 16px; height: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.tile { display: flex; margin: 0; animation: fadeup .4s both; }
.tile:nth-child(2) { animation-delay: .03s; } .tile:nth-child(3) { animation-delay: .06s; } .tile:nth-child(4) { animation-delay: .09s; }
.tile:nth-child(5) { animation-delay: .12s; } .tile:nth-child(6) { animation-delay: .15s; } .tile:nth-child(n+7) { animation-delay: .18s; }
.tile > button { flex: 1; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 1px; text-align: left; min-height: 132px; padding: 14px;
  background: var(--surface-2); border-radius: var(--r); font-weight: 500; transition: background .25s, box-shadow .25s, transform .12s; touch-action: manipulation; }
.tile > button:hover { background: var(--axis); }
.tile-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: auto; padding-bottom: 14px; }
.tile-ic { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--muted); transition: background .25s, color .25s; }
.tile-ic .i { width: 20px; height: 20px; }
.tile-ic .ring { position: absolute; inset: -4px; width: 52px; height: 52px; opacity: 0; transition: opacity .2s; }
.tile-ic .ring-bg, .tile-ic .ring-fg { stroke-width: 3; }
.tile-ic .ring-bg { stroke: var(--accent-soft); }
.tile.timed .tile-ic .ring { opacity: 1; }
.tile-tag { font-size: 12.5px; font-weight: 800; color: var(--on-ink); font-variant-numeric: tabular-nums; }
.tile-tag.timer, .tile-tag.sched { color: var(--accent); }
.tile-name { font-size: 16px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; display: flex; align-items: center; }
.tile-name .sw { width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
.tile-st { font-size: 13px; color: var(--ink-2); }
.tile-meta { font-size: 12px; color: var(--muted); }
.tile.on > button { background: var(--surface); box-shadow: var(--glow); }
.tile.on > button:hover { background: var(--surface); }
.tile.on .tile-ic { background: var(--on); color: #fff; }
.tile.unknown .tile-ic { background: var(--unk); }
.tile.offline > button { opacity: .55; }
.tile.pending > button { opacity: .75; }
.tile.pending .tile-ic .i { animation: spin .9s linear infinite; }

/* ---------- taimerid ja ajakavad */
.timer { display: flex; align-items: center; gap: 16px; padding: 4px 0 16px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.timer-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.timer-name { font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 6px; }
.timer .btnrow button { min-height: 40px; padding: 0 12px; }
.dialwrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.dial { width: min(220px, 60vw); height: auto; flex: none; }
.dial-night { fill: none; stroke: var(--night-band); stroke-width: 18; }
.dial-tick { stroke: var(--axis); stroke-width: 1.5; stroke-linecap: round; }
.dial-track { fill: none; stroke: var(--surface-2); }
.dial-arc { fill: none; stroke-linecap: round; animation: fadeup .6s both; }
.dial-dot { stroke: none; }
.dial-dot.hollow { fill: var(--surface); stroke-width: 3; }
.dial-dot.hollow.k0 { stroke: var(--s0); } .dial-dot.hollow.k1 { stroke: var(--s1); } .dial-dot.hollow.k2 { stroke: var(--s2); } .dial-dot.hollow.k3 { stroke: var(--s3); } .dial-dot.hollow.k4 { stroke: var(--s4); }
.dial-dot.hollow.k5 { stroke: var(--s5); } .dial-dot.hollow.k6 { stroke: var(--s6); } .dial-dot.hollow.k7 { stroke: var(--s7); } .dial-dot.hollow.k8 { stroke: var(--s8); }
.dial-arc { fill: none !important; }
.dial-hand { transition: transform 1s linear; }
.dial-hand line { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.dial-hand circle, .dial-hub { fill: var(--ink); }
.dial-h { font: 700 11px var(--font); fill: var(--muted); }
.dial-lbl { font: 800 15px var(--font); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; }
.schedlist, .autolist { list-style: none; margin: 0 0 6px; padding: 0; }
.schedlist li, .autolist li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.schedlist li:last-child, .autolist li:last-child { border-bottom: 0; }
.schedlist li.off .sl-main { opacity: .45; }
.sl-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.sl-name { font-weight: 800; display: flex; align-items: center; flex: 1; min-width: 0; }
.sl-when { font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.sl-when .i { width: 14px; height: 14px; color: var(--on); }
.arrow { color: var(--muted); }
.daybar { position: relative; display: block; height: 8px; border-radius: var(--r-xs); background: var(--surface-2); margin-top: 3px; }
.daybar i { position: absolute; top: 0; bottom: 0; border-radius: var(--r-xs); animation: growx .7s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
.daybar i.pt { width: 8px; margin-left: -4px; border-radius: 50%; }
.nowline { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; transition: left 1s linear; }
.autolist .inline { align-items: center; }
.autolist input { width: 84px; text-align: right; }
.newtimer { margin-top: 2px; }

/* ---------- ajajoon */
.tl-rows { position: relative; }
.tl-row { display: flex; align-items: center; height: 34px; }
.tl-name { width: var(--tl-name); flex: none; padding-right: 12px; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; flex: 1; height: 100%; border-bottom: 1px solid var(--line); }
.tl-row:first-child .tl-track { border-top: 1px solid var(--line); }
.tl-night i { position: absolute; top: 0; bottom: 0; background: var(--night-band); }
.tl-track b { position: absolute; top: 9px; height: 16px; min-width: 3px; border-radius: var(--r-xs); animation: growx .6s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
.tl-track b.unk { background: var(--unk); }
.tl-now { position: absolute; top: -4px; bottom: 0; width: 0; border-left: 2px solid var(--ink); }
.tl-now::before { content: ""; position: absolute; top: 0; left: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.tl-axis { display: flex; height: 22px; }
.tl-ticks { position: relative; flex: 1; font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-ticks span { position: absolute; top: 4px; transform: translateX(-50%); }
.tl-ticks span:first-child { transform: none; } .tl-ticks span:last-child { transform: translateX(-100%); }

/* ---------- 30 päeva tulbad */
.bars { display: flex; height: 230px; }
.bars .y { display: flex; flex-direction: column; justify-content: space-between; width: 40px; flex: none; padding-bottom: 22px; font-size: 11px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; padding-right: 8px; }
.bars .y span { line-height: 0; }
.cols { flex: 1; display: grid; grid-template-columns: repeat(30, 1fr); position: relative;
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% calc((100% - 22px) / 4) no-repeat,
              linear-gradient(var(--line) 1px, transparent 1px) 0 calc((100% - 22px) / 4) / 100% 1px no-repeat,
              linear-gradient(var(--line) 1px, transparent 1px) 0 calc((100% - 22px) / 2) / 100% 1px no-repeat,
              linear-gradient(var(--line) 1px, transparent 1px) 0 calc((100% - 22px) * .75) / 100% 1px no-repeat; }
.col { display: flex; flex-direction: column; min-width: 0; outline: none; }
.col .stack { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; padding: 0 2px; border-bottom: 1px solid var(--axis); border-radius: var(--r-xs) var(--r-xs) 0 0; transform-origin: bottom; animation: growy .7s cubic-bezier(.2,.8,.2,1) both; }
.col:nth-child(3n) .stack { animation-delay: .05s; } .col:nth-child(3n+1) .stack { animation-delay: .1s; }
.col .stack i { display: block; flex: none; min-height: 1px; border-radius: 2px; }
.col .stack i:last-child { border-radius: 4px 4px 2px 2px; }
.col.we .stack { background: var(--surface-3); }
.col:hover .stack, .col:focus-visible .stack { background: var(--surface-2); }
.col .x { height: 22px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding-top: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.col.today .x { color: var(--ink); font-weight: 800; }

/* ---------- soojuskaart: nädalapäev × tund */
.heat { display: grid; grid-template-columns: 22px repeat(24, 1fr); gap: 3px; align-items: center; }
.heat .hd { font-size: 11px; font-weight: 700; color: var(--muted); }
.heat .hh { font-size: 10px; font-weight: 600; color: var(--muted); text-align: center; height: 14px; }
.heat .cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); position: relative; overflow: hidden; animation: fadeup .5s both; }
.heat .cell i { position: absolute; inset: 0; background: var(--on); }
.heat-scale { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.heat-scale span { display: flex; gap: 3px; }
.heat-scale b { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-2); position: relative; overflow: hidden; }
.heat-scale b i { position: absolute; inset: 0; background: var(--on); }

/* ---------- tabel */
.tablewrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 700; padding-top: 14px; }
.tbl td.r, .tbl th.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl th:first-child, .tbl td:first-child { padding-left: 18px; } .tbl th:last-child, .tbl td:last-child { padding-right: 18px; }
.tbl tbody tr:hover { background: var(--surface-3); }
.tbl tfoot td { font-weight: 800; border-bottom: 0; }
.tbl .name { display: flex; align-items: center; text-decoration: none; font-weight: 800; }
.tbl .meta { display: block; font-size: 12px; color: var(--muted); margin: 2px 0 6px 17px; }
.share { display: block; height: 4px; border-radius: 2px; margin-left: 17px; max-width: 180px; background: var(--surface-2); overflow: hidden; }
.share i { display: block; height: 100%; border-radius: 2px; animation: growx .8s cubic-bezier(.2,.8,.2,1) both; transform-origin: left; }
.state { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.state .i { width: 15px; height: 15px; }
.state.on .i { color: var(--on); }
.state.unk { color: var(--muted); font-style: italic; font-weight: 500; }
.state.ok { color: var(--good); } .state.bad { color: var(--bad); }

/* ---------- pirnid */
.lights { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--gap); }
.light { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; scroll-margin-top: 90px; }
.light:target { outline: 2px solid var(--accent); }
.light.off { opacity: .6; }
.light > header { display: flex; align-items: flex-start; gap: 4px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.light > header .sw { margin-top: 8px; }
.light .lt { flex: 1; min-width: 0; }
.light h2 { font-size: 17px; }
.watt { font-size: 14px; color: var(--muted); white-space: nowrap; font-weight: 700; }
.watt b { font-size: 26px; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.bulbs { list-style: none; margin: 0; padding: 0; }
.bulbs li { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line); position: relative; }
.bulbs li.empty { color: var(--muted); font-size: 14px; padding: 14px 18px; margin: 0; }
.bi { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--on-soft); color: var(--on); flex: none; }
.bt { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 14px; min-width: 0; }
.bt .muted { flex-basis: 100%; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details.act > summary { width: 40px; height: 40px; display: grid; place-items: center; color: var(--muted); border-radius: var(--r-s); }
details.act > summary:hover, details.act[open] > summary { color: var(--ink); background: var(--surface-2); }
.pop { position: absolute; right: 8px; top: calc(100% - 4px); z-index: 5; width: min(320px, calc(100vw - 48px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 14px; box-shadow: 0 16px 40px var(--ring), 0 2px 6px var(--ring); animation: fadeup .18s both; }
.pop .subtle { padding-top: 10px; border-top: 1px solid var(--line); }
details.add, details.hist { border-bottom: 1px solid var(--line); }
details.add:last-child, details.hist:last-child { border-bottom: 0; }
details.add > summary, details.hist > summary, details.addid > summary { padding: 12px 18px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
details.add > summary, details.addid > summary { font-weight: 800; color: var(--accent); }
details.hist > summary { color: var(--muted); font-size: 13px; }
details.add > summary:hover, details.hist > summary:hover, details.addid > summary:hover { background: var(--surface-3); }
details.add > summary .i, details.addid > summary .i { transition: transform .2s; }
details.add[open] > summary .i, details.addid[open] > summary .i { transform: rotate(45deg); }
details.add > form, details.hist > form { padding: 4px 18px 18px; }
.panel > details.add { margin: 6px -18px -18px; border-top: 1px solid var(--line); border-bottom: 0; }
.light .f.row { grid-template-columns: 1fr 72px; }
.light .f.row .l, .light .f.row .d { grid-column: 1 / -1; }
.light .f.row > button { grid-column: 1 / -1; justify-self: stretch; }
details.hist ul { list-style: none; margin: 0; padding: 0 18px 12px; font-size: 13px; }
details.hist li { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line); }
details.hist li span:first-child { flex: 1; }
details.addid { padding: 0; }
details.addid > form, details.addid > p { padding: 0 18px; }
details.addid > p { padding-bottom: 16px; }
.fine.top { margin: -6px 0 14px; }

/* ---------- logi */
.log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.log li { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; align-self: center; }
.dot.ok { background: var(--good); } .dot.bad { background: var(--bad); }
.steps { padding-left: 20px; } .steps li { margin-bottom: 8px; }

#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12.5px; font-weight: 600; padding: 8px 11px; border-radius: var(--r-s); white-space: pre-line; max-width: 260px; line-height: 1.45; font-variant-numeric: tabular-nums; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--bad); color: #fff; padding: 12px 16px; border-radius: var(--r); font-size: 14px; font-weight: 700; max-width: min(92vw, 420px); box-shadow: 0 12px 30px var(--ring); }

/* ---------- sisselogimine */
body.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; overflow: hidden; }
.login-bg { position: fixed; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); gap: 14px; padding: 14px; filter: blur(6px); opacity: .7; }
.login-bg i { background: var(--surface-2); border-radius: var(--r); }
.login-bg i:nth-child(2), .login-bg i:nth-child(7) { background: var(--surface); box-shadow: var(--glow); }
.modal { position: relative; width: min(380px, 100%); background: var(--surface); border-radius: 14px; padding: 28px 24px 20px; box-shadow: 0 24px 60px var(--ring), 0 2px 8px var(--ring); margin: 0; max-width: none; animation: fadeup .35s both; }
.modal h1 { margin-bottom: 4px; } .modal > p { margin: 0 0 18px; } .modal .alert { margin-bottom: 14px; }
.modal-brand { width: 48px; height: 48px; display: grid; place-items: center; background: var(--on); color: #fff; border-radius: var(--r); margin-bottom: 18px; box-shadow: var(--glow); }
.modal-brand .i { width: 26px; height: 26px; }
.modal input { min-height: 46px; font-size: 16px; } .modal button { min-height: 48px; margin-top: 4px; }
.modal .fine { text-align: center; margin-top: 14px; }

/* ---------- kitsamad ekraanid */
@media (max-width: 860px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi.hero .val { font-size: 34px; }
}
@media (max-width: 900px) {
  :root { --tl-name: 96px; --gap: 12px; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  body.login { padding-bottom: 16px; }
  .top { padding-top: env(safe-area-inset-top); }
  .top-in { padding: 8px 14px; }
  .top nav { position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); padding: 5px; box-shadow: 0 10px 30px var(--ring), 0 1px 3px var(--ring); }
  .top nav { max-width: 560px; margin: 0 auto; }
  .top nav a { flex-direction: column; justify-content: center; gap: 2px; height: 50px; padding: 0; font-size: 10.5px; min-width: 0; }
  .top nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top nav a .i { width: 20px; height: 20px; }
  main { padding: 8px 14px; }
  h1 { font-size: 27px; }
  .panel { padding: 16px; } .panel.flush .ph { padding: 16px 16px 0; }
  .panel > details.add { margin: 6px -16px -16px; }
  .kpi { padding: 14px; } .val { font-size: 26px; } .kpi.hero .val { font-size: 30px; }
  .split { font-size: 18px; gap: 12px; }
  .hide-s { display: none; }
  .tbl th, .tbl td { padding: 10px 8px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 16px; } .tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
  .lights { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile > button { min-height: 128px; padding: 12px; }
  .f .pair { grid-template-columns: 1fr; }
  .f.row, .f.row2 { grid-template-columns: 1fr 72px; }
  .f.row .l, .f.row .d, .f.row > button, .f.row2 > * { grid-column: 1 / -1; }
  .filters { gap: 10px; }
  .chips { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .range { width: 100%; } .range input { flex: 1; min-width: 0; }
  .bars { height: 190px; } .bars .y { width: 32px; }
  .col .stack { padding: 0 1px; gap: 1px; }
  .heat { gap: 2px; grid-template-columns: 18px repeat(24, 1fr); } .heat .hh:nth-child(2n) { visibility: hidden; }
  input[type=text], input:not([type]), input[type=email], input[type=url], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], select { font-size: 16px; min-height: 46px; }
  button { min-height: 46px; } button.sq { width: 46px; } details.act > summary { width: 44px; height: 44px; }
  .switch { min-height: 0; }
  .timer { flex-direction: column; align-items: flex-start; }
  .timer .ring.big { align-self: center; }
  .dialwrap { justify-content: center; }
  footer { flex-direction: column; align-items: center; gap: 6px; padding-bottom: 16px; }
  #toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (display-mode: standalone) {
  body { overscroll-behavior-y: contain; -webkit-user-select: none; user-select: none; }
  input, textarea, code, .tbl, .log { -webkit-user-select: text; user-select: text; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================= v8: valgusti seadete leht nupu alt, paigalduspakkumine ================= */
.tile { position: relative; }
.tile-more { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-s); color: var(--muted); z-index: 1; -webkit-tap-highlight-color: transparent; }
.tile-more:hover { background: var(--line); color: var(--ink); }
.tile-more .i { width: 20px; height: 20px; }
.tile-top { padding-right: 36px; }
.tile-tag { margin-top: 4px; }
.sheet { border: 0; padding: 0 18px 18px; margin: auto; width: min(480px, calc(100vw - 24px)); max-height: min(86dvh, 760px); overflow-y: auto; background: var(--surface); color: var(--ink);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: fadeup .22s both; overscroll-behavior: contain; }
.sheet::backdrop { background: rgba(10,12,16,.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-head { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 12px; border-bottom: 1px solid var(--line); }
.sheet-head .eyebrow { color: var(--muted); }
.sheet-title { font-size: 22px; letter-spacing: -.02em; }
.sheet-title .sw { width: 9px; height: 9px; border-radius: 50%; }
.sheet-sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.sheet-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.sheet-sec h3 { margin: 0 0 12px; font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sheet-sec h3 .i { color: var(--accent); }
.sheet-sec .schedlist li { padding: 8px 0; }
.sheet-page { max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 0 18px 18px; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-s); }
.seg2 label { position: relative; display: block; }
.seg2 input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg2 span { display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; border-radius: 5px; font-size: 14px; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
.seg2 span .i { width: 16px; height: 16px; }
.seg2 input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg2 input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.timer.mini { padding: 0 0 14px; }
.timer.mini .timer-name { font-size: 16px; }
.ring.mid { width: 80px; height: 80px; flex: none; }
.ring.mid .ring-bg, .ring.mid .ring-fg { stroke-width: 7; }
.ring.mid .ring-num { font-size: 17px; }
details.add.inset { border: 1px solid var(--line); border-radius: var(--r-s); margin-top: 6px; }
details.add.inset > summary { padding: 11px 12px; }
details.add.inset > form { padding: 2px 12px 12px; }
.f .pair.two { grid-template-columns: 1fr 1fr; }
a.btn.soft { background: var(--surface-2); min-height: 42px; font-size: 14px; }
a.btn.soft:hover { background: var(--axis); }
.inline .btn.grow { flex: 1; }

.install { position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 12px;
  background: var(--surface); border-radius: var(--r); box-shadow: 0 16px 44px rgba(0,0,0,.3), 0 0 0 1px var(--line); animation: fadeup .35s .6s both; max-width: 520px; margin: 0 auto; }
body.login .install { bottom: calc(16px + env(safe-area-inset-bottom)); }
.install-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; background: var(--on); color: #fff; border-radius: var(--r-s); }
.install-ic .i { width: 22px; height: 22px; }
.install-txt { flex: 1; min-width: 0; display: grid; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.install-txt b { font-size: 14.5px; color: var(--ink); font-weight: 800; }
.install button.primary { min-height: 42px; padding: 0 14px; }
@media (max-width: 900px) {
  .sheet { width: 100vw; max-width: 100vw; max-height: 88dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); animation: sheetup .28s cubic-bezier(.2,.9,.3,1) both; }
  .sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--axis); }
  .f .pair.two { grid-template-columns: 1fr 1fr; }
  .tile-more { width: 44px; height: 44px; top: 4px; right: 4px; }
}
@keyframes sheetup { from { transform: translateY(100%); } }
/* v10 */
.s9 { background: var(--s9); } .k9 { stroke: var(--s9); fill: var(--s9); } .dial-dot.hollow.k9 { stroke: var(--s9); }
.s10 { background: var(--s10); } .k10 { stroke: var(--s10); fill: var(--s10); } .dial-dot.hollow.k10 { stroke: var(--s10); }
.s11 { background: var(--s11); } .k11 { stroke: var(--s11); fill: var(--s11); } .dial-dot.hollow.k11 { stroke: var(--s11); }
.s12 { background: var(--s12); } .k12 { stroke: var(--s12); fill: var(--s12); } .dial-dot.hollow.k12 { stroke: var(--s12); }

/* v11: kaheastmeline sisselogimine */
.twofa { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.twofa .steps { padding-left: 20px; display: grid; gap: 12px; margin: 0 0 12px; }
.twofa .steps .btn, .twofa .steps form { margin-top: 8px; }
.twofa .steps .inline { align-items: center; flex-wrap: wrap; }
code.key { font-size: 16px; letter-spacing: .06em; user-select: all; -webkit-user-select: all; }
input.otp { font: 800 22px var(--font); letter-spacing: .3em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }
.modal input.otp { max-width: none; font-size: 26px; min-height: 56px; }
.codes { background: var(--on-soft); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.codes ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.codes code { display: block; text-align: center; font-size: 15px; padding: 7px 4px; background: var(--surface); user-select: all; -webkit-user-select: all; }
.inset-f { padding: 4px 0 6px !important; }
.authlog { margin-top: 12px; border-top: 1px solid var(--line); }
.authlog > summary, .twofa details.hist > summary { padding-left: 0; padding-right: 0; }
.authlog .log { padding-bottom: 6px; }
.center { text-align: center; margin-top: 10px; }

/* v12: kulu kalender, aastavaade, kuu näidik */
.seg.big { background: var(--surface); box-shadow: var(--shadow); padding: 4px; border-radius: var(--r); }
.seg.big a { padding: 7px 14px; font-size: 13.5px; }
.kpis.three { grid-template-columns: 1.3fr 1fr 1fr; }
.hero-month { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; margin-top: 2px; }
.hero-month:hover { color: var(--accent); }
.hero-month .i { width: 15px; height: 15px; color: var(--accent); }
.ring.gauge .ring-num { font-size: 20px; }
.calnav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: var(--gap); }
.calnav h2 { font-size: 20px; min-width: 190px; justify-content: center; text-transform: capitalize; }
a.btn.sq, span.btn.sq { width: 42px; min-height: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-s); background: var(--surface); box-shadow: var(--shadow); }
span.btn.dis { opacity: .3; box-shadow: none; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cal-d { position: relative; overflow: hidden; aspect-ratio: 1.15; min-height: 54px; border-radius: var(--r-s); background: var(--surface-2); display: flex; flex-direction: column; justify-content: space-between; padding: 7px 8px; text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .15s; animation: fadeup .4s both; }
a.cal-d:hover { transform: translateY(-2px); box-shadow: 0 6px 16px var(--ring); }
.cal-d i { position: absolute; inset: 0; background: var(--on); }
.cal-d b, .cal-d span { position: relative; }
.cal-d b { font-size: 13px; font-weight: 800; }
.cal-d span { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; align-self: flex-end; }
.cal-d.none { background: none; border: 1px dashed var(--line); color: var(--muted); }
.cal-d.none b { font-weight: 600; }
.cal-d.today { outline: 2px solid var(--ink); outline-offset: -2px; }
.ybars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 240px; }
.yb { display: flex; flex-direction: column; align-items: stretch; gap: 5px; text-decoration: none; color: var(--ink); min-width: 0; }
.yb-v { font-size: 11.5px; font-weight: 700; text-align: center; height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yb-bar { flex: 1; display: flex; align-items: flex-end; background: var(--surface-3); border-radius: var(--r-xs); overflow: hidden; }
.yb-bar i { display: block; width: 100%; background: var(--accent); border-radius: var(--r-xs) var(--r-xs) 0 0; transform-origin: bottom; animation: growy .7s cubic-bezier(.2,.8,.2,1) both; min-height: 2px; }
.yb.cur .yb-bar i { background: var(--on); }
.yb.none .yb-bar i { display: none; }
.yb.future { opacity: .45; }
a.yb:hover .yb-bar { background: var(--surface-2); }
.yb-m { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; text-transform: capitalize; }
@media (max-width: 900px) {
  .kpis.three { grid-template-columns: 1fr 1fr; }
  .kpis.three .kpi.hero { grid-column: 1 / -1; }
  .cal { gap: 4px; }
  .cal-d { padding: 5px 5px; min-height: 48px; aspect-ratio: .95; }
  .cal-d span { font-size: 10.5px; }
  .cal-d b { font-size: 12px; }
  .ybars { gap: 3px; height: 200px; }
  .yb-v { font-size: 9.5px; }
  .yb-m { font-size: 10px; }
  .seg.big { width: 100%; }
  .seg.big a { flex: 1; text-align: center; }
}
/* v13: uuenduse riba */
.install.update { bottom: calc(86px + env(safe-area-inset-bottom)); animation-delay: 0s; }
.install.update .install-ic { background: var(--accent); }
@media (min-width: 901px) { .install.update { left: auto; right: 20px; bottom: 20px; margin: 0; width: 420px; } }

/* v15 */
.ring.gauge .ring-num { font-size: 18px; }
.yb-v { font-size: 10.5px; }

/* v16: lülitisse salvestatud reeglid */
.rules .schedlist li { padding: 8px 0; }
.rule-pulse { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-s); margin-bottom: 6px; }
.rule-pulse > div { display: grid; }
.rule-pulse b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.rule-pulse b .i { width: 16px; height: 16px; color: var(--accent); }
.rule-pulse input { width: 80px; text-align: right; }
.rule-none { margin: 6px 0; }
.rules .seg2 + .seg2 { margin-top: -4px; }
.rulegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.rulecard { border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 12px; }
.rulecard > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; font-size: 14px; }
.rulecard[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.rulecard .rules { padding-bottom: 12px; }

/* v17: valgusti aken vahekaartidega, lüliti seaded */
.tab-in { position: absolute; opacity: 0; pointer-events: none; }
.tabbar { position: sticky; top: 64px; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 12px 0 2px; background: var(--surface-2); border-radius: var(--r-s); }
.tabbar label { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 5px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.tabbar label .i { width: 16px; height: 16px; }
.tabbar label:hover { color: var(--ink); }
.tabpane { display: none; animation: fadeup .2s both; }
.tab-ajastus:checked ~ .pane-ajastus, .tab-lyliti:checked ~ .pane-lyliti, .tab-valgusti:checked ~ .pane-valgusti { display: block; }
.tab-ajastus:checked ~ .tabbar .tl-ajastus, .tab-lyliti:checked ~ .tabbar .tl-lyliti, .tab-valgusti:checked ~ .tabbar .tl-valgusti { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tab-in:focus-visible ~ .tabbar { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet-sec h3 .where { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin: -6px 0 10px; }
.swinfo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.swinfo > div { display: grid; gap: 2px; padding: 10px 12px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-s); min-width: 0; }
.swinfo b { font-size: 14px; overflow-wrap: anywhere; }
.wifi { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 20px; }
.bars i { width: 4px; border-radius: 1px; background: var(--axis); }
.bars i.on { background: var(--good); }
.wifi.lvl2 .bars i.on { background: var(--day); }
.wifi.lvl1 .bars i.on { background: var(--bad); }
.setlist { display: grid; gap: 8px; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-s); flex-wrap: wrap; }
.setrow.col { flex-direction: column; align-items: stretch; }
.setrow-t { display: grid; gap: 2px; flex: 1; min-width: 180px; }
.setrow-t b { font-size: 14px; }
.setrow .inline { align-items: center; }
.setrow input[type=number] { width: 80px; text-align: right; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-s); }
.seg3 button { min-height: 40px; background: none; color: var(--muted); font-size: 13.5px; padding: 0 6px; }
.seg3 button .i { width: 15px; height: 15px; }
.seg3 button:hover { background: var(--surface); color: var(--ink); }
.seg3 button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.setlink { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border-radius: var(--r-s); background: var(--surface-3); border: 1px solid var(--line); text-decoration: none; }
.setlink > span { flex: 1; display: grid; }
.setlink > .i:first-child { color: var(--on); }
.setlink:hover { border-color: var(--accent); }
.rule-pulse { display: none; }
.rules .setrow { margin-bottom: 6px; }
@media (max-width: 900px) {
  .tabbar { top: 60px; }
  .swinfo { grid-template-columns: 1fr 1fr; }
  .swinfo > div:first-child { grid-column: 1 / -1; }
}
/* v18: WiFi nupul */
.tile-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wbars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.wbars i { width: 3px; border-radius: 1px; background: var(--axis); }
.wbars i:nth-child(1) { height: 4px; } .wbars i:nth-child(2) { height: 6px; } .wbars i:nth-child(3) { height: 9px; } .wbars i:nth-child(4) { height: 12px; }
.wbars i.on { background: var(--muted); }
.tile.on .wbars i { background: var(--line); } .tile.on .wbars i.on { background: var(--ink-2); }
.wbars.lvl1 i.on, .tile.on .wbars.lvl1 i.on { background: var(--bad); }

/* v19: päev/öö plokk mahub kitsale ekraanile */
.split { flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
.split span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .val, .kpi .split { overflow-wrap: anywhere; }
@media (max-width: 900px) { .split { font-size: 17px; gap: 2px 10px; } .split .i { width: 15px; height: 15px; } }
@media (max-width: 400px) { .split { font-size: 15px; } }

/* v20: lüliti "kustub ise" minutid nupu nurgas, kui tuli on väljas */
.tile-tag.pulse { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-weight: 700; }
.tile-tag.pulse::before { content: ""; width: 13px; height: 13px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 8v5l3 2M9 2h6M12 5a8 8 0 1 0 0 16 8 8 0 0 0 0-16z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 8v5l3 2M9 2h6M12 5a8 8 0 1 0 0 16 8 8 0 0 0 0-16z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* v21: välgu-logo */
.brand .i { padding: 8px; }
.modal-brand .i { width: 24px; height: 24px; }
