:root {
  --bg-0: #0b0d10;
  --bg-1: #101318;
  --bg-2: #151920;
  --bg-3: #1a1f28;
  --border: #252b35;
  --border-strong: #343c49;
  --fg-0: #edf0f4;
  --fg-1: #abb3c0;
  --fg-2: #737d8d;
  --accent: #7592ff;
  --accent-strong: #8ea5ff;
  --accent-weak: rgba(117, 146, 255, 0.14);
  --ok: #45d79a;
  --ok-bg: rgba(69, 215, 154, 0.12);
  --warn: #e8bb55;
  --warn-bg: rgba(232, 187, 85, 0.12);
  --err: #f07a7a;
  --err-bg: rgba(240, 122, 122, 0.12);
  --info: #7592ff;
  --idle: #737d8d;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 238px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--font);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -20%, rgba(117, 146, 255, 0.09), transparent 38%),
    var(--bg-0);
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--fg-2);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

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

.auth-card {
  width: min(100%, 420px);
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(16, 19, 24, 0.94);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 28px;
}

.auth-card label {
  display: block;
  margin: 28px 0 8px;
  color: var(--fg-1);
  font-size: 13px;
  font-weight: 650;
}

.auth-card input,
.filters input,
.filters select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}

.auth-card input {
  height: 48px;
  padding: 0 14px;
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid rgba(142, 165, 255, 0.38);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(117, 146, 255, 0.35), rgba(117, 146, 255, 0.08));
  color: #dce4ff;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  margin: 0;
  border-radius: 10px;
  font-size: 14px;
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 680;
  transition: 140ms ease;
}

.button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.button.primary {
  background: var(--accent);
  color: #0a0d16;
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.ghost,
.icon-button {
  border-color: var(--border);
  background: var(--bg-2);
  color: var(--fg-1);
}

.button.ghost:hover,
.icon-button:hover {
  border-color: var(--border-strong);
  color: var(--fg-0);
}

.button.danger {
  border-color: rgba(240, 122, 122, 0.3);
  background: var(--err-bg);
  color: var(--err);
}

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

.button.wide {
  width: 100%;
  min-height: 46px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  font-size: 19px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  height: 100vh;
  grid-template-rows: auto 1fr auto;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--border);
  background: rgba(13, 16, 20, 0.96);
  backdrop-filter: blur(20px);
}

.brand,
.connection {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 14px;
}

.brand span {
  margin-top: 2px;
  color: var(--fg-2);
  font-size: 10px;
}

.sidebar-brand {
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
}

.main-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  padding-top: 20px;
}

.nav-item {
  display: grid;
  min-height: 44px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-1);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  transition: 140ms ease;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--fg-0);
}

.nav-item[aria-current="page"] {
  border-color: rgba(117, 146, 255, 0.22);
  background: var(--accent-weak);
  color: #dfe5ff;
}

.nav-icon {
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 17px;
  text-align: center;
}

.nav-item[aria-current="page"] .nav-icon {
  color: var(--accent-strong);
}

.nav-count {
  min-width: 24px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
}

.nav-count[data-active="true"] {
  background: var(--accent-weak);
  color: var(--accent-strong);
}

.sidebar-footer {
  padding: 16px 8px 0;
  border-top: 1px solid var(--border);
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 14px;
}

.connection {
  gap: 8px;
  color: var(--fg-1);
  font-size: 13px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
}

.connection[data-state="connected"] .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-bg);
}

.connection[data-state="error"] .status-dot {
  background: var(--err);
  box-shadow: 0 0 0 4px var(--err-bg);
}

.content-shell {
  min-width: 0;
}

.content-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  border-bottom: 1px solid rgba(37, 43, 53, 0.82);
  background: rgba(11, 13, 16, 0.88);
  backdrop-filter: blur(18px);
}

.content-header h1 {
  margin-bottom: 4px;
  font-size: 25px;
}

.content-header p {
  margin-bottom: 0;
  font-size: 14px;
}

.content-header time {
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 12px;
}

.workspace {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 30px 32px 80px;
}

.section-heading,
.jobs-toolbar,
.pagination {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.count-label,
.pagination {
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 12px;
}

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

.metric-card,
.account-card,
.active-item,
.jobs-panel {
  border: 1px solid var(--border);
  background: rgba(16, 19, 24, 0.82);
}

.metric-card {
  min-height: 96px;
  padding: 18px;
  border-radius: var(--radius-md);
}

.metric-card span,
.account-card span {
  color: var(--fg-2);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.section-block {
  margin-top: 30px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading.inline {
  align-items: center;
}

.page-section-heading {
  align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.page-section-heading p {
  max-width: 680px;
  margin: 8px 0 0;
  font-size: 12px;
}

.view-panel {
  animation: view-in 150ms ease-out;
}

.account-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.client-card-actions,
.client-identity,
.scope-option,
.secret-value-row {
  display: flex;
  align-items: center;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin-bottom: 14px;
}

.list-toolbar > span {
  color: var(--fg-1);
  font-size: 14px;
  font-weight: 650;
}

.client-list-head,
.client-card {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) 90px minmax(110px, 0.8fr) minmax(180px, 1fr) minmax(130px, 0.8fr) auto;
  align-items: center;
  gap: 20px;
}

.client-list-head {
  padding: 0 18px 10px;
  color: var(--fg-2);
  font-size: 12px;
}

.client-strip {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(16, 19, 24, 0.72);
}

.client-card {
  min-width: 0;
  min-height: 76px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.client-card:last-child {
  border-bottom: 0;
}

.client-card[data-revoked="true"] {
  opacity: 0.55;
}

.client-identity {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.client-identity strong,
.client-identity span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-identity strong {
  font-size: 14px;
}

.client-identity span,
.client-key,
.client-last-used {
  color: var(--fg-2);
  font-size: 12px;
}

.client-key {
  overflow: hidden;
  font-family: var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.client-status[data-status="revoked"] {
  background: var(--err-bg);
  color: var(--err);
}

.client-usage strong,
.client-usage span {
  display: block;
  white-space: nowrap;
}

.client-usage strong {
  font-size: 13px;
  font-weight: 600;
}

.client-usage span {
  margin-top: 4px;
  color: var(--fg-2);
  font-size: 12px;
}

.client-card-actions {
  gap: 6px;
}

.account-card {
  padding: 18px;
  border-radius: var(--radius-md);
}

.account-card-header,
.account-stat-row,
.active-item,
.job-primary,
.status-badge,
.artifact-header,
.drawer-id-row {
  display: flex;
  align-items: center;
}

.account-card-header,
.account-stat-row {
  justify-content: space-between;
  gap: 12px;
}

.account-card-header strong {
  font-size: 14px;
}

.account-stat-row {
  margin-top: 24px;
}

.account-stat-row strong {
  font-family: var(--mono);
  font-size: 22px;
}

.worker-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--fg-1);
  font-size: 13px;
}

.worker-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
  content: "";
}

.worker-status[data-status="HEALTHY"]::before {
  background: var(--ok);
}

.worker-status[data-status="BUSY"]::before {
  background: var(--accent);
}

.worker-status[data-status="COOLDOWN"]::before,
.worker-status[data-status="REAUTH_REQUIRED"]::before,
.worker-status[data-status="DEAD"]::before {
  background: var(--err);
}

.active-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.active-item {
  min-width: 0;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
}

.active-item:hover {
  border-color: var(--border-strong);
}

.type-icon,
.job-thumb {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--fg-1);
  font-size: 12px;
  font-weight: 800;
}

.type-icon {
  width: 38px;
  height: 38px;
}

.active-copy {
  min-width: 0;
  flex: 1;
}

.active-copy strong,
.active-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-copy strong {
  font-size: 14px;
}

.active-copy span {
  margin-top: 5px;
  color: var(--fg-2);
  font-size: 12px;
}

.active-progress {
  width: 56px;
  text-align: right;
}

.active-progress strong,
.active-progress span {
  display: block;
}

.active-progress strong {
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 13px;
}

.active-progress span {
  margin-top: 5px;
  color: var(--fg-2);
  font-size: 12px;
}

.jobs-panel {
  margin-top: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.jobs-toolbar {
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px 170px auto;
  gap: 8px;
  width: 100%;
}

.filters input,
.filters select {
  height: 40px;
  padding: 0 12px;
  color: var(--fg-1);
  font-size: 13px;
}

.filters input::placeholder {
  color: var(--fg-2);
}

.filter-more {
  position: relative;
}

.filter-more summary {
  display: flex;
  height: 40px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--fg-1);
  font-size: 13px;
  list-style: none;
}

.filter-more summary::-webkit-details-marker {
  display: none;
}

.filter-more-menu {
  position: absolute;
  z-index: 15;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 260px;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

.filter-more-menu label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--fg-2);
  font-size: 12px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(37, 43, 53, 0.72);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 650;
}

th:nth-child(1) { width: 64px; }
th:nth-child(2) { width: auto; }
th:nth-child(3) { width: 160px; }
th:nth-child(4) { width: 150px; }
th:nth-child(5) { width: 140px; }
th:nth-child(6) { width: 52px; }

tbody tr {
  cursor: pointer;
  transition: background 120ms ease;
}

tbody tr:hover {
  background: rgba(117, 146, 255, 0.045);
}

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

.job-thumb {
  width: 40px;
  height: 40px;
  overflow: hidden;
}

.job-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-primary {
  min-width: 0;
  gap: 10px;
}

.job-copy {
  min-width: 0;
}

.job-copy strong,
.job-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-copy strong {
  font-size: 14px;
  font-weight: 610;
}

.job-copy span,
.meta-cell {
  margin-top: 5px;
  color: var(--fg-2);
  font-size: 12px;
}

.model-cell {
  overflow: hidden;
  color: var(--fg-1);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  width: fit-content;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(115, 125, 141, 0.12);
  color: var(--fg-1);
  font-size: 12px;
  font-weight: 720;
}

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

.status-badge[data-status="DONE"] {
  background: var(--ok-bg);
  color: var(--ok);
}

.status-badge[data-status="DONE"]::before {
  background: var(--ok);
}

.status-badge[data-status="FAILED"],
.status-badge[data-status="SUBMITTED_UNKNOWN"],
.status-badge[data-status="INPUT_UPLOAD_UNKNOWN"],
.status-badge[data-status="UPSAMPLE_SUBMITTED_UNKNOWN"] {
  background: var(--err-bg);
  color: var(--err);
}

.status-badge[data-status="FAILED"]::before,
.status-badge[data-status="SUBMITTED_UNKNOWN"]::before,
.status-badge[data-status="INPUT_UPLOAD_UNKNOWN"]::before,
.status-badge[data-status="UPSAMPLE_SUBMITTED_UNKNOWN"]::before {
  background: var(--err);
}

.status-badge[data-status="QUEUED"],
.status-badge[data-status="CANCELLED"] {
  color: var(--fg-2);
}

.status-badge[data-active="true"] {
  background: var(--accent-weak);
  color: var(--accent-strong);
}

.status-badge[data-active="true"]::before {
  background: var(--accent);
}

.row-action {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-2);
}

.row-action:hover {
  background: var(--bg-3);
  color: var(--fg-0);
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--fg-2);
  text-align: center;
}

.empty-state strong {
  color: var(--fg-1);
  font-size: 13px;
}

.empty-state span {
  font-size: 13px;
}

.pagination {
  min-height: 58px;
  align-items: center;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
}

.drawer {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  display: grid;
  width: min(620px, 94vw);
  height: 100vh;
  grid-template-rows: auto 1fr auto;
  border-left: 1px solid var(--border-strong);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  animation: drawer-in 160ms ease-out;
}

.drawer-backdrop {
  position: fixed;
  z-index: 45;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.48);
  cursor: default;
}

.drawer-header,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
  background: rgba(16, 19, 24, 0.95);
}

.drawer-content {
  overflow-y: auto;
  padding: 20px;
}

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

.drawer-section h3 {
  margin: 0 0 12px;
  font-size: 12px;
}

.drawer-id-row {
  gap: 8px;
  margin-bottom: 14px;
}

.code-value {
  color: var(--fg-1);
  font-family: var(--mono);
  font-size: 10px;
  word-break: break-all;
}

.copy-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 10px;
}

.prompt-box,
.error-box,
.progress-box,
.metadata-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}

.prompt-box,
.error-box,
.progress-box {
  padding: 14px;
  color: var(--fg-1);
  font-size: 12px;
  line-height: 1.6;
}

.error-box {
  border-color: rgba(240, 122, 122, 0.28);
  background: var(--err-bg);
  color: #ffc1c1;
}

.progress-box strong,
.progress-box span {
  display: block;
}

.progress-box span {
  margin-top: 7px;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 10px;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
}

.metadata-item {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.metadata-item:nth-child(2n) {
  border-right: 0;
}

.metadata-item span,
.metadata-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metadata-item span {
  color: var(--fg-2);
  font-size: 9px;
  text-transform: uppercase;
}

.metadata-item strong {
  margin-top: 6px;
  color: var(--fg-1);
  font-family: var(--mono);
  font-size: 10px;
}

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

.artifact-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}

.artifact-card.master {
  grid-column: 1 / -1;
}

.artifact-preview {
  display: grid;
  width: 100%;
  min-height: 120px;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(45deg, #15191f 25%, transparent 25%),
    linear-gradient(-45deg, #15191f 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #15191f 75%),
    linear-gradient(-45deg, transparent 75%, #15191f 75%),
    #11141a;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-size: 12px 12px;
}

.artifact-card.master .artifact-preview {
  min-height: 260px;
}

.artifact-preview img,
.artifact-preview video {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.artifact-header {
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
}

.artifact-header span {
  overflow: hidden;
  color: var(--fg-1);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-header a {
  color: var(--accent-strong);
  font-size: 9px;
  text-decoration: none;
}

.lightbox {
  width: min(92vw, 1100px);
  max-height: 92vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
}

.lightbox img,
.lightbox video {
  display: block;
  width: 100%;
  max-height: 92vh;
  object-fit: contain;
}

.client-dialog {
  width: min(92vw, 680px);
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  box-shadow: var(--shadow);
  color: var(--fg-0);
}

.client-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.client-form {
  display: grid;
  max-height: 90vh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.dialog-body,
.secret-panel {
  overflow-y: auto;
  padding: 20px;
}

.dialog-body > label {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  color: var(--fg-1);
  font-size: 11px;
}

.dialog-body input[type="text"],
.dialog-body input[type="number"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}

.dialog-body input:disabled {
  color: var(--fg-2);
  cursor: not-allowed;
}

.dialog-body fieldset {
  padding: 0;
  border: 0;
}

.dialog-body legend {
  margin-bottom: 9px;
  color: var(--fg-1);
  font-size: 11px;
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.scope-option {
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  cursor: pointer;
}

.scope-option:has(input:checked) {
  border-color: rgba(117, 146, 255, 0.42);
  background: var(--accent-weak);
}

.scope-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.scope-option span,
.scope-option strong,
.scope-option small {
  display: block;
}

.scope-option strong {
  color: var(--fg-0);
  font-size: 10px;
}

.scope-option small {
  margin-top: 3px;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 8px;
}

.secret-panel h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.secret-value-row {
  gap: 8px;
  margin-top: 18px;
}

.secret-value-row code {
  min-width: 0;
  flex: 1;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(232, 187, 85, 0.35);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: #f8d98d;
  font-family: var(--mono);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  padding: 13px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
  color: var(--fg-1);
  font-size: 11px;
}

.toast[data-tone="error"] {
  border-color: rgba(240, 122, 122, 0.4);
  color: #ffc1c1;
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes view-in {
  from { transform: translateY(4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 1100px) {
  :root { --sidebar-width: 210px; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .client-list-head,
  .client-card { grid-template-columns: minmax(200px, 1.5fr) 80px minmax(180px, 1fr) auto; }
  .client-list-head span:nth-child(3),
  .client-list-head span:nth-child(5),
  .client-key,
  .client-last-used { display: none; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar {
    height: auto;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    padding: 10px 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-brand { padding: 0; border-bottom: 0; }
  .sidebar-brand .brand-mark { width: 32px; height: 32px; }
  .sidebar-brand span { display: none; }
  .sidebar-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0;
    border-top: 0;
  }
  .sidebar-footer .connection { display: none; }
  .sidebar-actions { display: flex; margin-top: 0; }
  .sidebar-actions .button { min-height: 32px; }
  .main-nav {
    display: flex;
    grid-column: 1 / -1;
    gap: 4px;
    margin-top: 9px;
    padding: 0 0 9px;
    overflow-x: auto;
  }
  .nav-item {
    display: flex;
    min-height: 38px;
    flex: 0 0 auto;
    padding: 0 11px;
  }
  .nav-icon { font-size: 14px; }
  .nav-count { min-width: 20px; }
  .content-header {
    position: static;
    min-height: 0;
    align-items: flex-start;
    padding: 22px 16px;
  }
  .content-header time { display: none; }
  .workspace { padding: 22px 14px 60px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .jobs-toolbar { align-items: stretch; flex-direction: column; }
  .filters { width: 100%; grid-template-columns: 1fr; }
  .filter-more-menu { position: static; width: 100%; margin-top: 6px; box-shadow: none; }
  .client-list-head { display: none; }
  .client-card { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .client-usage { grid-column: 1; }
  .client-card-actions { grid-column: 2; grid-row: 2; }
  .scope-grid { grid-template-columns: 1fr; }
  .secret-value-row { align-items: stretch; flex-direction: column; }
  th:nth-child(3), td:nth-child(3), th:nth-child(5), td:nth-child(5) { display: none; }
  th:nth-child(2) { width: auto; }
  .artifact-grid { grid-template-columns: repeat(2, 1fr); }
  .drawer { width: 100vw; }
}

@media (max-width: 480px) {
  .sidebar-actions .button { padding: 0 9px; }
  .nav-item { padding: 0 9px; font-size: 12px; }
  .metric-card { min-height: 84px; padding: 15px; }
  .metric-card strong { font-size: 21px; }
  .client-card-actions .button { min-height: 32px; padding: 0 9px; }
}

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