/* CRM Savage brand: black chrome, red accent, white cards on a neutral ground. Palette from the
   logo (brand/README.md). The red is for the logo, accents and links on white (6.7:1); it's only
   2.8:1 on black, so red-on-black is decoration, never text. */
:root {
  --chrome: #111111;          /* top bar, primary buttons, active tab */
  --chrome-2: #2a2a2a;
  --brand: #b3201f;           /* logo red */
  --brand-strong: #8f1918;    /* hover/pressed */
  --brand-tint: #fbeaea;
  --brand-tint-line: #efc4c3;
  --ground: #f4f4f5;
  --card: #ffffff;
  --line: #e2e2e5;
  --ink: #18181b;
  --muted: #5e5e66;
  --pill: #f0f0f2;
  --pill-hover: #e5e5e8;
  --accent: var(--brand);     /* links, focus, selected */
  --chart: #3f3f46;           /* bars and lines: neutral, so red keeps meaning "attention" */
  --danger: #a51c1c;
  --warn: #9a6400;
  --ok: #2d7a4f;
  --font: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Anton', 'Impact', 'Arial Narrow Bold', sans-serif;
  --r: 10px;
}

/* The homeowner intake page keeps the business's own, calmer look (see brand/README.md). */
body.org-theme {
  --chrome: #172a46; --chrome-2: #22385a; --brand: #2c5aa0; --brand-strong: #22487f;
  --brand-tint: #e8eef7; --brand-tint-line: #c4d6f0; --ground: #eef2f7; --line: #dde3ec;
  --ink: #1b2533; --muted: #5d6b7e; --pill: #edf1f6; --pill-hover: #e2e8f1; --chart: #2c5aa0;
  --display: 'Libre Baskerville', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--ground); line-height: 1.45; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--chrome); outline-offset: 2px; } /* black, not red: red reads as an error */
.topbar :focus-visible { outline-color: #fff; }
#view:focus, #view:focus-visible { outline: none; } /* focused for screen readers on screen change; not a control */

/* masthead */
.topbar { background: var(--chrome); color: #fff; box-shadow: inset 0 -3px 0 var(--brand); }
body.org-theme .topbar { box-shadow: none; }
.topbar-inner { max-width: none; margin: 0 auto; padding: 12px var(--side); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.logo { font-family: var(--display); font-size: 24px; letter-spacing: .5px; }
/* Wordmark: CRM in white, SAVAGE in red, condensed heavy caps like the logo. */
.wordmark { font-family: var(--display); font-size: 26px; line-height: 1; letter-spacing: .5px; text-transform: uppercase; display: inline-flex; gap: .22em; }
.wordmark .w1 { color: #fff; }
.wordmark .w2 { color: #e0362f; } /* lifted from the logo red: 4.2:1 on black, for 26px display type */
.brand-mark { height: 34px; width: auto; display: block; }
.divider { width: 1px; height: 26px; background: rgba(255,255,255,.35); }
.tagline { font-size: 14px; opacity: .92; }
.top-right { display: flex; align-items: center; gap: 14px; }
.top-link { color: #fff; opacity: .85; text-decoration: none; font-size: 13px; }
.top-link:hover { opacity: 1; text-decoration: underline; }
/* Programmers: View as Administrator | Coordinator, on the black top bar; red marks the current view. */
.view-as { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.view-as-label { opacity: .85; white-space: nowrap; }
.view-as .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.view-as .btn:hover { background: rgba(255,255,255,.12); }
.view-as .btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); position: relative; cursor: default; }
.viewas-strip { background: var(--brand); color: #fff; padding: 7px var(--side); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.viewas-strip .link-btn { color: #fff; text-decoration: underline; font-weight: 600; }
.viewas-strip :focus-visible { outline-color: #fff; }
.role-pick .programmer-opt { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; margin: 8px 0 0; color: var(--ink); }
.role-pick .programmer-opt input { width: auto; margin: 3px 0 0; }
.role-pick .programmer-opt .meta { display: block; }
.user-switch { background: var(--chrome-2); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; padding: 5px 8px; }

/* The page uses the window's width, with a side margin that grows with it but never goes over 2 inches. */
:root { --side: clamp(16px, calc(4vw - 24px), 2in); }
.wrap { max-width: none; margin: 0 auto; padding: 18px var(--side) 48px; }

/* tab bar */
/* Main navigation: one compact sticky row under the masthead. Tabs keep their natural width and the
   row scrolls sideways (scrollbar hidden) on narrow screens instead of wrapping. */
:root { --nav-h: 52px; }
.navbar { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.tabs { display: flex; align-items: center; gap: 4px; height: var(--nav-h); max-height: 56px; padding: 0 var(--side); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs a:hover { background: var(--pill); color: var(--ink); }
.tabs a.active { background: var(--chrome); color: #fff; box-shadow: inset 0 -3px 0 var(--brand); }
@media (max-width: 640px) { .tagline { display: none; } }

/* page heading */
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
h1 { font-size: 26px; margin: 0; font-weight: 700; letter-spacing: -.2px; text-wrap: balance; }
.sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
h3 { font-size: 14px; margin: 0; font-weight: 600; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; text-decoration: none; color: inherit; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .num { font-size: 26px; font-weight: 600; margin-top: 2px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .num.danger { color: var(--danger); }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* cards + grids */
.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.stack > * + * { margin-top: 14px; }
.empty { color: var(--muted); padding: 14px 0; }

/* work queue */
.queue details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.queue details:last-child { border-bottom: 0; }
.queue summary { cursor: pointer; list-style: none; display: flex; gap: 8px; }
.queue summary::-webkit-details-marker { display: none; }
.queue summary::before { content: '▶'; font-size: 10px; margin-top: 4px; color: var(--ink); transition: transform .15s; }
.queue details[open] summary::before { transform: rotate(90deg); }
.queue .title { font-weight: 600; }
.meta { color: var(--muted); font-size: 12.5px; }
.queue .body { padding: 8px 0 0 18px; }
.due { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.due.overdue { color: var(--danger); }
.due.today { color: var(--warn); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* deadlines list */
.dl { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dl:last-child { border-bottom: 0; }
.datebox { width: 46px; flex: none; text-align: center; background: var(--pill); border-radius: 6px; padding: 5px 0; }
.datebox .m { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.datebox .d { font-size: 18px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dl .title { font-weight: 600; }
.dl a { color: inherit; text-decoration: none; }

/* buttons + forms */
.btn { display: inline-flex; vertical-align: middle; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 7px 12px; border-radius: 7px; cursor: pointer; font-weight: 500; font-size: 13px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--pill); }
.btn.primary { background: var(--chrome); border-color: var(--chrome); color: #fff; }
.btn.primary:hover { background: var(--brand); border-color: var(--brand); }
.btn.ai { border-color: #c9b8e8; color: #4b2f86; background: #f6f2fd; }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: wait; }
.icon-btn { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form .full { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
input, select, textarea { border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%; }
textarea { min-height: 84px; resize: vertical; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar input { width: auto; }
.toolbar input[type=search] { width: 240px; max-width: 100%; }

/* chips */
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--pill); color: var(--muted); white-space: nowrap; }
.chip.ok { background: #e3f2e9; color: var(--ok); }
.chip.warn { background: #fbf0dc; color: var(--warn); }
.chip.danger { background: #f8e3e1; color: var(--danger); }
.chip.info { background: #e9e9ec; color: #27272a; } /* stages are neutral; red is kept for attention */

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f6f8fb; }
.num-col { font-variant-numeric: tabular-nums; }
.rrg { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; color: var(--muted); }

/* pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.lane { background: #e5ebf3; border-radius: var(--r); padding: 8px; min-height: 120px; }
.lane h3 { font-size: 12.5px; display: flex; justify-content: space-between; padding: 4px 4px 8px; color: var(--chrome); }
.lane .item { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.lane .item:hover { border-color: #b8c5d8; }

/* file header strip */
/* File header strip: two dense lines (who and what, then what's next). */
.file-head { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r); padding: 6px 12px; margin-bottom: 8px; display: grid; gap: 2px; font-size: 13px; }
.fh-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; min-height: 28px; }
.fh-fact { white-space: nowrap; }
.fh-fact .k { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.fh-fact .v { font-weight: 600; }
.fh-fact .v .meta { font-weight: 500; }
.fh-note { flex: 1 1 200px; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fh-line #openHighlights { margin-left: auto; }
@media (max-width: 520px) { .fh-fact { white-space: normal; } .fh-note { flex-basis: 100%; } .fh-line #openHighlights { margin-left: 0; } }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.subtabs button { border: 0; background: none; padding: 10px 12px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.subtabs button.active { color: var(--chrome); border-bottom-color: var(--chrome); }
/* File page tabs: one slim row of underlined text tabs under the main nav. The current tab gets a red
   underline and bold ink; the row scrolls sideways on narrow screens (the page itself never does). */
.file-page-head { margin-bottom: 8px; }
.ftabs { position: sticky; top: calc(var(--nav-h) + 1px); z-index: 20; display: flex; gap: 2px; margin: 0 calc(-1 * var(--side)) 14px; padding: 0 var(--side); background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ftabs::-webkit-scrollbar { display: none; }
.ftabs [role="tab"] { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 9px 10px 6px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 500; font-size: 13.5px; text-decoration: none; white-space: nowrap; }
.ftabs [role="tab"]:hover { color: var(--ink); border-bottom-color: var(--line); }
.ftabs [role="tab"][aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--brand); }
.ftabs [role="tab"]:focus-visible { outline-offset: -2px; }
.ftabs .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--pill); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.ftabs [aria-selected="true"] .count { background: var(--pill-hover); color: var(--ink); }
.fpanel { min-width: 0; }
.fpanel:focus { outline: none; }
.fpanel-enter { animation: fpanel-in .18s ease-out; }
@keyframes fpanel-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fpanel-enter { animation: none; } }
.fpanel .act-scroll { max-height: none; } /* Actions & Dates flows with the page instead of scrolling in its own box */
.fpanel > div > .card + .card, .fpanel > div > .card + .grid-2, .fpanel > div > .grid-2 + .card { margin-top: 14px; }
.fpanel-tools { display: flex; justify-content: flex-end; margin: -6px 0 8px; }
.fpanel-tools:empty, .fpanel-tools:not(:has(:not([hidden]))) { display: none; }
.fpanel-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.ro-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ro-field .ro-k { color: var(--muted); font-weight: 500; }
.ro-field > span:last-child { font-size: 14px; padding: 8px 0; }
.ro-field a { margin-left: 8px; font-size: 12.5px; }

/* Pricing tab: current list price, then earlier prices as bordered cards, newest first. */
.pricing { max-width: 760px; }
.pr-current { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pr-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pr-now { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0; }
.pr-amt { font-size: 24px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.pr-amt.big { font-size: 34px; line-height: 1.15; }
.pr-now .chip.ok { font-size: 13px; padding: 3px 12px; }
.pr-rule { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.pr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.pr-head h2 { margin: 0; font-size: 20px; }
.pr-list { display: grid; gap: 12px; }
.pr-card { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.pr-card summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--pill); font-weight: 700; cursor: pointer; list-style: none; }
.pr-card summary::-webkit-details-marker { display: none; }
.pr-card summary:focus-visible { outline-offset: -2px; }
.pr-chev { width: 9px; height: 9px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.pr-card[open] .pr-chev { transform: rotate(45deg); }
.pr-body { padding: 10px 16px 12px; }
.pr-range { font-weight: 600; color: var(--muted); }
.pr-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.pr-sale { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pr-val { margin-top: 14px; }
.pr-val .pr-now { margin-bottom: 10px; }
.pr-val .table-wrap { position: relative; } /* keeps the hidden "Actions" header inside the scroll box */
.va-table td.va-act { white-space: nowrap; text-align: right; }
@media (prefers-reduced-motion: reduce) { .pr-chev { transition: none; } }
@media (max-width: 520px) { .pr-amt.big { font-size: 28px; } .pr-current, .pr-head { flex-wrap: wrap; } }

/* Dropdown menus (menuHtml in app.js) */
.menu-wrap { display: inline-flex; }
.menu-pop { position: fixed; z-index: 40; min-width: 200px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.12); display: grid; gap: 1px; }
.menu-pop [role="menuitem"] { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; text-align: left; font-size: 13.5px; color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.menu-pop [role="menuitem"]:hover, .menu-pop [role="menuitem"]:focus { background: var(--pill); outline: none; }
.menu-pop [role="menuitem"]:focus-visible { outline: 2px solid var(--chrome); outline-offset: -2px; }
.menu-head { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.menu-head:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.btn.icon { padding-left: 8px; padding-right: 8px; letter-spacing: 1px; }

.summary-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; }
.summary-grid dt { color: var(--muted); font-size: 13px; }
.summary-grid dd { margin: 0; }
.note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .text { margin-top: 4px; white-space: pre-wrap; }
.post { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.post textarea { min-height: 64px; }
.post-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.post-row select { width: auto; }
.post-row .meta { margin-right: auto; }
.filter-row { padding: 10px 0 2px; }
.note.tc { border-left: 3px solid var(--chart); padding-left: 10px; }
.counts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.counts .num { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.counts .num.danger { color: var(--danger); }
.doc-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drive-line { padding-top: 10px; }
.drive-form { margin-top: 10px; }
.drive-form input { flex: 1; min-width: 200px; }
td.latest { max-width: 340px; }
@media (max-width: 520px) { .counts { grid-template-columns: repeat(3, 1fr); } }
.banner-warn { background: #fbf0dc; border-color: #ecd3a3; color: var(--warn); margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; color: var(--muted); }
.check input { width: auto; }
.ai-out { background: #f8f6fd; border: 1px solid #e3daf4; border-radius: 8px; padding: 12px; white-space: pre-wrap; margin-top: 10px; }

.int-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.int-row:last-child { border-bottom: 0; }
.int-row p { margin: 4px 0 0; color: var(--muted); max-width: 60ch; }
code { background: var(--pill); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* ---------- UI components (public/ui.js) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html.ui-scroll-lock, html.ui-scroll-lock body { overflow: hidden; }

/* dialog: centred card on desktop, full-screen sheet on phones */
.modal { position: fixed; inset: 0; background: rgba(15, 25, 40, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; overscroll-behavior: contain; }
.modal-card { background: var(--card); border-radius: 12px; width: min(620px, 100%); padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-card:focus { outline: none; }
.modal-card:focus-visible { outline: 2px solid var(--chrome); outline-offset: 2px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { min-width: 0; overflow-wrap: anywhere; }
.icon-btn { min-width: 44px; min-height: 44px; margin: -10px -10px -10px 0; border-radius: 8px; }
.icon-btn:hover { background: var(--pill); color: var(--ink); }
.modal-small .modal-card { width: min(440px, 100%); }
.modal-small { align-items: center; }
.ui-dialog-msg { margin-bottom: 4px; overflow-wrap: anywhere; }
.ui-field-error { color: var(--danger); font-size: 12.5px; }
@media (max-width: 560px) {
  .modal { padding: 0; align-items: stretch; }
  .modal-card, .modal-card.wide { width: 100%; min-height: 100dvh; border-radius: 0; box-shadow: none; padding: 0 16px max(16px, env(safe-area-inset-bottom)); }
  .modal-head { position: sticky; top: 0; z-index: 1; background: var(--card); padding: 12px 0; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
  .form-actions .btn { flex: 1; justify-content: center; min-height: 44px; }
  /* short questions (confirm, prompt) stay a card: a full-screen sheet would hide where you were */
  .modal.modal-small { padding: 16px; align-items: center; }
  .modal-small .modal-card { min-height: 0; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.25); padding: 0 16px 16px; }
}

/* buttons: danger, busy (spinner), aria-disabled */
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #8e2922; }
.btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; opacity: .8; }
.btn[aria-busy="true"]::before { content: ''; width: 12px; height: 12px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ui-spin .7s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* toasts: bottom centre, above the phone's home bar */
.ui-toasts { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; width: min(480px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.ui-toast-stack { display: flex; flex-direction: column; gap: 8px; }
.ui-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--chrome); color: #fff; padding: 8px 6px 8px 12px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: ui-in .18s ease-out; }
.ui-toast.success { background: #1f5c3b; }
.ui-toast.error { background: var(--danger); }
.ui-toast-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.ui-toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ui-toast-action { background: none; border: 1px solid rgba(255,255,255,.5); color: #fff; border-radius: 6px; padding: 4px 10px; font-weight: 600; cursor: pointer; }
.ui-toast-close { flex: none; background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; min-width: 36px; min-height: 36px; border-radius: 6px; cursor: pointer; opacity: .85; }
.ui-toast-close:hover, .ui-toast-close:focus-visible { opacity: 1; background: rgba(255,255,255,.15); }
.ui-toast :focus-visible { outline-color: #fff; }
@keyframes ui-in { from { opacity: 0; transform: translateY(6px); } }

/* loading / empty / error blocks */
.ui-state { padding: 18px 16px; color: var(--muted); }
.ui-state.compact { padding: 10px 0; }
.ui-state:not(.compact) { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.ui-state-title { font-weight: 600; color: var(--ink); }
.ui-state.error .ui-state-title { color: var(--danger); }
.ui-state-msg { margin-top: 2px; overflow-wrap: anywhere; }
.ui-state .btn { margin-top: 10px; margin-right: 6px; }
.ui-state.loading > div { display: grid; gap: 10px; animation: ui-show 0s .15s both; }
.ui-skel { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--pill) 25%, #f7f9fc 50%, var(--pill) 75%); background-size: 200% 100%; animation: ui-shimmer 1.2s linear infinite; }
@keyframes ui-shimmer { to { background-position: -200% 0; } }
@keyframes ui-show { from { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .ui-toast, .ui-skel { animation: none; }
  .btn[aria-busy="true"]::before { animation-duration: 2.5s; }
}
@media (forced-colors: active) {
  .ui-toast, .ui-state, .modal-card { border: 1px solid CanvasText; }
  .btn[aria-busy="true"]::before { border-color: ButtonText; border-right-color: transparent; }
}

/* admin metrics */
.stats.money .num { font-size: 24px; }
.stat .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.num.pos { color: var(--ok); }
.period { display: flex; gap: 4px; background: var(--pill); border-radius: 8px; padding: 3px; }
.period button { border: 0; background: none; padding: 6px 10px; border-radius: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.period button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(23,42,70,.12); }
.bar { height: 8px; background: var(--pill); border-radius: 4px; min-width: 60px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--chart); border-radius: 4px; }
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 170px; padding-top: 14px; }
.months .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.months .colbar { width: 60%; max-width: 44px; background: var(--chart); border-radius: 4px 4px 0 0; min-height: 2px; }
.months .lbl { font-size: 12px; color: var(--muted); }
.months .val { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.outcomes { display: flex; gap: 0; height: 12px; border-radius: 6px; overflow: hidden; background: var(--pill); margin: 12px 0 8px; }
.outcomes span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.money-box { margin-top: 14px; }

/* ---------- Marketing hub ---------- */
.net { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 4px; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .02em; vertical-align: middle; }
.subtabs .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.subtabs .count.warn { background: var(--warn); }
.subtabs.small button { padding: 7px 10px; font-size: 13px; }
.banner-info { background: #f0f0f2; border-color: var(--line); color: var(--ink); margin-bottom: 14px; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-bar select { width: auto; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.mhead { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--pill); }
.mhead.today { color: var(--accent); }
.mcell { min-height: 112px; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mcell.other { background: #f7f9fc; }
.mcell.other .mday span { color: #a3adbb; }
.mcell.today .mday span { background: var(--chrome); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.mday { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; }
.mday .add { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; opacity: 0; padding: 0 4px; }
.mcell:hover .add, .mday .add:focus { opacity: 1; }
.mcell.over, .wcell.over { background: var(--brand-tint); outline: 2px dashed var(--accent); outline-offset: -2px; }
.pchip { background: #fff; border: 1px solid var(--line); border-left: 3px solid #9aa6b5; border-radius: 6px; padding: 3px 5px; cursor: pointer; font-size: 12px; min-width: 0; }
.pchip[draggable="true"] { cursor: grab; }
.pchip:hover { box-shadow: 0 1px 4px rgba(23,42,70,.15); }
.pchip-top { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.pchip-top .t { font-weight: 600; margin-right: 2px; }
.pchip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pchip.s-scheduled, .pchip.s-approved { border-left-color: var(--accent); }
.pchip.s-published { border-left-color: var(--ok); }
.pchip.s-pending-review, .pchip.s-publishing, .pchip.s-partially-published { border-left-color: var(--warn); }
.pchip.s-failed { border-left-color: var(--danger); background: #fdf3f2; }
.pchip.s-draft { border-style: dashed; border-left-style: solid; }
.wgrid { display: grid; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.whour { font-size: 11px; color: var(--muted); padding: 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: right; }
.wcell { min-height: 44px; padding: 3px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(45, 122, 79, calc(var(--heat, 0) * 0.16)); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.compose-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger-text { color: var(--danger); }
.compose .sticky { position: sticky; top: 12px; }
.title-in { width: auto; flex: 1; max-width: 340px; }
.acct-pick { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.acct { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 6px; cursor: pointer; font-size: 13px; }
.acct input { width: auto; margin: 0; }
.acct.on { border-color: var(--accent); background: var(--brand-tint); }
.acct.off { opacity: .6; }
.compose textarea { width: 100%; font: inherit; }
.counts-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cc { font-size: 12px; background: var(--pill); border-radius: 6px; padding: 2px 6px; font-variant-numeric: tabular-nums; }
.cc.over { background: #f8e3e1; color: var(--danger); font-weight: 600; }
.lbl { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.lbl input, .lbl select { margin-top: 4px; }
.ai-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.ai-box summary { cursor: pointer; font-weight: 600; }
.media-row { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.mthumb { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; background: var(--pill); border: 2px solid transparent; padding: 0; }
.mthumb img, .mthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb .dim, .mthumb .dur { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 1px 4px; border-radius: 3px; }
.mthumb .dur { left: auto; right: 4px; }
.mthumb .x { position: absolute; top: 3px; right: 3px; border: 0; background: rgba(0,0,0,.6); color: #fff; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; }
.mthumb.pick { cursor: pointer; }
.mthumb.pick.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--brand-tint-line); }
.thumb-sm { height: 40px; vertical-align: middle; border-radius: 4px; }
.upl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.crop-ui { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 12px; }
.crop-cv { max-width: 100%; max-height: 340px; display: block; margin: 8px auto; background: #111; }
code.wrap { word-break: break-all; }
.pv { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.pv-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pv-av { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.pv-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; margin: 6px 0; }
.pv-title { font-weight: 700; margin-top: 6px; }
.pv .lnk { color: var(--accent); }
.pv-media { width: 100%; max-height: 360px; object-fit: cover; border-radius: 6px; display: block; margin: 6px 0; background: #111; }
.pv-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.pv-instagram .pv-media, .pv-tiktok .pv-media { border-radius: 0; margin: 0 -12px 6px; width: calc(100% + 24px); max-width: none; }
.checks { list-style: none; padding: 0; margin: 8px 0 0; }
.checks li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.checks li.error { color: var(--danger); }
.checks li.warn { color: var(--warn); }
.deliv { padding: 8px 0; border-bottom: 1px solid var(--line); }
.err { color: var(--danger); }
.inbox { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; min-height: 420px; }
.ilist { border-right: 1px solid var(--line); overflow-y: auto; max-height: 640px; }
.iitem { display: flex; gap: 8px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 10px; cursor: pointer; font: inherit; }
.iitem.on { background: var(--brand-tint); }
.iwho { min-width: 0; flex: 1; }
.itext { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ithread { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.thead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bubble { max-width: 80%; padding: 10px 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.bubble.in { background: var(--pill); align-self: flex-start; }
.bubble.out { background: var(--brand-tint); align-self: flex-end; }
.bubble.failed { background: #f8e3e1; }
.reply { display: flex; gap: 8px; align-items: flex-end; }
.reply textarea { flex: 1; font: inherit; }
.crm-bridge { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.crm-bridge h3 { margin: 0; width: 100%; font-size: 14px; }
.crm-bridge p { margin: 0; }
.chart { width: 100%; height: auto; }
.cbar { fill: var(--brand-tint-line); }
.cline { fill: none; stroke: var(--chart); stroke-width: 2; }
.clbl { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.key { display: inline-block; width: 12px; height: 8px; margin: 0 4px 0 10px; vertical-align: middle; }
.key.bar { background: var(--brand-tint-line); }
.key.line { background: var(--chart); height: 2px; }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--danger); font-weight: 600; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; margin-top: 8px; }
.heat .hh { font-size: 9px; color: var(--muted); text-align: left; }
.heat .hd { font-size: 11px; color: var(--muted); line-height: 16px; }
.heat .hc { height: 16px; border-radius: 2px; background: rgba(23, 42, 70, calc(0.06 + var(--heat) * 0.9)); }
.flow { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.flow-main { min-width: 0; flex: 1; }
.flow-reply { margin-top: 4px; font-size: 13px; }
.chk { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.chk legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.chk label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.chk input { width: auto; }
fieldset.full { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.slot { margin-bottom: 6px; }
.slot select, .slot input { width: auto; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 6px; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; }
  .ilist { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .compose .sticky { position: static; }
  .mcell { min-height: 80px; }
  .pchip-text { display: none; }
}
.flow .row-actions { align-items: flex-start; align-self: flex-start; }

/* ---------- Homeowner intake (public page + staff modal) ---------- */
.modal-card.wide { width: min(860px, 100%); }
.intake-wrap { max-width: 820px; }
.intake-head { margin: 6px 0 16px; }
.intake-head h1 { font-family: var(--display); font-size: 26px; }
.intake-head p { margin: 8px 0 0; max-width: 64ch; }
.intake-head .i-headline { font-size: 22px; font-style: italic; font-weight: 500; line-height: 1.3; color: var(--danger, #c62828); max-width: 36ch; }
.intake-head .i-linknote { padding: 10px 12px; border: 1px solid var(--brand-tint-line); background: var(--brand-tint); border-radius: var(--r); }
.lead-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.lead-link input { flex: 1; min-width: 220px; }
.intake-done { text-align: left; padding: 28px; }
.intake-done h1 { font-family: var(--display); margin-bottom: 10px; }
.i-section { padding: 6px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.i-section:last-of-type { border-bottom: 0; }
.i-section h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 4px 0 12px; }
.i-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--chrome); color: #fff; font-size: 13px; }
.i-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px 12px; }
.i-full { grid-column: 1 / -1; } .i-half { grid-column: span 3; } .i-third { grid-column: span 2; }
.i-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; border: 0; padding: 0; margin: 0; }
.i-field > label, .i-field > legend { font-weight: 600; font-size: 13.5px; color: var(--ink); padding: 0; }
.i-field > legend { margin-bottom: 5px; }
.i-req { color: var(--danger); }
.i-hint { color: var(--muted); font-size: 12.5px; margin: 0 0 2px; }
.i-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.i-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.i-opt { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; cursor: pointer; background: #fff; font-size: 13.5px; }
.i-opt input { width: auto; margin: 0; accent-color: var(--chrome); }
.i-opt:has(input:checked) { border-color: var(--chrome); background: var(--brand-tint); }
.i-other { margin-top: 6px; }
.i-money { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.i-money span { padding: 0 2px 0 10px; color: var(--muted); }
.i-money input { border: 0; padding-left: 4px; }
.i-missing > label, .i-missing > legend { color: var(--danger); }
.i-missing input, .i-missing select, .i-missing textarea, .i-missing .i-opt { border-color: var(--danger); }
.i-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.i-consent input { width: auto; margin-top: 3px; }
.i-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.i-error { background: #f8e3e1; color: var(--danger); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.i-actions { display: flex; gap: 8px; justify-content: flex-end; }
.i-actions .btn { padding: 10px 18px; font-size: 14px; }
@media (max-width: 640px) { .i-half, .i-third { grid-column: 1 / -1; } .i-opt { flex: 1 1 100%; } .i-actions .btn.primary { flex: 1; justify-content: center; } }

.lead-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pick-form { display: grid; gap: 10px; }
.pick-form .btn { flex-direction: column; align-items: flex-start; white-space: normal; text-align: left; padding: 12px 14px; gap: 2px; }
.i-view .i-vh { font-size: 14px; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.i-dl { display: grid; grid-template-columns: minmax(180px, 2fr) 3fr; gap: 6px 16px; margin: 0; }
.i-dl dt { color: var(--muted); font-size: 13px; }
.i-dl dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) { .i-dl { grid-template-columns: 1fr; } .i-dl dd { margin-bottom: 6px; } }
.i-equity { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: var(--pill); border-radius: 8px; padding: 12px; margin: 8px 0; }
.i-equity .k { color: var(--muted); font-size: 12px; } .i-equity .v { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.i-equity .v.neg { color: var(--danger); }
@media (max-width: 560px) { .i-equity { grid-template-columns: 1fr 1fr; } }
.print-intake { background: #fff; padding: 24px; max-width: 800px; margin: 0 auto; }

/* signed-in person + sign out in the masthead; team list in Settings */
.whoami { color: #fff; opacity: .92; font-size: 13px; }
.link-btn { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* signed-in person + sign out in the masthead; team list in Settings */
.whoami { color: #fff; opacity: .92; font-size: 13px; }
.link-btn { background: none; border: 0; cursor: pointer; padding: 0; font: inherit; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* sign-in page */
.login-logo { display: block; width: 220px; height: auto; margin: 6vh auto 18px; border-radius: 14px; background: #101010; }

/* Settings → Claude */
.claude-form { margin-top: 12px; grid-template-columns: 1fr; }
.claude-form .meta { margin: -4px 0 0; }
/* Settings → AI */
.ai-providers { display: grid; gap: 8px; margin-top: 10px; }
.ai-provider { border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; }
.ai-provider[open] { padding-bottom: 12px; }
.ai-provider summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; font-weight: 600; }
.ai-provider summary::-webkit-details-marker { display: none; }
.ai-provider summary::before { content: '▸'; color: var(--muted); margin-right: 2px; }
.ai-provider[open] summary::before { content: '▾'; }
.ai-name { flex: 1; }
.ai-notice { background: var(--pill); border-radius: 6px; padding: 8px 10px; margin: 0 !important; }
/* Contact import */
.file-pick { display: inline-block; margin: 6px 0 10px; cursor: pointer; }
.file-pick:focus-within .btn { outline: 2px solid var(--chrome); outline-offset: 2px; }
.imp-counts { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.imp-map { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 4px; margin: 0 0 14px; }
.imp-map legend { font-weight: 600; padding: 0 4px; }
.imp-map .form { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 8px; }
.imp-problems { margin: 12px 0; }
.imp-problems summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.imp-problems .btn { margin-top: 8px; }
/* Add account: role and access */
.role-pick { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.role-pick legend { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 6px; padding: 0; }
.role-opt { display: flex !important; flex-direction: row !important; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; color: var(--ink) !important; }
.role-opt input { width: auto; margin-top: 3px; accent-color: var(--chrome); }
.role-opt > span { display: flex; flex-direction: column; gap: 2px; }
.role-opt:has(input:checked) { border-color: var(--chrome); box-shadow: inset 0 0 0 1px var(--chrome); }
.role-opt.admin:has(input:checked) { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.role-warn { color: var(--warn) !important; font-weight: 600; margin: 2px 0 0; }
/* Settings → Google, Backups → Drive copies */
.g-steps { margin: 6px 0 10px; }
.g-steps summary { cursor: pointer; font-weight: 600; }
.g-steps ol { padding-left: 20px; margin: 8px 0; display: grid; gap: 6px; }
.g-uri { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.g-uri code { user-select: all; }
.drive-backup { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.drive-backup h4 { margin: 0 0 4px; font-size: 14px; }
.drive-backup .toolbar input { flex: 1; min-width: 220px; }
/* Administrator alerts */
.tab-badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 12px; line-height: 20px; text-align: center; vertical-align: 1px; }
.tabs a.active .tab-badge { background: #fff; color: var(--brand); }
.alert-card { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand); margin-bottom: 14px; }
/* File Overview bar and pop-up */
.hl-status .k { color: var(--muted); font-size: 12px; margin-right: 4px; }
.hl-warn { color: var(--danger); font-weight: 600; }
.hl-modal { font-size: 15px; line-height: 1.5; }
.hl-head { margin-bottom: 12px; }
.hl-addr { font-size: 20px; font-weight: 700; }
.hl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hl-sec { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.hl-sec:first-child { grid-row: span 2; }
.hl-sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.hl-sec h4 { font-size: 13px; margin: 12px 0 4px; }
.hl-status { background: var(--pill); border-radius: 6px; padding: 8px 10px; display: grid; gap: 2px; }
.hl-upd { border-left: 3px solid var(--line); padding: 2px 0 2px 8px; margin: 6px 0; overflow-wrap: anywhere; }
.hl-qn textarea { width: 100%; font-size: 14px; }
.hl-qn .form-actions { justify-content: space-between; }
.hl-person { padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.hl-person:last-child { border-bottom: 0; }
.hl-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.hl-row:last-child { border-bottom: 0; }
.hl-row.past { opacity: .6; }
.hl-amt { font-weight: 600; white-space: nowrap; }
@media (max-width: 760px) { .hl-grid { grid-template-columns: 1fr; } .hl-sec:first-child { grid-row: auto; } }
/* Lead checklist and notes */
.lead-check { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 2px; }
.lead-qn { font-size: 12.5px; color: var(--ink); background: var(--pill); border-radius: 6px; padding: 3px 6px; margin-top: 4px; max-width: 280px; overflow-wrap: anywhere; }
.hl-liens { margin: 0; padding-left: 18px; }
.hl-liens li { margin: 2px 0; }
/* File report */
.report-card { margin-bottom: 14px; }
.report-summary { font-size: 15px; line-height: 1.55; margin: 6px 0 10px; }
.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 18px; }
.report-cols h3 { font-size: 13px; margin: 6px 0 4px; }
.report-cols ul, .report-cols ol { margin: 0; padding-left: 18px; }
.report-cols li { margin: 3px 0; }
/* Leads list: readable menus, actions wrap */
select[data-assign], select[data-status] { min-width: 120px; }
.lead-actions { margin: 0; display: flex; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; align-items: center; }
/* Email */
.email-item { border-bottom: 1px solid var(--line); padding: 8px 0; }
.email-item summary { display: flex; gap: 10px; cursor: pointer; list-style: none; }
.email-item summary::-webkit-details-marker { display: none; }
.email-dir { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--pill); font-size: 13px; }
.email-item.out .email-dir { background: #e9e9ec; }
.email-item.in .email-dir { background: var(--brand-tint); color: var(--brand); }
.email-main { display: flex; flex-direction: column; min-width: 0; }
.email-snip { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.email-item[open] .email-snip { display: none; }
.email-body { margin: 8px 0 6px 32px; padding: 10px 12px; background: #fafafa; border: 1px solid var(--line); border-radius: 6px; font-size: 13.5px; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.email-item .row-actions, .email-item .em-file { margin: 6px 0 0 32px; flex-wrap: wrap; }
.em-people { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.em-people legend { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 4px; padding: 0; }
/* email actions always visible */
.email-item > details > summary { display: flex; gap: 10px; cursor: pointer; list-style: none; }
.email-item > details > summary::-webkit-details-marker { display: none; }
.email-item details[open] .email-snip { display: none; }
/* Leads filters; email recipients */
.list-filters { margin: -4px 0 12px; }
.list-filters input[type="search"] { flex: 1; min-width: 220px; max-width: 420px; }
.em-people label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; font-size: 13.5px; }
.em-people label.check input { width: auto; margin: 0; }

/* ---------- Public booking page (/book/...) ---------- */
.book-wrap { max-width: 920px; }
.book-head { margin: 8px 0 14px; }
.book-head h1 { font-family: var(--display); font-size: 26px; margin: 6px 0 4px; }
.book-head p { margin: 8px 0 0; max-width: 65ch; }
.book-msg { text-align: center; padding: 32px 16px; }
.book-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.book-type { display: block; color: inherit; text-decoration: none; border-top: 4px solid var(--tc, var(--brand)); }
.book-type:hover { box-shadow: 0 2px 10px rgba(23,42,70,.12); }
.book-type h2 { font-size: 17px; margin: 0 0 4px; }
.book-type p { margin: 8px 0; color: var(--muted); }
.book-go { color: var(--brand); font-weight: 600; font-size: 13px; }
.book-pick { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(220px, 1fr); gap: 24px; }
.book-month { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.bdow { font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.bday { border: 0; background: none; border-radius: 50%; aspect-ratio: 1; min-height: 38px; font-weight: 500; color: #a3adbb; cursor: default; }
.bday.open { background: var(--brand-tint); color: var(--brand-strong); font-weight: 700; cursor: pointer; }
.bday.open:hover { background: var(--brand-tint-line); }
.bday.sel { background: var(--brand); color: #fff; }
.book-tz { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.book-times h2 { font-size: 15px; margin: 4px 0 10px; }
.tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; }
.tslot { justify-content: center; border-color: var(--brand); color: var(--brand-strong); font-weight: 600; min-height: 40px; }
.tslot:hover { background: var(--brand); color: #fff; }
.book-chosen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.book-done { text-align: center; max-width: 560px; margin: 0 auto; }
.book-done .book-sum { text-align: left; }
.book-check { width: 52px; height: 52px; border-radius: 50%; background: #e3f2e9; color: var(--ok); font-size: 28px; display: inline-flex; align-items: center; justify-content: center; }
.book-sum { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 16px 0; }
.book-sum dt { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.book-sum dd { margin: 0; }
.book-actions { justify-content: center; margin: 14px 0; }
.book-note { background: #e3f2e9; color: var(--ok); padding: 8px 12px; border-radius: 7px; }
@media (max-width: 640px) { .book-pick { grid-template-columns: 1fr; } .book-head h1 { font-size: 22px; } }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.book-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin: 24px 0 8px; }

/* ---------- Calendar & Scheduling (CRM) ---------- */
.seg { display: inline-flex; gap: 0; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 7px 0 0 7px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 7px 7px 0; }
.sc-label { font-size: 15px; margin-left: 6px; }
.sc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.sc-cal { padding: 0; overflow: hidden; }
.sc-cal .mgrid { border-top: 0; border-left: 0; }
.sc-side { max-height: 760px; overflow-y: auto; }
.sc-chip, .sc-up { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--tc, #6e7781); background: #fff; border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 12px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.sc-chip:hover, .sc-up:hover { box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.sc-chip.canceled, .sc-ev.canceled { opacity: .55; text-decoration: line-through; }
.sc-more { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-align: left; padding: 0 4px; }
.sc-up { white-space: normal; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.sc-up-when { font-size: 12px; font-weight: 600; color: var(--muted); }
.sc-up .chip { align-self: flex-start; margin-top: 3px; }
.sc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--tc); margin-right: 6px; }
/* time grid (day / week) */
.sc-tg { --days: 7; overflow-x: auto; }
.sc-tg-head, .sc-tg-body { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(110px, 1fr)); }
.sc-tg-head { border-bottom: 1px solid var(--line); background: var(--pill); position: sticky; top: 0; z-index: 2; }
.sc-tg-head > div { padding: 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); }
.sc-tg-head > div.today { color: var(--brand); }
.sc-tg-head b { font-size: 15px; color: var(--ink); margin-left: 2px; }
.sc-tg-head > div.today b { color: var(--brand); }
.sc-tg-body { max-height: 720px; overflow-y: auto; }
.sc-hours > div { font-size: 11px; color: var(--muted); text-align: right; padding: 0 6px; border-top: 1px solid var(--line); box-sizing: border-box; }
.sc-col { position: relative; border-left: 1px solid var(--line); }
.sc-slot { position: absolute; left: 0; right: 0; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; padding: 0; }
.sc-slot:hover { background: var(--pill); }
.sc-ev { position: absolute; z-index: 1; border: 0; border-left: 3px solid var(--tc); background: color-mix(in srgb, var(--tc) 14%, #fff); border-radius: 5px; padding: 3px 5px; font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); line-height: 1.25; }
.sc-ev strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-ev span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-ev.pending { background: repeating-linear-gradient(45deg, #fff, #fff 6px, #fbf0dc 6px, #fbf0dc 12px); }
.sc-ev:hover { box-shadow: 0 2px 8px rgba(0,0,0,.18); z-index: 3; }
.sc-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--brand); z-index: 2; pointer-events: none; }
.sc-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
/* detail */
.sc-detail h4 { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sc-detail-head { border-left: 4px solid var(--tc); padding-left: 12px; }
.sc-detail-head h3 { margin: 6px 0 2px; font-size: 18px; }
.sc-actions { margin: 12px 0; }
.sc-actions select { width: auto; }
.sc-log { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.sc-log li { padding: 4px 0 8px 12px; position: relative; }
.sc-log li::before { content: ''; position: absolute; left: -5px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--chart); }
.sc-jobs, .sc-plain { list-style: none; padding: 0; margin: 0; }
.sc-jobs li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sc-open { margin-top: 4px; max-height: 160px; }
.tslot.sel { background: var(--chrome); color: #fff; border-color: var(--chrome); }
/* types and links */
.sc-page { margin-bottom: 14px; }
.sc-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.sc-type { border-top: 4px solid var(--tc); display: flex; flex-direction: column; gap: 8px; }
.sc-type.inactive { opacity: .7; }
.sc-type-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.sc-type h3 { margin: 0; font-size: 16px; }
.sc-type p { margin: 0; color: var(--muted); }
.sc-url code { font-size: 12px; background: var(--pill); padding: 3px 6px; border-radius: 5px; word-break: break-all; }
.sc-share { position: relative; display: inline-block; }
.sc-share summary { list-style: none; }
.sc-share summary::-webkit-details-marker { display: none; }
.sc-share-menu { position: absolute; z-index: 5; top: 110%; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: flex; flex-direction: column; min-width: 160px; padding: 4px; }
.sc-share-menu a { padding: 7px 10px; color: var(--ink); text-decoration: none; border-radius: 5px; }
.sc-share-menu a:hover { background: var(--pill); }
.sc-picker { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.sc-picker select { width: auto; }
.sc-q { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.sc-q .q-opts { grid-column: 1 / -1; }
.sc-loc { display: grid; grid-template-columns: 170px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.sc-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.sc-rules label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; }
legend { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 0 4px; }
/* weekly hours */
.sc-day { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sc-day:last-child { border-bottom: 0; }
.sc-wins { display: flex; flex-direction: column; gap: 6px; }
.sc-win { display: inline-flex; align-items: center; gap: 6px; }
.sc-win input { width: auto; }
.sc-ex li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sc-ex li.past { opacity: .55; }
.sc-rem { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; }
.sc-rem select { width: auto; }
.appt-chip { border: 0; cursor: pointer; margin-left: 4px; font-weight: 600; }
@media (max-width: 1000px) { .sc-layout { grid-template-columns: 1fr; } .sc-side { max-height: none; } }
@media (max-width: 640px) { .sc-rules { grid-template-columns: 1fr 1fr; } .sc-day { grid-template-columns: 1fr; } .sc-loc { grid-template-columns: 1fr; } .sc-q { grid-template-columns: 1fr auto; } .sc-tg-head, .sc-tg-body { grid-template-columns: 44px repeat(var(--days), minmax(84px, 1fr)); } }
.sc-ev.short { justify-content: center; padding: 0 5px; }
.sc-ev .one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.sc-ev .one strong { font-size: 11.5px; }
.sc-slot.ro { cursor: default; pointer-events: none; }

/* File: Actions & Dates tab */
/* One wide row per action item: check-off, name and task status, its fields left to right, Save.
   The list scrolls inside the card; on narrow screens it scrolls sideways instead of stacking into boxes. */
.act-hint { margin: 8px 0 10px; }
.act-scroll { max-height: min(72vh, 900px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 8px; }
.act-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.act-table { min-width: 940px; }
.act-sec { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 7px 14px; background: var(--pill); border-bottom: 1px solid var(--line); }
.act-sec h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.act-row { display: grid; grid-template-columns: 40px 210px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--card); }
.act-row:last-child { border-bottom: 0; }
.act-row:hover { background: var(--ground, #fafafa); }
.act-row.done .act-name strong { color: var(--muted); }
.act-cell-check { display: flex; justify-content: center; }
.act-check { width: 22px; height: 22px; margin: 0; cursor: pointer; accent-color: var(--ok); }
.act-check:disabled { cursor: default; opacity: .75; }
.act-check-none { color: var(--muted); }
.act-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.act-name .meta { font-size: 12px; }
.act-name .meta.ok { color: var(--ok); }
.act-name .meta.overdue { color: var(--danger); }
.act-name .meta.today { color: var(--warn); }
.act-fields { display: flex; flex-wrap: nowrap; gap: 12px; min-width: 0; }
.act-f { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; font-weight: 500; color: var(--muted); min-width: 0; }
.act-f.date { flex: 0 0 160px; }
.act-f.amount { flex: 0 0 140px; }
.act-f.text { flex: 1 1 180px; }
.act-f.long { flex: 1 1 100%; }
.act-f input, .act-f textarea { padding: 6px 9px; font-size: 13px; }
.act-f textarea.grow { min-height: 0; resize: none; overflow: hidden; line-height: 1.4; }
.act-f textarea.one-line { white-space: pre-wrap; }
.act-f .meta.overdue { color: var(--danger); }
.act-f .meta.today { color: var(--warn); }
.act-save .btn { flex: none; }
.act-tax { margin-top: 16px; max-width: 640px; }

.act-form { grid-template-columns: 1fr; }
.act-form label { min-width: 0; overflow-wrap: anywhere; }
.act-date { display: flex; gap: 6px; align-items: center; }
.act-date input { flex: 1; min-width: 0; }
.act-date .btn { flex: none; }

/* File: document checklist */
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 24px; }
.check-group { min-width: 0; }
.check-group h3 { font-size: 13px; margin: 4px 0 6px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.check-row .check-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.check-row .check-status { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.check-row select { width: auto; max-width: 130px; font-size: 12px; padding: 3px 6px; }
.check-row.na .check-name { color: var(--muted); text-decoration: line-through; }

/* Sign-in page: text-style button ("Forgot your password?") */
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.linkish:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#forgot .ok:not(:empty) { color: var(--ok); }

/* Home: upcoming file deadlines (full width, above the File monitor) */
.deadlines .dl-when { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.deadlines .dl-tasks ul { margin: 4px 0 0; padding-left: 16px; }
.deadlines .dl-tasks li { margin: 2px 0; overflow-wrap: anywhere; }
.deadlines .dl-tasks .overdue { color: var(--danger); font-weight: 600; }
.deadlines .dl-tasks .today { color: var(--warn); font-weight: 600; }
.deadlines td { vertical-align: top; }

/* File: Documents tab. Log a document and the Drive folder side by side on top; the checklist, then the receipt log, under it. */
.receipt-log td { overflow-wrap: anywhere; }
.receipt-log td:first-child { min-width: 180px; }
.receipt-log td select { width: auto; min-width: 150px; }
.docs-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
.docs-log { margin-top: 14px; }
.docs-side > .card { min-width: 0; }
.log-doc { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.log-doc label { min-width: 0; }
.log-doc input[type=file] { max-width: 100%; overflow-wrap: anywhere; }
.log-doc .form-actions { flex-wrap: wrap; align-items: center; }
.log-doc .form-actions .meta { flex: 1 1 200px; overflow-wrap: anywhere; }
#driveList { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  /* Phones: each logged document becomes a stacked card instead of a wide table row. */
  .receipt-log thead { display: none; }
  .receipt-log, .receipt-log tbody, .receipt-log tr, .receipt-log td { display: block; width: 100%; }
  .receipt-log tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .receipt-log td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 104px 1fr; gap: 8px; }
  .receipt-log td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; }
  .receipt-log td:first-child { min-width: 0; }
  .receipt-log td.empty { display: block; }
  .receipt-log td.empty::before { content: none; }
  .receipt-log td select { min-width: 0; width: 100%; }
}

/* Leads list: room for each column so names, addresses and sources don't wrap onto many lines. */
@media (min-width: 1300px) {
  .leads-table th, .leads-table td { padding: 12px 10px; }
  .leads-table td:nth-child(1) { min-width: 180px; }
  .leads-table td:nth-child(2) { min-width: 150px; }
  .leads-table td:nth-child(3) { min-width: 140px; }
  .leads-table td select { min-width: 118px; }
  .leads-table td:nth-child(6) { min-width: 140px; }
  .leads-table td:nth-child(7) { white-space: nowrap; }
}
.leads-table .lead-actions { justify-content: flex-end; }

/* ---------- Files (the pipeline of opportunities) ---------- */
.ftiles { grid-template-columns: repeat(5, 1fr); }
.ftile { font: inherit; text-align: left; cursor: pointer; }
.ftile:hover { border-color: #b8c5d8; }
.ftile.on { border-color: var(--chrome); box-shadow: inset 0 -3px 0 var(--danger); }
.ftile .num { font-size: 24px; }
.ftable td { vertical-align: top; }
.ftable td.rrg { white-space: nowrap; }
.ftable .fnext { max-width: 280px; }
.ftable tr.clickable:focus-visible { outline: 2px solid var(--chrome); outline-offset: -2px; }
.fdl { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; vertical-align: top; }
.fdl-date { font-variant-numeric: tabular-nums; }
.board-fit { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.board-fit .lane { min-height: 0; max-height: 70vh; overflow-y: auto; }
.board-fit .item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; font: inherit; color: inherit; }
.board-fit .item:focus-visible { outline: 2px solid var(--chrome); }
.item-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.item-next { font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 5px; margin-top: 3px; }
.lane-empty { padding: 6px 4px; }
.empty-stages { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 1100px) { .ftiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .ftiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ftile { padding: 10px 12px; }
  .ftile .num { font-size: 20px; }
  .ftools { width: 100%; }
  .ftools select, .ftools input[type=search] { flex: 1 1 100%; width: 100%; }
  .ftools .seg { flex: 1; } .ftools .seg .btn { flex: 1; justify-content: center; }
  /* The list becomes one card per file. */
  .ftable-card { background: none; border: 0; box-shadow: none; padding: 0; }
  .ftable thead { display: none; }
  .ftable, .ftable tbody, .ftable tr, .ftable td { display: block; width: 100%; }
  .ftable tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; }
  .ftable td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  .ftable td::before { content: attr(data-label); flex: 0 0 96px; color: var(--muted); font-size: 12.5px; }
  .ftable td.fprop::before, .ftable td.rrg::before, .ftable td.empty::before { content: none; }
  .ftable td.rrg { font-size: 12px; }
  .ftable td.fprop { display: block; font-size: 16px; }
  .ftable .fnext { max-width: none; }
  .fdl { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; white-space: normal; }
  .ftiles .ftile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .board-fit .lane { max-height: none; }
}

/* ---------- Google Sign-In and Integrations ---------- */
.or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 4px 0 10px; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.google-btn { width: 100%; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border-color: #747775; font-weight: 600; }
.google-btn:hover { background: #f8f9fa; }
.int-status { display: inline-flex; align-items: center; gap: 6px; }
.int-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.int-card { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.int-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.int-card .toolbar { margin-top: auto; }
.int-users td { white-space: nowrap; }
.audit-list { max-height: 360px; overflow-y: auto; }
.int-row code { overflow-wrap: anywhere; }
#intCard .i-vh { margin: 20px 0 8px; font-size: 15px; }
#intCard .int-row { padding-top: 0; border-bottom: 0; }
#intCard .int-row p { margin: 0 0 8px; }

/* ---------- Email page: the mailbox, laid out like Gmail (mail.js) ---------- */
.mail-head { flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.mail-search { flex: 1 1 320px; max-width: 720px; }
.mail-search input { width: 100%; border-radius: 24px; padding: 9px 16px; background: var(--pill); border: 1px solid transparent; }
.mail-search input:focus { background: var(--card); border-color: var(--line); }
#mailBoxPick select { width: auto; max-width: 320px; }
.gm { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1.05fr); gap: 12px; align-items: start; }
.gm > .card { min-width: 0; padding: 10px; }
.gm-side { position: sticky; top: 8px; display: grid; gap: 4px; }
.gm-compose { justify-self: start; padding: 12px 20px; border-radius: 16px; margin-bottom: 8px; font-weight: 600; }
.gm-folder { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 12px; border: 0; border-radius: 0 16px 16px 0; background: none; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.gm-folder:hover { background: var(--pill); }
.gm-folder.on { background: var(--brand-tint); font-weight: 700; color: var(--brand-strong); }
.gm-folder > span:first-child { width: 18px; text-align: center; }
.gm-fname { flex: 1; }
.gm-count { font-size: 12px; font-weight: 700; }
.gm-sep { margin: 10px 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.gm-tagfilter { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 10px; }
.gm-tagfilter .chip { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.gm-sync { margin: 10px 10px 0; justify-self: start; }
.gm-list { padding: 0 !important; overflow: hidden; }
.gm-cats { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.gm-cats button { flex: 1 0 auto; padding: 11px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gm-cats button.on { color: var(--brand-strong); border-bottom-color: var(--brand); }
.gm-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.gm-pager { margin-left: auto; display: flex; gap: 4px; }
.gm-row { display: grid; grid-template-columns: 20px minmax(90px, 160px) minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; background: var(--ground); }
.gm-row:hover { box-shadow: inset 0 -1px 0 var(--line), 0 1px 3px rgba(0,0,0,.12); position: relative; }
.gm-row.unread { background: var(--card); font-weight: 700; }
.gm-row.on { background: var(--brand-tint); }
.gm-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gm-star { color: var(--muted); }
.gm-star.on { color: #f4b400; }
.gm-from, .gm-subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gm-snip { color: var(--muted); font-weight: 400; }
.gm-date { font-size: 12px; white-space: nowrap; text-align: right; }
.gm-tagbox { display: flex; align-items: center; gap: 2px; }
.gm-tag { width: 92px; padding: 3px 7px; font-size: 12px; border-radius: 12px; border: 1px dashed var(--line); background: transparent; }
.gm-tag:focus { border-style: solid; background: var(--card); width: 130px; }
.mail-tag { text-decoration: none; white-space: nowrap; font-weight: 600; }
.gm-untag { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 3px; }
.gm-read { padding: 14px 16px !important; }
.gm-read-head { display: flex; align-items: center; gap: 10px; }
.gm-read-head h2 { margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.gm-back { display: none; }
.gm-filebox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 12px; padding: 8px 10px; border-radius: 10px; background: var(--brand-tint); }
.gm-filebox input { width: 260px; max-width: 100%; }
.gm-msg { border-top: 1px solid var(--line); }
.gm-msg-head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; cursor: pointer; }
.gm-msg-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.gm-msg-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.gm-msg .gm-body, .gm-msg .gm-to { display: none; }
.gm-msg.open .gm-body, .gm-msg.open .gm-to { display: block; }
.gm-msg.open .gm-snipline { display: none; }
.gm-snipline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-html { width: 100%; min-height: 120px; border: 0; border-radius: 8px; background: #fff; }
.gm-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; margin: 0 0 8px; }
.gm-atts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.gm-atts a { text-decoration: none; }
.gm-acts { margin: 8px 0 14px; }
.gm-empty { padding: 20px 10px; }
@media (max-width: 1200px) {
  /* Narrower screens: the list and the open email share one column, like Gmail without the reading pane. */
  .gm { grid-template-columns: 180px minmax(0, 1fr); }
  .gm-read { display: none; }
  .gm.reading .gm-list { display: none; }
  .gm.reading .gm-read { display: block; }
  .gm-back { display: inline-flex; }
}
@media (max-width: 760px) {
  .gm { grid-template-columns: minmax(0, 1fr); }
  .gm-side { position: static; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .gm-side .gm-compose, .gm-side .gm-sep, .gm-side .gm-tagfilter, .gm-side .gm-sync { grid-column: 1 / -1; }
  .gm-side nav { display: contents; }
  .gm-folder { border-radius: 16px; }
  .gm.reading .gm-side { display: none; }
  .gm-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "from date" "subj subj" "tag tag"; gap: 2px 8px; }
  .gm-star { display: none; }
  .gm-from { grid-area: from; } .gm-date { grid-area: date; } .gm-subj { grid-area: subj; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .gm-tagbox { grid-area: tag; }
}

/* Home: running tasks, one scrolling column per team member */
.run-card { margin-bottom: 14px; }
.run-list { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.run-task { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; background: var(--card); font-size: 12.5px; }
.run-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.run-task .btn { flex: none; }
.run-mine .run-task { background: var(--ground); border: 1px solid var(--line); }
.run-task .overdue { color: var(--danger); font-weight: 600; }
.run-task .today { color: var(--warn); font-weight: 600; }
/* Home: no open tasks shrinks Running tasks to a one-line status banner */
.run-card.run-empty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; }
.run-card.run-empty h2 { margin: 0; font-size: 15px; }

/* File: Weekly update tab (updates.js) */
.wu-status { margin-bottom: 14px; }
.wu-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 24px; }
.wu-facts .k { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.wu-facts .v { margin-top: 3px; }
.wu-facts .overdue { color: var(--danger); font-weight: 600; }
.wu-facts .today { color: var(--warn); font-weight: 600; }
.wu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: start; margin-bottom: 14px; }
.wu-grid > .card { min-width: 0; }
.wu-grid .card-head { flex-wrap: wrap; gap: 6px 10px; }
.wu-to { display: grid; gap: 4px; }
.wu-preview { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--ground); }
.wu-subj { font-weight: 600; margin-bottom: 8px; overflow-wrap: anywhere; }
.wu-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13.5px; margin: 0; max-height: 360px; overflow-y: auto; }
.wu-note { padding: 8px 10px; border-radius: 8px; background: var(--brand-tint); margin: 0 0 10px; font-size: 13.5px; overflow-wrap: anywhere; }
.wu-note.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.wu-note.danger { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.wu-actions { flex-wrap: wrap; gap: 8px; }
.danger-text { color: var(--danger); }
.wu-approvals { margin-bottom: 14px; border-left: 4px solid var(--warn); }
.wu-wait { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wu-wait > div { min-width: 0; overflow-wrap: anywhere; }
.wu-tpl { display: grid; gap: 8px; }
.wu-tpl textarea { font-family: inherit; }
/* Lead detail view: bank / loan boxes and the intake answers */
.loan-box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; margin: 0; min-width: 0; }
.loan-box legend { font-weight: 600; padding: 0 4px; }
.loan-box > .form { padding: 0; }
.ld-intake { max-height: 420px; overflow-y: auto; }
a.lead-link { color: inherit; }

/* ---------- Texts and calls (public/messages.js) ---------- */
.msg-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .msg-layout { grid-template-columns: 1fr; } }
.msg-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.msg-who select { flex: 1; min-width: 200px; width: auto; }
.msg-thread { list-style: none; margin: 8px 0; padding: 8px; display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; background: var(--ground, #f4f5f7); border-radius: 10px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.msg.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--brand-tint, #e8eef7); border-color: var(--brand-tint-line, #c4d6f0); }
.msg.bad { border-color: var(--danger); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.msg-err { font-size: 12px; color: var(--danger); margin-top: 4px; }
.msg .btn { margin-top: 6px; }
.msg-reply { margin-top: 8px; }
.msg-count { min-height: 1em; }
.msg-person, .call-row, .review-row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.call-note { margin-top: 2px; }
.call-row .toolbar { margin-top: 6px; }
.ooma-steps { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 14px; }
.ooma-step { display: flex; gap: 12px; }
.ooma-step h3 { margin: 2px 0 4px; font-size: 15px; }
.ooma-step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--pill); color: var(--muted); }
.ooma-step.done .ooma-step-n { background: #e3f2e9; color: var(--ok); }
.ooma-event { border-bottom: 1px solid var(--line); padding: 8px 0; }
.ooma-event summary { cursor: pointer; }
.ooma-event pre { max-height: 200px; overflow: auto; font-size: 12px; }

/* ---------- E-signatures (public/signatures.js) ---------- */
.chip.sig-viewed { background: #e6eefb; color: #1f4f96; }
.sig-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.sig-strip .k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sig-strip-item { display: inline-flex; align-items: center; gap: 6px; max-width: 320px; padding: 2px 8px 2px 2px; border: 1px solid var(--line); border-radius: 999px; background: none; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.sig-strip-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-strip-item:hover { background: var(--pill); }
.sig-strip-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drive-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drive-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.drive-sign { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sig-req { padding: 10px 0; border-top: 1px solid var(--line); }
.sig-req:first-child { border-top: 0; }
.sig-req-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sig-signers { margin: 6px 0 4px; padding-left: 18px; }
.sig-signers li { margin: 2px 0; }
/* The builder needs room: the dialog grows past the usual wide size. */
.modal-card.sig-dialog { width: min(1280px, 100%); }
.sig-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; min-height: min(78vh, 900px); }
.sig-side { display: flex; flex-direction: column; gap: 10px; }
.sig-side h3 { margin: 0; }
.sig-pick { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sig-pick li { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.sig-pick li.on { border-color: var(--ink); }
.sig-pick label { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.sig-pick label > span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.sig-move { display: inline-flex; gap: 4px; }
.sig-order { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 0; }
.sig-actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.sig-builder { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: var(--ground); }
.sig-builder docuseal-builder { display: block; min-height: 100%; }
@media (max-width: 900px) {
  .sig-layout { grid-template-columns: 1fr; }
  .sig-builder { min-height: 70vh; }
  .sig-actions { margin-top: 0; }
}

/* ---------- Settings → Automations (public/automations.js) ---------- */
.au-switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px 0; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.au-switch .au-knob { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #c9c9cf; transition: background .15s; flex: none; }
.au-switch .au-knob::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.au-switch[aria-checked="true"] { color: var(--ok); }
.au-switch[aria-checked="true"] .au-knob { background: var(--ok); }
.au-switch[aria-checked="true"] .au-knob::after { transform: translateX(16px); }
.au-switch[aria-busy="true"] { opacity: .6; cursor: progress; }
.au-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.au-tpl { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--chrome); }
.au-tpl h3 { margin: 0; font-size: 15px; }
.au-tpl p { margin: 0; flex: 1; }
.au-tpl-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.au-tpl-foot .btn { margin-left: auto; }
.au-table td { vertical-align: top; }
.au-table .au-name { font-weight: 600; color: var(--ink); }
.au-table th.r, .au-table td.r { text-align: right; }
@media (max-width: 720px) {
  .au-table thead { display: none; }
  .au-table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .au-table td { display: flex; gap: 10px; border: 0; padding: 4px 0; text-align: left !important; }
  .au-table td[data-label]::before { content: attr(data-label); flex: 0 0 90px; color: var(--muted); font-size: 12.5px; }
}
.au-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .au-layout { grid-template-columns: 1fr; } }
.au-flow > .card { margin-bottom: 12px; }
.au-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.au-steps::before { content: ''; position: absolute; left: 27px; top: 20px; bottom: 20px; width: 2px; background: var(--line); }
.au-step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.au-step.au-fixed { border-left: 3px solid var(--chrome); }
.au-step-head { display: flex; align-items: center; gap: 10px; }
.au-step-head h3 { margin: 0; font-size: 14.5px; flex: 1; }
.au-step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--chrome); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.au-step-n.trig { background: var(--brand); }
.au-step-n.exit { background: var(--chrome-2); }
.au-step-tools { display: flex; gap: 2px; }
.au-step-tools .icon-btn[disabled] { opacity: .35; cursor: default; }
.au-step-body { margin-top: 10px; }
.au-step + .au-step, .au-fixed + .au-fixed { margin-top: 12px; }
.au-add { display: flex; justify-content: center; padding: 8px 0; position: relative; }
.au-add-btn { background: var(--pill); border-style: dashed; }
.au-end { display: flex; justify-content: center; padding: 4px 0 0; position: relative; }
.au-delay { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.au-delay label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.au-delay input { width: 100px; }
.au-delay select { width: auto; }
.au-step-body .check { margin-right: 0; }
.au-sms-tools { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.au-vars { display: flex; gap: 6px; flex-wrap: wrap; }
.au-var { border: 1px solid var(--line); background: var(--pill); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink); }
.au-var::before { content: '{ } '; color: var(--brand); font-weight: 700; }
.au-var:hover { background: var(--pill-hover); }
.au-count { margin-top: 6px; font-size: 12px; color: var(--muted); }
.au-count.warn { color: var(--warn); font-weight: 600; }
.au-exits { display: flex; flex-direction: column; gap: 8px; }
.au-exits .check { color: var(--ink); }
.au-exit-status { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.au-pill-check { position: relative; }
.au-pill-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.au-pill-check span { display: inline-block; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.au-pill-check input:checked + span { background: var(--chrome); border-color: var(--chrome); color: #fff; }
.au-pill-check input:focus-visible + span { outline: 2px solid var(--chrome); outline-offset: 2px; }
.au-enr { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.au-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.au-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-tint); color: var(--brand-strong); }
.au-tag-x { border: 0; background: none; padding: 0 2px; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; }
.au-tag-form input { flex: 1; min-width: 160px; }
.au-consent { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.au-thread { padding: 10px 0 0; max-height: 320px; overflow-y: auto; }
.au-thread .bubble .meta { margin-top: 4px; }
.au-step-tools .icon-btn { font-size: 15px; min-width: 32px; min-height: 32px; margin: 0; }

/* Reorderable dashboard cards (public/dash.js). The cards themselves are untouched: the grid wrapper
   spaces the rows, and the grip sits in the card's own left padding next to its title. */
.dash > * + * { margin-top: 14px; }
.dash .dash-item > .card { margin-top: 0 !important; margin-bottom: 0 !important; }
.dash-item { position: relative; min-width: 0; }
.dash-grip { position: absolute; top: 14px; left: 1px; z-index: 1; width: 15px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); opacity: .45; cursor: grab; touch-action: none; display: grid; place-items: center; }
.dash-grip:hover, .dash-grip:focus-visible { opacity: 1; background: var(--pill); }
.dash-grip:focus-visible { outline: 2px solid var(--chrome); outline-offset: 0; }
.dash-item.dash-dragging { opacity: .6; }
.dash-item.dash-dragging > .card { outline: 2px dashed var(--muted); outline-offset: 2px; }
.dash.dash-on .dash-col:empty { min-height: 64px; border: 2px dashed var(--line); border-radius: var(--r); }
body.dash-grabbing, body.dash-grabbing * { cursor: grabbing !important; user-select: none; }
