:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #202b26;
  --muted: #637069;
  --green: #246457;
  --line: #e2e7e4;
  --red: #a0352b;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--green); text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
a, button, input, textarea, select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 4px;
}
input, textarea, select { accent-color: var(--green); }

.shell {
  max-width: 688px;
  margin: 0 auto;
  padding: 0 24px max(40px, env(safe-area-inset-bottom));
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -1.5px;
  text-decoration: none;
}
.brand-dot { color: var(--green); }
.main-nav { display: flex; align-self: stretch; gap: 12px; }
.main-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a[aria-current] { border-color: var(--green); color: var(--green); }
main { padding-top: 36px; }
.page-heading { margin: 0 0 32px; }
h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.8px;
}
h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; }
.muted { margin: 0; color: var(--muted); font-size: 14px; }
.page-heading .muted { margin-top: 8px; }
.card > p:first-child { margin-top: 0; }

.field, form > p { margin: 0 0 24px; }
.field label, form > p > label, legend { font-size: 15px; font-weight: 600; }
.field label, form > p > label { display: block; margin-bottom: 8px; }
input:not([type=radio]):not([type=hidden]), textarea, select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #b9c4bd;
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
textarea { min-height: 80px; line-height: 1.6; resize: vertical; }
input[type=datetime-local] { -webkit-appearance: none; appearance: none; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.label-row label { min-width: 0; }
.optional { color: var(--muted); font-size: 13px; font-weight: 400; }
.field-help, .helptext {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.label-row .field-help { flex-shrink: 0; margin: 0; font-size: 12px; }
.detail-field .field-help { margin: -2px 0 10px; }
.field-count {
  flex-shrink: 0;
  visibility: hidden;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.detail-field:focus-within .field-count { visibility: visible; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
.severity-field { margin-bottom: 28px; }
.severity-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.severity-choice { position: relative; cursor: pointer; }
.severity-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.severity-number {
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 1px solid #b9c4bd;
  border-radius: 7px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 500;
}
.severity-choice:hover .severity-number { background: #f3f6f4; }
.severity-choice input:checked + .severity-number { border-color: var(--green); background: var(--green); color: #fff; }
.severity-choice input:focus-visible + .severity-number { outline: 3px solid var(--green); outline-offset: 4px; }
.severity-description p {
  margin: 16px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--green);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.details-fields { margin-top: 32px; }
.details-fields legend {
  width: 100%;
  margin-bottom: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}
.details-fields .optional { margin-left: 8px; }
.author-line { margin: 4px 0 16px; color: var(--muted); font-size: 13px; }
.author-line strong { font-weight: 500; }
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.primary { background: var(--green); color: #fff; }
.primary:hover { background: #194f44; }
.secondary { border-color: #b9c4bd; background: var(--paper); color: var(--ink); }
.secondary:hover { background: #f3f6f4; }
.danger { background: var(--red); color: #fff; }
.form-actions { display: flex; gap: 12px; }
.form-actions > * { flex: 1; }
.notice {
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 1px solid #c4d8ca;
  border-radius: 7px;
  background: #f0f6f1;
  font-size: 14px;
}
.form-status { border-color: #d9bd83; background: #fff8e8; }
.errorlist { padding-left: 20px; color: var(--red); font-size: 14px; }
.errorlist li { margin: 6px 0; }

.history-card { padding: 24px 0; border-top: 1px solid var(--line); }
.incident-heading { display: flex; align-items: center; gap: 14px; }
.incident-heading > div { min-width: 0; overflow-wrap: anywhere; }
.severity-badge {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 52px;
  padding: 10px 8px;
  border-radius: 7px;
  background: #edf3ef;
  color: var(--green);
  font-size: 21px;
  font-weight: 600;
}
.severity-badge span { font-size: 12px; font-weight: 400; }
.severity-4, .severity-5 { background: #faf0e4; color: #865820; }
.edit-link { display: flex; align-items: center; min-height: 44px; margin-left: auto; padding: 10px 0 10px 12px; font-size: 14px; }
.incident-detail { margin-top: 22px; }
.incident-detail h3 { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.incident-note { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.65; }
.no-note { margin: 20px 0; color: var(--muted); font-size: 14px; }
.recorded-at { margin: 24px 0 0; color: var(--muted); font-size: 12px; }
.empty-state { padding: 36px 0; border-top: 1px solid var(--line); text-align: center; }
.empty-state .button { width: fit-content; margin: 24px auto 0; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; font-size: 14px; }
.pagination a { display: inline-flex; align-items: center; min-height: 44px; }
.delete-link { display: block; padding: 20px; color: var(--red); font-size: 14px; text-align: center; }
.delete-actions { margin-top: 32px; }
.account-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px 0; font-size: 14px; }
.account-actions > a { display: inline-flex; align-items: center; min-height: 44px; }
.text-button { min-height: 44px; padding: 10px 0 10px 12px; border: 0; background: none; color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.login-help { margin-top: 24px; }
.helptext ul { padding-left: 18px; }
.site-footer { margin-top: 32px; color: var(--muted); font-size: 12px; }
.site-footer:empty { display: none; }
.skip-link { position: absolute; left: -10000px; }
.skip-link:focus { top: 10px; left: 10px; z-index: 1; padding: 10px; background: var(--paper); }
.visually-hidden { 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: 480px) {
  .shell { padding-right: 20px; padding-left: 20px; }
  .site-header { min-height: 72px; gap: 12px; }
  .main-nav { gap: 4px; }
  .main-nav a { padding-right: 8px; padding-left: 8px; }
  main { padding-top: 28px; }
  h1 { font-size: 27px; }
  .severity-options { gap: 8px; }
}
@media (max-width: 360px) {
  .shell { padding-right: 16px; padding-left: 16px; }
  .label-row { flex-wrap: wrap; gap: 0 8px; }
  .label-row .field-help { margin-bottom: 8px; }
  .field-count { margin-left: auto; }
}
