/* ASIC Farm Panel V0.79.0 — schedule, sidebar check button, ASIC card, settings, market chart. */

/* ---------- Schedule page: only the schedule, no dashboard tiles ---------- */
body[data-view="schedule"] .metric-grid,
body[data-view="schedule"] .dashboard-health,
body[data-view="schedule"] .analytics-grid,
body[data-view="schedule"] .zec-panel,
body[data-view="schedule"] .model-strip,
body[data-view="schedule"] .asic-panel { display:none !important; }
body[data-view="schedule"] .schedule-panel { margin-top:0 !important; }

.schedule-mode-switch {
  display:inline-flex !important; flex-direction:row; flex:none; padding:4px; gap:4px; border:1px solid var(--line); border-radius:12px; background:var(--panel-soft,#f1f5f9);
}
.schedule-mode-switch button {
  min-height:36px; padding:0 16px; border:0; border-radius:9px; background:transparent; color:var(--muted);
  font:inherit; font-size:13px; font-weight:750; cursor:pointer; box-shadow:none; width:auto; white-space:nowrap;
}
.schedule-mode-switch button.active { background:#0871dc; color:#fff; box-shadow:0 4px 12px rgba(8,113,220,.28); }
.schedule-targets .schedule-all-farm-card {
  margin-top:12px; padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:var(--panel);
}
.schedule-targets .schedule-all-farm-card small { color:var(--muted); }
.schedule-pick { margin-top:12px; display:grid; gap:12px; }
.schedule-pick .schedule-search { margin:0 !important; width:100% !important; max-width:none !important; }
.schedule-none-warning {
  margin:0; padding:10px 14px; border-radius:10px; border:1px solid #f0d59e; background:#fff5df; color:#8a4f04; font-size:13px; font-weight:650;
}
.schedule-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
.schedule-col { border:1px solid var(--line); border-radius:14px; background:var(--panel); overflow:hidden; min-width:0; }
.schedule-col.in { border-color:rgba(32,185,101,.45); }
.schedule-col > header {
  display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px 10px 16px; border-bottom:1px solid var(--line);
  background:var(--panel-soft,#f8fafc);
}
.schedule-col.in > header { background:rgba(32,185,101,.09); }
.schedule-col > header > div { display:flex; align-items:center; gap:9px; min-width:0; }
.schedule-col > header b { font-size:14px; }
.schedule-count {
  display:inline-grid; place-items:center; min-width:28px; height:22px; padding:0 8px; border-radius:11px; font-size:12px; font-weight:800;
  color:#475569; background:rgba(100,116,139,.16);
}
.schedule-col.in .schedule-count { color:#fff; background:#20b965; }
.schedule-col > header button { min-height:32px; padding:0 12px; border-radius:9px; font-size:12px; font-weight:750; white-space:nowrap; }
.schedule-col > header button:disabled { opacity:.4; cursor:not-allowed; }
.schedule-col-list {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:8px; padding:12px; max-height:430px; overflow:auto; align-content:start;
}
.schedule-col-empty { grid-column:1/-1; margin:0; padding:22px 10px; text-align:center; color:var(--muted); font-size:13px; }
.schedule-asic-card {
  display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-height:46px; padding:6px 8px 6px 12px; text-align:left;
  border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--text); font:inherit; cursor:pointer; box-shadow:none;
  transition:border-color .12s, background .12s;
}
.schedule-asic-card > span { display:grid; gap:1px; min-width:0; }
.schedule-asic-card b { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.schedule-asic-card small { color:var(--muted); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.schedule-asic-card > i {
  flex:none; display:grid; place-items:center; width:24px; height:24px; border-radius:50%; font-style:normal; font-weight:800; font-size:15px; line-height:1;
}
.schedule-asic-card.add > i { color:#0871dc; background:rgba(8,113,220,.12); }
.schedule-asic-card.remove { border-color:rgba(32,185,101,.4); background:rgba(32,185,101,.06); }
.schedule-asic-card.remove > i { color:#c62828; background:rgba(198,40,40,.1); }
.schedule-asic-card.add:hover { border-color:#0871dc; background:rgba(8,113,220,.06); }
.schedule-asic-card.remove:hover { border-color:#c62828; background:rgba(198,40,40,.06); }
#saveScheduleBtn.dirty { background:#20b965 !important; color:#fff !important; border-color:#20b965 !important; box-shadow:0 6px 16px rgba(32,185,101,.35); }
html[data-theme="dark"] .schedule-mode-switch { background:rgba(255,255,255,.05); }
html[data-theme="dark"] .schedule-col > header { background:rgba(255,255,255,.04); }
html[data-theme="dark"] .schedule-none-warning { background:rgba(240,180,60,.12); border-color:rgba(240,180,60,.35); color:#f3c56b; }
html[data-theme="dark"] .schedule-count { color:#cbd5e1; }
@media (max-width:900px) { .schedule-columns { grid-template-columns:1fr; } .schedule-col-list { max-height:300px; } }

/* ---------- Sidebar "check now" button: fits the collapsed menu ---------- */
@media (min-width:761px) {
  body.sidebar-collapsed .check-cycle-card {
    display:grid !important; grid-template-columns:1fr !important; justify-items:center; gap:0;
    padding:0 !important; margin-left:auto !important; margin-right:auto !important;
    left:0 !important; right:0 !important; width:44px !important; min-width:0 !important; box-sizing:border-box;
    border:0 !important; background:transparent !important; box-shadow:none !important; overflow:visible;
  }
  body.sidebar-collapsed .check-cycle-trigger { width:40px; height:40px; border-radius:12px; margin:0; justify-self:center; }
  body.sidebar-collapsed .check-cycle-trigger svg { width:20px; height:20px; }
}

/* ---------- Settings window V2: tabs on the left, fixed header, scrolling body ---------- */
#settingsModal { padding:0; max-width:none; max-height:none; overflow:visible; }
.modal-card.settings-v2 {
  display:flex; flex-direction:column; width:min(1060px,calc(100vw - 32px)); height:min(760px,calc(100vh - 32px)); max-height:none;
  padding:0 !important; overflow:hidden; border-radius:20px;
}
.settings-v2-head {
  flex:none; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 22px; border-bottom:1px solid var(--line);
  background:var(--panel);
}
.settings-v2-head h3 { margin:0; font-size:21px; }
.settings-v2-head p { margin:3px 0 0; color:var(--muted); font-size:13px; }
.settings-v2-head p b { color:var(--text); }
.settings-v2-body { flex:1; min-height:0; display:grid; grid-template-columns:236px minmax(0,1fr); }
.settings-v2-tabs {
  display:flex; flex-direction:column; gap:4px; padding:14px 12px; border-right:1px solid var(--line); background:var(--panel-soft,#f6f8fb); overflow:auto;
}
.settings-v2-tabs button {
  display:flex; align-items:center; gap:11px; width:100%; min-height:52px; padding:8px 10px; border:0; border-radius:12px; background:transparent;
  color:var(--text); font:inherit; text-align:left; cursor:pointer; box-shadow:none;
}
.settings-v2-tabs button > i {
  flex:none; display:grid; place-items:center; width:32px; height:32px; border-radius:10px; font-style:normal; font-size:15px; color:#64748b; background:rgba(100,116,139,.13);
}
.settings-v2-tabs button > span { display:grid; gap:1px; min-width:0; }
.settings-v2-tabs button b { font-size:14px; }
.settings-v2-tabs button small { color:var(--muted); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.settings-v2-tabs button:hover { background:rgba(8,113,220,.07); }
.settings-v2-tabs button.active { background:var(--panel); box-shadow:0 2px 10px rgba(15,23,42,.08), inset 0 0 0 1px var(--line); }
.settings-v2-tabs button.active > i { color:#fff; background:#0871dc; }
.settings-v2-panes { min-width:0; overflow:auto; padding:22px 24px 26px; }
.settings-pane { display:none; gap:16px; }
.settings-pane.active { display:grid; align-content:start; }
.settings-pane-title h4 { margin:0 0 4px; font-size:19px; }
.settings-pane-title p { margin:0; color:var(--muted); font-size:13px; line-height:1.45; max-width:640px; }
.settings-group-title { margin:6px 0 -4px; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.settings-v2 .form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
.settings-v2 .form-grid .wide { grid-column:1/-1; }
.settings-v2 .form-grid label { display:grid; gap:6px; align-content:start; min-width:0; }
.settings-v2 .form-grid label > span { font-size:13px; font-weight:700; color:var(--text); }
.settings-v2 .form-grid label > small { color:var(--muted); font-size:12px; line-height:1.4; }
.settings-v2 .form-grid input:not([type="checkbox"]), .settings-v2 .form-grid select {
  width:100%; min-height:42px; padding:0 12px; border:1px solid var(--line); border-radius:11px; background:var(--panel); color:var(--text); font:inherit; font-size:15px;
}
.settings-unit { position:relative; }
.settings-unit input { padding-right:46px !important; }
.settings-unit em { position:absolute; right:13px; top:50%; transform:translateY(-50%); color:var(--muted); font-style:normal; font-size:12px; pointer-events:none; }
.settings-unit input::-webkit-outer-spin-button, .settings-unit input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.settings-unit input[type=number] { -moz-appearance:textfield; appearance:textfield; }
.settings-switch { display:flex !important; align-items:flex-start; gap:11px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--panel-soft,#f8fafc); cursor:pointer; }
.settings-switch input { margin-top:3px; width:17px; height:17px; flex:none; }
.settings-switch > span { display:grid !important; gap:2px; }
.settings-switch small { color:var(--muted); font-size:12px; font-weight:400; }
.settings-pane-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding-top:4px; }
.settings-pane-actions button { min-height:42px; padding:0 18px; border-radius:11px; font-weight:750; }
.settings-pane-actions .hint { margin:0; flex:1 1 220px; }
.settings-farms-list { display:grid; gap:8px; }
.settings-farm-row {
  display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; align-items:center; gap:10px; padding:12px 14px; border:1px solid var(--line); border-radius:13px; background:var(--panel);
}
.settings-farm-main { display:grid; gap:2px; min-width:0; }
.settings-farm-main b { font-size:15px; }
.settings-farm-main span { color:var(--muted); font-size:12px; }
.settings-farm-row button { min-height:34px; padding:0 13px; border-radius:9px; font-size:13px; font-weight:700; }
.settings-farm-fixed { min-width:74px; text-align:center; color:var(--muted); font-size:12px; }
.settings-agent-pill { padding:5px 10px; border-radius:20px; font-size:12px; font-weight:700; white-space:nowrap; color:#475569; background:rgba(100,116,139,.14); }
.settings-agent-pill.ok { color:#147a3d; background:rgba(32,185,101,.14); }
.settings-agent-pill.warn { color:#9b5c00; background:rgba(240,170,40,.18); }
.settings-agent-pill.bad { color:#b3261e; background:rgba(229,57,53,.13); }
.settings-agent-status { display:flex; align-items:center; gap:12px; padding:13px 15px; border:1px solid var(--line); border-radius:13px; background:var(--panel); }
.settings-agent-status > i { flex:none; width:11px; height:11px; border-radius:50%; background:#94a3b8; }
.settings-agent-status.ok > i { background:#20b965; box-shadow:0 0 0 5px rgba(32,185,101,.18); }
.settings-agent-status.warn > i { background:#f0a428; box-shadow:0 0 0 5px rgba(240,164,40,.2); }
.settings-agent-status.bad > i { background:#e53935; box-shadow:0 0 0 5px rgba(229,57,53,.16); }
.settings-agent-status div { display:grid; gap:2px; }
.settings-agent-status small { color:var(--muted); font-size:12px; }
.settings-server-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.settings-server-grid article { display:grid; gap:3px; padding:15px 16px; border:1px solid var(--line); border-left:4px solid #94a3b8; border-radius:13px; background:var(--panel); }
.settings-server-grid article.ok { border-left-color:#20b965; }
.settings-server-grid article.warn { border-left-color:#f0a428; }
.settings-server-grid article.bad { border-left-color:#e53935; }
.settings-server-grid span { color:var(--muted); font-size:12px; font-weight:700; }
.settings-server-grid b { font-size:24px; }
.settings-server-grid small { color:var(--muted); font-size:12px; }
.settings-v2 .panel-user-row { border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:var(--panel); }
.settings-v2 .installer-download-card { margin:0; }
.profile-admin-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.profile-admin-link {
  display:flex; align-items:center; gap:11px; min-height:56px; padding:9px 12px; border:1px solid var(--line); border-radius:13px; background:var(--panel);
  color:var(--text); font:inherit; text-align:left; cursor:pointer; box-shadow:none;
}
.profile-admin-link:hover { border-color:#0871dc; background:rgba(8,113,220,.05); }
.profile-admin-link > i { flex:none; display:grid; place-items:center; width:34px; height:34px; border-radius:10px; font-style:normal; color:#0871dc; background:rgba(8,113,220,.12); }
.profile-admin-link > span { display:grid; gap:1px; }
.profile-admin-link small { color:var(--muted); font-size:12px; }
html[data-theme="dark"] .settings-v2-tabs { background:#141a22; }
html[data-theme="dark"] .settings-v2-head, html[data-theme="dark"] .modal-card.settings-v2 { background:#171e27; }
html[data-theme="dark"] .settings-switch { background:rgba(255,255,255,.03); }
html[data-theme="dark"] .settings-agent-pill.ok { color:#6fe0a0; } html[data-theme="dark"] .settings-agent-pill.warn { color:#f3c56b; } html[data-theme="dark"] .settings-agent-pill.bad { color:#ff9b96; }
@media (max-width:820px) {
  .modal-card.settings-v2 { width:100vw; height:100vh; border-radius:0; }
  .settings-v2-body { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); }
  .settings-v2-tabs { flex-direction:row; border-right:0; border-bottom:1px solid var(--line); padding:8px; }
  .settings-v2-tabs button { width:auto; flex:none; min-height:42px; }
  .settings-v2-tabs button small { display:none; }
  .settings-v2 .form-grid, .settings-server-grid, .profile-admin-grid { grid-template-columns:1fr; }
  .settings-farm-row { grid-template-columns:1fr 1fr; }
  .settings-farm-main, .settings-agent-pill { grid-column:1/-1; justify-self:start; }
  .settings-v2-panes { padding:16px 14px 22px; }
}

/* "+ Ферма" left the top bar (now: Settings → «Все фермы» and Profile → «Админка»). */
.topbar .farm-add-btn { display:none !important; }
.installer-download-copy b span { font:inherit; color:inherit; }

/* ---------- ASIC card: wider and taller, everything visible without scrolling ---------- */
@media (min-width:761px) {
  #detailModal .asic-status-card {
    width:min(1360px,calc(100vw - 32px)); height:min(720px,calc(100vh - 20px)); max-height:calc(100vh - 20px);
  }
  #detailModal .asic-status-titlebar { padding:11px 18px; }
  #detailModal .asic-native-body { padding:12px 18px 2px; }
  #detailModal .asic-native-section { margin:0 0 10px; }
  #detailModal .asic-native-section-head { margin:0 0 6px; }
  #detailModal .asic-native-section-head h4 { font-size:15px; margin:0; display:inline; }
  #detailModal .asic-native-section-head p { display:inline; margin-left:8px; }
  #detailModal .asic-summary-item { padding:8px 12px; }
  #detailModal .asic-native-table th { padding-top:6px; padding-bottom:6px; }
  #detailModal .asic-native-table td { padding-top:7px; padding-bottom:7px; }
  #detailModal .asic-fans-strip { padding-top:8px; padding-bottom:8px; }
  #detailModal .asic-status-actions { padding-top:10px; padding-bottom:10px; }
  #detailModal .asic-history-link { min-height:28px; }
}
@media (min-width:1180px) {
  /* all eight summary values in one line */
  #detailModal .asic-summary-grid { grid-template-columns:repeat(8,minmax(0,1fr)); }
  #detailModal .asic-summary-item { border-top:0 !important; border-right:1px solid var(--line) !important; }
  #detailModal .asic-summary-item:last-child { border-right:0 !important; }
}

/* ---------- Market chart V2 ---------- */
.zec-panel.market-v2 { padding:0 !important; overflow:hidden; display:block !important; }
body[data-view="asics"] .zec-panel.market-v2, body[data-view="schedule"] .zec-panel.market-v2, body[data-view="logs"] .zec-panel.market-v2 { display:none !important; }
.market-v2-head { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; padding:16px 20px; border-bottom:1px solid var(--line); }
.market-v2-head h2 { margin:0 0 3px; font-size:17px; }
.market-v2-head .market-live { color:var(--muted); font-size:12px; font-weight:600; }
.market-v2-controls { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.market-v2-controls select { min-height:38px; padding:0 30px 0 12px; border:1px solid var(--line); border-radius:10px; background-color:var(--panel); color:var(--text); font:inherit; font-size:13px; font-weight:700; }
.market-v2-ranges { display:inline-flex; gap:3px; padding:3px; border-radius:11px; background:var(--panel-soft,#f1f5f9); border:1px solid var(--line); }
.market-v2-ranges button { min-height:32px; padding:0 13px; border:0; border-radius:8px; background:transparent; color:var(--muted); font:inherit; font-size:12px; font-weight:750; cursor:pointer; box-shadow:none; }
.market-v2-ranges button.active { background:var(--panel); color:#0871dc; box-shadow:0 1px 5px rgba(15,23,42,.12); }
.market-v2-body { display:grid; grid-template-columns:250px minmax(0,1fr); }
.market-v2-side { display:grid; gap:10px; align-content:start; padding:16px; border-right:1px solid var(--line); background:var(--panel-soft,#f8fafc); }
.market-v2-card { display:grid; gap:2px; padding:12px 14px; border:1px solid var(--line); border-left:4px solid #94a3b8; border-radius:12px; background:var(--panel); }
.market-v2-card.price { border-left-color:#1477e5; }
.market-v2-card.difficulty { border-left-color:#f0a024; }
.market-v2-card > span { color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.market-v2-card > strong { font-size:23px; line-height:1.2; color:var(--text); }
.market-v2-card > b { font-size:14px; }
.market-v2-card > b.positive, .market-v2-avg b.positive { color:#209447; }
.market-v2-card > b.negative, .market-v2-avg b.negative { color:#df3e38; }
.market-v2-trend { display:grid; gap:7px; margin-top:6px; font-size:12px; color:var(--muted); }
.market-v2-range { position:relative; height:6px; border-radius:3px; background:linear-gradient(90deg,#df3e38,#f0a024,#209447); opacity:.9; }
.market-v2-range i { position:absolute; top:50%; width:12px; height:12px; margin:-6px 0 0 -6px; border-radius:50%; background:var(--panel); border:3px solid #1477e5; box-sizing:border-box; }
.market-v2-minmax { display:flex; justify-content:space-between; gap:8px; }
.market-v2-minmax b, .market-v2-avg b { color:var(--text); font-size:13px; }
.market-v2-chart { min-width:0; display:flex; flex-direction:column; padding:14px 12px 10px; }
.market-v2-canvas { position:relative; flex:1; min-height:270px; }
.market-v2-canvas canvas { position:absolute; inset:0; width:100% !important; height:100% !important; display:block; cursor:crosshair; }
.market-v2-tooltip {
  position:absolute; top:8px; z-index:3; min-width:168px; display:grid; gap:4px; padding:9px 11px; border:1px solid var(--line); border-radius:11px;
  background:var(--panel); box-shadow:0 10px 26px rgba(15,23,42,.16); font-size:12px; pointer-events:none;
}
.market-v2-tooltip b { font-size:12px; color:var(--muted); }
.market-v2-tooltip span { display:flex; align-items:center; gap:7px; color:var(--text); }
.market-v2-tooltip em { margin-left:auto; font-style:normal; font-weight:800; }
.market-v2-tooltip i, .market-v2-legend i { flex:none; width:10px; height:10px; border-radius:50%; }
.market-v2 i.price { background:#1477e5; } .market-v2 i.difficulty { background:#f0a024; }
.market-v2-legend { display:flex; align-items:center; gap:18px; flex-wrap:wrap; padding:10px 8px 2px 62px; color:var(--muted); font-size:12px; }
.market-v2-legend span { display:inline-flex; align-items:center; gap:7px; }
.market-v2-legend em { font-style:normal; }
.market-v2-source { margin-left:auto; font-size:11px; opacity:.8; }
.market-v2-hint { margin:0; padding:0 20px; color:var(--muted); font-size:12px; }
.market-v2-hint:not(:empty) { padding:0 20px 12px; }
html[data-theme="dark"] .market-v2-side, html[data-theme="dark"] .market-v2-ranges { background:rgba(255,255,255,.03); }
@media (max-width:900px) {
  .market-v2-body { grid-template-columns:1fr; }
  .market-v2-side { grid-template-columns:repeat(3,minmax(0,1fr)); border-right:0; border-bottom:1px solid var(--line); }
  .market-v2-legend { padding-left:8px; }
}
@media (max-width:620px) { .market-v2-side { grid-template-columns:1fr; } }
.market-v2-canvas canvas { max-height:none !important; min-height:0 !important; }

/* ---------- V0.79.1: worker-account switch above the dashboard tiles ---------- */
.worker-scope-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0 0 12px; }
.worker-scope-bar > span { color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; margin-right:2px; }
.worker-scope-bar button {
  display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 8px 0 14px; border:1px solid var(--line); border-radius:18px;
  background:var(--panel); color:var(--text); font:inherit; font-size:13px; font-weight:700; cursor:pointer; box-shadow:none; width:auto;
}
.worker-scope-bar button b { min-width:26px; padding:2px 7px; border-radius:11px; font-size:12px; text-align:center; color:#475569; background:rgba(100,116,139,.15); }
.worker-scope-bar button:hover { border-color:#0871dc; }
.worker-scope-bar button.active { background:#0871dc; border-color:#0871dc; color:#fff; box-shadow:0 4px 12px rgba(8,113,220,.28); }
.worker-scope-bar button.active b { color:#0871dc; background:#fff; }
body[data-view="schedule"] .worker-scope-bar, body[data-view="logs"] .worker-scope-bar { display:none !important; }
#farmMap .farm-slot.scope-dim { opacity:.22; filter:grayscale(.6); }
html[data-theme="dark"] .worker-scope-bar button b { color:#cbd5e1; }
html[data-theme="dark"] .worker-scope-bar button.active b { color:#0871dc; }

/* ---------- V0.79.2: compact farm switch + worker switch next to it (top bar) ---------- */
@media (min-width:761px) {
  .topbar .farm-switch { min-height:40px !important; height:40px !important; padding:0 6px 0 12px !important; gap:8px !important; border-radius:12px !important; }
  .topbar .farm-switch > span { font-size:11px !important; }
  .topbar .farm-switch select { font-size:14px !important; font-weight:700 !important; min-height:0 !important; height:38px !important; padding:0 26px 0 2px !important; max-width:230px; text-overflow:ellipsis; }
  .topbar .worker-switch select { max-width:190px; }
}
.topbar .worker-switch.active { border-color:#0871dc !important; box-shadow:0 0 0 3px rgba(8,113,220,.14) !important; }
.topbar .worker-switch.active > span { color:#0871dc !important; }
body[data-view="schedule"] .worker-switch, body[data-view="logs"] .worker-switch { display:none !important; }
@media (min-width:761px) { .topbar .farm-switch { flex:0 0 auto !important; width:auto !important; } .topbar .farm-switch select { width:auto !important; } }
/* V0.79.3: switches are only as wide as their text */
@media (min-width:761px) {
  .topbar .farm-switch { min-width:0 !important; max-width:none !important; }
  .topbar .farm-switch select { flex:0 0 auto !important; min-width:0 !important; }
}
/* V0.79.4: smaller top-bar switches */
@media (min-width:761px) {
  .topbar .farm-switch { min-height:34px !important; height:34px !important; padding:0 4px 0 10px !important; gap:6px !important; border-radius:10px !important; box-shadow:none !important; }
  .topbar .farm-switch > span { font-size:10px !important; }
  .topbar .farm-switch select { font-size:13px !important; height:32px !important; padding:0 22px 0 0 !important; }
}
/* V0.79.5: board problem without per-chip data — amber, no particular chip singled out */
.asic-chip-dots i.unknown { border-color:#e0a020 !important; background:rgba(224,160,32,.18) !important; }

/* V0.79.8: farm agent silent */
.agent-stale-banner { display:grid; gap:4px; margin:0 0 14px; padding:14px 18px; border:1px solid #f0b4b0; border-left:5px solid #e53935; border-radius:14px; background:#fff3f2; color:#8f1d17; }
.agent-stale-banner b { font-size:15px; }
.agent-stale-banner span { font-size:13px; color:#7a2a25; }
body[data-view="schedule"] .agent-stale-banner, body[data-view="logs"] .agent-stale-banner { display:none !important; }
html[data-theme="dark"] .agent-stale-banner { background:rgba(229,57,53,.12); border-color:rgba(229,57,53,.4); color:#ffb4ae; }
html[data-theme="dark"] .agent-stale-banner span { color:#f3c0bb; }

/* ---------- V0.80: sub-account (role "client") — reduced panel ---------- */
body.role-client #sideNav [data-target="Расписание"],
body.role-client #sideNav [data-target="Настройки"],
body.role-client .bottom-nav button:nth-child(3),
body.role-client .bottom-nav button:nth-child(4),
body.role-client .bottom-nav button:nth-child(5),
body.role-client .farm-map-panel,
body.role-client .schedule-panel,
body.role-client #addAsicBtn,
body.role-client #scanNetworkBtn,
body.role-client:not(.perm-export) .asic-primary-actions > .asic-toolbar-menu,
body.role-client #bulkAddBtn,
body.role-client #rebootAllBtn,
body.role-client:not(.perm-firmware) .selected-firmware-menu,
body.role-client #deleteSelectedBtn,
body.role-client .agent-stale-banner span { display:none !important; }
/* V0.81: per-farm actions — a granted farm or a view-only (expired) farm */
body.farm-limited:not(.perm-reboot) #rebootSelectedBtn, body.farm-limited:not(.perm-reboot) #detailRebootBtn,
body.farm-limited:not(.perm-reboot) #rebootAllBtn,
body.farm-limited:not(.perm-locate) #detailLocateBtn,
body.farm-limited:not(.perm-stop) #detailStopBtn,
body.farm-limited:not(.perm-start) #detailStartBtn,
body.farm-limited:not(.perm-change_pool) #poolSelectedBtn, body.farm-limited:not(.perm-profile) #profileSelectedBtn,
body.farm-limited:not(.perm-change_pool) #detailPoolBtn,
body.farm-limited:not(.perm-change_pool) .asic-inline-config, body.farm-limited:not(.perm-profile) .asic-profile-editor,
body.farm-limited:not(.perm-change_worker) #detailWorkerBtn,
body.farm-limited:not(.perm-firmware) .selected-firmware-menu,
body.farm-limited:not(.perm-add) #addAsicBtn, body.farm-limited:not(.perm-add) #bulkAddBtn,
body.farm-limited:not(.perm-scan) #scanNetworkBtn,
body.farm-limited:not(.perm-delete) #deleteSelectedBtn,
body.farm-limited:not(.perm-check) #checkAllBtn { display:none !important; }
body.farm-readonly #shareSelectedBtn, body.role-client #shareSelectedBtn, body.farm-readonly .map-edit-btn { display:none !important; }
.readonly-banner { display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; margin:0 0 12px; padding:10px 14px; border-radius:12px;
  background:#fff6e5; border:1px solid #f1d39b; color:#7a5200; font-size:14px; }
.readonly-banner b { font-weight:700; }
html[data-theme="dark"] .readonly-banner { background:#3a2c10; border-color:#6b5320; color:#f3d79c; }
/* onboarding (after registration) */
.login-overlay.onboarding-overlay { z-index: 110; overflow-y:auto; }
.login-overlay .login-card.onboarding-card { width:min(760px, calc(100vw - 32px)) !important; max-width:760px !important; }
.onboarding-choices { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:8px 0 4px; }
.onboarding-choice { display:flex; flex-direction:column; gap:8px; padding:16px; border:1px solid var(--line, #e3e8ef); border-radius:14px; background:var(--panel-soft, #f8fafc); }
.onboarding-choice h3 { margin:0; font-size:17px; }
.onboarding-choice p { margin:0; color:var(--muted, #667085); font-size:13px; line-height:1.4; }
.onboarding-choice label { display:flex; flex-direction:column; gap:4px; font-size:13px; }
.onboarding-choice button { margin-top:auto; }
.onboarding-choices > * { min-width:0; }
.onboarding-choice input { width:100%; box-sizing:border-box; }
@media (max-width: 640px) { .onboarding-choices { grid-template-columns:1fr; } .login-overlay .login-card.onboarding-card { padding:22px 18px !important; } }
.join-notice { margin:0 0 6px; padding:9px 12px; border-radius:10px; background:#e8f1ff; color:#1d4ed8; font-size:13px; line-height:1.4; }
html[data-theme="dark"] .join-notice { background:#13284d; color:#9cc0ff; }
/* Settings → Доступ */
.access-edit-banner { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 12px; margin-bottom:10px; border-radius:10px; background:#e8f1ff; color:#1d4ed8; }
.access-select-tools { display:flex; gap:8px; flex-wrap:wrap; }
.access-perms { display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.access-perms > span { font-weight:600; font-size:14px; }
.access-perm-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:8px; }
.access-perm-list label { display:flex; align-items:center; gap:8px; padding:9px 11px; border:1px solid var(--line, #e3e8ef); border-radius:10px; cursor:pointer; font-size:14px; }
.access-perm-list label:has(input:checked) { border-color:#3b82f6; background:rgba(59,130,246,.08); }
.access-perm-list label.locked { opacity:.7; cursor:default; }
.access-link-result { display:flex; flex-direction:column; gap:6px; margin-top:12px; padding:12px; border-radius:12px; border:1px solid #9fd3b0; background:#effaf3; }
html[data-theme="dark"] .access-link-result { background:#10291a; border-color:#2e6b44; }
.access-link-row { display:flex; gap:8px; }
.access-link-row input { flex:1; min-width:0; font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:13px; }
.access-link-result small { color:var(--muted, #667085); }
.access-badges { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.access-badges i { font-style:normal; font-size:12px; padding:2px 7px; border-radius:999px; background:var(--panel-soft, #eef2f7); color:var(--muted, #475467); }
.access-status-active { color:#15803d; } .access-status-used { color:#1d4ed8; } .access-status-expired, .access-status-cancelled { color:#98a2b3; }

/* sub-account editor (Settings → Users) */
.client-access { display:grid; gap:14px; padding:16px; border:1px solid rgba(8,113,220,.3); border-radius:14px; background:rgba(8,113,220,.04); }
.client-access > div > span, .client-pick > span, .client-levels > span { font-size:13px; font-weight:700; color:var(--text); }
.client-access-row label { display:grid; gap:6px; }
.client-access-row select { min-height:40px; padding:0 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--text); font:inherit; }
.client-levels { display:grid; gap:8px; }
.client-levels label { display:flex; align-items:baseline; gap:8px; padding:10px 12px; border:1px solid var(--line); border-radius:11px; background:var(--panel); cursor:pointer; }
.client-levels label small { color:var(--muted); font-size:12px; }
.client-levels label:has(input:checked) { border-color:#0871dc; box-shadow:0 0 0 2px rgba(8,113,220,.15); }
.client-pick { display:grid; gap:8px; }
.client-chips { display:flex; flex-wrap:wrap; gap:6px; }
.client-chips button { display:inline-flex; align-items:center; gap:7px; min-height:32px; padding:0 6px 0 12px; border:1px solid var(--line); border-radius:16px; background:var(--panel); color:var(--text); font:inherit; font-size:13px; font-weight:700; cursor:pointer; width:auto; }
.client-chips button b { padding:1px 7px; border-radius:10px; font-size:11px; background:rgba(100,116,139,.15); }
.client-chips button.active { background:#0871dc; border-color:#0871dc; color:#fff; }
.client-chips button.active b { background:#fff; color:#0871dc; }
.client-pick .search { width:100% !important; max-width:none !important; margin:0 !important; }
.client-asic-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:6px; max-height:280px; overflow:auto; padding:2px; }
.client-asic-list label { display:flex; align-items:center; gap:8px; padding:7px 9px; border:1px solid var(--line); border-radius:9px; background:var(--panel); cursor:pointer; }
.client-asic-list label.by-account { border-color:rgba(32,185,101,.5); background:rgba(32,185,101,.07); }
.client-asic-list label span { display:grid; min-width:0; }
.client-asic-list label b { font-size:13px; } .client-asic-list label small { color:var(--muted); font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.client-count { font-size:13px; color:#0871dc; }
