@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #090b10;
  --stage: #06080c;
  --stage-glow: #151b2a;
  --surface: #10131b;
  --surface-2: #161b26;
  --surface-3: #1d2434;
  --input-bg: #0b0e15;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --row-hover: rgba(255, 255, 255, 0.03);

  --ink: #f4f6fa;
  --text: #c4ccd9;
  --muted: #7f8a9e;
  --faint: #556075;

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-ink: #93c5fd;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --accent-border: rgba(59, 130, 246, 0.34);

  --green: #22c55e;
  --green-ink: #4ade80;
  --green-soft: rgba(34, 197, 94, 0.13);
  --green-border: rgba(34, 197, 94, 0.28);

  --amber: #f59e0b;
  --amber-ink: #fbbf24;
  --amber-soft: rgba(245, 158, 11, 0.13);
  --amber-border: rgba(245, 158, 11, 0.28);

  --red: #ef4444;
  --red-hover: #dc2626;
  --red-ink: #fca5a5;
  --red-soft: rgba(239, 68, 68, 0.13);
  --red-border: rgba(239, 68, 68, 0.32);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-pop: 0 20px 56px rgba(0, 0, 0, 0.58);
  --term-bg: #07090e;
  --term-ink: #dce4f2;

  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-w: 244px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  --bg: #f3f5f9;
  --stage: #0b0e14;
  --stage-glow: #1b2233;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eaeff6;
  --input-bg: #ffffff;

  --border: #e3e8f0;
  --border-strong: #cdd5e2;
  --row-hover: #f7f9fc;

  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --faint: #94a3b8;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-ink: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;

  --green: #16a34a;
  --green-ink: #15803d;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;

  --amber: #d97706;
  --amber-ink: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --red: #dc2626;
  --red-hover: #b91c1c;
  --red-ink: #b91c1c;
  --red-soft: #fef2f2;
  --red-border: #fecaca;

  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-pop: 0 22px 54px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --term-bg: #0f131c;
  --term-ink: #e2e8f0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

.symbol-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

.theme-icon-moon {
  display: none;
}

:root[data-theme="light"] .theme-icon-sun {
  display: none;
}

:root[data-theme="light"] .theme-icon-moon {
  display: block;
}

/* =========================
   LOGIN VIEW
   ========================= */
.login-view {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  background:
    radial-gradient(640px 380px at 50% 0%, rgba(59, 130, 246, 0.14), transparent 72%),
    radial-gradient(1px 1px at 16px 16px, rgba(255, 255, 255, 0.05) 1px, transparent 0),
    var(--bg);
  background-size: auto, 24px 24px, auto;
}

:root[data-theme="light"] .login-view {
  background:
    radial-gradient(640px 380px at 50% 0%, rgba(37, 99, 235, 0.08), transparent 72%),
    radial-gradient(1px 1px at 16px 16px, rgba(15, 23, 42, 0.055) 1px, transparent 0),
    var(--bg);
  background-size: auto, 24px 24px, auto;
}

.login-theme-btn {
  position: fixed;
  top: 18px;
  right: 18px;
}

.login-shell {
  width: min(100%, 400px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-hero {
  text-align: center;
  margin-bottom: 24px;
}

.login-emblem {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.18);
}

.login-emblem img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.login-hero h1 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.login-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-card {
  width: 100%;
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.password-field {
  position: relative;
}

.password-field .field-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.password-field input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--input-bg);
  font-size: 13.5px;
}

.password-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.login-msg {
  margin: 0;
  font-size: 12px;
}

.login-msg:not(:empty) {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.login-msg.error:not(:empty) {
  border-color: var(--red-border);
  color: var(--red-ink);
  background: var(--red-soft);
}

.login-card .btn.block {
  margin-top: 16px;
  height: 42px;
  border-radius: var(--radius);
  font-size: 13.5px;
}

.login-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
}

.login-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.login-meta svg {
  width: 13px;
  height: 13px;
  color: var(--green);
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
}

/* =========================
   APP SHELL & SIDEBAR
   ========================= */
.app-shell {
  height: 100dvh;
  display: flex;
  overflow: hidden;
  background: var(--bg);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 10px 10px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: width 0.18s ease, flex-basis 0.18s ease, padding 0.18s ease, opacity 0.14s ease;
  z-index: 40;
}

.app-shell.sidebar-collapsed .sidebar {
  flex-basis: 0;
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.sb-head {
  flex: 0 0 auto;
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  margin-bottom: 10px;
}

.sb-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sb-brand img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.sb-nav {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.sb-item {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}

.sb-item svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.sb-item:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.sb-item.active {
  color: var(--ink);
  background: var(--surface-3);
  font-weight: 600;
}

.sb-item.active svg {
  color: var(--accent);
}

.sb-count {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 99px;
  color: var(--muted);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.sb-count.live {
  color: var(--green-ink);
  background: var(--green-soft);
}

.sb-search {
  flex: 0 0 auto;
  position: relative;
  margin-bottom: 12px;
}

.sb-search svg {
  position: absolute;
  top: 50%;
  left: 9px;
  width: 13px;
  height: 13px;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.sb-search input {
  width: 100%;
  height: 30px;
  padding: 0 26px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--input-bg);
  font-size: 12px;
}

.sb-search input:focus {
  border-color: var(--accent);
  outline: none;
}

.sb-search kbd {
  position: absolute;
  top: 50%;
  right: 7px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.1;
  transform: translateY(-50%);
  pointer-events: none;
}

.sb-section {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 6px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sb-pager {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sb-pager button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface-2);
}

.sb-pager button:not(:disabled):hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

.sb-pager button svg {
  width: 12px;
  height: 12px;
}

.sb-pager span {
  min-width: 24px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-align: center;
  text-transform: none;
}

.sb-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.sb-vm {
  width: 100%;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: transparent;
  font-size: 12.5px;
  text-align: left;
}

.sb-vm:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.sb-vm.active {
  border-color: var(--accent-border);
  color: var(--ink);
  background: var(--accent-soft);
  font-weight: 500;
}

.sb-vm-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-vm-port {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.sb-empty {
  padding: 12px 8px;
  color: var(--faint);
  font-size: 12px;
}

.sb-foot {
  flex: 0 0 auto;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}

.sb-foot .sb-item:hover {
  color: var(--red-ink);
  background: var(--red-soft);
}

.dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--faint);
}

.dot.running,
.dot.online {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.dot.starting {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.dot.error {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

/* =========================
   WORKSPACE & HEADER
   ========================= */
.workspace {
  flex: 1 1 auto;
  min-width: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-head {
  flex: 0 0 54px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.vh-left,
.vh-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.vh-right {
  flex: 0 0 auto;
}

.view-head h1 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vh-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 500;
}

.bulk-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid var(--border);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 500;
}

.view-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 20px 22px 28px;
  overflow-y: auto;
}

.inline-alert {
  flex: 0 0 auto;
  margin: 10px 18px 0;
  padding: 9px 12px;
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  color: var(--red-ink);
  background: var(--red-soft);
  font-size: 12.5px;
}

/* =========================
   BUTTONS & CONTROLS
   ========================= */
.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn {
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  background: var(--surface-2);
}

.btn.sm {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.btn:not(:disabled):hover {
  border-color: var(--muted);
  background: var(--surface-3);
}

.btn.primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.btn.primary:not(:disabled):hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.btn.danger {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.btn.danger:not(:disabled):hover {
  border-color: var(--red-hover);
  background: var(--red-hover);
}

.btn.danger-outline {
  border-color: var(--red-border);
  color: var(--red-ink);
  background: var(--red-soft);
}

.btn.block {
  width: 100%;
  margin-top: 10px;
}

.icon-btn {
  width: 32px;
  padding: 0;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
}

.icon-btn:not(:disabled):hover {
  border-color: var(--border-strong);
  color: var(--ink);
  background: var(--surface-3);
}

.icon-btn.ghost {
  border-color: transparent;
  background: transparent;
}

.icon-btn.ghost:not(:disabled):hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.icon-btn.loading svg {
  animation: spin 0.75s linear infinite;
}

.compact-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--input-bg);
  font-size: 12px;
}

.link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 500;
}

.link:hover {
  text-decoration: underline;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tag.accent {
  border-color: var(--accent-border);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.tag.green {
  border-color: var(--green-border);
  color: var(--green-ink);
  background: var(--green-soft);
}

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

/* =========================
   METRICS, PANELS, TABLE & GRID
   ========================= */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.metric-ico {
  color: var(--faint);
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.metric-value strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.metric-value span {
  color: var(--muted);
  font-size: 12.5px;
}

.metric-sub {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter {
  height: 4px;
  margin: 9px 0 2px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}

.meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.meter i.warn {
  background: var(--amber);
}

.meter i.critical {
  background: var(--red);
}

.fleet-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.fleet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-heading {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-pad {
  padding: 16px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.macros-split {
  grid-template-columns: 1fr 1.15fr;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
}

.segmented.full {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 10px;
}

.segmented button {
  height: 25px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.segmented em {
  font-style: normal;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
}

.segmented button.active em {
  color: var(--accent-ink);
}

.view-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
}

.view-switch button {
  width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}

.view-switch button.active {
  color: var(--ink);
  background: var(--surface);
}

.search-input {
  position: relative;
  width: 220px;
}

.wp-body .search-input {
  width: 100%;
  margin-bottom: 8px;
}

.search-input svg {
  position: absolute;
  top: 50%;
  left: 9px;
  width: 13px;
  height: 13px;
  color: var(--faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input input {
  width: 100%;
  height: 31px;
  padding: 0 10px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--input-bg);
  font-size: 12px;
}

.search-input input:focus {
  border-color: var(--accent);
  outline: none;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  height: 56px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  vertical-align: middle;
}

.table.compact td {
  height: 40px;
  padding: 6px 14px;
}

.table tbody tr:first-child td {
  border-top: 0;
}

.table tbody tr:hover {
  background: var(--row-hover);
}

.col-check {
  width: 36px;
  text-align: center;
}

.col-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.col-actions {
  text-align: right !important;
  white-space: nowrap;
}

.vm-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.vm-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-2);
}

.vm-avatar.running {
  border-color: var(--green-border);
  color: var(--green-ink);
  background: var(--green-soft);
}

.vm-avatar.starting {
  border-color: var(--amber-border);
  color: var(--amber-ink);
  background: var(--amber-soft);
}

.vm-avatar.error {
  border-color: var(--red-border);
  color: var(--red-ink);
  background: var(--red-soft);
}

.vm-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vm-link strong {
  font-size: 13px;
  font-weight: 600;
}

.vm-link:hover strong {
  color: var(--accent-ink);
}

.vm-sub {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11.5px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-badge.running {
  border-color: var(--green-border);
  color: var(--green-ink);
  background: var(--green-soft);
}

.status-badge.starting {
  border-color: var(--amber-border);
  color: var(--amber-ink);
  background: var(--amber-soft);
}

.status-badge.error {
  border-color: var(--red-border);
  color: var(--red-ink);
  background: var(--red-soft);
}

.os-primary {
  display: block;
  color: var(--ink);
  font-weight: 500;
}

.os-sub {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.spec-primary {
  display: block;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.spec-sub {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.adb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
}

.adb-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.adb-btn svg {
  width: 12px;
  height: 12px;
  color: var(--faint);
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

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

.device-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

:root[data-theme="light"] .device-card {
  background: var(--surface);
}

.device-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.dc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
}

.dc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.dc-head strong {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-head small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.dc-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 14px 12px;
}

.dc-spec {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

:root[data-theme="light"] .dc-spec {
  background: var(--surface-2);
}

.dc-spec span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.dc-spec strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.dc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 14px 12px;
}

.dc-tags {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dc-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

:root[data-theme="light"] .dc-foot {
  background: var(--surface-2);
}

.dc-foot .open-btn {
  flex: 1 1 auto;
}

.empty {
  padding: 50px 20px;
  text-align: center;
}

.empty-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-2);
}

.empty h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14.5px;
}

.empty p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12.5px;
}

/* =========================
   MASSIVE REMOTE CONTROL WALL
   ========================= */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
}

.sync-pill.active {
  border-color: var(--accent-border);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.sync-pill em {
  font-style: normal;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(59, 130, 246, 0.22);
  font-family: var(--font-mono);
  font-size: 11px;
}

.wall-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--bg);
}

.wall-master {
  flex: 0 0 326px;
  width: 326px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.wm-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.wm-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.wm-head-left select {
  min-width: 0;
  flex: 1 1 auto;
}

.wm-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: radial-gradient(circle at 50% 44%, var(--stage-glow) 0%, var(--stage) 75%);
  overflow: hidden;
}

.wall-master-frame {
  width: 240px;
  height: 510px;
}

.sync-capture-layer {
  position: absolute;
  inset: 6px;
  z-index: 2;
  border-radius: 20px;
  cursor: crosshair;
  touch-action: none;
  background: transparent;
}

.sync-capture-layer.direct {
  pointer-events: none;
}

.gesture-svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wm-nav {
  flex: 0 0 42px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 5px 8px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.wm-nav button {
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}

.wm-nav button:not(:disabled):hover {
  border-color: var(--border);
  color: var(--ink);
  background: var(--surface-2);
}

.wall-matrix-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wall-subbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.ws-left,
.ws-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ws-sep {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
  margin: 0 2px;
}

.wall-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--wall-cols, 3), minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
}

.wall-tile {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.wall-tile.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.wall-tile.is-master {
  border-color: var(--green);
}

.wt-head {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11.5px;
}

.wt-head input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}

.wt-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wt-btn {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
}

.wt-btn:hover {
  color: var(--ink);
  background: var(--surface-3);
}

.wt-btn.pinned {
  color: var(--green-ink);
}

.wt-screen-box {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 17.5;
  background: var(--stage);
  overflow: hidden;
}

.wt-rfb,
.wt-snap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wt-snap {
  object-fit: contain;
  background: #040507;
}

.wt-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  color: #94a3b8;
  background: #0c0f16;
  text-align: center;
  font-size: 11.5px;
}

.farm-results {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.danger-chip {
  color: var(--red-ink);
  border-color: var(--red-border);
  background: var(--red-soft);
}

/* =========================
   MACROS & API TOKENS
   ========================= */
.macros-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.macro-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

:root[data-theme="light"] .macro-card {
  background: var(--surface-2);
}

.macro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.macro-top strong {
  color: var(--ink);
  font-size: 13px;
}

.macro-desc {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.macro-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.steps-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.step-row select,
.step-row input {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--ink);
  background: var(--input-bg);
  font-size: 12px;
  min-width: 0;
}

.step-fields {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.step-fields input,
.step-fields select {
  flex: 1 1 0;
}

.token-reveal {
  padding: 11px 12px;
  border: 1px solid var(--green-border);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
}

.id-audit-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.id-warnings {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.id-warnings:empty {
  display: none;
}

.id-warn-item {
  font-size: 11px;
  color: var(--amber-ink);
  line-height: 1.4;
}

.fp-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* =========================
   SINGLE DEVICE PLAYER
   ========================= */
.player {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--stage);
}

.player-stage {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 20px 14px;
  background: radial-gradient(circle at 50% 42%, var(--stage-glow) 0%, var(--stage) 72%);
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}

.device-frame {
  position: relative;
  flex: 0 0 auto;
  width: 280px;
  height: 590px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  background: #050608;
  box-shadow:
    0 26px 68px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.device-screen {
  position: absolute;
  inset: 6px;
  overflow: hidden;
  border-radius: 20px;
  background: #030406;
  outline: none;
  touch-action: none;
  user-select: none;
  cursor: default !important;
}

.device-screen > div,
.device-screen canvas {
  border-radius: 20px;
  cursor: default !important;
}

.player-stage:fullscreen {
  width: 100vw;
  height: 100dvh;
  padding: 18px;
  background: #030406;
}

.console-overlay {
  position: absolute;
  inset: 6px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 20px;
  border-radius: 20px;
  color: #f1f5f9;
  background: #0e1118;
  text-align: center;
  font-size: 12px;
}

.console-overlay strong {
  font-size: 13.5px;
  font-weight: 600;
}

.console-overlay span:not(.loader) {
  color: #8b96aa;
}

.loader {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.nav-keys {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(16, 19, 27, 0.85);
}

.nav-keys button {
  width: 44px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #94a3b8;
  background: transparent;
}

.nav-keys button:not(:disabled):hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* WIDGET PANEL & RAIL */
.widget-panel {
  flex: 0 0 336px;
  width: 336px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.wp-head {
  flex: 0 0 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--border);
}

.wp-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.wp-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px;
  overflow-y: auto;
}

.wp-body > section {
  display: none;
}

.wp-body > section.active {
  display: block;
}

.wp-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wp-sub em {
  font-style: normal;
  margin-left: 4px;
  color: var(--faint);
  font-family: var(--font-mono);
}

.wp-help {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.widget-rail {
  flex: 0 0 48px;
  width: 48px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  scrollbar-width: none;
}

.widget-rail::-webkit-scrollbar {
  display: none;
}

.rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
  padding: 4px 0;
}

.rail-group + .rail-group {
  border-top: 1px solid var(--border);
}

.rail-btn {
  width: 34px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.rail-btn:not(:disabled):hover {
  color: var(--ink);
  background: var(--surface-2);
}

.rail-btn.active {
  border-color: var(--accent-border);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* FORMS & SHARED */
.kv {
  margin: 0;
}

.kv > div {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.kv > div:first-child {
  border-top: 0;
}

.kv dt {
  color: var(--muted);
  font-size: 12px;
}

.kv dd {
  margin: 0;
  overflow: hidden;
  max-width: 190px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}

.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 19px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background 0.15s ease;
}

.switch i::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  content: "";
  transition: transform 0.15s ease;
}

.switch input:checked + i {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + i::after {
  transform: translateX(15px);
}

textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--input-bg);
  font-size: 12.5px;
  resize: vertical;
}

textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.check input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  margin: 0;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.chip {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 500;
}

.chip:not(:disabled):hover {
  border-color: var(--accent-border);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.field {
  display: block;
  min-width: 0;
}

.field > span,
.field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  height: 35px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--input-bg);
  font-size: 12.5px;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  outline: none;
}

input[type="range"] {
  width: 100%;
  margin: 8px 0 2px;
  accent-color: var(--accent);
}

.dropzone {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--input-bg);
  cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone strong,
.dropzone small {
  display: block;
  overflow: hidden;
  max-width: 230px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone strong {
  color: var(--ink);
  font-size: 12.5px;
}

.dropzone small {
  color: var(--muted);
  font-size: 11.5px;
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cam-preview-wrap {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}

.cam-preview-img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  background: #0b0d12;
}

.cam-preview-meta {
  padding: 6px 10px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.cam-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.pkg-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pkg-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.pkg-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pkg-name {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pkg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pkg-actions button {
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface);
  font-size: 11px;
}

.pkg-actions button.danger {
  color: var(--red-ink);
  border-color: var(--red-border);
  background: var(--red-soft);
}

.shell-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.shell-row > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
}

.shell-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--input-bg);
  font-family: var(--font-mono);
  font-size: 12px;
}

.term {
  margin: 0 0 8px;
  padding: 10px 11px;
  min-height: 140px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--term-ink);
  background: var(--term-bg);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.term.tall {
  min-height: 260px;
  max-height: calc(100dvh - 210px);
}

/* CONTEXT MENU */
.menu {
  position: fixed;
  z-index: 80;
  min-width: 192px;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

.menu button {
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font-size: 12.5px;
  text-align: left;
}

.menu button:not(:disabled):hover {
  background: var(--surface-2);
}

.menu button.danger {
  color: var(--red-ink);
}

.menu button.danger:not(:disabled):hover {
  background: var(--red-soft);
}

.menu hr {
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* MODALS (ZERO OVERFLOW SCROLL) */
.modal {
  width: min(calc(100vw - 32px), 440px);
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

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

.modal::backdrop {
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(2px);
}

.modal-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
}

.modal-head {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.modal-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid.cols-create-top {
  grid-template-columns: 1.6fr 1fr 0.7fr;
}

.form-grid.hw {
  grid-template-columns: 1.3fr 1.6fr 0.65fr 0.75fr 0.85fr;
}

.span-2 {
  grid-column: span 2;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
}

.option:has(input:checked) {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.option input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.option strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.form-message {
  margin: 6px 0 0;
  color: var(--green-ink);
  font-size: 12px;
}

.form-message:empty {
  display: none;
}

.form-message.error {
  color: var(--red-ink);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-size: 12.5px;
  font-weight: 500;
}

.toast.error {
  border-color: var(--red-border);
  color: var(--red-ink);
  background: var(--red-soft);
}

@media (hover: hover) and (pointer: fine) {
  button,
  .dropzone,
  .option,
  .toggle-row {
    cursor: pointer;
  }
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1160px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .wall-master {
    flex: 0 0 280px;
    width: 280px;
  }
}

@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.18s ease;
    box-shadow: var(--shadow-pop);
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: var(--sidebar-w);
    padding: 12px 10px 10px;
    border-right: 1px solid var(--border);
  }

  .two-col,
  .macros-split {
    grid-template-columns: 1fr;
  }

  .wall-workspace {
    flex-direction: column;
  }

  .wall-master {
    flex: 0 0 auto;
    width: 100%;
    height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .widget-panel {
    position: fixed;
    top: 54px;
    right: 48px;
    bottom: 0;
    z-index: 30;
    width: min(320px, calc(100vw - 56px));
    box-shadow: var(--shadow-pop);
  }
}

@media (max-width: 640px) {
  .vh-meta,
  .conn,
  .wall-controls .segmented {
    display: none;
  }

  .view-body {
    padding: 12px;
  }

  .form-grid,
  .form-grid.cols-create-top,
  .form-grid.hw,
  .options {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}

/* Remote audio toggle */
.audio-btn[aria-pressed="true"] {
  border-color: var(--accent-border);
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.audio-btn.connecting svg {
  animation: audio-pulse 1s ease-in-out infinite;
}
@keyframes audio-pulse {
  50% { opacity: 0.35; }
}
@media (max-width: 720px) {
  .audio-btn span { display: none; }
}

/* ==========================================================================
   ENTERPRISE REFRESH — palette, accents, density, settings, wall keyboard
   ========================================================================== */
:root {
  --bg: #0b0d12;
  --stage: #07090d;
  --surface: #111319;
  --surface-2: #171a22;
  --surface-3: #1e222c;
  --input-bg: #0d0f14;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --ink: #f5f7fa;
  --text: #c9d1dc;
  --muted: #8a94a6;
  --faint: #5b6577;
  --radius: 10px;
  --radius-sm: 7px;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  --row-h: 44px;
}
:root[data-theme="light"] {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f5;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --ink: #101828;
  --text: #344054;
  --muted: #667085;
  --faint: #98a2b3;
}

/* Accent system: one hue, derived tints for both themes */
:root[data-accent="blue"] { --accent: #2f6fed; --accent-hover: #2459c9; }
:root[data-accent="indigo"] { --accent: #5b5bd6; --accent-hover: #4848c0; }
:root[data-accent="teal"] { --accent: #0e9aa7; --accent-hover: #0b7f8a; }
:root[data-accent="emerald"] { --accent: #12a150; --accent-hover: #0e8442; }
:root[data-accent="orange"] { --accent: #e5701b; --accent-hover: #c65d12; }
:root[data-accent="rose"] { --accent: #e0405e; --accent-hover: #c22f4c; }
:root[data-accent] {
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-border: color-mix(in srgb, var(--accent) 38%, transparent);
  --accent-ink: color-mix(in srgb, var(--accent) 55%, white);
}
:root[data-theme="light"][data-accent] {
  --accent-soft: color-mix(in srgb, var(--accent) 9%, white);
  --accent-border: color-mix(in srgb, var(--accent) 32%, white);
  --accent-ink: color-mix(in srgb, var(--accent) 80%, black);
}

/* Density */
:root[data-density="compact"] { --row-h: 36px; }
:root[data-density="compact"] body { font-size: 12.5px; }
:root[data-density="compact"] .view-head { flex-basis: 48px; min-height: 48px; }
:root[data-density="compact"] .sb-item { height: 29px; }
:root[data-density="compact"] .metric { padding: 11px 13px; }
:root[data-density="compact"] .view-body { gap: 12px; }

/* Consistent keyboard focus across the app */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Header title with breadcrumb/subtitle */
.vh-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.vh-crumb { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sidebar footer: settings + account card */
.sb-foot .sb-item[data-nav="settings"]:hover { color: var(--ink); background: var(--row-hover); }
.sb-foot .sb-item[data-nav="settings"].active { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-border); }
.sb-user {
  display: flex; align-items: center; gap: 9px;
  margin-top: 6px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.sb-avatar {
  flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #7c3aed));
}
.sb-user-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.sb-user-meta strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.sb-user-meta span { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-logout:hover { color: var(--red-ink) !important; background: var(--red-soft) !important; }
.app-shell.sidebar-collapsed .sb-user-meta { display: none; }

/* Settings layout */
.settings-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px;
  align-items: start; max-width: 1180px; width: 100%;
}
.settings-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-tab {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text); background: transparent; font: inherit; font-weight: 500; text-align: left; cursor: pointer;
}
.settings-tab svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.settings-tab:hover { background: var(--row-hover); color: var(--ink); }
.settings-tab.active { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-border); }
.settings-tab.active svg { color: currentColor; }
.settings-content { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.settings-pane { display: flex; flex-direction: column; gap: 16px; }
.settings-pane[hidden] { display: none; }
.settings-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden;
}
.sc-head { padding: 16px 20px 0; }
.sc-head h2 { margin: 0 0 4px; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.sc-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.sc-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sc-tools { display: flex; gap: 8px; align-items: center; }
.sc-tools input { height: 32px; min-width: 200px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--ink); background: var(--input-bg); font: inherit; }
.sc-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 20px; }
.sc-row { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sc-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; margin-top: 2px; border-top: 1px solid var(--border); }
.sc-body .field { max-width: 460px; }
.sc-body .hint { display: block; margin-top: 4px; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.field-grid .field { max-width: none; }
.form-msg { margin: 0; min-height: 18px; font-size: 12.5px; color: var(--muted); }
.form-msg.error { color: var(--red-ink); }
.form-msg.ok { color: var(--green-ink); }

.pw-meter { display: block; height: 4px; margin-top: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--red); transition: width 0.2s ease, background 0.2s ease; }
.pw-meter span[data-score="2"] { background: var(--amber); }
.pw-meter span[data-score="3"], .pw-meter span[data-score="4"] { background: var(--green); }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 160px)); gap: 12px; }
.choice {
  display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  color: var(--text); background: var(--surface-2); font: inherit; cursor: pointer; text-align: left;
}
.choice strong { color: var(--ink); font-weight: 500; }
.choice.active { border-color: var(--accent); box-shadow: var(--focus-ring); }
.swatch { display: block; height: 64px; border-radius: 6px; border: 1px solid var(--border); }
.sw-light { background: linear-gradient(180deg, #fff 0 30%, #eef1f5 30% 100%); }
.sw-dark { background: linear-gradient(180deg, #171a22 0 30%, #0b0d12 30% 100%); }
.sw-system { background: linear-gradient(90deg, #fff 0 50%, #0b0d12 50% 100%); }

.accent-row { display: flex; gap: 12px; flex-wrap: wrap; }
.accent-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); cursor: pointer; box-shadow: 0 0 0 1px var(--border-strong); }
.accent-dot.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }
.accent-dot[data-accent="blue"] { background: #2f6fed; color: #2f6fed; }
.accent-dot[data-accent="indigo"] { background: #5b5bd6; color: #5b5bd6; }
.accent-dot[data-accent="teal"] { background: #0e9aa7; color: #0e9aa7; }
.accent-dot[data-accent="emerald"] { background: #12a150; color: #12a150; }
.accent-dot[data-accent="orange"] { background: #e5701b; color: #e5701b; }
.accent-dot[data-accent="rose"] { background: #e0405e; color: #e0405e; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; }
.switch-row strong { display: block; color: var(--ink); font-weight: 500; }
.switch { appearance: none; flex: 0 0 38px; width: 38px; height: 22px; border-radius: 22px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background 0.15s ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform 0.15s ease; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(16px); }

.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { position: sticky; top: 0; height: 36px; padding: 0 16px; text-align: left; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.data-table td { height: var(--row-h); padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.data-table tbody tr:hover td { background: var(--row-hover); }
.audit-table .table-wrap, .settings-card .table-wrap { max-height: 60vh; overflow: auto; }
.ev-name { color: var(--ink); font-weight: 500; }
.ev-code { margin-left: 8px; color: var(--faint); font-family: var(--font-mono); font-size: 11px; }
.mono { font-family: var(--font-mono); font-size: 11.5px; }
.status-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 22px; font-size: 11px; font-weight: 600; }
.status-pill.ok { color: var(--green-ink); background: var(--green-soft); }
.status-pill.fail { color: var(--red-ink); background: var(--red-soft); }

.kv-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); margin: 0; padding: 8px 20px 18px; }
.kv-grid dt, .kv-grid dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv-grid dt { color: var(--muted); }
.kv-grid dd { color: var(--ink); }
.kv-grid > :nth-last-child(-n + 2) { border-bottom: 0; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--ink); background: var(--surface-2); font: 600 11px var(--font-mono); text-align: center; }

.sc-row .hint { display: inline; margin-top: 0; }
.settings-layout { align-content: start; }

@media (max-width: 860px) {
  .settings-layout { display: flex; flex-direction: column; gap: 14px; }
  .settings-nav { position: static; flex: 0 0 auto; flex-direction: row; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .settings-content { flex: 0 0 auto; }
  .settings-tab { flex: 0 0 auto; }
  .field-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kv-grid { grid-template-columns: 130px minmax(0, 1fr); }
  .sc-tools { width: 100%; }
  .sc-tools input { flex: 1; min-width: 0; }
}

/* Control Wall: keyboard focus indicator on the master screen */
.sync-capture-layer:focus { outline: none; }
.wall-master-frame.kbd-active { box-shadow: none; }

/* Command palette */
.sb-cmdk {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; margin: 8px 0 2px; padding: 0 9px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  color: var(--muted); background: transparent; font: inherit; font-size: 12.5px; cursor: pointer;
}
.sb-cmdk svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sb-cmdk span { flex: 1; text-align: left; }
.sb-cmdk:hover { color: var(--ink); border-color: var(--accent-border); background: var(--accent-soft); }
.app-shell.sidebar-collapsed .sb-cmdk span, .app-shell.sidebar-collapsed .sb-cmdk kbd { display: none; }
.cmdk-backdrop { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(5, 8, 14, 0.55); backdrop-filter: blur(3px); }
.cmdk-backdrop[hidden] { display: none; }
.cmdk { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-pop); }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.cmdk-input svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.cmdk-input input { flex: 1; height: 50px; border: 0; outline: none; color: var(--ink); background: transparent; font: inherit; font-size: 14px; box-shadow: none !important; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-group { padding: 8px 10px 4px; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.cmdk-item { width: 100%; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--text); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.cmdk-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.cmdk-item span { flex: 1; color: var(--ink); }
.cmdk-item small { color: var(--muted); font-size: 11.5px; }
.cmdk-item.active, .cmdk-item:hover { background: var(--accent-soft); }
.cmdk-item.active svg { color: var(--accent-ink); }
.cmdk-empty { padding: 24px; color: var(--muted); text-align: center; }
.cmdk-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.cmdk-foot kbd { margin-right: 3px; }

/* ==========================================================================
   DESIGN SYSTEM v2 — calm neutral scale, one accent, flat surfaces
   (Overrides earlier layers; keep this block last.)
   ========================================================================== */
:root,
:root[data-theme="dark"] {
  --bg: #111113;
  --sidebar-bg: #0e0e10;
  --surface: #18191b;
  --surface-2: #1f2023;
  --surface-3: #27282c;
  --input-bg: #111113;
  --border: #2a2b2f;
  --border-strong: #3a3b40;
  --row-hover: #1d1e21;
  --ink: #ededef;
  --text: #c6c7cc;
  --muted: #8b8d94;
  --faint: #62646b;
  --stage: #0b0b0c;
  --stage-glow: #0b0b0c;
  --shadow-card: none;
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px #2a2b2f;
  --green: #30a46c; --green-ink: #4cc38a; --green-soft: rgba(48, 164, 108, 0.14); --green-border: rgba(48, 164, 108, 0.3);
  --amber: #f1a10d; --amber-ink: #ffca16; --amber-soft: rgba(241, 161, 13, 0.13); --amber-border: rgba(241, 161, 13, 0.3);
  --red: #e5484d; --red-hover: #dc3e42; --red-ink: #ff9592; --red-soft: rgba(229, 72, 77, 0.13); --red-border: rgba(229, 72, 77, 0.32);
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2 6.7 11 12 5.2' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme="light"] {
  --bg: #fbfbfc;
  --sidebar-bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #f9f9fa;
  --surface-3: #f0f0f2;
  --input-bg: #ffffff;
  --border: #e6e6e9;
  --border-strong: #d6d6da;
  --row-hover: #f7f7f8;
  --ink: #1c2024;
  --text: #3d4048;
  --muted: #696e77;
  --faint: #9a9da4;
  --stage: #eeeef0;
  --stage-glow: #eeeef0;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.12), 0 0 0 1px #e6e6e9;
  --green: #218358; --green-ink: #18794e; --green-soft: #e6f6eb; --green-border: #b2ddc5;
  --amber: #b77400; --amber-ink: #ab6400; --amber-soft: #fff4d5; --amber-border: #f3d673;
  --red: #dc3e42; --red-hover: #ce2c31; --red-ink: #ce2c31; --red-soft: #feebec; --red-border: #fdbdbe;
}
:root:not([data-accent]), :root[data-accent="blue"] { --accent: #3e63dd; --accent-hover: #3358d4; }

body { font-size: 13px; letter-spacing: -0.003em; font-feature-settings: "cv11", "ss01", "tnum"; }

/* Shell */
.sidebar { background: var(--sidebar-bg); border-right-color: var(--border); }
.view-head { background: var(--bg); border-bottom-color: var(--border); }
.view-head h1 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.view-body { background: var(--bg); }
.sb-brand span { font-weight: 600; letter-spacing: -0.015em; }
.sb-item { color: var(--text); font-weight: 500; }
.sb-item svg { color: var(--muted); }
.sb-item:not(.active):hover { background: var(--surface-3); color: var(--ink); }
.sb-item.active { color: var(--ink); background: var(--surface-3); border-color: transparent; box-shadow: none; }
.sb-item.active svg { color: var(--ink); }
.sb-count, .sb-count.live { min-width: 0; height: auto; padding: 0; border: 0; background: none; color: var(--faint); font-size: 11.5px; font-weight: 500; }
.sb-count.live { color: var(--green-ink); }
.sb-vm { color: var(--text); }
.sb-vm:hover { background: var(--surface-3); }
.sb-vm.active { color: var(--ink); background: var(--surface-3); border-color: transparent; box-shadow: none; }
.sb-vm-port { color: var(--faint); font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.sb-section span, .sb-section > span { color: var(--faint); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.sb-search { border-color: var(--border); background: var(--surface); }
.sb-foot .sb-item[data-nav="settings"].active { color: var(--ink); background: var(--surface-3); border-color: transparent; }
.sb-user { background: transparent; border-color: transparent; padding: 6px 4px; }
.sb-avatar { background: var(--surface-3); color: var(--ink); border: 1px solid var(--border-strong); }

/* Buttons */
.btn { height: 32px; border-color: var(--border-strong); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.btn:not(:disabled):hover { border-color: var(--border-strong); background: var(--surface-3); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: none; }
.btn.primary:not(:disabled):hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn.danger-outline { background: var(--surface); }
.icon-btn { border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn:not(:disabled):hover { border-color: transparent; background: var(--surface-3); color: var(--ink); }

/* Inputs */
.field input, .field select, input[type="text"], input[type="search"], input[type="password"], input[type="number"], select, textarea {
  border-color: var(--border-strong);
  background-color: var(--input-bg);
}

/* Checkbox — custom, same in both themes */
input[type="checkbox"]:not(.switch) {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface) center / 14px 14px no-repeat;
  cursor: pointer;
  vertical-align: middle;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}
input[type="checkbox"]:not(.switch):hover { border-color: var(--muted); }
input[type="checkbox"]:not(.switch):checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: var(--check);
}
input[type="checkbox"]:not(.switch):indeterminate {
  border-color: var(--accent);
  background: var(--accent) linear-gradient(#fff, #fff) center / 8px 2px no-repeat;
}
input[type="checkbox"]:not(.switch):disabled { opacity: 0.45; cursor: not-allowed; }

/* Badges — sentence case, quiet */
.tag {
  height: 20px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  color: var(--text);
  background: var(--surface-3);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
.tag.accent { color: var(--accent-ink); background: var(--accent-soft); border: 0; }
.tag.green { color: var(--green-ink); background: var(--green-soft); border: 0; }
.group-label { color: var(--muted); font-size: 12.5px; }

/* Status — dot + label, no outline */
.status-badge { height: 22px; padding: 0 8px; border: 0; border-radius: 5px; font-size: 12px; background: var(--surface-3); color: var(--muted); }
.status-badge.running { border: 0; color: var(--green-ink); background: var(--green-soft); }
.status-badge.starting { border: 0; color: var(--amber-ink); background: var(--amber-soft); }
.status-badge.error { border: 0; color: var(--red-ink); background: var(--red-soft); }

/* Cards, metrics, panels */
.metric, .fleet-panel, .settings-card { border-color: var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-card); }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.metric-value strong { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.metric-ico { color: var(--faint); }
.fleet-toolbar { border-bottom-color: var(--border); }

/* Tables */
.table th, .data-table th {
  height: 36px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 1px solid var(--border);
}
.table td { border-bottom-color: var(--border); }
.table tbody tr:hover td { background: var(--row-hover); }
.adb-btn { border-color: var(--border) !important; background: var(--surface-2) !important; color: var(--text) !important; font-size: 11.5px; }

/* Segmented controls never wrap */
.segmented { background: var(--surface-3); border-color: transparent; }
.segmented button { white-space: nowrap; color: var(--muted); }
.segmented button.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border); }

/* Device stages: light in light mode, flat in dark mode */
.player-stage, .wm-stage { background: var(--stage); }
:root[data-theme="light"] .device-frame { border-color: #d6d6da; background: #0b0b0c; box-shadow: 0 20px 48px rgba(16, 24, 40, 0.16), 0 0 0 6px #ffffff, 0 0 0 7px #e6e6e9; }
:root[data-theme="dark"] .device-frame { border-color: #2a2b2f; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.wt-screen-box { background: var(--stage); }
.wt-state { color: var(--muted); background: var(--surface-2); }
.wall-tile { border-color: var(--border); border-radius: 8px; box-shadow: var(--shadow-card); }
.wall-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wt-head { border-bottom: 1px solid var(--border); background: var(--surface); }

/* Keyboard hints */
kbd { border-color: var(--border-strong); border-bottom-width: 1px; background: var(--surface); color: var(--muted); font: 500 10.5px var(--font-sans); }

/* Settings polish */
.settings-tab.active { color: var(--ink); background: var(--surface-3); border-color: transparent; }
.settings-tab.active svg { color: var(--ink); }
.choice.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.switch-row { background: transparent; }
.status-pill.ok { border-radius: 5px; }
.status-pill.fail { border-radius: 5px; }
.data-table th { text-transform: none; letter-spacing: 0; font-size: 12px; }

/* Toasts */
.toast { border: 1px solid var(--border); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); }

/* v2 refinements */
.os-sub, .spec-primary { font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.os-sub, .spec-sub { font-size: 12px; }
.spec-primary { font-size: 13px; }
.vm-avatar, .vm-avatar.running, .vm-avatar.starting, .vm-avatar.error {
  border: 1px solid var(--border); color: var(--muted); background: var(--surface-2);
}
.nav-keys { border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); }
.nav-keys button { color: var(--muted); }
.nav-keys button:not(:disabled):hover { color: var(--ink); background: var(--surface-3); }
.wt-state .btn.primary { border-color: var(--border-strong); background: var(--surface); color: var(--ink); }
.wt-state .btn.primary:not(:disabled):hover { background: var(--surface-3); border-color: var(--border-strong); }
.wt-state .status-badge { background: transparent; }

/* ==========================================================================
   CLOUD CONSOLE SHELL — global top bar, grouped navigation, breadcrumbs
   ========================================================================== */
:root { --topbar-h: 48px; --topbar-bg: #0f1724; --topbar-ink: #e6ebf2; --topbar-muted: #9aa6b8; --topbar-hover: rgba(255, 255, 255, 0.08); --topbar-border: rgba(255, 255, 255, 0.08); }
:root[data-theme="light"] { --bg: #f3f4f6; --sidebar-bg: #ffffff; --stage: #e9eaee; --stage-glow: #e9eaee; }
:root[data-theme="dark"] { --bg: #0e0f11; --sidebar-bg: #131416; }

.app-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  height: 100dvh;
}
.app-shell > .backdrop { grid-column: 1 / -1; }
.topbar { grid-column: 1 / -1; grid-row: 1; }
.sidebar { grid-column: 1; grid-row: 2; height: auto; min-height: 0; padding-top: 12px; }
.workspace { grid-column: 2; grid-row: 2; height: auto; min-height: 0; }

.topbar {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--topbar-h);
  padding: 0 12px 0 8px;
  color: var(--topbar-ink);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
}
.topbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-icon {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 6px; color: var(--topbar-muted); background: transparent; cursor: pointer;
}
.tb-icon:hover { color: #fff; background: var(--topbar-hover); }
.tb-brand {
  display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 8px 0 4px;
  border: 0; border-radius: 6px; color: #fff; background: transparent; cursor: pointer; white-space: nowrap;
}
.tb-brand:hover { background: var(--topbar-hover); }
.tb-brand img { width: 26px; height: 26px; border-radius: 6px; }
.tb-wordmark { font-size: 14.5px; font-weight: 650; letter-spacing: -0.02em; }
.tb-product { color: var(--topbar-muted); font-size: 14px; font-weight: 400; }
.tb-divider { width: 1px; height: 22px; margin: 0 6px; background: var(--topbar-border); }
.tb-workspace {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; max-width: 220px; padding: 0 10px;
  border: 1px solid var(--topbar-border); border-radius: 6px; color: var(--topbar-ink); background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tb-workspace span { overflow: hidden; text-overflow: ellipsis; }
.tb-workspace svg { width: 15px; height: 15px; color: var(--topbar-muted); }
.tb-workspace:hover { background: var(--topbar-hover); }
.tb-search {
  flex: 0 1 460px; display: flex; align-items: center; gap: 9px; height: 32px; margin-left: 10px; padding: 0 8px 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 6px; color: var(--topbar-muted); background: rgba(255, 255, 255, 0.06);
  font-size: 12.5px; cursor: pointer; text-align: left;
}
.tb-search svg { width: 15px; height: 15px; }
.tb-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-search:hover { border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.09); color: var(--topbar-ink); }
.tb-search kbd { border-color: rgba(255, 255, 255, 0.18); background: transparent; color: var(--topbar-muted); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tb-health {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; margin-right: 6px; padding: 0 10px;
  border-radius: 14px; color: var(--topbar-ink); background: rgba(255, 255, 255, 0.06); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.tb-health-label { color: var(--topbar-muted); font-weight: 400; }
.tb-health-dot { width: 7px; height: 7px; border-radius: 50%; background: #3fb950; box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.2); }
.tb-user-wrap { position: relative; }
.tb-user { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.tb-user:hover { background: var(--topbar-hover); }
.tb-avatar {
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  color: #fff; background: var(--accent); font-size: 12px; font-weight: 600;
}
.tb-avatar.lg { width: 34px; height: 34px; font-size: 14px; }
.tb-menu-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 80; width: 248px; padding: 6px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); box-shadow: var(--shadow-pop);
}
.tb-menu-pop[hidden] { display: none; }
.tb-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.tb-menu-head strong { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.tb-menu-head small { display: block; color: var(--muted); font-size: 12px; }
.tb-menu-pop button {
  width: 100%; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px;
  border: 0; border-radius: 6px; color: var(--text); background: transparent; font-size: 13px; text-align: left; cursor: pointer;
}
.tb-menu-pop button svg { width: 16px; height: 16px; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-menu-pop button:hover { color: var(--ink); background: var(--surface-3); }
.tb-menu-pop button.danger:hover { color: var(--red-ink); background: var(--red-soft); }
.tb-menu-pop button.danger:hover svg { color: currentColor; }
.tb-menu-sep { height: 1px; margin: 4px 2px; background: var(--border); }

/* Sidebar — grouped like a cloud console */
.sb-group {
  margin: 14px 10px 4px; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.sb-nav .sb-group:first-child { margin-top: 2px; }
.sb-nav { margin-bottom: 8px; }
.sidebar .sb-search { margin-top: 4px; }
.sb-item.active { position: relative; color: var(--accent-ink); background: var(--accent-soft); }
:root[data-theme="light"] .sb-item.active { color: var(--accent); }
.sb-item.active svg { color: currentColor; }
.sb-item.active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.app-shell.sidebar-collapsed .sb-group { display: none; }

/* Page header with breadcrumbs */
.view-head { flex-basis: auto; min-height: 64px; padding: 10px 24px; background: var(--surface); }
.vh-left.has-crumbs { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; }
.vh-left.has-crumbs > :not(.vh-crumbs) { max-width: 100%; }
.vh-crumbs { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; line-height: 1.2; white-space: nowrap; }
.vh-crumbs button { padding: 0; border: 0; color: var(--accent); background: none; font: inherit; cursor: pointer; }
.vh-crumbs button:hover { text-decoration: underline; }
.vh-crumbs [aria-current] { color: var(--text); }
.crumb-sep { width: 12px; height: 12px; fill: none; stroke: var(--faint); stroke-width: 2; }
.view-head h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.vh-left.has-crumbs .vh-title h1 { font-size: 18px; }
.vh-left.has-crumbs .vh-crumb { display: none; }
.view-body { padding: 20px 24px 28px; }

/* Detail header packs name + meta on one line under the crumbs */
#detail-view .vh-left.has-crumbs { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 2px; }
#detail-view .vh-left.has-crumbs .vh-crumbs { flex: 0 0 100%; }
#detail-view .view-head h1 { font-size: 17px; }

/* Containers like cloud consoles: white panels on gray canvas */
:root[data-theme="light"] .metric,
:root[data-theme="light"] .fleet-panel,
:root[data-theme="light"] .settings-card,
:root[data-theme="light"] .wall-tile { border-color: #e3e5e8; box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04); }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .workspace { grid-column: 1; }
  .sidebar { top: var(--topbar-h); inset: var(--topbar-h) auto 0 0; height: auto; }
  .tb-product, .tb-divider, .tb-workspace, .tb-health-label { display: none; }
  .tb-search { flex: 1 1 auto; margin-left: 4px; }
  .tb-search span, .tb-search kbd { display: none; }
  .tb-search { flex: 0 0 34px; width: 34px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .tb-right { margin-left: auto; }
  .view-head { padding: 10px 16px; }
  .view-body { padding: 16px; }
}
@media (min-width: 961px) {
  .app-shell.sidebar-collapsed .sidebar { width: 0; padding: 0; border: 0; }
}
#detail-view .vh-left.has-crumbs { justify-content: flex-start; align-content: center; }

/* ==========================================================================
   MINIMAL — neutral top bar, quiet chrome
   ========================================================================== */
:root, :root[data-theme="dark"] {
  --topbar-bg: var(--sidebar-bg); --topbar-ink: var(--ink); --topbar-muted: var(--muted);
  --topbar-hover: var(--surface-3); --topbar-border: var(--border);
}
:root[data-theme="light"] { --topbar-bg: #ffffff; --topbar-ink: var(--ink); --topbar-muted: var(--muted); --topbar-hover: var(--surface-3); --topbar-border: var(--border); }
.topbar { gap: 4px; padding: 0 10px 0 8px; }
.tb-icon:hover, .tb-brand:hover, .tb-user:hover { color: var(--ink); }
.tb-brand { gap: 10px; color: var(--ink); }
.tb-brand img { width: 24px; height: 24px; border-radius: 6px; }
.tb-wordmark { font-size: 14px; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tb-search {
  flex: 0 1 300px; margin-left: 12px; height: 30px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--faint);
}
.tb-search:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--muted); }
.tb-search kbd { border-color: var(--border); color: var(--faint); }
.tb-health { margin-right: 2px; height: 26px; padding: 0 9px; background: transparent; border: 1px solid var(--border); color: var(--text); }
.tb-health-dot { box-shadow: none; width: 6px; height: 6px; background: var(--green, #2da44e); }
.tb-avatar { width: 26px; height: 26px; background: var(--surface-3); color: var(--ink); border: 1px solid var(--border); }
.tb-icon { position: relative; width: 32px; height: 32px; }
.tb-bell-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 2px solid var(--topbar-bg); }
.tb-bell-dot[hidden] { display: none; }

/* Activity popover */
.tb-activity { width: 340px; padding: 0; }
.tb-act-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tb-act-head strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.tb-act-head button { width: auto !important; height: auto !important; padding: 0 !important; color: var(--accent) !important; background: none !important; font-size: 12px !important; }
.tb-act-list { max-height: 380px; overflow-y: auto; padding: 4px; }
.tb-act-list .tb-act-item { height: auto; align-items: flex-start; gap: 10px; padding: 9px 10px; }
.tb-act-item[disabled] { cursor: default; opacity: 1; }
.tb-act-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--faint); }
.tb-act-dot.green { background: #2da44e; } .tb-act-dot.red { background: #cf222e; } .tb-act-dot.amber { background: #bf8700; }
.tb-act-text { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.tb-act-text strong { color: var(--ink); font-weight: 600; }
.tb-act-text small { display: block; overflow: hidden; color: var(--red-ink); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.tb-act-item time { flex: 0 0 auto; color: var(--faint); font-size: 11.5px; line-height: 1.45; }
.tb-act-empty { margin: 0; padding: 28px 18px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* Sidebar: calmer groups, no active bar */
.sb-group { margin: 16px 10px 4px; color: var(--faint); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.sb-item.active { color: var(--ink) !important; background: var(--surface-3); }
.sb-item.active::before { display: none; }

/* Page header: lighter */
.view-head { min-height: 60px; }
.vh-crumbs { font-size: 12px; }
.vh-crumbs button { color: var(--muted); }
.vh-crumbs button:hover { color: var(--ink); }
.vh-crumbs > span:first-child, .vh-crumbs > span:first-child + .crumb-sep { display: none; }

/* Shortcuts sheet */
.cmdk.sheet { width: min(420px, calc(100vw - 32px)); padding: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.sheet-head strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.sheet-list { margin: 0; padding: 8px 14px 14px; }
.sheet-list div { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sheet-list div:last-child { border-bottom: 0; }
.sheet-list dt { display: flex; gap: 4px; }
.sheet-list dd { margin: 0; color: var(--text); font-size: 13px; }

@media (max-width: 960px) {
  .tb-wordmark { display: none; }
  .tb-activity { position: fixed; top: calc(var(--topbar-h) + 6px); left: 12px; right: 12px; width: auto; }
}

/* Minimal pass: templates, macros, cluster */
#token-name { font-family: var(--font-sans); }
.macro-card { border-color: var(--border); background: var(--surface); box-shadow: none; }
.macro-card:hover { border-color: var(--border-strong); }
.fleet-panel h2, .panel-head h2, .settings-card h2 { font-weight: 600; letter-spacing: -0.01em; }
:root[data-theme="light"] .term { color: #24292f; background: #f6f8fa; border: 1px solid var(--border); }
:root[data-theme="light"] .term code { color: inherit; }

/* Search — centered console search field */
.tb-brand { flex: 0 0 auto; }
.tb-search {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 560px)); min-width: 280px; height: 34px; margin: 0; padding: 0 6px 0 12px; gap: 10px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  color: var(--muted); background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  font-size: 13px; transition: border-color .12s, box-shadow .12s;
}
:root[data-theme="light"] .tb-search { background: #f7f8fa; border-color: #dfe1e6; }
:root[data-theme="dark"] .tb-search { background: var(--surface-2); }
.tb-search:hover { color: var(--text); border-color: var(--faint); background: var(--surface); }
.tb-search:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tb-search svg { width: 16px; height: 16px; color: var(--faint); }
.tb-search span { color: var(--faint); font-weight: 400; }
.tb-search kbd {
  min-width: 22px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface);
  color: var(--muted); font-family: var(--font-sans); font-size: 11px; font-weight: 500; line-height: 1;
}
.tb-search kbd + kbd { margin-left: -6px; }
@media (max-width: 1100px) {
  .tb-search { position: static; transform: none; flex: 1 1 auto; width: auto; max-width: 420px; margin-left: 16px; }
}
@media (max-width: 960px) {
  .tb-search { flex: 0 0 34px; width: 34px; min-width: 0; padding: 0; justify-content: center; border: 0; background: transparent !important; box-shadow: none; }
}

/* Search — left-aligned, compact (overrides centered version) */
.tb-search {
  position: static; transform: none; flex: 0 1 280px; width: auto; min-width: 0;
  height: 30px; margin-left: 14px; padding: 0 5px 0 10px; gap: 8px; border-radius: 6px; box-shadow: none;
}
:root[data-theme="light"] .tb-search { background: #f4f5f7; border-color: #e4e6ea; }
:root[data-theme="dark"] .tb-search { background: var(--surface-2); border-color: var(--border); }
.tb-search:hover { border-color: var(--border-strong); }
.tb-search svg { width: 15px; height: 15px; }
.tb-search kbd { height: 18px; min-width: 18px; font-size: 10.5px; }
.tb-search kbd + kbd { margin-left: -4px; }
.tb-brand img { border-radius: 6px; }
@media (max-width: 960px) {
  .tb-search { flex: 0 0 34px; width: 34px; margin-left: 4px; padding: 0; justify-content: center; border: 0; background: transparent !important; }
}

/* Monoline logo — inherits text color, matches the icon set */
.tb-logo { width: 22px !important; height: 22px !important; color: var(--ink); stroke-width: 1.8 !important; }
.tb-brand { gap: 8px; }
.login-logo { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--ink); }
.login-emblem { box-shadow: none; border-color: var(--border); }
@media (max-width: 960px) { .tb-search span, .tb-search kbd { display: none !important; } }

/* ==========================================================================
   NETWORK & VPN
   ========================================================================== */
.tag.vpn { color: var(--green-ink, #1a7f37); background: var(--green-soft, rgba(45, 164, 78, 0.12)); border: 0; }
:root[data-theme="dark"] .tag.vpn { color: #57d27a; background: rgba(63, 185, 80, 0.14); }
.vpn-warning { margin: 0 0 12px; padding: 10px 12px; border-radius: 6px; color: var(--red-ink); background: var(--red-soft); font-size: 13px; }
.vpn-list { display: flex; flex-direction: column; }
.vpn-empty { display: flex; flex-direction: column; gap: 4px; padding: 28px 16px; border: 1px dashed var(--border-strong); border-radius: 8px; text-align: center; }
.vpn-empty strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.vpn-empty span { color: var(--muted); font-size: 12.5px; }
.vpn-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.vpn-row:first-child { border-top: 0; padding-top: 4px; }
.vpn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.vpn-title { display: flex; align-items: center; gap: 8px; }
.vpn-title strong { color: var(--ink); font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpn-state { color: var(--muted); font-size: 12px; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status-dot.green { background: #2da44e; }
.status-dot.amber { background: #d29922; animation: vpn-pulse 1.2s ease-in-out infinite; }
.status-dot.red { background: #cf222e; }
@keyframes vpn-pulse { 50% { opacity: 0.35; } }
.vpn-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.vpn-meta b { color: var(--ink); font-weight: 600; }
.vpn-devices { color: var(--faint); font-size: 12px; }
.vpn-log { margin: 4px 0 0; padding: 8px 10px; max-height: 80px; overflow: auto; border-radius: 6px; color: var(--muted); background: var(--surface-2); font-size: 11px; white-space: pre-wrap; word-break: break-all; }
.vpn-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.vpn-add { margin-bottom: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.vpn-add form { display: flex; flex-direction: column; gap: 12px; }
.vpn-add textarea { min-height: 96px; font-family: var(--font-mono); font-size: 11.5px; resize: vertical; }
.vpn-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px;
  border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 13px; text-align: center;
  transition: border-color .12s, background .12s;
}
.vpn-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.vpn-drop svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--faint); }
.vpn-drop small { color: var(--faint); font-size: 12px; }
.vpn-file-btn { color: var(--accent); font-weight: 500; cursor: pointer; }
.vpn-file-btn:hover { text-decoration: underline; }
.vpn-add-foot { display: flex; justify-content: flex-end; gap: 8px; }
.form-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) {
  .vpn-row { flex-direction: column; gap: 10px; }
  .form-grid.two { grid-template-columns: 1fr; }
}

/* VPN enable/disable controls */
.vpn-row { padding-left: 2px; padding-right: 2px; }
.vpn-list { padding: 4px 20px 8px; }
.vpn-enable { display: inline-flex; align-items: center; gap: 8px; min-width: 104px; color: var(--text); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.vpn-cell { display: inline-flex; align-items: center; gap: 8px; max-width: 150px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.vpn-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpn-cell input:checked + span { color: var(--ink); font-weight: 500; }
input.switch.sm { transform: scale(0.82); transform-origin: left center; margin-right: -4px; }
.btn.vpn-toggle { color: var(--muted); }
.btn.vpn-toggle.on { color: var(--green-ink); border-color: color-mix(in srgb, var(--green-ink) 35%, transparent); background: var(--green-soft); }
.btn.vpn-toggle span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpn-cell { max-width: none; white-space: nowrap; gap: 6px; }
.vpn-page { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.vpn-page .settings-card { margin: 0; }
.vpn-page .vpn-add { margin: 0 20px 12px; }
.sb-count:empty { display: none; }
.os-primary, .spec-primary, .spec-sub, .status-badge, .group-label { white-space: nowrap; }
.vpn-page > * { flex-shrink: 0; }

/* GPS map picker (OpenStreetMap) */
.loc-search { position: relative; margin: 8px 0 6px; }
.loc-search svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.loc-search input { width: 100%; height: 34px; padding: 0 10px 0 32px; }
.loc-results { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.loc-results[hidden] { display: none; }
.loc-results .hint { margin: 0; padding: 10px 12px; }
.loc-result { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.loc-result:last-child { border-bottom: 0; }
.loc-result:hover { background: var(--surface-3); }
.loc-result strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.loc-result small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.loc-map { height: 260px; margin-bottom: 6px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); z-index: 0; }
.loc-map .map-error { padding: 16px; }
.loc-pick { margin: 0 0 10px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.loc-pick span { color: var(--ink); font-weight: 500; }
.loc-map .leaflet-control-attribution { font-size: 10px; }
:root[data-theme="dark"] .loc-map .leaflet-tile-pane { filter: brightness(0.82) contrast(1.05); }

/* ==========================================================================
   REFRESH 2026-11 — minimal login, dashboard UX, phone console
   ========================================================================== */

/* ---------- Login (minimal, monochrome) ---------- */
.login-view {
  min-height: 100dvh; display: flex; flex-direction: column; padding: 0;
  background:
    radial-gradient(1px 1px at 12px 12px, rgba(255, 255, 255, 0.045) 1px, transparent 0) 0 0 / 24px 24px,
    var(--bg);
}
:root[data-theme="light"] .login-view {
  background: radial-gradient(1px 1px at 12px 12px, rgba(15, 23, 42, 0.06) 1px, transparent 0) 0 0 / 24px 24px, var(--bg);
}
.login-view[hidden] { display: none; }
.ln-top { display: flex; align-items: center; height: 64px; padding: 0 28px; }
.ln-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.ln-brand svg { width: 22px; height: 22px; stroke-width: 1.8; }
.ln-center { flex: 1; display: grid; place-items: center; padding: 16px 20px 40px; }
.ln-card {
  width: min(100%, 384px); overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 16px 40px rgba(0, 0, 0, 0.22);
}
:root[data-theme="light"] .ln-card { border-color: var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 32px rgba(16, 24, 40, 0.07); }
.ln-head { padding: 26px 26px 0; }
.ln-head h1 { margin: 0 0 6px; color: var(--ink); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.ln-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
#login-form { padding: 22px 26px 24px; }
.ln-label { display: block; margin-bottom: 7px; color: var(--text); font-size: 12.5px; font-weight: 500; }
.ln-card .password-field input { height: 42px; border-radius: 8px; letter-spacing: 0.02em; transition: border-color .12s, box-shadow .12s; }
.ln-card .password-field input::placeholder { letter-spacing: 0.12em; }
.login-caps { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--amber-ink); font-size: 12px; }
.login-caps[hidden] { display: none; }
.login-caps svg { width: 13px; height: 13px; }
.ln-card .login-msg:not(:empty) { margin-top: 12px; }
.ln-submit { width: 100%; height: 42px; margin-top: 16px; justify-content: center; gap: 8px; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.ln-submit svg { transition: transform .15s ease; }
.ln-submit:hover svg { transform: translateX(2px); }
.ln-submit:disabled { opacity: 0.7; }
.ln-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 26px; border-top: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font-size: 12px;
}
.ln-online { display: inline-flex; align-items: center; gap: 7px; }
.ln-online i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.ln-host { overflow: hidden; color: var(--faint); font-family: var(--font-mono); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.ln-bottom { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; padding: 0 20px 24px; color: var(--faint); font-size: 12px; }
.ln-bottom span { display: inline-flex; align-items: center; gap: 6px; }
.ln-bottom svg { width: 13px; height: 13px; }
@media (max-width: 480px) {
  .ln-top { height: 56px; padding: 0 20px; }
  .ln-center { place-items: start center; padding-top: 8vh; }
  .ln-head { padding: 22px 20px 0; }
  #login-form { padding: 20px 20px 22px; }
  .ln-foot { padding: 12px 20px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ln-top { height: 44px; }
  .ln-center { place-items: start center; padding-top: 0; }
  .ln-bottom { display: none; }
}

/* ---------- Dashboard: same layout, calmer and easier to scan ---------- */
.table-wrap { overflow-x: auto; }
.table tbody tr[data-row] { cursor: pointer; }
.table tbody tr[data-row]:hover .vm-link strong { color: var(--accent-ink); }
:root[data-theme="light"] .table tbody tr[data-row]:hover .vm-link strong { color: var(--accent); }
.vm-sub { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { justify-content: flex-end; }
.group-tag { display: none; }
@media (max-width: 1500px) {
  .table .col-group { display: none; }
  .group-tag { display: inline-flex; }
}
@media (max-width: 1366px) { .table .col-adb { display: none; } }
.metric-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 720px) {
  .fleet-toolbar { gap: 8px; }
  .fleet-toolbar .toolbar-left, .fleet-toolbar .toolbar-right { width: 100%; }
  .fleet-toolbar .segmented { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
  .fleet-toolbar .segmented::-webkit-scrollbar { display: none; }
  .fleet-toolbar .search-input { flex: 1 1 auto; min-width: 0; }
  .fleet-toolbar .search-input input { width: 100%; }
  .fleet-toolbar .view-switch { display: none; }
  .card-grid { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
}

/* ---------- Device console: phone portrait ---------- */
.device-frame { transition: width .18s ease, height .18s ease; }
@media (max-width: 720px) {
  #detail-view .view-head { flex-wrap: wrap; gap: 8px; padding: 8px 12px; min-height: 0; }
  #detail-view .vh-left { flex: 1 1 100%; min-width: 0; }
  #detail-view .vh-left.has-crumbs { flex-wrap: nowrap; }
  #detail-view .vh-left.has-crumbs .vh-crumbs { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  #detail-view .vh-left h1, #detail-view .vh-left .tag, #detail-view #detail-dot, #detail-view .vh-meta { display: none; }
  #detail-view .vh-crumbs [aria-current] { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
  #detail-view .vh-right { flex: 1 1 100%; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  #detail-view .vh-right::-webkit-scrollbar { display: none; }
  #detail-view .vh-right .btn { flex: 0 0 auto; height: 32px; padding: 0 10px; }
  #detail-view .vh-right .icon-btn { flex: 0 0 auto; margin-left: auto; }
  #detail-view .player-stage { padding: 10px 8px; gap: 10px; }
  #detail-view .widget-rail { flex-basis: 44px; width: 44px; }
}

/* ---------- Device console: phone landscape (immersive) ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  .app-shell[data-view="detail"] { grid-template-rows: 0 minmax(0, 1fr); }
  .app-shell[data-view="detail"] .topbar { display: none; }
  .app-shell[data-view="detail"] .sidebar { display: none; }
  .app-shell[data-view="detail"] .workspace { grid-column: 1 / -1; }
  #detail-view .view-head { flex-wrap: nowrap; min-height: 0; height: 40px; flex-basis: 40px; padding: 0 10px; gap: 8px; }
  #detail-view .vh-left { flex: 1 1 auto; min-width: 0; }
  #detail-view .vh-left.has-crumbs { flex-wrap: nowrap; }
  #detail-view .vh-left.has-crumbs .vh-crumbs { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  #detail-view .vh-crumbs > span:first-child, #detail-view .vh-crumbs > span:first-child + .crumb-sep { display: none; }
  #detail-view .vh-crumbs [aria-current] { color: var(--ink); font-weight: 600; }
  #detail-view .vh-left h1, #detail-view .vh-left .tag, #detail-view #detail-dot, #detail-view .vh-meta, #detail-view .conn { display: none; }
  #detail-view .vh-right { flex: 0 0 auto; gap: 4px; overflow: visible; }
  #detail-view .vh-right .btn { height: 30px; padding: 0 9px; font-size: 12px; }
  #detail-view .vh-right .btn span { display: none; }
  #detail-view .vh-right .icon-btn { width: 30px; height: 30px; }
  #detail-view .player-stage { flex-direction: row; padding: 6px 8px; gap: 8px; }
  #detail-view .nav-keys { flex-direction: column; padding: 6px 4px; border-radius: 16px; }
  #detail-view .nav-keys button { width: 34px; height: 34px; }
  #detail-view .widget-rail { flex-basis: 42px; width: 42px; padding: 4px 0; justify-content: flex-start; }
  #detail-view .rail-btn { width: 32px; height: 30px; }
  #detail-view .device-frame { border-radius: 14px; }
  #detail-view .device-screen, #detail-view .device-screen > div, #detail-view .device-screen canvas, #detail-view .console-overlay { border-radius: 10px; }
  #detail-view .device-screen, #detail-view .console-overlay { inset: 4px; }
  #detail-view .widget-panel { max-height: 100%; }
}
/* Landscape stream (video fullscreen etc.): slimmer bezel so the picture is as big as possible */
.device-frame.is-landscape { border-radius: 18px; }
.device-frame.is-landscape .device-screen,
.device-frame.is-landscape .device-screen > div,
.device-frame.is-landscape .device-screen canvas,
.device-frame.is-landscape .console-overlay { border-radius: 13px; }
