:root {
  --bg: #f7f8fb;
  --ink: #17212b;
  --muted: #5f6b7a;
  --line: #dce3ea;
  --panel: #ffffff;
  --accent: #087f8c;
  --accent-2: #c2410c;
  --good: #15803d;
  --warn: #a16207;
  --bad: #b91c1c;
  --shadow: 0 18px 45px rgba(23, 33, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: #101820;
  color: #eef5f6;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  font-size: 17px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #24a7a6, #f97316);
  display: inline-block;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  color: #c9d5dc;
  padding: 10px 12px;
  border-radius: 8px;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  display: grid;
  gap: 8px;
  color: #c9d5dc;
  line-height: 1.45;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 18px;
}

.main {
  margin-left: 260px;
  padding: 38px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-header.compact {
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-weight: 750;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
}

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

h1 {
  max-width: 840px;
  font-size: 42px;
  line-height: 1.05;
  margin-bottom: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 19px;
  margin-bottom: 14px;
}

.lede {
  color: var(--muted);
  line-height: 1.6;
  max-width: 760px;
  margin-top: 14px;
}

.button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 720;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.button.danger {
  color: var(--bad);
  border-color: #fecaca;
}

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

.user-box {
  display: grid;
  gap: 5px;
  color: #c9d5dc;
  font-size: 13px;
}

.user-box small {
  color: #93a4af;
}

.user-box a {
  color: #ffffff;
  font-weight: 720;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.metric,
.panel,
.empty,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 20px;
  display: grid;
  gap: 10px;
}

.metric span {
  color: var(--muted);
}

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

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-head a {
  color: var(--accent);
  font-weight: 720;
}

.tool-group {
  margin-bottom: 32px;
}

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

.tool-card {
  min-height: 204px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-card:hover {
  border-color: rgba(8, 127, 140, 0.5);
  transform: translateY(-1px);
}

.tool-card span,
.tool-card small {
  color: var(--muted);
}

.tool-card h3 {
  font-size: 21px;
  margin: 0;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.badges.mini {
  margin-top: -2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf6f7;
  color: #0f6f78;
  font-size: 11px;
  font-weight: 760;
}

.badge.new {
  background: #fff1e7;
  color: #b45309;
}

.badge.readiness.production_pass {
  background: #dcfce7;
  color: #166534;
}

.badge.readiness.production_blocked {
  background: #ffedd5;
  color: #9a3412;
}

.badge.readiness.smoke_pass {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.readiness.smoke_pending {
  background: #f1f5f9;
  color: #475569;
}

.badge.readiness.need_large_storage {
  background: #fef9c3;
  color: #854d0e;
}

.badge.readiness.need_code_links {
  background: #fee2e2;
  color: #991b1b;
}

.badge.readiness.needs_token_or_license {
  background: #ede9fe;
  color: #5b21b6;
}

.readiness-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.readiness-panel dl {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.readiness-panel dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.readiness-panel dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.readiness-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}

.search {
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 12px;
  font: inherit;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 22px;
}

.panel.muted {
  background: #fbfcfd;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
}

select {
  background: #ffffff;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

input[type="file"] {
  background: #fbfcfd;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 0;
}

.form-section legend {
  padding: 0 8px;
  font-weight: 780;
  color: var(--ink);
}

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

.field-textarea,
.field-file {
  grid-column: 1 / -1;
}

.field-checkbox {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.field-checkbox span {
  color: var(--ink);
}

.field small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

textarea,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

pre {
  overflow: auto;
  background: #111827;
  color: #eef5f6;
  border-radius: 8px;
  padding: 16px;
  line-height: 1.5;
}

ul {
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.table-wrap {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td a {
  color: var(--accent);
  font-weight: 730;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
  text-transform: capitalize;
  background: #e8edf1;
  color: #394756;
}

.status.running {
  color: #075985;
  background: #e0f2fe;
}

.status.completed {
  color: var(--good);
  background: #dcfce7;
}

.status.queued {
  color: var(--warn);
  background: #fef3c7;
}

.status.failed,
.status.stopped {
  color: var(--bad);
  background: #fee2e2;
}

.progress {
  height: 10px;
  background: #e9eef3;
  border-radius: 999px;
  overflow: hidden;
}

.progress.small {
  width: 130px;
  height: 8px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.job-title-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
}

dt {
  color: var(--muted);
  font-weight: 730;
}

dd {
  margin: 0;
}

.empty {
  padding: 34px;
  color: var(--muted);
}

.result-panel {
  margin-top: 18px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 30px;
}

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

.result-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.result-card strong {
  color: var(--accent);
}

.result-card span,
.result-card small {
  color: var(--muted);
}

.artifact-list a {
  color: var(--accent);
  font-weight: 720;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.artifact-actions {
  display: grid;
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

.artifact-actions li,
.artifact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.artifact-actions li {
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-message {
  color: var(--muted);
  min-height: 22px;
}

.exact-shell {
  display: grid;
  grid-template-columns: minmax(520px, 760px) 220px;
  gap: 32px;
  align-items: start;
  max-width: 1140px;
  margin: 0 auto;
}

.exact-main {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.back-button {
  margin-bottom: 28px;
}

.exact-header {
  text-align: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 18px;
}

.exact-header h1 {
  font-size: 24px;
  margin: 0 auto 12px;
}

.exact-header p {
  color: var(--muted);
}

.exact-badges {
  justify-content: center;
  margin-top: 0;
  margin-bottom: 12px;
}

.reference-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 4px;
}

.page-header .reference-links {
  justify-content: flex-start;
}

.reference-links a {
  color: #075f4d;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.backend-notice {
  grid-column: 1 / -1;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
}

.backend-notice.ok {
  color: var(--good);
  background: #dcfce7;
}

.backend-notice.warn {
  color: var(--warn);
  background: #fef3c7;
}

.auth-shell {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(440px, 100%);
}

.auth-panel h1 {
  font-size: 30px;
  margin-bottom: 18px;
}

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

.auth-error {
  color: var(--bad);
  font-weight: 700;
}

.auth-success {
  color: var(--good);
  font-weight: 700;
}

.auth-note,
.auth-help {
  color: var(--muted);
}

.auth-alt {
  margin-top: 16px;
  color: var(--muted);
}

.auth-alt a,
.auth-help a {
  color: var(--accent);
  font-weight: 720;
}

.tool-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 8px;
}

.tool-actions button,
.details-toggle,
.example-chip,
.outline-button,
.link-button,
.trash-button {
  border: 0;
  background: transparent;
  color: #075f4d;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.details-toggle {
  color: var(--muted);
  font-size: 12px;
}

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

.exact-job-name {
  max-width: 240px;
}

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

.examples span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.examples div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.example-chip {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #aebbc8;
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
}

.exact-section {
  display: grid;
  gap: 12px;
}

.section-title {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 12px 0 0;
  font: inherit;
  font-weight: 760;
  color: var(--ink);
}

.exact-section.collapsed .section-title::after {
  content: "⌄";
  float: right;
  color: var(--muted);
}

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

.molecule-card,
.exact-field,
.exact-checkbox {
  grid-column: 1 / -1;
}

.exact-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.exact-field input,
.exact-field select,
.exact-field textarea {
  background: #ffffff;
}

.molecule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.molecule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.molecule-toolbar select {
  width: 140px;
}

.stepper {
  display: inline-grid;
  grid-template-columns: 28px 46px 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.stepper button,
.stepper input {
  border: 0;
  min-height: 28px;
  text-align: center;
  padding: 0;
}

.chain-pill {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #ffffff;
}

.trash-button {
  color: var(--muted);
}

.molecule-footer,
.exact-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.outline-button {
  min-height: 38px;
  border: 1px solid #0f766e;
  border-radius: 7px;
  padding: 8px 12px;
}

.danger-text {
  color: #b91c1c;
  border-color: transparent;
}

.link-button {
  color: #0f766e;
}

.exact-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}

.exact-checkbox.compact {
  grid-column: auto;
}

.submit-strip {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-top: 16px;
}

.exact-submit {
  min-width: 140px;
}

.submit-note {
  color: var(--muted);
  font-style: italic;
  margin: 0;
}

.related-rail {
  display: grid;
  gap: 18px;
}

.related-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.related-card h3 {
  margin-bottom: 8px;
}

.related-card p {
  color: var(--muted);
  line-height: 1.45;
}

.related-card span {
  display: inline-flex;
  border: 1px solid #0f766e;
  color: #0f766e;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .main {
    margin-left: 0;
    padding: 24px;
  }

  .metrics,
  .tool-grid,
  .detail-layout,
  .exact-shell {
    grid-template-columns: 1fr;
  }

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

  .page-header {
    flex-direction: column;
  }

  h1 {
    font-size: 32px;
  }
}
