/* TOKENS */
:root {
  --bg: #0b0b0d;
  --surface: #121214;
  --surface-2: #16161a;
  --surface-3: #1b1b22;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --text-tertiary: #6b7280;
  --border: #24242a;
  --ring: rgba(255, 255, 255, 0.08);
  --accent: #ffffff;
  --accent-ink: #0b0b0d;
  --danger: #ff5d5f;
  --success: #22c55e;
  --warning: #fbbf24;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-elev-1: 0 1px 0 rgba(0, 0, 0, 0.3);
  --shadow-elev-2: 0 6px 16px rgba(0, 0, 0, 0.25);
  --shadow-elev-press: 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-focus: 0 0 0 3px rgba(122, 162, 255, 0.35);
  --shadow-focus-soft: 0 0 0 4px rgba(255, 255, 255, 0.12);
  --shadow-field-focus: 0 0 0 3px rgba(255, 255, 255, 0.1);
  --shadow-error: 0 0 0 3px rgba(255, 93, 95, 0.15);
  --control-height: 36px;
  --control-height-mobile: 44px;
  --transition-fast: 0.12s ease;
  --transition-base: 0.2s ease;
  --space-1: 4px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 10px;
  --space-5: 12px;
  --space-6: 16px;
  --space-7: 20px;
  --space-8: 24px;
  --topbar-height: 64px;

  /* BUTTON PALETTE */
  --btn-bg: #1f2937;
  --btn-border: rgba(255, 255, 255, 0.1);
  --btn-text: #eef2ff;
  --btn-hover-bg: #2b3552;
  --btn-secondary-bg: #27304a;
  --btn-secondary-border: rgba(255, 255, 255, 0.1);
  --btn-secondary-text: #e2e8f0;
  --btn-secondary-hover: #344165;
  --btn-danger-bg: #ff5d5f;
  --btn-danger-border: rgba(255, 93, 95, 0.35);
  --btn-danger-hover: #ff7477;
  --btn-disabled-bg: #37415a;
  --btn-disabled-text: #a2b0cc;
}

/* BUTTON MAP
   btn-primary: main confirm/run/create actions
   btn-secondary: supporting, navigation, helper actions
   btn-danger: destructive or stop/cancel actions
*/

/* THEME */
html[data-theme="light"] {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f6;
  --surface-3: #e7e9f0;
  --text-primary: #101118;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --border: #d7d9e0;
  --ring: rgba(0, 0, 0, 0.08);
  --accent: #101118;
  --accent-ink: #ffffff;
  --danger: #e04f4f;
  --success: #1f9d55;
  --shadow-card: 0 10px 40px rgba(15, 23, 42, 0.12);
  --shadow-elev-1: 0 1px 0 rgba(16, 17, 24, 0.2);
  --shadow-elev-2: 0 6px 16px rgba(16, 17, 24, 0.18);
  --shadow-elev-press: 0 2px 6px rgba(16, 17, 24, 0.16);
  --shadow-focus: 0 0 0 3px rgba(122, 162, 255, 0.35);
  --shadow-focus-soft: 0 0 0 4px rgba(16, 17, 24, 0.12);
  --shadow-field-focus: 0 0 0 3px rgba(16, 17, 24, 0.12);
  --shadow-error: 0 0 0 3px rgba(255, 93, 95, 0.15);
}

/* BASE */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(1200px 800px at 110% -30%, rgba(120, 161, 255, 0.08), transparent 60%),
    var(--bg);
  color: var(--text-primary);
}

html[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(16, 17, 24, 0.06), transparent 60%),
    radial-gradient(1200px 800px at 110% -30%, rgba(122, 162, 255, 0.12), transparent 60%),
    var(--bg);
}

/* LAYOUT */
.app {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr;
  height: 100vh;
}

/* TOPBAR */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 64px;
  gap: var(--space-4);
}

.topbar .row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.search {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  width: 260px;
  min-width: 200px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), width var(--transition-base);
}

.search:focus {
  width: 320px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .brand-dot {
  background: linear-gradient(135deg, #101118, #7aa2ff);
  box-shadow: 0 0 0 6px rgba(16, 17, 24, 0.08);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #7aa2ff);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.06);
}

.search {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  width: 280px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.search:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus-soft);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

/* MAIN */
.main {
  padding: var(--space-6);
  overflow: auto;
}

/* HEADER */
.section-header {
  margin-bottom: var(--space-5);
}

.section-heading,
.field-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.section-header h1 {
  font-size: 20px;
  margin: 0;
}

.section-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* CARD */
.card {
  background: linear-gradient(180deg, rgba(18, 18, 20, 0.9), rgba(15, 15, 17, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
}

html[data-theme="light"] .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 242, 246, 0.92));
}

/* GRID */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid-workbench {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-5);
}

.workbench-header {
  gap: var(--space-4);
  justify-content: space-between;
  align-items: flex-end;
}

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

.workbench-top-row {
  gap: var(--space-4);
}

.workbench-group-summary {
  min-width: 220px;
}

.workbench-top-actions {
  justify-content: flex-end;
  align-items: center;
}

.workbench-group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.workbench-meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.workbench-meta .meta-pill {
  padding: 0.4rem 0.75rem;
}

/* BUTTON */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--space-3) 14px;
  border-radius: 10px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-text);
  cursor: pointer;
  min-height: 36px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow-elev-1);
  transition: transform var(--transition-fast), background var(--transition-base), border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.btn:hover {
  background: var(--btn-hover-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-elev-2);
}

.btn-primary {
  background: linear-gradient(135deg, #4f7cff, #6f95ff);
  color: #ffffff;
  border-color: transparent;
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: var(--btn-secondary-border);
}

html[data-theme="light"] .btn-secondary {
  background: #eef3ff;
  color: #1f2937;
  border-color: #d8dce8;
}

html[data-theme="light"] .btn-secondary:hover {
  background: #e4ebff;
}

.btn-danger {
  background: var(--btn-danger-bg);
  color: #ffffff;
  border-color: var(--btn-danger-border);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5d8dff, #86b0ff);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
}

.btn-danger:hover {
  background: var(--btn-danger-hover);
}

.btn-icon-inline+.btn-label,
.btn-label+.btn-icon-inline {
  margin-left: 8px;
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-elev-press);
}

.btn:disabled,
.btn[disabled] {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
  border-color: rgba(148, 163, 184, 0.18);
  opacity: 0.75;
  cursor: not-allowed;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed !important;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.btn:disabled:hover,
.btn[disabled]:hover {
  background: var(--surface-2);
}

.btn.is-disabled {
  opacity: 0.3;
  filter: grayscale(0.6);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn-icon {
  padding: var(--space-3);
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 0;
}

.btn-icon svg,
.btn-icon-inline svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn .btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: currentColor;
  display: none;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
}

.btn.is-loading .btn-label {
  opacity: 0.7;
}

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

/* LOGS */
.logs-shell {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #030304;
  overflow: hidden;
}

.logs-shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(10, 10, 12, 0.98), rgba(4, 4, 5, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.logs-shell-top .shell-title {
  color: #cbd5e1;
}

.logs-shell-top .shell-status {
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.shell-controls {
  display: flex;
  gap: 6px;
}

.shell-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: #f87171;
}

.dot-yellow {
  background: #fbbf24;
}

.dot-green {
  background: #34d399;
}

.shell-title {
  color: #cbd5e1;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shell-status {
  color: #7dd3fc;
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
}

.logs {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  background: #020203;
  color: #e7edf7;
  border: none;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
  border-radius: 0 0 14px 14px;
  padding: 14px 16px;
  min-height: 220px;
  max-height: 340px;
  overflow: auto;
}

.logs .log-line {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 4px 0;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d7e1ea;
}

.logs .log-line:nth-child(odd) {
  background: rgba(255, 255, 255, 0.015);
}

.logs .log-time {
  min-width: 62px;
  color: #5b7083;
  flex-shrink: 0;
  font-size: 11px;
}

.logs .log-prefix {
  min-width: 16px;
  color: #7e94b0;
  flex-shrink: 0;
}

.logs .log-level {
  min-width: 50px;
  color: #8fa9cc;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.logs .log-message {
  flex: 1;
}

.logs .log-header {
  color: #dce7ff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 7px 10px;
}

.logs .log-error {
  color: var(--danger);
  font-weight: 700;
}

.logs .log-warn {
  color: #f5c16c;
}

.logs .log-info {
  color: #c7d2fe;
}

.logs .log-meta {
  color: #7dd3fc;
}

.logs .log-highlight {
  color: #7dd3fc;
  font-weight: 600;
}

.log-toolbar {
  display: grid;
  gap: var(--space-3);
}

.log-toolbar-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
}

.log-toolbar-header .section-heading {
  margin-bottom: 0;
}

.log-toolbar-header .field-hint {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.log-toolbar-row {
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: flex-end;
}

.log-filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.log-filter-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.35rem;
}

.log-filter-field label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.log-filter-field select,
.log-filter-field input {
  width: 100%;
}

.log-filter-field label {
  margin-bottom: 0;
}

.log-search-field {
  min-width: 220px;
}

.log-toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-end;
  justify-content: flex-end;
  align-self: flex-end;
  padding: var(--space-3);
}

.log-toolbar-buttons .btn {
  white-space: nowrap;
  align-self: flex-end;
}

.log-toolbar-buttons .btn:first-child {
  min-width: 110px;
}

/* UTIL */
.row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

#importModal .row {
  flex-wrap: nowrap;
}

#importModal .row input[type="file"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

#importModal .row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.log-toolbar .log-toolbar-row,
.log-toolbar .log-toolbar-buttons {
  align-items: flex-end;
}

.align-center {
  align-items: center;
}

.align-end {
  align-items: flex-end;
}

.justify-between {
  justify-content: space-between;
}

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

.report-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-4);
}

.report-control-group {
  display: grid;
  gap: var(--space-2);
  min-width: 280px;
  width: 100%;
  max-width: 480px;
}

.report-control-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.report-control-row select.min-w-240 {
  flex: 1;
  min-width: 180px;
}

.report-control-row .btn {
  white-space: nowrap;
}

.report-controls label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 600;
}

.report-controls .row select.min-w-240 {
  min-width: 160px;
  max-width: 240px;
  flex: 1;
}

.gap-4 {
  gap: var(--space-4);
}

.mt-2 {
  margin-top: var(--space-2);
}

.mt-3 {
  margin-top: var(--space-3);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-5 {
  margin-top: var(--space-5);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.min-w-240 {
  min-width: 240px;
}

.report-frame-wrapper {
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.report-frame {
  width: 100%;
  min-height: 520px;
  height: auto;
  border: none;
  background: var(--surface);
  border-radius: 12px;
  display: block;
}

html[data-theme="light"] .report-frame-wrapper {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(209, 213, 219, 0.9);
}

html[data-theme="light"] .report-frame {
  background: #ffffff;
}

html[data-theme="light"] .empty-state {
  background: rgba(255, 255, 255, 0.92);
}

.hidden {
  display: none !important;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
}

.pill.status-online {
  border-color: rgba(34, 197, 94, 0.6);
  color: var(--text-primary);
  background: rgba(34, 197, 94, 0.12);
}

.pill.status-offline {
  border-color: rgba(255, 93, 95, 0.6);
  color: var(--danger);
  background: rgba(255, 93, 95, 0.12);
}

.pill.status-fail {
  color: var(--danger);
  border-color: rgba(224, 79, 79, 0.35);
  background: rgba(224, 79, 79, 0.12);
  font-weight: 600;
}

.pill.status-warning {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  font-weight: 600;
}

.pill.status-idle {
  color: var(--text-secondary);
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
}

.pill.status-running {
  color: var(--text-primary);
  border-color: rgba(122, 162, 255, 0.6);
  background: rgba(122, 162, 255, 0.12);
}

.pill.status-success {
  color: var(--text-primary);
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.12);
}

.queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.queue-table th,
.queue-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.queue-table th {
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.queue-table td code {
  font-size: 12px;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analytics-table th,
.analytics-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.analytics-table th {
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.analytics-table tr.compare-changed td {
  background: rgba(245, 158, 11, 0.1);
}

.streak {
  letter-spacing: 2px;
  white-space: nowrap;
}

.streak-dot {
  font-size: 12px;
}

.streak-pass {
  color: #22c55e;
}

.streak-fail {
  color: var(--danger);
}

.subtle {
  color: var(--text-tertiary);
  font-size: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--ring);
  background: var(--surface-3);
}

.status-chip strong {
  color: var(--text-primary);
}

.status-banner {
  position: sticky;
  top: calc(var(--topbar-height, 64px) + var(--space-4));
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-5);
  margin: 0 var(--space-6) var(--space-4);
  height: 68px;
  min-height: 68px;
  overflow: hidden;
  background: rgba(18, 25, 40, 0.84);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  box-shadow: var(--shadow-elev-1);
}

.status-banner.hidden {
  display: none;
}

.status-banner[data-status="running"] {
  background: rgba(40, 56, 96, 0.95);
}

.status-banner[data-status="canceled"] {
  background: rgba(78, 54, 26, 0.95);
}

.status-banner[data-status="success"] {
  background: rgba(22, 70, 34, 0.95);
}

.status-banner[data-status="fail"] {
  background: rgba(80, 23, 23, 0.95);
}

@media (max-width: 900px) {
  .status-banner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .status-banner-right {
    justify-content: flex-start;
  }
}

.status-banner-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.status-banner-right {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-pill {
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill.failed,
.status-pill.error {
  background: rgba(224, 79, 79, 0.12);
  border-color: rgba(224, 79, 79, 0.25);
  color: var(--danger);
}

.status-pill.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--warning);
}

.empty-state {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.empty-state p {
  margin: 0;
  color: var(--text-secondary);
}

.trend-chart {
  overflow-x: auto;
}

.trend-chart svg {
  display: block;
  min-width: 480px;
}

.trend-bar-pass {
  fill: var(--success);
}

.trend-bar-warn {
  fill: var(--warning);
}

.trend-bar-fail {
  fill: var(--danger);
}

.trend-bar-na {
  fill: var(--border);
}

.trend-gridline {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.trend-axis {
  fill: var(--text-tertiary);
  font-size: 10px;
}

.schedule-card {
  display: grid;
  gap: var(--space-4);
  background: linear-gradient(180deg, rgba(18, 18, 20, 0.9), rgba(15, 15, 17, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-elev-1);
}

html[data-theme="light"] .schedule-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 242, 246, 0.92));
  border-color: rgba(209, 213, 219, 0.9);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .schedule-card-body {
  border-color: rgba(229, 231, 235, 0.95);
}

html[data-theme="light"] .schedule-badge {
  background: rgba(122, 162, 255, 0.14);
  color: var(--accent);
}

.schedule-card-header,
.schedule-card-body,
.schedule-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.schedule-card-header {
  justify-content: space-between;
  align-items: center;
}

.schedule-card-header strong {
  display: block;
  font-size: 1rem;
}

.schedule-card-body {
  justify-content: space-between;
  gap: var(--space-4);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) 0;
}

.schedule-card-body>div {
  flex: 1 1 220px;
  min-width: 220px;
  min-height: 1px;
}

.schedule-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(122, 162, 255, 0.14);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
}

.schedule-card-actions {
  justify-content: flex-end;
  gap: var(--space-2);
  align-items: center;
}

.schedule-card-actions .btn {
  min-width: 0;
  flex: 0 0 auto;
}

.workbench-meta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

.workbench-meta .meta-pill {
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 12px;
}

.workbench-meta .meta-pill strong {
  color: var(--text-primary);
}

.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0;
  gap: var(--space-1);
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-height);
  padding: 0 var(--space-5);
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
}

.seg-btn.active {
  background: var(--surface-3);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--ring);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.hero h1 {
  font-size: 22px;
}

.metric {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.metric strong {
  font-size: 18px;
}

.report-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.metric-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.metric-card strong {
  font-size: 18px;
}

.group-item {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-3) var(--space-5);
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}

.group-item:hover,
.group-item.active {
  background: var(--surface-3);
  color: var(--text-primary);
  border-color: var(--ring);
}

.group-item.running {
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.group-item.success {
  border-color: var(--success);
  color: var(--text-primary);
}

.group-item.fail {
  border-color: var(--danger);
  color: var(--text-primary);
}

.group-item.canceled {
  border-color: var(--warning);
  color: var(--text-primary);
}

.group-list {
  display: grid;
  gap: var(--space-3);
}

.group-progress {
  display: block;
  margin-top: var(--space-1);
  color: var(--text-tertiary);
  font-size: 11px;
}

.group-item.running .group-progress {
  color: var(--accent);
}

.group-item.success .group-progress {
  color: var(--success);
}

.group-item.fail .group-progress {
  color: var(--danger);
}

.group-item.canceled .group-progress {
  color: var(--warning);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7aa2ff, #ffffff);
  transition: width var(--transition-base), background var(--transition-base);
}

.progress-fill.success {
  background: linear-gradient(90deg, var(--success), #bbf7d0);
}

.progress-fill.fail {
  background: linear-gradient(90deg, var(--danger), #fecaca);
}

html[data-theme="light"] .progress-fill {
  background: linear-gradient(90deg, #101118, #7aa2ff);
}

.script-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-5);
  align-items: center;
  min-height: 56px;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.script-row:first-of-type {
  border-top: none;
}

.script-meta {
  display: grid;
  gap: var(--space-1);
}

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

.script-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.pagination-info {
  color: var(--text-tertiary);
  font-size: 12px;
  white-space: nowrap;
}

.form-error {
  padding: var(--space-4) var(--space-5);
  border-radius: 10px;
  background: rgba(255, 93, 95, 0.1);
  border: 1px solid rgba(255, 93, 95, 0.4);
  color: var(--danger);
  font-size: 13px;
  white-space: pre-line;
}

.field-hint {
  margin-top: var(--space-2);
  font-size: 12px;
  color: var(--text-tertiary);
  min-height: 14px;
}

.field-hint.error {
  color: var(--danger);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-6);
}

#scriptModal .field-grid {
  gap: var(--space-5) var(--space-5);
}

#scriptModal .script-step-row {
  width: 100%;
  align-items: flex-end;
  gap: var(--space-4);
}

#scriptModal .script-step-row .inline-field {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#scriptModal .script-step-row .inline-field select,
#scriptModal .script-step-row .inline-field input {
  width: 100%;
}

#scriptModal .script-step-row>button {
  flex: 0 0 auto;
}

#scriptModal .field-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}

#scriptModal .field-label-with-icon .icon-button {
  width: 22px;
  height: 22px;
  font-size: 12px;
}

#scriptModal .action-info-field {
  position: static;
}

#scriptModal .action-info-field .field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

#scriptModal .action-info-field .field-row label {
  margin-bottom: 0;
}

#scriptModal .icon-button {
  appearance: none;
  border: none;
  background: transparent;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
}

#scriptModal .icon-button:hover,
#scriptModal .icon-button:focus {
  background: var(--surface-2);
  color: var(--text-primary);
}

#scriptModal .tooltip {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  z-index: 10;
  max-width: 280px;
  padding: var(--space-3) var(--space-4);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  font-size: 12px;
  line-height: 1.4;
}

#scriptModal .tooltip strong {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

#scriptModal .tooltip div+div {
  margin-top: 0.35rem;
}

#scriptModal .action-info-field {
  min-width: 0;
}

#scriptModal .tooltip.hidden {
  display: none;
}

.field {
  display: grid;
  gap: var(--space-2);
  min-height: calc(14px + var(--space-2) + var(--control-height));
}

.browser-toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.browser-toggle {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    background var(--transition-base), transform var(--transition-fast);
}

.browser-toggle[aria-pressed="true"] {
  border-color: rgba(122, 162, 255, 0.8);
  background: rgba(122, 162, 255, 0.18);
  box-shadow: 0 0 0 2px rgba(122, 162, 255, 0.18);
}

.browser-toggle:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.browser-toggle:hover {
  transform: translateY(-1px);
}

.settings-card {
  display: grid;
  gap: var(--space-6);
  width: 100%;
}

.settings-section {
  display: grid;
  gap: var(--space-5);
}

.settings-section+.settings-section {
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
}

.settings-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
}

.settings-section-title {
  font-weight: 600;
  font-size: 14px;
}

.settings-section-subtle {
  color: var(--text-tertiary);
  font-size: 12px;
}

.toast-container {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  display: grid;
  gap: var(--space-4);
  z-index: 20;
}

.toast {
  min-height: var(--control-height);
  padding: var(--space-3) 14px;
  border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-primary);
  min-width: 220px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-card);
  animation: toastIn 0.25s ease;
}

.toast-message {
  word-break: break-word;
}

.toast-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.6);
}

.toast.error {
  background: rgba(224, 79, 79, 0.12);
  border-color: rgba(224, 79, 79, 0.35);
  color: var(--danger);
}

.toast.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--warning);
}

.toast.info {
  border-color: rgba(122, 162, 255, 0.6);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.compact-buttons .btn {
  padding: var(--space-2) var(--space-4);
  border-radius: 8px;
  font-size: 12px;
}

body.compact-buttons .btn-icon {
  min-width: 30px;
  padding: var(--space-2);
}

body.compact-buttons .script-row {
  padding: var(--space-2) 0;
}

body.compact-buttons .logs {
  padding: var(--space-3);
  font-size: 11px;
  min-height: 120px;
}

body.compact-buttons .report-controls {
  gap: var(--space-2);
}

body.compact-buttons #reportSelect,
body.compact-buttons #reportStart,
body.compact-buttons #reportEnd {
  padding: var(--space-2) var(--space-3);
  font-size: 12px;
  min-height: 36px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

html[data-theme="light"] .modal-backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.modal-backdrop.open {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal-card {
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
}

#scheduleModal .modal-card {
  width: min(90vw, 760px);
}

#scriptModal .modal-card {
  width: min(90vw, 760px);
}

.modal-card.modal-large {
  width: min(90vw, 980px);
}

.screenshot-modal-body img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.modal-body {
  display: grid;
  gap: var(--space-5);
}

.step-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: var(--space-5);
  background: var(--surface-2);
  display: grid;
  gap: var(--space-4);
}

.step-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.step-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.excel-preview {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.excel-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.excel-preview th,
.excel-preview td {
  padding: 8px 10px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  white-space: normal;
  overflow-wrap: anywhere;
}

.excel-preview td {
  max-width: 220px;
}

.excel-preview th {
  background: var(--surface);
  color: var(--text-primary);
  position: sticky;
  top: 0;
}

.excel-preview th.first-col,
.excel-preview td.first-col {
  background: rgba(122, 162, 255, 0.12);
  font-weight: 600;
}

.excel-preview th.second-col,
.excel-preview td.second-col {
  background: rgba(245, 158, 11, 0.08);
}

.excel-preview .excel-preview-meta {
  margin-bottom: 10px;
}

.excel-row-error td {
  background: rgba(239, 68, 68, 0.14);
}

.excel-row-error:hover td {
  background: rgba(239, 68, 68, 0.2);
}

.excel-import-guidance {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.guide-actions a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
}

.guide-actions a.guide-open {
  color: var(--text-primary);
}

#excelDocsModal .modal-card {
  max-width: 760px;
  width: min(100%, 760px);
}

#excelDocsModal .doc-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

#excelDocsModal .doc-section {
  margin-bottom: 18px;
}

#excelDocsModal pre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
}

#excelDocsModal code {
  font-size: 12px;
}

.excel-example-table-wrapper {
  overflow-x: auto;
  margin-top: 12px;
}

.excel-example-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.excel-example-table th,
.excel-example-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.excel-example-table th {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.excel-example-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.excel-example-table td:first-child,
.excel-example-table th:first-child {
  font-weight: 600;
}

.excel-import-guidance .guide-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.excel-import-guidance .guide-header strong {
  color: var(--text-primary);
}

.excel-import-guidance .excel-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  background: var(--surface-2);
  cursor: help;
  font-size: 11px;
  line-height: 1;
}

.excel-import-guidance .guide-text code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.excel-preview-errors {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
  font-size: 12px;
}

.excel-preview-errors ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  display: block;
  width: 100%;
  height: 14px;
  line-height: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input,
select {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  height: var(--control-height);
  min-height: var(--control-height);
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  font: inherit;
  line-height: 1.2;
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
    background var(--transition-base);
}

input[type="date"],
input[type="file"] {
  height: var(--control-height);
  min-height: var(--control-height);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-tertiary) 50%),
    linear-gradient(135deg, var(--text-tertiary) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input::placeholder {
  color: var(--text-tertiary);
}

input:hover,
select:hover {
  border-color: var(--ring);
}

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

input.has-error,
select.has-error {
  border-color: var(--danger);
  box-shadow: var(--shadow-error);
}

html[data-theme="light"] .pill,
html[data-theme="light"] .status-chip {
  background: var(--surface-2);
}

html[data-theme="light"] .segmented {
  background: var(--surface-2);
}

html[data-theme="light"] .seg-btn.active {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px rgba(16, 17, 24, 0.08);
}

html[data-theme="light"] .toast {
  background: var(--surface);
}

html[data-theme="light"] .status-banner {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(209, 213, 219, 0.95);
  color: var(--text-primary);
}

html[data-theme="light"] .status-banner[data-status="running"] {
  background: rgba(219, 234, 254, 0.75);
  border-color: rgba(147, 197, 253, 0.7);
}

html[data-theme="light"] .status-banner[data-status="success"] {
  background: rgba(220, 252, 231, 0.75);
  border-color: rgba(34, 197, 94, 0.6);
}

html[data-theme="light"] .status-banner[data-status="fail"] {
  background: rgba(254, 202, 202, 0.75);
  border-color: rgba(248, 113, 113, 0.65);
}

html[data-theme="light"] .status-banner[data-status="canceled"] {
  background: rgba(255, 244, 179, 0.75);
  border-color: rgba(245, 158, 11, 0.65);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

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

  .search {
    width: 200px;
  }
}

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

@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
  }

  .topbar .row {
    width: 100%;
    justify-content: space-between;
  }

  .search {
    width: 100%;
  }

  .group-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: var(--space-1);
  }

  .group-item {
    min-width: 180px;
  }

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

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

  .progress-track {
    height: 6px;
  }

  .schedule-card {
    padding: var(--space-4);
  }

  .schedule-card-body {
    gap: var(--space-3);
    padding: var(--space-3) 0;
  }

  .schedule-card-body>div {
    min-width: 120px;
  }

  .schedule-card-actions {
    justify-content: flex-start;
    gap: var(--space-2);
  }

  .schedule-card-actions .btn {
    flex: 0 0 auto;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
  }

  .schedule-card-actions .btn.btn-danger {
    min-width: 0;
  }

  input,
  select {
    height: var(--control-height-mobile);
    min-height: var(--control-height-mobile);
  }

  input[type="date"],
  input[type="file"] {
    height: var(--control-height-mobile);
    min-height: var(--control-height-mobile);
  }
}

.fade-in {
  animation: fadeIn 0.01s linear;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(0);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= PROJECT SWITCHER ================= */
.project-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  max-width: 180px;
}

/* ================= ENV TABLE ================= */
.env-table {
  width: 100%;
  border-collapse: collapse;
}

.env-table th,
.env-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.env-table th {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.env-value {
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.env-actions {
  width: 1%;
  white-space: nowrap;
}

.env-actions .btn {
  padding: var(--space-2) var(--space-3);
  font-size: 0.85rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}
/* Inspector — Phase 1.3 selector inspector */

#inspectorUrl {
  min-width: 20rem;
  max-width: 34rem;
}

#inspectorFilter {
  min-width: 13rem;
}

#inspectorElements {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.inspector-element {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.inspector-element:hover {
  border-color: var(--accent);
  background: var(--surface-card);
}

.inspector-tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}

.inspector-id {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.inspector-selector {
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--text);
}

.inspector-suggestion {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* Inspector pill variants (JS emits .pill-success for verified selectors). */
.pill-success {
  background: var(--success-bg, rgba(34, 197, 94, 0.14));
  color: var(--success, #16a34a);
}
