:root {
  color-scheme: light;
  --page: #ffffff;
  --panel: #ffffff;
  --ink: #121612;
  --muted: #55615b;
  --rule: #dde3de;
  --control: #87938c;
  --blue: #0057b8;
  --teal: #08766b;
  --gold: #8a5a00;
  --red: #b42318;
  --violet: #6d4db0;
  --max: 1240px;
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  background: #ffffff;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  touch-action: manipulation;
}

a:hover {
  color: #003c7f;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #8fc2ff;
  outline-offset: 2px;
}

button,
input,
select {
  font: inherit;
}

button {
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--control);
  border-radius: var(--radius);
  cursor: pointer;
  min-height: 2.5rem;
  padding: 0.5rem 0.8rem;
  touch-action: manipulation;
}

button:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

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

input,
select {
  background: #ffffff;
  border: 1px solid var(--control);
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 2.5rem;
  padding: 0.45rem 0.65rem;
}

input::placeholder {
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 10;
  background: var(--ink);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
}

.skip-link:focus {
  top: 0.75rem;
}

.atlas-header {
  border-bottom: 1px solid var(--rule);
  background: #ffffff;
}

.header-inner {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max);
  min-height: 4.25rem;
  padding: 0.75rem 1.5rem;
}

.brand {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
  min-width: 15rem;
}

.brand a {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-id,
.mono,
code,
pre,
.table-id {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.brand-id {
  color: var(--muted);
  font-size: 0.8rem;
}

.main-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  justify-content: flex-end;
}

.main-nav a {
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.35rem 0.15rem;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.page-shell {
  margin: 0 auto;
  max-width: var(--max);
  padding: 2.2rem 1.5rem 4rem;
}

.page-heading {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.75rem;
  padding-bottom: 1.35rem;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  scroll-margin-top: 1rem;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: -0.035em;
  max-width: 44rem;
}

h2 {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.08rem;
  margin-bottom: 0.5rem;
}

p {
  max-width: 75ch;
  margin: 0.65rem 0;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  margin-top: 0.85rem;
}

.small,
small {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-line,
.label-row,
.page-actions,
.table-toolbar,
.pagination,
.download-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.8rem;
}

.status-line {
  margin-top: 1rem;
}

.tag,
.claim,
.state {
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  gap: 0.32rem;
  line-height: 1.2;
  padding: 0.3rem 0.58rem;
  white-space: nowrap;
}

.claim::before,
.state::before {
  content: "";
  background: currentColor;
  border-radius: 50%;
  display: inline-block;
  height: 0.45rem;
  width: 0.45rem;
}

.claim-observed,
.state-complete,
.state-executed,
.state-artifact-validated,
.state-scientifically-qualified,
.state-passed,
.state-promoted,
.state-promoted-by-recorded-decision {
  background: #eaf6f3;
  border-color: #94cec3;
  color: var(--teal);
}

.claim-inferred,
.state-in-progress,
.state-running,
.state-bound,
.state-visible {
  background: #fff7e6;
  border-color: #e6c47c;
  color: var(--gold);
}

.claim-proposed,
.state-pending,
.state-catalogued,
.state-plan-only {
  background: #f1edfb;
  border-color: #c7b9ea;
  color: var(--violet);
}

.claim-risk,
.state-blocked,
.state-failed {
  background: #fff0ee;
  border-color: #e5aba4;
  color: var(--red);
}

.state-skipped,
.state-not-applicable,
.state-not-recorded,
.claim-unknown {
  background: #f7f8f6;
  border-color: var(--rule);
  color: var(--muted);
}

.metrics {
  border-bottom: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  margin: 1.5rem 0 2rem;
}

.metric {
  border-right: 1px solid var(--rule);
  padding: 1rem 0.9rem 1.1rem;
}

.metric:first-child {
  padding-left: 0;
}

.metric:last-child {
  border-right: 0;
}

.metric dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.metric dd {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0.25rem 0 0;
}

.section {
  margin: 2.4rem 0;
}

.section-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.15rem;
}

.panel-white {
  background: #ffffff;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 1rem;
}

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

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

.field-list {
  display: grid;
  gap: 0.35rem 1.1rem;
  grid-template-columns: minmax(10rem, 0.75fr) minmax(0, 1.5fr);
  margin: 0;
}

.field-list dt {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.field-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.field-list dt,
.field-list dd {
  border-bottom: 1px solid var(--rule);
  padding: 0.42rem 0;
}

.table-wrap {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow-x: auto;
  background: #ffffff;
}

table {
  border-collapse: collapse;
  min-width: 42rem;
  width: 100%;
}

tbody tr {
  content-visibility: auto;
  contain-intrinsic-block-size: 3.5rem;
}

caption {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.75rem 0.9rem 0.2rem;
  text-align: left;
}

thead {
  background: #ffffff;
}

th,
td {
  border-bottom: 1px solid var(--rule);
  padding: 0.72rem 0.8rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

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

tbody tr:hover {
  background: #ffffff;
}

.table-id {
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.table-primary + .table-id,
.cell-detail,
.decision-detail,
.artifact-role {
  display: block;
  margin-top: 0.18rem;
}

.cell-detail,
.artifact-role {
  color: var(--muted);
  font-size: 0.88rem;
}

.table-primary {
  font-weight: 650;
}

.table-toolbar {
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.toolbar-field {
  align-items: center;
  display: flex;
  flex: 1 1 18rem;
  gap: 0.5rem;
}

.toolbar-field input {
  max-width: 28rem;
  width: 100%;
}

.toolbar-field label,
.toolbar-sort label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.toolbar-sort {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.pagination {
  justify-content: space-between;
  margin-top: 0.8rem;
}

.pagination-controls {
  display: flex;
  gap: 0.45rem;
}

.table-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  background: #ffffff;
  border: 1px dashed var(--control);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 1.2rem;
}

.empty-state strong {
  color: var(--ink);
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stage-item {
  align-items: start;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 4rem 1fr auto;
  padding: 0.72rem 0;
}

.stage-item:last-child {
  border-bottom: 0;
}

.stage-code {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.stage-name {
  font-weight: 650;
}

.stage-blocker {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.source-list,
.link-list {
  margin: 0;
  padding-left: 1.2rem;
}

.source-list li,
.link-list li {
  margin: 0.38rem 0;
  overflow-wrap: anywhere;
}

.source-list code,
.link-list code {
  font-size: 0.82rem;
}

.details {
  border-top: 1px solid var(--rule);
  margin-top: 1.1rem;
  padding-top: 0.8rem;
}

details summary {
  color: var(--blue);
  cursor: pointer;
  font-weight: 650;
}

pre {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 0.86rem;
  line-height: 1.45;
  max-height: 28rem;
  overflow: auto;
  padding: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.structure-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
}

.structure-visual {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #ffffff;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 0.65rem;
}

.structure-visual img {
  background: #ffffff;
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.structure-video {
  background: #ffffff;
  border-bottom: 1px solid var(--rule);
  padding: 0.65rem;
}

.structure-video video {
  background: #ffffff;
  display: block;
  max-height: 22rem;
  width: 100%;
}

.structure-placeholder {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  min-height: 10rem;
  padding: 1rem;
  text-align: center;
}

.structure-placeholder strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.structure-placeholder .placeholder-mark {
  border: 1px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  display: grid;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  height: 3.4rem;
  place-items: center;
  width: 3.4rem;
}

.structure-caption {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.95rem;
}

.structure-caption h3 {
  overflow-wrap: anywhere;
}

.structure-meta {
  color: var(--muted);
  display: grid;
  font-size: 0.88rem;
  gap: 0.22rem;
  grid-template-columns: auto 1fr;
}

.structure-meta dt {
  font-weight: 650;
}

.structure-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.opportunity {
  border-left: 3px solid var(--blue);
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0 0.9rem 1rem;
}

.opportunity:first-child {
  border-top: 0;
}

.opportunity-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.opportunity-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.18rem;
}

.sequence {
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.5;
  margin-top: 0.45rem;
  max-width: 28rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sequence-details,
.artifact-details {
  min-width: 10rem;
}

.sequence-details summary,
.artifact-details summary {
  white-space: nowrap;
}

.artifact-links {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}

.artifact-links li {
  margin: 0.35rem 0;
  overflow-wrap: anywhere;
}

.footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 auto;
  max-width: var(--max);
  padding: 1.25rem 1.5rem 2.5rem;
}

.print-only {
  display: none;
}

@media (max-width: 980px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: flex-start;
  }

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

  .metric:nth-child(3n) {
    border-right: 0;
  }

  .metric:nth-child(n + 4) {
    border-top: 1px solid var(--rule);
  }

  .structure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 1.6rem 1rem 3rem;
  }

  .header-inner,
  .footer {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .brand {
    min-width: 0;
  }

  .main-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
    width: 100%;
  }

  h1 {
    font-size: 2rem;
  }

  .metrics,
  .grid-2,
  .grid-3,
  .structure-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .metric:nth-child(3n) {
    border-right: 0;
    border-top: 1px solid var(--rule);
    padding-left: 0;
  }

  .metric:first-child {
    border-top: 0;
  }

  .field-list {
    grid-template-columns: 1fr;
  }

  .field-list dt {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .field-list dd {
    padding-top: 0;
  }

  .stage-item {
    grid-template-columns: 3rem 1fr;
  }

  .stage-item .state {
    grid-column: 2;
    justify-self: start;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-sort,
  .toolbar-field {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  html,
  body,
  .atlas-header,
  .page-shell,
  .footer,
  .panel,
  .table-wrap,
  .structure-card,
  .structure-visual,
  pre {
    background: #ffffff !important;
  }

  tbody tr[hidden] {
    display: table-row !important;
  }

  .atlas-header {
    position: static;
  }

  .main-nav,
  .table-toolbar,
  .pagination,
  .page-actions {
    display: none !important;
  }

  .page-shell {
    max-width: none;
    padding: 1rem 0;
  }

  .footer {
    padding-left: 0;
    padding-right: 0;
  }

  a {
    color: var(--ink);
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    overflow-wrap: anywhere;
  }

  .print-only {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
