:root,
.dark {
  color-scheme: dark;
  --background: #09090b;
  --foreground: #fafafa;
  --card: #111113;
  --card-foreground: #fafafa;
  --popover: #18181b;
  --muted: #18181b;
  --muted-foreground: #a1a1aa;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --border: #27272a;
  --input: #27272a;
  --ring: #a78bfa;
  --accent: #a78bfa;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  background: var(--background);
  color: var(--foreground);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: #c4b5fd; text-decoration: none; }
a:hover { color: #ddd6fe; text-decoration: underline; }
::selection { background: #8b5cf680; color: #fff; }
:is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
}
.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 25px 13px 18px;
  background: #0c0c0e;
  border-right: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px 39px;
}
.brand-mark {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}
.brand strong { display: block; font-size: 13px; font-weight: 650; letter-spacing: -.025em; }
.brand small { display: block; margin-top: 2px; color: #71717a; font-size: 10px; letter-spacing: .14em; font-weight: 650; }
.sidebar-label {
  padding: 0 12px;
  margin: 0 0 11px;
  color: #71717a;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .11em;
}
.nav-item {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #a1a1aa;
  text-align: left;
  font-size: 13px;
  font-weight: 560;
  transition: background .16s, color .16s, border-color .16s;
}
.nav-item svg, .icon-button svg, .metric-icon svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item:hover { background: #18181b; color: #e4e4e7; }
.nav-item.active { background: #27272a; border-color: #303034; color: #fafafa; }
.nav-item.active svg { color: #c4b5fd; }
.sidebar-foot {
  margin-top: auto;
  padding: 17px 11px 2px;
  border-top: 1px solid var(--border);
  color: #d4d4d8;
  font-size: 11px;
  line-height: 1.7;
}
.sidebar-foot small { display: block; margin-left: 17px; color: #71717a; }
.live-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px #4ade8022;
}
.workspace { min-width: 0; }
.topbar {
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: #09090beb;
}
.breadcrumb { color: #71717a; font-size: 12px; white-space: nowrap; }
.breadcrumb span { margin: 0 10px; color: #52525b; }
.breadcrumb strong { color: #e4e4e7; font-weight: 580; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.pill, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .025em;
  white-space: nowrap;
}
.pill { padding: 5px 10px; background: #163322; border-color: #255b38; color: #86efac; }
.pill.paused { background: #3a2812; border-color: #6b4619; color: #fcd34d; }
.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #121214;
  color: #d4d4d8;
}
.icon-button:hover { background: var(--secondary); color: #fff; }
.icon-button svg { width: 16px; height: 16px; }
.content { width: min(100%, 1520px); margin: 0 auto; padding: 33px 32px 64px; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}
.eyebrow {
  margin: 0 0 9px;
  color: #b9a6ff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
}
.page-heading h1 { margin: 0 0 7px; font-size: clamp(24px, 2.3vw, 31px); font-weight: 670; letter-spacing: -.045em; line-height: 1.14; }
.page-heading p:last-child { margin: 0; color: var(--muted-foreground); font-size: 13px; line-height: 1.55; }
.muted, .subtle { color: var(--muted-foreground); }
.subtle { font-size: 12px; }
.button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  transition: background .16s, border-color .16s, transform .16s;
}
.button:hover:not(:disabled) { background: #e4e4e7; border-color: #e4e4e7; text-decoration: none; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button.secondary { background: #18181b; border-color: #3f3f46; color: #e4e4e7; }
.button.secondary:hover:not(:disabled) { background: #27272a; border-color: #52525b; }
.button.danger { background: #2d181b; border-color: #643037; color: #fca5a5; }
.button.danger:hover:not(:disabled) { background: #422024; border-color: #8f4249; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric, .panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 2px #0004;
}
.metric { min-height: 125px; padding: 17px 18px; transition: border-color .16s, transform .16s; }
.metric:hover { border-color: #3f3f46; transform: translateY(-1px); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #d4d4d8; font-size: 12px; font-weight: 560; }
.metric-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #34343a; border-radius: 7px; background: #1c1c20; color: #c4b5fd; }
.metric-icon svg { width: 15px; height: 15px; }
.metric-value { margin-top: 14px; color: var(--foreground); font-size: 26px; font-weight: 700; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-foot { margin-top: 8px; color: #85858f; font-size: 11px; }
.dashboard-columns { display: grid; grid-template-columns: 1.35fr 1fr; align-items: start; gap: 14px; }
.dashboard-column { min-width: 0; display: grid; align-content: start; gap: 14px; }
.panel { min-width: 0; overflow: hidden; }
.panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; color: #f4f4f5; font-size: 14px; font-weight: 640; letter-spacing: -.015em; }
.panel-body { padding: 17px 18px; }
.status-list { display: grid; gap: 16px; }
.status-row { display: flex; align-items: center; gap: 11px; font-size: 12px; }
.status-row span:first-child { width: 115px; flex: none; color: #a1a1aa; }
.status-row strong { width: 25px; text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.bar { width: 100%; min-width: 0; height: 6px; flex: 1; overflow: hidden; appearance: none; border: 0; border-radius: 999px; background: #27272a; }
.bar::-webkit-progress-bar { border-radius: 999px; background: #27272a; }
.bar::-webkit-progress-value { border-radius: 999px; background: #9b82ea; }
.bar::-moz-progress-bar { border-radius: 999px; background: #9b82ea; }
.activity-item { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid #27272a; }
.activity-item:first-child { padding-top: 2px; }
.activity-item:last-child { padding-bottom: 2px; border-bottom: 0; }
.activity-item > div { min-width: 0; }
.activity-dot { width: 7px; height: 7px; flex: none; margin-top: 6px; border-radius: 50%; background: #a78bfa; box-shadow: 0 0 0 3px #a78bfa25; }
.activity-item strong { color: #e4e4e7; font-size: 12px; font-weight: 650; }
.activity-item p { margin: 4px 0; color: #a1a1aa; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.activity-item time { color: #85858f; font-size: 11px; }
.activity-item .button { margin-top: 5px; min-height: 28px; padding: 5px 9px; font-size: 10px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.input, select, textarea {
  min-width: 0;
  min-height: 35px;
  padding: 8px 11px;
  border: 1px solid var(--input);
  border-radius: 7px;
  outline: none;
  background: #101013;
  color: var(--foreground);
  font-size: 12px;
  line-height: 1.5;
  transition: border-color .16s, box-shadow .16s;
}
.input:hover, select:hover, textarea:hover { border-color: #3f3f46; }
.input:focus, select:focus, textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px #a78bfa26; }
.input::placeholder, textarea::placeholder { color: #71717a; }
.toolbar .search { flex: 1; min-width: 190px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 12px 15px; border-bottom: 1px solid var(--border); background: #171719; color: #a1a1aa; text-align: left; text-transform: uppercase; font-size: 9px; font-weight: 650; letter-spacing: .08em; }
.data-table td { padding: 13px 15px; border-bottom: 1px solid #262629; color: #b5b5bd; font-size: 12px; line-height: 1.5; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-open-lead] { cursor: pointer; }
.data-table tbody tr:hover { background: #1b1b1f; }
.cell-main { color: #f4f4f5; font-weight: 650; }
.cell-sub { display: block; margin-top: 2px; color: #797984; font-size: 10px; }
.badge { padding: 4px 8px; font-size: 9px; }
.badge.NEW, .badge.SKIPPED, .badge.CANCELLED { background: #27272a; border-color: #3f3f46; color: #d4d4d8; }
.badge.QUALIFIED, .badge.PREPARED { background: #1d2c40; border-color: #315071; color: #93c5fd; }
.badge.APPROVED { background: #173327; border-color: #2c6242; color: #86efac; }
.badge.SENT { background: #282449; border-color: #453b76; color: #c4b5fd; }
.badge.REPLIED, .badge.SENDING { background: #3b2d16; border-color: #674c1c; color: #fcd34d; }
.badge.HUMAN_TAKEOVER { background: #3b2030; border-color: #703b57; color: #f9a8d4; }
.badge.FAILED, .badge.UNCERTAIN, .badge.BLOCKED { background: #3a2023; border-color: #743a42; color: #fca5a5; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px; border-top: 1px solid var(--border); color: #a1a1aa; font-size: 11px; }
.pagination button { min-height: 29px; margin-left: 5px; padding: 5px 9px; border: 1px solid #3f3f46; border-radius: 6px; background: #18181b; color: #e4e4e7; font-size: 10px; }
.pagination button:hover:not(:disabled) { background: #27272a; }
.empty { padding: 42px 22px; color: #85858f; text-align: center; font-size: 12px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; color: #d4d4d8; font-size: 11px; font-weight: 570; }
.field.full { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; font-weight: 430; }
.field textarea { min-height: 132px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.template-layout { display: grid; grid-template-columns: 285px minmax(0, 1fr); gap: 14px; }
.template-list { display: grid; align-content: start; gap: 8px; }
.template-item { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #171719; color: #e4e4e7; text-align: left; }
.template-item:hover { background: #202024; border-color: #494951; }
.template-item.active { background: #29243b; border-color: #7962bb; }
.template-item strong { display: block; font-size: 11px; font-weight: 650; }
.template-item small { display: block; margin-top: 5px; overflow: hidden; color: #a1a1aa; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.preview { min-height: 110px; padding: 16px; border: 1px solid #38383e; border-radius: 8px; background: #18181b; color: #dedee3; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.control-card { padding: 19px; }
.control-card h2 { margin: 0 0 8px; color: #f4f4f5; font-size: 13px; font-weight: 650; }
.control-card p { color: #a1a1aa; font-size: 11px; line-height: 1.6; }
.kv { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: #a1a1aa; }
.kv strong { color: #e4e4e7; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 0; }
.switch-row span { color: #e4e4e7; font-size: 11px; font-weight: 570; }
.switch-row input { width: 17px; height: 17px; accent-color: #a78bfa; cursor: pointer; }
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: flex-end; background: #000b; backdrop-filter: blur(3px); }
.drawer { width: min(600px, 100%); height: 100%; overflow-y: auto; padding: 26px; border-left: 1px solid #3f3f46; background: #101013; box-shadow: -25px 0 60px #0008; }
.lead-detail-page { width: min(1120px, 100%); margin: 0 auto; }
.lead-detail-nav { margin-bottom: 14px; }
.lead-detail-card { padding: 26px; }
.lead-detail-card > h3 { margin-top: 0; }
.lead-detail-card .detail-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lead-detail-card .chat-bubble { width: min(76%, 680px); }
.takeover-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; margin-bottom: 16px; }
.takeover-summary div { padding: 16px 18px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); }
.takeover-summary span { display: block; color: #92929b; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.takeover-summary strong { display: block; margin-top: 7px; color: #fafafa; font-size: 25px; }
.takeover-toolbar { align-items: center; }
.takeover-toolbar .toolbar { margin: 0; }
.takeover-list { display: grid; gap: 12px; }
.takeover-item { padding: 17px; border: 1px solid #303036; border-radius: 10px; background: #151517; }
.takeover-item.unhandled { border-color: #654d94; box-shadow: inset 3px 0 #a78bfa; }
.takeover-item.handled { opacity: .75; }
.takeover-main, .takeover-title, .takeover-meta { display: flex; align-items: center; }
.takeover-main { justify-content: space-between; gap: 16px; }
.takeover-title { gap: 10px; min-width: 0; }
.takeover-title h3 { margin: 0; color: #f4f4f5; font-size: 14px; }
.takeover-title p { margin: 4px 0 0; color: #92929b; font-size: 10px; }
.takeover-main time { flex: none; color: #92929b; font-size: 10px; }
.unread-dot { width: 8px; height: 8px; flex: none; border-radius: 999px; background: #a78bfa; box-shadow: 0 0 10px #a78bfa88; }
.takeover-item.handled .unread-dot { background: #52525b; box-shadow: none; }
.reply-preview { margin: 14px 0 10px 18px; padding: 13px 14px; border-radius: 8px; background: #1d1d21; color: #e4e4e7; font-size: 12px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.takeover-meta { gap: 14px; margin: 0 0 14px 18px; color: #85858f; font-size: 10px; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 19px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 3px 0 0; font-size: 20px; font-weight: 670; letter-spacing: -.035em; }
.lead-status { margin-top: 10px; }
.close { width: 31px; height: 31px; flex: none; border: 1px solid #3f3f46; border-radius: 7px; background: #27272a; color: #e4e4e7; font-size: 20px; line-height: 1; }
.close:hover { background: #3f3f46; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 18px 0; }
.detail-meta div { min-width: 0; padding: 11px 12px; border: 1px solid #29292d; border-radius: 7px; background: #18181b; }
.detail-meta small { display: block; margin-bottom: 5px; color: #85858f; font-size: 9px; letter-spacing: .05em; text-transform: uppercase; }
.detail-meta strong { color: #e4e4e7; font-size: 11px; font-weight: 570; overflow-wrap: anywhere; }
.divider { margin: 21px 0; border: 0; border-top: 1px solid var(--border); }
.loading { padding: 90px 20px; color: #a1a1aa; text-align: center; font-size: 12px; }
#toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: min(420px, calc(100vw - 44px)); padding: 11px 14px; border: 1px solid #3f3f46; border-radius: 8px; background: #27272a; color: #fafafa; box-shadow: 0 14px 38px #0009; font-size: 11px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s, transform .18s; }
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { border-color: #813c43; background: #3a2023; color: #fecaca; }
.pending-review { padding: 16px; border: 1px solid #494064; border-radius: 9px; background: #1b1825; }
.pending-review h3 { margin: 0 0 6px; font-size: 13px; }
.pending-review .preview { background: #141219; }
.conversation-panel { display: grid; gap: 14px; }
.conversation-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.conversation-head h3 { margin: 3px 0 0; }
.chat-list { display: grid; gap: 10px; }
.chat-bubble { width: min(88%, 460px); padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px 12px 12px 3px; background: #18181b; }
.chat-bubble.outgoing { justify-self: end; border-color: #5b4b82; border-radius: 12px 12px 3px 12px; background: #211a31; }
.chat-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: #a1a1aa; font-size: 11px; }
.chat-label strong { color: #e4e4e7; font-size: 11px; }
.chat-bubble p { margin: 0; color: #f4f4f5; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble small { display: block; margin-top: 8px; color: #8f8f99; font-size: 10px; }
.error-note { color: #fca5a5; font-size: 11px; line-height: 1.55; }
.quick-action-description { margin: 0 0 14px; font-size: 12px; line-height: 1.6; }
.lead-form-panel { margin-bottom: 16px; }
.toolbar-panel-body { padding-bottom: 0; }
.pending-actions { margin-top: 14px; }
.profile-link { font-size: 12px; overflow-wrap: anywhere; }
.template-preview { margin-top: 14px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% -15%, #34254d 0%, transparent 36%), #09090b; }
.login-card { width: min(410px, 100%); padding: 34px; border: 1px solid #35353b; border-radius: 14px; background: #111113; box-shadow: 0 24px 65px #0009; }
.login-card .brand-mark { margin-bottom: 29px; }
.login-card h1 { margin: 0 0 7px; font-size: 28px; font-weight: 675; letter-spacing: -.045em; }
.login-card .muted { margin: 0; font-size: 12px; line-height: 1.55; }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
.login-card .button { min-height: 39px; margin-top: 2px; }
.login-card small { display: block; margin-top: 26px; color: #777780; text-align: center; font-size: 10px; }
#login-error { min-height: 16px; margin: 0; color: #fca5a5; font-size: 11px; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .template-layout { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .shell { display: block; min-width: 0; }
  .workspace { min-width: 0; }
  .sidebar { min-width: 0; min-height: 0; overflow: hidden; padding: 13px 16px 11px; position: sticky; top: 0; z-index: 10; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0 2px 10px; }
  .brand-mark { width: 30px; height: 30px; font-size: 20px; }
  .brand strong { font-size: 12px; }
  .brand small { font-size: 9px; }
  .sidebar-label, .sidebar-foot { display: none; }
  #nav { width: 100%; max-width: 100%; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
  #nav::-webkit-scrollbar { display: none; }
  .nav-item { width: auto; min-height: 32px; flex: none; gap: 6px; margin: 0; padding: 6px 10px; white-space: nowrap; font-size: 10px; }
  .nav-item svg { width: 14px; height: 14px; }
  .topbar { height: 53px; padding: 0 18px; }
  .breadcrumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { flex: none; }
  .content { padding: 25px 18px 45px; }
  .dashboard-columns { grid-template-columns: 1fr; }
  .template-layout, .control-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 108px; padding: 13px; }
  .metric-value { margin-top: 12px; font-size: 23px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-heading h1 { font-size: 25px; }
  .content { padding: 22px 14px 40px; }
  .breadcrumb { font-size: 11px; }
  .breadcrumb span { margin: 0 5px; }
  .top-actions { gap: 6px; }
  .top-actions .button { padding: 7px 9px; }
  .panel-head, .panel-body { padding-left: 14px; padding-right: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .drawer { padding: 18px; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .lead-detail-card { padding: 18px; }
  .lead-detail-card .detail-meta { grid-template-columns: 1fr 1fr; }
  .lead-detail-card .chat-bubble { width: 88%; }
  .takeover-toolbar, .takeover-main { align-items: flex-start; flex-direction: column; }
  .takeover-toolbar .toolbar { width: 100%; }
  .takeover-toolbar select { flex: 1; min-width: 0; }
  .login-card { padding: 28px 23px; }
}
@media (max-width: 380px) {
  .detail-meta { grid-template-columns: 1fr; }
  .lead-detail-card .detail-meta { grid-template-columns: 1fr; }
  .lead-detail-card .chat-bubble { width: 100%; }
  .takeover-summary { grid-template-columns: 1fr 1fr; }
  .takeover-item { padding: 14px; }
  .reply-preview, .takeover-meta { margin-left: 0; }
  .top-actions .pill { display: none; }
  .metric-top { font-size: 10px; }
}
