:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3ee;
  --primary: #2563eb;
  --teal: #0f766e;
  --green: #16a34a;
  --red: #dc2626;
  --sidebar: #101827;
  --sidebar-soft: #172033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

button.secondary,
button.mini {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

button.mini {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  color: #e5edf8;
  background: linear-gradient(180deg, var(--sidebar), #0b1120);
  padding: 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: var(--teal);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.sidebar-card p {
  color: #9fb0c8;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  display: flex;
  gap: 10px;
  align-items: center;
  border-radius: 9px;
  color: #cbd5e1;
  padding: 11px 12px;
  font-weight: 700;
}

nav a span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

nav a.active,
nav a:hover {
  color: #fff;
  background: rgba(37, 99, 235, 0.22);
}

.sidebar-card {
  margin-top: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--sidebar-soft);
  padding: 14px;
}

.sidebar-card small,
.eyebrow {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.topbar h1 {
  margin: 2px 0 4px;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-actions input {
  width: 280px;
}

.profile {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.status-line {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  color: #1d4ed8;
  background: #eff6ff;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-weight: 700;
}

.agent-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 18px;
  align-items: stretch;
  border: 1px solid #b9d8ff;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(20, 184, 166, 0.14), transparent 50%),
    #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  margin-bottom: 14px;
  padding: 18px;
}

.agent-console.compact {
  grid-template-columns: minmax(0, 1fr);
}

.agent-console-main {
  display: grid;
  align-content: center;
  gap: 10px;
}

.agent-console-main h2 {
  margin: 0;
  max-width: 860px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.agent-console-main p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
}

.agent-console-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.agent-console-actions a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.agent-console-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.agent-console.compact .agent-console-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.agent-console-steps article {
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
}

.agent-console-steps span,
.agent-console-steps small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.agent-console-steps span {
  color: var(--teal);
  font-size: 13px;
}

.agent-console-steps strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
}

.agent-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: center;
  border: 1px solid #c9d7eb;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(37, 99, 235, 0.12), transparent 48%),
    #fff;
  padding: 22px;
  margin-bottom: 14px;
}

.agent-hero h2 {
  max-width: 820px;
  margin: 5px 0 8px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.agent-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.agent-score {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.agent-score span,
.agent-score small {
  color: var(--muted);
  font-weight: 800;
}

.agent-score strong {
  color: var(--teal);
  font-size: 42px;
}

.panel,
.metric-card,
.drawer,
.integration-card,
.sequence-card,
.report-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.panel,
.drawer,
.integration-card,
.sequence-card,
.report-card {
  padding: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  padding: 14px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 26px;
}

.metric-card.green strong {
  color: var(--green);
}

.opportunity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.opportunity-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  padding: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.opportunity-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.opportunity-head h3 {
  margin: 3px 0 0;
  font-size: 17px;
  line-height: 1.2;
}

.opportunity-head small,
.opportunity-facts span,
.opportunity-pitch small {
  color: var(--muted);
  font-weight: 800;
}

.opportunity-score {
  display: flex;
  gap: 10px;
  align-items: baseline;
  border-radius: 10px;
  background: #eef7ff;
  padding: 10px;
}

.opportunity-score strong {
  color: var(--primary);
  font-size: 34px;
}

.opportunity-facts {
  display: grid;
  gap: 6px;
}

.opportunity-pitch {
  border-left: 3px solid var(--teal);
  background: #f0fdfa;
  padding: 10px;
}

.opportunity-pitch strong {
  display: block;
  margin-top: 4px;
}

.opportunity-status,
.export-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.export-console {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 46%),
    #fff;
}

.export-summary article {
  flex: 1;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px;
}

.export-summary span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.export-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 26px;
}

.split-grid,
.search-console,
.lead-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.panel-heading h2,
.drawer h2,
.integration-card h2 {
  margin: 0;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  padding: 11px 12px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.location-field {
  position: relative;
  z-index: 5;
}

.location-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  gap: 5px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.location-suggestions[hidden] {
  display: none;
}

.location-suggestions button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  padding: 9px;
}

.location-suggestions button:hover {
  background: #eef7ff;
}

.location-suggestions small {
  color: var(--muted);
}

.quick-actions,
.filter-strip,
.preset-row,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.row-actions {
  gap: 6px;
}

.preset-row {
  margin-top: 14px;
}

.funnel-list,
.run-plan,
.agent-task-list,
.readiness-grid {
  display: grid;
  gap: 10px;
}

.agent-run-status {
  display: grid;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  padding: 12px;
  margin: 12px 0;
}

.agent-run-status strong {
  color: #1d4ed8;
}

.agent-run-status span,
.agent-run-status small {
  color: var(--muted);
  font-size: 13px;
}

.agent-run-status div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.agent-run-status i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--primary));
}

.funnel-list div,
.run-plan article,
.agent-task-list article,
.readiness-grid article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  padding: 12px;
}

.run-plan article,
.agent-task-list article {
  display: grid;
  grid-template-columns: 1fr auto;
}

.run-plan span,
.agent-task-list span,
.readiness-grid span {
  color: var(--muted);
  font-size: 13px;
}

.funnel-list strong {
  color: var(--primary);
  font-size: 22px;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pipeline-column {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.pipeline-column h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.pipeline-column div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 10px;
  margin-bottom: 8px;
}

.pipeline-column span,
.pipeline-column small {
  color: var(--muted);
  font-size: 12px;
}

.score-bars {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}

.score-bars div {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr 32px;
  gap: 8px;
  align-items: center;
}

.score-bars span,
.score-bars em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.score-bars div::before {
  content: "";
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  grid-column: 2;
  grid-row: 1;
}

.score-bars strong {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--primary));
  grid-column: 2;
  grid-row: 1;
  min-width: 8px;
}

.sequence-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.sequence-card.approved {
  border-color: #86efac;
  background: #f0fdf4;
}

.send-log {
  display: grid;
  gap: 10px;
}

.send-log article {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  padding: 10px;
}

.send-log small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.integration-actions {
  margin-top: 14px;
}

.setup-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.setup-steps li::marker {
  color: var(--teal);
  font-weight: 900;
}

.chip {
  min-height: 32px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-2);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 1080px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  padding: 12px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td small,
.detail-list dd,
.sequence-card p {
  color: var(--muted);
  line-height: 1.45;
}

th:first-child,
td:first-child {
  width: 260px;
}

th:last-child,
td:last-child {
  width: 96px;
  text-align: right;
}

td {
  overflow-wrap: anywhere;
}

.status,
.mini-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
}

.status.qualified,
.status.connected {
  background: #dcfce7;
  color: #166534;
}

.status.missing,
.status.failed {
  background: #fee2e2;
  color: #991b1b;
}

.status.draft,
.status.new {
  background: #dbeafe;
  color: #1d4ed8;
}

.mini-badge {
  margin: 0 4px 4px 0;
  background: #fef3c7;
  color: #92400e;
}

.drawer {
  position: sticky;
  top: 20px;
  align-self: start;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.lead-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  justify-content: end;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(2px);
  padding: 18px;
}

.lead-profile-overlay .drawer {
  position: static;
  width: min(520px, 100%);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.lead-profile-stack {
  display: grid;
  grid-template-columns: minmax(420px, 520px) minmax(520px, 760px);
  gap: 14px;
  align-items: start;
  width: min(100%, 1300px);
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.lead-profile-stack > .drawer:only-child {
  grid-column: 2;
}

.gmaps-report {
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.report-cover {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  color: #e5edf8;
  background: linear-gradient(135deg, #101827, #0f766e 58%, #2563eb);
  padding: 18px;
}

.report-cover small {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
}

.report-logo {
  display: flex;
  gap: 12px;
  align-items: center;
}

.report-logo > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  color: #ecfeff;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 950;
}

.report-logo strong,
.report-logo small {
  display: block;
}

.report-title,
.report-section,
.report-footer {
  padding: 18px;
}

.report-title h2 {
  margin: 4px 0 8px;
  font-size: 30px;
  line-height: 1.08;
}

.report-title p,
.report-section p,
.report-footer p,
.report-steps span {
  color: var(--muted);
  line-height: 1.45;
}

.report-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.report-score-grid div,
.report-findings article,
.report-steps li,
.report-footer {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 12px;
}

.report-score-grid span,
.report-score-grid small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.report-score-grid strong {
  display: block;
  margin: 7px 0;
  color: var(--primary);
  font-size: 24px;
}

.report-section h3 {
  margin: 0 0 12px;
}

.report-findings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-findings article {
  display: grid;
  gap: 8px;
}

.report-findings p {
  margin: 0;
}

.report-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-steps li {
  display: grid;
  gap: 4px;
}

.report-footer {
  margin: 0 18px 18px;
  background: #ecfeff;
}

.report-download {
  padding: 0 18px 18px;
}

.report-download button {
  width: 100%;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-list dd {
  margin: 4px 0 0;
}

.drawer-actions,
.activity-list,
.rule-list,
.integration-grid {
  display: grid;
  gap: 10px;
}

.activity-list article {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.activity-list span,
.activity-list small {
  display: block;
  color: var(--muted);
}

.warning,
.empty-state {
  border: 1px solid #f3d08b;
  border-radius: 10px;
  background: #fff8e8;
  color: #5f4313;
  padding: 12px;
}

.empty-state {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
}

.sequence-card {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.sequence-card div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.sequence-card span {
  display: block;
  color: var(--primary);
  font-weight: 900;
}

.integration-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.integration-card {
  display: grid;
  gap: 10px;
}

.report-card {
  margin-bottom: 10px;
}

.inbox-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.inbox-list {
  display: grid;
  gap: 8px;
}

.inbox-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface-2);
  text-align: left;
  padding: 12px;
}

.inbox-list button.active {
  border-color: rgba(20, 184, 166, 0.55);
  background: #ecfeff;
}

.inbox-list span,
.inbox-list small {
  color: var(--muted);
}

.message-thread {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc, #eef7ff);
  padding: 14px;
}

.message-bubble {
  display: grid;
  gap: 6px;
  max-width: 72%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.message-bubble.outbound {
  justify-self: end;
  border-color: rgba(20, 184, 166, 0.32);
  background: #dcfce7;
}

.message-bubble.inbound {
  justify-self: start;
}

.message-bubble p {
  margin: 0;
}

.message-bubble small {
  color: var(--muted);
  font-weight: 800;
}

.reply-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 1180px) {
  .metric-grid,
  .integration-grid,
  .pipeline-board,
  .opportunity-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split-grid,
  .search-console,
  .lead-workbench,
  .inbox-layout,
  .lead-profile-stack,
  .agent-console {
    grid-template-columns: 1fr;
  }

  .agent-console.compact .agent-console-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-profile-overlay .drawer {
    width: 100%;
  }

  .report-score-grid,
  .report-findings {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .top-actions {
    display: grid;
  }

  .top-actions input {
    width: 100%;
  }

  .agent-hero,
  .agent-console-steps,
  .agent-console.compact .agent-console-steps,
  .metric-grid,
  .form-grid,
  .integration-grid,
  .opportunity-grid,
  .pipeline-board {
    grid-template-columns: 1fr;
  }
}

.inbox-command {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.inbox-command article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.inbox-command span,
.inbox-search-row span,
.chat-insights span,
.reply-actions span,
.reply-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inbox-command strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.inbox-layout {
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 230px);
}

.inbox-list-panel,
.inbox-thread-panel {
  padding: 0;
  overflow: hidden;
}

.inbox-panel-head,
.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}

.inbox-panel-head h2,
.chat-header h2 {
  margin: 0;
}

.inbox-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.inbox-search-row input {
  min-height: 38px;
  padding: 8px 10px;
}

.inbox-list {
  gap: 0;
  max-height: calc(100vh - 370px);
  overflow: auto;
}

.inbox-list button {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 14px 16px;
}

.inbox-list button:hover {
  background: #f8fafc;
}

.inbox-list button.active {
  border-color: var(--line);
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.12), #fff 52%);
  box-shadow: inset 3px 0 0 var(--teal);
}

.avatar,
.chat-identity > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--primary));
  font-weight: 900;
}

.conversation-main {
  min-width: 0;
}

.conversation-main strong,
.conversation-main em,
.conversation-meta small {
  display: block;
}

.conversation-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-main em {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.conversation-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.conversation-meta b {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
}

.chat-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.chat-identity small,
.chat-identity p {
  color: var(--muted);
}

.chat-identity p {
  margin: 3px 0 0;
}

.chat-actions {
  display: flex;
  gap: 10px;
}

.chat-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px 16px;
}

.chat-insights span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
}

.message-thread {
  max-height: calc(100vh - 475px);
  min-height: 420px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(248, 250, 252, 0.92), rgba(239, 246, 255, 0.92)),
    radial-gradient(circle at 20px 20px, rgba(15, 118, 110, 0.08) 1px, transparent 1px);
  background-size: auto, 22px 22px;
  padding: 20px;
}

.message-bubble {
  gap: 8px;
  max-width: min(680px, 76%);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  padding: 12px 14px;
}

.message-bubble.outbound {
  border-color: #a7f3d0;
  background: #dcfce7;
  border-bottom-right-radius: 4px;
}

.message-bubble.inbound {
  background: #fff;
  border-bottom-left-radius: 4px;
}

.bubble-meta,
.bubble-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.bubble-meta strong {
  color: #475569;
  font-size: 12px;
}

.message-bubble p {
  line-height: 1.45;
  white-space: pre-wrap;
}

.message-attachment {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  margin-top: 8px;
  padding: 10px;
}

.message-attachment > span {
  align-items: center;
  background: linear-gradient(135deg, #2563eb, #0891b2);
  border-radius: 10px;
  color: #fff;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  letter-spacing: 0;
  width: 36px;
}

.message-attachment strong,
.message-attachment small {
  display: block;
}

.message-attachment small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-pill {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.reply-box {
  gap: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 0;
  padding: 14px 16px 16px;
}

.reply-toolbar,
.reply-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.reply-box textarea {
  min-height: 88px;
  border-radius: 12px;
  background: #f8fafc;
  margin: 10px 0;
}

@media (max-width: 1180px) {
  .inbox-command {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .inbox-command,
  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .message-bubble {
    max-width: 92%;
  }
}
