/* Rep view: deliberately an internal tool, distinct from the customer-facing site. */
:root {
  --bg: #f2f4f5;
  --panel: #fff;
  --ink: #15191c;
  --ink-2: #4a5359;
  --muted: #6d767c;
  --line: #e1e5e8;
  --accent: #1F866F;
  --accent-50: #e7f3ef;
  --warm: #b86e00;
  --hot: #1F866F;
  --top: #14191c;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #CD902C; outline-offset: 2px; }
.icon { flex: none; width: 16px; height: 16px; }

.rp-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--top); color: #fff; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.rp-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.rp-brand img { height: 30px; width: auto; }
.rp-pill { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; background: rgba(255, 255, 255, .12); padding: 3px 8px; border-radius: 4px; }
.rp-top-actions { display: flex; gap: 8px; }
.rp-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.rp-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.rp-btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .25); }
.rp-btn:disabled { opacity: .6; }

.rp-main { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 56px); }
@media (min-width: 980px) { .rp-main { grid-template-columns: 340px 1fr; } }

.rp-list { background: var(--panel); border-right: 1px solid var(--line); }
.rp-list-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.rp-list-head strong { color: var(--ink); font-size: 14px; }
.rp-list ul { list-style: none; margin: 0; padding: 0; }
.rp-item { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 3px; border-left: 3px solid transparent; }
.rp-item:hover { background: #f8fafa; }
.rp-item[aria-current="true"] { background: var(--accent-50); border-left-color: var(--accent); }
.rp-item-top { display: flex; justify-content: space-between; gap: 8px; }
.rp-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rp-item-mid { color: var(--ink-2); font-size: 13px; }
.rp-item-bot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.rp-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; }
.rp-badge .icon { width: 12px; height: 12px; }
.rp-badge-photo { background: #eef0ff; color: #4a4fb0; }
.rp-badge-booked { background: var(--accent-50); color: var(--accent); }
.rp-score { margin-left: auto; min-width: 30px; text-align: center; font-size: 12px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: #eceff1; color: var(--ink-2); }
.rp-score.is-warm { background: #fff1dc; color: var(--warm); }
.rp-score.is-hot { background: var(--accent); color: #fff; }

.rp-detail { padding: 16px; min-width: 0; }
@media (min-width: 980px) { .rp-detail { padding: 22px 28px; } }
.rp-back { display: none; align-items: center; gap: 4px; background: none; border: 0; color: var(--accent); font-weight: 600; padding: 6px 0; min-height: 40px; }
.rp-detail-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 16px; }
.rp-detail-head h1 { font-size: 22px; }
.rp-sub { color: var(--muted); font-size: 13.5px; }
.rp-head-actions { display: flex; align-items: center; gap: 10px; }
.rp-id { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.rp-grid { display: grid; gap: 14px; }
@media (min-width: 1200px) { .rp-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.rp-col { display: grid; gap: 14px; min-width: 0; }
.rp-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.rp-card h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 10px; }
.rp-card dl { margin: 0; }
.rp-row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid #f0f2f3; }
.rp-row:first-child { border-top: 0; }
.rp-row dt { color: var(--muted); }
.rp-row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.rp-tag { font-size: 11px; font-weight: 700; background: #eceff1; color: var(--ink-2); padding: 2px 6px; border-radius: 4px; margin-left: 4px; }
.rp-color { display: inline-flex; align-items: center; gap: 6px; }
.rp-color i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .15); }
.rp-price { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rp-muted { color: var(--muted); font-size: 13px; margin-top: 4px; }
.rp-image { margin: 0; padding: 8px; }
.rp-image img { border-radius: 4px; width: 100%; }
.rp-image figcaption { font-size: 12px; color: var(--muted); padding: 6px 4px 0; }
.rp-noimage { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.rp-slot { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }

.rp-signals-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rp-signals-head h2 { margin-bottom: 0; }
.rp-gauge { display: flex; align-items: baseline; gap: 2px; }
.rp-gauge strong { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.rp-gauge span { color: var(--muted); font-size: 13px; }
.rp-gauge.is-hot strong { color: var(--hot); }
.rp-gauge.is-warm strong { color: var(--warm); }
.rp-meter { height: 6px; background: #eceff1; border-radius: 6px; overflow: hidden; margin: 10px 0 12px; }
.rp-meter span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.rp-signals ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rp-signals li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.rp-signals li.is-on { color: var(--ink); font-weight: 600; }
.rp-check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #eceff1; color: #9aa3a9; }
.rp-signals li.is-on .rp-check { background: var(--accent); color: #fff; }
.rp-check .icon { width: 12px; height: 12px; stroke-width: 3; }
.rp-weight { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* SMS phone mock */
.phone { position: relative; width: 280px; max-width: 100%; margin: 12px auto 4px; border-radius: 36px; background: #0b0d0e; padding: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.phone-notch { position: absolute; top: 12px; left: 50%; width: 90px; height: 22px; margin-left: -45px; background: #0b0d0e; border-radius: 0 0 14px 14px; z-index: 1; }
.phone-head { background: #f6f6f7; border-radius: 26px 26px 0 0; padding: 30px 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; border-bottom: 1px solid #e3e3e6; font-size: 12px; }
.phone-avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; border: 1px solid #ddd; }
.phone-avatar img { width: 34px; }
.phone-body { background: #fff; border-radius: 0 0 26px 26px; padding: 10px 10px 18px; min-height: 360px; display: flex; flex-direction: column; gap: 6px; }
.phone-time { text-align: center; font-size: 10.5px; color: #8a8a8e; margin-bottom: 2px; }
.bubble { align-self: flex-start; max-width: 86%; background: #e9e9eb; color: #000; padding: 7px 11px; border-radius: 16px; font-size: 13px; line-height: 1.35; }
.bubble-img { align-self: flex-start; width: 86%; border-radius: 14px; border: 1px solid #e3e3e6; }

.rp-empty { grid-column: 1 / -1; max-width: 460px; margin: 80px auto; text-align: center; padding: 0 16px; }
.rp-empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-50); color: var(--accent); display: grid; place-items: center; margin: 0 auto 14px; }
.rp-empty-icon .icon { width: 26px; height: 26px; }
.rp-empty h1 { font-size: 22px; margin-bottom: 8px; }
.rp-empty p { color: var(--ink-2); margin-bottom: 18px; }
.rp-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Phone: list first, detail on tap. */
@media (max-width: 979px) {
  .rp-detail { display: none; }
  body.rp-show-detail .rp-list { display: none; }
  body.rp-show-detail .rp-detail { display: block; }
  body.rp-show-detail .rp-back { display: inline-flex; }
  .rp-row { grid-template-columns: 110px 1fr; }
}
