/* ==========================================================================
   Tools — the hub and the pages under /tools.

   Built on the tokens already shipped by css/secilen.css (--c-*, --fs-*,
   --radius*, --gap-*, --shadow-*, .wrap) so a tool page reads as part of the
   site without restating the palette. css/hair-analysis.css stays separate:
   it owns the upload and report components that only that page has.

   Loaded after the shared sheets, so it wins where it overlaps.
   ========================================================================== */

:root {
  --tool-surface: #ffffff;
  --tool-surface-soft: #f3f8fb;
  --tool-surface-warm: var(--c-off-white);
  --tool-line: var(--c-border);
  --tool-ink: var(--c-dark);
  --tool-ink-soft: #4a6670;
  --tool-shadow: 0 1px 2px rgba(7, 95, 134, .06), 0 8px 28px rgba(7, 95, 134, .07);
}

/* ===== BREADCRUMBS ===== */

.crumbs {
  margin: 0 0 var(--gap-md);
}
.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  color: var(--tool-ink-soft);
}
/* The separator is drawn rather than written, so it never lands in a copied
   selection or in a screen reader's reading of the trail. */
.crumbs__item + .crumbs__item::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 10px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: .5;
}
.crumbs__link {
  color: inherit;
  text-decoration: none;
}
.crumbs__link:hover,
.crumbs__link:focus-visible {
  color: var(--c-primary-lt);
  text-decoration: underline;
}
.crumbs__current {
  color: var(--tool-ink);
  font-weight: var(--fw-medium);
}

/* ===== TOOL HERO ===== */

/* The site navbar is position:absolute, so every first section has to clear
   it by hand. Its height is 6em, dropping at the two layout breakpoints. */
.tool-hero {
  --tool-nav: 6em;
  background: linear-gradient(180deg, var(--tool-surface-soft) 0%, var(--c-white) 100%);
  padding: calc(var(--tool-nav) + 2.5rem) 0 3.5rem;
}
@media screen and (max-width: 991px) {
  .tool-hero { --tool-nav: 5em; }
}
@media screen and (max-width: 767px) {
  .tool-hero { --tool-nav: 4em; }
}
.tool-hero__intro {
  max-width: 46rem;
}
.tool-hero__title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 1.3rem + 2.6vw, var(--fs-h2));
  font-weight: var(--fw-black);
  line-height: 1.1;
  color: var(--tool-ink);
}
.tool-hero__lead {
  margin: 0 0 1.75rem;
  max-width: 62ch;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--tool-ink-soft);
}
.tool-hero__points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--gap-sm);
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}
.tool-hero__point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--tool-ink-soft);
}
.tool-hero__tick {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

/* ===== THE HUB ===== */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--gap-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tool-group + .tool-group {
  margin-top: 4rem;
}
.tool-group__head {
  margin-bottom: var(--gap-md);
  max-width: 54ch;
}
.tool-group__title {
  margin: 0 0 .5rem;
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  color: var(--tool-ink);
}
.tool-group__text {
  margin: 0;
  color: var(--tool-ink-soft);
  line-height: 1.6;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1.5rem;
  background: var(--tool-surface);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-lg);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-card:hover,
.tool-card:focus-within {
  transform: translateY(-2px);
  border-color: transparent;
  box-shadow: var(--tool-shadow);
}
.tool-card__icon {
  width: 36px;
  height: 36px;
  opacity: .85;
}
.tool-card__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  color: var(--tool-ink);
}
/* The whole card is the hit area; the link stays the only focusable thing in
   it, which is what keeps tabbing through the grid predictable. */
.tool-card__title a {
  color: inherit;
  text-decoration: none;
}
.tool-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.tool-card__text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--tool-ink-soft);
}
.tool-card__meta {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-primary);
}
/* A card that leads with a photograph, used where the grid holds a handful
   of items rather than a dozen. */
.tool-card.is-feature {
  grid-column: span 2;
  padding: 0 0 1.5rem;
  overflow: hidden;
}
.tool-card.is-feature > :not(.tool-card__image) {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}
.tool-card__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
@media screen and (max-width: 767px) {
  .tool-card.is-feature {
    grid-column: span 1;
  }
}
.tool-card__tag {
  align-self: flex-start;
  margin-top: auto;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-primary);
  background: var(--tool-surface-soft);
  border-radius: var(--radius-pill);
}

/* ===== SHARED TOOL CONTROLS ===== */

.tool-panel {
  padding: clamp(1.25rem, .6rem + 2vw, 2.5rem);
  background: var(--tool-surface);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--tool-shadow);
}
.tool-layout {
  display: grid;
  gap: var(--gap-md);
  align-items: start;
}
@media (min-width: 62rem) {
  .tool-layout {
    grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
  }
  .tool-layout__result {
    position: sticky;
    top: 7rem;
  }
}

.tool-field {
  display: block;
  margin-bottom: var(--gap-sm);
}
.tool-field__label {
  display: block;
  margin-bottom: .35rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
}
.tool-field__hint {
  margin: .35rem 0 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--tool-ink-soft);
}
.tool-field select,
.tool-field input[type="number"],
.tool-field input[type="text"],
.tool-field input[type="date"] {
  width: 100%;
  padding: .7rem .85rem;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--tool-ink);
  background: var(--c-white);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius);
}
.tool-field select:focus-visible,
.tool-field input:focus-visible {
  outline: 2px solid var(--c-primary-lt);
  outline-offset: 1px;
}

/* A row of radio cards. The input stays in the DOM and keeps focus; only its
   default box is hidden, so arrow keys still move between the options. */
.tool-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.tool-option {
  position: relative;
  display: block;
  padding: .85rem 1rem;
  background: var(--c-white);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.tool-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.tool-option__label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
}
.tool-option__note {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--tool-ink-soft);
}
.tool-option:hover {
  border-color: var(--c-primary-lt);
}
.tool-option:has(input:checked) {
  border-color: var(--c-primary);
  background: var(--tool-surface-soft);
}
.tool-option:has(input:focus-visible) {
  outline: 2px solid var(--c-primary-lt);
  outline-offset: 2px;
}

/* ===== RESULT TILES ===== */

.tool-result {
  padding: 1.5rem;
  color: var(--c-text-on-dark);
  background: linear-gradient(135deg, #075f86 0%, #07505a 100%);
  border-radius: var(--radius-lg);
}
.tool-result__label {
  margin: 0 0 .25rem;
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
}
.tool-result__value {
  margin: 0;
  font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  font-weight: var(--fw-black);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tool-result__note {
  margin: 1rem 0 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
  opacity: .88;
}
.tool-result__rows {
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, .22);
  display: grid;
  gap: .5rem;
  font-size: var(--fs-sm);
}
.tool-result__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.tool-result__row span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-semibold);
}
/* The row that is a conclusion rather than a component of the sum. */
.tool-result__row.is-total {
  margin-top: .35rem;
  padding-top: .6rem;
  border-top: 1px solid rgba(255, 255, 255, .22);
}
.tool-result__row.is-total span:last-child {
  color: var(--c-accent);
}

/* ===== TABLES ===== */

.tool-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-lg);
  background: var(--tool-surface);
}
.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.tool-table th,
.tool-table td {
  padding: .85rem 1rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
  border-bottom: 1px solid var(--tool-line);
}
.tool-table thead th {
  position: sticky;
  top: 0;
  background: var(--tool-surface-soft);
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
  white-space: nowrap;
}
.tool-table tbody tr:last-child td {
  border-bottom: 0;
}
.tool-table td.is-number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tool-table__muted {
  color: var(--tool-ink-soft);
}
/* A header a screen reader needs and a sighted reader does not: the first
   column of a comparison table is obvious on sight and unnamed without it. */
.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.tool-table th[scope="row"] {
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
}

/* ===== TIMELINE ===== */

.tool-timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 2rem;
  list-style: none;
}
.tool-timeline::before {
  content: "";
  position: absolute;
  top: .5rem;
  bottom: .5rem;
  left: 7px;
  width: 2px;
  background: var(--tool-line);
}
.tool-timeline__item {
  position: relative;
  padding-bottom: 1.75rem;
}
.tool-timeline__item::before {
  content: "";
  position: absolute;
  top: .45rem;
  left: -2rem;
  width: 16px;
  height: 16px;
  background: var(--c-white);
  border: 3px solid var(--c-primary);
  border-radius: 50%;
}
.tool-timeline__day {
  margin: 0 0 .15rem;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.tool-timeline__title {
  margin: 0 0 .3rem;
  font-size: 1.05rem;
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
}
.tool-timeline__text {
  margin: 0;
  line-height: 1.6;
  color: var(--tool-ink-soft);
}

/* ===== VERDICT / CALLOUT ===== */

.tool-verdict {
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--c-primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--tool-surface-soft);
}
.tool-verdict.is-warn {
  border-left-color: #b0781f;
  background: #fdf6e8;
}
.tool-verdict.is-stop {
  border-left-color: #a8372c;
  background: #fbefed;
}
.tool-verdict__label {
  margin: 0 0 .35rem;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tool-ink-soft);
}
.tool-verdict__title {
  margin: 0 0 .4rem;
  font-size: 1.1rem;
  font-weight: var(--fw-bold);
  color: var(--tool-ink);
}
.tool-verdict__text {
  margin: 0;
  line-height: 1.6;
  color: var(--tool-ink-soft);
}
.tool-verdict__list {
  margin: .9rem 0 0;
  padding-left: 1.1rem;
  line-height: 1.6;
  color: var(--tool-ink-soft);
}
.tool-verdict__item + .tool-verdict__item {
  margin-top: .5rem;
}
/* A reason that blocks surgery and one that merely complicates it have to
   look different, or the list reads as one undifferentiated warning. */
.tool-verdict__item.is-stop::marker {
  color: #a8372c;
}
.tool-verdict__item.is-warn::marker {
  color: #b0781f;
}
.tool-verdict__item.is-note {
  list-style: none;
  margin-left: -1.1rem;
  padding-top: .7rem;
  border-top: 1px solid var(--tool-line);
  font-size: var(--fs-sm);
}

/* A disclaimer sits under every estimate. It has to be readable, not hidden;
   it just must not compete with the number above it. */
.tool-disclaimer {
  margin: var(--gap-sm) 0 0;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--tool-ink-soft);
}

/* ===== STEPPED QUESTIONS ===== */

.tool-step[hidden] {
  display: none;
}
.tool-step__count {
  margin: 0 0 .5rem;
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tool-ink-soft);
}
.tool-step__question {
  margin: 0 0 1.25rem;
  font-size: clamp(1.2rem, 1rem + .8vw, 1.6rem);
  font-weight: var(--fw-bold);
  line-height: 1.25;
  color: var(--tool-ink);
}
.tool-progress {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-md);
}
.tool-progress[hidden] {
  display: none;
}
.tool-progress__track {
  flex: 1;
  height: 4px;
  background: var(--tool-line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.tool-progress__track > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--c-primary);
  border-radius: inherit;
  transition: width .25s ease;
}
.tool-progress__count {
  flex: none;
  margin: 0;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  color: var(--tool-ink-soft);
}

/* A step the visitor tried to skip. The cue is on the panel rather than the
   individual field because the step only ever holds one question. */
.is-missing [data-tool-step]:not([hidden]) .tool-field__label::after {
  content: " *";
  color: #a8372c;
}
.is-missing [data-tool-step]:not([hidden]) input:not(:placeholder-shown) {
  border-color: var(--tool-line);
}

/* A quieter button than .button, for "back" and "start again" — actions that
   should be available without competing with the one that moves forward. */
.tool-button {
  padding: .7rem 1.25rem;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
  background: none;
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.tool-button:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.tool-button[hidden] {
  display: none;
}

/* Height and weight are one question, so they sit on one row. */
.tool-field__pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--gap-sm);
}
.tool-field__sub {
  display: block;
}
.tool-field__sub > span {
  display: block;
  margin-bottom: .35rem;
  font-size: var(--fs-xs);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tool-ink-soft);
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-xs);
  margin-top: var(--gap-md);
}

/* ===== SCALE GALLERY ===== */

.scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: var(--gap-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}
.scale-card {
  padding: 1rem;
  text-align: center;
  background: var(--tool-surface);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-lg);
}
.scale-card__art {
  display: block;
  width: 100%;
  max-width: 9rem;
  margin: 0 auto .75rem;
  aspect-ratio: 1;
}
.scale-card__name {
  margin: 0 0 .25rem;
  font-size: 1rem;
  font-weight: var(--fw-bold);
  color: var(--tool-ink);
}
.scale-card__summary {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--tool-ink-soft);
}

/* The same gallery used as a picture-picker. Choosing from seven drawings is
   far more reliable than choosing from seven descriptions, which is why the
   hairline tool asks this way rather than with a dropdown. */
.scale-grid.is-compact {
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
}
.scale-card.is-choice {
  display: block;
  padding: .75rem;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.scale-card.is-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.scale-card.is-choice:has(input:checked) {
  border-color: var(--c-primary);
  box-shadow: inset 0 0 0 1px var(--c-primary);
}
.scale-card.is-choice:has(input:focus-visible) {
  outline: 2px solid var(--c-primary-lt);
  outline-offset: 2px;
}
.scale-card__image {
  display: block;
  width: 100%;
  margin: 0 auto .5rem;
  aspect-ratio: 1;
}
.scale-card__label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
}

/* ===== EMBEDDED TOUR ===== */

/* 16:9 with the iframe filling it, so the tour does not jump the layout
   while it loads. */
.tour-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--tool-surface-soft);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-lg);
}
.tour-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
@media screen and (max-width: 767px) {
  .tour-frame {
    aspect-ratio: 4 / 3;
  }
}

/* ===== CLOSING CTA ===== */

.tool-cta {
  padding: var(--section-pad) 0;
  background: var(--tool-surface-warm);
}
.tool-cta__panel {
  display: grid;
  gap: var(--gap-md);
  align-items: start;
}
@media (min-width: 62rem) {
  .tool-cta__panel {
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  }
}
.tool-cta__aside {
  padding: 1.5rem;
  background: var(--c-white);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-lg);
}
.tool-cta__aside-title {
  margin: 0 0 .5rem;
  font-size: 1.15rem;
  font-weight: var(--fw-bold);
  color: var(--tool-ink);
}
.tool-cta__aside-text {
  margin: 0 0 1.25rem;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--tool-ink-soft);
}

.tool-next {
  margin-bottom: var(--gap-md);
}
.tool-next__label {
  margin: 0 0 .6rem;
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tool-ink-soft);
}
.tool-next__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-xs);
}
.tool-next__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .5rem .9rem;
  font-size: var(--fs-sm);
  color: var(--c-primary);
  text-decoration: none;
  background: var(--c-white);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-pill);
}
.tool-next__link img {
  width: 16px;
  height: 16px;
}
.tool-next__link:hover,
.tool-next__link:focus-visible {
  border-color: var(--c-primary);
}

/* ===== PHOTO UPLOAD SLOTS ===== */

/* The skin and rhinoplasty tools both ask for photographs the same way: a
   row of framed slots, each checked on its own the moment it is filled, so a
   badly held camera is caught before the form is finished. */
.skin-uploads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--gap-sm);
}
.skin-upload {
  display: block;
  cursor: pointer;
}
.skin-upload__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  text-align: center;
  background: var(--tool-surface-soft);
  border: 2px dashed var(--tool-line);
  border-radius: var(--radius-lg);
  transition: border-color .18s ease;
}
.skin-upload:hover .skin-upload__frame,
.skin-upload input:focus-visible + .skin-upload__frame {
  border-color: var(--c-primary);
}
.skin-upload__preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.skin-upload__placeholder {
  padding: 0 .75rem;
  font-size: var(--fs-sm);
  color: var(--tool-ink-soft);
}
.skin-upload__caption {
  display: block;
  margin-top: .5rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
}
.skin-upload__status {
  display: block;
  margin-top: .2rem;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--tool-ink-soft);
}
.skin-upload.is-ok .skin-upload__frame {
  border-style: solid;
  border-color: var(--c-accent);
}
.skin-upload.is-bad .skin-upload__frame {
  border-color: #c0392b;
}
.skin-upload.is-bad .skin-upload__status {
  color: #c0392b;
}
.skin-upload.is-busy .skin-upload__frame {
  border-color: var(--c-primary-lt);
}

.skin-busy {
  text-align: center;
}

/* ===== FINDING CARDS ===== */

.skin-findings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: var(--gap-sm);
}
.skin-finding {
  padding: 1.25rem;
  background: var(--c-white);
  border: 1px solid var(--tool-line);
  border-left: 3px solid var(--tool-line);
  border-radius: var(--radius-lg);
}
/* The left edge carries the severity, so a reader can skim the column and
   see where the real problems are without reading a word. */
.skin-finding.is-mild { border-left-color: var(--c-accent); }
.skin-finding.is-moderate { border-left-color: #e8a33d; }
.skin-finding.is-marked { border-left-color: #c0392b; }
.skin-finding.is-none { opacity: .72; }
.skin-finding__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-xs);
  margin-bottom: .5rem;
}
.skin-finding__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: var(--fw-semibold);
  color: var(--tool-ink);
}
.skin-finding__badge {
  flex: none;
  font-size: var(--fs-xs);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tool-ink-soft);
}
.skin-finding__text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--tool-ink-soft);
}
.skin-finding__label {
  margin: .9rem 0 .35rem;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.skin-finding__links {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}
.skin-finding__links li + li {
  margin-top: .25rem;
}
.skin-finding__links a {
  color: var(--c-primary);
}

/* ===== ASSISTANT ===== */

.chat {
  max-width: 44rem;
  margin: 0 auto;
}
.chat__log {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  max-height: 60vh;
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--c-white);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-lg);
}
.chat__turn {
  max-width: 85%;
  padding: .9rem 1.1rem;
  border-radius: var(--radius-lg);
}
.chat__turn.is-user {
  align-self: flex-end;
  color: var(--c-white);
  background: var(--c-primary);
}
.chat__turn.is-bot {
  align-self: flex-start;
  background: var(--tool-surface-soft);
}
.chat__turn.is-pending {
  color: var(--tool-ink-soft);
  font-style: italic;
}
.chat__turn.is-error {
  background: #fdecea;
  color: #8a241a;
}
.chat__text {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.chat__text + .chat__text {
  margin-top: .75rem;
}
.chat__label {
  margin: .9rem 0 .3rem;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c-primary);
}
.chat__links {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}
.chat__links li + li {
  margin-top: .2rem;
}
/* The line that ends most honest answers: this depends on an examination. */
.chat__note {
  margin: .9rem 0 0;
  padding-top: .75rem;
  border-top: 1px solid var(--tool-line);
  font-size: var(--fs-xs);
  line-height: 1.55;
  color: var(--tool-ink-soft);
}

/* Suggested openings, hidden for good once the visitor has asked anything. */
.chat__starters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-xs);
  margin-top: var(--gap-sm);
}
.chat__starter {
  padding: .45rem .9rem;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--c-primary);
  cursor: pointer;
  background: var(--c-white);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius-pill);
}
.chat__starter:hover,
.chat__starter:focus-visible {
  border-color: var(--c-primary);
}

.chat__form {
  display: flex;
  align-items: flex-end;
  gap: var(--gap-xs);
  margin-top: var(--gap-sm);
}
.chat__form textarea {
  flex: 1;
  padding: .75rem .9rem;
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--tool-ink);
  background: var(--c-white);
  border: 1px solid var(--tool-line);
  border-radius: var(--radius);
  resize: vertical;
}
.chat__form textarea:focus-visible {
  outline: 2px solid var(--c-primary-lt);
  outline-offset: 1px;
}

/* ===== SECTION RHYTHM ===== */

.tool-section {
  padding: var(--section-pad) 0;
}
.tool-section.is-soft {
  background: var(--tool-surface-soft);
}
.tool-section__head {
  max-width: 54ch;
  margin-bottom: var(--gap-md);
}
.tool-section__title {
  margin: 0 0 .6rem;
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  color: var(--tool-ink);
}
.tool-section__text {
  margin: 0;
  line-height: 1.65;
  color: var(--tool-ink-soft);
}

/* Anything the tool writes only after a calculation stays out of the flow
   until there is something to say. */
[data-tool-empty] {
  color: var(--tool-ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .tool-progress__track > span {
    transition: none;
  }
}
