:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --ink: #1f2928;
  --muted: #65706d;
  --line: #d7ded8;
  --surface: #ffffff;
  --surface-soft: #eef5f1;
  --teal: #126b63;
  --teal-dark: #0c5049;
  --gold: #bd8326;
  --shadow: 0 14px 30px rgba(31, 41, 40, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.2rem;
}

.brand small {
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

nav a,
.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
}

nav a.active,
.button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.button.secondary {
  background: transparent;
  color: var(--teal-dark);
}

.button.danger {
  border-color: #a33a2e;
  background: #a33a2e;
  color: #fff;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero,
.page-header {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 42px);
}

.hero h1,
.page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
}

.hero p,
.page-header p,
.card p,
.qa-panel p,
footer {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.case-link-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.case-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.case-link-row form {
  display: flex;
}

.case-link {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
}

.case-link span {
  color: var(--teal-dark);
  font-weight: 900;
}

.case-link small {
  color: var(--muted);
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
  padding-left: 20px;
}

.checklist li {
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.grid,
.qa-grid,
.details-grid,
.workspace-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.qa-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.details-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.qa-panel,
.form-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card h2,
.qa-panel h2,
.form-panel h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.section-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.wide-card,
.form-panel {
  margin-top: 16px;
}

.form-panel,
.compact-form {
  display: grid;
  gap: 18px;
}

.compact-form {
  gap: 12px;
}

.form-panel section,
.field {
  display: grid;
  gap: 10px;
}

.field,
.checkbox-row {
  color: var(--ink);
  font-weight: 800;
}

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

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}

.field textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  resize: vertical;
}

.file-field input {
  padding: 10px;
}

.button-submit {
  width: fit-content;
  border: 0;
  cursor: pointer;
}

.error-banner {
  border: 1px solid #d6a9a3;
  border-radius: 8px;
  background: #fff0ed;
  color: #7d2e25;
  padding: 12px;
  font-weight: 800;
}

.success-banner {
  display: grid;
  gap: 4px;
  border: 1px solid #9fcdbb;
  border-radius: 8px;
  background: #ebf8f2;
  color: var(--teal-dark);
  padding: 12px;
  font-weight: 800;
}

.notice {
  margin-top: 18px;
  border: 1px solid #d8c69d;
  border-radius: 8px;
  background: #fff7e4;
  color: #78500f;
  padding: 12px;
  font-weight: 800;
}

pre {
  min-height: 96px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal-dark);
  padding: 12px;
  white-space: pre-wrap;
}

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

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

.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.summary-list.single-column {
  grid-template-columns: 1fr;
}

.summary-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

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

.summary-list dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.inline-actions {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.inline-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-actions input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}

.reminder-row-due {
  background: #fff7e4;
}

.reminder-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reminder-status.due {
  border-color: #d8c69d;
  background: #fff7e4;
  color: #78500f;
}

.reminder-status.sent_mock,
.reminder-status.completed {
  border-color: #9fcdbb;
  background: #ebf8f2;
  color: var(--teal-dark);
}

.reminder-status.cancelled {
  border-color: #d6a9a3;
  background: #fff0ed;
  color: #7d2e25;
}

.gate-status,
.gate-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.gate-status.pass,
.gate-pill.pass {
  border-color: #9fcdbb;
  background: #ebf8f2;
  color: var(--teal-dark);
}

.gate-status.warn,
.gate-pill.warn {
  border-color: #d8c69d;
  background: #fff7e4;
  color: #78500f;
}

.gate-status.fail,
.gate-pill.fail {
  border-color: #d6a9a3;
  background: #fff0ed;
  color: #7d2e25;
}

h3 {
  margin: 18px 0 8px;
  font-size: 0.95rem;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 12px;
}

.timeline-marker {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: var(--surface);
}

.timeline li.complete .timeline-marker {
  border-color: var(--teal);
  background: var(--teal);
}

.timeline strong,
.timeline span,
.timeline small {
  display: block;
}

.timeline span,
.timeline small,
.muted-copy {
  color: var(--muted);
}

.timeline span {
  font-weight: 800;
  text-transform: capitalize;
}

.timeline small {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .grid,
  .qa-grid,
  .details-grid,
  .workspace-grid,
  .summary-list {
    grid-template-columns: 1fr;
  }

  .case-link-row {
    grid-template-columns: 1fr;
  }
}
