:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-muted: #eef2ec;
  --ink: #18211c;
  --muted: #5a665f;
  --line: #d9ded7;
  --accent: #19675d;
  --accent-strong: #124b44;
  --accent-soft: #dcefed;
  --warn-soft: #f5e8cf;
  --shadow: 0 12px 36px rgba(24, 33, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: end;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
  letter-spacing: 0;
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search button,
.primary-link {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  padding: 0 18px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search button:hover,
.primary-link:hover {
  background: var(--accent-strong);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 16px;
  color: var(--muted);
}

.status-row p {
  margin: 0;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  padding: 8px 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 22px;
  align-items: start;
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-card {
  width: 100%;
  min-height: 154px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  padding: 18px;
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.project-card:hover,
.project-card:focus-visible,
.project-card.is-selected {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  outline: none;
}

.card-select {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
}

.project-card h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.card-document-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.card-document-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.card-meta,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.card-meta {
  margin-bottom: 14px;
}

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.86rem;
  line-height: 1.2;
  white-space: normal;
}

.pill {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.chip {
  background: var(--surface-muted);
  color: var(--muted);
}

.detail-panel {
  position: sticky;
  top: 18px;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.detail-panel h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.detail-panel p {
  margin: 0 0 14px;
}

.detail-placeholder,
.empty-state,
.error-state {
  color: var(--muted);
}

.error-state {
  padding: 16px;
  border-radius: 8px;
  background: var(--warn-soft);
}

.detail-facts {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.detail-facts li {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
}

.detail-facts span:first-child {
  color: var(--muted);
}

.document-row {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 680px);
    padding-top: 22px;
  }

  .topbar,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 480px) {
  .search {
    grid-template-columns: 1fr;
  }

  .search button {
    width: 100%;
  }

  .project-card {
    padding: 16px;
  }

  .detail-facts li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
