/* BossBoard Cloud — restyled to match the Muse app BossBoard:
   Jobber-style light workspace — soft gray canvas, white cards, deep navy
   sidebar, green primary action, Inter. (Dark values mirror the Muse app's
   Options dark theme.) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --accent: #12805c; /* runtime: overridden by the user's accent setting */
  --accent-dark: #0d6a4c;
  --ink: #1b2a33;
  --ink-2: #33424c;
  --muted: #6d7f8a;
  --line: #dde3e7;
  --bg: #f2f4f5;
  --card: #ffffff;
  --surface-2: #eef1f3;
  --side: #12262e;
  --side-ink: #c3d2d9;
  --side-dim: #7d97a3;
  --ok: #12805c;
  --warn: #d97706;
  --bad: #c93a3a;
  --radius: 10px;
  --shadow-card: 0 1px 2px rgba(18, 38, 46, 0.06), 0 4px 14px rgba(18, 38, 46, 0.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; -webkit-font-smoothing: antialiased; }
body.theme-dark { --bg: #0e1518; --card: #182227; --surface-2: #212f36; --ink: #e9eff2; --ink-2: #c7d5db; --muted: #93a7b0; --line: #2d3f47; --ok: #34b37a; --bad: #e57373; --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 14px rgba(0, 0, 0, 0.35); }
body.density-compact { font-size: 14.5px; }
body.density-compact td, body.density-compact th { padding: 5px 8px; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 6px; }
label input, label select, label textarea { margin-top: 0; text-transform: none; letter-spacing: normal; }
a { color: #2563eb; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--side); padding: 20px; }
.auth-card { background: var(--card); border-radius: 12px; padding: 28px; width: 100%; max-width: 380px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.auth-logo { font-size: 24px; font-weight: 800; letter-spacing: -0.2px; text-align: center; color: var(--ink); }
.auth-sub { text-align: center; color: var(--muted); margin: 6px 0 10px; }
.error { color: var(--bad); font-size: 14px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
#sidebar { width: 240px; flex: 0 0 240px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { font-weight: 800; letter-spacing: -0.2px; font-size: 18px; padding: 20px 16px 10px; color: #fff; }
.brand::after { content: "Roofing CRM · Quotes · Jobs · Invoices"; display: block; font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--side-ink); margin-top: 2px; }
#nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
#nav button { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; color: var(--side-ink); text-align: left; padding: 8px 12px; margin-bottom: 2px; border-radius: 8px; font-size: 14px; font-weight: 600; }
#nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
#nav button.active { background: rgba(255,255,255,.12); color: #fff; }
#nav .badge { background: rgba(255,255,255,.14); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.side-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12.5px; color: var(--side-ink); }
.side-foot .muted { color: var(--side-dim); }
.side-foot .btn.ghost { color: var(--side-ink); border-color: rgba(255,255,255,.18); margin-top: 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar { display: flex; gap: 12px; align-items: center; padding: 12px 18px; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
body.theme-dark #topbar { background: rgba(24,34,39,.95); }
.search-wrap { flex: 1; max-width: 560px; position: relative; }
.search-wrap input { background: var(--surface-2); border-radius: var(--radius); min-height: 44px; padding: 10px 12px; }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(18,38,46,.16); max-height: 60vh; overflow-y: auto; padding: 6px; z-index: 50; }
.search-results h5 { margin: 8px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.search-results button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px; border-radius: 6px; color: var(--ink); }
.search-results button:hover { background: var(--surface-2); }
.search-results .sub { color: var(--muted); font-size: 12.5px; }
.top-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.new-menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(18,38,46,.16); padding: 6px; min-width: 180px; z-index: 50; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.menu button:hover { background: var(--surface-2); }
#content { padding: 24px 20px; max-width: 1152px; width: 100%; margin: 0 auto; }

/* ---------- generic ---------- */
.btn { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: var(--radius); padding: 8px 14px; font-weight: 600; min-height: 40px; }
.btn.small { min-height: 0; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 1px 2px rgba(18,38,46,.08); }
.btn.primary:hover { background: var(--accent); filter: brightness(.92); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); border-color: #e5b4b4; }
.btn.danger:hover { background: #fdecec; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-2 { grid-template-columns: 1fr; } }
h1.page { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 16px; }
.money-big { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.money-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.pill.green { background: #e6f4ee; color: #12805c; border-color: #c9e6d8; }
.pill.amber { background: #fdf3d7; color: #92400e; border-color: #efdfae; }
.pill.red { background: #fdecec; color: #c93a3a; border-color: #f0bcbc; }
.pill.gray { background: var(--surface-2); color: var(--muted); }
body.theme-dark .pill.green { background: #123528; color: #34b37a; border-color: #1d4d38; }
body.theme-dark .pill.amber { background: #38300f; color: #f2c94c; border-color: #57491a; }
body.theme-dark .pill.red { background: #3d1d1d; color: #e57373; border-color: #5f2b2b; }
.stage-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.stage-dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.muted { color: var(--muted); } .small-text { font-size: 13px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 4px 14px; }

/* ---------- pipeline ---------- */
.pipeline { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.stage-col { flex: 0 0 250px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 12px; }
.stage-col h4 { margin: 2px 0 10px; font-size: 13.5px; display: flex; justify-content: space-between; }
.stage-col h4 .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.lead-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; cursor: pointer; background: var(--card); }
.lead-card:hover { border-color: #b7c5cc; box-shadow: var(--shadow-card); }
.lead-card .nm { font-weight: 700; }
.lead-card .meta { color: var(--muted); font-size: 12.5px; }

/* ---------- documents ---------- */
.doc-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .doc-layout { grid-template-columns: 1fr; } }
.paper { background: #fff; color: #263238; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 28px; }
.paper h2 { margin: 0; }
.paper table td, .paper table th { border-color: #e8e8e8; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 86px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; background: #fff; padding: 0; text-align: center; }
.swatch.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.swatch .chip { height: 44px; background-size: cover; background-position: center; }
.swatch .nm { font-size: 11px; padding: 4px 2px; color: #333; }
.sig-pad { border: 1px solid var(--line); border-radius: var(--radius); width: 100%; height: 144px; touch-action: none; background: #fff; }

/* ---------- feed / jobs ---------- */
.feed-post { border-bottom: 1px solid var(--line); padding: 10px 0; }
.feed-post .who { font-size: 12.5px; color: var(--muted); }
.feed-post.need { background: #fdf3d7; border-left: 3px solid var(--warn); padding-left: 10px; }
body.theme-dark .feed-post.need { background: #2b2413; }
.feed-post img, .thumb { max-width: 220px; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(14,21,24,.55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px; z-index: 100; overflow-y: auto; }
.modal { background: var(--card); border-radius: 12px; box-shadow: 0 20px 50px rgba(18,38,46,.25); width: 100%; max-width: 680px; padding: 22px; }
.modal.wide-modal { max-width: 980px; }
.modal h3 { margin-top: 0; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; z-index: 200; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 14px; }

/* ---------- options ---------- */
.opt-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.opt-row .grow { flex: 1; }
.opt-row input[type="text"] { max-width: 300px; }
input[type="color"] { width: 52px; padding: 2px; height: 34px; }
.switch { width: auto !important; }

/* ---------- mobile ---------- */
.only-mobile { display: none; }
@media (max-width: 860px) {
  #sidebar { position: fixed; left: -252px; transition: left .2s; }
  #sidebar.open { left: 0; box-shadow: 0 0 60px rgba(0,0,0,.5); }
  .only-mobile { display: inline-block; }
  #content { padding: 14px; }
  .search-wrap { max-width: none; }
}

/* ================= v5: Muse-app structural port ================= */
/* ---------- shell: groups, screen title, topbar ---------- */
.nav-group-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--side-dim); padding: 14px 12px 4px; }
.nav-group-label:first-child { padding-top: 2px; }
#nav button.nav-opts { margin-top: 10px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); }
#nav button svg { width: 17px; height: 17px; flex: 0 0 17px; }
#nav button .nav-ic { display: inline-flex; margin-right: 8px; vertical-align: -3px; }
.screen-title { font-size: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.search-trigger { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); font-size: 14px; cursor: text; text-align: left; }
.search-trigger:hover { border-color: var(--line); }
.search-trigger svg { width: 18px; height: 18px; flex: 0 0 18px; }
.kbd-chip { margin-left: auto; font-size: 11px; font-weight: 600; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: var(--card); color: var(--muted); white-space: nowrap; }
.options-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--card); box-shadow: 0 1px 2px rgba(18,38,46,.06); min-height: 44px; }
.options-btn svg { width: 18px; height: 18px; }
#new-btn { min-height: 44px; font-weight: 700; }
.gear-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(18,38,46,.06); color: var(--ink-2); font-weight: 600; font-size: 14px; }
.gear-btn:hover { background: var(--surface-2); }
.gear-btn svg { width: 18px; height: 18px; }

/* ---------- screen heads (screens that carry one in the Muse app) ---------- */
.screen-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.screen-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.screen-sub { font-size: 14px; color: var(--muted); margin: 3px 0 0; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saved-note { font-size: 14px; font-weight: 700; color: var(--ok); }

/* ---------- lead cards (Home / Clients / Pipeline) ---------- */
.lead-card2 { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 14px 16px; margin-bottom: 8px; cursor: pointer; }
.lead-card2:hover { border-color: #b7c5cc; }
.lc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lc-main { background: none; border: 0; padding: 0; text-align: left; min-width: 0; flex: 1; cursor: pointer; }
.lc-name { display: block; font-size: 16px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-sub { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-value { background: none; border: 0; padding: 2px 0; font-size: 15px; font-weight: 700; color: var(--accent); text-decoration: underline dotted; text-underline-offset: 4px; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lc-value-none { background: none; border: 0; padding: 2px 0; font-size: 14px; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 4px; cursor: pointer; white-space: nowrap; }
.lc-static { font-size: 15px; font-weight: 700; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lc-cluster { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.date-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.date-pill.due { background: #fdecec; color: var(--bad); border-color: #f0bcbc; }
button.date-pill { cursor: pointer; }
.bell-btn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; padding: 0; }
.bell-btn svg { width: 20px; height: 20px; }
.bell-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bell-static { cursor: default; }
.stage-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.stage-pill .stage-dot { width: 8px; height: 8px; flex-basis: 8px; }
.stage-pill .caret { color: var(--muted); font-size: 11px; }
.stage-pill-static { cursor: default; }

/* ---------- picker dialogs ---------- */
.modal-kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
.picker-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.picker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.picker-row:hover { border-color: #b7c5cc; }
.picker-row .pr-sub { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.picker-row.current { color: #fff; border-color: transparent; cursor: default; }
.picker-row.current .pr-sub { color: rgba(255,255,255,.85); }
.field-error { color: var(--bad); font-size: 14px; font-weight: 600; margin-top: 8px; }
.saved-big { text-align: center; padding: 26px 0 10px; font-size: 20px; font-weight: 800; color: var(--ok); }

/* ---------- Home ---------- */
.sec-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.pipeline-total { display: block; background: none; border: 0; padding: 0; margin-top: 2px; font-size: 48px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink-2); text-decoration: underline dotted; text-underline-offset: 8px; cursor: pointer; font-variant-numeric: tabular-nums; }
.stats-row { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; }
.stat { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.stat b { display: block; font-size: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.stat.good b { color: var(--ok); }
.stat.bad b { color: var(--bad); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 10px; }
.sec-title { font-size: 16px; font-weight: 700; margin: 26px 0 10px; }
.sec-head .sec-title { margin: 0; }
.sec-count { color: var(--muted); font-weight: 600; }
.dotted-link { background: none; border: 0; padding: 0; font-size: 13px; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.money-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.money-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 10px 12px; text-align: left; cursor: pointer; }
.money-card:hover { border-color: #b7c5cc; }
.mc-v { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.mc-v.accent { color: var(--accent); }
.mc-v.good { color: var(--ok); }
.mc-l { font-size: 12px; color: var(--muted); margin-top: 1px; }
.recent-docs { margin-top: 6px; }
.recent-doc { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); padding: 9px 2px; text-align: left; cursor: pointer; }
.recent-doc .rd-name { font-weight: 600; font-size: 14.5px; }
.recent-doc .rd-sub { font-size: 12.5px; color: var(--muted); }
.recent-doc .rd-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.empty-note { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--muted); font-size: 14px; background: var(--card); }
.stage-row { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); padding: 11px 2px; cursor: pointer; text-align: left; }
.stage-row:first-child { border-top: 0; }
.stage-row .sr-label { flex: 1; font-size: 15px; font-weight: 600; color: var(--ink); }
.stage-row .sr-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.stage-count-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 2px 9px; font-size: 12.5px; font-weight: 700; }

/* ---------- Clients ---------- */
.clients-tools { margin-bottom: 6px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
@media (max-width: 560px) { .filter-grid { grid-template-columns: 1fr; } }
.count-line { font-size: 14px; color: var(--muted); margin: 12px 0 10px; }

/* ---------- Pipeline ---------- */
.pipe-stage-head { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; }
.pipe-stage-head:first-of-type { margin-top: 4px; }
.pipe-stage-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.pipe-stage-head .ps-count { color: var(--muted); font-size: 14px; }
.pipe-stage-head .ps-total { margin-left: auto; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.pipe-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 640px) { .pipe-grid { grid-template-columns: 1fr 1fr; gap: 0 10px; } }
.no-leads { color: var(--muted); font-size: 14px; margin: 0 0 6px; }

/* ---------- lead detail (inside the client modal) ---------- */
.detail-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-name { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 10px 0 2px; }
.detail-addr { font-size: 14px; color: var(--muted); }
.detail-value-row { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.detail-value { font-size: 20px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.detail-service { font-size: 14px; color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.action-grid .btn, .action-grid .btn-placeholder { min-height: 56px; display: flex; align-items: center; justify-content: center; font-size: 15px; text-decoration: none; }
.btn-placeholder { border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: var(--surface-2); font-weight: 600; }
.email-row { margin-top: 8px; }
.email-row .btn { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.sec-kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 8px; }
.jobcost-line { font-size: 15px; margin: 4px 0; }
.jobcost-line b.bad { color: var(--bad); }
.jobcost-line b.good { color: var(--ok); }
.exp-mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.exp-mini-row .amt { font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; }
.doc-mini-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 6px; cursor: pointer; text-align: left; }
.doc-mini-row .dm-t { font-weight: 600; font-size: 14.5px; }
.doc-mini-row .dm-s { font-size: 12.5px; color: var(--muted); }
.doc-mini-row .dm-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.stage-pills-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-pick { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.stage-pick.current { color: #fff; border-color: transparent; }
.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
@media (max-width: 560px) { .form-grid2, .form-grid3 { grid-template-columns: 1fr; } }
.big-save { width: 100%; min-height: 52px; font-size: 16px; font-weight: 700; margin-top: 14px; }
.big-save-56 { min-height: 56px; font-size: 18px; }
.btn.danger-solid { background: #7f1d1d; border-color: #7f1d1d; color: #fff; }
.btn.danger-solid:hover { background: #7f1d1d; filter: brightness(1.1); }
.intro-line { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.tab-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

/* ---------- document list cards ---------- */
.doc-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 14px 16px; margin-bottom: 8px; cursor: pointer; text-align: left; width: 100%; }
.doc-card:hover { border-color: #b7c5cc; }
.doc-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.doc-name { font-size: 16px; font-weight: 600; color: var(--ink); }
.doc-sub { font-size: 14px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-total { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 9px; font-size: 12px; }
.chip-num { background: var(--surface-2); border-radius: 6px; padding: 2px 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.chip-brand { background: var(--surface-2); border-radius: 6px; padding: 2px 7px; font-weight: 600; color: var(--ink-2); }
.chip-date { color: var(--muted); }
.due-text { color: var(--accent); font-weight: 700; }
.paid-text { color: var(--muted); }
.pill-status { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-good { background: #e3f2e9; color: var(--ok); }
.st-warn { background: #fdf3d7; color: #92600a; }
.st-bad { background: #fdecec; color: var(--bad); }
.st-dim { background: var(--surface-2); color: var(--muted); }
body.theme-dark .st-good { background: #123528; color: #34b37a; }
body.theme-dark .st-warn { background: #38300f; color: #f2c94c; }
body.theme-dark .st-bad { background: #3d1d1d; color: #e57373; }
.for-client { display: flex; align-items: flex-end; gap: 8px; }
.for-client select { min-width: 190px; }

/* ---------- document editor ---------- */
.editor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.editor-title { font-size: 20px; font-weight: 800; margin: 0; flex: 1; min-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 1024px) { .editor-grid { grid-template-columns: 1fr 430px; } }
.preview-toggle { display: none; margin-bottom: 12px; }
@media (max-width: 1023px) {
  .preview-toggle { display: inline-flex; }
  .preview-col { display: none; }
  .preview-col.show { display: block; }
}
.ed-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 18px; margin-bottom: 16px; }
.ed-card h3 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.ed-sub { font-size: 14px; color: var(--muted); margin: -6px 0 12px; }
.field-grid { display: grid; grid-template-columns: 1fr; gap: 2px 12px; }
@media (min-width: 640px) { .field-grid { grid-template-columns: 1fr 1fr; } .field-grid .span2 { grid-column: span 2; } }
.field-grid label { margin-top: 6px; }
.linked-note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.linked-note b { color: var(--ink-2); }
.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 560px) { .pkg-grid { grid-template-columns: 1fr; } }
.pkg-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 10px 12px; text-align: left; cursor: pointer; width: 100%; }
.pkg-card.sel { border: 2px solid var(--accent); background: #eef7f2; padding: 9px 11px; }
body.theme-dark .pkg-card.sel { background: #14352a; }
.pkg-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 700; font-size: 14.5px; }
.sel-pill { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 8px; white-space: nowrap; }
.pkg-product { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pkg-price { font-size: 20px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.pkg-price .per { font-size: 12px; font-weight: 600; color: var(--muted); }
.pkg-products { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.rate-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; max-width: 260px; }
.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
@media (max-width: 560px) { .swatch-grid { grid-template-columns: repeat(3, 1fr); } }
.swatch-btn { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); padding: 0; cursor: pointer; text-align: center; }
.swatch-btn img { display: block; width: 100%; height: 64px; object-fit: cover; background: var(--surface-2); }
.swatch-btn .nm { display: block; font-size: 11px; font-weight: 500; padding: 4px 2px; color: var(--ink-2); }
.swatch-btn.sel { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }
.swatch-btn .ck { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.prints-line { font-size: 13px; color: var(--muted); margin-top: 10px; }
.item-card { background: var(--surface-2); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.item-head { display: flex; align-items: center; gap: 8px; }
.item-num { font-size: 12px; font-weight: 700; color: var(--muted); }
.item-head input { flex: 1; background: var(--card); }
.item-rm { flex: 0 0 auto; width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--bad); font-weight: 700; cursor: pointer; box-shadow: 0 1px 2px rgba(18,38,46,.06); }
.item-card textarea { background: var(--card); margin-top: 8px; }
.brand-tag { display: inline-block; margin-top: 6px; background: #e3f2e9; color: var(--accent); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 8px; }
body.theme-dark .brand-tag { background: #123528; }
.item-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 4px; }
.item-grid3 input { background: var(--card); }
.amount-cell { font-weight: 600; padding: 9px 0 0; font-variant-numeric: tabular-nums; }
.add-item-btn { width: 100%; margin-top: 2px; }
.svc-label { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.svc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.svc-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.svc-chip:hover { border-color: var(--accent); color: var(--accent); }
.trow { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.trow .tl { color: var(--muted); }
.trow.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 9px; font-size: 18px; font-weight: 700; }
.trow.total .tl { color: var(--ink); }
.trow.accent-row { color: var(--accent); font-weight: 700; }
.trow.accent-row .tl { color: var(--accent); }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.pay-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 12px; }
@media (max-width: 700px) { .pay-form { grid-template-columns: 1fr 1fr; } }
.action-col { display: flex; flex-direction: column; gap: 8px; }
.action-col .btn { width: 100%; text-align: left; min-height: 44px; }
.action-col .btn.primary { text-align: center; }
.sig-img-wrap { background: var(--surface-2); border-radius: var(--radius); padding: 10px; }
.sig-img-wrap img { max-width: 300px; width: 100%; }
.clear-sig-link { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline dotted; cursor: pointer; padding: 0; }

/* ---------- paper (DocPreview mirror) ---------- */
.paper2 { background: #eceff1; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 14px rgba(18,38,46,.08); overflow: hidden; color: #263238; }
@media (min-width: 1024px) { .paper2 { position: sticky; top: 84px; } }
.paper-head { background: var(--side); color: #fff; padding: 16px; }
.paper-head .ph-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.paper-head .ph-line { font-size: 14px; color: rgba(255,255,255,.85); margin-top: 3px; }
.paper-head .ph-meta { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 3px; }
.paper-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.paper-sec { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 2px rgba(18,38,46,.07); }
.paper-sec h3 { font-size: 18px; font-weight: 700; margin: 0 0 10px; color: #263238; }
.paper-sec h4 { font-size: 16px; font-weight: 700; margin: 0 0 6px; color: #263238; }
.paper-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; font-size: 14px; }
.paper-dl dt { font-size: 12px; font-weight: 500; color: #78909c; }
.paper-dl dd { margin: 2px 0 0; font-weight: 500; }
.paper-brandline { display: flex; align-items: center; gap: 12px; border-top: 1px solid #eceff1; margin-top: 12px; padding-top: 10px; font-size: 14px; }
.paper-brandline img { width: 80px; height: 48px; object-fit: cover; border-radius: 6px; flex: 0 0 80px; }
.paper-pkgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.paper-pkg { border: 1px solid #cfd8dc; border-radius: 8px; padding: 10px; }
.paper-pkg.sel { border: 2px solid #12805c; background: #eef7f2; padding: 9px; }
.paper-pkg .pp-name { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; }
.paper-pkg .pp-ck { width: 16px; height: 16px; border-radius: 50%; background: #12805c; color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }
.paper-pkg .pp-prod { font-size: 10px; color: #78909c; margin-top: 2px; line-height: 1.35; }
.paper-pkg .pp-price { font-size: 14px; font-weight: 700; margin-top: 6px; }
.paper-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.paper-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #78909c; font-weight: 500; text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid #cfd8dc; }
.paper-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid #eceff1; vertical-align: top; color: #263238; }
.paper-table .r { text-align: right; padding-right: 0; }
.paper-table .it-det { display: block; font-size: 12px; color: #78909c; white-space: pre-line; }
.paper-totals { margin: 12px 0 0 auto; width: 224px; font-size: 14px; }
.paper-totals .trow .tl { color: #78909c; }
.paper-totals .trow.total { border-top: 2px solid #263238; font-size: 16px; }
.paper-totals .trow.total .tl { color: #263238; }
.paper-notes { font-size: 14px; color: #455a64; white-space: pre-line; }
.paper-terms { font-size: 12px; line-height: 1.55; color: #546e7a; white-space: pre-line; }
.paper-sig-img { max-height: 64px; width: auto; border-bottom: 1px solid #263238; }
.paper-sig-line { font-size: 12px; color: #78909c; margin-top: 6px; }
.paper-sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: 12px; color: #78909c; }
.paper-sig-grid .line { border-bottom: 1px solid #263238; height: 34px; }

/* ---------- expenses / lead costs ---------- */
.form-err { color: var(--bad); font-size: 14px; font-weight: 600; }
.form-ok { color: var(--ok); font-size: 14px; font-weight: 700; }
.cat-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.cat-row:first-of-type { border-top: 0; }
.cat-row .amt { font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; }
.month-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 24px 0 10px; }
.month-head h3 { font-size: 16px; font-weight: 700; margin: 0; }
.month-head .m-total { font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; }
.exp-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 14px 16px; margin-bottom: 8px; }
.exp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.exp-title { font-size: 16px; font-weight: 600; }
.exp-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.exp-amt { font-size: 16px; font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-actions { display: flex; gap: 6px; margin-top: 10px; }
.hero-total { font-size: 48px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-2); line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.byplat-sub { font-size: 13px; color: var(--muted); }

/* ---------- templates / catalog / jobs / team ---------- */
.tpl-items { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 14px; }
.tpl-items li { display: flex; justify-content: space-between; gap: 12px; padding: 2.5px 0; }
.tpl-items .ti-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-items .ti-amt { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.brand-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.brand-pill { border-radius: 99px; border: 0; background: var(--surface-2); color: var(--muted); padding: 7px 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.brand-pill.sel { background: var(--accent); color: #fff; font-weight: 700; box-shadow: 0 1px 2px rgba(18,38,46,.15); }
.tpl-total { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tpl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.catalog-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
@media (min-width: 640px) { .catalog-swatches { grid-template-columns: repeat(8, 1fr); } }
.catalog-swatches figure { margin: 0; }
.catalog-swatches .sw-wrap { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.catalog-swatches img { display: block; width: 100%; height: 52px; object-fit: cover; }
.catalog-swatches figcaption { font-size: 11px; font-weight: 500; line-height: 1.3; text-align: center; color: var(--muted); margin-top: 4px; }
.prod-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 3px 24px; font-size: 14px; color: var(--ink-2); }
@media (min-width: 640px) { .prod-list { grid-template-columns: 1fr 1fr; } }
.svc-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.svc-list li { padding: 3px 0; }
.svc-list .sv-name { font-weight: 600; }
.svc-list .sv-det { color: var(--muted); }
.job-docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.job-doc-chip { background: var(--surface-2); border: 0; border-radius: 99px; padding: 5px 11px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--side); color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.team-top { display: flex; gap: 12px; align-items: flex-start; }
.role-pill { display: inline-block; background: #e3f2e9; color: var(--accent); font-size: 12px; font-weight: 700; border-radius: 99px; padding: 2px 9px; margin-top: 3px; }
body.theme-dark .role-pill { background: #123528; }
.team-phone { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* ---------- options center ---------- */
.opt-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 18px; margin-bottom: 16px; scroll-margin-top: 84px; }
.opt-card h3 { font-size: 18px; font-weight: 700; margin: 0; }
.opt-blurb { font-size: 14px; color: var(--muted); margin: 3px 0 16px; }
.opt-row2 { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; flex-wrap: wrap; }
.opt-row2 input[type="text"] { background: var(--card); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 0; font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: normal; color: var(--ink); margin: 0; cursor: pointer; }
.toggle-row input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--accent); cursor: pointer; }
.move-btns { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.move-btn { width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.move-btn:disabled { opacity: .35; cursor: default; }
.sub-block { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.sub-block h4 { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.opt-subbox { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.opt-subbox h4 { font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.opt-subbox input, .opt-subbox textarea, .opt-subbox select { background: var(--card); }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.preset-chip.sel { border: 2px solid var(--accent); background: var(--surface-2); font-weight: 700; color: var(--ink); padding: 7px 11px; }
.preset-swatch { display: inline-flex; border-radius: 4px; overflow: hidden; }
.preset-swatch span { width: 20px; height: 20px; display: block; }
.save-bar { position: sticky; top: 76px; z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-card); padding: 12px 16px; margin-bottom: 16px; }
.save-bar .sb-text { flex: 1; font-size: 14px; color: var(--muted); min-width: 200px; }
.danger-card { border-color: #f0c6c6; }
.danger-card h3 { color: var(--bad); }
.cf-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }

/* ---------- search overlay ---------- */
.search-overlay { position: fixed; inset: 0; background: rgba(10,14,16,.6); z-index: 120; display: flex; justify-content: center; align-items: flex-start; padding: 8vh 14px 14px; }
.search-panel { background: var(--card); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.35); width: 100%; max-width: 576px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.search-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search-head svg { width: 20px; height: 20px; color: var(--muted); flex: 0 0 20px; }
.search-head input { flex: 1; border: 0; background: transparent; font-size: 16px; padding: 6px 0; }
.search-head input:focus { box-shadow: none; }
.esc-btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 6px; font-size: 11px; font-weight: 700; padding: 4px 8px; cursor: pointer; }
.search-body { overflow-y: auto; padding: 12px 14px 16px; }
.search-group-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.search-group-label:first-child { margin-top: 0; }
.search-hit { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.search-hit:hover { background: var(--surface-2); }
.search-hit .sh-t { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.search-hit .sh-s { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.recent-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.recent-chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.quick-link { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.quick-link:hover { background: var(--surface-2); }
.search-tip { font-size: 12.5px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.search-none { font-size: 14px; color: var(--muted); padding: 10px 2px; line-height: 1.55; }

/* ---------- modal polish ---------- */
.modal h3 { font-size: 18px; font-weight: 700; }
