:root {
    color-scheme: light;
    --bg: #f6f5f0;
    --surface: #ffffff;
    --surface-soft: #f8f7f3;
    --ink: #111111;
    --muted: #66615b;
    --line: #e5e0d1;
    --brand: #ff3302;
    --brand-secondary: #ff6641;
    --brand-dark: #9c1f00;
    --brand-soft: #ffccc0;
    --brand-wash: #fff2ee;
    --charcoal: #353535;
    --success: #176b4d;
    --success-soft: #e8f4ef;
    --gold: #875512;
    --gold-soft: #fff1d9;
    --red: #8f303b;
    --red-soft: #fbe9eb;
    --neutral: #404040;
    --neutral-soft: #eeeae1;
    --shadow: 0 16px 38px rgb(53 53 53 / 8%);
    font-family: "Ping AR", Tahoma, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
html { scroll-behavior: auto; }
body { margin: 0; min-width: 0; background: var(--bg); color: var(--ink); line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
code { direction: ltr; unicode-bidi: isolate; }
.skip-link { position: fixed; z-index: 100; inset: .5rem auto auto .5rem; transform: translateY(-180%); background: var(--surface); padding: .65rem 1rem; border-radius: .6rem; }
.skip-link:focus { transform: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2rem; padding: 1.4rem; color: white; background: var(--charcoal); }
.brand { display: flex; align-items: center; gap: .8rem; }
.brand-mark { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .8rem; background: var(--brand); color: #000000; font-weight: 900; font-size: 1.35rem; }
.brand strong, .brand small { display: block; }
.brand small { color: #d9d5cc; }
.sidebar nav { display: grid; gap: .18rem; }
.nav-group-label { margin: .85rem .9rem .18rem; color: #bfbfbf; font-size: .68rem; font-weight: 800; }
.sidebar nav a { padding: .75rem .9rem; border-radius: .7rem; color: #eeeae1; text-decoration: none; }
.sidebar nav a:hover { color: white; background: rgb(255 255 255 / 9%); }
.sidebar nav a.is-active { color: #000000; background: var(--brand); font-weight: 900; }
.safety-card { margin-top: auto; display: flex; align-items: center; gap: .65rem; padding: .35rem .1rem; }
.safety-card strong, .safety-card small { display: block; }
.safety-card small { color: #d9d5cc; }
.status-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #5bd1aa; box-shadow: 0 0 0 .25rem rgb(91 209 170 / 15%); }
.workspace { min-width: 0; padding: clamp(1rem, 3vw, 2.4rem); }
.topbar, .section-heading, .panel-heading, .modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar { margin-bottom: 2rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.6rem, 3vw, 2.35rem); }
h2 { margin-bottom: .2rem; }
h3 { margin-bottom: 0; }
.eyebrow { margin-bottom: .25rem; color: var(--brand-dark); font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.section-description { max-width: 46rem; margin: .35rem 0 0; color: var(--muted); }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.workspace-heading small { display: block; color: var(--muted); }
.top-actions-menu { position: relative; }
.top-actions-menu > summary { list-style: none; }
.top-actions-menu > summary::-webkit-details-marker { display: none; }
.top-actions-menu-panel { position: absolute; z-index: 50; inset: calc(100% + .45rem) auto auto 0; display: grid; min-width: 12rem; gap: .45rem; padding: .55rem; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); box-shadow: var(--shadow); }
.top-actions-menu-panel .button { width: 100%; }
.discovery-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem; }
.lock-badge, .user-badge, .phase-badge, .tag { display: inline-flex; align-items: center; border-radius: 99rem; padding: .38rem .65rem; font-size: .78rem; font-weight: 700; }
.lock-badge { color: var(--neutral); background: var(--neutral-soft); direction: ltr; }
.user-badge, .phase-badge { color: var(--brand-dark); background: var(--brand-wash); }
.button, .icon-button { border: 0; border-radius: .7rem; font-weight: 700; }
.button { padding: .65rem .9rem; }
.button.primary { background: var(--brand); color: #000000; }
.button.primary:hover { background: var(--brand-secondary); }
.button.secondary { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.button.secondary:hover { border-color: var(--brand-secondary); background: var(--brand-wash); }
.button.danger { color: var(--red); background: var(--red-soft); }
.button.wide { width: 100%; }
.icon-button { width: 2.2rem; height: 2.2rem; background: transparent; font-size: 1.4rem; }
.page-section { scroll-margin-top: 1rem; margin-bottom: 2.3rem; }
.metrics { display: flex; flex-wrap: wrap; gap: .45rem 1.25rem; margin: .8rem 0 1rem; color: var(--muted); }
.metric { display: inline-flex; gap: .35rem; align-items: baseline; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: .82rem; }
.metric strong { color: var(--ink); font-size: inherit; }
.metric span { color: inherit; }
.panel { border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); box-shadow: none; }
.pipeline-panel { padding-top: .85rem; border-top: 1px solid var(--line); }
.panel-heading span { color: var(--muted); font-size: .82rem; }
.pipeline { display: flex; flex-wrap: wrap; gap: .45rem 1.25rem; margin-top: .6rem; }
.pipeline-step { display: inline-flex; gap: .35rem; color: var(--muted); font-size: .82rem; }
.pipeline-step strong { color: var(--ink); }
.today-focus { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0 .25rem; padding: .9rem 0 .9rem 1rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.today-work-scopes { margin-top: 1rem; }
.today-focus-copy { display: grid; gap: .18rem; min-width: 0; }
.today-focus-copy > span { color: var(--brand-dark); font-size: .75rem; font-weight: 900; }
.today-focus-copy h3, .today-focus-copy p { margin: 0; }
.today-focus-copy p, .today-focus-copy small { color: var(--muted); }
.today-worklist { overflow: hidden; border-inline: 0; border-radius: 0; box-shadow: none; }
.today-worklist-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; background: transparent; border-bottom: 1px solid var(--line); }
.today-worklist-heading h3 { margin: 0; }
.today-worklist-heading span { color: var(--muted); font-size: .78rem; }
.today-list-group { padding: .9rem 1rem; border-top: 1px solid var(--line); }
.today-list-group:first-of-type { border-top: 0; }
.today-list-group h4 { margin: 0 0 .35rem; font-size: .9rem; }
.today-action-items { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.today-action-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.today-action-items li:first-child { border-top: 0; }
.today-action-items strong, .today-action-items small { display: block; }
.today-action-items small { color: var(--muted); font-size: .75rem; }
.today-action-link { color: var(--brand-dark); font-size: .82rem; font-weight: 900; text-decoration: none; }
.today-action-link:hover { text-decoration: underline; }
.today-empty { margin: 0; padding: 1.2rem; color: var(--muted); text-align: center; }
.today-secondary { margin-top: .75rem; padding: .75rem 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; color: var(--muted); background: transparent; }
.today-secondary > summary { width: fit-content; cursor: pointer; color: var(--brand-dark); font-size: .82rem; font-weight: 800; }
.research-safety { margin: .75rem 0; color: var(--muted); font-size: .84rem; }
.research-safety summary { width: fit-content; cursor: pointer; font-weight: 800; }
.research-safety p { max-width: 52rem; margin: .45rem 0 .1rem; color: var(--muted); }
.research-safety small { color: var(--muted); }
.research-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; }
.crm-guide-entry { display: flex; justify-content: flex-start; margin-top: .35rem; }
.crm-guide-trigger { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.25rem; padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--brand-dark); font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.crm-guide-trigger > span { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: #e6efe9; }
.crm-guide-trigger:hover { border-color: var(--brand-dark); }
.crm-guide-trigger:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 3px; }
.research-workbench { display: grid; grid-template-columns: minmax(17rem, 21rem) minmax(0, 1fr); gap: 0; align-items: start; overflow: hidden; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.research-queue, .research-detail { min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
.research-queue { overflow: hidden; }
.research-detail { border-inline-start: 1px solid var(--line); }
.research-controls { margin: 1rem 0 .55rem; }
.research-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: .65rem; padding: 0; background: transparent; }
.research-toolbar > label { min-width: 0; flex: 1 1 10rem; }
.research-toolbar > .research-search-field { flex: 2 1 17rem; }
.research-toolbar input, .research-toolbar select { min-width: 0; width: 100%; }
.research-list-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; min-height: 2.8rem; }
#live-crm-pager { align-items: center; justify-content: flex-end; padding: 0; gap: .55rem; font-size: .75rem; }
#live-crm-pager .button { flex: 0 0 auto; min-height: 2.75rem; padding: .35rem .55rem; background: transparent; border: 0; }
.research-secondary { margin-top: .65rem; }
.research-secondary > details { margin: 0; border: 0; font-size: .78rem; color: var(--muted); }
.research-secondary > details > summary { color: var(--muted); padding-block: .35rem; }
.research-history-item { padding-block: .75rem; border-bottom: 1px solid var(--line); }
.research-summary { margin: 0; padding: .35rem 0; font-size: .8rem; }
.research-summary { color: var(--muted); }
.research-list { display: grid; max-height: 36rem; overflow-y: auto; overscroll-behavior: contain; }
.research-list-item { display: grid; gap: .3rem; width: 100%; padding: .8rem .9rem; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: var(--surface); text-align: start; }
.research-list-item:last-child { border-bottom: 0; }
.research-list-item:hover { background: var(--surface-soft); }
.research-list-item.is-active { background: var(--brand-wash); box-shadow: inset -.22rem 0 0 var(--brand); }
.research-list-head, .research-block-heading { display: flex; justify-content: space-between; align-items: center; gap: .55rem; }
.research-list-head strong { min-width: 0; font-size: .95rem; }
.research-list-head { display: grid; min-width: 0; gap: .2rem; }
.research-list-head .tag.good, .research-list-head .tag.warn { max-width: 100%; padding: 0; border-radius: 0; background: transparent; white-space: normal; font-weight: 500; text-align: start; }
.research-list-domain { color: var(--muted); overflow-wrap: anywhere; }
.research-list-operations { color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.research-list-operations.is-overdue { color: var(--red); font-weight: 800; }
.research-detail { min-height: 22rem; padding: 1.1rem; overflow-wrap: anywhere; }
.research-detail-content { display: grid; gap: .75rem; }
.research-back-button { display: none; width: fit-content; }
.research-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; flex-wrap: wrap; }
.research-card-head > div { min-width: 0; }
.research-card-head h3 { margin-bottom: .1rem; font-size: clamp(1.25rem, 2.2vw, 1.65rem); }
.research-compact-meta { margin: .2rem 0 0; color: var(--muted); font-size: .84rem; }
.research-site-link { width: fit-content; color: var(--brand-dark); font-size: .86rem; font-weight: 800; text-decoration: none; }
.research-next-step { display: grid; gap: .18rem; padding: .65rem .8rem; border-inline-start: .2rem solid var(--brand); color: var(--brand-dark); background: transparent; }
.research-next-step span { font-size: .75rem; font-weight: 800; }
.research-crm-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .8rem 0; border-block: 1px solid var(--line); background: transparent; }
.research-crm-state { display: grid; gap: .12rem; min-width: 0; }
.research-crm-state > span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.research-crm-state > strong { color: var(--brand-dark); }
.research-crm-state > small { color: var(--muted); overflow-wrap: anywhere; }
.research-crm-owner { font-weight: 800; }
.research-crm-summary-text, .research-latest-activity { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.research-crm-dates, .research-crm-actions { display: flex; flex-wrap: wrap; gap: .4rem .8rem; }
.research-crm-dates { margin-top: .25rem; color: var(--muted); font-size: .76rem; }
.research-crm-actions { justify-content: flex-end; }
.research-crm-action-area { display: grid; justify-items: end; gap: .3rem; }
.research-crm-action-area > small { color: var(--muted); font-size: .7rem; }
.research-crm-timeline { gap: .55rem; }
.research-crm-entry { display: grid; gap: .3rem; padding: .75rem 0; border-bottom: 1px solid var(--line); background: transparent; }
.research-crm-entry p { margin: 0; white-space: pre-wrap; }
.research-crm-entry small, .research-crm-empty { color: var(--muted); }
.research-crm-empty { margin: 0; }
.crm-primary-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; max-width: 42rem; }
.crm-primary-actions .button { min-width: 0; min-height: 2.8rem; padding: .6rem .7rem; text-align: center; }
.crm-customer-website { display: inline-flex; align-items: center; min-height: 2.75rem; max-width: 100%; color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: .22rem; overflow-wrap: anywhere; }
.crm-customer-website:hover { color: var(--ink); }
.crm-whatsapp-button { background: #176b46; border-color: #176b46; color: #fff; }
.crm-whatsapp-button:hover { background: #125436; }
.crm-owner-button { overflow-wrap: anywhere; }
.crm-client-services:has(.crm-service-chips) { padding: .25rem 0 .75rem; border: 0; border-bottom: 1px solid var(--line); }
.crm-service-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.crm-service-chip { min-height: 2.75rem; padding: .45rem .85rem; border: 1px solid #d4d4d4; border-radius: 2rem; background: #f4f4f4; color: #505050; font-size: .86rem; font-weight: 700; }
.crm-service-chip[data-status="ACTIVE"] { color: #155f37; background: #e3f4e8; border-color: #94cba7; }
.crm-service-chip[data-status="PLANNED"] { color: #28588e; background: #eaf1fc; border-color: #aec7e4; }
.crm-service-chip[data-status="DECLINED"] { color: #a21c2a; background: #ffebec; border-color: #e9afb5; }
.crm-service-chip[data-status="UNKNOWN"] { border-style: dashed; }
.crm-service-chip:disabled { cursor: default; opacity: 1; }
.crm-service-legend { display: block; margin-top: .5rem; color: var(--muted); font-size: .7rem; }
.crm-conversation { min-width: 0; }
.crm-conversation-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.crm-conversation-heading h4 { margin: 0; }
.crm-conversation-heading .button { padding: .5rem .7rem; font-size: .8rem; }
.crm-followup-line { display: block; margin-bottom: .7rem; color: var(--muted); }
.crm-conversation-list { display: grid; gap: 1rem; }
.crm-conversation-list > .research-crm-empty { padding-block: 1.5rem; }
.crm-conversation-row { display: grid; grid-template-columns: minmax(5.5rem, 8rem) minmax(0, 1fr); align-items: start; gap: .8rem; }
.crm-conversation-row time { padding-top: .7rem; color: var(--muted); font-size: .75rem; line-height: 1.7; }
.crm-conversation-bubble { min-width: 0; padding: .8rem 1rem; border-radius: .85rem 0 .85rem .85rem; background: #f5f4f1; }
.crm-conversation-row.is-inbound .crm-conversation-bubble { background: #edf6f0; }
.crm-conversation-bubble p { margin: .4rem 0; white-space: pre-wrap; line-height: 1.8; }
.crm-conversation-bubble small { color: var(--muted); font-size: .73rem; }
.crm-form-request-details { min-width: 0; overflow-wrap: anywhere; }
.crm-form-request-brief { white-space: pre-wrap; line-height: 1.8; }
.crm-form-source-details { margin-top: .55rem; font-size: .8rem; }
.crm-form-source-details summary { width: fit-content; cursor: pointer; color: var(--muted); padding-block: .35rem; }
.crm-form-source-details[open] { border-top: 1px solid var(--line); padding-top: .35rem; }
.crm-form-source-details a { display: inline-block; margin-top: .35rem; }
.crm-extra-details { margin-top: .5rem; }
.research-disclosure.crm-extra-details > summary { color: var(--muted); font-size: .85rem; font-weight: 500; }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.modal-heading .icon-button { min-width: 2.75rem; min-height: 2.75rem; border: 0; background: transparent; font-size: 1.5rem; }
#crm-whatsapp-dialog .form-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
#crm-whatsapp-dialog .form-actions .button { flex: 1; }
.research-reason { padding-block: .15rem; }
.research-reason h4 { margin: 0 0 .25rem; }
.research-reason p { margin: 0; color: var(--neutral); }
.research-warning h4 { margin: 0 0 .5rem; }
.research-evidence, .research-checklist { display: grid; gap: .55rem; margin: 0; padding-inline-start: 1.25rem; }
.research-evidence li p { margin: .25rem 0; }
.research-evidence li small, .research-channel-card small, .research-draft-card small, .research-trace { display: block; color: var(--muted); }
.research-intervention { padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.research-source-link { display: inline-flex; margin-top: .4rem; color: var(--brand-dark); font-size: .8rem; font-weight: 800; }
.research-warning { padding: .75rem .85rem; border-radius: .7rem; color: #5f3c0a; background: var(--gold-soft); }
.research-communication-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.research-channel-card, .research-draft-card { padding: .85rem 0; border-top: 1px solid var(--line); }
.research-channel { display: flex; flex-wrap: wrap; gap: .35rem; margin: .65rem 0 .2rem; font-weight: 900; }
.research-channel bdi { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.research-draft { margin: 0 0 .45rem; padding: .8rem; border-inline-start: .25rem solid var(--brand); border-radius: .65rem; background: var(--surface-soft); white-space: pre-wrap; }
.research-disclosure { border-top: 1px solid var(--line); padding-top: .65rem; }
.research-disclosure summary { color: var(--brand-dark); cursor: pointer; font-weight: 800; }
.research-disclosure-body { display: grid; gap: .75rem; padding-top: .7rem; }
.research-contact-disclosure { border-top: 0; padding-top: 0; }
.research-contact-action { display: flex; justify-content: center; width: 100%; list-style: none; color: #000000 !important; text-align: center; }
.research-contact-action::-webkit-details-marker { display: none; }
.research-contact-disclosure[open] .research-contact-action { background: var(--brand-secondary); }
.research-contact-status { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 800; text-align: center; }
.research-score-line { margin: 0; color: var(--muted); font-size: .82rem; }
.research-disclosure .research-trace { margin-top: .25rem; }
.research-trace { direction: ltr; unicode-bidi: isolate; text-align: left; }
.crm-optional-fields { border: 0; border-top: 1px solid var(--line); padding: .8rem 0; }
.crm-optional-fields summary { cursor: pointer; color: var(--brand-dark); font-weight: 800; }
.crm-optional-fields .form-grid { margin-top: .8rem; }
.crm-contact-card { min-width: 0; margin: 0; padding: .9rem 0; border: 0; border-top: 1px solid var(--line); background: transparent; }
.crm-contact-card legend { padding-inline: .35rem; color: var(--brand-dark); font-weight: 900; }
.crm-contact-card .hint { margin: 0 0 .75rem; }
.crm-client-services { display: grid; gap: .65rem; padding: .8rem 0; border-block: 1px solid var(--line); background: transparent; }
.crm-client-services-heading { display: flex; align-items: end; justify-content: space-between; gap: .65rem; }
.crm-client-services-heading h4 { margin: 0; }
.crm-client-services-heading small { display: block; color: var(--muted); }
.crm-client-services-heading > small { max-width: 18rem; text-align: end; }
.crm-client-services-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.crm-client-service { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: .65rem; padding: .55rem 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.crm-client-service[data-status="ACTIVE"] { border-color: #98cdbf; background: transparent; }
.crm-client-service strong { min-width: 0; font-size: .82rem; overflow-wrap: anywhere; }
.crm-client-service-status { flex: 0 0 auto; min-width: 5.25rem; min-height: 2.4rem; padding: .4rem .65rem; border: 1px solid transparent; border-radius: 999px; font-size: .78rem; font-weight: 900; }
.crm-client-service-status.is-active { color: white; background: var(--success); }
.crm-client-service-status.is-inactive { color: var(--muted); background: var(--surface); border-color: var(--line); }
.crm-contact-list { gap: .6rem; }
.crm-contact-item { display: grid; gap: .55rem; padding: .75rem 0; border-bottom: 1px solid var(--line); background: transparent; }
.crm-contact-item p { margin: 0; color: var(--muted); }
.crm-contact-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .55rem; }
.crm-contact-heading small { color: var(--muted); }
.crm-channel-list { display: grid; gap: .35rem; }
.crm-channel-row { display: grid; grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .45rem 0; }
.crm-channel-row > span { color: var(--neutral); font-size: .78rem; font-weight: 900; }
.crm-channel-row bdi { overflow-wrap: anywhere; }
.crm-channel-row small { color: var(--muted); text-align: end; }
.compact-empty { min-height: 9rem; }
.autopilot-safety { margin: .75rem 0; color: var(--muted); }
.autopilot-safety > summary { width: fit-content; cursor: pointer; color: var(--brand-dark); font-size: .82rem; font-weight: 800; }
.autopilot-safety > div { display: grid; gap: .25rem; margin-top: .55rem; padding: .8rem .9rem; border-inline-start: .25rem solid var(--brand); background: var(--surface-soft); }
.autopilot-safety span { display: block; color: var(--muted); }
.autopilot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, .7fr); gap: .9rem; align-items: start; }
.autopilot-results, .autopilot-list { display: grid; gap: .8rem; }
.autopilot-list-panel { padding: 1rem; }
.autopilot-list { margin-top: .8rem; }
.automation-card { display: grid; gap: .65rem; padding: .9rem 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; overflow-wrap: anywhere; }
.automation-card strong, .automation-card small { display: block; }
.automation-card small { color: var(--muted); }
.automation-summary, .automation-settings-list p { margin: 0; }
.automation-card-details, .automation-run-details { padding-top: .55rem; border-top: 1px solid var(--line); }
.automation-card-details > summary, .automation-run-details > summary, .autopilot-history > summary, .automation-create-details > summary, .automation-advanced > summary { cursor: pointer; color: var(--brand-dark); font-weight: 800; }
.automation-settings-list { display: grid; gap: .35rem; padding-top: .65rem; color: var(--muted); font-size: .82rem; }
.automation-safety-ok, .automation-safety-warning { margin: 0; padding: .55rem .7rem; border-radius: .6rem; font-size: .8rem; }
.automation-safety-ok { color: var(--success); background: var(--success-soft); }
.automation-safety-warning { color: var(--red); background: var(--red-soft); }
.autopilot-history, .automation-create-details { padding: 1rem 0; border-inline: 0; border-radius: 0; }
.autopilot-history > .autopilot-list { padding-top: .2rem; }
.automation-create-details > .form-panel { margin-top: .75rem; padding: .8rem 0 0; border-top: 1px solid var(--line); }
.automation-advanced { padding: .7rem 0; border: 0; border-top: 1px solid var(--line); }
.automation-advanced > label:first-of-type { margin-top: .65rem; }
.automation-advanced label + label { margin-top: .55rem; }
.automation-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin: 0; padding: 0; list-style-position: inside; }
.automation-steps li { padding: .45rem; border-radius: .5rem; background: var(--surface); border: 1px solid var(--line); font-size: .76rem; }
.automation-control-box { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin: .8rem 0; padding: .8rem; border-radius: .8rem; background: var(--brand-wash); border: 1px solid var(--brand-soft); }
.automation-control-box small { display: block; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1rem 0; padding: .8rem 0; border-block: 1px solid var(--line); background: transparent; }
label { display: grid; gap: .3rem; color: var(--muted); font-size: .82rem; font-weight: 700; }
input, select, textarea { min-height: 2.65rem; padding: .55rem .7rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: .65rem; }
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.page-section h2[tabindex="-1"]:focus-visible { outline: 0; text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: .14rem; text-underline-offset: .28rem; }
.filters label:first-child { flex: 1 1 16rem; }
.crm-grid { display: grid; grid-template-columns: minmax(15rem, .8fr) minmax(0, 1.7fr); gap: 0; align-items: start; overflow: hidden; border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
.leads-panel { overflow: hidden; }
.leads-panel, .detail-panel { border: 0; border-radius: 0; }
.lead-list { display: grid; }
.lead-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .6rem; padding: .9rem 1rem; text-align: right; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; }
.lead-row:hover, .lead-row.is-active { background: var(--brand-wash); }
.lead-row strong, .lead-row small { display: block; }
.lead-row small { color: var(--muted); }
.detail-panel { min-height: 20rem; padding: 1.1rem; border-inline-start: 1px solid var(--line); }
.detail-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.detail-head h3 { font-size: 1.4rem; }
.detail-domain { direction: ltr; unicode-bidi: isolate; color: var(--muted); }
.detail-meta { display: flex; flex-wrap: wrap; gap: .45rem; margin: .8rem 0; }
.tag { color: var(--neutral); background: var(--neutral-soft); white-space: nowrap; }
.tag.good { color: var(--success); background: var(--success-soft); }
.tag.warn { color: var(--gold); background: var(--gold-soft); }
.tag.stop { color: var(--red); background: var(--red-soft); }
.action-box { margin: 1rem 0; padding: .75rem .9rem; border: 0; border-inline-start: .2rem solid var(--brand); background: transparent; }
.action-box h4 { margin: 0 0 .55rem; }
.action-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.record-card { padding: .8rem 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; overflow-wrap: anywhere; }
.record-card p { margin: .35rem 0; }
.record-card small { color: var(--muted); }
.record-card .message-body { white-space: pre-wrap; }
.subheading { margin: 1.2rem 0 .55rem; font-size: 1rem; }
.service-portfolio { margin: 1rem 0; padding: 1rem 0; border-block: 1px solid var(--line); background: transparent; }
.portfolio-heading, .portfolio-card-head, .portfolio-score { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.portfolio-heading h4 { margin: 0; }
.portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: .8rem; }
.portfolio-card.is-selected { padding-inline-start: .75rem; border-inline-start: .2rem solid var(--brand); box-shadow: none; }
.commercial-card.is-closed { opacity: .78; }
.portfolio-score { margin: .6rem 0 .35rem; }
.portfolio-score > strong { font-size: 1.2rem; white-space: nowrap; }
.portfolio-empty { min-height: 6rem; }
.registry-grid { display: grid; grid-template-columns: minmax(16rem, .8fr) minmax(0, 1.2fr); gap: .9rem; margin-top: 1rem; align-items: start; }
.form-panel { display: grid; gap: .75rem; padding: 1rem; }
.registry-list { overflow: hidden; }
.registry-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.registry-row:last-child { border-bottom: 0; }
.registry-row strong, .registry-row small { display: block; }
.registry-row small { color: var(--muted); }
.audit-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; padding: 1rem; margin-top: 1rem; }
.audit-search { grid-column: span 2; }
.audit-filter-actions { display: flex; align-items: end; gap: .5rem; }
.audit-toolbar, .audit-card-head, .audit-meta { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.audit-toolbar { margin: .8rem 0; }
.audit-toolbar p { margin: 0; color: var(--muted); }
.audit-toolbar > div { display: flex; gap: .45rem; }
.audit-list { display: grid; gap: 0; border-block: 1px solid var(--line); background: var(--surface); }
.audit-card { padding: 1rem 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.audit-card-head > div { min-width: 0; }
.audit-card-head strong, .audit-card-head small { display: block; overflow-wrap: anywhere; }
.audit-meta { margin: .65rem 0; color: var(--muted); flex-wrap: wrap; }
.audit-meta time { direction: ltr; unicode-bidi: isolate; font-size: .78rem; }
.audit-details { margin: .65rem 0; }
.audit-details summary { cursor: pointer; color: var(--brand-dark); font-weight: 700; }
.audit-details pre { max-height: 16rem; overflow: auto; padding: .75rem; border-radius: .65rem; background: var(--charcoal); color: #f6f5f0; direction: ltr; text-align: left; white-space: pre-wrap; }
.empty { min-height: 9rem; display: grid; place-items: center; align-content: center; gap: .3rem; padding: 1rem; color: var(--muted); text-align: center; }
.modal { width: min(28rem, calc(100% - 2rem)); padding: 0; border: 0; border-radius: 1rem; box-shadow: 0 2rem 7rem rgb(0 0 0 / 30%); }
.modal.wide { width: min(58rem, calc(100% - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; }
.modal::backdrop { background: rgb(17 17 17 / 65%); backdrop-filter: blur(4px); }
.modal-card { display: grid; gap: .8rem; padding: 1.4rem; }
.modal-card h2 { margin-bottom: 0; }
.modal-card p { color: var(--muted); }
.crm-workflow-guide .modal-card { gap: 1rem; }
.crm-workflow-guide .crm-guide-intro { margin: 0; font-size: .88rem; }
.crm-guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.crm-guide-step { min-width: 0; padding: .8rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); }
.crm-guide-art { display: block; width: 100%; height: 7rem; margin-bottom: .35rem; border-radius: .65rem; background: #f8f6f1; }
.crm-guide-step h3 { margin: .25rem 0; font-size: .94rem; }
.crm-guide-step p { margin: 0; font-size: .8rem; line-height: 1.7; }
.crm-workflow-guide .crm-guide-note { margin: 0; padding: .7rem .85rem; border-radius: .7rem; background: #f8f1e9; color: var(--ink); font-size: .82rem; }
#crm-workflow-guide-done { justify-self: start; min-width: 6rem; }
#live-crm-status-dialog .live-crm-form-grid { grid-template-columns: 1fr; }
#live-crm-status-dialog .live-crm-form-grid .span-2 { grid-column: auto; }
#live-crm-interaction-dialog .live-crm-form-grid { grid-template-columns: 1fr; }
#live-crm-interaction-dialog textarea { min-height: 7rem; }
.crm-dialog-company { margin: -.25rem 0 0; color: var(--muted); font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.span-2 { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: .6rem; }
.check-row input { min-height: auto; }
.hint { padding: .7rem; border-radius: .65rem; background: var(--gold-soft); }
.form-help { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.7; }
.metrics-group { flex-basis: 100%; margin: .7rem 0 0; font-size: .82rem; color: var(--muted); }
.error { color: var(--red) !important; font-weight: 700; }
.toast { position: fixed; z-index: 120; inset: auto 1rem 1rem auto; max-width: min(26rem, calc(100% - 2rem)); padding: .8rem 1rem; border-radius: .75rem; color: white; box-shadow: var(--shadow); }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .8rem 1rem; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
    .nav-group-label { display: none; }
    .safety-card { margin: 0 0 0 auto; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .research-workbench { grid-template-columns: 1fr; }
    .research-list { max-height: none; }
    .research-detail { display: none; }
    .research-detail { border-inline-start: 0; }
    #live-research.is-detail-open > .section-heading, #live-research.is-detail-open > .research-controls, #live-research.is-detail-open > .research-secondary { display: none; }
    #live-research.is-detail-open .research-queue { display: none; }
    #live-research.is-detail-open .research-detail { display: block; }
    .research-back-button { display: inline-flex; }
    .research-communication-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .sidebar { position: sticky; z-index: 40; top: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; height: auto; gap: .65rem; padding: .7rem .8rem; }
    .brand { grid-row: 1; grid-column: 1; }
    .brand small, .safety-card small { display: none; }
    .sidebar nav { grid-row: 2; grid-column: 1 / -1; width: 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .sidebar nav::-webkit-scrollbar { display: none; }
    .sidebar nav a { flex: 0 0 auto; padding: .58rem .8rem; text-align: center; white-space: nowrap; }
    .safety-card { grid-row: 1; grid-column: 2; width: auto; margin: 0; padding: .55rem .7rem; }
    .topbar, .section-heading { align-items: start; flex-direction: column; }
    .topbar { justify-content: flex-end; margin-bottom: 1rem; }
    .workspace-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .lock-badge { display: none; }
    #live-research .section-heading { align-items: stretch; flex-direction: column; gap: .6rem; }
    #live-research .section-description { display: none; }
    .top-actions { width: 100%; }
    .metrics, .today-grid, .crm-grid, .record-grid, .registry-grid, .portfolio-grid, .form-grid, .audit-filters, .autopilot-grid, .automation-steps { grid-template-columns: 1fr; }
    .today-focus { align-items: stretch; flex-direction: column; }
    .today-focus .button { width: 100%; text-align: center; }
    .pipeline { grid-template-columns: 1fr; }
    .pipeline-step { display: flex; justify-content: space-between; text-align: right; }
    .workspace { width: 100%; padding: 1rem; }
    .detail-panel { border-inline-start: 0; border-top: 1px solid var(--line); }
    .research-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .research-toolbar > .research-search-field { grid-column: 1 / -1; }
    .research-crm-summary { grid-template-columns: 1fr; }
    .research-crm-actions { justify-content: stretch; }
    .research-crm-actions .button { flex: 1 1 9rem; }
    .research-crm-action-area { position: sticky; z-index: 10; bottom: 0; justify-items: stretch; margin: .35rem -.2rem -.2rem; padding: .65rem .2rem calc(.25rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--surface) 78%, transparent); }
    .research-crm-action-area > small { text-align: center; }
    .crm-channel-row { grid-template-columns: auto minmax(0, 1fr); }
    .crm-channel-row small { grid-column: 1 / -1; text-align: start; }
    .crm-client-services-heading { align-items: start; flex-direction: column; }
    .crm-client-services-heading > small { max-width: none; text-align: start; }
    .crm-client-services-grid { grid-template-columns: 1fr; }
    .crm-client-service-status { min-height: 2.75rem; }
    .research-heading-actions { width: 100%; justify-content: space-between; }
    .research-heading-actions .button { flex: 1; padding: .55rem .45rem; font-size: .78rem; white-space: nowrap; min-height: 2.75rem; }
    .audit-toolbar { align-items: stretch; flex-direction: column; }
    .audit-toolbar > div .button { flex: 1; }
    .audit-card-head { align-items: flex-start; }
    .modal-card { padding: 1rem; }
}

@media (max-width: 430px) {
    .research-card-head .tag { width: fit-content; }
    .crm-primary-actions { gap: .3rem; }
    .crm-primary-actions .button { padding: .55rem .3rem; font-size: .78rem; }
    .crm-service-chips { gap: .4rem; }
    .crm-service-chip { padding: .4rem .65rem; font-size: .8rem; }
    .crm-conversation-row { grid-template-columns: minmax(4.2rem, 5rem) minmax(0, 1fr); gap: .45rem; }
    .crm-conversation-row time { font-size: .67rem; }
    .crm-conversation-bubble { padding: .65rem .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
.crm-website-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.crm-catalog-row { display: flex; align-items: end; gap: .5rem; flex-wrap: wrap; padding-block: .75rem; border-bottom: 1px solid var(--line); }
.crm-catalog-row > label, .crm-catalog-row > span { flex: 1 1 180px; min-width: 0; }
.crm-trash-detail { flex: 1 1 180px; min-width: 0; display: grid; gap: .25rem; }
.crm-trash-detail small { color: var(--muted); }
.crm-catalog-row input { width: 100%; }
.crm-delete-action { color: #a52c3b; margin-top: 1rem; }

/* Customer workspace: a scan-friendly grid and a focused detail drawer. */
#live-research .research-workbench { display: block; background: transparent; border: 0; overflow: visible; }
#live-research .research-queue { background: transparent; border: 0; box-shadow: none; overflow: visible; }
#live-research .research-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr)); gap: 1rem; max-height: none; overflow: visible; padding: 0; }
#live-research .research-list > .empty { grid-column: 1 / -1; }
.crm-quick-filters { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 1rem; }
.crm-quick-filters button, .crm-date-shortcuts button { border: 1px solid transparent; border-radius: 999px; background: transparent; padding: .55rem .8rem; color: var(--muted); min-height: 42px; font: inherit; cursor: pointer; }
.crm-quick-filters button[aria-pressed="true"] { background: #fff0e9; border-color: #ffbea6; color: #9c2a09; font-weight: 700; }
.crm-quick-filters [data-work][aria-pressed="true"] { background: #eaf6f0; border-color: #b7dbc9; color: #176347; }
.crm-quick-filter-divider { align-self: center; flex: none; width: 1px; height: 24px; margin-inline: .35rem; background: var(--line); }
#crm-outcome-help { display: block; margin-top: .3rem; }
#live-research .research-toolbar { display: grid; grid-template-columns: minmax(0,1fr) minmax(160px,200px) auto; gap: .65rem; align-items: end; padding: 0; border: 0; background: transparent; }
#live-research .research-search-field { width: 100%; max-width: none; }
.crm-filter-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .65rem; }
.crm-filter-footer { grid-column: 1 / -1; display: flex; gap: .65rem; }
.crm-filter-footer > label { width: 200px; min-width: 0; }
.crm-filter-fields > label { min-width: 0; }
.crm-expanded-filters { grid-column: 1 / -1; padding-block: .8rem .3rem; border-top: 1px solid var(--line); }
.crm-expanded-filters .crm-filter-fields { grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
.crm-expanded-filters .crm-filter-footer { margin-top: .65rem; }
.crm-active-filters { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.crm-active-filters > span { overflow-wrap: anywhere; }
.crm-active-filters button { min-height: 36px; flex-shrink: 0; }
.crm-customer-card { min-width: 0; display: flex; flex-direction: column; gap: .75rem; padding: 1rem; border: 1px solid #e5e0d7; border-radius: 1rem; background: white; text-align: start; }
.crm-customer-card.is-new { background: #fff8f3; border-color: #f0c5ac; border-inline-start: 3px solid var(--brand); }
.crm-customer-card.is-landing-new { background: #f4faf7; border-color: #a7d5bd; border-inline-start: 3px solid #25885f; }
.crm-form-label { color: #146347; font-size: .72rem; font-weight: 700; }
.crm-inbound-wait { display: flex; flex-wrap: wrap; gap: .15rem .5rem; color: #146347; font-size: .75rem; line-height: 1.65; overflow-wrap: anywhere; }
.crm-inbound-wait time { font-weight: 700; }
.crm-inbound-wait span { color: #67615b; }
.crm-form-review-item { display: grid; gap: .45rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.crm-form-review-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-form-review-item small { color: var(--muted); }
.crm-form-review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.crm-customer-card.is-active { outline: 2px solid #dfbaa6; outline-offset: 2px; }
.crm-card-title { border: 0; background: transparent; padding: 0; text-align: start; font: inherit; font-size: 1.05rem; font-weight: 800; cursor: pointer; color: #202020; overflow-wrap: anywhere; }
.crm-card-title:hover { color: #b43711; }
.crm-new-label { flex: none; color: #a33b13; font-size: .72rem; font-weight: 700; }
.crm-customer-card .research-list-head { display: flex; align-items: start; justify-content: space-between; gap: .5rem; }
.crm-customer-card .crm-website-link { font-size: .8rem; align-self: start; color: #666; max-width: 100%; overflow-wrap: anywhere; }
.crm-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .78rem; }
.crm-card-status { color: #6c645c; }
.crm-card-owner { color: #67615b; font: inherit; background: transparent; border: 0; border-bottom: 1px dotted #b6ada3; padding: .2rem; cursor: pointer; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-card-claim { color: #fff; background: var(--brand); border: 0; border-radius: .5rem; padding: .25rem .6rem; font-weight: 700; }
.crm-card-last { color: #666; margin: .1rem 0; font-size: .88rem; line-height: 1.7; min-height: 1.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crm-card-last.is-expanded { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-inline-action { border: 0; padding: .15rem 0; background: transparent; color: #9c2a09; font: inherit; font-size: .78rem; cursor: pointer; text-decoration: underline; text-underline-offset: .2rem; }
.crm-inline-action:disabled { opacity: .55; cursor: wait; }
.crm-card-contact .crm-inline-action { margin-top: .2rem; }
.crm-defer-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.crm-offered-services { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .45rem; color: #615b53; font-size: .78rem; }
.crm-offered-services span { border: 1px solid #e8ded0; border-radius: 999px; padding: .2rem .6rem; background: #fffaf4; }
.crm-card-contact { border-block: 1px solid #f0ede7; padding: .6rem 0; }
.crm-card-contact-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem; color: #70685f; margin-bottom: .25rem; }
.crm-card-contact-heading time { font-size: .72rem; }
.crm-card-shortcuts { display: flex; gap: 1rem; }
.crm-card-shortcuts button { min-height: 36px; border: 0; background: transparent; padding: .2rem 0; color: #9c2a09; font: inherit; font-size: .82rem; cursor: pointer; }
.crm-card-shortcuts button:hover { text-decoration: underline; }
.crm-customer-brief { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.research-card-head > div { flex: 1; min-width: 0; }
.research-card-head .crm-customer-brief { font-size: .9rem; margin: .4rem 0; color: #655e56; }
.crm-add-profile { border: 0; padding: .4rem 0; background: transparent; font: inherit; font-size: .8rem; color: #777; cursor: pointer; }
.crm-heading-channels .research-disclosure-body { padding: 0; }
.crm-heading-channels .crm-contact-item { border: 0; padding: 0; }
.crm-heading-channels .crm-contact-heading { font-size: .75rem; }
.crm-heading-channels .crm-contact-item:first-child .crm-contact-heading { display: none; }
.crm-heading-channels .crm-channel-icons { padding: .2rem 0; }
.crm-previous-records { display: grid; gap: .75rem; }
.crm-previous-record { background: #f7f6f3; }
.crm-previous-record > small { color: #817b71; }
.crm-history-original > summary { cursor: pointer; color: #777; font-size: .8rem; }
.crm-work-add { margin-top: .8rem; }
.crm-work-details > summary { color: #655e56; font-size: .85rem; }
.crm-channel-icons { display: flex; flex-wrap: wrap; gap: .5rem; padding: .5rem 0; }
.crm-channel-icon { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: #176c4c; background: #fff; font-size: 1.25rem; cursor: pointer; }
.crm-channel-icon.is-archived { opacity: .5; }
.crm-channel-icon img { display: block; margin: auto; }
.crm-channel-add { border-style: dashed; color: #655e56; }
.crm-channel-icon:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.crm-channel-value { overflow-wrap: anywhere; user-select: all; }
#live-crm-editor-fields > label, #live-crm-status-form .form-grid > label { min-width: 0; }
#live-crm-editor-fields input, #live-crm-editor-fields select, #live-crm-status-form input { min-width: 0; width: 100%; }
#live-crm-editor-fields:has(select[name="type"]) > label { grid-column: 1 / -1; }
#live-crm-editor-fields > label:has(textarea) { grid-column: 1 / -1; }
#crm-admin-content > button.today-action-link { background: none; border: 0; padding: .35rem 0; cursor: pointer; }
.crm-card-service-list { display: flex; gap: .35rem; flex-wrap: wrap; min-height: 1.5rem; }
.crm-card-service { font: inherit; font-size: .72rem; background: #f1f1ef; border: 1px solid #deded9; border-radius: .5rem; color: #636363; padding: .35rem .5rem; min-height: 36px; cursor: pointer; }
.crm-card-service[data-status="ACTIVE"] { background: #e6f3e9; color: #196440; }
.crm-card-service[data-status="DECLINED"] { background: #ffebec; border-color: #e9afb5; color: #a21c2a; }
.crm-card-service:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
#live-research > #live-crm-pager { display: flex; justify-content: center; padding: 1.25rem 0; }
#live-crm-pager .button { border: 1px solid var(--line); background: white; padding-inline: 2.5rem; }
.crm-incoming-choice { display: flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 400; margin-top: .5rem; }
.crm-incoming-choice input { width: 1rem; min-height: 1rem; margin: 0; }
.crm-card-service-empty { color: #92908a; font-size: .75rem; }
.crm-card-opportunity { color: #885729; }
.crm-card-due { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem .5rem; margin-top: auto; padding-top: .4rem; color: #756d65; font-size: .78rem; }
.crm-card-due-countdown { font-size: inherit; white-space: nowrap; }
.crm-card-due.is-overdue { color: #a6372e; }
.crm-card-due.is-due-today { color: #916600; font-weight: 700; }
.crm-card-due.is-deferred { color: #526778; }
.crm-customer-card.is-contacted-today { border-inline-start: 3px solid #439779; background: linear-gradient(135deg, #f3faf7, #fff 65%); }
.crm-contact-done { color: #196947; font-weight: 700; }
.crm-importance { flex: none; border: 0; border-radius: .6rem; background: transparent; color: #756d65; font-size: 1.5rem; line-height: 1; min-width: 44px; min-height: 44px; padding: .4rem; cursor: pointer; }
.crm-importance[aria-pressed="true"] { color: #a56b00; }
.crm-importance:hover { background: #faf3e2; }
.crm-importance:focus-visible { outline: 2px solid #a56b00; outline-offset: 2px; }
.crm-importance:disabled { cursor: default; }
.crm-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; padding-top: .4rem; }
.crm-card-actions .button { min-height: 44px; padding: .55rem .45rem; font-size: .8rem; }
.crm-whatsapp-split { display: flex; align-items: stretch; min-width: 0; background: #176c4c; border: 1px solid #176c4c; border-radius: .65rem; overflow: hidden; }
.crm-whatsapp-split .crm-whatsapp-button { border: 0; border-radius: 0; flex: 1; min-width: 0; margin: 0; background: transparent; color: white; }
.crm-copy-number { flex: 0 0 42px; width: 42px; min-height: 44px; border: 0; border-inline-start: 1px solid #ffffff40; background: transparent; color: white; font-size: 1.4rem; cursor: pointer; }
.crm-copy-number:hover { background: #ffffff19; }
.crm-copy-number:disabled { opacity: .4; cursor: default; }
.crm-detail-drawer { position: fixed; inset: 0 auto 0 0; width: min(760px, 95vw); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; padding: 0; background: white; box-shadow: 6px 0 36px #0002; overflow-y: auto; }
.crm-detail-drawer::backdrop { background: #25252166; }
html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; }
body:has(dialog.modal[open]) .crm-detail-drawer { overflow: hidden; }
dialog.modal { max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
.crm-form-error { padding: .7rem; margin: .5rem 0; border-inline-start: 3px solid #8f303b; background: #fff2f3; color: #842634; line-height: 1.7; }
.crm-contact-decision { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; font-size: .85rem; color: var(--muted); padding-block: .75rem; }
.crm-detail-drawer .research-detail { display: block !important; border: 0; padding: 1.35rem; max-height: none; overflow: visible; }
.crm-detail-drawer .research-back-button { display: inline-flex; margin-bottom: 1rem; }
.crm-detail-drawer .research-card-head { margin-bottom: .5rem; }
.crm-detail-drawer .crm-primary-actions { grid-template-columns: 1fr 1fr 1fr; }
.crm-detail-drawer .crm-service-chip { font-size: .78rem; padding: .4rem .65rem; }
.crm-detail-drawer .crm-service-chips { padding-block: .3rem; }
.crm-archive-notes { padding: .6rem 0; font-size: .85rem; color: #777; }
.crm-archive-notes > summary { cursor: pointer; }
.crm-archive-notes .crm-conversation-bubble { margin-top: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-service-overview { width: 100%; text-align: start; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem; border: 0; border-bottom: 1px solid #eee; background: transparent; padding: 1rem .25rem; color: #666; font: inherit; cursor: pointer; }
.crm-service-overview[data-status="ACTIVE"] strong, .crm-active-period, .crm-service-state[data-status="ACTIVE"] { color: #176c4c; }
.crm-service-overview[data-status="DECLINED"] strong { color: #a6372e; }
.crm-service-overview span { font-size: .78rem; }
.crm-service-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.crm-service-heading select { width: auto; }
.crm-service-timeline { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin: 1rem 0; direction: ltr; }
.crm-service-month { display: grid; text-align: center; font-size: .7rem; gap: .4rem; color: #777; }
.crm-month-mark { background: #f0f0ed; color: #aaa; border-radius: 4px; min-height: 2rem; display: grid; place-items: center; }
.crm-service-month.is-covered .crm-month-mark { background: #cce8d4; color: #176c4c; }
.crm-period-row { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; padding: .5rem 0; border-bottom: 1px solid #eee; }
.crm-date-shortcuts { display: flex; gap: .2rem; flex-wrap: wrap; }
.crm-shortcut-editor { display: grid; gap: 1rem; }
.crm-shortcut-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .6rem; align-items: end; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.crm-shortcut-row > * { min-width: 0; }
.crm-shortcut-row input { width: 100%; }
.crm-platform-guide { display: grid; gap: 1.25rem; }
.crm-platform-guide h3 { margin: 0 0 .35rem; font-size: 1rem; }
.crm-platform-guide p, .crm-guide-intro { margin: 0; line-height: 1.9; color: var(--muted); }
.crm-guide-intro { padding-bottom: 1rem; }
@media (max-width: 600px) { .crm-shortcut-row { grid-template-columns: 1fr 1fr; } .crm-shortcut-row > :first-child { grid-column: 1 / -1; } }
.crm-date-shortcuts button { padding: .25rem .65rem; color: #706352; background: #f6f4f0; font-size: .8rem; }
#live-crm-prospect-form .form-grid > label { min-width: 0; }
#live-crm-prospect-form .form-grid input, #live-crm-prospect-form .form-grid select, #live-crm-prospect-form .form-grid textarea { width: 100%; min-width: 0; }
#crm-duplicate-suggestions { padding: .8rem; background: #fff4dd; border-radius: .7rem; }
.crm-duplicate-heading { margin: 0 0 .5rem; }
.crm-duplicate-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding-block: .45rem; }
.crm-duplicate-identity { min-width: 0; display: grid; gap: .2rem; overflow-wrap: anywhere; }
.crm-duplicate-identity small { color: var(--muted, #666); }
.crm-duplicate-row .button { flex-shrink: 0; padding: .45rem .65rem; }
.crm-distinct-check { display: flex; align-items: center; gap: .5rem; margin-block-start: .6rem; }
.crm-distinct-check input { width: auto; }
@media (max-width: 820px) {
    #live-research .research-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); }
    #live-research .research-toolbar > .research-search-field { grid-column: 1 / -1; width: 100%; max-width: none; }
    #live-research.is-detail-open > .section-heading, #live-research.is-detail-open > .research-controls, #live-research.is-detail-open > .research-secondary { display: block; }
    #live-research.is-detail-open .research-queue { display: block; }
    .crm-detail-drawer { width: 100%; }
    .crm-detail-drawer .research-detail { padding: 1rem; }
    .crm-quick-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .crm-quick-filters button { flex: none; white-space: nowrap; padding-inline: .65rem; font-size: .8rem; }
    .crm-filter-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .crm-filter-footer > label { flex: 1; }
}

/* A shared, bottom-to-top service history beside the conversation. */
.crm-history-layout { display: grid; grid-template-columns: minmax(205px, 29%) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-block: 1rem; }
.crm-history-layout > * { min-width: 0; }
.crm-history-layout .crm-conversation { margin: 0; border-top: 0; padding-top: 0; }
.crm-sales-timeline { border-inline-end: 1px solid var(--border, #e5e0d6); padding-inline-end: 1rem; }
.crm-timeline-heading, .crm-period-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.crm-timeline-heading h4, .crm-period-heading h4 { margin: 0; }
.crm-timeline-heading select { width: auto; padding: .25rem; font-size: .75rem; }
.crm-timeline-add, .crm-period-action { border: 0; background: transparent; color: #ac3009; cursor: pointer; padding: .5rem .15rem; font: inherit; font-size: .8rem; }
.crm-sales-months { list-style: none; margin: .6rem 0 0; padding: 0; }
.crm-sales-month { position: relative; display: grid; grid-template-columns: 2.8rem minmax(0, 1fr); gap: .35rem; min-height: 2.6rem; padding: .35rem .65rem .35rem 0; border-inline-start: 2px solid #e9e6df; }
.crm-sales-month::before { content: ''; position: absolute; inset-inline-start: -4px; top: .75rem; width: 6px; height: 6px; border-radius: 50%; background: #d0ccc3; }
.crm-sales-month.is-recurring { border-inline-start-color: #20825e; }
.crm-sales-month.is-recurring::before { background: #20825e; }
.crm-sales-month time { color: #77766f; font-size: .72rem; padding-top: .2rem; white-space: nowrap; }
.crm-sales-labels { display: flex; flex-wrap: wrap; gap: .25rem; align-content: start; }
.crm-sales-label { border: 0; border-radius: .25rem; padding: .2rem .35rem; font: inherit; font-size: .7rem; cursor: pointer; overflow-wrap: anywhere; background: #e8f5ed; color: #176746; }
.crm-sales-label.is-one_time { background: #f2ebff; color: #694199; }
.crm-sales-label.is-accounting, .crm-service-chip[data-status="HISTORICAL"] { background: #eaf1fc; color: #28588e; border-color: #aec7e4; }
.crm-accounting-entry { padding-block: .7rem; border-bottom: 1px solid var(--line); }
.crm-accounting-entry strong { margin-inline-end: .65rem; }
.crm-accounting-entry p { margin-block: .4rem; white-space: pre-wrap; }
.crm-accounting-entry small { color: var(--muted); }
.crm-sales-timeline > .form-help { display: block; margin-block: .4rem; line-height: 1.5; }
.crm-service-chip[data-status="STOPPED"], .crm-service-state[data-status="STOPPED"] { color: #925f18; background: #fff2d9; border-color: #dfb36a; border-style: solid; }
.crm-service-chip[data-status="COMPLETED"], .crm-service-state[data-status="COMPLETED"] { color: #694199; background: #f2ebff; border-color: #cbb5e7; border-style: solid; }
.crm-service-state-form { display: grid; gap: .65rem; padding-block-end: 1rem; }
.crm-period-heading { margin-block: 1rem .5rem; }
.crm-period-row { gap: .65rem; flex-wrap: wrap; font-size: .85rem; }
.crm-extra-actions { margin-top: 1rem; color: #67645e; font-size: .85rem; }
.crm-extra-actions > summary { cursor: pointer; padding-block: .6rem; }
.crm-extra-actions .crm-work-add { margin-block: .75rem; }
.nav-secondary { margin-top: 1rem; font-size: .85rem; }
.nav-secondary > summary { cursor: pointer; padding: .75rem 1rem; color: #d0cdc6; }
.sidebar nav .nav-secondary a { display: block; margin-top: .25rem; }
.customer-summary { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; padding-block: .75rem 1.5rem; }
.customer-summary > span { display: flex; gap: .6rem; align-items: baseline; }
.customer-summary strong { font-size: 1.8rem; line-height: 1; }
.customer-summary .soon { color: #885700; }
.customer-summary .overdue { color: #a62d34; }
.renewal-board { padding-block: 1rem; margin-bottom: 1.5rem; border-block: 1px solid var(--line); }
.renewal-board h3 { margin: 0 0 .25rem; }
.subscription-views { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--line); margin-block: .25rem 1rem; }
.subscription-views button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: .8rem .15rem; font: inherit; cursor: pointer; }
.subscription-views button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent, #ff3d00); font-weight: 700; }
.subscription-history { min-width: 0; margin-block: 1rem 2rem; }
.subscription-range { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; }
.subscription-range label { display: grid; gap: .3rem; font-size: .8rem; color: var(--muted); }
.subscription-range input, .subscription-range select { min-height: 42px; max-width: 100%; }
.subscription-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .75rem; margin-block: 1.25rem .5rem; }
.subscription-legend .period { color: #16734e; }
.subscription-legend .cycle { color: #547c67; }
.subscription-legend .accounting { color: #286f9b; }
.subscription-count { color: var(--muted); font-size: .8rem; }
.subscription-scroll { max-width: 100%; max-height: 65vh; overflow: auto; border-block: 1px solid var(--line); isolation: isolate; }
.subscription-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .75rem; }
.subscription-table th, .subscription-table td { padding: .65rem 0; min-width: 4.25rem; text-align: center; vertical-align: middle; }
.subscription-table thead th { position: sticky; top: 0; z-index: 2; font-weight: 400; color: var(--muted); padding: .8rem .35rem; white-space: nowrap; border-bottom: 1px solid var(--line); background: #faf9f5; }
.subscription-table .subscription-identity, .subscription-table thead th:first-child { position: sticky; inset-inline-start: 0; z-index: 1; min-width: 170px; max-width: 210px; text-align: start; background: #faf9f5; padding-inline: .8rem; border-inline-end: 1px solid var(--line); }
.subscription-table thead th:first-child { z-index: 3; }
.subscription-identity button { display: block; border: 0; background: none; font-family: inherit; color: var(--ink); font-weight: 700; text-align: start; padding: .35rem 0; font-size: .9rem; overflow-wrap: anywhere; cursor: pointer; }
.subscription-identity button:hover { color: var(--brand-dark); text-decoration: underline; }
.subscription-identity > span:not(.sr-only) { display: block; color: var(--muted); font-weight: 400; padding-block: .1rem; }
.subscription-table tr.subscription-customer-start:not(:first-child) > * { border-top: 1px solid var(--line); }
.subscription-table .is-this-month { background: #ecf3ee; }
.subscription-table td { background-image: linear-gradient(to left, transparent calc(100% - 1px), #eeeae3 1px); }
.subscription-mark { position: relative; display: block; height: 10px; margin-inline: 12px; border-radius: 8px; }
.subscription-mark.period { background: #21815b; }
.subscription-mark.cycle { background: #bad5c5; border: 1px solid #719781; }
.subscription-mark.accounting { background: #286f9b; }
.subscription-mark.join-before { margin-inline-start: 0; border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start: 0; }
.subscription-mark.join-after { margin-inline-end: 0; border-start-end-radius: 0; border-end-end-radius: 0; border-inline-end: 0; }
.subscription-mark.has-accounting::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #286f9b; outline: 2px solid #fff; inset-inline-start: calc(50% - 4px); top: 1px; }
.subscription-mark.accounting.has-accounting::after { display: none; }
.subscription-review { font-size: .8rem; margin-top: 1.25rem; color: var(--muted); }
.subscription-review summary { cursor: pointer; padding-block: .5rem; }
.subscription-review > button { display: block; margin-block: .4rem; text-align: start; }
@media (max-width: 600px) {
    .subscription-range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .subscription-range label:first-child { grid-column: 1 / -1; }
    .subscription-range button { grid-column: 1 / -1; }
    .subscription-range label { min-width: 0; }
    .subscription-range input { width: 100%; min-width: 0; box-sizing: border-box; }
    .subscription-table .subscription-identity, .subscription-table thead th:first-child { min-width: 116px; max-width: 140px; }
    .subscription-identity button { font-size: .8rem; }
    .subscription-legend { gap: .65rem; font-size: .7rem; }
}
.renewal-board .section-heading { margin-bottom: .6rem; }
#salla-store-summary { gap: .6rem 1.2rem; align-items: center; padding-block: .45rem 1rem; }
#salla-store-summary > span { gap: .35rem; }
#salla-store-summary strong { font-size: 1.1rem; }
.salla-store-total { margin-inline-start: auto; color: var(--muted); font-size: .78rem; }
#salla-store-list { max-width: 100%; max-height: 65vh; overflow: auto; border: 1px solid var(--line); border-radius: .6rem; }
.salla-store-table { width: 100%; min-width: 690px; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.salla-store-table th, .salla-store-table td { text-align: start; vertical-align: middle; padding: .55rem .75rem; border-bottom: 1px solid var(--line); }
.salla-store-table thead th { position: sticky; top: 0; z-index: 1; background: #f5f3ef; font-weight: 700; white-space: nowrap; }
.salla-store-table thead th:first-child { min-width: 180px; }
.salla-store-table thead th:nth-child(4) { min-width: 160px; }
.salla-store-table thead th > span, .salla-store-table thead th > button { display: block; margin-bottom: .35rem; }
.salla-store-table thead input, .salla-store-table thead select { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; font-weight: 400; }
.salla-store-sort { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.salla-store-sort[aria-pressed="true"] { color: var(--brand-dark); text-decoration: underline; text-underline-offset: .25em; }
.salla-store-table tbody tr { --salla-tone: #386d55; }
.salla-store-table tbody tr:nth-child(even) { background: #faf9f6; }
.salla-store-table tbody tr.soon { --salla-tone: #a06b09; background: #fffaf0; }
.salla-store-table tbody tr.overdue { --salla-tone: #a62d34; }
.salla-store-table tbody tr.paused { --salla-tone: #888; }
.salla-store-table tbody tr > :first-child { border-inline-start: 3px solid var(--salla-tone); }
.salla-store-table tbody th a, .salla-store-table tbody th strong { color: var(--ink); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.salla-store-table tbody th a:hover { text-decoration: underline; }
.salla-store-table time { white-space: nowrap; }
.salla-store-muted { color: var(--muted); font-size: .78rem; }
.salla-store-progress { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.salla-store-progress progress { flex: 1; min-width: 60px; height: 7px; border: 0; border-radius: 10px; overflow: hidden; background: #e6e4de; accent-color: var(--salla-tone); }
.salla-store-progress progress::-webkit-progress-bar { background: #e6e4de; border-radius: 10px; }
.salla-store-progress progress::-webkit-progress-value { background: var(--salla-tone); border-radius: 10px; }
.salla-store-progress strong { min-width: 5.2rem; color: var(--salla-tone); font-size: .8rem; white-space: nowrap; }
.salla-store-edit { padding: .35rem .65rem; font-size: .78rem; }
@media (max-width: 600px) {
    .salla-store-table { min-width: 670px; }
    .salla-store-table th, .salla-store-table td { padding: .5rem; }
    .salla-store-total { flex-basis: 100%; margin-inline-start: 0; }
}
.renewal-service-filter { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.renewal-service-filter select { width: auto; max-width: 260px; min-width: 145px; }
.renewal-customer { padding: .9rem 0 .65rem; border-bottom: 1px solid var(--line); }
.renewal-customer-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-bottom: .15rem; }
.renewal-customer-heading h4 { margin: 0; min-width: 0; max-width: 100%; font-size: 1.06rem; }
.renewal-client-open { display: inline-flex; align-items: center; gap: .55rem; min-height: 40px; max-width: 100%; padding: .25rem 0; border: 0; border-radius: .35rem; box-shadow: none; background: transparent; color: var(--charcoal); font: inherit; font-weight: 700; line-height: 1.5; cursor: pointer; text-align: start; text-decoration: none; }
.renewal-client-open > span:first-child { overflow-wrap: anywhere; }
.renewal-client-arrow { color: #8c8880; font-family: system-ui, sans-serif; font-size: 1.15rem; font-weight: 400; line-height: 1; }
.renewal-client-open:hover, .renewal-client-open:hover .renewal-client-arrow { color: var(--brand-dark); }
.renewal-client-open:focus-visible { outline: 2px solid var(--brand-secondary); outline-offset: 4px; }
.renewal-customer-heading small { color: var(--muted); font-size: .75rem; }
.renewal-customer .renewal-row { padding: .7rem 0; border-bottom: 0; gap: 1rem; }
.renewal-identity strong { font-size: .91rem; font-weight: 600; color: #514d48; }
.crm-sales-label.is-cycle { color: #22684b; background: #e3f1e9; border-color: #c6dfd0; }
.renewal-row { --renewal-color: #217552; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.5fr) auto; gap: 1.5rem; align-items: center; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.renewal-row.soon { --renewal-color: #a06b09; }
.renewal-row.overdue { --renewal-color: #b13d49; }
.renewal-row.paused { --renewal-color: #777; }
.renewal-row.planned { --renewal-color: #547b9a; }
.renewal-identity { display: grid; gap: .2rem; min-width: 0; overflow-wrap: anywhere; }
.renewal-identity > button { justify-self: start; text-align: start; border: 0; padding: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.renewal-identity small, .renewal-dates { color: var(--muted); font-size: .75rem; }
.renewal-time { display: grid; gap: .45rem; min-width: 0; }
.renewal-time strong { color: var(--renewal-color); font-size: .85rem; }
.renewal-time progress { width: 100%; height: 7px; border: 0; border-radius: 10px; overflow: hidden; background: #e6e4de; accent-color: var(--renewal-color); }
.renewal-time progress::-webkit-progress-bar { background: #e6e4de; border-radius: 10px; }
.renewal-time progress::-webkit-progress-value { background: var(--renewal-color); border-radius: 10px; }
.renewal-dates { display: flex; justify-content: space-between; gap: .5rem; }
.renewal-actions { margin: 0; }
.renewal-actions .button { padding: .45rem .65rem; font-size: .8rem; }
.renewal-customer-results, .crm-renewal-compact { display: grid; gap: .5rem; }
.crm-renewal-compact > div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-block: .6rem; border-bottom: 1px solid var(--line); }
.automation-work-queue { padding-block: 0 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.automation-work-queue h3 { margin-block: 0 .5rem; }
.automation-work-queue p { color: var(--muted); }
.automation-path { display: flex; list-style: none; padding: 0; gap: .5rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.automation-path li:not(:last-child)::after { content: ' ←'; margin-inline-start: .5rem; }
@media (max-width: 800px) {
    .audit-search { grid-column: auto; }
    .audit-filters > label { min-width: 0; }
    .sidebar nav { align-items: start; }
    .nav-secondary { flex: 0 0 auto; margin-top: 0; }
    .renewal-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; }
    .renewal-actions { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .customer-summary { gap: 1rem; justify-content: space-between; font-size: .75rem; }
    .customer-summary > span { flex-direction: column; gap: .4rem; }
    .customer-summary strong { font-size: 1.4rem; }
    .renewal-row { grid-template-columns: minmax(0, 1fr); }
    .renewal-board .section-heading { align-items: start; gap: .5rem; }
    .renewal-service-filter { flex-wrap: wrap; max-width: 100%; }
    .renewal-service-filter select { max-width: 100%; }
}
@media (max-width: 600px) {
    .crm-history-layout { grid-template-columns: minmax(108px, 31%) minmax(0, 1fr); gap: .65rem; }
    .crm-history-layout.has-form-request { grid-template-columns: minmax(0, 1fr); }
    .crm-history-layout.has-form-request > .crm-conversation { order: -1; }
    .crm-sales-timeline { padding-inline-end: .5rem; }
    .crm-timeline-heading { flex-wrap: wrap; }
    .crm-sales-month { grid-template-columns: minmax(0, 1fr); gap: .1rem; padding-inline-start: .5rem; }
    .crm-sales-label { font-size: .65rem; }
    .crm-history-layout .crm-conversation-heading { flex-wrap: wrap; gap: .4rem; }
    .crm-history-layout .crm-conversation-row { grid-template-columns: minmax(0, 1fr); }
    .crm-history-layout .crm-conversation-bubble { padding: .65rem; overflow-wrap: anywhere; }
}

/* Daily work comes first; occasional actions remain one step away. */
.topbar { gap: 1.5rem; margin-bottom: 1.6rem; }
.workspace-heading { flex: 1; min-width: 0; }
.workspace-heading h1 { font-size: clamp(1.15rem, 2vw, 1.6rem); white-space: nowrap; margin: 0; }
.top-actions { flex-wrap: nowrap; flex-shrink: 0; gap: .5rem; }
.top-actions > .button, .account-toggle { min-height: 44px; font-size: .86rem; }
.top-actions .brief-bell { position: relative; width: 44px; justify-content: center; padding: .6rem; }
.top-actions .brief-bell i { position: absolute; inset: 8px 8px auto auto; }
.account-toggle { display: flex; align-items: center; gap: .6rem; max-width: 190px; }
#session-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-actions-menu-panel { width: 240px; max-width: calc(100vw - 32px); padding: .6rem; }
.top-actions-menu-panel .button { text-align: start; border: 0; background: transparent; padding: .65rem; min-height: 42px; }
.top-actions-menu-panel .button:hover { background: var(--surface-soft); }
.account-description { display: block; font-size: .75rem; color: var(--muted); padding: .45rem .65rem .8rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.account-technical { border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.account-technical > summary { cursor: pointer; padding: .7rem .6rem; }
.account-technical > small { display: block; padding: .45rem .6rem; }
.more-actions { font-size: 1.35rem; min-width: 44px; min-height: 44px; padding: .25rem .65rem; list-style: none; }
.crm-customer-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem; }
.crm-daily-actions, .crm-record-actions { display: flex; align-items: stretch; gap: .5rem; min-width: 0; }
.crm-daily-actions { flex: 1 1 260px; }
.crm-daily-actions > * { flex: 1; min-width: 0; }
.crm-record-actions .button { font-size: .78rem; padding: .6rem .7rem; }
.crm-customer-actions .button { min-height: 44px; }
.crm-daily-actions .button { padding: .6rem .7rem; white-space: nowrap; }
.crm-record-actions .crm-owner-button { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-record-actions { flex-wrap: wrap; }
.top-actions-menu summary:focus-visible, .crm-customer-actions button:focus-visible, #crm-filter-toggle:focus-visible, .nav-secondary summary:focus-visible { outline: 2px solid var(--success); outline-offset: 3px; }
.nav-secondary .nav-secondary { margin-top: .2rem; }
.nav-panel-close { display: none; }
.nav-secondary.has-active-page > summary { color: white; font-weight: 700; }
@media (max-width: 800px) {
    .sidebar nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); overflow: visible; align-items: stretch; }
    .sidebar nav > a, #secondary-tools-nav > summary { display: flex; justify-content: center; align-items: center; min-height: 44px; padding: .4rem .3rem; font-size: .75rem; line-height: 1.5; white-space: normal; text-align: center; }
    #secondary-tools-nav > summary { height: 100%; }
    #secondary-tools-nav .secondary-tools-panel { position: fixed; inset: auto 12px 12px; z-index: 50; max-height: 65dvh; overflow-y: auto; padding: .7rem; border: 1px solid #625f59; border-radius: 1rem; background: var(--charcoal); box-shadow: 0 8px 40px #0005; }
    .nav-panel-close { display: block; margin-inline-start: auto; min-height: 44px; padding: .5rem .8rem; border: 0; background: transparent; color: white; font: inherit; cursor: pointer; }
}
@media (max-width: 820px) {
    .topbar { margin-bottom: 1rem; }
    .top-actions { justify-content: flex-end; }
    .account-toggle { max-width: 150px; }
    #live-research .section-heading { flex-direction: row; align-items: center; }
    #live-research .section-heading h2 { font-size: 1.08rem; margin: 0; }
    .crm-guide-steps { grid-template-columns: 1fr; }
    .crm-guide-step { display: grid; grid-template-columns: 6.8rem minmax(0, 1fr); column-gap: .8rem; align-items: center; }
    .crm-guide-art { grid-row: span 2; height: 5.5rem; margin: 0; }
    .research-heading-actions { width: auto; flex-wrap: nowrap; }
    #live-research .research-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
    #live-research .research-search-field { grid-column: 1 / -1; }
    .crm-expanded-filters .crm-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crm-customer-actions { align-items: stretch; }
    .crm-daily-actions, .crm-record-actions { width: 100%; }
    .crm-record-actions .button { flex: 1; max-width: none; }
}
@media (max-width: 360px) {
    #live-research .section-heading { flex-wrap: wrap; }
    .crm-guide-step { grid-template-columns: 1fr; }
    .crm-guide-art { grid-row: auto; height: 5rem; margin-bottom: .3rem; }
    .crm-expanded-filters .crm-filter-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Offered services belong to a contact, not to a sale. Native checkboxes support touch/keyboard. */
#crm-offered-service-field { display: block; min-width: 0; margin: 0; padding: 0; border: 0; }
#crm-offered-service-field legend { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.crm-offered-services legend { margin-bottom: .65rem; font-size: .875rem; font-weight: 600; }
.crm-service-disclosure { position: relative; }
.crm-service-disclosure summary { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .7rem; border: 1px solid #e7e4de; border-radius: 999px; background: #fff; cursor: pointer; font-size: .8rem; list-style: none; }
.crm-service-disclosure summary::-webkit-details-marker { display: none; }
.crm-service-disclosure summary:focus-visible { outline: 2px solid #a83511; outline-offset: 2px; }
.crm-service-disclosure summary span { border: 0; padding: 0; background: none; }
.crm-service-disclosure .crm-service-selection-count:not(:empty) { min-width: 1.25rem; padding: .1rem .3rem; border-radius: 999px; background: #fff0e7; color: #92380f; text-align: center; }
.crm-service-popover { position: absolute; inset-inline: 0; bottom: calc(100% + .5rem); z-index: 8; padding: .65rem; border: 1px solid #eee9e1; border-radius: .8rem; background: #fff; box-shadow: 0 8px 28px #27201a20; }
.crm-service-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr)); gap: .65rem .35rem; max-height: min(17rem, 40vh); overflow-y: auto; overflow-x: hidden; padding: .25rem; scrollbar-width: thin; }
.crm-service-picker .crm-service-group-heading, .crm-service-picker .crm-service-divider { grid-column: 1 / -1; margin: 0; font-size: .75rem; font-weight: 600; line-height: 1.4; color: #514b45; }
.crm-service-picker .crm-service-divider { margin-top: .2rem; padding-top: .7rem; border-top: 1px solid #e8e4de; color: #6b645e; }
.crm-service-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 0; cursor: pointer; }
.crm-service-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.crm-service-choice { --service-fill: #eaf1ff; --service-border: #c7d8f8; --service-ink: #24518b; }
.crm-service-choice[data-tone="snapchat"] { --service-fill: #fff8bd; --service-border: #eddb66; --service-ink: #222; }
.crm-service-choice[data-tone="tiktok"] { --service-fill: #dbf8f3; --service-border: #9cdcd1; --service-ink: #145e53; }
.crm-service-choice[data-tone="google"] { --service-fill: #e6efff; --service-border: #b6cef5; --service-ink: #245baa; }
.crm-service-choice[data-tone="maps"] { --service-fill: #e3f4e9; --service-border: #a8d7b8; --service-ink: #246342; }
.crm-service-choice[data-tone="social"] { --service-fill: #ffe7ef; --service-border: #f0b5ca; --service-ink: #a62962; }
.crm-service-choice[data-tone="ink"] { --service-fill: #ebecef; --service-border: #c9cbd2; --service-ink: #333841; }
.crm-service-choice[data-tone="seo"] { --service-fill: #eee7ff; --service-border: #cebbf3; --service-ink: #6336a2; }
.crm-service-choice[data-tone="design"] { --service-fill: #ffe9de; --service-border: #f2c2a9; --service-ink: #984322; }
.crm-service-choice[data-tone="video"] { --service-fill: #f4e8ff; --service-border: #d7b6f0; --service-ink: #76469b; }
.crm-service-choice[data-tone="warm"] { --service-fill: #fff0d3; --service-border: #e9ca8b; --service-ink: #865815; }
.crm-service-choice .crm-service-choice-content { position: relative; display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--service-border); border-radius: 50%; background: var(--service-fill); color: var(--service-ink); transition: background .15s, border-color .15s; }
.crm-service-choice .crm-service-word, .crm-service-choice .crm-service-platforms { padding: 0; border: 0; border-radius: 0; background: none; }
.crm-service-word { font-size: .68rem; font-weight: 750; white-space: nowrap; }
.crm-service-platforms { display: flex; align-items: center; gap: .2rem; }
.crm-service-platforms img { width: 1.35rem; height: 1.35rem; object-fit: contain; }
.crm-service-platforms img:not(:only-child) { width: 1rem; height: 1rem; }
.crm-service-choice .crm-service-choice-check { position: absolute; inset-inline-end: -.15rem; top: -.2rem; width: 1rem; height: 1rem; padding: 0; border: 0; border-radius: 50%; background: #ff4b16; color: #fff; text-align: center; line-height: 1rem; opacity: 0; font-size: .65rem; }
.crm-service-choice .crm-service-choice-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; width: 100%; min-height: 2.6em; padding: 0; border: 0; border-radius: 0; background: none; overflow: hidden; overflow-wrap: anywhere; text-align: center; font-size: .75rem; font-weight: 600; line-height: 1.3; color: #38332d; }
.crm-service-choice:hover .crm-service-choice-content { border-color: var(--service-ink); }
.crm-service-choice input:checked + .crm-service-choice-content { border-color: #ff4b16; background: #fff4ef; color: #a83511; }
.crm-service-choice input:checked + .crm-service-choice-content .crm-service-choice-check { opacity: 1; }
.crm-service-choice input:focus-visible + .crm-service-choice-content { outline: 2px solid #a83511; outline-offset: 2px; }
.crm-offered-services .form-help { display: block; margin-top: .5rem; }
.crm-service-popover .form-help { font-size: .7rem; }
#crm-offered-service-selection { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#crm-offered-service-field[hidden] { display: none; }
.crm-interaction-offers { display: flex; flex-wrap: wrap; gap: .35rem; margin-block: .5rem; }
.crm-interaction-offers span { border-radius: .5rem; padding: .3rem .55rem; background: #fff0e7; color: #92380f; font-size: .8rem; }
.crm-batch-form { display: grid; gap: .9rem; }
.crm-batch-quota { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.crm-batch-quota input { width: 7rem; text-align: center; }
.crm-batch-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.crm-batch-records { max-height: 19rem; overflow: auto; margin: 0; padding-inline-start: 1.8rem; }
.crm-batch-records li { padding: .7rem .3rem; border-bottom: 1px solid #e7e1d8; overflow-wrap: anywhere; }
.crm-batch-records small { display: block; color: #77716a; margin-top: .25rem; }
@media (prefers-reduced-motion: reduce) { .crm-service-choice .crm-service-choice-content { transition: none; } }
.crm-interaction-save-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crm-interaction-save-actions > button { flex: 1 1 160px; }
.crm-card-next-action { flex-basis: 100%; width: 100%; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crm-next-action-editor { min-width: 0; }
.crm-next-action-editor > summary { cursor: pointer; color: var(--muted); font-size: .82rem; }
.crm-next-action-editor > label { margin-top: .65rem; }
