:root {
  --bg: #f6f7f9;
  --panel: #fff;
  --line: #e3e6ea;
  --text: #1c2430;
  --muted: #6b7684;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --high: #c2410c;
  --med: #b45309;
  --low: #4b5563;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
button, .btn, input, select, textarea { font: inherit; }
button, .btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: #c5cbd3; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: #1d4ed8; }
button:disabled { opacity: .55; cursor: progress; }
button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
input, select, textarea { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; }
textarea { width: 100%; resize: vertical; }

header {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
/* Search gets its own row under the brand + nav so the pickers have room. */
.search { display: flex; gap: 8px; order: 3; flex-basis: 100%; }
.search input { flex: 1; min-width: 140px; }
.search #bizType { min-width: 190px; max-width: 260px; }
.search #continent { max-width: 170px; }
.search #country { max-width: 230px; }
nav { display: flex; gap: 8px; margin-left: auto; }

main { flex: 1; display: flex; min-height: 0; }
#sidebar { width: 340px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.filters #filterQ { grid-column: 1 / -1; }
.list-head { display: flex; justify-content: space-between; padding: 8px 12px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
#leadList { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#leadList li { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
#leadList li:hover { background: #fafbfc; }
#leadList li.current { background: var(--accent-soft); }
#leadList .name { font-weight: 600; }
#leadList .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
#leadList .chips { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eef0f3; color: var(--muted); }
.chip.ok { background: #e6f6ec; color: #17733a; }
.chip.warn { background: #fdf0e1; color: var(--med); }
.chip.ai { background: #efe9ff; color: #6d28d9; }
.status { text-transform: capitalize; }
.status-new { background: #eef0f3; }
.status-contacted { background: #e0ecff; color: #1d4ed8; }
.status-replied { background: #fff3c4; color: #8a6100; }
.status-meeting { background: #efe9ff; color: #6d28d9; }
.status-won { background: #dcf5e3; color: #17733a; }
.status-lost { background: #fde4e4; color: #b91c1c; }
.empty { padding: 30px 20px; color: var(--muted); text-align: center; line-height: 1.6; }

#mapWrap { flex: 1; position: relative; }
#map { position: absolute; inset: 0; }
.floating {
  position: absolute; top: 12px; right: 12px; z-index: 500; width: 300px; max-height: calc(100% - 24px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.floating ol { padding-left: 20px; margin: 8px 0; }
.floating li { margin: 3px 0; }
.hidden { display: none !important; }

#detail { width: 440px; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 16px 18px 40px; }
#detail h2 { margin: 0 0 4px; font-size: 19px; }
#detail h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 22px 0 8px; display: flex; justify-content: space-between; align-items: center; }
#detail .close { float: right; border: none; font-size: 20px; padding: 0 4px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 5px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.kv a { color: var(--accent); }
.socials a { margin-right: 8px; }
.pain { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin-bottom: 7px; }
.pain .issue { font-weight: 600; }
.pain .ev { color: var(--muted); font-size: 12.5px; margin-top: 3px; font-style: italic; }
.sev { font-size: 11px; font-weight: 600; text-transform: uppercase; margin-right: 6px; }
.sev-high { color: var(--high); } .sev-medium { color: var(--med); } .sev-low { color: var(--low); }
.angle { background: #f5f8ff; border-left: 3px solid var(--accent); padding: 8px 10px; border-radius: 4px; font-size: 13px; }
.fit { font-size: 13px; margin-bottom: 8px; }
.fit b { font-size: 15px; }
.email-to { display: flex; gap: 6px; margin-bottom: 6px; }
.email-to select, .email-to input { flex: 1; }
#subj { width: 100%; margin-bottom: 6px; font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.notes { list-style: none; padding: 0; margin: 8px 0 0; }
.notes li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; white-space: pre-wrap; }
.notes time { display: block; color: var(--muted); font-size: 11px; }
.rec { color: #b91c1c; border-color: #fca5a5; }
.reviews { max-height: 220px; overflow-y: auto; font-size: 12.5px; }
.reviews p { margin: 0 0 8px; }
details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: 560px; max-width: 95vw; }
dialog::backdrop { background: rgba(15, 23, 42, .35); }
dialog form { padding: 18px 22px; max-height: 85vh; overflow-y: auto; }
dialog h2 { margin-top: 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 14px; padding: 10px 14px; }
legend { font-weight: 600; padding: 0 4px; }
fieldset label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
fieldset input, fieldset textarea { width: 100%; margin-top: 3px; color: var(--text); }
.row2 { display: grid; grid-template-columns: 3fr 1fr; gap: 8px; }
menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 0; }

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2000;
  background: #1c2430; color: #fff; padding: 9px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 80vw;
}
#toast.show { opacity: 1; }
#toast.err { background: #b91c1c; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.route-num { background: var(--accent); color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }

.filters .chk { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.score-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.chip.fit-good { background: #dcf5e3; color: #17733a; }
.chip.fit-maybe { background: #fff3c4; color: #8a6100; }
.chip.fit-poor { background: #fde4e4; color: #b91c1c; }
.chip.chain { background: #e9e9ef; color: #4b5563; }
.prospect { border-radius: 8px; padding: 9px 11px; margin-top: 10px; font-size: 13px; }
.prospect.good { background: #eefaf2; } .prospect.maybe { background: #fffaea; } .prospect.poor { background: #fdf1f1; }
button.link { border: none; background: none; color: var(--accent); padding: 0; margin: -2px 0 10px; font-size: 12.5px; }
fieldset select { width: 100%; margin-top: 3px; }

.row2.even { grid-template-columns: 1fr 1fr; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.chip.due { background: #fde4e4; color: #b91c1c; }
.chip.upcoming { background: #e0ecff; color: #1d4ed8; }
.match { border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; margin-bottom: 8px; font-size: 13px; }
.match ul { margin: 4px 0 0; padding-left: 18px; }
.match li { margin: 2px 0; }
details.email-opts { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
details.email-opts .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
details.email-opts .grid .wide { grid-column: 1 / -1; }
details.email-opts label { color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.followup-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.followup-row input[type=date] { padding: 4px 6px; }
.followup-row button { padding: 4px 9px; font-size: 12.5px; }
.leaflet-popup-content { margin: 12px 14px; font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; }
.pop h4 { margin: 0 0 2px; font-size: 15px; }
.pop .meta { color: var(--muted); font-size: 12px; }
.pop .chips { margin: 6px 0; display: flex; gap: 4px; flex-wrap: wrap; }
.pop .lines { margin: 6px 0; display: grid; gap: 2px; word-break: break-all; }
.pop .lines a { color: var(--accent); }
.pop .note-row { display: flex; gap: 4px; margin-top: 8px; }
.pop .note-row input { flex: 1; min-width: 0; padding: 4px 6px; }
.pop .note-row button, .pop .followup-row button { padding: 4px 8px; font-size: 12px; }
.pop .followup-row { margin-top: 6px; }
.pop .open { width: 100%; margin-top: 8px; }
.banner { padding: 8px 12px; background: #fff7e6; border-bottom: 1px solid #f3d9a4; font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- Team / table / assistant ---------- */
nav select#actingAs { max-width: 150px; }
.map-tools { position: absolute; top: 12px; right: 12px; z-index: 500; display: flex; gap: 6px; }
.map-tools button { box-shadow: 0 2px 6px rgba(0,0,0,.12); }
#routePanel.floating { top: 54px; }
.chip.rep { background: #fff; border: 1px solid currentColor; }

#tablePanel { position: absolute; inset: 0; z-index: 800; background: var(--panel); display: flex; flex-direction: column; }
.table-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 13px; }
.table-bar .bulk { display: flex; gap: 6px; }
.table-bar .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.table-bar select, .table-bar button, .table-bar .btn { padding: 4px 8px; font-size: 12.5px; }
details.cols { position: relative; }
details.cols summary { list-style: none; cursor: pointer; }
details.cols summary::-webkit-details-marker { display: none; }
#colChooser { position: absolute; right: 0; top: 30px; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.1); display: grid; gap: 4px; width: 190px; }
#colChooser label { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.table-scroll { flex: 1; overflow: auto; }
#leadTable { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12.5px; }
#leadTable th { position: sticky; top: 0; z-index: 2; background: #f3f5f8; text-align: left; font-weight: 600; padding: 7px 10px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
#leadTable th.nosort { cursor: default; }
#leadTable td { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
#leadTable tr:hover td { background: #fafbfc; }
#leadTable tr.current td { background: var(--accent-soft); }
#leadTable td.name { font-weight: 600; cursor: pointer; }
#leadTable td .chip { font-size: 11px; }
#leadTable td a { color: var(--accent); }
#leadTable td select { padding: 2px 4px; font-size: 12px; }

#teamDlg { width: 820px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.kpi .v { font-size: 20px; font-weight: 700; }
.kpi .l { font-size: 11.5px; color: var(--muted); }
.grid-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 8px; }
.grid-table th, .grid-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.grid-table th:first-child, .grid-table td:first-child { text-align: left; }
.grid-table th { color: var(--muted); font-weight: 600; }
.grid-table .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.grid-table input[type=color] { width: 28px; height: 22px; padding: 0; border: none; }
.funnel { display: flex; height: 8px; border-radius: 4px; overflow: hidden; min-width: 120px; background: #eef0f3; }
.funnel span { display: block; height: 100%; }
.add-rep { display: flex; gap: 6px; margin-bottom: 6px; }
.add-rep input:not([type=color]) { flex: 1; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }

#assistant { position: fixed; right: 16px; bottom: 16px; z-index: 1500; width: 420px; height: min(640px, calc(100vh - 90px)); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.as-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.as-head .hint { margin: 0; flex: 1; }
.as-head button { border: none; padding: 2px 6px; }
#asMessages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.5; }
.msg { padding: 8px 11px; border-radius: 10px; max-width: 92%; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.assistant { align-self: flex-start; background: #f3f5f8; }
.msg.assistant a.lead-link { color: var(--accent); font-weight: 600; cursor: pointer; }
.msg.error { background: #fde4e4; color: #b91c1c; }
.as-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.as-suggest button { font-size: 12px; padding: 4px 9px; border-radius: 14px; }
#asForm { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); }
#asForm textarea { flex: 1; resize: none; }

.dist { display: grid; grid-template-columns: 24px 1fr 30px; gap: 3px 8px; align-items: center; font-size: 12px; margin: 6px 0; }
.dist .bar { height: 7px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.dist .bar span { display: block; height: 100%; background: #f59e0b; }
.dist .n { color: var(--muted); text-align: right; }
.review-box { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13px; margin-bottom: 8px; }
.review-box .row { display: flex; gap: 14px; flex-wrap: wrap; }
.reply { margin: -4px 0 8px 14px; padding-left: 8px; border-left: 2px solid #cbd5e1; color: #475569; font-size: 12px; }

.bt-table { width: 100%; border-collapse: collapse; margin: 6px 0 8px; font-size: 12.5px; }
.bt-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 2px 4px; }
.bt-table td { padding: 2px 4px; }
.bt-table td:first-child, .bt-table th:first-child { width: 36px; text-align: center; }
.bt-table td input:not([type=checkbox]) { width: 100%; margin: 0; padding: 4px 6px; }
.bt-table td:last-child { width: 30px; }
.bt-table button { padding: 2px 7px; border: none; color: var(--muted); }

#heatPanel { position: absolute; top: 12px; left: 56px; z-index: 850; width: min(760px, calc(100% - 140px)); max-height: calc(100% - 24px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 12px 14px; }
.heat-head { display: flex; gap: 6px; align-items: center; }
.heat-head #heatQuery { flex: 1; }
.heat-head button#heatClose { border: none; }
.heat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.heat-cols h4 { margin: 8px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.heat-row { display: grid; grid-template-columns: 1fr 90px 34px; gap: 8px; align-items: center; font-size: 12.5px; padding: 2px 0; }
.heat-row .bar { height: 7px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.heat-row .bar span { display: block; height: 100%; background: #f97316; }
.heat-row .s { text-align: right; font-variant-numeric: tabular-nums; }
.heat-row a { color: var(--accent); cursor: pointer; }
.heat-row .pop { color: var(--muted); font-size: 11px; }
.q-row { display: flex; gap: 6px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.q-row .lbl { margin-left: auto; color: #c2410c; font-weight: 600; white-space: nowrap; }
.q-row button { padding: 1px 7px; font-size: 11.5px; }

.footer-preview { background: #f6f7f9; border: 1px dashed var(--line); border-radius: 6px; padding: 6px 9px; font-size: 12px; white-space: pre-wrap; margin: 4px 0 8px; color: #475569; font-family: inherit; }
.footer-preview.missing { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }
.dnc-add { display: flex; gap: 6px; margin: 6px 0; }
.dnc-add textarea { flex: 1; }
.dnc-list { list-style: none; padding: 0; margin: 0; max-height: 160px; overflow-y: auto; font-size: 12.5px; }
.dnc-list li { display: flex; gap: 8px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line); }
.dnc-list li .r { color: var(--muted); flex: 1; }
.dnc-list li button { border: none; padding: 0 6px; color: var(--muted); }
.check-list { font-size: 12.5px; margin: 6px 0 0; padding-left: 0; list-style: none; }
.check-list li { padding: 2px 0; }
.check-list .fix { display: block; color: var(--muted); margin-left: 20px; }
.send-meter { font-size: 12px; color: var(--muted); }
.send-meter.full { color: #b91c1c; font-weight: 600; }
.dnc-banner { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; border-radius: 8px; padding: 8px 11px; font-size: 13px; margin-top: 10px; }
.chip.dnc { background: #fde4e4; color: #991b1b; }
.chip.replied { background: #fff3c4; color: #8a6100; }

.seq-table td:first-child { width: 70px; }
.seq-table td input[type=number] { width: 60px; }
.seq-steps { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 6px; }
.seq-step { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.seq-step.done { background: #e6f6ec; border-color: #bfe5cc; color: #17733a; }
.seq-step.current { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.seq-status { font-size: 12.5px; color: var(--muted); }
.dm-box { border: 1px solid #f5c2e7; background: #fdf4fb; border-radius: 8px; padding: 9px 11px; margin: 8px 0; }
.dm-box textarea { margin: 6px 0; background: #fff; }
.dm-box .count { font-size: 11.5px; color: var(--muted); }
.contact-guess { color: var(--muted); font-size: 12px; }

.job-status { align-self: center; font-size: 12.5px; color: var(--accent); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.chip.closed { background: #e5e7eb; color: #374151; text-decoration: line-through; }
.chip.maybe-closed { background: #fef3c7; color: #92400e; }
.closed-banner { background: #f3f4f6; border: 1px solid #d1d5db; color: #374151; border-radius: 8px; padding: 8px 11px; font-size: 13px; margin-top: 10px; }
.closed-banner.maybe { background: #fffbeb; border-color: #fcd34d; color: #92400e; }

#importDlg { width: 760px; }
#importDlg textarea { width: 100%; margin: 8px 0; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
#importDlg .chk { display: flex; gap: 6px; align-items: center; font-size: 13px; margin: 4px 0; color: var(--text); }
.import-map { max-height: 300px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; }
.import-map td, .import-map th { text-align: left !important; vertical-align: top; }
.import-map td.sample { color: var(--muted); max-width: 320px; white-space: normal; font-size: 12px; }
.import-map select { width: 160px; }
.import-map tr.unmapped td { opacity: .55; }

.reply-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 8px; }
.reply-grid h4 { margin: 4px 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.rs-row { display: grid; grid-template-columns: 1fr 70px 46px 52px; gap: 6px; align-items: center; font-size: 12.5px; padding: 2px 0; }
.rs-row .bar { height: 7px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.rs-row .bar span { display: block; height: 100%; background: #16a34a; }
.rs-row .n, .rs-row .r { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.rs-row .r { color: var(--text); font-weight: 600; }
.rs-row.few { opacity: .5; }
.rs-row.few .r::after { content: " ?"; color: var(--muted); font-weight: 400; }

#kitDlg { width: 860px; }
.kit-ready { margin: 6px 0 10px; font-size: 12.5px; }
.kit-ready .track { height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; margin: 4px 0; }
.kit-ready .track span { display: block; height: 100%; background: #16a34a; }
.kit-ready .miss { color: #92400e; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 6px 12px; }
.tabs button.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.kit-group { margin-bottom: 10px; }
.kit-group h4 { margin: 6px 0; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.kit-row { display: grid; grid-template-columns: 200px 1fr; gap: 8px; align-items: start; margin-bottom: 6px; font-size: 13px; }
.kit-row label { padding-top: 6px; }
.kit-row label .need { color: #b91c1c; }
.kit-row textarea { min-height: 32px; font-size: 13px; }
.cat-scroll { max-height: 360px; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; }
.cat-table td, .cat-table th { text-align: left !important; padding: 3px 5px; }
.cat-table input { width: 100%; padding: 3px 5px; font-size: 12.5px; border-color: transparent; }
.cat-table input:focus { border-color: var(--line); }
.cat-table td.num input { width: 70px; text-align: right; }
.cat-table img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; background: #eef0f3; }
.show-table input { width: 100%; padding: 3px 5px; }
.featured { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.featured .fp { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px 4px 4px; font-size: 12.5px; }
.featured .fp img { width: 36px; height: 36px; object-fit: cover; border-radius: 5px; background: #eef0f3; }
.lint-box { font-size: 12.5px; color: #92400e; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; padding: 6px 9px; margin: 6px 0; }
.lint-box.ok { color: #17733a; background: #f0fdf4; border-color: #bbf7d0; }
.kit-nudge { font-size: 12.5px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 6px 9px; margin: 6px 0; }

/* ---------- Today, wholesale steps, replies, launch check ---------- */
.badge.hot { background: #ea580c; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dm-box .count.over { color: #b91c1c; font-weight: 600; margin-left: 8px; }
.dm-box .count + .count { margin-left: 8px; }
#todayPanel { position: fixed; top: 58px; right: 0; bottom: 0; z-index: 1400; width: 400px; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.1); display: flex; flex-direction: column; }
#todayBody { flex: 1; overflow-y: auto; padding: 4px 14px 16px; font-size: 13px; }
#todayBody h4 { margin: 14px 0 6px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
#todayBody h4 .n { color: var(--muted); font-weight: 500; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 5px; cursor: pointer; }
.today-list li:hover { background: #f7f9fc; border-color: var(--accent); }
.today-list .hint { margin: 2px 0 0; }
.today-list .when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.when.overdue, .overdue { color: #b91c1c !important; font-weight: 600; }
.health { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12px; padding: 8px 10px; margin-top: 10px; border-radius: 8px; background: #f3f5f8; }
.health.bad { background: #fde4e4; color: #991b1b; }
.health a { margin-left: auto; color: var(--accent); }
.intent { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; background: #eef0f3; color: #475569; white-space: nowrap; }
.intent.hot { background: #ffedd5; color: #9a3412; font-weight: 600; }
.intent.later { background: #e0f2fe; color: #075985; }
.intent.no { background: #f1f5f9; color: #64748b; }
.reply-card { border: 1px solid #fed7aa; background: #fffaf5; border-radius: 8px; padding: 9px 11px; margin: 6px 0; font-size: 13px; }
.reply-card.handled { border-color: var(--line); background: #fafbfc; }
.rc-head { display: flex; align-items: center; gap: 6px; }
.rc-head .hint { margin: 0; }
.rc-sum { margin: 5px 0 3px; font-weight: 500; }
.rc-text { white-space: pre-wrap; color: #334155; padding: 4px 0; }
.rc-draft { width: 100%; margin: 6px 0 2px; background: #fff; font-size: 12.5px; }
.log-reply { margin: 6px 0; font-size: 12.5px; }
.log-reply summary { color: var(--accent); cursor: pointer; }
.log-form { display: grid; gap: 6px; margin-top: 6px; }
.ev-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin: 6px 0; font-size: 12.5px; background: #fafbfc; }
.ev-form b, .ev-form .wide, .ev-form .actions { grid-column: 1 / -1; }
.ev-form label { display: grid; gap: 2px; }
.ev-list { list-style: none; padding: 0; margin: 4px 0 8px; font-size: 12.5px; }
.ev-list li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ev-list li > span:first-child { display: inline-block; min-width: 52px; color: var(--muted); }
.ev-list button.link { border: none; background: none; color: var(--muted); padding: 0 4px; cursor: pointer; }
.ws-actions button { font-size: 12.5px; }
.rule-banner { border: 1px solid #fcd34d; background: #fffbeb; border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 12.5px; }
.rule-banner.ok { border-color: #bfe5cc; background: #f0fbf4; }
.chip.maybe { background: #fef3c7; color: #92400e; }
#launchDlg { width: 680px; }
.launch-sum { padding: 9px 12px; border-radius: 8px; font-weight: 600; margin-bottom: 8px; }
.launch-sum.ok { background: #e6f6ec; color: #17733a; }
.launch-sum.bad { background: #fde4e4; color: #991b1b; }
.launch-list { list-style: none; padding: 0; margin: 0; }
.launch-list li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.launch-list li.bad { background: #fff5f5; }
.launch-list .hint { margin: 2px 0 0; }
.launch-list .btns { display: flex; gap: 4px; }
.launch-list .btns button { font-size: 12px; padding: 3px 8px; white-space: nowrap; }
#dupDlg { width: 640px; }
.dup-group { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.dup-row { display: flex; gap: 6px; align-items: baseline; padding: 3px 0; font-size: 13px; }
.dup-row .hint { margin: 0; }
.funnel-steps { margin-bottom: 8px; }
.fs-row { display: grid; grid-template-columns: 130px 1fr 40px 44px; gap: 8px; align-items: center; font-size: 12.5px; padding: 2px 0; }
.fs-row .bar { height: 10px; border-radius: 5px; background: #eef0f3; overflow: hidden; }
.fs-row .bar span { display: block; height: 100%; background: #16a34a; }
.fs-row .n { text-align: right; font-weight: 600; }
.fs-row .r { text-align: right; color: var(--muted); }

/* ---------- Lists, tags, priority, timeline, pipeline, goals ---------- */
.views-row { grid-column: 1 / -1; display: flex; gap: 6px; }
.views-row select { flex: 1; }
.views-row button { padding: 4px 8px; font-size: 12px; }
.chip.prio { background: #f1f5f9; color: #475569; font-weight: 600; }
.chip.prio.mid { background: #fef3c7; color: #92400e; }
.chip.prio.hi { background: #ffedd5; color: #c2410c; }
.chip.tag { background: #eef2ff; color: #4338ca; }
.chip.tag a { color: inherit; text-decoration: none; margin-left: 2px; }
.chip.stage { background: #dcfce7; color: #166534; }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0 2px; }
.tag-row input { border: 1px dashed var(--line); padding: 2px 6px; font-size: 12px; border-radius: 10px; width: 90px; }
.prio-why { margin: 2px 0 6px; }
.tag-bulk { display: inline-flex; gap: 2px; }
.tag-bulk input { padding: 4px 6px; font-size: 12.5px; }
.tpl-bar { display: flex; gap: 8px; align-items: center; margin: 4px 0; font-size: 12.5px; }
.tpl-bar select { font-size: 12.5px; padding: 3px 6px; }
.tpl-bar a { color: var(--accent); }
.tpl-item { display: grid; grid-template-columns: 160px 1fr auto auto; gap: 6px; align-items: start; margin-bottom: 6px; }
.tpl-item .hint { margin: 6px 0 0; white-space: nowrap; }
.tpl-new { display: grid; gap: 6px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.timeline { list-style: none; padding: 0; margin: 6px 0; font-size: 12.5px; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.timeline .tl-ic { text-align: center; }
.timeline time { color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.timeline .tl-sub { color: #334155; margin-top: 2px; }
.timeline .tl-text { white-space: pre-wrap; color: #475569; margin-top: 2px; }
.timeline .tl-in { background: #fffaf5; }
.timeline .tl-order { background: #f0fbf4; }
.timeline summary { color: #475569; cursor: pointer; }
#pipePanel { position: absolute; inset: 0; z-index: 800; background: var(--panel); display: flex; flex-direction: column; }
.pipe-tabs { display: inline-flex; gap: 2px; }
.pipe-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#pipeNote { margin: 0; }
#pipeNote button { padding: 1px 8px; }
.pipe-body { flex: 1; overflow: auto; padding: 10px 12px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 10px; min-height: 100%; }
.b-col { background: #f3f5f8; border-radius: 10px; padding: 8px; min-height: 300px; }
.b-col.over { outline: 2px dashed var(--accent); }
.b-head { font-weight: 600; font-size: 12.5px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.b-head span { color: var(--muted); }
.b-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; cursor: grab; font-size: 12.5px; }
.b-card:hover { border-color: var(--accent); }
.b-card .hint { margin: 2px 0 0; }
.b-next { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow span { font-size: 11.5px; color: var(--muted); text-align: center; }
.cal-day { min-height: 92px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px; font-size: 11px; overflow: hidden; }
.cal-day.empty { border: none; }
.cal-day.past { background: #fafbfc; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-n { font-weight: 600; color: #475569; }
.cal-it { border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.k-followup { background: #dbeafe; } .k-wholesale { background: #ffedd5; } .k-order { background: #dcfce7; } .k-sample { background: #ede9fe; } .k-market { background: #fde68a; cursor: default; }
.cal-key { margin-left: 10px; font-size: 11.5px; }
.cal-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 3px 0 8px; vertical-align: -1px; }
.cust-table td { white-space: nowrap; }
.cust-table a { color: inherit; }
.grade { display: inline-block; width: 22px; text-align: center; border-radius: 4px; font-weight: 700; }
.g-A { background: #16a34a; color: #fff; } .g-B { background: #fde68a; } .g-C { background: #e2e8f0; }
.goals { margin-top: 10px; display: grid; gap: 5px; }
.goal { display: grid; grid-template-columns: 110px 1fr 46px; gap: 8px; align-items: center; font-size: 12.5px; }
.goal .bar { height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.goal .bar span { display: block; height: 100%; background: var(--accent); }
.goal .bar span.met { background: #16a34a; }
.goal .bar span.warn { background: #ea580c; }
.goal b { text-align: right; }
.goal-cell input { width: 46px; padding: 2px 4px; }
.review-box { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-size: 13px; }
.review-text { line-height: 1.55; margin: 4px 0 8px; }
h3 #reviewBtn { font-size: 12px; padding: 3px 9px; margin-left: 8px; }

/* ---------- People, queue, data quality, wording tests ---------- */
.person { padding: 4px 0 6px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.person.primary b { color: var(--accent); }
.person .p-act { font-size: 11.5px; }
.person .p-act a { color: var(--muted); }
.contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 6px 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.contact-form .chk, .contact-form .actions { grid-column: 1 / -1; }
.contact-form input { font-size: 12.5px; padding: 4px 6px; }
.queued-line { font-size: 12.5px; padding: 6px 9px; margin: 4px 0; border-radius: 8px; background: #eff6ff; border: 1px solid #bfdbfe; }
.queued-line button { font-size: 11.5px; padding: 1px 7px; margin-left: 6px; }
.missing-chip { grid-column: 1 / -1; font-size: 12px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 4px 8px; display: flex; gap: 6px; align-items: center; }
.missing-chip button { font-size: 11.5px; padding: 1px 7px; }
#qualityDlg { width: 980px; max-width: 96vw; }
.q-sum { margin-bottom: 8px; font-size: 13px; }
.q-table td a { color: #b45309; font-weight: 600; }
.q-table td:first-child { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-list td { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.q-list tr.qs-sent td, .q-list tr.qs-cancelled td { color: var(--muted); }
.q-list tr.qs-failed td { background: #fff5f5; }
.job-stop { margin-left: 6px; color: #b91c1c; }
.ab-new, .ab-card, .ab-rules { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 6px; }
.ab-new h4, .ab-rules h4 { margin: 0; }
.ab-card.stopped { opacity: .75; }
.ab-head .hint { margin: 0 6px; }
.ab-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab-side { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.ab-side.win { border-color: #16a34a; background: #f0fbf4; }
.ab-side button { margin-top: 6px; font-size: 12px; }

/* ---------- Guide, language ---------- */
#guidePanel { position: fixed; top: 58px; right: 0; bottom: 0; z-index: 1450; width: 400px; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.1); display: flex; flex-direction: column; }
#guideBody { flex: 1; overflow-y: auto; padding: 8px 14px 16px; font-size: 13px; }
.guide { list-style: none; padding: 0; margin: 8px 0; counter-reset: g; }
.guide li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 7px; counter-increment: g; }
.guide li.done { background: #f0fbf4; border-color: #bfe5cc; }
.guide li.done p, .guide li.done button { display: none; }
.g-head { display: flex; align-items: center; gap: 6px; }
.g-mark { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.g-mark:empty::before { content: counter(g); color: var(--muted); }
.guide li.done .g-mark { background: #16a34a; border-color: #16a34a; color: #fff; }
.guide p { margin: 5px 0 6px 26px; }
.guide button { margin-left: 26px; font-size: 12.5px; }
nav select#langSel { padding: 4px 6px; }

/* ---------- Store assortment, DDP, mailboxes, cards, login ---------- */
.assort { border: 1px solid #c7d2fe; background: #f5f7ff; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 12.5px; }
.assort button { font-size: 11.5px; padding: 1px 8px; }
.as-head2 { display: flex; gap: 6px; align-items: center; }
.as-head2 .hint { margin: 0; flex: 1; }
.as-grid { display: grid; grid-template-columns: 96px 1fr; gap: 3px 8px; margin-top: 6px; }
.as-grid > span:nth-child(odd) { color: var(--muted); }
.met-line { font-size: 12.5px; padding: 5px 9px; margin: 6px 0; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; }
.ddp-table input { width: 100%; padding: 3px 5px; font-size: 12.5px; }
.ddp-costs { margin: 10px 0; }
.ddp-try { font-size: 13px; padding: 8px 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; line-height: 1.8; }
.ddp-try input { padding: 2px 5px; }
.mbox-table td { vertical-align: middle; }
.mbox-table .hint { margin: 2px 0 0; }
.mbox-table button { font-size: 11.5px; padding: 2px 7px; }
#mboxAdd { margin-top: 6px; }
#mboxAdd summary { color: var(--accent); cursor: pointer; font-size: 13px; }
#cardDlg { width: 720px; max-width: 96vw; }
.card-top { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.card-top label:first-child { flex: 1; min-width: 220px; }
.card-pick { cursor: pointer; padding: 8px 14px; background: var(--accent); color: #fff; border-radius: 8px; }
.card-grid { display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin-top: 10px; }
.card-grid img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.card-grid label { display: grid; grid-template-columns: 90px 1fr; gap: 6px; align-items: center; font-size: 12.5px; margin-bottom: 4px; }
.card-grid label.chk { display: flex; }
#loginBox { position: fixed; inset: 0; z-index: 5000; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; }
#loginForm { background: #fff; border-radius: 12px; padding: 22px 26px; width: 320px; display: grid; gap: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
#loginForm h2 { margin: 0; }

/* ---------- Phone layout ---------- */
@media (max-width: 760px) {
  header { flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
  header .brand { display: none; }
  #searchForm { order: 2; width: 100%; flex-wrap: wrap; gap: 4px; }
  #searchForm > * { flex: 1 1 45%; min-width: 0; }
  nav { order: 1; width: 100%; overflow-x: auto; gap: 4px; margin: 0; }
  nav button, nav select { flex: none; padding: 5px 8px; font-size: 13px; }
  main { flex-direction: column; }
  #sidebar { width: 100%; max-height: 45vh; border-right: none; border-bottom: 1px solid var(--line); }
  #mapWrap { min-height: 40vh; }
  #detail { position: fixed; inset: 0; width: 100%; max-width: none; z-index: 1600; overflow-y: auto; }
  #todayPanel, #guidePanel, #assistant { top: 0; left: 0; right: 0; width: 100%; height: 100%; border-radius: 0; }
  dialog { width: 100vw !important; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; }
  .row2, .row2.even, .row3 { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(5, 78vw); overflow-x: auto; }
  .cal-day { min-height: 60px; }
  .actions button { padding: 8px 12px; }
}
@media (max-width: 760px) {
  html, body { width: 100%; overflow-x: hidden; }
  body { height: auto; min-height: 100vh; }
  main { display: flex; flex-direction: column; width: 100%; height: auto; }
  #sidebar { width: 100% !important; max-width: 100vw; box-sizing: border-box; max-height: none; }
  #sidebar .filters { grid-template-columns: 1fr 1fr; }
  #sidebar select, #sidebar input:not([type=checkbox]) { min-width: 0; width: 100%; box-sizing: border-box; }
  #sidebar input[type=checkbox] { width: auto; }
  #sidebar .chk { grid-column: 1 / -1; }
  #leadList li { display: flex; gap: 8px; }
  #leadList li > div { min-width: 0; flex: 1; }
  .views-row { min-width: 0; }
  #leadList { max-height: 50vh; overflow-y: auto; }
  #mapWrap { width: 100%; height: 45vh; flex: none; }
  #searchForm select, #searchForm input, #searchForm button { min-width: 0; box-sizing: border-box; }
  .score-bar { flex-wrap: wrap; }
}

/* ---------- Supplier import, line sheet, orders ---------- */
#srcDlg { width: 1180px; max-width: 98vw; }
.src-scroll { max-height: 48vh; }
.src-table input { width: 100%; min-width: 70px; padding: 3px 5px; font-size: 12px; }
.src-table td { vertical-align: top; text-align: left; }
.src-table tr.warn td { background: #fffbeb; }
.src-review { font-size: 11.5px; max-width: 220px; color: #92400e; }
.src-review details { color: var(--muted); }
#lsFrame { width: 100%; height: 55vh; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; background: #fff; }
#catTable tr.warn td { background: #fffbeb; }
.order-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 12.5px; }
.order-card.paid { background: #f0fbf4; border-color: #bfe5cc; }
.order-card.cancelled { opacity: .6; }
.oc-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.oc-head .hint { margin: 0; }
.oc-next { margin: 4px 0; }
.order-card .actions a.btn, .order-card .actions button { font-size: 12px; padding: 3px 9px; }
#orderDlg { width: 860px; max-width: 98vw; }
.order-lines input { width: 100%; padding: 3px 5px; font-size: 12.5px; }
.order-lines td.r { text-align: right; white-space: nowrap; }
.order-sum { font-size: 13.5px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; margin: 8px 0; }
#leadList li.more { justify-content: center; padding: 10px; }

/* ---------- Pilot, limits ---------- */
.pilot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pilot-head h3 { margin: 0; }
.pilot-head .btns { margin-left: auto; display: flex; gap: 6px; }
.pilot-ready, .pilot-new, .pilot-report { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.pilot-ready h4, .pilot-new h4, .pilot-report h4 { margin: 0 0 6px; }
.kpi.bad { border-color: #fca5a5; background: #fef2f2; }
.pilot-log { list-style: none; padding: 0; margin: 0; font-size: 12.5px; max-height: 260px; overflow-y: auto; }
.pilot-log li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.pilot-log li.stop, .pilot-log li.warn { color: #b45309; }
.pilot-log li.done { color: #15803d; }
.pilot-log time { color: var(--muted); font-size: 11.5px; margin-right: 6px; }
.pilot-mini { font-size: 12.5px; padding: 7px 10px; margin-top: 10px; border-radius: 8px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.pilot-mini.warn { background: #fffbeb; border-color: #fcd34d; }
.pilot-mini a { color: var(--accent); margin-left: 4px; }

/* LinkedIn (by hand) */
.li-box { border-color: #b6d4f0; background: #f2f8fd; }
.li-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.li-head .count { margin-left: auto; }
.li-head .count.over { color: #b91c1c; font-weight: 600; }
.li-close { font-size: 12px; }
.li-who { margin: 6px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.li-tabs { display: flex; gap: 4px; margin: 4px 0; }
.li-tabs .tab { font-size: 12px; padding: 3px 10px; border-radius: 12px; }
.li-tabs .tab.on { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.li-find { margin-top: 8px; font-size: 13px; }
.li-find summary { cursor: pointer; color: #0a66c2; }
.li-links { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.li-funnel { grid-column: 1 / -1; margin-bottom: 8px; }

/* My business, Markets, Rehearsal */
.wide-dlg { width: min(920px, 96vw); }
.demo-banner { background: #fff7e0; border-bottom: 1px solid #f3d38a; padding: 7px 16px; font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.steps-tabs { display: flex; gap: 4px; margin: 4px 0 10px; }
.steps-tabs .tab { font-size: 12.5px; padding: 4px 12px; border-radius: 14px; }
.steps-tabs .tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.p-questions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.p-q { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.p-q > span:first-child { font-weight: 600; }
.p-q .req { color: #b91c1c; }
.p-q.todo input, .p-q.todo textarea { border-color: #f3c46b; background: #fffaf0; }
.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.m-types, .m-cities { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; font-size: 13px; }
.m-cities { max-height: 160px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.m-next li { margin: 3px 0; font-size: 13px; }
.m-items tr.done td { color: var(--muted); }
.m-items tr.failed td { color: #b91c1c; }
.m-items { font-size: 12.5px; }
.m-cov td, .m-cov th { font-size: 12.5px; }
.rh-text { white-space: pre-wrap; background: #f7f7f5; border-radius: 6px; padding: 8px 10px; margin-top: 4px; font-size: 12.5px; }
@media (max-width: 700px) { .p-questions, .p-grid { grid-template-columns: 1fr; } }

/* My business: from existing material */
.p-import { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; background: #fafaf7; }
.p-import summary { cursor: pointer; }
.p-drop { border: 1px dashed #b9b9b0; border-radius: 6px; padding: 8px; margin: 6px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.p-drop.over { background: var(--accent-soft); border-color: var(--accent); }
.p-src { font-size: 11.5px; margin-top: 2px; }
textarea.unsure { border-color: #f3c46b; background: #fffaf0; }
.ok-banner { background: #eef8f0; border-color: #bfe5cc; }

/* Review desk */
.desk-dlg { width: min(1180px, 98vw); max-height: 94vh; }
.desk-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.desk-top h2 { margin: 0 8px 0 0; }
.desk-close { margin-left: auto; }
.desk-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; margin-top: 10px; }
.desk-store { border-right: 1px solid var(--line); padding-right: 14px; font-size: 13px; }
.desk-store h3 { margin: 0 0 2px; }
.desk-mail { display: flex; flex-direction: column; gap: 6px; }
.desk-mail #deskSubj { font-weight: 600; }
.desk-mail textarea { font-family: inherit; font-size: 14px; line-height: 1.5; }
.desk-lint { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.desk-nav { margin-left: auto; display: inline-flex; gap: 4px; }
kbd { font-size: 10.5px; border: 1px solid #ccc; border-radius: 3px; padding: 0 4px; background: #f7f7f7; color: #555; }
.desk-empty { padding: 40px 0; text-align: center; color: var(--muted); }
.desk-patterns { background: #fff7e0; border: 1px solid #f3d38a; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-top: 8px; }
.dp-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.dp-rule { flex: 1; min-width: 260px; }
.desk-keys { margin-top: 10px; }
@media (max-width: 760px) { .desk-grid { grid-template-columns: 1fr; } .desk-store { border-right: none; padding-right: 0; } }

/* Dialogs: × in the corner, buttons always reachable */
dialog { position: relative; }
dialog form { padding-top: 22px; }
.dlg-x { position: absolute; top: 10px; right: 12px; z-index: 5; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 15px; line-height: 1; padding: 0; color: var(--muted); cursor: pointer; }
.dlg-x:hover { background: #f3f4f6; color: inherit; }
dialog form > h2:first-child, .set-top h2 { padding-right: 40px; }
dialog form > menu { position: sticky; bottom: -18px; background: #fff; padding: 10px 0 2px; margin-top: 12px; border-top: 1px solid var(--line); z-index: 3; }

/* Settings: categories */
#settingsDlg { width: min(860px, 96vw); }
#settingsDlg form { padding-top: 0; }
.set-top { position: sticky; top: 0; z-index: 4; background: #fff; display: flex; align-items: center; gap: 12px; padding: 16px 44px 6px 0; }
.set-top h2 { margin: 0; padding-right: 0; }
.set-top #setSearch { flex: 1; max-width: 300px; }
.set-cats { position: sticky; top: 56px; z-index: 4; background: #fff; display: flex; gap: 4px; flex-wrap: wrap; padding: 4px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.set-cats button { font-size: 13px; padding: 5px 11px; border-radius: 16px; }
.set-cats button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#setDirty { margin-right: auto; color: #b45309; }
@media (max-width: 700px) {
  .set-top { flex-wrap: wrap; padding-right: 44px; }
  .set-cats { top: 92px; flex-wrap: nowrap; overflow-x: auto; }
  .set-cats button { white-space: nowrap; }
}

/* Exchange rate (Kit → DDP pricing) */
.fx-box .kpis { margin: 6px 0; }
.fx-spark { display: block; color: var(--accent, #2f6fdd); margin: 4px 0 2px; max-width: 100%; }
.fx-table td, .fx-table th { white-space: nowrap; }
.fx-table tr.warn td { background: rgba(192, 57, 43, 0.06); }
.fx-alert button { margin-left: 6px; }
.fx-money { display: block; margin-top: 4px; }
.src-cost { align-self: center; font-size: 12px; white-space: nowrap; }
/* Phone calls */
.calls-dlg { width: min(940px, 96vw); }
.call-dlg { width: min(760px, 96vw); }
.calls-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.call-list { list-style: none; padding: 0; margin: 0; }
.call-list > li { border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.call-list > li.is-open { border-left: 3px solid #16a34a; }
.cl-sub { margin: 3px 0; }
.call-tel { font-weight: 600; margin-right: 6px; }
.call-script { background: #f8fafc; border-radius: 6px; padding: 8px 10px; margin: 6px 0; }
.call-script p { margin: 2px 0 8px; }
.call-outs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 8px; }
.call-draft pre { white-space: pre-wrap; font-family: inherit; background: #f8fafc; padding: 8px; border-radius: 6px; }
/* Stockists */
.st-dlg { width: min(820px, 96vw); }
.st-brand { border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.st-sample { margin-top: 4px; }
/* Organisation and role (org.js) */
.org-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.org-chip select { font-size: 12.5px; }
.role-banner { background: #eef2ff; color: #3730a3; padding: 6px 12px; font-size: 13px; }
#brandLogo { height: 22px; max-width: 90px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.audit-table td { font-size: 12.5px; }
/* Validate (validate.js) */
.v-tabs { margin-bottom: 8px; }
.v-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--panel); }
.v-card.dropped { opacity: .7; }
.v-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.v-funnel { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.v-step { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; display: flex; flex-direction: column; align-items: center; min-width: 70px; font-size: 12px; }
.v-step b { font-size: 16px; }
.v-step em { font-style: normal; color: var(--accent); }
.v-suggest { padding: 6px 10px; border-radius: 6px; background: var(--accent-soft); margin: 4px 0; }
.v-suggest.drop { background: #fef2f2; } .v-suggest.keep { background: #ecfdf5; }
.v-summary { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.ue-total td { font-weight: 600; border-top: 2px solid var(--line); }
.iv-dlg { width: min(760px, 96vw); }
.portfolio-dlg { width: min(1100px, 97vw); }
.pf-note { display: flex; gap: 4px; margin-top: 4px; } .pf-note input { flex: 1; min-width: 120px; }
.pb-parts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; }
.send-dlg { width: min(760px, 96vw); }
.send-steps { padding-left: 20px; } .send-steps li { margin: 8px 0; } .send-steps li.done { opacity: .75; }
