:root {
  color-scheme: light;
  --accent: #27bfdc;
  --accent-dark: #1489a0;
  --ink: #16242d;
  --muted: #5d717b;
  --line: #d8e7eb;
  --panel: #ffffff;
  --panel-soft: #f7fbfc;
  --page: #f1f7f9;
  --ok: #257a57;
  --warn: #9c6415;
  --risk: #b73535;
  --shadow: 0 14px 36px rgba(22, 36, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.68;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f3f8fa;
  font-size: 0.92em;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 40px;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 30px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 860px;
  margin-bottom: 12px;
  font-size: clamp(2.15rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.28rem;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.header-copy {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.header-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  min-width: min(100%, 350px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid rgba(39, 191, 220, 0.35);
  border-radius: 999px;
  background: rgba(39, 191, 220, 0.14);
  color: #0f6778;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.muted {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.last-updated {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.dashboard {
  display: grid;
  gap: 22px;
}

.section {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.section-header p {
  max-width: 810px;
  margin-bottom: 0;
  color: var(--muted);
}

.section-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #f5fcfe;
  color: #31505b;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.metric,
.item-card,
.gap-card,
.notice-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.metric span,
.meta-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.12rem;
  line-height: 1.35;
}

.metric p,
.item-card p,
.gap-card p,
.notice-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.item-card ul,
.gap-card ul,
.notice-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.item-card li,
.gap-card li,
.notice-card li {
  margin: 6px 0;
}

.status-tag,
.priority-tag {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 800;
}

.status-tag.done {
  color: var(--ok);
}

.status-tag.progress,
.status-tag.preview {
  color: var(--accent-dark);
}

.status-tag.needs-work {
  color: var(--warn);
}

.status-tag.risk {
  color: var(--risk);
}

.priority-p0 {
  border-color: rgba(183, 53, 53, 0.28);
  background: #fff7f7;
}

.priority-p0 .priority-tag {
  color: var(--risk);
}

.priority-p1 {
  border-color: rgba(156, 100, 21, 0.28);
  background: #fffaf2;
}

.priority-p1 .priority-tag {
  color: var(--warn);
}

.priority-p2 {
  border-color: rgba(39, 191, 220, 0.28);
  background: #f4fcfe;
}

.priority-p2 .priority-tag {
  color: var(--accent-dark);
}

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

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.94rem;
}

th {
  background: #f0f8fa;
  color: #344650;
  font-size: 0.78rem;
  text-transform: uppercase;
}

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

.score {
  display: grid;
  gap: 5px;
  min-width: 130px;
}

.score-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eef1;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.safety {
  border-color: rgba(39, 191, 220, 0.4);
  background: #f3fcfe;
}

.error {
  border-color: rgba(183, 53, 53, 0.35);
  background: #fff7f7;
}

.loading-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.site-footer {
  margin-top: 24px;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .header-status {
    justify-content: flex-start;
  }

  .last-updated {
    text-align: left;
  }

  .overview-grid,
  .phase-grid,
  .agent-grid,
  .checklist-grid,
  .gap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 14px;
  }

  .site-header {
    gap: 16px;
    padding-top: 18px;
  }

  h1 {
    font-size: 2.05rem;
  }

  .section {
    padding: 15px;
  }

  .section-header {
    display: block;
  }

  .overview-grid,
  .phase-grid,
  .agent-grid,
  .checklist-grid,
  .gap-grid {
    grid-template-columns: 1fr;
  }
}
