/* T19 · feasibility wizard: labelled rail, mobile progress, spec sheet, memo. */

.wiz__rail { align-items: start; gap: 4px; }
.wiz__rail li { display: grid; flex: 1; justify-items: center; gap: 7px; text-align: center; }
.wiz__rail li b {
  max-width: 10ch;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.wiz__rail li.is-on b { color: var(--ink); }
.wiz__rail li.is-done b { color: var(--green); }
.wiz__rail span { width: 36px; height: 36px; }

.wiz__mobile { display: none; }
.wiz__mbar { height: 3px; overflow: hidden; border-radius: 3px; background: var(--rule); }
.wiz__mbar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .5s var(--e-out); }

.wiz .field > label { font-size: 15px; font-weight: 600; color: var(--ink); }
.wiz .input,
.wiz .textarea {
  width: 100%;
  border-radius: var(--r-sm);
  border: 1px solid var(--rule-2);
  background: var(--bone);
  color: var(--ink);
  font-size: 17px;
}
.wiz .input { height: 52px; min-height: 52px; padding: 0 16px; }
.wiz .textarea { min-height: 140px; padding: 14px 16px; line-height: 1.55; }
.wiz .input:focus,
.wiz .textarea:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.wiz .field.is-err .input,
.wiz .field.is-err .textarea { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.wiz .field__err { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--err); }
.wiz .req { color: var(--err); }

.wiz .tile__b { min-height: 56px; background: var(--bone); border-color: var(--rule-2); }
.wiz .tile__b i {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1.5px solid var(--rule-2);
  color: transparent;
}
.wiz .tile input:checked + .tile__b i { background: var(--green); border-color: var(--green); color: var(--bone); }

.fsum {
  display: grid;
  gap: 7px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border-left: 3px solid var(--err);
  border-radius: 8px;
  background: color-mix(in srgb, var(--err) 9%, var(--bone));
}
.fsum[hidden] { display: none; }
.fsum p { margin: 0; font-size: 14px; font-weight: 650; color: #8f2e1c; }
.fsum ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.fsum a { font-size: 14px; color: #8f2e1c; text-decoration: underline; text-underline-offset: 2px; }

/* Desktop: the spec card stays visible and updates in place. */
.ticket { position: sticky; top: calc(var(--hdr) + 24px); }
.ticket__sum {
  display: none;
  list-style: none;
  cursor: pointer;
}
.ticket__sum::-webkit-details-marker { display: none; }
.ticket__rows dd.is-new { animation: spec-flash .8s var(--e-out); }
@keyframes spec-flash {
  0% { color: var(--apricot); background: rgba(255, 179, 71, .14); }
  100% { color: inherit; background: transparent; }
}

/* The success panel is a stamped engineering memo, not a generic thank-you. */
.wiz-done {
  position: relative;
  display: grid;
  gap: 14px;
  justify-items: start;
  max-width: 760px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  background: var(--bone);
}
.wiz-done::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed var(--rule-2);
  pointer-events: none;
}
.memo__head { position: relative; z-index: 1; display: flex; align-items: start; justify-content: space-between; gap: 18px; width: 100%; }
.memo__stamp {
  flex: none;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 2px solid var(--err);
  border-radius: 50%;
  color: var(--err);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-9deg);
  box-shadow: inset 0 0 0 4px var(--bone), inset 0 0 0 5px currentColor;
  opacity: .82;
}
.wiz-done > * { position: relative; z-index: 1; }
.wiz-done .fdone__ref { margin: 0; font-size: 14px; color: var(--ink-2); }
.memo__verdict {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--green);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
.wiz-done a { color: var(--green); }

@media (max-width: 900px) {
  .wiz { padding-bottom: 104px; }
  .wiz__rail { display: none; }
  .wiz__mobile {
    display: grid;
    gap: 8px;
    margin: 0 0 24px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  .ticket {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    top: auto;
    z-index: 70;
    display: block;
    max-height: calc(100dvh - 120px);
  }
  .ticket__sum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 0 18px;
    border: 1px solid var(--line-d2);
    border-radius: 999px;
    background: var(--night);
    color: var(--on-night);
    font-size: 14px;
    font-weight: 650;
    box-shadow: var(--shadow-2);
  }
  .ticket__sum::after { content: "+"; font-size: 18px; line-height: 1; }
  .ticket[open] .ticket__sum::after { content: "–"; }
  .ticket:not([open]) .ticket__card,
  .ticket:not([open]) > .sm { display: none; }
  .ticket[open] .ticket__card {
    display: block;
    max-height: 58dvh;
    overflow: auto;
    margin-bottom: 8px;
    box-shadow: var(--shadow-3);
  }
  .ticket > .sm { padding: 0 8px; }
  .memo__stamp { width: 74px; height: 74px; font-size: 9px; }
}

@media (min-width: 901px) {
  details.ticket:not([open]) > .ticket__card,
  details.ticket:not([open]) > .sm { display: block; }
}

@media (max-width: 560px) {
  .wiz__sum { grid-template-columns: minmax(0, 1fr); }
  .wiz__act { flex-wrap: wrap; }
  .wiz__act .btn { width: 100%; justify-content: space-between; }
  .wiz__act #wizardNextBtn, .wiz__act #wizardSubmitBtn { margin-left: 0; }
  .memo__head { display: grid; }
}
@media (max-width: 900px) {
  .ticket { transition: transform .4s var(--e-out), opacity .3s; }
  .ticket.is-away:not([open]) { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
}

/* ---------- Wizard on a raised card; answer tiles light up when chosen ---------- */
.wiz__main { border: 1px solid transparent; border-radius: 30px;
  background: linear-gradient(180deg, #FFFDF9, var(--bone)) padding-box, linear-gradient(155deg, #fff, rgba(22, 32, 26, .1) 38%, rgba(255, 179, 71, .5)) border-box;
  box-shadow: inset 0 1px 0 #fff, 0 30px 60px -30px rgba(15, 23, 18, .28), 0 80px 120px -70px rgba(26, 67, 49, .35); }
.tile__b { border-radius: 18px; background: #FFFEFB; transition: transform .5s var(--e-out), border-color .3s, box-shadow .5s var(--e-out), background-color .3s, color .3s; }
.tile:hover .tile__b { transform: translateY(-4px); box-shadow: 0 18px 36px -20px rgba(15, 23, 18, .35); }
.tile input:checked + .tile__b { background: var(--green); border-color: var(--green); color: var(--on-night); box-shadow: 0 24px 44px -22px rgba(26, 67, 49, .7), inset 0 1px 0 rgba(255, 255, 255, .12); }
.tile input:checked + .tile__b > span { color: var(--on-night-2); }
.tile input:checked + .tile__b i { background: var(--apricot); border-color: var(--apricot); color: var(--apricot-ink); }
.wiz__rail li.is-on span { box-shadow: 0 0 0 6px rgba(255, 179, 71, .22); }
