:root {
  color-scheme: light;
  --navy: #0f1629;
  --navy-2: #18233a;
  --navy-3: #26344f;
  --amber: #f5a623;
  --amber-dark: #d4891a;
  --amber-soft: #fff3e0;
  --page: #f4f2eb;
  --surface: #fffefa;
  --surface-2: #f8f7f2;
  --surface-hover: #faf9f5;
  --border: #e5e1d7;
  --ink: #1a1a2e;
  --body: #2d2d3a;
  --muted: #6b6b80;
  --subtle: #9e9ea7;
  --green: #1a9b6a;
  --green-soft: #e8f8ef;
  --red: #d9483b;
  --red-soft: #fdecea;
  --orange: #d47a28;
  --orange-soft: #fef0e0;
  --blue: #2870cc;
  --blue-soft: #e5eef9;
  --purple: #7c5ce5;
  --purple-soft: #f3eeff;
  --shadow-card: 0 1px 3px rgba(15, 22, 41, .06), 0 1px 2px rgba(15, 22, 41, .04);
  --shadow-float: 0 18px 60px rgba(15, 22, 41, .16);
  --sidebar: 244px;
  --radius: 14px;
  --transition: 150ms cubic-bezier(.4, 0, .2, 1);
  font-family: Inter, "Avenir Next", "Segoe UI", system-ui, sans-serif;
}

/* Briefing and optional voice: reuse the dashboard's existing visual tokens. */
.briefing-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4); margin-bottom: var(--space-3); }
.briefing-card p { margin: var(--space-2) 0 0; max-width: 65ch; color: var(--muted); line-height: 1.6; }
.copilot-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--border); }
.copilot-drawer { grid-template-rows: auto auto minmax(0, 1fr) auto !important; }
.copilot-tools button { min-height: 36px; }
@media (max-width: 767px) {
  .briefing-card { align-items: stretch; flex-direction: column; padding: var(--space-3); }
}

[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b1120;
  --surface: #151d30;
  --surface-2: #1b253a;
  --surface-hover: #202b42;
  --border: rgba(255, 255, 255, .1);
  --ink: #f7f4ec;
  --body: #e2dfd8;
  --muted: #aaa9b4;
  --subtle: #a2aabb;
  --green: #53d3a0;
  --red: #ff938a;
  --orange: #efb473;
  --blue: #8bb9ff;
  --purple: #b8a5ff;
  --amber-soft: rgba(245, 166, 35, .13);
  --green-soft: rgba(26, 155, 106, .15);
  --red-soft: rgba(217, 72, 59, .14);
  --orange-soft: rgba(212, 122, 40, .15);
  --blue-soft: rgba(40, 112, 204, .15);
  --purple-soft: rgba(124, 92, 229, .15);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--page); color: var(--body); }
body { min-width: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--amber) 42%, transparent); outline-offset: 2px; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -.035em; color: var(--ink); margin-bottom: 4px; }
h2 { font-size: 18px; letter-spacing: -.02em; color: var(--ink); margin-bottom: 4px; }
h3 { font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.mono, .metric-value, .money { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.boot-screen { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 12px; color: var(--muted); }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 15% 15%, rgba(245,166,35,.18), transparent 32%), var(--page); }
.login-card { width: min(420px, 100%); padding: 28px; display: grid; gap: 16px; }
.login-card .brand-mark { margin-bottom: 4px; }
.login-card h1, .login-card p { margin-bottom: 0; }
.boot-mark { width: 52px; height: 52px; margin: auto; border-radius: 16px; display: grid; place-items: center; background: var(--navy); color: white; font-weight: 900; box-shadow: var(--shadow-float); }
.boot-mark span { color: var(--amber); }

.app-shell { min-height: 100vh; }
.sidebar { width: var(--sidebar); position: fixed; inset: 0 auto 0 0; background: var(--navy); color: white; display: flex; flex-direction: column; padding: 24px 16px 18px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 28px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--navy); background: linear-gradient(135deg, #ffbe42, var(--amber-dark)); font-weight: 900; box-shadow: 0 6px 18px rgba(245, 166, 35, .2); }
.brand-name { font-size: 20px; line-height: 1; font-weight: 850; letter-spacing: -.04em; }
.brand-name span { color: var(--amber); }
.brand-caption { margin-top: 5px; font-size: 9px; color: rgba(255,255,255,.38); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.nav { display: grid; gap: 4px; }
.nav-button { position: relative; width: 100%; min-height: 46px; padding: 0 12px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 10px; background: transparent; color: rgba(255,255,255,.58); cursor: pointer; text-align: left; font-size: 13px; font-weight: 650; transition: background var(--transition), color var(--transition); }
.nav-button::before { content: ""; position: absolute; left: -16px; width: 3px; height: 25px; border-radius: 0 3px 3px 0; background: transparent; }
.nav-button:hover { background: rgba(255,255,255,.055); color: rgba(255,255,255,.86); }
.nav-button.active { background: rgba(245,166,35,.12); color: var(--amber); }
.nav-button.active::before { background: var(--amber); }
.nav-icon { width: 20px; text-align: center; font-size: 17px; line-height: 1; }
.nav-badge { margin-left: auto; padding: 2px 7px; min-width: 22px; text-align: center; border-radius: 999px; color: white; background: var(--red); font-size: 10px; font-weight: 800; }
.sidebar-spacer { flex: 1; }
.agent-status { margin: 12px 2px; padding: 13px; border: 1px solid rgba(255,255,255,.07); background: rgba(255,255,255,.045); border-radius: 12px; }
.agent-status-title { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.34); font-weight: 800; margin-bottom: 10px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255,255,255,.62); margin-top: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(26,155,106,.12); }
.status-dot.sandbox { background: var(--orange); box-shadow: 0 0 0 3px rgba(212,122,40,.13); }
.status-dot.danger { background: var(--red); box-shadow: 0 0 0 3px rgba(195,62,62,.13); }
.sidebar-user { display: flex; gap: 10px; align-items: center; padding: 12px 8px 2px; border-top: 1px solid rgba(255,255,255,.07); }
.avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; background: linear-gradient(135deg, var(--navy-3), #34476c); color: var(--amber); display: grid; place-items: center; font-size: 11px; font-weight: 850; }
.sidebar-user strong { display: block; font-size: 12px; color: rgba(255,255,255,.9); }
.sidebar-user span { font-size: 10px; color: rgba(255,255,255,.38); }

.content-shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { height: 72px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); }
.eyebrow { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.topbar-title { font-size: 18px; font-weight: 800; letter-spacing: -.025em; color: var(--ink); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: transform var(--transition), background var(--transition); }
.icon-button:hover { background: var(--surface-hover); transform: translateY(-1px); }
.main { max-width: 1440px; margin: 0 auto; padding: 28px; }
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 22px; }
.page-head p { font-size: 13px; color: var(--muted); margin-bottom: 0; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.button { min-height: 42px; border: 1px solid transparent; border-radius: 11px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; font-size: 13px; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), background var(--transition); }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.985); }
.button.primary { color: #2f2104; background: var(--amber); box-shadow: 0 7px 18px rgba(245,166,35,.19); }
.button.primary:hover { background: #ffb329; }
.button.secondary { background: var(--surface); border-color: var(--border); color: var(--body); }
.button.ghost { background: transparent; color: var(--muted); }
.button.danger { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 18%, transparent); }
.button.danger:hover { background: color-mix(in srgb, var(--red) 16%, var(--surface)); }
.button.success { background: var(--green); color: white; }
.button.small-button { min-height: 36px; padding-inline: 12px; font-size: 12px; }
.button[disabled] { cursor: wait; opacity: .55; transform: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-pad { padding: 20px; }
.action-banner { display: flex; align-items: center; gap: 13px; min-height: 68px; padding: 14px 18px; margin-bottom: 24px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--amber) 20%, var(--border)); border-left: 4px solid var(--amber); background: var(--amber-soft); }
.action-banner.clear { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 18%, var(--border)); border-left-color: var(--green); }
.banner-icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: color-mix(in srgb, var(--amber) 18%, transparent); display: grid; place-items: center; }
.action-banner.clear .banner-icon { background: color-mix(in srgb, var(--green) 15%, transparent); }
.action-banner strong { color: var(--ink); display: block; font-size: 14px; }
.action-banner span { color: var(--muted); font-size: 12px; }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.section-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.count-chip { border-radius: 999px; padding: 4px 9px; font-size: 11px; font-weight: 800; background: var(--red-soft); color: var(--red); }
.count-chip.danger { box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 8%, transparent); }
.review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.review-card { position: relative; overflow: hidden; padding: 18px; border-left: 4px solid var(--amber); animation: reviewGlow 2.6s ease-in-out infinite; }
.blocked-questions-section { margin-bottom: 8px; padding: 18px 18px 0; border: 1px solid color-mix(in srgb, var(--red) 18%, var(--border)); border-radius: 14px; background: color-mix(in srgb, var(--red-soft) 58%, transparent); }
.blocked-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blocked-question-card { border-left-color: var(--red); animation: none; }
.blocked-subject { display: block; margin: 4px 0 8px; color: var(--ink); font-size: 11px; }
.blocked-question { min-height: 48px; margin: 0 0 14px; color: var(--body); font-size: 12px; line-height: 1.55; }
@keyframes reviewGlow { 0%,100% { box-shadow: var(--shadow-card), 0 0 0 0 rgba(245,166,35,0); } 50% { box-shadow: var(--shadow-card), 0 0 0 5px rgba(245,166,35,.08); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
.review-top { display: flex; gap: 11px; align-items: center; margin-bottom: 13px; }
.review-person { min-width: 0; flex: 1; }
.review-person strong { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.review-person span { color: var(--muted); font-size: 11px; }
.ai-badge { align-self: flex-start; padding: 4px 8px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-size: 10px; font-weight: 850; }
.draft-preview { font-size: 13px; color: var(--body); line-height: 1.55; margin: 0 0 14px; min-height: 60px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.review-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); font-size: 10px; font-weight: 700; }
.chip.warning { color: var(--orange); background: var(--orange-soft); border-color: transparent; }
.review-actions { display: grid; gap: 7px; }
.review-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric-card { position: relative; padding: 20px; min-height: 132px; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--metric, var(--amber)); }
.metric-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.metric-value { margin-top: 15px; font-size: 31px; color: var(--ink); font-weight: 850; letter-spacing: -.05em; }
.metric-note { margin-top: 7px; font-size: 11px; color: var(--subtle); }

.lead-priority-section { margin-bottom: 24px; }
.score-disclaimer { color: var(--subtle); font-size: 9px; font-weight: 750; }
.lead-priority-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lead-priority-card { min-width: 0; padding: 15px; cursor: pointer; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.followup-report { margin-top: 18px; padding: 18px; }
.followup-report-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.followup-report-grid > div { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.followup-report-grid strong, .followup-report-grid span { display: block; }
.followup-report-grid strong { color: var(--ink); font-size: 16px; }
.followup-report-grid span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.followup-plan-list { display: grid; gap: 8px; }
.followup-plan-list article { padding: 12px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.followup-plan-list strong, .followup-plan-list span { display: block; }
.followup-plan-list strong { color: var(--ink); font-size: 10px; }
.followup-plan-list span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.supervisor-agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.supervisor-agent-grid article { padding: 12px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.supervisor-agent-grid article > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font-weight: 900; }
.supervisor-agent-grid strong, .supervisor-agent-grid small { display: block; }
.supervisor-agent-grid strong { color: var(--ink); font-size: 10px; }
.supervisor-agent-grid small { margin-top: 4px; color: var(--muted); font-size: 7px; line-height: 1.4; }
.supervisor-task-list { display: grid; gap: 8px; }
.supervisor-task-list article { padding: 11px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; align-items: start; border: 1px solid var(--border); border-radius: 10px; }
.supervisor-task-list strong, .supervisor-task-list p, .supervisor-task-list small { display: block; }
.supervisor-task-list strong { color: var(--ink); font-size: 10px; }
.supervisor-task-list p { margin: 3px 0; color: var(--body); font-size: 9px; }
.supervisor-task-list small { color: var(--muted); font-size: 8px; }
.lead-priority-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--amber) 42%, var(--border)); box-shadow: 0 9px 26px rgba(15,22,41,.09); }
.lead-priority-top { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.lead-priority-top .avatar { width: 34px; height: 34px; }
.lead-priority-top strong, .lead-priority-top span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-priority-top strong { color: var(--ink); font-size: 12px; }
.lead-priority-top span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.lead-score { color: var(--ink); font: 850 20px "SFMono-Regular", Consolas, monospace; }
.lead-priority-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.lead-temperature, .lead-urgency { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.lead-temperature.super_hot { background: var(--red-soft); color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 7%, transparent); }
.lead-temperature.very_hot { background: var(--orange-soft); color: var(--orange); }
.lead-temperature.hot { background: var(--amber-soft); color: var(--amber-dark); }
.lead-temperature.warm { background: var(--blue-soft); color: var(--blue); }
.lead-temperature.low { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.lead-urgency { background: var(--purple-soft); color: var(--purple); }
.lead-priority-card > p { min-height: 34px; margin: 10px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.lead-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 9px; }
.lead-card-footer strong { color: var(--ink); font-size: 10px; }

.dashboard-lower { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 16px; }
.risk-card { border-top: 3px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(90deg, var(--red), var(--amber)) border-box; }
.risk-title { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; font-size: 14px; margin-bottom: 15px; }
.risk-list { display: grid; gap: 10px; }
.risk-item { display: flex; justify-content: space-between; gap: 15px; font-size: 13px; }
.risk-item span:first-child::before { content: ""; width: 6px; height: 6px; display: inline-block; margin: 0 9px 1px 0; border-radius: 50%; background: var(--red); }
.risk-total { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.risk-total strong { color: var(--red); font-size: 22px; }
.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; min-height: 46px; border-bottom: 1px solid var(--border); font-size: 12px; }
.feed-item:last-child { border-bottom: 0; }
.feed-time { color: var(--subtle); font: 10px "SFMono-Regular", Consolas, monospace; }
.feed-arrow { color: var(--subtle); }

.filter-bar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.input, .select, .textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); background: var(--surface); }
.textarea { resize: vertical; line-height: 1.5; }
.search { max-width: 320px; }
.select { width: auto; min-width: 148px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 11px; font-weight: 750; color: var(--muted); }
.input-with-suffix { position: relative; display: grid; }
.input-with-suffix .input { padding-right: 58px; }
.input-with-suffix > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 10px; font-weight: 800; pointer-events: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(235px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding: 2px 2px 14px; }
.kanban-column { min-height: 300px; border-radius: 13px; background: color-mix(in srgb, var(--surface-2) 68%, transparent); border: 1px solid var(--border); overflow: hidden; }
.kanban-head { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 13px; border-top: 3px solid var(--column-color); color: var(--ink); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .055em; }
.kanban-count { margin-left: auto; min-width: 23px; padding: 2px 7px; text-align: center; border-radius: 999px; background: color-mix(in srgb, var(--column-color) 13%, transparent); color: var(--column-color); }
.kanban-list { display: grid; gap: 9px; padding: 9px; }
.archived-pipeline { padding: 18px; }
.archived-pipeline-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.archived-pipeline-head h2 { margin: 3px 0 0; font-size: 18px; }
.archived-pipeline-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.deal-card.archived { opacity: .92; border-style: dashed; }
.archive-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 10px; }
.archive-card-meta strong { color: var(--ink); }
.archived-opportunity-note { margin-top: 12px; }
.deal-card { padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-card); cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); }
.deal-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,22,41,.09); }
.deal-top { display: flex; align-items: center; gap: 9px; }
.deal-top .avatar { width: 34px; height: 34px; flex-basis: 34px; }
.deal-name { min-width: 0; flex: 1; }
.deal-name strong { display: block; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-name span { color: var(--muted); font-size: 10px; }
.deal-value { color: var(--ink); font-size: 12px; font-weight: 800; }
.deal-priority-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.deal-priority-label strong { color: var(--ink); font: 850 13px "SFMono-Regular", Consolas, monospace; }
.score { margin-top: 13px; }
.score-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; margin-bottom: 5px; }
.score-track { height: 4px; border-radius: 4px; overflow: hidden; background: var(--border); }
.score-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--amber) 55%, var(--green)); }
.lead-card-reason { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.deal-footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 12px; font-size: 9px; color: var(--subtle); }

.lead-priority-detail { border-left: 4px solid var(--red); background: color-mix(in srgb, var(--red-soft) 35%, var(--surface)); }
.lead-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.lead-detail-head h3 { margin: 8px 0 0; color: var(--ink); }
.lead-detail-head > strong { color: var(--ink); font: 900 34px "SFMono-Regular", Consolas, monospace; letter-spacing: -.06em; }
.lead-explanation { margin: 10px 0 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.lead-factors { display: grid; gap: 8px; }
.lead-factor { display: grid; grid-template-columns: 130px minmax(80px, 1fr) 38px; gap: 9px; align-items: center; font-size: 9px; }
.lead-factor > span { color: var(--body); font-weight: 700; }
.lead-factor > div { height: 5px; overflow: hidden; border-radius: 999px; background: var(--border); }
.lead-factor i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--amber), var(--green)); }
.lead-factor b { color: var(--muted); text-align: right; }
.lead-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.lead-reasons span { padding: 5px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--body); font-size: 9px; }
.lead-confidence { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 9px; }

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 760px; }
table.data th { height: 44px; padding: 0 15px; background: var(--surface-2); color: var(--muted); text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
table.data td { height: 62px; padding: 10px 15px; border-top: 1px solid var(--border); font-size: 12px; vertical-align: middle; }
table.data tbody tr { transition: background var(--transition); }
table.data tbody tr:hover { background: var(--surface-hover); }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell strong { display: block; color: var(--ink); font-size: 12px; }
.person-cell span { color: var(--muted); font-size: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-pill.success { background: var(--green-soft); color: var(--green); }
.status-pill.warning { background: var(--orange-soft); color: var(--orange); }
.status-pill.danger { background: var(--red-soft); color: var(--red); }
.status-pill.ai { background: var(--purple-soft); color: var(--purple); }
.empty-state { padding: 52px 24px; text-align: center; }
.empty-icon { width: 50px; height: 50px; margin: 0 auto 13px; border-radius: 16px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-size: 23px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 12px; margin-bottom: 0; }

.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 18px; align-items: start; }
.settings-mobile-picker { display: none; }
.settings-nav { position: sticky; top: 92px; padding: 8px; }
.settings-nav button { width: 100%; min-height: 42px; text-align: left; padding: 0 11px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.settings-nav button.active { color: var(--amber-dark); background: var(--amber-soft); font-weight: 800; }
.settings-panel { padding: 22px; }
.settings-panel > h2 { margin-bottom: 6px; }
.settings-panel > h2 + p { margin-bottom: 20px; line-height: 1.55; }
.setting-block + .setting-block { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-option { position: relative; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.mode-option.selected { border-color: var(--amber); background: var(--amber-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 15%, transparent); }
.mode-option strong { color: var(--ink); display: block; font-size: 13px; }
.mode-option span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.mode-risk { margin-top: 7px; color: var(--red); font-size: 10px; font-weight: 800; }
.toggle-row { min-height: 56px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.toggle-row strong { display: block; color: var(--ink); font-size: 13px; }
.toggle-row span { color: var(--muted); font-size: 11px; }
.switch { width: 48px; height: 28px; padding: 3px; border: 0; border-radius: 999px; background: var(--border); cursor: pointer; }
.switch::after { content: ""; display: block; width: 22px; height: 22px; border-radius: 50%; background: white; box-shadow: 0 1px 5px rgba(0,0,0,.2); transition: transform var(--transition); }
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(20px); }
.provider-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.provider-card { padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.provider-card strong { display: block; color: var(--ink); font-size: 12px; }
.provider-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.provider-state { float: right; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.provider-state.sandbox { background: var(--orange); }
.provider-state.offline { background: var(--red); }
.connection-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 14px; }
.connection-summary-card { min-width: 0; padding: 15px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 24px; gap: 11px; align-items: center; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.connection-summary-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 26%, var(--border)); box-shadow: 0 9px 24px rgba(15,22,41,.07); }
.connection-summary-card.ready { border-color: color-mix(in srgb, var(--green) 25%, var(--border)); background: color-mix(in srgb, var(--green-soft) 48%, var(--surface)); }
.connection-summary-card.attention { border-color: color-mix(in srgb, var(--red) 25%, var(--border)); }
.connection-summary-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 16px; font-weight: 850; }
.connection-summary-card.ready .connection-summary-icon { color: var(--green); background: color-mix(in srgb, var(--green) 12%, white); }
.connection-summary-card small, .connection-summary-card strong, .connection-summary-card p { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-summary-card small { color: var(--subtle); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.connection-summary-card strong { margin-top: 3px; color: var(--ink); font-size: 11px; }
.connection-summary-card p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.connection-summary-card > i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); font-size: 9px; font-style: normal; font-weight: 900; }
.connection-summary-card.ready > i { color: white; background: var(--green); border-color: var(--green); }
.connection-focus { padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--border)); border-radius: 14px; background: linear-gradient(135deg, var(--amber-soft), color-mix(in srgb, var(--amber-soft) 35%, var(--surface))); overflow: hidden; position: relative; }
.connection-focus::after { content: ""; position: absolute; width: 130px; height: 130px; right: -52px; top: -62px; border-radius: 50%; background: color-mix(in srgb, var(--amber) 10%, transparent); pointer-events: none; }
.connection-focus.ready { border-color: color-mix(in srgb, var(--green) 25%, var(--border)); background: linear-gradient(135deg, var(--green-soft), color-mix(in srgb, var(--green-soft) 30%, var(--surface))); }
.connection-focus-copy { min-width: 0; position: relative; z-index: 1; }
.connection-focus-copy > span { color: var(--amber-dark); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.connection-focus.ready .connection-focus-copy > span { color: var(--green); }
.connection-focus h3 { margin: 5px 0 4px; color: var(--ink); font-size: 15px; }
.connection-focus p { max-width: 440px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.connection-focus-action { flex: none; display: grid; gap: 6px; justify-items: stretch; position: relative; z-index: 1; }
.connection-focus-action small { color: var(--subtle); font-size: 8px; text-align: center; }
.connection-journey { margin: 14px 0 18px; padding: 13px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.connection-journey > div { min-width: 0; display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px; border-radius: 9px; }
.connection-journey > div.current { background: var(--amber-soft); }
.connection-journey b { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); font-size: 9px; }
.connection-journey .complete b { color: white; background: var(--green); border-color: var(--green); }
.connection-journey .current b { color: #302002; background: var(--amber); border-color: var(--amber); }
.connection-journey strong, .connection-journey small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connection-journey strong { color: var(--ink); font-size: 9px; }
.connection-journey small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.advanced-connections { border: 1px solid var(--border); border-radius: 13px; background: var(--surface); overflow: clip; }
.advanced-connections > summary { min-height: 64px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; list-style: none; transition: background var(--transition); }
.advanced-connections > summary::-webkit-details-marker { display: none; }
.advanced-connections > summary:hover { background: var(--surface-hover); }
.advanced-connections > summary strong, .advanced-connections > summary small { display: block; }
.advanced-connections > summary strong { color: var(--ink); font-size: 12px; }
.advanced-connections > summary small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.advanced-connections > summary > b { color: var(--muted); font-size: 17px; transition: transform var(--transition); }
.advanced-connections[open] > summary > b { transform: rotate(180deg); }
.advanced-connections-body { padding: 18px; border-top: 1px solid var(--border); animation: connectionReveal 220ms ease both; }
.advanced-connections-body > .provider-grid { margin-bottom: 22px; }
.advanced-connections-body > .setting-block + .setting-block { margin-top: 18px; padding-top: 0; border-top: 0; }
@keyframes connectionReveal { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 900px) {
  .connection-summary-grid { grid-template-columns: 1fr; }
  .connection-summary-card p { white-space: normal; }
  .connection-focus { align-items: flex-start; flex-direction: column; }
  .connection-focus-action { width: 100%; }
  .connection-journey { grid-template-columns: 1fr; }
  .connection-journey strong, .connection-journey small { white-space: normal; }
}
@media (max-width: 520px) {
  .connection-summary-card { padding: 12px; }
  .connection-focus { padding: 15px; }
  .advanced-connections > summary { padding-inline: 13px; }
  .advanced-connections > summary small { line-height: 1.45; }
  .advanced-connections-body { padding: 13px; }
}
.gmail-connection { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.gmail-connection-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.gmail-connection-head h3 { margin: 4px 0 0; }
.gmail-connection > p { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.gmail-permissions { display: grid; gap: 7px; margin: 15px 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.gmail-permissions strong { color: var(--ink); font-size: 10px; }
.gmail-permissions span { padding-left: 17px; position: relative; color: var(--muted); font-size: 9px; line-height: 1.45; }
.gmail-permissions span::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gmail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.gmail-actions > span { color: var(--subtle); font-size: 9px; }
.gmail-monitor-toggle { margin-top: 15px; padding-top: 14px; border-top: 1px dashed var(--border); }
.gmail-monitor-toggle > div { min-width: 0; }
.gmail-monitor-toggle span { display: block; margin-top: 4px; line-height: 1.5; }
.gmail-monitor-toggle .switch { flex: none; }
.gmail-sandbox-test { margin-top: 15px; padding-top: 14px; border-top: 1px dashed var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.gmail-sandbox-test strong, .gmail-sandbox-test span { display: block; }
.gmail-sandbox-test strong { color: var(--ink); font-size: 10px; }
.gmail-sandbox-test span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.mailbox-learning { padding: 18px; border: 1px solid var(--border); border-radius: 12px; }
.consent-check { margin: 15px 0; padding: 13px; display: flex; align-items: flex-start; gap: 11px; border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--border)); border-radius: 10px; background: var(--blue-soft); cursor: pointer; }
.consent-check input { margin-top: 2px; accent-color: var(--blue); }
.consent-check strong, .consent-check small { display: block; }
.consent-check strong { color: var(--ink); font-size: 10px; }
.consent-check small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.mail-learning-options { margin-bottom: 14px; grid-template-columns: 1.25fr .75fr .75fr .75fr; }
.style-profile { margin-top: 15px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style-profile > div { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.style-profile strong, .style-profile span { display: block; }
.style-profile strong { color: var(--ink); font-size: 11px; }
.style-profile span { margin-top: 4px; color: var(--muted); font-size: 8px; }
.webhook-copy { margin-top: 14px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.webhook-copy > div { min-width: 0; }
.webhook-copy small, .webhook-copy code { display: block; }
.webhook-copy small { margin-bottom: 5px; color: var(--subtle); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.webhook-copy code { overflow: hidden; color: var(--ink); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.whatsapp-setup { margin: 15px 0; padding: 15px; border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--border)); border-radius: 11px; background: linear-gradient(145deg, var(--surface), var(--blue-soft)); }
.whatsapp-setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.whatsapp-setup-head h4 { margin: 4px 0 0; color: var(--ink); font-size: 13px; }
.whatsapp-setup > p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.whatsapp-setup-grid { margin-top: 14px; }
.whatsapp-setup-grid em { color: var(--subtle); font-size: 8px; font-style: normal; font-weight: 600; }
.whatsapp-setup-actions { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.whatsapp-setup-actions > span { color: var(--green); font-size: 8px; font-weight: 750; }
@media (max-width: 620px) {
  .webhook-copy { align-items: stretch; flex-direction: column; }
  .webhook-copy code { white-space: normal; overflow-wrap: anywhere; }
  .whatsapp-setup { padding: 13px; }
  .whatsapp-setup-head { align-items: stretch; flex-direction: column; }
  .whatsapp-setup-grid { grid-template-columns: 1fr; }
  .whatsapp-setup-actions { align-items: stretch; flex-direction: column; }
  .whatsapp-setup-actions .button { width: 100%; }
}
.mail-candidates { margin-top: 18px; }
.mail-candidates h4 { margin-bottom: 8px; color: var(--ink); font-size: 11px; }
.mail-candidates article { padding: 12px 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; border-top: 1px solid var(--border); }
.mail-candidates article strong { color: var(--ink); font-size: 10px; }
.mail-candidates article p { margin: 4px 0; color: var(--body); font-size: 9px; line-height: 1.45; }
.mail-candidates article span { color: var(--subtle); font-size: 8px; }
.mail-candidates article > div:last-child { display: flex; gap: 6px; flex: none; }
.mail-import-job { padding: 18px; border: 1px solid var(--border); border-radius: 12px; }
.import-progress { height: 9px; margin-top: 15px; overflow: hidden; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border); }
.import-progress > i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #79a8f4); transition: width 260ms ease; }
.import-progress-meta { margin: 8px 0 14px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.import-progress-meta strong { color: var(--ink); }
.mail-privacy-controls { margin-top: 18px; padding-top: 15px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--border); }
.mail-privacy-controls strong, .mail-privacy-controls span { display: block; }
.mail-privacy-controls strong { color: var(--ink); font-size: 10px; }
.mail-privacy-controls span { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.mail-privacy-controls > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; flex: none; }
.timeline { display: grid; gap: 0; margin-top: 14px; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; min-height: 56px; }
.timeline-dot { position: relative; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--amber); }
.timeline-dot::after { content: ""; position: absolute; top: 12px; left: 4px; width: 2px; height: 44px; background: var(--border); }
.timeline-item:last-child .timeline-dot::after { display: none; }
.timeline-item strong { display: block; color: var(--ink); font-size: 12px; }
.timeline-item span { color: var(--muted); font-size: 10px; }
.opportunity-next-action { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.opportunity-next-action h3 { margin: 0; }
.opportunity-next-action p { margin: 5px 0 0; }
.opportunity-state-actions { min-width: min(100%, 370px); display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 7px; }
.opportunity-state-actions .input { width: auto; min-width: 155px; min-height: 38px; }

.mobile-nav { display: none; }
.daily-events h3 { font-size: 14px; margin: var(--space-3) 0 var(--space-2); }
.daily-event { display: flex; justify-content: space-between; gap: var(--space-3); width: 100%; min-height: 64px; padding: var(--space-3) 0; background: transparent; color: var(--text); border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; }
.daily-event > span { display: grid; gap: var(--space-1); overflow-wrap: anywhere; min-width: 0; }
.daily-event > span:last-child { text-align: right; }
.daily-event > span:first-child strong, .daily-event > span:first-child small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.5; max-height: 3em; overflow: hidden; }
.daily-event small { color: var(--muted); font-size: 13px; }
.daily-commercial summary { cursor: pointer; min-height: 44px; display: list-item; font-weight: 650; padding: var(--space-2); }
.more-tools { display: grid; gap: var(--space-3); }
.search-group { margin-top: var(--space-3); }
.search-group h3 { font-size: 14px; }
.search-result { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); width: 100%; min-height: 48px; padding: var(--space-3); border: 1px solid var(--border); border-radius: 8px; margin-bottom: var(--space-2); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.search-result:hover { border-color: var(--blue); }
.search-result span { color: var(--muted); font-size: 13px; }
.knowledge-full-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; }
.toast-region { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 260px; max-width: 380px; padding: 13px 15px; border: 1px solid var(--border); border-left: 4px solid var(--green); border-radius: 11px; background: var(--surface); color: var(--body); box-shadow: var(--shadow-float); font-size: 12px; animation: toastIn .2s ease-out; }
.toast.error { border-left-color: var(--red); }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }

.modal { width: min(760px, calc(100vw - 28px)); max-height: min(88vh, 900px); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--body); box-shadow: var(--shadow-float); overflow: auto; }
.modal::backdrop { background: rgba(7, 12, 24, .56); backdrop-filter: blur(4px); }
.modal-head { position: sticky; top: 0; z-index: 2; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { position: sticky; bottom: 0; min-height: 70px; padding: 12px 20px; display: flex; justify-content: flex-end; gap: 8px; align-items: center; border-top: 1px solid var(--border); background: var(--surface); }
.modal-foot-note { margin-right: auto; color: var(--muted); font-size: 10px; }
.message-original { margin: 0 0 16px; padding: 14px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.55; }
.message-original.blocked-original { padding: 17px 18px; border: 1px solid color-mix(in srgb, var(--red) 26%, var(--border)); border-left: 5px solid var(--red); background: color-mix(in srgb, var(--red-soft) 55%, var(--surface)); box-shadow: 0 8px 24px rgba(190, 54, 48, .08); }
.customer-question-label { display: block; margin-bottom: 7px; color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.message-original > strong { color: var(--ink); }
.customer-question { margin: 10px 0 0; color: var(--ink); font-size: 15px; font-weight: 720; line-height: 1.55; }
.message-thread { display: grid; gap: 10px; margin-top: 18px; }
.bubble { max-width: 84%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px 12px 12px 3px; background: var(--surface); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.bubble.outbound { margin-left: auto; border-radius: 12px 12px 3px 12px; background: var(--navy); color: white; border-color: var(--navy); }
.bubble.ai { background: var(--amber-soft); border-left: 3px solid var(--amber); }
.message-attachments { display: grid; gap: 7px; margin-top: 11px; }
.message-attachment { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 9px; align-items: center; padding: 9px; border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--border)); border-radius: 9px; background: color-mix(in srgb, white 72%, transparent); color: var(--ink); text-decoration: none; }
.message-attachment > span { grid-row: 1 / span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 9px; font-weight: 900; }
.message-attachment strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.message-attachment small { color: var(--muted); font-size: 9px; }
.message-attachment:hover { border-color: var(--amber); }
.bubble.outbound.ai { background: var(--navy); color: white; border-color: var(--navy); border-left-color: var(--amber); }
.bubble.outbound .bubble-meta { color: rgba(255,255,255,.66); }
.bubble a { color: inherit; font-weight: 750; text-decoration: underline; overflow-wrap: anywhere; }
.bubble-meta { display: block; margin-bottom: 5px; color: var(--subtle); font-size: 9px; font-weight: 800; }
.view-switcher { width: fit-content; display: flex; gap: 4px; margin: -4px 0 16px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.view-switcher button { min-height: 36px; padding: 0 15px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 11px; font-weight: 750; }
.view-switcher button.active { background: var(--navy); color: white; }
.view-switcher button span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 5px; place-items: center; border-radius: 999px; background: var(--amber); color: var(--navy); font-size: 9px; }
.inbox-tabs { width: fit-content; display: flex; gap: 4px; margin: -2px 0 12px; padding: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.inbox-tabs button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 11px; font-weight: 750; }
.inbox-tabs button:hover { color: var(--ink); background: var(--surface-2); }
.inbox-tabs button.active { color: white; background: var(--navy); box-shadow: 0 5px 14px rgba(20,32,56,.14); }
.inbox-tabs button span { display: inline-grid; min-width: 19px; height: 19px; margin-left: 5px; place-items: center; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 9px; }
.inbox-tabs button.active span { background: var(--amber); color: var(--navy); }
.inbox-layout { min-height: 620px; display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); overflow: hidden; }
.conversation-list { min-width: 0; border-right: 1px solid var(--border); background: var(--surface-2); }
.conversation-list-head { height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--ink); font-size: 12px; }
.conversation-list-head span { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 10px; }
.conversation-item { width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--body); text-align: left; cursor: pointer; }
.conversation-item:hover, .conversation-item.active { background: var(--surface); }
.conversation-item.active { box-shadow: inset 3px 0 var(--amber); }
.conversation-copy { min-width: 0; }
.conversation-copy > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conversation-copy strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy time { flex: none; color: var(--subtle); font-size: 8px; }
.conversation-copy p { margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item > b { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 999px; background: var(--amber); color: var(--navy); font-size: 9px; }
.email-direction-badge { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--teal) 13%, var(--surface)); color: var(--teal); font-size: 16px; font-weight: 800; }
.email-direction-badge.sent { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: var(--blue); }
.other-email-detail { min-height: 620px; padding: 24px; }
.other-email-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.other-email-head h2 { margin: 10px 0 0; color: var(--ink); font-size: 19px; line-height: 1.35; }
.other-email-head time { flex: none; color: var(--subtle); font-size: 10px; }
.other-email-meta { display: grid; gap: 7px; margin: 16px 0; }
.other-email-meta > div { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
.other-email-meta dt { color: var(--subtle); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.other-email-meta dd { margin: 0; overflow-wrap: anywhere; color: var(--body); font-size: 11px; }
.other-email-note { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.other-email-note strong, .other-email-note span { display: block; }
.other-email-note strong { flex: none; color: var(--ink); font-size: 10px; }
.other-email-note span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.other-email-body { min-height: 180px; padding: 18px 2px; color: var(--body); font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.other-email-body a { color: var(--blue); font-weight: 700; }
.conversation-detail { min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.conversation-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.conversation-mode { display: flex; align-items: center; gap: 8px; }
.conversation-thread { min-height: 340px; max-height: 470px; display: flex; flex-direction: column; gap: 10px; padding: 18px; overflow-y: auto; background: color-mix(in srgb, var(--surface-2) 65%, transparent); }
.conversation-empty { min-height: 360px; display: grid; align-content: center; justify-items: center; padding: 30px; color: var(--muted); text-align: center; }
.conversation-empty h3 { margin: 8px 0 0; }
.conversation-empty p { max-width: 320px; font-size: 11px; }
.conversation-pending { padding: 16px 18px; border-top: 1px solid var(--border); background: var(--amber-soft); }
.conversation-pending.needs-human { background: var(--red-soft); }
.conversation-pending > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.conversation-pending > div strong { color: var(--ink); font-size: 11px; }
.pending-reply { margin-top: 10px; padding: 13px; border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--border)); border-radius: 11px; background: var(--surface); }
.pending-reply.blocked { border-color: color-mix(in srgb, var(--red) 34%, var(--border)); }
.pending-reply.partial-answer { border-color: color-mix(in srgb, var(--amber) 55%, var(--border)); background: color-mix(in srgb, var(--amber) 5%, var(--surface)); }
.pending-reply p { margin: 0 0 10px; color: var(--body); font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.partial-draft { margin: 10px 0; padding: 12px; border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--border)); border-radius: 10px; background: var(--surface); }
.partial-draft > span { display: block; margin-bottom: 6px; color: var(--amber); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.partial-draft p { margin: 0; color: var(--body); font-size: 11px; line-height: 1.6; }
.missing-facts { margin: 10px 0; padding: 10px 12px; border-radius: 9px; background: color-mix(in srgb, var(--amber) 9%, var(--surface-2)); color: var(--body); font-size: 10px; }
.missing-facts strong { display: block; margin-bottom: 5px; color: var(--amber); }
.missing-facts ul { margin: 0; padding-left: 17px; }
.missing-facts li + li { margin-top: 3px; }
.grounding-trace { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 9px 0; font-size: 10px; color: var(--muted); }
.grounding-trace > span { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.grounding-trace > div { display: flex; flex-wrap: wrap; gap: 5px; }
.grounding-trace b { padding: 4px 7px; border: 1px solid color-mix(in srgb, var(--teal) 24%, var(--border)); border-radius: 999px; background: color-mix(in srgb, var(--teal) 7%, var(--surface)); color: var(--body); font-weight: 650; }
.grounding-trace.warning b { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); background: color-mix(in srgb, var(--amber) 10%, var(--surface)); }
.human-required, .pending-reason { display: block; margin-bottom: 5px; }
.human-required { color: var(--red); font-size: 12px; }
.pending-reason { color: var(--muted); font-size: 10px; }
.manual-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface); }
.manual-composer .field > span, .field-help { color: var(--subtle); font-size: 9px; }
.manual-composer .textarea { min-height: 70px; }
.knowledge-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 4px; }
.knowledge-stats > div { padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.knowledge-stats strong, .knowledge-stats span { display: block; }
.knowledge-stats strong { color: var(--ink); font: 800 24px "SFMono-Regular", Consolas, monospace; }
.knowledge-stats span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.knowledge-save { margin-top: 14px; }
.knowledge-list { display: grid; gap: 9px; margin-top: 12px; }
.knowledge-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.knowledge-row strong, .knowledge-row span { display: block; }
.knowledge-row strong { color: var(--ink); font-size: 11px; }
.knowledge-row span { margin-top: 4px; color: var(--subtle); font-size: 9px; }
.knowledge-row p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.knowledge-actions { display: flex; align-items: center; gap: 8px; }
.current-mode { display: flex; align-items: center; gap: 11px; margin: 12px 0 14px; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--green) 30%, var(--border)); border-radius: 11px; background: var(--green-soft); }
.current-mode.automatic { border-color: color-mix(in srgb, var(--red) 30%, var(--border)); background: var(--red-soft); }
.current-mode i { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--green); }
.current-mode.automatic i { background: var(--red); }
.current-mode strong, .current-mode span { display: block; }
.current-mode strong { color: var(--ink); font-size: 12px; }
.current-mode span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.mode-warning, .mode-note { margin-top: 12px; padding: 11px 13px; border-radius: 10px; font-size: 10px; line-height: 1.5; }
.mode-warning { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--orange-soft); color: var(--orange); }
.mode-warning strong, .mode-warning span { display: block; }
.mode-note { background: var(--surface-2); color: var(--muted); }
.document-lines { width: 100%; border-collapse: collapse; }
.document-lines th { text-align: left; padding: 7px; color: var(--muted); font-size: 10px; }
.document-lines td { padding: 5px; border-top: 1px solid var(--border); }
.document-lines input { min-height: 38px; padding: 7px 8px; }
.document-lines .line-name { min-width: 200px; }
.document-lines .line-number { width: 92px; }
.document-summary { width: min(320px, 100%); margin: 18px 0 0 auto; }
.document-terms { margin-top: 18px; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; font-size: 12px; }
.summary-row.grand { margin-top: 5px; padding-top: 12px; border-top: 2px solid var(--ink); color: var(--ink); font-size: 16px; font-weight: 850; }
.validation-list { margin: 12px 0 0; padding: 11px 13px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 11px; }
.delivery-proof { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px; border: 1px solid color-mix(in srgb, var(--green) 24%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--green-soft) 72%, var(--surface)); }
.delivery-proof-icon { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: white; font-weight: 900; }
.delivery-proof > div { display: grid; gap: 4px; min-width: 0; }
.delivery-proof > div > span { color: var(--muted); font-size: 10px; }
.delivery-proof-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 5px; }
.delivery-proof-actions a { color: var(--green); font-size: 11px; font-weight: 800; }
.fiche-flow { display: flex; align-items: center; gap: 7px; margin: 16px 0 22px; overflow-x: auto; color: var(--subtle); font-size: 9px; white-space: nowrap; }
.fiche-flow span { padding: 7px 9px; border: 1px solid var(--border); border-radius: 999px; }
.fiche-flow span.done { border-color: color-mix(in srgb, var(--green) 30%, var(--border)); background: var(--green-soft); color: var(--green); font-weight: 800; }
.fiche-template-list { display: grid; gap: 8px; margin-top: 12px; }
.fiche-template { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); color: var(--body); text-align: left; cursor: pointer; }
.fiche-template:hover, .fiche-template.selected { border-color: var(--amber); background: var(--amber-soft); }
.fiche-template strong, .fiche-template small { display: block; }
.fiche-template strong { color: var(--ink); font-size: 11px; }
.fiche-template small { margin-top: 4px; color: var(--subtle); font-size: 9px; }
.fiche-template em { flex: none; font-style: normal; }
.fiche-editor-head, .fiche-actions, .fiche-opportunity-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fiche-editor-head h3, .fiche-editor-head p, .fiche-opportunity-card h3, .fiche-opportunity-card p { margin: 0; }
.fiche-editor > .field { margin: 16px 0; }
.fiche-catalog-choice { margin-bottom: 16px; }
.fiche-catalog-choice label { display: flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.fiche-catalog-choice input { width: 18px; height: 18px; accent-color: var(--accent); }
.fiche-catalog-choice p { margin: 8px 0 0 26px; }
.fiche-schema-head, .fiche-schema-row { display: grid; grid-template-columns: 1.35fr 1fr 110px 90px 32px; gap: 7px; align-items: center; }
.fiche-schema-head { padding: 0 3px 6px; color: var(--subtle); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.fiche-schema-row { margin-bottom: 8px; }
.fiche-schema-row .input { min-width: 0; min-height: 38px; padding: 7px 8px; font-size: 10px; }
.fiche-required { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.fiche-required input { width: 16px; height: 16px; accent-color: var(--amber); }
.fiche-options { grid-column: 1 / -1; }
.fiche-schema-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.fiche-actions { justify-content: flex-end; margin-top: 15px; }
.fiche-submissions { display: grid; gap: 7px; margin-top: 12px; }
.fiche-submissions > div { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.fiche-submissions strong { color: var(--ink); font-size: 12px; }
.fiche-submissions small { color: var(--subtle); font-size: 11px; }
.fiche-submission-action { display: flex; flex-wrap: wrap; justify-content: flex-end; justify-self: end; gap: var(--space-2); }
.fiche-submission-action .button { white-space: nowrap; }
.fiche-analysis { display: grid; gap: var(--space-4); }
.fiche-analysis-summary { margin: 0; padding: var(--space-4); border-left: 4px solid var(--amber); border-radius: 0 12px 12px 0; background: var(--amber-soft); color: var(--ink); line-height: 1.6; }
.analysis-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr); gap: var(--space-2); }
.analysis-metrics > div { display: grid; gap: var(--space-1); min-width: 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.analysis-metrics strong { overflow: hidden; color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.analysis-metrics span { color: var(--subtle); font-size: 11px; }
.analysis-section, .analysis-alert { padding: var(--space-4); border: 1px solid var(--border); border-radius: 12px; }
.analysis-section h3, .analysis-alert h3 { margin: 0 0 var(--space-2); color: var(--ink); font-size: 14px; }
.analysis-section ul, .analysis-alert ul { display: grid; gap: var(--space-2); margin: 0; padding-left: 20px; color: var(--body); line-height: 1.5; }
.analysis-alert.warning { border-color: color-mix(in srgb, var(--amber) 42%, var(--border)); background: var(--amber-soft); }
.analysis-alert.danger { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); background: color-mix(in srgb, var(--red) 12%, var(--surface)); }
.analysis-metrics strong { white-space: normal; overflow-wrap: anywhere; }
.fiche-analysis-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-4); padding: var(--space-4); border-left: 4px solid var(--amber); }
.fiche-analysis-card h3, .fiche-analysis-card p { margin: var(--space-2) 0 0; }
.fiche-analysis-card-actions { display: flex; flex: 0 0 auto; align-items: center; gap: var(--space-2); }
.review-fields { display: grid; gap: 12px; margin-top: 18px; }
.review-field { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.review-field.has-issue { border-color: rgba(201, 99, 46, .46); background: rgba(255, 244, 232, .72); }
.review-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-field-head label { color: var(--ink); font-size: 11px; font-weight: 700; }
.review-field small { color: var(--subtle); font-size: 9px; line-height: 1.45; }
.confidence-pill { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: rgba(42, 120, 83, .12); color: var(--green); font-size: 9px; font-weight: 800; }
.confidence-pill.low { background: rgba(201, 99, 46, .13); color: #a94f25; }
.review-checkbox { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 10px; }
.review-checkbox input { width: 16px; height: 16px; accent-color: var(--green); }
.fiche-opportunity-card { margin-top: 12px; border-left: 4px solid var(--green); }

@media (max-width: 1120px) {
  :root { --sidebar: 84px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand-copy, .nav-label, .nav-badge, .agent-status, .sidebar-user div { display: none; }
  .nav-button { justify-content: center; padding: 0; }
  .nav-button::before { left: -16px; }
  .sidebar-user { justify-content: center; padding-inline: 0; }
  .review-grid { grid-template-columns: repeat(2, 1fr); }
  .lead-priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-lower { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .supervisor-agent-grid { grid-template-columns: 1fr; }
  .followup-report-grid { grid-template-columns: repeat(2, 1fr); }
  .followup-plan-list article { align-items: stretch; flex-direction: column; }
  .gmail-sandbox-test, .mail-candidates article, .mail-privacy-controls { align-items: stretch; flex-direction: column; }
  .mail-privacy-controls > div:last-child { justify-content: stretch; }
  .mail-privacy-controls .button { width: 100%; }
  .import-progress-meta { align-items: flex-start; flex-direction: column; }
  .opportunity-next-action { align-items: stretch; flex-direction: column; }
  .opportunity-state-actions { min-width: 0; justify-content: stretch; }
  .opportunity-state-actions .input, .opportunity-state-actions .button { width: 100%; }
  .mail-learning-options, .style-profile { grid-template-columns: 1fr; }
  :root { --sidebar: 0px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .content-shell { margin-left: 0; }
  .topbar { height: 62px; padding: 0 16px; }
  .topbar .eyebrow { display: none; }
  .topbar-title { font-size: 16px; }
  .main { padding: 18px 16px 24px; }
  .page-head { display: block; margin-bottom: 18px; }
  .page-actions { margin-top: 14px; justify-content: stretch; }
  .page-actions .button { flex: 1; }
  h1 { font-size: 22px; }
  .review-grid, .metric-grid, .form-grid, .mode-options, .provider-grid { grid-template-columns: 1fr; }
  .lead-priority-grid { grid-template-columns: 1fr; }
  .review-grid { gap: 10px; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 112px; }
  .metric-value { font-size: 27px; }
  .dashboard-lower { display: grid; grid-template-columns: minmax(0, 1fr); }
  .feed-item { grid-template-columns: 42px 1fr; }
  .feed-arrow { display: none; }
  .filter-bar .search, .filter-bar .select { max-width: none; width: 100%; }
  .kanban { display: block; overflow: visible; }
  .kanban-column { margin-bottom: 12px; min-height: 0; }
  .settings-layout { display: block; }
  .settings-mobile-picker { display: grid; gap: 6px; margin-bottom: 12px; }
  .settings-mobile-picker span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
  .settings-mobile-picker .input { color: var(--ink); background: var(--surface); font-weight: 750; }
  .settings-nav { display: none; }
  .table-card { margin-inline: -16px; border-radius: 0; border-inline: 0; }
  .modal { width: calc(100vw - 16px); max-height: calc(100vh - 18px); border-radius: 15px; }
  .modal-body { padding: 16px; }
  .inbox-tabs { width: 100%; }
  .inbox-tabs button { flex: 1; padding-inline: 8px; }
  .inbox-layout { min-height: 0; display: block; }
  .conversation-list { max-height: 280px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .conversation-head { align-items: flex-start; flex-direction: column; }
  .conversation-mode { width: 100%; justify-content: space-between; }
  .conversation-thread { max-height: 430px; }
  .manual-composer { grid-template-columns: 1fr; }
  .manual-composer .button { width: 100%; }
  .other-email-detail { min-height: 0; padding: 18px 16px; }
  .other-email-head { flex-direction: column; gap: 8px; }
  .other-email-note { flex-direction: column; gap: 4px; }
  .knowledge-stats { grid-template-columns: 1fr 1fr; }
  .fiche-schema-head { display: none; }
  .fiche-schema-row { grid-template-columns: minmax(0, 1fr) 84px 32px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
  .fiche-schema-row [data-fiche-key="label"], .fiche-schema-row [data-fiche-key="name"], .fiche-options { grid-column: 1 / -1; }
  .fiche-schema-row [data-fiche-key="type"] { grid-column: 1; }
  .fiche-schema-row .fiche-required { grid-column: 2; }
  .fiche-schema-row .icon-button { grid-column: 3; grid-row: 3; }
  .fiche-actions, .fiche-opportunity-card { align-items: stretch; flex-direction: column; }
  .fiche-actions .button { width: 100%; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 50; height: calc(62px + env(safe-area-inset-bottom)); padding: 5px 3px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--border); backdrop-filter: blur(18px); box-shadow: 0 -8px 26px rgba(15,22,41,.08); }
  .mobile-nav button { min-height: 52px; border: 0; background: transparent; color: var(--subtle); display: grid; place-items: center; align-content: center; gap: 3px; font-size: 9px; }
  .mobile-nav button span:first-child { font-size: 17px; }
  .mobile-nav button.active { color: var(--amber-dark); font-weight: 850; }
  .toast-region { inset: 10px 10px auto; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}

/* M6UX.1 — cockpit visuel guidé par les vidéos du dashboard original */
:root {
  --sidebar: 216px;
  --transition: 180ms cubic-bezier(.2, .8, .2, 1);
}

:root:not([data-theme="dark"]) {
  --navy: #172033;
  --navy-2: #22304a;
  --navy-3: #304263;
  --blue: #3276e8;
  --blue-soft: #edf4ff;
  --page: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f3f7fd;
  --border: #e6eaf0;
  --ink: #182033;
  --body: #384358;
  --muted: #59677e;
  --subtle: #626d82;
  --shadow-card: 0 1px 2px rgba(18, 31, 53, .04), 0 8px 22px rgba(18, 31, 53, .035);
  --shadow-float: 0 22px 70px rgba(18, 31, 53, .16);
}

html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(circle at 72% -12%, color-mix(in srgb, var(--blue) 5%, transparent), transparent 34rem),
    var(--page);
}

.sidebar {
  width: var(--sidebar);
  padding: 18px 12px 16px;
  color: var(--body);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 28px rgba(19, 34, 57, .025);
  backdrop-filter: blur(18px);
}
.brand { gap: 10px; min-height: 52px; padding: 0 10px 18px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: white;
  background: linear-gradient(145deg, #4b8df4, #2465d2);
  box-shadow: 0 8px 20px rgba(50, 118, 232, .24);
  transition: transform 260ms cubic-bezier(.2, 1.4, .3, 1), box-shadow var(--transition);
}
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.06); box-shadow: 0 12px 28px rgba(50, 118, 232, .3); }
.brand-name { color: var(--ink); font-size: 15px; letter-spacing: -.025em; }
.brand-name span { color: inherit; }
.brand-caption { margin-top: 4px; color: var(--subtle); font-size: 8px; }
.nav { gap: 3px; }
.nav-button {
  min-height: 42px;
  padding: 0 11px;
  gap: 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  transition: color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.nav-button::before { left: -12px; width: 3px; height: 22px; background: transparent; }
.nav-button:hover { color: var(--ink); background: var(--surface-2); transform: translateX(2px); }
.nav-button.active {
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 6%, transparent);
}
.nav-button.active::before { background: var(--blue); }
.nav-icon { width: 19px; color: currentColor; font-size: 15px; }
.nav-badge { color: white; background: var(--blue); box-shadow: 0 3px 10px rgba(50, 118, 232, .22); }
.agent-status {
  margin: 10px 3px;
  padding: 11px;
  border-color: var(--border);
  background: var(--surface-2);
  border-radius: 10px;
}
.agent-status-title { margin-bottom: 8px; color: var(--subtle); }
.status-line { margin-top: 6px; color: var(--muted); font-size: 9px; }
.status-dot { animation: agentPulse 2.2s ease-out infinite; }
.sidebar-user { padding: 11px 8px 2px; border-top-color: var(--border); }
.sidebar-user strong { color: var(--ink); }
.sidebar-user span { color: var(--muted); }
.sidebar-user .avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); }

.content-shell { margin-left: var(--sidebar); }
.topbar {
  height: 68px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(18, 31, 53, .02);
}
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 18px; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 10px; font-weight: 750; white-space: nowrap; }
.connection-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 10%, transparent); animation: agentPulse 2.2s ease-out infinite; }
.global-search {
  width: min(390px, 38vw);
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  font-size: 10px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.global-search > span:first-child { color: var(--subtle); font-size: 17px; }
.global-search > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search kbd { margin-left: auto; padding: 3px 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--subtle); background: var(--surface); font: 8px inherit; }
.global-search:hover { border-color: color-mix(in srgb, var(--blue) 28%, var(--border)); background: var(--surface); box-shadow: 0 5px 18px rgba(28, 57, 99, .06); transform: translateY(-1px); }
.topbar-actions { gap: 7px; }
.icon-button { width: 38px; height: 38px; border-radius: 10px; color: var(--muted); box-shadow: 0 1px 2px rgba(17, 30, 50, .02); }
.icon-button:hover { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 24%, var(--border)); background: var(--blue-soft); transform: translateY(-2px); }

.main { max-width: 1540px; padding: 24px 26px 34px; }
.main > * { animation: pageReveal 360ms both cubic-bezier(.2, .8, .2, 1); }
.page-head { align-items: flex-end; margin-bottom: 20px; }
.page-head h1 { margin-bottom: 5px; font-size: clamp(23px, 2vw, 28px); }
.page-head p { font-size: 11px; }
.page-kicker { display: block; margin-bottom: 7px; color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .105em; text-transform: uppercase; }
.button-symbol { font-size: 16px; line-height: 0; }

.card {
  border-color: var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition);
}
.button, .icon-button, .nav-button, [data-action] { position: relative; overflow: hidden; isolation: isolate; }
.button { min-height: 40px; border-radius: 9px; font-size: 11px; }
.button.primary { color: white; background: linear-gradient(135deg, #3d80ed, #286bdc); box-shadow: 0 7px 18px rgba(50, 118, 232, .2); }
.button.primary:hover { background: linear-gradient(135deg, #4b8df4, #2c70e3); box-shadow: 0 10px 24px rgba(50, 118, 232, .27); }
.button.secondary:hover { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, var(--border)); background: var(--blue-soft); }
.button.ui-pressed, .icon-button.ui-pressed, .nav-button.ui-pressed { animation: pressBounce 340ms cubic-bezier(.2, 1.5, .4, 1); }
.click-ripple { position: absolute; z-index: -1; width: 14px; height: 14px; border-radius: 50%; background: currentColor; opacity: .14; pointer-events: none; transform: translate(-50%, -50%) scale(0); animation: clickRipple 520ms ease-out forwards; }

.dashboard-page > * { animation: dashboardRise 420ms both cubic-bezier(.2, .8, .2, 1); }
.dashboard-page > :nth-child(2) { animation-delay: 45ms; }
.dashboard-page > :nth-child(3) { animation-delay: 90ms; }
.dashboard-page > :nth-child(4) { animation-delay: 125ms; }
.dashboard-page > :nth-child(5) { animation-delay: 160ms; }
.dashboard-page > :nth-child(6) { animation-delay: 195ms; }

.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 132px; padding: 16px; cursor: default; }
.metric-card::before { display: none; }
.metric-card::after { content: ""; position: absolute; inset: auto -28px -35px auto; width: 96px; height: 96px; border-radius: 50%; background: color-mix(in srgb, var(--metric) 5%, transparent); transition: transform 320ms ease, opacity 320ms ease; }
.metric-card:hover { z-index: 1; transform: translateY(-4px); border-color: color-mix(in srgb, var(--metric) 24%, var(--border)); box-shadow: 0 16px 36px rgba(23, 42, 72, .09); }
.metric-card:hover::after { transform: scale(1.25); opacity: .7; }
.metric-top { min-height: 27px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.metric-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--metric); background: color-mix(in srgb, var(--metric) 9%, var(--surface)); font-size: 13px; font-weight: 850; transition: transform 300ms cubic-bezier(.2, 1.4, .3, 1); }
.metric-card:hover .metric-icon { transform: rotate(-5deg) scale(1.1); }
.metric-trend { max-width: 90px; padding: 3px 6px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 7px; font-weight: 800; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-value { margin-top: 12px; color: var(--ink); font-size: 24px; line-height: 1; letter-spacing: -.055em; }
.metric-label { margin-top: 8px; color: var(--ink); font-size: 9px; letter-spacing: .02em; text-transform: none; }
.metric-note { margin-top: 4px; color: var(--subtle); font-size: 8px; }

.action-banner { min-height: 58px; margin-bottom: 18px; padding: 11px 15px; border-radius: 11px; }
.banner-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; }
.action-banner strong { font-size: 12px; }
.action-banner span { font-size: 10px; }
.section-head { align-items: center; }
.section-head h2 { font-size: 15px; }
.section-head p { font-size: 10px; }
.count-chip { font-size: 9px; }

.dashboard-review-section,
.lead-priority-section,
.fiche-dashboard-section {
  margin-bottom: 18px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.fiche-task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fiche-task-card { min-width: 0; padding: 14px; border-left: 3px solid var(--amber); box-shadow: none; background: var(--surface-2); }
.fiche-task-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--amber) 42%, var(--border)); background: var(--surface); box-shadow: 0 10px 24px rgba(23, 42, 72, .07); }
.fiche-task-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.fiche-task-head .avatar { width: 34px; height: 34px; }
.fiche-task-head strong, .fiche-task-head span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fiche-task-head strong { color: var(--ink); font-size: 12px; }
.fiche-task-head > div > span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.fiche-task-card h3 { margin: 13px 0 5px; color: var(--ink); font-size: 13px; }
.fiche-task-card > p { min-height: 32px; margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.fiche-task-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.review-field.has-server-error { border-color: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 12%, transparent); }
.review-field-errors { display: grid; gap: 3px; }
.review-server-error { color: var(--danger); font-weight: 700; }
.dashboard-review-section .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.dashboard-review-section .review-card { padding: 14px; background: var(--surface-2); border-left-width: 3px; animation: none; box-shadow: none; }
.dashboard-review-section .review-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 24%, var(--border)); background: var(--surface); box-shadow: 0 10px 24px rgba(23, 42, 72, .07); }
.review-card { border-left-color: var(--blue); }
.blocked-question-card { border-left-color: var(--red); }
.review-person strong { font-size: 12px; }
.review-person span, .draft-preview { font-size: 10px; }
.draft-preview { min-height: 46px; margin-bottom: 11px; }
.review-meta { margin-bottom: 10px; }
.review-actions { gap: 6px; }
.review-actions-row { gap: 6px; }
.review-actions .button { min-height: 34px; font-size: 9px; }

.lead-priority-section { padding-bottom: 18px; }
.lead-priority-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 0; }
.lead-priority-card { padding: 13px; box-shadow: none; background: var(--surface-2); }
.lead-priority-card:hover, .lead-priority-card:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--blue) 23%, var(--border)); background: var(--surface); box-shadow: 0 12px 28px rgba(23, 42, 72, .08); }
.lead-score { font-size: 17px; }
.lead-priority-card > p { min-height: 30px; }
.score-disclaimer { color: var(--subtle); font-size: 8px; }
.dashboard-lower { gap: 12px; }
.dashboard-lower > .card { padding: 17px; }
.feed-item { min-height: 42px; }

.input:focus, .select:focus, .textarea:focus { border-color: color-mix(in srgb, var(--blue) 55%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 9%, transparent); outline: 0; }
.conversation-item.active { box-shadow: inset 3px 0 var(--blue); }
.settings-nav button.active { color: var(--blue); background: var(--blue-soft); }
.view-switcher button.active { background: var(--blue); }
.mobile-nav button.active { color: var(--blue); }

.toast { padding-left: 42px; border-left: 0; box-shadow: 0 18px 55px rgba(18, 31, 53, .18); animation: toastInPremium 340ms cubic-bezier(.2, 1.3, .4, 1); }
.toast::before { content: "✓"; position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; color: white; background: var(--green); transform: translateY(-50%); font-size: 10px; font-weight: 900; }
.toast.error::before { content: "!"; background: var(--red); }

@keyframes pageReveal { from { opacity: 0; } }
@keyframes dashboardRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pressBounce { 0% { transform: scale(1); } 38% { transform: scale(.965); } 100% { transform: scale(1); } }
@keyframes clickRipple { to { opacity: 0; transform: translate(-50%, -50%) scale(15); } }
@keyframes agentPulse { 0%, 55%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 28%, transparent); } 72% { box-shadow: 0 0 0 6px transparent; } }
@keyframes toastInPremium { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (min-width: 768px) and (max-width: 1120px) {
  :root { --sidebar: 196px; }
  .brand { justify-content: flex-start; padding-inline: 10px; }
  .brand-copy, .nav-label, .nav-badge, .agent-status, .sidebar-user div { display: block; }
  .nav-button { justify-content: flex-start; padding: 0 10px; }
  .nav-button::before { left: -12px; }
  .sidebar-user { justify-content: flex-start; padding-inline: 8px; }
  .main { padding-inline: 22px; }
  .lead-priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 940px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-review-section .review-grid { grid-template-columns: 1fr; }
  .global-search { width: min(300px, 34vw); }
}

@media (max-width: 767px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .content-shell { margin-left: 0; }
  .topbar { height: 60px; padding: 0 13px; }
  .topbar-left { gap: 0; }
  .connection-state { display: none; }
  .global-search { width: 38px; min-height: 38px; padding: 0; justify-content: center; background: var(--surface); border-color: var(--border); }
  .global-search > span:nth-child(2), .global-search kbd { display: none; }
  .main { padding: 18px 14px 28px; }
  .page-head { display: block; margin-bottom: 17px; }
  .page-actions { margin-top: 13px; justify-content: stretch; }
  .page-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric-card { min-height: 124px; padding: 13px; }
  .metric-value { font-size: 21px; }
  .metric-trend { display: none; }
  .dashboard-review-section, .lead-priority-section { padding: 13px; margin-inline: -1px; }
  .dashboard-review-section .review-grid, .review-grid, .lead-priority-grid, .form-grid, .mode-options, .provider-grid { grid-template-columns: 1fr; }
  .dashboard-lower { grid-template-columns: minmax(0, 1fr); }
  .mobile-nav { display: grid; }
  .mobile-nav button.active { color: var(--blue); }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-label { font-size: 8px; }
  .metric-card { min-width: 0; }
  .topbar-actions { gap: 4px; }
  .icon-button { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .main > *, .dashboard-page > *, .status-dot, .connection-state i, .toast { animation: none !important; }
  .click-ripple { display: none; }
}

/* M3 — onboarding traiteur guidé */
.onboarding-shortcut {
  width: 100%; min-height: 34px; margin-top: 11px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 8px;
  transition: border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.onboarding-shortcut strong { color: var(--blue); font-size: 8px; }
.onboarding-shortcut:hover { color: var(--ink); border-color: color-mix(in srgb, var(--blue) 30%, var(--border)); box-shadow: 0 6px 16px rgba(31, 67, 119, .08); transform: translateY(-1px); }
.login-divider { position: relative; height: 18px; display: grid; place-items: center; color: var(--subtle); font-size: 9px; }
.login-divider::before { content: ""; position: absolute; inset: 50% 0 auto; height: 1px; background: var(--border); }
.login-divider span { position: relative; padding: 0 10px; background: var(--surface); }
.register-card { width: min(720px, 100%); padding: 30px; }
.register-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 16px; align-items: start; }
.register-heading .brand-mark { width: 42px; height: 42px; }
.register-heading h1 { margin-bottom: 6px; }
.register-heading p { line-height: 1.5; }
.password-hint { display: flex; flex-wrap: wrap; gap: 7px 12px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: var(--surface-2); font-size: 9px; }
.password-hint span::first-letter { color: var(--green); }

.onboarding-shell { width: min(940px, 100%); margin: 0 auto; padding: 8px 0 30px; }
.onboarding-intro { max-width: 660px; margin: 0 auto 24px; text-align: center; animation: dashboardRise 420ms both; }
.onboarding-intro h1 { font-size: clamp(24px, 3vw, 32px); }
.onboarding-intro p { margin: 7px auto 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.onboarding-stepper { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 auto 18px; padding: 0 20px; }
.onboarding-stepper > i { position: absolute; z-index: 0; left: 10%; right: 10%; top: 17px; height: 3px; overflow: hidden; border-radius: 999px; background: var(--border); }
.onboarding-stepper > i::after { content: ""; display: block; width: var(--onboarding-progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #79a8f4); transition: width 420ms cubic-bezier(.2, .8, .2, 1); }
.onboarding-step { position: relative; z-index: 1; display: grid; justify-items: center; gap: 7px; color: var(--subtle); text-align: center; }
.onboarding-step > span { width: 36px; height: 36px; display: grid; place-items: center; border: 3px solid var(--page); border-radius: 50%; color: var(--subtle); background: var(--surface); box-shadow: 0 0 0 1px var(--border); font-size: 12px; font-weight: 850; transition: transform 260ms cubic-bezier(.2, 1.4, .3, 1), color var(--transition), background var(--transition), box-shadow var(--transition); }
.onboarding-step strong { font-size: 9px; font-weight: 750; }
.onboarding-step.active { color: var(--blue); }
.onboarding-step.active > span { color: white; background: var(--blue); box-shadow: 0 0 0 1px var(--blue), 0 7px 18px rgba(50, 118, 232, .24); transform: scale(1.08); }
.onboarding-step.done { color: var(--green); }
.onboarding-step.done > span { color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 30%, var(--border)); }
.onboarding-card { overflow: visible; animation: dashboardRise 430ms 80ms both cubic-bezier(.2, .8, .2, 1); }
.onboarding-card-head { min-height: 76px; padding: 17px 23px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border); }
.onboarding-card-head span { color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.onboarding-card-head h2 { margin: 4px 0 0; font-size: 19px; }
.onboarding-card-head em { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: 8px; font-style: normal; white-space: nowrap; }
.onboarding-card-body { min-height: 360px; padding: 24px; }
.onboarding-copy { max-width: 670px; margin-bottom: 20px; }
.onboarding-copy h3 { margin-bottom: 6px; font-size: 16px; }
.onboarding-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.onboarding-form { gap: 15px; }
.onboarding-form .field label { color: var(--ink); }
.onboarding-card-foot { min-height: 70px; padding: 13px 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 13px 13px; }
.onboarding-card-foot > .button:last-child { justify-self: end; }
.onboarding-card-foot > .button:first-child { justify-self: start; }
.onboarding-safe-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.onboarding-safe-note span { color: var(--green); font-size: 7px; }
.onboarding-guardrail, .onboarding-activation-note { margin-top: 20px; padding: 15px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; border: 1px solid color-mix(in srgb, var(--green) 20%, var(--border)); border-radius: 11px; background: var(--green-soft); }
.onboarding-guardrail > span, .onboarding-activation-note > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--green); font-weight: 900; }
.onboarding-guardrail strong, .onboarding-activation-note strong { display: block; color: var(--ink); font-size: 11px; }
.onboarding-guardrail p, .onboarding-activation-note p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.onboarding-catalog { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
.onboarding-catalog-row { min-width: 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); box-shadow: var(--shadow-card); animation: dashboardRise 220ms both; }
.catalog-row-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.catalog-row-heading strong { color: var(--ink); font-size: 13px; }
.catalog-essential-grid, .catalog-advanced-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.catalog-essential-grid .field, .catalog-advanced-grid .field { min-width: 0; }
.catalog-essential-grid label, .catalog-advanced-grid label { font-size: 11px; }
.catalog-name { grid-column: span 2; }
.catalog-description { grid-column: 1 / -1; }
.onboarding-catalog-row .input, .onboarding-catalog-row .textarea { min-width: 0; min-height: 40px; background: var(--surface); font-size: 12px; }
.catalog-advanced { margin-top: var(--space-3); border-top: 1px solid var(--border); }
.catalog-advanced summary { padding: var(--space-3) 0; color: var(--blue); font-size: 11px; font-weight: 800; cursor: pointer; }
.catalog-flags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-3); }
.catalog-flags label { display: flex; align-items: center; gap: var(--space-2); min-width: 0; color: var(--body); font-size: 11px; }
.catalog-flags input { width: 16px; height: 16px; flex: none; accent-color: var(--blue); }
.onboarding-simulation { display: grid; grid-template-columns: minmax(0, .9fr) minmax(280px, 1.1fr); gap: 18px; align-items: start; }
.onboarding-simulation > .button { grid-column: 1; width: fit-content; }
.onboarding-preview, .onboarding-preview-empty { grid-column: 2; grid-row: 1 / span 2; min-height: 250px; padding: 18px; border-radius: 12px; }
.onboarding-preview { border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--border)); background: linear-gradient(145deg, var(--surface), var(--blue-soft)); box-shadow: 0 12px 30px rgba(33, 69, 122, .07); animation: dashboardRise 330ms both; }
.onboarding-preview-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.onboarding-preview-top strong { color: var(--green); font-size: 9px; }
.onboarding-preview > p { margin: 18px 0; color: var(--body); font-size: 11px; line-height: 1.65; white-space: pre-wrap; }
.onboarding-preview-proof { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 12px; border-top: 1px solid var(--border); }
.onboarding-preview-proof span { color: var(--green); font-size: 8px; font-weight: 750; }
.onboarding-preview-empty { display: grid; place-items: center; align-content: center; border: 1px dashed var(--border); color: var(--muted); background: var(--surface-2); text-align: center; }
.onboarding-preview-empty span { color: var(--blue); font-size: 28px; }
.onboarding-preview-empty p { max-width: 220px; margin: 10px 0 0; font-size: 10px; line-height: 1.5; }
.onboarding-readiness { display: grid; gap: 8px; }
.onboarding-readiness > div { min-height: 48px; padding: 0 13px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.onboarding-readiness > div > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 10px; font-weight: 900; }
.onboarding-readiness > div.complete > span { color: var(--green); background: var(--green-soft); }
.onboarding-readiness strong { color: var(--ink); font-size: 10px; }
.onboarding-readiness em { color: var(--red); font-size: 8px; font-style: normal; font-weight: 800; }
.onboarding-readiness .complete em { color: var(--green); }
.onboarding-settings-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.onboarding-settings-summary > div { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.onboarding-settings-summary span, .onboarding-settings-summary strong { display: block; }
.onboarding-settings-summary span { color: var(--muted); font-size: 9px; }
.onboarding-settings-summary strong { margin-top: 5px; color: var(--ink); font-size: 11px; }

@media (max-width: 900px) {
  .onboarding-step strong { display: none; }
  .onboarding-card-body { min-height: 330px; }
  .onboarding-simulation { grid-template-columns: 1fr; }
  .onboarding-preview, .onboarding-preview-empty { grid-column: 1; grid-row: auto; }
}

@media (max-width: 767px) {
  .register-card { padding: 22px 18px; }
  .register-heading { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; }
  .register-heading .brand-mark { width: 36px; height: 36px; }
  .onboarding-shell { padding-top: 2px; }
  .onboarding-intro { margin-bottom: 18px; text-align: left; }
  .onboarding-intro p { font-size: 10px; }
  .onboarding-stepper { padding-inline: 4px; }
  .onboarding-stepper > i { left: 9%; right: 9%; }
  .onboarding-step > span { width: 32px; height: 32px; font-size: 10px; }
  .onboarding-card { margin-inline: -4px; }
  .onboarding-card-head { min-height: 66px; padding: 13px 15px; }
  .onboarding-card-head h2 { font-size: 17px; }
  .onboarding-card-body { min-height: 0; padding: 18px 15px; }
  .onboarding-card-foot { position: sticky; bottom: 62px; z-index: 8; min-height: 64px; padding: 10px 12px; grid-template-columns: auto 1fr; box-shadow: 0 -10px 24px rgba(22, 39, 67, .06); }
  .onboarding-safe-note { display: none; }
  .onboarding-card-foot > .button:last-child { justify-self: stretch; }
  .onboarding-card-foot .button { min-height: 40px; padding-inline: 11px; font-size: 9px; }
  .onboarding-catalog-row { padding: var(--space-3); }
  .catalog-essential-grid, .catalog-advanced-grid, .catalog-flags { grid-template-columns: 1fr; }
  .catalog-name, .catalog-description { grid-column: 1; }
  .onboarding-settings-summary { grid-template-columns: 1fr; }
}

/* M6UX.2 — action suivante, états vides guidés et parcours fiche → devis → envoi */
.action-banner-copy { min-width: 0; flex: 1; }
.action-banner > .button { flex: none; margin-left: auto; }
.action-banner > .button span { color: inherit; font-size: inherit; }
.button-spinner { width: 14px; height: 14px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: buttonSpin 650ms linear infinite; }
.empty-state > .button { margin-top: 16px; }
.kanban .empty-state { padding: 26px 12px; box-shadow: none; background: var(--surface-2); }
.kanban .empty-state .empty-icon { width: 38px; height: 38px; margin-bottom: 10px; border-radius: 12px; font-size: 17px; }
.kanban .empty-state h3 { font-size: 11px; }
.kanban .empty-state p { font-size: 9px; line-height: 1.45; }
.toast { position: relative; }

.journey-card { margin-top: 12px; padding: 16px; }
.logistics-card { margin-top: var(--space-3); padding: var(--space-3); }
.logistics-card .journey-head { margin-bottom: var(--space-2); }
.logistics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.logistics-grid > div { min-width: 0; padding: var(--space-2); border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.logistics-grid small, .logistics-grid strong { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.logistics-grid small { color: var(--muted); font-size: 11px; }
.logistics-grid strong { margin-top: var(--space-1); color: var(--ink); font-size: 12px; white-space: nowrap; }
.journey-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.journey-head h3 { margin-top: 4px; color: var(--ink); font-size: 14px; }
.journey-head > strong { color: var(--muted); font-size: 10px; }
.journey-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.journey-step { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.journey-step:not(:last-child)::after { content: ""; position: absolute; left: calc(100% + 1px); top: 50%; z-index: 2; width: 7px; height: 2px; background: var(--border); }
.journey-dot { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 50%; color: var(--subtle); background: var(--surface); border: 1px solid var(--border); font-size: 9px; font-weight: 900; }
.journey-step strong, .journey-step small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journey-step strong { color: var(--ink); font-size: 10px; }
.journey-step small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.journey-step.done { border-color: color-mix(in srgb, var(--green) 25%, var(--border)); background: var(--green-soft); }
.journey-step.done .journey-dot { color: white; border-color: var(--green); background: var(--green); }
.journey-step.active { border-color: color-mix(in srgb, var(--blue) 30%, var(--border)); background: var(--blue-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 8%, transparent); }
.journey-step.active .journey-dot { color: white; border-color: var(--blue); background: var(--blue); }
.stage-history { margin-top: var(--space-3); border-top: 1px solid var(--border); padding-top: var(--space-2); }
.stage-history summary { min-height: 36px; display: flex; align-items: center; color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; }
.stage-history > div { display: grid; gap: var(--space-2); padding-top: var(--space-2); }
.stage-history p { display: grid; grid-template-columns: minmax(90px, auto) 1fr auto; align-items: center; gap: var(--space-2); margin: 0; min-width: 0; }
.stage-history p strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.stage-history p small, .stage-history-empty { color: var(--muted); font-size: 11px; }
.stage-history-empty { margin: var(--space-3) 0 0; border-top: 1px solid var(--border); padding-top: var(--space-2); }
.workflow-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-3) 0; }
.workflow-field-choice { display: flex; align-items: center; gap: var(--space-2); min-height: 52px; border: 1px solid var(--border); border-radius: 12px; padding: var(--space-2) var(--space-3); background: var(--surface-soft); cursor: pointer; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.workflow-field-choice:hover { border-color: var(--blue); transform: translateY(-1px); }
.workflow-field-choice:has(input:checked) { border-color: color-mix(in srgb, var(--blue) 65%, var(--border)); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.workflow-field-choice input { width: 18px; height: 18px; accent-color: var(--blue); }
.workflow-field-choice span { display: grid; gap: 2px; min-width: 0; }
.workflow-field-choice strong { color: var(--ink); font-size: 13px; }
.workflow-field-choice small { color: var(--muted); font-size: 11px; }

@keyframes buttonSpin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  .action-banner { align-items: flex-start; flex-wrap: wrap; }
  .action-banner > .button { width: calc(100% - 43px); margin-left: 43px; }
  .fiche-task-grid { grid-template-columns: 1fr; }
  .fiche-task-actions .button { flex: 1 1 100%; }
  .journey-steps { grid-template-columns: 1fr; }
  .logistics-grid { grid-template-columns: 1fr; }
  .journey-step:not(:last-child)::after { left: 22px; top: calc(100% + 1px); width: 2px; height: 7px; }
  .stage-history p { grid-template-columns: 1fr; gap: var(--space-1); }
  .stage-history p strong { white-space: normal; }
  .workflow-field-grid { grid-template-columns: 1fr; }
}

/* M6UX.4 — copilote contextuel, chaleureux et strictement en lecture seule */
.copilot-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 70; min-height: 44px; padding: 0 15px 0 11px;
  display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, #346fe3, #7459e8); box-shadow: 0 14px 34px rgba(52, 91, 190, .3);
  cursor: pointer; transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}
.copilot-launcher > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 15px; }
.copilot-launcher strong { font-size: 10px; letter-spacing: .01em; }
.copilot-launcher:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 18px 40px rgba(52, 91, 190, .36); }
.copilot-launcher.open { opacity: 0; pointer-events: none; transform: translateY(8px); }
.copilot-drawer {
  position: fixed; z-index: 80; top: 72px; right: 18px; bottom: 18px; width: min(390px, calc(100vw - 36px));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid color-mix(in srgb, var(--blue) 18%, var(--border));
  border-radius: 18px; background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 28px 70px rgba(24, 44, 86, .24);
  backdrop-filter: blur(18px); opacity: 0; pointer-events: none; transform: translateX(28px) scale(.98);
  transform-origin: bottom right; transition: opacity 180ms ease, transform 240ms cubic-bezier(.2,.8,.2,1);
}
.copilot-drawer.open { opacity: 1; pointer-events: auto; transform: translateX(0) scale(1); }
.copilot-head { min-height: 68px; padding: 12px 13px; display: grid; grid-template-columns: 38px minmax(0,1fr) 34px; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, var(--blue-soft), var(--surface)); }
.copilot-head .copilot-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #346fe3, #7459e8); box-shadow: 0 8px 20px rgba(52,91,190,.23); font-size: 17px; }
.copilot-head strong, .copilot-head span { display: block; }
.copilot-head strong { color: var(--ink); font-size: 11px; }
.copilot-head span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.copilot-feed { min-height: 0; padding: 16px 14px 8px; overflow-y: auto; overscroll-behavior: contain; background: radial-gradient(circle at 100% 0, color-mix(in srgb, var(--blue-soft) 55%, transparent), transparent 34%); }
.copilot-message { margin-bottom: 13px; display: flex; flex-direction: column; align-items: flex-start; animation: dashboardRise 220ms both; }
.copilot-message.user { align-items: flex-end; }
.copilot-bubble { max-width: 89%; padding: 11px 12px; border-radius: 14px; font-size: 10px; line-height: 1.55; }
.copilot-bubble.assistant { color: var(--body); border: 1px solid var(--border); border-bottom-left-radius: 5px; background: var(--surface); box-shadow: 0 6px 18px rgba(26, 49, 91, .06); }
.copilot-bubble.user { color: #fff; border-bottom-right-radius: 5px; background: linear-gradient(135deg, #346fe3, #5d65e8); }
.copilot-citations { max-width: 92%; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
.copilot-citations span { padding: 4px 7px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 7px; font-weight: 750; }
.copilot-suggestions { width: 100%; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.copilot-suggestions button, .copilot-navigation { min-height: 30px; padding: 6px 9px; border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--border)); border-radius: 9px; color: var(--blue); background: var(--surface); cursor: pointer; font-size: 8px; font-weight: 750; text-align: left; transition: transform var(--transition), background var(--transition); }
.copilot-suggestions button:hover, .copilot-navigation:hover { background: var(--blue-soft); transform: translateY(-1px); }
.copilot-navigation { margin-top: 7px; }
.copilot-bubble.typing { min-width: 54px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.copilot-bubble.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: copilotTyping 900ms infinite ease-in-out; }
.copilot-bubble.typing i:nth-child(2) { animation-delay: 120ms; }
.copilot-bubble.typing i:nth-child(3) { animation-delay: 240ms; }
.copilot-compose { padding: 11px 12px 10px; display: grid; grid-template-columns: minmax(0,1fr) 38px; gap: 7px; border-top: 1px solid var(--border); background: var(--surface); }
.copilot-compose textarea { min-height: 42px; max-height: 110px; resize: none; padding: 10px 11px; border: 1px solid var(--border); border-radius: 11px; color: var(--ink); background: var(--surface-2); outline: none; font: inherit; font-size: 9px; line-height: 1.4; }
.copilot-compose textarea:focus { border-color: color-mix(in srgb, var(--blue) 55%, var(--border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 10%, transparent); }
.copilot-send { width: 38px; height: 38px; align-self: center; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #346fe3, #7459e8); cursor: pointer; font-size: 16px; }
.copilot-send:disabled { opacity: .5; cursor: wait; }
.copilot-compose small { grid-column: 1 / -1; color: var(--subtle); font-size: 7px; line-height: 1.35; }
@keyframes copilotTyping { 0%, 70%, 100% { transform: translateY(0); opacity: .35; } 35% { transform: translateY(-3px); opacity: 1; } }

@media (max-width: 767px) {
  .copilot-launcher { top: 14px; right: calc(50% - 21px); bottom: auto; width: 42px; min-height: 42px; padding: 0; justify-content: center; }
  .copilot-launcher strong { display: none; }
  .copilot-drawer { inset: 8px 8px 70px; width: auto; border-radius: 15px; }
  .copilot-head { min-height: 62px; }
  .copilot-feed { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .copilot-launcher, .copilot-drawer, .copilot-message, .copilot-bubble.typing i { animation: none !important; transition: none !important; }
}

/* M6UX.5 — lisibilité confortable et hiérarchie quotidienne */
:root {
  --sidebar: 224px;
  font-family: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { font-size: 14px; line-height: 1.5; }
button, input, select, textarea { letter-spacing: 0; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.metric-value, .money, .lead-score, .lead-detail-head > strong {
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}

h1 { font-size: clamp(28px, 2.4vw, 34px); font-weight: 760; line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 20px; font-weight: 720; line-height: 1.25; }
h3 { font-size: 16px; font-weight: 700; line-height: 1.3; }
.small { font-size: 13px; }

.sidebar { padding: 20px 14px 18px; }
.brand { min-height: 58px; padding: 0 9px 20px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
.brand-name { font-size: 18px; font-weight: 760; }
.brand-caption { margin-top: 5px; font-size: 10px; font-weight: 700; letter-spacing: .075em; }
.nav { gap: 4px; }
.nav-button { min-height: 46px; padding: 0 12px; gap: 11px; border-radius: 10px; font-size: 14px; font-weight: 620; }
.nav-icon { width: 20px; font-size: 17px; }
.nav-badge { min-width: 23px; font-size: 11px; }
.agent-status { padding: 13px; }
.agent-status-title { font-size: 10px; letter-spacing: .08em; }
.status-line { margin-top: 7px; font-size: 12px; }
.sidebar-user strong { font-size: 13px; }
.sidebar-user span { font-size: 11px; }

.topbar { height: 72px; padding: 0 26px; }
.topbar-title { font-size: 20px; font-weight: 740; }
.eyebrow, .connection-state { font-size: 12px; }
.global-search { min-height: 42px; font-size: 13px; }
.global-search kbd { font-size: 10px; }
.icon-button { width: 42px; height: 42px; }
.main { max-width: 1580px; padding: 28px 30px 40px; }

.page-head { align-items: flex-end; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 7px; font-size: clamp(28px, 2.4vw, 34px); }
.page-head p { max-width: 780px; font-size: 14px; line-height: 1.55; }
.page-kicker { margin-bottom: 7px; font-size: 11px; font-weight: 750; letter-spacing: .09em; }

.button { min-height: 42px; padding-inline: 16px; border-radius: 10px; font-size: 13px; font-weight: 680; }
.button.small-button { min-height: 38px; padding-inline: 13px; font-size: 12px; }
.input, .select, .textarea { min-height: 44px; padding: 10px 13px; font-size: 14px; line-height: 1.4; }
.field label, .settings-mobile-picker > span { font-size: 12px; font-weight: 680; }
.field-help, .password-hint, .validation-list { font-size: 12px; line-height: 1.5; }
.status-pill, .ai-badge, .chip, .count-chip { font-size: 11px; line-height: 1.25; }

.metric-card { min-height: 142px; padding: 18px; }
.metric-icon { width: 31px; height: 31px; font-size: 15px; }
.metric-trend { max-width: 120px; font-size: 10px; }
.metric-value { margin-top: 13px; font-size: 28px; font-weight: 760; letter-spacing: -.04em; }
.metric-label { margin-top: 8px; font-size: 13px; font-weight: 700; }
.metric-note { margin-top: 4px; font-size: 11px; }
.action-banner strong { font-size: 14px; }
.action-banner span { font-size: 12px; }
.section-head h2 { font-size: 19px; }
.section-head p { font-size: 13px; line-height: 1.5; }
.review-person strong { font-size: 14px; }
.review-person span, .draft-preview { font-size: 12px; line-height: 1.5; }
.review-actions .button { min-height: 36px; font-size: 12px; }
.lead-score { font-size: 21px; font-weight: 760; }
.lead-priority-card > p, .score-disclaimer, .lead-reasons, .lead-confidence { font-size: 11px; line-height: 1.5; }
.feed-item strong, .followup-report strong { font-size: 13px; }
.feed-item span, .followup-report span { font-size: 11px; line-height: 1.45; }

.view-switcher button, .filter-bar { font-size: 13px; }
.kanban { grid-template-columns: repeat(4, minmax(255px, 1fr)); gap: 14px; }
.kanban-head { min-height: 50px; padding-inline: 14px; font-size: 13px; font-weight: 730; }
.deal-card { padding: 14px; }
.deal-card h3 { font-size: 14px; }
.deal-card p, .deal-meta, .deal-reasons, .deal-next { font-size: 11px; line-height: 1.45; }
.kanban .empty-state h3 { font-size: 13px; }
.kanban .empty-state p { font-size: 11px; }

.inbox-shell { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
.conversation-list-head { height: 58px; padding-inline: 17px; font-size: 14px; }
.conversation-list-head span { font-size: 11px; }
.conversation-item { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 11px; padding: 14px; }
.conversation-copy strong { font-size: 13px; }
.conversation-copy time { font-size: 10px; }
.conversation-copy p { margin-top: 5px; font-size: 12px; }
.conversation-item > b { font-size: 10px; }
.conversation-head { min-height: 72px; }
.conversation-head strong { font-size: 14px; }
.conversation-head span, .conversation-mode { font-size: 12px; }
.conversation-thread { gap: 12px; padding: 20px; }
.message-bubble, .message-thread .bubble { font-size: 13px; line-height: 1.55; }
.conversation-empty p { font-size: 13px; }
.conversation-pending > div strong { font-size: 13px; }
.conversation-pending p, .pending-question, .draft-source { font-size: 12px; line-height: 1.5; }

.settings-layout { grid-template-columns: 240px minmax(0, 900px); gap: 22px; }
.settings-nav { padding: 10px; }
.settings-nav button { min-height: 46px; padding-inline: 13px; font-size: 13px; }
.settings-panel { padding: 24px; }
.settings-panel > h2 { font-size: 22px; }
.settings-panel p, .setting-block p, .gmail-permissions span, .mode-note, .mode-warning { font-size: 13px; line-height: 1.55; }
.setting-block h3, .gmail-connection h3 { font-size: 17px; }

table.data { font-size: 13px; }
table.data th { font-size: 11px; letter-spacing: .055em; }
table.data td { line-height: 1.45; }
.person-cell strong { font-size: 13px; }
.person-cell span { font-size: 11px; }

.journey-head > strong { font-size: 12px; }
.journey-step strong { font-size: 12px; }
.journey-step small { font-size: 10px; }
.journey-dot { font-size: 11px; }

.copilot-launcher strong { font-size: 12px; }
.copilot-head strong { font-size: 14px; }
.copilot-head span { font-size: 11px; }
.copilot-bubble { font-size: 13px; line-height: 1.55; }
.copilot-citations span { font-size: 10px; }
.copilot-suggestions button, .copilot-navigation { min-height: 34px; font-size: 11px; }
.copilot-compose textarea { min-height: 46px; font-size: 14px; }
.copilot-compose small { font-size: 11px; }

/* Preserve useful space for client identity instead of six equal columns. */
table[aria-label="Contacts clients"] th:nth-child(1) { width: 27%; }
table[aria-label="Contacts clients"] th:nth-child(2) { width: 20%; }
table[aria-label="Contacts clients"] th:nth-child(3) { width: 13%; }
table[aria-label="Contacts clients"] th:nth-child(4) { width: 9%; }
table[aria-label="Contacts clients"] th:nth-child(5) { width: 17%; }
table[aria-label="Contacts clients"] th:nth-child(6) { width: 14%; }

@media (max-width: 767px) {
  .dashboard-page .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .dashboard-page .metric-card { min-height: 0; padding: var(--space-3); }
  .dashboard-page .metric-label { font-size: 13px; }
  .dashboard-page .metric-value { font-size: 24px; }
  .dashboard-page .metric-context { font-size: 11px; }
}

/* Event dossier: facts first, optional detail second. */
.dossier-overview { margin-top: var(--space-3); }
.dossier-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-3) 0; }
.dossier-facts dt { color: var(--muted); font-size: 13px; }
.dossier-facts dd { margin: var(--space-1) 0 0; color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.dossier-documents { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dossier-documents .button { height: auto; padding-block: var(--space-2); white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.dossier-section { margin-top: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.dossier-section > summary, .event-cost-details > summary { padding: var(--space-3); cursor: pointer; font-weight: 650; color: var(--ink); min-height: 48px; }
.dossier-section > :not(summary) { margin: var(--space-3); }
.event-alert { padding: var(--space-3); margin-block: var(--space-3); background: var(--orange-soft); border-left: 3px solid var(--orange); border-radius: 8px; overflow-wrap: anywhere; }
.event-alert ul { padding-left: var(--space-3); margin: 0; }
.event-alert p { margin: var(--space-2) 0; }
.event-alert li + li { margin-top: var(--space-2); }
.event-menu { list-style: none; padding: 0; margin: var(--space-3) 0; }
.event-menu li { display: flex; justify-content: space-between; gap: var(--space-3); border-bottom: 1px solid var(--border); padding-block: var(--space-2); }
.event-menu strong { min-width: 0; overflow-wrap: anywhere; }
.event-menu span { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.event-checklist { display: grid; gap: var(--space-2); margin-block: var(--space-3); }
.event-checklist label { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; cursor: pointer; }
.event-checklist input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--amber); }
.event-cost-details { border-top: 1px solid var(--border); margin-top: var(--space-3); }
.event-cost-details > summary { padding-inline: 0; }
.event-cost-grid { display: grid; grid-template-columns: minmax(90px, 1.4fr) repeat(2, minmax(70px, 1fr)); gap: var(--space-2); align-items: center; }
.event-cost-grid > strong { font-size: 12px; color: var(--muted); }
.event-cost-grid input { min-width: 0; width: 100%; }
.event-cost-grid > label { font-size: 13px; overflow-wrap: anywhere; }
.event-margin { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-3); margin-block: var(--space-3); }
.event-margin > div { display: grid; gap: var(--space-1); border: 1px solid var(--border); padding: var(--space-3); border-radius: 8px; }
.event-margin strong { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.event-margin small, .event-margin span { color: var(--muted); font-size: 12px; }
.event-save { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); align-items: center; margin-top: var(--space-3); }
.event-save span { color: var(--green); }
[data-theme="dark"] .button.success { background: #20694f; color: #fff; }
[data-theme="dark"] .button.primary { box-shadow: none; }
[data-theme="dark"] .metric-value, [data-theme="dark"] .money { font-family: inherit; }
summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (max-width: 480px) {
  .dossier-facts, .event-margin { grid-template-columns: 1fr; }
  .event-preparation .section-head { align-items: stretch; flex-direction: column; }
  .event-save .button { width: 100%; }
}

@media (min-width: 768px) and (max-width: 1120px) {
  :root { --sidebar: 204px; }
  .main { padding-inline: 22px; }
  .nav-button { font-size: 13px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 767px) {
  body { font-size: 15px; }
  .main { padding: 20px 16px 96px; }
  .topbar { height: 64px; padding-inline: 14px; }
  .topbar-title { font-size: 18px; }
  .page-head { align-items: flex-start; gap: 16px; margin-bottom: 20px; }
  .page-head h1 { font-size: 27px; }
  .page-head p { font-size: 14px; }
  .page-kicker { font-size: 10px; }
  .button { min-height: 44px; font-size: 13px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 132px; padding: 15px; }
  .metric-value { font-size: 24px; }
  .metric-label { font-size: 12px; }
  .metric-note { font-size: 10px; }
  .inbox-shell { grid-template-columns: 1fr; }
  .conversation-copy strong { font-size: 14px; }
  .conversation-copy p { font-size: 12px; }
  .conversation-thread { padding: 16px 12px; }
  .settings-panel { padding: 18px 16px; }
  table.data { font-size: 13px; }
  .copilot-bubble { font-size: 14px; }
}

@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 118px; }
}

/* M6UX.6 — grille, états explicites et présentation de données (variante test) */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --card-border: color-mix(in srgb, var(--border) 88%, var(--ink));
  --card-elevation: 0 1px 2px rgba(15, 22, 41, .04), 0 8px 24px rgba(15, 22, 41, .035);
}

.main {
  width: 100%;
  max-width: 1600px;
  padding: var(--space-4) var(--space-5) var(--space-6);
}

.card {
  border-color: var(--card-border);
  box-shadow: var(--card-elevation);
}

.card-pad,
.settings-panel,
.followup-report { padding: var(--space-4); }

.page-head {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.page-head > div:first-child { min-width: 0; }
.page-head h1 { margin-bottom: var(--space-1); }
.page-head p { max-width: 680px; }
.page-actions { gap: var(--space-2); }
.page-kicker { margin-bottom: var(--space-1); }

.section-head {
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.section-head > div { min-width: 0; }
.section-head h2,
.section-head h3 { margin-bottom: var(--space-1); }
.section-head p { margin: 0; }

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.metric-card { padding: var(--space-3); }
.metric-value { margin-top: var(--space-3); }
.metric-label { margin-top: var(--space-2); }
.metric-note { margin-top: var(--space-1); }

.dashboard-review-section,
.lead-priority-section,
.blocked-questions-section { margin-bottom: var(--space-4); }

.review-grid,
.lead-priority-grid,
.dashboard-lower,
.followup-report-grid { gap: var(--space-3); }

.review-card,
.lead-priority-card,
.deal-card { min-width: 0; }

.action-banner {
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}

.filter-bar {
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.kanban {
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: var(--space-3);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  scrollbar-gutter: stable;
}

.kanban-column { min-width: 0; }
.kanban-list { gap: var(--space-2); padding: var(--space-2); }
.kanban-head { padding-inline: var(--space-3); }

.inbox-layout {
  grid-template-columns: minmax(280px, 352px) minmax(0, 1fr);
  overflow: hidden;
}

.conversation-list,
.conversation-detail,
.conversation-copy,
.deal-name,
.person-cell { min-width: 0; }

.conversation-item { gap: var(--space-2); padding: var(--space-3); }
.conversation-thread { gap: var(--space-3); padding: var(--space-4); }

.settings-layout {
  grid-template-columns: 240px minmax(0, 960px);
  gap: var(--space-4);
}

.settings-nav { padding: var(--space-2); }
.settings-nav button { padding-inline: var(--space-3); }

.numeric {
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.truncate,
.truncate-cell,
.deal-name strong,
.deal-name span,
.person-cell strong,
.person-cell span,
.conversation-copy strong,
.conversation-copy p,
.lead-card-reason {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-card { min-width: 0; }
.table-scroll {
  max-width: 100%;
  overflow: auto;
  scrollbar-gutter: stable;
}

table.data {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

table.data th,
table.data td { padding-inline: var(--space-3); }

table.data th.numeric,
table.data td.numeric,
table.data td:has(> .numeric) { text-align: right; }

table.data td {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.component-state {
  min-height: 176px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  text-align: center;
}

.component-state h3,
.component-state p { margin: 0; }
.component-state p { max-width: 440px; color: var(--muted); }

.component-state .state-icon,
.empty-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}

.error-state .state-icon {
  border-color: color-mix(in srgb, var(--red) 24%, var(--border));
  background: var(--red-soft);
  color: var(--red);
}

.component-state > .button { margin-top: var(--space-2); }

.skeleton-stack {
  width: min(100%, 440px);
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.skeleton-stack i,
.skeleton-block {
  display: block;
  width: var(--skeleton-width, 100%);
  min-height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 50%, var(--surface-2) 75%);
  background-size: 240% 100%;
  animation: m6Skeleton 1.35s ease-in-out infinite;
}

@keyframes m6Skeleton {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.app-loading-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background: var(--page);
}

.loading-sidebar {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  background: var(--navy);
}

.loading-sidebar .skeleton-block { background: rgba(255, 255, 255, .09); }
.brand-skeleton { width: 72%; min-height: 40px; margin-bottom: var(--space-4); }
.nav-skeleton { min-height: 44px; }

.loading-main {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-5);
}

.title-skeleton { width: min(320px, 72%); min-height: 36px; }
.subtitle-skeleton { width: min(520px, 92%); }
.loading-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.metric-skeleton { min-height: 140px; border: 1px solid var(--border); }
.content-skeleton { min-height: 320px; border: 1px solid var(--border); }
.loading-content-card { margin-top: var(--space-2); }

.app-state-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.app-state-shell > .component-state {
  width: min(520px, 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--card-elevation);
}

[data-ui-state="loading"] { cursor: progress; }
[data-ui-state="error"] { border-color: color-mix(in srgb, var(--red) 24%, var(--border)); }

/* Agenda — source de vérité des disponibilités de l’agent */
.agenda-trust {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}

.agenda-trust-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.agenda-trust strong,
.agenda-trust span { display: block; }
.agenda-trust strong { color: var(--ink); }
.agenda-trust span { margin-top: var(--space-1); color: var(--muted); font-size: 12px; line-height: 1.45; }

.agenda-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(264px, 320px);
  align-items: start;
  gap: var(--space-3);
}

.agenda-calendar { min-width: 0; overflow: hidden; }
.agenda-toolbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.agenda-month-navigation { display: flex; align-items: center; gap: var(--space-3); }
.agenda-month-navigation h2 { margin: 0; }
.agenda-calendar-scroll { max-width: 100%; overflow-x: auto; scrollbar-gutter: stable; }
.agenda-weekdays,
.agenda-grid { min-width: 616px; }
.agenda-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.agenda-weekdays span {
  padding: var(--space-2) var(--space-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.agenda-day {
  position: relative;
  min-height: 112px;
  min-width: 0;
  padding: var(--space-2);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}
.agenda-day:hover { background: var(--surface-hover); }
.agenda-day:focus-visible { outline: 0; box-shadow: inset 0 0 0 2px var(--blue); }
.agenda-day:nth-child(7n) { border-right: 0; }
.agenda-day.outside { background: var(--surface-2); }
.agenda-day.outside:hover { background: var(--surface-hover); }
.agenda-day.outside .agenda-day-number { color: var(--subtle); }
.agenda-day.today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--amber) 68%, transparent); }
.agenda-day-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}
.agenda-day-number {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.agenda-day-add {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  opacity: 0;
  transform: scale(.86);
  transition: opacity var(--transition), transform var(--transition);
}
.agenda-day:hover .agenda-day-add,
.agenda-day:focus-visible .agenda-day-add,
.agenda-day:focus-within .agenda-day-add { opacity: 1; transform: scale(1); }
.agenda-day.today .agenda-day-number { background: var(--amber); color: #2f2104; }
.agenda-day-entries { display: grid; gap: var(--space-1); }
.agenda-entry {
  width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-left: 3px solid currentColor;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), filter var(--transition);
}
.agenda-entry:hover { transform: translateY(-1px); filter: saturate(1.08); }
.agenda-entry span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 760; }
.agenda-entry.booking { color: var(--blue); background: var(--blue-soft); }
.agenda-entry.time_off { color: var(--purple); background: var(--purple-soft); }
.agenda-entry.unavailable { color: var(--red); background: var(--red-soft); }
.agenda-entry.available { color: var(--green); background: var(--green-soft); }
.agenda-more { color: var(--muted); font-size: 10px; font-weight: 750; padding-inline: var(--space-1); }
.agenda-inline-empty { margin: 0; padding: var(--space-3); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; text-align: center; }
.agenda-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-3); }
.agenda-legend span { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--muted); font-size: 11px; }
.agenda-legend i,
.agenda-upcoming-entry > i { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 3px; }
.agenda-legend i.booking,
.agenda-upcoming-entry > i.booking { background: var(--blue); }
.agenda-legend i.time_off,
.agenda-upcoming-entry > i.time_off { background: var(--purple); }
.agenda-legend i.unavailable,
.agenda-upcoming-entry > i.unavailable { background: var(--red); }
.agenda-legend i.available,
.agenda-upcoming-entry > i.available { background: var(--green); }
.agenda-upcoming { min-width: 0; }
.agenda-upcoming-list { display: grid; gap: var(--space-1); }
.agenda-reminders { display: grid; gap: var(--space-1); margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.agenda-upcoming-entry {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.agenda-upcoming-entry:hover { background: var(--surface-hover); }
.agenda-upcoming-entry strong,
.agenda-upcoming-entry small { display: block; }
.agenda-upcoming-entry small { margin-top: var(--space-1); color: var(--muted); font-size: 10px; }
.agenda-upcoming-entry b { color: var(--subtle); font-size: 18px; }
.agenda-upcoming .component-state { min-height: 248px; padding-inline: var(--space-2); }

@media (min-width: 1440px) {
  .main { padding-inline: var(--space-6); }
  .review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .main { padding-inline: var(--space-4); }
  .metric-grid,
  .loading-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-lower { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 216px minmax(0, 1fr); gap: var(--space-3); }
  .agenda-layout { grid-template-columns: 1fr; }
  .agenda-upcoming-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .main { padding: var(--space-3) var(--space-3) 96px; }
  .page-head { align-items: stretch; flex-direction: column; margin-bottom: var(--space-3); }
  .page-actions { justify-content: flex-start; }
  .page-actions .button { flex: 1 1 auto; }
  .metric-grid,
  .loading-metric-grid,
  .lead-priority-grid,
  .review-grid,
  .blocked-grid,
  .followup-report-grid { grid-template-columns: 1fr; }
  .action-banner { align-items: flex-start; flex-wrap: wrap; }
  .action-banner .button { width: 100%; margin-left: 0; }
  .inbox-layout { grid-template-columns: 1fr; min-height: 0; }
  .conversation-list { max-height: 44vh; }
  .conversation-thread { padding: var(--space-3); }
  .settings-layout { grid-template-columns: 1fr; gap: var(--space-3); }
  .settings-nav { display: none; }
  .card-pad,
  .settings-panel,
  .followup-report { padding: var(--space-3); }
  .kanban { grid-template-columns: repeat(4, minmax(264px, 82vw)); }
  .component-state { min-height: 144px; padding: var(--space-4) var(--space-3); }
  .app-loading-shell { grid-template-columns: 1fr; }
  .loading-sidebar { display: none; }
  .loading-main { padding: var(--space-4) var(--space-3); }
  .copilot-drawer:not(.open) { visibility: hidden; transform: none; }
  .copilot-drawer.open { visibility: visible; }
  .agenda-trust { grid-template-columns: auto minmax(0, 1fr); }
  .agenda-trust > .button { grid-column: 1 / -1; width: 100%; }
  .agenda-toolbar { align-items: stretch; flex-direction: column; }
  .agenda-month-navigation { justify-content: space-between; }
  .agenda-upcoming-list { grid-template-columns: 1fr; }
  .agenda-weekdays,
  .agenda-grid { min-width: 672px; }
  .agenda-day { min-height: 104px; }
  .analysis-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-metrics > div:last-child { grid-column: span 2; }
  .fiche-analysis-card { align-items: stretch; flex-direction: column; }
  .fiche-analysis-card-actions { align-items: stretch; flex-direction: column; }
  .fiche-submissions > div { grid-template-columns: auto minmax(0, 1fr); }
  .fiche-submission-action { grid-column: 1 / -1; justify-self: stretch; }
  .fiche-submission-action .button { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-stack i,
  .skeleton-block { animation: none !important; }
  .agenda-entry { transition: none !important; }
  .agenda-day,
  .agenda-day-add { transition: none !important; }
}

@media (min-width: 1100px) {
  .kanban { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
}
@media (max-width: 767px) {
  .mobile-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mobile-nav button { font-size: 11px; min-width: 0; min-height: 52px; padding-inline: 2px; }
  .mobile-nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .daily-event { gap: var(--space-2); flex-direction: column; }
  .daily-event > span { flex: 1; }
  .daily-event > span:last-child { grid-template-columns: 1fr 1fr; text-align: left; align-items: start; }
  .daily-event > span:last-child small { text-align: right; }
}

/* Keep the effective sending mode and mailbox identity readable at every width. */
.connection-summary-card.email-delivery strong,
.connection-summary-card.email-delivery p { white-space: normal; overflow-wrap: anywhere; }

.recipient-audit table { table-layout: fixed; width: 100%; }
.recipient-audit td { overflow-wrap: anywhere; white-space: normal; }
