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

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

h1 {
  font-size: clamp(2rem, 3vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.lead {
  margin-bottom: 2rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
}

.field.inline {
  margin-bottom: 0;
}

.field label {
  font-weight: 600;
}

.field input,
.field select {
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field.optional label::after {
  content: " (optional)";
  font-weight: normal;
  color: #64748b;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.srs-form {
  display: grid;
  gap: 0.75rem;
}

button[type="submit"] {
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

button[type="submit"]:hover {
  background-color: #1d4ed8;
}

button[type="submit"]:active {
  transform: translateY(1px);
}

.button-secondary {
  background: transparent;
  color: #1f2933;
  border: 1px solid rgba(148, 163, 184, 0.8);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.button-secondary:hover {
  background-color: rgba(148, 163, 184, 0.15);
  border-color: rgba(37, 99, 235, 0.5);
  color: #1d4ed8;
}

.button-secondary:active {
  transform: translateY(1px);
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.status-message {
  margin-top: 1.5rem;
  min-height: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.status-message.error {
  color: #dc2626;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.project-tools {
  margin-top: 2.5rem;
  display: grid;
  gap: 1rem;
}

.project-tools__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.project-tools .field {
  flex: 1 1 260px;
}

.filter-summary {
  margin: 0;
  color: #475569;
}

.project-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.06);
}

.project-card h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.project-card p {
  margin: 0.35rem 0;
  color: #475569;
  line-height: 1.4;
}

.section-lead {
  margin: 0.5rem 0 1.5rem;
  color: #475569;
  line-height: 1.6;
}

#srs-section {
  margin-top: 2.75rem;
}

.srs-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.empty-state {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px dashed rgba(148, 163, 184, 0.8);
  color: #475569;
  text-align: center;
}

.srs-card {
  margin-top: 1.5rem;
}

.srs-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.srs-card h4 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.05rem;
}

.srs-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 1rem 0 1.5rem;
  padding: 0;
}

.srs-meta dt {
  font-weight: 600;
  color: #1f2933;
}

.srs-meta dd {
  margin: 0;
  color: #475569;
}

.srs-html {
  margin-top: 1.25rem;
  line-height: 1.6;
  color: #1f2933;
}

.srs-html table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.srs-html th,
.srs-html td {
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.srs-html th {
  background-color: rgba(37, 99, 235, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    background-color: #0f172a;
    color: #e2e8f0;
  }

  .card,
  .project-card {
    background: #1e293b;
    border-color: rgba(226, 232, 240, 0.12);
    box-shadow: none;
  }

  .project-tools {
    background: rgba(15, 23, 42, 0.65);
  }

  .filter-summary {
    color: #cbd5f5;
  }

  .field input,
  .field select {
    background: #0f172a;
    color: inherit;
    border-color: rgba(148, 163, 184, 0.5);
  }

  button[type="submit"] {
    background-color: #3b82f6;
  }

  button[type="submit"]:hover {
    background-color: #2563eb;
  }

  .button-secondary {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.5);
  }

  .button-secondary:hover {
    background-color: rgba(148, 163, 184, 0.2);
    color: #93c5fd;
  }

  button[disabled] {
    opacity: 0.45;
  }

  .status-message {
    color: #e2e8f0;
  }

  .srs-meta dt {
    color: #e2e8f0;
  }

  .srs-meta dd,
  .srs-html {
    color: #cbd5f5;
  }

  .srs-html th,
  .srs-html td {
    border-color: rgba(148, 163, 184, 0.35);
  }

  .srs-html th {
    background-color: rgba(59, 130, 246, 0.15);
  }

  .empty-state {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.35);
    color: #cbd5f5;
  }
}
