/* The results screen. One accent family per page: the recommended service's tint. */
:where(.page, .estimator-admin) .block { margin-bottom: var(--s5); }
.quote { font-size: 18px; line-height: 28px; font-weight: 500; margin-bottom: var(--s2); }
.figure { font-size: 32px; line-height: 40px; font-weight: 600; margin-bottom: var(--s2); }
.stack { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s3); }

.accent { padding: var(--s4); border-radius: var(--r-card); }
.accent--plum { background: var(--plum-tint); }
.accent--blue { background: var(--blue-tint); }
.accent--yellow { background: var(--yellow-tint); }
.accent--teal { background: var(--teal-tint); }
.accent--green { background: var(--green-tint); }
.accent h2 { margin-top: 0; }

.savings__lead { margin: 0; font-size: 14px; line-height: 20px; color: var(--text-2); }
.savings__figure { margin: 0; font-size: 32px; line-height: 40px; font-weight: 600; }
.savings__sub { margin-bottom: var(--s3); }

.notice--fixed { margin-top: var(--s3); }
.notice--info { background: var(--info-bg); border-color: var(--info-line); }
.notice--ok { background: var(--ok-bg); border-color: var(--ok-line); }
.notice--warn { background: var(--warn-bg); border-color: var(--warn-line); }
.next-step { border-top: 1px solid var(--border); padding-top: var(--s4); }

/* The estimate at a glance: a large tinted panel, then plain sections with hairlines. */
.summary { margin-bottom: var(--s5); }
.summary__grid { display: grid; gap: var(--s3); margin: 0 0 var(--s3); }
.summary__grid dt { font-size: 14px; line-height: 20px; color: var(--text-2); }
.summary__grid dd { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; }
.summary__grid .summary__text { font-size: 18px; line-height: 28px; font-weight: 500; }
.summary .actions { margin-top: var(--s2); }
@media (min-width: 768px) { .summary__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .summary__wide { grid-column: span 1; } }

/* Folding sections: open on desktop, closed on phones until tapped. */
.fold { border-top: 1px solid var(--border); margin-bottom: var(--s4); }
.fold.accent { border-top: 0; }
.fold__summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); cursor: pointer; list-style: none; padding: var(--s2) 0; }
.fold__summary::-webkit-details-marker { display: none; }
.fold__summary h2 { margin: 0; font-size: 24px; line-height: 32px; }
.fold__summary::after { content: "+"; flex: none; font-size: 24px; font-weight: 600; }
.fold[open] > .fold__summary::after { content: "\2212"; }
.fold__summary:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.fold__body { padding-top: var(--s2); }

/* Savings range bar: one bar, conservative named first. */
.range { margin: var(--s3) 0; }
.range__bar { display: block; width: 100%; height: 16px; }
.range__track { fill: var(--blue); }
.range__marker { fill: var(--charcoal); }
.range__labels { display: grid; gap: var(--s2); margin-top: var(--s2); }
.range__labels p { margin: 0; display: flex; justify-content: space-between; gap: var(--s3); }
.range__name { color: var(--text-2); font-size: 14px; }
.range__value { font-weight: 600; }
.range__labels p:first-child .range__name { color: var(--charcoal); font-weight: 600; }
@media (min-width: 768px) { .range__labels { grid-template-columns: repeat(3, 1fr); } .range__labels p { flex-direction: column; justify-content: flex-start; gap: 0; } .range__labels p:nth-child(2) { text-align: center; } .range__labels p:nth-child(3) { text-align: right; } }
.workings { margin-top: var(--s3); }
.workings summary { cursor: pointer; font-weight: 600; color: var(--charcoal); text-decoration: underline; text-underline-offset: 3px; padding: var(--s1) 0; }

/* Before and after. */
.ba { display: grid; gap: var(--s3); align-items: start; }
.ba__title { margin: 0 0 var(--s2); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-2); }
.ba__list { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.pain { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s2) var(--s3); background: var(--white); border: 1px solid var(--border); border-radius: var(--r-control); }
.pain__name { font-weight: 600; }
.pain__label { align-self: flex-start; padding: 0 var(--s2); background: var(--yellow-tint); border-radius: var(--r-control); font-size: 14px; line-height: 20px; }
.ba__arrow { justify-self: center; color: var(--charcoal); transform: rotate(90deg); }
.ba__card { padding: var(--s4); background: var(--white); border: 2px solid var(--charcoal); border-radius: var(--r-card); }
.ba__card p { margin: 0 0 var(--s1); }
.ba__headline { font-size: 20px; line-height: 28px; font-weight: 600; }
.ba__name { font-weight: 500; }
@media (min-width: 768px) { .ba { grid-template-columns: 1fr auto 1fr; } .ba__arrow { transform: none; align-self: center; } }

/* Timeline: three bands in one row on desktop, stacked on phones. */
.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.journey__band { padding: var(--s3); border-radius: var(--r-card); border: 1px solid var(--border); background: var(--white); }
.journey__band h3 { margin: 0 0 var(--s2); font-size: 18px; line-height: 28px; }
.journey__band ul { margin: 0; padding-left: var(--s3); }
.journey__band li { margin-bottom: var(--s2); }
.journey__when { margin: 0 0 var(--s2); }
.journey__band--build { border-top: 4px solid var(--blue); }
.journey__band--support { background: var(--green-tint); border-color: var(--green-tint); border-top: 4px solid var(--charcoal); }
@media (min-width: 768px) { .journey { grid-template-columns: 1.2fr 1.4fr 1fr; } }

.email, .change { border-top: 1px solid var(--border); padding-top: var(--s4); }
.change__list { padding-left: var(--s4); margin: 0 0 var(--s3); }
.change__list li { margin-bottom: var(--s2); }

@media (max-width: 600px) {
  .table th, .table td { padding: var(--s2); font-size: 14px; }
  .figure, .savings__figure { font-size: 24px; line-height: 32px; }
}

/* The AI note: a quiet card that is clearly labelled as AI, separate from the recommended solution's accent colour. */
.ai-review { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: var(--r-card); padding: var(--s4); }
.ai-review h2 { margin-top: 0; }
.ai-review p:last-child { margin-bottom: 0; }
.ai-review__badge { display: inline-flex; align-items: center; gap: var(--s1); margin: 0 0 var(--s2); padding: 2px var(--s2) 2px 6px; border-radius: 999px; background: var(--tint); color: var(--charcoal); font-size: 12px; line-height: 20px; font-weight: 600; letter-spacing: 0.02em; }
.ai-review__wait { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); }
.ai-review__dots { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--blue); animation: ai-spin 0.9s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-review__dots { animation: none; border-top-color: var(--blue); } }
.ai-review { box-shadow: var(--shadow-1); }
.ai-review__icon { flex: none; }

/* Polish: the summary reads as one panel with clear figures, and the closing sections become quiet cards. */
.public .summary { border: 1px solid var(--border); box-shadow: var(--shadow-1); padding: var(--s5) var(--s4); }
.public .summary__grid dt { font-weight: 500; }
.public .summary__grid dd { font-size: 28px; line-height: 36px; letter-spacing: -0.01em; }
.public .summary .actions { margin-top: var(--s4); }
@media (min-width: 768px) {
  .public .summary__grid > div + div { border-left: 1px solid var(--border); padding-left: var(--s4); }
  .public .summary__grid dd { font-size: 32px; line-height: 40px; }
}
.public .fold__summary { padding: var(--s3) 0 var(--s2); }
.public .fold__summary::after { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 50%; font-size: 20px; line-height: 1; }
.public .fold__summary:hover::after { border-color: var(--charcoal); }
.public .accent.fold { box-shadow: var(--shadow-1); }
.public .journey__band { box-shadow: var(--shadow-1); }
.public .ba__card { box-shadow: var(--shadow-1); }
.public .next-step { border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s5) var(--s4); background: var(--white); box-shadow: var(--shadow-2); }
.public .next-step h2 { margin-top: 0; }
.public .table tbody tr:last-child th, .public .table tbody tr:last-child td { border-bottom: 0; }
.public .table th[scope="row"] { font-weight: 500; }

/* Things to discuss on the call: carried from the flags raised while answering. Icon-free here; the heading says what it is. */
.discuss-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.discuss-list__item { padding: var(--s3); border: 1px solid; border-left-width: 4px; border-radius: var(--r-control); color: var(--charcoal); }
.discuss-list__item--info { background: var(--info-bg); border-color: var(--info-line); }
.discuss-list__item--warn { background: var(--warn-bg); border-color: var(--warn-line); }

/* On a phone the workings table stacks: each row names itself, then lists its three figures with their scenario. FEEDBACK.md 3a. */
@media (max-width: 599px) {
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack th, .table--stack td { display: block; width: auto; }
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tr { padding: var(--s2) 0; border-bottom: 1px solid var(--border); }
  .table--stack tr:last-child { border-bottom: 0; }
  .public .table--stack th[scope="row"] { padding: 0 0 var(--s1); font-weight: 600; border: 0; }
  .public .table--stack td { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s1) 0; border: 0; }
  .table--stack td::before { content: attr(data-label); color: var(--text-2); }
}
