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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f7f9;
  color: #172033;
}

a {
  color: #0b5cab;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px clamp(16px, 5vw, 64px);
  background: #101820;
  color: #f7fafc;
}

.eyebrow {
  margin: 0 0 4px;
  color: #8fd6c2;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: 0;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

nav a {
  color: #f7fafc;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  text-decoration: none;
}

nav a[hidden],
.visual-diff-section[hidden] {
  display: none;
}

main {
  padding: 24px clamp(16px, 5vw, 64px) 56px;
}

@media (min-width: 1200px) {
  main {
    width: 60%;
    margin: 0 auto;
    padding-right: 0;
    padding-left: 0;
  }
}

.status-band {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #d7dde5;
}

.status-band div {
  min-width: 0;
  padding: 16px;
  background: #ffffff;
}

.label {
  display: block;
  margin-bottom: 6px;
  color: #687386;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

code {
  overflow-wrap: anywhere;
}

.section {
  margin-top: 24px;
  padding-top: 8px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.section-heading p {
  max-width: 560px;
  margin-bottom: 0;
  color: #596579;
}

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

article,
.viewer-shell,
.model-fallback {
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
}

article {
  overflow: hidden;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #e4e8ef;
}

.card-head h3,
.pdf-layout h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

iframe {
  width: 100%;
  height: 520px;
  border: 0;
  background: #ffffff;
}

.viewer-shell {
  height: min(760px, 78vh);
  overflow: hidden;
}

kicanvas-embed {
  display: block;
  width: 100%;
  height: 100%;
}

.download-grid {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.model-fallback {
  padding: 28px;
  min-height: 260px;
}

x3d-canvas {
  display: block;
  width: 100%;
  height: min(640px, 72vh);
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #eef2f7;
}

.model-actions {
  margin: 10px 0 0;
}

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

.board-card {
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 18px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
}

.board-card:hover,
.board-card:focus-visible {
  border-color: #0b5cab;
  outline: none;
}

.board-name {
  font-size: 1.1rem;
  font-weight: 800;
}

.board-path,
.board-meta {
  color: #596579;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

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

.download-grid a {
  padding: 14px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.section-compact {
  padding-top: 0;
}

.pdf-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
}

.pdf-links a {
  padding: 8px 10px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #f6f7f9;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

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

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-button {
  padding: 10px 12px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.tab-button:hover,
.tab-button:focus-visible,
.tab-button.is-active {
  border-color: #0b5cab;
  color: #0b5cab;
  outline: none;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.preview-panel {
  min-width: 0;
}

.diff-image-link {
  display: block;
  padding: 10px;
  background: #ffffff;
}

.diff-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #e4e8ef;
  background: #ffffff;
}

.empty-state {
  padding: 28px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #ffffff;
}

@media (max-width: 900px) {
  .topbar,
  .section-heading {
    display: block;
  }

  nav {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .status-band,
  .report-grid,
  .download-grid,
  .preview-status {
    grid-template-columns: 1fr;
  }

  iframe {
    height: 440px;
  }
}
