@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --ink: #f4f5ef;
  --muted: #969d96;
  --muted-2: #697069;
  --surface: #171b18;
  --surface-2: #1d221e;
  --surface-3: #242a25;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #a8f36a;
  --accent-soft: rgba(168, 243, 106, 0.12);
  --cyan: #66dfd0;
  --danger: #ff806f;
  --warning: #f7c95f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius: 20px;
  font-family: "Manrope", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #101311;
  color: var(--ink);
}

body {
  min-height: 100vh;
}

.live-page {
  height: 100vh;
  overflow: hidden;
}

.live-page .app-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -20%, rgba(168, 243, 106, 0.08), transparent 31rem),
    #101311;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 52px;
  padding: 7px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 19, 17, 0.91);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(168, 243, 106, 0.35);
  border-radius: 9px;
  background: var(--accent);
  color: #14200f;
  font-size: 14px;
  font-weight: 800;
  transform: rotate(-3deg);
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 13px;
  letter-spacing: 0.01em;
}

.brand small {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.main-nav a {
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  transition: 160ms ease;
}

.main-nav a:hover {
  color: var(--ink);
}

.main-nav a.active {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: var(--ink);
}

.side-nav {
  width: 100%;
  margin-bottom: 4px;
}

.side-nav a {
  min-width: 0;
  flex: 1;
  padding-right: 7px;
  padding-left: 7px;
  text-align: center;
}

.replay-workspace .library-panel {
  padding-top: 12px;
}

.topbar-status {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(247, 201, 95, 0.08);
}

.status-dot.online {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(168, 243, 106, 0.08);
}

.status-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 128, 111, 0.08);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(390px, 1fr) minmax(270px, 320px);
  min-height: 100vh;
  max-width: 1720px;
  margin: 0 auto;
}

.live-workspace {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(250px, 300px);
  max-width: 1920px;
}

.panel,
.viewer-column {
  min-width: 0;
  padding: 30px 26px;
}

.panel {
  background: rgba(23, 27, 24, 0.76);
}

.connection-panel,
.library-panel {
  border-right: 1px solid var(--line);
}

.session-panel,
.details-panel {
  border-left: 1px solid var(--line);
}

.panel-heading,
.viewer-toolbar,
.subheading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  margin-bottom: 28px;
}

.panel-heading.compact {
  align-items: center;
  margin-bottom: 24px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 19px;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 15px;
}

.step-badge {
  display: grid;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.stack-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: #d7dcd6;
  font-size: 12px;
  font-weight: 700;
}

.field small {
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.45;
}

.field-row {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 12px;
}

input,
select {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  outline: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(5, 7, 6, 0.24);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #555c56;
}

input:focus,
select:focus {
  border-color: rgba(168, 243, 106, 0.54);
  background: rgba(5, 7, 6, 0.4);
  box-shadow: 0 0 0 3px rgba(168, 243, 106, 0.08);
}

.check-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.check-row > span {
  display: grid;
  gap: 3px;
}

.check-row strong {
  font-size: 12px;
}

.check-row small {
  color: var(--muted);
  font-size: 10px;
}

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

.check-row i {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0d100e;
  transition: 160ms ease;
}

.check-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: 160ms ease;
}

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

.check-row input:checked + i::after {
  background: #14200f;
  transform: translateX(16px);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.button-primary {
  background: var(--accent);
  color: #172111;
  box-shadow: 0 10px 24px rgba(168, 243, 106, 0.09);
}

.button-primary:hover:not(:disabled) {
  background: #b7ff7d;
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: #dfe4de;
}

.button-secondary:hover:not(:disabled) {
  border-color: rgba(168, 243, 106, 0.32);
  background: var(--accent-soft);
}

.button-danger {
  border-color: rgba(255, 128, 111, 0.35);
  background: rgba(255, 128, 111, 0.1);
  color: #ff9f91;
}

.button-wide {
  width: 100%;
}

.button-icon {
  font-size: 17px;
}

.hidden {
  display: none !important;
}

.tip-card {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding: 13px;
  border: 1px solid rgba(102, 223, 208, 0.12);
  border-radius: 12px;
  background: rgba(102, 223, 208, 0.045);
}

.tip-card p {
  color: #8faaa5;
  font-size: 10px;
  line-height: 1.7;
}

.tip-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(102, 223, 208, 0.35);
  border-radius: 50%;
  color: var(--cyan);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.viewer-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding-right: clamp(22px, 4vw, 58px);
  padding-left: clamp(22px, 4vw, 58px);
}

.viewer-toolbar {
  width: 100%;
  max-width: 680px;
  align-items: center;
  margin-bottom: 20px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 39px;
  height: 39px;
  padding: 0;
  cursor: pointer;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: #cbd0ca;
  font-size: 17px;
  transition: 140ms ease;
}

.icon-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--accent);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.device-stage {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 570px;
  flex: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at center, rgba(168, 243, 106, 0.05), transparent 18rem),
    #131714;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle, #000 12%, transparent 72%);
}

.phone-frame {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(310px, calc(100% - 40px));
  aspect-ratio: 9 / 19.5;
  max-height: calc(100vh - 255px);
  min-height: 470px;
  flex-direction: column;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 38px;
  background: #090b09;
  box-shadow:
    0 38px 70px rgba(0, 0, 0, 0.58),
    0 0 0 5px #202520,
    0 0 0 6px rgba(255, 255, 255, 0.08);
}

.phone-top {
  position: absolute;
  z-index: 5;
  top: 15px;
  left: 50%;
  display: flex;
  width: 66px;
  height: 19px;
  align-items: center;
  justify-content: flex-end;
  padding-right: 7px;
  border-radius: 999px;
  background: #050605;
  transform: translateX(-50%);
}

.phone-top span {
  position: absolute;
  left: 18px;
  width: 24px;
  height: 3px;
  border-radius: 99px;
  background: #181b18;
}

.phone-top i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #142519;
  box-shadow: 0 0 0 1px #25312a;
}

.vnc-screen {
  position: relative;
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 29px;
  background: #0c100d center / contain no-repeat;
  touch-action: none;
}

.vnc-screen > div:not(.screen-placeholder):not(.touch-layer) {
  width: 100% !important;
  height: 100% !important;
}

#replay-screen.replay-seeking {
  cursor: wait;
}

#replay-screen.replay-seeking > div:not(.screen-placeholder):not(.touch-layer),
#replay-screen.replay-seeking .touch-layer {
  visibility: hidden;
}

.vnc-screen.control-active,
.vnc-screen.control-active canvas {
  cursor: default !important;
}

.screen-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  text-align: center;
}

.screen-placeholder strong {
  margin-top: 22px;
  font-size: 13px;
}

.screen-placeholder p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.placeholder-orbit {
  position: relative;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 1px solid rgba(168, 243, 106, 0.15);
  border-radius: 50%;
}

.placeholder-orbit::before,
.placeholder-orbit::after {
  position: absolute;
  border: 1px solid rgba(168, 243, 106, 0.08);
  border-radius: 50%;
  content: "";
}

.placeholder-orbit::before {
  inset: 8px;
}

.placeholder-orbit::after {
  inset: 16px;
}

.placeholder-orbit span {
  width: 14px;
  height: 22px;
  border: 1px solid var(--accent);
  border-radius: 4px;
}

.placeholder-orbit i {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(168, 243, 106, 0.75);
}

.replay-orbit i {
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(102, 223, 208, 0.75);
}

.phone-home {
  position: absolute;
  z-index: 5;
  bottom: 14px;
  left: 50%;
  width: 70px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.5);
  transform: translateX(-50%);
  pointer-events: none;
}

.mobile-controls {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.multi-viewer-column {
  min-width: 0;
  padding: 30px clamp(18px, 2.4vw, 40px);
  overflow: hidden;
}

.multi-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  align-content: start;
  gap: 18px;
  min-height: 570px;
}

.multi-empty-state {
  display: flex;
  min-height: 570px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at center, rgba(168, 243, 106, 0.05), transparent 18rem),
    rgba(19, 23, 20, 0.78);
  text-align: center;
}

.multi-empty-state strong {
  margin-top: 22px;
  font-size: 14px;
}

.multi-empty-state p {
  max-width: 360px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.vnc-card {
  display: grid;
  min-width: 0;
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(20, 24, 21, 0.9);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.vnc-card-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.vnc-card-title {
  min-width: 0;
}

.vnc-card-title .eyebrow {
  margin-bottom: 4px;
}

.vnc-card-title h3,
.vnc-card-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vnc-card-title h3 {
  font-size: 14px;
}

.vnc-card-title small {
  margin-top: 5px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.vnc-card-status {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 10px;
}

.device-rate {
  display: grid;
  gap: 2px;
  min-width: 92px;
  text-align: right;
}

.device-rate span {
  color: var(--muted);
  font-size: 8px;
}

.device-rate strong {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-line;
}

.vnc-card-stage {
  position: relative;
  display: grid;
  min-height: 490px;
  place-items: center;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(168, 243, 106, 0.045), transparent 15rem),
    #111512;
}

.vnc-card-stage::before {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  content: "";
  pointer-events: none;
}

.vnc-card-stage .phone-frame {
  width: min(245px, calc(100% - 28px));
  min-height: 400px;
  max-height: 520px;
}

.vnc-tuning {
  display: grid;
  gap: 11px;
  padding: 12px 15px 13px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.014);
}

.vnc-tuning-heading,
.vnc-tuning-label,
.vnc-tuning-control small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vnc-tuning-heading > div {
  display: grid;
  gap: 3px;
}

.vnc-tuning-heading strong {
  color: #d9ddd8;
  font-size: 10px;
  font-weight: 600;
}

.vnc-tuning-heading small,
.vnc-tuning-heading > span,
.vnc-tuning-control small {
  color: var(--muted);
  font-size: 8px;
}

.vnc-tuning-heading > span {
  flex: 0 0 auto;
  font-family: "DM Mono", monospace;
  text-align: right;
}

.vnc-tuning-heading > span[data-state="ready"],
.vnc-tuning-heading > span[data-state="applied"] {
  color: var(--accent);
}

.vnc-tuning-heading > span[data-state="pending"] {
  color: var(--cyan);
}

.vnc-tuning-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vnc-tuning-control {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 9px 10px 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(9, 13, 11, 0.46);
}

.vnc-tuning-label {
  color: #cbd0ca;
  font-size: 9px;
}

.vnc-tuning-label output {
  min-width: 20px;
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.vnc-tuning-control input[type="range"] {
  width: 100%;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.vnc-tuning-control input[type="range"]:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.vnc-tuning-control input[type="range"]:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.vnc-card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-top: 1px solid var(--line);
}

.vnc-card-controls .mobile-controls {
  min-width: 0;
  margin: 0;
}

.vnc-card-controls .control-key {
  min-width: 48px;
}

.vnc-card-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.vnc-card-actions .icon-button {
  width: 36px;
  height: 36px;
}

.vnc-card-actions .button {
  min-height: 36px;
  padding: 8px 11px;
}

.vnc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.vnc-card-footer strong {
  margin-left: 3px;
  color: #cbd0ca;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 500;
}

.vnc-card:fullscreen {
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #101311;
}

.vnc-card:fullscreen .vnc-card-stage {
  min-height: calc(100vh - 145px);
}

.vnc-card:fullscreen .phone-frame {
  width: min(390px, calc(100% - 40px));
  max-height: calc(100vh - 175px);
}

#summary-rate {
  max-width: none;
  line-height: 1.45;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
}

.control-key {
  display: flex;
  min-width: 70px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.control-key:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--accent);
}

.control-key:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.control-key span {
  font-size: 18px;
}

.control-key small {
  font-size: 10px;
}

.state-pill {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.state-pill.live,
.state-pill.playing {
  border-color: rgba(168, 243, 106, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.state-pill.error {
  border-color: rgba(255, 128, 111, 0.28);
  background: rgba(255, 128, 111, 0.08);
  color: var(--danger);
}

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

.metric {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.metric span,
.session-detail span {
  color: var(--muted);
  font-size: 10px;
}

.metric strong {
  font-family: "DM Mono", monospace;
  font-size: 15px;
  font-weight: 500;
}

.session-detail {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.session-detail > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.session-detail strong {
  overflow: hidden;
  max-width: 160px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.traffic-card {
  display: grid;
  gap: 15px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 7, 6, 0.19);
}

.traffic-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.traffic-heading .eyebrow {
  margin-bottom: 4px;
}

.traffic-heading strong {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: right;
  white-space: pre-line;
}

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

.traffic-grid > div {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.traffic-grid span,
.bandwidth-recommendation span,
.traffic-total {
  color: var(--muted);
  font-size: 9px;
}

.traffic-grid strong {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.bandwidth-recommendation {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 11px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 0 9px 9px 0;
  background: var(--accent-soft);
}

.bandwidth-recommendation strong {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
  white-space: pre-line;
}

.bandwidth-recommendation small {
  grid-column: 1 / -1;
  color: #75866a;
  font-size: 8px;
}

.traffic-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.traffic-total strong {
  color: #cbd0ca;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 500;
}

.notice {
  margin-top: 20px;
  padding: 12px 13px;
  border-left: 2px solid var(--cyan);
  border-radius: 0 8px 8px 0;
  background: rgba(102, 223, 208, 0.05);
  color: #9db5b1;
  font-size: 10px;
  line-height: 1.6;
}

.notice.error {
  border-left-color: var(--danger);
  background: rgba(255, 128, 111, 0.06);
  color: #dca49d;
}

.notice.success {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: #b8d9a0;
}

.section-divider {
  height: 1px;
  margin: 26px 0;
  background: var(--line);
}

.subheading {
  align-items: center;
  margin-bottom: 14px;
}

.text-button {
  padding: 4px;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

.text-button:disabled {
  cursor: not-allowed;
  color: var(--muted-2);
}

.text-button.centered {
  justify-self: center;
}

.recording-list {
  display: grid;
  gap: 8px;
  overflow: auto;
  scrollbar-color: #333a34 transparent;
  scrollbar-width: thin;
}

.compact-list {
  max-height: 260px;
  margin-bottom: 18px;
}

.recording-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  width: 100%;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--ink);
  transition: 140ms ease;
}

.recording-item:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.recording-item.selected {
  border-color: rgba(168, 243, 106, 0.34);
  background: var(--accent-soft);
}

.recording-item strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-item time {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.recording-item small {
  overflow: hidden;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-item em {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-style: normal;
}

.empty-state {
  padding: 24px 10px;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.search-field {
  position: relative;
  display: block;
  margin-bottom: 12px;
}

.search-field span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input {
  padding-left: 35px;
}

.import-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 18px;
}

.library-list {
  max-height: calc(100vh - 270px);
  padding-right: 3px;
}

.replay-stage {
  min-height: 510px;
}

.playback-bar {
  display: grid;
  width: 100%;
  max-width: 680px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
}

.play-button {
  display: grid;
  width: 37px;
  height: 37px;
  padding: 0 0 0 2px;
  cursor: pointer;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #172111;
  font-size: 12px;
}

.play-button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.35;
}

.timeline {
  display: grid;
  gap: 7px;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.progress-seek {
  --progress: 0%;
  width: 100%;
  min-height: 16px;
  height: 16px;
  padding: 0;
  cursor: pointer;
  appearance: none;
  border: 0;
  background: transparent;
}

.progress-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background:
    linear-gradient(
      90deg,
      var(--accent) 0 var(--progress),
      #303630 var(--progress) 100%
    );
}

.progress-seek::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  cursor: grab;
  appearance: none;
  border: 2px solid #101311;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(168, 243, 106, 0.42);
}

.progress-seek::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 99px;
  background: #303630;
}

.progress-seek::-moz-range-progress {
  height: 4px;
  border-radius: 99px;
  background: var(--accent);
}

.progress-seek::-moz-range-thumb {
  width: 9px;
  height: 9px;
  cursor: grab;
  border: 2px solid #101311;
  border-radius: 50%;
  background: var(--accent);
}

.progress-seek:focus-visible {
  outline: 1px solid rgba(168, 243, 106, 0.55);
  outline-offset: 2px;
}

.progress-seek:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.speed-select select {
  width: 64px;
  min-height: 34px;
  padding: 7px 8px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.recording-details {
  display: grid;
  gap: 13px;
  margin-bottom: 22px;
}

.recording-details > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.recording-details span {
  color: var(--muted);
  font-size: 10px;
}

.recording-details strong {
  overflow: hidden;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-details {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

.empty-details p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.action-stack {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.disabled-link {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}

.operation-legend {
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 9px;
}

.operation-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.operation-legend i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-touch {
  border: 1px solid var(--accent);
}

.legend-key {
  background: var(--cyan);
}

.operation-log {
  display: grid;
  max-height: 160px;
  gap: 6px;
  overflow: auto;
  margin-top: 13px;
}

.operation-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: #c8cdc7;
  font-size: 9px;
}

.operation-entry time {
  color: var(--muted);
  font-family: "DM Mono", monospace;
}

.touch-layer {
  position: absolute;
  z-index: 12;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.touch-ripple {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: rgba(168, 243, 106, 0.14);
  box-shadow: 0 0 0 7px rgba(168, 243, 106, 0.06);
  transform: translate(-50%, -50%) scale(0.5);
  animation: touch-pop 620ms ease-out forwards;
}

.key-toast {
  position: absolute;
  z-index: 13;
  right: 14px;
  bottom: 22px;
  padding: 8px 11px;
  border: 1px solid rgba(102, 223, 208, 0.32);
  border-radius: 8px;
  background: rgba(10, 17, 15, 0.88);
  color: var(--cyan);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  animation: key-fade 900ms ease forwards;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes touch-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.45);
  }
}

@keyframes key-fade {
  0%,
  60% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* Live workspace: compact controls on the left, phone-sized cards on the right. */
.live-workspace {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  align-items: start;
  height: 100vh;
  max-width: none;
  min-height: 0;
  overflow: hidden;
}

.live-command-bar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-self: stretch;
  gap: 14px;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: rgba(23, 27, 24, 0.82);
}

.quick-connect-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: end;
  gap: 9px 7px;
}

.quick-field-host {
  grid-column: 1;
  grid-row: 1;
}

.quick-field-port {
  grid-column: 2;
  grid-row: 1;
}

.quick-field-password {
  grid-column: 1 / -1;
  grid-row: 2;
}

.quick-field-name {
  grid-column: 1 / -1;
  grid-row: 3;
}

.quick-record {
  grid-column: 1;
  grid-row: 4;
}

.quick-connect-button {
  grid-column: 2;
  grid-row: 4;
}

.quick-field {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.quick-field > span,
.quick-record > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.quick-field input {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 11px;
}

.quick-record {
  position: relative;
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
}

.quick-record input {
  position: absolute;
  width: 1px;
  min-height: 0;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.quick-record i {
  position: relative;
  width: 29px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #0d100e;
}

.quick-record i::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transition: 160ms ease;
}

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

.quick-record input:checked + i::after {
  background: #14200f;
  transform: translateX(13px);
}

.quick-connect-button {
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid rgba(168, 243, 106, 0.28);
  border-radius: 7px;
  background: rgba(168, 243, 106, 0.07);
  box-shadow: none;
  color: #c9f5a7;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.quick-connect-button:hover:not(:disabled) {
  border-color: rgba(168, 243, 106, 0.48);
  background: rgba(168, 243, 106, 0.12);
  transform: none;
}

.quick-connect-button .button-icon {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.live-summary-bar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-items: stretch;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8px;
}

.summary-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

.summary-inline strong {
  color: #d8ddd7;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 500;
}

.summary-inline-rate strong {
  color: var(--accent);
  line-height: 1.25;
  white-space: nowrap;
}

.live-notice {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-notice.error,
.live-notice.success {
  border: 0;
  background: transparent;
}

.live-workspace .multi-viewer-column {
  display: flex;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 7px 10px 10px;
  overflow: hidden;
}

.live-workspace .multi-viewer-toolbar {
  flex: 0 0 auto;
  min-height: 27px;
  margin-bottom: 6px;
}

.live-workspace .multi-viewer-toolbar h1 {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.live-workspace .device-grid {
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 410px), 440px));
  grid-auto-rows: max-content;
  align-content: start;
  justify-content: start;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.live-workspace .multi-empty-state {
  min-height: 100%;
  border-radius: 9px;
}

.live-workspace .multi-empty-state strong {
  margin-top: 0;
}

.live-workspace .vnc-card {
  width: 100%;
  height: max-content;
  max-width: 440px;
  justify-self: start;
  border-radius: 9px;
  background: #0b0e0c;
  box-shadow: none;
}

.vnc-card-info {
  display: grid;
  gap: 6px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 24, 21, 0.94);
}

.vnc-card-primary-row {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) minmax(190px, 1.6fr) auto;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.vnc-card-identity {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.vnc-card-identity h3,
.vnc-card-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vnc-card-identity h3 {
  flex: 0 1 auto;
  font-size: 11px;
}

.vnc-card-identity small {
  min-width: 0;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.vnc-inline-tuning {
  display: grid;
  grid-template-columns: repeat(2, minmax(66px, 1fr));
  min-width: 0;
  gap: 4px;
}

.vnc-inline-control {
  display: grid;
  grid-template-columns: auto minmax(32px, 1fr) 14px;
  min-width: 0;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 8px;
}

.vnc-inline-control input[type="range"] {
  width: 100%;
  min-height: 0;
  height: 12px;
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

.vnc-inline-control input[type="range"]:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.vnc-inline-control output {
  color: var(--accent);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  text-align: right;
}

.vnc-card-primary-row .vnc-card-actions {
  justify-content: flex-end;
}

.vnc-card-primary-row .button {
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 9px;
}

.vnc-card-secondary-row {
  display: flex;
  min-width: 0;
  min-height: 27px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 7px;
  white-space: nowrap;
}

.card-inline-metric {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.card-inline-metric strong {
  color: #cbd0ca;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  font-weight: 500;
}

.card-rate strong {
  color: var(--accent);
  line-height: 1.15;
  white-space: nowrap;
}

.live-workspace .vnc-card-stage {
  min-height: clamp(540px, calc(100vh - 126px), 900px);
  padding: 0;
  background: #050705;
}

.live-workspace .vnc-card-stage::before {
  display: none;
}

.live-workspace .vnc-screen {
  width: 100%;
  height: 100%;
  min-height: inherit;
  border-radius: 0;
}

.live-workspace .screen-placeholder strong {
  margin-top: 0;
}

.live-workspace .vnc-card:fullscreen .vnc-card-stage {
  min-height: calc(100vh - 72px);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 280px minmax(390px, 1fr);
  }

  .live-workspace {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .session-panel,
  .details-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .session-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
  }

  .session-panel .panel-heading,
  .session-panel .notice,
  .session-panel .section-divider,
  .session-panel .subheading,
  .session-panel .recording-list,
  .session-panel > .button {
    grid-column: 1 / -1;
  }

  .details-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 28px;
  }

  .details-panel .panel-heading,
  .details-panel .section-divider,
  .details-panel .operation-legend,
  .details-panel .operation-log {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 68px;
    padding: 10px 14px;
  }

  .brand small,
  .topbar-status {
    display: none;
  }

  .main-nav a {
    padding: 8px 10px;
    font-size: 11px;
  }

  .workspace {
    display: flex;
    min-height: auto;
    flex-direction: column;
  }

  .panel,
  .viewer-column,
  .multi-viewer-column {
    padding: 24px 18px;
  }

  .connection-panel,
  .library-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .viewer-column {
    order: -1;
  }

  .connection-panel,
  .library-panel {
    order: 0;
  }

  .session-panel,
  .details-panel {
    display: block;
    order: 1;
  }

  .device-stage {
    min-height: 520px;
  }

  .device-grid,
  .multi-empty-state {
    min-height: 500px;
  }

  .vnc-card-stage {
    min-height: 470px;
  }

  .vnc-card-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .vnc-card-controls .mobile-controls,
  .vnc-card-actions {
    justify-content: center;
  }

  .phone-frame {
    min-height: 430px;
    max-height: 560px;
  }

  .library-list {
    max-height: 360px;
  }
}

@media (max-width: 440px) {
  .brand > span:last-child {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .main-nav a {
    padding: 8px;
  }

  .panel,
  .viewer-column,
  .multi-viewer-column {
    padding-right: 14px;
    padding-left: 14px;
  }

  .vnc-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .vnc-card-status {
    align-items: center;
    justify-content: space-between;
  }

  .vnc-card-stage {
    min-height: 440px;
    padding: 18px 10px;
  }

  .vnc-tuning-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .vnc-tuning-heading > span {
    text-align: left;
  }

  .vnc-tuning-grid {
    grid-template-columns: 1fr;
  }

  .vnc-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .device-stage {
    min-height: 480px;
  }

  .phone-frame {
    width: min(280px, calc(100% - 34px));
    min-height: 410px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 48px;
    padding: 5px 10px;
  }

  .brand {
    gap: 7px;
  }

  .brand-mark {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .brand strong {
    font-size: 11px;
  }

  .main-nav a {
    padding: 5px 7px;
    font-size: 9px;
  }

  .live-command-bar {
    height: auto;
    min-height: auto;
    padding: 6px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quick-connect-form {
    grid-template-columns: minmax(0, 1.2fr) 76px minmax(0, 1fr);
  }

  .quick-field-host {
    grid-column: 1;
    grid-row: 1;
  }

  .quick-field-port {
    grid-column: 2;
    grid-row: 1;
  }

  .quick-field-password {
    grid-column: 3;
    grid-row: 1;
  }

  .quick-field-name {
    grid-column: 1;
    grid-row: 2;
  }

  .quick-record {
    grid-column: 2;
    grid-row: 2;
  }

  .quick-connect-button {
    grid-column: 3;
    grid-row: 2;
  }

  .live-summary-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
  }

  .live-notice {
    grid-column: 1 / -1;
    text-align: left;
  }

  .live-workspace .multi-viewer-column {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
    padding: 6px 8px 8px;
  }

  .live-workspace .device-grid {
    min-height: 0;
  }

  .live-workspace .multi-empty-state {
    min-height: 100%;
  }

  .vnc-card-primary-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .vnc-inline-tuning {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .vnc-card-primary-row .vnc-card-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .vnc-card-secondary-row {
    flex-wrap: wrap;
    gap: 6px 9px;
  }

  .live-workspace .vnc-card-stage {
    min-height: clamp(520px, calc(100vh - 300px), 760px);
  }
}

@media (max-width: 440px) {
  .brand strong,
  .topbar-status {
    display: none;
  }

  .quick-connect-form {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .quick-field-host {
    grid-column: 1;
    grid-row: 1;
  }

  .quick-field-port {
    grid-column: 2;
    grid-row: 1;
  }

  .quick-field-password {
    grid-column: 1;
    grid-row: 2;
  }

  .quick-field-name {
    grid-column: 2;
    grid-row: 2;
  }

  .quick-record {
    grid-column: 1;
    grid-row: 3;
  }

  .quick-connect-button {
    grid-column: 2;
    grid-row: 3;
  }

  .live-notice {
    display: none;
  }

  .vnc-inline-tuning {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .live-workspace .vnc-card-stage {
    min-height: 500px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
