:root {
  --bg: #f5f7f8;
  --surface: #fff;
  --ink: #1d2a2c;
  --muted: #8a969a;
  --line: #e8edef;
  --green: #15846b;
  --green-dark: #106953;
  --green-soft: #eaf5ef;
  --side: #172c2a;
  --side-light: #203a36;
  --shadow: 0 3px 12px #193d3505;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #65c8ab;
  outline-offset: 3px;
}
button {
  color: inherit;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-library {
  display: none;
}
.hidden,
[hidden] {
  display: none !important;
}
.sidebar {
  width: 224px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--side);
  color: #c4d2ce;
  display: flex;
  flex-direction: column;
  padding: 29px 17px 15px;
  z-index: 10;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
  padding: 0 13px 37px;
}
.brand strong {
  font-size: 22px;
  letter-spacing: -0.8px;
  font-weight: 650;
}
.brand strong > span {
  font-size: 13px;
  color: #829b92;
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 3px;
}
.brand-mark {
  width: 27px;
  height: 27px;
  position: relative;
  display: flex;
  gap: 3px;
  transform: rotate(-14deg);
}
.brand-mark > span {
  background: #79c9aa;
  display: block;
  width: 7px;
  border-radius: 2px;
  height: 20px;
}
.brand-mark > span:nth-child(2) {
  height: 27px;
  background: #d7eee4;
}
.brand-mark > span:nth-child(3) {
  height: 16px;
  margin-top: 11px;
}
.workspace-label {
  padding: 0 13px 13px;
  font-size: 10px;
  color: #81978f;
  letter-spacing: 1.2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tiny-pill {
  font-family: monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
  border: 1px solid #3a5048;
  border-radius: 4px;
  padding: 3px 5px;
}
.nav-item {
  border: 0;
  width: 100%;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  color: #a8bdb4;
  text-align: left;
  border-radius: 7px;
  transition: background 0.15s;
}
.nav-item.selected {
  color: #eff7f3;
  background: #2b4740;
}
.nav-item:hover {
  background: #294139;
}
.device-list-heading {
  margin: 36px 13px 14px;
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 11px;
  color: #9bb1a7;
}
.count {
  background: #2d443c;
  color: #c3d7cc;
  font-size: 10px;
  min-width: 17px;
  text-align: center;
  border-radius: 4px;
  padding: 2px 4px;
}
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border: 0;
  background: transparent;
  border-radius: 5px;
  color: #8c9d97;
}
.icon-button:hover:not(:disabled) {
  background: #edf3f0;
  color: var(--green);
}
.device-list-heading .icon-button {
  padding: 2px;
  margin-left: auto;
  color: #a6bdb2;
}
.device-list-heading .icon-button:hover {
  background: #3c5549;
  color: white;
}
.device-list {
  overflow-y: auto;
  flex: 1;
  min-height: 110px;
}
.side-empty {
  color: #97ada2;
  font-size: 12px;
  line-height: 1.9;
  padding: 14px 13px;
}
.device-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  color: #b7c9bf;
  background: transparent;
  border-radius: 8px;
  padding: 12px 11px;
  margin-bottom: 6px;
  text-align: left;
  transition: background 0.15s;
}
.device-item:hover {
  background: #223c34;
}
.device-item.active {
  background: #25453a;
  border-color: #3a6955;
}
.device-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 38px;
  border-radius: 6px;
  background: #263f35;
  color: #a5c7b4;
  flex: none;
}
.device-item.active .device-icon {
  background: #335d48;
  color: #d3f3df;
}
.device-icon svg {
  width: 17px;
  height: 21px;
}
.device-item-body {
  min-width: 0;
  flex: 1;
}
.device-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  font-size: 12px;
  color: #d7e4dc;
}
.sidebar-bottom {
  border-top: 1px solid #2d4339;
  margin-top: 20px;
  padding-top: 15px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2fa582;
  flex: none;
}
.sidebar .status-dot {
  background: #7bb995;
  width: 5px;
  height: 5px;
}
.settings {
  font-size: 12px;
  padding: 11px 13px;
}
.settings > span {
  margin-left: auto;
}
.main {
  margin-left: 224px;
  padding: 35px 38px 18px;
  max-width: 1740px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 27px;
  gap: 16px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 2.2px;
  color: #95a09b;
  font-weight: 600;
  margin-bottom: 10px;
}
h1 {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.8px;
  margin: 0;
}
.page-header p {
  font-size: 12px;
  color: #8b9896;
  margin: 10px 0 0;
  letter-spacing: 0.3px;
}
.service-badge {
  display: flex;
  gap: 8px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 30px;
  font-size: 10px;
  padding: 9px 12px;
  white-space: nowrap;
  color: #657c71;
}
.service-badge.error .status-dot {
  background: #d17b62;
}
.overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 24px;
}
.overview-card {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 10px;
  min-height: 106px;
  padding: 18px 18px;
  display: flex;
  gap: 12px;
  position: relative;
  align-items: flex-start;
}
.step-no {
  font-family: monospace;
  font-size: 10px;
  color: #aab8b3;
  padding-top: 3px;
}
.metric-label {
  display: block;
  color: #7a8b85;
  font-size: 10px;
  letter-spacing: 0.2px;
}
.overview-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.4px;
  font-weight: 560;
  margin-top: 8px;
}
.overview-card strong small {
  font: 10px inherit;
  font-size: 10px;
  color: #9aa7a1;
  margin-left: 3px;
}
.metric-hint {
  font-size: 9px;
  color: #9aa69f;
  display: block;
  margin-top: 7px;
}
.metric-icon {
  margin-left: auto;
  background: #f1f6f3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #759b86;
}
.metric-icon.active {
  color: var(--green);
  background: var(--green-soft);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 22px;
  align-items: start;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-heading {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 21px;
  border-bottom: 1px solid #eef1ef;
  gap: 12px;
}
.heading-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.heading-label > svg {
  width: 15px;
  height: 17px;
  color: #6d8a7b;
}
h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin: 0;
}
.mode-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  background: #edf7f1;
  color: #568269;
  border: 1px solid #e2f0e6;
  border-radius: 4px;
  padding: 4px 7px;
  white-space: nowrap;
}
.mode-badge .status-dot {
  width: 4px;
  height: 4px;
}
.device-title {
  padding: 19px 22px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.device-title h3 {
  font-size: 15px;
  letter-spacing: 0.2px;
  font-weight: 550;
  margin: 0 0 6px;
}
.device-title p {
  font-size: 9px;
  font-family: monospace;
  color: #93a199;
  margin: 0;
  word-break: break-all;
}
.button {
  border: 1px solid transparent;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  min-height: 34px;
  transition:
    background 0.15s,
    transform 0.15s;
}
.button svg {
  width: 14px;
  height: 14px;
}
.button:not(:disabled):active {
  transform: translateY(1px);
}
.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 3px #15846b15;
}
.primary:hover:not(:disabled) {
  background: var(--green-dark);
}
.secondary {
  border-color: #e2e9e5;
  background: white;
  color: #56705f;
}
.secondary:hover:not(:disabled) {
  background: #f3f8f4;
  border-color: #b5d1bf;
}
.screen-stage {
  margin: 0 17px;
  border-radius: 7px;
  min-height: 450px;
  padding: 22px 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #f6f8f7;
  background-image: radial-gradient(#d5e0d9 1px, transparent 1px);
  background-size: 14px 14px;
}
.phone-frame {
  width: 228px;
  max-width: 90%;
  border: 1px solid #dfe7e1;
  padding: 0 5px;
  background: #fff;
  border-radius: 22px;
  box-shadow:
    0 12px 25px #2347340b,
    0 1px 4px #23473409;
}
.phone-top {
  height: 16px;
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.phone-top span {
  width: 21px;
  height: 3px;
  background: #e3e9e5;
  border-radius: 4px;
}
.phone-top i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #e3e9e5;
}
.phone-screen {
  border-radius: 11px;
  overflow: hidden;
  position: relative;
  background: #fafcfb;
  aspect-ratio: var(--screen-aspect, 9/16);
  border: 1px solid #edf1ee;
  display: grid;
  place-items: center;
  touch-action: auto;
}
.phone-screen.interactive {
  cursor: crosshair;
  touch-action: none;
}
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
}
.phone-bottom {
  height: 15px;
  display: grid;
  place-items: center;
}
.phone-bottom span {
  width: 43px;
  height: 3px;
  border-radius: 5px;
  background: #e0e8e2;
}
.screen-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}
.empty-symbol {
  width: 51px;
  height: 51px;
  display: grid;
  place-items: center;
  background: #f0f6f1;
  color: #86ab92;
  border-radius: 16px;
  border: 1px solid #e7efe8;
  margin-bottom: 19px;
}
.empty-symbol svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.3;
}
.screen-empty strong {
  color: #6e8978;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.6px;
}
.screen-empty p {
  font-size: 10px;
  line-height: 1.9;
  color: #9aa99f;
  margin: 10px 0 18px;
}
.empty-tag {
  font-size: 8px;
  color: #a2b0a6;
  border: 1px solid #e6ece7;
  border-radius: 4px;
  padding: 4px 7px;
  letter-spacing: 0.3px;
}
.stage-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: #91a297;
  margin-top: 15px;
}
.stage-note .status-dot {
  width: 4px;
  height: 4px;
  background: #8db79a;
}
.snapshot-footer {
  min-height: 54px;
  padding: 15px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.snapshot-footer > span {
  font-size: 9px;
  color: #98a79d;
  white-space: nowrap;
}
.switch-label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 10px;
  color: #7d9183;
  cursor: pointer;
}
.switch-label input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch {
  display: block;
  width: 25px;
  height: 14px;
  background: #dce5df;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}
.switch:after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
}
.switch-label input:checked + .switch {
  background: var(--green);
}
.switch-label input:checked + .switch:after {
  transform: translateX(11px);
}
.switch-label input:focus-visible + .switch {
  outline: 2px solid #65c8ab;
  outline-offset: 2px;
}
.live-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #70a484;
  box-shadow: 0 0 0 4px #eff6f0;
  margin-right: 3px;
}
.subtle-badge {
  font-size: 9px;
  color: #8b9c91;
  background: #f3f6f3;
  border-radius: 4px;
  padding: 4px 6px;
  white-space: nowrap;
}
.subtle-badge.connected {
  color: #25815e;
  background: #ebf5ee;
}
.session-facts {
  padding: 5px 20px 0;
  margin: 0;
}
.session-facts > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0;
}
.session-facts dt {
  font-size: 11px;
  color: #8c9d92;
}
.session-facts dd {
  font-size: 10px;
  font-weight: 500;
  margin: 0;
  color: #587461;
}
.traffic-area {
  padding: 14px 20px 15px;
  margin-top: 3px;
  border-top: 1px dashed #e8eee9;
}
.traffic-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #7e9587;
}
.traffic-heading > strong {
  font-family: monospace;
  font-size: 15px;
  font-weight: 500;
  color: #426a54;
}
.traffic-heading strong small {
  font-family: inherit;
  font-size: 9px;
  color: #95a99b;
  font-weight: 400;
}
.muted {
  color: #a4b0a9;
  font-size: 9px;
  margin-left: 3px;
}
.traffic-chart {
  display: block;
  width: 100%;
  height: 42px;
  margin: 14px 0 7px;
  overflow: visible;
  stroke-linecap: round;
}
.chart-caption {
  display: flex;
  justify-content: space-between;
  color: #a3b0a7;
  font-size: 8px;
}
.navigation-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 16px 20px;
}
.key-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #f8faf8;
  border: 1px solid #edf1ee;
  color: #6f8979;
  border-radius: 6px;
  padding: 12px 5px 10px;
  font-size: 10px;
}
.key-button svg {
  width: 16px;
  height: 16px;
}
.key-button:hover:not(:disabled) {
  border-color: #b7d6c1;
  background: #f0f7f2;
  color: #267d51;
}
input {
  border: 1px solid #e1e8e2;
  background: #fff;
  border-radius: 5px;
  min-height: 33px;
  padding: 7px 8px;
  color: #506b59;
  font-size: 11px;
  min-width: 0;
}
input::placeholder {
  color: #b3beb5;
}
input[type='checkbox'] {
  accent-color: var(--green);
  min-height: auto;
}
.checkbox-label {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0 20px 16px;
  font-size: 10px;
  color: #859b8b;
}
.checkbox-label input {
  margin: 0;
}
.checkbox-label .muted {
  margin-left: auto;
}
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #6c8473;
  margin: 9px 0 7px;
}
.field-label > span {
  color: #a4b2a6;
  font-size: 8px;
}
.input-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.input-row > input {
  flex: 1;
  width: 100%;
  font-size: 10px;
}
.input-row > .button {
  font-size: 10px;
  padding-left: 9px;
  padding-right: 9px;
  min-height: 33px;
}
.mono {
  font-family: monospace;
}
.full {
  width: 100%;
}
.activity-card {
  margin-top: 23px;
}
.activity-card > .card-heading {
  height: 48px;
}
.activity-icon {
  font-size: 15px;
  color: #739582;
}
.log-count {
  font: 9px monospace;
  background: #f0f5f1;
  color: #91a396;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 2px;
}
.small-link {
  background: none;
  border: 0;
  font-size: 10px;
  color: #9aab9e;
  padding: 5px;
}
.activity-log {
  max-height: 198px;
  overflow-y: auto;
  padding: 0 20px;
}
.log-empty {
  padding: 22px 0;
  color: #a1afa5;
  font-size: 11px;
}
.log-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: start;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f3f0;
  font-size: 10px;
}
.log-row:last-child {
  border-bottom: 0;
}
.log-time {
  color: #a4b0a7;
  font-family: monospace;
  line-height: 1.7;
}
.log-body {
  color: #728b79;
  min-width: 0;
}
.log-body strong {
  font-weight: 500;
  color: #536d5b;
  display: block;
  line-height: 1.7;
}
.log-body p {
  margin: 3px 0 0;
  color: #91a296;
  font-family: monospace;
  font-size: 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 90px;
  overflow: auto;
}
.log-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #edf6ef;
  color: #529269;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 8px;
  white-space: nowrap;
}
.log-badge.error {
  background: #fff0eb;
  color: #bb775b;
}
.log-badge.info {
  background: #f2f5f3;
  color: #8c9f92;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 19px;
  gap: 20px;
  color: #a5b1a7;
  font-size: 8px;
}
.page-footer > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-footer .status-dot {
  width: 4px;
  height: 4px;
  background: #83b492;
}
.page-footer > span:last-child {
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #b0bbb3;
  font-size: 7px;
}
.notice {
  background: #fff5e8;
  border: 1px solid #f0dfc2;
  border-radius: 7px;
  padding: 12px 15px;
  color: #9b7a48;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.notice.error {
  color: #a45e46;
  background: #fff1eb;
  border-color: #eed8cd;
}
dialog {
  border: 1px solid #e2eae4;
  border-radius: 13px;
  box-shadow: 0 24px 100px #13312330;
  max-width: 440px;
  width: calc(100% - 36px);
  padding: 25px;
  color: var(--ink);
}
dialog::backdrop {
  background: #132b2855;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dialog-heading h2 {
  font-size: 17px;
}
.dialog-close {
  font-size: 24px;
  background: none;
  border: 0;
  color: #91a097;
  padding: 0 3px;
  line-height: 1;
}
dialog p {
  color: #87998c;
  font-size: 12px;
  line-height: 1.9;
  margin: 10px 0 16px;
}
dialog input {
  width: 100%;
}
.field-note {
  font-size: 10px !important;
  color: #a3b0a6 !important;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: calc(50% + 70px);
  transform: translateX(-50%);
  background: #203e31;
  color: #f0f8f1;
  padding: 12px 19px;
  border-radius: 8px;
  box-shadow: 0 8px 25px #12312322;
  font-size: 12px;
  z-index: 100;
  max-width: calc(100% - 32px);
  line-height: 1.7;
}
.toast.error {
  background: #8c4f40;
}
.screen-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-direction: column;
  background: #f7fbf8d9;
  color: #60806b;
  font-size: 10px;
  backdrop-filter: blur(2px);
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #cde2d3;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.tap-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #34b58a;
  background: #34b58a33;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 0 5px #34b58a15;
}
.key-button:disabled,
.device-action:disabled {
  opacity: 0.38;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1550px) {
  .screen-stage {
    min-height: 510px;
  }
  .phone-frame {
    width: 253px;
  }
  .overview-card {
    min-height: 114px;
  }
}
@media (max-width: 1180px) {
  .sidebar {
    width: 194px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .main {
    margin-left: 194px;
    padding: 28px 24px 18px;
  }
  .brand {
    padding-left: 10px;
    padding-right: 4px;
  }
  .brand strong {
    font-size: 20px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
  }
  .overview {
    gap: 10px;
  }
  .overview-card {
    padding: 16px 13px;
    gap: 8px;
  }
  .metric-icon {
    display: none;
  }
  .snapshot-footer {
    padding: 14px 17px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .button {
    padding: 9px 10px;
  }
  .device-title {
    padding-left: 17px;
    padding-right: 17px;
  }
}
@media (max-width: 920px) {
  .sidebar {
    width: 165px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .main {
    margin-left: 165px;
    padding: 25px 20px;
  }
  .brand {
    gap: 9px;
    padding-left: 8px;
  }
  .brand strong {
    font-size: 18px;
  }
  .brand strong > span {
    display: none;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 12px;
  }
  .overview-card {
    gap: 6px;
    padding: 14px 10px;
  }
  .overview-card strong {
    font-size: 18px;
  }
  .metric-hint {
    font-size: 8px;
  }
  .step-no {
    font-size: 8px;
  }
  .card-heading {
    padding: 0 16px;
  }
  .navigation-keys {
    padding-left: 15px;
    padding-right: 15px;
  }
  .checkbox-label {
    margin-left: 15px;
    margin-right: 15px;
  }
  .service-badge {
    font-size: 9px;
    padding: 8px;
  }
  .device-title p {
    max-width: 230px;
  }
  .phone-frame {
    width: 204px;
  }
  .screen-stage {
    padding: 20px 8px 14px;
    min-height: 420px;
  }
  .snapshot-footer > span {
    font-size: 8px;
  }
  h1 {
    font-size: 23px;
  }
  .sidebar .workspace-label {
    font-size: 8px;
    letter-spacing: 0.4px;
  }
  .tiny-pill {
    font-size: 7px;
  }
  .sidebar .device-list-heading {
    margin-left: 10px;
    margin-right: 10px;
  }
  .device-item {
    padding: 10px 7px;
    gap: 7px;
  }
  .device-icon {
    width: 26px;
    height: 34px;
  }
}
@media (max-width: 740px) {
  .sidebar {
    position: relative;
    width: auto;
    height: auto;
    padding: 17px 20px;
    display: block;
  }
  .brand {
    padding: 0;
    display: inline-flex;
  }
  .brand strong {
    font-size: 20px;
  }
  .brand strong > span {
    display: inline;
  }
  .sidebar nav,
  .workspace-label,
  .sidebar-bottom {
    display: none;
  }
  .device-list-heading {
    position: absolute;
    right: 20px;
    top: 12px;
    margin: 0 !important;
  }
  .device-list-heading > span:first-child {
    display: none;
  }
  .device-list {
    display: flex;
    gap: 7px;
    overflow: auto;
    min-height: 0;
    margin-top: 18px;
    padding-bottom: 2px;
  }
  .device-item {
    width: 147px;
    flex: none;
    margin-bottom: 0;
  }
  .device-item-name {
    font-size: 11px;
  }
  .device-icon {
    width: 25px;
  }
  .main {
    margin: 0;
    padding: 25px 16px 17px;
  }
  .page-header {
    align-items: flex-start;
    margin-bottom: 21px;
  }
  .page-header p {
    font-size: 11px;
  }
  .page-header .eyebrow {
    font-size: 8px;
  }
  h1 {
    font-size: 23px;
  }
  .overview {
    gap: 7px;
    margin-bottom: 17px;
  }
  .overview-card {
    display: block;
    padding: 12px 10px;
    min-height: 105px;
  }
  .step-no {
    display: none;
  }
  .metric-label {
    font-size: 9px;
  }
  .overview-card strong {
    font-size: 18px;
    margin-top: 10px;
  }
  .metric-hint {
    font-size: 8px;
    line-height: 1.6;
    max-width: 90px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .screen-stage {
    min-height: 445px;
  }
  .phone-frame {
    width: 220px;
  }
  .session-facts {
    padding-left: 15px;
    padding-right: 15px;
  }
  .traffic-area {
    padding: 14px 15px;
  }
  .navigation-keys {
    gap: 5px;
    padding: 13px 10px;
  }
  .checkbox-label {
    font-size: 9px;
    gap: 4px;
    margin: 0 10px 14px;
  }
  .checkbox-label > .muted {
    display: none;
  }
  .card-heading h2 {
    font-size: 11px;
  }
  .subtle-badge {
    font-size: 8px;
  }
  .traffic-heading {
    font-size: 9px;
  }
  .chart-caption {
    font-size: 7px;
  }
  .session-facts dd {
    font-size: 9px;
  }
  .session-facts dt {
    font-size: 10px;
  }
  .snapshot-footer {
    flex-wrap: nowrap;
  }
  .toast {
    left: 50%;
  }
  .page-footer {
    font-size: 7px;
  }
  .page-footer > span:last-child {
    display: none;
  }
  .device-title p {
    max-width: none;
    font-size: 9px;
  }
  .activity-card {
    margin-top: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition: none !important;
  }
}
/* Keep the compact console readable without relying on external fonts. */
.metric-label {
  font-size: 11px;
  color: #71877b;
}
.metric-hint {
  font-size: 10px;
  color: #83968b;
}
.overview-card strong small {
  font-size: 10px;
}
.button {
  font-size: 12px;
}
h2 {
  font-size: 13px;
}
.key-button {
  font-size: 11px;
}
.page-header p {
  color: #7d8f85;
}
.session-facts dt {
  color: #7f9487;
}
.snapshot-footer > span {
  color: #859b8e;
}
.field-label > span {
  color: #8f9f92;
}
.screen-empty p {
  color: #8b9f90;
}
@media (max-width: 920px) {
  .metric-label {
    font-size: 10px;
  }
  .metric-hint {
    font-size: 9px;
  }
  .button {
    font-size: 11px;
  }
}
@media (max-width: 740px) {
  .metric-label {
    font-size: 9px;
  }
  .metric-hint {
    font-size: 8px;
  }
}
.transport-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 20px 10px;
}
.transport-label {
  font-size: 10px;
  color: #819789;
}
.transport-options {
  display: flex;
  border: 1px solid #e0e9e3;
  background: #f7faf8;
  padding: 3px;
  border-radius: 6px;
  gap: 3px;
}
.transport-option {
  font-size: 10px;
  border: 0;
  background: transparent;
  color: #84998b;
  padding: 6px 9px;
  border-radius: 4px;
}
.transport-option.active {
  background: #fff;
  color: #247e57;
  box-shadow: 0 1px 4px #173d2915;
  font-weight: 600;
}
.transport-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 20px 4px;
  padding: 10px 0;
  border-bottom: 1px dashed #e8eeea;
}
.transport-comparison > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.transport-comparison span {
  font-size: 8px;
  color: #9aaba0;
}
.transport-comparison strong {
  font: 12px monospace;
  color: #617e6b;
  font-weight: 500;
}
@media (max-width: 740px) {
  .transport-picker {
    padding-left: 10px;
    padding-right: 10px;
    gap: 3px;
    flex-wrap: wrap;
  }
  .transport-options {
    gap: 0;
  }
  .transport-option {
    font-size: 9px;
    padding: 6px;
  }
  .transport-comparison {
    margin: 0 10px;
  }
  .transport-comparison span {
    font-size: 7px;
  }
}
.transport-note {
  font-size: 8px;
  color: #9aaba0;
  margin: 0 20px 3px;
  line-height: 1.6;
}
@media (max-width: 740px) {
  .transport-note {
    margin-left: 10px;
    margin-right: 10px;
    font-size: 7px;
  }
}
.phone-screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
}
@media (max-width: 1180px) {
}
@media (max-width: 920px) {
}
@media (max-width: 740px) {
}

.snapshot-source {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 0 22px 14px;
  font-size: 11px;
  color: #71877b;
}
.snapshot-source select {
  border: 1px solid #dfe7e1;
  border-radius: 5px;
  background: white;
  padding: 7px;
  color: #315b49;
  max-width: 100%;
}
.snapshot-source > span {
  font-size: 10px;
  color: #83968b;
}
.screenshot-dialog {
  width: min(800px, 96vw);
  max-width: 96vw;
  max-height: 94vh;
  padding: 0;
  overflow: hidden;
}
.original-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.original-heading h2 {
  margin: 0;
}
.original-heading p {
  margin: 6px 0 0;
  font-size: 11px;
}
.original-heading > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.original-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.original-actions .button {
  font-size: 11px;
  padding: 8px 10px;
}
.original-scroll {
  max-height: calc(94vh - 95px);
  overflow: auto;
  padding: 12px;
  background: #edf1ee;
  overscroll-behavior: contain;
}
.original-scroll img {
  display: block;
  max-width: none;
  max-height: none;
  margin: 0 auto;
  object-fit: initial;
}
.snapshot-footer {
  flex-wrap: wrap;
  gap: 10px;
}

/* Share the former snapshot area equally with the Python script console. */
.snapshot-card .capture-options {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 16px 14px;
}
.snapshot-card .capture-options .snapshot-source {
  padding: 0;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 0;
}
.capture-options .snapshot-source {
  font-size: 10px;
}
.capture-options .snapshot-source label {
  white-space: nowrap;
}
.capture-options .snapshot-source select {
  font-size: 10px;
  padding: 7px 5px;
  max-width: 150px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%);
  white-space: nowrap !important;
  border: 0 !important;
}
.workspace {
  grid-template-areas: 'snapshot scripts status' 'actions . status';
}
.workspace > .snapshot-card {
  grid-area: snapshot;
}
.workspace > .script-card {
  grid-area: scripts;
}
.workspace > .action-card {
  grid-area: actions;
}
.workspace > .status-column {
  grid-area: status;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  align-self: start;
}
.workspace > .action-card {
  align-self: stretch;
}
.status-column > .activity-card {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.status-column > .activity-card > .card-heading {
  height: 56px;
  flex-shrink: 0;
}
.status-column > .activity-card > .activity-log {
  flex: 1;
  max-height: 420px;
  min-height: 0;
}
.workspace > .snapshot-card,
.workspace > .script-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}
.workspace > .snapshot-card > .screen-stage {
  flex: 1;
}
.workspace > .snapshot-card > .card-heading,
.workspace > .script-card > .card-heading {
  flex-shrink: 0;
}
.scene-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.scene-heading-actions .small-link {
  color: var(--green);
  font-size: 10px;
  white-space: nowrap;
}
.workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 306px;
  gap: 18px;
}
.snapshot-card,
.script-card {
  min-width: 0;
}
.snapshot-card .phone-navigation {
  padding: 14px 17px 0;
  flex-shrink: 0;
}
.phone-navigation .key-button {
  flex-direction: row;
  justify-content: center;
  gap: 7px;
  padding: 11px 6px;
}
.snapshot-card .screen-stage {
  padding: 14px 8px;
  justify-content: center;
}
.snapshot-card .phone-frame {
  width: clamp(260px, 32vh, 320px);
  max-width: 100%;
  flex-shrink: 0;
}
.snapshot-card .card-heading {
  padding: 0 16px;
}
.snapshot-card .device-title {
  padding: 20px 16px;
}
.snapshot-card .snapshot-source {
  padding-left: 16px;
  padding-right: 16px;
}
.snapshot-card .device-title p {
  overflow-wrap: anywhere;
  max-width: 100%;
}
.snapshot-card .snapshot-footer {
  padding: 14px 16px;
}
.phone-frame {
  max-width: 94%;
}
.script-symbol {
  font: 600 15px monospace;
  color: var(--green);
}
.script-card .card-heading {
  padding: 0 18px;
}
.script-card .subtle-badge {
  font-size: 8px;
  letter-spacing: 0.6px;
}
.script-content {
  padding: 20px 18px;
}
.script-description {
  color: #80938a;
  font-size: 11px;
  line-height: 1.8;
  margin: 7px 0 15px;
  overflow-wrap: anywhere;
}
.script-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dde7e1;
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: #315c49;
  font-size: 12px;
  min-width: 0;
}
.script-maintenance {
  display: flex;
  gap: 5px;
  margin: 6px -4px 0;
}
.script-maintenance .small-link {
  font-size: 10px;
  color: #4e8870;
}
.script-maintenance .danger-link {
  color: #ae776c;
  margin-left: auto;
}
.script-stages {
  list-style: none;
  margin: 14px 0 18px;
  padding: 0;
  display: grid;
  gap: 13px;
}
.script-stages li {
  display: flex;
  gap: 10px;
  align-items: start;
}
.script-stages li > span {
  display: grid;
  place-items: center;
  flex: none;
  width: 23px;
  height: 23px;
  background: #edf5f0;
  border: 1px solid #e1ebe5;
  border-radius: 6px;
  color: #579075;
  font: 10px monospace;
}
.script-stages strong {
  font-size: 11px;
  font-weight: 600;
  color: #4e695b;
}
.script-stages code {
  display: inline-block;
  font: 9px monospace;
  color: #9aaba1;
  margin-left: 4px;
}
.script-stages p {
  font-size: 10px;
  color: #8a9c91;
  line-height: 1.8;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}
.script-parameters,
.script-output {
  border-top: 1px solid #edf1ee;
  padding: 12px 0;
}
.script-parameters summary,
.script-output summary,
.sdk-reference summary {
  cursor: pointer;
  color: #597765;
  font-size: 11px;
}
.script-parameters summary span {
  float: right;
  font: 9px monospace;
  color: #99aba0;
}
textarea {
  font:
    12px/1.65 Consolas,
    'Cascadia Code',
    monospace;
  color: #315746;
  background: #f9fbfa;
  border: 1px solid #dde7e0;
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  tab-size: 4;
}
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #65c8ab;
  outline-offset: 2px;
}
.script-parameters textarea {
  width: 100%;
  max-height: 330px;
  min-height: 180px;
}
.script-parameters p {
  font-size: 10px;
  color: #8a9b91;
  line-height: 1.7;
  margin: 6px 0;
}
.script-parameters .small-link {
  padding-left: 0;
  color: #4a8c70;
}
.script-status-box {
  padding: 14px 12px;
  background: #f4f8f5;
  border: 1px solid #e5eee7;
  border-radius: 7px;
  margin: 7px 0 13px;
}
.script-status-box > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.script-status-box strong {
  font-size: 12px;
  font-weight: 600;
  color: #496955;
}
.script-status-box .status-dot {
  background: #acbdb3;
}
.script-status-box .status-dot.running {
  background: #20a979;
  box-shadow: 0 0 0 3px #20a97919;
}
.script-status-box .status-dot.failed {
  background: #c3765f;
}
.script-status-box > div > span:last-child {
  margin-left: auto;
  font: 11px monospace;
  color: #799283;
}
.script-status-box p {
  font-size: 11px;
  line-height: 1.8;
  color: #7a9182;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}
.script-time {
  display: block;
  font-size: 9px;
  color: #95a69a;
  margin-top: 5px;
}
.script-buttons {
  display: flex;
  gap: 8px;
}
.script-buttons .primary {
  flex: 1;
}
.script-note {
  font-size: 10px;
  color: #91a297;
  line-height: 1.8;
  margin: 10px 0;
}
.script-output {
  margin-top: 10px;
  padding-bottom: 0;
}
.script-output pre {
  font:
    10px/1.8 Consolas,
    monospace;
  color: #758c7b;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 190px;
  overflow: auto;
  margin: 12px 0;
}
.template-section {
  border-top: 1px solid #e9efeb;
  padding: 19px 18px;
}
.template-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.template-heading h3 {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}
.template-heading p {
  font-size: 10px;
  color: #91a297;
  margin: 6px 0 0;
}
.template-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.template-toolbar .button {
  font-size: 10px;
  padding: 8px 10px;
  min-height: 32px;
}
.template-list {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
}
.template-empty {
  font-size: 11px;
  line-height: 1.8;
  color: #a0aea4;
  margin: 6px 0;
}
.template-row {
  display: flex;
  gap: 9px;
  align-items: center;
  border: 1px solid #e5ece7;
  border-radius: 6px;
  padding: 8px;
  min-width: 0;
}
.template-row img {
  width: 48px;
  height: 40px;
  object-fit: contain;
  background: #f3f6f4;
  border-radius: 3px;
  flex: none;
}
.template-row-body {
  min-width: 0;
  flex: 1;
}
.template-row-body strong {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #51755f;
  overflow-wrap: anywhere;
}
.template-row-body code {
  display: block;
  font:
    9px/1.7 Consolas,
    monospace;
  color: #81998a;
  overflow-wrap: anywhere;
}
.template-row-body small {
  font-size: 9px;
  color: #a0afa5;
}
.template-row-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: end;
}
.template-row-actions button {
  font-size: 9px;
  padding: 2px 3px;
  color: #5f9077;
}
.template-result {
  font-size: 11px;
  color: #658971;
  line-height: 1.8;
  overflow-wrap: anywhere;
  margin: 10px 0 0;
}
.template-result.error {
  color: #b67460;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.editor-toolbar input {
  width: 240px;
}
.editor-toolbar span {
  font: 12px monospace;
  color: #8ba292;
}
.editor-help {
  font-size: 11px;
  margin: 12px 0;
}
.code-editor {
  width: 100%;
  min-height: 380px;
  height: 48vh;
  background: #142d26;
  color: #d6e9de;
  font-size: 13px;
  line-height: 1.75;
  padding: 16px;
  border-color: #244637;
  resize: vertical;
  white-space: pre;
  overflow: auto;
}
.editor-feedback {
  min-height: 20px;
  color: #af6b56;
  font-size: 11px;
  line-height: 1.7;
  margin: 9px 0;
}
.editor-feedback.success {
  color: #348367;
}
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 10px;
}
.dialog-actions > span {
  font-size: 10px;
  color: #8fa394;
  line-height: 1.7;
}
.sdk-reference {
  margin-top: 14px;
}
.sdk-reference pre {
  font:
    11px/1.9 Consolas,
    monospace;
  color: #62816c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f5f8f6;
  padding: 14px;
  border-radius: 6px;
}
.template-upload-preview {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin: 0 auto 15px;
  background: #f5f8f6;
  border: 1px solid #e6ece8;
}
.template-ref-preview {
  font:
    12px/1.9 Consolas,
    monospace;
  background: #f1f7f3;
  border-radius: 5px;
  padding: 9px;
  overflow-wrap: anywhere;
}
.template-crop-dialog {
  max-width: 600px;
  max-height: 94vh;
  overflow: auto;
}
.crop-canvas-wrap {
  padding: 10px;
  background: #f0f4f1;
  border-radius: 6px;
}
.crop-canvas-wrap canvas {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: auto;
  cursor: crosshair;
  touch-action: none;
}
.template-crop-dialog > p {
  font-size: 11px;
}
@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'snapshot scripts' 'actions status';
    gap: 16px;
  }
  .screen-stage {
    min-height: 440px;
  }
  .main {
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 740px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas: 'snapshot' 'actions' 'scripts' 'status';
  }
  .main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .editor-toolbar {
    flex-wrap: wrap;
  }
  .editor-toolbar input {
    width: 180px;
  }
  .code-editor {
    font-size: 11px;
    min-height: 300px;
  }
  .dialog-actions {
    align-items: flex-start;
  }
  .script-card .subtle-badge {
    font-size: 8px;
  }
}

/* Workspace navigation and focused management pages. */
.sidebar {
  width: 216px;
  padding: 30px 16px 18px;
}
.sidebar nav {
  display: grid;
  gap: 6px;
}
.sidebar .brand {
  padding-bottom: 40px;
}
.sidebar-bottom {
  margin-top: auto;
}
.nav-code {
  width: 18px;
  font:
    600 14px Consolas,
    monospace;
  color: inherit;
}
.main {
  margin-left: 216px;
  max-width: none;
  padding: 34px 30px 20px;
}
.app-page {
  min-width: 0;
}
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-toolbar h2 {
  font-size: 15px;
}
.section-toolbar p {
  color: var(--muted);
  font-size: 11px;
  margin: 7px 0 0;
}
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.dashboard-metric {
  padding: 23px 24px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.dashboard-metric > span {
  font-size: 12px;
  color: #73877d;
}
.dashboard-metric strong {
  font-size: 34px;
  font-weight: 550;
  letter-spacing: -1px;
  color: #244b40;
}
.dashboard-metric small {
  color: #84968c;
  font-size: 11px;
}
.dashboard-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0;
}
.dashboard-links > button {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 21px;
  border: 1px solid #dce8e1;
  border-radius: 10px;
  background: #eef5f1;
  text-align: left;
}
.dashboard-links > button:hover {
  background: #e3f0e8;
}
.quick-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 10px;
  background: white;
  color: var(--green);
  flex-shrink: 0;
}
.dashboard-links strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
}
.dashboard-links small {
  display: block;
  font-size: 11px;
  color: #7d9286;
  margin-top: 7px;
}
.dashboard-links > button > svg {
  margin-left: auto;
  color: #60917a;
}
.table-scroll {
  overflow-x: auto;
}
.device-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
.device-table th {
  background: #fafcfb;
  font-size: 11px;
  color: #83958b;
  font-weight: 500;
  padding: 14px 20px;
  white-space: nowrap;
}
.device-table td {
  padding: 18px 20px;
  border-top: 1px solid #edf1ef;
  color: #698173;
  white-space: nowrap;
}
.device-table td strong {
  display: block;
  font-size: 12px;
  color: #355a49;
  font-weight: 500;
}
.device-table td small {
  display: block;
  font:
    10px Consolas,
    monospace;
  margin-top: 7px;
  color: #97a59d;
  max-width: 290px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.device-table .table-empty {
  padding: 36px;
  text-align: center;
  color: var(--muted);
}
.page-tabs {
  display: flex;
  gap: 25px;
  border-bottom: 1px solid #dfe7e3;
  margin-bottom: 22px;
}
.page-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0 5px 14px;
  color: #8c9b92;
  background: transparent;
  font-weight: 500;
}
.page-tabs button.active {
  color: var(--green);
  border-bottom-color: var(--green);
}
.page-tabs button span {
  margin-left: 6px;
  background: #e7efea;
  color: #719781;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}
.device-page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}
.device-page-toolbar .page-tabs {
  flex: 1;
}
.device-page-toolbar > div:last-child {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cloud-import-dialog {
  width: min(760px, 94vw);
  max-width: 94vw;
  max-height: 90vh;
  overflow: auto;
}
.cloud-import-dialog details {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}
.cloud-import-dialog summary {
  cursor: pointer;
  color: var(--green);
  font-size: 12px;
}
.enrollment-form {
  display: grid;
  gap: 14px;
}
.enrollment-form label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #6a8173;
}
.enrollment-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid #dde7e1;
  border-radius: 6px;
  padding: 10px;
}
.cloud-import-dialog .enrollment-form {
  margin-top: 16px;
}
.import-selection-heading {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 10px;
  font-size: 12px;
  color: #71877b;
}
.cloud-candidates {
  max-height: 360px;
  overflow-y: auto;
}
.cloud-candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line);
}
.cloud-candidate > span {
  flex: 1;
  min-width: 0;
}
.cloud-candidate input[type='checkbox'],
.import-selection-heading input[type='checkbox'] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: none;
  margin: 0;
}
.import-selection-heading label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cloud-candidate strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cloud-candidate small {
  display: block;
  font:
    10px/1.7 Consolas,
    monospace;
  color: #8c9d92;
  overflow-wrap: anywhere;
}
@media (max-width: 740px) {
  .device-page-toolbar {
    flex-wrap: wrap;
    margin-bottom: 15px;
  }
  .device-page-toolbar .page-tabs {
    min-width: 100%;
    margin-bottom: 0;
  }
}
.device-management {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.device-browser {
  position: sticky;
  top: 20px;
}
.device-browser .device-list-heading {
  position: static;
  color: #527261;
  margin: 0;
  padding: 18px 15px;
}
.device-browser .device-list-heading > span:first-child {
  display: block;
}
.device-browser .device-list-heading .icon-button {
  color: #658774;
}
.device-browser .count {
  background: #edf4ef;
  color: #6a8d76;
}
.device-search {
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  border: 1px solid #e0e8e3;
  border-radius: 6px;
  padding: 9px;
  font-size: 11px;
  background: #fafcfb;
  min-width: 0;
}
.device-browser .device-list {
  display: block;
  margin-top: 0;
  padding: 0 8px 8px;
  max-height: calc(100vh - 285px);
}
.device-browser .device-item {
  width: 100%;
  padding: 13px 9px;
  gap: 8px;
  margin-bottom: 6px;
}
.device-browser .device-item:hover {
  background: #f4f8f5;
}
.device-browser .device-item.active {
  background: #eaf4ee;
  border-color: #cfe2d5;
}
.device-browser .device-icon {
  background: #f0f5f2;
  color: #83a28f;
}
.device-browser .device-item.active .device-icon {
  background: #d7eadf;
  color: #438361;
}
.device-browser .device-item-name {
  color: #476452;
}
.device-browser .device-item-name > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-browser .device-list {
  overflow-x: hidden;
}
.device-record-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.device-record-actions .danger-link {
  color: #af6b56;
}
.device-detail .snapshot-card .device-title {
  gap: 12px;
  flex-wrap: wrap;
}
.device-detail .snapshot-card .device-title > div:first-child {
  flex: 1;
  min-width: 0;
}
.device-detail {
  min-width: 0;
}
.device-detail .overview {
  gap: 10px;
  margin-bottom: 17px;
}
.device-detail .overview-card {
  min-height: 100px;
  padding: 16px 12px;
  gap: 8px;
}
.device-detail .metric-icon {
  display: none;
}
.device-detail .overview-card strong {
  font-size: 20px;
}
.device-detail .workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
  grid-template-areas: 'actions snapshot status';
  gap: 16px;
  align-items: stretch;
}
.device-controls-column {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.device-controls-column > .action-card {
  flex: 1;
}
.device-controls-column > .device-script-card {
  flex: none;
}
.device-detail .workspace > .snapshot-card {
  align-self: stretch;
}
.device-detail .workspace > .status-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: stretch;
  min-height: 0;
}
.device-detail .status-column > .activity-card {
  height: 340px;
  flex: none;
}
.device-detail .status-column > .session-card {
  flex: none;
}
.device-script-content {
  padding: 16px;
}
.device-script-content > .button {
  margin-top: 12px;
  font-size: 11px;
}
.device-script-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  color: #587561;
  font-size: 11px;
}
.device-script-state strong {
  font-weight: 500;
}
.device-script-state .running {
  background: #20a979;
  box-shadow: 0 0 0 3px #20a97919;
}
.device-script-state .failed {
  background: #c3765f;
}
.device-script-content > .small-link {
  padding-left: 0;
  font-size: 10px;
  color: var(--green);
}
.device-detail .screen-stage {
  container-type: size;
  min-height: 570px;
  margin: 0 16px;
  padding: 10px 6px;
}
.device-detail .snapshot-card .phone-frame {
  width: min(100cqw, calc((100cqh - 60px) * var(--screen-aspect, 0.5625) + 12px));
  max-width: 100%;
}
.device-detail .snapshot-footer {
  justify-content: center;
}
.device-detail .workspace > .action-card {
  align-self: start;
}
.screen-controls {
  padding: 18px 16px;
}
.screen-controls h3,
.control-section-title {
  font-size: 11px;
  font-weight: 500;
  color: #71877b;
  margin: 0 0 12px;
}
.screen-controls h3:not(:first-child) {
  margin-top: 20px;
}
.screen-controls .capture-options {
  display: grid;
  gap: 12px;
}
.screen-controls .snapshot-source {
  padding: 0;
  margin: 0;
  flex-wrap: nowrap;
  font-size: 11px;
}
.screen-controls .snapshot-source select {
  min-width: 0;
  flex: 1;
  font-size: 11px;
}
.action-card > .card-heading {
  flex-wrap: wrap;
  height: auto;
  min-height: 56px;
  padding: 12px 16px;
  gap: 8px;
}
.action-heading-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.action-heading-controls .subtle-badge {
  display: none;
}
.action-heading-controls #connectButton {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 10px;
  gap: 4px;
}
.action-heading-controls #connectButton svg {
  width: 12px;
  height: 12px;
}
.connection-spinner {
  animation: connection-spin 1s linear infinite;
}
@keyframes connection-spin {
  to {
    transform: rotate(360deg);
  }
}
.screen-controls .snapshot-source {
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  width: 100%;
}
.screen-controls .snapshot-source label {
  flex: none;
  white-space: nowrap;
  font-size: 10px;
}
.screen-controls .capture-source-button {
  flex: none;
  padding: 4px;
  min-width: 24px;
  min-height: 28px;
}
.screen-controls .capture-source-button svg {
  width: 14px;
  height: 14px;
}
.screen-controls .snapshot-source select {
  flex: 0 1 150px;
  margin-left: auto;
  font-size: 10px;
  padding: 7px 2px;
}
.visible-text-input {
  padding: 16px 20px;
}
.visible-text-input .input-row {
  min-width: 0;
}
.visible-text-input .input-row input {
  min-width: 0;
}
.device-detail .snapshot-card .phone-navigation {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 0 16px 10px;
}
.device-detail .phone-navigation #viewOriginal {
  padding: 7px 10px;
  font-size: 11px;
}
.device-detail .phone-navigation .key-button {
  flex: none;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6d8c7d;
}
.device-detail .phone-navigation .key-button:hover:not(:disabled) {
  background: #edf5f0;
  color: var(--green);
}
.device-detail .phone-navigation .key-button svg {
  width: 17px;
  height: 17px;
}
.control-section-title {
  padding: 18px 20px 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.device-detail .status-column .activity-log {
  max-height: none;
  overflow-y: auto;
}
.device-detail .status-column .log-row {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 14px;
}
.device-detail .status-column .log-time {
  grid-column: 1;
  grid-row: 1;
}
.device-detail .status-column .log-badge {
  grid-column: 2;
  grid-row: 1;
}
.device-detail .status-column .log-body {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}
.script-device-context {
  padding: 20px 23px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.script-device-context h2 {
  font-size: 13px;
}
.script-device-context p {
  font-size: 11px;
  color: #8c9e92;
  margin: 7px 0 0;
}
.script-device-context select {
  min-width: 180px;
  max-width: 350px;
  flex: 1;
  margin-left: auto;
  border: 1px solid #dde7e1;
  border-radius: 6px;
  padding: 10px;
  background: white;
  color: #456954;
}
.script-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.script-workspace > .script-card {
  min-width: 0;
}
.script-workspace > .template-section {
  padding: 24px;
  border: 1px solid var(--line);
}
.script-workspace .script-content {
  padding: 24px;
}
.script-workspace .template-heading h3 {
  font-size: 15px;
}
.script-workspace .template-heading p {
  font-size: 11px;
}
.script-workspace .template-list {
  margin-top: 18px;
  max-height: 650px;
}
.script-workspace .template-row {
  padding: 12px;
}
.script-workspace .template-row img {
  width: 64px;
  height: 54px;
}
.script-workspace .template-row-body strong {
  font-size: 12px;
}
.script-workspace .script-stages {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.script-workspace .script-stages li {
  display: block;
}
.script-workspace .script-stages li > span {
  margin-bottom: 10px;
}
.script-workspace .script-stages code {
  display: block;
  margin: 7px 0 0;
}
.script-workspace .script-stages p {
  font-size: 11px;
}
@media (min-width: 1800px) {
  .dashboard-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 1450px) {
  .device-management {
    grid-template-columns: 1fr;
  }
  .device-browser {
    position: static;
  }
  .device-browser .device-list {
    display: flex;
    overflow-x: auto;
    max-height: 130px;
  }
  .device-browser .device-item {
    width: 180px;
    flex: none;
  }
}
@media (max-width: 1250px) {
  .main {
    padding: 28px 22px;
  }
  .device-management {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
  }
  .device-detail .workspace {
    gap: 12px;
  }
  .device-management {
    grid-template-columns: 1fr;
  }
  .device-browser {
    position: static;
  }
  .device-browser .device-list {
    display: flex;
    overflow-x: auto;
    max-height: 130px;
  }
  .device-browser .device-item {
    width: 180px;
    flex: none;
  }
  .device-detail .overview {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .device-detail .overview-card {
    min-height: 0;
    padding: 12px;
  }
  .device-detail .overview-card > div {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .device-detail .overview-card strong {
    font-size: 15px;
    margin: 0;
  }
  .device-detail .metric-hint {
    margin: 0;
  }
  .script-workspace {
    grid-template-columns: 1fr;
  }
  .script-device-context {
    flex-wrap: wrap;
  }
  .script-device-context select {
    max-width: none;
  }
}
@media (min-width: 741px) and (max-width: 960px) {
  .device-detail .workspace {
    grid-template-columns: minmax(0, 1fr) 210px;
    grid-template-areas: 'actions actions' 'snapshot status';
  }
}
@media (max-width: 740px) {
  .sidebar {
    position: static;
    width: 100%;
    padding: 17px 16px 12px;
  }
  .sidebar .brand {
    padding: 0 4px 19px;
  }
  .sidebar .workspace-label {
    display: none;
  }
  .sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }
  .sidebar nav .nav-item {
    justify-content: center;
    padding: 11px 4px;
    gap: 7px;
    font-size: 12px;
  }
  .sidebar-bottom {
    display: flex;
    padding-top: 10px;
    margin-top: 12px;
  }
  .sidebar-bottom .nav-item {
    width: auto;
    font-size: 11px;
    padding: 7px;
  }
  .main {
    margin-left: 0;
    padding: 24px 16px;
  }
  .page-header {
    margin-bottom: 24px;
  }
  h1 {
    font-size: 24px;
  }
  .page-header p {
    font-size: 11px;
    line-height: 1.8;
  }
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .dashboard-metric {
    padding: 18px;
  }
  .dashboard-metric strong {
    font-size: 28px;
  }
  .dashboard-metric small {
    line-height: 1.7;
  }
  .dashboard-links {
    grid-template-columns: 1fr;
  }
  .device-management {
    grid-template-columns: 1fr;
  }
  .device-browser {
    position: static;
  }
  .device-browser .device-list {
    max-height: 210px;
  }
  .device-detail .overview {
    display: none;
  }
  .device-detail .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'actions' 'snapshot' 'status';
    gap: 16px;
  }
  .device-detail .status-column > .activity-card {
    height: 300px;
  }
  .device-browser .device-list {
    display: block;
  }
  .device-browser .device-item {
    width: 100%;
  }
  .device-detail .screen-stage {
    min-height: 570px;
  }
  .script-device-context {
    padding: 18px;
    gap: 14px;
  }
  .script-device-context > div {
    width: 100%;
  }
  .script-device-context select {
    min-width: 0;
    width: 100%;
    flex: auto;
  }
  .script-workspace .script-content,
  .script-workspace > .template-section {
    padding: 18px;
  }
  .script-workspace .script-stages {
    grid-template-columns: 1fr;
  }
  .script-workspace .script-stages li {
    display: flex;
  }
  .script-workspace .script-stages code {
    display: inline-block;
    margin: 0 0 0 5px;
  }
}
/* 执行端登记与连接地址维护。 */
.nodes-dialog {
  max-width: 900px;
}
.nodes-node-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.nodes-node-list p {
  margin: 8px 0;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .nodes-node-form {
    grid-template-columns: 1fr;
  }
}
.phone-screen.interactive.dragging {
  cursor: grabbing;
}
.phone-screen.interactive,
.phone-screen.interactive img,
.phone-screen.interactive video {
  user-select: none;
  -webkit-user-drag: none;
}
.cloud-video-mount {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.cloud-video-mount video {
  width: 100% !important;
  height: 100% !important;
  inset: 0 !important;
  object-fit: contain !important;
  transform: none !important;
}
.display-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.display-heading h3 {
  margin: 0 !important;
}
.display-heading .switch-label {
  margin: 0;
  flex: none;
}
.command-tools {
  border-top: 1px solid #eef2ee;
  padding: 16px;
}
.device-functions-menu {
  position: fixed;
  z-index: 80;
  min-width: 140px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px #172c2a24;
}
.device-functions-menu .button {
  margin: 0;
  padding: 9px 12px;
  border: 0;
  text-align: left;
}
.device-menu-separator {
  border-top: 1px solid var(--line);
  margin: 5px 0;
}
.device-view-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  flex: none;
}
.device-detail .snapshot-card .device-view-toolbar .device-title {
  padding: 0;
  flex: 1;
  min-width: 0;
}
.device-view-toolbar .device-title h3,
.device-view-toolbar .device-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-detail .snapshot-card .device-view-toolbar .phone-navigation {
  padding: 0;
  gap: 4px;
  flex-wrap: nowrap;
  flex: none;
}
.device-view-toolbar .device-record-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
@media (max-width: 740px) {
  .device-view-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .device-view-toolbar .phone-navigation {
    grid-column: 1/-1;
    grid-row: 2;
    justify-self: center;
  }
  .device-view-toolbar .device-record-actions {
    grid-column: 2;
    grid-row: 1;
  }
}

.phone-functions {
  margin-top: 18px;
}
.phone-functions h3 {
  font-size: 11px;
  font-weight: 500;
  color: #71877b;
  margin: 0 0 10px;
}
.phone-function-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.phone-function-buttons .button {
  min-width: 0;
  justify-content: space-between;
  padding: 8px;
  font-size: 11px;
}

/* Script editing and global execution history. */
.script-workspace {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
}
.script-editor-controls,
.script-editor-inline {
  padding: 18px 24px;
}
.script-editor-controls {
  padding-bottom: 0;
}
.script-editor-inline {
  min-width: 0;
}
.script-editor-inline .code-editor {
  min-height: 420px;
  height: 55vh;
}
.script-editor-inline .editor-toolbar input {
  max-width: 100%;
}
.editor-run-panel {
  border-top: 1px solid var(--line);
}
.editor-run-panel > summary {
  cursor: pointer;
  padding: 18px 24px;
  color: var(--green);
  font-size: 12px;
}
.editor-run-panel .script-content {
  padding-top: 0;
}
.queue-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.queue-stat {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.queue-stat > span {
  color: var(--muted);
  font-size: 12px;
}
.queue-stat > strong {
  font-size: 28px;
}
.queue-card {
  padding: 20px;
}
.queue-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}
.queue-toolbar input {
  flex: 1;
  min-width: 0;
}
.queue-toolbar input,
.queue-toolbar select,
.queue-toolbar > .button {
  height: 36px;
  font-size: 12px;
}
.queue-toolbar select {
  width: 180px;
  appearance: none;
  border: 1px solid #dde7e1;
  border-radius: 6px;
  color: #456954;
  background-color: white;
  padding: 8px 34px 8px 12px;
  line-height: 18px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23688475' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.queue-toolbar select:hover {
  border-color: #b5d1bf;
}
.queue-toolbar select option {
  color: #456954;
  background: white;
}
.queue-feedback {
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
  margin: 16px 0;
}
.queue-card .table-scroll {
  overflow-x: auto;
}
.queue-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  font-size: 12px;
}
.queue-table th,
.queue-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.queue-table td strong,
.queue-table td small {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-table td small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.queue-table td:last-child {
  white-space: nowrap;
}
.queue-table .small-link + .small-link {
  margin-left: 12px;
}
.queue-status {
  display: inline-block;
  white-space: nowrap;
  border-radius: 5px;
  padding: 5px 8px;
  background: #f0f4f2;
  color: #677f73;
}
.queue-status.running,
.queue-status.checking {
  background: #e6f5ee;
  color: #118267;
}
.queue-status.queued {
  background: #fff6df;
  color: #947420;
}
.queue-status.failed {
  background: #fff0ed;
  color: #b45748;
}
.queue-empty {
  text-align: center !important;
  color: var(--muted);
}
.queue-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
}
.queue-pagination > span {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
}
#queueRunDialog {
  width: 800px;
  max-width: calc(100% - 32px);
}
#queueRunMeta {
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.queue-run-logs {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 55vh;
  overflow: auto;
  padding: 16px;
  background: #f5f8f6;
  font-size: 12px;
  line-height: 1.8;
}
@media (max-width: 1100px) {
  .script-workspace {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .script-editor-controls,
  .script-editor-inline {
    padding: 16px;
  }
  .queue-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .queue-toolbar {
    flex-wrap: wrap;
  }
  .queue-toolbar input {
    flex-basis: 100%;
  }
  .queue-toolbar select {
    flex: 1;
    min-width: 0;
  }
  .queue-card {
    padding: 14px;
    min-width: 0;
  }
  .queue-pagination {
    flex-wrap: wrap;
  }
  .queue-pagination > span {
    flex-basis: 100%;
  }
}

.script-device-context > div {
  margin-right: auto;
  flex-shrink: 0;
}
.script-device-context select {
  margin-left: 0;
  min-width: 140px;
}
.script-editor-controls .script-maintenance {
  margin: 0;
}
@media (max-width: 600px) {
  .script-device-context select {
    min-width: 0;
  }
}

/* Independent script browsing, editing, and template panels. */
.script-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1fr);
}
.script-library {
  min-width: 0;
  padding: 18px 12px;
}
.script-library h2 {
  font-size: 13px;
  margin: 0 6px 16px;
}
.script-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 75vh;
  overflow: auto;
}
.script-list-item {
  width: 100%;
  padding: 12px 10px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  text-align: left;
  color: #426957;
  cursor: pointer;
}
.script-list-item strong,
.script-list-item small {
  display: block;
  overflow-wrap: anywhere;
}
.script-list-item strong {
  font-size: 12px;
  font-weight: 500;
}
.script-list-item small {
  margin-top: 6px;
  font-size: 10px;
  color: #8b9f93;
}
.script-list-item.selected {
  border-color: #cce4d7;
  background: #edf6f0;
}
.script-list-item:hover {
  background: #f2f7f4;
}
.script-list-empty {
  font-size: 11px;
  color: var(--muted);
  padding: 0 6px;
}
.script-workspace > .template-section {
  min-width: 0;
  padding: 18px 12px;
}
.script-workspace .template-heading {
  flex-wrap: wrap;
  gap: 12px;
}
.script-workspace .template-row {
  flex-wrap: wrap;
  padding: 10px 6px;
}
.script-workspace .template-row-body {
  min-width: 0;
}
.script-workspace .template-row-actions {
  flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .script-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  }
  .script-workspace > .template-section {
    grid-column: 1/-1;
  }
}
@media (max-width: 600px) {
  .script-workspace {
    grid-template-columns: 1fr;
  }
  .script-list {
    max-height: 220px;
  }
  .script-workspace > .template-section {
    grid-column: auto;
  }
}

.device-id-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.device-id-row #selectedId {
  min-width: 0;
}
.device-id-row .icon-button {
  flex: none;
  padding: 3px;
}
.device-id-row .icon-button svg {
  width: 13px;
  height: 13px;
}

.device-connection-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 10px;
  color: #8a9b92;
  white-space: nowrap;
}
.device-connection-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.device-connection-status.connected {
  color: #329c75;
}
.device-connection-status.connecting {
  color: #b39548;
}
.device-connection-status.failed {
  color: #b46d5d;
}

.script-list-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.script-list-row .script-list-item {
  flex: 1;
  min-width: 0;
  width: auto;
}
.script-list-row .delete-script {
  flex: none;
  padding: 6px 4px;
  font-size: 10px;
  color: #7c8f84;
}

.action-heading-controls .connection-text {
  font-size: 10px;
  color: #89998f;
  white-space: nowrap;
}
.action-heading-controls .connection-text.connected {
  color: #329c75;
}
.action-heading-controls .connection-text.pending {
  color: #a98b40;
}

/* Keep media intrinsic dimensions from overflowing the phone viewport. */
.phone-screen > video,
.phone-screen > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-width: 0;
  min-height: 0;
}
.device-node-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 12px;
  color: #6b8277;
  font-size: 11px;
}
.device-node-filter > span {
  flex: none;
}
.device-node-filter .script-select {
  flex: 1;
  min-height: 34px;
  font-size: 11px;
}
.device-item-node {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #81988b;
  font-size: 10px;
}
.dashboard-metrics.nodes-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dashboard-nodes {
  margin-bottom: 22px;
}
.node-health {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #298b6d;
}
.node-health::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.node-health.unavailable {
  color: #ae6858;
}
.nodes-node-route {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
}
.nodes-node-route label {
  flex: 1;
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: #6b8277;
}
@media (max-width: 1000px) {
  .dashboard-metrics.nodes-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
