:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f2;
  --ink: #172026;
  --muted: #60707d;
  --soft: #d9e2e4;
  --line: #d8e1e4;
  --teal: #0b7f79;
  --teal-soft: #d8f1ee;
  --blue: #2364aa;
  --blue-soft: #dfeafa;
  --amber: #a86505;
  --amber-soft: #fff0d5;
  --rose: #b64a5d;
  --rose-soft: #fde2e6;
  --green: #4c7f2e;
  --green-soft: #e4f1da;
  --purple: #6d5aa7;
  --shadow: 0 20px 60px rgba(26, 43, 54, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

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

button {
  color: inherit;
}

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

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.auth-screen {
  grid-column: 1 / -1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef3f2;
}

.auth-shell {
  width: min(1040px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-intro {
  min-width: 0;
  padding: 30px;
  background: #101b22;
  color: #f6fbfc;
  display: grid;
  align-content: space-between;
  gap: 28px;
}

.auth-card {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 20px;
  padding: clamp(24px, 6vw, 54px);
  background: var(--surface);
}

.auth-brand {
  color: inherit;
}

.auth-brand small {
  color: #aab9c0;
}

.auth-title {
  display: grid;
  gap: 10px;
}

.auth-title .eyebrow {
  color: #aab9c0;
}

.auth-title h1 {
  font-size: 42px;
  line-height: 1;
}

.auth-title p {
  max-width: 380px;
  color: #c5d2d7;
}

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

.auth-status-list span {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dce7ea;
}

.auth-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.login-hints {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

.login-hints summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.login-hints span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.security-note {
  color: var(--muted);
  font-size: 13px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: #101b22;
  color: #f6fbfc;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.brand strong,
.project-card strong {
  display: block;
}

.brand small,
.project-card small {
  color: #aab9c0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  border-radius: var(--radius);
  flex: 0 0 auto;
}

.project-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
}

.project-switcher {
  margin-top: 10px;
  min-height: 34px;
  color: #f6fbfc;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.project-card > span,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.project-card .eyebrow,
.project-card > span {
  color: #aab9c0;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-list button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #c9d4d8;
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
}

.nav-list button:hover,
.nav-list button.active {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.svg-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.svg-icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.standalone-main {
  grid-column: 1 / -1;
  min-height: 100vh;
  background: var(--bg);
}

.topbar {
  min-height: 82px;
  padding: 18px 26px;
  background: rgba(245, 247, 248, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

h1 {
  font-size: 26px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

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

.metric-chip,
.cost-range,
.score,
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.cost-range {
  background: var(--amber-soft);
  color: #6d4304;
  border-color: #f4cf8e;
}

.score {
  background: var(--blue-soft);
  color: #123c70;
}

.badge-public,
.validation-human,
.status-succeeded,
.badge-authorized {
  background: var(--teal-soft);
  color: #075b56;
  border-color: #a5d8d1;
}

.badge-estimated,
.status-retrying,
.status-queued,
.validation-needs_review {
  background: var(--amber-soft);
  color: #794a04;
  border-color: #edca8b;
}

.badge-derived,
.validation-ai,
.status-running,
.status-active {
  background: var(--blue-soft);
  color: #163d6d;
  border-color: #bdd0ef;
}

.status-failed,
.status-cancelled {
  background: var(--rose-soft);
  color: #8b293a;
  border-color: #f2bcc6;
}

.status-idle {
  background: var(--green-soft);
  color: #315f19;
  border-color: #bdd9ae;
}

.icon-button,
.primary-button,
.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.icon-button:hover,
.secondary-button:hover {
  border-color: #aab9c0;
  background: #f8fafb;
}

.icon-button.danger:hover {
  background: var(--rose-soft);
  border-color: #efb4c0;
  color: #8b293a;
}

.primary-button {
  background: #10242d;
  border-color: #10242d;
  color: #ffffff;
  font-weight: 800;
}

.primary-button:hover {
  background: #183742;
}

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

.secondary-button {
  color: #1e313a;
  font-weight: 700;
}

.view {
  padding: 24px 26px 36px;
}

.dashboard-grid,
.jobs-layout,
.settings-layout,
.admin-layout,
.project-platform,
.env-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.kpi-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  min-height: 112px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  align-content: space-between;
}

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

.kpi strong {
  display: block;
  font-size: 27px;
  line-height: 1.15;
}

.kpi-teal {
  border-top: 4px solid var(--teal);
}

.kpi-blue {
  border-top: 4px solid var(--blue);
}

.kpi-amber {
  border-top: 4px solid var(--amber);
}

.kpi-rose {
  border-top: 4px solid var(--rose);
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel.wide,
.pilot-panel,
.explorer-panel,
.chat-panel {
  grid-column: 1 / -1;
}

.is-disabled {
  opacity: 0.68;
}

.is-disabled input,
.is-disabled select,
.is-disabled textarea {
  background: #f4f6f7;
}

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

.pilot-form,
.import-form,
.access-form,
.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 1.4fr) repeat(3, minmax(120px, 0.8fr)) auto;
  gap: 10px;
  align-items: end;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  padding: 8px 10px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 100, 170, 0.14);
}

.estimate-strip,
.import-help,
.mini-metrics,
.score-row,
.media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.estimate-strip,
.import-help {
  margin-top: 12px;
}

.estimate-strip span,
.import-help span,
.mini-metrics span,
.score-row span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #f9fbfb;
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.import-form {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.65fr) auto;
}

.access-form {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(160px, 0.7fr) auto;
}

.file-picker input {
  padding: 6px;
}

.import-help {
  align-items: center;
  justify-content: space-between;
}

.import-help strong {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  background: var(--green-soft);
  border: 1px solid #c6ddb8;
  color: #375f20;
  padding: 0 10px;
  font-size: 12px;
}

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) 74px;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.bar-row:hover .bar-label {
  color: var(--blue);
}

.bar-label {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf2f4;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.timeline-bars {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 10px;
  align-items: end;
}

.timeline-day {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr 38px;
  align-items: end;
  gap: 8px;
}

.timeline-day span {
  display: block;
  width: 100%;
  min-height: 10px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #efb35d, #2f7f86);
}

.timeline-day small {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.compact-list,
.alert-list,
.thread-list,
.job-list,
.run-list {
  display: grid;
  gap: 10px;
}

.reel-list-item {
  min-height: 64px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: #fbfcfc;
  border-radius: var(--radius);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.reel-list-item:hover,
.source-list button:hover {
  border-color: #a8c2c7;
  background: #f6fafb;
}

.reel-list-item strong,
.table-reel strong,
.source-list strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reel-list-item small,
.table-reel small,
.source-list small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-row,
.empty-state {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 10px;
  color: var(--muted);
}

.search-field {
  position: relative;
  display: block;
}

.search-field .svg-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-field input {
  padding-left: 36px;
}

.filter-bar {
  grid-template-columns: minmax(240px, 1.4fr) repeat(4, minmax(150px, 1fr));
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7fafb;
  color: var(--muted);
  font-size: 12px;
}

.data-table th button {
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: #f7fbfb;
}

.table-reel {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  background: #eef3f2;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 5px;
}

.reel-cover {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #dce8eb;
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.cover-large {
  min-height: 330px;
}

.cover-small {
  width: 58px;
  height: 48px;
}

.cover-tiny {
  width: 44px;
  height: 38px;
}

.cover-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.7;
}

.cover-content {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  gap: 4px;
  padding: 16px;
  background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.42));
}

.cover-content span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.cover-content strong {
  font-size: 28px;
  line-height: 1;
}

.cover-small .cover-content,
.cover-tiny .cover-content {
  padding: 6px;
}

.cover-small .cover-content span,
.cover-tiny .cover-content span {
  display: none;
}

.cover-small .cover-content strong,
.cover-tiny .cover-content strong {
  font-size: 12px;
}

.cover-mint {
  background: linear-gradient(135deg, #0b7f79, #63b39f);
}

.cover-rose {
  background: linear-gradient(135deg, #9e3850, #e47775);
}

.cover-amber {
  background: linear-gradient(135deg, #a86505, #e8ad55);
}

.cover-indigo {
  background: linear-gradient(135deg, #284a78, #6d78b5);
}

.cover-slate {
  background: linear-gradient(135deg, #24323a, #67818a);
}

.cover-blue {
  background: linear-gradient(135deg, #2364aa, #6db1d8);
}

.cover-green {
  background: linear-gradient(135deg, #4c7f2e, #9cbd5e);
}

.cover-coral {
  background: linear-gradient(135deg, #b64a5d, #ef895f);
}

.cover-purple {
  background: linear-gradient(135deg, #6d5aa7, #4f94b1);
}

.cover-sand {
  background: linear-gradient(135deg, #7a6b4a, #cda75d);
}

.cover-teal {
  background: linear-gradient(135deg, #0f6f75, #5ba9a1);
}

.cover-lime {
  background: linear-gradient(135deg, #557a2c, #c6b84e);
}

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

.detail-main {
  min-height: 330px;
}

.media-panel {
  display: grid;
  gap: 12px;
}

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

.metric-grid .kpi {
  min-height: 96px;
  box-shadow: none;
}

.metric-grid .kpi strong {
  font-size: 22px;
}

.snapshot-card {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.snapshot-card small {
  display: block;
  color: var(--muted);
}

.sparkline {
  width: 100%;
  height: 48px;
}

.sparkline polyline {
  fill: none;
  stroke: var(--teal);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.two-column article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 12px;
}

.segment-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.segment-list span {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.analysis-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.analysis-list div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
}

.analysis-list dt {
  color: var(--muted);
  font-weight: 800;
}

.analysis-list dd {
  margin: 0;
}

.stack-form {
  display: grid;
  gap: 12px;
}

.check-row {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  font-size: 14px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.thread-item,
.job-row,
.run-card,
.analytics-card,
.cluster-card,
.debate-card,
.permission-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 12px;
}

.thread-item header,
.run-card header,
.analytics-card header,
.cluster-card header,
.debate-card header,
.permission-card header,
.job-row,
.source-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.thread-item p,
.debate-card p,
.cluster-card p,
.run-card p {
  margin: 8px 0;
  color: #3f5059;
}

.thread-item small {
  color: var(--muted);
}

.analytics-grid,
.cluster-grid,
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.project-overview-card {
  width: 100%;
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.project-overview-card:hover,
.project-overview-card.active {
  border-color: #91b9c2;
  background: #f3f9fa;
}

.project-overview-card header,
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-overview-card strong,
.member-row strong {
  display: block;
}

.project-overview-card small,
.member-row small,
.form-status {
  color: var(--muted);
}

.project-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-card-metrics span {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 7px 8px;
  color: var(--muted);
}

.project-card-metrics b {
  display: block;
  color: var(--ink);
}

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

.project-options-grid .primary-button {
  grid-column: 1 / -1;
}

.member-management {
  display: grid;
  gap: 14px;
}

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

.member-row {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 9px 10px;
}

.member-row > div {
  min-width: 0;
}

.member-row > span:not(.member-lock) {
  min-width: 78px;
  color: var(--ink);
  font-weight: 800;
}

.member-lock {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-status {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13px;
}

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

.deploy-card {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 6px;
}

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

.deploy-card strong {
  overflow-wrap: anywhere;
}

.deploy-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 10px;
}

.deploy-log {
  max-height: 260px;
  min-height: 120px;
}

.setup-progress {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin: 12px 0;
}

.setup-progress span {
  display: block;
  height: 100%;
  background: var(--teal);
}

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

.setup-steps button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  padding: 8px;
  cursor: pointer;
}

.setup-steps button.active {
  border-color: #91b9c2;
  background: #f3f9fa;
}

.setup-steps b {
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: #10242d;
  color: #ffffff;
  flex: 0 0 26px;
}

.setup-steps span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

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

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

.env-field small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.env-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.analytics-card,
.cluster-card,
.permission-card {
  display: grid;
  gap: 12px;
}

.permission-card small {
  display: block;
  color: var(--muted);
}

.access-list {
  display: grid;
  gap: 6px;
}

.access-list span {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 6px 8px;
  color: var(--muted);
}

.access-list b {
  color: var(--ink);
}

.analytics-card header strong,
.cluster-card header strong {
  font-size: 24px;
}

.debate-board {
  display: grid;
  gap: 12px;
}

.debate-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

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

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.job-row small {
  display: block;
  color: var(--muted);
  margin: 3px 0 8px;
}

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

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

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

.chat-panel {
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
}

.chat-log {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
  padding: 12px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
}

.chat-message {
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 12px;
  white-space: pre-line;
}

.chat-message.user {
  justify-self: end;
  background: #10242d;
  color: #ffffff;
  border-color: #10242d;
}

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.source-list button {
  min-height: 54px;
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcfc;
  border-radius: var(--radius);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

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

.threshold-grid article {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 12px;
  display: grid;
  align-content: space-between;
}

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

.threshold-grid strong {
  font-size: 24px;
}

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

.provider-grid article {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfc;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.provider-grid strong {
  font-size: 18px;
}

.provider-grid p,
.provider-grid small {
  margin: 0;
  color: var(--muted);
}

.code-block {
  margin: 0;
  overflow: auto;
  min-height: 116px;
  border: 1px solid var(--line);
  background: #101b22;
  color: #f5fbfc;
  border-radius: var(--radius);
  padding: 14px;
}

@media (max-width: 1180px) {
  #app {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .sidebar {
    padding: 12px;
  }

  .brand div,
  .project-card,
  .nav-list span {
    display: none;
  }

  .brand {
    justify-content: center;
  }

  .nav-list button {
    justify-content: center;
    padding: 0;
  }

  .pilot-form,
  .import-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pilot-form .primary-button,
  .import-form .primary-button {
    grid-column: 1 / -1;
  }

  .kpi-grid,
  .metric-grid,
  .analytics-grid,
  .cluster-grid,
  .permissions-grid,
  .project-card-grid,
  .deploy-grid,
  .setup-steps,
  .env-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .cover-large {
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  #app {
    display: block;
  }

  .auth-screen {
    padding: 14px;
    place-items: stretch;
  }

  .auth-shell {
    min-height: calc(100vh - 28px);
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 260px;
    padding: 22px;
  }

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

  .auth-title h1 {
    font-size: 34px;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .brand {
    flex: 0 0 auto;
  }

  .nav-list {
    display: flex;
    gap: 4px;
  }

  .nav-list button {
    width: 42px;
    flex: 0 0 42px;
  }

  .topbar {
    position: static;
    display: grid;
    align-items: start;
    padding: 16px;
  }

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

  .view {
    padding: 16px;
  }

  .dashboard-grid,
  .jobs-layout,
  .settings-layout,
  .admin-layout,
  .project-platform,
  .env-layout,
  .kpi-grid,
  .metric-grid,
  .two-column,
  .analytics-grid,
  .cluster-grid,
  .permissions-grid,
  .project-card-grid,
  .project-options-grid,
  .deploy-grid,
  .setup-steps,
  .env-field-grid,
  .filter-bar,
  .import-form,
  .access-form,
  .pilot-form,
  .snapshot-card,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .job-row,
  .debate-card {
    display: grid;
  }

  .job-meta,
  .media-actions {
    justify-content: start;
  }

  .timeline-bars {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bar-row {
    grid-template-columns: minmax(0, 1fr) 90px;
  }

  .bar-track {
    grid-column: 1 / -1;
    order: 3;
  }
}
