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

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

.shell {
  width: min(68rem, calc(100% - 3rem));
  margin: 2.5rem auto;
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid #cad4cb;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 1.5rem 4rem rgb(29 42 35 / 10%);
}

.eyebrow {
  color: #4c6a58;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  margin: 0.4rem 0 1rem;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
}

p {
  line-height: 1.65;
}

a {
  color: #175c3a;
  font-weight: 650;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem max(1.5rem, calc((100% - 68rem) / 2));
  border-bottom: 1px solid #cad4cb;
  background: #fff;
}

.topbar nav,
.heading-row,
.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.heading-row {
  justify-content: space-between;
}

.brand {
  font-size: 1.05rem;
  text-decoration: none;
}

.user-label,
.muted,
.project-code {
  color: #647268;
}

.narrow {
  max-width: 32rem;
  margin: 0 auto;
}

.stacked-form {
  display: grid;
  gap: 1rem;
}

.stacked-form label {
  display: grid;
  gap: 0.4rem;
  font-weight: 650;
}

input,
textarea,
button {
  box-sizing: border-box;
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #aab9ae;
  border-radius: 0.5rem;
}

textarea {
  resize: vertical;
}

button,
.button {
  display: inline-block;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: #175c3a;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}

.secondary {
  background: #4c6a58;
}

.danger {
  background: #a72f2f;
}

.danger-link {
  color: #922a2a;
}

.link-button {
  padding: 0;
  background: transparent;
  color: #175c3a;
}

.inline-form {
  display: inline;
}

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

.project-card,
.placeholder,
.source-section,
.empty-state {
  padding: 1.4rem;
  border: 1px solid #d4ddd5;
  border-radius: 0.75rem;
  background: #f9fbf8;
}

.upload-form {
  max-width: 46rem;
  margin-bottom: 2rem;
}

fieldset {
  display: flex;
  gap: 1rem;
  padding: 0.8rem;
  border: 1px solid #d4ddd5;
  border-radius: 0.5rem;
}

.choice {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500 !important;
}

.choice input {
  width: auto;
}

.source-list {
  display: grid;
  gap: 0.75rem;
}

.source-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #d4ddd5;
  border-radius: 0.5rem;
}

.source-card p {
  margin: 0.25rem 0 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid #d4ddd5;
  text-align: left;
}

.delete-form {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #e4a3a3;
  border-radius: 0.5rem;
}

.analysis-notice {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #a9c4b2;
  border-radius: 0.5rem;
  background: #f3faf5;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.progress-grid article {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid #d4ddd5;
  border-radius: 0.5rem;
}

.progress-grid strong {
  font-size: 1.4rem;
}

.project-card h2,
.project-code {
  margin-top: 0;
}

.badge {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: #e0e9e2;
  font-size: 0.85rem;
  font-weight: 700;
}

.alert {
  padding: 0.75rem 1rem;
  border: 1px solid #e4a3a3;
  border-radius: 0.5rem;
  background: #fff1f1;
  color: #792323;
}

.description {
  white-space: pre-wrap;
}

@media (max-width: 44rem) {
  .topbar,
  .topbar nav {
    align-items: flex-start;
    flex-direction: column;
  }
}
