/* ============================================================
   SCTAssist demo page — page chrome + the mock comparables case.
   The mock is deliberately generic (slate/neutral), NOT Rightmove's
   look: same workflow, our own styling.
   ============================================================ */

.demo-page { background: var(--bg-subtle); }
.demo-main { padding-top: 84px; }
.demo-wide { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ── Intro + tour ── */
.demo-intro { padding: 40px 0 24px; }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-light); padding: 5px 12px; border-radius: var(--radius-pill); }
.demo-badge svg.lucide { width: 15px; height: 15px; }
.demo-intro h1 { font-size: clamp(30px, 4vw, 44px); margin: 14px 0 10px; }
.demo-lede { max-width: 760px; font-size: 17px; }
.demo-tour { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 24px; }
.demo-tour li { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px; transition: border-color .2s, background .2s; }
.demo-tour li b { display: block; font-size: 14px; color: var(--navy); line-height: 1.3; }
.demo-tour li small { display: block; font-size: 12px; color: var(--text-muted); line-height: 1.4; margin-top: 2px; }
.demo-tour__n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--bg-muted); color: var(--text-secondary);
  font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.demo-tour li.done { border-color: #bfe6d8; background: var(--green-light); }
.demo-tour li.done .demo-tour__n { background: var(--green); color: #fff; font-size: 0; }
.demo-tour li.done .demo-tour__n::after { content: "✓"; font-size: 14px; }

/* ── Browser-window frame ── */
.demo-stage { padding: 8px 0 40px; }
.demo-window { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); overflow: hidden; }
.demo-window__bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: #eef1f5; border-bottom: 1px solid var(--border); }
.demo-dots { display: flex; gap: 6px; }
.demo-dots i { width: 11px; height: 11px; border-radius: 50%; background: #d3d9e1; }
.demo-dots i:nth-child(1) { background: #f0a19b; } .demo-dots i:nth-child(2) { background: #f3cf7c; } .demo-dots i:nth-child(3) { background: #9ed49f; }
.demo-url { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-url svg.lucide { width: 13px; height: 13px; }
.demo-window__tag { font-size: 11.5px; font-weight: 600; color: var(--amber); background: var(--amber-light); padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.demo-window__body { display: flex; height: 780px; }
.demo-panel { flex: 0 0 380px; border-left: 1px solid #d6dce4; background: #f9f9f9; display: flex; }
.demo-panel iframe { border: 0; width: 100%; height: 100%; display: block; }

.demo-disclaimer { font-size: 12.5px; color: var(--text-muted); margin: 14px 4px 0; max-width: 980px; line-height: 1.6; }
.demo-cta { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 28px; }
.demo-cta h2 { font-size: 26px; margin-bottom: 4px; }
.demo-cta__btns { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1100px) { .demo-tour { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 980px) {
  .demo-window__body { flex-direction: column; height: auto; }
  .mock { height: 720px; }
  .demo-panel { flex: none; height: 720px; border-left: 0; border-top: 1px solid #d6dce4; }
  .demo-window__tag { display: none; }
}
@media (max-width: 640px) { .demo-tour { grid-template-columns: 1fr 1fr; } .demo-wide { padding: 0 12px; } }

/* ============================================================
   Mock comparables case
   ============================================================ */
.mock { flex: 1; min-width: 0; display: flex; flex-direction: column; font-family: var(--font-body); font-size: 13px; color: #24303c; background: #f3f5f8; }
.mock * { box-sizing: border-box; }
.mock h3, .mock h4 { font-family: var(--font-body); letter-spacing: 0; color: #24303c; }

.mk-top { flex: 0 0 auto; display: flex; align-items: center; gap: 18px; background: #2b3641; color: #fff; padding: 0 16px; height: 46px; }
.mk-logo { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mk-logo span { background: #f0b44c; color: #2b3641; font-size: 10.5px; font-weight: 800; padding: 2px 6px; border-radius: 4px; }
.mk-nav { display: flex; height: 100%; }
.mk-nav button { background: none; border: 0; color: #c4ccd5; font: inherit; font-weight: 600; padding: 0 14px; cursor: pointer; border-bottom: 3px solid transparent; }
.mk-nav button:hover { color: #fff; }
.mk-nav button.on { color: #fff; border-bottom-color: #f0b44c; }
.mk-case { margin-left: auto; font-size: 12px; color: #aab4bf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mk-body { flex: 1; overflow: auto; padding: 16px; position: relative; }
.mk-hint { background: #fff8e8; border: 1px solid #f1dcae; color: #7a5a17; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 12.5px; }

/* Comparables grid */
.mk-cols { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 12px; }
.mk-col { background: #fff; border: 1px solid #dfe4ea; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.mk-col--subject { border-color: #9fb3c8; box-shadow: inset 0 3px 0 #2b3641; }
.mk-col__photo { position: relative; aspect-ratio: 4/3; background: #dfe6ee; cursor: pointer; overflow: hidden; }
.mk-col__photo svg { width: 100%; height: 100%; display: block; transition: transform .25s; }
.mk-col__photo:hover svg { transform: scale(1.04); }
.mk-col__photo .mk-open { position: absolute; left: 8px; bottom: 8px; background: rgba(43,54,65,.85); color: #fff; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 5px; }
.mk-col__tag { position: absolute; top: 8px; left: 8px; background: #2b3641; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.mk-col__addr { padding: 10px 12px 4px; font-weight: 700; font-size: 13px; line-height: 1.35; min-height: 48px; }
.mk-price { margin: 4px 12px 8px; padding: 8px 10px; background: #f3f5f8; border-radius: 7px; }
.mk-price b { font-size: 16px; display: block; }
.mk-price small { color: #6b7886; font-size: 11.5px; }
.mk-attr { display: flex; justify-content: space-between; gap: 8px; padding: 5px 12px; border-top: 1px solid #f0f2f5; font-size: 12px; }
.mk-attr span:first-child { color: #6b7886; }
.mk-attr span:last-child { font-weight: 600; text-align: right; }

/* Detail view */
.mk-detail { display: grid; grid-template-columns: 1fr 260px; gap: 14px; }
.mk-detail__head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mk-back { background: #fff; border: 1px solid #dfe4ea; border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.mk-back:hover { background: #f3f5f8; }
.mk-detail__title { font-size: 15px; font-weight: 700; }
.mk-pager { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b7886; }
.mk-pager button { width: 26px; height: 26px; border: 1px solid #dfe4ea; background: #fff; border-radius: 6px; cursor: pointer; }
.mk-pager button:disabled { opacity: .4; cursor: default; }
.mk-card { background: #fff; border: 1px solid #dfe4ea; border-radius: 10px; overflow: hidden; }
.mk-tabs { display: flex; border-bottom: 1px solid #dfe4ea; overflow-x: auto; }
.mk-tabs button { background: none; border: 0; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: #6b7886; padding: 11px 14px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.mk-tabs button.on { color: #24303c; border-bottom-color: #f0b44c; }
.mk-tabs button.flash { background: #fff4d6; }
.mk-pane { padding: 14px; min-height: 330px; }
.mk-gallery { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.mk-gallery svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.mk-gallery__side { display: grid; gap: 8px; }
.mk-floorplan { display: flex; justify-content: center; }
.mk-floorplan svg { width: 100%; max-width: 560px; height: auto; }
.mk-desc { line-height: 1.7; color: #3b4753; max-width: 640px; }
.mk-desc h4 { font-size: 12px; letter-spacing: .06em; color: #6b7886; margin-bottom: 8px; }
.mk-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mk-table th, .mk-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef1f4; }
.mk-table th { color: #6b7886; font-weight: 600; width: 40%; }
.mk-facts .mk-attr { padding: 7px 12px; }
.mk-facts h4 { font-size: 12px; letter-spacing: .05em; color: #6b7886; padding: 12px 12px 6px; }

.mk-notes { grid-column: 1 / -1; }
.mk-notes label, .mk-report label { display: block; font-size: 12px; font-weight: 700; color: #4a5664; margin-bottom: 6px; }
.mk-notes textarea, .mk-report textarea { width: 100%; min-height: 110px; resize: vertical; overflow: hidden; font: inherit; font-size: 13px; line-height: 1.55;
  border: 1px solid #cfd6de; border-radius: 8px; padding: 10px 12px; background: #fff; color: #24303c; }
.mk-notes textarea:focus, .mk-report textarea:focus { outline: 2px solid #9fb3c8; outline-offset: 0; }
textarea.mk-flash, input.mk-flash { animation: mkflash 1.6s ease; }
@keyframes mkflash { 0% { background: #fff1c7; box-shadow: 0 0 0 3px #f0b44c55; } 100% { background: #fff; box-shadow: none; } }

/* Analysis */
.mk-analysis { display: grid; gap: 12px; max-width: 760px; }
.mk-an-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid #f0f2f5; flex-wrap: wrap; }
.mk-an-row:first-of-type { border-top: 0; }
.mk-an-title { flex: 0 0 120px; font-weight: 700; font-size: 12.5px; }
.mk-an-vals { flex: 1; font-size: 12px; color: #6b7886; min-width: 150px; }
.mk-an-opts { display: flex; gap: 6px; }
.mk-an-opts button { border: 1px solid #cfd6de; background: #fff; font: inherit; font-size: 12px; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.mk-an-opts button.on { background: #2b3641; border-color: #2b3641; color: #fff; }
.mk-an-opts button.pulse { animation: mkpulse 1s ease; }
@keyframes mkpulse { 0% { box-shadow: 0 0 0 0 #f0b44c; } 100% { box-shadow: 0 0 0 10px #f0b44c00; } }

/* Report */
.mk-report { display: grid; gap: 16px; max-width: 900px; }
.mk-report__comp { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: start; }
.mk-report__comp svg { width: 100%; border-radius: 6px; display: block; }
.mk-report__meta { font-size: 11.5px; color: #6b7886; margin-top: 4px; line-height: 1.4; }
.mk-report .mk-rationale { min-height: 220px; font-size: 13px; line-height: 1.6; border: 1px solid #cfd6de; border-radius: 8px; padding: 10px 12px;
  background: #fff; color: #24303c; white-space: pre-wrap; word-wrap: break-word; }
.mk-report .mk-rationale:focus { outline: 2px solid #9fb3c8; outline-offset: 0; }
.mk-report .mk-rationale:empty::before { content: attr(data-placeholder); color: #9aa5b1; }
.mk-rationale.mk-flash { animation: mkflash 1.6s ease; }
.mk-mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 1px #f0c43c; }
.mk-todo { font-size: 12px; margin: -2px 0 6px; }
.mk-todo.left { color: #8a5a00; }
.mk-todo.left::before { content: ""; display: inline-block; width: 10px; height: 10px; background: #ffe58a; border: 1px solid #f0c43c; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.mk-todo.ok { color: #1e8e3e; font-weight: 600; }
.mk-mv { display: flex; align-items: center; gap: 8px; }
.mk-mv input { font: inherit; border: 1px solid #cfd6de; border-radius: 8px; padding: 7px 10px; width: 160px; }

@media (max-width: 1250px) { .mk-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .mk-detail { grid-template-columns: 1fr; }
  .mk-report__comp { grid-template-columns: 1fr; }
  .mk-report__comp svg { max-width: 220px; }
  .mk-nav button { padding: 0 8px; }
  .mk-case { display: none; }
}

/* ── Coach: circles the next thing to click ── */
.coach-ring { position: fixed; z-index: 50; pointer-events: none; border: 3px solid #ff5a1f; border-radius: 12px;
  opacity: 0; transition: opacity .2s, left .25s, top .25s, width .25s, height .25s; animation: coachpulse 1.4s ease-out infinite; }
.coach-ring.on { opacity: 1; }
@keyframes coachpulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,31,.55); } 70% { box-shadow: 0 0 0 12px rgba(255,90,31,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,31,0); } }
.coach-tip { position: fixed; z-index: 51; pointer-events: none; background: #ff5a1f; color: #fff; font: 600 12.5px/1.3 var(--font-body);
  padding: 6px 10px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.18); max-width: 260px; opacity: 0; transition: opacity .2s; }
.coach-tip.on { opacity: 1; }
.coach-tip::before { content: ""; position: absolute; left: 50%; top: -6px; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: #ff5a1f; }
.coach-tip.side::before { left: auto; right: -6px; top: 50%; margin: -6px 0 0; border: 6px solid transparent; border-right: 0; border-left-color: #ff5a1f; }
.coach-tip.above::before { top: auto; bottom: -6px; border-bottom: 0; border-top: 6px solid #ff5a1f; }
.demo-tour li.current { border-color: #ff5a1f; box-shadow: 0 0 0 3px rgba(255,90,31,.15); }
.demo-tour li.current .demo-tour__n { background: #ff5a1f; color: #fff; }
@media (prefers-reduced-motion: reduce) { .coach-ring { animation: none; transition: opacity .2s; } }

.mk-toast { position: fixed; z-index: 60; transform: translate(-50%, -50%) scale(.9); background: #1e8e3e; color: #fff; font: 700 17px/1.2 var(--font-body);
  padding: 16px 26px; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.22); pointer-events: none; animation: mktoast .25s ease forwards; transition: opacity .4s; }
.mk-toast.out { opacity: 0; }
@keyframes mktoast { to { transform: translate(-50%, -50%) scale(1); } }
