/* RPR CRM styles: clean SaaS look, navy rail + light workspace */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --navy: #0f172a;
  --navy-2: #1e293b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --green: #059669;
  --red: #dc2626;
  --amber: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Every inline SVG here comes from icon(), so give them all an icon-sized
   default. Without it an unstyled one falls back to the 300x150 replaced
   element size. Context-specific rules below override this. */
svg { width: 16px; height: 16px; flex: none; }
.boot { padding: 60px; text-align: center; color: var(--muted); }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px 44px; width: 420px; max-width: 92vw; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-logo .mark { width: 42px; height: 42px; border-radius: 10px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; }
.login-logo h1 { font-size: 22px; }
.login-sub { color: var(--muted); margin-bottom: 24px; }
.login-user { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border: 1px solid var(--border); background: #fff; border-radius: 10px; margin-bottom: 10px; transition: all .12s; }
.login-user:hover { border-color: var(--blue); background: #f0f6ff; }
.login-user .who { flex: 1; }
.login-user .who b { display: block; }
.login-user .who span { color: var(--muted); font-size: 12.5px; }

/* ---- App shell ---- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.rail {
  width: 216px; min-width: 216px; background: var(--navy); color: #cbd5e1;
  display: flex; flex-direction: column; padding: 14px 10px;
}
.rail .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; color: #fff; }
.rail .brand .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; color: #fff; }
.rail .brand b { font-size: 15.5px; }
.rail .brand span { display: block; font-size: 10.5px; color: #94a3b8; font-weight: 400; }
.rail nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rail nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: #cbd5e1; font-weight: 500; font-size: 13.5px;
}
.rail nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.rail nav a.on { background: var(--blue); color: #fff; }
.rail nav a svg { width: 17px; height: 17px; flex: none; }
.rail nav a .count { margin-left: auto; background: rgba(255,255,255,.16); border-radius: 999px; font-size: 11px; padding: 1px 7px; }
/* An unapproved CDA is somebody waiting on their commission, so the whole
   rail item goes red rather than just carrying a quiet number. */
.rail nav a .count.danger { background: #dc2626; color: #fff; font-weight: 600; }
.rail nav a.has-danger { color: #fca5a5; }
/* Somebody is waiting on an answer from you. Amber rather than red: it is a
   person, not an emergency. */
.rail nav a .count.warn { background: #d97706; color: #fff; font-weight: 600; }
.rail nav a.has-warn { color: #fcd34d; }
.rail .me { display: flex; align-items: center; gap: 10px; padding: 10px 10px 4px; border-top: 1px solid var(--navy-2); margin-top: 10px; }
.rail .me .who { flex: 1; min-width: 0; }
.rail .me .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail .me .who span { font-size: 11px; color: #94a3b8; }
.rail .me button { background: none; border: none; color: #94a3b8; padding: 4px; }
.rail .me button:hover { color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 58px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; flex: none;
}
/* The help ? sits with the title rather than out at the end, so it reads as
   "help with this page" instead of a stray control. The gap is its own, since
   the toolbar's 14px would push it away from the name it belongs to. */
.topbar h2 { font-size: 17px; margin-right: -6px; }
.topbar .search { position: relative; flex: 1; max-width: 420px; }
.topbar .search input {
  width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); outline: none;
}
.topbar .search input:focus { border-color: var(--blue); background: #fff; }
.topbar .search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted); }
.search-pop {
  position: absolute; top: 42px; left: 0; right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15,23,42,.14); max-height: 340px; overflow: auto; z-index: 60;
}
.search-pop .hit { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.search-pop .hit:hover { background: #f0f6ff; }
.search-pop .hit .sub { color: var(--muted); font-size: 12px; }
.topbar .spacer { flex: 1; }

.content { flex: 1; overflow: auto; padding: 20px; }

/* ---- Buttons, badges, pills ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  background: #fff; border-radius: 8px; padding: 7px 13px; font-weight: 600; font-size: 13px;
  color: var(--text); white-space: nowrap;
}
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }
.icon-btn { border: none; background: none; padding: 5px; border-radius: 6px; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 3px 10px; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap;
}
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.bad { background: #fee2e2; color: #b91c1c; }
.pill.good { background: #d1fae5; color: #065f46; }
.pill.plain { background: #eef2f7; color: #475569; }
.banner { border-radius: 9px; padding: 10px 13px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.banner.bad { background: #fee2e2; color: #b91c1c; }
.banner.warn { background: #fef3c7; color: #92400e; }
.banner.good { background: #d1fae5; color: #065f46; }
.banner.info { background: #eff6ff; color: #1d4ed8; }
.tag { display: inline-block; background: #eef2f7; color: #475569; border-radius: 6px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; margin: 1px 2px 1px 0; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; flex: none;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 52px; height: 52px; font-size: 19px; }

/* ---- Cards & layout ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.card .card-head h3 { font-size: 14px; }
.card .card-head .spacer { flex: 1; }
.card .card-body { padding: 16px; }
.grid { display: grid; gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }

/* ---- Stat cards ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; }
.stat:hover { border-color: var(--blue); }
.stat .n { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.stat .l { color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.stat.alert .n { color: var(--red); }

/* ---- Tables ---- */
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: #f8fafc;
  position: sticky; top: 0; z-index: 5;
}
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr.row { cursor: pointer; }
table.list tr.row:hover { background: #f0f6ff; }
table.list td .sub { color: var(--muted); font-size: 12px; margin-top: 1px; }

/* ---- People page ---- */
.people-layout { display: flex; gap: 16px; align-items: flex-start; }
.filter-rail { width: 220px; min-width: 220px; }
.filter-rail .sect { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; padding: 12px 12px 6px; }
.filter-rail .fitem {
  display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-radius: 8px;
  cursor: pointer; font-weight: 500; color: var(--text); font-size: 13.5px;
}
.filter-rail .fitem:hover { background: #eef2f7; }
.filter-rail .fitem.on { background: #e0eaff; color: var(--blue-dark); font-weight: 700; }
.filter-rail .fitem .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.filter-rail .fitem .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.people-table-wrap { flex: 1; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select {
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 8px; background: #fff; outline: none;
}
.toolbar input[type=text]:focus { border-color: var(--blue); }

/* ---- Person page ---- */
.person-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.person-head .title h2 { font-size: 21px; }
.person-head .title .sub { color: var(--muted); }
.person-head .spacer { flex: 1; }
/* Grid children default to min-width:auto, so a long email or address refuses
   to shrink and spills over the next column. min-width:0 is the fix; the wrap
   rules stop the content itself from running past the card edge. */
.person-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.person-layout > .pcol { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.person-layout .card, .person-layout .composer { min-width: 0; max-width: 100%; }
.person-layout .kv .v { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.person-layout .card-body { overflow-wrap: anywhere; }
@media (max-width: 1000px) { .person-layout { grid-template-columns: minmax(0, 1fr); } }

/* Draggable cards */
.pcard { position: relative; }
.pcard.dragging { opacity: .45; }
.pcard.drop-before { box-shadow: 0 -3px 0 0 var(--blue); }
.pcard.drop-after { box-shadow: 0 3px 0 0 var(--blue); }
.drag-grip { color: #cbd5e1; cursor: grab; display: inline-flex; margin-right: 2px; }
.drag-grip:active { cursor: grabbing; }
.pcard:hover .drag-grip { color: var(--muted); }
.pcol:empty { min-height: 60px; border: 2px dashed var(--border); border-radius: var(--radius); }

/* Multi-value contact rows */
.multi-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.multi-row .icon-btn.tiny { padding: 2px; opacity: 0; }
.multi-row:hover .icon-btn.tiny { opacity: 1; }
.icon-btn.tiny svg { width: 12px; height: 12px; }
.ghost-add { background: transparent; border-style: dashed; color: var(--muted); margin-top: 4px; }
.ghost-add:hover { color: var(--blue); border-color: var(--blue); }

/* Composer extras */
.comp-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.comp-files { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.comp-files .tag a { color: #b91c1c; text-decoration: none; margin-left: 4px; }
.composer input[type=datetime-local] { padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; }
.tpl-pick { padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 7px; cursor: pointer; }
.tpl-pick:hover { border-color: var(--blue); background: #f8fbff; }
.tpl-top { display: flex; align-items: baseline; gap: 10px; }
.tpl-top b { flex: 1; min-width: 0; }
/* The reply rate the office measured in Follow Up Boss. Grey by default, green
   when the line genuinely works, amber when it mostly does not: an agent
   choosing between two answers should be able to see which one gets answered
   without reading both. */
.tpl-stat { flex: none; font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: var(--bg); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.tpl-stat.good { background: #ecfdf5; color: #047857; }
.tpl-stat.weak { background: #fffbeb; color: #92400e; }
/* Sent a few times, not enough to rate. Quieter than the rest so it reads as
   "no verdict yet" rather than as a bad one. */
.tpl-stat.thin { background: transparent; color: var(--muted); font-weight: 400; }
.tpl-stat small { font-weight: 400; opacity: .75; margin-left: 5px; }
.tpl-folder { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); margin: 12px 0 6px; }
.tpl-search { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  margin-bottom: 4px; }
.tpl-search:focus { outline: none; border-color: var(--blue); }
.kv { display: flex; padding: 6px 0; gap: 10px; }
.kv .k { width: 92px; min-width: 92px; color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.kv .v { flex: 1; word-break: break-word; }
.editable { border-bottom: 1px dashed transparent; cursor: pointer; }
.editable:hover { border-bottom-color: var(--blue); }

/* Timeline */
.composer { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin-bottom: 16px; box-shadow: var(--shadow); }
.composer .tabs { display: flex; border-bottom: 1px solid var(--border); }
.composer .tabs button {
  border: none; background: none; padding: 10px 15px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; font-size: 13px;
}
.composer .tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.composer .body { padding: 12px; }
.composer textarea, .composer input[type=text] {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; outline: none; resize: vertical;
}
.composer textarea:focus, .composer input[type=text]:focus { border-color: var(--blue); }
.composer .row { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.composer select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; }

.tl-item { display: flex; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-ico {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; flex: none; color: #fff;
}
.tl-ico svg { width: 15px; height: 15px; }
.tl-body { flex: 1; min-width: 0; }
.tl-body .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-body .head b { font-size: 13px; }
.tl-body .head .when { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.tl-body .subj { font-weight: 600; margin-top: 2px; }
.tl-body .text { color: #334155; margin-top: 2px; white-space: pre-wrap; }
.tl-body .auto { display: inline-block; background: #ede9fe; color: #6d28d9; font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }

/* ---- Deals board ---- */
.board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 10px; }
.col { background: #e9eef5; border-radius: var(--radius); width: 265px; min-width: 265px; padding: 10px; }
.col .col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.col .col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.col .col-head b { font-size: 13px; }
.col .col-head .sum { margin-left: auto; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.deal-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow);
}
.deal-card:hover { border-color: var(--blue); }
.deal-card.dragging { opacity: .45; }
.deal-card b { display: block; font-size: 13px; }
.deal-card .val { font-weight: 700; color: var(--green); margin-top: 3px; }
.deal-card .meta { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.col.dragover { outline: 2px dashed var(--blue); outline-offset: -4px; }

/* ---- Tasks ---- */
.task-group h4 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.task-group h4.overdue { color: var(--red); }
.task-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 6px; }
.task-row:hover { border-color: var(--blue); }
.task-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.task-row .t-name { font-weight: 600; }
.task-row .t-sub { color: var(--muted); font-size: 12px; }
.task-row .t-due { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.task-row .t-due.overdue { color: var(--red); font-weight: 700; }
.task-row.done .t-name { text-decoration: line-through; color: var(--muted); }
.task-type-ico { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.task-type-ico svg { width: 14px; height: 14px; }

/* ---- Calendar ---- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-head h3 { font-size: 16px; min-width: 160px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; }
.cal-dow { background: #f8fafc; padding: 7px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cal-cell { background: #fff; min-height: 96px; padding: 6px; font-size: 12px; }
.cal-cell.dim { background: #f8fafc; color: var(--muted); }
.cal-cell .dnum { font-weight: 700; margin-bottom: 4px; }
.cal-cell.today .dnum { color: #fff; background: var(--blue); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.cal-ev { background: #e0eaff; color: var(--blue-dark); border-radius: 5px; padding: 2px 6px; margin-bottom: 3px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.cal-ev.task-ev { background: #fef3c7; color: #92400e; }

/* ---- Plans ---- */
.plan-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.plan-step:last-child { border: none; }
.plan-step .day-chip { background: var(--navy); color: #fff; border-radius: 8px; padding: 4px 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.step-editor { display: grid; grid-template-columns: 70px 110px 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.step-editor input, .step-editor select, .step-editor textarea { padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; width: 100%; }

/* ---- Reports ---- */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-row .lbl { width: 130px; min-width: 130px; font-size: 12.5px; font-weight: 600; text-align: right; color: #475569; }
.bar-row .bar-track { flex: 1; background: #eef2f7; border-radius: 6px; height: 22px; position: relative; }
.bar-row .bar { height: 100%; border-radius: 6px; background: var(--blue); min-width: 2px; }
.bar-row .val { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 60px; }

/* ---- Modal ---- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow: auto; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,.3); }
.modal.wide { width: 760px; }
.modal .m-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal .m-head h3 { font-size: 16px; flex: 1; }
.modal .m-body { padding: 20px; max-height: 70vh; overflow: auto; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; outline: none; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); }

/* ---- Toast ---- */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy); color: #fff; border-radius: 10px; padding: 11px 16px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: slidein .18s ease-out;
}
.toast.err { background: var(--red); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Inbox ---- */
.inbox-item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; background: #fff; }
.inbox-item:hover { background: #f0f6ff; }
.inbox-item .ib-body { flex: 1; min-width: 0; }
.inbox-item .ib-head { display: flex; gap: 8px; align-items: baseline; }
.inbox-item .ib-head .when { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.inbox-item .ib-text { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

code.api { background: var(--navy); color: #a5f3fc; display: block; padding: 14px; border-radius: 8px; font-size: 12px; overflow-x: auto; white-space: pre; font-family: Consolas, monospace; }

/* ---- Guarantee clock (10 offers in 10 days) ---- */
.guar { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: var(--radius); padding: 12px 16px; margin-top: 12px; box-shadow: var(--shadow); }
.guar.ok { border-left-color: var(--green); }
.guar.behind { border-left-color: var(--amber); }
.guar.met { border-left-color: var(--green); background: #f0fdf4; }
.guar.missed { border-left-color: var(--red); background: #fef2f2; }
.guar-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.guar-head b { font-size: 15px; }
.guar-count { font-weight: 800; font-size: 15px; }
.guar-msg { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.guar.met .guar-msg { color: var(--green); }
.guar.missed .guar-msg { color: var(--red); }
.guar.behind .guar-msg { color: var(--amber); }
.guar-track { background: #e9eef5; border-radius: 6px; height: 10px; overflow: hidden; }
.guar-fill { height: 100%; background: var(--blue); border-radius: 6px; transition: width .2s; }
.guar.met .guar-fill, .guar.ok .guar-fill { background: var(--green); }
.guar.behind .guar-fill { background: var(--amber); }
.guar.missed .guar-fill { background: var(--red); }

.prop-card { cursor: pointer; }
.prop-card:hover { border-color: var(--blue); }
.dnc-banner { background: #fee2e2; color: #b91c1c; border-radius: 8px; padding: 8px 11px; font-weight: 700; font-size: 12.5px; margin-bottom: 8px; }

/* ---- Photos ---- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo { position: relative; margin: 0; border-radius: 10px; overflow: hidden; background: #e9eef5; aspect-ratio: 4 / 3; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo-badge { position: absolute; left: 6px; bottom: 6px; background: rgba(15,23,42,.82); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.photo-x { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border: none; border-radius: 50%; background: rgba(15,23,42,.7); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s; }
.photo:hover .photo-x { opacity: 1; }
.photo-x:hover { background: var(--red); }
.card.dropping { outline: 2px dashed var(--blue); outline-offset: -6px; background: #f0f6ff; }

/* ---- Feedback widget ---- */
.fb-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  display: flex; align-items: center; gap: 8px;
  background: var(--navy); color: #fff; border: none; border-radius: 999px;
  padding: 11px 18px; font-weight: 700; font-size: 13.5px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .32);
}
.fb-launch:hover { background: var(--blue); }
.fb-launch svg { width: 16px; height: 16px; }
.fb-panel {
  position: fixed; right: 20px; bottom: 74px; z-index: 150; width: 350px; max-width: calc(100vw - 40px);
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .28); overflow: hidden;
}
.fb-panel .fb-head { display: flex; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.fb-panel .fb-head h3 { font-size: 14px; flex: 1; }
.fb-panel .fb-body { padding: 14px 16px; }
.fb-panel textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; resize: vertical; outline: none; }
.fb-panel textarea:focus { border-color: var(--blue); }
.fb-types { display: flex; gap: 6px; margin-bottom: 10px; }
.fb-types button { flex: 1; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 7px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fb-types button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.fb-sent { text-align: center; padding: 26px 16px; }
.fb-sent .tick { font-size: 30px; color: var(--green); }
#toast-root { bottom: 84px; }

/* ---- Multi-value fields, tags, list editors, automations ---- */
.mf-row { display: grid; grid-template-columns: 1fr 120px 32px; gap: 6px; margin-bottom: 6px; }
.mf-row input, .mf-row select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; width: 100%; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 5px; min-height: 26px; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; background: #eef2f7; color: #334155; border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 12.5px; font-weight: 600; }
.tag-chip button { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 3px; }
.tag-chip button:hover { color: var(--red); }
.editable-list .el-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.editable-list .el-row input.el-name { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; }
.editable-list .el-row input.el-color { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; }
.au-line { display: flex; gap: 9px; align-items: baseline; padding: 3px 0; flex-wrap: wrap; }
.au-key { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); min-width: 42px; }
.au-action { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #f8fafc; }
.au-action select, .au-action input, .au-action textarea { padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; width: 100%; margin-bottom: 6px; }
.chips .chip svg { width: 15px; height: 15px; }

/* ---- Duplicate merge ---- */
.dupe { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.dupe-why { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--amber); margin-bottom: 8px; }
.dupe-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dupe-side { background: #f8fafc; border-radius: 8px; padding: 10px; }
.dupe-side button { margin-top: 8px; width: 100%; justify-content: center; }

/* ---- Mobile: agents work from the car ---- */
/* ---- About and changelog ---- */
.about-head { display: flex; gap: 16px; align-items: center; padding: 20px 22px; }
.about-mark {
  width: 52px; height: 52px; border-radius: 14px; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 24px; flex: none;
}
.feat-row { display: flex; gap: 11px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.feat-row:last-child { border-bottom: none; }
.feat-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; margin-top: 6px; flex: none; }
.feat-dot.on { background: var(--green, #059669); box-shadow: 0 0 0 3px rgba(5, 150, 105, .15); }

/* ---- Today and the call queue ---- */
.today-alert {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 14px;
}
.tab-count { margin-left: 6px; opacity: .75; font-variant-numeric: tabular-nums; }
.chip.on .tab-count { opacity: .9; }

.queue-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.queue-list { padding: 0; max-height: calc(100vh - 300px); overflow-y: auto; }
.q-row { display: flex; gap: 9px; align-items: flex-start; padding: 10px 13px; border-bottom: 1px solid var(--border); cursor: pointer; }
.q-row:hover { background: #f8fafc; }
.q-row.on { background: #eff6ff; box-shadow: inset 3px 0 0 var(--blue); }
.q-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: none; }
.q-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.q-facts span { display: inline-flex; align-items: center; gap: 6px; }
.q-facts svg { width: 14px; height: 14px; }
.q-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.q-playbook { margin-top: 12px; }
.q-pb-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.q-line { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border); }
.q-line-text { flex: 1; min-width: 0; font-style: italic; line-height: 1.55; font-size: 13.5px; }
.q-line .icon-btn { opacity: 0; }
.q-line:hover .icon-btn { opacity: 1; }
.q-help { margin-top: 12px; text-align: center; }
.q-help b {
  display: inline-block; background: var(--bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: 11.5px; margin: 0 1px;
}

/* Inline row controls on the People table */
td.stagecell { position: relative; }
.stage-inline {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: none; background: transparent;
}
tr.row:hover td.stagecell::after {
  content: ''; position: absolute; right: 6px; top: 50%; margin-top: -2px;
  border: 4px solid transparent; border-top-color: var(--muted); pointer-events: none;
}
.row-actions { display: flex; gap: 2px; margin-top: 3px; opacity: 0; }
tr.row:hover .row-actions { opacity: 1; }
.row-actions .icon-btn { padding: 3px; }
.row-actions svg { width: 14px; height: 14px; }

/* Timeline filter chips */
.tl-chips { padding: 8px 0 4px; }
.tl-chips .chip { font-size: 11.5px; padding: 3px 10px; }

@media (max-width: 900px) {
  .queue-split { grid-template-columns: minmax(0, 1fr); }
  .queue-list { max-height: 260px; }
  .q-help { display: none; }
  .row-actions { opacity: 1; }
}

/* Volume meter */
.meter-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.meter {
  position: relative; display: flex; height: 22px; border-radius: 7px; overflow: hidden;
  background: #e2e8f0; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}
.meter > span { height: 100%; transition: width .4s ease; }
.meter .meter-free { background: #e2e8f0; }
.meter.warning { box-shadow: inset 0 0 0 2px var(--amber, #d97706); }
.meter.critical { box-shadow: inset 0 0 0 2px #b91c1c; }
.meter-mark {
  position: absolute; top: -3px; bottom: -3px; width: 2px; background: rgba(15, 23, 42, .35);
}
.meter-mark.crit { background: rgba(185, 28, 28, .6); }
.meter-key { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.meter-key .mk { display: inline-flex; align-items: center; gap: 6px; }
.meter-key .mk i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.meter-key .mk b { color: var(--text); }
.app-share {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.changelog { position: relative; padding-left: 22px; }
.changelog::before {
  content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--border);
}
.rel { position: relative; margin-bottom: 16px; }
.rel-dot {
  position: absolute; left: -22px; top: 18px; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border);
}
.rel-dot.now { border-color: var(--blue); background: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.change { display: flex; gap: 9px; align-items: flex-start; padding: 5px 0; font-size: 13.5px; line-height: 1.55; }
.ctag {
  flex: none; color: #fff; border-radius: 5px; padding: 1px 7px; font-size: 10.5px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; min-width: 62px; text-align: center;
}
@media (max-width: 700px) {
  .about-head { flex-direction: column; align-items: flex-start; }
  .ctag { min-width: 54px; }
}

/* ---- Inbox with a folder rail ---- */
.inbox-split { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; align-items: start; }
.folder-rail { padding: 10px 0 12px; align-self: stretch; }
.folder-rail .sect { padding: 4px 12px 6px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.folder-rail .fitem { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer; border-radius: 7px; margin: 0 6px; }
.folder-rail .fitem:hover { background: var(--bg); }
.folder-rail .fitem.on { background: #eff6ff; color: var(--blue); font-weight: 600; }
.folder-rail .fitem.drop-in { background: #dbeafe; box-shadow: inset 0 0 0 2px var(--blue); }
.folder-rail .fitem .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.folder-rail .fitem .count { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.folder-rail .fitem .sl-edit { opacity: 0; }
.folder-rail .fitem:hover .sl-edit { opacity: 1; }
.rail-actions { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 0; margin-top: 8px; border-top: 1px solid var(--border); }
.convo-row.dragging { opacity: .5; }
.prov-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.prov-row.off { opacity: .6; cursor: not-allowed; }
.prov-row input { margin-top: 4px; }
.ck-row { display: grid; grid-template-columns: 1fr 80px 190px 30px; gap: 8px; align-items: center; margin-bottom: 7px; }
.ck-row input, .ck-row select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
@media (max-width: 900px) {
  .inbox-split { grid-template-columns: minmax(0, 1fr); }
  .folder-rail { display: flex; flex-wrap: wrap; padding: 8px; }
  .folder-rail .sect, .rail-actions { width: 100%; }
  .rail-actions { flex-direction: row; }
  .ck-row { grid-template-columns: 1fr; }
}

/* ---- Shared texting inbox ---- */
.convo-split { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: stretch; height: calc(100vh - 220px); min-height: 460px; }
.convo-list { overflow-y: auto; padding: 0; }
.convo-row { padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.convo-row:hover { background: #f8fafc; }
.convo-row.on { background: #eff6ff; box-shadow: inset 3px 0 0 var(--blue); }
.convo-row.unread .cr-top b { font-weight: 800; }
.convo-row.unread .cr-msg { color: var(--text); font-weight: 600; }
.cr-top { display: flex; align-items: baseline; gap: 8px; }
.cr-top b { font-size: 13.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-top .when { color: var(--muted); font-size: 11.5px; flex: none; }
.cr-msg { color: var(--muted); font-size: 12.5px; margin: 3px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cr-meta .pill { font-size: 10.5px; padding: 2px 8px; }

.convo-pane { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.thread-msgs { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); }
.thread-compose { border-top: 1px solid var(--border); padding: 12px 16px; }
.thread-compose .row { display: flex; gap: 8px; align-items: flex-end; }
.thread-compose textarea { flex: 1; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; font-family: inherit; font-size: 13.5px; resize: vertical; }
select.mini { padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; background: #fff; }
.bub { max-width: 76%; margin-bottom: 12px; }
.bub.in { margin-right: auto; }
.bub.out { margin-left: auto; }
.bub-body { padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bub.in .bub-body { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bub.out .bub-body { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bub-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.bub.out .bub-meta { text-align: right; }

/* ---- Bulk selection bar ---- */
.pick-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  background: #0f172a; color: #fff; border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .35); font-size: 13.5px;
}
.pick-bar .btn { background: #1e293b; color: #fff; border-color: #334155; }
.pick-bar .btn:hover { background: #334155; }
.pick-bar .btn.primary { background: var(--blue); border-color: var(--blue); }
td.pickcell, th:first-child input[type=checkbox] { cursor: default; }
td.pickcell input, th input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }

/* ---- Bulk number check ---- */
.progress { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress > span { display: block; height: 100%; background: var(--blue); transition: width .2s; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-box { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.stat-box b { display: block; font-size: 20px; line-height: 1.2; }
.stat-box span { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

@media (max-width: 860px) {
  .convo-split { grid-template-columns: 1fr; height: auto; }
  .convo-list { max-height: 320px; }
  .convo-pane { min-height: 460px; }
  .bub { max-width: 88%; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; height: auto; min-height: 100vh; }
  .rail { width: 100%; min-width: 0; flex-direction: row; align-items: center; padding: 8px 10px; overflow-x: auto; gap: 6px; position: sticky; top: 0; z-index: 40; }
  .rail .brand { padding: 0 8px 0 2px; flex: none; }
  .rail .brand span { display: none; }
  .rail nav { flex-direction: row; flex: 1; gap: 4px; }
  .rail nav a { padding: 8px 10px; white-space: nowrap; font-size: 12.5px; }
  .rail .me { border-top: none; margin-top: 0; padding: 0 4px; flex: none; }
  .rail .me .who { display: none; }
  .main { min-height: 0; }
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .topbar h2 { font-size: 15px; width: 100%; }
  .topbar .search { max-width: none; order: 3; width: 100%; }
  .content { padding: 12px; }
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .people-layout { flex-direction: column; }
  .filter-rail { width: 100%; min-width: 0; }
  .filter-rail .fitem { display: inline-flex; width: auto; }
  .person-layout { grid-template-columns: 1fr; }
  .dupe-pair { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .step-editor { grid-template-columns: 60px 1fr; }
  .modal-back { padding: 2vh 8px; }
  .person-head { gap: 10px; }
  .person-head .btn { flex: 1 1 auto; justify-content: center; }
  table.list th:nth-child(n+5), table.list td:nth-child(n+5) { display: none; }
  .board { padding-bottom: 4px; }
  .col { width: 84vw; min-width: 84vw; }
  #toast-root { left: 12px; right: 12px; bottom: 12px; }
}

/* ---- Signing: the composer, the field editor, the Signings list ---- */
.modal.huge { width: min(1240px, 96vw); }

h4.sec {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  margin: 20px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--border);
}
h4.sec:first-child { margin-top: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sc-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: #fff;
  border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; cursor: grab;
}
.sc-row.dragging { opacity: .45; }
.sc-row .sc-grip { color: var(--muted); display: flex; }
.sc-row .sc-grip svg { width: 15px; height: 15px; }
.sc-row .sc-num {
  background: var(--text); color: #fff; border-radius: 6px; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: none;
}
.sc-add { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.sc-add select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; min-width: 220px; }

.sc-party { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 12px 40px 12px 12px; margin-bottom: 8px; }
.sc-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc-prem { position: absolute; top: 8px; right: 8px; }
.sc-auto { font-size: 12px; color: #92400e; background: #fef3c7; border-radius: 7px; padding: 5px 9px; margin-top: 9px; }
.sc-hits { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.sc-hits button {
  text-align: left; border: 1px solid var(--border); background: #f8fafc; border-radius: 7px;
  padding: 5px 9px; font-size: 12.5px; cursor: pointer;
}
.sc-hits button:hover { border-color: var(--blue); background: #eff6ff; }
.sc-notify { display: flex; flex-direction: column; gap: 5px; margin-top: 14px; }
.sc-notify label { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text); font-weight: 500; }

.sg-row { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--border); }
.sg-row:last-child { border-bottom: 0; }
.sg-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.ed-back { position: fixed; inset: 0; background: rgba(15, 23, 42, .62); z-index: 120; display: flex; padding: 2vh 2vw; }
.ed { background: var(--bg, #f1f5f9); border-radius: 14px; flex: 1; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,.35); }
.ed-head { display: flex; gap: 10px; align-items: center; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.ed-body { flex: 1; display: flex; min-height: 0; }
.ed-rail { width: 300px; flex: none; background: #fff; border-right: 1px solid var(--border); padding: 16px; overflow: auto; }
.ed-rail h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 18px 0 8px; }
.ed-rail h4:first-child { margin-top: 0; }
.ed-canvas { flex: 1; overflow: auto; padding: 18px; }
.ed-docname { font-weight: 700; font-size: 13.5px; margin: 6px 0 10px; display: flex; gap: 8px; align-items: center; }
.ed-docname .n {
  background: var(--text); color: #fff; border-radius: 6px; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
.ed-parties { display: flex; flex-direction: column; gap: 5px; }
.ed-party {
  display: flex; gap: 8px; align-items: center; text-align: left; width: 100%;
  border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 7px 9px;
  font-size: 12.5px; cursor: pointer; color: var(--text);
}
.ed-party:hover { border-color: var(--blue); }
.ed-party.on { border-color: var(--blue); background: #eff6ff; }
.ed-party .chip {
  background: var(--blue); color: #fff; border-radius: 6px; padding: 1px 6px;
  font-size: 10.5px; font-weight: 700; border: 0; flex: none;
}
.ed-party .muted { font-weight: 400; font-size: 11.5px; }
.ed-props { border: 1px solid var(--border); border-radius: 9px; padding: 10px; background: #f8fafc; }
.ed-check { display: flex; gap: 8px; align-items: center; font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.ed-list { display: flex; flex-direction: column; gap: 4px; }
.ed-lgroup { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.ed-lgroup b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
ol.audit { padding-left: 20px; font-size: 12.5px; color: var(--muted); max-height: 220px; overflow: auto; }
ol.audit li { margin-bottom: 5px; }

@media (max-width: 860px) {
  .ed-body { flex-direction: column; }
  .ed-rail { width: auto; border-right: 0; border-bottom: 1px solid var(--border); max-height: 44vh; }
  .sc-pgrid { grid-template-columns: 1fr; }
}
.doc-bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0 4px; }
.doc-pick { width: 15px; height: 15px; flex: none; cursor: pointer; }

/* ---- About: the API keys tab ---- */
.keyrow { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.keyrow code, .keyitem code {
  font-size: 11px; background: #f1f5f9; border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; color: #475569; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.intg { margin-bottom: 12px; }
.intg .card-head .feat-dot { margin-top: 0; }
.intg.on { border-color: #bbf7d0; }
.intg-what { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.intg-what .lbl {
  display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 700; margin-bottom: 3px;
}
.intg-what p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text); }
.intg-note {
  margin: 12px 0 0; padding: 8px 11px; background: #f8fafc;
  border-left: 3px solid var(--border); border-radius: 0 7px 7px 0; line-height: 1.6;
}
.keylist { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 4px; }
.keyitem { display: flex; gap: 9px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.keyitem:last-child { border-bottom: none; }
.keyitem.set code { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.keyitem .kname { font-size: 12.5px; color: var(--text); }
.keyitem .tag.env { background: #e0e7ff; color: #3730a3; }
.keyitem .tag.app { background: #dcfce7; color: #166534; }
@media (max-width: 720px) { .intg-what { grid-template-columns: 1fr; gap: 10px; } }

/* ---- Bad numbers, Zillow status, USDA ---- */
.multi-row.num-bad a, .multi-row.num-bad span:not(.badbox):not(.pill) { text-decoration: line-through; opacity: .6; }
.multi-row.num-bad a { pointer-events: none; cursor: default; }
.badbox {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .3px; cursor: pointer; flex: none;
}
.badbox input { width: 13px; height: 13px; margin: 0; cursor: pointer; }
.num-sub { font-size: 11.5px; color: var(--muted); margin: -3px 0 6px 46px; display: flex; gap: 8px; flex-wrap: wrap; }
.num-stale { color: var(--amber); font-weight: 600; }
.num-why { color: var(--red); }
.usda-tick {
  display: inline-flex; width: 18px; height: 18px; border-radius: 4px; background: #dcfce7;
  color: #166534; align-items: center; justify-content: center;
}
.usda-tick svg { width: 13px; height: 13px; }
.zillow-eye {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px;
  padding: 9px 11px; background: #f8fafc; border: 1px solid var(--border); border-radius: 9px;
}
.zillow-eye .muted { flex-basis: 100%; }
.fld-move { display: flex; flex-direction: column; gap: 1px; flex: none; }
.fld-move .icon-btn { padding: 1px 3px; }
.fld-move .icon-btn svg { width: 12px; height: 12px; }
.fld-move .icon-btn:disabled { opacity: .25; cursor: default; }
pre.forewarn {
  background: #fff; border: 1px solid var(--border); border-radius: 7px; padding: 8px 11px;
  margin: 8px 0 0; font-size: 12px; line-height: 1.5; font-family: ui-monospace, Menlo, monospace; color: #334155;
}
.tpl-folder { border-left: 2px solid var(--border); padding-left: 10px; margin: 10px 0; }
.tpl-folder-head { display: flex; gap: 7px; align-items: center; padding: 4px 0; font-size: 13px; }
.tpl-folder-head svg { width: 14px; height: 14px; color: var(--muted); }

/* ---- Resources ---- */
.res-crumbs { font-size: 13.5px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.res-crumbs a { color: var(--blue); text-decoration: none; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.res-card {
  display: flex; gap: 11px; align-items: flex-start; background: var(--card);
  border: 1px solid var(--border); border-radius: 11px; padding: 12px 13px; box-shadow: var(--shadow);
}
.res-card.res-folder { cursor: pointer; }
.res-card.res-folder:hover { border-color: var(--blue); }
.res-card a { text-decoration: none; color: var(--text); }
.res-card a:hover b { color: var(--blue); }
.res-icon {
  width: 34px; height: 34px; flex: none; border-radius: 8px; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden;
}
.res-icon svg { width: 17px; height: 17px; }
.res-icon img { width: 100%; height: 100%; object-fit: cover; }
.res-acts { display: flex; gap: 3px; align-items: flex-start; flex: none; }

/* ---- Showings ---- */
.sh-card { margin-bottom: 10px; }
.sh-card.sh-change { border-color: #fecaca; }
.sh-card.sh-change .card-head { background: #fef2f2; }
.sh-group { margin-bottom: 16px; }
.sh-group-head { display: flex; gap: 8px; align-items: center; padding: 4px 2px 8px; font-size: 13.5px; }
.sh-group-head svg { width: 15px; height: 15px; color: var(--muted); }
.sh-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.sh-fields label { display: flex; flex-direction: column; gap: 2px; }
.sh-fields label span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.sh-fields input, .sh-fields textarea {
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; font: inherit; font-size: 13px; width: 100%;
}
.sh-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.sh-actions select { padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; }
.sh-check { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.sh-dupes {
  margin-top: 10px; padding: 8px 11px; background: #f8fafc;
  border-left: 3px solid var(--border); border-radius: 0 7px 7px 0; font-size: 12.5px;
}
.sh-feedback { margin-top: 10px; }
.sh-feedback label { display: flex; flex-direction: column; gap: 2px; }
.sh-feedback label span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.sh-feedback textarea { padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; font: inherit; font-size: 13px; }
.si-day { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.si-day input[type=time] { padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 12.5px; }
.si-day input[type=time]:disabled { opacity: .4; }

/* ---- Bundled tools ---- */
.tool-strip {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 11px;
}
.cp-steps { padding-left: 20px; font-size: 13.5px; line-height: 1.8; margin: 0; }
.cp-steps li { margin-bottom: 2px; }

.pf-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.pf-item { position: relative; margin: 0; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #f8fafc; }
.pf-item img { width: 100%; height: 100px; object-fit: cover; display: block; }
.pf-item figcaption { padding: 5px 7px; font-size: 11.5px; display: flex; flex-direction: column; gap: 1px; }
.pf-item.working { outline: 2px solid var(--blue); }
.pf-item.failed { outline: 2px solid var(--red); }
.pf-item.done { outline: 2px solid var(--green); }
.pf-compare {
  position: absolute; left: 5px; top: 5px; border: 0; border-radius: 5px; cursor: pointer;
  background: rgba(15,23,42,.72); color: #fff; font-size: 10.5px; padding: 2px 7px;
}
.pf-x {
  position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; line-height: 15px;
  border: 0; border-radius: 50%; background: rgba(15,23,42,.72); color: #fff; cursor: pointer; font-size: 13px;
}
.pf-bar { height: 5px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin: 10px 0 4px; }
.pf-bar span { display: block; height: 100%; background: var(--blue); transition: width .2s; }
#photofix-card.dropping { outline: 2px dashed var(--blue); outline-offset: -4px; }

/* The texting-limit recap. A list rather than a paragraph because somebody
   reading it is looking for the one line that explains their refusal. */
.tl-recap { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--text); }
.tl-recap li { margin-bottom: 2px; }

/* The up and down movers on the editable lists. Disabled at the ends, because
   a button that does nothing is worse than one that is visibly unavailable. */
.el-row .el-up, .el-row .el-down { flex: none; }
.el-row .el-up:disabled, .el-row .el-down:disabled { opacity: .25; cursor: default; }
.el-row .el-up:disabled:hover, .el-row .el-down:disabled:hover { background: transparent; }
