/* Tajir Connect console.
   Branded after tajirusa.com: an edge-green palette on a deep, near-black
   green ground, warm amber for emphasis. Dark, dense, information-first — the
   operator is scanning a fleet, so rows stay tight and status reads at a
   glance. */

:root {
  /* Brand — the tajir green scale. */
  --brand:        #3d9970;   /* tajir-400, primary accent            */
  --brand-2:      #2d7a5a;   /* tajir-500, pressed / borders         */
  --brand-bright: #5cb88a;   /* tajir-300, hover / highlights        */
  --brand-soft:   #8dd4ab;   /* tajir-200, on-dark text accents      */
  --amber:        #ffaa00;   /* warm accent, sparing                 */

  /* Grounds — deep tajir greens reading almost black. */
  --bg:        #061210;      /* tajir-950 */
  --bg-2:      #0a1f17;      /* tajir-900 */
  --bg-3:      #12312492;    /* raised surfaces (translucent)        */
  --bg-3s:     #123124;      /* raised surfaces (solid)              */
  --line:      #1d3f31;
  --line-soft: #14332690;

  /* Text. */
  --fg:        #eaf7f0;
  --fg-dim:    #9fc4b3;
  --fg-faint:  #63887a;

  /* Semantic. */
  --accent:    var(--brand);
  --accent-dk: var(--brand-2);
  --green:     #34d399;
  --red:       #ef4444;

  /* Brand accent as a tint, reused for selection / focus washes. */
  --wash:      rgba(61,153,112,.14);
  --wash-soft: rgba(61,153,112,.08);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", var(--sans);

  /* Resizable side widths (JS overrides, persisted). */
  --side-w:  240px;
  --panel-w: 440px;

  --radius: 10px;
}

* { box-sizing: border-box; }

/* The layout rules below set display on elements that are also toggled with the
   `hidden` attribute, and an explicit display beats the user-agent's
   `[hidden] { display: none }`. Without this the login shell, the app shell,
   and the modal would all be visible at once on first paint. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(61,153,112,.35); }

/* Slimmer, brand-tinted scrollbars. */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--brand-2); background-clip: padding-box; }

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #04140d;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  transition: filter .12s ease;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--fg-dim);
  font-weight: 500;
}
button.ghost:hover:not(:disabled) { color: var(--fg); border-color: var(--brand); filter: none; }

/* Borderless icon button — used for the topbar actions. Just an icon and a
   hover wash, no box. */
button.icon-btn {
  background: none; border: none; color: var(--fg-dim);
  padding: 7px; border-radius: 8px; line-height: 0;
}
button.icon-btn:hover:not(:disabled) { color: var(--fg); background: var(--bg-3); filter: none; }
button.icon-btn svg { width: 19px; height: 19px; display: block; }
button.mini {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 6px;
  font-weight: 500;
  box-shadow: none;
}
button.mini:hover:not(:disabled) { color: var(--fg); border-color: var(--brand); filter: none; box-shadow: none; }
button.linkish {
  background: none; border: none; color: var(--brand-bright);
  padding: 0; text-decoration: underline; font-weight: 500; box-shadow: none;
}
button.danger { background: var(--red); border-color: var(--red); color: #fff; }

input, select, textarea {
  font: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 8px;
  padding: 8px 11px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--wash-soft);
}
textarea { resize: vertical; font-family: var(--mono); font-size: 13px; }

kbd {
  background: var(--bg-3s); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; font-family: var(--mono); font-size: 12px;
}

/* ----------------------------------------------------------------- login */

.login-shell {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login-card {
  width: 360px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 30px;
}
.login-logo {
  width: 56px; height: 56px; border-radius: 12px;
  display: block; margin: 0 auto 16px;
}
.login-mark {
  font-family: var(--display);
  font-size: 26px; font-weight: 700; letter-spacing: -.02em;
  text-align: center;
}
.login-mark .accent { color: var(--brand-bright); }
.login-sub { color: var(--fg-dim); margin: 6px 0 26px; font-size: 13px; text-align: center; }
.login-card label { display: block; font-size: 12px; color: var(--fg-dim); margin-bottom: 6px; }
.login-card button { width: 100%; margin-top: 18px; padding: 10px; font-size: 14px; }
.login-error {
  margin-top: 14px; color: #fca5a5; font-size: 13px;
  background: rgba(239,68,68,.09); border: 1px solid rgba(239,68,68,.3);
  border-radius: 8px; padding: 9px 11px;
}
.login-foot {
  margin-top: 22px; text-align: center;
  font-size: 11px; color: var(--fg-faint); letter-spacing: .03em;
}

/* ---------------------------------------------------------------- topbar */

#app { height: 100%; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px; height: 56px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; }
.brand-name {
  font-family: var(--display);
  font-weight: 700; letter-spacing: -.01em; font-size: 17px;
}
.brand-name .accent { color: var(--brand-bright); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* Signed-in user, plain — avatar and name, no box. */
.who {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg-dim); margin: 0 4px 0 6px;
}
.who-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #04140d; font-weight: 700; font-size: 11px;
  display: grid; place-items: center;
}

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-faint); display: inline-block; flex: none;
}
.dot.online { background: var(--green); }

/* ---------------------------------------------------------------- layout */

.layout {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--panel-w);
  min-height: 0;
  transition: grid-template-columns .18s cubic-bezier(.4,0,.2,1);
}
.layout.dragging { transition: none; user-select: none; }
.layout.left-collapsed  { grid-template-columns: 0px minmax(0,1fr) var(--panel-w); }
.layout.right-collapsed { grid-template-columns: var(--side-w) minmax(0,1fr) 0px; }
.layout.left-collapsed.right-collapsed { grid-template-columns: 0px minmax(0,1fr) 0px; }
/* A collapsed pane keeps its (now zero-width) grid track — it must stay a grid
   item, or the remaining columns would shift and the table would collapse
   instead. `overflow: hidden` is what stops any sliver of its content leaking
   past the seam. */
.layout.left-collapsed  .sidebar { overflow: hidden; padding-left: 0; padding-right: 0; }
.layout.right-collapsed .panel   { overflow: hidden; }

/* Drag handles sit on top of the seams between columns. Positioned by the same
   width variables that drive the grid, so they always track the seam — and when
   a side is collapsed the handle parks on the outer edge so the pane can be
   pulled back open by dragging. */
.rsz {
  position: absolute; top: 0; bottom: 0; width: 11px;
  z-index: 20; cursor: col-resize;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.rsz::after {
  content: ""; width: 2px; height: 100%; background: transparent;
  transition: background .12s ease, width .12s ease;
}
.rsz:hover::after, .rsz.dragging::after { width: 3px; background: var(--brand); }
.rsz-left  { left: var(--side-w); margin-left: -5px; }
.rsz-right { right: var(--panel-w); margin-right: -5px; }

/* When collapsed, the handle parks on the very edge and turns into a visible
   pull-tab with a chevron. Click it or drag it out to reopen the pane. It sits
   above everything else on that edge so nothing can swallow the drag. */
.rsz::before {
  content: ""; position: absolute; display: none;
  color: var(--fg-dim); font-size: 13px; font-weight: 700; line-height: 1;
}
.layout.left-collapsed  .rsz-left,
.layout.right-collapsed .rsz-right {
  width: 16px; z-index: 25; background: var(--bg-3s);
}
.layout.left-collapsed  .rsz-left  { left: 0;  margin-left: 0;  border-right: 1px solid var(--line); }
.layout.right-collapsed .rsz-right { right: 0; margin-right: 0; border-left: 1px solid var(--line); }
.layout.left-collapsed  .rsz-left::after,
.layout.right-collapsed .rsz-right::after { width: 0; }
.layout.left-collapsed  .rsz-left::before  { content: "›"; display: block; }
.layout.right-collapsed .rsz-right::before { content: "‹"; display: block; }
.layout.left-collapsed  .rsz-left:hover,
.layout.right-collapsed .rsz-right:hover { background: var(--bg-3); }
.layout.left-collapsed  .rsz-left:hover::before,
.layout.right-collapsed .rsz-right:hover::before { color: var(--fg); }

/* The old floating expander tabs are superseded by the pull-tab above. */
.expander { display: none !important; }

/* --------------------------------------------------------------- sidebar */

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}
/* Search lives at the top of the sidebar, with a leading magnifier. */
.side-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; margin: 0 2px 6px;
}
.side-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--wash-soft); }
.side-search svg { width: 15px; height: 15px; flex: none; color: var(--fg-faint); }
.side-search input {
  border: none; background: none; padding: 8px 0; border-radius: 0;
  box-shadow: none !important;
}
.side-search input:focus { border: none; box-shadow: none; }
.side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--fg-faint); padding: 14px 8px 6px;
  white-space: nowrap;
}
.side-head:first-child { padding-top: 0; }
.side-head-actions { display: flex; align-items: center; gap: 4px; }
.tree { display: flex; flex-direction: column; gap: 1px; }
.tree-item {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; color: var(--fg-dim);
  padding: 8px 10px; border-radius: 8px; text-align: left; width: 100%;
  font-size: 13px; white-space: nowrap; box-shadow: none; font-weight: 500;
}
/* Let a long group name shrink and ellipsize so the count / delete control on
   the right is never pushed off the edge of a narrow sidebar. */
.tree-item > span:first-child { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tree-item:hover { background: var(--bg-3); color: var(--fg); filter: none; box-shadow: none; }
.tree-item.active {
  background: var(--wash); color: var(--fg); font-weight: 600;
}
.tree-item .count { margin-left: auto; color: var(--fg-faint); font-size: 12px; }
.tree-item.active .count { color: var(--brand-soft); }
/* Only rendered for an admin on a selected, empty group — a small explicit
   button, not a hover affordance. */
.tree-item .del {
  margin-left: auto; padding: 2px 8px; font-size: 11px; font-weight: 600;
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--fg-dim); line-height: 1.4;
}
.tree-item .del:hover { color: #fff; background: var(--red); border-color: var(--red); filter: none; }

/* ----------------------------------------------------------------- table */

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

.table-head, .row {
  display: grid;
  grid-template-columns: 34px minmax(140px, 2fr) minmax(90px, 1fr) 96px 118px 108px 40px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
.table-head {
  height: 36px; flex: none;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--fg-faint);
}
.rows { overflow-y: auto; flex: 1; }
.row {
  height: 48px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .1s ease;
}
.row:hover { background: var(--bg-2); }
.row.selected { background: var(--wash); }
.row.selected:hover { background: rgba(61,153,112,.18); }

.cell-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.name-text { min-width: 0; }
.name-text .n {
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.name-text .h {
  font-size: 11.5px; color: var(--fg-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cell-dim { color: var(--fg-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-mono { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); }
.os-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--bg-3); color: var(--fg-dim); border: 1px solid var(--line);
}
.row-menu {
  background: none; border: none; color: var(--fg-faint); padding: 4px 6px;
  border-radius: 6px; font-size: 15px; line-height: 1; box-shadow: none;
}
.row-menu:hover { background: var(--bg-3); color: var(--fg); filter: none; box-shadow: none; }

.chk { display: inline-flex; align-items: center; cursor: pointer; }
.chk input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk span {
  width: 16px; height: 16px; border: 1.5px solid var(--line);
  border-radius: 5px; display: inline-block; position: relative; background: var(--bg);
  transition: background .1s ease, border-color .1s ease;
}
.chk input:checked + span { background: var(--brand); border-color: var(--brand); }
.chk input:checked + span::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 4px; height: 8px; border: solid #04140d; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.empty { padding: 48px; text-align: center; color: var(--fg-faint); }

/* ----------------------------------------------------------------- panel */

.panel {
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
}
.panel-tabs {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--line); flex: none;
  padding-right: 6px;
}
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--fg-dim); padding: 12px 15px; border-radius: 0; font-size: 13px;
  box-shadow: none; font-weight: 500;
}
.tab:hover { color: var(--fg); filter: none; box-shadow: none; }
.tab.active { color: var(--fg); border-bottom-color: var(--brand); font-weight: 600; }
.panel-collapse { margin-left: auto; }

.selection-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; font-size: 12.5px; color: var(--fg-dim);
  border-bottom: 1px solid var(--line-soft); background: var(--bg-3); flex: none;
}
.selection-bar b { color: var(--brand-soft); }

.tab-body { display: none; flex-direction: column; min-height: 0; flex: 1; padding: 14px; gap: 12px; overflow-y: auto; }
.tab-body.active { display: flex; }
.tab-body[data-body="terminal"] { padding: 0; gap: 0; overflow: hidden; }

/* terminal */
.term-output {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
}
.hint { color: var(--fg-faint); font-family: var(--sans); font-size: 13px; }
.job { margin-bottom: 16px; }
.job-cmd {
  color: var(--fg); background: var(--bg-3); border: 1px solid var(--line);
  padding: 7px 11px; border-radius: 6px; margin-bottom: 8px;
  white-space: pre-wrap; word-break: break-word;
}
.job-cmd .meta { color: var(--fg-faint); font-size: 11px; display: block; margin-top: 3px; }
.host-block { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.host-head {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); padding: 6px 10px; font-size: 12px;
}
.host-head .hn { font-weight: 600; }
.host-head .code { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.code.ok   { background: rgba(52,211,153,.16); color: var(--green); }
.code.bad  { background: rgba(239,68,68,.15);  color: var(--red); }
.code.wait { background: rgba(255,170,0,.15);  color: var(--amber); }
.host-out {
  padding: 8px 10px; white-space: pre-wrap; word-break: break-word;
  max-height: 320px; overflow-y: auto; color: var(--fg-dim);
}
.host-out .e { color: #fca5a5; }

.term-input {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--line); background: var(--bg-3); flex: none;
}
.term-input select { width: 120px; flex: none; }
.term-input input { font-family: var(--mono); font-size: 13px; }
.term-input button { flex: none; }

/* files + clipboard */
.field label { display: block; font-size: 12px; color: var(--fg-dim); margin-bottom: 6px; }
.row-btns { display: flex; gap: 8px; }

.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  color: var(--fg-dim);
  transition: border-color .15s ease, background .15s ease;
}
.dropzone.over { border-color: var(--brand); background: var(--wash-soft); }
.dz-icon { font-size: 28px; color: var(--brand); }
.dz-inner p { margin: 6px 0 0; font-size: 13px; }
.dz-sub { color: var(--fg-faint); font-size: 12px !important; }

.file-log { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.log-line {
  padding: 8px 11px; border-radius: 8px; background: var(--bg-3);
  border: 1px solid var(--line); color: var(--fg-dim);
}
.log-line.ok  { color: var(--green); }
.log-line.err { color: #fca5a5; }

.action-card {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
.action-card p { margin: 3px 0 0; color: var(--fg-dim); font-size: 12.5px; }
.action-card button { margin-left: auto; flex: none; }

/* Essentials grid — a tile per action, echoing ScreenConnect's toolbar. */
.ess-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.ess {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--fg);
  border-radius: 10px; padding: 13px; font-size: 12.5px; text-align: left;
  min-height: 64px; justify-content: space-between; font-weight: 500;
  box-shadow: none;
}
.ess:hover:not(:disabled) { border-color: var(--brand); background: var(--bg-3s); filter: none; }
.ess-i { font-size: 18px; color: var(--brand-bright); line-height: 1; }
/* A latched toggle (blank / block / wake) shows its on-state. */
.ess-toggle.on {
  background: var(--wash);
  border-color: var(--brand);
  color: var(--fg);
}
.ess-toggle.on .ess-i { color: var(--brand-bright); }

/* ---------------------------------------------------------------- viewer */

.viewer {
  position: fixed; inset: 0; z-index: 70;
  background: #030907;
  display: flex; flex-direction: column;
}
.viewer-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 12px; background: var(--bg-2);
  border-bottom: 1px solid var(--line); flex: none;
  position: relative; z-index: 30;
}
.vb-name { font-weight: 600; margin-right: 2px; }
.vb-stat { color: var(--fg-faint); font-size: 12px; font-family: var(--mono); }
.vb-spacer { flex: 1; }

/* ScreenConnect-style toolbar: compact icon-only buttons in labelled groups
   separated by thin dividers. Every control is icon + tooltip, no text. */
.vb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; flex: none; }

.vb-select {
  width: auto; padding: 6px 9px; font-size: 12.5px; flex: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--fg);
}

.vb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; flex: none;
  background: none; border: 1px solid transparent; color: var(--fg-dim);
  border-radius: 8px; box-shadow: none;
}
.vb-btn:hover:not(:disabled) { color: var(--fg); background: var(--bg-3); filter: none; box-shadow: none; }
.ti { width: 18px; height: 18px; flex: none; opacity: .95; }
/* Latched / active state: Control on, 1:1 view, or an open popover. */
.vb-btn.on, .vb-menu.open {
  color: var(--brand-bright); background: var(--wash); border-color: var(--brand-2);
}

/* Toolbar popovers: session controls without leaving the session. */
.vb-pop {
  position: absolute;
  top: 54px; right: 12px;
  z-index: 40;
  width: 360px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.pop-title { font-weight: 600; margin-bottom: 10px; }
.pop-label { display: block; font-size: 12px; color: var(--fg-dim); margin-bottom: 6px; }
.vb-pop .ess-grid { grid-template-columns: repeat(2, 1fr); }

.viewer-stage {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
}
#screen {
  /* Pinned to all four edges of the stage, then object-fit letterboxes the
     frame inside that box.
     Absolute offsets are what make this reliable. Percentage heights on a
     canvas are not: the element carries an intrinsic aspect ratio, and whenever
     the parent's height is indefinite (a centered grid item, a flex child mid
     layout) `height:100%` silently falls back to that ratio. The element then
     renders taller than the stage and the bottom of the desktop — the taskbar —
     is clipped away. Offsets always resolve to a definite box, whatever the
     parent's layout mode or the window's shape. */
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  /* The frame is a downscaled JPEG; letting the browser smooth it on the way
     back up reads better than blocky nearest-neighbour. */
  image-rendering: auto;
  cursor: crosshair;
  background: #000;
}
/* "1:1" toggle: true pixels, scrolled rather than scaled. Back to static flow
   so the canvas takes its intrinsic size and the stage can scroll around it. */
#screen.actual-size {
  position: static;
  width: auto; height: auto;
  max-width: none; max-height: none;
  object-fit: none;
}
.viewer-stage.scrollable { overflow: auto; }
#screen.controlling { cursor: none; }
.viewer-msg {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: var(--fg-faint); font-size: 13px;
  pointer-events: none; text-align: center; padding: 0 20px;
}

/* Drag-and-drop onto the session. */
.drop-overlay {
  position: absolute; inset: 0; z-index: 25;
  display: grid; place-items: center;
  background: rgba(6, 18, 16, .74);
  border: 3px dashed var(--brand);
  /* The overlay must not eat the dragleave/drop events of the element under
     the pointer, which is what makes a drag flicker on and off. */
  pointer-events: none;
}
.drop-card { text-align: center; color: var(--fg); }
.drop-icon { font-size: 44px; color: var(--brand-bright); line-height: 1; }
.drop-head { font-size: 17px; font-weight: 600; margin-top: 10px; }
.drop-sub { font-size: 13px; color: var(--fg-dim); margin-top: 4px; font-family: var(--mono); }

/* Transfer progress list. */
.xfer {
  position: absolute; left: 14px; bottom: 14px; z-index: 26;
  display: flex; flex-direction: column; gap: 6px;
  max-width: 380px;
}
.xfer-item {
  background: rgba(10, 31, 23, .96);
  border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px;
}
.xfer-item.ok  { border-color: var(--brand-2); }
.xfer-item.err { border-color: var(--red); color: #fca5a5; }
.xfer-name { font-weight: 550; }
.xfer-meta { color: var(--fg-faint); font-size: 11.5px; margin-top: 2px; }
.xfer-bar {
  height: 3px; background: var(--bg); border-radius: 2px; margin-top: 6px; overflow: hidden;
}
.xfer-fill { height: 100%; background: var(--brand); width: 0; transition: width .15s ease; }

/* ----------------------------------------------------------------- modal */

.modal {
  position: fixed; inset: 0; background: rgba(3,9,7,.6);
  display: grid; place-items: center; z-index: 50;
}
.modal-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 24px; width: min(560px, calc(100vw - 40px)); max-height: 80vh; overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}
.modal-card h3 { margin: 0 0 14px; font-size: 17px; font-family: var(--display); font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-card pre {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; overflow-x: auto; font-family: var(--mono); font-size: 12px;
  color: var(--fg-dim); white-space: pre-wrap; word-break: break-all;
}
.modal-card .step { color: var(--fg-dim); font-size: 13px; margin: 14px 0 6px; }

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-3s); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 15px; font-size: 13px;
  min-width: 220px; max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  animation: rise .18s ease;
}
.toast.ok  { border-color: var(--brand-2); }
.toast.err { border-color: var(--red); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* --------------------------------------------------------------- narrow */

@media (max-width: 1180px) {
  :root { --side-w: 190px; --panel-w: 380px; }
  .table-head, .row { grid-template-columns: 34px minmax(120px,2fr) 90px 80px 0 96px 36px; }
  .th-ip, .cell-ip { display: none; }
}
