/* Customer Flow Studio — lead response demo.
   Loaded after site.css and booking-demo.css (shared step, progress, choice
   and phone-frame patterns). Only lead-demo specifics live here. */

.ld-progress {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* The reveal and owner steps use the wider shell on desktop; the rest stay
   at a comfortable reading width, like the booking demo. */
.ld-welcome,
.ld [data-step="form"],
.ld [data-step="process"],
.ld [data-step="result"],
.ld [data-step="request"] {
  max-width: 680px;
  margin-inline: auto;
  width: 100%;
}

@media (min-width: 900px) {
  .ld-shell {
    max-width: 980px;
  }
  .ld .bd-top {
    max-width: 680px;
    margin-inline: auto;
    width: 100%;
  }
}

/* Customer quote form ------------------------------------------------------ */

.ld-quote {
  display: grid;
  gap: 16px;
}

.ld-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ld-opts--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ld-opts .bd-opt label {
  justify-content: center;
  text-align: center;
  padding: 10px 8px;
}

.ld-set[aria-invalid="true"] .bd-opt label {
  border-color: #b3261e;
}

.ld-quote textarea {
  min-height: 72px;
}

.ld-customer {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--tint-soft);
  font-size: 0.925rem;
}

.ld-customer span {
  color: var(--muted);
}

.ld-customer__list {
  display: grid;
  gap: 2px;
  margin: 4px 0 0;
}

.ld-customer__list div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}

.ld-customer__list dt {
  font-weight: 700;
  color: var(--muted);
}

.ld-customer__list dt::after {
  content: ":";
}

.ld-customer__list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ld-customer__note {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Simulation note ------------------------------------------------------------ */

.ld-sim {
  justify-self: start;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--sand);
  font-size: 0.9rem;
}

/* Reveal: customer / owner / system cards --------------------------------- */

.ld-cards {
  display: grid;
  gap: 12px;
}

@media (min-width: 900px) {
  .ld-cards {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
  }
  .ld-card--customer {
    grid-row: 1 / span 2;
  }
}

.ld-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}

.ld-card summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 14px 16px;
  list-style: none;
  cursor: pointer;
}

.ld-card summary::-webkit-details-marker {
  display: none;
}

.ld-card summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
  border-radius: var(--radius-lg);
}

.ld-card__num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 700;
}

.ld-card__who {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ld-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--teal-900);
}

.ld-card__body {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.ld-card__meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.ld-card__heading {
  font-weight: 700;
  color: var(--teal-900);
}

.ld-card__note {
  font-size: 0.85rem;
  color: var(--muted);
}

.ld-card .bd-link {
  justify-self: start;
}

/* Customer: warm */
.ld-card--customer {
  background: #fff4ea;
  border-color: rgba(194, 65, 12, 0.22);
}

.ld-card--customer .ld-card__num {
  background: var(--coral);
  color: #3a0d08;
}

.ld-msg {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid rgba(194, 65, 12, 0.18);
  font-size: 1rem;
  color: var(--ink);
}

/* Owner: teal */
.ld-card--owner {
  background: var(--teal-50);
  border-color: rgba(0, 107, 94, 0.3);
}

/* System: plain record */
.ld-card--system {
  background: var(--white);
  border-style: dashed;
  border-color: var(--line-strong);
}

.ld-card--system .ld-card__num {
  background: var(--teal-900);
}

.ld-kv {
  display: grid;
  gap: 6px;
  margin: 0;
}

.ld-kv div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  font-size: 0.925rem;
}

.ld-kv dt {
  font-weight: 700;
  color: var(--muted);
}

.ld-kv dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Tracker: a table when its box is wide, a card when it's narrow ----------- */

.ld-tracker {
  container-type: inline-size;
  overflow-x: auto; /* safety net for browsers without container queries */
}

.ld-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ld-table th,
.ld-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.ld-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
}

.ld-table td {
  overflow-wrap: anywhere;
}

.ld-table td.is-missing {
  color: #8c1d18;
  font-weight: 600;
}

@container (max-width: 759.98px) {
  .ld-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .ld-table,
  .ld-table tbody,
  .ld-table tr,
  .ld-table td {
    display: block;
  }
  .ld-table tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    overflow: hidden;
  }
  .ld-table td {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
  }
  .ld-table td:last-child {
    border-bottom: 0;
  }
  .ld-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

.ld-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--teal-50);
  color: var(--teal-900);
}

.ld-status--contacted {
  background: #e8ecf3;
  color: #24334a;
}

.ld-status--quoted {
  background: #fff1e6;
  color: #7a3508;
}

.ld-status--won {
  background: var(--teal);
  color: var(--cream);
}

.ld-status--lost {
  background: #eee9e2;
  color: #4a4038;
}

/* Owner console ------------------------------------------------------------- */

.ld-owner {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .ld-owner {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
    align-items: start;
  }
}

.ld-owner__main {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1px solid var(--line);
}

.ld-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ld-controls .btn {
  width: 100%;
  min-height: 46px;
}

.ld-controls .btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.ld-controls--minor {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.ld-controls--minor [hidden] {
  display: none;
}

.ld-hint {
  font-size: 0.9rem;
  color: var(--teal-900);
  font-weight: 600;
}

.ld-hint:empty {
  display: none;
}

.ld-owner__side {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line-strong);
  background: var(--white);
}

.ld-owner__side h3 {
  font-size: 1.15rem;
}

.ld-reminder {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--paper);
  font-size: 0.925rem;
}

.ld-reminder.is-on {
  border-left: 4px solid var(--coral);
  background: #fff4ea;
}

.ld-reminder--no-next-action.is-on {
  border-left-color: #b3261e;
  background: #fdecea;
}

.ld-reminder__tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ld-reminder__title {
  font-weight: 700;
  color: var(--ink);
}

.ld-reminder__when {
  font-size: 0.8rem;
  color: var(--muted);
}

.ld-reminder__none {
  color: var(--muted);
}

.ld-recap {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--teal-50);
  color: var(--teal-900);
  font-size: 0.95rem;
}

/* Current process ---------------------------------------------------------- */

.bd-callout[hidden] {
  display: none;
}

.ld-choices--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 600px) {
  .ld-choices--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.bd-define em,
.bd-num label em {
  font-style: normal;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--coral);
}

/* Sample request ------------------------------------------------------------ */

.ld-request-note {
  margin-top: -6px;
}

.ld-include-hint {
  margin-top: -14px;
  padding-left: 4px;
}

.bd-include input:disabled + label {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 359.98px) {
  .ld-controls {
    grid-template-columns: 1fr;
  }
  .ld-kv div {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.ld-table td .ld-status {
  justify-self: start;
}
