:root {
  color: #1e2528;
  background: #f4f5f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 22px;
}

.eyebrow {
  color: #607074;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  color: #182022;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  color: #182022;
  font-size: 17px;
  line-height: 1.2;
}

h3 {
  color: #202729;
  font-size: 14px;
  line-height: 1.35;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #ccd4cf;
  border-radius: 6px;
  color: #243033;
  background: #ffffff;
  cursor: pointer;
}

.icon-button:hover {
  border-color: #7f978c;
}

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

.summary-grid,
.main-grid,
.lane-grid {
  display: grid;
  gap: 14px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.main-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: 14px;
}

.lane-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.metric,
.panel,
.agent-lane,
.auth-panel {
  border: 1px solid #d8ded9;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 36px rgba(35, 41, 38, 0.05);
}

.metric {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  min-height: 118px;
  padding: 16px;
  border-left-width: 5px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: #172023;
  font-size: 18px;
  line-height: 1.22;
}

.metric p,
.lane-header p,
.state-item p,
.footer,
.muted {
  color: #5c696d;
  font-size: 13px;
  line-height: 1.45;
}

.metric-label {
  color: #667478;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  background: #eef3ef;
  color: #31594a;
}

.metric-icon svg {
  width: 20px;
  height: 20px;
}

.metric-healthy,
.metric-ready {
  border-left-color: #287a5b;
}

.metric-waiting {
  border-left-color: #b68522;
}

.metric-blocked,
.metric-invalid,
.metric-invalid-proof {
  border-left-color: #bd3f35;
}

.panel,
.agent-lane {
  min-width: 0;
  padding: 16px;
}

.panel-header,
.lane-header,
.state-top,
.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header {
  margin-bottom: 14px;
}

.lane-header {
  align-items: flex-start;
  margin-bottom: 12px;
}

.next-action {
  color: #1f2b2d;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.proof-list,
.item-list,
.checklist,
.warning-list,
.skeleton-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.proof-file {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #425053;
  font-size: 13px;
}

.proof-file svg {
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: #b68522;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e8e4;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: #287a5b;
}

.checklist,
.warning-list {
  padding: 0;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #4d5c60;
  font-size: 13px;
  line-height: 1.35;
}

.checklist svg {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: #b68522;
}

.checklist .done svg {
  color: #287a5b;
}

.state-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e4e8e3;
  border-radius: 6px;
  background: #fbfcfa;
}

.compact .state-item {
  padding: 10px;
}

.state-top span:last-child {
  color: #718084;
  font-size: 12px;
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: #415158;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  color: #263032;
  background: #eef0ec;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.status-healthy,
.status-ready {
  color: #15523a;
  background: #dff1e8;
}

.status-waiting {
  color: #6b4a04;
  background: #f5e8c7;
}

.status-blocked,
.status-invalid,
.status-invalid-proof {
  color: #7e241e;
  background: #f2d7d4;
}

.warning-list li {
  padding: 10px 12px;
  border-left: 4px solid #bd3f35;
  border-radius: 4px;
  color: #342625;
  background: #fff4f2;
  font-size: 13px;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 0 2px;
}

.footer span {
  padding: 5px 8px;
  border: 1px solid #d7ddd8;
  border-radius: 6px;
  background: #ffffff;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  display: grid;
  width: min(440px, 100%);
  gap: 14px;
  padding: 26px;
  text-align: center;
}

.auth-panel svg {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  color: #31594a;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 6px;
  color: #ffffff;
  background: #31594a;
  font-weight: 800;
  text-decoration: none;
}

.warning-text,
.error-banner {
  color: #7e241e;
}

.error-banner {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #e1a09a;
  border-radius: 6px;
  background: #fff4f2;
}

.loading-overlay {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #ffffff;
  background: #243033;
  font-size: 13px;
}

.skeleton-stack div {
  height: 18px;
  border-radius: 4px;
  background: #eef0ec;
}

@media (max-width: 1040px) {
  .summary-grid,
  .lane-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

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

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 26px;
  }

  .summary-grid,
  .lane-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: auto;
  }
}
