:root {
  --orange: #ffa400;
  --orange-hover: #ff9100;
  --black: #000;
  --page: #f6f6f6;
  --white: #fff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --indigo: #4f46e5;
  --green: #166534;
  --green-bg: #dcfce7;
  --amber: #92400e;
  --amber-bg: #fef3c7;
  --red: #b91c1c;
  --red-bg: #fee2e2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Public Sans", system-ui, sans-serif;
  color: #171717;
  background: var(--page);
  line-height: 1.5;
}
a { color: var(--indigo); }
.app-shell { min-height: 100%; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; }
.page-inner { width: min(80rem, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.navbar {
  background: var(--black);
  border-top: 4px solid var(--orange);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
.navbar-inner {
  width: min(80rem, calc(100% - 2rem));
  margin: 0 auto;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.navbar-left, .navbar-right, .nav-links { display: flex; align-items: center; }
.navbar-left { gap: 1.5rem; }
.navbar-right { gap: 1rem; }
.logo { display: flex; align-items: center; }
.logo img { display: block; }
.nav-links { gap: 2rem; }
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 4rem;
  padding: 0 0.25rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 4px solid transparent;
}
.nav-link:hover { color: #fff; }
.nav-link.is-active { color: var(--orange); border-bottom-color: var(--orange); }
.role-badge {
  background: var(--orange);
  color: #000;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.25rem 0.5rem;
}
.nav-text, .signout {
  color: #d1d5db;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
}
.nav-text:hover, .signout:hover { color: #fff; }
.signout svg { width: 1rem; height: 1rem; }
.logout-form { margin: 0; }
.menu-button {
  display: none;
  background: none;
  border: 0;
  color: #9ca3af;
  padding: 0.5rem;
  cursor: pointer;
}
.menu-button svg { width: 1.5rem; height: 1.5rem; }
.mobile-menu {
  display: none;
  background: #000;
  border-top: 1px solid #374151;
  padding: 0.5rem 1rem 1rem;
}
.mobile-link {
  display: block;
  width: 100%;
  text-align: left;
  color: #d1d5db;
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}
.mobile-link.is-active, .mobile-link:hover { background: #111827; color: #fff; }

.footer {
  background: #000;
  color: #9ca3af;
  text-align: center;
  font-size: 0.875rem;
  padding: 1rem;
  margin-top: auto;
}
.footer p { margin: 0; }

.page-header h1, .edit-title, .content-card h1, .login-card h1 {
  margin: 0;
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 700;
  color: var(--gray-900);
}
.content-card h1 { margin-bottom: 0.75rem; }
.content-card h1.status-detail-title {
  margin-bottom: 0.5rem;
  font-weight: 400;
}
.lede { margin: 0.5rem 0 0; color: var(--gray-600); }
.queue-links { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; }
.meta-note { margin: 1rem 0 0; font-size: 0.75rem; font-style: italic; color: var(--gray-900); }

.btn-orange, .btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-orange {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.btn-orange:hover { background: var(--orange-hover); }
.btn-white {
  background: #fff;
  color: var(--gray-900);
  border-color: var(--gray-200);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
}
.btn-white:hover, .btn-white.is-selected { box-shadow: 0 4px 6px rgb(0 0 0 / 0.08); }
.btn-white.is-selected { border-color: var(--orange); }
.btn-small { padding: 0.4rem 1rem; }

.filters { margin: 1.5rem 0; }
.filters-row, .status-filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.status-filters { margin-top: 1rem; }
.search-field { position: relative; flex: 1 1 16rem; min-width: 12rem; }
.search-field input { width: 100%; padding-right: 2.5rem; }
.search-field svg {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}
input, select, textarea {
  font: inherit;
  color: var(--gray-900);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
}
select { min-width: 8rem; }
select:disabled { background: var(--gray-100); color: var(--gray-400); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid #a5b4fc;
  outline-offset: 0;
  border-color: var(--indigo);
}
textarea { width: 100%; resize: vertical; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; }

.card-list { display: grid; gap: 1.5rem; }
.alert-card {
  display: block;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
}
.alert-card:hover { box-shadow: 0 4px 6px rgb(0 0 0 / 0.1), 0 2px 4px rgb(0 0 0 / 0.06); }
.card-top, .status-card-top, .back-row, .detail-tags, .review-tags, .edit-actions, .status-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.card-top, .status-card-top, .back-row { justify-content: space-between; align-items: flex-start; }
.alert-card h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
}
.status-title { font-size: 1.125rem; line-height: 1.75rem; font-weight: 400; margin: 0; color: var(--gray-900); }
.status-detail-title { font-size: 1.875rem; line-height: 2.25rem; font-weight: 400; }
.status-component { font-weight: 700; }
.status-rest { font-weight: 400; }
.card-tags, .review-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.card-date { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.25rem; color: var(--gray-600); }
.card-preview { margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--gray-600); }
.review-tags { margin-top: 1rem; }
.attachment-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}
.attachment-count svg { width: 0.75rem; height: 0.75rem; }

.venue-tag, .category-tag, .review-tag, .level-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  padding: 0.125rem 0.625rem;
  white-space: nowrap;
}
.venue-tag {
  background: var(--gray-200);
  color: var(--gray-800);
  border: 2px solid var(--gray-200);
}
.category-tag {
  color: var(--gray-900);
  border: 1px solid var(--orange);
}
.review-tag { border: 1px solid transparent; }
.review-tag.to-review { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-300); }
.review-tag.needs-revisions { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }
.review-tag.approved { background: var(--green-bg); color: var(--green); border-color: #86efac; }
.level-pill {
  border-radius: 999px;
  font-weight: 500;
  gap: 0.375rem;
  flex-shrink: 0;
}
.level-pill.lg { padding: 0.5rem 0.75rem; font-size: 1rem; }
.level-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; display: inline-block; }
.level-pill.informational { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.level-pill.informational .level-dot { background: #22c55e; }
.level-pill.issue { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.level-pill.issue .level-dot { background: #eab308; }
.level-pill.severe { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.level-pill.severe .level-dot { background: #ef4444; }
.level-pill.unknown { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.level-pill.unknown .level-dot { background: var(--gray-400); }

.empty { text-align: center; color: var(--gray-500); padding: 2rem 0; }
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}
.pager-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  text-decoration: none;
  background: #fff;
}
.pager-btn:hover:not(.is-disabled) { background: var(--gray-50); }
.pager-btn.is-disabled { opacity: 0.5; cursor: not-allowed; }
.pager-status { padding: 0.5rem 1rem; font-size: 0.875rem; color: var(--gray-700); }

.back-row { margin-bottom: 1.5rem; align-items: center; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.875rem;
}
.back-link:hover { color: var(--gray-700); }
.back-link svg { width: 1rem; height: 1rem; }
.content-card {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06);
  padding: 2rem 1.5rem;
  overflow: hidden;
}
.detail-tags { margin: 0 0 0.75rem; }
.content-card .card-date { margin: 0 0 1rem; }
.status-card-top .card-date { margin: 0 0 0.75rem; }
.review-above {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
}
.review-above-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
.review-status-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.review-status-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  letter-spacing: 0.02em;
}
button.review-tag {
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  opacity: 0.55;
}
button.review-tag:hover,
button.review-tag:focus-visible {
  opacity: 1;
}
button.review-tag.is-current {
  opacity: 1;
  box-shadow: 0 0 0 1px currentColor;
}
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: underline;
  color: var(--gray-700);
}
.source-link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.source-link:hover { color: var(--gray-900); }
.review-below { margin-top: 1.5rem; }
.banner { padding: 0.75rem 1rem; border-radius: 0.375rem; margin: 0 0 1rem; }
.banner.ok { background: #f0fdf4; color: var(--green); border: 1px solid #bbf7d0; }
.banner.error { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }

.prose {
  --prose-body: #374151;
  --prose-headings: #111827;
  --prose-links: #111827;
  --prose-bold: #111827;
  --prose-bullets: #d1d5db;
  --prose-counters: #6b7280;
  --prose-quotes: #111827;
  --prose-quote-borders: #e5e7eb;
  --prose-hr: #e5e7eb;
  --prose-code: #111827;
  border-top: 1px solid var(--gray-200);
  padding-top: 0.5rem;
  margin-top: 0;
  overflow: auto;
  max-width: none;
  color: var(--prose-body);
  font-size: 1rem;
  line-height: 1.75;
}
.content-card .status-card-top + .prose { border-top: 0; padding-top: 0.5rem; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin-top: 1.25em; margin-bottom: 1.25em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0; }
.prose a {
  color: var(--prose-links);
  font-weight: 500;
  text-decoration: underline;
}
.prose strong, .prose b {
  color: var(--prose-bold);
  font-weight: 600;
}
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  color: var(--prose-headings);
  font-weight: 700;
}
.prose h1 {
  font-size: 2.25em;
  margin-top: 0;
  margin-bottom: 0.8888889em;
  line-height: 1.1111111;
}
.prose h2 {
  font-size: 1.5em;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3333333;
}
.prose h2:first-child { margin-top: 1em; }
.prose h3 {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  line-height: 1.6;
}
.prose h4 {
  font-size: 1em;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.5;
}
.prose ul, .prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em;
}
.prose ul { list-style-type: disc; }
.prose ol { list-style-type: decimal; }
.prose li { margin-top: 0.5em; margin-bottom: 0.5em; }
.prose ul > li, .prose ol > li { padding-left: 0.375em; }
.prose ul > li::marker { color: var(--prose-bullets); }
.prose ol > li::marker { color: var(--prose-counters); font-weight: 400; }
.prose li > p { margin-top: 0.75em; margin-bottom: 0.75em; }
.prose ul ul, .prose ul ol, .prose ol ul, .prose ol ol {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
}
.prose img {
  max-width: 100%;
  height: auto;
  margin-top: 2em;
  margin-bottom: 2em;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--prose-hr);
  margin: 3em 0;
}
.prose blockquote {
  font-weight: 500;
  font-style: italic;
  color: var(--prose-quotes);
  border-left: 0.25rem solid var(--prose-quote-borders);
  margin: 1.6em 0;
  padding-left: 1em;
}
.prose code {
  color: var(--prose-code);
  font-weight: 600;
  font-size: 0.875em;
}
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.prose thead { background: #f1f1f1; font-weight: 700; }
.prose th, .prose td { padding: 0.75rem; border: 1px solid var(--gray-200); text-align: left; vertical-align: top; }
.prose .highlight-blond, .prose .bg-light-orange, .prose mark { background: #fef1b8; color: #dc2626; }
.prose .bg-silver { background: #e8eaed; }
.prose [align="center"] { text-align: center; }
.prose [align="right"] { text-align: right; }
.prose [align="left"] { text-align: left; }
.prose [data-highlight-colour="blond"] { background-color: #fef1b8; }
.prose [data-highlight-colour="green"] { background-color: #d1fae5; }
.prose.dim { opacity: 0.85; }

.attachments { margin-top: 2rem; border-top: 1px solid var(--gray-200); padding-top: 1.5rem; }
.attachments h2, .notes-box h2 { font-size: 1.125rem; margin: 0 0 1rem; }
.attachments ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.attachments li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-50);
  padding: 0.75rem;
  border-radius: 0.5rem;
}
.attachments li:hover { background: var(--gray-100); }
.attachments svg { width: 1.25rem; height: 1.25rem; color: var(--gray-400); flex-shrink: 0; }
.attachments a { color: var(--indigo); font-weight: 500; text-decoration: none; }
.attachments a:hover { color: #4338ca; }
.doc-link {
  margin-left: auto;
  color: var(--gray-500) !important;
  background: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}
.doc-link:hover { color: var(--indigo) !important; background: #eef2ff; }
.notes-box { margin-top: 1.5rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 0.5rem; padding: 1rem 1.25rem; }
.review-below .notes-box { margin-top: 0; }
.notes-box p { margin: 0; white-space: pre-wrap; }
.source-line { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; font-size: 0.875rem; }
.muted { color: var(--gray-500); }

.field-hint { font-size: 0.8125rem; font-weight: 400; color: var(--gray-500); }
.tox-tinymce { border-radius: 0.375rem !important; border-color: var(--gray-300) !important; }

.edit-title { margin-bottom: 1.5rem; }
.edit-form, .stack { display: grid; gap: 1.25rem; }
.edit-form label, .stack label { display: grid; gap: 0.35rem; font-size: 0.875rem; font-weight: 500; color: var(--gray-700); }
.edit-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.status-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.original { margin-top: 2rem; background: #fff; border-radius: 0.5rem; box-shadow: 0 1px 3px rgb(0 0 0 / 0.1); padding: 1rem 1.5rem; }
.original summary { cursor: pointer; font-weight: 600; }

.login-wrap { display: flex; justify-content: center; padding: 3rem 0; }
.login-card {
  width: min(28rem, 100%);
  background: #fff;
  box-shadow: 0 4px 6px rgb(0 0 0 / 0.08);
  border-radius: 0.5rem;
  padding: 2rem;
}
.login-card h1 { text-align: center; font-size: 1.5rem; }
.login-card p { text-align: center; color: var(--gray-600); font-size: 0.875rem; }
.login-card .btn-orange { width: 100%; }

@media (max-width: 640px) {
  .nav-links, .navbar-right { display: none; }
  .menu-button { display: inline-flex; }
  .mobile-menu:not([hidden]) { display: block; }
  .alert-card h2 { font-size: 1.25rem; }
  .status-row { grid-template-columns: 1fr; }
  .filters-row, .status-filters { gap: 0.5rem; }
  .filters-row select, .status-filters select { flex: 1 1 8rem; min-width: 0; }
}
