@font-face {
  font-family: IRANYekan;
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/static/fonts/iranyekanweblight(fanum).woff2") format("woff2");
}

@font-face {
  font-family: IRANYekan;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/iranyekanwebregular(fanum).woff2") format("woff2");
}

@font-face {
  font-family: IRANYekan;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/iranyekanwebbold(fanum).woff2") format("woff2");
}

:root {
  --paper: #e7eef3;
  --card: #ffffff;
  --ink: #0b2233;
  --text: #173042;
  --muted: #5a7184;
  --line: #d3dee6;
  --teal: #0d7f78;
  --up: #1b7f58;
  --down: #c43742;
  --degraded: #b87a1c;
  --offline: #6a7c8c;
  --waiting: #3a6d96;
  --hot: #c43742;
  --warn: #b87a1c;
  --ok: #1b7f58;
  --bezel: #0b2233;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 280px at 100% 0%, #e4eef3, transparent 70%),
    var(--paper);
  color: var(--text);
  font-family: IRANYekan, Tahoma, sans-serif;
  font-weight: 400;
  line-height: 1.55;
}

h1, h2, h3, strong { font-weight: 700; }

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.3;
}

h2 { margin: 0; font-size: 18px; color: var(--ink); }

a { color: var(--teal); text-decoration: none; }

button, input { font-family: inherit; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bezel);
  color: #f4f7fa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f4f7fa;
}

.brand strong,
.brand small { display: block; }

.brand small {
  font-weight: 300;
  font-size: 12px;
  opacity: 0.75;
}

.mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.ghost {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #f4f7fa;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}

.ghost:hover { background: rgba(255, 255, 255, 0.08); }

.page {
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}

.kicker {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.boards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.lane {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
}

.lane-watch {
  background: #fff6f6;
  border-color: #f0d0d3;
}

.lane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.lane-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

button.card {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: right;
  cursor: pointer;
}

.primary {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.primary:hover { background: #1d4060; }

.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 200ms ease,
    transform 220ms ease,
    overlay 220ms ease allow-discrete,
    display 220ms ease allow-discrete;
}

.modal[open] {
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  .modal[open] {
    opacity: 0;
    transform: translateY(16px);
  }
}

.modal-wide { width: min(780px, calc(100vw - 32px)); }

.modal::backdrop {
  background: rgba(11, 34, 51, 0);
  backdrop-filter: blur(5px);
  transition:
    background 220ms ease,
    overlay 220ms ease allow-discrete,
    display 220ms ease allow-discrete;
}

.modal[open]::backdrop {
  background: rgba(11, 34, 51, 0.62);
}

@starting-style {
  .modal[open]::backdrop {
    background: rgba(11, 34, 51, 0);
  }
}

.modal .panel {
  margin: 0;
  box-shadow: 0 28px 64px rgba(11, 34, 51, 0.32);
}

.modal-sheet {
  max-height: 86vh;
  overflow: auto;
  padding: 8px 8px 4px;
  border-radius: 20px;
  background: var(--paper);
}

.modal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 700;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block: 18px 16px;
  padding-inline: 36px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  box-shadow: 0 10px 28px rgba(22, 50, 74, 0.05);
}

.card::before {
  content: "";
  position: absolute;
  inset-inline-start: 14px;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 3px;
  background: var(--rail, var(--line));
}

.card:hover { border-color: #b7c9d4; }

.tone-up { --rail: var(--up); }
.tone-down { --rail: var(--down); }
.tone-degraded { --rail: var(--degraded); }
.tone-offline { --rail: var(--down); }
.tone-waiting { --rail: var(--waiting); }

.card-top,
.row-top,
.meter-head,
.panel-head,
.live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.card h2 { font-size: 17px; }

.muted { color: var(--muted); margin: 0; }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
}

.host,
.drives { unicode-bidi: isolate; }

.host { direction: ltr; }

.drives {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f6f8fa;
  font-size: 13px;
}

.seen {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 300;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0;
  padding: 0;
  list-style: none;
}

.dots li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f6f8fa;
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef3f6;
}

.st-up { color: var(--up); }
.st-down { color: var(--down); }
.st-degraded { color: var(--degraded); }
.st-online { color: var(--up); }
.st-offline { color: var(--down); }
.st-waiting { color: var(--waiting); }

.st-up.pill,
.st-online.pill { background: #e7f6ef; }

.st-down.pill { background: #fdecee; }

.st-degraded.pill { background: #fbf3e4; }

.st-offline.pill { background: #fdecee; color: var(--down); }

.st-waiting.pill { background: #e8f0f8; }

.st-down .dot {
  animation: pulse 1.6s ease-in-out infinite;
}

.panel {
  margin: 0 0 16px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(22, 50, 74, 0.04);
}

.panel-head { margin-bottom: 14px; }

.subhead {
  margin: 18px 0 10px;
  font-size: 14px;
  color: var(--muted);
}

.stat-grid,
.drives {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat-grid { grid-template-columns: 1fr 1fr; }

.drives { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.drive {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfc;
}

.meter {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6eef2;
}

.meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.meter-fill.ok { background: var(--ok); }
.meter-fill.warn { background: var(--warn); }
.meter-fill.hot { background: var(--hot); }

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.row:first-child { border-top: 0; padding-top: 0; }

.detail { margin: 6px 0 0; }

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 400;
}

input:focus {
  outline: 2px solid rgba(26, 122, 114, 0.35);
  border-color: var(--teal);
}

button[type="submit"] {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button[type="submit"]:hover { background: #1d4060; }

.error {
  margin: 0 0 8px;
  color: var(--down);
  font-weight: 700;
}

.alert {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fdecee;
  color: var(--down);
  font-weight: 700;
}

.reveal code {
  display: block;
  margin-top: 10px;
  padding: 12px;
  overflow-wrap: anywhere;
  border-radius: 12px;
  background: #f4f8f7;
  color: var(--ink);
  direction: ltr;
  text-align: left;
}

.back { font-weight: 700; }

.gate {
  width: min(920px, calc(100% - 32px));
  margin: 48px auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  overflow: hidden;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(22, 50, 74, 0.08);
}

.gate-side {
  padding: 36px 32px;
  background:
    linear-gradient(165deg, #1b425f 0%, var(--ink) 55%, #123028 100%);
  color: #f4f7fa;
}

.gate-side .kicker { color: #9fd4ce; }

.gate-side h1 {
  margin: 8px 0 10px;
  color: #fff;
  font-size: 30px;
}

.gate-side p:last-child {
  margin: 0;
  font-weight: 300;
  opacity: 0.86;
}

.gate .form { margin: 0; border: 0; box-shadow: none; padding: 32px; }

.captcha-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.captcha-head a {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.captcha-img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e8eeeb;
}

.captcha-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.live-head { margin-bottom: 16px; }

.live-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.primary.slim {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
}

.primary:disabled {
  opacity: 0.45;
  cursor: default;
}

.modal-remote {
  width: min(1100px, calc(100vw - 24px));
}

.remote-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.session-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.session-chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* Reliable taps on every remote control: kill the iOS 300ms delay and the
   grey tap flash, and never leave a sticky :hover after a tap. */
.remote-bar .session-chip,
.remote-chrome-toggle,
.mouse-pad-btn,
.remote-toast-close {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Visible pressed feedback so a tap always registers to the eye. */
.remote-bar .session-chip:active,
.remote-chrome-toggle:active,
.mouse-pad-btn:active {
  transform: scale(0.94);
  filter: brightness(1.25);
}

/* A short, self-dismissing confirmation toast (e.g. a quality change).
   Separate from .remote-toast so the lock note is never clobbered. */
.remote-flash {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: 80vw;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(13, 28, 44, 0.92);
  color: #f4f7fa;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.remote-flash[hidden] {
  display: none;
}

.session-chip.on {
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 700;
}

.stage {
  background: #10202c;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0;
}

.stage canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #10202c;
}

body.remote-window {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #10202c;
}

.remote-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #102033;
  color: #d7e3ea;
}

.quality-label {
  color: #9eb0be;
  font-size: 12px;
}

.remote-title {
  margin: 0;
  color: #d7e3ea;
  font-size: 13px;
}

.remote-bar .session-chip {
  background: transparent;
  color: #d7e3ea;
}

.remote-bar .session-chip.on {
  background: #173044;
  color: #fff;
}

.remote-toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: calc(100% - 24px);
  max-width: 640px;
  margin: 8px auto;
  padding: 10px 14px;
  background: #0b2233;
  color: #f4f7fa;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.remote-toast[hidden] {
  display: none;
}

.remote-toast-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.remote-toast-close {
  flex: none;
  border: 0;
  background: transparent;
  color: #9eb0be;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 0;
  border-radius: 999px;
}

.remote-toast-close:hover {
  color: #fff;
}

.chip-num {
  font-weight: 700;
}

.chip-badge {
  font-weight: 700;
}

/* The single cycling quality button is mobile-only; desktop keeps the chips.
   Specific enough (id) to beat .session-chip.with-ico's inline-flex. */
.remote-bar #remote-quality .quality-cycle {
  display: none;
}

.stage-fill {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: 0;
}

.stage-fill canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.stage-fill.stage-zoomed {
  overflow: auto;
  place-items: start;
}

.stage-fill.stage-zoomed canvas {
  max-width: none;
  max-height: none;
}

.remote-clip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #173044;
  color: #d7e3ea;
}

.remote-clip[hidden],
.remote-clip .session-chip[hidden] {
  display: none;
}

.remote-clip textarea {
  flex: 1;
  min-width: 0;
  height: 36px;
  resize: none;
  border: 1px solid #2a4558;
  border-radius: 8px;
  background: #102033;
  color: #d7e3ea;
  padding: 6px 8px;
}

.remote-paste {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  left: 0;
  top: 0;
}

.hint {
  margin: 10px 4px 4px;
  color: var(--muted, #5d6b76);
  font-size: 12px;
}

body:has(.console) {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body:has(.console) .app-shell {
  flex: 1;
  height: 100%;
  min-height: 0;
}

body:has(.console) .side {
  min-height: 0;
  overflow: auto;
}

body:has(.console) main {
  flex: 1;
  min-height: 0;
  display: flex;
}

.console {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  min-width: 0;
}

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

.shell-main > main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 232px;
  flex: none;
  min-height: 100vh;
  padding: 16px 12px;
  background: #0e2838;
  color: #d7e3ea;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
}

.side-brand {
  padding: 0 8px;
  color: #f4f7fa;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-extra:not(:has(*)) { display: none; }

.side-foot {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side .who {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #f4f7fa;
  line-height: 1.3;
}

.side .who strong { font-size: 13px; }

.side .who small {
  font-weight: 300;
  font-size: 11px;
  opacity: 0.75;
}

.side .nav-link {
  width: 100%;
  justify-content: flex-start;
  border-radius: 8px;
  padding: 8px 10px;
}

.side .nav-link.on {
  background: #173044;
  color: #fff;
  box-shadow: inset -3px 0 0 #1c8f8c;
}

.side-nav form { margin: 0; }

.side button.nav-link[type="submit"] {
  width: 100%;
  margin: 0;
  background: transparent;
  color: #f4f7fa;
  font-weight: 400;
  border-radius: 8px;
}

.side button.nav-link[type="submit"]:hover {
  background: #173044;
}

.rail {
  min-height: 0;
  overflow: auto;
  padding: 18px 12px 16px;
  background: #0e2838;
  color: #d7e3ea;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
}

.rail-kicker,
.rail-lead,
.rail-label {
  margin: 0 8px;
}

.rail-kicker {
  color: #8fb8b4;
  font-size: 12px;
  font-weight: 700;
}

.rail h2 {
  margin: 4px 8px 8px;
  color: #fff;
  font-size: 26px;
}

.rail-lead {
  margin-bottom: 14px;
  color: #9eb0be;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.7;
}

.rail-label {
  margin-bottom: 6px;
  color: #7f93a3;
  font-size: 12px;
}

.build,
.groups button,
.tool {
  font: inherit;
  cursor: pointer;
}

.build {
  display: block;
  width: calc(100% - 16px);
  margin: 0 8px 16px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: #1c8f8c;
  color: #fff;
  font-weight: 700;
  text-align: right;
}

.build:hover { background: #167a78; }

.groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.groups button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d7e3ea;
  text-align: right;
}

.groups button:hover { background: #173044; }

.groups + .rail-label { margin-top: 14px; }

.side-roles {
  list-style: none;
  margin: 0 8px 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-roles li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #d7e3ea;
  font-size: 13px;
}

.side-roles span {
  color: #9eb0be;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.5;
}

.role-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.role-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.role-list span,
.roles-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.roles-note { margin: 12px 0 0; }

.list-error {
  margin: 0;
  padding: 8px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.groups button.on {
  background: #173044;
  color: #fff;
  box-shadow: inset -3px 0 0 #1c8f8c;
}

.groups .count {
  color: #8aa0b0;
  font-size: 12px;
}

.list-pane,
.inspect {
  min-width: 0;
  min-height: 0;
}

.list-pane {
  display: flex;
  flex-direction: column;
  background: #f7fbfc;
  border-inline: 1px solid var(--line);
}

.list-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.list-head h1 {
  flex: 1;
  min-width: 0;
  font-size: 18px;
}

.tool {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.tool:hover { border-color: var(--teal); color: var(--teal); }

.tool:disabled {
  opacity: 0.4;
  cursor: default;
}

.list-head .find {
  width: min(240px, 34%);
}

#sites {
  flex: 1;
  overflow: auto;
}

.machines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.machine {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: right;
  cursor: pointer;
}

.machine:hover { background: #fff; }

.machine.on {
  background: #e7f4f3;
  box-shadow: inset -3px 0 0 var(--teal);
}

.machine-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.machine-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.machine-meta,
.machine-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.machine-services {
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 8px;
}

.machine-note {
  color: var(--down);
  font-size: 12px;
  font-weight: 700;
}

.drive-count {
  padding: 0 6px;
  border-radius: 999px;
  background: #eef3f6;
}

.conn {
  display: flex;
  direction: rtl;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex: none;
  min-width: 210px;
  justify-self: start;
  background: transparent;
  color: #6b7280;
}

.conn-ico,
.conn-screen {
  display: grid;
  flex: none;
  color: #6b7280;
}

.conn-ico .ico,
.conn-screen .ico {
  display: block;
  width: 22px;
  height: 22px;
}

.conn.st-online .conn-screen,
.conn.st-live .conn-ico,
.conn.st-live .conn-screen { color: var(--up); }

.conn-track {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 148px;
  height: 22px;
}

.conn-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 2px;
  background: #8b939c;
}

.conn.st-online .conn-line {
  background: linear-gradient(to left, #8b939c 0 42%, var(--up) 42% 100%);
}

.conn.st-live .conn-line { background: var(--up); }

.conn.st-offline .conn-line { background: var(--down); }

.conn-label {
  position: relative;
  z-index: 1;
  max-width: 120px;
  padding: 0 6px;
  overflow: hidden;
  background: #f7fbfc;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.machine:hover .conn-label { background: #fff; }

.machine.on .conn-label { background: #e7f4f3; }

.list-none {
  margin: 18px 14px;
}

.inspect {
  overflow: auto;
  padding: 14px 14px 20px;
  background: #f7fafb;
}

.inspect-empty {
  margin-top: 48px;
  text-align: center;
}

.shot {
  margin: 0 0 12px;
  overflow: hidden;
  border-radius: 12px;
  background: #102033;
}

.shot-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  height: 132px;
  color: #d7e3ea;
  background:
    linear-gradient(180deg, rgba(28, 143, 140, 0.28), transparent 60%),
    #16324a;
}

.shot-screen.tone-down,
.shot-screen.tone-offline {
  background:
    linear-gradient(180deg, rgba(196, 69, 74, 0.28), transparent 60%),
    #16324a;
}

.shot-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: #10202c;
}

.shot-monitors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0 12px 10px;
  list-style: none;
}

.shot-monitors li {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: #16324a;
  color: #d7e3ea;
  font-size: 12px;
}

.shot-note {
  margin: 0;
  padding: 8px 12px;
  color: #9eb0be;
  font-size: 12px;
}

.facts {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.facts div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  font-size: 13px;
}

.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); }

.inspect .stat-grid { grid-template-columns: 1fr; }

.inspect .alert { margin: 0; }

@media (max-width: 980px) {
  body:has(.console) {
    height: auto;
    overflow: auto;
  }

  .app-shell { flex-direction: column; }

  .side {
    width: auto;
    min-height: 0;
  }

  .console { grid-template-columns: 1fr; }

  .list-pane { min-height: 70vh; }

  .list-head { flex-wrap: wrap; }

  .list-head .find { width: 100%; }
}

@media (max-width: 860px) {
  .boards { grid-template-columns: 1fr; }
  .lane-watch { order: -1; }
  .page-head { align-items: stretch; flex-direction: column; }
  .primary { width: 100%; }
  .gate,
  .stat-grid { grid-template-columns: 1fr; }

  .gate-side { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .st-down .dot { animation: none; }

  .modal,
  .modal::backdrop {
    transition: none;
  }

  .modal { transform: none; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* --- user management / top nav --- */
.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.top-nav .who {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-inline-end: 6px;
  color: #f4f7fa;
  line-height: 1.3;
}

.top-nav .who strong { font-size: 13px; }

.top-nav .who small {
  font-weight: 300;
  font-size: 11px;
  opacity: 0.75;
}

a.ghost.linkish {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.users-table th,
.users-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

.users-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.users-table th:last-child,
.users-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.user-id {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-handle,
.user-scope {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.user-handle {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}

.user-when {
  white-space: nowrap;
  color: var(--muted);
}

.users-table tr.row-off { opacity: 0.62; }

.user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.user-stats li {
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.user-stats strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.user-stats span {
  color: var(--muted);
  font-size: 13px;
}

.users-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.users-search input { min-width: min(280px, 100%); }

.users-search button[type="submit"] {
  width: auto;
  margin: 0;
  padding: 10px 16px;
}

.account-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-form {
  max-height: 86vh;
  overflow: auto;
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 12px;
}

.form .checks label,
.form .check-line {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}

.form .checks input,
.form .check-line input {
  width: auto;
  padding: 0;
}

.user-edit form + form {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.user-edit button.ghost-ink,
.user-edit button.danger-text {
  width: 100%;
  margin-top: 8px;
}

.user-edit button.ghost-ink {
  background: #fff;
  color: var(--ink);
}

.user-edit button.danger-text {
  background: transparent;
  color: var(--down);
}

.audit-panel { margin-top: 18px; }

.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.audit-list li:first-child { border-top: 0; }

.user-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.inline-form,
.mini-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
}

.inline-form select,
.mini-form input,
.form select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.inline-form button[type="submit"],
.mini-form button[type="submit"] {
  width: auto;
  margin: 0;
  padding: 7px 12px;
  font-size: 12px;
}

.ghost-ink {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ghost-ink:hover { border-color: var(--teal); color: var(--teal); }

.svc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.svc-actions button { width: auto; margin: 0; }

.danger-text {
  border: 0;
  background: transparent;
  color: var(--down);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 4px;
}

.action-box {
  position: relative;
}

.action-box summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
}

.action-box summary::-webkit-details-marker { display: none; }

.action-box[open] summary {
  border-color: var(--teal);
  color: var(--teal);
}

.action-box .mini-form {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(22, 50, 74, 0.12);
}

.flash {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.flash-ok {
  background: #e7f6ef;
  color: var(--up);
}

.flash-error {
  background: #fdecee;
  color: var(--down);
}

.form.narrow {
  width: min(440px, 100%);
}

.table-wrap { overflow-x: auto; }

@media (max-width: 900px) {
  .users-layout { grid-template-columns: 1fr; }
  .top-nav { justify-content: flex-end; }
}

.ico {
  display: block;
  flex: none;
}

.with-ico {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

h2.with-ico,
.subhead.with-ico,
.remote-title.with-ico {
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #f4f7fa;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.on {
  background: rgba(255, 255, 255, 0.1);
}

.nav-link:focus-visible,
.groups button:focus-visible,
.machine:focus-visible,
.tool:focus-visible,
.ghost-ink:focus-visible,
.primary:focus-visible,
.session-chip:focus-visible {
  outline: 2px solid #7dfff4;
  outline-offset: 2px;
}

.top-nav form { margin: 0; }

.top-nav button[type="submit"] {
  width: auto;
  margin: 0;
  background: transparent;
}

.top-nav .who strong {
  display: inline-flex;
  font-size: 13px;
}

.find {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.find input {
  width: 100%;
  min-width: 0;
  padding: 7px 0;
  border: 0;
  background: transparent;
}

.find input:focus { outline: none; }

.find:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 127, 120, 0.16);
}

.build.with-ico { justify-content: center; }

.groups button .with-ico { color: inherit; }

.presence-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef3f6;
  color: var(--muted);
}

.presence-mark.st-online {
  color: var(--up);
  background: #e7f6ef;
}

.presence-mark.st-offline {
  color: var(--down);
  background: #fdecee;
}

.presence-mark.st-waiting {
  color: var(--waiting);
  background: #e8f0f8;
}

.svc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--teal);
}

.gate-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.gate-points li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 300;
}

.user-stats li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
}

.stat-ico {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #e7f4f3;
  color: var(--teal);
}

.user-stats strong { grid-column: 2; }

.shot-monitors li .ico { color: #9fd4ce; }

.primary.with-ico,
.tool.with-ico,
.ghost-ink.with-ico,
.danger-text.with-ico,
.session-chip.with-ico,
.text-btn.with-ico {
  gap: 6px;
}

.session-chip.with-ico { display: inline-flex; }

.quality-label.with-ico { display: inline-flex; }

.live {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-head {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 0;
}

.live-title {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.live-title h2 {
  min-width: 0;
  width: 100%;
  font-size: 16px;
  overflow-wrap: break-word;
}

.live-tools {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}

.live-tools button.chip-btn {
  width: auto;
  margin-top: 0;
}

.token-field {
  direction: ltr;
  text-align: left;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.chip-btn:hover { border-color: var(--teal); color: var(--teal); }

.chip-btn.danger { color: var(--down); }

.chip-btn.danger:hover {
  border-color: var(--down);
  color: var(--down);
}

.site-delete-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.site-delete-actions button {
  width: auto;
  flex: 1;
  margin-top: 0;
  justify-content: center;
}

.site-delete-actions button.danger-text[type="submit"] {
  background: transparent;
  color: var(--down);
  border: 1px solid var(--down);
  border-radius: 12px;
}

.site-delete-actions button.danger-text[type="submit"]:hover {
  background: var(--down);
  color: #fff;
}

.chip-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.chip-btn:focus-visible {
  outline: 2px solid rgba(13, 127, 120, 0.45);
  outline-offset: 2px;
}

.live-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 300;
}

.live-meta > span + span::before {
  content: "·";
  margin-inline: 6px;
  color: #9aafbc;
}

.live .stat-grid,
.live .drives {
  grid-template-columns: 1fr;
  gap: 6px;
}

.meter-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.meter-line .meter {
  height: 3px;
  margin: 0;
}

.meter-val {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.svc-actions button[type="submit"] {
  width: auto;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.svc-actions button[type="submit"]:hover {
  background: #fff;
  border-color: var(--teal);
  color: var(--teal);
}

.svc-actions button.danger-text[type="submit"] {
  border-color: transparent;
  background: transparent;
  color: var(--down);
}

.svc-actions button.danger-text[type="submit"]:hover {
  border-color: transparent;
  background: transparent;
  color: var(--down);
}

.live-block {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.live-block .panel-head {
  margin-bottom: 8px;
}

.live-block h2 {
  font-size: 13px;
}

.live-block .muted {
  font-size: 12px;
  font-weight: 300;
}

.live .meter-line .meter {
  height: 3px;
  margin: 0;
}

.live .drive {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.live .drives {
  gap: 8px;
  margin-top: 8px;
}

.live .row {
  padding: 7px 0;
}

.live .detail {
  margin: 2px 0 0;
  font-size: 12px;
}

.live .shot {
  margin: 0;
  border-radius: 8px;
}

.inspect .shot-image {
  max-height: 112px;
}

.live .machine-note {
  margin: 0;
  font-size: 12px;
}

.backstage-window {
  background: #10202c;
}

.backstage-window .session-chip {
  width: auto;
  background: transparent;
  color: #d7e3ea;
  border-color: #2a4558;
}

.backstage-window .session-chip.on {
  background: #173044;
  color: #fff;
  border-color: #2a9d8f;
}

.backstage-window button[type="submit"] {
  width: auto;
  margin: 0;
  background: transparent;
}

.stage-pane .session-row {
  flex: 0 0 auto;
  align-items: center;
}

.stage-quiet {
  margin: 0;
  padding: 6px 12px;
  color: #9eb0be;
  font-size: 12px;
}

.stage-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px 12px;
}

.stage-pane[hidden] {
  display: none;
}

.stage-cwd {
  color: #9eb0be;
  font-size: 12px;
}

#stage-out {
  flex: 1;
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border-radius: 10px;
  background: #0c1822;
  color: #d7e3ea;
  font: 13px/1.45 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
}

.stage-line {
  display: flex;
  gap: 8px;
}

.stage-line input {
  flex: 1;
  min-width: 0;
  border: 1px solid #2a4558;
  border-radius: 8px;
  background: #102033;
  color: #d7e3ea;
  padding: 8px;
}

.stage-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.stage-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid #1d3344;
}

.stage-list button {
  border: 0;
  background: transparent;
  color: #d7e3ea;
  cursor: pointer;
  text-align: start;
}

.stage-upload {
  align-self: flex-start;
  cursor: pointer;
}

/* --- Support & Join (ScreenConnect style) --- */
.join-code-input {
  direction: ltr;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 8px;
  padding: 12px 16px;
  color: var(--ink);
}

.join-ready {
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #bce3de;
  background: #f1faf8;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-decoration: none;
  margin-top: 6px;
}

.support-badge {
  display: inline-block;
  padding: 2px 8px;
  margin-inline-end: 6px;
  border-radius: 8px;
  background: #e7f4f3;
  color: var(--teal);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.support-code-big {
  padding: 12px;
  border-radius: 12px;
  background: #e7f4f3;
  color: var(--ink);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 6px;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.support-dl-note {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
}

.support-dl-note.st-downloading {
  color: var(--degraded);
}

.support-dl-note.st-downloaded {
  color: var(--up);
}

.support-dl-banner {
  margin: 4px 0 0;
  padding: 6px 10px;
  border-radius: 10px;
  background: #e8f4f8;
  color: var(--waiting);
  font-size: 12px;
  font-weight: 700;
}

.support-dl-banner.st-downloading {
  background: #fbf3e4;
  color: var(--degraded);
}

.support-dl-banner.st-downloaded {
  background: #e7f6ef;
  color: var(--up);
}

/* --- Live Service Logs Modal --- */
.log-sheet {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #eef3f6;
}

.log-filters {
  display: flex;
  gap: 6px;
}

.log-filters .chip-btn.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.log-source {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.log-table-wrap {
  height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.log-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0e2838;
  color: #fff;
  padding: 10px 10px;
  text-align: right;
  font-size: 12px;
  white-space: nowrap;
}

.log-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.log-row-error {
  background: #fff5f5;
}

.log-row-warn {
  background: #fffbf0;
}

.log-col-num {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.log-col-time {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}

.log-col-comp {
  font-weight: 700;
  color: var(--teal);
  font-size: 12px;
}

.log-col-msg {
  font-family: ui-monospace, Consolas, IRANYekan, Tahoma, monospace;
  line-height: 1.5;
  word-break: break-word;
}

.log-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.log-auto-toggle input {
  width: auto;
  margin: 0;
}





/* --- Desktop remote toolbar: slim ScreenConnect-style overlay --- */
@media (min-width: 981px) {
  body.remote-window {
    position: relative;
  }

  .remote-bar {
    position: absolute;
    top: 10px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 40;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    width: max-content;
    max-width: calc(100% - 24px);
    padding: 4px 6px;
    gap: 0;
    overflow: visible;
    background: rgba(11, 22, 36, 0.9);
    color: #e8eef3;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .remote-bar-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    min-width: 0;
  }

  .remote-bar-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    flex: none;
  }

  .remote-bar .session-row {
    flex: none;
    flex-wrap: nowrap;
  }

  .remote-bar-sep {
    flex: none;
    width: 1px;
    height: 18px;
    margin: 0 5px;
    background: rgba(255, 255, 255, 0.16);
  }

  .remote-status-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e6b33a;
    box-shadow: 0 0 0 3px rgba(230, 179, 58, 0.22);
  }

  .remote-status-dot[data-state="live"] {
    background: #2ee6a8;
    box-shadow: 0 0 0 3px rgba(46, 230, 168, 0.22);
  }

  .remote-status-dot[data-state="down"] {
    background: #e85b5b;
    box-shadow: 0 0 0 3px rgba(232, 91, 91, 0.25);
  }

  .remote-bar-status {
    gap: 8px;
    padding: 0 8px 0 4px;
    min-width: 0;
  }

  .remote-title {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }

  .remote-live-user,
  .remote-site-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #b7c6d1;
  }

  .remote-live-user {
    max-width: 10em;
    color: #f4f7fa;
    font-weight: 700;
  }

  .remote-live-user[hidden] {
    display: none;
  }

  .remote-site-name {
    max-width: 12em;
    padding-inline-end: 2px;
  }

  .remote-bar .session-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 32px;
    padding: 4px 8px;
    border-radius: 8px;
    border-color: transparent;
    background: transparent;
    color: #e8eef3;
    gap: 5px;
  }

  .remote-bar .session-chip:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .remote-bar .session-chip.on {
    background: rgba(13, 127, 120, 0.28);
    border-color: rgba(46, 242, 230, 0.28);
    color: #fff;
  }

  /* Icon-only primary actions and menu triggers; badge + caret may stay. */
  .remote-bar .remote-menu-toggle > span:not(.chip-badge):not(.menu-caret),
  .remote-bar-actions .session-chip.with-ico > span {
    display: none;
  }

  .menu-caret {
    width: 0;
    height: 0;
    margin-inline-start: 2px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    border-bottom-width: 0;
    opacity: 0.7;
  }

  .remote-menu {
    position: relative;
    flex: none;
  }

  .remote-menu-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    z-index: 50;
    min-width: 188px;
    padding: 6px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(10, 20, 32, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
  }

  .remote-menu.open .remote-menu-panel {
    display: flex;
  }

  .remote-menu:has(#remote-monitors:empty) {
    display: none;
  }

  .remote-menu-panel .session-row {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    gap: 4px;
  }

  .remote-menu-panel .session-chip,
  .remote-menu-panel .quality-label {
    width: 100%;
    justify-content: flex-start;
    border-radius: 8px;
    box-sizing: border-box;
  }

  .remote-menu-panel .quality-label {
    padding: 4px 8px;
    color: #9eb0be;
  }

  .remote-bar #remote-quality .quality-cycle {
    display: none;
  }

  .remote-keys-bar {
    position: absolute;
    top: 58px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 39;
    width: max-content;
    max-width: calc(100% - 24px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    background: rgba(11, 22, 36, 0.92);
  }

  body.remote-window.chrome-hidden .remote-chrome-toggle {
    display: inline-flex;
    top: 0;
    left: 50%;
    right: auto;
    inset-inline-start: auto;
    transform: translateX(-50%);
    width: auto;
    min-width: 64px;
    height: 22px;
    padding: 0 16px;
    border-radius: 0 0 10px 10px;
    border-top: 0;
  }
}
