:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: #08090d;
  color: #f5f5f7;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top right, #1b1733, #08090d 48%);
}

.bootstrap-page {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 15vh 0 10vh;
}

.eyebrow {
  color: #b6a4ff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 680px;
  margin: 0 0 20px;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.lead {
  max-width: 620px;
  color: #b7bac4;
  font-size: 1.1rem;
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 48px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  padding: 0 18px;
  border: 1px solid #303442;
  color: #f5f5f7;
  text-decoration: none;
}

.button.primary {
  border-color: #8c6cff;
  background: #8c6cff;
}

.stack {
  display: grid;
  gap: 0;
  border-top: 1px solid #262936;
}

.stack div {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 0;
  border-bottom: 1px solid #262936;
}

dt { color: #8f94a1; }
dd { margin: 0; color: #f5f5f7; font-weight: 700; }

.flash {
  position: fixed;
  z-index: 10;
  top: 18px;
  right: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 12px 16px;
  border: 1px solid #4a426d;
  background: #151423;
  color: #e2ddff;
}

.auth-page,
.workspace-page {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 9vh 0 10vh;
}

.auth-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 32px;
  border: 1px solid #282d39;
  background: rgba(16, 19, 26, 0.92);
}

.auth-card h1,
.workspace-page h1 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
}

.auth-form {
  display: grid;
  gap: 18px;
  margin: 30px 0 18px;
}

.auth-form label {
  display: block;
  margin-bottom: 7px;
  color: #c9cbd3;
  font-size: 0.85rem;
  font-weight: 700;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid #303442;
  background: #0b0e13;
  color: #fff;
  font: inherit;
}

.auth-form input:focus {
  border-color: #8c6cff;
  outline: 2px solid rgba(140, 108, 255, 0.25);
}

.auth-form .button {
  justify-content: center;
  cursor: pointer;
  font: inherit;
}

.back-link { color: #b6a4ff; }

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

.workspace-header h1 { margin-bottom: 12px; }
.workspace-header .eyebrow { margin-bottom: 12px; }
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.header-actions .button { min-height: 40px; cursor: pointer; font: inherit; }

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

.panel {
  padding: 24px;
  border: 1px solid #282d39;
  background: rgba(16, 19, 26, 0.92);
}

.panel h2 { margin: 0 0 7px; font-size: 1.1rem; }
.muted { color: #8f94a1; line-height: 1.6; }
.member-list,
.audit-list { margin: 24px 0 0; padding: 0; list-style: none; }
.member-list li,
.audit-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 0;
  border-top: 1px solid #262936;
}
.member-list strong,
.audit-list strong { display: block; }
.member-list small,
.audit-list small { display: block; margin-top: 4px; color: #8f94a1; }
.role { color: #b6a4ff; font-size: 0.85rem; }
.audit-list.detailed li { align-items: start; }
.audit-list.detailed span { color: #c9cbd3; }
.audit-list.detailed small { margin-left: auto; text-align: right; }
.invite-form { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; margin-top: 20px; }
.invite-form input,
.invite-form select { min-height: 40px; box-sizing: border-box; padding: 0 10px; border: 1px solid #303442; background: #0b0e13; color: #fff; font: inherit; }
.invite-form .button { min-height: 40px; cursor: pointer; font: inherit; }
.panel h3 { margin: 28px 0 0; font-size: 0.9rem; }

@media (max-width: 700px) {
  .workspace-header { display: grid; }
  .workspace-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .audit-list.detailed li { display: grid; }
  .audit-list.detailed small { margin-left: 0; text-align: left; }
  .invite-form { grid-template-columns: 1fr; }
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
a, button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #c2b5ff; outline-offset: 3px; }
.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; }

.workspace-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 10px 0;
  border-bottom: 1px solid #282d39;
}
.workspace-nav-meta { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.workspace-switcher { position: relative; }
.workspace-switcher summary { display: grid; gap: 2px; min-width: 150px; padding: 7px 10px; border: 1px solid #303442; cursor: pointer; list-style: none; }
.workspace-switcher summary::-webkit-details-marker { display: none; }
.workspace-switcher summary::after { content: "⌄"; position: absolute; top: 9px; right: 9px; color: #b6a4ff; }
.workspace-switcher summary small { color: #8f94a1; }
.workspace-switcher ul { position: absolute; z-index: 3; min-width: 210px; margin: 5px 0 0; padding: 6px; border: 1px solid #4a426d; background: #10131a; list-style: none; }
.workspace-switcher li a { display: block; padding: 8px; color: #f5f5f7; text-decoration: none; }
.workspace-switcher li a:hover, .workspace-switcher li a:focus-visible { background: #201c39; }
.early-access-badge { color: #8f94a1; font-size: .72rem; white-space: nowrap; }
.workspace-nav .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.workspace-breadcrumbs { display: flex; align-items: center; gap: 6px; width: 100%; color: #8f94a1; font-size: .78rem; }
.workspace-breadcrumbs a { padding: 0; border: 0; color: #b6a4ff; }
.workspace-health { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; color: #8f94a1; font-size: .78rem; }
.health-summary { padding: 3px 7px; border: 1px solid #303442; color: #c9cbd3; }
.health-summary.status-healthy { border-color: #3c775e; color: #a7e3c1; }
.health-summary.status-blocked, .health-summary.status-unavailable { border-color: #8d4f60; color: #ffb8c6; }
.workspace-nav a {
  padding: 8px 11px;
  border: 1px solid transparent;
  color: #b7bac4;
  text-decoration: none;
}
.workspace-nav a:hover, .workspace-nav a:focus-visible { border-color: #4a426d; color: #fff; }
.nav-toggle { display: none; min-height: 40px; padding: 0 12px; border: 1px solid #303442; background: #10131a; color: #fff; cursor: pointer; }

.filter-form, .settings-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.filter-form > div, .settings-form > div { display: grid; gap: 6px; min-width: 150px; }
.filter-form label, .settings-form label { color: #c9cbd3; font-size: .85rem; font-weight: 700; }
.filter-form select, .filter-form input, .settings-form input[type="number"] {
  min-height: 40px; padding: 0 10px; border: 1px solid #303442; background: #0b0e13; color: #fff;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid > div { display: grid; gap: 6px; }
.form-grid label, .configuration-section label, .configuration-card label, .panel > form label { color: #c9cbd3; font-size: .85rem; font-weight: 700; }
.settings-form input:not([type="checkbox"]), .settings-form select, .settings-form textarea,
.configuration-card input:not([type="checkbox"]), .configuration-card select, .configuration-card textarea,
.panel > form input:not([type="checkbox"]), .panel > form select, .panel > form textarea {
  min-height: 40px; padding: 8px 10px; border: 1px solid #303442; background: #0b0e13; color: #fff;
}
.settings-form textarea, .configuration-card textarea, .panel > form textarea { min-height: 90px; resize: vertical; }
.settings-form { display: grid; align-items: start; }
.settings-form small { color: #8f94a1; line-height: 1.45; }
.check-row { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 8px !important; }
.check-row input { width: 18px; height: 18px; }
.configuration-card { margin-top: 16px; }
.configuration-card-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.configuration-card-header h3 { margin: 0; }
.configuration-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid #282d39; }
.compact-form { display: flex; align-items: end; }
.compact-form > div { min-width: 160px; }
.test-account-row { align-items: start; gap: 16px; }
.test-account-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px; }
.account-replace-form { display: flex; align-items: center; gap: 8px; }
.account-replace-form input { min-height: 36px; min-width: 190px; }
.data-table code { overflow-wrap: anywhere; color: #c9cbd3; font-size: .78rem; }
.empty-state { display: grid; gap: 6px; margin-top: 18px; padding: 24px; border: 1px dashed #4a426d; color: #c9cbd3; }
.empty-state span { color: #8f94a1; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 10px; border-top: 1px solid #282d39; text-align: left; vertical-align: top; }
.data-table th small { display: block; margin-top: 4px; color: #8f94a1; font-weight: 400; }
.text-link { color: #b6a4ff; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid #4a426d; color: #e2ddff; font-size: .8rem; font-weight: 700; }
.status-pill::before { content: "●"; font-size: .55rem; }
.status-completed, .status-published, .status-ready { border-color: #3c775e; color: #a7e3c1; }
.status-failed, .status-blocked, .status-gate_failed { border-color: #8d4f60; color: #ffb8c6; }
.status-queued, .status-planning, .status-exploring, .status-verifying { border-color: #8b6f35; color: #f2d69b; }
.mission-details { display: grid; grid-template-columns: minmax(130px, .8fr) 1fr; gap: 10px 16px; }
.mission-details dt { color: #8f94a1; }
.mission-details dd { margin: 0; color: #f5f5f7; font-weight: 700; }
.evidence-video-wrap { display: block; max-width: 640px; margin-top: 10px; }
.evidence-video { display: block; width: 100%; max-width: 640px; background: #000; }
.evidence-video-wrap small { display: block; margin-top: 6px; color: #8f94a1; }

@media (max-width: 700px) {
  .workspace-page { width: min(100% - 28px, 1080px); padding-top: 5vh; }
  .workspace-nav { display: block; }
  .workspace-nav-meta { justify-content: space-between; margin-bottom: 10px; }
  .workspace-switcher summary { min-width: 190px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .workspace-nav .nav-links { display: none; padding-top: 8px; }
  .workspace-nav[data-open] .nav-links { display: grid; }
  .workspace-nav a { display: block; }
  .workspace-breadcrumbs { margin: 4px 0 5px; }
  .workspace-health { margin: 12px 0 0; }
  .filter-form > div { min-width: min(100%, 220px); flex: 1 1 180px; }
  .filter-form .button { width: 100%; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .configuration-card-header { display: grid; }
  .compact-form { display: grid; align-items: start; }
  .test-account-row, .test-account-controls, .account-replace-form { align-items: start; justify-content: start; }
  .test-account-controls { display: grid; }
  .account-replace-form { display: grid; }
  .mission-details { grid-template-columns: 1fr; }
}

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