/* Final Ops presentation layer. Values and recorded states come from the snapshot. */
:root {
  --ops-action: #244db9;
  --ops-action-hover: #193b94;
  --ops-action-soft: #eaf0ff;
}

/* The final rendered audit includes quiet metadata, not just primary actions. */
body[data-view='finance'] {
  --muted: #526158;
}
body .ballot-heading .eyebrow,
body .poll-index,
body .poll-option-count small,
body .poll-decision > div > span,
body .poll-decision > small,
body .helpful-card .eyebrow {
  color: #526078;
}

/* Light scorecard surfaces must not inherit retired dark-theme tokens. */
body[data-view='kpis'] {
  --green: #174737;
  --green-dark: #123c2e;
  --green-light: #e8eee7;
  --accent: #244db9;
  --surface: #ffffff;
  --surface-muted: #f1f3ec;
  --canvas: #f8f8f3;
  --copper: #965134;
  --focus: #244db9;
  --status-success: #206242;
  --status-success-soft: #e8f2e8;
}
.scorecard-page {
  --scorecard-amber: #80521e;
  --scorecard-amber-bg: #fff5df;
  --scorecard-amber-line: #b18a45;
}
.scorecard-page .evidence-spectrum {
  background: #f1f3ec;
  color: #243e33;
}
.spectrum-legend .is-verified i {
  background: #206242;
}
.spectrum-legend .is-partial i {
  background: #80521e;
}
.spectrum-legend .is-census i {
  background: #5b4d82;
}
.spectrum-legend .is-unknown i {
  background: #59675f;
}

/* Pair foreground and background in each interactive state. */
body .primary {
  background: var(--ops-action);
  border-color: var(--ops-action);
  color: #ffffff;
}
body .primary:is(:hover, :focus-visible) {
  background: var(--ops-action-hover);
  border-color: var(--ops-action-hover);
  color: #ffffff;
}
body .secondary {
  background: #ffffff;
  border-color: #788d81;
  color: #174737;
}
body .secondary:is(:hover, :focus-visible),
body[data-view='kpis'] .secondary:is(:hover, :focus-visible) {
  background: #e8eee7;
  color: #123c2e;
  border-color: #52665f;
}
body :is(.public-tabs, .guide-options, .range-controls, .scorecard-controls [role='group']) button {
  background: #ffffff;
  color: #243e33;
  border: 1px solid #788d81;
}
body
  :is(.public-tabs, .guide-options, .range-controls, .scorecard-controls [role='group'])
  button:hover {
  background: #eaf0ff;
  color: #193b94;
  border-color: #244db9;
}
body
  :is(.public-tabs, .guide-options, .range-controls, .scorecard-controls [role='group'])
  button[aria-pressed='true'] {
  background: #244db9;
  color: #ffffff;
  border-color: #244db9;
  box-shadow: inset 0 -3px 0 #ffffff;
  font-weight: 750;
}
body .scorecard-controls [role='group'] button[aria-pressed='true'] span {
  background: #ffffff;
  color: #193b94;
}
body
  :is(.public-tabs, .guide-options, .range-controls, .scorecard-controls [role='group'])
  button[aria-pressed='true']:hover {
  background: #193b94;
  color: #ffffff;
}
body .text-btn {
  color: #244db9;
}
body .text-btn:is(:hover, :focus-visible) {
  color: #193b94;
}
body .public-phase .text-btn {
  color: #ffffff;
}
body .section-owner {
  color: #174737;
}
body .section-owner:hover {
  background: #e8eee7;
  color: #123c2e;
}
body .scorecard-hero:hover {
  background: #edf2fc;
}
body .scorecard-hero.is-unknown:hover {
  background: #fff5df;
}
body .sidebar .nav-item[aria-current='page'] {
  box-shadow: inset 4px 0 0 #a8c4ff;
  font-weight: 750;
}

/* Two-color focus rings work on light cards and dark navigation. */
body :is(a, button, input, select, textarea, summary, [tabindex='0']):focus-visible {
  outline: 3px solid #244db9;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #ffffff;
}
body .sidebar :focus-visible,
body .public-phase :focus-visible {
  outline-color: #ffffff;
  box-shadow: 0 0 0 3px #244db9;
}
body main h1:focus {
  outline-offset: 6px;
}
body :is(button, a, summary, input, select, textarea) {
  scroll-margin-block: 130px 40px;
}
body :is(button, summary, input, select),
body :is(.primary, .secondary, .text-btn, .nav-item, .top-product-link, .section-owners-org) {
  min-height: 44px;
}
body :is(button, summary) {
  touch-action: manipulation;
}
body :is(.ticker-controls button, .ticker-controls a, .dialog-close) {
  min-width: 44px;
  min-height: 44px;
}
body button:disabled {
  cursor: not-allowed;
}

/* Legible metadata and wrapping instead of clipped records. */
body
  :is(
    .snapshot-cutoff,
    .date-label,
    .public-snapshot,
    .story-meta,
    .public-state,
    .section-owner-role,
    .section-owner-detail,
    .section-owners-note,
    .scorecard-date,
    .scorecard-status,
    .scorecard-hero-note,
    .scorecard-hero-action,
    .panel-note,
    .ops-fresh,
    .ticker-label small,
    .filter-result-status
  ) {
  font-size: 0.8125rem;
  line-height: 1.6;
}
body
  :is(
    .scorecard-observatory .page-heading p,
    .scorecard-group-heading p,
    .scorecard-chart-heading p,
    .spectrum-legend > span,
    .evidence-spectrum > p
  ) {
  font-size: 0.875rem;
  line-height: 1.65;
}
body :is(.scorecard-hero > strong, .public-state, .ops-state) {
  white-space: normal;
}
body :is(.workstream-main, .roadmap-content, .story-card, .ops-deliverables summary > span) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.story-card > p,
.workstream-main > p {
  max-width: 68ch;
}
body .section-owner {
  min-height: 100px;
}
.record-owner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
  color: #52665f;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 6px 0;
}
.record-owner strong,
.record-owner .text-btn {
  font-size: inherit;
}
.record-owner > span:first-child {
  font-weight: 600;
}
.record-owner .text-btn {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.workstream-details,
.milestone-details {
  margin-top: 12px;
}
body :is(.workstream-details, .milestone-details) > summary {
  padding: 10px 12px;
  border: 1px solid #788d81;
  border-radius: 8px;
  background: #ffffff;
  color: #174737;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}
body :is(.workstream-details, .milestone-details) > summary:hover {
  background: #e8eee7;
  color: #123c2e;
}
.workstream-details[open] > summary,
.milestone-details[open] > summary {
  margin-bottom: 14px;
}
.workstream-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
}
body .ops-deliverables summary small {
  font-size: 0.8125rem;
  line-height: 1.6;
}
body .view-controls {
  flex-wrap: wrap;
  gap: 12px;
}
.filter-result-status {
  color: #52665f;
  margin: 12px 0 20px;
}
.section-jump {
  display: none;
}
.scorecard-scope,
.action-details {
  overflow-wrap: anywhere;
}

.participation-lane-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 16px;
}
.participation-lane-controls label {
  display: grid;
  gap: 6px;
  flex: 1 1 230px;
  min-width: 0;
  color: #243e33;
  font-size: 0.875rem;
  font-weight: 650;
}
.participation-lane-controls select {
  width: 100%;
  min-width: 0;
  background: #ffffff;
  color: #243e33;
  border: 1px solid #788d81;
  border-radius: 8px;
  padding: 10px;
}
.participation-lane-intro p,
.lane-owner,
.ballot-edition-note,
.live-ballot-boundary {
  font-size: 0.875rem;
  line-height: 1.65;
  color: #52665f;
}
.live-ballot-boundary {
  padding: 12px 16px;
  background: #eaf0ff;
  color: #193b94;
  border-left: 3px solid #244db9;
  border-radius: 4px;
}
.contextual-participation {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid #788d81;
  border-radius: 14px;
  background: #ffffff;
  color: #243e33;
}
.contextual-participation > p {
  font-size: 0.9375rem;
  max-width: 70ch;
}
.contextual-participation .ballot-heading {
  margin: 0 0 12px;
}
.contextual-participation .poll-card {
  max-width: none;
  padding: 20px;
}
.poll-context,
.signup-preferences {
  margin: 16px 0;
}
.poll-context summary,
.signup-preferences > summary,
.finance-runtime summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.65;
}
.poll-context p,
.signup-credit-note {
  font-size: 0.875rem;
  line-height: 1.65;
}
body .signup-preferences fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}
body .signup-preferences fieldset legend {
  float: none;
  width: 100%;
  margin-bottom: 12px;
}
body .signup-credit-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
body .signup-credit-consent input {
  flex-shrink: 0;
}
.finance-runtime {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.finance-runtime > article {
  min-width: 0;
  background: #ffffff;
  border: 1px solid #dce1d8;
  border-radius: 12px;
  padding: 24px;
}
.finance-runtime h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  margin: 12px 0;
}
.finance-runtime p,
.finance-runtime li {
  font-size: 0.875rem;
  line-height: 1.65;
}
.finance-runtime .eyebrow {
  font-size: 0.75rem;
}
.finance-runtime .finance-token-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.finance-token-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: space-between;
  border-bottom: 1px solid #dce1d8;
  padding-bottom: 10px;
}
.finance-token-summary dt {
  color: #52665f;
  font-size: 0.875rem;
}
.finance-token-summary dd {
  margin: 0;
  color: #243e33;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 800px) {
  .finance-runtime {
    grid-template-columns: 1fr;
  }
  .contextual-participation {
    padding: 16px;
  }
  .contextual-participation .poll-card {
    padding: 16px;
  }
  .contextual-participation .ballot-heading {
    flex-wrap: wrap;
  }
}

/* AI analysis stays in a separate disclosure, outside community ballot totals. */
.ai-advisory,
.earlier-polls {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid #788d81;
  border-radius: 10px;
  background: #f8f8f3;
  color: #243e33;
}
.ai-advisory summary,
.earlier-polls > summary {
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 8px 0;
}
.ai-advisory > summary > span,
.ai-role-recommendation > summary > span {
  display: block;
  color: #52665f;
  margin-top: 4px;
}
.ai-advisory-counts {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.ai-advisory-counts li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 12px 0;
  border-top: 1px solid #dce1d8;
  font-size: 0.875rem;
}
.ai-advisory p {
  font-size: 0.875rem;
  line-height: 1.65;
  max-width: 68ch;
}
.ai-role-recommendation {
  border-top: 1px solid #dce1d8;
  padding: 8px 0;
}
.ai-method,
.ai-role-recommendations {
  margin-top: 12px;
}
.earlier-polls {
  max-width: 850px;
}
.earlier-polls[open] > summary {
  margin-bottom: 20px;
}
#participation-polls > .poll-card + .poll-card {
  margin-top: 24px;
}
body .poll-option.is-selected {
  background: #eaf0ff;
  color: #193b94;
  border: 2px solid #244db9;
}
body .poll-option:focus-within {
  outline: 3px solid #244db9;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .section-jump {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 100%;
    color: #243e33;
    font-size: 0.875rem;
    font-weight: 650;
  }
  .section-jump select {
    width: 100%;
    padding: 8px 12px;
    background: #ffffff;
    color: #243e33;
    border: 1px solid #788d81;
    border-radius: 8px;
  }
}
@media (max-width: 700px) {
  body .attention {
    flex-wrap: wrap;
  }
  body .scorecard-controls [role='group'] {
    flex-wrap: wrap;
    max-width: 100%;
  }
  body .scorecard-controls [role='group'] button {
    flex: 1 1 auto;
  }
  body .topbar,
  body .schedule-strip {
    position: static;
  }
  body .topbar {
    padding-inline: 18px;
  }
  body :is(input, select, textarea) {
    font-size: 1rem;
  }
  body :is(.public-dateline, .public-snapshot, .page-heading, .story-meta) {
    flex-wrap: wrap;
    gap: 10px;
  }
  body :is(.date-control, .public-snapshot select, .filter-wrap select) {
    max-width: 100%;
  }
  body .view-controls .search-wrap {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
  }
  body .view-controls input {
    width: 100%;
    min-width: 0;
  }
  body .ops-deliverables summary {
    flex-wrap: wrap;
    gap: 10px;
  }
  body .ops-deliverables summary > span:first-child {
    flex: 1 1 100%;
  }
  body .ticker-controls {
    flex-wrap: wrap;
  }
  body .public-workstream {
    gap: 16px;
  }
  body .public-roadmap > article {
    grid-template-columns: 65px 18px minmax(0, 1fr);
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media (forced-colors: active) {
  body :is(a, button, input, select, summary, [tabindex='0']):focus-visible {
    outline: 3px solid Highlight;
  }
  body [aria-pressed='true'],
  body [aria-current='page'] {
    outline: 2px solid Highlight;
  }
}
