/* ===========================================================================
   TG Ops — оформление панели управления.
   Эстетика: операторская консоль. Спокойная нейтральная палитра, один акцент
   (азур), моноширинный шрифт для всех технических величин, точные «приборные»
   индикаторы прогресса. Светлая и тёмная темы через CSS-переменные.
   Шрифты системные — без внешних зависимостей, мгновенная загрузка, работает
   офлайн на сервере.
   =========================================================================== */

:root {
  /* тёмная тема по умолчанию */
  --bg:           #0d1117;
  --bg-grid:      rgba(255,255,255,0.025);
  --surface:      #161c24;
  --surface-2:    #1c2530;
  --surface-3:    #232d3a;
  --border:       #29333f;
  --border-strong:#3a4756;
  --text:         #e7edf4;
  --text-dim:     #9babbd;
  --text-faint:   #697789;
  --accent:       #4c8dff;
  --accent-hover: #6ba3ff;
  --accent-press: #3d79e6;
  --accent-soft:  rgba(76,141,255,0.14);
  --accent-line:  rgba(76,141,255,0.40);
  --ok:           #34c08a;
  --ok-soft:      rgba(52,192,138,0.14);
  --warn:         #e2b341;
  --warn-soft:    rgba(226,179,65,0.14);
  --danger:       #ef5b57;
  --danger-soft:  rgba(239,91,87,0.14);
  --shadow:       0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.28);
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.35);
  --radius:       10px;
  --radius-sm:    7px;
  --radius-lg:    14px;
  --rail-w:       232px;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "SF Mono", "Cascadia Code",
          "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg:           #eef1f6;
  --bg-grid:      rgba(15,30,60,0.03);
  --surface:      #ffffff;
  --surface-2:    #f4f6fa;
  --surface-3:    #eaeef4;
  --border:       #e0e6ef;
  --border-strong:#c6d0dd;
  --text:         #18212f;
  --text-dim:     #56627a;
  --text-faint:   #8794a6;
  --accent:       #2f6fed;
  --accent-hover: #2562d8;
  --accent-press: #1f55c0;
  --accent-soft:  rgba(47,111,237,0.10);
  --accent-line:  rgba(47,111,237,0.35);
  --ok:           #149a67;
  --ok-soft:      rgba(20,154,103,0.12);
  --warn:         #b27d1d;
  --warn-soft:    rgba(178,125,29,0.13);
  --danger:       #d6453f;
  --danger-soft:  rgba(214,69,63,0.10);
  --shadow:       0 1px 2px rgba(20,30,50,0.06), 0 10px 28px rgba(20,30,50,0.08);
  --shadow-sm:    0 1px 2px rgba(20,30,50,0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num  { font-variant-numeric: tabular-nums; }

::selection { background: var(--accent-soft); }

/* фон с едва заметной сеткой — техническая фактура без «украшательства» */
.grid-bg {
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* --------------------------------------------------------------------- скролл */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* ===================================================================== ВХОД */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 34px 30px 30px;
}
.login-mark {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 26px;
}
.login-mark .logo { width: 34px; height: 34px; }
.login-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.login-sub { color: var(--text-faint); font-size: 12.5px; margin-top: 1px; font-family: var(--mono); }
.login h1 { font-size: 19px; font-weight: 640; margin: 0 0 5px; letter-spacing: -0.02em; }
.login .hint { color: var(--text-dim); font-size: 13px; margin: 0 0 22px; }

/* ================================================================= КАРКАС */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100%; }

.rail {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.rail-head {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--border);
}
.rail-head .logo { width: 28px; height: 28px; flex: none; }
.rail-brand { font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em; }
.rail-brand small { display: block; font-family: var(--mono); font-weight: 500;
  font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.02em; }

.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer; font-weight: 530;
  border: 1px solid transparent;
  transition: background .12s, color .12s;
  user-select: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item .count {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  background: var(--surface-3); color: var(--text-dim);
  padding: 1px 7px; border-radius: 20px;
}
.nav-item.active .count { background: var(--accent); color: #fff; }

.rail-foot { padding: 12px 10px; border-top: 1px solid var(--border); display: flex; gap: 6px; }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: none; /* виден только на узких экранах */
  align-items: center; gap: 12px; flex-wrap: wrap; row-gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 30;
}
.topbar .logo { width: 26px; height: 26px; }
.topbar-brand { font-weight: 650; }
.topbar-spacer { flex: 1; }
.topbar-nav {
  display: flex; gap: 6px; width: 100%;
  flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; -ms-overflow-style: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }
.seg {
  flex: 0 0 auto; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-dim);
  font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
}
.seg svg { width: 16px; height: 16px; flex: none; }
.seg.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

.view { padding: 26px 30px 60px; max-width: 1120px; width: 100%; }

.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.view-head h1 { font-size: 21px; font-weight: 640; margin: 0; letter-spacing: -0.02em; }
.view-head .sub { color: var(--text-dim); font-size: 13px; margin-top: 3px; }

/* статусная точка нод в шапке/рейле */
.online-strip { display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  color: var(--text-dim); font-family: var(--mono); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot.on  { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--text-faint); }
.dot.busy{ background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

/* ================================================================= КНОПКИ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 560;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s, transform .04s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }
.btn-danger { color: var(--danger); border-color: var(--border-strong); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 9px; font-size: 12.5px; border-radius: 6px; }
.btn-icon { padding: 7px; }
.btn-block { width: 100%; }

/* ================================================================= ПОЛЯ */
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
label.lbl { display: block; font-size: 12.5px; font-weight: 560; color: var(--text-dim); margin-bottom: 6px; }
label.lbl .opt { color: var(--text-faint); font-weight: 400; }

.input, textarea.input, select.input {
  width: 100%; font: inherit;
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border-strong);
  transition: border-color .12s, box-shadow .12s;
}
[data-theme="light"] .input,
[data-theme="light"] textarea.input,
[data-theme="light"] select.input { background: var(--surface-2); }
.input:focus, textarea.input:focus, select.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-faint); }
textarea.input { resize: vertical; min-height: 84px; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.input.mono { font-family: var(--mono); }
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; }
.field-note { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }

/* переключатель */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 36px; height: 20px; border-radius: 20px; background: var(--surface-3);
  border: 1px solid var(--border-strong); position: relative; transition: background .15s, border-color .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--text-faint); transition: transform .15s, background .15s;
}
.switch input:checked + .track { background: var(--accent-soft); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--accent); }
.switch .switch-lbl { font-size: 13px; color: var(--text); }

/* ================================================================= КАРТОЧКИ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 12px; }
.cards { display: flex; flex-direction: column; gap: 12px; }
.grid-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }

/* ============================================================= БЕЙДЖ/ЧИП */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; letter-spacing: 0.01em;
  border: 1px solid transparent; text-transform: lowercase;
}
.badge.neutral { background: var(--surface-3); color: var(--text-dim); }
.badge.ok      { background: var(--ok-soft); color: var(--ok); }
.badge.run     { background: var(--accent-soft); color: var(--accent); }
.badge.warn    { background: var(--warn-soft); color: var(--warn); }
.badge.danger  { background: var(--danger-soft); color: var(--danger); }

/* ============================================================ ИНДИКАТОР */
.meter {
  --p: 0%;
  position: relative; height: 7px; border-radius: 20px;
  background: var(--surface-3); overflow: hidden;
}
.meter > i {
  position: absolute; inset: 0; width: var(--p);
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 20px; transition: width .4s ease;
}
.meter.thin { height: 5px; }
.meter.ok > i   { background: linear-gradient(90deg, var(--ok), #5fd6a6); }
.meter.warn > i { background: linear-gradient(90deg, var(--warn), #f0cb6e); }
.meter.idle > i { background: var(--border-strong); }

/* шкала диска */
.gauge { height: 8px; border-radius: 20px; background: var(--surface-3); overflow: hidden; display: flex; }
.gauge > .used  { background: var(--accent); }
.gauge > .share { background: var(--accent-soft); }

/* ===================================================================== TAG */
.tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); min-height: 42px;
}
[data-theme="light"] .tags { background: var(--surface-2); }
.tags:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 3px 5px 3px 9px; border-radius: 6px; font-family: var(--mono); font-size: 12px;
}
.tag button { border: none; background: none; color: var(--text-faint); cursor: pointer; display: flex; padding: 1px; border-radius: 4px; }
.tag button:hover { color: var(--danger); background: var(--danger-soft); }
.tags input {
  border: none; background: none; outline: none; color: var(--text);
  font-family: var(--mono); font-size: 13px; flex: 1; min-width: 140px; padding: 4px;
}

/* ============================================================== ЧЕКБОКСЫ */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.check {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; user-select: none; background: var(--bg); transition: border-color .12s, background .12s;
}
[data-theme="light"] .check { background: var(--surface-2); }
.check:hover { border-color: var(--text-faint); }
.check.on { border-color: var(--accent); background: var(--accent-soft); }
.check input { display: none; }
.check .box {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  flex: none; display: grid; place-items: center; color: #fff; transition: background .12s, border-color .12s;
}
.check.on .box { background: var(--accent); border-color: var(--accent); }
.check .box svg { width: 12px; height: 12px; opacity: 0; }
.check.on .box svg { opacity: 1; }
.check .ttl { font-size: 13px; }

/* ============================================================== СПИСКИ */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 560; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kv { display: flex; gap: 18px; flex-wrap: wrap; }
.kv > div { display: flex; flex-direction: column; gap: 1px; }
.kv .k { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.kv .v { font-family: var(--mono); font-size: 13px; }

.avatar {
  width: 38px; height: 38px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: 13px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}

/* ================================================================ ЗАДАЧИ */
.task { padding: 16px 18px; }
.task-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.task-srcs { font-weight: 580; font-size: 14.5px; }
.task-meta { font-family: var(--mono); font-size: 11.5px; color: var(--text-faint); margin-top: 2px;
  display: flex; gap: 10px; flex-wrap: wrap; }
.task-actions { margin-left: auto; display: flex; gap: 6px; }

.telemetry {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 13px 0 4px; padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.telemetry .cell .k { font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.telemetry .cell .v { font-family: var(--mono); font-size: 15px; font-weight: 560; margin-top: 2px; }
.cur-file { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-top: 10px;
  display: flex; align-items: center; gap: 8px; }
.cur-file .ellipsis { color: var(--text); }

.src-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.src-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.src-row .nm { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-row .st { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.src-row .meter { grid-column: 1 / -1; }

.log {
  margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-dim);
  max-height: 150px; overflow: auto; display: flex; flex-direction: column; gap: 3px;
}
.log .t { color: var(--text-faint); }
.disclosure { cursor: pointer; color: var(--text-dim); display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.disclosure svg { width: 13px; height: 13px; transition: transform .15s; }
.disclosure.open svg { transform: rotate(90deg); }

/* =============================================================== EMPTY */
.empty {
  text-align: center; padding: 64px 24px; color: var(--text-dim);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface);
}
.empty .ic { width: 40px; height: 40px; color: var(--text-faint); margin: 0 auto 14px; }
.empty h3 { margin: 0 0 6px; color: var(--text); font-weight: 600; font-size: 15px; }
.empty p { margin: 0 0 18px; font-size: 13px; max-width: 380px; margin-left: auto; margin-right: auto; }

/* =============================================================== МОДАЛКА */
.modal-root {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 22px;
  background: rgba(6,10,16,0.62); backdrop-filter: blur(3px);
}
.modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.modal.wide { max-width: 680px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; font-weight: 630; margin: 0; letter-spacing: -0.01em; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 20px; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.step-pip { flex: 1; height: 3px; border-radius: 3px; background: var(--surface-3); }
.step-pip.done { background: var(--accent); }

.callout {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; color: var(--text-dim);
}
.callout code, .code-inline { font-family: var(--mono); color: var(--text); }
.code-block {
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); white-space: pre-wrap; word-break: break-all;
}
[data-theme="light"] .code-block { background: var(--surface-2); }

.form-error { color: var(--danger); font-size: 12.5px; margin-top: 12px; min-height: 1px; }

/* мини-разбивка по типам в предпросмотре */
.mixbar { display: flex; height: 10px; border-radius: 20px; overflow: hidden; background: var(--surface-3); margin: 6px 0 12px; }
.mixbar > span { display: block; height: 100%; }
.mixlegend { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.mixlegend .it { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.mixlegend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mixlegend .ct { font-family: var(--mono); color: var(--text-dim); }

/* =============================================================== ТОСТЫ */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-left-width: 3px; border-radius: var(--radius-sm);
  padding: 11px 14px; box-shadow: var(--shadow); max-width: 360px; font-size: 13px;
  animation: toast-in .18s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent); }
.toast svg { width: 17px; height: 17px; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================================================ АДАПТИВ */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto; flex-direction: row; align-items: center;
    border-right: none; border-bottom: 1px solid var(--border); overflow-x: auto;
  }
  .rail-head { border-bottom: none; border-right: 1px solid var(--border); padding: 12px 14px; }
  .rail-head small { display: none; }
  .nav { flex-direction: row; padding: 8px; gap: 4px; }
  .nav-item { padding: 8px 12px; white-space: nowrap; }
  .nav-item .count { display: none; }
  .rail-foot { border-top: none; border-left: 1px solid var(--border); margin-left: auto; }
  .view { padding: 20px 16px 56px; }
  .telemetry { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .rail { display: none; }
  .topbar { display: flex; }
  .modal-root { padding: 12px; }
  .view-head h1 { font-size: 19px; }
  .field-row { flex-direction: column; gap: 0; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .task-actions { width: 100%; margin: 10px 0 0; }
  .task-actions .btn { flex: 1; }
}

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

/* ============================================================ НОДЫ */
.node-card { padding: 16px 18px; display: flex; flex-direction: column; }
.node-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.node-meta { font-size: 11px; color: var(--text-faint); }
.disks { display: flex; flex-direction: column; gap: 10px; }
.disk-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin-bottom: 4px; }
.disk-head .mono { color: var(--text-dim); max-width: 55%; }
.disk-free { color: var(--text-faint); white-space: nowrap; }
.node-proxy { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.node-proxy svg { width: 14px; height: 14px; flex: none; opacity: .7; }
.node-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.muted { color: var(--text-faint); }

/* ============================================================ ФАЙЛЫ */
.files-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 8px 0 4px; font-size: 13px; }
.crumb { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 2px 4px; border-radius: 5px; }
.crumb:hover { background: var(--surface-2); }
.crumb-sep { color: var(--text-faint); }
.file-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-top: 6px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--surface-2); }
.file-name { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; background: none; border: none; color: var(--text); font: inherit; cursor: default; text-align: left; padding: 0; }
button.file-name { cursor: pointer; }
button.file-name:hover { color: var(--accent); }
.file-name svg { width: 17px; height: 17px; flex: none; color: var(--text-dim); }
.file-size { font-family: var(--mono); font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.arc-jobs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.arc-job { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.arc-job-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 8px; }
.arc-job-top span:first-child { display: flex; align-items: center; gap: 8px; }
.arc-job-top svg { width: 15px; height: 15px; }
.bar { height: 6px; border-radius: 20px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }

/* ============================================================ НАСТРОЙКИ */
.set-title { display: flex; align-items: center; gap: 9px; font-weight: 620; font-size: 14.5px; }
.set-title svg { width: 18px; height: 18px; color: var(--text-dim); }
.callout.err { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 20px; background: var(--surface-3); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }
