:root {
  --demo-phone-width: min(100%, 430px);
  --demo-phone-height: clamp(620px, 78vh, 760px);
  --demo-phone-radius: 34px;
  --demo-phone-screen-radius: 26px;
  --demo-app-card-border: rgba(32, 61, 52, 0.12);
  --demo-app-card-bg: rgba(255, 255, 255, 0.86);
}

.demo-view-toolbar {
  display: none;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  width: min(100%, 1480px);
  margin-inline: auto;
  border: 1px solid rgba(32, 61, 52, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.05);
}

.demo-view-toolbar-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.demo-view-toolbar-label strong {
  color: var(--forest);
  font-size: 0.92rem;
  line-height: 1.2;
}

.demo-view-toolbar-label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
}

.demo-view-segmented {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  border: 1px solid rgba(32, 61, 52, 0.16);
  border-radius: 8px;
  padding: 4px;
  background: rgba(247, 244, 238, 0.82);
}

.demo-view-segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 13px;
  color: var(--forest);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
}

.demo-view-segmented button.is-active {
  color: #1e1707;
  background: var(--gold);
  box-shadow: 0 5px 12px rgba(143, 104, 50, 0.16);
}

.reviews-phone-panel,
.phone-scanner-stage,
.estimate-rescue-stage,
.owner-brief-stage {
  justify-items: center;
}

.reviews-phone,
.scanner-device,
.estimate-rescue-device,
.owner-brief-device {
  display: flex;
  flex-direction: column;
  width: var(--demo-phone-width);
  height: var(--demo-phone-height);
  min-width: 0;
  border: 1px solid rgba(15, 24, 22, 0.22);
  border-radius: var(--demo-phone-radius);
  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);
}

.reviews-phone .phone-top,
.scanner-device .phone-top,
.estimate-rescue-phone-top,
.owner-brief-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;
}

.reviews-phone .phone-top {
  position: static;
}

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

.reviews-phone .phone-screen {
  position: static;
  inset: auto;
}

.owner-app-header,
.scanner-app-header,
.estimate-app-header,
.brief-app-header {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--demo-app-card-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--demo-app-card-bg);
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.04);
}

.owner-app-header img,
.scanner-app-header img,
.estimate-app-header img,
.brief-app-header img {
  width: 30px;
  height: 30px;
}

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

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

.owner-app-header span,
.scanner-app-header span,
.estimate-app-header span,
.brief-app-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: none;
}

.phone-review-feed-section,
.scanner-feed,
.estimate-priorities,
.brief-priorities {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--demo-app-card-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--demo-app-card-bg);
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.04);
}

.phone-review-home,
.phone-review-detail {
  display: grid;
  min-height: 0;
  overflow: auto;
}

.phone-review-home {
  grid-template-rows: minmax(0, 1fr);
}

.phone-review-list,
.phone-action-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

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

.phone-panel-title-row {
  display: grid;
  gap: 3px;
  align-items: start;
}

.phone-panel-title-row strong,
.scanner-section-heading strong,
.estimate-section-heading strong,
.brief-section-heading strong {
  color: var(--forest);
  font-size: 0.76rem;
  line-height: 1.15;
}

.phone-panel-title-row span,
.scanner-section-heading span,
.estimate-section-heading span,
.brief-section-heading span,
.phone-review-feed-hint {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.25;
  text-transform: none;
}

.phone-review-card,
.appointment-card,
.schedule-action-card,
.estimate-action-card,
.brief-action-card {
  border-color: var(--demo-app-card-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.phone-review-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 11px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.phone-review-card strong,
.phone-action-card strong {
  color: var(--forest);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.18;
}

.phone-review-card p,
.phone-action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.phone-review-meta,
.phone-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.phone-review-meta span,
.phone-action-meta span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--muted);
  background: rgba(247, 244, 238, 0.9);
  font-size: 0.68rem;
  font-weight: 900;
}

.phone-review-card.is-risk {
  border-color: rgba(174, 76, 61, 0.24);
  background: #fff8f5;
}

.phone-review-cta {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  border: 1px solid rgba(18, 106, 91, 0.28);
  border-radius: 999px;
  padding: 0 9px;
  color: #0b4b40;
  background: #eef7f4;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.phone-review-card:hover,
.phone-review-card:focus-visible,
.phone-review-card.is-selected,
.opportunity-card:hover,
.opportunity-card:focus-visible,
.opportunity-card.is-selected,
.estimate-action-card:hover,
.estimate-action-card:focus-visible,
.estimate-action-card.is-selected,
.brief-action-card:hover,
.brief-action-card:focus-visible,
.brief-action-card.is-selected {
  border-color: rgba(214, 168, 79, 0.9);
  outline: none;
  background:
    linear-gradient(135deg, rgba(255, 247, 231, 0.82), rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow: 0 0 0 3px rgba(214, 168, 79, 0.14);
}

.phone-review-detail,
.scanner-detail,
.estimate-detail,
.brief-detail {
  border: 1px solid var(--demo-app-card-border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(23, 33, 31, 0.04);
}

.phone-review-detail {
  align-content: start;
  gap: 10px;
}

.phone-detail-back,
.scanner-detail-back,
.estimate-detail-back,
.brief-detail-back {
  min-height: 34px;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 950;
}

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

.phone-review-detail h3 {
  margin: 0;
  color: var(--forest);
  font-size: 1.08rem;
  line-height: 1.14;
}

.phone-detail-review,
.phone-detail-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

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

.phone-detail-section strong {
  color: var(--forest);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.phone-detail-draft {
  border: 1px solid rgba(32, 61, 52, 0.12);
  border-radius: 8px;
  padding: 10px;
  background: #f7f4ee;
  color: var(--forest);
  font-weight: 700;
}

.phone-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phone-detail-actions button {
  min-height: 36px;
  border: 1px solid rgba(32, 61, 52, 0.16);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--forest);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
}

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

.estimate-phone-screen.is-detail-open {
  display: grid;
  background:
    linear-gradient(180deg, #f8faf5, #eef4ee 54%, #f7f4ee),
    #fff;
}

.estimate-phone-screen.is-detail-open .phone-review-home {
  display: none;
}

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

@media (min-width: 900px) {
  .demo-view-toolbar {
    display: flex;
  }

  body.demo-mobile-preview .reviews-workbench,
  body.demo-mobile-preview .reactivation-workbench,
  body.demo-mobile-preview .referral-workbench {
    grid-template-columns: minmax(280px, 430px);
    justify-content: center;
  }

  body.demo-mobile-preview .reviews-phone-panel,
  body.demo-mobile-preview .phone-scanner-stage,
  body.demo-mobile-preview .estimate-rescue-stage,
  body.demo-mobile-preview .owner-brief-stage {
    display: grid;
  }

  body.demo-mobile-preview .reviews-workbench > .action-center-demo,
  body.demo-mobile-preview .desktop-demo-app {
    display: none;
  }

  body.demo-desktop-preview .reviews-phone-panel,
  body.demo-desktop-preview .phone-scanner-stage,
  body.demo-desktop-preview .estimate-rescue-stage,
  body.demo-desktop-preview .owner-brief-stage {
    display: none;
  }
}

@media (max-width: 899px) {
  .demo-view-toolbar {
    display: none;
  }
}

@media (max-width: 620px) {
  .reviews-phone,
  .scanner-device,
  .estimate-rescue-device,
  .owner-brief-device {
    width: min(100%, calc(100vw - 56px), 360px);
    border-radius: 28px;
    padding: 8px;
  }

  .reviews-owner-screen,
  .scanner-screen,
  .estimate-rescue-screen,
  .owner-brief-screen {
    border-radius: 22px;
    padding: 13px;
  }
}
