:root {
  --bg: #f6f7f9;
  --panel: #fff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #d9dee7;
  --accent: #1976d2;
  --accent-dark: #125aa0;
  --ok: #138a36;
  --warn: #b7791f;
  --bad: #c62828;
  --shadow: 0 12px 30px rgba(22, 34, 51, 0.08);
}

/* Recording storage and upload state: one quiet operational band, then inline progress. */
.recording-storage-banner {
  display: grid;
  grid-template-columns: 8px auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: -8px 0 18px;
  padding: 10px 14px;
  border: 1px solid #e7c66f;
  border-radius: 8px;
  background: #fff8df;
  color: #644b10;
  line-height: 1.4;
}

.recording-storage-banner.stopped {
  border-color: #e6a29d;
  background: #fff0ef;
  color: #7c2722;
}

.recording-storage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d59a13;
}

.recording-storage-banner.stopped .recording-storage-dot {
  background: #cf4037;
}

.recording-storage-banner strong {
  white-space: nowrap;
}

.recording-storage-banner > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recording-upload-progress {
  display: grid;
  gap: 7px;
  min-height: 38px;
  padding: 2px 1px;
}

.recording-upload-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 13px;
}

.recording-upload-progress-head span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.recording-upload-track {
  position: relative;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(39, 44, 52, 0.10);
}

.recording-upload-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f6f63;
  transition: width 180ms ease;
}

.recording-upload-state {
  min-height: 28px;
  color: #2f6f63;
  font-size: 13px;
  font-weight: 750;
}

.recording-upload-state.purged {
  color: var(--muted);
}

body.theme-dark .recording-storage-banner {
  border-color: rgba(229, 183, 67, 0.42);
  background: rgba(111, 82, 15, 0.34);
  color: #f2d98d;
}

body.theme-dark .recording-storage-banner.stopped {
  border-color: rgba(224, 104, 94, 0.44);
  background: rgba(112, 34, 29, 0.34);
  color: #f2aaa4;
}

body.theme-dark .recording-upload-track {
  background: rgba(255, 255, 255, 0.12);
}

body.theme-dark .recording-upload-track > span {
  background: #70b2a6;
}

@media (max-width: 700px) {
  .recording-storage-banner {
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 7px 9px;
    margin-top: -10px;
    padding: 10px 12px;
  }

  .recording-storage-banner > span:last-child {
    grid-column: 2;
  }

  .recording-upload-progress-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.auth-pending .app,
.auth-screen .app,
body:not(.auth-screen) .auth-panel {
  display: none;
}

.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-box {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-box label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-message {
  position: fixed;
  top: 24px;
  left: 50%;
  width: min(420px, calc(100vw - 48px));
  transform: translateX(-50%);
  text-align: center;
}

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

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button.primary,
.topbar button,
.section-head button,
menu button:last-child {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover,
.topbar button:hover,
.section-head button:hover,
menu button:last-child:hover {
  background: var(--accent-dark);
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #202833;
  color: #fff;
  padding: 22px 16px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2c94c;
  color: #202833;
  font-weight: 800;
}

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

.brand h1 {
  font-size: 18px;
}

.brand p,
#view-subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.sidebar .brand p {
  color: #bac4d0;
}

nav {
  display: grid;
  gap: 8px;
}

.nav {
  text-align: left;
  color: #e8eef6;
  border: 0;
  background: transparent;
}

.nav.active,
.nav:hover {
  background: #334155;
  color: #fff;
}

main {
  padding: 24px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.actions {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto auto auto auto;
  gap: 8px;
  align-items: center;
}

.current-user {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid #b9d7ff;
  background: #eaf3ff;
}

.hidden,
.view {
  display: none;
}

.form-grid label.hidden {
  display: none;
}

.view.active {
  display: block;
}

.metric-action {
  position: relative;
}

body .metric-action > button,
body .metric-action > button:hover,
body.theme-dark .metric-action > button,
body.theme-dark .metric-action > button:hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: inherit;
  box-shadow: none;
  backdrop-filter: none;
  cursor: pointer;
}

body .metric-action > button:focus-visible {
  outline: 2px solid #438680;
  outline-offset: -2px;
}

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

.metrics div,
.panel,
.card,
.row,
dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
}

.metrics div {
  padding: 16px;
}

.metrics span {
  display: block;
  font-size: 30px;
  font-weight: 800;
}

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

.overview-shell {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.overview-sidebar {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 16px;
}

.metrics-rail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.metrics-rail div {
  padding: 12px;
}

.metrics-rail span {
  font-size: 24px;
}

.overview-computer-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  padding-right: 4px;
}

.overview-computer-list::-webkit-scrollbar {
  width: 8px;
}

.overview-computer-list::-webkit-scrollbar-thumb {
  background: #c8d2df;
  border-radius: 999px;
}

.overview-computer-item {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
}

.overview-computer-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.12);
}

.overview-computer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.overview-computer-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.overview-computer-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.update-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-color: #b8e2c4;
  background: #e9f8ee;
  color: var(--ok);
  font-weight: 800;
}

button:disabled,
.update-icon:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.update-icon:disabled {
  background: #eef0f3;
  border-color: #d1d1d6;
  color: #8e8e93;
}

.overview-computer-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.overview-computer-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-size: 13px;
  line-height: 1.35;
}

.overview-computer-row span {
  color: var(--muted);
}

.overview-computer-row strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

.overview-detail {
  min-width: 0;
}

.card {
  padding: 16px;
}

.overview-card {
  min-height: calc(100vh - 164px);
}

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

.section-head {
  margin-bottom: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2f7;
  color: #475569;
}

.status.online,
.status.idle {
  background: #e9f8ee;
  color: var(--ok);
}

.status.running,
.status.dispatching,
.status.queued {
  background: #fff4df;
  color: var(--warn);
}

.status.offline,
.status.failed,
.status.canceled,
.status.cancelled {
  background: #ffebee;
  color: var(--bad);
}

.status.success {
  background: #e9f8ee;
  color: var(--ok);
}

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

.meta-stack {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.meta-line {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
}

.meta-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.meta-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.flow-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.flow-chip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}

.flow-chip > div { min-width: 0; }
.flow-chip .muted { overflow-wrap: anywhere; word-break: break-word; }
.readonly-multiline { min-height: 96px; resize: none; overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; }

.table-list,
.log-list {
  display: grid;
  gap: 10px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(120px, 160px) minmax(220px, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.row {
  padding: 14px;
}

.task-row {
  cursor: pointer;
  box-shadow: none;
}

.task-row.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.12);
}

.row-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.panel {
  padding: 16px;
}

.queue-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.task-detail {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.task-detail-head,
.snapshot-head,
.detail-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-detail h3,
.detail-section h4,
.snapshot-head h4 {
  margin: 0;
}

.detail-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  margin: 14px -4px 2px;
  padding: 4px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.detail-tab {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.detail-tab:hover {
  color: var(--text);
  background: #f8fafc;
}

.detail-tab.active {
  color: var(--text);
  border-color: var(--line);
  border-bottom-color: #fff;
  background: #fff;
}

.detail-tab-panel {
  min-height: 180px;
}

.detail-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.detail-grid {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
}

.detail-row span {
  color: var(--muted);
  font-size: 12px;
}

.detail-row strong {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}

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

.detail-log {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}

.detail-log .muted {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}
.task-log-list {
  display: grid;
  gap: 10px;
}

.task-log-group {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}

.task-log-group .muted {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

.task-log-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  background: #fff;
}

.task-log-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.task-log-table th,
.task-log-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
}

.task-log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
}

.task-log-table tr:last-child td {
  border-bottom: 0;
}

.task-log-content {
  max-width: 520px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

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

.recording-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #f1d49a;
  border-radius: 6px;
  background: #fff8e8;
  color: #6b4d16;
}

.recording-notice p {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.45;
}

.recording-notice p:last-child {
  margin-bottom: 0;
}

.recording-item {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}

.recording-video {
  display: block;
  width: 100%;
  max-height: 300px;
  border-radius: 6px;
  background: #111827;
}

.recording-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  text-align: center;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  background: #f6f8fb;
}

.snapshot-card {
  margin-top: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.snapshot-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  background: #f6f8fb;
}

.snapshot-image {
  display: block;
  width: 100%;
  max-height: 360px;
  margin-top: 10px;
  object-fit: contain;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  background: #111827;
}

.snapshot-caption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid .wide,
.form-grid button {
  grid-column: 1 / -1;
}

.check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
  min-height: auto;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  padding: 18px;
}

dialog::backdrop {
  background: rgba(17, 24, 39, 0.45);
}

menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions,
  .metrics,
  .filter-bar,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

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

  .task-detail {
    position: static;
    max-height: none;
  }

  .overview-sidebar {
    position: static;
  }

  .overview-computer-list {
    max-height: none;
  }
}

/* iOS-style visual refresh, scoped to presentation only. */
:root {
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.16);
  --accent: #007aff;
  --accent-dark: #0066d6;
  --ok: #248a3d;
  --warn: #a05a00;
  --bad: #d70015;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 245, 247, 0));
  z-index: -1;
}

.sidebar {
  background: rgba(242, 242, 247, 0.86);
  color: var(--text);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.mark {
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.22);
}

.brand h1 {
  color: var(--text);
  font-weight: 800;
}

.sidebar .brand p,
.brand p,
#view-subtitle {
  color: var(--muted);
}

.nav {
  position: relative;
  min-height: 38px;
  padding: 9px 12px;
  color: var(--text);
  border-radius: 8px;
  font-weight: 650;
}

.nav.active,
.nav:hover {
  background: rgba(0, 122, 255, 0.12);
  color: var(--accent-dark);
}

main {
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: -22px -22px 18px;
  padding: 18px 22px 14px;
  background: rgba(245, 245, 247, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

#view-title {
  font-size: 25px;
  font-weight: 800;
}

button {
  min-height: 34px;
  border-color: rgba(60, 60, 67, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent);
  font-weight: 650;
  box-shadow: none;
}

button:hover {
  border-color: rgba(0, 122, 255, 0.35);
  background: rgba(0, 122, 255, 0.08);
}

button.primary,
.topbar button,
.section-head button,
menu button:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.primary:hover,
.topbar button:hover,
.section-head button:hover,
menu button:last-child:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

button:disabled,
.update-icon:disabled {
  background: rgba(118, 118, 128, 0.10);
  color: var(--muted);
  border-color: transparent;
  opacity: 1;
}

input,
select,
textarea {
  min-height: 38px;
  border-color: transparent;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.10);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 122, 255, 0.42);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.metrics div,
.panel,
.card,
.row,
dialog,
.auth-box {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metrics div {
  background: rgba(255, 255, 255, 0.86);
}

.metrics span {
  color: var(--text);
  font-weight: 800;
}

.overview-computer-item,
.flow-chip,
.detail-log,
.task-log-group,
.recording-item {
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.overview-computer-item:hover,
.task-row:hover,
.row:hover {
  border-color: rgba(0, 122, 255, 0.24);
  background: rgba(255, 255, 255, 0.96);
}

.overview-computer-item.active,
.task-row.active {
  border-color: rgba(0, 122, 255, 0.55);
  background: rgba(0, 122, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.18);
}

.status {
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
}

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

.status.online,
.status.idle,
.status.success {
  background: rgba(52, 199, 89, 0.14);
  color: var(--ok);
}

.status.running,
.status.dispatching,
.status.queued,
.status.busy {
  background: rgba(255, 159, 10, 0.16);
  color: var(--warn);
}

.status.offline,
.status.failed,
.status.canceled,
.status.cancelled {
  background: rgba(255, 59, 48, 0.13);
  color: var(--bad);
}

.update-icon {
  width: 26px;
  height: 26px;
  border-color: transparent;
  background: rgba(52, 199, 89, 0.14);
  color: var(--ok);
}

.row-meta,
.overview-computer-meta,
.meta-label,
.detail-row span,
.form-grid label,
.current-user,
.muted {
  color: var(--muted);
}

.meta-line,
.detail-row,
.task-log-table th,
.task-log-table td {
  border-bottom-color: rgba(60, 60, 67, 0.12);
}

.queue-shell {
  gap: 16px;
}

.task-detail {
  top: 82px;
}

.detail-tabs {
  gap: 2px;
  margin: 14px 0 4px;
  padding: 3px;
  border: 0;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.14);
}

.detail-tab {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.detail-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.62);
}

.detail-tab.active {
  color: var(--text);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.task-log-table-wrap,
.recording-empty,
.snapshot-empty,
.snapshot-image,
.recording-video {
  border-color: rgba(60, 60, 67, 0.14);
  border-radius: 8px;
}

.task-log-table th {
  background: rgba(249, 249, 251, 0.96);
}

.task-log-content {
  font-family: "SFMono-Regular", Consolas, "Microsoft YaHei UI", monospace;
}

.recording-notice {
  border-color: rgba(255, 159, 10, 0.28);
  border-radius: 8px;
  background: rgba(255, 204, 0, 0.12);
  color: #7a4b00;
}

.snapshot-card {
  border-color: rgba(60, 60, 67, 0.16);
  border-style: solid;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.notice {
  border-color: rgba(0, 122, 255, 0.26);
  border-radius: 8px;
  background: rgba(0, 122, 255, 0.10);
  color: var(--accent-dark);
}

@media (max-width: 900px) {
  main {
    padding: 14px;
  }

  .topbar {
    margin: -14px -14px 14px;
    padding: 14px;
  }

  .sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  nav {
    display: flex;
    overflow-x: auto;
  }

  .nav {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}
/* iOS 26 Liquid Glass refinement. Presentation-only overrides. */
:root {
  --bg: #f6f7fb;
  --panel: rgba(255, 255, 255, 0.70);
  --text: #101014;
  --muted: #6f7178;
  --line: rgba(40, 42, 48, 0.12);
  --accent: #0a84ff;
  --accent-dark: #006fd6;
  --ok: #1f8f45;
  --warn: #ad6300;
  --bad: #d70015;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --shadow: 0 18px 48px rgba(28, 31, 38, 0.08), 0 2px 8px rgba(28, 31, 38, 0.05);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

html {
  background: #f6f7fb;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84) 0%, rgba(245, 247, 252, 0.78) 44%, rgba(240, 243, 249, 0.86) 100%);
  color: var(--text);
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.80), rgba(255, 255, 255, 0.24) 34%, rgba(246, 247, 251, 0) 100%);
}

.app {
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  padding: 24px 16px;
  background: rgba(244, 245, 250, 0.74);
  border-right: 1px solid rgba(60, 60, 67, 0.14);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(28px) saturate(1.45);
}

.brand {
  gap: 12px;
  margin-bottom: 30px;
}

.mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(10, 132, 255, 0.92);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.24), var(--inner-light);
}

.brand h1 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.12;
}

.brand p,
.sidebar .brand p,
#view-subtitle {
  color: var(--muted);
  font-size: 12px;
}

nav {
  gap: 8px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 12px;
  color: #1f2229;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 720;
  background: transparent;
}

.nav::before {
  width: 20px;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

.nav:nth-child(1)::before { content: "⌁"; }
.nav:nth-child(2)::before { content: "▣"; }
.nav:nth-child(3)::before { content: "◇"; }
.nav:nth-child(4)::before { content: "≡"; }
.nav:nth-child(5)::before { content: "⌕"; }
.nav:nth-child(6)::before { content: "⚙"; }
.nav:nth-child(7)::before { content: "◉"; }

.nav.active,
.nav:hover {
  background: rgba(10, 132, 255, 0.14);
  color: #005fc7;
  box-shadow: var(--inner-light);
}

.nav.active::before,
.nav:hover::before {
  color: #005fc7;
}

main {
  padding: 24px 22px;
}

.topbar {
  min-height: 88px;
  margin: -24px -22px 22px;
  padding: 18px 22px 16px;
  background: rgba(248, 249, 252, 0.72);
  border-bottom: 1px solid rgba(60, 60, 67, 0.13);
  box-shadow: 0 10px 30px rgba(40, 44, 52, 0.045);
  backdrop-filter: blur(30px) saturate(1.6);
}

#view-title {
  font-size: 29px;
  line-height: 1.08;
  font-weight: 830;
}

.actions {
  grid-template-columns: minmax(280px, 420px) auto auto auto auto;
  gap: 10px;
}

#command-input,
input,
select,
textarea {
  min-height: 40px;
  border: 1px solid rgba(60, 60, 67, 0.08);
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.025), var(--inner-light);
}

#command-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: rgba(60, 60, 67, 0.52);
}

button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--accent);
  font-size: 14px;
  font-weight: 760;
  box-shadow: var(--inner-light), 0 3px 12px rgba(20, 24, 32, 0.045);
  backdrop-filter: blur(18px) saturate(1.25);
}

button:hover {
  border-color: rgba(10, 132, 255, 0.30);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-dark);
}

button.primary,
.topbar button,
.section-head button,
menu button:last-child {
  border-color: rgba(10, 132, 255, 0.74);
  background: rgba(10, 132, 255, 0.92);
  color: #fff;
  box-shadow: var(--inner-light), 0 10px 22px rgba(10, 132, 255, 0.18);
}

button.primary:hover,
.topbar button:hover,
.section-head button:hover,
menu button:last-child:hover {
  background: rgba(0, 111, 214, 0.94);
}

.section-head {
  margin-bottom: 18px;
}

.section-head h3 {
  font-size: 22px;
  font-weight: 820;
}

.metrics div,
.panel,
.card,
.row,
dialog,
.auth-box,
.overview-computer-item,
.flow-chip,
.detail-log,
.task-log-group,
.recording-item,
.snapshot-card {
  border: 1px solid rgba(60, 60, 67, 0.11);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: var(--shadow), var(--inner-light);
  backdrop-filter: blur(24px) saturate(1.35);
}

.row,
.overview-computer-item {
  padding: 16px;
}

.table-list,
.log-list {
  gap: 12px;
}

.row h3,
.card h3,
.task-detail h3 {
  color: var(--text);
  font-size: 20px;
  line-height: 1.12;
  font-weight: 820;
}

.row-head {
  align-items: flex-start;
}

.row-head .muted,
.overview-computer-meta,
.row-meta {
  font-size: 12.5px;
}

.row-meta {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid rgba(60, 60, 67, 0.10);
  color: var(--muted);
}

.row-actions {
  align-items: center;
  gap: 8px;
}

.row-actions button {
  min-height: 34px;
  padding: 7px 12px;
}

.status {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  box-shadow: var(--inner-light);
}

.status::before {
  width: 6px;
  height: 6px;
}

.status.online,
.status.idle,
.status.success {
  background: rgba(48, 209, 88, 0.16);
  color: #16833a;
}

.status.running,
.status.dispatching,
.status.queued,
.status.busy {
  background: rgba(255, 159, 10, 0.18);
  color: #a85a00;
}

.status.offline,
.status.failed,
.status.canceled,
.status.cancelled {
  background: rgba(255, 69, 58, 0.15);
  color: #d70015;
}

.overview-shell {
  gap: 18px;
}

.overview-sidebar {
  top: 104px;
}

.metrics-rail div {
  padding: 14px;
}

.metrics-rail span {
  font-size: 25px;
  font-weight: 850;
}

.overview-computer-item.active,
.task-row.active {
  border-color: rgba(10, 132, 255, 0.34);
  background: rgba(10, 132, 255, 0.11);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.18), var(--inner-light), 0 12px 28px rgba(10, 132, 255, 0.08);
}

.task-detail {
  top: 104px;
}

.detail-tabs {
  gap: 3px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.16);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.045), var(--inner-light);
}

.detail-tab {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 760;
}

.detail-tab.active {
  background: rgba(255, 255, 255, 0.92);
  color: #111216;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12), var(--inner-light);
}

.detail-section h4,
.snapshot-head h4 {
  font-size: 16px;
  font-weight: 800;
}

.detail-row,
.meta-line {
  padding: 9px 0;
}

.detail-row span,
.meta-label {
  font-size: 12px;
}

.detail-row strong,
.meta-value {
  font-size: 13.5px;
}

.task-log-table-wrap {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--inner-light);
}

.task-log-table {
  font-size: 12.5px;
}

.task-log-table th {
  background: rgba(248, 248, 252, 0.94);
  font-weight: 780;
}

.task-log-content {
  font-family: "SF Mono", "SFMono-Regular", Consolas, "Microsoft YaHei UI", monospace;
  line-height: 1.55;
}

.recording-video,
.snapshot-image,
.recording-empty,
.snapshot-empty {
  border-radius: 8px;
}

.auth-panel {
  background: rgba(246, 247, 251, 0.75);
}

.auth-box {
  padding: 24px;
}

.auth-box h2,
#editor-title {
  font-size: 24px;
  font-weight: 830;
}

@media (max-width: 900px) {
  .topbar {
    min-height: auto;
  }

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

  .sidebar {
    backdrop-filter: blur(24px) saturate(1.35);
  }
}
/* iOS 26 control tuning: wider nav pills, softer controls, less blue. */
:root {
  --accent: #2f7df6;
  --accent-dark: #1f5fc6;
  --control: rgba(255, 255, 255, 0.70);
  --control-hover: rgba(255, 255, 255, 0.92);
  --control-border: rgba(60, 60, 67, 0.13);
  --control-text: #202126;
}

.sidebar {
  padding: 24px 14px;
}

nav {
  gap: 9px;
}

.nav {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #24262d;
  font-size: 16px;
  font-weight: 760;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 4px 14px rgba(24, 27, 35, 0.035);
}

.nav::before {
  width: 22px;
  font-size: 15px;
}

.nav.active,
.nav:hover {
  border-color: rgba(10, 132, 255, 0.20);
  background: rgba(213, 232, 255, 0.82);
  color: #111827;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 8px 20px rgba(52, 117, 224, 0.08);
}

button {
  border-color: var(--control-border);
  background: var(--control);
  color: var(--control-text);
}

button:hover {
  border-color: rgba(60, 60, 67, 0.18);
  background: var(--control-hover);
  color: #111216;
}

button.primary,
.topbar button,
.section-head button,
menu button:last-child {
  border-color: rgba(60, 60, 67, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: #111216;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 5px 16px rgba(20, 24, 32, 0.055);
}

button.primary:hover,
.topbar button:hover,
.section-head button:hover,
menu button:last-child:hover {
  border-color: rgba(47, 125, 246, 0.28);
  background: rgba(255, 255, 255, 0.95);
  color: #111216;
}

#logout,
button[data-delete-computer],
button[data-delete-flow],
button[data-delete-user] {
  color: #d70015;
}

#parse-command,
#refresh,
#logout {
  min-height: 40px;
  border-radius: 999px;
  padding: 8px 16px;
}

.section-head button,
.row-actions button,
.flow-chip button,
menu button,
.update-icon {
  border-radius: 999px;
}

.row-actions button {
  min-height: 32px;
  padding: 6px 12px;
}

.section-head button {
  min-height: 40px;
  padding: 8px 17px;
}

.status,
.update-icon {
  border-radius: 999px;
}

.status {
  min-height: 28px;
  padding: 5px 11px;
}

.metrics div,
.panel,
.card,
.row,
dialog,
.auth-box,
.overview-computer-item,
.flow-chip,
.detail-log,
.task-log-group,
.recording-item,
.snapshot-card {
  border-radius: 12px;
}

.table-list .row,
.overview-computer-item {
  border-radius: 12px;
}

#command-input,
input,
select,
textarea {
  border-radius: 12px;
}

.actions #command-input {
  border-radius: 12px;
}

.detail-tabs {
  border-radius: 999px;
}

.detail-tab {
  border-radius: 999px;
}

.task-log-table-wrap,
.recording-video,
.snapshot-image,
.recording-empty,
.snapshot-empty {
  border-radius: 12px;
}

.overview-computer-item.active,
.task-row.active {
  border-color: rgba(47, 125, 246, 0.28);
  background: rgba(214, 232, 255, 0.72);
}

.update-icon:not(:disabled) {
  background: rgba(52, 199, 89, 0.15);
  color: #16833a;
}

.update-icon.update-failed:not(:disabled) {
  background: rgba(255, 149, 0, 0.16);
  border-color: rgba(255, 149, 0, 0.36);
  color: #b85f00;
}

.current-user {
  color: #767680;
}

@media (max-width: 900px) {
  .nav {
    min-width: 96px;
    justify-content: center;
  }
}
/* Day/Night mode toggle. */
.theme-toggle {
  width: 72px;
  min-width: 72px;
  height: 40px;
  min-height: 40px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  padding: 3px;
  border-radius: 999px;
  border-color: rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.70);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 5px 16px rgba(20, 24, 32, 0.055);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.94);
}

.theme-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.theme-sun {
  color: #f7b500;
}

.theme-moon {
  color: #344054;
}

.theme-toggle[data-theme="light"] .theme-sun,
.theme-toggle[data-theme="dark"] .theme-moon {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  transform: scale(1.02);
}

body.theme-dark {
  --bg: #101114;
  --panel: rgba(30, 32, 38, 0.72);
  --text: #f5f7fb;
  --muted: #a5a8b2;
  --line: rgba(255, 255, 255, 0.13);
  --glass: rgba(28, 30, 36, 0.66);
  --glass-strong: rgba(38, 41, 49, 0.82);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.22);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --control: rgba(42, 45, 54, 0.72);
  --control-hover: rgba(56, 60, 70, 0.88);
  --control-border: rgba(255, 255, 255, 0.12);
  --control-text: #f4f6fb;
}

body.theme-dark {
  background:
    linear-gradient(135deg, rgba(24, 26, 32, 0.98) 0%, rgba(14, 15, 19, 0.96) 46%, rgba(22, 25, 32, 0.98) 100%);
}

body.theme-dark::before {
  background: linear-gradient(180deg, rgba(70, 76, 92, 0.20), rgba(16, 17, 20, 0));
}

body.theme-dark .sidebar {
  background: rgba(24, 26, 32, 0.74);
  border-right-color: rgba(255, 255, 255, 0.10);
}

body.theme-dark .topbar {
  background: rgba(19, 21, 27, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

body.theme-dark .nav {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
  color: #e9ebf2;
}

body.theme-dark .nav::before {
  color: #b2b5bf;
}

body.theme-dark .nav.active,
body.theme-dark .nav:hover {
  border-color: rgba(115, 166, 255, 0.22);
  background: rgba(78, 127, 204, 0.22);
  color: #f7f9ff;
}

body.theme-dark .nav.active::before,
body.theme-dark .nav:hover::before {
  color: #c7d8ff;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark #command-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

body.theme-dark button,
body.theme-dark button.primary,
body.theme-dark .topbar button,
body.theme-dark .section-head button,
body.theme-dark menu button:last-child {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(42, 45, 54, 0.72);
  color: #f4f6fb;
}

body.theme-dark button:hover,
body.theme-dark button.primary:hover,
body.theme-dark .topbar button:hover,
body.theme-dark .section-head button:hover,
body.theme-dark menu button:last-child:hover {
  background: rgba(58, 62, 74, 0.92);
  color: #fff;
}

body.theme-dark .theme-toggle {
  background: rgba(36, 39, 47, 0.80);
  border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dark .theme-toggle[data-theme="dark"] .theme-moon {
  background: rgba(78, 84, 100, 0.92);
  color: #d8deea;
}

body.theme-dark .theme-sun {
  color: #ffd54a;
}

body.theme-dark .theme-moon {
  color: #5f6b7d;
}

body.theme-dark .metrics div,
body.theme-dark .panel,
body.theme-dark .card,
body.theme-dark .row,
body.theme-dark dialog,
body.theme-dark .auth-box,
body.theme-dark .overview-computer-item,
body.theme-dark .flow-chip,
body.theme-dark .detail-log,
body.theme-dark .task-log-group,
body.theme-dark .recording-item,
body.theme-dark .snapshot-card {
  background: var(--glass);
  border-color: rgba(255, 255, 255, 0.11);
}

body.theme-dark .row-meta,
body.theme-dark .meta-line,
body.theme-dark .detail-row,
body.theme-dark .task-log-table th,
body.theme-dark .task-log-table td {
  border-color: rgba(255, 255, 255, 0.10);
}

body.theme-dark .task-log-table-wrap,
body.theme-dark .recording-empty,
body.theme-dark .snapshot-empty {
  background: rgba(22, 24, 30, 0.72);
  border-color: rgba(255, 255, 255, 0.10);
}

body.theme-dark .task-log-table th {
  background: rgba(32, 35, 42, 0.94);
}

body.theme-dark .overview-computer-item.active,
body.theme-dark .task-row.active {
  border-color: rgba(105, 155, 235, 0.34);
  background: rgba(54, 91, 150, 0.26);
}

body.theme-dark .status.online,
body.theme-dark .status.idle,
body.theme-dark .status.success {
  background: rgba(48, 209, 88, 0.18);
  color: #63d982;
}

body.theme-dark .status.running,
body.theme-dark .status.dispatching,
body.theme-dark .status.queued,
body.theme-dark .status.busy {
  background: rgba(255, 159, 10, 0.20);
  color: #ffbf5b;
}

body.theme-dark .status.offline,
body.theme-dark .status.failed,
body.theme-dark .status.canceled,
body.theme-dark .status.cancelled {
  background: rgba(255, 69, 58, 0.20);
  color: #ff8b84;
}
/* Place day/night toggle in the brand corner. */
.brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
}

.brand .theme-toggle {
  justify-self: end;
}

.theme-toggle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  grid-template-columns: 1fr;
  padding: 3px;
}

.theme-toggle .theme-icon {
  grid-area: 1 / 1;
  width: 28px;
  height: 28px;
  font-size: 17px;
  opacity: 0;
  transform: scale(0.82) rotate(-12deg);
}

.theme-toggle[data-theme="light"] .theme-sun,
.theme-toggle[data-theme="dark"] .theme-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.theme-toggle[data-theme="light"] .theme-sun {
  color: #f7b500;
}

.theme-toggle[data-theme="dark"] .theme-moon {
  color: #344054;
}

body.theme-dark .theme-toggle[data-theme="dark"] .theme-moon {
  color: #d8deea;
}
/* Final day/night toggle fix: keep icon visible and bindable even before JS state settles. */
.brand .theme-toggle {
  justify-self: end;
}

#theme-toggle.theme-toggle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  grid-template-columns: 1fr;
  padding: 3px;
  border-radius: 999px;
}

#theme-toggle .theme-icon {
  grid-area: 1 / 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 18px;
  opacity: 0;
  transform: scale(0.82) rotate(-12deg);
  pointer-events: none;
}

#theme-toggle:not([data-theme]) .theme-sun,
#theme-toggle[data-theme="light"] .theme-sun,
#theme-toggle[data-theme="dark"] .theme-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

#theme-toggle .theme-sun {
  color: #f7b500;
}

#theme-toggle .theme-moon {
  color: #344054;
}

body.theme-dark #theme-toggle[data-theme="dark"] .theme-moon {
  color: #d8deea;
}
/* Final queue detail overlap fix: tabs and task-log table headers must not stack. */
.task-detail .detail-tabs {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  overflow: visible;
  margin: 16px 0 12px !important;
}

.task-detail .detail-tab-panel {
  position: relative;
  display: block;
  padding-top: 2px;
  clear: both;
}

.task-detail .detail-section {
  margin-top: 0 !important;
  gap: 12px;
}

.task-detail .task-log-table th {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

.task-detail .task-log-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}
/* Final queue detail freeze: keep the title/tabs fixed and scroll only the content below. */
.task-detail.panel {
  display: flex !important;
  flex-direction: column !important;
  height: calc(100vh - 128px) !important;
  max-height: calc(100vh - 128px) !important;
  overflow: hidden !important;
}

.task-detail .task-detail-head {
  flex: 0 0 auto !important;
  position: relative !important;
  z-index: 4 !important;
  background: inherit;
  padding-bottom: 10px;
}

.task-detail .detail-tabs {
  flex: 0 0 auto !important;
  position: relative !important;
  top: auto !important;
  z-index: 4 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  overflow: visible !important;
  margin: 0 0 14px !important;
}

.task-detail .detail-tab-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 6px !important;
  overscroll-behavior: contain;
}

.task-detail .detail-section {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.task-detail .task-log-table th {
  position: sticky !important;
  top: 0 !important;
  z-index: 1 !important;
}

.task-detail .task-log-table-wrap {
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Final detail interaction fix: keep media clickable and content state stable. */
.task-detail .detail-tab-panel {
  position: relative !important;
  z-index: 1 !important;
  pointer-events: auto !important;
}

.task-detail .recording-list,
.task-detail .recording-item,
.task-detail .recording-video {
  position: relative !important;
  z-index: 2 !important;
  pointer-events: auto !important;
}

.task-detail .task-detail-head,
.task-detail .detail-tabs {
  pointer-events: auto !important;
}


.secret-field {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(280px, 1.4fr);
  gap: 12px;
  align-items: center;
}
.secret-field > div:first-child > span {
  display: block;
  font-weight: 700;
  color: var(--text);
}
.secret-field p {
  margin: 4px 0 0;
}
.secret-control {
  display: flex;
  gap: 8px;
  align-items: center;
}
.secret-control input {
  flex: 1;
  min-width: 0;
}
.secret-control button {
  width: auto;
  white-space: nowrap;
}
.miniprogram-binding-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.binding-panel-head,
.binding-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.binding-panel-head h3,
.binding-pending h4,
.binding-row p {
  margin: 0;
}
.binding-pending {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
@media (max-width: 760px) {
  .binding-panel-head,
  .binding-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 760px) {
  .secret-field { grid-template-columns: 1fr; }
  .secret-control { flex-wrap: wrap; }
}


/* Mobile app shell 0.2.48 */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.auth-screen,
  body.auth-pending {
    overflow-x: hidden;
  }

  .app {
    display: block;
    min-height: 100vh;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto !important;
    z-index: 60;
    height: auto !important;
    max-height: calc(86px + env(safe-area-inset-bottom));
    overflow: hidden;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid rgba(60, 60, 67, 0.14);
    background: rgba(248, 249, 252, 0.88);
    box-shadow: 0 -14px 34px rgba(20, 24, 32, 0.10);
    backdrop-filter: blur(26px) saturate(1.45);
  }

  .brand {
    display: none !important;
  }

  nav {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(64px, 1fr);
    grid-template-columns: none !important;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 2px 2px;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .nav {
    min-width: 64px !important;
    min-height: 58px;
    padding: 6px 4px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    border-radius: 18px;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
  }

  .nav::before {
    width: auto;
    font-size: 17px;
    line-height: 1;
  }

  main {
    padding: 12px;
    min-width: 0;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: auto;
    margin: -12px -12px 12px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 12px;
    border-bottom: 1px solid rgba(60, 60, 67, 0.12);
  }

  #view-title {
    font-size: 24px;
  }

  #view-subtitle {
    display: none;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    width: 100%;
  }

  .actions #command-input {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .current-user {
    display: none;
  }

  #parse-command,
  #refresh,
  #logout {
    min-height: 38px;
    padding: 7px 12px;
  }

  .section-head,
  .card-head,
  .row-head,
  .task-detail-head,
  .snapshot-head,
  .detail-log-head {
    align-items: flex-start;
    gap: 10px;
  }

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

  .section-head h3 {
    font-size: 20px;
  }

  .metrics,
  .metrics-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .metrics div,
  .metrics-rail div {
    padding: 10px 8px;
  }

  .metrics span,
  .metrics-rail span {
    font-size: 21px;
  }

  .metrics label {
    font-size: 11px;
  }

  .overview-shell,
  .queue-shell {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .overview-sidebar,
  .task-detail,
  .task-detail.panel {
    position: static !important;
    top: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .overview-card {
    min-height: 0;
  }

  .overview-computer-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 82vw);
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 4px;
    scroll-snap-type: x proximity;
  }

  .overview-computer-item {
    scroll-snap-align: start;
  }

  .table-list,
  .log-list {
    gap: 10px;
  }

  .row,
  .panel,
  .card,
  .overview-computer-item,
  .task-detail.panel {
    padding: 12px;
    border-radius: 14px;
  }

  .row h3,
  .card h3,
  .task-detail h3 {
    font-size: 18px;
    line-height: 1.18;
  }

  .row-meta,
  .detail-grid,
  .filter-bar,
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  .row-meta {
    gap: 6px;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .status {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 4px 9px;
  }

  .task-detail .task-detail-head,
  .task-detail .detail-tabs {
    position: static !important;
    padding-bottom: 0;
  }

  .task-detail .detail-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    margin: 12px 0 !important;
    padding: 4px !important;
    scrollbar-width: none;
  }

  .task-detail .detail-tabs::-webkit-scrollbar {
    display: none;
  }

  .detail-tab {
    min-width: max-content;
  }

  .task-detail .detail-tab-panel {
    overflow: visible !important;
    padding-right: 0 !important;
  }

  .detail-row,
  .meta-line,
  .overview-computer-row {
    grid-template-columns: 76px minmax(0, 1fr) !important;
    gap: 8px;
  }

  .recording-video,
  .snapshot-image {
    width: 100%;
    max-height: 52vh;
  }

  .task-log-table-wrap {
    max-width: 100%;
    overflow-x: auto !important;
  }

  .task-log-table {
    min-width: 640px;
  }

  .secret-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .secret-control input {
    grid-column: 1 / -1;
  }

  dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 14px;
    border-radius: 16px;
  }
}

@media (max-width: 420px) {
  .actions {
    grid-template-columns: 1fr 1fr;
  }

  #parse-command {
    grid-column: 1 / -1;
  }

  .metrics,
  .metrics-rail {
    grid-template-columns: 1fr 1fr 1fr !important;
  }

  .nav {
    min-width: 58px !important;
    font-size: 11px;
  }
}


/* Mobile queue detail 0.2.50 */
@media (max-width: 760px) {
  .sidebar {
    max-height: calc(74px + env(safe-area-inset-bottom));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  }

  nav {
    grid-auto-flow: unset !important;
    grid-auto-columns: unset !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 5px;
    overflow: visible;
  }

  .nav {
    min-width: 0 !important;
    min-height: 52px;
    padding: 5px 2px;
    border-radius: 16px;
    font-size: 11px;
    letter-spacing: 0;
  }

  .nav::before {
    font-size: 15px;
  }

  .app {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  #queue .queue-shell {
    display: flex !important;
    flex-direction: column !important;
  }

  #queue #task-detail {
    order: -1;
    margin-bottom: 12px;
    scroll-margin-top: 132px;
  }

  #queue #task-list {
    order: 1;
  }

  #queue .task-row {
    position: relative;
  }

  #queue .task-row::after {
    content: "点开详情";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(10, 132, 255, 0.11);
    color: var(--accent);
    font-size: 12px;
    font-weight: 760;
  }

  #queue .task-row.active::after {
    content: "详情已展开在上方";
    background: rgba(48, 209, 88, 0.14);
    color: #16833a;
  }

  .task-detail.panel {
    border-color: rgba(10, 132, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.08), var(--shadow), var(--inner-light);
  }

  .task-detail .detail-grid {
    gap: 8px;
  }

  .task-detail .detail-row {
    padding: 8px 0;
    border-bottom: 1px solid rgba(60, 60, 67, 0.10);
  }

  .task-detail .detail-row:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 380px) {
  .nav {
    font-size: 10px;
    min-height: 50px;
  }

  .nav::before {
    font-size: 14px;
  }
}


/* Mobile full detail page 0.2.50 */
.mobile-detail-back {
  display: none;
}

@media (max-width: 760px) {
  body.mobile-task-detail-open #queue .section-head,
  body.mobile-task-detail-open #queue #task-list {
    display: none !important;
  }

  body.mobile-task-detail-open #queue .queue-shell {
    display: block !important;
  }

  body.mobile-task-detail-open #queue #task-detail {
    display: block !important;
    order: unset;
    margin: 0;
    padding: 14px;
    min-height: calc(100vh - 94px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  body.mobile-task-detail-open .sidebar {
    display: none !important;
  }

  body.mobile-task-detail-open .app {
    padding-bottom: 0;
  }

  body.mobile-task-detail-open .topbar {
    display: none !important;
  }

  body.mobile-task-detail-open main {
    padding: calc(10px + env(safe-area-inset-top)) 0 0;
  }

  body.mobile-task-detail-open #queue {
    display: block;
  }

  .mobile-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.76);
  }

  .mobile-detail-back::before {
    content: "‹";
    font-size: 22px;
    line-height: 1;
    margin-top: -1px;
  }

  body.mobile-task-detail-open .task-detail .task-detail-head {
    padding: 0 0 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(60, 60, 67, 0.10);
  }

  body.mobile-task-detail-open .task-detail .task-detail-head h3 {
    font-size: 22px;
    line-height: 1.16;
  }

  body.mobile-task-detail-open .task-detail .detail-tabs {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
    margin: 0 0 14px !important;
    background: rgba(242, 242, 247, 0.92) !important;
    backdrop-filter: blur(20px) saturate(1.35);
  }

  body.mobile-task-detail-open .task-detail .detail-section h4 {
    font-size: 19px;
    margin-bottom: 8px;
  }

  body.mobile-task-detail-open .task-detail .detail-row {
    grid-template-columns: 82px minmax(0, 1fr) !important;
    align-items: center;
    min-height: 52px;
  }

  body.mobile-task-detail-open .task-detail .detail-row span {
    color: var(--muted);
  }

  body.mobile-task-detail-open .task-detail .detail-row strong {
    font-size: 15px;
    line-height: 1.35;
    word-break: break-word;
  }
}


@media (max-width: 760px) {
  body:not(.mobile-task-detail-open) #queue #task-detail {
    display: none !important;
  }
}


/* Mobile detail click fix 0.2.51 */
@media (max-width: 760px) {
  #queue .task-row::after,
  #queue .task-row.active::after {
    content: "查看详情" !important;
    background: rgba(10, 132, 255, 0.11) !important;
    color: var(--accent) !important;
  }

  body.mobile-task-detail-open #queue .task-row::after,
  body.mobile-task-detail-open #queue .task-row.active::after {
    content: "" !important;
    display: none !important;
  }
}

/* UI polish 0.2.54: Liquid control deck for desktop and mobile. */
:root {
  --bg: #f4f6f8;
  --panel: rgba(255, 255, 255, 0.82);
  --glass: rgba(255, 255, 255, 0.72);
  --text: #171a20;
  --muted: #707782;
  --line: rgba(39, 44, 52, 0.11);
  --accent: #2f6f63;
  --accent-dark: #1f5149;
  --accent-soft: rgba(47, 111, 99, 0.13);
  --control: rgba(255, 255, 255, 0.74);
  --control-hover: rgba(255, 255, 255, 0.94);
  --control-border: rgba(39, 44, 52, 0.12);
  --shadow: 0 18px 46px rgba(22, 27, 34, 0.08);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-pill: 999px;
}

html {
  background: var(--bg);
}

body {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(238,242,246,0.86) 42%, rgba(232,238,242,0.72));
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.app {
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  padding: 22px 16px;
  background: rgba(248, 250, 251, 0.66);
  border-right: 1px solid rgba(39, 44, 52, 0.10);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.66), 14px 0 36px rgba(22,27,34,0.035);
  backdrop-filter: blur(32px) saturate(1.45);
}

.brand {
  min-height: 64px;
  padding: 8px 8px 10px;
  margin-bottom: 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.42);
  box-shadow: var(--inner-light);
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: linear-gradient(145deg, #1d211f, #4b5e58);
  color: #f8fbf9;
  box-shadow: 0 14px 28px rgba(31, 81, 73, 0.18), var(--inner-light);
}

.brand h1 {
  font-size: 18px;
  line-height: 1.08;
  font-weight: 860;
}

.brand p,
.sidebar .brand p,
#view-subtitle,
.muted {
  color: var(--muted);
}

.sidebar nav {
  display: grid;
  gap: 10px;
}

.nav {
  position: relative;
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid rgba(255,255,255,0.58);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.42);
  color: #252a31;
  font-size: 16px;
  font-weight: 780;
  box-shadow: var(--inner-light), 0 8px 22px rgba(22,27,34,0.035);
}

.nav::before {
  content: "" !important;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: var(--radius-pill);
  background: currentColor;
  opacity: 0.42;
}

.nav.active,
.nav:hover {
  border-color: rgba(47,111,99,0.22);
  background: rgba(255,255,255,0.86);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(47,111,99,0.08), var(--inner-light), 0 14px 34px rgba(47,111,99,0.10);
}

main {
  padding: 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  min-height: 92px;
  margin: -28px -28px 24px;
  padding: 20px 28px 16px;
  background: rgba(247, 249, 250, 0.72);
  border-bottom: 1px solid rgba(39,44,52,0.10);
  box-shadow: 0 16px 36px rgba(22,27,34,0.045);
  backdrop-filter: blur(30px) saturate(1.42);
}

#view-title {
  font-size: 30px;
  line-height: 1.04;
  font-weight: 880;
}

.actions {
  grid-template-columns: minmax(260px, 440px) auto auto auto auto;
  gap: 9px;
}

#command-input,
input,
select,
textarea {
  min-height: 42px;
  border-radius: 15px;
  border-color: rgba(39,44,52,0.10);
  background: rgba(255,255,255,0.68);
  box-shadow: inset 0 1px 2px rgba(22,27,34,0.035), var(--inner-light);
}

button,
.topbar button,
.section-head button,
menu button:last-child {
  min-height: 40px;
  border-radius: var(--radius-pill);
  border-color: var(--control-border);
  background: var(--control);
  color: #1d2228;
  font-weight: 780;
  box-shadow: var(--inner-light), 0 8px 18px rgba(22,27,34,0.055);
}

button:hover,
.topbar button:hover,
.section-head button:hover,
menu button:last-child:hover {
  border-color: rgba(47,111,99,0.26);
  background: var(--control-hover);
  color: var(--accent-dark);
}

button.primary {
  background: #1f5149;
  border-color: #1f5149;
  color: #fff;
}

#logout,
button[data-delete-computer],
button[data-delete-flow],
button[data-delete-user] {
  color: #c83a33;
}

.metrics div,
.panel,
.card,
.row,
dialog,
.auth-box,
.overview-computer-item,
.flow-chip,
.detail-log,
.task-log-group,
.recording-item,
.snapshot-card {
  border: 1px solid rgba(39,44,52,0.10);
  border-radius: var(--radius-lg);
  background: var(--glass);
  box-shadow: var(--shadow), var(--inner-light);
  backdrop-filter: blur(24px) saturate(1.28);
}

.card,
.panel,
.row,
.task-detail.panel {
  padding: 18px;
}

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

.section-head h3,
.row h3,
.card h3,
.task-detail h3 {
  color: var(--text);
  font-weight: 850;
}

.row-head,
.card-head,
.task-detail-head {
  gap: 14px;
}

.row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.row-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(39,44,52,0.09);
}

.row-meta span,
.overview-computer-meta,
.current-user {
  color: var(--muted);
}

.status {
  min-height: 28px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  gap: 7px;
  box-shadow: var(--inner-light);
}

.status::before {
  width: 7px;
  height: 7px;
}

.status.online,
.status.idle,
.status.success {
  background: rgba(44, 170, 91, 0.14);
  color: #177442;
}

.status.running,
.status.dispatching,
.status.queued,
.status.busy {
  background: rgba(196, 130, 32, 0.15);
  color: #8a520e;
}

.status.offline,
.status.failed,
.status.canceled,
.status.cancelled {
  background: rgba(208, 60, 52, 0.14);
  color: #b12b25;
}

.overview-shell {
  grid-template-columns: minmax(320px, 372px) minmax(0, 1fr);
  gap: 20px;
}

.overview-sidebar {
  top: 116px;
}

.metrics-rail {
  gap: 10px;
}

.metrics-rail div {
  padding: 14px 12px;
  border-radius: 18px;
}

.metrics-rail span {
  font-size: 26px;
}

.overview-computer-list {
  gap: 12px;
  max-height: calc(100vh - 274px);
  padding-right: 4px;
}

.overview-computer-item {
  padding: 16px;
  border-radius: 22px;
}

.overview-computer-item.active,
.task-row.active {
  border-color: rgba(47,111,99,0.30);
  background: rgba(47,111,99,0.10);
  box-shadow: inset 0 0 0 1px rgba(47,111,99,0.12), var(--inner-light), 0 16px 34px rgba(47,111,99,0.09);
}

.overview-computer-row,
.meta-line,
.detail-row {
  min-height: 38px;
}

.meta-stack {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 18px;
}

.snapshot-card {
  overflow: hidden;
}

.snapshot-image,
.snapshot-empty,
.recording-video,
.recording-empty {
  border-radius: 18px;
}

.queue-shell {
  grid-template-columns: minmax(340px, 0.92fr) minmax(460px, 1.18fr);
  gap: 18px;
}

.task-detail.panel {
  top: 116px;
  border-radius: 24px;
}

.task-detail .detail-tabs {
  gap: 6px !important;
  padding: 5px !important;
  border-radius: 18px;
  background: rgba(230, 234, 237, 0.72);
}

.detail-tab {
  min-height: 36px;
  border-radius: 14px;
}

.detail-tab.active {
  background: rgba(255,255,255,0.96);
  color: #171a20;
  box-shadow: 0 3px 10px rgba(22,27,34,0.12), var(--inner-light);
}

.task-detail .detail-tab-panel {
  scrollbar-gutter: stable;
}

.task-log-table-wrap {
  border-radius: 18px;
}

.task-log-table th {
  background: rgba(248,250,251,0.96);
}

body.theme-dark {
  --bg: #0f1216;
  --panel: rgba(26, 30, 36, 0.86);
  --glass: rgba(26, 30, 36, 0.76);
  --text: #eef2f4;
  --muted: #9aa3ad;
  --line: rgba(235, 241, 245, 0.12);
  --accent: #7bc4b7;
  --accent-dark: #9ad8cf;
  --accent-soft: rgba(123,196,183,0.14);
  --control: rgba(43, 49, 58, 0.78);
  --control-hover: rgba(54, 62, 72, 0.92);
  --control-border: rgba(235,241,245,0.12);
  --shadow: 0 18px 48px rgba(0,0,0,0.30);
  background: linear-gradient(135deg, #0f1216, #151a20 48%, #101417);
}

body.theme-dark .sidebar,
body.theme-dark .topbar {
  background: rgba(18, 22, 27, 0.78);
  border-color: rgba(235,241,245,0.10);
}

body.theme-dark .brand,
body.theme-dark .nav,
body.theme-dark #command-input,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: rgba(33, 39, 46, 0.72);
  border-color: rgba(235,241,245,0.10);
}

body.theme-dark .nav {
  color: #dbe3e8;
}

body.theme-dark .nav.active,
body.theme-dark .nav:hover {
  background: rgba(123,196,183,0.14);
  color: #dff8f3;
}

body.theme-dark .detail-tabs,
body.theme-dark .task-detail .detail-tabs {
  background: rgba(12, 15, 18, 0.66) !important;
}

body.theme-dark .detail-tab.active,
body.theme-dark .task-log-table th {
  background: rgba(47, 55, 65, 0.94);
  color: #eef2f4;
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .actions {
    grid-template-columns: minmax(220px, 1fr) auto auto auto auto;
  }

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

  .overview-sidebar,
  .task-detail.panel {
    position: static !important;
    height: auto !important;
    max-height: none !important;
  }
}

@media (max-width: 760px) {
  body {
    background: linear-gradient(180deg, #f6f8f9 0%, #edf1f3 100%);
  }

  .app {
    display: block;
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  main {
    padding: 12px;
  }

  .sidebar {
    position: fixed !important;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    top: auto !important;
    z-index: 70;
    height: 66px !important;
    max-height: 66px !important;
    overflow: hidden;
    padding: 7px;
    border: 1px solid rgba(39,44,52,0.10);
    border-radius: 26px;
    background: rgba(248,250,251,0.86);
    box-shadow: 0 18px 44px rgba(22,27,34,0.18), var(--inner-light);
    backdrop-filter: blur(28px) saturate(1.55);
  }

  .brand {
    display: none !important;
  }

  .sidebar nav {
    display: flex !important;
    gap: 5px;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .nav {
    flex: 1 0 52px;
    min-width: 52px !important;
    min-height: 52px;
    padding: 5px 4px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-radius: 20px;
    font-size: 11px;
    line-height: 1.05;
    text-align: center;
    white-space: nowrap;
    box-shadow: none;
  }

  .nav::before {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
  }

  .nav.active,
  .nav:hover {
    background: rgba(47,111,99,0.14);
    box-shadow: var(--inner-light);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: auto;
    margin: -12px -12px 12px;
    padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
    border-radius: 0 0 24px 24px;
  }

  #view-title {
    font-size: 26px;
  }

  #view-subtitle {
    display: none;
  }

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

  .actions #command-input {
    grid-column: 1 / -1;
    min-height: 42px;
  }

  .current-user {
    display: none;
  }

  #parse-command,
  #refresh,
  #logout {
    min-height: 38px;
    padding: 7px 12px;
  }

  .section-head {
    align-items: center;
    margin: 4px 0 12px;
  }

  .section-head h3 {
    font-size: 21px;
  }

  .metrics,
  .metrics-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .metrics div,
  .metrics-rail div {
    min-height: 72px;
    padding: 12px 8px;
    border-radius: 20px;
  }

  .metrics span,
  .metrics-rail span {
    font-size: 24px;
  }

  .metrics label {
    font-size: 11px;
  }

  .overview-shell,
  .queue-shell {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .overview-sidebar,
  .task-detail,
  .task-detail.panel {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .overview-computer-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(252px, 84vw);
    gap: 10px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px 2px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .overview-computer-list::-webkit-scrollbar {
    display: none;
  }

  .overview-computer-item {
    scroll-snap-align: start;
  }

  .row,
  .panel,
  .card,
  .overview-computer-item,
  .task-detail.panel {
    padding: 14px;
    border-radius: 22px;
  }

  .row-head,
  .card-head,
  .task-detail-head,
  .snapshot-head,
  .detail-log-head {
    align-items: flex-start;
    gap: 10px;
  }

  .row-head > div,
  .task-detail-head > div,
  .card-head > div {
    min-width: 0;
  }

  .row-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .row h3,
  .card h3,
  .task-detail h3 {
    font-size: 18px;
    line-height: 1.18;
  }

  .row-meta {
    grid-template-columns: 1fr !important;
    gap: 7px;
    font-size: 12.5px;
  }

  .detail-grid,
  .filter-bar,
  .form-grid,
  .meta-stack {
    grid-template-columns: 1fr !important;
  }

  .detail-row,
  .meta-line,
  .overview-computer-row {
    grid-template-columns: 86px minmax(0, 1fr) !important;
    gap: 9px;
    min-height: 42px;
  }

  .detail-row strong,
  .meta-value,
  .overview-computer-row strong {
    min-width: 0;
    word-break: break-word;
  }

  #queue .task-row::after,
  #queue .task-row.active::after {
    content: "查看详情" !important;
    margin-top: 12px;
    min-height: 32px;
    border-radius: var(--radius-pill);
    background: rgba(47,111,99,0.12) !important;
    color: var(--accent-dark) !important;
  }

  body:not(.mobile-task-detail-open) #queue #task-detail {
    display: none !important;
  }

  body.mobile-task-detail-open main {
    padding: calc(10px + env(safe-area-inset-top)) 0 0;
  }

  body.mobile-task-detail-open #queue #task-detail {
    min-height: calc(100vh - env(safe-area-inset-top));
    padding: 14px;
    border-radius: 24px 24px 0 0;
  }

  .mobile-detail-back {
    min-height: 40px;
    margin: 0 0 14px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.82);
    color: var(--accent-dark);
  }

  .mobile-detail-back::before {
    content: "‹" !important;
    font-size: 25px;
    line-height: 1;
  }

  body.mobile-task-detail-open .task-detail .task-detail-head {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  body.mobile-task-detail-open .task-detail .detail-tabs {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 5px !important;
    border-radius: 18px;
    background: rgba(241,244,245,0.92) !important;
    backdrop-filter: blur(20px) saturate(1.35);
    scrollbar-width: none;
  }

  body.mobile-task-detail-open .task-detail .detail-tabs::-webkit-scrollbar {
    display: none;
  }

  .detail-tab {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .task-detail .detail-tab-panel {
    overflow: visible !important;
    padding-right: 0 !important;
  }

  .recording-video,
  .snapshot-image {
    width: 100%;
    max-height: 54vh;
  }

  .task-log-table-wrap {
    max-width: 100%;
    overflow-x: auto !important;
  }

  .task-log-table {
    min-width: 680px;
  }

  dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 34px);
    overflow-y: auto;
    padding: 16px;
    border-radius: 24px;
  }

  body.theme-dark {
    background: linear-gradient(180deg, #0f1216 0%, #141920 100%);
  }

  body.theme-dark .sidebar {
    background: rgba(18,22,27,0.88);
  }

  body.theme-dark .mobile-detail-back,
  body.theme-dark .task-detail .detail-tabs,
  body.theme-dark.mobile-task-detail-open .task-detail .detail-tabs {
    background: rgba(26,30,36,0.92) !important;
  }
}

@media (max-width: 420px) {
  .actions {
    grid-template-columns: 1fr 1fr;
  }

  #parse-command {
    grid-column: 1 / -1;
  }

  .nav {
    flex-basis: 48px;
    min-width: 48px !important;
    font-size: 10px;
  }

  .metrics,
  .metrics-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .detail-row,
  .meta-line,
  .overview-computer-row {
    grid-template-columns: 76px minmax(0, 1fr) !important;
  }
}



.status.updating {
  color: #8a5a00;
  background: #fff1d6;
}
.status.awaiting_choice {
  background: #fff3cd;
  color: #8a5a00;
}
body.theme-dark .status.awaiting_choice {
  background: rgba(255, 193, 7, 0.18);
  color: #ffd166;
}
.status.updating::before {
  background: #c47a00;
}
.status.update_failed {
  color: #a32b2b;
  background: #ffe1e1;
}
.status.update_failed::before {
  background: #d93030;
}
body.theme-dark .status.updating {
  color: #ffd08a;
  background: rgba(255, 166, 0, 0.18);
}
body.theme-dark .status.update_failed {
  color: #ffb3b3;
  background: rgba(255, 79, 79, 0.18);
}


/* ShadowBot application catalog */
.section-title-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.flow-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.flow-filter select { width: auto; min-width: 180px; border-radius: 999px; padding-inline: 14px 34px; }
.flow-catalog-list { align-content: start; }
.flow-catalog-row { overflow: hidden; }
.flow-identity { min-width: 0; display: grid; gap: 8px; }
.flow-identity h3 { overflow-wrap: anywhere; }
.flow-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.uuid-chip, .source-chip, .catalog-status { display: inline-flex; align-items: center; min-height: 25px; max-width: 100%; padding: 4px 10px; border: 1px solid rgba(0, 122, 255, 0.14); border-radius: 999px; background: rgba(0, 122, 255, 0.10); color: #0a66c2; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.copyable { cursor: copy; transition: opacity 120ms ease, background-color 120ms ease; }
.copyable:active { opacity: 0.58; }
.source-chip { border-color: rgba(88, 86, 214, 0.14); background: rgba(88, 86, 214, 0.09); color: #4b48b8; }
.catalog-status { border-color: transparent; font-weight: 700; }
.catalog-status.configured { background: rgba(52, 199, 89, 0.13); color: #1f7a38; }
.catalog-status.unconfigured, .catalog-status.pending { background: rgba(0, 122, 255, 0.10); color: #0a66c2; }
.theme-dark .uuid-chip, .theme-dark .catalog-status.unconfigured, .theme-dark .catalog-status.pending { background: rgba(64, 156, 255, 0.18); color: #79b8ff; }
.theme-dark .source-chip { background: rgba(94, 92, 230, 0.20); color: #aaa8ff; }
.theme-dark .catalog-status.configured { background: rgba(48, 209, 88, 0.18); color: #6ee78d; }

.flow-sync-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.flow-sync-button { width: 40px; min-width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; font-size: 19px; line-height: 1; }
.flow-sync-status { max-width: min(460px, 42vw); min-height: 28px; overflow-wrap: anywhere; }
.flow-launcher-path { overflow-wrap: anywhere; word-break: break-word; }
.flow-section-head #sync-flow-catalog { color: var(--accent); background: var(--panel); border-color: var(--line); }
.flow-section-head #sync-flow-catalog:hover:not(:disabled) { border-color: var(--accent); background: var(--panel); }
.flow-section-head #sync-flow-catalog:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.flow-section-head #sync-flow-catalog:disabled { cursor: not-allowed; opacity: 0.52; }
body.theme-dark .flow-section-head #sync-flow-catalog { background: rgba(42, 45, 54, 0.72); color: #79b8ff; border-color: rgba(255, 255, 255, 0.12); }

@media (max-width: 700px) {
  .flow-section-head, .section-title-row { align-items: stretch; }
  .flow-section-head { gap: 10px; }
  .section-title-row { flex: 1 1 auto; flex-direction: column; gap: 8px; }
  .flow-filter { width: 100%; }
  .flow-filter select { width: 100%; min-width: 0; }
  .flow-sync-control { width: 100%; flex-wrap: wrap; }
  .flow-sync-control .flow-filter { flex: 1 1 min(220px, 100%); }
  .flow-sync-status { width: 100%; max-width: none; }
  .flow-catalog-row .row-head { align-items: flex-start; }
  .flow-catalog-row .row-actions { width: 100%; }
  .flow-catalog-row .row-actions button { flex: 1 1 auto; }
  .uuid-chip { max-width: 100%; }
}


/* Unified execution identity */
.overview-compact-title,
.overview-detail-title,
.overview-compact-uuid,
.uuid-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.overview-compact-title {
  flex: 1 1 auto;
}

.overview-compact-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-compact-uuid {
  margin-top: 8px;
}

.overview-compact-uuid .uuid-chip {
  max-width: 100%;
}

.overview-computer-meta {
  margin-top: 6px;
}

.overview-detail-heading {
  min-width: 0;
}

.overview-detail-title h3 {
  margin: 0;
}

.task-row .flow-identity {
  flex: 1 1 280px;
}

.task-row .uuid-chip,
.task-detail .uuid-chip {
  word-break: break-all;
}

.task-detail .execution-uuid-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) !important;
  align-items: start;
}

.task-detail .execution-uuid-row > strong {
  min-width: 0;
  justify-self: start;
  text-align: left;
}

.task-detail .execution-uuid-row > strong.uuid-list {
  justify-content: flex-start;
}

.task-detail .execution-uuid-row .uuid-chip {
  color: #0a66c2;
}

.theme-dark .task-detail .execution-uuid-row .uuid-chip {
  color: #79b8ff;
}

@media (max-width: 700px) {
  .task-row .row-head,
  .task-detail-head {
    align-items: flex-start;
  }

  .task-row .row-actions {
    width: 100%;
  }

  .task-row .row-actions button {
    flex: 1 1 auto;
  }

  .overview-detail-title {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .task-detail .execution-uuid-row {
    grid-template-columns: 1fr !important;
    gap: 4px;
  }
}

/* Public filing footer: visible on both login and authenticated views. */
.site-legal {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.site-legal a {
  color: inherit;
  text-decoration: none;
}

.site-legal a:hover {
  color: var(--text);
  text-decoration: underline;
}

.police-filing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.police-filing img {
  flex: 0 0 auto;
  width: 16px;
  height: 17px;
}

body.auth-screen .auth-panel,
body.auth-pending .auth-panel,
.app {
  min-height: calc(100vh - 42px);
}

@media (max-width: 760px) {
  .site-legal {
    min-height: calc(42px + 86px + env(safe-area-inset-bottom));
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body.mobile-task-detail-open .site-legal {
    display: none;
  }
}

/* Queue history filters stay in normal flow on desktop and mobile. */
.queue-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.queue-filters label { display: flex; flex-direction: column; gap: 6px; min-width: 140px; flex: 1; font-size: 13px; color: var(--muted, #667085); }
.queue-filters .queue-keyword { flex: 2; min-width: 180px; }
.queue-filters input, .queue-filters select { width: 100%; min-width: 0; height: 40px; box-sizing: border-box; border-radius: 8px; }
.queue-filters button { height: 40px; }
.queue-date-field { position: relative; display: block; }
.queue-date-field input[data-date-text] { padding-right: 40px; }
.queue-filters .queue-date-picker { position: absolute; top: 0; right: 0; width: 38px; padding: 0 8px; border: 0; background: transparent; box-shadow: none; color: transparent; cursor: pointer; }
.queue-date-picker::-webkit-datetime-edit { display: none; }
.queue-date-picker::-webkit-calendar-picker-indicator { margin: 0; padding: 0; width: 20px; height: 20px; cursor: pointer; }
.queue-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: 0 0 12px; }
.queue-pagination button { width: 40px; height: 36px; padding: 0; }
#queue-error:empty { display: none; }
#queue-error { margin-bottom: 12px; color: #b42318; }
@media (max-width: 600px) {
  #queue #task-list { width: 100%; min-width: 0; }
  .queue-filters label { flex: 1 1 calc(50% - 12px); min-width: 0; }
  .queue-filters .queue-keyword { flex-basis: 100%; }
  .queue-filters button { flex: 1; }
}
