html {
  scroll-padding-top: 96px;
}

.estimate-rescue-page {
  background:
    linear-gradient(180deg, rgba(239, 246, 241, 0.9), rgba(247, 244, 238, 0.98)),
    var(--paper);
  overflow-x: hidden;
}

.estimate-rescue-shell {
  padding-top: 86px;
  overflow-x: hidden;
}

.estimate-rescue-hero {
  min-width: 0;
  padding: clamp(46px, 6vw, 66px) clamp(18px, 5vw, 72px) clamp(26px, 3vw, 34px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(32, 61, 52, 0.98), rgba(92, 119, 101, 0.8)),
    var(--forest);
}

.estimate-rescue-hero h1 {
  max-width: 1060px;
  margin-bottom: 22px;
  color: #fff;
  font-size: clamp(2.8rem, 5.2vw, 4.75rem);
  text-shadow: none;
}

.estimate-rescue-hero p:not(.section-kicker) {
  max-width: 840px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.62;
}

.estimate-rescue-workspace {
  display: grid;
  gap: clamp(22px, 3vw, 34px);
  min-width: 0;
  padding: clamp(30px, 4vw, 48px) clamp(18px, 5vw, 72px) clamp(34px, 5vw, 68px);
  background:
    radial-gradient(circle at 14% 6%, rgba(214, 168, 79, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(245, 249, 246, 0.94), rgba(255, 252, 246, 0.98));
}

.estimate-rescue-header {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(360px, 0.7fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: end;
  width: min(100%, 1280px);
  margin-inline: auto;
}

.estimate-rescue-header-copy {
  min-width: 0;
}

.estimate-rescue-header h2 {
  max-width: 760px;
  margin: 0;
  color: var(--forest);
  font-size: clamp(1.9rem, 3.2vw, 3.15rem);
  line-height: 1.08;
}

.estimate-rescue-header p:not(.section-kicker) {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.45vw, 1.28rem);
  font-weight: 700;
  line-height: 1.58;
}

.estimate-rescue-proof {
  display: grid;
  gap: 1px;
  min-width: 0;
  border: 1px solid rgba(32, 61, 52, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(32, 61, 52, 0.14);
}

.estimate-rescue-proof article {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.78);
}

.estimate-rescue-proof span {
  color: var(--clay);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.estimate-rescue-proof strong {
  color: var(--forest);
  font-size: clamp(1rem, 1.35vw, 1.24rem);
  line-height: 1.18;
}

.estimate-rescue-stage {
  display: none;
  place-items: center;
  min-width: 0;
}

.desktop-demo-app .estimate-detail-back {
  display: none;
}

.desktop-demo-app .estimate-action-card:hover,
.desktop-demo-app .estimate-action-card:focus-visible,
.desktop-demo-app .estimate-action-card.is-selected {
  border-color: rgba(18, 106, 91, 0.58);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 106, 91, 0.08);
}

.estimate-rescue-phone-unit {
  display: grid;
  gap: 16px;
  width: min(100%, 430px);
}

.estimate-rescue-phone-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  color: var(--forest);
}

.estimate-rescue-phone-label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.estimate-rescue-phone-label strong {
  display: block;
  font-size: 1.2rem;
}

.estimate-rescue-phone-label p {
  max-width: 210px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
}

.estimate-rescue-device {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: clamp(620px, 78vh, 760px);
  min-width: 0;
  border: 1px solid rgba(15, 24, 22, 0.22);
  border-radius: 34px;
  padding: 11px;
  background:
    linear-gradient(145deg, #24342f, #070b0a 62%),
    #111;
  box-shadow:
    0 28px 80px rgba(20, 36, 31, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.estimate-rescue-phone-top {
  display: flex;
  justify-content: space-between;
  padding: 7px 18px 9px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 850;
}

.estimate-rescue-screen {
  display: grid;
  gap: 12px;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  border-radius: 26px;
  padding: 16px;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8faf5, #eef4ee 54%, #f7f4ee);
  scrollbar-width: thin;
}

.estimate-rescue-screen.is-detail-open .estimate-scan-panel,
.estimate-rescue-screen.is-detail-open .estimate-metrics,
.estimate-rescue-screen.is-detail-open .estimate-priorities {
  display: none;
}

.estimate-rescue-screen.is-pending .estimate-metrics,
.estimate-rescue-screen.is-pending .estimate-priorities {
  display: none;
}

.estimate-rescue-screen.is-pending .estimate-app-header {
  display: none;
}

.estimate-rescue-screen.is-pending {
  align-content: start;
}

.estimate-rescue-screen.is-detail-open {
  display: block;
}

.estimate-rescue-screen:not(.is-detail-open) .estimate-detail {
  display: none;
}

.estimate-app-header,
.estimate-scan-panel,
.estimate-metrics,
.estimate-action-card,
.estimate-detail {
  border: 1px solid rgba(32, 61, 52, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.04);
}

.estimate-app-header {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.estimate-app-header img {
  width: 30px;
  height: 30px;
}

.estimate-app-header strong,
.estimate-app-header span {
  display: block;
}

.estimate-app-header strong {
  color: var(--forest);
  line-height: 1;
}

.estimate-app-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.estimate-scan-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(32, 61, 52, 0.97), rgba(143, 104, 50, 0.8)),
    var(--forest);
  color: #fff;
}

.estimate-scan-panel span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.estimate-scan-panel strong {
  display: block;
  margin-top: 3px;
  font-size: 1.34rem;
  line-height: 1.08;
}

.estimate-scan-panel p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.38;
}

.estimate-scan-button {
  width: fit-content;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  color: #1e1707;
  background: var(--gold);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 950;
}

.estimate-scan-button:disabled {
  cursor: default;
  opacity: 0.72;
}

.estimate-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.estimate-metrics div {
  display: grid;
  gap: 5px;
  align-content: center;
  justify-items: center;
  min-height: 62px;
  min-width: 0;
  padding: 10px 6px 11px;
  background: rgba(255, 255, 255, 0.66);
}

.estimate-metrics strong {
  display: block;
  color: var(--forest);
  font-size: 1.4rem;
  line-height: 1.16;
  font-variant-numeric: tabular-nums;
}

.estimate-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.estimate-priorities {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.estimate-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.estimate-section-heading strong {
  color: var(--forest);
}

.estimate-action-list {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.estimate-action-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  min-width: 0;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.estimate-action-card:hover,
.estimate-action-card:focus-visible,
.estimate-action-card.is-selected {
  border-color: rgba(214, 168, 79, 0.86);
  outline: none;
  background:
    linear-gradient(135deg, rgba(255, 247, 231, 0.78), rgba(255, 255, 255, 0.96)),
    #fff;
}

.estimate-rank {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  color: #1e1707;
  background: var(--gold);
  font-size: 0.82rem;
  font-weight: 950;
}

.estimate-card-copy {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.estimate-card-copy h3,
.estimate-card-copy p {
  margin: 0;
}

.estimate-card-copy h3 {
  color: var(--forest);
  font-size: 0.96rem;
  line-height: 1.18;
}

.estimate-card-copy p {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.estimate-card-meta,
.estimate-detail-meta,
.estimate-detail-actions,
.estimate-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.estimate-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--forest);
  background: rgba(111, 137, 119, 0.14);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.estimate-pill.is-hot {
  color: #8f2f1e;
  background: #fff0e8;
}

.estimate-pill.is-value {
  color: #755113;
  background: #fff7dc;
}

.estimate-detail {
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 14px 14px 22px;
  align-content: start;
  background: #fff;
}

.estimate-detail-back {
  width: fit-content;
  min-height: 34px;
  border: 0;
  padding: 0;
  color: var(--forest);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 950;
}

.estimate-detail-back::before {
  content: "<";
  margin-right: 7px;
}

.estimate-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  text-align: center;
}

.estimate-empty p,
.estimate-detail p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
  line-height: 1.45;
}

.estimate-detail h3 {
  margin: 0;
  color: var(--forest);
  font-size: 1.18rem;
  line-height: 1.16;
}

.estimate-detail-section {
  display: grid;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid rgba(32, 61, 52, 0.11);
}

.estimate-detail-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.estimate-detail-section p {
  color: var(--forest);
  font-weight: 600;
}

.estimate-message-draft {
  border: 1px solid rgba(32, 61, 52, 0.12);
  border-radius: 8px;
  padding: 11px;
  background: rgba(247, 244, 238, 0.82);
}

.estimate-sequence {
  align-items: stretch;
}

.estimate-sequence span {
  flex: 1 1 84px;
  border: 1px solid rgba(32, 61, 52, 0.12);
  border-radius: 8px;
  padding: 9px 8px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.estimate-detail-actions button {
  min-height: 38px;
  border: 1px solid rgba(32, 61, 52, 0.2);
  border-radius: 6px;
  padding: 0 11px;
  color: var(--forest);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 900;
}

.estimate-detail-actions button:first-child {
  border-color: var(--gold);
  color: #1e1707;
  background: var(--gold);
}

@media (max-width: 760px) {
  .estimate-rescue-header {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: center;
  }

  .estimate-rescue-header h2,
  .estimate-rescue-header p:not(.section-kicker) {
    margin-inline: auto;
  }

  .estimate-rescue-proof {
    width: min(100%, 430px);
    margin-inline: auto;
    text-align: left;
  }

  .estimate-rescue-stage {
    display: grid;
  }
}

@media (max-width: 620px) {
  .estimate-rescue-shell {
    padding-top: 78px;
  }

  .estimate-rescue-workspace {
    padding-inline: 16px;
  }

  .estimate-rescue-header h2 {
    font-size: 2rem;
  }

  .estimate-rescue-proof article {
    grid-template-columns: 1fr;
    gap: 5px;
    min-height: 0;
    padding: 14px;
  }

  .estimate-rescue-phone-label {
    display: grid;
  }

  .estimate-rescue-phone-label p {
    max-width: none;
    text-align: left;
  }

  .estimate-rescue-device {
    border-radius: 28px;
    padding: 8px;
  }

  .estimate-rescue-screen {
    height: auto;
    min-height: 0;
    border-radius: 22px;
    padding: 13px;
  }
}

@media (max-width: 560px) {
  .estimate-rescue-phone-unit {
    width: min(100%, calc(100vw - 56px), 340px);
  }
}
