:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1c2330; --muted: #667085; --line: #e4e7ec;
  --brand: #1f4fd8; --brand-ink: #fff;
  --hot: #c2331f; --hot-bg: #fdecea; --warm: #a15c07; --warm-bg: #fff3dd;
  --cold: #2f6b3b; --cold-bg: #e8f4ea; --none: #667085; --none-bg: #eef0f3;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 24px; }

/* App shell: fixed sidebar on desktop, slide-in drawer on phones. */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--ink); color: #c9d0dc; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main { min-width: 0; }
.mobile-bar, .scrim { display: none; }
.side-nav { display: flex; flex-direction: column; min-height: 100%; padding: 16px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 700; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; flex-shrink: 0; }
.nav-group { margin-bottom: 18px; }
.nav-label { padding: 0 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7d8799; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: 8px; color: #c9d0dc; font-size: 14px; }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
a.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-link.current { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.nav-link.disabled { color: #7d8799; cursor: default; }
.nav-link .soon { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #98a2b3; }
.nav-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.nav-foot .who { font-size: 12px; color: #98a2b3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout { background: none; border: 0; padding: 8px 0 0; min-height: 36px; color: #c9d0dc; cursor: pointer; font-size: 13px; }
.signout:hover { color: #fff; text-decoration: underline; }
.guest { min-height: 100vh; }
.guest-brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 48px; font-weight: 700; font-size: 18px; }
.guest-brand .brand-mark { width: 34px; height: 34px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .mobile-bar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30; background: var(--ink); color: #fff; padding: 4px 8px; }
  .mobile-brand { color: #fff; font-weight: 700; }
  .mobile-brand:hover { text-decoration: none; }
  .nav-toggle { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: #fff; cursor: pointer; border-radius: 8px; }
  .nav-toggle:hover { background: rgba(255, 255, 255, .1); }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 20, 30, .5); }
  .nav-link { min-height: 44px; }
  .wrap { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.flash { background: var(--cold-bg); color: var(--cold); border: 1px solid #bfe0c5; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.errors { background: var(--hot-bg); color: var(--hot); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: block; color: inherit; }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 13px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=number], input[type=email], input[type=password], select, textarea { border: 1px solid #cdd2da; border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); }
input[type=number] { width: 90px; }
textarea { width: 100%; min-height: 90px; }
.btn { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #cdd2da; }
.btn.danger { background: #fff; color: var(--hot); border: 1px solid #e8b4ad; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
.tablecard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.name { font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; min-width: 42px; text-align: center; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.pill.hot { background: var(--hot-bg); color: var(--hot); }
.pill.warm { background: var(--warm-bg); color: var(--warm); }
.pill.cold { background: var(--cold-bg); color: var(--cold); }
.pill.unscored { background: var(--none-bg); color: var(--none); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--none-bg); color: var(--ink); }
.badge.qualified { background: var(--hot-bg); color: var(--hot); }
.badge.rejected { background: #eceef1; color: #8a93a3; text-decoration: line-through; }
.badge.blocked { background: var(--warm-bg); color: var(--warm); }
.ic { display: inline-block; width: 22px; text-align: center; font-size: 12px; font-weight: 700; border-radius: 4px; margin-right: 2px; }
.ic.on { background: var(--cold-bg); color: var(--cold); }
.ic.off { background: var(--none-bg); color: #b5bcc8; }

.pagination { display: flex; list-style: none; gap: 4px; padding: 0; margin: 16px 0 0; flex-wrap: wrap; }
.pagination li a, .pagination li span { display: block; padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.pagination li.active span { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination li.disabled span { color: #b5bcc8; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }
.bigscore { font-size: 44px; font-weight: 800; line-height: 1; }
.bar { height: 8px; background: var(--none-bg); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--cold); }
.bar.part > span { background: var(--warm); }
.bar.fail > span { background: var(--hot); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
dl.form { grid-template-columns: 110px 1fr; align-items: start; }
dl.form dt { padding-top: 8px; }
dl.form input { width: 100%; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--none-bg); padding: 2px 6px; border-radius: 4px; word-break: break-all; }
.badge.active { background: var(--cold-bg); color: var(--cold); }
.badge.stale { background: var(--warm-bg); color: var(--warm); }
.badge.dormant { background: var(--hot-bg); color: var(--hot); }
.badge.closed { background: #eceef1; color: #6b7280; text-decoration: line-through; }
details.socials { margin-top: 10px; }
details.socials summary { cursor: pointer; font-size: 13px; color: var(--brand); width: fit-content; }
details.socials summary:hover { text-decoration: underline; }
.callhead { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.bigphone { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: .01em; }
.callgrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .callgrid { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 16px; }
.scriptpart { margin-bottom: 14px; }
.scriptpart p { margin: 2px 0 0; font-size: 16px; line-height: 1.55; }
.scriptpart .edit-form { display: none; margin-top: 4px; }
.scriptpart.editing .edit-form { display: block; }
.scriptpart.editing .view { display: none; }
.scriptpart:target { scroll-margin-top: 80px; }
.photo-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.photo-pick { display: grid; gap: 6px; align-content: start; }
.photo-pick img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 28%; border-radius: 6px; background: var(--none-bg); }
.photo-pick.off img { opacity: .45; }
.photo-pick .check { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.logo-pick { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; padding: 12px; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.logo-pick img { height: auto; max-width: 200px; background: #fff; border-radius: 4px; padding: 6px; }
.optlabel[hidden] { display: none; }
.optlabel { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.optlabel select, .optlabel input { display: block; width: 100%; margin-top: 2px; font-size: 14px; }
.noteform { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.scriptlabel { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.outcomes { display: grid; gap: 6px; }
.outcome { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.outcome:hover { border-color: var(--brand); }
.outcome:has(input:checked) { border-color: var(--brand); background: #eef3ff; }
.hours { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.note { border-top: 1px solid var(--line); padding: 12px 0; }
.note:first-of-type { border-top: 0; }
.notebody { white-space: pre-wrap; margin-top: 4px; }
.linkbtn { white-space: nowrap; flex-shrink: 0; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 13px; }
.linkbtn:hover { color: var(--hot); text-decoration: underline; }
.crumb { margin-bottom: 12px; font-size: 14px; }

/* Prospect page: key facts, action pills and their panels */
.keyfacts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 32px; align-items: center; }
.kf-score { display: flex; align-items: center; gap: 16px; }
.kf-list { grid-template-columns: 110px minmax(0, 1fr); }
@media (max-width: 700px) { .keyfacts { grid-template-columns: minmax(0, 1fr); } }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.actpill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid #cdd2da; background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.actpill:hover { border-color: var(--brand); text-decoration: none; }
.actpill[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (max-width: 860px) { .actpill { min-height: 44px; } }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #cdd2da; flex-shrink: 0; }
.dot.done { background: var(--cold); }
.dot.busy { background: #e0a100; }
.dot.failed { background: var(--hot); }
.dot.off { background: transparent; border: 1.5px solid #b5bcc8; }
.action-panel { border-color: var(--ink); }
.panel-last { background: #f6f7f9; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.panel-form { max-width: 520px; }
.optlabel .hint { display: block; font-weight: 400; margin-top: 4px; color: var(--muted); }
.concept-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* Concept workspace */
.stepno { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; vertical-align: 1px; }
.estimate { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f6f7f9; }
.estimate-amount { font-size: 20px; }

/* Copy editor */
.editgroup > summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.editgroup > summary::-webkit-details-marker { display: none; }
.editgroup > summary::before { content: "▸"; color: var(--muted); }
.editgroup[open] > summary::before { content: "▾"; }
.editgroup[open] > summary { margin-bottom: 14px; }
.editfield { display: block; margin-bottom: 14px; }
.editlabel { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.editfield input, .editfield textarea { width: 100%; }
.editfield.flagged input, .editfield.flagged textarea { border-color: var(--hot); background: var(--hot-bg); }
.fieldnote { display: block; margin-top: 4px; font-size: 13px; color: var(--hot); }
.issuelist { margin: 0 0 16px; padding-left: 18px; font-size: 14px; }
.issuelist li { margin-bottom: 4px; }
.editbar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }

/* Look and files */
.palettes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.palette { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-height: 48px; }
.palette:hover { border-color: var(--brand); }
.palette:has(input:checked) { border-color: var(--brand); background: #eef3ff; }
.swatches { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); flex-shrink: 0; }
.swatches i { display: block; width: 22px; height: 28px; }
.checks .check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; font-size: 14px; }
.checks input { margin-top: 3px; }

/* Sidebar counts */
.nav-link .count { margin-left: auto; font-size: 12px; color: #98a2b3; font-variant-numeric: tabular-nums; }
.nav-link.current .count { color: #fff; }

.optlabel input[type=password] { width: 100%; }

/* Photo and logo uploads */
.uploads { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.uploads form { display: grid; gap: 8px; justify-items: start; }
.uploads input[type=file] { font-size: 14px; max-width: 100%; }
