/* Thin Web — веб-панель. */
:root {
  --bg: #0d1117; --panel: #161b22; --line: #30363d; --line-soft: rgba(255,255,255,0.08);
  --fg: #e6edf3; --fg-strong: #f0f6fc; --muted: #8b949e; --dim: #6e7681;
  --green: #3fb950; --green-soft: #7ee787; --red: #f85149; --red-soft: #ff7b72;
  --blue: #388bfd; --blue-soft: #79c0ff; --amber: #d29922; --amber-soft: #e3b341; --orange: #ff9e57;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 15% 0%, rgba(56,99,180,0.22), transparent 55%),
                    radial-gradient(ellipse at 100% 100%, rgba(32,140,120,0.14), transparent 50%);
  background-attachment: fixed;
  color: var(--fg);
  font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue-soft); }
.wrap { max-width: 1500px; margin: 0 auto; padding: 36px 48px 40px; }

/* верх */
.top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.clock { font-size: 56px; font-weight: 300; letter-spacing: -1px; color: var(--fg-strong); line-height: 1.05; }
.date { color: var(--muted); font-size: 16px; }
.spacer { flex: 1; }
.chip { background: rgba(255,255,255,0.06); border: 1px solid var(--line-soft); border-radius: 999px;
        padding: 8px 16px; color: #c9d1d9; font-size: 14px; white-space: nowrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.06);
       border: 1px solid var(--line-soft); border-radius: 14px; padding: 9px 14px; cursor: pointer;
       font-size: 14px; color: var(--fg); text-decoration: none; }
.btn:hover { background: rgba(255,255,255,0.12); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: #238636; border-color: transparent; color: #fff; }
.btn.primary:hover { background: #2ea043; }
.btn.danger { background: transparent; color: var(--red); border-color: rgba(248,81,73,0.4); }
.btn.flat { background: transparent; border-color: var(--line); color: #c9d1d9; }
.btn:disabled { opacity: .5; cursor: default; }

.section { font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--dim);
           text-transform: uppercase; margin: 30px 0 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.banner { margin-top: 24px; border: 1px solid rgba(248,81,73,0.5); background: rgba(248,81,73,0.08);
          color: #ffdcd7; border-radius: 14px; padding: 12px 16px; }

/* VPN и сессии */
.pill { display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.09); border-radius: 14px; padding: 9px 14px; cursor: pointer;
        user-select: none; }
.pill:hover { background: rgba(255,255,255,0.10); border-color: rgba(121,192,255,0.45); }
.pill.up { border-color: rgba(63,185,80,0.45); background: rgba(46,160,67,0.08); }
.pill.connecting { border-color: rgba(210,153,34,0.5); }
.pill.error { border-color: rgba(248,81,73,0.5); }
.pill.add { border-style: dashed; background: transparent; color: var(--muted); }
.pill.static { cursor: default; }
.pill .name { font-weight: 500; color: var(--fg-strong); }
.pill .kind { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.pill .ip { font-family: var(--mono); font-size: 13px; color: var(--green-soft); }
.pill .err { font-size: 13px; color: var(--red-soft); max-width: 340px; overflow: hidden;
             text-overflow: ellipsis; white-space: nowrap; }
.pill .x { color: var(--dim); padding: 0 2px 0 6px; background: none; border: 0; cursor: pointer; font-size: 15px; }
.pill .x:hover { color: var(--red); }
.pill .edit { color: var(--dim); background: none; border: 0; cursor: pointer; padding: 0 0 0 4px; display: flex; }
.pill .edit:hover { color: var(--fg); }
.pill .edit svg { width: 15px; height: 15px; }
.dot { width: 9px; height: 9px; border-radius: 99px; background: #484f58; flex: none; }
.dot.up { background: var(--green); box-shadow: 0 0 8px rgba(63,185,80,0.9); }
.dot.down, .dot.error { background: var(--red); }
.dot.connecting { background: var(--amber); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .35 } to { opacity: 1 } }

/* плитки */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile { position: relative; background-color: rgba(255,255,255,0.045); border: 1px solid var(--line-soft);
        border-radius: 22px; padding: 22px; min-height: 168px; display: flex; flex-direction: column;
        gap: 12px; cursor: pointer; transition: border-color .12s, background-color .12s; outline: none; }
.tile:hover, .tile:focus-visible { border-color: rgba(121,192,255,0.65); background-color: rgba(255,255,255,0.075); }
.tile.live { border-color: rgba(63,185,80,0.45); }
.tile.add { border-style: dashed; background: transparent; align-items: center; justify-content: center;
            color: var(--muted); font-size: 18px; }
.tile.add .plus { font-size: 40px; font-weight: 200; color: var(--dim); line-height: 1; }
.tile .head { display: flex; align-items: flex-start; gap: 12px; }
.avatar { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
          font-size: 22px; font-weight: 700; flex: none; }
.badge { margin-left: auto; border-radius: 8px; padding: 3px 9px; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
.rdp .avatar, .badge.rdp { background: rgba(56,139,253,0.16); color: var(--blue-soft); }
.ssh .avatar, .badge.ssh { background: rgba(46,160,67,0.16); color: var(--green-soft); }
.vnc .avatar, .badge.vnc { background: rgba(210,153,34,0.16); color: var(--amber-soft); }
.pve .avatar, .badge.pve { background: rgba(229,83,0,0.16); color: var(--orange); }
.tile .name { font-size: 20px; font-weight: 600; color: var(--fg-strong); overflow: hidden;
              text-overflow: ellipsis; white-space: nowrap; }
.tile .host { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow: hidden;
              text-overflow: ellipsis; white-space: nowrap; margin-top: -6px; }
.tile .foot { margin-top: auto; display: flex; align-items: center; gap: 8px; min-height: 30px; }
.tile .status { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tile .status.live { color: var(--green-soft); }
.tile .via { font-size: 12px; color: var(--muted); background: rgba(255,255,255,0.06); border-radius: 7px;
             padding: 2px 8px; max-width: 130px; min-width: 0; flex-shrink: 1; overflow: hidden;
             text-overflow: ellipsis; white-space: nowrap; }
.tile .via.up { color: var(--green-soft); background: rgba(46,160,67,0.12); }
.tile .acts { margin-left: auto; display: flex; gap: 4px; }
.iconbtn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid transparent; background: transparent;
           color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.iconbtn:hover { background: rgba(255,255,255,0.10); color: var(--fg); border-color: var(--line-soft); }
.iconbtn svg { width: 17px; height: 17px; }

.hint { color: var(--dim); font-size: 13px; margin-top: 28px; }
.kbd { background: rgba(255,255,255,0.08); border-radius: 6px; padding: 2px 7px; color: #c9d1d9; font-size: 12px; }

/* диалоги */
dialog { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 18px;
         padding: 26px 28px; width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(1,4,9,0.65); backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
dialog .note { color: var(--dim); font-size: 13px; margin: 0 0 14px; }
.form { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; align-items: center; margin: 14px 0 20px; }
.form label.f { color: var(--muted); font-size: 13px; text-align: right; }
.form .full { grid-column: 1 / -1; }
.form > .actions, .form > .banner { grid-column: 1 / -1; }
.form > .actions { justify-content: flex-end; margin-top: 4px; }
.form input[type=text], .form input[type=password], .form input[type=number], .form select, .form textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
  outline: none; min-width: 0; }
.form textarea { font-family: var(--mono); font-size: 12px; min-height: 120px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--blue); }
.form .check { display: flex; gap: 8px; align-items: flex-start; color: #c9d1d9; font-size: 14px; }
.form .sub { color: var(--dim); font-size: 12px; margin-top: 4px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions .spacer { flex: 1; }

/* тосты */
#toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex;
          flex-direction: column; gap: 8px; z-index: 50; width: min(720px, calc(100vw - 32px)); }
.toast { background: #1f2937; border: 1px solid rgba(248,81,73,0.5); border-radius: 14px; padding: 12px 18px;
         color: #ffdcd7; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.toast.ok { border-color: rgba(63,185,80,0.5); color: #d2f8d9; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(400px, 100%); background: rgba(22,27,34,0.85); border: 1px solid var(--line);
               border-radius: 22px; padding: 30px 28px; }
.login h1 { margin: 0; font-size: 22px; font-weight: 600; }
.login .sub { color: var(--muted); margin: 4px 0 22px; font-size: 14px; }
.login input { width: 100%; margin-bottom: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
               padding: 12px 14px; outline: none; font-size: 16px; }
.login input:focus { border-color: var(--blue); }
.login .remember { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 4px 0 0; cursor: pointer; }
.login .remember[hidden] { display: none; }
.login .remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.login .btn { width: 100%; justify-content: center; margin-top: 14px; padding: 12px; font-size: 15px; }
.login .msg { min-height: 22px; color: var(--red-soft); font-size: 14px; margin-top: 10px; }

/* вкладки */
.tabs { display: flex; gap: 4px; margin-top: 28px; border-bottom: 1px solid var(--line-soft); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; cursor: pointer;
       color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: -1px; }
.tab:hover { color: var(--fg); }
.tab.on { color: var(--fg-strong); border-bottom-color: var(--blue); }
.who { display: inline-flex; align-items: center; gap: 8px; }
.role { font-size: 11px; font-weight: 700; letter-spacing: 1px; border-radius: 7px; padding: 2px 7px;
        background: rgba(56,139,253,0.15); color: var(--blue-soft); text-transform: uppercase; }
.role.user { background: rgba(255,255,255,0.08); color: var(--muted); }
.role.wall { background: rgba(88,166,255,0.14); color: #79c0ff; }
.pill .who { font-size: 12px; color: var(--muted); }

/* таблицы: пользователи, журнал */
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.tbl th { text-align: left; color: var(--dim); font-weight: 600; font-size: 12px; letter-spacing: 1px;
          text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr.off td { opacity: .5; }
.tbl .mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.tbl .ev { font-weight: 500; }
.tbl .ev.bad { color: var(--red-soft); }
.tbl .ev.good { color: var(--green-soft); }
.tbl td.r { text-align: right; white-space: nowrap; }
.tblwrap { overflow-x: auto; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.toolbar input { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px;
                 outline: none; min-width: 220px; }
.checks { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow: auto;
          border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); }
.pwrow { display: flex; gap: 8px; }
.pwrow input { flex: 1; }

/* вкладка «Сервер»: нагрузка */
.gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gauge { background: rgba(255,255,255,0.045); border: 1px solid var(--line-soft); border-radius: 18px;
         padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ring { --pct: 0; --c: var(--green); width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center;
        background: conic-gradient(var(--c) calc(var(--pct) * 1%), rgba(255,255,255,0.08) 0); }
.ring.warn { --c: var(--amber); }
.ring.bad { --c: var(--red); }
.ring span { width: 70px; height: 70px; border-radius: 50%; background: var(--panel); display: grid;
             place-items: center; font-size: 17px; font-weight: 600; color: var(--fg-strong); }
.ring.flat { background: rgba(56,139,253,0.14); }
.ring.flat span { font-size: 15px; font-family: var(--mono); }
.gauge .lbl { font-size: 13px; color: var(--muted); text-align: center; }
.gauge .lbl b { display: block; font-weight: 400; color: var(--dim); font-size: 12px; }

/* вкладка «Сервер»: службы, настройки */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cards.two { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.card { background: rgba(255,255,255,0.045); border: 1px solid var(--line-soft); border-radius: 18px; padding: 18px; }
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--fg-strong); }
.card .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card .meta { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.card .note { color: var(--dim); font-size: 13px; margin: 8px 0 0; }
.card .actions { margin-top: 14px; }
.card .form { margin: 12px 0 14px; grid-template-columns: 110px 1fr; }
.state { font-size: 11px; font-weight: 700; letter-spacing: 1px; border-radius: 7px; padding: 3px 8px;
         text-transform: uppercase; background: rgba(255,255,255,0.08); color: var(--muted); }
.state.on { background: rgba(46,160,67,0.16); color: var(--green-soft); }
.state.off { background: rgba(248,81,73,0.12); color: var(--red-soft); }
.note-box { margin-top: 24px; border: 1px dashed var(--line); border-radius: 14px; padding: 14px 16px; color: var(--muted); }
.tbl .routes { font-family: var(--mono); font-size: 13px; color: var(--blue-soft); }
.tbl td .dot { display: inline-block; margin-right: 8px; vertical-align: middle; }
.toolbar .sub { color: var(--dim); font-size: 13px; }

/* подключение клиента: QR */
.qr { display: flex; justify-content: center; margin: 6px 0 10px; }
.qr img { width: min(300px, 70vw); height: auto; image-rendering: pixelated; border-radius: 12px;
          background: #fff; padding: 10px; }
dialog details { margin-top: 10px; color: #c9d1d9; font-size: 14px; }
dialog details summary { cursor: pointer; color: var(--muted); }
dialog details textarea { width: 100%; margin-top: 8px; background: var(--bg); border: 1px solid var(--line);
                          border-radius: 10px; padding: 9px 11px; font-family: var(--mono); font-size: 12px;
                          min-height: 190px; resize: vertical; white-space: pre; }
dialog details ol { margin: 8px 0 0; padding-left: 20px; }
dialog .warnbox { border: 1px solid rgba(210,153,34,0.5); background: rgba(210,153,34,0.08); color: #f2dfae;
                  border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 10px; }

/* ───────── камеры (в духе DS Cam) ───────── */
.cv { position: relative; display: flex; flex-direction: column; margin-top: 18px; background: #0b0e13; border: 1px solid var(--line-soft);
      border-radius: 16px; overflow: hidden; height: calc(100vh - 230px); min-height: 540px; }
.cv-top { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #161b22;
          border-bottom: 1px solid var(--line-soft); flex: none; }
.cv-ib { width: 42px; height: 42px; border: 0; background: none; border-radius: 10px; color: #58a6ff; cursor: pointer;
         display: grid; place-items: center; padding: 0; flex: none; }
.cv-ib:hover { background: rgba(255,255,255,0.07); }
.cv-ib svg { width: 26px; height: 26px; }
.cv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 6px; }
.cv-title b { font-size: 18px; font-weight: 600; color: var(--fg-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-title span { font-size: 13px; color: var(--muted); }
.cv-body { flex: 1; min-height: 0; display: flex; }
.cv-side { width: 230px; flex: none; overflow: auto; border-right: 1px solid var(--line-soft); padding: 8px;
           display: flex; flex-direction: column; gap: 2px; background: #0f1319; }
.cv-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0;
           border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--fg); font-size: 15px; }
.cv-item:hover { background: rgba(255,255,255,0.06); }
.cv-item.on { background: rgba(56,139,253,0.16); color: var(--fg-strong); }
.cv-item .txt { display: flex; flex-direction: column; min-width: 0; }
.cv-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-item .st { font-size: 12px; color: var(--red-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-item.plain { color: #c9d1d9; }
.cv-ico { width: 20px; height: 20px; display: grid; place-items: center; color: var(--muted); flex: none; }
.cv-ico svg { width: 18px; height: 18px; }
.cv-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.rdot { width: 10px; height: 10px; border-radius: 50%; background: #484f58; flex: none; display: inline-block; }
.rdot.on { background: #f85149; box-shadow: 0 0 6px rgba(248,81,73,0.8); }
.rdot.bad { background: var(--amber); }
.cv-stage { flex: 1; min-width: 0; overflow: auto; background: #000; position: relative; }
.cv-empty { color: var(--muted); padding: 80px 20px; text-align: center; }
.cv-grid { display: grid; gap: 2px; align-content: start; }
.cv-grid.l1 { grid-template-columns: 1fr; }
.cv-grid.l2 { grid-template-columns: 1fr; }
.cv-grid.l4 { grid-template-columns: repeat(2, 1fr); }
.cv-grid.l9 { grid-template-columns: repeat(3, 1fr); }
.ct { display: flex; flex-direction: column; background: #000; min-width: 0; }
.ct-head { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: #1c2128; color: #f0f6fc;
           font-size: 14px; font-weight: 600; }
.ct-head .nm { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-head .warn { font-size: 12px; font-weight: 500; color: var(--amber-soft); min-width: 10px; }
.ct-v { position: relative; aspect-ratio: 16 / 9; background: #000; cursor: pointer; overflow: hidden; }
.ct-v video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.ct-v:fullscreen { aspect-ratio: auto; }
.ct-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 86%; text-align: center;
          color: #c9d1d9; font-size: 13px; background: rgba(0,0,0,0.6); border-radius: 10px; padding: 8px 12px; }
.ct-msg[hidden] { display: none; }
.cv.single .ct-head { display: none; }
/* компьютер: сетка камер — по высоте окна, без прокрутки */
body:not(.cams-app) .cv:not(.single) .cv-grid { height: 100%; grid-auto-rows: minmax(0, 1fr); }
body:not(.cams-app) .cv:not(.single) .ct { min-height: 0; }
body:not(.cams-app) .cv:not(.single) .ct-v { flex: 1; aspect-ratio: auto; min-height: 0; }
body:not(.cams-app) .cv:not(.single) .cv-stage:has(.cv-dots) .cv-grid { height: calc(100% - 28px); }
.cv.single .cv-stage { display: flex; flex-direction: column; justify-content: center; }
.cv.single .cv-grid { flex: 1; align-content: center; }
.cv.single .ct-v { cursor: default; max-height: calc(100vh - 380px); aspect-ratio: auto; height: 100%; min-height: 220px; }
/* компьютер: одна камера — на всю площадь окна (раньше высота 100% от «авто» схлопывалась до минимума) */
body:not(.cams-app) .cv.single .cv-grid { display: flex; flex-direction: column; min-height: 0; }
body:not(.cams-app) .cv.single .ct { flex: 1; min-height: 0; }
body:not(.cams-app) .cv.single .ct-v { flex: 1; height: auto; max-height: none; min-height: 220px; }
.cv-dots { display: flex; justify-content: center; gap: 8px; padding: 10px; }
.cv-dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: #484f58; cursor: pointer; }
.cv-dots button.on { background: #58a6ff; }
.cv-setup { padding: 4px 16px 20px; background: var(--bg); min-height: 100%; }

.cv-dock { flex: none; background: #161b22; border-top: 1px solid var(--line-soft); user-select: none; }
.cv-ctl { display: flex; align-items: center; gap: 8px; padding: 10px 10px 2px; }
.cv-btn { min-width: 46px; height: 36px; border: 0; border-radius: 6px; background: #30363d; color: #f0f6fc;
          font-weight: 600; font-size: 15px; cursor: pointer; display: grid; place-items: center; padding: 0 10px; }
.cv-btn svg { width: 20px; height: 20px; }
.cv-btn:disabled { opacity: .45; cursor: default; }
.cv-btn.wide { flex: 1; font-weight: 500; font-size: 14px; }
.cv-live { background: #1f6feb; color: #fff; font-weight: 700; letter-spacing: .5px; }
.cv-live.off { background: #30363d; color: #c9d1d9; }
.cv-bubble { position: relative; background: #f0f6fc; color: #1f6feb; border-radius: 6px; padding: 6px 16px;
             font: 600 18px/1.2 var(--mono); white-space: nowrap; }
.cv-bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
                    border: 7px solid transparent; border-top-color: #f0f6fc; border-bottom: 0; }
.cv-bubble.live { color: #cf222e; }
.cv-tl { position: relative; height: 84px; overflow: hidden; cursor: grab; touch-action: none; margin-top: 4px; }
.cv-tl:active { cursor: grabbing; }
.cv-tl .bar { position: absolute; left: 0; right: 0; top: 50px; height: 34px; background: #2d333b; }
.cv-tl .blk { position: absolute; top: 50px; height: 34px; background: #6e7681; }
.cv-tl .mot { position: absolute; top: 50px; height: 34px; background: #f0883e; }
.cv-act button.ev { color: #f0883e; }
.cv-act button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cv-act button[hidden] { display: none; }
.cv-tl .fut { position: absolute; top: 50px; height: 34px;
              background: repeating-linear-gradient(135deg, #2d333b 0 5px, #3d444d 5px 10px); }
.cv-tl .sel { position: absolute; top: 46px; height: 42px; background: rgba(31,111,235,0.45);
              border-left: 2px solid #58a6ff; border-right: 2px solid #58a6ff; }
.cv-tl .tk { position: absolute; top: 36px; height: 14px; border-left: 2px solid #8b949e; }
.cv-tl .tk.small { top: 42px; height: 8px; border-left-width: 1px; border-color: #6e7681; }
.cv-tl .tk span { position: absolute; top: -32px; left: 0; transform: translateX(-50%); color: #b1bac4;
                  font-size: 15px; white-space: nowrap; }
.cv-tl .center { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff;
                 box-shadow: 0 0 4px rgba(0,0,0,0.6); pointer-events: none; }
.cv-act { display: flex; justify-content: space-around; gap: 2px; padding: 8px 4px 10px; border-top: 1px solid #0d1117; }
.cv-act button { flex: 1; background: none; border: 0; color: #f0f6fc; display: flex; flex-direction: column; align-items: center;
                 gap: 4px; font-size: 12px; cursor: pointer; padding: 4px 0; min-width: 0; }
.cv-act button svg { width: 30px; height: 30px; }
.cv-act button:disabled { color: #545d68; cursor: default; }
.cv-export { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-bottom: 1px solid #0d1117; background: #1c2128; }
.cv-export b { font-size: 15px; }
.cv-export select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.cv-export .row2 { display: flex; gap: 8px; }
.cv-layer { position: absolute; inset: 0; z-index: 20; background: rgba(1,4,9,0.6); }
.cv-layer.drawer .cv-panel { position: absolute; left: 0; top: 0; bottom: 0; width: min(82%, 320px); background: #161b22;
                             overflow: auto; padding: calc(env(safe-area-inset-top) + 12px) 10px 20px;
                             box-shadow: 4px 0 24px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 2px; }
.cv-who { color: var(--muted); font-size: 13px; padding: 4px 12px 10px; }
.cv-layer.menu .cv-sheet-box { position: absolute; right: 8px; top: calc(env(safe-area-inset-top) + 54px); min-width: 230px;
                               background: #1c2128; border: 1px solid var(--line); border-radius: 12px; padding: 6px;
                               box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.cv-mi { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; color: var(--fg);
         padding: 11px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; text-align: left; }
.cv-mi:hover { background: rgba(255,255,255,0.06); }
.cv-mi svg { width: 20px; height: 20px; color: #58a6ff; flex: none; }

/* телефон: камеры — на весь экран, как отдельное приложение */
body.cams-app { overflow: hidden; }
body.cams-app .wrap > .side, body.cams-app #banners { display: none !important; }
body.cams-app .cv { position: fixed; inset: 0; margin: 0; border: 0; border-radius: 0; height: auto; min-height: 0; z-index: 10;
                    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); background: #000; }
body.cams-app .cv-side { display: none; }
body.cams-app .cv.single .ct-v { max-height: none; }

.setup { display: flex; flex-direction: column; gap: 16px; }
.cv-setup .card { max-width: 720px; margin-top: 16px; }
.banner.inline { margin: 0; padding: 7px 12px; font-size: 13px; }
.probe { display: flex; flex-direction: column; gap: 4px; margin: -6px 0 12px; font-size: 13px; }
.probe .good { color: var(--green-soft); }
.probe .bad { color: var(--red-soft); }
.checks.flat { max-height: none; }

/* телефон как приложение (PWA): вырезы экрана */
@supports (padding: max(0px)) {
  .wrap { padding-top: max(36px, calc(env(safe-area-inset-top) + 12px));
          padding-left: max(48px, env(safe-area-inset-left)); padding-right: max(48px, env(safe-area-inset-right)); }
}

@media (max-width: 640px) {
  @supports (padding: max(0px)) {
    .wrap { padding-top: max(20px, calc(env(safe-area-inset-top) + 8px)); padding-bottom: 32px;
            padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  }
  /* шапка на телефоне — компактно, одной строкой */
  .top { align-items: center; flex-wrap: nowrap; gap: 8px; }
  .top .clock { font-size: 30px; }
  .top .date { display: none; }
  .top .chip { padding: 6px 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .top .chip .role { display: none; }
  .top .btn { padding: 7px 10px; font-size: 13px; }
  .tabs { margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
  .tab { white-space: nowrap; }
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .cards, .cards.two { grid-template-columns: 1fr; }
  .card .form { grid-template-columns: 1fr; }
  #clients td.r { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
  #clients td.r .btn { justify-content: center; padding: 7px 10px; }
  #clients td:first-child { word-break: break-word; }
  .tbl .hide-sm { display: none; }
  .clock { font-size: 40px; }
  .top .chip.hide-sm { display: none; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .tile { min-height: 0; padding: 16px; }
  .form { grid-template-columns: 1fr; }
  .form label.f { text-align: left; margin-bottom: -6px; }
  .hint { display: none; }
}

/* ───────────── файлы ───────────── */
dialog.wide { width: min(820px, calc(100vw - 32px)); }
.fm { position: relative; margin-top: 18px; background: rgba(22,27,34,0.7); border: 1px solid var(--line);
      border-radius: 16px; overflow: hidden; }
.fm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px;
          border-bottom: 1px solid var(--line-soft); }
.fm-crumbs { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 200px; overflow-x: auto;
             scrollbar-width: none; white-space: nowrap; }
.fm-crumbs.small { margin: 6px 0 10px; }
.fm-crumb { background: none; border: 0; color: #c9d1d9; padding: 6px 8px; border-radius: 8px; cursor: pointer;
            display: inline-flex; align-items: center; gap: 6px; font-weight: 500; max-width: 220px;
            overflow: hidden; text-overflow: ellipsis; }
.fm-crumb:last-child { color: var(--fg-strong); }
.fm-crumb:hover { background: rgba(255,255,255,0.07); }
.fm-crumb svg { width: 18px; height: 18px; flex: none; }
.fm-sep { color: var(--dim); }
.fm-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.fm-tools .btn { padding: 7px 12px; font-size: 14px; position: relative; }
.fm-badge { position: absolute; top: -6px; right: -6px; background: var(--blue); color: #fff; font-size: 11px;
            min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; }
.fm-selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px;
             background: rgba(56,139,253,0.1); border-bottom: 1px solid rgba(56,139,253,0.3); }
.fm-selbar .btn { padding: 6px 11px; font-size: 13px; }
.fm-seln { font-weight: 600; margin-right: 6px; }
.fm-row { display: grid; grid-template-columns: 36px 34px minmax(0, 1fr) 100px 150px 40px; align-items: center;
          gap: 8px; padding: 6px 10px 6px 4px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.fm-row:hover { background: rgba(255,255,255,0.04); }
.fm-row.sel { background: rgba(56,139,253,0.12); }
.fm-head { cursor: default; color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
.fm-head:hover { background: none; }
.fm-h { background: none; border: 0; color: inherit; text-align: left; padding: 0; cursor: pointer; font-size: 13px; }
.fm-h.on { color: var(--fg-strong); font-weight: 600; }
.fm-cb { display: grid; place-items: center; height: 36px; cursor: pointer; }
.fm-cb input { width: 17px; height: 17px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.fm-ic { width: 30px; height: 30px; display: grid; place-items: center; }
.fm-ic svg { width: 30px; height: 30px; }
.fm-nm { min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fm-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; }
.fm-nm small { display: none; width: 100%; color: var(--dim); font-size: 12px; }
.fm-shared { color: var(--blue-soft); display: inline-grid; }
.fm-shared svg { width: 15px; height: 15px; }
.fm-sz, .fm-dt { color: var(--muted); font-size: 13px; white-space: nowrap; }
.fm-sz { text-align: right; }
.fm-head .fm-sz { text-align: right; }
.fm-more, .fm-ib { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: #c9d1d9;
                   display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.fm-more:hover, .fm-ib:hover { background: rgba(255,255,255,0.08); }
.fm-more svg, .fm-ib svg { width: 19px; height: 19px; }
.fm-ib.danger { color: var(--red-soft); }
.fm-ib:disabled { opacity: .4; }
.fm-empty { padding: 48px 20px; text-align: center; color: #c9d1d9; }
.fm-empty .sub { color: var(--dim); font-size: 13px; margin-top: 6px; }
.fm-foot { padding: 10px 16px; color: var(--dim); font-size: 12px; white-space: pre-wrap; }
.fm-drop { position: absolute; inset: 0; background: rgba(13,17,23,0.85); border: 2px dashed var(--blue);
           border-radius: 16px; display: grid; place-items: center; font-size: 18px; color: var(--blue-soft);
           pointer-events: none; z-index: 5; }
.fm-menu { position: fixed; z-index: 60; background: #1c2128; border: 1px solid var(--line); border-radius: 12px;
           padding: 6px; min-width: 210px; box-shadow: 0 12px 34px rgba(0,0,0,0.5); }
.fm-menu.sheet { left: 0; right: 0; bottom: 0; top: auto; border-radius: 18px 18px 0 0; padding: 8px 8px
                 max(14px, env(safe-area-inset-bottom)); min-width: 0; }
.fm-menu-t { padding: 8px 12px 10px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.fm-menu-hint { color: var(--dim); font-size: 12px; padding: 6px 12px 4px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
.fm-mi { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; color: #e6edf3;
         padding: 9px 12px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; }
.fm-menu.sheet .fm-mi { padding: 13px 14px; font-size: 16px; }
.fm-mi:hover { background: rgba(255,255,255,0.07); }
.fm-mi svg { width: 18px; height: 18px; color: var(--muted); }
.fm-mi.danger, .fm-mi.danger svg { color: var(--red-soft); }
.fm-pick { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px;
           min-height: 120px; padding: 4px; }
.fm-pick .sub { color: var(--dim); font-size: 13px; padding: 14px; }
.fm-pick-i { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0;
             padding: 7px 10px; border-radius: 8px; cursor: pointer; text-align: left; color: inherit; }
.fm-pick-i:hover { background: rgba(255,255,255,0.06); }
.fm-ups { position: fixed; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 32px)); z-index: 40;
          background: #1c2128; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(0,0,0,0.5); }
.fm-ups-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px;
            border-bottom: 1px solid var(--line-soft); }
.fm-ups-l { max-height: 40vh; overflow: auto; padding: 6px 12px 10px; }
.fm-up { padding: 6px 0; }
.fm-up-n { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-up-s { font-size: 12px; color: var(--muted); }
.fm-up.err .fm-up-s { color: var(--red-soft); }
.fm-bar-p { height: 4px; background: #30363d; border-radius: 2px; overflow: hidden; margin-top: 5px; }
.fm-bar-p i { display: block; height: 100%; background: var(--blue); transition: width .3s; }
.fm-up.done .fm-bar-p i, .fm-task.complete .fm-bar-p i { background: var(--green); }
.fm-up.err .fm-bar-p i, .fm-task.error .fm-bar-p i { background: var(--red); }
.fm-tasks { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 18px; max-height: 60vh; overflow: auto; }
.fm-tasks .sub { color: var(--dim); font-size: 13px; }
.fm-task { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.fm-task-t { display: flex; align-items: center; gap: 8px; }
.fm-task-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fm-task-b { display: flex; gap: 2px; }
.fm-task-s { font-size: 12px; color: var(--muted); margin-top: 6px; }
.fm-task.error .fm-task-s { color: var(--red-soft); }
.fm-links { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 6px; }
.fm-links-h { color: var(--muted); font-size: 13px; }
.fm-links .sub { color: var(--dim); font-size: 13px; }
.fm-link { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.fm-link-m { flex: 1; min-width: 0; }
.fm-link input, .fm-made-l input { width: 100%; background: none; border: 0; color: var(--blue-soft); font: 13px var(--mono);
                                   outline: none; padding: 0; text-overflow: ellipsis; }
.fm-link .sub { color: var(--dim); font-size: 12px; margin-top: 2px; }
.fm-made-b { border: 1px solid rgba(63,185,80,0.45); background: rgba(63,185,80,0.07); border-radius: 12px;
             padding: 12px; margin: 12px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fm-made-l { display: flex; gap: 10px; align-items: center; width: 100%; }
.fm-made-l input { font-size: 15px; flex: 1; min-width: 0; }
.fm-qr { width: 150px; height: 150px; image-rendering: pixelated; background: #fff; border-radius: 8px; }

@media (max-width: 640px) {
  .fm { margin-top: 12px; border-radius: 14px; }
  .fm-bar { padding: 10px; }
  .fm-tools { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .fm-tools .btn { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11px; justify-content: center; }
  .fm-tools .btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .fm-row { grid-template-columns: 34px 34px minmax(0, 1fr) 36px; padding-right: 4px; }
  .fm-sz, .fm-dt { display: none; }
  .fm-nm small { display: block; }
  .fm-head { display: none; }
  .fm-ups { right: 8px; left: 8px; width: auto; bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* ───────────── просмотр файла ───────────── */
body.fv-open { overflow: hidden; }
.fv { position: fixed; inset: 0; z-index: 70; background: #0b0e13; display: flex; flex-direction: column; }
.fv-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
          padding-top: max(8px, env(safe-area-inset-top)); background: #11151b; border-bottom: 1px solid var(--line-soft); }
.fv-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-left: 6px; }
.fv-nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--fg-strong); }
.fv-nm small { color: var(--muted); font-size: 12px; }
.fv-tools, .fv-acts { display: flex; align-items: center; gap: 2px; }
.fv-tools.inline { justify-content: flex-end; min-height: 0; }
.fv-ib { width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: #e6edf3; display: grid;
         place-items: center; cursor: pointer; padding: 0; text-decoration: none; }
.fv-ib:hover { background: rgba(255,255,255,0.08); }
.fv-ib svg { width: 21px; height: 21px; }
.fv-count { color: var(--muted); font-size: 13px; padding: 0 8px; white-space: nowrap; }
.fv-body { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center;
           position: relative; }
.fv-body.k-pdf, .fv-body.k-office, .fv-body.k-text { align-items: flex-start; }
.fv-slot { display: contents; }
.fv-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fv-media { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
            width: 100%; height: 100%; padding: 0 0 max(8px, env(safe-area-inset-bottom)); }
.fv-media .fv-video { flex: 1; min-height: 0; width: 100%; max-height: 100%; object-fit: contain; }
.fv-video { max-width: 100%; max-height: 100%; background: #000; }
.fv-seek { display: flex; align-items: center; gap: 10px; width: min(900px, calc(100% - 24px)); color: #c9d1d9;
           font: 13px var(--mono); }
.fv-seek input { flex: 1; accent-color: var(--blue); }
.fv-note { color: var(--muted); font-size: 13px; text-align: center; padding: 0 16px; }
.fv-audio { width: min(520px, calc(100% - 32px)); }
.fv-text { margin: 0; padding: 16px 20px max(20px, env(safe-area-inset-bottom)); width: 100%; min-height: 100%;
           font: 13px/1.5 var(--mono); color: #d0d7de; white-space: pre-wrap; word-break: break-word; tab-size: 4; }
.fv-pages { margin: 12px auto 24px; display: flex; flex-direction: column; gap: 12px; }
.fv-page { background: #fff; width: 100%; box-shadow: 0 4px 18px rgba(0,0,0,0.5); }
.fv-page canvas { width: 100%; height: 100%; display: block; }
.fv-msg { color: var(--muted); padding: 40px 20px; text-align: center; width: 100%; }
.fv-card { text-align: center; padding: 30px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fv-card-nm { font-size: 17px; font-weight: 600; word-break: break-word; max-width: 520px; }
.fv-card-sub { color: var(--muted); font-size: 14px; max-width: 520px; }
.fv-card .btn { margin-top: 10px; text-decoration: none; }
.fv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px;
          background: rgba(0,0,0,0.35); border-radius: 12px; z-index: 2; }
.fv-nav.l { left: 8px; } .fv-nav.r { right: 8px; }
.fv-inline { display: flex; flex-direction: column; min-height: 60vh; border: 1px solid var(--line); border-radius: 14px;
             overflow: hidden; background: #0b0e13; }
.fv-inline .fv-body { min-height: 60vh; max-height: 80vh; }
.fv-inline.k-image .fv-body, .fv-inline.k-video .fv-body { max-height: 75vh; }
@media (max-width: 640px) {
  .fv-nav { display: none; }
  .fv-count { display: none; }
}

/* ───────────── страница ссылки /s/… ───────────── */
.sh { max-width: 1100px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 20px 40px; }
.sh-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sh-logo { font-weight: 700; font-size: 18px; color: var(--fg-strong); text-decoration: none; }
.sh-logo span { color: var(--muted); font-weight: 400; }
.sh-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sh-h h1 { margin: 0; font-size: 22px; font-weight: 600; word-break: break-word; flex: 1; min-width: 200px; }
.sh-meta { color: var(--muted); font-size: 13px; width: 100%; }
.sh-lock { max-width: 380px; margin: 60px auto; background: var(--panel); border: 1px solid var(--line);
           border-radius: 18px; padding: 26px; }
.sh-lock h1 { font-size: 20px; margin: 0 0 6px; }
.sh-lock input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
                 margin: 14px 0 10px; outline: none; }
.sh-lock .btn { width: 100%; justify-content: center; padding: 11px; }
.sh-err { color: var(--red-soft); font-size: 14px; min-height: 20px; margin-top: 8px; }
.sh-big { text-align: center; padding: 80px 20px; color: #c9d1d9; font-size: 18px; }
.sh-big .sub { color: var(--muted); font-size: 14px; margin-top: 8px; }
.sh .fm { margin-top: 0; }
.sh .fm-row { grid-template-columns: 34px minmax(0, 1fr) 100px 150px 40px; padding-left: 10px; }
@media (max-width: 640px) {
  .sh .fm-row { grid-template-columns: 34px minmax(0, 1fr) 36px; }
}

/* ───────────── виртуальные машины ───────────── */
.warnbox { border: 1px solid rgba(210,153,34,0.5); background: rgba(210,153,34,0.08); color: #f2dfae;
           border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-top: 14px; }
.vm-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.vm-sum { flex: 1; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.vm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 16px; }
.vm-empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: #c9d1d9; border: 1px dashed var(--line);
            border-radius: 16px; }
.vm-empty .sub { color: var(--dim); font-size: 13px; margin-top: 6px; }
.vm-card { background: rgba(22,27,34,0.85); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
           display: flex; flex-direction: column; gap: 12px; }
.vm-card.on { border-color: rgba(63,185,80,0.45); }
.vm-top { display: flex; align-items: center; gap: 10px; }
.vm-ic svg { width: 38px; height: 38px; display: block; }
.vm-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vm-nm b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-strong); }
.vm-nm small { color: var(--muted); font-size: 12px; }
.vm-st { font-size: 12px; padding: 3px 9px; border-radius: 10px; background: rgba(255,255,255,0.06); color: var(--muted);
         white-space: nowrap; }
.vm-st.on { background: rgba(63,185,80,0.15); color: var(--green-soft); }
.vm-st.mid { background: rgba(210,153,34,0.15); color: var(--amber-soft); }
.vm-st.bad { background: rgba(248,81,73,0.15); color: var(--red-soft); }
.vm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.vm-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vm-stat span { color: var(--dim); font-size: 12px; }
.vm-stat b { font-weight: 500; font-size: 13px; color: #c9d1d9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-stat i { display: block; height: 4px; background: #30363d; border-radius: 2px; overflow: hidden; margin-top: 3px; }
.vm-stat i u { display: block; height: 100%; background: var(--blue); }
.vm-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.vm-iso, .vm-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #c9d1d9; max-width: 100%;
                   background: rgba(255,255,255,0.06); border-radius: 8px; padding: 3px 8px; }
.vm-iso svg { width: 14px; height: 14px; flex: none; }
.vm-iso span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-err { color: var(--red-soft); font-size: 13px; }
.vm-act { display: flex; gap: 8px; flex-wrap: wrap; }
.vm-act .btn { padding: 7px 12px; font-size: 14px; }
.vm-res { display: flex; gap: 10px; flex-wrap: wrap; }
.vm-res label { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 90px; color: var(--muted); font-size: 12px; }
.vm-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-s { background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: #c9d1d9; border-radius: 9px; padding: 4px 10px;
          font-size: 12px; cursor: pointer; }
.vm-snapf { display: flex; gap: 8px; margin: 12px 0 18px; }
.vm-snapf input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none; }
.vm-ports { margin-top: 26px; }
.vm-ports-h { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.vm-ports-h h3 { margin: 0; flex: 1; font-size: 16px; font-weight: 600; }
.vm-ports > .sub { color: var(--dim); font-size: 13px; }
.vm-ports .tbl td .sub { color: var(--dim); font-size: 12px; }
.vm-warn { color: var(--amber-soft); font-size: 12px; }
@media (max-width: 640px) {
  .vm-grid { grid-template-columns: 1fr; }
  .vm-sum { gap: 4px 12px; font-size: 13px; }
  .vm-ports .tbl td, .vm-ports .tbl th { padding: 8px 6px; }
  .vm-ports .tbl td.r { white-space: nowrap; }
  .vm-ports .tbl .mono { font-size: 12px; word-break: break-all; }
}

/* ───────────── хранилище ───────────── */
#storage .card { display: flex; flex-direction: column; gap: 10px; }
.st-disk { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.st-dh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-dh .sub, .st-part .sub, #storage .sub { color: var(--dim); font-size: 12px; }
.st-kind { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; letter-spacing: .5px; }
.st-kind.hdd { background: rgba(210,153,34,0.15); color: var(--amber-soft); }
.st-kind.ssd { background: rgba(56,139,253,0.15); color: var(--blue-soft); }
.st-part { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.st-bar { height: 5px; background: #30363d; border-radius: 3px; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--blue); }
.st-bar i.bad { background: var(--red); }
.st-blank { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
            border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.st-place { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-top: 1px solid var(--line-soft);
            padding-top: 10px; }
.st-place > div { min-width: 0; }
.st-place .mono { font-size: 13px; word-break: break-all; }
.st-place.small { border-top: 0; padding-top: 2px; }
.st-sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line-soft);
          padding-top: 10px; }
.st-move { border-radius: 10px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.st-move.running { background: rgba(56,139,253,0.1); border: 1px solid rgba(56,139,253,0.35); }
.st-move.done { background: rgba(63,185,80,0.08); border: 1px solid rgba(63,185,80,0.35); }
.st-move.failed { background: rgba(248,81,73,0.08); border: 1px solid rgba(248,81,73,0.4); }
.vm-disks { display: flex; flex-direction: column; gap: 6px; }
.vm-disk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form .vm-disk input[type=number] { width: 90px; flex: none; }
.form .vm-disk select { flex: 1; width: auto; min-width: 150px; }
.vm-disk .where { flex: 1; color: var(--muted); font-size: 13px; min-width: 150px; }
.vm-disks > .btn { align-self: flex-start; }

.ncflow h1 { font-size: 22px; margin: 0 0 10px; }
.ncflow .sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.ncflow .btn { margin-top: 8px; }
.login .ncflow .btn { width: auto; }

/* синхронизация */
.fm-sync-how p { margin: 4px 0 8px; color: var(--muted); }
.fm-sync-how ol { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 4px; }
.fm-sync-how a { color: var(--blue-soft); }
.fm-sync-dav { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.fm-sync-dav summary { cursor: pointer; color: var(--muted); }
.fm-sync-dav > .btn { margin-top: 8px; }
.fm-sync-dav .fm-link, .fm-sync-out { margin-top: 8px; }
.fm-sync-out { display: grid; gap: 8px; }

/* резервные копии */
.bk { display: flex; flex-direction: column; gap: 10px; }
.bk h3 { margin: 0; }
.bk p.sub { margin: 0; color: var(--muted); }
.bk-line { font-size: 14px; }
.bk-line.mono { font-size: 12px; word-break: break-all; color: var(--dim); }
.bk-last { border-top: 1px solid var(--line-soft); padding-top: 10px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.bk-last.bad > b { color: var(--red); }
.bk-parts { display: grid; gap: 4px; }
.bk-parts > div { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; font-size: 13px; }
.bk-parts .bad, .bk-parts > div.bad .sub { color: var(--red); }
.bk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-pw { display: grid; gap: 6px; }
.bk-sched { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bk-sched input[type=time] { width: 110px; }
.bk-keep { display: flex; gap: 14px; flex-wrap: wrap; }
.bk-keep span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bk-keep input { width: 72px !important; }
.bk .st-move > .btn { align-self: flex-start; }
.bk-last.bad > div > b { color: var(--red); }
.bk-snaps { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; margin: 8px 0; }
.bk-snap { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line);
           border-radius: 12px; padding: 8px 8px 8px 12px; }
.bk-snap .sub { font-size: 12px; color: var(--dim); }
.pill-s.on { border-color: var(--blue); color: #fff; }

/* ───── почта ───── */
.tab-badge { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--blue);
             color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.ml { display: grid; grid-template-columns: 240px minmax(300px, 380px) minmax(0, 1fr); margin-top: 18px;
      height: calc(100vh - 230px); min-height: 520px; background: rgba(22,27,34,0.7); border: 1px solid var(--line);
      border-radius: 18px; overflow: hidden; }
.ml-side { border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.ml-compose { justify-content: center; margin: 0 4px 6px; }
.ml-acc { display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.ml-acch { display: flex; align-items: center; gap: 4px; padding: 6px 4px 4px 10px; }
.ml-accn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ml-accn b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-accn span { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-accerr { color: var(--red-soft); font-size: 12px; padding: 0 10px 4px; }
.ml-fold { display: flex; align-items: center; gap: 10px; background: none; border: 0; border-radius: 10px; padding: 7px 10px;
           cursor: pointer; text-align: left; color: #c9d1d9; font-size: 14px; }
.ml-fold:hover { background: rgba(255,255,255,0.05); }
.ml-fold.on { background: rgba(56,139,253,0.16); color: var(--fg-strong); }
.ml-fold.drop { outline: 2px dashed var(--blue); }
.ml-fic svg, .ml-fic { width: 17px; height: 17px; flex: none; color: var(--muted); display: inline-flex; }
.ml-fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-badge { font-size: 12px; font-weight: 600; color: var(--blue-soft); }
.ml-sfoot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.ml-sfoot .btn { justify-content: flex-start; border-color: transparent; }
.ml-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ml-lhead { display: flex; align-items: center; gap: 6px; padding: 12px 10px 6px 14px; }
.ml-tbox { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.ml-title { font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-count { color: var(--dim); font-size: 13px; }
.ml-search { position: relative; margin: 4px 12px 6px; }
.ml-search input { width: 100%; background: #0d1117; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 8px 34px; }
.ml-sicon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--dim); display: flex; }
.ml-filters { display: flex; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; }
.ml-bulk { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--line-soft);
           border-bottom: 1px solid var(--line-soft); background: rgba(56,139,253,0.08); flex-wrap: wrap; }
.ml-selc { font-size: 13px; color: var(--muted); margin-right: 4px; }
.ml-rows { flex: 1; overflow-y: auto; min-height: 0; border-top: 1px solid var(--line-soft); }
.ml-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 30px; align-items: center; gap: 4px; padding: 9px 8px 9px 10px;
          border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.ml-row:hover { background: rgba(255,255,255,0.03); }
.ml-row.on { background: rgba(56,139,253,0.14); }
.ml-row.sel { background: rgba(56,139,253,0.09); }
.ml-row input { width: 16px; height: 16px; margin: 0; }
.ml-rmain { min-width: 0; }
.ml-rtop { display: flex; gap: 8px; align-items: baseline; }
.ml-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c9d1d9; font-size: 14px; }
.ml-date { color: var(--dim); font-size: 12px; white-space: nowrap; }
.ml-subj { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 5px; align-items: center; }
.ml-row.unseen .ml-from { color: var(--fg-strong); font-weight: 600; }
.ml-row.unseen .ml-subj { color: var(--fg); }
.ml-row.unseen .ml-rmain { position: relative; }
.ml-row.unseen .ml-rmain::before { content: ""; position: absolute; left: -10px; top: 7px; width: 6px; height: 6px; border-radius: 3px; background: var(--blue); }
.ml-clip, .ml-clip svg { width: 13px; height: 13px; flex: none; display: inline-flex; }
.ml-tag { color: var(--dim); font-size: 12px; }
.ml-ib { width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; color: #c9d1d9; cursor: pointer;
         display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ml-ib:hover { background: rgba(255,255,255,0.08); }
.ml-ib svg { width: 18px; height: 18px; }
.ml-ib.danger { color: var(--red-soft); }
.ml-star { color: var(--dim); opacity: .5; }
.ml-row:hover .ml-star { opacity: 1; }
.ml-star.on { color: var(--amber-soft); opacity: 1; }
.ml-star.on svg { fill: currentColor; }
.ml-morebtn { margin: 10px auto; }
.ml-note { color: var(--muted); padding: 24px 16px; text-align: center; font-size: 14px; }
.ml-note.bad { color: var(--red-soft); }
.ml-pick { margin-top: 30vh; }
.ml-read { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
.ml-rbar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
           position: sticky; top: 0; background: #161b22; z-index: 2; flex-wrap: wrap; }
.ml-rbar .btn { padding: 7px 11px; border-radius: 11px; }
.ml-mhead { padding: 14px 18px 8px; }
.ml-mhead h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; color: var(--fg-strong); overflow-wrap: anywhere; }
.ml-mfrom { display: flex; gap: 12px; align-items: flex-start; }
.ml-mfrom > div { flex: 1; min-width: 0; font-size: 14px; }
.ml-mfrom .sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ml-mdate { color: var(--dim); font-size: 12px; white-space: nowrap; }
.ml-av { width: 38px; height: 38px; border-radius: 19px; background: #1f6feb; color: #fff; display: flex; align-items: center;
         justify-content: center; font-weight: 600; flex: none; }
.ml-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 18px 10px; align-items: center; }
.ml-att { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 3px 4px 3px 12px; max-width: 100%; }
.ml-att a { color: var(--fg); text-decoration: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.ml-att a:hover { text-decoration: underline; }
.ml-att .sub { color: var(--dim); font-size: 12px; white-space: nowrap; }
.ml-att .ml-ib { width: 28px; height: 28px; }
.ml-imgs { margin: 0 18px 10px; padding: 8px 12px; border-radius: 10px; background: rgba(210,153,34,0.1); color: var(--amber-soft);
           font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ml-body { padding: 0 12px 16px; }
.ml-frame { width: 100%; height: 300px; border: 0; display: block; background: transparent; color-scheme: dark; }
.ml-frame.light { background: #fff; border-radius: 12px; color-scheme: light; }
.ml-menu { max-height: 60vh; overflow-y: auto; }
.ml-empty { margin-top: 18px; max-width: 560px; }
.ml-empty p { color: var(--muted); }
.ml-only-mob { display: none; }
/* написать */
dialog.ml-cdlg { width: min(900px, calc(100vw - 32px)); }
.ml-chead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ml-chead h2 { margin: 0; }
.ml-cform { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: visible; }
.ml-crow { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid var(--line-soft); position: relative; }
.ml-crow:last-child { border-bottom: 0; }
.ml-crow > label { width: 64px; flex: none; color: var(--muted); font-size: 13px; }
.ml-crow > input, .ml-crow > select { flex: 1; min-width: 0; background: none; border: 0; padding: 8px 0; outline: none; }
.ml-crow > select { background: var(--panel); }
.ml-cctoggle { background: none; border: 0; color: var(--blue-soft); cursor: pointer; font-size: 13px; }
.ml-addr { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 4px 0; position: relative; cursor: text; }
.ml-addr > input { flex: 1; min-width: 140px; background: none; border: 0; padding: 4px 0; outline: none; }
.ml-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(56,139,253,0.15); border-radius: 8px; padding: 2px 4px 2px 8px; font-size: 13px; }
.ml-chip.bad { background: rgba(248,81,73,0.18); }
.ml-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 3px; font-size: 15px; line-height: 1; }
.ml-sug { position: absolute; left: 0; top: 100%; z-index: 70; min-width: 260px; max-width: 100%; background: #1c2128;
          border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.ml-sugi { display: flex; flex-direction: column; align-items: flex-start; width: 100%; background: none; border: 0; border-radius: 8px;
           padding: 6px 10px; cursor: pointer; text-align: left; }
.ml-sugi span { color: var(--dim); font-size: 12px; }
.ml-sugi.on, .ml-sugi:hover { background: rgba(56,139,253,0.18); }
.ml-tools { display: flex; gap: 2px; margin: 8px 0 4px; flex-wrap: wrap; }
.ml-tools button { min-width: 32px; height: 30px; background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; color: #c9d1d9; font-weight: 600; }
.ml-tools button:hover { border-color: var(--line); }
.ml-editor { min-height: 240px; max-height: 50vh; overflow-y: auto; background: #0d1117; border: 1px solid var(--line); border-radius: 12px;
             padding: 12px 14px; outline: none; line-height: 1.5; overflow-wrap: anywhere; }
.ml-editor blockquote { margin: 4px 0 4px 6px; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.ml-editor img { max-width: 100%; }
.ml-editor p { margin: 0 0 6px; }
.ml-catts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.ml-achip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 3px 4px 3px 10px; font-size: 13px; max-width: 100%; }
.ml-achip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.ml-achip .sub { color: var(--dim); font-size: 12px; }
.ml-achip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; }
.ml-warn { color: var(--amber-soft); font-size: 12px; }
.ml-cact { flex-wrap: wrap; }
.ml-cact .spacer { flex: 1; }
.ml-hint { color: var(--amber-soft); font-size: 13px; background: rgba(210,153,34,0.08); border-radius: 10px; padding: 8px 10px; }
.ml-adv { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.ml-adv summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.ml-srv { display: grid; gap: 8px; margin-top: 10px; }
.ml-srow { display: grid; grid-template-columns: 130px minmax(0, 1fr) 90px 150px; gap: 8px; align-items: center; }
.ml-srow > span { color: var(--muted); font-size: 13px; }
.ml-srow:last-child { grid-template-columns: 130px minmax(0, 1fr); }
.ml-pcrumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ml-plist { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.ml-prow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 14px; }
.ml-prow:last-child { border-bottom: 0; }
.ml-prow:hover { background: rgba(255,255,255,0.04); }
.ml-prow > span:nth-child(3), .ml-prow > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-prow .sub { flex: none !important; color: var(--dim); font-size: 12px; }
.ml-ctop { display: flex; gap: 8px; margin-bottom: 8px; }
.ml-ctop input { flex: 1; }
.ml-clist { max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.ml-crowc { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; border: 1px solid var(--line-soft); border-radius: 10px; }
.ml-crowc > div { flex: 1; min-width: 0; }
.ml-crowc .sub { color: var(--dim); font-size: 12px; }

@media (max-width: 1200px) {
  .ml { grid-template-columns: 210px minmax(280px, 330px) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ml { display: block; height: calc(100dvh - 150px); min-height: 0; margin-top: 10px; border-radius: 14px; position: relative; }
  .ml > section, .ml > aside { position: absolute; inset: 0; border: 0; }
  .ml-side, .ml-read { display: none; }
  .ml[data-view="folders"] .ml-side { display: flex; }
  .ml[data-view="folders"] .ml-list { display: none; }
  .ml[data-view="msg"] .ml-read { display: flex; background: #161b22; }
  .ml[data-view="msg"] .ml-list { display: none; }
  .ml-only-mob { display: inline-flex; }
  .ml-row { padding: 11px 8px 11px 10px; }
  .ml-hide-xs { display: none; }
  .ml-mhead h2 { font-size: 18px; }
  .ml-body { padding: 0 6px 12px; }
  dialog.ml-cdlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  dialog.ml-cdlg[open] { display: flex; flex-direction: column; }
  dialog.ml-cdlg .ml-editor { flex: 1; }
  .ml-editor { max-height: none; min-height: 200px; }
  .ml-cact .btn > span { display: none; }
  .ml-cact .btn { padding: 9px 12px; }
  dialog.ml-cdlg { padding: 16px 14px; }
  .ml-crow > label { width: 52px; }
  .ml-srow, .ml-srow:last-child { grid-template-columns: 1fr 80px; }
  .ml-srow > span { grid-column: 1 / -1; }
  .ml-srow select { grid-column: 1 / -1; }
}
.ml-ctop input { background: #0d1117; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ml-kind { display: flex; gap: 6px; flex-wrap: wrap; }
.ml-kind .pill-s:disabled { opacity: .4; }
.form > .ml-hint { grid-column: 2 / -1; }
@media (max-width: 640px) { .form > .ml-hint { grid-column: 1 / -1; } }
.ml-title.ml-sync::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 3px; background: var(--blue); vertical-align: middle; animation: mlpulse 1s infinite alternate; }
@keyframes mlpulse { from { opacity: .25; } to { opacity: 1; } }
.ml-acctag { font-size: 11px; color: var(--blue-soft); background: rgba(56,139,253,0.12); border-radius: 6px; padding: 0 6px; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }

/* ───────── календарь ───────── */
.cl-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cl-nav { display: flex; align-items: center; gap: 6px; }
.cl-today { padding: 7px 14px; }
.cl-title { font-size: 20px; font-weight: 600; color: var(--fg-strong); white-space: nowrap; }
.cl-top .spacer { flex: 1; }
.cl-views { display: flex; background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); border-radius: 12px; padding: 3px; }
.cl-view { background: transparent; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 9px; cursor: pointer; font: inherit; font-size: 13px; }
.cl-view.on { background: rgba(56,139,253,0.18); color: var(--blue-soft); }
.cl-add { display: inline-flex; align-items: center; gap: 6px; }
.cl-add svg { width: 16px; height: 16px; }
.iconbtn.spin svg { animation: clspin 1s linear infinite; }
@keyframes clspin { to { transform: rotate(360deg); } }
.cl-banner { margin-top: 12px; background: rgba(210,153,34,0.10); border: 1px solid rgba(210,153,34,0.35); color: var(--amber-soft);
             border-radius: 12px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.cl-banner > div { width: 100%; }
.cl { display: grid; grid-template-columns: 230px minmax(0, 1fr); margin-top: 14px; background: rgba(22,27,34,0.7);
      border: 1px solid var(--line); border-radius: 18px; overflow: hidden; min-height: 560px; height: calc(100vh - 230px); }
.cl-side { border-right: 1px solid var(--line); padding: 14px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.cl-src-h { font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--dim); padding: 0 6px 6px; }
.cl-src-h.err { color: var(--red-soft); }
.cl-src-h.err::after { content: " · ошибка"; }
.cl-cal { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; cursor: pointer; font-size: 14px; color: #c9d1d9; }
.cl-cal:hover { background: rgba(255,255,255,0.05); }
.cl-cal-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl input[type=checkbox], .cl-pick input[type=checkbox] { appearance: none; width: 16px; height: 16px; border-radius: 5px; margin: 0; flex: none;
  border: 2px solid var(--c, var(--blue)); background: transparent; cursor: pointer; display: grid; place-items: center; }
.cl input[type=checkbox]:checked, .cl-pick input[type=checkbox]:checked { background: var(--c, var(--blue)); }
.cl input[type=checkbox]:checked::after, .cl-pick input[type=checkbox]:checked::after { content: ""; width: 4px; height: 8px; border: solid #0d1117;
  border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.cl-tag { font-size: 10px; color: var(--blue-soft); background: rgba(56,139,253,0.12); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.cl-tag.ro { color: var(--muted); background: rgba(255,255,255,0.06); }
.cl-side-add { margin-top: auto; font-size: 13px; }
.cl-main { overflow: auto; position: relative; display: flex; flex-direction: column; }
.cl-empty { color: var(--dim); padding: 40px 20px; text-align: center; }
/* месяц */
.cl-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(92px, 1fr)); flex: 1; }
.cl-wd { color: var(--dim); font-size: 12px; text-align: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cl-day { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 4px; min-width: 0; cursor: pointer;
          display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cl-day:nth-child(7n) { border-right: 0; }
.cl-day:hover { background: rgba(255,255,255,0.025); }
.cl-day.other { background: rgba(0,0,0,0.18); }
.cl-day.other .cl-dn { color: var(--dim); }
.cl-day.we .cl-dn { color: var(--red-soft); }
.cl-dn { font-size: 13px; color: var(--muted); padding: 2px 4px; align-self: flex-end; border-radius: 999px; min-width: 24px; text-align: center; }
.cl-day.today .cl-dn { background: var(--blue); color: #fff; font-weight: 600; }
.cl-ev { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; text-align: left; font: inherit; font-size: 12px; line-height: 1.35;
         color: var(--fg); background: color-mix(in srgb, var(--c) 16%, transparent); border: 0; border-left: 3px solid var(--c);
         border-radius: 5px; padding: 2px 6px; cursor: pointer; overflow: hidden; white-space: nowrap; }
.cl-ev:hover { background: color-mix(in srgb, var(--c) 28%, transparent); }
.cl-ev.allday { background: color-mix(in srgb, var(--c) 55%, #0d1117); color: #fff; border-left-color: transparent; }
.cl-ev b { font-weight: 600; color: color-mix(in srgb, var(--c) 60%, #fff); flex: none; }
.cl-ev.allday b { color: #fff; }
.cl-ev span { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.cl-dots { display: inline-flex; gap: 2px; flex: none; }
.cl-dots i { width: 6px; height: 6px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,0.4); }
.cl-more { background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; text-align: left; padding: 0 6px; cursor: pointer; }
.cl-more:hover { color: var(--fg); }
/* неделя */
.cl-week { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.cl-wk-head, .cl-wk-all { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cl-wk-gut { font-size: 10px; color: var(--dim); padding: 4px; text-align: right; }
.cl-wk-d { text-align: center; padding: 6px 0; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; align-items: center; }
.cl-wk-d b { font-size: 18px; font-weight: 500; color: var(--fg); width: 32px; height: 32px; line-height: 32px; border-radius: 50%; }
.cl-wk-d.today b { background: var(--blue); color: #fff; }
.cl-wk-allc { display: flex; flex-direction: column; gap: 2px; padding: 3px; border-left: 1px solid var(--line-soft); min-width: 0; min-height: 26px; }
.cl-wk-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.cl-wk-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); position: relative; }
.cl-wk-h { height: 44px; font-size: 10px; color: var(--dim); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.cl-wk-col { position: relative; border-left: 1px solid var(--line-soft);
  background-image: repeating-linear-gradient(to bottom, var(--line-soft) 0 1px, transparent 1px 44px); cursor: pointer; }
.cl-wk-col.today { background-color: rgba(56,139,253,0.04); }
.cl-ev.timed { position: absolute; flex-direction: column; align-items: flex-start; white-space: normal; padding: 2px 5px; gap: 0;
               border: 1px solid #0d1117; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 26%, #0d1117); }
.cl-ev.timed span { white-space: normal; overflow: hidden; }
.cl-ev.timed .cl-dots { position: absolute; right: 4px; top: 4px; }
.cl-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 2; pointer-events: none; }
.cl-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
/* список */
.cl-list { padding: 8px 16px 20px; }
.cl-lday { margin-top: 12px; }
.cl-lday-h { font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.cl-lday.today .cl-lday-h { color: var(--blue-soft); }
.cl-lrow { display: flex; gap: 14px; align-items: flex-start; width: 100%; background: none; border: 0; border-radius: 10px; padding: 8px 6px;
           color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.cl-lrow:hover { background: rgba(255,255,255,0.04); }
.cl-ltime { flex: none; width: 96px; color: var(--muted); font-size: 13px; padding-left: 10px; border-left: 3px solid var(--c); }
.cl-ltext { display: flex; flex-direction: column; min-width: 0; }
.cl-ltext b { font-weight: 500; }
.cl-ltext small { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
/* диалоги */
dialog.cl-dlg .cl-evh { display: flex; gap: 12px; align-items: center; }
.cl-evbar { width: 6px; align-self: stretch; border-radius: 3px; flex: none; }
.cl-evinfo { margin: 14px 0 20px; display: flex; flex-direction: column; gap: 10px; }
.cl-evl { display: flex; gap: 10px; align-items: flex-start; color: #c9d1d9; }
.cl-evi svg { width: 18px; height: 18px; color: var(--muted); flex: none; margin-top: 1px; }
.cl-evcals { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-evcal { font-size: 12px; border-radius: 999px; padding: 3px 10px; background: color-mix(in srgb, var(--c) 18%, transparent);
            border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.cl-evdesc { white-space: pre-wrap; color: #c9d1d9; font-size: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
             padding: 10px 12px; max-height: 260px; overflow: auto; overflow-wrap: anywhere; }
.cl-daylist { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 18px; }
.cl-daylist .cl-ev { font-size: 14px; padding: 6px 10px; }
.cl-form .cl-tin { font-size: 17px; padding: 11px 12px; }
.cl-dt { display: flex; gap: 8px; }
.cl-dt input { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--fg); font: inherit; min-width: 0; }
.cl-dt input[type=date] { flex: 1; }
.form textarea.cl-desc { font-family: inherit; font-size: 14px; min-height: 70px; }
.cl-pick { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow-y: auto; }
.cl-pickrow { display: flex !important; align-items: center !important; gap: 8px !important; padding: 4px 2px; }
.cl-pickrow small { color: var(--dim); font-size: 12px; margin-left: auto; }
.cl-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cl-pill { background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: #c9d1d9; border-radius: 999px; padding: 6px 13px; cursor: pointer; font: inherit; font-size: 13px; }
.cl-pill.on { border-color: var(--blue); background: rgba(56,139,253,0.16); color: var(--blue-soft); }
.cl-set { display: flex; flex-direction: column; gap: 14px; margin: 10px 0 18px; max-height: 60vh; overflow-y: auto; }
.cl-set-src { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.cl-set-h { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.cl-set-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-set-n small { color: var(--dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-set-n small.err { color: var(--red-soft); white-space: normal; }
.cl-set-cal { display: flex; gap: 12px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line-soft); font-size: 14px; flex-wrap: wrap; }
.cl-set-cal input[type=color] { width: 26px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 6px; }
.cl-set-cn { flex: 1; min-width: 120px; }
.cl-set-cal .check { display: flex; gap: 6px; align-items: center; color: #c9d1d9; font-size: 13px; }
.cl-phone { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 18px; max-height: 64vh; overflow-y: auto; }
.cl-phone > .btn { align-self: flex-start; }
.cl-copy { display: flex; gap: 8px; align-items: flex-end; }
.cl-copy > div { flex: 1; min-width: 0; }
.cl-copy input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--fg); font-family: var(--mono); font-size: 13px; }
.cl-copy .sub, .cl-dev .sub { color: var(--dim); font-size: 12px; margin-bottom: 3px; }
.cl-how h3, .cl-phone > h3 { font-size: 14px; margin: 12px 0 4px; color: var(--fg-strong); }
.cl-how ol { margin: 0; padding-left: 20px; color: #c9d1d9; font-size: 14px; line-height: 1.5; }
.cl-devs { display: flex; flex-direction: column; gap: 6px; }
.cl-dev { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 10px; }
.cl-dev > div { flex: 1; }
@media (max-width: 900px) {
  .cl { grid-template-columns: minmax(0, 1fr); }
  .cl-side { display: none; }
}
@media (max-width: 640px) {
  .cl-top { gap: 6px; margin-top: 10px; }
  .cl-title { order: -1; width: 100%; font-size: 18px; }
  .cl-top .spacer { display: none; }
  .cl-views { order: 5; }
  .cl-add { padding: 8px 12px; }
  .cl { height: calc(100dvh - 210px); min-height: 0; border-radius: 14px; margin-top: 10px; }
  .cl-month { grid-template-rows: auto repeat(6, minmax(64px, 1fr)); }
  .cl-ev { font-size: 10.5px; padding: 1px 3px; border-left-width: 2px; }
  .cl-dots { display: none; }
  .cl-wk-head, .cl-wk-all, .cl-wk-grid { grid-template-columns: 38px repeat(7, minmax(0, 1fr)); }
  .cl-ltime { width: 80px; }
  .cl-form.form { grid-template-columns: 1fr; }
  .cl-form.form label.f { text-align: left; }
}
.cl-ev.cancel, .cl-lrow.cancel { opacity: .5; }
.cl-ev.cancel span, .cl-lrow.cancel b { text-decoration: line-through; }
.cl-notify { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 18px; }
.cl-nbox { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.cl-nbox .sub { color: var(--dim); font-size: 12px; }
.cl-nbox .sub.err { color: var(--red-soft); }
.cl-nbox .check, .cl-notify > .check { display: flex; gap: 8px; align-items: center; color: #c9d1d9; font-size: 14px; }
.cl-nbox .actions { margin-top: 2px; }
.cl-sel { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--fg); font: inherit; }
/* календарь: год и переход к месяцу */
button.cl-title { background: none; border: 0; padding: 4px 8px; margin-left: -8px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 20px; font-weight: 600; color: var(--fg-strong); }
button.cl-title:hover { background: rgba(255,255,255,0.06); }
button.cl-title::after { content: " ▾"; font-size: 12px; color: var(--muted); }
.cl-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 22px; padding: 18px 20px 24px; }
.cl-ym { min-width: 0; }
.cl-ym-h { background: none; border: 0; color: var(--fg-strong); font: inherit; font-weight: 600; font-size: 15px; padding: 2px 4px; margin: 0 0 6px -4px; cursor: pointer; border-radius: 6px; }
.cl-ym-h:hover { background: rgba(255,255,255,0.06); }
.cl-ym-h.cur { color: var(--blue-soft); }
.cl-ym-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cl-ym-wd { font-size: 10px; color: var(--dim); text-align: center; padding-bottom: 2px; }
.cl-yd { position: relative; height: 30px; min-width: 0; background: none; border: 0; border-radius: 7px; color: #c9d1d9; font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.cl-yd:hover { background: rgba(255,255,255,0.08); }
.cl-yd.we { color: var(--red-soft); }
.cl-yd.has.lvl1 { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--fg); }
.cl-yd.has.lvl2 { background: color-mix(in srgb, var(--c) 40%, transparent); color: #fff; }
.cl-yd.has.lvl3 { background: color-mix(in srgb, var(--c) 62%, transparent); color: #fff; font-weight: 600; }
.cl-yd.today { box-shadow: inset 0 0 0 2px var(--blue); color: #fff; font-weight: 600; }
.cl-yd-dots { position: absolute; left: 0; right: 0; bottom: 2px; display: flex; justify-content: center; gap: 2px; }
.cl-yd-dots i { width: 4px; height: 4px; border-radius: 50%; display: block; }
dialog.cl-pickdlg { width: min(420px, calc(100vw - 32px)); }
.cl-pk-h { display: flex; align-items: center; justify-content: center; gap: 10px; }
.cl-pk-y { background: none; border: 0; color: var(--fg-strong); font: inherit; font-size: 22px; font-weight: 600; padding: 4px 12px; border-radius: 10px; cursor: pointer; }
.cl-pk-y:hover { background: rgba(255,255,255,0.06); }
.cl-pk-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 20px; }
.cl-pk-m { background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: #c9d1d9; border-radius: 12px; padding: 12px 6px; font: inherit; font-size: 14px; cursor: pointer; }
.cl-pk-m:hover { border-color: var(--blue); }
.cl-pk-m.now { color: var(--blue-soft); }
.cl-pk-m.on { background: rgba(56,139,253,0.18); border-color: var(--blue); color: var(--blue-soft); }
@media (max-width: 1100px) { .cl-year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cl-year { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; padding: 12px; }
  .cl-yd { font-size: 10.5px; border-radius: 5px; height: 24px; }
  button.cl-title { font-size: 18px; }
  .cl-views .cl-view { padding: 6px 9px; }
}
/* RustDesk на главной */
.rd-head { display: flex; align-items: center; gap: 8px; }
.rd-head .spacer { flex: 1; }
#rd-tools { display: flex; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.rd-btn { padding: 5px 12px; font-size: 13px; }
.rd .avatar, .badge.rd { background: rgba(255,158,87,0.16); color: var(--orange); }
.rd .avatar { font-size: 13px; font-weight: 700; }
.tile.rd.off { opacity: .55; }
.rd-empty { color: var(--dim); font-size: 14px; padding: 6px 2px 14px; grid-column: 1 / -1; }
.rd-err { grid-column: 1 / -1; }
.rd-open { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }
.rd-who { display: flex; flex-direction: column; gap: 6px; }
.rd-client { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; margin: 12px 0; }
.rd-client > div:first-child { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rd-copy { display: flex; gap: 8px; align-items: flex-end; }
.rd-copy > div { flex: 1; min-width: 0; }
.rd-copy .sub { color: var(--dim); font-size: 12px; margin-bottom: 3px; }
.rd-copy input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--fg); font-family: var(--mono); font-size: 12px; }
@media (max-width: 640px) { .rd-client { grid-template-columns: 1fr; } #rd-tools .rd-btn { padding: 4px 9px; font-size: 12px; } }

/* двухфакторный вход */
.acc-card { display: flex; flex-direction: column; gap: 10px; }
.acc-h { font-size: 16px; font-weight: 600; color: var(--fg-strong); display: flex; align-items: center; gap: 8px; }
#twofa-state.ok { color: var(--green-soft); border-color: rgba(63,185,80,0.4); }
.chip.tfa { margin-left: 8px; font-size: 11px; padding: 1px 6px; }
.secret { font-size: 15px; letter-spacing: .5px; padding: 8px 10px; background: var(--bg2, rgba(255,255,255,.05));
          border-radius: 8px; word-break: break-all; user-select: all; margin-bottom: 10px; }
.recovery pre { font-size: 15px; line-height: 1.6; padding: 10px 14px; background: var(--bg2, rgba(255,255,255,.05));
                border-radius: 8px; columns: 2; user-select: all; }
.okbox { padding: 10px 12px; border-radius: 8px; background: rgba(63,185,80,.12); color: var(--ok, #3fb950); margin-bottom: 10px; }
#code-row .sub { margin: 0 0 6px; }
#code-alt { display: block; margin-top: 8px; font-size: 13px; }

/* ── Дом */
.hm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hm-title { margin: 0; font-size: 22px; font-weight: 600; color: var(--fg-strong); }
.hm-upd { color: var(--dim); font-size: 13px; }
.hm-head .btn.spin svg { animation: hm-rot 1s linear infinite; }
@keyframes hm-rot { to { transform: rotate(360deg); } }
.hm-err { margin-bottom: 14px; }
.hm-empty { max-width: 640px; }
.hm-ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.hm-ic svg { width: 100%; height: 100%; }
.hm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.hm-tile { background: rgba(255,255,255,0.045); border: 1px solid var(--line-soft); border-radius: 18px; padding: 16px 18px; }
.hm-tile.elec { background: linear-gradient(135deg, rgba(227,179,65,0.14), rgba(255,255,255,0.03)); }
.hm-tile.water { background: linear-gradient(135deg, rgba(56,139,253,0.16), rgba(255,255,255,0.03)); }
.hm-tile.total { background: linear-gradient(135deg, rgba(63,185,80,0.15), rgba(255,255,255,0.03)); }
.hm-tile.elec .hm-ic { color: var(--amber-soft); }
.hm-tile.water .hm-ic { color: var(--blue-soft); }
.hm-th { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.hm-big { font-size: 32px; font-weight: 600; color: var(--fg-strong); margin: 6px 0 2px; letter-spacing: -0.5px; }
.hm-tile .sub { color: var(--muted); font-size: 13px; }
.hm-small { color: var(--dim); font-size: 13px; margin-top: 8px; }
.hm-meters { margin: 14px 0 4px; }
.hm-meters summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
.hm-meters .tbl td .sub { color: var(--dim); font-size: 12px; }
.hm-meters .r { text-align: right; white-space: nowrap; }
.hm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 16px; align-items: start; }
.hm-card .hm-ch { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); }
.hm-card .hm-ch h3 { margin: 0; }
.hm-room { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin: 12px 0 6px; }
.hm-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.hm-sw { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; cursor: pointer; text-align: left;
         background: rgba(255,255,255,0.05); border: 1px solid var(--line-soft); color: var(--fg); font-size: 14px; }
.hm-sw:hover { background: rgba(255,255,255,0.09); }
.hm-sw.on { background: rgba(227,179,65,0.18); border-color: rgba(227,179,65,0.45); color: var(--fg-strong); }
.hm-sw.on .hm-ic { color: var(--amber-soft); }
.hm-sw.off { opacity: 0.5; }
.hm-curt { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 0;
           border-top: 1px solid var(--line-soft); }
.hm-curt:first-of-type { border-top: 0; }
.hm-curt input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--blue); }
.hm-curt.off { opacity: 0.55; }
.hm-cn .sub, .hm-ac .sub, .hm-sen .sub { color: var(--dim); font-size: 12px; }
.hm-cb { display: flex; gap: 6px; }
.hm-cb .btn { padding: 8px 10px; }
.hm-sens { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.hm-sen { background: rgba(255,255,255,0.05); border: 1px solid var(--line-soft); border-radius: 14px; padding: 10px 12px; }
.hm-sen.off { opacity: 0.55; }
.hm-sn { color: var(--muted); font-size: 13px; }
.hm-sv { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.hm-sv b { font-size: 24px; font-weight: 600; color: var(--fg-strong); }
.hm-sv span { color: var(--blue-soft); font-size: 15px; }
.hm-warn { color: var(--amber-soft); font-size: 12px; }
.hm-ac { border-top: 1px solid var(--line-soft); padding-top: 12px; margin-top: 4px; }
.hm-ac.off { opacity: 0.6; }
.hm-ach { display: flex; align-items: center; gap: 10px; }
.hm-ach .hm-ic { color: var(--blue-soft); width: 26px; height: 26px; }
.hm-ic.spin-slow svg { animation: hm-rot 3s linear infinite; }
.hm-acn { font-weight: 600; color: var(--fg-strong); }
.hm-pw { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-soft); background: rgba(255,255,255,0.06);
         color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 10px; }
.hm-pw svg { width: 22px; height: 22px; }
.hm-pw.on { background: var(--green); color: #fff; border-color: transparent; }
.hm-acnums { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 12px 0 4px; }
.hm-numr { display: flex; align-items: center; gap: 6px; }
.hm-numr b { min-width: 64px; text-align: center; font-size: 20px; color: var(--fg-strong); }
.hm-numr .btn { padding: 6px 8px; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-chip { border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; background: rgba(255,255,255,0.05);
           border: 1px solid var(--line-soft); color: var(--fg); }
.hm-chip.on { background: rgba(56,139,253,0.22); border-color: rgba(56,139,253,0.55); color: var(--fg-strong); }
.hm-safe { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.hm-safe .hm-ic.alarm { color: var(--red); }
.hm-ok { color: var(--green-soft); font-size: 13px; margin-left: auto; }
.hm-bad { color: #fff; background: var(--red); border-radius: 8px; padding: 2px 8px; font-size: 13px; font-weight: 600; margin-left: auto; }
.hm-safe .sub { margin-left: auto; color: var(--dim); font-size: 13px; }
.hm-set { border-top: 1px solid var(--line-soft); padding: 4px 0; }
.hm-set > summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--fg-strong); }
.hm-set .form { margin-top: 4px; }
.hm-set .form > .okbox, .hm-set .form > .hm-st, .hm-set .form > p, .hm-set .form > .btn,
.hm-set .form > details, .hm-set .form > .check { grid-column: 1 / -1; }
.hm-set .form > .btn { justify-self: start; }
.hm-st { color: var(--muted); font-size: 13px; }
.hm-diag summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.hm-dev { padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.hm-dev .mono { word-break: break-all; margin-top: 2px; }
@media (max-width: 640px) {
  .hm-grid { grid-template-columns: 1fr; }
  .hm-big { font-size: 26px; }
}
.hm-pre { max-height: 260px; overflow: auto; font-size: 11px; white-space: pre-wrap; word-break: break-all; background: rgba(0,0,0,.25); padding: 8px; border-radius: 8px; }
.hm-ac.busy { opacity: 0.6; pointer-events: none; }
.hm-acsec { margin-top: 8px; }
.hm-temp { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 6px 0; }
.hm-tv { display: flex; align-items: flex-start; gap: 2px; min-width: 96px; justify-content: center; }
.hm-tv b { font-size: 46px; font-weight: 300; color: var(--fg-strong); line-height: 1; }
.hm-tv span { font-size: 16px; color: var(--muted); margin-top: 4px; }
.hm-ac:not(.running) .hm-tv b { color: var(--muted); }
.hm-tb { width: 48px; height: 48px; border-radius: 50%; justify-content: center; padding: 0; }
.hm-tb svg { width: 22px; height: 22px; }
.hm-chip:disabled, .hm-tb:disabled { opacity: 0.4; cursor: default; }

/* Дом: плитки по комнатам */
.hm-room-sec { margin-bottom: 18px; }
.hm-rh { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.hm-rh h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.hm-rname { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-weight: 600; max-width: 260px; }
.hm-tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; min-height: 40px; align-items: start; }
.hm-t { position: relative; min-width: 0; display: flex; }
.hm-t > * { flex: 1; min-width: 0; }
.hm-t.w2 { grid-column: span 2; }
.hm-t .hm-sw { height: 100%; min-height: 64px; }
.hm-t .hm-tile { padding: 14px; }
.hm-t .hm-ac { background: rgba(255,255,255,0.045); border: 1px solid var(--line-soft); border-radius: 18px; padding: 14px; margin: 0; }
.hm-t .hm-sen { padding: 12px 14px; }
.hm-t .hm-curt { display: grid; border-top: 0; padding: 14px; align-content: start; }
.hm-tn { font-weight: 600; color: var(--fg-strong); }
.hm-mid { font-size: 24px; font-weight: 600; color: var(--fg-strong); margin: 6px 0 2px; }
.hm-tile.hot { background: linear-gradient(135deg, rgba(255,126,87,0.15), rgba(255,255,255,0.03)); }
.hm-tile.hot .hm-ic { color: var(--orange); }
.hm-th span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-safe-t .hm-ok, .hm-safe-t .hm-bad { display: inline-block; margin: 8px 0 0; }
.hm-t.edit { outline: 1px dashed var(--line); outline-offset: 3px; border-radius: 18px; cursor: grab; }
.hm-t.edit > :first-child { pointer-events: none; }
.hm-t.drag { opacity: 0.4; }
.hm-t.hid > :first-child { opacity: 0.35; }
.hm-eov { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; gap: 4px; align-items: center;
          background: rgba(13,17,23,0.92); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.hm-eov .btn { padding: 5px 7px; }
.hm-eov select { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px; font-size: 13px; }
.hm-drop { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--dim); font-size: 13px; text-align: center; }
@media (max-width: 640px) {
  .hm-tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-t.w2 { grid-column: 1 / -1; }
}
.hm-t.edit { padding-bottom: 46px; }

/* Дом: кондиционер */
.hm-ac2 { --acc: #8b949e; --acc2: rgba(139,148,158,0.12); position: relative; display: flex; flex-direction: column; gap: 12px;
          border-radius: 18px; padding: 16px; border: 1px solid var(--line-soft);
          background: radial-gradient(120% 90% at 50% 0%, var(--acc2), rgba(255,255,255,0.03) 70%); transition: opacity .2s; }
.hm-ac2.m-cool { --acc: #58a6ff; --acc2: rgba(88,166,255,0.20); }
.hm-ac2.m-heat { --acc: #ff9e57; --acc2: rgba(255,158,87,0.20); }
.hm-ac2.m-auto { --acc: #3fb950; --acc2: rgba(63,185,80,0.18); }
.hm-ac2.m-dry  { --acc: #39c5cf; --acc2: rgba(57,197,207,0.18); }
.hm-ac2.m-fan  { --acc: #bc8cff; --acc2: rgba(188,140,255,0.18); }
.hm-ac2.busy { opacity: 0.6; pointer-events: none; }
.hm-ac2.offline { opacity: 0.55; }
.hm-ac2-top { display: flex; align-items: center; gap: 12px; }
.hm-ac2-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hm-ac2-name b { font-size: 16px; color: var(--fg-strong); }
.hm-ac2-name span { font-size: 13px; color: var(--acc); }
.hm-ac2.m-off .hm-ac2-name span { color: var(--dim); }
.hm-ac2 .hm-pw.on { background: var(--acc); }
.hm-ac2-mid { display: flex; align-items: center; justify-content: center; gap: 10px; }
.hm-dial { position: relative; width: 168px; height: 168px; flex: none; }
.hm-dial svg { width: 100%; height: 100%; }
.hm-dial circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.hm-dial .trk { stroke: rgba(255,255,255,0.08); }
.hm-dial .val { stroke: var(--acc); transition: stroke-dasharray .3s; filter: drop-shadow(0 0 6px var(--acc2)); }
.hm-dial-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hm-dial-t { display: flex; align-items: flex-start; }
.hm-dial-t b { font-size: 50px; font-weight: 300; line-height: 1; color: var(--fg-strong); letter-spacing: -1px; }
.hm-dial-t span { font-size: 22px; color: var(--muted); margin-top: 2px; }
.hm-ac2.m-off .hm-dial-t b { color: var(--muted); }
.hm-dial-s { font-size: 12px; color: var(--muted); margin-top: 4px; text-align: center; }
.hm-ac2 .hm-tb { background: rgba(255,255,255,0.06); border: 1px solid var(--line-soft); }
.hm-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 6px; }
.hm-mode { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px 7px; border-radius: 12px; cursor: pointer;
           background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; min-width: 0; }
.hm-mode span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-mode svg { width: 20px; height: 20px; }
.hm-mode.on { color: #fff; background: var(--acc); border-color: transparent; box-shadow: 0 4px 14px var(--acc2); }
.hm-mode:disabled, .hm-ex:disabled, .hm-bar:disabled { opacity: 0.4; cursor: default; }
.hm-speed { display: flex; align-items: center; gap: 12px; }
.hm-lbl { color: var(--muted); font-size: 13px; flex: 1; }
.hm-bars { display: flex; align-items: flex-end; gap: 5px; }
.hm-bar { width: 16px; border-radius: 4px; border: 0; cursor: pointer; background: rgba(255,255,255,0.12); padding: 0; }
.hm-bar.on { background: var(--acc); }
.hm-extras { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.hm-ex { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; cursor: pointer; font-size: 12px;
         background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); color: var(--muted); }
.hm-ex svg { width: 15px; height: 15px; }
.hm-ex.on { color: var(--fg-strong); border-color: var(--acc); background: var(--acc2); }
.hm-t .hm-ac2 { margin: 0; }

/* Дом: меню разделов и обзор */
.hm-app { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.hm-nav { flex: 1 1 200px; max-width: 230px; display: flex; flex-direction: column; gap: 4px; background: rgba(255,255,255,0.035);
          border: 1px solid var(--line-soft); border-radius: 22px; padding: 14px 10px; position: sticky; top: 12px; }
.hm-clock { padding: 4px 12px 14px; display: flex; flex-direction: column; }
.hm-clock b { font-size: 38px; font-weight: 300; letter-spacing: -1px; color: var(--fg-strong); line-height: 1; }
.hm-clock span { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hm-nv { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 0; background: none;
         color: #c9d1d9; font-size: 15px; cursor: pointer; text-align: left; }
.hm-nv:hover { background: rgba(255,255,255,0.06); }
.hm-nv.on { background: rgba(56,139,253,0.16); color: var(--fg-strong); }
.hm-nv.on .hm-ic { color: var(--blue-soft); }
.hm-nsp { flex: 1; min-height: 12px; }
.hm-nset { color: var(--muted); }
.hm-main { flex: 999 1 560px; min-width: 0; }
.hm-hl { display: flex; flex-direction: column; min-width: 0; }
.hm-hl .hm-title { font-size: 26px; }
.hm-hl .hm-upd { font-size: 14px; color: var(--muted); }
.hm-pill { padding: 7px 14px; border-radius: 999px; font-size: 13px; background: rgba(63,185,80,0.12);
           border: 1px solid rgba(63,185,80,0.35); color: var(--green-soft); white-space: nowrap; }
.hm-pill.bad { background: rgba(210,153,34,0.12); border-color: rgba(210,153,34,0.4); color: var(--amber-soft); }
.hm-ovgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hm-ov { --acc: #8b949e; --acc2: rgba(139,148,158,0.12); position: relative; display: flex; flex-direction: column; gap: 10px;
         min-height: 190px; padding: 18px; border-radius: 22px; border: 1px solid var(--line-soft); background: rgba(255,255,255,0.045); min-width: 0; }
.hm-ov.w2 { grid-column: span 2; }
.hm-ovh { display: flex; align-items: center; gap: 8px; }
.hm-ovt { font-size: 15px; color: #c9d1d9; background: none; border: 0; padding: 0; cursor: default; text-align: left; flex: 1; min-width: 0;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; }
button.hm-ovt { cursor: pointer; }
button.hm-ovt:hover { color: var(--fg-strong); }
.hm-ovr { font-size: 12px; color: var(--acc); white-space: nowrap; }
.hm-ic.big { width: 44px; height: 44px; color: var(--acc); }
.hm-ov.light { --acc: var(--muted); }
.hm-ov.light.lit { --acc: var(--amber-soft); background: linear-gradient(150deg, rgba(227,179,65,0.20), rgba(255,255,255,0.035) 60%); border-color: rgba(227,179,65,0.35); }
.hm-ovchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.hm-ovchip { padding: 6px 11px; border-radius: 999px; font-size: 12px; cursor: pointer; border: 1px solid transparent;
             background: rgba(255,255,255,0.06); color: var(--muted); }
.hm-ovchip.on { background: rgba(227,179,65,0.22); color: #f2dfae; }
.hm-ovchip.off { opacity: 0.5; }
.hm-ov.clim { align-items: center; background: radial-gradient(120% 90% at 50% 0%, var(--acc2), rgba(255,255,255,0.03) 70%); }
.hm-ov.clim .hm-ovh { align-self: stretch; }
.hm-ov.m-cool, .hm-ac2.m-cool { --acc: #58a6ff; --acc2: rgba(88,166,255,0.20); }
.hm-ov.m-heat { --acc: #ff9e57; --acc2: rgba(255,158,87,0.20); }
.hm-ov.m-auto { --acc: #3fb950; --acc2: rgba(63,185,80,0.18); }
.hm-ov.m-dry { --acc: #39c5cf; --acc2: rgba(57,197,207,0.18); }
.hm-ov.m-fan { --acc: #bc8cff; --acc2: rgba(188,140,255,0.18); }
.hm-ov.clim:not(.m-off) { border-color: color-mix(in srgb, var(--acc) 35%, transparent); }
.hm-dial.sm { width: 132px; height: 132px; }
.hm-dial.sm .hm-dial-t b { font-size: 38px; }
.hm-ov.m-off .hm-dial-t b { color: var(--muted); }
.hm-pw.sm { width: 36px; height: 36px; padding: 8px; }
.hm-ov .hm-pw.on { background: var(--acc); }
.hm-ovfoot { margin-top: auto; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; text-align: center; }
.hm-ov.sec { --acc: var(--green-soft); }
.hm-ov.sec .hm-ovfoot { text-align: left; }
.hm-ov.sec.alarm { --acc: #fff; background: rgba(248,81,73,0.25); border-color: var(--red); }
.hm-ovbig { font-size: 18px; font-weight: 600; color: var(--acc); }
.hm-ov.ic { --acc: #79c0ff; }
.hm-ov.ic .hm-ovfoot { margin-top: 4px; text-align: left; }
.hm-icrow { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.hm-ov.ic .hm-door { margin-top: auto; align-self: stretch; justify-content: center; }
.hm-ov.ic.alarm { --acc: #fff; background: rgba(46,160,67,0.28); border-color: var(--green, #3fb950);
                  animation: hm-ring 1.2s ease-in-out infinite; }
@keyframes hm-ring { 50% { box-shadow: 0 0 0 6px rgba(63,185,80,0.25); } }
.hm-callbox { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.hm-callbox:empty { display: none; }
.hm-callline { font-size: 15px; line-height: 1.5; }
.hm-callnum { font-size: 20px; font-weight: 700; color: var(--blue-soft, #79c0ff); white-space: nowrap; }
.hm-door { display: inline-flex; align-items: center; gap: 8px; }
.hm-door svg { width: 18px; height: 18px; }
.hm-door.confirm { background: #d29922; border-color: #d29922; color: #111; }
.hm-icom .hm-door { margin-top: 10px; width: 100%; justify-content: center; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.hm-icom.ringing { border-color: var(--green, #3fb950); }
.hm-ov.cam { padding: 0; overflow: hidden; min-height: 0; aspect-ratio: 1 / 1; background: linear-gradient(160deg, #1b2330, #0b0e13); }
.hm-ov.cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.hm-camtop { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 14px; color: var(--fg-strong);
             background: linear-gradient(180deg, rgba(0,0,0,0.6), transparent); }
.hm-camtop .btn { padding: 6px 10px; font-size: 12px; background: rgba(13,17,23,0.7); }
.hm-live { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.hm-camt { font-size: 12px; color: #c9d1d9; }
.hm-ov.curt { --acc: var(--blue-soft); }
.hm-cvis { display: flex; gap: 4px; height: 64px; }
.hm-cl { border-radius: 8px; background: repeating-linear-gradient(90deg, rgba(121,192,255,0.35) 0 6px, rgba(121,192,255,0.15) 6px 12px); flex-shrink: 0; }
.hm-cgap { flex: 1; border-radius: 8px; background: rgba(255,255,255,0.04); }
.hm-ovbtns { display: flex; gap: 8px; margin-top: auto; }
.hm-ovbtns .btn { flex: 1; justify-content: center; min-height: 44px; }
.hm-ov.boil { --acc: var(--muted); }
.hm-ov.boil.lit { --acc: var(--orange); background: linear-gradient(150deg, rgba(255,126,87,0.18), rgba(255,255,255,0.035) 60%); border-color: rgba(255,126,87,0.32); }
.hm-bigsw { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border-radius: 14px;
            border: 1px solid var(--line-soft); background: rgba(255,255,255,0.06); color: var(--fg); cursor: pointer; font-size: 14px; }
.hm-bigsw .hm-ic { color: var(--acc); }
.hm-bigsw.on { background: var(--orange); color: #1a1205; border-color: transparent; }
.hm-bigsw.on .hm-ic { color: #1a1205; }
.hm-ov.bills { flex-direction: row; flex-wrap: wrap; gap: 20px; min-height: 160px; align-items: stretch;
               background: linear-gradient(135deg, rgba(63,185,80,0.14), rgba(255,255,255,0.03) 65%); border-color: rgba(63,185,80,0.28); }
.hm-billmain { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.hm-billmain b { font-size: 38px; font-weight: 600; color: var(--fg-strong); letter-spacing: -0.5px; }
.hm-billmain .sub, .hm-billpart .sub { font-size: 12px; color: var(--muted); }
.hm-billpart { flex: 1 1 140px; display: flex; flex-direction: column; gap: 6px; padding-left: 18px; border-left: 1px solid var(--line-soft); }
.hm-billpart .hm-ovt { display: flex; align-items: center; gap: 6px; }
.hm-billpart .hm-ic { width: 16px; height: 16px; color: var(--amber-soft); }
.hm-billpart b { font-size: 22px; color: var(--fg-strong); }
.hm-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.hm-scene { min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
            border-radius: 18px; border: 1px solid var(--line-soft); background: rgba(255,255,255,0.045); color: var(--fg); font-size: 13px; }
.hm-scene .hm-ic { width: 24px; height: 24px; color: var(--blue-soft); }
.hm-scene:hover { background: rgba(255,255,255,0.08); }
.hm-scene.run { opacity: 0.5; pointer-events: none; }
.hm-main .hm-rh { margin-top: 18px; }
@media (max-width: 900px) {
  .hm-ovgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hm-nav { max-width: none; flex-direction: row; flex-basis: 100%; overflow-x: auto; padding: 8px; border-radius: 16px; position: static; }
  .hm-nsp { display: none; }
  .hm-nv { flex: none; padding: 9px 12px; font-size: 14px; }
  .hm-nv .hm-ic { width: 18px; height: 18px; }
  .hm-ovgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hm-ov { min-height: 150px; padding: 14px; }
  .hm-ov.w2, .hm-ov.clim { grid-column: 1 / -1; }
  .hm-pill { display: none; }
}

/* Дом: время и погода */
.hm-ov.hm-time { --acc: var(--blue-soft); background: linear-gradient(160deg, rgba(56,139,253,0.18), rgba(255,255,255,0.03) 65%); border-color: rgba(56,139,253,0.25); }
.hm-ov.hm-time.wx-sun:not(.night) { background: linear-gradient(160deg, rgba(227,179,65,0.20), rgba(255,255,255,0.03) 65%); border-color: rgba(227,179,65,0.3); }
.hm-ov.hm-time.wx-rain, .hm-ov.hm-time.wx-storm { background: linear-gradient(160deg, rgba(88,110,140,0.30), rgba(255,255,255,0.03) 65%); }
.hm-ov.hm-time.night { background: linear-gradient(160deg, rgba(110,90,200,0.20), rgba(255,255,255,0.03) 65%); border-color: rgba(140,120,220,0.28); }
.hm-tclock { display: flex; flex-direction: column; }
.hm-tclock b { font-size: 52px; font-weight: 300; letter-spacing: -1.5px; line-height: 1; color: var(--fg-strong); }
.hm-date { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hm-wx { display: flex; align-items: center; gap: 12px; }
.hm-wxi { width: 40px; height: 40px; color: var(--amber-soft); flex: none; }
.hm-time.night .hm-wxi, .hm-time.wx-cloud .hm-wxi, .hm-time.wx-fog .hm-wxi { color: #c9d1d9; }
.hm-time.wx-rain .hm-wxi, .hm-time.wx-snow .hm-wxi, .hm-time.wx-storm .hm-wxi { color: var(--blue-soft); }
.hm-wxi svg { width: 100%; height: 100%; }
.hm-wxt { display: flex; flex-direction: column; }
.hm-wxt b { font-size: 26px; font-weight: 600; color: var(--fg-strong); line-height: 1.1; }
.hm-wxt span { font-size: 13px; color: var(--muted); }
.hm-time .hm-ovfoot { text-align: left; white-space: pre-line; }
@media (max-width: 720px) {
  .hm-ov.cam { aspect-ratio: 1 / 1; }
  .hm-tclock b { font-size: 40px; }
}

/* Дом: камера на обзоре и мобильная раскладка */
button.hm-ov.cam { cursor: pointer; font: inherit; color: inherit; text-align: left; }
button.hm-ov.cam:disabled { cursor: default; }
.hm-cambar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 22px 12px 10px;
             background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent); font-size: 13px; color: var(--fg-strong); }
.hm-camn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-cambar .hm-camt { font-size: 11px; color: #c9d1d9; }
@media (max-width: 720px) {
  .hm-ov.bills { flex-direction: column; gap: 12px; }
  .hm-billpart { padding-left: 0; border-left: 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
  .hm-billmain b { font-size: 32px; }
  .hm-ov.hm-time { min-height: 0; }
  .hm-ov.clim .hm-dial.sm { width: 120px; height: 120px; }
}

/* Дом: время и погода в шапке обзора */
.hm-trow { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hm-when { font-size: 15px; color: var(--muted); }
.hm-hl .hm-upd { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.hm-wline { display: inline-flex; align-items: center; gap: 8px; color: #c9d1d9; }
.hm-wline .hm-wxi { width: 24px; height: 24px; color: var(--amber-soft); }
.hm-wline .hm-wxi.night, .hm-wline .wx-cloud, .hm-wline .wx-fog { color: #c9d1d9; }
.hm-wline .wx-rain, .hm-wline .wx-snow, .hm-wline .wx-storm { color: var(--blue-soft); }
.hm-wline b { font-size: 17px; color: var(--fg-strong); font-weight: 600; }
.hm-wtail { color: var(--muted); }
.hm-wtail::before, .hm-hsum::before { content: "·"; margin-right: 8px; color: var(--dim); }
.hm-wline:empty + .hm-hsum::before { content: none; }
.hm-hsum { color: var(--muted); }
@media (max-width: 720px) {
  .hm-when { font-size: 13px; }
  .hm-hl .hm-upd { gap: 6px 10px; font-size: 13px; }
}

.hm-ov-ac { min-width: 0; }
.hm-ovsens { display: flex; flex-direction: column; gap: 8px; align-self: stretch; margin-top: 6px; }
.hm-ovsens div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.hm-ovsens b { color: var(--fg-strong); font-weight: 600; }
@media (max-width: 720px) { .hm-ov-ac { grid-column: 1 / -1; } }

/* Дом: компактный пульт кондиционера на обзоре — по размеру квадратной камеры */
.hm-ovgrid { align-items: start; }
.hm-ac2.compact { gap: 8px; padding: 14px; aspect-ratio: 1 / 1; overflow: hidden; }
.hm-ac2.compact .hm-dial { width: 118px; height: 118px; }
.hm-ac2.compact .hm-dial-t b { font-size: 34px; }
.hm-ac2.compact .hm-dial-t span { font-size: 16px; }
.hm-ac2.compact .hm-dial-s { font-size: 11px; }
.hm-ac2.compact .hm-tb { width: 40px; height: 40px; }
.hm-ac2.compact .hm-ac2-mid { flex: 1; min-height: 0; }
.hm-ac2.compact .hm-mode { padding: 7px 2px; }
.hm-ac2.compact .hm-mode span { display: none; }
.hm-ac2.compact .hm-speed .hm-lbl { font-size: 12px; }
.hm-ac2.compact .hm-extras { padding-top: 8px; gap: 5px; }
.hm-ac2.compact .hm-ex { padding: 6px 8px; }
.hm-ac2.compact .hm-ex span { display: none; }
.hm-ac2.compact .hm-pw { width: 38px; height: 38px; padding: 8px; }
@media (max-width: 720px) {
  .hm-ac2.compact { aspect-ratio: auto; }
}

/* Раздел «Сервер»: меню по категориям, как в «Доме» */
.adm-grp { padding: 14px 12px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.adm-grp:first-child { padding-top: 2px; }
.adm-nav .hm-nv { padding: 9px 12px; font-size: 14px; }
.adm-main .hm-head { margin-bottom: 10px; }
.adm-main .gauges { margin-top: 4px; }
.adm-single .adm-nav, .adm-single .adm-main > .hm-head { display: none; }
@media (max-width: 720px) {
  .adm-grp { display: none; }
  .adm-main .hm-head { display: none; }
}
/* камеры внутри «Дома»: вровень с меню, углы как у плиток */
.hm-camslot .cv { margin-top: 0; border-radius: 22px; }
/* настройки Aqara: HomeKit сверху, облако — запасной вариант в раскрывашке */
.hm-subh { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--fg-strong); margin-top: 4px; }
.hm-alt { grid-column: 1 / -1; margin-top: 10px; }
.hm-alt > .form { margin-top: 10px; }
/* ✎ плитки: выбор моторов окна; узкие плитки обзора — кнопки не вылезают */
.hm-picks { display: flex; flex-direction: column; gap: 6px; }
.hm-ovbtns .btn { min-width: 0; padding-left: 8px; padding-right: 8px; }
@media (max-width: 720px) {
  .hm-ov.bills { flex-direction: column; gap: 14px; min-height: 0; }
  .hm-billmain, .hm-billpart { flex: none; }
  .hm-billpart { padding-left: 0; border-left: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
}
.hm-hkrow { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px;
            background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); }
.hm-hkrow b { color: var(--fg-strong); }
.hm-hkrow .btn { margin-left: auto; }
/* сценарии: зимой / летом */
.hm-season { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px;
             background: rgba(88,166,255,0.08); border: 1px solid rgba(88,166,255,0.25); }
.hm-snow { font-weight: 600; color: var(--fg-strong); margin-right: auto; }
.hm-sdates { display: inline-flex; align-items: center; gap: 6px; }
.hm-sdates input { width: 64px; text-align: center; }
.hm-scrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hm-sccell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.hm-sccell > .sub { width: 100%; font-size: 11px; }
.hm-sccell select { flex: 1; min-width: 0; }
.hm-sct { width: 64px; }
@media (max-width: 560px) { .hm-scrow { grid-template-columns: 1fr; } }
/* обзор: перестановка плиток пальцем или мышью */
.hm-ovgrid.ovedit > * { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
                        outline: 2px dashed rgba(88,166,255,0.45); outline-offset: 3px; animation: hm-wiggle 1.6s ease-in-out infinite; }
.hm-ovgrid.ovedit > * * { pointer-events: none; }
.hm-ovgrid.ovedit > .dragging { cursor: grabbing; opacity: 0.6; animation: none; outline-color: var(--blue); z-index: 2; }
@keyframes hm-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-0.4deg); } 75% { transform: rotate(0.4deg); } }
/* обзор — «мозаика»: плитка занимает свою высоту, свободное место рядом с большими плитками заполняется следующими */
.hm-ovgrid.masonry { row-gap: 0; grid-auto-rows: 2px; grid-auto-flow: row dense; align-items: start; }
.hm-ovgrid.masonry > * { margin-bottom: 14px; }
@media (max-width: 720px) { .hm-ovgrid.masonry > * { margin-bottom: 10px; } }
/* обзор — сетка одинаковых ячеек (высота ячейки задаётся из home.js) */
.hm-ovgrid.cells { grid-auto-flow: row dense; align-items: stretch; }
.hm-ovgrid.cells > * { min-height: 0; margin: 0; height: auto; }
.hm-ovgrid.cells > .measure { align-self: start; }
.hm-ovgrid.cells > .hm-ov.cam { aspect-ratio: auto; }
.hm-ovgrid.cells > .hm-ov { overflow: hidden; }
/* пульт кондиционера в сетке: высоту задают ячейки, ширину — колонка (без квадрата, иначе он шире колонки) */
.hm-ovgrid.cells > .hm-ac2 { aspect-ratio: auto; width: auto; max-width: 100%; overflow: hidden; }
.hm-ovgrid.cells > .hm-ov { gap: 8px; }
.hm-ovgrid.cells .hm-ovchips { overflow-y: auto; min-height: 0; }
.hm-ovgrid.cells .hm-ovfoot { overflow: hidden; }
.hm-ovgrid.cells .hm-cvis { flex: 1 1 auto; min-height: 28px; max-height: 64px; height: auto; }
.hm-ovgrid.cells .hm-ic.big { width: 38px; height: 38px; }
/* автоматизации */
.hm-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.hm-rules > .hm-drop { grid-column: 1 / -1; }
.hm-rule { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,0.045);
           border: 1px solid var(--line-soft); }
.hm-rule.off { opacity: 0.55; }
.hm-rule.low { border-color: rgba(255,158,87,0.4); background: linear-gradient(150deg, rgba(255,126,87,0.14), rgba(255,255,255,0.03) 70%); }
.hm-rule.high { border-color: rgba(88,166,255,0.4); background: linear-gradient(150deg, rgba(88,166,255,0.14), rgba(255,255,255,0.03) 70%); }
.hm-ruleh { display: flex; align-items: center; gap: 8px; }
.hm-ruleh b { flex: 1; min-width: 0; color: var(--fg-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-rulet { font-size: 22px; font-weight: 600; color: var(--fg-strong); }
.hm-rules-st { font-size: 12px; color: var(--muted); }
/* ячейки: при замере — естественная высота; «Коммуналка» на телефоне — столбиком без переноса вбок */
.hm-ovgrid.cells > .measure { height: auto !important; }
@media (max-width: 720px) {
  .hm-ovgrid.cells > .hm-ov.bills { flex-wrap: nowrap; }
  .hm-head { flex-wrap: wrap; }
  .hm-head > .hm-hl { flex: 1 1 100%; }
  .hm-wline { flex-wrap: wrap; }
}

/* Дом: один экран-обзор (без бокового меню) */
.hm-app.one > .hm-main { flex: 1 1 100%; }
.hm-cvis.pick { cursor: pointer; }
.hm-cvis.pick:hover .hm-cl { filter: brightness(1.25); }
.hm-ov.bills.click { cursor: pointer; }
.hm-ov.bills.click:hover { border-color: rgba(63,185,80,0.45); }

/* Дом: окно «Коммуналка» — расход по дням и расчёт суммы */
#dlg.hm-udlg { width: min(760px, 96vw); }
.hm-usec { padding: 14px 0 10px; border-top: 1px solid var(--line-soft); }
.hm-uh { display: flex; align-items: baseline; gap: 12px; }
.hm-uh h3 { margin: 0; flex: 1; font-size: 16px; }
.hm-uh b { font-size: 16px; }
.hm-uwrap { margin: 10px 0 6px; }
.hm-uchart { width: 100%; height: auto; max-height: 220px; display: block; }
.hm-uchart .ax { stroke: var(--line-soft); stroke-width: 1; }
.hm-uchart .hit { fill: transparent; cursor: pointer; }
.hm-uchart .bar:hover .hit { fill: rgba(255,255,255,0.05); }
.hm-uchart .bar.future .hit { fill: rgba(255,255,255,0.015); }
.hm-uchart .dl, .hm-uchart .ml { fill: var(--muted); font-size: 9px; text-anchor: middle; }
.hm-uchart .ml { text-anchor: start; }
.hm-ulegend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.hm-ulegend span { display: inline-flex; align-items: center; gap: 6px; }
.hm-ulegend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hm-utip { min-height: 18px; margin-top: 4px; }
.hm-ucalc { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.hm-urow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 2fr) auto; gap: 10px; align-items: baseline;
           font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.hm-urow .nm { color: var(--fg-strong); }
.hm-urow.fx { grid-template-columns: minmax(0, 1.2fr) minmax(0, 3.4fr) auto; }
.hm-fixed { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; }
.hm-fixed .pwrow input[type=number] { max-width: 120px; }
.hm-urow b { text-align: right; }
.hm-uexp { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.hm-utotal { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 14px 0 4px; border-top: 1px solid var(--line-soft); font-size: 15px; }
.hm-utotal b { text-align: right; font-size: 18px; }
@media (max-width: 720px) {
  .hm-urow { grid-template-columns: 1fr auto; }
  .hm-urow .sub { grid-column: 1 / -1; }
}

/* Камеры: нижняя панель архива на узком телефоне — всё в одну строку без наездов */
.cv-ctl > * { flex-shrink: 0; }
.cv-ctl > .cv-bubble { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: clip; }
@media (max-width: 440px) {
  .cv-ctl { gap: 6px; padding: 8px 8px 2px; }
  .cv-ctl > .spacer { flex: 1 1 0; min-width: 0; }
  .cv-btn { min-width: 38px; height: 34px; padding: 0 8px; }
  .cv-live { padding: 0 10px; letter-spacing: 0; }
  .cv-bubble { font-size: 15px; padding: 5px 8px; }
}
@media (max-width: 360px) {
  .cv-bubble { font-size: 13px; padding: 5px 6px; }
  .cv-btn { min-width: 34px; padding: 0 6px; }
}

button.hm-pill { cursor: pointer; font: inherit; }
.hm-offl { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.hm-offl > div { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,0.04); }

.hm-avg { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; padding: 4px 0 8px; }
.hm-avg[hidden] { display: none; }

/* «Сервер» → «Подписки VPN» */
.subs-bar { margin-top: 26px; }
.subs-bar .section { margin: 0; }
.tbl td.subs-url { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td.bad-t { color: var(--red-soft); }
.chip.wg { border-color: rgba(88,166,255,.5); color: #a5d0ff; }
.subs-wg { grid-column: 1 / -1; margin: 0; }
.subs-wg[hidden] { display: none; }
.subs-test { margin: 8px 0; }
.subs-test .sub { margin-top: 4px; font-size: 13px; color: var(--dim); }
.row-in { display: flex; gap: 8px; }
.row-in input { flex: 1; min-width: 0; }
.subs-type { display: none; font-size: 12px; color: var(--dim); margin-top: 2px; }
@media (max-width: 640px) { .subs-type { display: block; } }
.subs-qr-url { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px;
  user-select: all; }

.ct-snd { position: absolute; right: 8px; bottom: 8px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0;
          display: grid; place-items: center; background: rgba(13,17,23,0.62); color: #f0f6fc; cursor: pointer; backdrop-filter: blur(4px); }
.ct-snd svg { width: 20px; height: 20px; }
.ct-snd.on { background: rgba(31,111,235,0.85); }
.ct-snd:hover { background: rgba(13,17,23,0.85); }
.ct-snd.on:hover { background: rgba(31,111,235,1); }

/* дубликаты */
.fm-dup { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 6px; }
.fm-dup-mode { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.fm-dup-mode .sub, .fm-dup .sub { color: var(--dim); font-size: 12px; }
.fm-dup-list { min-height: 120px; max-height: 55vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.fm-dup-g { flex: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fm-dup-gh { padding: 6px 12px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,0.04); }
.fm-dup-r { display: flex; align-items: center; gap: 10px; padding: 6px 12px; cursor: pointer; }
.fm-dup-r:hover { background: rgba(255,255,255,0.04); }
.fm-dup-th { width: 56px; height: 56px; flex: none; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); }
.fm-dup-th img, .fm-dup-th svg { width: 100%; height: 100%; object-fit: cover; }
.fm-dup-t { min-width: 0; flex: 1; }
.fm-dup-t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.fm-dup-more { flex: none; align-self: center; }
@media (max-width: 640px) { .fm-dup-list { max-height: 60vh; } .fm-dup-th { width: 48px; height: 48px; } }

/* лента фото */
.fm-gal { position: fixed; inset: 0; z-index: 60; background: var(--bg, #0d1117); display: flex; flex-direction: column; }
.fm-gal-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 56px; box-sizing: border-box; border-bottom: 1px solid var(--line); flex: none; }
.fm-gal-top b { flex: 1; min-width: 0; }
.fm-gal-body { position: absolute; top: 105px; left: 0; right: 0; bottom: 0; overflow-y: scroll; overflow-x: hidden; padding: 0 60px 0 8px;
               scrollbar-width: none; overscroll-behavior: contain; }
.fm-gal-body::-webkit-scrollbar { display: none; }
.fm-gal-m { overflow: hidden; }
.fm-gal-m h3 { margin: 0; height: 42px; line-height: 42px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-gal-m h3::first-letter { text-transform: uppercase; }
.fm-gal-grid { display: grid; gap: 3px; margin-bottom: 3px; }
.fm-gal-day { height: 28px; line-height: 28px; font-size: 12px; color: var(--muted); }
.fm-gal-t { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: rgba(255,255,255,0.05); cursor: pointer; overflow: hidden; border-radius: 3px; }
.fm-gal-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fm-gal-v { position: absolute; right: 6px; bottom: 4px; color: #fff; font-size: 12px; text-shadow: 0 0 4px #000; }
/* шкала времени (как в Google Фото) */
.fm-rail { position: absolute; top: 113px; bottom: 8px; right: 0; width: 56px; touch-action: none; cursor: pointer; user-select: none; }
.fm-rail-y { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); pointer-events: none; }
.fm-rail-d { position: absolute; right: 14px; width: 3px; height: 3px; margin-top: -1px; border-radius: 50%; background: rgba(255,255,255,0.28); pointer-events: none; }
.fm-rail-mark { position: absolute; right: 0; width: 56px; height: 2px; background: var(--blue-soft, #58a6ff); pointer-events: none; opacity: .0; transition: opacity .2s; }
.fm-rail-bub { position: absolute; right: 60px; transform: translateY(-50%); padding: 5px 10px; border-radius: 8px; background: #1f2630; border: 1px solid var(--line);
               font-size: 13px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; }
.fm-rail-bub.on { opacity: 1; }
.fm-rail:hover .fm-rail-mark, .fm-rail:active .fm-rail-mark { opacity: 1; }
.fm-gal:hover .fm-rail-mark { opacity: .8; }
.fm-gal-bar2 { position: absolute; top: 57px; left: 0; right: 0; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; z-index: 1; }
.fm-gal-chips { display: flex; gap: 6px; flex: none; }
.fm-gal-chip { height: 34px; border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 17px; padding: 0 14px; font: inherit; font-size: 13px; cursor: pointer; }
.fm-gal-chip.on { background: rgba(88,166,255,0.16); color: var(--blue-soft, #58a6ff); border-color: rgba(88,166,255,0.5); }
.fm-gal-q { flex: 1; min-width: 0; max-width: 360px; height: 34px; box-sizing: border-box; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 11px center / 16px no-repeat;
  border: 1px solid var(--line); border-radius: 17px; padding: 0 14px 0 34px; color: var(--fg); font: inherit; font-size: 14px; outline: none; -webkit-appearance: none; appearance: none; }
.fm-gal-q:focus { border-color: rgba(88,166,255,0.6); }
.fm-gal-q::placeholder { color: var(--dim, #6e7681); }
.fm-gal-q::-webkit-search-cancel-button { filter: invert(0.6); }
/* выбор в ленте */
.fm-gal-sel { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--bg, #0d1117); z-index: 2; }
.fm-gal-sel[hidden] { display: none; }
.fm-gal-sel b { flex: 1; min-width: 0; }
.fm-gal-top { position: relative; }
.fm-gal-ck { position: absolute; left: 5px; top: 5px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.85);
             background: rgba(0,0,0,0.25); opacity: 0; transition: opacity .12s; z-index: 1; box-sizing: border-box; }
.fm-gal-t:hover .fm-gal-ck, .selmode .fm-gal-ck { opacity: 1; }
.fm-gal-t.on .fm-gal-ck, .fm-gal-day.on .fm-gal-ck { opacity: 1; background: var(--blue, #388bfd) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--blue, #388bfd); }
.fm-gal-t.on img { transform: scale(0.86); border-radius: 6px; }
.fm-gal-t.on { background: rgba(56,139,253,0.25); }
.fm-gal-t img { transition: transform .12s; }
.fm-gal-day { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.fm-gal-day .fm-gal-ck { position: static; flex: none; width: 18px; height: 18px; opacity: 0; }
.fm-gal-day:hover .fm-gal-ck, .selmode .fm-gal-day .fm-gal-ck { opacity: 1; }
.fm-gal-src { height: 34px; max-width: 42vw; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 17px; padding: 0 10px; font: inherit; font-size: 13px; }
@media (max-width: 560px) { .fm-gal-ib span { display: none; } .fm-gal-ib { padding: 8px 10px; } .fm-gal-bar2 { flex-wrap: wrap; height: auto; padding: 6px 12px; row-gap: 6px; }
  .fm-gal-body { top: 150px; } .fm-rail { top: 158px; } .fm-gal-q { flex-basis: 100%; max-width: none; } }
.fm-link-m label.sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; cursor: pointer; }
.fm-link-m label.sub input, .fm-link > label.sub input { width: auto; margin: 0; }
.fm-links { max-height: 60vh; overflow: auto; }
.fm-links > * { flex: none; }

/* ───────── Здоровье ───────── */
.hl-bar { margin-top: 6px; }
.hl-bar .section { margin: 0; }
.hl-sel, .hl-in { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; outline: none; min-width: 0; }
.hl-in:focus, .hl-sel:focus { border-color: var(--blue); }
.hl-in[type=number] { width: 100px; flex: 1 1 90px; }
.hl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hl-seg button { background: transparent; border: 0; border-right: 1px solid var(--line); padding: 8px 13px; cursor: pointer; color: #c9d1d9; }
.hl-seg button:last-child { border-right: 0; }
.hl-seg button.on { background: rgba(56,139,253,.22); color: var(--fg-strong); }
.hl-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; }
.hl-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hl-card h3 { margin: 0; }
.hl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hl-row .spacer { flex: 1; }
.hl-row .hl-in[type=text] { flex: 1; }
.hl-sl { color: var(--dim); font-size: 22px; }
.hl-ck { color: #c9d1d9; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.hl-form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 18px; }
.hl-form .hl-in[type=text] { width: 100%; }
.hl-score { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.hl-score button { background: rgba(255,255,255,.05); border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 4px; cursor: pointer; font-size: 12px; color: #c9d1d9; }
.hl-score button.on { background: rgba(56,139,253,.25); border-color: var(--blue); color: var(--fg-strong); }
.hl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-chip { background: rgba(255,255,255,.05); border: 1px solid var(--line-soft); border-radius: 999px; padding: 5px 11px; cursor: pointer; font-size: 13px; color: #c9d1d9; }
.hl-chip.on { background: rgba(227,179,65,.2); border-color: var(--amber); color: var(--fg-strong); }
.hl-big { font-size: 34px; font-weight: 300; color: var(--fg-strong); line-height: 1.1; }
.hl-man { margin-top: 4px; }
.hl-med { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.hl-med-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.hl-tile { background: rgba(255,255,255,.045); border: 1px solid var(--line-soft); border-radius: 16px; padding: 14px 16px; }
.hl-lab { color: var(--muted); font-size: 13px; }
.hl-ro { margin-top: 14px; border-color: rgba(210,153,34,.5); background: rgba(210,153,34,.08); color: #f0d98c; }
.hl-chart { display: flex; flex-direction: column; gap: 6px; }
.hl-svg { width: 100%; height: auto; display: block; }
.hl-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.hl-lg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.hl-list { display: flex; flex-direction: column; }
.hl-item { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); align-items: center; }
.hl-when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.hl-what { min-width: 0; overflow-wrap: anywhere; }
.hl-bp.ok { color: var(--green-soft); } .hl-bp.warn { color: var(--amber-soft); } .hl-bp.bad { color: var(--red-soft); } .hl-bp.low { color: var(--blue-soft); }
.hl-acts { display: flex; gap: 6px; }
.hl-acts .btn { padding: 5px 10px; font-size: 13px; }
.hl-medrow { display: grid; grid-template-columns: 1.3fr 0.8fr 1.2fr auto auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.hl-medrow input[type=text] { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; width: 100%; }
@media (max-width: 720px) {
  .hl-item { grid-template-columns: 1fr auto; } .hl-when { grid-column: 1 / -1; }
  .hl-medrow { grid-template-columns: 1fr 1fr; }
  .hl-cols { grid-template-columns: 1fr; }
}

/* отчёт врачу: на экране — предпросмотр листа, при печати остаётся только он */
#hl-print { position: fixed; inset: 0; z-index: 50; background: #3a3f47; overflow: auto; }
.hl-tools { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.hl-sheet { background: #fff; color: #111; max-width: 820px; margin: 18px auto; padding: 36px 44px; border-radius: 4px; font-size: 14px; line-height: 1.4; }
.hl-sheet .sub { color: #666; }
.hl-sheet h1 { font-size: 24px; margin: 0 0 6px; }
.hl-sheet h2 { font-size: 15px; margin: 20px 0 8px; padding-bottom: 3px; border-bottom: 1px solid #bbb; break-after: avoid; }
.hl-meta { color: #444; font-size: 13px; }
.hl-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hl-t th, .hl-t td { border: 1px solid #ccc; padding: 4px 7px; text-align: left; vertical-align: top; }
.hl-t th { background: #f0f2f5; font-weight: 600; }
.hl-sum th { width: 38%; }
.hl-t tr { break-inside: avoid; }
.hl-t tr.hl-bad td { background: #fdecea; } .hl-t tr.hl-warn td { background: #fff7e0; } .hl-t tr.hl-low td { background: #e8f1fd; }
.hl-pre { white-space: pre-line; }
.hl-foot { margin-top: 18px; font-size: 11px; color: #777; }
.hl-sheet .hl-legend { color: #444; }
body.hl-printing { overflow: hidden; }
@media print {
  body.hl-printing > *:not(#hl-print) { display: none !important; }
  body.hl-printing { overflow: visible; background: #fff !important; }
  #hl-print { position: static; background: #fff; overflow: visible; }
  .hl-tools { display: none !important; }
  .hl-sheet { max-width: none; margin: 0; padding: 0; border-radius: 0; }
  @page { size: A4; margin: 14mm 12mm; }
}
.hl-entry { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.hl-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hl-cols .hl-wide { grid-column: 1 / -1; }
.hl-cols { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
@media (max-width: 720px) { .hl-cols { grid-template-columns: 1fr; } }

/* DLNA */
.dl-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); cursor: pointer; flex-wrap: wrap; }
.dl-row .sub { color: var(--dim); font-size: 12px; margin-left: auto; }
#dlna .sub { color: var(--dim); font-size: 12px; margin: 6px 0; }
#dlna .card > .btn { margin-top: 10px; }

/* «Обзор» */
#overview { display: flex; flex-direction: column; gap: 18px; }
#overview .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ov-title { display: flex; flex-direction: column; gap: 2px; }
.ov-title h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--fg-strong); }
.ov-sub { color: var(--muted); font-size: 14px; }
.ov-alert { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; padding: 10px 18px; border-radius: 14px; background: rgba(227,179,65,0.08); border: 1px solid rgba(227,179,65,0.32); }
.ov-alert.ok { background: rgba(63,185,80,0.08); border-color: rgba(63,185,80,0.3); gap: 10px; min-height: 48px; }
.ov-alert b { font-weight: 600; color: var(--fg-strong); }
.ov-pr { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 4px; background: none; border: 0; color: var(--fg); font-size: 14px; cursor: pointer; text-align: left; }
.ov-pr:hover { text-decoration: underline; }
.ov-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ov-kpi { background: rgba(255,255,255,0.045); border: 1px solid var(--line-soft); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ov-kpi .l { color: var(--muted); font-size: 13px; }
.ov-kpi .v { font-size: 26px; font-weight: 500; letter-spacing: -.02em; color: var(--fg-strong); }
.ov-kpi .s { color: var(--muted); font-size: 12.5px; }
.ov-g2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.ov-g2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ov-g2.one, .ov-g2e.one { grid-template-columns: minmax(0, 1fr); }
.ov-card { background: rgba(255,255,255,0.045); border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px 20px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ov-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.ov-h h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--fg-strong); }
.ov-link { background: none; border: 0; padding: 0; color: var(--blue-soft); cursor: pointer; font-size: 13px; font-weight: 500; }
.ov-link:hover { text-decoration: underline; }
.ov-empty { color: var(--dim); font-size: 13px; padding: 4px 0; }
.ov-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.ov-bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; transition: width .4s; }
.ov-bar i.warn { background: var(--amber-soft); }
.ov-bar i.bad { background: var(--red); }
.ov-disk { display: grid; grid-template-columns: minmax(110px, 190px) 1fr auto; align-items: center; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.ov-disk:first-of-type { border-top: 0; }
.ov-dn { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ov-dn b { font-weight: 500; font-size: 14px; color: var(--fg-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-dn span { color: var(--muted); font-size: 12.5px; }
.ov-dv { color: var(--muted); font-size: 13px; white-space: nowrap; text-align: right; }
.ov-nomount { color: var(--dim); font-size: 12.5px; }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b667a; flex: none; display: inline-block; }
.ov-dot.ok { background: var(--green); }
.ov-dot.warn { background: var(--amber-soft); }
.ov-dot.bad { background: var(--red); }
.ov-cams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ov-cam { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; cursor: pointer; padding: 0; border: 1px solid var(--line-soft); color: var(--fg); overflow: hidden;
          background: repeating-linear-gradient(135deg, #182130 0 10px, #151d2a 10px 20px); }
.ov-cam:hover { border-color: #3a4b66; }
.ov-cam .nm { position: absolute; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; background: rgba(11,15,22,0.78); padding: 3px 9px; border-radius: 6px; max-width: calc(100% - 16px); }
.ov-cam .rec { position: absolute; right: 8px; top: 8px; font-size: 11px; letter-spacing: .06em; background: rgba(11,15,22,0.78); padding: 2px 7px; border-radius: 6px; color: #ff9d97; }
.ov-cam .nosig { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; }
.ov-ev { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: inherit; font-family: inherit; font-size: 14px; text-align: left; cursor: pointer; width: 100%; }
.ov-ev:first-of-type { border-top: 0; padding-top: 2px; }
.ov-ev:hover b { text-decoration: underline; }
.ov-ev.past { opacity: .5; }
.ov-ev span { color: var(--muted); font-size: 13px; min-width: 56px; }
.ov-ev b { font-weight: 500; color: var(--fg-strong); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-svc { display: flex; align-items: center; gap: 12px; min-height: 52px; width: 100%; padding: 0; border: 0; border-top: 1px solid var(--line-soft); background: none; color: var(--fg); font-size: 14px; text-align: left; cursor: pointer; }
.ov-svc:first-of-type { border-top: 0; }
.ov-svc .ti:first-child { color: var(--muted); }
.ov-svc .grow { flex: 1; min-width: 0; font-weight: 500; }
.ov-svc .val { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ov-svc .chev { width: 16px; height: 16px; color: var(--muted); }
.ov-svc:hover .grow { text-decoration: underline; }
@media (max-width: 1180px) {
  .ov-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-g2, .ov-g2e { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .ov-title h2 { font-size: 22px; }
  .ov-kpis { gap: 10px; }
  .ov-kpi { padding: 12px 14px; border-radius: 14px; }
  .ov-kpi .v { font-size: 22px; }
  .ov-card { padding: 16px; border-radius: 14px; }
  .ov-cams { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ov-disk { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .ov-disk .ov-bar, .ov-disk .ov-nomount { grid-column: 1 / -1; grid-row: 2; }
  .ov-alert { flex-direction: column; align-items: flex-start; }
}

/* ───── оболочка: боковое меню ───── */
.wrap { max-width: none; margin: 0; padding: 0; display: flex; align-items: flex-start; }
.side { flex: 0 0 248px; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px;
        background: rgba(12,17,24,0.88); border-right: 1px solid var(--line-soft); z-index: 20; }
.content { flex: 1; min-width: 0; padding: 32px 40px 48px; max-width: 1560px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; font-weight: 600; font-size: 16px; color: var(--fg-strong); }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.ti { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tabs { display: flex; flex-direction: column; gap: 2px; margin: 0; border: 0; }
.tabs .grp { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 6px; }
.tab, .tab-more { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 10px; margin: 0; border: 0; border-radius: 10px;
                  background: none; color: #c7d1de; font-size: 14px; font-weight: 400; text-align: left; cursor: pointer; position: relative; }
.tab .ti, .tab-more .ti { color: var(--muted); }
.tab:hover, .tab-more:hover { background: rgba(255,255,255,0.06); color: var(--fg); }
.tab.on { background: rgba(56,139,253,0.16); color: var(--fg-strong); font-weight: 500; border: 0; }
.tab.on .ti { color: var(--blue-soft); }
.tab-more { display: none; }
.tb { margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #0b0f16; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.subnav { display: flex; flex-direction: column; margin: 0 0 6px; padding: 0; }
.sn { min-height: 36px; padding: 0 10px 0 40px; border: 0; border-radius: 8px; background: none; color: #c7d1de; font-size: 13.5px; text-align: left; cursor: pointer; }
.sn:hover { background: rgba(255,255,255,0.06); }
.sn.on { background: rgba(56,139,253,0.16); color: var(--fg-strong); font-weight: 500; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 4px 4px 10px; border-top: 1px solid var(--line-soft); }
.me-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-t b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.me-t small { color: var(--muted); font-size: 12px; }
.av { width: 34px; height: 34px; border-radius: 50%; background: #22304a; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.icb { width: 44px; height: 44px; border-radius: 10px; background: none; border: 0; color: var(--muted); display: grid; place-items: center; cursor: pointer; margin-left: auto; flex: none; }
.icb:hover { background: rgba(255,255,255,0.06); color: var(--fg); }
#adm-nav { display: none; }
.more { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.55); display: flex; align-items: flex-end; }
.more-card { width: 100%; max-height: 82vh; overflow-y: auto; background: #121923; border-radius: 20px 20px 0 0; border-top: 1px solid var(--line);
             padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 2px; }
.mi { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--fg); font-size: 15px; text-align: left; cursor: pointer; }
.mi .ti { color: var(--muted); }
.mi.on { background: rgba(56,139,253,0.16); }
.mi.sub { min-height: 44px; padding-left: 44px; font-size: 14px; color: #c7d1de; }
.mi.out { margin-top: 8px; border-top: 1px solid var(--line-soft); border-radius: 0 0 12px 12px; color: var(--muted); }

@media (max-width: 860px) {
  .wrap { display: block; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; flex-direction: row; overflow: visible; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
          border-right: 0; border-top: 1px solid var(--line-soft); background: rgba(12,17,24,0.96); backdrop-filter: blur(10px); }
  .brand, .tabs .grp, .me, .subnav { display: none !important; }
  .tabs { flex-direction: row; flex: 1; gap: 0; }
  .tab, .tab-more { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; min-height: 56px; padding: 0; font-size: 11.5px; text-align: center; border-radius: 12px; }
  .tab .tl, .tab-more .tl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body[data-more="1"] .tab:not([data-pri]) { display: none; }
  body[data-more="1"] .tab-more { display: flex; color: var(--muted); }
  .tb { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: 10.5px; padding: 0 4px; }
  .content { padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); }
}

.adm-sech { font-size: 12px; font-weight: 600; letter-spacing: 2px; color: var(--dim); text-transform: uppercase; margin: 28px 0 12px; }
.tab:focus, .tab-more:focus, .sn:focus, .icb:focus, .ov-pr:focus, .ov-svc:focus, .ov-cam:focus, .ov-ev:focus { outline: none; }
.kbnav .tab:focus-visible, .kbnav .tab-more:focus-visible, .kbnav .sn:focus-visible, .kbnav .icb:focus-visible { box-shadow: inset 0 0 0 2px rgba(121,192,255,0.55); }
.ov-pr.static { cursor: default; }
.ov-pr.static:hover { text-decoration: none; }
.ov-cam.img { background-size: cover; background-position: center; }
.ov-cam.img .nosig { display: none; }
#tab-vms::before { content: "Виртуальные машины"; display: block; margin: 0 0 14px; font-size: 26px; font-weight: 600; color: var(--fg-strong); letter-spacing: -.01em; }

/* меню профиля и вкладки страницы */
.me-wrap { margin-top: auto; position: relative; }
.me { width: 100%; margin: 0; background: none; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; color: inherit; text-align: left; cursor: pointer; min-height: 60px; padding: 14px 10px 4px; }
.me:hover .me-t b { text-decoration: underline; }
.pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 4px); background: #161e2b; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); z-index: 30; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.pi { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--fg); font-size: 14px; text-align: left; cursor: pointer; }
.pi:hover { background: rgba(255,255,255,0.06); }
.pi .ti { color: var(--muted); }
.pv { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 8px; }
.ptabs::-webkit-scrollbar { display: none; }
.pt { display: flex; align-items: center; min-height: 44px; padding: 0 16px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.pt:hover { color: var(--fg); }
.pt.on { color: var(--fg-strong); border-bottom-color: var(--blue); }
.pt:focus { outline: none; }
#adm-sub { display: none; }
@media (max-width: 860px) { .me-wrap { display: none; } }
.pl { display: flex; flex-direction: column; line-height: 1.25; }
.pl small { color: var(--muted); font-size: 12px; }

/* «Сервер → VPN»: карточки как в макете */
.vcard, .vpnp .vcard { background: rgba(255,255,255,0.045); border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px 20px; margin: 0 0 16px; min-width: 0; }
.vpnp .vcard > h2, .vpnp .vch h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.vpnp .vch { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.vpnp .vch h2 { margin: 0; }
.vpnp .vch .spacer { flex: 1; }
.vpnp .vcard .section { margin: 22px 0 10px; }
.vpnp .vcard .cards > * { background: rgba(255,255,255,0.03); }
@media (max-width: 860px) { .vpnp .vcard { padding: 14px; border-radius: 14px; } .vpnp .cards.two { grid-template-columns: 1fr; } }
.hl-title { margin: 0; font-size: 26px; font-weight: 600; color: var(--fg-strong); letter-spacing: -.01em; }

/* общие заголовки страниц и карточки */
.pg-title { margin: 0 0 16px; font-size: 26px; font-weight: 600; color: var(--fg-strong); letter-spacing: -.01em; }
.vcard { background: rgba(255,255,255,0.045); border: 1px solid var(--line-soft); border-radius: 16px; padding: 18px 20px; margin: 0 0 16px; min-width: 0; }
.vcard > h2, .vch h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.vch { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.vch h2 { margin: 0; }
.vch .spacer { flex: 1; }
.hint-inl { font-size: 13px; }
.g2e-pg { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.g2e-pg > .vcard { margin: 0; }
#tab-main .hint { display: none; }
@media (max-width: 860px) { .vcard { padding: 14px; border-radius: 14px; } .hint-inl { display: none; } }
.vm-notes { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; margin: 0 0 14px; }
.vm-notes b { font-weight: 600; }
#tab-files::before { content: "Файлы"; display: block; margin: 0 0 14px; font-size: 26px; font-weight: 600; color: var(--fg-strong); letter-spacing: -.01em; }
#tab-files .fm { margin-top: 0; }
.cl-menu { position: fixed; z-index: 60; min-width: 230px; background: #161e2b; border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.cl-menu-i { display: block; width: 100%; text-align: left; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--fg); font: inherit; cursor: pointer; }
.cl-menu-i:hover { background: rgba(255,255,255,.07); }
.cl-more-b { font-size: 20px; line-height: 1; }
.cl-src-err { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #ff9d97; margin: 0 0 6px; }
.cl-src-retry { background: none; border: 0; color: var(--blue); font: inherit; font-size: 12.5px; cursor: pointer; padding: 6px 0; min-height: 32px; }
#tab-cal::before { content: "Календарь"; display: block; margin: 0 0 14px; font-size: 26px; font-weight: 600; color: var(--fg-strong); letter-spacing: -.01em; }
.log-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 0 100%; margin-bottom: 4px; }
.log-chip { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
.log-chip.on { background: rgba(76,141,255,.18); border-color: rgba(76,141,255,.5); color: #fff; }
.log-chip.bad { color: #ff9d97; }
.chip-ev { display: inline-block; padding: 2px 10px; border-radius: 13px; font-size: 12.5px; border: 1px solid var(--line); background: rgba(255,255,255,.05); }
.chip-ev.good { color: #7ee08c; border-color: rgba(63,185,80,.35); background: rgba(63,185,80,.08); }
.chip-ev.bad { color: #ff9d97; border-color: rgba(255,107,99,.4); background: rgba(255,107,99,.08); }
/* «Камеры»: список камер — чипами над сеткой */
@media (min-width: 861px) {
  #tab-cams::before { content: "Камеры"; display: block; margin: 0 0 14px; font-size: 26px; font-weight: 600; color: var(--fg-strong); letter-spacing: -.01em; }
  #tab-cams .cv { margin-top: 0; }
  #tab-cams .cv-body { flex-direction: column; }
  #tab-cams .cv-side { width: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; border-right: 0;
                       border-bottom: 1px solid var(--line-soft); padding: 8px 10px; gap: 8px; scrollbar-width: none; }
  #tab-cams .cv-side::-webkit-scrollbar { display: none; }
  #tab-cams .cv-item { width: auto; flex: none; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line-soft); font-size: 14px; white-space: nowrap; }
  #tab-cams .cv-item.on { border-color: rgba(56,139,253,.5); }
  #tab-cams .cv-item .st { display: none; }
  #tab-cams .cv-sep { width: 1px; height: 24px; margin: 8px 2px; flex: none; }
}

/* «Подключения»: плитки без вложенной карточки, компактнее */
.pg-sec { margin: 0 0 22px; }
#tab-main .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
#tab-main .tile { min-height: 0; padding: 16px 18px; gap: 10px; }
#tab-main .tile .name { font-size: 17px; }
#tab-main .tile.add { min-height: 0; flex-direction: row; gap: 10px; padding: 0 18px; min-height: 120px; }
#tab-main .tile.add .plus { font-size: 28px; }
#tab-main .tile.add span:not(.plus), #tab-main .tile.add .lbl { font-size: 15px; }
#tab-main .g2e-pg { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
#tab-main .g2e-pg .vcard { padding: 16px 18px; }
#tab-main .tile { border-radius: 16px; }
#tab-main .tile .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
#tab-main .tile .host { margin-top: -4px; }

#main-tabs { margin: 0 0 18px; }
#tab-main [data-pane]:not(.on) { display: none; }
#tab-main .g2e-pg { display: block; }
#tab-main .g2e-pg > .vcard { margin: 0; }
