:root {
  --page-bg: #f3f5f8;
  --surface: #ffffff;
  --surface-hover: #fbfdff;
  --border: #dce3ec;
  --text: #15202b;
  --muted: #68758a;
  --link: #0058d8;
  --draft: #6a768c;
  --focus: rgba(0, 88, 216, 0.2);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page-bg);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(100% - 48px, 936px);
  margin: 0 auto;
  padding: 46px 0 18px;
}

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

h1 {
  color: #15202b;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

h2 {
  margin-top: 32px;
  font-size: 1.35rem;
}

h3 {
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f3f6fa;
}

small {
  color: var(--muted);
  font-size: inherit;
}

.page-kicker {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1.125rem;
  font-weight: 500;
}

.root-actions {
  margin-top: 14px;
  font-weight: 600;
}

.pull-request-list {
  display: grid;
  gap: 7px;
  margin-top: 38px;
}

.pull-request-card {
  position: relative;
  display: block;
  min-height: 124px;
  padding: 29px 96px 25px 24px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pull-request-card:hover {
  background: var(--surface-hover);
}

.pull-request-card:hover {
  text-decoration: none;
}

.pull-request-card h3 {
  color: var(--link);
}

.pull-request-number {
  color: var(--muted);
  font-weight: 650;
}

.pull-request-card .pull-request-number {
  color: inherit;
  font-size: 0.95rem;
  font-weight: 700;
}

.pull-request-card.is-draft h3 {
  color: var(--draft);
}

.pull-request-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.pull-request-avatar {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e4e9f1;
  color: var(--muted);
  font-size: 0.75rem;
  object-fit: cover;
}

.pull-request-separator {
  color: #8b95a5;
}

.draft-badge {
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  padding: 5px 10px;
  border: 1px solid #cbd3df;
  border-radius: 4px;
  color: var(--draft);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}

.notice-card,
article {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.service-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.status-badge {
  padding: 4px 9px;
  border: 1px solid #b9c4d3;
  border-radius: 999px;
  background: #eef3f8;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-healthy,
.status-running {
  border-color: #9bd0ad;
  background: #edf8f0;
  color: #166534;
}

.status-unhealthy,
.status-crashed {
  border-color: #f0b4ae;
  background: #fff1f0;
  color: #9f1d15;
}

.service-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.service-summary-list div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.service-summary-list dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.service-summary-list dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.service-error {
  margin-top: 12px;
  color: #9f1d15;
  font-weight: 600;
}

.service-logs {
  max-height: 260px;
}

.service-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.service-table th,
.service-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.service-table th {
  background: #f3f6fa;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

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

.usage-row-depth-0 {
  background: #f8fafc;
  font-weight: 700;
}

.usage-tree-node {
  position: relative;
  display: inline-block;
}

.usage-tree-node-depth-1 {
  margin-left: 24px;
}

.usage-tree-node-depth-2 {
  margin-left: 48px;
}

.usage-tree-node-depth-1::before,
.usage-tree-node-depth-2::before {
  position: absolute;
  top: 0.7em;
  width: 14px;
  height: 0.7em;
  border-bottom: 1px solid #b9c4d3;
  border-left: 1px solid #b9c4d3;
  content: "";
}

.usage-tree-node-depth-1::before {
  left: -24px;
}

.usage-tree-node-depth-2::before {
  left: -24px;
}

.usage-value {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  white-space: nowrap;
}

.usage-bar {
  display: block;
  width: 96px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9f1;
}

.usage-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #4a78c2;
}

button {
  padding: 8px 12px;
  border: 1px solid #0b4db0;
  border-radius: 5px;
  background: var(--link);
  color: white;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.review-shell {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 40px 0;
}

.review-shell-header {
  margin-bottom: 14px;
}

.review-back-link {
  font-weight: 600;
}

.review-page-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.review-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.review-header-copy {
  min-width: 0;
}

.review-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.review-title .pull-request-number {
  font-size: 0.72em;
  font-weight: 500;
}

.review-title-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.review-sha-badge,
.review-state-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

.review-sha-badge {
  border: 1px solid #d7dde8;
  background: #f6f8fb;
  color: #445066;
}

.review-state-badge {
  border: 1px solid #cfd7e3;
  background: #eff3f8;
  color: #526075;
}

.review-header-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
}

.review-github-link {
  font-weight: 600;
}

.review-stale-notice {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 20px 22px;
  border: 1px solid #f0d58a;
  border-radius: 5px;
  background: #fff8df;
}

.review-stale-title {
  margin: 0;
  font-size: 1rem;
}

.review-stale-copy {
  margin-top: 6px;
  color: #6c5500;
}

.review-stale-action {
  flex: 0 0 auto;
  font-weight: 600;
}

.review-section {
  margin-top: 32px;
}

.review-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

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

.review-service-grid-secondary {
  margin-top: 14px;
}

.review-service-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fbfcfe;
  color: inherit;
  text-decoration: none;
}

.review-service-card:hover {
  background: var(--surface);
  text-decoration: none;
}

.review-service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 5px;
  background: #eef3ff;
  color: #315eb6;
  font-weight: 700;
}

.review-service-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.review-service-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.review-service-description {
  color: var(--muted);
}

.review-service-host {
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f0f4fa;
  color: #506075;
  font-size: 0.85rem;
}

.review-service-chevron {
  color: #7a879b;
  font-size: 1.1rem;
}

.review-service-disclosure {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fafbfd;
}

.review-service-disclosure summary {
  cursor: pointer;
  font-weight: 600;
}

.review-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 20px;
  margin-top: 32px;
}

.review-info-card {
  margin-top: 0;
  padding: 24px;
  border-radius: 5px;
}

.review-empty-state {
  margin-top: 16px;
  color: var(--muted);
}

.review-details-list {
  display: grid;
  gap: 16px;
  margin: 16px 0 0;
}

.review-details-list div {
  min-width: 0;
}

.review-details-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.review-details-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.markdown-body {
  margin-top: 16px;
  color: var(--text);
}

.markdown-body :first-child {
  margin-top: 0;
}

.markdown-body :where(h1, h2, h3, h4) {
  margin: 1.5em 0 0.6em;
  font-size: 1.05rem;
  line-height: 1.3;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
  margin: 0 0 1em;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4em;
}

.markdown-body code {
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: #f3f6fa;
  font-size: 0.92em;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.markdown-body blockquote {
  padding-left: 14px;
  border-left: 3px solid #d9e0ea;
  color: var(--muted);
}

.markdown-body-fallback pre {
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .review-service-grid,
  .review-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 28px, 936px);
    padding-top: 28px;
  }

  h1 {
    font-size: 2rem;
  }

  .pull-request-list {
    margin-top: 28px;
  }

  .pull-request-card {
    min-height: 0;
    padding: 20px;
  }

  .draft-badge {
    position: static;
    display: inline-block;
    margin-top: 16px;
    transform: none;
  }

  .pull-request-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .review-shell {
    width: min(100% - 20px, 1120px);
    padding: 20px 0;
  }

  .review-page-card {
    padding: 20px;
    border-radius: 5px;
  }

  .review-header,
  .review-stale-notice {
    flex-direction: column;
  }

  .review-github-link,
  .review-stale-action {
    margin-top: 0;
  }
}
