:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f4;
  color: #202427;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button,
input {
  min-height: 42px;
  border: 1px solid #c9cec8;
  border-radius: 6px;
  background: #ffffff;
  color: #202427;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #d7dbd4;
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #64706d;
  font-size: 0.86rem;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.05rem;
}

.top-actions,
.toolbar,
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.health,
.meta,
.auth-user {
  color: #59635f;
  font-size: 0.92rem;
}

.auth-user {
  border: 1px solid #d7dbd4;
  border-radius: 6px;
  background: #ffffff;
  padding: 10px 12px;
  color: #202427;
}

.logout-button,
.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.logout-button {
  border-color: #ad332b;
  background: #ad332b;
  color: #ffffff;
}

.toolbar {
  margin: 22px 0;
  align-items: end;
}

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

.field span {
  color: #47514e;
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  padding: 0 12px;
}

.model-field {
  flex: 1 1 280px;
}

.primary {
  border-color: #202427;
  background: #202427;
  color: #ffffff;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.ops-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.model-summary,
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-pill {
  border: 1px solid #d7dbd4;
  border-radius: 999px;
  background: #ffffff;
  color: #47514e;
  padding: 7px 10px;
  font-size: 0.86rem;
}

.category-tab {
  min-height: 36px;
  border-color: #d7dbd4;
  background: #ffffff;
  color: #37413e;
}

.category-tab.active {
  border-color: #202427;
  background: #202427;
  color: #ffffff;
}

.model-card,
.side-panel {
  border: 1px solid #d7dbd4;
  border-radius: 8px;
  background: #ffffff;
}

.model-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.model-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.model-name {
  font-weight: 700;
}

.model-id,
.endpoint-path {
  overflow-wrap: anywhere;
  color: #59635f;
  font-size: 0.88rem;
}

.description {
  color: #37413e;
  line-height: 1.45;
}

.badges,
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge,
.fact,
.method {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.78rem;
}

.badge {
  background: #e7f0ea;
  color: #1f6142;
}

.badge.missing {
  background: #f5e9e2;
  color: #8b3f18;
}

.fact,
.method {
  background: #eff1ee;
  color: #47514e;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.danger {
  border-color: #ad332b;
  color: #ad332b;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.side-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

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

.endpoint {
  display: grid;
  gap: 6px;
  border-top: 1px solid #edf0ea;
  padding-top: 10px;
}

.endpoint:first-child {
  border-top: 0;
  padding-top: 0;
}

.endpoint-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.endpoint p {
  color: #47514e;
  line-height: 1.4;
}

.download-state:empty {
  display: none;
}

.download-box {
  display: grid;
  gap: 8px;
  border: 1px solid #d7dbd4;
  border-radius: 6px;
  background: #f8faf7;
  padding: 10px;
}

.job-card.running .method,
.job-card.queued .method,
.job-card.canceling .method {
  background: #dcebe4;
  color: #1f6142;
}

.job-card.failed .method,
.job-card.canceled .method,
.job-card.interrupted .method {
  background: #f5e9e2;
  color: #8b3f18;
}

.progress-track {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e2e6df;
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: #202427;
  transition: width 180ms ease;
}

.progress-track.indeterminate span {
  animation: progress-slide 1.15s ease-in-out infinite;
}

.job-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #c9cec8;
  border-top-color: #202427;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes progress-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(240%);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .progress-track span,
  .progress-track.indeterminate span,
  .spinner {
    animation: none;
    transition: none;
  }
}

.meta {
  min-height: 24px;
  margin-top: 14px;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .ops-layout {
    grid-template-columns: 1fr;
  }
}
