:root {
  --bg-canvas: #f4f6fa;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;
  --sidebar-bg: #141b2d;
  --sidebar-hover: #1e2942;
  --sidebar-active: #2563eb;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #8492a6;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --ink: #0f172a;
  --ink-secondary: #475467;
  --ink-muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --primary: #155eef;
  --primary-hover: #1049c7;
  --primary-soft: #eff4ff;
  --ai-start: #4f46e5;
  --ai-end: #0ea5e9;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --line-green: #06c755;
  --line-green-soft: #e9fbf0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 14px 32px rgba(16, 24, 40, 0.14);
  font-family: "Inter", "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg-canvas); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* App Shell */
.ghl-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.18s ease;
}
.ghl-shell.collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}

/* Sidebar */
.ghl-sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  border-right: 1px solid var(--sidebar-border);
  z-index: 20;
  overflow: hidden;
}
.sidebar-top {
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.brand-name {
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
.brand-sub {
  font-size: 10px;
  color: var(--sidebar-muted);
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--sidebar-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--sidebar-hover); color: #fff; }
.icon-btn svg { width: 17px; height: 17px; }

.location-switcher {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  padding: 7px 9px;
  color: #fff;
  text-align: left;
}
.location-switcher:hover { background: rgba(255, 255, 255, 0.09); }
.loc-avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #0ea5e9;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.loc-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.loc-meta strong {
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loc-meta small {
  font-size: 10.5px;
  color: var(--sidebar-muted);
}
.loc-chevron { width: 15px; height: 15px; color: var(--sidebar-muted); flex-shrink: 0; }

.quick-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--sidebar-muted);
  font-size: 12.5px;
}
.quick-search-btn:hover { border-color: rgba(255, 255, 255, 0.2); color: #e2e8f0; }
.quick-search-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.quick-search-btn kbd {
  margin-left: auto;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  color: #cbd5e1;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.nav-item.active svg { opacity: 1; }
.nav-item.nav-ai { color: #bae6fd; }
.nav-item.nav-ai.active { background: linear-gradient(135deg, var(--ai-start), var(--ai-end)); color: #fff; }

.nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
}
.nav-pill {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 10.5px;
  border-radius: 999px;
  padding: 1px 7px;
}
.nav-tag-ai {
  margin-left: auto;
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 700;
  border-radius: 5px;
  padding: 1px 5px;
}
.nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 8px 6px;
}
.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--sidebar-border);
}

/* Collapsed sidebar */
.ghl-shell.collapsed .brand-text,
.ghl-shell.collapsed .loc-meta,
.ghl-shell.collapsed .loc-chevron,
.ghl-shell.collapsed .quick-search-btn span,
.ghl-shell.collapsed .quick-search-btn kbd,
.ghl-shell.collapsed .nav-item span {
  display: none;
}
.ghl-shell.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
.ghl-shell.collapsed .nav-item,
.ghl-shell.collapsed .quick-search-btn,
.ghl-shell.collapsed .location-switcher { justify-content: center; padding: 9px; }

/* Main Column */
.ghl-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top Bar */
.ghl-topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 15;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  height: 100%;
}
.mobile-menu-btn { display: none; color: var(--ink); }
.topbar-title {
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.topbar-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  overflow-x: auto;
}
.topbar-tab {
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 0 10px;
  position: relative;
  white-space: nowrap;
}
.topbar-tab:hover { color: var(--ink); }
.topbar-tab.active { color: var(--primary); font-weight: 650; }
.topbar-tab.active::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  height: 2.5px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.topbar-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  height: 34px;
  width: 220px;
}
.topbar-search-wrap:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12);
}
.topbar-search-wrap svg { width: 15px; height: 15px; color: var(--ink-muted); flex-shrink: 0; }
.topbar-search-wrap input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13px;
}
.ai-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 0;
  background: linear-gradient(135deg, var(--ai-start), var(--ai-end));
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}
.ai-quick-btn:hover { filter: brightness(1.06); }
.ai-quick-btn svg { width: 15px; height: 15px; }

.env-pill {
  font-size: 11.5px;
  font-weight: 650;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #fedf89;
}
.env-pill.live {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: #abefc6;
}
.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: #1e293b;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  display: grid;
  place-items: center;
}

/* Main Canvas */
.ghl-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  min-width: 0;
}
.ghl-canvas.flush {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Typography & Reusable Components */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.page-head p {
  margin: 4px 0 0;
  color: var(--ink-secondary);
  font-size: 13px;
}
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: 0.12s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn-ai { background: linear-gradient(135deg, var(--ai-start), var(--ai-end)); color: #fff; }
.btn-ai:hover { filter: brightness(1.06); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.card-title { font-size: 14.5px; font-weight: 700; margin: 0; }
.card-sub { font-size: 12px; color: var(--ink-muted); }

/* Dashboard Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-secondary);
  font-weight: 600;
}
.kpi-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 4px;
}
.kpi-delta {
  font-size: 12px;
  font-weight: 600;
  color: var(--ok);
}
.kpi-delta.muted { color: var(--ink-muted); font-weight: 500; }

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* Funnel Visual */
.funnel-bars { display: flex; flex-direction: column; gap: 10px; }
.funnel-step {
  display: grid;
  grid-template-columns: 110px 1fr 78px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.funnel-track {
  height: 26px;
  background: #f1f5f9;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
}
.funnel-fill {
  height: 100%;
  border-radius: 7px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

/* Tags & Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-blue { background: var(--primary-soft); color: #1849a9; }
.pill-green { background: var(--ok-soft); color: var(--ok); }
.pill-line { background: var(--line-green-soft); color: #05963e; }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-gray { background: #f2f4f7; color: #344054; }
.pill-ai { background: #eef2ff; color: #4338ca; }

/* Tables */
.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
  background: #f9fafb;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tr.clickable:hover { background: #f8fafc; cursor: pointer; }
.contact-cell { display: flex; align-items: center; gap: 10px; }
.mini-av {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Conversations 3-Pane (GoHighLevel Signature UI) */
.conv-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 310px;
  flex: 1;
  min-height: 0;
  background: #fff;
}
.conv-list {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.conv-list-head {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.conv-filter-row { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-secondary);
}
.chip.active { background: var(--primary-soft); border-color: #b2ddff; color: var(--primary); font-weight: 600; }

.conv-items { flex: 1; overflow-y: auto; }
.conv-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.conv-item:hover { background: #f8fafc; }
.conv-item.active { background: var(--primary-soft); border-left: 3px solid var(--primary); padding-left: 11px; }
.conv-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conv-item-name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.unread-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--primary); }
.conv-item-preview {
  font-size: 12.5px;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-center {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f8fafc;
}
.conv-thread-head {
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.conv-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg-bubble {
  max-width: 74%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
}
.msg-bubble.in {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
}
.msg-bubble.out {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}
.msg-bubble.out.line {
  background: #06c755;
}
.msg-meta {
  font-size: 11px;
  opacity: 0.78;
  margin-top: 5px;
  display: flex;
  gap: 8px;
}
.conv-composer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
}
.composer-channels {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.conv-composer textarea {
  width: 100%;
  min-height: 68px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 12px;
  resize: vertical;
  outline: none;
}
.conv-composer textarea:focus { border-color: var(--primary); }
.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.conv-right {
  border-left: 1px solid var(--line);
  padding: 16px;
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.info-group h3 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}

/* Opportunities Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-col {
  background: #eef2f7;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px;
  min-height: 420px;
  transition: background 0.12s;
}
.kanban-col.drag-over { background: #e0ebff; border-color: var(--primary); }
.kanban-col-head {
  padding: 6px 8px 10px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 10px;
}
.kanban-col-head.s2 { border-bottom-color: #0ea5e9; }
.kanban-col-head.s3 { border-bottom-color: #f59e0b; }
.kanban-col-head.s4 { border-bottom-color: #10b981; }
.kanban-col-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 13.5px;
}
.kanban-col-sum {
  font-size: 12px;
  color: var(--ink-secondary);
  margin-top: 3px;
}
.deal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.deal-card:active { cursor: grabbing; }
.deal-card h4 { margin: 0 0 4px; font-size: 13.5px; }
.deal-val { font-weight: 750; color: var(--ink); font-size: 14px; margin: 6px 0; }
.deal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f2f4f7;
}

/* Automation Visual Workflow Builder */
.wf-canvas {
  background: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 18px 18px;
  background-color: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.wf-node {
  width: min(360px, 100%);
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  padding: 13px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}
.wf-node.trigger { border-color: #2563eb; background: #f8fbff; }
.wf-node.ai { border-color: #6366f1; background: #f5f3ff; }
.wf-node-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.wf-arrow {
  width: 2px;
  height: 26px;
  background: #94a3b8;
  position: relative;
}
.wf-arrow::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: -4px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #94a3b8;
}

/* Launchpad Checklist */
.launch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
}
.launch-left { display: flex; align-items: center; gap: 14px; }
.launch-check {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.launch-check.done { background: var(--ok-soft); color: var(--ok); }
.launch-check.todo { background: #f2f4f7; color: var(--ink-muted); }

/* AI Studio / Drawer */
.ai-prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ai-chip {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.ai-chip:hover { background: #e0e7ff; }
.ai-chat-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 460px;
}
.ai-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-draft-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
}

/* Drawer & Modal */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 40;
  display: flex;
  justify-content: flex-end;
}
.backdrop.center { justify-content: center; align-items: center; padding: 16px; }
.drawer {
  width: min(460px, 100%);
  height: 100%;
  background: #fff;
  padding: 20px 22px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 11px;
  font-weight: 400;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12);
}

/* Toast */
.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
}

/* Responsive */
@media (max-width: 1120px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid-3 { grid-template-columns: 1fr; }
  .conv-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .conv-right { display: none; }
}
@media (max-width: 820px) {
  .ghl-shell { grid-template-columns: 1fr; }
  .ghl-sidebar {
    position: fixed;
    left: -260px;
    width: 244px;
    transition: left 0.2s ease;
  }
  .ghl-shell.mobile-open .ghl-sidebar { left: 0; }
  .mobile-menu-btn { display: grid; }
  .topbar-search-wrap { display: none; }
  .conv-layout { grid-template-columns: 1fr; }
  .conv-list { max-height: 220px; }
}
