:root {
  --red: #a6192e;
  --red-dark: #8a1526;
  --teal: #68d2df;
  --teal-light: #a3e2eb;
  --teal-pale: #d4eef2;
  --bg: hsl(180 52% 94%);
  --card: #fff;
  --border: hsl(180 30% 85%);
  --text: #1f2d2f;
  --muted: #5b6b6e;
  --amber-bg: #fff6e0;
  --amber: #8a5a00;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 50 50 / 0.06), 0 8px 24px -16px rgb(20 50 50 / 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}
h1 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin: 0; }
.center { text-align: center; align-items: center; }
.error { color: var(--danger); font-size: 13px; margin: 8px 0 0; }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 15px; }
.brand strong { font-weight: 600; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--red); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 6px; top: 8px; width: 14px; height: 12px; background: #fff; clip-path: polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%); }
.who { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 16px 0; box-shadow: var(--shadow); }
.card.narrow { max-width: 440px; margin: 48px auto; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap-row { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
label, .label { font-size: 13px; font-weight: 500; }

input, textarea {
  font: inherit; color: inherit; width: 100%;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: #fff;
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
textarea { resize: vertical; min-height: 72px; }
#search-form input { flex: 1; }

.btn {
  font: inherit; font-weight: 500; font-size: 14px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 10px; padding: 9px 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.btn:hover { background: var(--teal-pale); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.ghost { border-color: transparent; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn[disabled]:hover { background: #fff; }
.btn.primary[disabled]:hover { background: var(--red); }
.link { background: none; border: 0; padding: 0; color: var(--red); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* people results */
.people { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.person { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.person.selected { border-color: var(--teal); background: var(--teal-pale); }
.person .name { font-weight: 600; }
.person .deals { font-size: 12px; color: var(--muted); margin-top: 2px; }
.person .contact { font-size: 12px; color: var(--muted); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.chip[aria-checked="true"] { background: var(--text); color: #fff; border-color: var(--text); }

.client-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.run { margin: 6px 0 12px; }
.offline { background: var(--amber-bg); color: var(--amber); border-radius: 10px; padding: 8px 12px; margin: 8px 0 0; }

/* status */
.status { font-size: 14px; }
.status .line { display: flex; align-items: center; gap: 10px; }
.status .elapsed { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--teal-pale); border-top-color: var(--red); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
#view-verify .spinner { width: 28px; height: 28px; margin: 8px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.note.amber { background: var(--amber-bg); color: var(--amber); }
.note.red { background: #fdecec; color: var(--danger); }

/* property cards */
.props { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.props li { padding: 10px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-top: 1px solid var(--border); flex-wrap: wrap; }
.props li:first-child { border-top: 0; }
.props .addr { font-weight: 600; }
.props .sub { font-size: 12px; color: var(--muted); }
.props .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.props .value { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 14px; }
.badge { border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; font-size: 12px; background: #fff; }
.badge.ok { background: var(--teal-pale); border-color: var(--teal-light); }

/* skeleton while the worker runs (shape of the real cards) */
.skel { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.skel li { padding: 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; }
.skel li:first-child { border-top: 0; }
.bone { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #e3e3e3 25%, #f1f1f1 50%, #e3e3e3 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.bone + .bone { margin-top: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .bone, .spinner { animation: none; } }

/* report */
.report { margin-top: 12px; }
.frame-wrap { margin-top: 10px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.frame-wrap p { padding: 10px 12px; }
#report-frame { width: 100%; height: 70vh; min-height: 420px; border: 0; background: #fff; display: block; }

/* recent */
.recent { list-style: none; margin: 10px 0 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.recent li:first-child { border-top: 0; }
.recent .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.recent button { text-align: left; }
.foot { text-align: center; margin: 24px 0 40px; }
