:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --bg: #f7f7f6;
  --surface: #ffffff;
  --border: #e5e4e0;
  --border-light: #f0efeb;
  --text-primary: #0a0a0a;
  --text-secondary: #6b6a65;
  --text-muted: #a3a29e;
  --green: #1a7a4a;
  --green-bg: #eaf5ef;
  --blue: #1565a8;
  --blue-bg: #e8f4fd;
  --red: #c0392b;
  --red-bg: #faeaea;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --purple: #6d3fd4;
  --purple-bg: #f3f0ff;
  --shadow-soft: 0 18px 60px rgba(10, 10, 10, 0.07);
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-2xl: 18px;
  --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(21, 101, 168, 0.09), transparent 30%),
    linear-gradient(180deg, #f8f7f4 0%, #f3f1ec 100%);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

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

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 410px);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(229, 228, 224, 0.88);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 34px 32px;
}

.brand-lockup {
  margin-bottom: 24px;
}

.brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.brand-title {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.brand-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 14px;
}

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

.field-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.text-input,
.select-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-primary);
  padding: 0 13px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.text-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}

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

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

.auth-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.button {
  border: 0;
  border-radius: var(--r-md);
  min-height: 38px;
  padding: 0 15px;
  font-weight: 500;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    opacity 0.12s ease,
    background-color 0.12s ease,
    border-color 0.12s ease;
}

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

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  background: var(--black);
  color: var(--white);
}

.button-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.button-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.button-full {
  width: 100%;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.app-shell-hidden {
  display: none;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.sidebar-head {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.sidebar-subtitle {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  flex: 1;
}

.nav-section {
  padding: 14px 20px 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link,
.mobile-nav-link {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 20px;
  border-left: 2px solid transparent;
}

.nav-link:hover,
.nav-link-active {
  background: rgba(247, 247, 246, 0.88);
  color: var(--text-primary);
}

.nav-link-active {
  border-left-color: var(--black);
  font-weight: 500;
}

.nav-pill {
  min-width: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.sidebar-foot {
  padding: 16px 20px;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-user-value {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.main-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(229, 228, 224, 0.72);
  background: rgba(247, 247, 246, 0.9);
  backdrop-filter: blur(8px);
}

.topbar-eyebrow {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge-idle {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.status-badge-idle .status-dot {
  background: var(--text-muted);
}

.status-badge-running {
  background: var(--green-bg);
  color: var(--green);
}

.status-badge-running .status-dot {
  background: var(--green);
  animation: pulse 1.2s infinite;
}

.status-badge-finished {
  background: var(--blue-bg);
  color: var(--blue);
}

.status-badge-finished .status-dot {
  background: var(--blue);
}

.mobile-nav {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 18px 0;
}

.mobile-nav-link {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.mobile-nav-link-active {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

.content-shell {
  flex: 1;
  padding: 24px 28px 36px;
}

.page {
  display: none;
}

.page-active {
  display: block;
}

.run-panel,
.card,
.placeholder-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 228, 224, 0.88);
  border-radius: var(--r-2xl);
  box-shadow: 0 12px 36px rgba(10, 10, 10, 0.04);
}

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

.panel-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
}

.run-progress {
  margin-top: 12px;
}

.run-progress-hidden {
  display: none;
}

.run-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 5px;
}

.progress-track {
  height: 6px;
  background: rgba(229, 228, 224, 0.8);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 0%, #2b9f63 100%);
  transition: width 0.3s ease;
}

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

.stat-card {
  padding: 16px 18px;
  border: 1px solid rgba(229, 228, 224, 0.88);
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.8);
}

.stat-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.stat-value-green {
  color: var(--green);
}

.stat-value-amber {
  color: var(--amber);
}

.card {
  padding: 20px;
}

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

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-title {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.card-subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar-search {
  width: min(100%, 320px);
}

.toolbar-projects .toolbar-search {
  width: min(100%, 240px);
}

.toolbar-field {
  min-width: 150px;
}

.sub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
  background: rgba(247, 247, 246, 0.58);
}

.filter-group,
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mini-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
}

.text-input-small {
  min-height: 30px;
  width: 72px;
  padding: 0 10px;
  font-size: 12px;
}

.select-input-small {
  min-height: 34px;
  padding-right: 34px;
}

.mini-select {
  display: grid;
  gap: 4px;
  min-width: 132px;
}

.mini-select-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: rgba(10, 10, 10, 0.32);
  color: var(--text-primary);
}

.filter-chip-active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.results-count {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.table-shell {
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--r-xl);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.table th {
  padding: 12px 14px;
  text-align: left;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.sortable {
  cursor: pointer;
}

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

.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.35;
  font-size: 10px;
}

.sortable.sort-asc .sort-indicator,
.sortable.sort-desc .sort-indicator {
  opacity: 1;
}

.sortable.sort-asc .sort-indicator::after {
  content: "↑";
}

.sortable.sort-desc .sort-indicator::after {
  content: "↓";
}

.sortable:not(.sort-asc):not(.sort-desc) .sort-indicator::after {
  content: "↕";
}

.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

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

.table tbody tr:hover td {
  background: rgba(247, 247, 246, 0.5);
}

.table-align-center {
  text-align: center;
}

.source-name {
  font-weight: 500;
}

.source-url {
  color: var(--blue);
  text-decoration: none;
  word-break: break-all;
}

.source-url:hover {
  text-decoration: underline;
}

.project-row {
  cursor: pointer;
}

.project-source {
  color: var(--text-secondary);
  font-size: 12px;
}

.project-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  font-weight: 500;
}

.project-name-text {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-url {
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
}

.project-url:hover {
  text-decoration: underline;
}

.project-summary {
  display: -webkit-box;
  max-width: 260px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-category {
  color: var(--text-secondary);
  font-size: 12px;
}

.project-metric,
.project-date {
  font-variant-numeric: tabular-nums;
}

.project-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-neutral {
  background: var(--bg);
  color: var(--text-muted);
}

.tag-amber {
  background: var(--amber-bg);
  color: var(--amber);
}

.tag-purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.tag-new {
  background: var(--green);
  color: var(--white);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 94px;
}

.metric-track {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(229, 228, 224, 0.92);
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--black);
}

.metric-text {
  min-width: 24px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

.vote-delta {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
}

.vote-delta-up {
  color: var(--green);
}

.vote-delta-flat {
  color: var(--text-muted);
}

.depth-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.depth-pill[data-depth="2"] {
  background: var(--blue-bg);
  border-color: rgba(21, 101, 168, 0.1);
  color: var(--blue);
}

.depth-pill[data-depth="3"] {
  background: var(--purple-bg);
  border-color: rgba(109, 63, 212, 0.1);
  color: var(--purple);
}

.depth-pill-note {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 500;
}

.tag-yes {
  background: var(--green-bg);
  color: var(--green);
}

.tag-no {
  background: var(--bg);
  color: var(--text-muted);
}

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

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.icon-button-danger:hover {
  background: var(--red-bg);
  border-color: rgba(192, 57, 43, 0.18);
  color: var(--red);
}

.toggle {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--border);
  transition: background-color 0.16s ease;
}

.toggle-handle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(10, 10, 10, 0.18);
  transition: transform 0.16s ease;
}

.toggle input:checked + .toggle-track {
  background: var(--green);
}

.toggle input:checked ~ .toggle-handle {
  transform: translateX(16px);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 48px 20px;
  text-align: center;
}

.empty-state-icon {
  color: var(--text-muted);
  font-size: 24px;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 500;
}

.empty-state-copy {
  color: var(--text-secondary);
  font-size: 12px;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 14px;
}

.pagination-summary {
  margin-right: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.pagination-button {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.pagination-button:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text-primary);
}

.pagination-button-active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

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

.placeholder-card {
  padding: 28px;
}

.placeholder-stage {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  margin-bottom: 14px;
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.placeholder-title {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.placeholder-copy {
  margin: 0;
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.run-history-list {
  display: grid;
  gap: 12px;
}

.run-card {
  overflow: hidden;
  border: 1px solid rgba(229, 228, 224, 0.88);
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.9);
}

.run-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.run-card-head-copy {
  min-width: 0;
  flex: 1;
}

.run-id {
  color: var(--blue);
  font-family: "Courier New", monospace;
  font-size: 12px;
  font-weight: 700;
}

.run-period {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.run-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.run-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.run-badge-pending {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.run-badge-pending .run-badge-dot {
  background: var(--text-muted);
}

.run-badge-running {
  background: var(--green-bg);
  color: var(--green);
}

.run-badge-running .run-badge-dot {
  background: var(--green);
  animation: pulse 1.2s infinite;
}

.run-badge-success {
  background: var(--blue-bg);
  color: var(--blue);
}

.run-badge-success .run-badge-dot {
  background: var(--blue);
}

.run-badge-partial_success {
  background: var(--amber-bg);
  color: var(--amber);
}

.run-badge-partial_success .run-badge-dot {
  background: var(--amber);
}

.run-badge-failed {
  background: var(--red-bg);
  color: var(--red);
}

.run-badge-failed .run-badge-dot {
  background: var(--red);
}

.run-card-body {
  padding: 14px 16px 16px;
}

.run-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.run-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}

.run-params {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.run-param {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--r-md);
  background: rgba(247, 247, 246, 0.85);
  padding: 6px 10px;
  color: var(--text-secondary);
  font-size: 12px;
}

.run-param strong {
  color: var(--text-primary);
  font-weight: 600;
}

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

.run-mini-card {
  border-radius: var(--r-lg);
  background: rgba(247, 247, 246, 0.88);
  padding: 10px 12px;
}

.run-mini-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.run-mini-value {
  margin-top: 7px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.run-mini-value-danger {
  color: var(--red);
}

.run-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border-light);
  background: rgba(247, 247, 246, 0.78);
}

.run-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.run-error-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--red);
  font: inherit;
  font-size: 24px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
}

.run-error-link:hover {
  text-decoration-style: solid;
}

.run-error-link-inline {
  font-size: 13px;
}

.run-empty-card {
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
  padding: 42px 18px;
  text-align: center;
  background: rgba(247, 247, 246, 0.55);
}

.run-empty-icon {
  color: var(--text-muted);
  font-size: 28px;
}

.run-empty-title {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
}

.run-empty-copy {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.42);
}

.modal-card {
  position: relative;
  width: min(100%, 500px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: 0 26px 70px rgba(10, 10, 10, 0.18);
  padding: 22px;
}

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

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.modal-form {
  display: grid;
  gap: 14px;
}

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

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  background: rgba(247, 247, 246, 0.55);
}

.toggle-copy {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 62;
  background: rgba(10, 10, 10, 0.18);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 63;
  display: flex;
  flex-direction: column;
  width: min(100vw, 520px);
  height: 100vh;
  border-left: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -14px 0 36px rgba(10, 10, 10, 0.08);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.drawer-head-copy {
  min-width: 0;
}

.drawer-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.drawer-subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 12px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}

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

.drawer-section-title {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.drawer-box {
  border-radius: var(--r-lg);
  background: var(--bg);
  padding: 12px 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

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

.metric-card {
  border-radius: var(--r-lg);
  background: var(--bg);
  padding: 12px 14px;
}

.metric-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

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

.drawer-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.drawer-key {
  width: 118px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.drawer-value {
  flex: 1;
  color: var(--text-primary);
  font-size: 13px;
  word-break: break-word;
}

.drawer-code {
  margin: 0;
  border-radius: var(--r-lg);
  padding: 12px 14px;
  background: var(--black);
  color: #ece9e1;
  font-family: "Courier New", monospace;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.run-error-code {
  max-height: min(56vh, 420px);
  overflow-y: auto;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  padding: 16px 22px 18px;
  border-top: 1px solid var(--border);
}

.drawer-actions .button,
.drawer-actions a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.button-danger {
  background: var(--red);
  color: var(--white);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(90vw, 360px);
  border-radius: var(--r-lg);
  background: var(--black);
  color: var(--white);
  padding: 12px 14px;
  box-shadow: 0 20px 40px rgba(10, 10, 10, 0.16);
  font-size: 13px;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

@media (max-width: 980px) {
  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
  }

  .content-shell,
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .run-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-head,
  .run-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .sub-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .results-count {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .auth-card,
  .modal-card {
    padding: 24px 20px;
  }

  .brand-title {
    font-size: 24px;
  }

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

  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .run-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-shell {
    overflow-x: auto;
  }

  .table {
    min-width: 760px;
  }

  .drawer {
    width: 100%;
  }

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