:root {
  --bg: #050a09;
  --panel: rgba(13, 24, 22, 0.84);
  --panel-solid: #0d1816;
  --panel-light: #12211e;
  --line: rgba(154, 184, 176, 0.14);
  --line-strong: rgba(123, 255, 193, 0.32);
  --text: #ecf7f2;
  --muted: #8ca29b;
  --accent: #6dffbd;
  --accent-strong: #22d98a;
  --warn: #ffcd70;
  --danger: #ff7e87;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, #12342a 0%, transparent 44%),
    var(--bg);
  background-size: 42px 42px, 42px 42px, auto, auto;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(110px);
  opacity: 0.11;
}

.ambient-one {
  top: -180px;
  right: -120px;
  background: var(--accent);
}

.ambient-two {
  bottom: -240px;
  left: -120px;
  background: #2384ff;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 0;
}

.login-panel {
  width: min(620px, 100%);
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(17, 34, 29, 0.94), rgba(8, 17, 15, 0.96));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-large {
  font-size: 22px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(109, 255, 189, 0.42);
  border-radius: 9px;
  background: rgba(109, 255, 189, 0.08);
}

.brand-mark i {
  display: block;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(109, 255, 189, 0.34);
}

.brand-mark i:nth-child(1) { height: 42%; }
.brand-mark i:nth-child(2) { height: 100%; }
.brand-mark i:nth-child(3) { height: 68%; }

.eyebrow,
.section-kicker {
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.login-panel h1 {
  margin: 42px 0 12px;
  font-size: clamp(34px, 7vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.login-copy {
  max-width: 490px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.login-form {
  margin-top: 34px;
}

.login-form label {
  display: block;
  margin-bottom: 9px;
  color: #bdcec8;
  font-size: 13px;
  font-weight: 650;
}

.token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.token-row input {
  min-width: 0;
  height: 48px;
  padding: 0 15px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: rgba(1, 8, 6, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.token-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 255, 189, 0.12);
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.56;
  transform: none;
}

.button-primary {
  color: #052016;
  background: var(--accent);
  box-shadow: 0 10px 30px rgba(34, 217, 138, 0.18);
}

.button-primary:hover {
  background: #8affca;
}

.button-danger {
  color: #2c070b;
  background: var(--danger);
  box-shadow: 0 10px 30px rgba(255, 126, 135, 0.14);
}

.button-danger:hover {
  background: #ff9da4;
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.button-ghost:hover {
  border-color: rgba(109, 255, 189, 0.38);
  background: rgba(109, 255, 189, 0.07);
}

.form-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.login-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  color: #748b84;
  font-size: 12px;
}

.lock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(109, 255, 189, 0.7);
}

.dashboard {
  padding: 30px 0 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 12px currentColor;
}

.connection[data-state="online"] .connection-dot {
  background: var(--accent);
}

.connection[data-state="offline"] .connection-dot {
  background: var(--danger);
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 52px 0 22px;
}

.dashboard-heading h1,
.section-heading h2 {
  margin: 6px 0 0;
  letter-spacing: -0.035em;
}

.dashboard-heading h1 {
  font-size: clamp(30px, 4vw, 45px);
}

.updated {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

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

.metric {
  min-height: 164px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(18, 33, 30, 0.86), rgba(10, 19, 17, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.metric-accent {
  border-color: rgba(109, 255, 189, 0.3);
  background: linear-gradient(145deg, rgba(26, 60, 47, 0.75), rgba(9, 22, 18, 0.92));
}

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

.metric strong {
  display: block;
  margin-top: 24px;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-download {
  display: block;
  max-width: 100%;
  margin: 24px 0 0;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-download:hover,
.metric-download:focus-visible,
.hits-download:hover,
.hits-download:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.metric small {
  display: block;
  margin-top: 12px;
  color: #6f8780;
  font-size: 11px;
}

.mini-track {
  height: 4px;
  margin-top: 19px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(109, 255, 189, 0.55);
  transition: width 450ms ease;
}

.content-section {
  margin-top: 50px;
}

.run-control-card {
  padding: 25px;
  border: 1px solid rgba(109, 255, 189, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(19, 38, 31, 0.88), rgba(12, 22, 19, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.create-run-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 1.3fr);
  gap: 14px;
}

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

.field > span {
  color: #bdcec8;
  font-size: 12px;
  font-weight: 700;
}

.field-heading {
  min-height: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #bdcec8;
  font-size: 12px;
  font-weight: 700;
}

.passphrase-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.passphrase-mode label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.passphrase-mode label:has(input:checked) {
  color: var(--accent);
  border-color: rgba(109, 255, 189, 0.5);
  background: rgba(109, 255, 189, 0.08);
}

.passphrase-mode input,
.field .passphrase-mode input {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent-strong);
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: rgba(1, 8, 6, 0.68);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 255, 189, 0.12);
}

.field input:disabled,
.field select:disabled {
  color: #61736d;
  border-color: rgba(109, 255, 189, 0.1);
  background: rgba(109, 255, 189, 0.035);
}

.field-passphrase input {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.field-passphrase input[type="file"] {
  padding: 11px 14px;
  font-family: inherit;
  font-size: 12px;
}

.field-note {
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.field-uid input {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.generator-panel {
  margin-top: 18px;
  border: 1px solid rgba(109, 255, 189, 0.16);
  border-radius: 12px;
  background: rgba(1, 8, 6, 0.34);
}

.generator-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  color: #c9d8d3;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.generator-panel summary small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 600;
}

.parameter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 2px 17px 17px;
}

.address-types-field {
  display: grid;
  gap: 9px;
  padding: 0 17px 17px;
}

.address-types-field > span {
  color: #bdcec8;
  font-size: 12px;
  font-weight: 700;
}

.address-type-grid,
.fixed-parameters,
.run-parameters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.address-type-grid label,
.fixed-parameters span,
.run-parameters span {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  font-weight: 650;
}

.address-type-grid label {
  cursor: pointer;
}

.address-type-grid label:has(input:checked) {
  color: var(--accent);
  border-color: rgba(109, 255, 189, 0.45);
  background: rgba(109, 255, 189, 0.07);
}

.address-type-grid input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.fixed-parameters {
  padding: 0 17px 17px;
}

.fixed-parameters span {
  min-height: 25px;
  color: #71857e;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.run-parameters {
  margin-top: 14px;
}

.run-parameters span {
  min-height: 26px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.run-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.run-scope span {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #9db2ab;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.create-run-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(109, 255, 189, 0.14);
}

.create-run-actions strong {
  color: var(--accent);
  font-size: 13px;
}

.create-run-actions p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.create-run-actions .button {
  flex: 0 0 auto;
  min-height: 45px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.section-heading h2 {
  font-size: 25px;
}

.count-pill,
.status-badge,
.task-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}

.count-pill {
  min-width: 34px;
  height: 27px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.runs-list {
  display: grid;
  gap: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.pagination-button {
  min-width: 92px;
  min-height: 34px;
  padding: 0 13px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
}

.pagination-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.pagination-label {
  min-width: 140px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.pagination-jump {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}

.pagination-jump input {
  width: 72px;
  min-height: 34px;
  padding: 0 9px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(1, 8, 6, 0.68);
  text-align: center;
}

.pagination-jump input:focus {
  border-color: rgba(109, 255, 189, 0.52);
  box-shadow: 0 0 0 2px rgba(109, 255, 189, 0.08);
}

.pagination-go {
  min-height: 34px;
  padding: 0 11px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
}

.run-card,
.worker-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.022);
  backdrop-filter: blur(12px);
}

.run-card {
  padding: 25px;
}

.run-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.run-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.priority-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.priority-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.priority-input {
  width: 82px;
  min-height: 28px;
  padding: 4px 7px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  font: inherit;
  font-size: 12px;
}

.priority-input:focus {
  border-color: rgba(109, 255, 189, 0.52);
  outline: none;
  box-shadow: 0 0 0 2px rgba(109, 255, 189, 0.08);
}

.button-priority-save {
  min-height: 28px;
  padding: 0 8px;
  color: #b9cac4;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  line-height: 1;
}

.button-priority-save:hover {
  color: var(--accent);
  border-color: rgba(109, 255, 189, 0.38);
  background: rgba(109, 255, 189, 0.07);
}

.button-priority-save:disabled {
  color: #4d5b57;
  cursor: default;
  opacity: 0.45;
}

.button-delete {
  min-height: 28px;
  padding: 0 10px;
  color: var(--danger);
  border-color: rgba(255, 126, 135, 0.22);
  background: rgba(255, 126, 135, 0.05);
  font-size: 11px;
}

.button-delete:hover {
  border-color: rgba(255, 126, 135, 0.48);
  background: rgba(255, 126, 135, 0.1);
}

.run-index {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

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

.status-badge {
  gap: 7px;
  min-height: 28px;
  padding: 0 11px;
  color: var(--accent);
  border-color: rgba(109, 255, 189, 0.23);
  font-size: 11px;
  font-weight: 750;
}

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

.status-badge[data-status="complete"] {
  color: #78c6ff;
  border-color: rgba(120, 198, 255, 0.23);
}

.status-badge[data-status="paused"] {
  color: var(--warn);
  border-color: rgba(255, 205, 112, 0.23);
}

.run-progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 18px;
  margin-top: 26px;
}

.run-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.run-track {
  height: 9px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.065);
}

.run-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  box-shadow: 0 0 18px rgba(109, 255, 189, 0.35);
  transition: width 450ms ease;
}

.run-percent {
  min-width: 94px;
  text-align: right;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.run-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.detail {
  padding: 13px 14px;
  border-left: 1px solid var(--line);
}

.detail:first-child {
  border-left-color: var(--line-strong);
}

.detail span {
  display: block;
  color: #718980;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hits-download {
  display: block;
  max-width: 100%;
  margin-top: 7px;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 0;
  outline: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-download:disabled,
.hits-download:disabled {
  cursor: wait;
  opacity: 0.65;
}

.tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.task-chip {
  min-height: 26px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.task-chip b {
  margin-left: 6px;
  color: var(--text);
}

.workers-list {
  column-count: 3;
  column-gap: 12px;
}

.worker-card {
  display: inline-block;
  width: 100%;
  min-width: 0;
  margin: 0 0 12px;
  padding: 20px;
  break-inside: avoid;
  vertical-align: top;
}

.worker-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.worker-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.worker-delete {
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.worker-id {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-host {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-state {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border-radius: 50%;
  background: #52605c;
}

.worker-state.active {
  background: var(--accent);
  box-shadow: 0 0 13px rgba(109, 255, 189, 0.65);
}

.worker-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.worker-stat {
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.028);
}

.worker-stat span {
  display: block;
  color: #718980;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.worker-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 13px;
}

.rig-gpu-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.rig-gpu {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
}

.rig-gpu > .worker-state {
  margin: 0;
}

.rig-gpu-identity {
  min-width: 0;
}

.rig-gpu-title,
.rig-gpu-meta {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
}

.rig-gpu-device {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 11px;
}

.rig-gpu-name {
  overflow: hidden;
  color: #9eb1aa;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rig-gpu-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.rig-gpu-speed {
  color: #c9d8d3;
  font-weight: 700;
}

.rig-gpu-seen::before {
  content: "·";
  margin-right: 7px;
}

.rig-gpu-error {
  grid-column: 2 / -1;
  width: 100%;
  margin-top: 2px;
}

.worker-error {
  margin: 13px 0 0;
  padding-top: 12px;
  overflow: hidden;
  color: var(--danger);
  border-top: 1px solid rgba(255, 126, 135, 0.15);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  padding: 38px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 16px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  font-size: 12px;
}

.toast[data-kind="success"] {
  border-color: rgba(109, 255, 189, 0.32);
  background: #10271f;
}

.toast[data-kind="error"] {
  border-color: rgba(255, 126, 135, 0.35);
  background: #271317;
}

@media (max-width: 1120px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workers-list {
    column-count: 2;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 26px, 1500px);
  }

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

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .connection {
    width: 100%;
    margin-bottom: 5px;
  }

  .metric-grid,
  .create-run-grid,
  .parameter-grid {
    grid-template-columns: 1fr;
  }

  .workers-list {
    column-count: 1;
  }

  .metric {
    min-height: 140px;
  }

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

  .detail:nth-child(3) {
    border-left-color: var(--line-strong);
  }

  .detail:nth-child(5) {
    border-left-color: var(--line-strong);
  }

  .create-run-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {

  .pagination-jump {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

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

  .button-primary {
    min-height: 48px;
  }

  .create-run-actions .button {
    width: 100%;
  }

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

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

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

  .run-percent {
    text-align: left;
  }

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

  .detail,
  .detail:nth-child(3) {
    border-left-color: var(--line-strong);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
