/* starlink — plain CSS, mobile first. Same language as Friday: near-black
   surfaces, Space Grotesk for titles, mono numbers, one warm accent; a tab bar
   at the bottom on phones that becomes a side rail on wide screens. */

@font-face { font-family: 'Inter'; src: url('/fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0a0c0f; --surface: #12161b; --surface-2: #1a2027; --track: #161b21;
  --line: #262e37; --line-soft: #1e252d;
  --text: #edeff2; --text-2: #c3cad3; --muted: #8792a0;
  --accent: #f4b740; --accent-soft: rgba(244,183,64,.18);
  --cool: #7b8cff; --cool-soft: rgba(123,140,255,.18);
  --green: #3fb950; --amber: #f4b740; --red: #ff8a7a; --blue: #58a6ff; --purple: #bc8cff;
  /* names the server cards already use */
  --card: var(--surface); --card2: var(--surface-2);
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
/* behave like an app, not a page: no double-tap zoom, no text selection or
   long-press callouts on the UI (fields stay selectable) */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body {
  font: 15px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes breathe { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
@keyframes up { from { transform: translateY(100%) } to { transform: none } }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; max-width: 1240px; margin: 0 auto; }
main { flex: 1; min-width: 0; padding: 0 18px calc(100px + env(safe-area-inset-bottom)); animation: rise .35s ease-out; }
.center { min-height: 80vh; display: grid; place-items: center; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  height: calc(70px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10,12,15,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--surface-2);
}
.tabbar .brand { display: none; }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500;
}
.tabbar a.on { color: var(--accent); }
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 960px) {
  .shell { flex-direction: row; gap: 40px; padding: 0 32px; }
  main { padding: 0 0 48px; }
  .tabbar {
    position: sticky; top: 0; align-self: flex-start; height: 100dvh; width: 210px; flex: none;
    flex-direction: column; gap: 4px; padding: 22px 20px 24px 0; background: none; backdrop-filter: none;
    border-top: 0; border-right: 1px solid var(--surface-2);
  }
  .tabbar .brand { display: flex; align-items: center; gap: 10px; padding: 0 14px 26px; font-family: var(--font-display); font-weight: 600; font-size: 16px; }
  .tabbar a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
  .tabbar a:hover { background: var(--surface); color: var(--text); }
  .tabbar a.on { background: var(--surface); }
}

/* ---------- page head ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 22px 2px 18px; }
.hello h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.hello > div { min-width: 0; }
.hello .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.hello .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sect { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 26px 2px 12px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.card h2 {
  margin: 0 0 14px; font-family: var(--font-display); font-size: 16px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.card h2 span { font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--muted); }
.wide { grid-column: 1 / -1; }
.stale { opacity: .55; transition: opacity .3s; }

.bat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.big { font-family: var(--font-mono); font-size: 56px; font-weight: 500; line-height: 1; letter-spacing: -.03em; }
.big small { font-size: 22px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 500; font-size: 13px; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: breathe 2.4s ease-in-out infinite; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.kv b { color: var(--text); font-weight: 500; text-align: right; font-family: var(--font-mono); }
.meter { position: relative; height: 10px; background: var(--track); border-radius: 5px; margin: 18px 0 6px; }
.meter > div { height: 100%; border-radius: 5px; transition: width .6s ease, background .3s; }
.meter .mark { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--text); opacity: .6; border-radius: 1px; }
.meter .mark.red { background: var(--red); opacity: 1; }
canvas.chart { width: 100%; height: 110px; display: block; margin-top: 14px; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; font-family: var(--font-mono); }
.cores { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; height: 70px; align-items: end; }
.core { background: var(--track); border-radius: 6px; height: 100%; position: relative; overflow: hidden; }
.core > div { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 6px; transition: height .5s ease, background .3s; }
.bar { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; margin: 6px 0 12px; }
.bar > div { height: 100%; background: var(--blue); border-radius: 3px; transition: width .6s ease; }
.row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.row span:first-child { color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 0 0 8px; font-family: var(--font-body); }
td { padding: 7px 0; border-top: 1px solid var(--line-soft); }
td.r, th.r { text-align: right; }
.sysc { margin-top: 16px; }
.sysc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
canvas.syschart { width: 100%; display: block; touch-action: pan-y; cursor: crosshair; margin-bottom: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.net-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.net-ssid { font-family: var(--font-display); font-weight: 600; font-size: 18px; overflow-wrap: anywhere; }
.net-top .s { color: var(--muted); font-size: 12px; }
.sig { display: flex; align-items: flex-end; gap: 3px; height: 22px; flex: none; }
.sig i { width: 6px; background: var(--surface-2); border-radius: 2px; }
.sig[data-q="4"] i.on, .sig[data-q="3"] i.on { background: var(--green); }
.sig[data-q="2"] i.on { background: var(--amber); }
.sig[data-q="1"] i.on { background: var(--red); }
.rates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 10px; }
.rates .lbl { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.rates .k { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.rates .k.rx { background: var(--blue); } .rates .k.tx { background: var(--green); }
.rate { font-family: var(--font-mono); font-size: 22px; font-weight: 500; white-space: nowrap; }
canvas.netchart { width: 100%; height: 96px; display: block; touch-action: pan-y; cursor: crosshair; }
.readout { color: var(--muted); font-size: 12px; margin: 4px 0 12px; min-height: 1.4em; font-family: var(--font-mono); }
.net-rows .row { padding: 6px 0; border-top: 1px solid var(--line-soft); }
.svc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; font-size: 13px; }
.svc div { display: flex; align-items: center; gap: 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 0; height: 44px; padding: 0 18px; border-radius: 22px; font-weight: 600; font-size: 14px;
  cursor: pointer; background: var(--accent); color: var(--bg); transition: transform .08s, opacity .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: none; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover:not(:disabled) { border-color: var(--muted); }
.btn.danger { background: var(--red); color: var(--bg); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 18px; }
.btn.block { width: 100%; height: 54px; border-radius: 27px; font-size: 16px; }
.icon-btn { appearance: none; width: 40px; height: 40px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { appearance: none; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; height: 30px; padding: 0 12px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--line); color: var(--text); }
.seg.wide { display: grid; grid-template-columns: repeat(4, 1fr); }
.seg.wide button { height: 40px; font-size: 13px; padding: 0 4px; }

.switch { position: relative; width: 52px; height: 32px; border: 0; background: none; padding: 0; flex: none; cursor: pointer; }
.switch::before { content: ''; position: absolute; left: 4px; top: 6px; width: 44px; height: 20px; border-radius: 10px; background: var(--line); transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 8px; left: 6px; width: 16px; height: 16px; border-radius: 8px; background: var(--text); transition: left .2s; }
.switch[aria-checked="true"]::before { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 30px; background: var(--bg); }
.switch:disabled { opacity: .5; cursor: default; }

input[type=text], select.field {
  height: 44px; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; font-size: 16px; width: 100%;
}
input[type=text]:focus, select.field:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
select.field {
  -webkit-appearance: none; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238792a0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
.field { display: flex; gap: 10px; }

.list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.list > div:first-child { border-top: 0; padding-top: 0; }
.list .t { font-weight: 500; }
.list .s { color: var(--muted); font-size: 12px; }
.tag { font-size: 11px; font-weight: 500; height: 22px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 11px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: middle; }
.tag.blue { color: var(--accent); border-color: var(--accent-soft); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.user { border-top: 1px solid var(--line-soft); padding: 14px 0; }
.user:first-child { border-top: 0; padding-top: 0; }
.user .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.user .devs { margin: 8px 0 0 2px; }
.user .devs > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; color: var(--muted); }
.audit > div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.audit > div:first-child { border-top: 0; }
.audit .when { color: var(--muted); }

/* ---------- sign-in, enrollment ---------- */
.auth { width: 100%; max-width: 400px; text-align: center; }
.auth .logo { width: 72px; height: 72px; margin: 0 auto 22px; }
.auth h1 { margin: 0 0 8px; font-family: var(--font-display); font-size: 28px; font-weight: 500; }
.auth p { color: var(--muted); margin: 0 0 26px; line-height: 1.5; }
.code { font-family: var(--font-mono); font-size: 50px; font-weight: 500; letter-spacing: .18em; margin: 8px 0 4px; }
.pcoff { margin-top: 20px; }
.pcoff .sect { margin: 0 0 10px; }
.keyline { width: 100%; margin-top: 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 16px; line-height: 1.4; resize: none; word-break: break-all; }
.hint { color: var(--muted); font-size: 12px; margin-top: 16px; line-height: 1.5; }
.err { color: var(--red); margin-top: 14px; min-height: 1.4em; font-size: 14px; }
.scan { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: #000; margin: 0 0 8px; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto; }

/* ---------- dialogs, sheets, toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 40; padding: 20px; }
.dialog { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; max-width: 380px; width: 100%; animation: rise .2s ease-out; }
.dialog h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; }
.dialog p { color: var(--muted); margin: 0 0 20px; }
.dialog .actions { display: flex; gap: 10px; justify-content: flex-end; }
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); animation: up .25s ease-out;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.sheet-head .s { color: var(--muted); font-size: 12px; }
@media (min-width: 700px) {
  .sheet-bg { align-items: center; padding: 20px; }
  .sheet { border-radius: 24px; border-bottom: 1px solid var(--line); padding-bottom: 24px; animation: rise .2s ease-out; }
  .sheet .grab { display: none; }
}
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 14px; z-index: 50;
  font-weight: 500; font-size: 14px; max-width: calc(100vw - 40px); animation: rise .2s ease-out;
}
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* ---------- Casa ---------- */
.rooms { display: grid; gap: 26px 22px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: start; margin-top: 4px; }
.room { min-width: 0; }
.room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 10px; }
.room-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.room-head .s { color: var(--muted); font-size: 12px; font-family: var(--font-mono); }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tile {
  position: relative; text-align: left; appearance: none; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r); padding: 14px; min-height: 148px; display: flex; flex-direction: column; gap: 6px;
  color: var(--text); cursor: pointer; transition: border-color .2s, background .2s;
}
.tile:hover { border-color: #33404d; }
.tile .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tile .ico { width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.tile .ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile .name { font-weight: 500; font-size: 14px; margin-top: auto; line-height: 1.25; }
.tile .state { font-size: 12px; color: var(--muted); }
.tile .val { font-family: var(--font-mono); font-size: 30px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.tile .val small { font-size: 14px; color: var(--muted); margin-left: 2px; }
.tile.on { border-color: var(--accent-soft); background: linear-gradient(180deg, rgba(244,183,64,.07), var(--surface) 70%); }
.tile.on .ico { background: var(--accent-soft); color: var(--accent); }
.tile.on.cool { border-color: var(--cool-soft); background: linear-gradient(180deg, rgba(123,140,255,.08), var(--surface) 70%); }
.tile.on.cool .ico { background: var(--cool-soft); color: var(--cool); }
.tile .alert { color: var(--red); }
.tile.pending { opacity: .75; }
.tile .act { margin-top: 4px; }
.home-empty { color: var(--muted); font-size: 14px; padding: 24px 0; }

/* the air conditioner sheet */
.dial { position: relative; width: min(100%, 280px); aspect-ratio: 1; margin: 0 auto; }
.dial svg { width: 100%; height: 100%; display: block; }
.dial .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; pointer-events: none; }
.dial .t { font-family: var(--font-mono); font-size: 54px; font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.dial .t small { font-size: 20px; color: var(--muted); }
.dial .s { font-size: 12px; color: var(--muted); }
.dial-btns { display: flex; justify-content: center; gap: 70px; margin: -38px 0 18px; position: relative; }
.dial-btns .icon-btn { width: 52px; height: 52px; border-radius: 26px; }
.dial-btns .icon-btn svg { width: 22px; height: 22px; }
.ctl { display: grid; gap: 14px; }
.ctl label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ac-off .dial, .ac-off .dial-btns, .ac-off .ctl { opacity: .35; pointer-events: none; }
.sheet .foot { color: var(--muted); font-size: 12px; margin-top: 16px; font-family: var(--font-mono); }
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fr > div { background: var(--surface-2); border-radius: 14px; padding: 14px; }
.fr .s { color: var(--muted); font-size: 12px; }
.fr .v { font-family: var(--font-mono); font-size: 34px; font-weight: 500; letter-spacing: -.02em; }
.fr .v small { font-size: 16px; color: var(--muted); }
.fr-btns { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.fr-btns .icon-btn { width: 44px; height: 44px; border-radius: 22px; }
.tv-now { background: var(--surface-2); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.tv-now .s, .tv-vol .s { color: var(--muted); font-size: 12px; }
.tv-now .app { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.tv-now.off .app { color: var(--muted); font-size: 17px; }
.tv-vol { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 14px; padding: 14px; }
.tv-vol .v { font-size: 30px; font-weight: 500; }
.tv-vol .v small { font-size: 14px; color: var(--muted); }
.tv-vol .fr-btns { margin-top: 0; }
.tv-vol.off { opacity: .5; }
.fr-btns .icon-btn:disabled { opacity: .35; cursor: default; }
.fr-rows { margin-top: 10px; background: var(--surface-2); border-radius: 14px; padding: 0 14px; }
.fr-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; font-size: 14px; }
.fr-row + .fr-row { border-top: 1px solid var(--line-soft); }
.fr-row .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* the organize sheet */
.org-room { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.org-dev { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.org-dev .s { color: var(--muted); font-size: 12px; }
.org-add { display: grid; gap: 8px; margin-top: 10px; }
.sheet h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 22px 0 10px; }

/* energy, tariffs */
.tline { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.linkish { appearance: none; border: 0; background: none; color: var(--accent); font: inherit; font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0; flex: none; }
.tar { padding: 12px 0; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; }
.tar:first-of-type { border-top: 0; }
.tar-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.tar label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tar .icon-btn { width: 44px; height: 44px; border-radius: 22px; }
input[type=date] {
  height: 44px; width: 100%; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 10px; font-family: var(--font-mono); font-size: 16px; -webkit-appearance: none; appearance: none; color-scheme: dark;
}
input[type=date]:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
canvas.echart { width: 100%; height: 160px; display: block; touch-action: pan-y; cursor: crosshair; }
.elegend { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px; font-family: var(--font-mono); }
.elegend span { display: inline-flex; align-items: center; gap: 6px; }
.elegend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

@media (max-width: 560px) {
  main { padding-left: 14px; padding-right: 14px; }
  .grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .rooms { grid-template-columns: 1fr; }
  .big { font-size: 50px; }
  .hello h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
