.results-page {
  min-height: 100vh;
  margin: 0;
  background: #f4f7f5;
  color: #14211d;
}

.results-page [hidden] {
  display: none !important;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 28px;
}

.results-brand {
  color: #0b4b3e;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}

.results-restart,
.result-source-link {
  color: #0b5a49;
  font-weight: 700;
  text-underline-offset: 3px;
}

.results-restart:focus-visible,
.result-primary-action:focus-visible,
.result-details summary:focus-visible {
  outline: 3px solid #69bca7;
  outline-offset: 3px;
}

.results-main {
  width: min(100% - 40px, 1040px);
  margin: 0 auto;
  padding: 40px 0 96px;
}

.results-hero {
  max-width: 800px;
  margin-bottom: 48px;
}

.results-eyebrow,
.result-section-kicker {
  margin: 0 0 10px;
  color: #147660;
  font-size: .875rem;
  font-weight: 800;
}

.results-hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1.08;
  word-break: keep-all;
}

.results-company {
  margin: 20px 0 0;
  color: #52635d;
  font-size: 1.05rem;
}

.results-scan-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 28px;
}

.results-scan-summary strong {
  color: #0b4b3e;
  font-size: 2.5rem;
}

.results-method,
.results-display-note,
.result-section-description {
  color: #5a6964;
  line-height: 1.7;
}

.results-method {
  margin: 18px 0 0;
}

.results-display-note {
  margin: 4px 0 0;
  font-size: .925rem;
}

.results-state,
.results-error {
  padding: 24px;
  border-radius: 16px;
  background: #fff;
}

.workspace-save {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  gap: 36px;
  align-items: end;
  padding: 30px;
  border: 1px solid #c8dbd4;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff 0%, #eef7f3 100%);
  box-shadow: 0 18px 48px rgb(11 75 62 / 9%);
  animation: workspaceSaveIn 480ms cubic-bezier(.22, 1, .36, 1) both;
}

.workspace-save h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

.workspace-save-copy,
.auth-description {
  margin: 10px 0 0;
  color: #5a6964;
  line-height: 1.65;
}

.workspace-save-form,
.auth-email-form {
  display: grid;
  gap: 9px;
}

.workspace-save-label,
.auth-email-form label {
  color: #31433d;
  font-size: .875rem;
  font-weight: 800;
}

.workspace-save-actions,
.auth-email-row {
  display: flex;
  gap: 10px;
}

.workspace-save-actions input,
.auth-email-row input {
  min-width: 0;
  flex: 1;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #b9cbc4;
  border-radius: 10px;
  background: #fff;
  color: #14211d;
  font: inherit;
}

.workspace-save-button {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: #0b4b3e;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.workspace-save-button:hover {
  transform: translateY(-1px);
  background: #126552;
  box-shadow: 0 10px 24px rgb(11 75 62 / 18%);
}

.workspace-save-button:disabled {
  cursor: wait;
  opacity: .58;
}

.workspace-save-button:focus-visible,
.workspace-save-actions input:focus-visible,
.auth-email-row input:focus-visible,
.auth-back:focus-visible,
.auth-text-button:focus-visible,
.results-auth-link:focus-visible,
.results-auth-button:focus-visible {
  outline: 3px solid #69bca7;
  outline-offset: 3px;
}

.workspace-save-status {
  grid-column: 1 / -1;
  min-height: 24px;
  margin: 0;
  color: #0b5a49;
  font-weight: 700;
}

.workspace-save-status.is-error {
  color: #8a2e25;
}

.workspace-saved-link {
  grid-column: 1 / -1;
  display: inline-flex;
  min-height: 44px;
  width: fit-content;
  align-items: center;
  color: #0b5a49;
  font-weight: 800;
  text-underline-offset: 3px;
}

.auth-main {
  width: min(100% - 40px, 760px);
  margin: 0 auto;
  padding: 72px 0 120px;
}

.auth-card {
  padding: clamp(28px, 6vw, 54px);
  border: 1px solid #d0ddd8;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 64px rgb(20 33 29 / 9%);
  animation: workspaceSaveIn 480ms cubic-bezier(.22, 1, .36, 1) both;
}

.auth-card h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.1;
  word-break: keep-all;
}

.auth-email-form {
  margin-top: 32px;
}

.auth-confirm {
  margin-top: 30px;
}

.auth-back {
  display: inline-block;
  color: #0b5a49;
  font-weight: 800;
  text-underline-offset: 3px;
}

.auth-secondary-actions,
.results-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-secondary-actions {
  margin-top: 20px;
}

.auth-text-button,
.results-auth-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #0b5a49;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.results-auth-link {
  color: #31433d;
  font-weight: 750;
  text-decoration: none;
}

.results-auth-link:hover,
.results-auth-button:hover,
.auth-text-button:hover {
  color: #126552;
}

@keyframes workspaceSaveIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .workspace-save {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 24px 20px;
  }

  .workspace-save-actions,
  .auth-email-row {
    flex-direction: column;
  }

  .workspace-save-button {
    width: 100%;
  }

  .auth-main {
    padding-top: 34px;
  }

  .results-header-actions {
    justify-content: flex-end;
    gap: 10px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-save,
  .auth-card {
    animation: none;
  }

  .workspace-save-button {
    transition: none;
  }
}

.results-error {
  border: 1px solid #d9a6a0;
  color: #8a2e25;
}

.result-section {
  margin-top: 64px;
}

.result-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #cad6d1;
}

.result-section-heading h2 {
  margin: 0;
  font-size: 2rem;
}

.result-section-count {
  margin: 0;
  color: #60716b;
  font-weight: 700;
  text-align: right;
}

.result-card-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.result-card {
  padding: 28px;
  border: 1px solid #d8e1dd;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 36px rgb(20 33 29 / 6%);
}

.result-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.result-card-heading h3 {
  max-width: 720px;
  margin: 10px 0 0;
  font-size: 1.35rem;
  line-height: 1.45;
}

.result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-verdict {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e3f3ec;
  color: #0b5a49;
  font-size: .8rem;
  font-weight: 800;
}

.result-timing {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf2f0;
  color: #45534e;
  font-size: .8rem;
  font-weight: 800;
}

.timing-standing,
.timing-open {
  background: #e8f4ef;
  color: #0b5a49;
}

.timing-upcoming,
.timing-missing,
.timing-invalid {
  background: #fff3d6;
  color: #745310;
}

.verdict-unknown-need-answer,
.verdict-eligible-if,
.verdict-watchlist {
  background: #fff3d6;
  color: #745310;
}

.verdict-blocked,
.verdict-not-relevant {
  background: #f2f0ef;
  color: #665e5a;
}

.result-next-action {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #c9ddd5;
  border-radius: 14px;
  background: #f1f8f5;
}

.result-next-action.action-customer,
.result-next-action.action-grantseek {
  border-color: #e7d29f;
  background: #fff9e9;
}

.result-next-kicker {
  margin: 0 0 6px;
  color: #5f6f69;
  font-size: .78rem;
  font-weight: 800;
}

.result-next-action h4,
.result-ranking-reason h4 {
  margin: 0;
  font-size: 1rem;
}

.result-next-action > p:not(.result-next-kicker),
.result-ranking-reason p {
  margin: 7px 0 0;
  color: #40504b;
  line-height: 1.6;
}

.result-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  padding: 0 16px;
  border-radius: 10px;
  background: #0b4b3e;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.result-source-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  color: #0b5a49;
  font-weight: 800;
  text-underline-offset: 3px;
}

.result-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 0;
}

.result-facts div {
  padding: 14px;
  border-radius: 12px;
  background: #f5f8f6;
}

.result-facts dt {
  color: #66736f;
  font-size: .8rem;
  font-weight: 700;
}

.result-facts dd {
  margin: 5px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.result-checked-at {
  margin: 10px 0 0;
  color: #687871;
  font-size: .82rem;
}

.result-ranking-reason {
  margin-top: 20px;
  padding-left: 14px;
  border-left: 3px solid #8bb8aa;
}

.result-why,
.result-evidence,
.result-explanation-details {
  margin-top: 24px;
}

.result-details {
  margin-top: 22px;
  border-top: 1px solid #dfe8e4;
  padding-top: 18px;
}

.result-details summary {
  min-height: 44px;
  color: #0b5a49;
  font-weight: 800;
  cursor: pointer;
}

.result-why h4,
.result-evidence h4 {
  margin: 0 0 8px;
  font-size: .95rem;
}

.result-why p {
  margin: 0;
  color: #40504b;
  line-height: 1.65;
}

.result-why .result-action {
  margin-top: 8px;
  color: #7b4e16;
  font-weight: 700;
}

.result-explanation-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-explanation-group {
  padding: 14px;
  border-radius: 12px;
  background: #f8faf9;
}

.result-explanation-group h4 {
  margin: 0 0 8px;
  font-size: .88rem;
}

.result-explanation-group ul {
  margin: 0;
  padding-left: 18px;
  color: #596862;
  font-size: .86rem;
  line-height: 1.55;
}

.result-evidence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.result-evidence-list li {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e0e7e4;
  border-radius: 12px;
}

.result-evidence-list strong {
  font-size: .85rem;
}

.result-evidence-list span {
  color: #64716d;
  font-size: .85rem;
  line-height: 1.5;
}

.gate-pass strong { color: #0b6a54; }
.gate-unknown strong { color: #8a651c; }
.gate-block strong { color: #9b392e; }

.result-empty {
  margin: 0;
  padding: 24px;
  border-radius: 14px;
  background: #fff;
  color: #65736e;
}

.workspace-review-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #c8ddef;
  border-radius: 14px;
  background: #f4f9ff;
}

.workspace-review-copy h2,
.workspace-review-copy p,
.workspace-review-status {
  margin: 0;
}

.workspace-review-copy h2 {
  color: #17334f;
  font-size: 1rem;
  line-height: 1.45;
}

.workspace-review-copy p {
  margin-top: 5px;
  color: #587086;
  font-size: .88rem;
  line-height: 1.55;
}

.workspace-review-button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #3182f6;
  border-radius: 10px;
  background: #3182f6;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.workspace-review-button:disabled {
  cursor: wait;
  opacity: .62;
}

.workspace-review-button.is-saved {
  border-color: #b8d6ca;
  background: #eaf5f0;
  color: #0b6a54;
  cursor: default;
  opacity: 1;
}

.workspace-review-button:focus-visible {
  outline: 3px solid rgb(49 130 246 / 35%);
  outline-offset: 3px;
}

.workspace-review-status {
  grid-column: 1 / -1;
  min-height: 1.4em;
  color: #405a70;
  font-size: .88rem;
}

.workspace-review-status.is-error {
  color: #9b392e;
}

.feedback-panel {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #dfe8e4;
}

.feedback-panel-overall {
  margin-top: 72px;
  padding: 28px;
  border: 1px solid #c9ddd5;
  border-radius: 20px;
  background: #eaf5f0;
}

.feedback-panel h2,
.feedback-title {
  margin: 0;
  line-height: 1.4;
}

.feedback-panel h2 {
  font-size: 1.55rem;
}

.feedback-title {
  font-size: 1rem;
}

.feedback-panel > p,
.feedback-help {
  margin: 8px 0 0;
  color: #586a63;
  line-height: 1.55;
}

.feedback-controls {
  margin-top: 16px;
}

.feedback-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-chip {
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid #aebfb8;
  border-radius: 999px;
  background: #fff;
  color: #163f35;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.feedback-chip[aria-pressed="true"] {
  border-color: #0b4b3e;
  background: #0b4b3e;
  color: #fff;
}

.feedback-chip:focus-visible,
.feedback-save:focus-visible,
.feedback-delete:focus-visible,
.feedback-reason textarea:focus-visible {
  outline: 3px solid #69bca7;
  outline-offset: 3px;
}

.feedback-reason {
  margin-top: 16px;
}

.feedback-reason label {
  display: block;
  margin-bottom: 7px;
  font-weight: 750;
}

.feedback-reason textarea {
  box-sizing: border-box;
  width: 100%;
  max-width: 680px;
  min-height: 108px;
  padding: 12px 14px;
  border: 1px solid #aebfb8;
  border-radius: 12px;
  background: #fff;
  color: #14211d;
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

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

.feedback-save,
.feedback-delete {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.feedback-save {
  border: 1px solid #0b4b3e;
  background: #0b4b3e;
  color: #fff;
}

.feedback-delete {
  border: 1px solid #aebfb8;
  background: transparent;
  color: #7a302a;
}

.feedback-save:disabled,
.feedback-delete:disabled,
.feedback-chip:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.feedback-status {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: #40534c;
  font-size: .9rem;
}

.feedback-unavailable {
  opacity: .75;
}

@media (max-width: 680px) {
  .results-header {
    padding: 18px 20px;
  }

  .results-main {
    width: min(100% - 28px, 1040px);
    padding-top: 24px;
  }

  .results-hero h1 {
    font-size: 2.5rem;
  }

  .result-section-heading,
  .result-card-header {
    align-items: start;
    flex-direction: column;
  }

  .result-section-count {
    text-align: left;
  }

  .result-card {
    padding: 20px;
  }

  .workspace-review-panel {
    grid-template-columns: 1fr;
  }

  .workspace-review-button {
    width: 100%;
  }

  .workspace-review-status {
    grid-column: auto;
  }

  .result-primary-action {
    box-sizing: border-box;
    width: 100%;
  }

  .feedback-panel-overall {
    margin-top: 48px;
    padding: 20px;
  }

  .feedback-chip-group,
  .feedback-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .feedback-chip,
  .feedback-save,
  .feedback-delete {
    width: 100%;
  }

  .result-facts,
  .result-evidence-list,
  .result-explanation-details {
    grid-template-columns: 1fr;
  }
}
