:root {
  --bg: #eef8ff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-strong: rgba(222, 242, 255, 0.78);
  --text: #1b3244;
  --muted: #58758d;
  --line: rgba(124, 188, 230, 0.34);
  --green: #2ea87e;
  --green-strong: #167c63;
  --amber: #b8872e;
  --red: #c75f71;
  --red-strong: #a74054;
  --blue: #4aa8e8;
  --blue-strong: #247fbe;
  --cyan: #6cd5ef;
  --rose: #e28ca4;
  --brand-yellow: #ffd20a;
  --ink: #112b3f;
  --code: #102638;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  min-width: 320px;
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(145deg, #dff3ff 0%, #f8fdff 38%, #eaf7ff 68%, #fff2f7 100%);
  color: var(--text);
}

body.creator-page-live::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.78;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 133, 207, 0.32), rgba(255, 133, 207, 0) 34%),
    radial-gradient(circle at 82% 10%, rgba(255, 191, 226, 0.42), rgba(255, 191, 226, 0) 30%),
    radial-gradient(circle at 52% 82%, rgba(255, 94, 187, 0.24), rgba(255, 94, 187, 0) 36%);
  animation: pinkPageGlow 4s ease-in-out infinite;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: start;
  pointer-events: auto;
  border: 1px solid rgba(124, 188, 230, 0.36);
  border-radius: 8px;
  background:
    radial-gradient(circle at 14% 0%, rgba(115, 211, 255, 0.16), rgba(115, 211, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 248, 255, 0.8));
  padding: 12px;
  box-shadow:
    0 22px 48px rgba(54, 137, 199, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  animation: toastIn 0.18s ease-out;
}

.toast[data-leaving="1"] {
  animation: toastOut 0.18s ease-in forwards;
}

.toast[data-type="success"] {
  border-color: rgba(46, 168, 126, 0.38);
  background:
    radial-gradient(circle at 14% 0%, rgba(97, 213, 172, 0.18), rgba(97, 213, 172, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(226, 249, 241, 0.82));
}

.toast[data-type="warning"] {
  border-color: rgba(184, 135, 46, 0.34);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 210, 10, 0.16), rgba(255, 210, 10, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 249, 232, 0.82));
}

.toast[data-type="error"] {
  border-color: rgba(199, 95, 113, 0.38);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 142, 166, 0.16), rgba(255, 142, 166, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 235, 240, 0.82));
}

.toast strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.toast p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.toast button {
  min-height: 30px;
  width: 30px;
  border-radius: 999px;
  padding: 0;
}

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

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(233, 248, 255, 0.76));
  color: var(--text);
  cursor: pointer;
  box-shadow:
    0 10px 20px rgba(56, 139, 198, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

button:hover {
  border-color: rgba(74, 168, 232, 0.78);
  background: linear-gradient(180deg, #ffffff, rgba(230, 247, 255, 0.94));
  box-shadow:
    0 14px 30px rgba(56, 139, 198, 0.18),
    inset 0 1px 0 #ffffff;
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
  box-shadow:
    0 7px 15px rgba(56, 139, 198, 0.12),
    inset 0 2px 6px rgba(44, 126, 184, 0.12);
}

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

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 16px 18px 0;
  padding: 20px 26px;
  overflow: hidden;
  border: 1px solid rgba(134, 202, 240, 0.48);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(225, 246, 255, 0.74) 62%, rgba(255, 239, 247, 0.7));
  backdrop-filter: blur(22px);
  box-shadow:
    0 24px 54px rgba(51, 134, 195, 0.18),
    0 7px 16px rgba(255, 255, 255, 0.72) inset,
    0 -10px 22px rgba(66, 160, 226, 0.08) inset;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 46%);
}

.topbar::after {
  content: "";
  position: absolute;
  top: -65%;
  bottom: -65%;
  left: -34%;
  width: 24%;
  pointer-events: none;
  opacity: 0;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(224, 255, 247, 0.74), rgba(255, 255, 255, 0));
}

body.creator-page-live .topbar {
  border-color: rgba(255, 132, 207, 0.58);
  box-shadow:
    0 28px 62px rgba(51, 134, 195, 0.2),
    0 0 34px rgba(255, 132, 207, 0.24),
    0 7px 16px rgba(255, 255, 255, 0.72) inset,
    0 -10px 22px rgba(66, 160, 226, 0.08) inset;
}

body.creator-page-live .topbar::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 195, 232, 0.78), rgba(255, 255, 255, 0));
  animation: topbarLightSweep 3s ease-in-out infinite;
}

body.creator-page-live .log-dock-button,
body.creator-page-live .result-dock-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 132, 207, 0.58);
  box-shadow:
    0 26px 62px rgba(64, 155, 215, 0.2),
    0 0 34px rgba(255, 132, 207, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.92) inset,
    0 -12px 24px rgba(88, 178, 231, 0.05) inset;
}

body.creator-page-live .log-dock-button::after,
body.creator-page-live .result-dock-button::after {
  content: "";
  position: absolute;
  top: -55%;
  bottom: -55%;
  left: -38%;
  width: 28%;
  pointer-events: none;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 197, 232, 0.68), rgba(255, 255, 255, 0));
  animation: logPanelSweep 3.2s ease-in-out infinite;
}

body.creator-page-live #logs {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 119, 207, 0.3), rgba(255, 119, 207, 0) 34%),
    #102638;
  box-shadow:
    0 0 0 1px rgba(255, 163, 218, 0.2),
    0 0 26px rgba(255, 119, 207, 0.24) inset;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar h1,
.panel h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  color: #18384f;
  font-size: 31px;
  line-height: 0.96;
  text-shadow:
    0 0 18px rgba(115, 211, 255, 0.24),
    0 2px 0 rgba(255, 255, 255, 0.86);
  animation: brandTitleGlow 3.6s ease-in-out infinite;
}

.brand-copy h1 {
  width: 100%;
  text-align: center;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 230px;
}

.brand-mark,
.login-logo {
  display: block;
  object-fit: contain;
  filter:
    drop-shadow(0 10px 16px rgba(255, 210, 10, 0.24))
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.86));
}

.brand-mark {
  width: 54px;
  height: 54px;
  animation: brandMarkGlow 3.6s ease-in-out infinite;
}

.brand-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  width: max-content;
}

.brand-copy .eyebrow {
  margin: 0;
  color: #4c9bd1;
  width: 100%;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: justify;
  text-align-last: justify;
  text-transform: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
}

.brand-auth-slot {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 2px;
}

.brand-auth-slot::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  right: 6px;
  height: 1px;
  pointer-events: none;
  opacity: 0.68;
  transform: translateY(-50%);
  background: linear-gradient(90deg, rgba(74, 168, 232, 0), rgba(74, 168, 232, 0.32), rgba(226, 140, 164, 0));
}

.brand-auth-slot .auth-status {
  justify-content: center;
  min-height: 30px;
  width: 100%;
  max-width: 178px;
  isolation: isolate;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  box-shadow:
    0 12px 24px rgba(58, 144, 207, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -10px 18px rgba(91, 184, 235, 0.08);
}

.brand-auth-slot .auth-status::before {
  position: relative;
  z-index: 1;
}

.brand-auth-slot .auth-status::after {
  content: "";
  position: absolute;
  inset: -45% auto -45% -72%;
  z-index: -1;
  width: 52%;
  pointer-events: none;
  opacity: 0;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  animation: identityChipSweep 4.8s ease-in-out infinite;
}

.brand-auth-slot .auth-status[data-state="admin"] {
  box-shadow:
    0 14px 28px rgba(74, 168, 232, 0.18),
    0 0 18px rgba(106, 213, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 18px rgba(91, 184, 235, 0.1);
  animation: identityAdminPulse 3.8s ease-in-out infinite;
}

.brand-auth-slot .auth-status[data-state="member"] {
  box-shadow:
    0 14px 28px rgba(46, 168, 126, 0.16),
    0 0 18px rgba(97, 213, 172, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 18px rgba(97, 213, 172, 0.08);
  animation: identityMemberPulse 3.8s ease-in-out infinite;
}

.brand-auth-slot .auth-status[data-state="bad"] {
  box-shadow:
    0 12px 24px rgba(199, 95, 113, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -10px 18px rgba(199, 95, 113, 0.06);
}

.top-status {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  gap: 10px;
  min-width: 280px;
}

.status-chip {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  min-height: 40px;
  min-width: 112px;
  border: 1px solid rgba(124, 188, 230, 0.36);
  border-radius: 18px;
  padding: 0 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(232, 248, 255, 0.62));
  color: var(--muted);
  box-shadow:
    0 12px 24px rgba(58, 144, 207, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.status-chip[data-has-meta="1"] {
  min-height: 52px;
  align-content: center;
  row-gap: 2px;
}

.status-chip span {
  font-size: 11px;
  font-weight: 900;
}

.status-chip strong {
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip small {
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip[data-state="ok"] {
  border-color: rgba(46, 168, 126, 0.34);
  background: linear-gradient(180deg, rgba(242, 255, 249, 0.94), rgba(221, 245, 236, 0.72));
}

.status-chip[data-state="live"] {
  border-color: rgba(71, 181, 255, 0.76);
  background:
    radial-gradient(circle at 18% 20%, rgba(93, 207, 255, 0.58), rgba(93, 207, 255, 0) 38%),
    linear-gradient(180deg, rgba(241, 251, 255, 0.98), rgba(210, 238, 255, 0.8));
  box-shadow:
    0 0 0 1px rgba(71, 181, 255, 0.18),
    0 0 24px rgba(71, 181, 255, 0.36),
    0 14px 30px rgba(58, 144, 207, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: liveGlow 1.8s ease-in-out infinite;
}

.status-chip[data-state="live"]::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -45%;
  width: 40%;
  pointer-events: none;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
  animation: lightSweep 2.4s ease-in-out infinite;
}

.status-chip[data-state="live"] span,
.status-chip[data-state="live"] strong {
  position: relative;
  z-index: 1;
  color: #126ea8;
}

.status-chip[data-state="warn"] {
  border-color: rgba(184, 135, 46, 0.3);
  background: linear-gradient(180deg, rgba(255, 250, 237, 0.94), rgba(255, 241, 204, 0.68));
}

.status-chip[data-state="bad"] {
  border-color: rgba(199, 95, 113, 0.34);
  background: linear-gradient(180deg, rgba(255, 246, 248, 0.94), rgba(250, 224, 229, 0.72));
}

@keyframes liveGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(71, 181, 255, 0.16),
      0 0 18px rgba(71, 181, 255, 0.3),
      0 14px 30px rgba(58, 144, 207, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(71, 181, 255, 0.3),
      0 0 34px rgba(71, 181, 255, 0.52),
      0 18px 36px rgba(58, 144, 207, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
  }
}

@keyframes lightSweep {
  0%,
  40% {
    left: -48%;
    opacity: 0;
  }
  58% {
    opacity: 1;
  }
  100% {
    left: 118%;
    opacity: 0;
  }
}

@keyframes topbarLightSweep {
  0%,
  42% {
    left: -34%;
    opacity: 0;
  }
  58% {
    opacity: 0.9;
  }
  100% {
    left: 112%;
    opacity: 0;
  }
}

@keyframes brandTitleGlow {
  0%,
  100% {
    text-shadow:
      0 0 14px rgba(115, 211, 255, 0.18),
      0 2px 0 rgba(255, 255, 255, 0.86);
  }
  50% {
    text-shadow:
      0 0 24px rgba(115, 211, 255, 0.34),
      0 0 13px rgba(255, 210, 10, 0.18),
      0 2px 0 rgba(255, 255, 255, 0.9);
  }
}

@keyframes brandMarkGlow {
  0%,
  100% {
    filter:
      drop-shadow(0 10px 16px rgba(255, 210, 10, 0.22))
      drop-shadow(0 2px 0 rgba(255, 255, 255, 0.86));
  }
  50% {
    filter:
      drop-shadow(0 12px 22px rgba(255, 210, 10, 0.38))
      drop-shadow(0 0 12px rgba(115, 211, 255, 0.28))
      drop-shadow(0 2px 0 rgba(255, 255, 255, 0.9));
  }
}

@keyframes identityChipSweep {
  0%,
  50% {
    left: -72%;
    opacity: 0;
  }
  64% {
    opacity: 0.72;
  }
  100% {
    left: 122%;
    opacity: 0;
  }
}

@keyframes identityAdminPulse {
  0%,
  100% {
    border-color: rgba(74, 168, 232, 0.5);
  }
  50% {
    border-color: rgba(106, 213, 255, 0.78);
  }
}

@keyframes identityMemberPulse {
  0%,
  100% {
    border-color: rgba(46, 168, 126, 0.42);
  }
  50% {
    border-color: rgba(97, 213, 172, 0.7);
  }
}

@keyframes pinkPageGlow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.82;
    transform: scale(1.02);
  }
}

@keyframes logPanelSweep {
  0%,
  44% {
    left: -38%;
    opacity: 0;
  }
  60% {
    opacity: 0.85;
  }
  100% {
    left: 114%;
    opacity: 0;
  }
}

@keyframes loginWaterDrift {
  0% {
    background-position: 0 0, 34px 22px, 0 0;
  }
  100% {
    background-position: 120px 84px, -72px -56px, 0 0;
  }
}

@keyframes loginRipplePulse {
  0% {
    opacity: 0.2;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.38;
  }
  100% {
    opacity: 0.18;
    transform: scale(1.12);
  }
}

@keyframes refreshSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes preflightTrackFlow {
  0% {
    background-position: -120% 0;
    opacity: 0.48;
  }
  50% {
    opacity: 1;
  }
  100% {
    background-position: 220% 0;
    opacity: 0.58;
  }
}

@keyframes emptyStateGlow {
  0%,
  100% {
    box-shadow:
      0 12px 24px rgba(72, 154, 213, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
  50% {
    box-shadow:
      0 16px 34px rgba(72, 154, 213, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }
}

@keyframes toastIn {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions,
.panel-heading,
.inline-actions,
.action-bar,
.preset-row,
.bottom-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  position: relative;
  isolation: isolate;
  justify-content: flex-end;
  flex-wrap: wrap;
  overflow: hidden;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(219, 244, 255, 0.42));
  backdrop-filter: blur(16px);
  box-shadow:
    0 18px 38px rgba(58, 144, 207, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -12px 24px rgba(91, 184, 235, 0.08);
}

.topbar-actions::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 24px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 44%),
    repeating-linear-gradient(90deg, rgba(74, 168, 232, 0.08) 0 1px, transparent 1px 42px);
}

.topbar-actions::after {
  content: "";
  position: absolute;
  top: -55%;
  bottom: -55%;
  left: -34%;
  z-index: -1;
  width: 18%;
  pointer-events: none;
  opacity: 0;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(190, 238, 255, 0.52), rgba(255, 255, 255, 0));
  animation: topbarLightSweep 6.2s ease-in-out infinite;
}

.topbar-actions > * {
  position: relative;
  z-index: 1;
}

body.touch-control-mode .topbar {
  top: 10px;
  align-items: stretch;
  gap: 14px;
  margin: 10px 12px 0;
  padding: 16px 18px;
}

body.touch-control-mode .topbar-title {
  width: 100%;
  justify-content: center;
  gap: 10px;
}

body.touch-control-mode .brand-copy {
  width: auto;
  justify-items: center;
  align-items: center;
  text-align: center;
}

body.touch-control-mode .brand-copy h1,
body.touch-control-mode .brand-copy .eyebrow {
  width: auto;
  text-align: center;
}

body.touch-control-mode .brand-copy .eyebrow {
  text-align-last: auto;
}

body.touch-control-mode .top-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 304px;
  min-width: 0;
}

body.touch-control-mode .top-status .status-chip {
  --chip-accent: #4d87d5;
  --chip-ink: #1d5079;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 66px;
  height: 66px;
  border-radius: 19px;
  padding: 8px 6px 7px;
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-content: center;
  row-gap: 5px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--chip-accent) 28%, rgba(255, 255, 255, 0.82));
  background:
    radial-gradient(circle at 18% 12%, color-mix(in srgb, var(--chip-accent) 18%, transparent), transparent 46%),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.42), transparent 42%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--chip-accent) 14%, rgba(235, 247, 255, 0.92)));
  box-shadow:
    0 16px 32px color-mix(in srgb, var(--chip-accent) 16%, transparent),
    inset 0 -10px 18px color-mix(in srgb, var(--chip-accent) 10%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

body.touch-control-mode .top-status .status-chip::before {
  content: attr(data-short);
  display: block;
  position: relative;
  z-index: 1;
  color: var(--chip-ink);
  font-size: 10px;
  font-weight: 980;
  line-height: 1;
  letter-spacing: 0.06em;
  text-align: center;
}

body.touch-control-mode .top-status .status-chip span,
body.touch-control-mode .top-status .status-chip small {
  display: none;
}

body.touch-control-mode .top-status .status-chip strong {
  display: flex;
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 20px;
  min-width: 0;
  max-width: 100%;
  padding: 0 2px;
  color: var(--chip-ink);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.touch-control-mode .top-status .status-chip[data-state="idle"] {
  --chip-accent: #6f93bf;
  --chip-ink: #365474;
}

body.touch-control-mode .top-status .status-chip[data-state="ok"],
body.touch-control-mode .top-status .status-chip[data-state="live"] {
  --chip-accent: #3fb69f;
  --chip-ink: #0d6855;
}

body.touch-control-mode .top-status .status-chip[data-state="warn"] {
  --chip-accent: #d8a54b;
  --chip-ink: #8a6213;
}

body.touch-control-mode .top-status .status-chip[data-state="bad"] {
  --chip-accent: #df7b98;
  --chip-ink: #95485d;
}

body.touch-control-mode .topbar-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  width: 100%;
  justify-content: stretch;
  border-radius: 20px;
}

body.touch-control-mode .topbar-actions .top-button,
body.touch-control-mode .icon-button {
  min-height: 46px;
  font-size: 14px;
}

body.touch-control-mode .topbar-actions #openScriptLabBtn,
body.touch-control-mode .topbar-actions #openAdminBtn,
body.touch-control-mode .topbar-actions #openScreenTestBtn,
body.touch-control-mode .topbar-actions #openRunnerBtn,
body.touch-control-mode .topbar-actions #openEnvBtn {
  display: none;
}

body.touch-control-mode #loadPresetContactBtn {
  display: none;
}

.panel-heading {
  justify-content: space-between;
  margin-bottom: 16px;
}

.collapsible-heading {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
  margin: -4px -4px 12px;
  transition: background 0.16s ease;
}

.collapsible-heading:hover {
  background: rgba(232, 248, 255, 0.62);
}

.collapsible-heading:focus-visible {
  outline: 3px solid rgba(74, 168, 232, 0.24);
}

.heading-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.collapse-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(124, 188, 230, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.collapsible-panel[data-collapsed="1"] .collapsible-content {
  display: none;
}

.collapsible-panel[data-collapsed="1"] .collapsible-heading {
  margin-bottom: -4px;
}

.collapsible-panel[data-collapsed="1"] .collapse-icon {
  color: var(--muted);
}

.advanced-guard {
  border-color: rgba(124, 188, 230, 0.26);
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.1), rgba(115, 211, 255, 0) 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(234, 249, 255, 0.62));
}

.advanced-guard .panel-heading {
  margin-bottom: 12px;
}

.advanced-guard h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.script-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-top: 12px;
}

.script-action-row[data-has-upload="0"] {
  grid-template-columns: minmax(0, 1fr);
}

.image-quick-action-slot {
  min-width: 0;
}

.image-quick-action-slot[hidden] {
  display: none;
}

.advanced-debug-button,
.image-upload-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  border-color: rgba(124, 188, 230, 0.36);
  background:
    radial-gradient(circle at 16% 18%, rgba(115, 211, 255, 0.22), rgba(115, 211, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(229, 248, 255, 0.66));
  padding: 10px 12px;
  text-align: left;
  box-shadow:
    0 14px 34px rgba(74, 168, 232, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.advanced-debug-button b,
.image-upload-button strong {
  display: block;
}

.advanced-debug-button small,
.image-upload-button small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.advanced-modal-panel {
  width: min(720px, 100%);
}

.advanced-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.advanced-modal-grid .field:last-child {
  grid-column: 1 / -1;
}

.advanced-check-row {
  margin-top: 12px;
}

.guard-hint {
  margin: 0 0 12px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.guard-hint[data-tone="warning"] {
  border-color: rgba(184, 135, 46, 0.34);
  background: rgba(255, 249, 232, 0.84);
  color: #896526;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(460px, 1.1fr);
  gap: 20px;
  padding: 20px 18px 18px;
}

.monitor-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  align-content: stretch;
  gap: 16px;
  min-height: 0;
}

.monitor-dock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.log-dock-button,
.result-dock-button {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(280px, 1.18fr);
  align-items: center;
  gap: 22px;
  min-height: 170px;
  width: 100%;
  overflow: hidden;
  border-color: rgba(124, 188, 230, 0.42);
  border-radius: 8px;
  padding: 24px;
  text-align: left;
  background:
    radial-gradient(circle at 16% 18%, rgba(113, 214, 255, 0.22), rgba(113, 214, 255, 0) 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(221, 246, 255, 0.76) 62%, rgba(255, 237, 247, 0.72));
  box-shadow:
    0 24px 54px rgba(80, 156, 214, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -14px 28px rgba(88, 178, 231, 0.08);
}

.log-dock-button::before,
.result-dock-button::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 44%);
}

.log-dock-button > *,
.result-dock-button > * {
  position: relative;
  z-index: 1;
}

.log-dock-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.log-dock-button .eyebrow,
.result-dock-button .eyebrow {
  font-size: 13px;
}

.log-dock-copy strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

.log-dock-copy small {
  color: var(--muted);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.34;
}

.log-dock-stats {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.log-dock-stats span {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  border: 1px solid rgba(124, 188, 230, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  padding: 12px 16px;
}

.log-dock-stats b {
  color: var(--blue-strong);
  font-size: 16px;
}

.log-dock-stats em {
  overflow: hidden;
  color: var(--blue-strong);
  font-size: 18px;
  font-style: normal;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-dock-button {
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 210, 10, 0.18), rgba(255, 210, 10, 0) 36%),
    radial-gradient(circle at 82% 12%, rgba(113, 214, 255, 0.22), rgba(113, 214, 255, 0) 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(225, 247, 255, 0.78) 58%, rgba(255, 239, 248, 0.74));
}

.monitor-dock-grid .log-dock-button,
.monitor-dock-grid .result-dock-button {
  grid-template-columns: 1fr;
  gap: 14px;
  min-height: 238px;
  padding: 18px;
}

.monitor-dock-grid .log-dock-copy {
  gap: 7px;
}

.monitor-dock-grid .log-dock-copy strong {
  font-size: 22px;
}

.monitor-dock-grid .log-dock-copy small {
  font-size: 13px;
}

.monitor-dock-grid .log-dock-stats {
  gap: 8px;
}

.monitor-dock-grid .log-dock-stats span {
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  padding: 9px 10px;
}

.monitor-dock-grid .log-dock-stats b {
  font-size: 13px;
}

.monitor-dock-grid .log-dock-stats em {
  font-size: 14px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.14), rgba(115, 211, 255, 0) 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(232, 248, 255, 0.72));
  padding: 18px;
  backdrop-filter: blur(16px);
  box-shadow:
    0 24px 54px rgba(80, 156, 214, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -12px 24px rgba(88, 178, 231, 0.05) inset;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 92px;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
}

.panel > * {
  position: relative;
  z-index: 1;
}

.setup-panel {
  align-self: start;
  position: sticky;
  top: 126px;
}

.dashboard-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 14px;
  background: rgba(124, 188, 230, 0.24);
  box-shadow:
    0 18px 34px rgba(70, 152, 212, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.device-mode-banner {
  display: grid;
  gap: 5px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(124, 188, 230, 0.34);
  border-radius: 10px;
  background:
    radial-gradient(circle at 10% 10%, rgba(113, 214, 255, 0.18), rgba(113, 214, 255, 0) 38%),
    radial-gradient(circle at 88% 16%, rgba(255, 179, 224, 0.18), rgba(255, 179, 224, 0) 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(234, 249, 255, 0.74));
  box-shadow:
    0 16px 30px rgba(72, 154, 213, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.device-mode-banner strong {
  color: var(--blue-strong);
  font-size: 13px;
  font-weight: 900;
}

.device-mode-banner span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.touch-control-top-row {
  display: none;
}

.touch-action-bar-slot {
  display: none;
}

.touch-config-pair-slot {
  display: none;
}

.touch-config-column {
  display: none;
}

.control-mode-hub {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.control-runner-quick-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 16px;
}

.control-runner-chip {
  display: grid;
  gap: 2px;
  min-height: 58px;
  align-content: center;
  justify-items: start;
  border-color: rgba(124, 188, 230, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  background:
    radial-gradient(circle at 12% 10%, rgba(113, 214, 255, 0.14), rgba(113, 214, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(235, 248, 255, 0.72));
  box-shadow:
    0 12px 24px rgba(72, 154, 213, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.control-runner-chip strong {
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.control-runner-chip small {
  color: rgba(63, 85, 111, 0.82);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.control-runner-chip[data-state="active"] {
  border-color: rgba(74, 168, 232, 0.58);
  background:
    radial-gradient(circle at 10% 8%, rgba(88, 209, 255, 0.22), rgba(88, 209, 255, 0) 38%),
    linear-gradient(145deg, rgba(248, 255, 255, 0.96), rgba(227, 247, 255, 0.82));
  box-shadow:
    0 14px 28px rgba(72, 154, 213, 0.14),
    0 0 18px rgba(96, 214, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.control-runner-chip[data-state="online"] {
  border-color: rgba(107, 197, 160, 0.34);
}

.control-runner-chip[data-state="offline"] {
  border-color: rgba(225, 180, 76, 0.34);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 222, 145, 0.22), rgba(255, 222, 145, 0) 38%),
    linear-gradient(145deg, rgba(255, 252, 245, 0.94), rgba(255, 246, 224, 0.82));
}

.control-hub-button {
  display: grid;
  gap: 4px;
  min-height: 76px;
  align-content: center;
  justify-items: start;
  border-color: rgba(124, 188, 230, 0.34);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  background:
    radial-gradient(circle at 12% 10%, rgba(113, 214, 255, 0.2), rgba(113, 214, 255, 0) 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(228, 247, 255, 0.74));
  box-shadow:
    0 16px 30px rgba(72, 154, 213, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.control-hub-button[data-tone="live"] {
  border-color: rgba(77, 193, 239, 0.44);
  background:
    radial-gradient(circle at 10% 10%, rgba(88, 209, 255, 0.24), rgba(88, 209, 255, 0) 40%),
    radial-gradient(circle at 90% 14%, rgba(255, 168, 228, 0.18), rgba(255, 168, 228, 0) 42%),
    linear-gradient(145deg, rgba(248, 255, 255, 0.96), rgba(225, 247, 255, 0.84));
  box-shadow:
    0 18px 34px rgba(73, 167, 220, 0.16),
    0 0 22px rgba(96, 214, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.control-hub-button[data-tone="ok"] {
  border-color: rgba(107, 197, 160, 0.4);
  background:
    radial-gradient(circle at 12% 12%, rgba(124, 234, 190, 0.18), rgba(124, 234, 190, 0) 40%),
    linear-gradient(145deg, rgba(250, 255, 252, 0.94), rgba(232, 249, 241, 0.82));
}

.control-hub-button[data-tone="warn"] {
  border-color: rgba(225, 180, 76, 0.42);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 222, 145, 0.24), rgba(255, 222, 145, 0) 40%),
    linear-gradient(145deg, rgba(255, 252, 245, 0.95), rgba(255, 246, 224, 0.84));
}

.control-hub-button[data-tone="bad"] {
  border-color: rgba(214, 116, 140, 0.42);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 177, 199, 0.22), rgba(255, 177, 199, 0) 40%),
    linear-gradient(145deg, rgba(255, 248, 251, 0.95), rgba(255, 233, 239, 0.84));
}

.control-hub-button strong {
  color: var(--blue-strong);
  font-size: 14px;
  font-weight: 900;
}

.control-hub-button small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.control-hub-live {
  display: grid;
  gap: 2px;
  width: 100%;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(124, 188, 230, 0.2);
}

.control-hub-live em {
  color: var(--text-main);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.35;
}

.control-hub-live span {
  color: rgba(63, 85, 111, 0.82);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.touch-focus-pulse {
  position: relative;
}

.touch-focus-pulse::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 12px;
  border: 2px solid rgba(98, 206, 255, 0.58);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.88) inset,
    0 0 30px rgba(98, 206, 255, 0.28);
  animation: touchFocusPulse 1.2s ease-out forwards;
  pointer-events: none;
}

@keyframes touchFocusPulse {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}

.dashboard-metric {
  min-width: 0;
  padding: 12px 13px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(232, 248, 255, 0.64));
}

.dashboard-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-metric strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-section {
  position: relative;
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(124, 188, 230, 0.32);
}

.action-bar {
  position: relative;
  flex-wrap: wrap;
  align-items: stretch;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), rgba(219, 244, 255, 0.36));
  box-shadow:
    0 18px 38px rgba(58, 144, 207, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.action-bar button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
}

.execution-device-card {
  position: relative;
  flex: 1.35 1 250px;
  min-width: 240px;
  min-height: 78px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 12px 14px;
  border: 1px solid rgba(124, 188, 230, 0.34);
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 10%, rgba(116, 224, 255, 0.26), rgba(116, 224, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(229, 246, 255, 0.74));
  box-shadow:
    0 18px 36px rgba(64, 150, 209, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.execution-device-card[data-mode="remote"] {
  border-color: rgba(74, 168, 232, 0.5);
  box-shadow:
    0 18px 36px rgba(64, 150, 209, 0.18),
    0 0 28px rgba(103, 203, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.execution-device-card[data-mode="offline"],
.execution-device-card[data-mode="missing"] {
  border-color: rgba(198, 64, 78, 0.28);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 186, 196, 0.24), rgba(255, 186, 196, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 238, 241, 0.76));
}

.execution-device-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.execution-device-label {
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.execution-device-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.execution-device-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

#runPreflightBtn {
  flex: 1 1 150px;
}

#startRunBtn {
  flex: 1.4 1 190px;
  min-height: 48px;
  font-size: 15px;
}

#safeStopBtn,
#killRunBtn {
  flex: 1 1 130px;
}

.control-section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 86px;
  height: 1px;
  background: linear-gradient(90deg, rgba(74, 168, 232, 0.92), rgba(108, 213, 239, 0));
}

.inputs-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  margin-top: 0;
  border: 1px solid rgba(124, 188, 230, 0.3);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(115, 211, 255, 0.16), rgba(115, 211, 255, 0) 38%),
    radial-gradient(circle at 92% 8%, rgba(255, 164, 216, 0.14), rgba(255, 164, 216, 0) 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(232, 248, 255, 0.68));
  padding: 16px;
  box-shadow:
    0 18px 38px rgba(72, 154, 213, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.inputs-panel .section-label {
  flex: 0 0 auto;
}

.inputs-panel .dynamic-param-list {
  flex: 0 0 auto;
  min-height: auto;
  overflow-y: visible;
  align-content: start;
  padding-right: 0;
}

.script-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.script-source-grid .field {
  margin-bottom: 0;
}

.rule-summary {
  margin-top: 12px;
  border: 1px solid rgba(124, 188, 230, 0.3);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(113, 214, 255, 0.16), rgba(113, 214, 255, 0) 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(232, 248, 255, 0.56));
  color: var(--muted);
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.rule-summary strong {
  color: var(--blue-strong);
}

.rule-summary[data-state="unverified"] {
  border-color: rgba(184, 135, 46, 0.34);
  background: rgba(255, 249, 232, 0.84);
  color: #896526;
}

.rule-summary[data-state="blocked"] {
  border-color: rgba(199, 95, 113, 0.32);
  background: rgba(255, 235, 240, 0.84);
  color: #9a4555;
}

.runner-target-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.94fr) minmax(0, 1.06fr);
  gap: 12px;
  margin-top: 12px;
  align-items: end;
}

.runner-filter-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.runner-filter-toolbar button {
  min-height: 32px;
  border-color: rgba(124, 188, 230, 0.3);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
}

.runner-filter-toolbar button[aria-pressed="true"] {
  border-color: rgba(74, 168, 232, 0.58);
  background:
    radial-gradient(circle at 14% 0%, rgba(106, 213, 255, 0.24), rgba(106, 213, 255, 0) 40%),
    rgba(234, 248, 255, 0.92);
  color: var(--blue-strong);
  box-shadow:
    0 10px 22px rgba(72, 154, 213, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body:not(.touch-control-mode) #deviceModeBanner,
body:not(.touch-control-mode) #controlModeHub,
body:not(.touch-control-mode) #controlRunnerQuickList,
body:not(.touch-control-mode) .runner-filter-toolbar[data-runner-filter-group="main"],
body:not(.touch-control-mode) .runner-target-panel {
  display: none !important;
}

.runner-target-field {
  margin-bottom: 0;
}

.runner-target-hint {
  min-height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(124, 188, 230, 0.26);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(113, 214, 255, 0.12), rgba(113, 214, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(235, 248, 255, 0.56));
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

body.touch-control-mode .shell {
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px 12px 18px;
}

body.touch-control-mode .setup-panel {
  position: static;
  top: auto;
}

body.touch-control-mode .panel {
  padding: 16px;
}

body.touch-control-mode .dashboard-strip,
body.touch-control-mode .monitor-dock-grid,
body.touch-control-mode .script-action-row {
  grid-template-columns: 1fr;
}

body.touch-control-mode .runner-filter-toolbar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.touch-control-mode .runner-filter-toolbar[data-runner-filter-group="main"] {
  display: none;
}

body.touch-control-mode .touch-control-top-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}

body.touch-control-mode .touch-action-bar-slot {
  display: block;
  margin-top: 12px;
}

body.touch-control-mode .touch-config-pair-slot {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 12px;
  margin-bottom: 14px;
}

body.touch-control-mode .touch-config-column {
  display: grid;
  align-content: start;
  gap: 12px;
}

body.touch-control-mode #touchActionBarSlot .action-bar {
  width: 100%;
}

body.touch-control-mode .touch-control-top-row .device-mode-banner {
  width: 100%;
  min-height: 78px;
  margin-bottom: 0;
  padding: 10px 12px;
  align-content: center;
}

body.touch-control-mode .touch-control-top-row .device-mode-banner strong {
  font-size: 12px;
}

body.touch-control-mode .touch-control-top-row .device-mode-banner span {
  font-size: 11px;
}

body.touch-control-mode .runner-target-panel {
  display: flex;
  width: 100%;
  gap: 0;
  margin-top: 0;
}

body.touch-control-mode .runner-target-field {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  min-height: 78px;
  padding: 9px 10px;
  border: 1px solid rgba(124, 188, 230, 0.3);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 12%, rgba(113, 214, 255, 0.14), rgba(113, 214, 255, 0) 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(234, 248, 255, 0.76));
  box-shadow:
    0 12px 24px rgba(72, 154, 213, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body.touch-control-mode .runner-target-field > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

body.touch-control-mode .runner-target-field > span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(124, 188, 230, 0.42);
  box-shadow:
    0 0 0 3px rgba(124, 188, 230, 0.12),
    0 0 14px rgba(124, 188, 230, 0.18);
  flex: 0 0 auto;
}

body.touch-control-mode .runner-target-field[data-runner-state="online"] > span::before {
  background: #20b47a;
  box-shadow:
    0 0 0 3px rgba(32, 180, 122, 0.12),
    0 0 16px rgba(32, 180, 122, 0.24);
}

body.touch-control-mode .runner-target-field[data-runner-state="warn"] > span::before {
  background: #d49a2f;
  box-shadow:
    0 0 0 3px rgba(212, 154, 47, 0.12),
    0 0 16px rgba(212, 154, 47, 0.22);
}

body.touch-control-mode .runner-target-field[data-runner-state="bad"] > span::before {
  background: #cf5670;
  box-shadow:
    0 0 0 3px rgba(207, 86, 112, 0.12),
    0 0 16px rgba(207, 86, 112, 0.22);
}

body.touch-control-mode .runner-target-field > select {
  min-height: 40px;
  border-radius: 10px;
  padding-right: 8px;
}

body.touch-control-mode .runner-target-hint {
  display: none;
}

body.touch-control-mode .runner-target-field::after {
  content: attr(data-runner-state-label);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(124, 188, 230, 0.14);
  color: var(--blue-strong);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

body.touch-control-mode .runner-target-field[data-runner-state="online"]::after {
  background: rgba(32, 180, 122, 0.14);
  color: #117152;
}

body.touch-control-mode .runner-target-field[data-runner-state="warn"]::after {
  background: rgba(212, 154, 47, 0.14);
  color: #8b651f;
}

body.touch-control-mode .runner-target-field[data-runner-state="bad"]::after {
  background: rgba(207, 86, 112, 0.14);
  color: #9a4555;
}

body.touch-control-mode .control-mode-hub {
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, 1fr);
  grid-template-columns: none;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

body.touch-control-mode .control-mode-hub::-webkit-scrollbar {
  display: none;
}

body.touch-control-mode #controlHubRunnerBtn,
body.touch-control-mode .control-runner-quick-list {
  display: none !important;
}

body.touch-control-mode .control-mode-hub .control-hub-button {
  min-height: 86px;
  padding: 10px;
  gap: 3px;
}

body.touch-control-mode .control-mode-hub .control-hub-button > small {
  display: none;
}

body.touch-control-mode #controlHubLogsBtn,
body.touch-control-mode #controlHubResultsBtn,
body.touch-control-mode #controlHubPreflightBtn,
body.touch-control-mode #controlHubEnvBtn,
body.touch-control-mode #controlHubAdminBtn {
  grid-column: auto;
  min-height: 86px;
  grid-template-columns: 1fr;
  grid-template-areas: none;
  align-items: start;
  column-gap: 0;
}

body.touch-control-mode #controlHubLogsBtn > strong,
body.touch-control-mode #controlHubResultsBtn > strong,
body.touch-control-mode #controlHubPreflightBtn > strong,
body.touch-control-mode #controlHubEnvBtn > strong,
body.touch-control-mode #controlHubAdminBtn > strong {
  grid-area: auto;
  align-self: auto;
}

body.touch-control-mode #controlHubLogsBtn > small,
body.touch-control-mode #controlHubResultsBtn > small,
body.touch-control-mode #controlHubPreflightBtn > small,
body.touch-control-mode #controlHubEnvBtn > small,
body.touch-control-mode #controlHubAdminBtn > small {
  grid-area: auto;
  align-self: auto;
}

body.touch-control-mode .control-mode-hub .control-hub-live {
  width: 100%;
  min-width: 0;
  margin-top: 2px;
  padding-top: 0;
  border-top: 0;
  justify-items: start;
  align-self: start;
  text-align: left;
  gap: 3px;
}

body.touch-control-mode .control-mode-hub .control-hub-live em {
  font-size: 14px;
  line-height: 1.2;
}

body.touch-control-mode .control-mode-hub .control-hub-live span {
  font-size: 10px;
  line-height: 1.35;
}

body.touch-control-mode #controlHubLogsBtn .control-hub-live em,
body.touch-control-mode #controlHubResultsBtn .control-hub-live em {
  font-size: 16px;
}

body.touch-control-mode .monitor-dock-grid,
body.touch-control-mode .execution-device-card {
  display: none;
}

body.touch-control-mode #touchActionBarSlot .action-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

body.touch-control-mode #logsModal,
body.touch-control-mode #resultsModal {
  place-items: end stretch;
  padding: 12px 0 0;
  background: rgba(23, 52, 78, 0.3);
}

body.touch-control-mode #logsModal .modal-panel,
body.touch-control-mode #resultsModal .modal-panel {
  width: 100%;
  max-height: calc(100vh - 120px);
  border-radius: 24px 24px 0 0;
  border-bottom: 0;
  padding: 14px 14px 18px;
  touch-action: pan-y;
  transition:
    max-height 180ms ease,
    transform 180ms ease,
    border-radius 180ms ease;
}

.touch-sheet-handle {
  display: none;
}

body.touch-control-mode #logsModal .log-modal-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

body.touch-control-mode #resultsModal .result-center-summary,
body.touch-control-mode #resultsModal .result-filter-bar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.touch-control-mode #logsModal[data-sheet-state="expanded"] .modal-panel,
body.touch-control-mode #resultsModal[data-sheet-state="expanded"] .modal-panel,
body.touch-control-mode #logsModal .modal-panel[data-sheet-state="expanded"],
body.touch-control-mode #resultsModal .modal-panel[data-sheet-state="expanded"] {
  max-height: calc(100vh - 18px);
  border-radius: 20px 20px 0 0;
}

body.touch-control-mode #logsModal .modal-panel[data-dragging="1"],
body.touch-control-mode #resultsModal .modal-panel[data-dragging="1"] {
  transition: none;
}

body.touch-control-mode .touch-sheet-handle {
  position: relative;
  display: block;
  width: 72px;
  min-height: 22px;
  margin: 0 auto 8px;
  border: 0;
  background: transparent;
  padding: 0;
  outline: none;
}

body.touch-control-mode .touch-sheet-handle::before {
  content: "";
  display: block;
  width: 52px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: rgba(124, 188, 230, 0.44);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

body.touch-control-mode .touch-sheet-handle:focus-visible::before {
  background: rgba(74, 168, 232, 0.72);
  box-shadow:
    0 0 0 3px rgba(74, 168, 232, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;
}

body.touch-control-mode .action-bar {
  gap: 12px;
}

body.touch-control-mode .execution-device-card {
  flex-basis: 100%;
  min-width: 0;
}

body.touch-control-mode .log-dock-button,
body.touch-control-mode .result-dock-button {
  grid-template-columns: 1fr;
}

.startup-runner-target {
  margin: 14px 0 0;
}

.startup-runner-filter {
  margin-top: 14px;
}

.startup-runner-target small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.section-label {
  margin: 0 0 11px;
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dynamic-param-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.param-field {
  margin-bottom: 0;
}

.param-field[data-kind="textarea"],
.param-field[data-kind="select"],
.param-field[data-kind="image-upload"],
.param-field[data-kind="multi-select-chips"],
.param-field[data-kind="ordered-list-builder"] {
  grid-column: 1 / -1;
}

.quick-param-field {
  height: 100%;
  margin-bottom: 0;
}

.required-mark {
  margin-left: 6px;
  color: var(--red-strong);
  font-size: 11px;
  font-style: normal;
}

.param-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.execution-summary {
  margin: 12px 0 0;
  border: 1px solid rgba(74, 168, 232, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.14), rgba(115, 211, 255, 0) 36%),
    rgba(255, 255, 255, 0.64);
  color: #355d77;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.execution-summary[data-tone="warning"] {
  border-color: rgba(184, 135, 46, 0.34);
  background: rgba(255, 249, 232, 0.84);
  color: #896526;
}

.param-field input[type="checkbox"] {
  justify-self: start;
  width: 18px;
  min-height: 18px;
  box-shadow: none;
}

.image-upload-control {
  position: relative;
  display: grid;
  gap: 8px;
}

.strategy-param-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.multi-chip-control,
.ordered-builder-control {
  display: grid;
  gap: 10px;
}

.multi-chip-row,
.ordered-builder-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.multi-chip-option,
.ordered-builder-option {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(124, 188, 230, 0.3);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  box-shadow:
    0 10px 22px rgba(72, 154, 213, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.multi-chip-option[data-active="1"],
.ordered-builder-option[data-active="1"] {
  border-color: rgba(65, 172, 232, 0.56);
  background:
    radial-gradient(circle at 18% 14%, rgba(126, 224, 255, 0.26), rgba(126, 224, 255, 0) 42%),
    linear-gradient(145deg, rgba(237, 250, 255, 0.94), rgba(220, 244, 255, 0.84));
  color: var(--blue-strong);
  box-shadow:
    0 12px 26px rgba(72, 154, 213, 0.16),
    0 0 18px rgba(126, 224, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.ordered-builder-selected {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(124, 188, 230, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px;
}

.ordered-builder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(124, 188, 230, 0.2);
  border-radius: 8px;
  background: rgba(243, 251, 255, 0.86);
  padding: 8px 10px;
}

.ordered-builder-row span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.ordered-builder-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ordered-builder-actions button {
  width: 30px;
  min-height: 30px;
  border-radius: 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 900;
}

.ordered-builder-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.quick-param-field .image-upload-control {
  height: 100%;
}

.image-upload-button {
  position: relative;
  overflow: hidden;
}

.image-clear-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-height: 24px;
  border-color: rgba(41, 169, 96, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #19743d;
  padding: 0;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 8px 18px rgba(41, 169, 96, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.image-upload-control[data-state="uploaded"] .image-clear-button {
  display: inline-flex;
}

.image-upload-preview {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 12;
  display: none;
  width: 178px;
  overflow: hidden;
  border: 1px solid rgba(124, 188, 230, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 7px;
  box-shadow:
    0 20px 42px rgba(72, 154, 213, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.image-preview-current {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: contain;
  background:
    linear-gradient(45deg, rgba(124, 188, 230, 0.14) 25%, transparent 25% 75%, rgba(124, 188, 230, 0.14) 75%),
    linear-gradient(45deg, rgba(124, 188, 230, 0.14) 25%, transparent 25% 75%, rgba(124, 188, 230, 0.14) 75%);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}

.image-preview-current[hidden] {
  display: none;
}

.image-upload-recent {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.image-preview-current:not([hidden]) + .image-upload-recent {
  margin-top: 7px;
}

.image-recent-item {
  display: grid;
  gap: 3px;
  min-height: 0;
  border-color: rgba(124, 188, 230, 0.24);
  background: rgba(235, 248, 255, 0.8);
  padding: 5px;
  text-align: center;
}

.image-recent-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 5px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.72);
}

.image-recent-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-upload-control[data-state="uploaded"]:hover .image-upload-preview,
.image-upload-control[data-state="uploaded"]:focus-within .image-upload-preview,
.image-upload-control[data-has-recent="1"]:hover .image-upload-preview,
.image-upload-control[data-has-recent="1"]:focus-within .image-upload-preview {
  display: block;
}

.image-upload-button::after {
  content: "";
  position: absolute;
  inset: -35% -15%;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-28%);
  background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.64), transparent 64%);
}

.image-upload-button[data-state="missing"] {
  border-color: rgba(202, 155, 36, 0.48);
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 230, 128, 0.42), rgba(255, 230, 128, 0) 40%),
    linear-gradient(145deg, rgba(255, 252, 232, 0.96), rgba(255, 238, 157, 0.68));
  color: #8a6513;
  box-shadow:
    0 0 0 1px rgba(255, 219, 93, 0.18),
    0 12px 28px rgba(202, 155, 36, 0.18);
  animation: imageUploadMissingGlow 2.8s ease-in-out infinite;
}

.image-upload-button[data-state="uploaded"] {
  border-color: rgba(41, 169, 96, 0.5);
  background:
    radial-gradient(circle at 12% 14%, rgba(116, 255, 177, 0.34), rgba(116, 255, 177, 0) 42%),
    linear-gradient(145deg, rgba(236, 255, 244, 0.98), rgba(185, 246, 213, 0.74));
  color: #19743d;
  box-shadow:
    0 0 0 1px rgba(95, 232, 154, 0.18),
    0 0 26px rgba(41, 169, 96, 0.22);
  animation: imageUploadReadyGlow 2.4s ease-in-out infinite;
}

.image-upload-button[data-state="uploading"] {
  border-color: rgba(74, 168, 232, 0.54);
  background:
    radial-gradient(circle at 12% 14%, rgba(115, 211, 255, 0.34), rgba(115, 211, 255, 0) 42%),
    rgba(235, 248, 255, 0.92);
  color: var(--blue-strong);
}

.image-upload-button[data-state="uploading"]::after,
.image-upload-button[data-state="uploaded"]::after {
  opacity: 1;
  animation: imageUploadShine 2.2s ease-in-out infinite;
}

.image-upload-button[data-state="error"] {
  border-color: rgba(198, 64, 78, 0.46);
  background: rgba(251, 229, 229, 0.92);
  color: var(--red-strong);
}

@keyframes imageUploadMissingGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 219, 93, 0.16),
      0 12px 28px rgba(202, 155, 36, 0.15);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 219, 93, 0.32),
      0 0 30px rgba(255, 213, 77, 0.32);
  }
}

@keyframes imageUploadReadyGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(95, 232, 154, 0.18),
      0 0 24px rgba(41, 169, 96, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(95, 232, 154, 0.34),
      0 0 36px rgba(53, 214, 124, 0.36);
  }
}

@keyframes imageUploadShine {
  0% {
    transform: translateX(-34%);
  }
  58%,
  100% {
    transform: translateX(44%);
  }
}

.empty-params {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed rgba(124, 188, 230, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.12), rgba(115, 211, 255, 0) 38%),
    rgba(255, 255, 255, 0.58);
  color: var(--muted);
  padding: 14px;
  font-size: 13px;
}

.empty-state {
  display: grid;
  gap: 5px;
  border-style: solid;
  box-shadow:
    0 12px 24px rgba(72, 154, 213, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

.empty-state span {
  color: var(--muted);
  line-height: 1.4;
}

#preflightModal[data-state="checking"] .empty-state {
  animation: emptyStateGlow 1.8s ease-in-out infinite;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
  box-shadow:
    inset 0 1px 4px rgba(71, 143, 194, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.72);
}

.field textarea {
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(74, 168, 232, 0.18);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.switch-grid label,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: linear-gradient(180deg, rgba(242, 250, 255, 0.92), rgba(224, 244, 255, 0.78));
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  box-shadow:
    0 8px 18px rgba(74, 156, 215, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.check-row {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.preset-row {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.preset-row button,
.inline-actions button,
.top-button,
.secondary-button {
  padding: 0 12px;
}

.topbar-actions .top-button {
  position: relative;
  overflow: hidden;
  min-height: 40px;
  border-color: rgba(112, 190, 236, 0.42);
  border-radius: 18px;
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(224, 245, 255, 0.66));
  color: #1e668f;
  font-size: 13px;
  font-weight: 900;
  box-shadow:
    0 12px 22px rgba(58, 144, 207, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -10px 18px rgba(91, 184, 235, 0.12);
}

.topbar-actions .top-button::after {
  content: "";
  position: absolute;
  top: -45%;
  bottom: -45%;
  left: -70%;
  width: 46%;
  pointer-events: none;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: left 0.28s ease, opacity 0.28s ease;
}

.topbar-actions .top-button:hover {
  border-color: rgba(74, 168, 232, 0.72);
  background:
    radial-gradient(circle at 26% 18%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(209, 241, 255, 0.72));
  box-shadow:
    0 18px 30px rgba(58, 144, 207, 0.18),
    0 0 18px rgba(106, 213, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -10px 18px rgba(91, 184, 235, 0.12);
}

.topbar-actions .top-button:hover::after {
  left: 124%;
  opacity: 1;
}

.topbar-actions .top-button:active {
  transform: translateY(1px) scale(0.985);
  box-shadow:
    0 7px 14px rgba(58, 144, 207, 0.1),
    inset 0 2px 8px rgba(44, 126, 184, 0.14);
}

.auth-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: 190px;
  overflow: hidden;
  border: 1px solid rgba(124, 188, 230, 0.44);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(229, 247, 255, 0.66));
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow:
    0 12px 22px rgba(58, 144, 207, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -12px 20px rgba(91, 184, 235, 0.08);
}

.auth-status::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(93, 147, 181, 0.12);
}

.auth-status[data-state="admin"] {
  border-color: rgba(74, 168, 232, 0.5);
  background:
    radial-gradient(circle at 16% 20%, rgba(106, 213, 255, 0.28), rgba(106, 213, 255, 0) 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(223, 245, 255, 0.72));
  color: var(--blue-strong);
}

.auth-status[data-state="admin"]::before {
  background: var(--blue);
  box-shadow:
    0 0 0 4px rgba(74, 168, 232, 0.14),
    0 0 14px rgba(74, 168, 232, 0.4);
}

.auth-status[data-state="member"] {
  border-color: rgba(46, 168, 126, 0.42);
  background:
    radial-gradient(circle at 16% 20%, rgba(97, 213, 172, 0.24), rgba(97, 213, 172, 0) 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(226, 249, 241, 0.72));
  color: var(--green-strong);
}

.auth-status[data-state="member"]::before {
  background: var(--green);
  box-shadow:
    0 0 0 4px rgba(46, 168, 126, 0.12),
    0 0 14px rgba(46, 168, 126, 0.32);
}

.auth-status[data-state="bad"] {
  border-color: rgba(199, 95, 113, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 234, 239, 0.72));
  color: var(--red-strong);
}

.auth-status[data-state="bad"]::before {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(199, 95, 113, 0.12);
}

.primary-button {
  border-color: rgba(36, 127, 190, 0.68);
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, #4aa8e8, #6cd5ef);
  color: #ffffff;
  padding: 0 16px;
  box-shadow:
    0 16px 30px rgba(36, 127, 190, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.primary-button:hover {
  border-color: var(--blue-strong);
  background: linear-gradient(135deg, #247fbe, #4fc6e6);
}

.danger-button {
  border-color: var(--red-strong);
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, var(--red), #e58b9b);
  color: #ffffff;
  padding: 0 16px;
  box-shadow:
    0 14px 28px rgba(167, 64, 84, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.danger-button:hover {
  border-color: var(--red-strong);
  background: var(--red-strong);
}

#startRunBtn {
  border-color: rgba(36, 127, 190, 0.82);
  box-shadow:
    0 18px 34px rgba(36, 127, 190, 0.28),
    0 0 0 1px rgba(108, 213, 239, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -14px 24px rgba(36, 127, 190, 0.12);
}

#runPreflightBtn {
  color: var(--blue-strong);
}

#safeStopBtn {
  box-shadow:
    0 16px 30px rgba(167, 64, 84, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#killRunBtn {
  color: var(--red-strong);
  border-color: rgba(199, 95, 113, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 234, 239, 0.72));
}

.icon-button {
  width: 38px;
  padding: 0;
}

#refreshAllBtn {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-color: rgba(87, 184, 241, 0.52);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(218, 244, 255, 0.7));
  color: var(--blue-strong);
  font-size: 18px;
  font-weight: 900;
  box-shadow:
    0 16px 30px rgba(58, 144, 207, 0.18),
    0 0 18px rgba(106, 213, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -12px 20px rgba(91, 184, 235, 0.16);
}

#refreshAllBtn:hover {
  border-color: rgba(36, 127, 190, 0.58);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(199, 238, 255, 0.8));
  transform: translateY(-1px);
}

#refreshAllBtn.is-refreshing {
  animation: refreshSpin 0.72s linear infinite;
  pointer-events: none;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.state-idle {
  background: rgba(218, 239, 255, 0.86);
  color: #355d77;
}

.state-running {
  background: #dff4ea;
  color: var(--green-strong);
}

.state-warning {
  background: rgba(255, 249, 232, 0.92);
  color: #896526;
}

.state-failed {
  background: #fbe5e5;
  color: var(--red-strong);
}

.state-completed {
  background: rgba(213, 243, 255, 0.9);
  color: var(--blue-strong);
}

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

.check-item {
  display: block;
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(231, 247, 255, 0.66));
  text-align: left;
  box-shadow:
    0 14px 28px rgba(72, 154, 213, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.check-item:hover {
  border-color: var(--blue);
  background: #ffffff;
}

.check-item strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
}

.check-title {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.check-scope {
  border: 1px solid rgba(78, 178, 240, 0.24);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(231, 247, 255, 0.68);
  color: var(--blue-strong);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.check-issue {
  border: 1px solid rgba(184, 135, 46, 0.28);
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(255, 247, 222, 0.76);
  color: #9b6a00;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.check-issue[data-issue="permission"] {
  border-color: rgba(243, 187, 73, 0.5);
  background: rgba(255, 248, 220, 0.9);
  color: #946000;
}

.check-issue[data-issue="dependency"] {
  border-color: rgba(124, 188, 230, 0.45);
  background: rgba(231, 247, 255, 0.9);
  color: var(--blue-strong);
}

.check-issue[data-issue="chrome"],
.check-issue[data-issue="cdp"] {
  border-color: rgba(199, 95, 113, 0.34);
  background: rgba(255, 240, 246, 0.86);
  color: #b44067;
}

.check-issue[data-issue="runner"] {
  border-color: rgba(115, 116, 207, 0.34);
  background: rgba(240, 242, 255, 0.86);
  color: #4d54a8;
}

.check-item p {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.check-action {
  display: inline-flex;
  margin-top: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.workspace-state-button {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  border-width: 2px;
}

.workspace-state-button::after {
  content: "";
  position: absolute;
  inset: auto 12px 10px 12px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
  opacity: 0.78;
}

.workspace-state-button[data-workspace-state="configured"] {
  border-color: rgba(46, 168, 126, 0.46);
  background: linear-gradient(135deg, rgba(240, 255, 251, 0.96), rgba(220, 247, 255, 0.78));
}

.workspace-state-button[data-workspace-state="configured"]::after {
  background: var(--green);
}

.workspace-state-button[data-workspace-state="unconfigured"] {
  border-color: rgba(184, 135, 46, 0.44);
  background: linear-gradient(135deg, rgba(255, 251, 241, 0.96), rgba(226, 246, 255, 0.76));
}

.workspace-state-button[data-workspace-state="unconfigured"]::after {
  background: var(--amber);
}

.workspace-state-button[data-workspace-state="unavailable"] {
  border-color: rgba(199, 95, 113, 0.46);
  background: linear-gradient(135deg, rgba(255, 246, 248, 0.96), rgba(229, 245, 255, 0.76));
}

.workspace-state-button[data-workspace-state="unavailable"]::after {
  background: var(--red);
}

.workspace-state-button[data-workspace-state="permission"] {
  border-color: rgba(243, 187, 73, 0.58);
  background: linear-gradient(135deg, rgba(255, 249, 230, 0.98), rgba(230, 245, 255, 0.82));
  box-shadow: 0 14px 32px rgba(243, 187, 73, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.workspace-state-button[data-workspace-state="permission"]::after {
  background: var(--amber);
  box-shadow: 0 0 14px rgba(243, 187, 73, 0.58);
}

.workspace-status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--blue-strong);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 11px;
}

.badge-ok {
  background: #dff4ea;
  color: var(--green-strong);
}

.badge-bad {
  background: #fbe5e5;
  color: var(--red-strong);
}

.badge-soft {
  background: rgba(232, 244, 255, 0.9);
  color: var(--blue-strong);
}

.preflight-list {
  display: grid;
  gap: 8px;
}

.startup-panel {
  width: min(860px, 100%);
  background:
    radial-gradient(circle at 12% 6%, rgba(117, 207, 255, 0.24), rgba(117, 207, 255, 0) 34%),
    radial-gradient(circle at 86% 10%, rgba(255, 199, 238, 0.24), rgba(255, 199, 238, 0) 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(230, 248, 255, 0.8));
}

.startup-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 12px;
}

.startup-step-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 112px;
  border: 1px solid rgba(124, 188, 230, 0.34);
  border-radius: 14px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(234, 249, 255, 0.72));
  box-shadow:
    0 18px 34px rgba(70, 152, 212, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.startup-step-card[data-state="ok"] {
  border-color: rgba(46, 168, 126, 0.34);
  background:
    radial-gradient(circle at 14% 12%, rgba(219, 255, 242, 0.72), rgba(219, 255, 242, 0) 42%),
    linear-gradient(180deg, rgba(244, 255, 250, 0.94), rgba(228, 248, 255, 0.76));
}

.startup-step-card[data-state="failed"] {
  border-color: rgba(199, 95, 113, 0.3);
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 226, 234, 0.72), rgba(255, 226, 234, 0) 42%),
    linear-gradient(180deg, rgba(255, 249, 251, 0.94), rgba(231, 248, 255, 0.76));
}

.startup-step-no {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(83, 179, 242, 0.95), rgba(141, 217, 255, 0.88));
  color: #fff;
  font-weight: 950;
  box-shadow:
    0 10px 22px rgba(74, 168, 232, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.startup-step-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 18px;
}

.startup-step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.startup-env-summary {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding-right: 3px;
}

.startup-env-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.36fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(124, 188, 230, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
}

.startup-env-row[data-tone="ok"] {
  border-color: rgba(46, 168, 126, 0.28);
  background: rgba(241, 255, 249, 0.78);
}

.startup-env-row[data-tone="warn"] {
  border-color: rgba(184, 135, 46, 0.28);
  background: rgba(255, 250, 237, 0.78);
}

.startup-env-row[data-tone="bad"] {
  border-color: rgba(199, 95, 113, 0.28);
  background: rgba(255, 246, 248, 0.78);
}

.startup-env-row strong {
  color: var(--ink);
  font-size: 13px;
}

.startup-env-row span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.startup-actions {
  justify-content: flex-end;
}

.preflight-modal-panel {
  width: min(1040px, 100%);
  background:
    radial-gradient(circle at 10% 0%, rgba(91, 198, 255, 0.18), rgba(91, 198, 255, 0) 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 248, 255, 0.78));
}

.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.preflight-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(124, 188, 230, 0.32);
  border-radius: 14px;
  background: rgba(124, 188, 230, 0.26);
  box-shadow:
    0 16px 34px rgba(70, 152, 212, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.preflight-step {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 12px;
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 42%),
    rgba(255, 255, 255, 0.68);
}

.preflight-step::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 3px;
  border-radius: 999px;
  background: rgba(124, 188, 230, 0.22);
}

.preflight-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.preflight-step strong {
  color: var(--ink);
  font-size: 14px;
}

.preflight-step[data-state="ok"] {
  background: linear-gradient(180deg, rgba(235, 252, 246, 0.94), rgba(226, 248, 255, 0.74));
}

.preflight-step[data-state="ok"]::before {
  background: linear-gradient(90deg, var(--green), rgba(108, 213, 239, 0.7));
  box-shadow: 0 0 12px rgba(46, 168, 126, 0.24);
}

.preflight-step[data-state="ok"] strong {
  color: var(--green-strong);
}

.preflight-step[data-state="failed"] {
  background: linear-gradient(180deg, rgba(255, 246, 248, 0.94), rgba(235, 248, 255, 0.74));
}

.preflight-step[data-state="failed"]::before {
  background: linear-gradient(90deg, var(--red), rgba(255, 172, 189, 0.72));
  box-shadow: 0 0 12px rgba(199, 95, 113, 0.22);
}

.preflight-step[data-state="failed"] strong {
  color: var(--red-strong);
}

.preflight-step[data-state="running"] {
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, rgba(245, 253, 255, 0.96), rgba(226, 248, 255, 0.74));
}

.preflight-step[data-state="running"]::before {
  background:
    linear-gradient(90deg, rgba(74, 168, 232, 0), rgba(74, 168, 232, 0.92), rgba(108, 213, 239, 0), rgba(74, 168, 232, 0.78), rgba(74, 168, 232, 0));
  background-size: 220% 100%;
  box-shadow: 0 0 12px rgba(74, 168, 232, 0.22);
  animation: preflightTrackFlow 1.4s ease-in-out infinite;
  animation-delay: calc(var(--step-index) * 0.12s);
}

.preflight-step[data-state="running"] strong {
  color: var(--blue-strong);
}

.preflight-list-modal {
  max-height: min(430px, calc(100vh - 390px));
  overflow: auto;
  padding-right: 3px;
}

.preflight-device-banner {
  display: grid;
  flex: 1 1 520px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: min(560px, 100%);
  border: 1px solid rgba(124, 188, 230, 0.34);
  border-radius: 10px;
  background:
    radial-gradient(circle at 8% 0%, rgba(115, 211, 255, 0.18), rgba(115, 211, 255, 0) 42%),
    rgba(255, 255, 255, 0.72);
  padding: 8px;
  box-shadow:
    0 12px 26px rgba(72, 154, 213, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.preflight-device-banner[data-mode="ready"] {
  border-color: rgba(46, 168, 126, 0.34);
  box-shadow:
    0 12px 26px rgba(72, 154, 213, 0.1),
    0 0 20px rgba(46, 168, 126, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.preflight-device-banner[data-mode="blocked"] {
  border-color: rgba(199, 95, 113, 0.3);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 164, 208, 0.16), rgba(255, 164, 208, 0) 42%),
    rgba(255, 255, 255, 0.74);
}

.preflight-device-banner span {
  min-width: 0;
  border: 1px solid rgba(124, 188, 230, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  padding: 7px 9px;
}

.preflight-device-banner em,
.preflight-device-banner strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-device-banner em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.preflight-device-banner strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.preflight-item {
  display: grid;
  grid-template-columns: 46px minmax(120px, 0.62fr) minmax(0, 1.2fr) minmax(126px, auto);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(235, 249, 255, 0.66));
  padding: 9px;
  box-shadow:
    0 10px 22px rgba(72, 154, 213, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.preflight-item[data-ok="0"] {
  border-color: rgba(199, 95, 113, 0.28);
  background: rgba(255, 246, 248, 0.78);
}

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

.preflight-item small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.preflight-fix-slot {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.preflight-fix-button {
  min-height: 32px;
  white-space: nowrap;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.log-view {
  width: 100%;
  min-height: 290px;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: var(--code);
  color: #dff5ff;
  padding: 14px;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.log-view.short {
  min-height: 130px;
  max-height: 210px;
}

.logs-panel {
  width: min(1260px, 100%);
}

.log-device-banner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(124, 188, 230, 0.34);
  border-radius: 10px;
  background:
    radial-gradient(circle at 8% 0%, rgba(115, 211, 255, 0.2), rgba(115, 211, 255, 0) 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(230, 248, 255, 0.64));
  padding: 10px;
  box-shadow:
    0 14px 30px rgba(72, 154, 213, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.log-device-banner[data-mode="runner"] {
  border-color: rgba(74, 168, 232, 0.5);
  box-shadow:
    0 14px 30px rgba(72, 154, 213, 0.16),
    0 0 22px rgba(106, 213, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.log-device-banner[data-mode="missing"] {
  border-color: rgba(199, 95, 113, 0.28);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 164, 208, 0.18), rgba(255, 164, 208, 0) 42%),
    rgba(255, 255, 255, 0.76);
}

.log-device-banner span {
  min-width: 0;
  border: 1px solid rgba(124, 188, 230, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  padding: 8px 10px;
}

.log-device-banner em,
.log-device-banner strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-device-banner em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.log-device-banner strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.log-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.log-modal-pane {
  min-width: 0;
  border: 1px solid rgba(124, 188, 230, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
}

.log-modal-pane h3 {
  margin: 0;
  color: var(--ink);
}

.log-pane-actions {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.log-search-input {
  width: min(190px, 100%);
  min-height: 32px;
  border: 1px solid rgba(124, 188, 230, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.log-search-input:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(74, 168, 232, 0.16);
}

.copy-log-button,
.clear-log-button {
  min-height: 32px;
  border-color: rgba(74, 168, 232, 0.3);
  background:
    radial-gradient(circle at 18% 0%, rgba(115, 211, 255, 0.18), rgba(115, 211, 255, 0) 48%),
    rgba(235, 248, 255, 0.8);
  color: var(--blue-strong);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.copy-log-button:hover,
.copy-log-button:focus-visible,
.clear-log-button:hover,
.clear-log-button:focus-visible {
  border-color: rgba(74, 168, 232, 0.62);
  background: rgba(226, 246, 255, 0.94);
}

.clear-log-button {
  border-color: rgba(184, 135, 46, 0.28);
  background: rgba(255, 249, 232, 0.78);
  color: #896526;
}

.log-view-modal {
  min-height: min(560px, calc(100vh - 250px));
  max-height: min(560px, calc(100vh - 250px));
}

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

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 13px;
}

.results-panel {
  position: relative;
  width: min(1260px, 100%);
}

.result-batch-summary {
  max-width: min(860px, 78vw);
  margin-top: 8px;
  border: 1px solid rgba(74, 168, 232, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 8% 0%, rgba(106, 213, 255, 0.14), rgba(106, 213, 255, 0) 38%),
    rgba(255, 255, 255, 0.68);
  color: var(--blue-strong);
  padding: 8px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

#resultsModal[data-loading="1"] .results-panel::after {
  content: "正在刷新运行结果...";
  position: absolute;
  top: 88px;
  right: 24px;
  z-index: 4;
  border: 1px solid rgba(124, 188, 230, 0.34);
  border-radius: 8px;
  background: rgba(246, 253, 255, 0.94);
  color: var(--blue-strong);
  padding: 8px 12px;
  box-shadow: 0 12px 28px rgba(72, 154, 213, 0.16);
  font-size: 13px;
  font-weight: 800;
}

.result-center-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.result-center-summary .dashboard-metric {
  min-height: 96px;
  border: 1px solid rgba(124, 188, 230, 0.3);
  border-radius: 12px;
  padding: 16px;
  box-shadow:
    0 16px 32px rgba(72, 154, 213, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.result-center-summary .dashboard-metric span {
  margin-bottom: 8px;
  font-size: 13px;
}

.result-center-summary .dashboard-metric strong {
  color: var(--blue-strong);
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
}

.result-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(124, 188, 230, 0.3);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.14), rgba(115, 211, 255, 0) 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(232, 248, 255, 0.58));
  padding: 14px;
  box-shadow:
    0 12px 26px rgba(72, 154, 213, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.result-run-filter-hint {
  grid-column: 1 / 4;
  grid-row: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(74, 168, 232, 0.28);
  border-radius: 10px;
  background:
    radial-gradient(circle at 8% 0%, rgba(106, 213, 255, 0.16), rgba(106, 213, 255, 0) 38%),
    rgba(255, 255, 255, 0.66);
  padding: 8px 10px;
}

.result-run-filter-hint[hidden] {
  display: none;
}

.result-run-filter-hint span,
.result-run-filter-hint strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-run-filter-hint span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.result-run-filter-hint strong {
  color: var(--blue-strong);
  font-size: 13px;
}

.result-run-filter-hint button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.result-filter-bar .field {
  grid-row: 2;
  height: 100%;
  margin-bottom: 0;
  font-size: 14px;
}

.result-filter-bar .field > span {
  font-size: 13px;
  font-weight: 900;
}

.result-filter-bar .field select,
.result-filter-bar .field input {
  min-height: 52px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 850;
}

.result-custom-range {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
}

.result-custom-range[hidden] {
  display: none;
}

#refreshResultsBtn {
  grid-column: 4;
  grid-row: 1;
  min-height: 52px;
  align-self: end;
  border-radius: 10px;
  color: var(--blue-strong);
  padding: 0 18px;
  font-size: 17px;
  font-weight: 950;
}

.results-table-wrap {
  max-height: min(520px, calc(100vh - 360px));
  background: rgba(255, 255, 255, 0.48);
}

.results-table {
  --result-script-sticky-width: 210px;
  --result-sequence-sticky-width: 78px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 1280px;
}

.result-col-script {
  width: var(--result-script-sticky-width);
}

.result-col-sequence {
  width: var(--result-sequence-sticky-width);
}

.result-col-creator {
  width: 14%;
}

.result-col-flag {
  width: 7%;
}

.result-col-status {
  width: 11%;
}

.result-col-reason {
  width: 21%;
}

.result-col-time {
  width: 11%;
}

.results-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.results-table th,
.results-table td {
  height: 52px;
  vertical-align: middle;
}

.results-table tbody tr {
  --result-row-bg: rgba(255, 255, 255, 0.5);
  background: var(--result-row-bg);
}

.results-table tbody tr:nth-child(even) {
  --result-row-bg: rgba(235, 248, 255, 0.38);
  background: var(--result-row-bg);
}

.results-table tbody tr:hover {
  --result-row-bg: rgba(226, 246, 255, 0.72);
  background: var(--result-row-bg);
}

.results-table thead th:nth-child(1),
.results-table thead th:nth-child(2),
.results-table tbody td.result-script-cell,
.results-table tbody td.result-sequence-cell {
  position: sticky;
}

.results-table thead th:nth-child(1),
.results-table tbody td.result-script-cell {
  left: 0;
}

.results-table thead th:nth-child(2),
.results-table tbody td.result-sequence-cell {
  left: var(--result-script-sticky-width);
  box-shadow: 12px 0 18px -18px rgba(31, 118, 184, 0.55);
}

.results-table thead th:nth-child(1),
.results-table thead th:nth-child(2) {
  z-index: 6;
}

.results-table tbody td.result-script-cell,
.results-table tbody td.result-sequence-cell {
  z-index: 3;
  background: var(--result-row-bg);
}

.results-table td:first-child strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-creator-cell,
.result-time-cell {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-time-cell {
  color: var(--muted);
  font-size: 12px;
}

.result-flag-cell,
.result-sequence-cell,
.result-status-cell,
.result-time-cell {
  text-align: center;
}

.result-sequence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 26px;
  border: 1px solid rgba(74, 168, 232, 0.3);
  border-radius: 999px;
  background: rgba(235, 248, 255, 0.82);
  color: var(--blue-strong);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 950;
}

.result-sequence[data-state="snapshot"] {
  min-width: 42px;
  border-color: rgba(124, 188, 230, 0.3);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 11px;
}

.result-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 26px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.result-flag[data-state="yes"] {
  border-color: rgba(46, 168, 126, 0.32);
  background: rgba(226, 249, 241, 0.86);
  color: #1d7b5d;
}

.result-flag[data-state="no"] {
  border-color: rgba(199, 95, 113, 0.22);
  background: rgba(255, 244, 247, 0.76);
  color: #9a4555;
}

.result-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.result-status-full_sop {
  border-color: rgba(46, 168, 126, 0.34);
  background: rgba(226, 249, 241, 0.86);
  color: #1d7b5d;
}

.result-status-partial_sop,
.result-status-stopped {
  border-color: rgba(184, 135, 46, 0.32);
  background: rgba(255, 249, 232, 0.86);
  color: #896526;
}

.result-status-touched {
  border-color: rgba(74, 168, 232, 0.34);
  background: rgba(229, 247, 255, 0.86);
  color: var(--blue-strong);
}

.result-status-run_snapshot {
  border-color: rgba(124, 188, 230, 0.36);
  background: rgba(235, 248, 255, 0.92);
  color: #355d77;
}

.result-status-no_touch,
.result-status-error {
  border-color: rgba(199, 95, 113, 0.34);
  background: rgba(255, 235, 240, 0.86);
  color: #9a4555;
}

.result-reason {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.result-reason-text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.snapshot-detail-button {
  flex: 0 0 auto;
  min-height: 30px;
  border-color: rgba(74, 168, 232, 0.28);
  background: rgba(235, 248, 255, 0.78);
  color: var(--blue-strong);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.result-empty-cell {
  height: 96px;
  text-align: center;
}

.snapshot-drawer {
  position: absolute;
  top: 78px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  width: min(440px, calc(100% - 36px));
  border: 1px solid rgba(124, 188, 230, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.16), rgba(115, 211, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(232, 248, 255, 0.92));
  padding: 14px;
  box-shadow:
    -18px 0 46px rgba(54, 137, 199, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.snapshot-drawer[hidden] {
  display: none;
}

.snapshot-drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.snapshot-drawer-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

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

.snapshot-summary span {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(124, 188, 230, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.snapshot-summary b {
  color: var(--blue-strong);
  font-size: 11px;
}

.snapshot-params {
  min-height: 0;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: var(--code);
  color: #dff5ff;
  padding: 12px;
  font: 11px/1.48 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.result-params-details summary {
  cursor: pointer;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 900;
}

.result-params-details pre {
  max-height: 190px;
  margin: 7px 0 0;
  overflow: auto;
  border-radius: 8px;
  background: var(--code);
  color: #dff5ff;
  padding: 10px;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(25, 68, 96, 0.34);
  backdrop-filter: blur(10px);
  padding: 18px;
}

.modal-backdrop[hidden] {
  display: none;
}

#loginModal {
  overflow: hidden;
  background: rgba(25, 68, 96, 0.28);
  backdrop-filter: blur(12px) saturate(1.2);
}

#loginModal::before,
#loginModal::after {
  content: "";
  position: absolute;
  inset: -16%;
  z-index: 0;
  pointer-events: none;
}

#loginModal::before {
  background:
    repeating-radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0) 0 30px, rgba(255, 255, 255, 0.2) 31px 32px, rgba(255, 255, 255, 0) 33px 68px),
    repeating-radial-gradient(ellipse at 50% 50%, rgba(91, 198, 255, 0) 0 46px, rgba(91, 198, 255, 0.16) 47px 49px, rgba(91, 198, 255, 0) 50px 96px),
    linear-gradient(145deg, rgba(224, 248, 255, 0.18), rgba(255, 241, 250, 0.12));
  filter: blur(0.4px);
  mix-blend-mode: screen;
  opacity: 0.72;
  animation: loginWaterDrift 12s linear infinite;
}

#loginModal::after {
  background:
    radial-gradient(ellipse at 42% 46%, rgba(255, 255, 255, 0) 0 30%, rgba(255, 255, 255, 0.2) 31%, rgba(255, 255, 255, 0) 32%),
    radial-gradient(ellipse at 58% 54%, rgba(91, 198, 255, 0) 0 22%, rgba(91, 198, 255, 0.16) 23%, rgba(91, 198, 255, 0) 24%);
  opacity: 0.28;
  mix-blend-mode: soft-light;
  animation: loginRipplePulse 6.5s ease-in-out infinite;
}

#loginModal .login-panel {
  position: relative;
  z-index: 1;
}

#screenModal {
  z-index: 26;
}

#advancedGuardModal {
  z-index: 28;
}

.modal-panel {
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(232, 248, 255, 0.82));
  padding: 18px;
  backdrop-filter: blur(18px);
  box-shadow:
    0 30px 78px rgba(54, 137, 199, 0.26),
    0 1px 0 rgba(255, 255, 255, 0.86) inset,
    0 -16px 28px rgba(91, 184, 235, 0.08) inset;
}

.login-panel {
  width: min(620px, 100%);
}

#loginHint:empty {
  display: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(230, 247, 255, 0.62)),
    radial-gradient(circle at 16% 12%, rgba(255, 210, 10, 0.18), rgba(255, 210, 10, 0));
  box-shadow:
    0 16px 34px rgba(72, 154, 213, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.login-logo {
  width: 58px;
  height: 58px;
}

.login-brand strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0;
}

.workspace-panel {
  width: min(720px, 100%);
}

.workspace-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.workspace-picker .field {
  margin-bottom: 0;
}

.workspace-picker button {
  padding: 0 14px;
}

.screen-panel {
  width: min(1120px, 100%);
}

.screen-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 14px;
  background: rgba(124, 188, 230, 0.24);
}

.screen-metric {
  min-width: 0;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(232, 248, 255, 0.62));
}

.screen-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.screen-metric strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
}

.screen-card {
  min-width: 0;
  border: 1px solid rgba(124, 188, 230, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
}

.screen-card h3 {
  margin: 0;
  color: var(--ink);
}

.screen-layout-card {
  margin-bottom: 14px;
}

.screen-layout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.screen-layout-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.screen-layout-canvas {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(rgba(124, 188, 230, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 188, 230, 0.12) 1px, transparent 1px),
    radial-gradient(circle at 16% 14%, rgba(255, 210, 10, 0.15), rgba(255, 210, 10, 0) 30%),
    linear-gradient(145deg, rgba(245, 252, 255, 0.96), rgba(230, 247, 255, 0.72));
  background-size: 28px 28px, 28px 28px, auto, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 14px 30px rgba(72, 154, 213, 0.1);
  touch-action: none;
}

.screen-layout-display {
  position: absolute;
  display: grid;
  align-content: center;
  gap: 4px;
  overflow: hidden;
  min-height: 58px;
  border: 1px solid rgba(74, 168, 232, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(225, 246, 255, 0.78)),
    radial-gradient(circle at 50% 0%, rgba(255, 210, 10, 0.16), rgba(255, 210, 10, 0));
  color: var(--ink);
  cursor: grab;
  padding: 10px;
  text-align: center;
  box-shadow:
    0 18px 32px rgba(64, 155, 215, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  user-select: none;
}

.screen-layout-display:active {
  cursor: grabbing;
}

.screen-layout-display[data-selected="1"] {
  border-color: rgba(255, 210, 10, 0.98);
  box-shadow:
    0 20px 42px rgba(64, 155, 215, 0.2),
    0 0 0 2px rgba(255, 210, 10, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.screen-layout-display strong,
.screen-layout-display small,
.screen-layout-display em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-layout-display strong {
  font-size: 12px;
}

.screen-layout-display small,
.screen-layout-display em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.screen-display-list {
  display: grid;
  gap: 9px;
}

.screen-display-item {
  width: 100%;
  border: 1px solid rgba(124, 188, 230, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  cursor: pointer;
  padding: 10px;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
}

.screen-display-item:hover,
.screen-display-item:focus-visible {
  border-color: rgba(64, 176, 238, 0.72);
  background: linear-gradient(135deg, rgba(244, 252, 255, 0.96), rgba(230, 246, 255, 0.86));
  box-shadow: 0 12px 28px rgba(68, 170, 232, 0.16);
  transform: translateY(-1px);
}

.screen-display-item[data-selected="1"] {
  border-color: rgba(43, 169, 235, 0.9);
  background: linear-gradient(135deg, rgba(230, 247, 255, 0.98), rgba(255, 245, 251, 0.82));
  box-shadow:
    0 16px 34px rgba(62, 173, 236, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
}

.screen-display-item strong,
.screen-display-item small,
.screen-display-item em {
  display: block;
}

.screen-display-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.screen-display-item em {
  margin-top: 8px;
  color: #2789c9;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
}

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

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

.register-panel {
  margin-top: 16px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(115, 211, 255, 0.16), rgba(115, 211, 255, 0) 42%),
    rgba(255, 255, 255, 0.58);
  padding: 12px;
}

.register-panel .panel-heading {
  margin-bottom: 10px;
}

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

.modal-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.modal-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.check-list-modal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.modal-actions button {
  padding: 0 12px;
}

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

.script-lab-panel {
  width: min(1280px, 100%);
  background:
    radial-gradient(circle at 8% 0%, rgba(91, 198, 255, 0.18), rgba(91, 198, 255, 0) 34%),
    radial-gradient(circle at 92% 8%, rgba(255, 188, 226, 0.16), rgba(255, 188, 226, 0) 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 248, 255, 0.78));
}

.admin-panel {
  width: min(1480px, calc(100vw - 28px));
  max-height: min(880px, calc(100vh - 24px));
  display: flex;
  flex-direction: column;
  height: min(880px, calc(100vh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background:
    radial-gradient(circle at 8% 0%, rgba(91, 198, 255, 0.18), rgba(91, 198, 255, 0) 34%),
    radial-gradient(circle at 92% 8%, rgba(255, 188, 226, 0.16), rgba(255, 188, 226, 0) 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 248, 255, 0.78));
}

.script-lab-panel .modal-header,
.admin-panel .modal-header,
.preflight-modal-panel .modal-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(124, 188, 230, 0.24);
}

.admin-panel .modal-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-radius: 8px;
  background:
    radial-gradient(circle at 8% 0%, rgba(91, 198, 255, 0.16), rgba(91, 198, 255, 0) 38%),
    linear-gradient(180deg, rgba(247, 253, 255, 0.96), rgba(236, 249, 255, 0.84));
  backdrop-filter: blur(14px);
}

.studio-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 14px;
  background: rgba(124, 188, 230, 0.24);
  box-shadow:
    0 18px 34px rgba(70, 152, 212, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.studio-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 16% 0%, rgba(115, 211, 255, 0.12), rgba(115, 211, 255, 0) 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(233, 248, 255, 0.62));
  padding: 16px;
  box-shadow:
    0 18px 38px rgba(72, 154, 213, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.studio-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 70px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0));
}

.studio-card > * {
  position: relative;
  z-index: 1;
}

.studio-card h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.ai-card {
  border-color: rgba(106, 195, 242, 0.34);
  background:
    radial-gradient(circle at 18% 0%, rgba(82, 197, 255, 0.18), rgba(82, 197, 255, 0) 34%),
    radial-gradient(circle at 86% 12%, rgba(255, 156, 214, 0.2), rgba(255, 156, 214, 0) 38%),
    linear-gradient(145deg, rgba(233, 248, 255, 0.84), rgba(255, 245, 249, 0.76));
}

.ai-progress-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-top: 12px;
  border: 1px solid rgba(106, 195, 242, 0.32);
  border-radius: 8px;
  background:
    radial-gradient(circle at 14% 0%, rgba(82, 197, 255, 0.16), rgba(82, 197, 255, 0) 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(231, 247, 255, 0.56));
  padding: 12px;
  box-shadow:
    0 14px 28px rgba(72, 154, 213, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.ai-progress-panel[hidden] {
  display: none;
}

.ai-progress-panel[data-status="running"] {
  border-color: rgba(74, 168, 232, 0.52);
  box-shadow:
    0 16px 34px rgba(72, 154, 213, 0.16),
    0 0 0 1px rgba(108, 213, 239, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.ai-progress-panel strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.ai-progress-log {
  grid-column: 1 / -1;
  min-height: 92px;
  max-height: 160px;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(124, 188, 230, 0.2);
  border-radius: 8px;
  background: rgba(12, 38, 56, 0.92);
  color: #dff5ff;
  padding: 10px;
  font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.script-list-card {
  margin-top: 14px;
}

.script-list-card .script-list {
  max-height: min(360px, calc(100vh - 420px));
  overflow: auto;
  padding-right: 3px;
}

.script-list {
  display: grid;
  gap: 10px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.72fr) minmax(760px, 1.58fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas:
    "resources permissions";
  flex: 0 0 auto;
  gap: 14px;
  align-items: stretch;
  height: clamp(650px, calc(100vh - 230px), 760px);
  min-height: 0;
  overflow: visible;
}

.admin-side-stack {
  grid-area: resources;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
  scrollbar-gutter: stable;
}

.admin-member-card {
  grid-area: member;
}

.admin-invite-card {
  grid-area: invites;
}

.admin-permission-card {
  grid-area: permissions;
}

.admin-column,
.admin-grid > .studio-card {
  height: 100%;
  min-height: 0;
}

.admin-grid .studio-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px;
}

.admin-grid .panel-heading {
  flex: 0 0 auto;
  margin-bottom: 10px;
  min-width: 0;
}

.admin-grid .panel-heading > div {
  min-width: 0;
}

.admin-grid .panel-heading h3,
.admin-grid .panel-heading .eyebrow {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-grid .field {
  gap: 5px;
  margin-bottom: 8px;
  font-size: 12px;
  min-width: 0;
}

.admin-grid .field span {
  min-width: 0;
  line-height: 1.25;
}

.admin-grid .field input,
.admin-grid .field select {
  min-height: 32px;
  padding: 6px 9px;
  min-width: 0;
  font-size: 12px;
}

.admin-grid .modal-copy {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-grid .modal-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
  padding-top: 8px;
}

.admin-grid .modal-actions button {
  width: 100%;
  min-width: 0;
}

.admin-script-card,
.admin-rule-card {
  flex: 0 0 auto;
}

.admin-monitor-card {
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding: 12px;
  border-color: rgba(74, 168, 232, 0.36);
  background:
    radial-gradient(circle at 12% 0%, rgba(106, 213, 255, 0.22), rgba(106, 213, 255, 0) 34%),
    radial-gradient(circle at 88% 18%, rgba(255, 183, 225, 0.18), rgba(255, 183, 225, 0) 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(230, 247, 255, 0.7));
}

.admin-panel > .admin-monitor-card {
  min-height: 0;
}

.admin-monitor-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(120px, 0.72fr)) minmax(210px, 0.9fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}

.admin-monitor-controls .field {
  margin: 0;
}

.admin-monitor-controls input,
.admin-monitor-controls select {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 11px;
}

.admin-activity-quick-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-self: end;
}

.admin-activity-quick-filters button {
  min-height: 30px;
  border-color: rgba(124, 188, 230, 0.3);
  padding: 0 8px;
  font-size: 11px;
}

.admin-activity-quick-filters button[aria-pressed="true"] {
  border-color: rgba(74, 168, 232, 0.58);
  background:
    radial-gradient(circle at 14% 0%, rgba(106, 213, 255, 0.24), rgba(106, 213, 255, 0) 40%),
    rgba(234, 248, 255, 0.92);
  color: var(--blue-strong);
  box-shadow:
    0 10px 22px rgba(72, 154, 213, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.admin-activity-list {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.admin-panel > .admin-monitor-card .admin-activity-list {
  grid-template-columns: 1fr;
  max-height: clamp(380px, 38vh, 460px);
}

.admin-activity-table-head,
.admin-activity-row {
  display: grid;
  grid-template-columns:
    minmax(82px, 0.68fr)
    minmax(74px, 0.56fr)
    minmax(150px, 1.05fr)
    minmax(170px, 1.22fr)
    minmax(118px, 0.78fr)
    minmax(180px, 1.32fr)
    minmax(64px, 0.42fr);
  gap: 10px;
  align-items: center;
}

.admin-activity-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border: 1px solid rgba(124, 188, 230, 0.22);
  border-radius: 8px;
  background: rgba(233, 248, 255, 0.92);
  padding: 5px 9px;
  color: #4e86ad;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(72, 154, 213, 0.08);
}

.admin-activity-pager {
  display: grid;
  grid-template-columns: minmax(76px, 0.7fr) minmax(70px, auto) minmax(76px, 0.7fr);
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.admin-panel > .admin-monitor-card .admin-activity-pager {
  width: min(420px, 100%);
  margin-left: auto;
}

.admin-activity-pager span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.admin-activity-pager button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 11px;
}

.admin-activity-row {
  position: relative;
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 4px 9px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  appearance: none;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.admin-activity-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(124, 188, 230, 0.42);
}

.admin-activity-row:hover {
  border-color: rgba(74, 168, 232, 0.62);
  background:
    radial-gradient(circle at 14% 0%, rgba(106, 213, 255, 0.16), rgba(106, 213, 255, 0) 38%),
    rgba(255, 255, 255, 0.78);
}

.admin-activity-row[data-status="running"],
.admin-activity-row[data-status="queued"] {
  border-color: rgba(74, 168, 232, 0.5);
  box-shadow:
    0 10px 22px rgba(58, 144, 207, 0.15),
    0 0 0 1px rgba(112, 211, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  animation: adminLiveRowPulse 2.2s ease-in-out infinite;
}

.admin-activity-row[data-status="running"]::before,
.admin-activity-row[data-status="queued"]::before {
  background: linear-gradient(180deg, #6bd6ff, #4aa8e8);
  box-shadow: 0 0 16px rgba(74, 168, 232, 0.46);
}

.admin-activity-row[data-status="failed"],
.admin-activity-row[data-status="error"],
.admin-activity-row[data-status="killing"],
.admin-activity-row[data-status="killed"] {
  border-color: rgba(199, 95, 113, 0.34);
  background:
    radial-gradient(circle at 8% 50%, rgba(255, 164, 208, 0.18), rgba(255, 164, 208, 0) 42%),
    rgba(255, 255, 255, 0.72);
  animation: adminRiskRowPulse 1.9s ease-in-out infinite;
}

.admin-activity-row[data-status="failed"]::before,
.admin-activity-row[data-status="error"]::before,
.admin-activity-row[data-status="killing"]::before,
.admin-activity-row[data-status="killed"]::before {
  background: linear-gradient(180deg, #ff91c5, #cf5d79);
  box-shadow: 0 0 16px rgba(207, 93, 121, 0.42);
}

.admin-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-activity-row strong,
.admin-activity-row small,
.admin-activity-row em,
.admin-activity-row b,
.admin-activity-row .activity-script,
.admin-activity-row .activity-time,
.admin-activity-row code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-activity-row strong {
  color: var(--ink);
  font-size: 11px;
}

.admin-activity-row b,
.admin-activity-row small,
.admin-activity-row em {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.admin-activity-row b {
  display: block;
  color: var(--ink);
  font-size: 10px;
}

.activity-cell {
  min-width: 0;
}

.activity-owner {
  display: grid;
  gap: 4px;
}

.activity-device-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 20px;
  border: 1px solid rgba(74, 168, 232, 0.34);
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 0%, rgba(115, 211, 255, 0.2), rgba(115, 211, 255, 0) 48%),
    rgba(235, 248, 255, 0.86);
  color: var(--blue-strong);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(106, 213, 255, 0.16);
}

.activity-device-chip[data-device="server"] {
  border-color: rgba(184, 135, 46, 0.28);
  background: rgba(255, 249, 232, 0.88);
  color: #896526;
  box-shadow: none;
}

.activity-device-chip[data-device="runner"] {
  border-color: rgba(74, 168, 232, 0.48);
  background:
    radial-gradient(circle at 18% 0%, rgba(106, 213, 255, 0.28), rgba(106, 213, 255, 0) 52%),
    rgba(235, 248, 255, 0.94);
  box-shadow: 0 0 18px rgba(106, 213, 255, 0.24);
}

.activity-script,
.activity-time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.activity-actions {
  display: flex;
  justify-content: flex-end;
}

.activity-result-button {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 950;
  color: var(--blue-strong);
}

.admin-activity-row code {
  border-radius: 6px;
  background: rgba(16, 38, 56, 0.88);
  color: #dff5ff;
  display: block;
  padding: 4px 7px;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.activity-log em {
  color: rgba(86, 122, 150, 0.7);
  font-weight: 900;
}

@keyframes adminLiveRowPulse {
  0%,
  100% {
    box-shadow:
      0 10px 22px rgba(58, 144, 207, 0.12),
      0 0 0 1px rgba(112, 211, 255, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.82);
  }
  50% {
    box-shadow:
      0 12px 26px rgba(58, 144, 207, 0.22),
      0 0 18px rgba(106, 213, 255, 0.22),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}

@keyframes adminRiskRowPulse {
  0%,
  100% {
    box-shadow:
      0 10px 22px rgba(207, 93, 121, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.76);
  }
  50% {
    box-shadow:
      0 12px 28px rgba(207, 93, 121, 0.2),
      0 0 20px rgba(255, 139, 198, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }
}

.activity-detail-panel {
  width: min(920px, 100%);
}

.activity-detail-grid {
  margin-bottom: 14px;
}

.activity-control-actions {
  justify-content: flex-end;
  margin: 0 0 14px;
  padding-top: 0;
  border-top: 0;
}

.activity-control-actions button[hidden] {
  display: none;
}

.activity-log-panel {
  border: 1px solid rgba(124, 188, 230, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.12), rgba(115, 211, 255, 0) 38%),
    rgba(255, 255, 255, 0.48);
  padding: 12px;
}

.activity-detail-logs {
  min-height: 260px;
  max-height: min(460px, calc(100vh - 380px));
}

.admin-member-card .two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-member-card .field {
  margin-bottom: 7px;
}

.admin-member-card .modal-copy {
  margin: 8px 0 0;
  font-size: 11px;
}

.admin-permission-card > .panel-heading {
  align-items: flex-start;
  gap: 14px;
}

.permission-header-actions {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  min-width: min(520px, 58%);
}

.invite-code-inline {
  display: grid;
  gap: 4px;
  margin: 0;
  min-width: 0;
}

.invite-code-inline span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
}

.invite-code-inline input {
  min-height: 30px;
  min-width: 0;
  border: 1px solid rgba(124, 188, 230, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 6px 9px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.permission-header-actions button {
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.permission-target-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.permission-workspace-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 0.96fr) minmax(360px, 1.04fr);
  gap: 14px;
  align-items: stretch;
  overflow: hidden;
}

.permission-config-stack,
.permission-member-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.permission-config-stack {
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-gutter: stable;
}

.permission-config-stack > *,
.permission-member-stack > .field,
.permission-member-stack > .modal-actions {
  flex: 0 0 auto;
}

.permission-member-stack {
  overflow: hidden;
}

.permission-member-stack .permission-member-search-field {
  margin-bottom: 8px;
}

.permission-target-tabs button {
  min-height: 30px;
  border: 1px solid rgba(124, 188, 230, 0.32);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0%, rgba(115, 211, 255, 0.14), rgba(115, 211, 255, 0) 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(232, 248, 255, 0.66));
  color: var(--text);
  font-weight: 900;
}

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

.permission-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.permission-summary-grid .modal-copy {
  min-height: 26px;
  margin: 0;
  border: 1px solid rgba(124, 188, 230, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.52);
  padding: 5px 7px;
  font-size: 10px;
  line-height: 1.25;
}

.admin-member-merge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-height: 0;
  margin-bottom: 8px;
}

.member-editor-panel {
  min-height: 0;
  border: 1px solid rgba(124, 188, 230, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.1), rgba(115, 211, 255, 0) 38%),
    rgba(255, 255, 255, 0.52);
  padding: 9px;
}

.member-editor-panel .sub-heading {
  margin-bottom: 7px;
}

.member-editor-panel .two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.member-editor-panel .field {
  margin-bottom: 5px;
}

.member-inline-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 5px;
  padding-top: 6px;
}

.member-editor-panel .modal-copy {
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.25;
}

.permission-target-tabs button[aria-pressed="true"] {
  border-color: rgba(79, 174, 239, 0.72);
  background:
    radial-gradient(circle at 18% 0%, rgba(121, 218, 255, 0.28), rgba(121, 218, 255, 0) 52%),
    radial-gradient(circle at 92% 12%, rgba(255, 164, 216, 0.22), rgba(255, 164, 216, 0) 42%),
    linear-gradient(180deg, rgba(237, 250, 255, 0.96), rgba(212, 241, 255, 0.82));
  color: #165c88;
  box-shadow:
    0 12px 26px rgba(72, 154, 213, 0.14),
    0 0 0 1px rgba(101, 202, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.admin-member-card {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.admin-invite-card {
  overflow: hidden;
}

.admin-invite-card .role-list {
  flex: 0 0 auto;
  max-height: 116px;
  overflow-y: auto;
  padding-right: 3px;
}

.admin-invite-card .invite-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
}

.role-list,
.invite-list {
  display: grid;
  gap: 8px;
}

.role-row,
.invite-row {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 10% 0%, rgba(115, 211, 255, 0.12), rgba(115, 211, 255, 0) 42%),
    rgba(255, 255, 255, 0.72);
  padding: 8px;
}

.role-row strong,
.invite-row strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.role-row small,
.invite-row small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.role-row em {
  color: var(--blue-strong);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.invite-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.invite-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.invite-row span {
  border-radius: 999px;
  background: rgba(224, 246, 238, 0.9);
  color: #26775b;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

.invite-row[data-status="inactive"] span {
  background: rgba(255, 239, 231, 0.9);
  color: #b5603c;
}

.invite-row button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 10px;
}

.admin-device-card {
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.admin-device-card .panel-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(247, 253, 255, 0.94), rgba(238, 250, 255, 0.84));
  backdrop-filter: blur(10px);
}

.admin-device-card .device-control-grid,
.admin-device-card .modal-copy {
  flex: 0 0 auto;
}

.admin-device-card .device-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-right: 3px;
}

.admin-permission-card {
  overflow: hidden;
}

.admin-permission-card .member-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  align-content: start;
  overflow-y: auto;
  gap: 0;
  overflow: auto;
  border: 1px solid rgba(124, 188, 230, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  padding-right: 0;
}

.admin-permission-card .permission-save-actions {
  margin-top: 8px;
  padding-top: 8px;
}

.admin-permission-card .permission-inline-hint {
  margin: 8px 0 0;
  min-height: 28px;
  display: flex;
  align-items: center;
}

.admin-permission-card .modal-actions {
  grid-template-columns: 1fr;
}

.admin-permission-card .member-editor-panel .member-inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  margin-top: 6px;
  border-top: 1px solid rgba(124, 188, 230, 0.2);
  padding-top: 7px;
}

.admin-permission-card .member-editor-panel .member-inline-actions button {
  min-height: 30px;
  width: 100%;
  min-width: 0;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
}

.admin-permission-card .member-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid rgba(124, 188, 230, 0.18);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.58);
  padding: 6px 8px;
  box-shadow: none;
}

.admin-permission-card .member-row:nth-child(even) {
  background: rgba(235, 248, 255, 0.54);
}

.admin-permission-card .member-row:last-child {
  border-bottom: 0;
}

.admin-permission-card .member-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-permission-card .member-row strong,
.admin-permission-card .member-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.admin-permission-card .member-row strong {
  font-size: 12px;
  line-height: 1.2;
}

.admin-permission-card .member-row small {
  font-size: 11px;
  line-height: 1.2;
}

.admin-permission-card .member-edit {
  min-height: 28px;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 11px;
}

.admin-permission-card .member-row:hover {
  border-color: transparent;
  background: rgba(224, 245, 255, 0.94);
  box-shadow: inset 3px 0 0 rgba(74, 168, 232, 0.68);
}

.admin-permission-card .member-row.member-row-highlight {
  background:
    radial-gradient(circle at 10% 50%, rgba(255, 228, 146, 0.55), rgba(255, 228, 146, 0) 32%),
    rgba(255, 248, 219, 0.98);
  box-shadow:
    inset 3px 0 0 rgba(255, 183, 43, 0.9),
    0 0 0 1px rgba(255, 196, 84, 0.46);
}

.admin-permission-card .member-row[data-expanded="1"] {
  background: rgba(231, 247, 255, 0.94);
  box-shadow: inset 3px 0 0 rgba(74, 168, 232, 0.78);
}

.admin-permission-card .member-inline-editor {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(124, 188, 230, 0.18);
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.12), rgba(115, 211, 255, 0) 38%),
    rgba(246, 252, 255, 0.94);
  padding: 8px 8px 10px 24px;
}

.admin-permission-card .member-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.admin-permission-card .member-inline-grid .field,
.admin-permission-card .member-inline-grid .field span {
  min-width: 0;
}

.admin-permission-card .member-inline-grid .field {
  margin: 0;
}

.admin-permission-card .member-inline-grid input,
.admin-permission-card .member-inline-grid select {
  min-height: 28px;
  font-size: 10px;
  padding: 4px 7px;
}

.admin-permission-card .member-inline-password-field {
  grid-column: 1 / -1;
}

.admin-permission-card .member-inline-editor-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 6px;
}

.admin-permission-card .member-inline-editor-actions button {
  min-height: 28px;
  font-size: 10px;
  white-space: nowrap;
}

.device-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding-right: 3px;
}

.device-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.device-search-field {
  grid-column: 1 / -1;
}

.device-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(122, 189, 231, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.device-inline-toggle input {
  margin: 0;
}

.device-row {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.12), rgba(115, 211, 255, 0) 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 249, 255, 0.72));
  padding: 9px;
  text-align: left;
  box-shadow:
    0 10px 22px rgba(72, 154, 213, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.device-row[data-status="ready"] {
  border-color: rgba(86, 215, 177, 0.44);
  box-shadow:
    0 12px 26px rgba(72, 154, 213, 0.1),
    0 0 0 1px rgba(86, 215, 177, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.device-row[data-activity="online"] {
  background:
    radial-gradient(circle at 12% 0%, rgba(89, 239, 156, 0.22), rgba(89, 239, 156, 0) 38%),
    linear-gradient(180deg, rgba(241, 255, 247, 0.92), rgba(231, 249, 255, 0.74));
}

.device-row[data-activity="stale"] {
  border-color: rgba(202, 155, 36, 0.36);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 218, 103, 0.18), rgba(255, 218, 103, 0) 38%),
    linear-gradient(180deg, rgba(255, 252, 235, 0.92), rgba(238, 249, 255, 0.7));
}

.device-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.device-status-stack {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.device-row-head strong {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ink);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.device-row p,
.device-row small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.device-row small {
  color: #4f9ccf;
}

.device-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.device-owner-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(229, 245, 255, 0.96);
  color: var(--blue-strong);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.device-system-line {
  color: #78a6c9;
}

.device-row .device-live-line {
  color: var(--ink);
  font-weight: 900;
}

.activity-pill {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  border-radius: 999px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.activity-pill[data-activity="online"] {
  background: rgba(213, 244, 229, 0.94);
  color: var(--green-strong);
  box-shadow: 0 0 18px rgba(71, 211, 132, 0.2);
}

.activity-pill[data-activity="recent"] {
  background: rgba(218, 239, 255, 0.94);
  color: var(--blue-strong);
}

.activity-pill[data-activity="stale"] {
  background: rgba(255, 249, 232, 0.94);
  color: #896526;
}

.activity-pill[data-activity="paused"] {
  background: rgba(255, 237, 246, 0.94);
  color: #a94d7a;
}

.detail-modal-backdrop {
  z-index: 32;
}

.device-detail-panel {
  width: min(760px, 100%);
}

.device-rename-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0;
}

.device-rename-bar .field {
  margin: 0;
}

.device-rename-bar .primary-button {
  min-width: 108px;
}

.device-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.device-detail-grid span {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(124, 188, 230, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.58);
  padding: 8px;
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.device-detail-grid b {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.device-runs-panel {
  margin-top: 14px;
  border: 1px solid rgba(124, 188, 230, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.12), rgba(115, 211, 255, 0) 38%),
    rgba(255, 255, 255, 0.48);
  padding: 12px;
}

.device-run-list {
  display: grid;
  gap: 8px;
}

.device-run-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(124, 188, 230, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 10px;
  text-align: left;
}

.device-run-row:hover {
  border-color: rgba(74, 168, 232, 0.58);
  background: rgba(235, 248, 255, 0.9);
}

.device-run-row strong,
.device-run-row small,
.device-run-row b {
  display: block;
}

.device-run-row strong {
  color: var(--ink);
  font-size: 13px;
}

.device-run-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.device-run-row > span {
  text-align: right;
}

.device-run-row b {
  color: var(--blue-strong);
  font-size: 12px;
}

.result-row-highlight {
  animation: resultRowPulse 2.4s ease-in-out;
}

@keyframes resultRowPulse {
  0%,
  100% {
    background: transparent;
    box-shadow: none;
  }
  30%,
  70% {
    background: rgba(229, 247, 255, 0.86);
    box-shadow: inset 0 0 0 999px rgba(115, 211, 255, 0.08);
  }
}

.device-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(124, 188, 230, 0.24);
}

.member-list {
  display: grid;
  gap: 7px;
  max-height: 390px;
  overflow: auto;
}

.member-row {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 42px;
  align-items: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.1), rgba(115, 211, 255, 0) 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 249, 255, 0.72));
  padding: 6px;
  box-shadow:
    0 10px 22px rgba(72, 154, 213, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.member-row input {
  width: 16px;
  min-height: 16px;
}

.member-edit {
  min-height: 24px;
  padding: 0 6px;
  font-size: 10px;
}

.member-row:hover,
.device-row:hover,
.script-item:hover {
  border-color: rgba(74, 168, 232, 0.52);
  box-shadow:
    0 16px 32px rgba(72, 154, 213, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.member-row strong,
.member-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-row strong {
  font-size: 12px;
  line-height: 1.2;
}

.member-row small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.28;
}

.script-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(115, 211, 255, 0.11), rgba(115, 211, 255, 0) 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(238, 249, 255, 0.72));
  padding: 12px;
  box-shadow:
    0 10px 22px rgba(72, 154, 213, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.script-item[data-highlight="1"] {
  border-color: rgba(255, 210, 10, 0.82);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 210, 10, 0.18), rgba(255, 210, 10, 0) 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 249, 255, 0.76));
  box-shadow:
    0 18px 36px rgba(72, 154, 213, 0.16),
    0 0 0 2px rgba(255, 210, 10, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.script-item strong {
  display: block;
  margin-bottom: 4px;
}

.script-item p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.script-item code {
  color: #315f7c;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.compact {
  margin-bottom: 12px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  overflow-wrap: anywhere;
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 1080px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topbar-actions {
    order: 2;
    flex: 1 1 auto;
  }

  .top-status {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }

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

  .setup-panel {
    position: static;
  }

  .log-dock-button,
  .result-dock-button {
    grid-template-columns: 1fr;
  }

  .log-modal-grid {
    grid-template-columns: 1fr;
  }

  .log-device-banner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-filter-bar .field {
    grid-row: auto;
  }

  .result-run-filter-hint,
  .result-custom-range {
    grid-column: 1 / -1;
  }

  .admin-monitor-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel > .admin-monitor-card .admin-activity-list {
    grid-template-columns: 1fr;
    max-height: 380px;
  }

  .admin-activity-table-head,
  .admin-activity-row {
    grid-template-columns:
      minmax(76px, 0.72fr)
      minmax(70px, 0.58fr)
      minmax(140px, 1fr)
      minmax(160px, 1.1fr)
      minmax(110px, 0.72fr)
      minmax(58px, 0.42fr);
  }

  .activity-head-log,
  .activity-log {
    display: none;
  }

  #refreshResultsBtn {
    grid-column: auto;
    grid-row: auto;
  }

  .result-filter-bar > button {
    width: 100%;
  }

  .snapshot-drawer {
    position: fixed;
    inset: auto 14px 14px;
    top: 80px;
    width: auto;
  }

  .screen-config-grid,
  .screen-metrics,
  .device-detail-grid {
    grid-template-columns: 1fr;
  }

  .device-control-grid {
    grid-template-columns: 1fr;
  }

  .device-rename-bar {
    grid-template-columns: 1fr;
  }

  .screen-layout-canvas {
    min-height: 220px;
  }

  .log-view-modal {
    min-height: 280px;
    max-height: 360px;
  }

  .preflight-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .preflight-device-banner {
    flex-basis: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .startup-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .toast-stack {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .topbar,
  .panel-heading,
  .action-bar,
  .inline-actions,
  .modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .log-device-banner {
    grid-template-columns: 1fr;
  }

  .topbar-title,
  .login-brand {
    align-items: center;
  }

  .shell {
    padding: 12px;
  }

  .panel {
    padding: 14px;
  }

  .top-status,
  .dashboard-strip,
  .script-source-grid,
  .runner-filter-toolbar,
  .runner-target-panel,
  .studio-summary,
  .result-center-summary,
  .result-filter-bar,
  .admin-monitor-controls,
  .result-custom-range {
    grid-template-columns: 1fr;
  }

  .result-run-filter-hint,
  .result-custom-range,
  #refreshResultsBtn {
    grid-column: auto;
    grid-row: auto;
  }

  .result-filter-bar .field {
    grid-row: auto;
  }

  .top-status {
    display: grid;
    min-width: 0;
    width: 100%;
  }

  .monitor-dock-grid {
    grid-template-columns: 1fr;
  }

  .status-chip {
    grid-template-columns: 46px 1fr;
    width: 100%;
  }

  .two-col,
  .switch-grid,
  .dynamic-param-list,
  .quad-grid,
  .check-list,
  .check-list-modal,
  .startup-step-card,
  .startup-env-row,
  .preflight-steps,
  .preflight-device-banner,
  .preflight-item,
  .admin-grid,
  .studio-grid,
  .device-detail-grid,
  .advanced-modal-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel > .admin-monitor-card .admin-activity-list {
    grid-template-columns: 1fr;
  }

  .admin-activity-table-head {
    display: none;
  }

  .admin-activity-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "type state"
      "owner actions"
      "time time"
      "script script"
      "log log";
    gap: 4px 8px;
    min-height: auto;
    padding: 9px 10px;
  }

  .activity-type {
    grid-area: type;
  }

  .activity-state {
    grid-area: state;
  }

  .activity-owner {
    grid-area: owner;
  }

  .activity-script {
    grid-area: script;
  }

  .activity-time {
    grid-area: time;
  }

  .activity-actions {
    grid-area: actions;
  }

  .activity-log {
    display: block;
    grid-area: log;
  }

  .activity-log code {
    max-height: 36px;
    white-space: normal;
  }

  .admin-panel {
    overflow: auto;
  }

  .admin-grid {
    flex: 0 0 auto;
    grid-template-areas:
      "resources"
      "permissions";
    grid-template-rows: none;
    height: auto;
    overflow: visible;
  }

  .admin-column,
  .admin-grid > .studio-card {
    height: auto;
  }

  .admin-side-stack {
    grid-template-rows: none;
    overflow: visible;
  }

  .admin-member-card .two-col,
  .invite-create-grid,
  .permission-workspace-grid,
  .permission-scope-grid,
  .permission-summary-grid,
  .permission-header-actions,
  .admin-member-merge-grid,
  .member-editor-panel .two-col {
    grid-template-columns: 1fr;
  }

  .permission-workspace-grid {
    overflow: visible;
  }

  .permission-config-stack,
  .permission-member-stack {
    overflow: visible;
    padding-right: 0;
  }

  .permission-header-actions {
    min-width: 0;
    width: 100%;
  }

  .admin-permission-card .member-editor-panel .member-inline-actions {
    grid-template-columns: 1fr;
  }

  .admin-permission-card .member-inline-grid,
  .admin-permission-card .member-inline-editor-actions {
    grid-template-columns: 1fr;
  }

  .admin-device-card .device-list,
  .admin-invite-card .invite-list,
  .admin-permission-card .member-list {
    flex: 0 0 auto;
    max-height: 300px;
  }

  .admin-permission-card .member-row > span {
    display: grid;
    grid-column: 2 / 4;
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .preflight-fix-slot {
    justify-content: stretch;
  }

  .preflight-fix-button {
    width: 100%;
  }

  .preflight-device-banner {
    min-width: 0;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    width: 100%;
    justify-content: stretch;
    align-items: stretch;
    border-radius: 22px;
  }

  .topbar-actions .top-button {
    width: 100%;
    max-width: none;
    justify-content: center;
  }

  #refreshAllBtn {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }
}
