:root {
  --muted: #626262;
  --opportunity-background: #f0f6f4;
}

select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
}

.stack {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field label {
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #a1aaa8;
  border-radius: 4px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}

.alert {
  border-left: 3px solid #906926;
  padding: 16px;
  background: #fbf5e9;
  margin: 20px 0;
  overflow-wrap: anywhere;
}

.alert p:last-child {
  margin-bottom: 0;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  border-top: 8px solid var(--navy);
}

.login-panel {
  width: 100%;
  max-width: 460px;
  padding: 36px;
  margin: 24px auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.login-brand {
  display: inline-block;
  color: var(--navy);
  font-size: 26px;
  font-weight: 650;
  margin-bottom: 0;
}

.login-panel .note {
  font-size: 12px;
  margin-top: 24px;
}

.errorlist {
  padding-left: 18px;
}

.surface {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.breadcrumbs a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.data-context {
  margin: 0 0 24px;
  max-width: 900px;
}

.data-context summary {
  font-size: 12px;
  color: var(--muted);
}

.data-context p {
  color: var(--muted);
  max-width: 80ch;
}

.search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--teal);
}

.search {
  padding-right: 6px;
}

.account {
  margin-top: auto;
  padding: 24px 14px 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  color: white;
}

.account strong {
  overflow-wrap: anywhere;
}

.account small {
  color: #d6e0e7;
  font-size: 11px;
}

.account form,
.operator-link {
  grid-column: 1/-1;
}

.logout {
  background: transparent;
  border: 1px solid #647c8b;
  border-radius: 4px;
  min-height: 40px;
  padding: 7px 14px;
  color: white;
  width: 100%;
  text-align: left;
}

.operator-link {
  color: #d6e0e7;
  font-size: 11px;
  margin-top: 8px;
  text-decoration: underline;
}

.sidebar :focus-visible {
  outline-color: #9edbd2;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.summary-grid .metric>span {
  font-size: 13px;
}

.summary-grid small {
  font-size: 12px;
  margin-top: 10px;
}

.summary-grid .metric:not(.primary-metric) strong {
  font-size: 20px;
  margin-top: 16px;
}

.filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin: 24px 0;
}

.filters .field {
  flex: 1;
  max-width: 520px;
}

.filters .button {
  min-height: 44px;
}

.status-badge {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid #dce5e1;
  border-radius: 4px;
  background: #fff;
  color: #285d56;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.status-badge.unreviewed,
.status-badge.unassessed {
  color: #68532b;
  border-color: #e7ddc7;
}

.data-table {
  font-size: 13px;
}

.opportunity-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 14px;
}

.data-table th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.data-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}

.opportunity-table td {
  padding: 18px 16px;
  background: var(--opportunity-background);
  border-bottom: 0;
}

.opportunity-table td:first-child {
  border-radius: 5px 0 0 5px;
}

.opportunity-table td:last-child {
  border-radius: 0 5px 5px 0;
}

.cell-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.3;
  text-transform: uppercase;
}

.data-table td:first-child {
  width: 26%;
}

.data-table td:nth-child(2) {
  width: 38%;
}

.data-table td:nth-child(3) {
  width: 20%;
}

.data-table td small {
  font-size: 11px;
}

.data-table th:last-child,
.data-table td:last-child {
  text-align: left;
}

.row-link {
  display: grid;
  gap: 5px;
  color: var(--teal);
}

.row-link strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.row-link span {
  color: var(--ink);
}

.source-title {
  font-size: 12px;
  margin: 10px 0 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.unavailable {
  max-width: 860px;
  padding: 36px;
}

.unavailable h2 {
  font-size: 24px;
}

.unavailable .actions {
  margin-top: 28px;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.explanations p,
.explanations a {
  font-size: 13px;
}

.explanations .priority-number {
  font-size: 43px;
}

.meta {
  font-size: 12px;
}

.meta div,
.meta dd,
blockquote,
.source-row,
.surface h2 {
  overflow-wrap: anywhere;
}

.detail-grid>.surface {
  padding: 24px;
}

.section-heading {
  flex-wrap: wrap;
}

.section-heading>a.button {
  color: var(--ink);
  font-size: 12px;
}

.tabs a {
  padding: 8px 0;
  color: var(--teal);
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .account {
    margin: 12px 0;
    padding: 16px 8px 8px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    border-top: 1px solid #647c8b;
  }

  .account form {
    grid-column: 3;
    grid-row: 1;
  }

  .operator-link {
    grid-column: 2/-1;
  }

  .sidebar-foot {
    display: block;
  }

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

  .filters {
    flex-wrap: wrap;
  }

  .filters .field {
    flex-basis: 100%;
  }

  .surface,
  .unavailable,
  .detail-grid>.surface {
    padding: 20px;
  }

  .data-table:not(.opportunity-table) {
    min-width: 680px;
  }

  .opportunity-table,
  .opportunity-table tbody,
  .opportunity-table tr,
  .opportunity-table td {
    display: block;
    width: 100%;
  }

  .opportunity-table {
    min-width: 0;
    border-spacing: 0;
  }

  .opportunity-table tr {
    margin: 0 0 16px;
    border-radius: 5px;
    background: var(--opportunity-background);
    overflow: hidden;
  }

  .opportunity-table td,
  .opportunity-table td:first-child,
  .opportunity-table td:last-child {
    padding: 15px 16px;
    border: 0;
    border-radius: 0;
  }

  .opportunity-table td + td {
  }

  .cell-label {
    margin-bottom: 7px;
  }

  .login-panel {
    padding: 24px;
  }

  .meta {
    grid-template-columns: 1fr;
  }
}

.overview-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.overview-heading .lede {
  margin: 8px 0 0;
}

.overview-filters {
  flex-wrap: wrap;
  margin: 24px 0;
}

.overview-filters .field {
  flex: 2;
  min-width: 180px;
}

.overview-filters .period-field {
  flex: 1;
  min-width: 155px;
}

.overview-filters>.source-link {
  align-self: center;
  margin-top: 24px;
}

.overview-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-metrics .surface {
  padding: 20px;
}

a.metric:hover,
.classification-segment:hover {
  border-color: var(--teal);
}

.overview-metrics .metric small {
  margin-top: 8px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}

.overview-side {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.priority-item {
  margin-top: 14px;
  padding: 18px;
  border-radius: 5px;
  background: var(--opportunity-background);
  overflow-wrap: anywhere;
}

.priority-item-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.stored-score {
  text-align: right;
  flex-shrink: 0;
}

.stored-score strong {
  font-size: 28px;
  line-height: 1.1;
  color: var(--teal);
}

.need-summary {
  font-size: 13px;
  margin: 12px 0;
}

.row-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.priority-dates {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  margin: 12px 0;
}

.priority-item>.source-link {
  font-size: 12px;
}

.classification-segments {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.classification-segment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e7ddc7;
  border-radius: 4px;
  background: #faf6ed;
}

.classification-segment strong {
  font-size: 20px;
}

.capture-item {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.capture-item small {
  margin-top: 5px;
}

.overview-events {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.run-event {
  display: grid;
  gap: 8px;
  border-left: 2px solid var(--teal);
  padding-left: 12px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.run-event strong {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.activity-gaps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
  font-size: 12px;
}

.activity-gaps p {
  margin: 0;
}

.activity-gaps small {
  margin-top: 5px;
}

.priority-reasons {
  margin-top: 20px;
  font-size: 12px;
}

.priority-reasons summary {
  color: var(--teal);
}

.priority-reasons p {
  margin-top: 12px;
}

.score-factors {
  margin: 12px 0;
}

.score-factors div {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.score-factors dd {
  margin: 2px 0 0;
}

@media (max-width: 1100px) {

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

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

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

@media (max-width: 760px) {

  .overview-metrics,
  .overview-side,
  .overview-events,
  .activity-gaps {
    grid-template-columns: minmax(0, 1fr);
  }

  .overview-filters .field {
    flex-basis: 100%;
  }
}

.grounding-note {
  border-left: 2px solid #906926;
  padding-left: 10px;
  margin: 8px 0;
}

.review-form {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.review-form select,
.review-form textarea {
  max-width: 100%;
}

.review-success {
  background: #edf5f1;
  border-left: 3px solid var(--teal);
  padding: 12px;
  margin: 12px 0;
}

.review-entry {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 18px;
  overflow-wrap: anywhere;
}

.review-comment {
  white-space: pre-wrap;
  margin-top: 12px;
}

.review-entry .section-heading {
  margin-bottom: 8px;
}

.detail-grid {
  align-items: start;
}

.review-form~.source-link {
  display: block;
  margin-top: 12px;
}

.explorer-filters {
  margin: 24px 0 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.filter-grid .field label {
  font-size: 12px;
}

.filter-search {
  grid-column: span 2;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.filter-actions small {
  color: var(--muted);
  font-size: 11px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.filter-chips a {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--teal);
}

.filter-chips a:hover {
  background: #edf5f1;
}

.filter-chips span {
  margin-left: 8px;
}

.filter-errors {
  margin-top: 0;
}

.classification-link {
  display: block;
  margin-top: 10px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-search {
    grid-column: auto;
  }
}

.advanced-filters {
  margin-top: 18px;
}

.advanced-filters summary {
  color: var(--teal);
  font-size: 12px;
  padding: 10px 0;
  cursor: pointer;
}

.advanced-filters .filter-grid {
  margin-top: 12px;
}

.detail-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.detail-summary {
  max-width: 90ch;
  line-height: 1.65;
  margin: 18px 0 12px;
}

.detail-dates {
  line-height: 1.7;
}

.detail-main>.surface {
  padding: 24px;
}

.detail-main .evidence {
  margin-top: 20px;
}

.detail-main details {
  margin: 16px 0;
}

.detail-main summary {
  cursor: pointer;
  color: var(--teal);
  font-size: 12px;
}

.claim-details p,
.evidence details p,
.decision-entry,
.processing-entry p {
  font-size: 12px;
  margin-top: 10px;
}

.detail-main pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  background: #f6f7f6;
  padding: 12px;
  border-radius: 4px;
}

.hash {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.structured-explanation {
  line-height: 1.6;
  margin: 16px 0;
}

.squad-table {
  width: 100%;
  font-size: 12px;
  margin: 18px 0;
  border-collapse: collapse;
}

.squad-table th,
.squad-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.squad-table th {
  font-size: 11px;
  color: var(--muted);
}

.squad-table td small {
  font-size: 10px;
  margin-top: 6px;
}

.squad-table td:first-child {
  width: 28%;
}

.processing-entry {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

#processing-history {
  margin-top: 28px;
}

.factor-contribution {
  display: block;
  color: var(--teal);
  margin: 6px 0;
}

.score-factors details {
  margin: 10px 0;
}

.score-factors details p {
  font-size: 11px;
}

.explanations>.priority-reasons {
  padding-bottom: 24px;
}

.detail-main #review-history {
  margin-top: 0;
}

.tabs {
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .detail-main>.surface {
    padding: 20px;
  }

  .squad-table {
    min-width: 620px;
  }
}

.detail-grid>.detail-main {
  padding: 0;
  background: transparent;
  border: 0;
}

.squad-table {
  table-layout: fixed;
}

.squad-table th:first-child {
  width: 25%;
}

.squad-table th:nth-child(2) {
  width: 15%;
}

.squad-table th:nth-child(3) {
  width: 26%;
}

.squad-table th:nth-child(4) {
  width: 34%;
}

.detail-main,
.explanations {
  overflow-wrap: anywhere;
}

.review-queue-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 24px 0;
}

.review-queue-summary .note {
  margin-top: 10px;
}

.review-queue-actions {
  display: grid;
  gap: 12px;
}

.request-fields dt {
  font-weight: 600;
  margin-top: 1rem;
}

.request-fields dd {
  margin: .25rem 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.request-inputs {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 100%;
  font-size: .75rem;
}

.comparison-table {
  min-width: 560px;
}

.comparison-table td:nth-child(n) {
  width: 25%;
}

.import-workflow {
  overflow-wrap: anywhere;
}

.import-workflow>p {
  margin: 16px 0;
  line-height: 1.65;
  max-width: 90ch;
}

.import-workflow input[type=file] {
  max-width: 100%;
}

.upload-receipt {
  font-size: 12px;
  margin: 20px 0;
}

.upload-history {
  padding-left: 20px;
}

.upload-history li {
  margin: 16px 0;
  overflow-wrap: anywhere;
}

.upload-history small {
  display: block;
  color: var(--muted);
  margin-top: 8px;
}

.import-preview-table {
  min-width: 920px;
  table-layout: fixed;
}

.import-preview-table th:first-child,
.import-preview-table td:first-child {
  width: 8%;
}

.import-preview-table th:nth-child(2),
.import-preview-table td:nth-child(2) {
  width: 22%;
}

.import-preview-table th:nth-child(3),
.import-preview-table td:nth-child(3) {
  width: 14%;
}

.import-preview-table th:nth-child(4),
.import-preview-table td:nth-child(4) {
  width: 20%;
}

.import-preview-table th:nth-child(5),
.import-preview-table td:nth-child(5) {
  width: 36%;
}

.operations-filters {
  margin-top: 20px;
}

.operations-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.operations-source,
.operations-event,
.operations-article {
  min-width: 0;
  overflow-wrap: anywhere;
}

.operations-source {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.operations-source .status-badge {
  margin: 12px 0;
}

.operations-source p,
.operations-event p,
.operations-article>p {
  margin: 12px 0;
  line-height: 1.65;
}

.operations-event {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.operations-events {
  margin-top: 24px;
}

.usage-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 24px;
  max-width: 720px;
  font-size: 12px;
}

.usage-fields dt,
.usage-fields dd {
  margin: 0;
}

.topbar {
  grid-template-columns: minmax(0, 1fr);
  margin-left: 224px;
}

.topbar-main {
  grid-column: 1;
}

.sidebar {
  top: 0;
  z-index: 10;
}

.sidebar > .brand {
  min-height: 96px;
  flex: 0 0 96px;
  margin: -34px -12px 24px;
  padding-left: 28px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .topbar {
    margin-left: 190px;
  }
}

@media (max-width: 760px) {
  .topbar {
    margin-left: 0;
  }

  .topbar-main {
    grid-column: auto;
  }

  .sidebar {
    top: auto;
    z-index: auto;
  }

  .sidebar > .brand {
    min-height: 0;
    flex-basis: auto;
    margin: 0 0 8px;
    padding: 10px 8px 12px;
    font-size: 20px;
  }
}

@media (max-width: 760px) {
  .operations-sources {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dashboard-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin: 24px 0;
}

.dashboard-intro h2 {
  font-size: 28px;
  margin: 8px 0;
}

.dashboard-intro p {
  max-width: 70ch;
  line-height: 1.65;
}

.detail-main .evidence,
.operations-event.news-signal-card {
  margin: 24px 0;
  padding: 18px 16px;
  border: 0;
  border-radius: 5px;
  background: var(--opportunity-background);
}

.news-explanation {
  margin: 20px 0;
  line-height: 1.7;
}

.news-explanation h4 {
  margin: 22px 0 6px;
  font-size: 14px;
}

.news-explanation p {
  max-width: 85ch;
}

.signal-type {
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
}

.signal-certainty {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 20px 0;
  font-size: 13px;
}

.signal-certainty dt {
  color: var(--muted);
}

.signal-certainty dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.technical-details > summary,
details.surface > summary {
  cursor: pointer;
  color: var(--teal);
  padding: 8px 0;
}

.technical-details {
  font-size: 13px;
}

.evidence:target,
.operations-event:target {
  outline: 3px solid var(--teal);
  outline-offset: 8px;
}

[id] {
  scroll-margin-top: 120px;
}

@media (max-width: 760px) {
  .overview-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  [id] {
    scroll-margin-top: 24px;
  }
}
