:root {
  --bg: #060d1a;
  --panel: #0b1526;
  --panel-2: #0f1c31;
  --panel-3: #142440;
  --line: #1c3054;
  --line-soft: #142136;
  --fg: #e8eefc;
  --fg-dim: #8296b8;
  --accent: #2f6ff0;
  --accent-hi: #4f89ff;
  --accent-soft: rgba(47,111,240,.14);
  --ok: #35d07f;
  --warn: #f0b429;
  --bad: #f4626b;
  --radius: 11px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 208px;
}

* { box-sizing: border-box; }

/*
 * An element carrying [hidden] must actually disappear. Any rule that sets
 * `display` (.btn is inline-flex, .preview img is block) otherwise wins on
 * specificity and the element stays visible — which is how a hidden <img>
 * ended up rendering its broken-image placeholder in the preview panel.
 */
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 14.5px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.3rem; } h2 { font-size: 1.28rem; }
h3 { font-size: 1.12rem; } h4 { font-size: .88rem; }
p { margin: 0; }
button { font: inherit; }

.muted { color: var(--fg-dim); }
.small { font-size: .82rem; }
.spacer { flex: 1; }
.center-text { text-align: center; }

/* screens ------------------------------------------------------------------ */

.screen { display: none; height: 100%; flex-direction: column; }
body[data-screen="boot"]    .screen[data-for="boot"],
body[data-screen="login"]   .screen[data-for="login"],
body[data-screen="devices"] .screen[data-for="devices"],
body[data-screen="session"] .screen[data-for="session"] { display: flex; }

.center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 20px; }

/* controls ----------------------------------------------------------------- */

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--fg); font-weight: 550; padding: 9px 15px;
  border-radius: 9px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: background .13s, border-color .13s, opacity .13s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: #27436f; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.danger { background: transparent; border-color: #5a2a34; color: var(--bad); }
.btn.danger:hover:not(:disabled) { background: #2b1720; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-dim); }
.btn.ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--fg); }
.btn.icon { padding: 8px; min-width: 36px; height: 36px; font-size: .8rem; font-weight: 650; }
.btn.block { width: 100%; }
.btn.small-btn { padding: 6px 12px; font-size: .84rem; }
.btn svg, .ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn.icon svg { width: 19px; height: 19px; }

.linklike { background: none; border: 0; color: var(--accent-hi); cursor: pointer; padding: 0; text-decoration: underline; }

.select {
  background: var(--panel-2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px; font-size: .85rem; max-width: 180px;
}

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .82rem; color: var(--fg-dim); margin-bottom: 5px; }
.field input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--fg);
  border-radius: 9px; padding: 11px 12px; font: inherit;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.error {
  background: #2b1720; border: 1px solid #5a2a34; color: #fca5a5;
  padding: 9px 12px; border-radius: 8px; font-size: .86rem; margin-bottom: 12px;
}

/* brand -------------------------------------------------------------------- */

.logo-tile {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(150deg, var(--accent-hi), var(--accent));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 14px rgba(47,111,240,.35);
}
.logo-tile svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 15px; padding: 26px; }
.auth-card { width: min(400px, 100%); }
.auth-card #login-hint { margin-top: 14px; }
.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }

/* app bar ------------------------------------------------------------------ */

.app { background: var(--bg); }

.appbar {
  display: flex; align-items: center; gap: 11px;
  padding: calc(11px + var(--safe-t)) 18px 11px;
  background: var(--panel); border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.wordmark { font-size: 1.02rem; letter-spacing: -.01em; }
.tagline { color: var(--fg-dim); font-size: .82rem; margin-left: 8px; }
@media (max-width: 900px) { .tagline { display: none; } }

.nav-toggle { display: none; }

.server-state {
  display: flex; align-items: center; gap: 7px;
  font-size: .82rem; color: var(--fg-dim);
  background: var(--panel-2); border: 1px solid var(--line-soft);
  padding: 6px 12px; border-radius: 999px;
}
@media (max-width: 700px) { .server-state span { display: none; } }

.conn-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--fg-dim);
  box-shadow: 0 0 0 3px rgba(130,150,184,.15); flex: none; display: inline-block;
}
.conn-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(53,208,127,.18); }
.conn-dot.off { background: var(--bad); box-shadow: 0 0 0 3px rgba(244,98,107,.18); }

.user-chip {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 5px 11px 5px 5px; color: var(--fg);
}
.user-chip:hover { background: var(--panel-3); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--panel-3);
  display: grid; place-items: center; color: var(--fg-dim); flex: none;
}
.avatar svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.user-name { font-size: .86rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { width: 14px; height: 14px; fill: none; stroke: var(--fg-dim); stroke-width: 2; }

/* shell -------------------------------------------------------------------- */

.shell { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--panel);
  border-right: 1px solid var(--line-soft);
  padding: 14px 12px calc(14px + var(--safe-b));
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.sidefill { flex: 1; min-height: 16px; }

.navitem {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--fg-dim); cursor: pointer;
  font-size: .9rem; font-weight: 550; text-align: left;
}
.navitem svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.navitem:hover { background: var(--panel-2); color: var(--fg); }
.navitem.active { background: var(--accent-soft); color: var(--accent-hi); border-color: rgba(47,111,240,.35); }

.side-card {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 13px;
}
.side-card-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 650; font-size: .86rem; color: var(--warn); margin-bottom: 5px;
}
.side-card-head svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.side-card-body { font-family: var(--mono); font-size: .72rem; color: var(--fg); overflow-wrap: anywhere; }
.side-card-note { font-size: .74rem; color: var(--fg-dim); margin-top: 6px; }

.content { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 22px calc(28px + var(--safe-b)); }
.view[hidden] { display: none; }

.view-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.head-tile {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--accent-soft); border: 1px solid rgba(47,111,240,.3);
  display: grid; place-items: center; color: var(--accent-hi);
}
.head-tile svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* dashboard split ---------------------------------------------------------- */

.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 940px) { .split { grid-template-columns: 1fr; } }

.machine-list {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 13px; padding: 9px; display: flex; flex-direction: column; gap: 7px;
}

.machine {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border-radius: 10px; border: 1px solid transparent; background: var(--panel-2);
  cursor: pointer; text-align: left; width: 100%; color: var(--fg);
}
.machine:hover { background: var(--panel-3); }
.machine.selected { border-color: var(--accent); background: var(--accent-soft); }
.machine-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--fg-dim); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.machine.selected .machine-ico { stroke: var(--accent-hi); }
.machine-text { flex: 1; min-width: 0; }
.machine-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-status { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--fg-dim); margin-top: 1px; }
.machine-os { width: 17px; height: 17px; flex: none; color: var(--fg-dim); }
.machine-os svg { width: 100%; height: 100%; }

/* detail ------------------------------------------------------------------- */

.detail {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 13px; padding: 16px;
}
.detail[hidden] { display: none; }
.empty-detail { text-align: center; padding: 46px 24px; display: flex; flex-direction: column; gap: 12px; align-items: center; }

.detail-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.detail-titles { min-width: 0; }
.detail-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(53,208,127,.14); color: var(--ok);
  border-radius: 999px; padding: 3px 10px; font-size: .76rem; font-weight: 600;
}
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.off { background: rgba(130,150,184,.14); color: var(--fg-dim); }
.badge.busy { background: rgba(240,180,41,.14); color: var(--warn); }

.tool-row { display: flex; gap: 6px; }
.tool {
  width: 36px; height: 36px; border-radius: 9px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  color: var(--fg-dim); display: grid; place-items: center;
}
.tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { color: var(--fg); background: var(--panel-3); }
.tool.active { border-color: var(--accent); color: var(--accent-hi); background: var(--accent-soft); }

.preview {
  position: relative; border-radius: 11px; overflow: hidden;
  background: #040a14; border: 1px solid var(--line-soft);
  aspect-ratio: 16 / 10; display: grid; place-items: center;
}
.preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--fg-dim); text-align: center; padding: 20px;
}
.preview-empty[hidden] { display: none; }
.preview-empty svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .55; }
.preview-stamp {
  position: absolute; right: 9px; bottom: 9px;
  background: rgba(4,10,20,.78); border: 1px solid var(--line-soft);
  padding: 3px 9px; border-radius: 999px; font-size: .72rem; color: var(--fg-dim);
}

.action-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 14px 0; }
@media (max-width: 620px) { .action-row { grid-template-columns: repeat(2, 1fr); } }

.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .info-grid { grid-template-columns: 1fr; } }

.info-card { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 11px; padding: 13px 14px; }
.info-card h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--fg); }
.info-card h4 svg { width: 16px; height: 16px; fill: none; stroke: var(--accent-hi); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--fg-dim); font-size: .8rem; }
.kv dd { margin: 0; font-size: .8rem; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed li { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; color: var(--fg-dim); }
.feed li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-top: 6px; flex: none; }
.feed li.dim::before { background: var(--fg-dim); }
.feed li.warn::before { background: var(--warn); }
.feed li.bad::before { background: var(--bad); }
.feed.big li { font-size: .86rem; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.feed.big li:last-child { border-bottom: 0; }
.feed .when { color: var(--fg-dim); font-size: .74rem; margin-left: auto; padding-left: 10px; white-space: nowrap; }

.quick { display: flex; flex-direction: column; gap: 3px; }
.quick button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: transparent; border: 0; color: var(--fg-dim);
  padding: 6px 7px; border-radius: 7px; cursor: pointer; font-size: .8rem; text-align: left;
}
.quick button:hover:not(:disabled) { background: var(--panel-3); color: var(--fg); }
.quick button:disabled { opacity: .45; cursor: not-allowed; }
.quick svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* generic panels ----------------------------------------------------------- */

.panel-note {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: 13px; padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.file-launch { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 6px; }
.settings-list { gap: 0; }
.setting-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .grow { flex: 1; min-width: 0; }
.setting-row strong { display: block; font-weight: 600; }
.setting-row em { font-style: normal; font-size: .81rem; color: var(--fg-dim); }

/* session ------------------------------------------------------------------ */

.screen.session { background: #000; }
.sessionbar {
  display: flex; align-items: center; gap: 7px;
  padding: calc(6px + var(--safe-t)) 10px 6px;
  background: rgba(11,21,38,.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft); z-index: 5;
}
.sessionbar.hidden { display: none; }
.session-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.session-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32vw; }

.pill {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--fg-dim);
}
.pill.live { background: rgba(53,208,127,.16); color: var(--ok); }
.pill.bad { background: rgba(244,98,107,.16); color: var(--bad); }

.stat { font-family: var(--mono); font-size: .73rem; color: var(--fg-dim); white-space: nowrap; }
@media (max-width: 720px) { .stat { display: none; } }

.stage { position: relative; flex: 1; background: #000; overflow: hidden; display: flex; }
#remote { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; touch-action: none; outline: none; }

.stage-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: rgba(6,13,26,.9); text-align: center; padding: 20px;
}
.stage-overlay[hidden] { display: none; }
.ime { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: -100px; top: 0; }

.touchbar {
  display: flex; gap: 6px; padding: 7px 10px calc(7px + var(--safe-b));
  background: var(--panel); border-top: 1px solid var(--line-soft);
  overflow-x: auto; scrollbar-width: none;
}
.touchbar::-webkit-scrollbar { display: none; }
.touchbar[hidden] { display: none; }
.tkey {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--fg);
  border-radius: 8px; padding: 8px 12px; font-size: .84rem; cursor: pointer;
  white-space: nowrap; flex: none; -webkit-tap-highlight-color: transparent;
}
.tkey.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tsep { width: 1px; background: var(--line); flex: none; margin: 4px 3px; }

/* file drawer -------------------------------------------------------------- */

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100%);
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
  padding-top: var(--safe-t); padding-bottom: var(--safe-b);
  box-shadow: -18px 0 44px rgba(0,0,0,.5);
  animation: slide-in .18s ease-out;
}
.drawer[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }

.drawer-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line-soft); }
.path-row { display: flex; gap: 6px; padding: 10px 12px; align-items: center; }
.path-input {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line);
  color: var(--fg); border-radius: 8px; padding: 7px 10px;
  font-family: var(--mono); font-size: .79rem;
}
.roots { display: flex; gap: 6px; padding: 0 12px 10px; flex-wrap: wrap; }
.root-chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--fg-dim);
  border-radius: 999px; padding: 4px 11px; font-size: .79rem; cursor: pointer;
}
.root-chip:hover { color: var(--fg); border-color: #27436f; }

.filelist { flex: 1; overflow-y: auto; padding: 0 6px; outline: none; }
.frow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: .87rem; }
.frow:hover { background: var(--panel-2); }
.frow.dir { cursor: pointer; }
.frow .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .fsize { color: var(--fg-dim); font-family: var(--mono); font-size: .75rem; flex: none; }
.fico { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--fg-dim); stroke-width: 1.8; }
.frow.dir .fico { stroke: var(--accent-hi); }
.frow .facts { display: flex; gap: 2px; opacity: 0; flex: none; }
.frow:hover .facts { opacity: 1; }
@media (pointer: coarse) { .frow .facts { opacity: 1; } }

.dropzone { margin: 10px 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; color: var(--fg-dim); font-size: .84rem; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }

.transfers { max-height: 34vh; overflow-y: auto; padding: 0 12px 12px; }
.transfer { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 11px; margin-bottom: 7px; font-size: .81rem; }
.transfer-top { display: flex; gap: 8px; align-items: center; }
.transfer-top .tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer .bar { height: 4px; background: var(--bg); border-radius: 3px; margin-top: 7px; overflow: hidden; }
.transfer .bar > i { display: block; height: 100%; background: var(--accent); transition: width .15s linear; }
.transfer.done .bar > i { background: var(--ok); }
.transfer.error .bar > i { background: var(--bad); }
.transfer .tmeta { color: var(--fg-dim); font-family: var(--mono); font-size: .71rem; margin-top: 4px; }

/* modals + toasts ---------------------------------------------------------- */

.modal-root {
  position: fixed; inset: 0; z-index: 60; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(2,6,13,.72); backdrop-filter: blur(3px);
}
.modal-root[hidden] { display: none; }
.modal { width: min(430px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 22px; max-height: 88vh; overflow-y: auto; }
.modal h3 { margin-bottom: 6px; }
.modal .modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal .modal-actions .btn { flex: 1; }

.code-display {
  font-family: var(--mono); font-size: 1.55rem; letter-spacing: .16em;
  text-align: center; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; margin: 14px 0 6px; user-select: all;
}

.steps { counter-reset: s; margin: 14px 0 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding-left: 30px; margin-bottom: 9px; font-size: .86rem; color: var(--fg-dim); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--panel-3);
  color: var(--fg); display: grid; place-items: center; font-size: .73rem; font-weight: 650;
}

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + var(--safe-b)); z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(440px, calc(100% - 32px));
}
.toast {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--fg);
  padding: 10px 15px; border-radius: 10px; font-size: .86rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .16s ease-out;
  max-width: 100%; text-align: center;
}
.toast.bad { border-color: #5a2a34; background: #2b1720; color: #fca5a5; }
.toast.good { border-color: #1c4a3a; background: #0f2620; color: #86efac; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* narrow screens ----------------------------------------------------------- */

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    padding-top: calc(16px + var(--safe-t));
    transform: translateX(-100%); transition: transform .18s ease-out;
    box-shadow: 18px 0 44px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: none; }
  .content { padding: 16px 14px calc(24px + var(--safe-b)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* installer links in the Add Computer modal ------------------------------- */

.installers { display: flex; flex-direction: column; gap: 7px; margin: 14px 0 4px; }
.install-link { text-decoration: none; gap: 10px; justify-content: flex-start; }
.install-ico { width: 18px; height: 18px; flex: none; color: var(--fg-dim); }
.install-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; }
.install-link:hover .install-ico { color: var(--fg); }
