@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(vendor/fonts/jetbrains-mono-latin-400-normal.woff2?v=5.3.0) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(vendor/fonts/jetbrains-mono-latin-700-normal.woff2?v=5.3.0) format("woff2");
}

:root {
  --bg: #0a0c11;
  --bg-2: #0e1118;
  --panel: #12161f;
  --panel-2: #181d28;
  --hover: #1b2130;
  --line: #1e2431;
  --line-2: #2a3243;
  --text: #e6e9f0;
  --muted: #8d95a7;
  --faint: #5e6678;
  --accent: #8b9bff;
  --accent-2: #4fd1c5;
  --ok: #3ddc97;
  --warn: #f5b84a;
  --bad: #f87171;
  --radius: 14px;
  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono",
          "Noto Sans Mono CJK SC", "Microsoft YaHei", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", Roboto, sans-serif;
  --side-w: 248px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 4px; text-align: center;
  font: 11px/17px var(--mono); color: var(--muted); background: var(--panel-2); border: 1px solid var(--line-2);
}
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons & fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--panel-2); cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: #1f2535; border-color: #384258; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary {
  background: linear-gradient(135deg, #8b9bff, #6c7cf5); border-color: transparent; color: #0b0e17; font-weight: 600;
}
.btn-primary:hover { background: linear-gradient(135deg, #9daaff, #7b8af7); border-color: transparent; }
.btn-danger { color: var(--bad); border-color: #4a2a2e; background: #1d1316; }
.btn-danger:hover { background: #2a1519; border-color: #6b3036; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn-xs svg.i, .btn-sm svg.i { width: 14px; height: 14px; }
.btn-block { width: 100%; height: 42px; font-size: 15px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; padding: 0; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; font-size: 12.5px; }
.link-btn:hover { color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field em { font-style: normal; color: var(--faint); margin-left: 6px; }
.field input, .field textarea, .pathbar input {
  width: 100%; padding: 9px 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { font-family: var(--mono); font-size: 13px; resize: vertical; }
.field input:focus, .field textarea:focus, .pathbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #8b9bff26; }
.form-error { min-height: 20px; margin: 0 0 10px; color: var(--bad); font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); margin: 0; }
.acct-sudo { margin: -2px 0 14px; }

/* ---------- brand */
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand b { display: block; font-size: 15px; letter-spacing: .2px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.logo {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  background: url(favicon.svg) center/cover;
  box-shadow: 0 4px 18px #8b9bff40;
}
.brand-lg .logo { width: 42px; height: 42px; border-radius: 12px; }
.brand-lg b { font-size: 19px; }

/* ---------- login */
.login-body { display: grid; place-items: center; min-height: 100vh; overflow: hidden; }
.login-glow {
  position: fixed; inset: -30%; pointer-events: none;
  background:
    radial-gradient(40% 35% at 30% 30%, #8b9bff1f, transparent 70%),
    radial-gradient(35% 30% at 70% 70%, #4fd1c51a, transparent 70%);
}
.login-card {
  position: relative; width: min(400px, calc(100vw - 32px));
  padding: 32px 30px 22px;
  background: #11151dcc; backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 30px 80px #0008;
}
.login-card .brand { margin-bottom: 26px; }
.login-foot { margin: 18px 0 0; text-align: center; color: var(--faint); font-size: 12px; }

/* ---------- app layout */
.app-body { display: flex; height: 100vh; overflow: hidden; }
#sidebar {
  width: var(--side-w); flex: none; display: flex; flex-direction: column;
  background: var(--bg-2); border-right: 1px solid var(--line);
  transition: margin-left .2s ease;
}
body.side-collapsed #sidebar { margin-left: calc(-1 * var(--side-w)); }
#sidebar > .brand { padding: 16px 16px 12px; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 4px 18px; color: var(--faint); font-size: 12px; letter-spacing: .5px;
}
.acct-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.group-label {
  padding: 14px 10px 4px; color: var(--faint); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 4px 7px 10px; border-radius: 9px; cursor: pointer;
  transition: background .12s;
}
.acct:hover { background: var(--panel); }
.acct.active { background: var(--panel-2); }
.acct-text { flex: 1; min-width: 0; }
.acct-text b { display: block; font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-text small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .icon-btn { opacity: 0; width: 26px; height: 26px; }
.acct:hover .icon-btn, .acct.active .icon-btn { opacity: 1; }

.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--faint); }
.dot.online { background: var(--ok); box-shadow: 0 0 0 3px #3ddc9722; }
.dot.connecting, .dot.starting, .dot.disconnected { background: var(--warn); animation: pulse 1.2s infinite; }
.dot.offline { background: var(--bad); }
.dot.exited { background: var(--faint); }
@keyframes pulse { 50% { opacity: .35; } }

.side-foot { padding: 14px 18px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #0b0e17;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.me-email { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-actions { display: flex; gap: 16px; }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.tabbar {
  display: flex; align-items: center; gap: 6px;
  height: 44px; flex: none; padding: 0 8px;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.tabs { flex: 1; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; align-items: center; height: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 30px; padding: 0 6px 0 11px; max-width: 220px;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 13px;
}
.tab:hover { background: var(--panel); color: var(--text); }
.tab.active { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.tab .tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .tab-x { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; color: var(--faint); }
.tab .tab-x svg.i { width: 12px; height: 12px; stroke-width: 2.2; }
.tab .tab-x:hover { background: #ffffff14; color: var(--text); }
.tab.overview-tab { padding-right: 11px; }
.tab.overview-tab svg.i { width: 15px; height: 15px; }
.tab-new { width: 28px; height: 28px; }
.net-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 99px; font: 11.5px/20px var(--mono);
  color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  white-space: nowrap;
}
.net-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.net-pill.good::before { background: var(--ok); }
.net-pill.fair::before { background: var(--warn); }
.net-pill.poor::before, .net-pill.down::before { background: var(--bad); }
.net-pill.down { color: var(--warn); border-color: #4a3a1a; }

#panes { flex: 1; min-height: 0; position: relative; }
.pane { position: absolute; inset: 0; }

/* ---------- overview */
.overview { overflow-y: auto; padding: 26px 28px 30px; }
.ov-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.ov-head h1 { margin: 0 0 2px; font-size: 22px; font-weight: 650; letter-spacing: .2px; }
.ov-head p { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.card {
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), #0f131a);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color .15s;
}
.card:hover { border-color: var(--line-2); }
.card-body { display: flex; flex-direction: column; gap: 14px; padding: 18px 18px 16px; }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-head .dot { width: 10px; height: 10px; }
.card-head .t { flex: 1; min-width: 0; }
.card-head b { display: block; font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-head small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { padding: 2px 10px; border-radius: 99px; font-size: 12px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.pill.online { color: var(--ok); border-color: #1f4a39; background: #0f2219; }
.pill.connecting { color: var(--warn); border-color: #4a3a1a; background: #21190b; }
.pill.offline { color: var(--bad); border-color: #4a2026; background: #22100f; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.metric { min-width: 0; padding: 9px 11px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.metric-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.metric label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.metric-top b { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.metric .v { margin-top: 6px; color: var(--faint); font-family: var(--mono); font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 5px; border-radius: 99px; background: #1d2330; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .4s; }
.bar.hot > i { background: linear-gradient(90deg, var(--warn), var(--bad)); }

.gpu-block { display: flex; flex-direction: column; gap: 6px; }
.gpu-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.gpu-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpu-head > span:last-child { flex: none; }
.gpu-head b { color: var(--text); font-weight: 500; }
.gpu-rows { display: grid; gap: 4px 18px; grid-template-columns: 1fr; }
.gpu-rows.two { grid-template-columns: 1fr 1fr; }
.gpu-row {
  display: grid; grid-template-columns: 16px minmax(30px, 1fr) 38px 64px 30px; align-items: center; gap: 8px;
  font: 11.5px/18px var(--mono); color: var(--muted);
}
.gpu-rows.two .gpu-row { grid-template-columns: 14px minmax(24px, 1fr) 36px 54px; }
.gpu-rows.two .gpu-row .g-t { display: none; }
.gpu-row .g-i { color: var(--faint); }
.gpu-row b { color: var(--text); font-weight: 500; text-align: right; }
.gpu-row .g-m, .gpu-row .g-t { text-align: right; color: var(--faint); }

.acct-rows { border-top: 1px solid var(--line); background: #0d1016; }
.acct-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 18px; }
.acct-row + .acct-row { border-top: 1px solid #171c26; }
.acct-row .ar-main { flex: 1; min-width: 0; }
.acct-row .ar-main b { font-weight: 500; font-size: 13.5px; }
.acct-row .ar-main small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row .ar-main small.err { color: #f3a6a6; white-space: normal; }
.acct-row .ar-actions { display: flex; gap: 6px; flex: none; }

/* ---------- route test (which gateway node is faster) */
.route-card {
  margin-bottom: 16px; padding: 16px 18px 12px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), #0f131a);
}
.rt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rt-head b { font-size: 15px; font-weight: 600; margin-right: 10px; }
.rt-head small { color: var(--muted); font-size: 12px; }
.rt-actions { display: flex; gap: 6px; }
.rt-verdict {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 12px 0 10px; padding: 9px 12px; border-radius: 10px; font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line);
}
.rt-verdict.good { color: #9eeac6; border-color: #1f4a39; background: #0f2219; }
.rt-verdict.better { color: #c8cfff; border-color: #343f80; background: #141a33; }
.rt-table-wrap { overflow-x: auto; margin-top: 8px; }
.rt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.rt-table th { padding: 6px 10px; text-align: right; color: var(--faint); font-weight: 500; border-bottom: 1px solid var(--line); }
.rt-table td { padding: 7px 10px; text-align: right; font-family: var(--mono); color: var(--muted); border-bottom: 1px solid #171c26; }
.rt-table th:first-child, .rt-table td:first-child { text-align: left; }
.rt-table td.rt-node { font-family: var(--sans); color: var(--text); font-size: 13px; }
.rt-table td.muted { text-align: left; font-family: var(--sans); white-space: normal; }
.rt-table td.win { color: var(--ok); font-weight: 600; }
.rt-table td.rt-avg { color: var(--text); font-weight: 600; }
.rt-table tr.best td.rt-avg { color: var(--ok); }
.rt-table tr.off td { opacity: .75; }
.rt-table .tag {
  margin-left: 6px; padding: 0 6px; border-radius: 99px; font-size: 11px;
  color: var(--accent); border: 1px solid #343f80; background: #141a33;
}
.rt-foot { margin-top: 8px; font-size: 11.5px; }
.rt-switch { margin-left: 8px; height: 22px; }

.route-pick { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--faint); }
.route-pick select {
  max-width: 260px; height: 24px; padding: 0 6px; font-size: 12px; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 6px; outline: none;
}
.route-pick select:focus { border-color: var(--accent); }
.node-switch { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; font-size: 12.5px; }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.kbd-hint { margin: 22px 2px 0; font-size: 12px; }

/* ---------- terminal */
.term-pane { background: #0b0e14; }
.term-host { position: absolute; inset: 8px 4px 2px 12px; }
.term-host .xterm { height: 100%; }
.term-host .xterm-viewport { background-color: #0b0e14 !important; scrollbar-width: thin; scrollbar-color: #2a3242 transparent; }
.term-host .xterm .composition-view { background: #1b2130; color: var(--text); border-radius: 3px; }
.term-host .xterm-screen { position: relative; }
/* predictive echo overlay: one cell per character, opaque so it hides the real cursor below */
.predict { position: absolute; z-index: 10; display: flex; pointer-events: none; white-space: pre;
  font-family: var(--mono); color: #d8dce6; }
.predict span { display: block; flex: none; width: var(--cw); height: 100%; background: #0b0e14; text-align: center; }
.predict .p-wide { width: calc(var(--cw) * 2); }
.predict .p-caret { background: #8b9bff; }

.statusbar {
  display: flex; align-items: center; gap: 10px; flex: none;
  height: 34px; padding: 0 8px 0 14px;
  background: var(--bg-2); border-top: 1px solid var(--line); font-size: 12.5px;
}
.statusbar .sb-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.statusbar .sb-who b { font-weight: 500; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.statusbar .sb-meta { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.statusbar .sb-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.statusbar .sb-echo { color: var(--faint); font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.statusbar .sb-hint { color: var(--warn); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; cursor: help; }
.statusbar .btn.on { color: var(--accent); }
.statusbar .sep { width: 1px; height: 16px; background: var(--line-2); margin: 0 4px; }

/* ---------- files drawer */
.drawer {
  position: absolute; top: 44px; right: 0; bottom: 0; z-index: 20;
  width: min(480px, 100%); display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line-2);
  box-shadow: -24px 0 60px #0009;
  animation: drawer-in .18s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 18px; }
.drawer-title b { font-size: 15px; font-weight: 600; margin-right: 8px; }
.drawer-title small { color: var(--muted); font-size: 12.5px; }
.pathbar { display: flex; align-items: center; gap: 4px; padding: 0 12px 8px; }
.pathbar input { padding: 6px 10px; font: 12.5px var(--mono); border-radius: 8px; }
.drawer-tools { display: flex; align-items: center; gap: 12px; padding: 0 18px 10px; font-size: 12.5px; }
.drawer-tools .muted { margin-left: auto; font-size: 12px; }
.file-list { flex: 1; overflow-y: auto; border-top: 1px solid var(--line); padding: 4px 6px; }
.file-row {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) 70px 92px 30px; align-items: center; gap: 10px;
  padding: 6px 6px 6px 10px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.file-row:hover { background: var(--hover); }
.file-row .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fs, .file-row .fm { color: var(--faint); font: 11.5px var(--mono); text-align: right; white-space: nowrap; }
.file-row svg.i { color: var(--muted); }
.file-row.dir svg.i.kind { color: var(--accent); }
.file-row .icon-btn { width: 26px; height: 26px; opacity: .55; }
.file-row:hover .icon-btn { opacity: 1; }
.file-msg { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.drawer-foot { padding: 9px 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.drawer-tools { flex-wrap: wrap; }
.drop-hint, .term-drop {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; text-align: center;
  background: rgba(14, 17, 24, .86); border: 2px dashed var(--accent); border-radius: 12px; color: var(--text); font-size: 14px;
}
.drop-hint { margin: 8px; pointer-events: none; }
.drop-hint b, .term-drop small { display: block; margin-top: 6px; color: var(--accent); font: 12.5px var(--mono); }
.term-drop { position: fixed; inset: 56px 12px 46px calc(var(--side-w) + 12px); }
body.side-collapsed .term-drop { left: 12px; }
.uploads { border-top: 1px solid var(--line); max-height: 38%; display: flex; flex-direction: column; }
.up-head { display: flex; align-items: center; gap: 8px; padding: 8px 18px; font-size: 12.5px; }
.up-head b { font-weight: 500; }
.up-list { overflow-y: auto; padding: 0 8px 8px; }
.up-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 64px 26px; align-items: center; gap: 8px;
  padding: 4px 6px 4px 10px; border-radius: 7px; font-size: 12.5px; overflow: hidden;
}
.up-row .up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row .up-state { text-align: right; font: 11.5px var(--mono); color: var(--faint); }
.up-row .icon-btn { width: 24px; height: 24px; }
.up-row .icon-btn svg.i { width: 12px; height: 12px; }
.up-row.done .up-state { color: var(--ok); }
.up-row.error .up-state { color: var(--bad); }
.up-row.error .up-name, .up-row.cancelled .up-name { color: var(--muted); }
.up-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); transition: width .15s; }

/* ---------- dialogs */
.dialog {
  width: min(620px, calc(100vw - 24px)); padding: 24px 24px 18px;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 40px 100px #000a;
}
.dialog-sm { width: min(420px, calc(100vw - 24px)); }
.dialog::backdrop { background: #04060acc; backdrop-filter: blur(3px); }
.dialog h2 { margin: 0 0 18px; font-size: 17px; font-weight: 600; }
.dialog-actions { display: flex; gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ---------- toasts */
#toasts { position: fixed; right: 18px; bottom: 48px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast {
  max-width: 380px; padding: 10px 14px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 12px 30px #0008;
  font-size: 13px; animation: slide .2s ease-out; word-break: break-word;
}
.toast.error { border-color: #5a2a30; color: #f6b0b0; }
.toast.ok { border-color: #1f4a39; color: #9eeac6; }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } }

/* ---------- mobile */
#scrim { display: none; }
@media (max-width: 820px) {
  #sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; margin-left: 0 !important; transform: translateX(-100%); transition: transform .2s; }
  body.menu-open #sidebar { transform: none; }
  body.menu-open #scrim { display: block; position: fixed; inset: 0; z-index: 30; background: #0008; }
  .overview { padding: 18px 14px 30px; }
  .cards { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .statusbar .sb-meta, .kbd-hint, .net-pill { display: none; }
  .file-row { grid-template-columns: 18px minmax(0, 1fr) 64px 30px; }
  .file-row .fm { display: none; }
  .acct-row .ar-actions .btn span { display: none; }
}
