/* Live demo (simulator.js): the internal simulator's phone, chat and lock screen in the TradeReach style. */
.sim-band { padding: 88px 0 96px; background: linear-gradient(180deg, #fff, var(--tint)); border-bottom: 1px solid #e8ecf3; --sms: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --ios-blue: #0a6fd6; --sys: #646a73; }
.sim-head { max-width: 760px; }
.sim-head h2 { max-width: 20ch; }
.sim-tag { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 6px 14px; border-radius: 999px; background: #fff4d1; color: var(--amber-ink); box-shadow: inset 0 0 0 1px #f0d27a; font-size: .85rem; font-weight: 700; }
.sim-tag i { width: 8px; height: 8px; border-radius: 50%; background: #e0a800; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sim { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.sim-progress { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; counter-reset: p; }
.sim-progress li { counter-increment: p; display: grid; gap: 8px; min-width: 0; color: var(--muted); font-size: .82rem; }
.sim-progress li::before { content: ""; height: 5px; border-radius: 5px; background: var(--line); transition: background .4s; }
.sim-progress li b { font-weight: 600; }
.sim-progress li.done, .sim-progress li.now { color: var(--ink); }
.sim-progress li.done::before { background: var(--navy); }
.sim-progress li.now::before { background: var(--amber); }
.sim-progress li.now.urgent::before { background: var(--alarm); }

.sim-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 20px 0 24px; }
.sim-caption { margin: 0; min-height: 1.6em; font-size: 1.08rem; font-weight: 600; color: var(--ink); max-width: 56ch; }
.sim-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

.sim-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 40px; align-items: start; }
.sim-col { min-width: 0; }
.sim-side { display: grid; gap: 12px; }
.sim-label { margin: 0 0 10px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sim-side .sim-label { margin: 8px 0 -2px; }

/* Customer's phone: a messaging app */
.sim-phone { width: 100%; max-width: 360px; margin: 0 auto; background: #0d1216; border-radius: 46px; padding: 10px; box-shadow: var(--shadow); }
.sim-screen { position: relative; display: flex; flex-direction: column; height: 600px; border-radius: 37px; overflow: hidden; background: #fff; font-family: var(--sms); color: #111418; }
.sim-status { display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 4px; font: 600 .85rem/1 var(--sms); }
.sim-island { width: 92px; height: 26px; border-radius: 15px; background: #000; }
.sim-bars { display: flex; gap: 3px; align-items: flex-end; }
.sim-bars i { display: block; width: 3px; border-radius: 1px; background: currentColor; }
.sim-bars i:nth-child(1) { height: 5px; } .sim-bars i:nth-child(2) { height: 7px; } .sim-bars i:nth-child(3) { height: 9px; } .sim-bars i:nth-child(4) { height: 11px; }
.sim-thread-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 10px; border-bottom: .5px solid #d9dbe0; }
.sim-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(180deg, #a2a9b1, #868e97); color: #fff; font: 600 1rem/1 var(--sms); }
.sim-thread-head strong { font: 500 .78rem/1 var(--sms); }
.sim-chat { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; scroll-behavior: smooth; }
.sim-idle { margin: auto; display: grid; gap: 6px; text-align: center; color: var(--sys); font: 400 .9rem/1.4 var(--sms); max-width: 24ch; }
.sim-idle strong { color: #111418; font-weight: 600; }
.sim-idle-start { justify-self: center; margin-top: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: 700 .92rem var(--font); cursor: pointer; }
.sim-idle-start:hover { background: var(--navy-2); }
.sim-idle-start:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.sysline { align-self: center; text-align: center; padding: 6px 0 10px; font: 500 .72rem/1.35 var(--sms); color: var(--sys); }
.callrow { align-self: center; padding: 2px 0 12px; font: 500 .75rem/1 var(--sms); color: #ff3b30; }
.bubble { max-width: 80%; margin-top: 2px; padding: 8px 13px 9px; border-radius: 19px; font: 400 .95rem/1.32 var(--sms); overflow-wrap: anywhere; animation: sim-pop .25s cubic-bezier(.2, .8, .3, 1.2) both; transform-origin: bottom left; }
.bubble.in { align-self: flex-start; background: #e9e9eb; }
.bubble.out { align-self: flex-end; background: var(--ios-blue); color: #fff; transform-origin: bottom right; }
.bubble.gap { margin-top: 10px; }
.bubble.in.tail { border-bottom-left-radius: 5px; }
.bubble.out.tail { border-bottom-right-radius: 5px; }
.bubble .tag { display: block; margin-bottom: 3px; font: 700 .66rem/1.2 var(--sms); letter-spacing: .06em; text-transform: uppercase; color: #d70015; }
.receipt { align-self: flex-end; padding: 4px 4px 0; font: 500 .68rem/1 var(--sms); color: var(--sys); }
.typing { align-self: flex-start; display: flex; gap: 4px; margin-top: 10px; padding: 12px 14px; border-radius: 19px 19px 19px 5px; background: #e9e9eb; animation: sim-pop .2s ease-out both; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sys); animation: sim-blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sim-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@keyframes sim-pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

.sim-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 2px; border-top: .5px solid #e3e5e9; }
.sim-replies p { flex: 1 0 100%; margin: 0 0 2px; font: 600 .75rem/1.3 var(--sms); color: var(--sys); }
.sim-replies button, .sim-finish { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--ios-blue) 55%, transparent); background: #fff; color: var(--ios-blue); font: 600 .82rem/1 var(--sms); cursor: pointer; }
.sim-replies button:hover, .sim-finish:hover { background: color-mix(in srgb, var(--ios-blue) 8%, #fff); }
.sim-finish { align-self: center; margin: 6px 0 0; }
.sim-composer { display: flex; align-items: center; gap: 6px; margin: 8px 10px 18px; padding: 3px 3px 3px 14px; border: 1px solid #c9ccd2; border-radius: 22px; }
.sim-composer:focus-within { border-color: var(--ios-blue); }
.sim-composer input { flex: 1; min-width: 0; padding: 7px 0; border: 0; outline: none; background: transparent; font: 400 1rem/1.2 var(--sms); color: #111418; }
.sim-composer input::placeholder { color: var(--sys); }
.sim-composer input:disabled { cursor: not-allowed; }
.sim-composer button { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--ios-blue); color: #fff; cursor: pointer; }
.sim-composer button:disabled { background: #c4c7cd; cursor: default; }

/* Ringing overlay */
.sim-ring { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 110px 24px 60px; text-align: center; background: linear-gradient(180deg, #24364f, #0b1e3a); color: #f2f5f6; transition: opacity .35s; }
.sim-ring .who { position: relative; font: 400 1.9rem/1.1 var(--sms); }
.sim-ring .state { position: relative; font: 400 1rem/1.3 var(--sms); color: #b9c4ca; }
.sim-ring .end { margin-top: auto; display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: #ff3b30; }
.sim-ring .end svg { width: 30px; height: 30px; fill: #fff; transform: rotate(135deg); }
.sim-ring-pulse { position: absolute; top: 72px; left: 50%; width: 120px; height: 120px; margin-left: -60px; border-radius: 50%; border: 2px solid rgb(255 198 41 / .55); animation: sim-pulse 1.4s ease-out infinite; }
@keyframes sim-pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.sim-ring.fade { opacity: 0; }

/* Plumber's phone */
.sim-lock { display: grid; gap: 14px; padding: 20px 16px 18px; border-radius: 26px; background: radial-gradient(120% 80% at 20% 0%, #24364f, var(--navy) 60%); color: #f1f5f6; box-shadow: var(--shadow); }
.sim-lock-time { display: grid; gap: 4px; text-align: center; }
.sim-lock-time b { font: 600 2.6rem/1 var(--sms); letter-spacing: -.02em; }
.sim-lock-time span { font: 500 .82rem/1 var(--sms); color: var(--navy-ink); }
.sim-notif { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 18px; background: rgb(255 255 255 / .14); }
.sim-notif.pop { animation: sim-drop .45s cubic-bezier(.2, .8, .3, 1) both; }
.sim-notif img { width: 38px; height: 38px; border-radius: 9px; }
.sim-notif.urgent { background: rgb(198 42 29 / .45); }
.sim-notif-head { display: flex; justify-content: space-between; gap: 8px; font: 500 .74rem/1.2 var(--sms); color: var(--navy-ink); }
.sim-notif-title { margin-top: 2px; font: 600 .95rem/1.3 var(--sms); }
.sim-notif-body { font: 400 .9rem/1.35 var(--sms); color: #dfe6f2; overflow-wrap: anywhere; }
@keyframes sim-drop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Dashboard preview: the Leads view of the real dashboard */
.sim-dash-empty { margin: 0; padding: 28px 20px; border-radius: 18px; border: 1.5px dashed var(--line); color: var(--muted); text-align: center; }
.sim-dash { overflow: hidden; border-radius: 18px; background: var(--tint); box-shadow: var(--card), inset 0 0 0 1px var(--line); }
.sim-dash.enter { animation: sim-rise .5s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes sim-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.sim-dash-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--navy); color: #fff; font-weight: 700; font-size: .85rem; }
.sim-dash-top img { display: block; height: 26px; width: auto; border-radius: 5px; }
.sim-dash-top span { padding: 4px 12px; border-radius: 999px; background: rgb(255 255 255 / .12); box-shadow: inset 0 -2px 0 var(--amber); }
.sim-lead { margin: 14px; padding: 16px 18px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 8px; }
.sim-lead-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sim-lead-head small { color: var(--muted); font-size: .8rem; }
.sim-badge { padding: 5px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.sim-badge.new { background: #e3f3ea; color: #17704a; }
.sim-badge.urgent { background: #fff4d1; color: #7a5200; }
.sim-badge.emergency { background: var(--alarm); color: #fff; }
.sim-lead h3 { font-size: 1.25rem; }
.sim-lead-place { margin: 0; color: var(--muted); }
.sim-lead-job { margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--tint); overflow-wrap: anywhere; }
.sim-lead dl { margin: 4px 0 0; display: grid; gap: 4px; font-size: .92rem; }
.sim-lead dl div { display: flex; justify-content: space-between; gap: 12px; }
.sim-lead dt { color: var(--muted); }
.sim-lead dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.sim-lead-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 6px; }
.sim-lead-actions label { display: grid; gap: 2px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.sim-lead-actions select { min-height: 44px; padding: 0 10px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font: 600 .95rem var(--font); color: var(--ink); }
.sim-lead-actions .btn { min-height: 44px; padding: 0 16px; font-size: .92rem; }
.sim-action-note { margin: 0; min-height: 1.2em; font-size: .86rem; color: #17704a; }
.sim-history-box summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 700; font-size: .92rem; }
.sim-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.sim-history li { padding: 8px 10px; border-radius: 10px; background: var(--tint); overflow-wrap: anywhere; }
.sim-history li.from-caller { background: #e8f1ff; }
.sim-history b { display: block; font-size: .72rem; color: var(--muted); }

/* Result */
.sim-result { margin-top: 28px; padding: 24px; border-radius: 20px; background: var(--navy); color: #fff; }
.sim-result.enter, .sim-result:not([hidden]) { animation: sim-rise .5s cubic-bezier(.16, 1, .3, 1) both; }
.sim-result > p:first-child { margin: 0 0 16px; max-width: none; font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.2; }
.sim-result .btn-dark { background: var(--amber); color: var(--amber-ink); }
.sim-result .btn-dark:hover { background: #fff; color: var(--navy); }
.sim-result .btn-quiet { color: #fff; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .45); }
.sim-result .btn-quiet:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.sim-result-note { margin: 14px 0 0; font-size: .9rem; color: var(--navy-ink); }

.sim-how { margin-top: 40px; }
.sim-how h3 { font-size: 1.2rem; }
.sim-how ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.sim-how li { padding: 20px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.sim-how b { display: block; margin-bottom: 4px; color: var(--ink); }

@media (max-width: 960px) {
  .sim-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .sim-side { max-width: 460px; width: 100%; margin: 0 auto; }
  .sim-how ul { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sim-band { padding: 64px 0 72px; }
  .sim-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
  .sim-progress li { font-size: .76rem; }
  .sim-buttons, .sim-buttons .btn { width: 100%; }
}
@media (max-width: 400px) {
  .sim-phone { border-radius: 40px; padding: 8px; }
  .sim-screen { height: 560px; border-radius: 33px; }
  .sim-lead-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sim *, .sim *::before, .sim *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
