/* LeadAdvance app UI. System fonts, no external assets. */
:root {
  --bg: #f6f7f9; --surface: #fff; --text: #1d2433; --muted: #667085; --line: #e4e7ec;
  --primary: #3b5bdb; --primary-dark: #2f4ac0; --primary-soft: #edf1ff;
  --ok: #12805c; --ok-soft: #e6f6ef; --warn: #b54708; --warn-soft: #fff4e5;
  --err: #c0362c; --err-soft: #fdecea; --info-soft: #eef4ff;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; }
pre { white-space: pre-wrap; word-break: break-word; margin: .25rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { word-break: break-word; }
.center { text-align: center; }
.inline { display: inline; }
.empty { color: var(--muted); text-align: center; padding: 1.5rem; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--primary); }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav > a, .nav .linkish { padding: .4rem .65rem; border-radius: 8px; color: var(--text); }
.nav > a:hover, .nav .linkish:hover { background: var(--bg); text-decoration: none; }
.nav > a.active { background: var(--primary-soft); color: var(--primary); }
.nav > a.btn { color: #fff; }
.badge { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 99px; background: var(--err); color: #fff; font-size: .75rem; text-align: center; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.subnav { background: var(--surface); border-bottom: 1px solid var(--line); }
.subnav-inner { max-width: 1160px; margin: 0 auto; padding: 0 16px; display: flex; gap: .25rem; overflow-x: auto; }
.subnav a { padding: .6rem .75rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.impersonation-bar { background: #fff4e5; color: var(--warn); text-align: center; padding: .45rem 16px; font-size: .9rem; border-bottom: 1px solid #f5d9b3; }

/* Layout */
.container { max-width: 1160px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.grid-2, .grid-3 { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2 + *, .grid-3 + * { margin-top: 1rem; }
.card.narrow { max-width: 440px; margin: 2rem auto; }
.hero { text-align: center; max-width: 760px; margin: 2.5rem auto 2rem; }
.hero h1 { font-size: 2.2rem; line-height: 1.2; }
.lead { font-size: 1.1rem; color: var(--muted); }

/* Buttons */
.btn { display: inline-block; background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: 8px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-small { padding: .3rem .65rem; font-size: .85rem; }
.btn-large { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-light { background: #fff; color: var(--warn); border-color: #f5d9b3; }
.btn-light:hover { background: #fff8ee; }
.btn-danger { background: #fff; color: var(--err); border-color: #f3c2bd; }
.btn-danger:hover { background: var(--err-soft); }

/* Forms */
.form { display: grid; gap: .9rem; }
.form-compact { gap: .6rem; }
.field { display: grid; gap: .3rem; }
.field > span { font-size: .85rem; font-weight: 600; color: #344054; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=month], select, textarea {
  width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input:disabled { background: var(--bg); color: var(--muted); }
textarea.mono { font-size: .82rem; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.check { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-inline, .search-inline { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; }
.form-inline label { display: grid; gap: .25rem; font-size: .85rem; font-weight: 600; }
.form-inline input, .form-inline select { width: auto; }
.search-inline input { width: auto; min-width: 220px; }
table select { width: auto; padding: .3rem .5rem; font-size: .85rem; }

/* Alerts & pills */
.alert { border-radius: 8px; padding: .7rem .9rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: #b7e4cf; }
.alert-error { background: var(--err-soft); color: var(--err); border-color: #f3c2bd; }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: #f5d9b3; }
.alert-info { background: var(--info-soft); color: var(--primary); border-color: #c9d6ff; }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; color: #344054; }
a.pill:hover { text-decoration: none; background: var(--primary-soft); }
.pill-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-done { background: var(--ok-soft); color: var(--ok); border-color: #b7e4cf; }
.pill-failed { background: var(--err-soft); color: var(--err); border-color: #f3c2bd; }
.pill-running { background: var(--info-soft); color: var(--primary); border-color: #c9d6ff; }
.pill-queued { background: var(--warn-soft); color: var(--warn); border-color: #f5d9b3; }
.filters { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .5rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; }
.table .actions form { margin-right: .25rem; }
details summary { cursor: pointer; color: var(--err); }

/* Stats & meters */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: .85rem; }
.meter { margin: .9rem 0; }
.meter-head { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .3rem; }
.meter-bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.meter-fill { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%;background:var(--warn)}
progress { width: 100%; height: 10px; accent-color: var(--primary); }
.job-watch { margin-top: 1rem; padding: .8rem; border: 1px dashed var(--line); border-radius: 8px; }
.job-done progress { accent-color: var(--ok); }
.job-failed .js-job-message { color: var(--err); }

/* Lists */
.steps { padding-left: 1.2rem; margin: 0; }
.steps li { margin: .4rem 0; }
.steps li.done { color: var(--ok); text-decoration: line-through; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .45rem 0 .45rem 1.5rem; position: relative; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li.warn::before { content: "!"; position: absolute; left: 0; top: .45rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: .75rem; text-align: center; line-height: 1.1rem; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list li.unread { font-weight: 600; }
.debug { text-align: left; background: #111827; color: #f9fafb; padding: 1rem; border-radius: 8px; font-size: .78rem; max-height: 50vh; overflow: auto; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card.narrow { margin: 1rem auto; }
  .search-inline input { min-width: 0; flex: 1; }
}

/* ---- Prospecting ---- */
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--err); font-weight: 600; }
.search-grid { display: grid; grid-template-columns: 2fr 2fr 1.2fr auto; gap: .75rem; align-items: end; }
.results-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.save-controls { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.save-controls select, .save-controls input { width: auto; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: " ↕"; color: #c4c9d4; }
th.sorted-asc::after { content: " ↑"; color: var(--primary); }
th.sorted-desc::after { content: " ↓"; color: var(--primary); }
.results-table td { vertical-align: middle; }
.small-pill { font-size: .7rem; margin-left: .4rem; padding: 0 .45rem; }
.score { display: inline-block; min-width: 2.4rem; text-align: center; padding: .15rem .45rem; border-radius: 6px; font-weight: 700; font-size: .9rem; }
.score-high { background: #fdecea; color: #b42318; }
.score-mid { background: #fff4e5; color: #b54708; }
.score-low { background: #ecfdf3; color: #067647; }
.score-none { background: var(--bg); color: var(--muted); }
.score-big { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 84px; height: 84px; border-radius: 16px; }
.score-big span { font-size: 2rem; font-weight: 800; line-height: 1; }
.score-big small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.table.kv th { text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--muted); font-weight: 500; width: 40%; border-bottom: 1px solid var(--line); }
.reasons { list-style: none; padding: 0; margin: 0; }
.reasons li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.reasons li:last-child { border-bottom: 0; }
.reason-points { display: inline-block; min-width: 2.6rem; font-weight: 700; color: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--primary-soft); color: var(--primary); border-radius: 99px; padding: .15rem .3rem .15rem .65rem; font-size: .85rem; }
.chip-x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .25rem; }
.attribution { margin: .75rem 0 0; font-size: .75rem; color: var(--muted); }
.google-attr { font-family: Roboto, Arial, sans-serif; color: #5e5e5e; font-weight: 500; }
.pill.status-won { background: var(--ok-soft); color: var(--ok); border-color: #b7e4cf; }
.pill.status-lost { background: var(--bg); color: var(--muted); }
.pill.status-viewed, .pill.status-replied { background: var(--info-soft); color: var(--primary); border-color: #c9d6ff; }
.pill.status-preview_sent, .pill.status-contacted { background: var(--warn-soft); color: var(--warn); border-color: #f5d9b3; }
.status-tabs { margin-bottom: 1rem; }
.filter-bar input[type=search] { min-width: 220px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }
.inline-rename { display: flex; gap: .4rem; align-items: center; }
.inline-rename input { max-width: 280px; padding: .35rem .55rem; }
textarea.js-notes { width: 100%; }
@media (max-width: 860px) {
  .search-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
.right { text-align: right; }

/* ---- Facelift ---- */
.redesign-grid { grid-template-columns: 2.2fr 1.6fr 1fr auto; }
.redesign-grid:not(:has(select)) { grid-template-columns: 2fr 1.6fr auto; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.preview-frame { background: #e9edf3; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 1rem; }
.preview-frame iframe { display: block; width: 100%; height: 78vh; border: 0; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.preview-mobile iframe { width: 390px; max-width: 100%; height: 780px; margin: 0 auto; border-radius: 28px; border: 10px solid #111827; }
.before-shots { display: flex; gap: 14px; align-items: flex-start; }
.before-shots .before-d { width: 100%; max-height: 420px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); }
.before-shots .before-m { width: 120px; max-height: 420px; object-fit: cover; object-position: top; border-radius: 12px; border: 1px solid var(--line); }
.before-shots a:first-child { flex: 1; }
.facelift-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fixture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fixture-grid iframe { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
@media (max-width: 860px) { .redesign-grid, .redesign-grid:not(:has(select)) { grid-template-columns: 1fr; } .fixture-grid { grid-template-columns: 1fr; } }
.direction-concept { margin: .25rem 0 1rem; color: var(--muted); max-width: 70ch; }
.direction-concept strong { color: var(--text); }
.swatch { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
/* Design-family samples: scaled live iframes, side by side */
.fam-grid { display: grid; gap: 28px 24px; margin-top: 1rem; }
.fam-grid-desktop { grid-template-columns: repeat(2, 552px); justify-content: space-between; }
.fam-grid-mobile { grid-template-columns: repeat(4, 270px); justify-content: space-between; }
.fam-meta p { margin: .25rem 0 0; }
.fam-frame { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-top: .6rem; }
.fam-frame iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.fam-grid-desktop .fam-frame { width: 552px; height: 690px; }
.fam-grid-desktop .fam-frame iframe { width: 1280px; height: 1600px; transform: scale(.43125); }
.fam-grid-mobile .fam-frame { width: 270px; height: 900px; }
.fam-grid-mobile .fam-frame iframe { width: 390px; height: 1300px; transform: scale(.6923); }
@media (max-width: 1180px) { .fam-grid-desktop, .fam-grid-mobile { grid-template-columns: repeat(auto-fill, minmax(270px, 552px)); } }

/* Redesign page: sharing, prospect activity, outreach */
.share-grid { align-items: start; }
.copy-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.copy-row input { flex: 1; min-width: 0; }
.h-sub { font-size: 1rem; margin: 1.2rem 0 .6rem; }
.text-err { color: var(--err); }
.act-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.act-stat { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.act-stat strong { display: block; font-size: 1.15rem; }
.act-stat span { color: var(--muted); font-size: .78rem; }
.outreach textarea { width: 100%; font: inherit; line-height: 1.5; resize: vertical; }
.outreach .field { margin-bottom: .4rem; }
@media (max-width: 640px) { .act-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .copy-row { flex-wrap: wrap; } }

/* Billing and upgrade prompts */
.nav > a.nav-upgrade { background: var(--primary); color: #fff; font-weight: 600; }
.nav > a.nav-upgrade:hover { background: var(--primary-dark); }
.upgrade-prompt { margin: .75rem 0 0; }
.upgrade-link { font-weight: 600; white-space: nowrap; }
.plan-card h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.plan-price { font-size: 1.5rem; }
.plan-features { margin: 0 0 1rem; padding-left: 1.2rem; }
.plan-features li { margin: .25rem 0; }
