:root {
  --ink: #172033;
  --muted: #667085;
  --line: #e5e8ef;
  --paper: #ffffff;
  --canvas: #f4f6f9;
  --navy: #13294b;
  --navy-2: #1d3e6e;
  --blue: #1c64f2;
  --blue-soft: #eef4ff;
  --gold: #d7ad48;
  --green: #16794b;
  --green-soft: #eaf8f1;
  --red: #b42318;
  --red-soft: #fff0ee;
  --orange: #b54708;
  --orange-soft: #fff4e8;
  --shadow: 0 12px 32px rgba(22, 34, 55, .08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { font-size: 16px; min-height: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }

.app-header { height: 72px; display: grid; grid-template-columns: minmax(210px, 1fr) auto minmax(260px, 1fr); align-items: center; gap: 24px; padding: 0 38px; background: var(--navy); color: white; }
.app-brand { display: inline-flex; gap: 11px; align-items: center; color: white; font-size: 18px; }
.app-brand:hover { text-decoration: none; }
.app-brand > span, .brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--navy); background: var(--gold); font-weight: 800; }
.active-agency, .control-plane-label { display: flex; align-items: center; gap: 9px; padding: 9px 18px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 14px; }
.pulse-dot { width: 9px; height: 9px; background: #5fe0a1; border-radius: 50%; box-shadow: 0 0 0 4px rgba(95,224,161,.14); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; font-size: 13px; }
.header-actions form { margin: 0; }
.header-link { color: #e8eef8; }
.link-button { border: 0; padding: 0; background: none; }
.user-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; opacity: .72; }
.app-nav { display: flex; gap: 8px; align-items: center; padding: 0 38px; height: 53px; background: white; border-bottom: 1px solid var(--line); overflow-x: auto; }
.app-nav a { color: #465167; padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-size: 14px; font-weight: 600; }
.app-nav a:hover { background: var(--blue-soft); color: var(--blue); text-decoration: none; }
.app-shell { width: min(1420px, calc(100% - 48px)); min-height: calc(100vh - 176px); margin: 28px auto 48px; }
.public-shell { min-height: calc(100vh - 58px); }
.app-footer { display: flex; justify-content: space-between; padding: 18px 38px; color: #8a93a4; background: white; border-top: 1px solid var(--line); font-size: 12px; }
.local-footer { display: flex; align-items: center; gap: 7px; }
.local-footer i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }

h1, h2, h3 { line-height: 1.18; margin-top: 0; }
h1 { font-size: clamp(29px, 3vw, 42px); letter-spacing: -.035em; margin-bottom: 10px; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin-top: 0; }
.muted { color: var(--muted); }
.eyebrow { color: var(--blue); letter-spacing: .13em; font-size: 12px; font-weight: 800; margin-bottom: 9px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading > div:first-child { max-width: 760px; }
.page-heading p { color: var(--muted); margin-bottom: 0; }
.page-heading-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.compact-heading { display: block; max-width: 750px; margin: 45px auto 28px; text-align: center; }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; font-size: 14px; text-decoration: none; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button-primary { color: white; background: var(--blue); box-shadow: 0 6px 16px rgba(28,100,242,.2); }
.button-secondary { color: var(--ink); background: white; border-color: #ccd2dc; }
.button-danger { color: var(--red); background: var(--red-soft); border-color: #ffcdc7; }
.button-quiet { color: var(--blue); background: var(--blue-soft); }
.button-large { min-height: 50px; padding: 12px 24px; }
.button-small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.login-stage { min-height: calc(100vh - 58px); display: grid; place-items: center; padding: 48px 20px; background: radial-gradient(circle at 78% 18%, rgba(44,106,196,.20), transparent 33%), linear-gradient(135deg, #0e2343, #172f56 58%, #0b1b33); }
.login-card { width: min(610px, 100%); padding: 52px; border-radius: 24px; color: white; background: rgba(12,28,53,.72); border: 1px solid rgba(255,255,255,.13); box-shadow: 0 30px 70px rgba(0,0,0,.24); backdrop-filter: blur(14px); }
.login-card h1 { font-size: clamp(38px, 5vw, 60px); }
.login-card .lead-copy { color: #c9d5e8; font-size: 19px; max-width: 530px; margin-bottom: 30px; }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card .eyebrow { color: #8db5ff; }
.local-notice { display: flex; gap: 9px; align-items: center; margin-top: 28px; color: #aebbd0; font-size: 13px; }
.local-notice span { width: 8px; height: 8px; border-radius: 50%; background: #f0b64b; }
.login-form-card { width: min(520px, 100%); padding: 40px 48px; }
.login-form-card h1 { font-size: 36px; }
.login-form-card .muted { color: #b7c4d8; }
.stack-form { display: grid; gap: 9px; }
.stack-form label { font-size: 13px; font-weight: 700; color: #dbe4f3; margin-top: 5px; }
.stack-form input:not([type=checkbox]) { width: 100%; height: 48px; padding: 0 13px; color: white; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 9px; outline: none; }
.stack-form input:focus { border-color: #78a8ff; box-shadow: 0 0 0 3px rgba(120,168,255,.16); }
.check-line { display: flex; gap: 8px; align-items: center; font-weight: 500 !important; }
.validation { color: #ffb4ad; font-size: 12px; }
.demo-access { margin-top: 24px; color: #cbd7e8; font-size: 12px; }
.demo-access summary { cursor: pointer; }
.demo-grid { display: grid; grid-template-columns: 1fr; gap: 5px; padding-top: 12px; }
.demo-grid p { padding: 10px; background: rgba(255,255,255,.06); border-radius: 8px; }

.toast-banner { position: sticky; top: 12px; z-index: 10; padding: 13px 17px; margin-bottom: 18px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 650; }
.success-banner { color: #0f6840; background: #e8f8ef; border: 1px solid #b7e8cd; }
.error-banner { color: var(--red); background: var(--red-soft); border: 1px solid #ffc8c1; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(20,35,60,.035); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-body { padding: 22px; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric-card { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.metric-card small { display: block; color: var(--muted); margin-bottom: 8px; }
.metric-card strong { font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.metric-card .metric-note { margin-top: 9px; color: var(--muted); font-size: 12px; }
.metric-highlight { background: var(--navy); color: white; border-color: var(--navy); }
.metric-highlight small, .metric-highlight .metric-note { color: #bdc9dc; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 12px; color: #7b8495; border-bottom: 1px solid var(--line); font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table strong { display: block; }
.data-table small { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-open { color: var(--green); background: var(--green-soft); }
.status-wait { color: var(--orange); background: var(--orange-soft); }
.status-archived { color: #616b7d; background: #edf0f4; }
.progress-track { height: 8px; overflow: hidden; background: #e9edf3; border-radius: 999px; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #5a92ff); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #344054; font-size: 13px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #ccd2dc; border-radius: 8px; outline: none; }
.form-field input, .form-field select { min-height: 44px; }
.form-field textarea { min-height: 100px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,100,242,.1); }
.field-help { color: var(--muted); font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; }

.agency-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.agency-choice-grid form { margin: 0; }
.agency-choice { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 22px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; text-align: left; box-shadow: var(--shadow); }
.agency-choice:hover { border-color: #a9c4fb; transform: translateY(-2px); }
.agency-choice-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; color: white; background: var(--navy); font-weight: 800; }
.agency-choice strong, .agency-choice small { display: block; }
.agency-choice small { color: var(--muted); margin-top: 3px; }
.agency-choice .arrow { color: var(--blue); font-size: 24px; }

.empty-state { max-width: 650px; margin: 80px auto; padding: 48px; text-align: center; background: white; border: 1px solid var(--line); border-radius: 18px; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 50%; color: var(--red); background: var(--red-soft); font-size: 26px; font-weight: 800; }
.empty-state p { color: var(--muted); }
.privacy-boundary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 20px; color: #24553e; background: #edf9f3; border: 1px solid #c8ead8; border-radius: 12px; }
.privacy-boundary strong, .privacy-boundary small { display: block; }
.privacy-boundary small { margin-top: 2px; color: #527363; }
.privacy-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #d9f1e4; font-size: 20px; }
.collapsible-panel { display: none; margin-bottom: 20px; }
.collapsible-panel.is-open { display: block; }
.dashboard-grid { grid-template-columns: 1.15fr .85fr; }
.campaign-list { display: grid; gap: 18px; }
.campaign-progress { display: grid; grid-template-columns: 1fr auto; gap: 8px 15px; }
.campaign-progress span { display: block; color: var(--muted); font-size: 12px; }
.full-row { grid-column: 1 / -1; }
.outcome-bars { display: grid; gap: 13px; }
.outcome-row { display: grid; grid-template-columns: 145px 1fr 28px; align-items: center; gap: 10px; font-size: 13px; }
.outcome-row strong { text-align: right; }
.bar-track { height: 7px; background: #edf0f4; border-radius: 999px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--blue); border-radius: inherit; }
.followup-row { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 12px 0; color: var(--ink); border-bottom: 1px solid var(--line); }
.followup-row:last-child { border-bottom: 0; }
.followup-row:hover { text-decoration: none; color: var(--blue); }
.followup-row strong, .followup-row small { display: block; }
.followup-row small { color: var(--muted); }
.followup-date { display: grid; place-items: center; min-width: 55px; padding: 7px; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.local-mail-panel { background: linear-gradient(145deg, #fff, #f8fafc); }
.inline-empty { padding: 20px; color: var(--muted); text-align: center; }
.campaign-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; }
.campaign-card { padding: 22px; }
.campaign-card h2 { margin-top: 18px; margin-bottom: 8px; }
.campaign-card p { min-height: 48px; color: var(--muted); }
.campaign-card-top { display: flex; justify-content: space-between; align-items: center; }
.campaign-card-top form { margin: 0; }
.create-campaign-panel { margin-bottom: 22px; }
.create-campaign-panel[hidden] { display: none; }
.campaign-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.campaign-numbers { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 10px; font-size: 13px; }
.booking-set { margin-top: 14px; color: var(--green); font-size: 12px; font-weight: 700; }
.edit-details { margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.edit-details summary { color: var(--blue); cursor: pointer; font-weight: 700; font-size: 13px; }
.compact-form { margin-top: 15px; }
.list-icon { color: var(--blue); background: var(--blue-soft); }

.table-action { text-align: right; }
.table-action form, .bulk-actions { display: flex; justify-content: flex-end; margin: 0; }
.bulk-actions { gap: 8px; flex-wrap: wrap; }
.sharing-layout { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(360px, 1.15fr); gap: 28px; align-items: start; }
.sharing-guide { padding: 18px 20px; color: #344054; background: #f7faff; border: 1px solid #d6e3f8; border-radius: 10px; }
.sharing-guide ol { margin: 12px 0; padding-left: 22px; }
.sharing-guide li + li { margin-top: 7px; }
.sharing-guide p { margin: 0; color: var(--muted); font-size: 13px; }
.shared-access { display: inline-flex; margin-left: 8px; padding: 3px 7px; color: var(--blue); background: var(--blue-soft); border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }

.caller-start { width: min(760px, 100%); margin: 8vh auto; padding: 52px; text-align: center; }
.caller-start > p:not(.eyebrow) { max-width: 610px; margin: 0 auto 28px; color: var(--muted); font-size: 18px; }
.caller-start-count { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 30px; }
.caller-start-count strong { color: var(--blue); font-size: 40px; line-height: 1; }
.caller-start-count span { max-width: 120px; color: var(--muted); text-align: left; font-size: 13px; }
.caller-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.caller-topline h1 { margin-bottom: 0; }
.caller-work-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.caller-work-actions form { margin: 0; }
.caller-campaign-heading strong { color: var(--ink); }
.caller-campaign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; max-width: 1100px; margin: 0 auto; }
.caller-campaign-card { display: flex; flex-direction: column; padding: 24px; }
.caller-campaign-card.current-campaign { border-color: #8eb4f8; box-shadow: 0 9px 28px rgba(28,100,242,.12); }
.caller-campaign-card h2 { margin: 18px 0 8px; }
.caller-campaign-card > p { flex: 1; min-height: 58px; color: var(--muted); }
.caller-campaign-card form { margin: 18px 0 0; }
.caller-campaign-card form .button { width: 100%; }
.caller-campaign-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.current-label { color: var(--blue); font-size: 12px; font-weight: 800; }
.caller-campaign-numbers { margin-top: 4px; }
.caller-context { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 20px 0; padding: 12px 18px; color: white; background: var(--navy); border-radius: 10px; }
.caller-work-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .7fr); gap: 20px; align-items: start; }
.contact-panel, .outcome-panel { grid-column: 1; }
.campaign-brief, .defer-panel { grid-column: 2; }
.campaign-brief { grid-row: 1; position: sticky; top: 16px; border-top: 4px solid var(--gold); }
.campaign-brief p { margin: 0; font-size: 16px; line-height: 1.65; }
.defer-panel { grid-row: 2; }
.contact-panel .panel-header small, .outcome-panel .panel-header small { color: var(--muted); }
.contact-panel .panel-header h2, .outcome-panel .panel-header h2 { margin: 2px 0 0; }
.contact-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.contact-data-grid div { min-width: 0; }
.contact-data-grid small, .contact-data-grid strong, .contact-data-grid span { display: block; overflow-wrap: anywhere; }
.contact-data-grid small { margin-bottom: 5px; color: var(--muted); }
.contact-data-grid span { margin-top: 3px; color: #596579; }
.extra-fields { padding: 0 22px 22px; }
.extra-fields summary { color: var(--blue); cursor: pointer; font-size: 13px; font-weight: 700; }
.extra-fields dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; padding: 16px; background: #f8fafc; border-radius: 10px; }
.extra-fields dl div { min-width: 0; }
.extra-fields dt { color: var(--muted); font-size: 11px; }
.extra-fields dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.outcome-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.outcome-choice { position: relative; }
.outcome-choice input { position: absolute; opacity: 0; }
.outcome-choice span { display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 8px; border: 1px solid #cfd5df; border-radius: 9px; text-align: center; font-weight: 700; cursor: pointer; }
.outcome-choice-quick span { flex-direction: column; }
.outcome-choice-quick span small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 700; }
.outcome-choice input:checked + span { color: white; background: var(--blue); border-color: var(--blue); box-shadow: 0 5px 14px rgba(28,100,242,.22); }
.outcome-choice-quick input:checked + span small { color: rgba(255,255,255,.82); }
.outcome-choice input:focus-visible + span { outline: 3px solid rgba(28,100,242,.25); }
.result-details { margin-top: 20px; }
.booking-inline { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 16px 18px; background: #f7faff; border: 1px solid #c8d9f5; border-radius: 10px; }
.booking-inline div { min-width: 0; }
.booking-inline small, .booking-inline strong, .booking-inline span { display: block; }
.booking-inline small { margin-bottom: 3px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.booking-inline span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.booking-inline .button { flex: 0 0 auto; }
.submit-call { width: 100%; margin-top: 20px; }
.radio-line { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; font-weight: 650; }
.defer-panel .form-field { margin: 14px 0; }
.defer-panel .button { width: 100%; }

.import-card { max-width: 950px; margin: 0 auto; }
.import-target { padding: 18px 20px; background: #f7faff; border: 1px solid #d6e3f8; border-radius: 10px; }
.import-target select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid #b9cbe8; border-radius: 8px; background: white; }
[data-new-campaign] { transition: opacity .16s ease; }
[data-new-campaign].is-disabled { opacity: .45; }
.file-drop { padding: 24px; background: #f7faff; border: 1px dashed #9ebbf1; border-radius: 11px; }
.file-drop input { padding: 10px; background: white; }
.import-summary, .mapping-panel { margin-bottom: 20px; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.mapping-explanation { display: grid; gap: 4px; margin-bottom: 20px; padding: 15px 17px; color: #344054; background: #f7faff; border-left: 4px solid var(--blue); border-radius: 8px; }
.mapping-explanation span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.mapping-item { display: grid; gap: 5px; }
.mapping-item span { color: #344054; font-size: 12px; font-weight: 700; }
.mapping-item select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #ccd2dc; border-radius: 8px; background: white; }
.preview-panel { margin-top: 20px; }
.preview-table { min-width: 1200px; font-size: 12px; }
.preview-table td { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lead-tabs { display: flex; gap: 5px; padding: 4px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.lead-tabs a { padding: 8px 13px; color: var(--muted); border-radius: 7px; font-weight: 700; }
.lead-tabs a:hover { text-decoration: none; }
.lead-tabs a.active { color: white; background: var(--navy); }
.lead-search { display: flex; gap: 10px; margin-bottom: 18px; padding: 14px; }
.lead-search input { flex: 1; min-width: 0; padding: 10px 13px; border: 1px solid #ccd2dc; border-radius: 8px; }
.lead-table small { display: block; max-width: 360px; margin-top: 3px; }
.lead-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.lead-detail-grid .full-span { grid-column: 1 / -1; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.detail-list div { min-width: 0; }
.detail-list .full { grid-column: 1 / -1; }
.detail-list small, .detail-list strong, .detail-list span { display: block; }
.detail-list small { margin-bottom: 4px; color: var(--muted); }
.detail-list span { color: var(--muted); }
.detail-list p { padding: 13px; margin: 4px 0 0; background: #f7f8fa; border-radius: 8px; white-space: pre-wrap; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.lead-actions form { margin: 0; }
.edit-contact { padding: 13px 15px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; }
.edit-contact summary { color: var(--blue); cursor: pointer; font-weight: 700; }
.edit-contact > .form-grid { margin-top: 16px; }
.note-timeline article { position: relative; padding: 0 0 18px 25px; border-left: 2px solid #d9e4f6; }
.note-timeline article::before { position: absolute; top: 1px; left: -7px; width: 12px; height: 12px; content: ""; background: var(--blue); border: 3px solid white; border-radius: 50%; }
.note-timeline strong, .note-timeline small { display: inline-block; }
.note-timeline small { margin-left: 9px; color: var(--muted); }
.note-timeline p { margin: 6px 0 0; white-space: pre-wrap; }
.outbox-list { display: grid; gap: 12px; }
.mail-card { padding: 18px 21px; }
.mail-meta { display: flex; justify-content: space-between; gap: 15px; }
.mail-card > small { color: var(--muted); }
.mail-card details { margin-top: 12px; }
.mail-card summary { color: var(--blue); cursor: pointer; font-weight: 700; }
.mail-card pre { overflow: auto; padding: 14px; color: #263247; background: #f6f8fb; border-radius: 9px; white-space: pre-wrap; font: 13px/1.55 "Segoe UI", sans-serif; }

@media (max-width: 920px) {
  .app-header { grid-template-columns: 1fr auto; height: auto; min-height: 68px; padding: 12px 20px; }
  .active-agency, .control-plane-label { grid-row: 2; grid-column: 1 / -1; justify-content: center; }
  .header-actions .user-name { display: none; }
  .app-nav { padding: 0 15px; }
  .app-shell { width: min(100% - 28px, 1420px); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .caller-work-grid, .lead-detail-grid, .sharing-layout { grid-template-columns: 1fr; }
  .contact-panel, .outcome-panel, .campaign-brief, .defer-panel { grid-column: 1; grid-row: auto; }
  .campaign-brief { position: static; }
  .mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-detail-grid .full-span { grid-column: 1; }
}

@media (max-width: 620px) {
  .app-brand strong, .header-actions > a { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading-actions { justify-content: stretch; flex-direction: column; }
  .page-heading-actions .button { width: 100%; }
  .metric-grid, .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .login-card, .login-form-card { padding: 32px 24px; }
  .app-footer { flex-direction: column; gap: 7px; padding: 16px 20px; }
  .caller-start { padding: 34px 22px; }
  .caller-topline { align-items: stretch; flex-direction: column; }
  .caller-work-actions { justify-content: stretch; }
  .caller-work-actions form, .caller-work-actions .button { flex: 1; }
  .contact-data-grid, .detail-list, .extra-fields dl, .mapping-grid { grid-template-columns: 1fr; }
  .outcome-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-search { flex-direction: column; }
  .mail-meta { flex-direction: column; gap: 2px; }
  .booking-inline { align-items: stretch; flex-direction: column; }
  .booking-inline .button { width: 100%; }
}
