.home-example {
  max-width: 48ch;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #425570;
}

.home-example h2 {
  color: var(--cream);
  font-size: 1.1rem;
  line-height: 1.4;
  letter-spacing: -.015em;
}

.home-example > p {
  margin-top: 8px;
  color: #c5ced8;
  font-size: .9rem;
  line-height: 1.55;
}

.home-example-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  margin-top: 10px;
}

.home-example-links a,
.home-example-links button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--cream);
  font-size: .83rem;
}

.home-example-links a:hover,
.home-example-links button:hover {
  color: var(--gold);
}

.home-example-links svg {
  width: 18px;
  height: 18px;
}

.hero-copy .home-example .fine {
  margin-top: 8px;
  color: #b2bfd0;
  font-size: .75rem;
}

.library-intro {
  padding-block: 48px 24px;
}

.library-intro h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
}

.library-intro .lead {
  margin-top: 16px;
}

.library-notice {
  max-width: 85ch;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.55;
}

.library-notice a {
  color: var(--slate);
}

.library-filters {
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 1fr);
  gap: 18px 24px;
  padding-block: 22px 12px;
}

.library-filters .search-field {
  grid-column: auto;
}

.more-filters {
  grid-column: 1 / -1;
  min-width: 0;
}

.more-filters summary {
  width: fit-content;
  min-height: 44px;
  padding-block: 10px;
  color: var(--slate);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}

.more-filters summary:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.more-filter-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-block: 12px 14px;
}

.library-layout .filter-meta {
  margin-block: 18px;
}

.filter-meta .active-filter-summary {
  max-width: none;
  margin-top: 4px;
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.library-source-check {
  margin-top: 24px;
}

.draft-memory {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.55;
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

@media (max-width: 900px) {
  .more-filter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .more-filter-fields .filter-baseline {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .home-example {
    margin-top: 24px;
    padding-top: 18px;
  }

  .library-intro {
    padding-block: 32px 20px;
  }

  .library-intro .lead {
    margin-top: 12px;
    font-size: 1rem;
  }

  .library-notice {
    margin-bottom: 20px;
    font-size: .83rem;
  }

  .library-filters,
  .more-filter-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .library-filters {
    padding-block: 18px 8px;
  }

  .more-filter-fields {
    padding-top: 8px;
  }

  .library-layout .filter-meta {
    align-items: center;
    margin-block: 14px;
  }
}

/* Guided discovery */
.discovery-page {
  max-width: 1180px;
}

.discovery-page .tool-intro {
  padding-bottom: 36px;
}

.discovery-page .tool-intro h1 {
  max-width: 12ch;
}

.discovery-page .tool-intro .lead {
  max-width: 54ch;
}

.restore-note {
  margin: 0 0 28px 300px;
}

.discovery-grid {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 58px;
}

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

.discovery-progress {
  position: sticky;
  top: 28px;
  align-self: start;
}

.discovery-progress ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: path;
}

.discovery-progress li {
  position: relative;
}

.discovery-progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 45px;
  bottom: -13px;
  left: 14px;
  width: 1px;
  background: var(--rule);
}

.discovery-progress button {
  display: grid;
  grid-template-columns: 29px 1fr;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 58px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--muted);
  text-align: left;
  font-size: .82rem;
}

.discovery-progress button span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--cream);
  font-variant-numeric: tabular-nums;
  font-size: .74rem;
}

.discovery-progress button[aria-current="step"] {
  color: var(--navy);
  font-weight: 700;
}

.discovery-progress button[aria-current="step"] span {
  border-color: var(--gold);
  background: var(--navy);
  color: var(--cream);
}

.discovery-progress button:disabled {
  opacity: 1;
  cursor: default;
}

.discovery-page .form-surface {
  min-height: 560px;
  padding: 44px;
}

.discovery-page .form-surface > .lead {
  max-width: 62ch;
  margin-bottom: 34px;
}

.area-choices,
.situation-choices,
.route-choices,
.destination-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-card {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  cursor: pointer;
}

.choice-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.choice-card > span {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 18px 19px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.choice-card strong {
  color: var(--navy);
  font-size: .95rem;
  line-height: 1.42;
}

.choice-card small {
  margin-top: 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 400;
  line-height: 1.48;
}

.choice-card:hover > span {
  border-color: #718097;
  background: #f5f6f3;
}

.choice-card input:focus-visible + span {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}

.choice-card input:checked + span {
  border-color: var(--gold);
  background: var(--navy);
}

.choice-card input:checked + span strong {
  color: var(--cream);
}

.choice-card input:checked + span small {
  color: #c7d1dd;
}

.situation-choices,
.route-choices,
.destination-choices {
  grid-template-columns: 1fr;
}

.situation-choices .choice-card > span,
.route-choices .choice-card > span,
.destination-choices .choice-card > span {
  min-height: auto;
  padding: 17px 20px;
}

.selection-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: .8rem;
  text-align: right;
}

.constraint-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
}

.constraint-choices .choice-card > span {
  display: block;
  min-height: 58px;
  padding: 16px;
}

.secondary-area,
.deadline-field,
.discovery-context {
  margin-top: 30px;
}

.discovery-result {
  min-width: 0;
}

.result-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: start;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--rule);
}

.result-heading h2 {
  margin-top: 18px;
  max-width: 15ch;
}

.result-heading .lead {
  margin-top: 16px;
  max-width: 55ch;
}

.route-result {
  position: relative;
  margin-block: 34px;
  padding: 32px;
  border-radius: 8px;
  background: var(--navy);
  color: #d2dbe5;
  overflow: hidden;
}

.route-result::after {
  content: "";
  position: absolute;
  right: -65px;
  bottom: -94px;
  width: 240px;
  height: 240px;
  border: 1px solid #3e5571;
  border-radius: 50%;
  box-shadow: inset 0 0 0 38px var(--navy), inset 0 0 0 39px #3e5571, inset 0 0 0 78px var(--navy), inset 0 0 0 79px #3e5571;
  pointer-events: none;
}

.route-result > * {
  position: relative;
  z-index: 1;
  max-width: 64ch;
}

.route-label {
  color: #68788b;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.route-result .route-label {
  color: var(--gold);
}

.route-result h3 {
  margin-top: 8px;
  color: var(--cream);
  font-size: clamp(1.55rem, 2.5vw, 2.25rem);
}

.route-result > p:not(.route-label) {
  margin-top: 12px;
}

.route-why {
  color: #b9c6d5;
  font-size: .84rem;
}

.route-why strong {
  color: var(--cream);
}

.secondary-route {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #415670;
}

.secondary-route strong {
  color: var(--cream);
}

.secondary-route p {
  margin-top: 5px;
  font-size: .85rem;
}

.result-section {
  padding-block: 34px;
  border-top: 1px solid var(--rule);
}

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

.result-section h3,
.ai-prompt-section h3 {
  margin-top: 7px;
  font-size: 1.45rem;
}

.result-section > p:not(.route-label),
.result-intro {
  margin-top: 12px;
  color: var(--muted);
}

.artifact-lines,
.result-questions {
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}

.artifact-lines li,
.result-questions li {
  padding: 15px 0;
  border-bottom: 1px solid var(--rule);
  color: #2e4055;
  overflow-wrap: anywhere;
}

.result-questions {
  counter-reset: result-question;
}

.result-questions li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  counter-increment: result-question;
}

.result-questions li::before {
  content: counter(result-question);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--navy);
  font-size: .75rem;
  font-weight: 700;
}

.reference-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 25px;
}

.reference-card {
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  border-top: 2px solid var(--navy);
  min-width: 0;
}

.reference-card h3 {
  margin-top: 14px;
  font-size: 1.02rem;
}

.reference-card > p {
  margin-top: 14px;
  color: var(--muted);
  font-size: .82rem;
}

.reference-card .reference-publisher {
  margin-top: 5px;
  color: var(--muted);
  font-size: .72rem;
}

.reference-card .reference-limit {
  padding-top: 13px;
  border-top: 1px solid var(--rule);
}

.reference-card > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  color: var(--slate);
  font-size: .82rem;
  font-weight: 700;
}

.reference-card > a svg {
  width: 17px;
  height: 17px;
}

.reference-card .reference-status {
  margin-top: 12px;
  font-size: .68rem;
  line-height: 1.5;
}

.known-unknown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 26px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.known-unknown > div {
  padding: 22px;
  background: var(--soft);
}

.known-unknown p {
  margin-top: 8px;
  color: var(--muted);
  font-size: .84rem;
}

.ai-prompt-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  margin-top: 10px;
  padding: 30px;
  background: #e5eae9;
}

.ai-prompt-section p:not(.route-label) {
  margin-top: 9px;
  color: var(--muted);
  font-size: .86rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 13px 18px;
  padding-top: 34px;
}

.save-discovery {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 0 auto;
  font-size: .8rem;
  font-weight: 500;
}

.save-discovery input {
  margin: 0;
}

@media (max-width: 1000px) {
  .discovery-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .restore-note {
    margin-left: 0;
  }

  .discovery-progress {
    position: static;
  }

  .discovery-progress ol {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .discovery-progress li:not(:last-child)::after {
    top: 24px;
    bottom: auto;
    left: calc(50% + 15px);
    right: calc(-50% + 15px);
    width: auto;
    height: 1px;
  }

  .discovery-progress button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-height: 75px;
    text-align: center;
    line-height: 1.3;
  }

  .reference-list {
    grid-template-columns: 1fr;
  }

  .reference-card {
    padding-bottom: 22px;
  }
}

@media (max-width: 650px) {
  .discovery-page .tool-intro {
    padding-bottom: 27px;
  }

  .discovery-page .form-surface {
    min-height: 0;
    padding: 25px 18px;
  }

  .discovery-progress button {
    font-size: .65rem;
  }

  .discovery-progress button span {
    width: 26px;
    height: 26px;
  }

  .area-choices,
  .constraint-choices {
    grid-template-columns: 1fr;
  }

  .choice-card > span {
    padding: 16px;
  }

  .result-heading,
  .ai-prompt-section {
    grid-template-columns: 1fr;
  }

  .result-heading .plain-button {
    width: fit-content;
  }

  .route-result {
    padding: 25px 20px;
  }

  .route-result::after {
    opacity: .45;
  }

  .result-section-heading {
    display: block;
  }

  .result-section-heading .plain-button {
    margin-top: 8px;
  }

  .known-unknown {
    grid-template-columns: 1fr;
  }

  .ai-prompt-section {
    padding: 24px 20px;
  }

  .ai-prompt-section .button {
    width: 100%;
  }

  .save-discovery {
    width: 100%;
    margin-left: 0;
  }
}

@media print {
  .discovery-page .tool-intro,
  .restore-note,
  .discovery-progress,
  .result-actions,
  .discovery-result .no-print {
    display: none !important;
  }

  .discovery-page,
  .discovery-grid {
    width: 100%;
    display: block;
    padding: 0;
  }

  .discovery-page .form-surface {
    padding: 0;
    border: 0;
  }

  .route-result {
    background: #fff;
    color: #000;
    border: 1px solid #777;
  }

  .route-result h3,
  .route-result .route-label,
  .route-result .route-why,
  .route-result .route-why strong,
  .secondary-route strong {
    color: #000;
  }

  .route-result::after {
    display: none;
  }

  .reference-list {
    grid-template-columns: 1fr;
  }

  .reference-card {
    break-inside: avoid;
  }
}
