/**
 * Desktop workspace: CRM | divider | Chat
 * Visual composition — active at min-width: 900px
 */

:root {
  --ws-duration: 280ms;
  --ws-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ws-chat-pct: 27%;
  --ws-crm-pct: 73%;
  --ws-divider: 6px;
  --ws-min-pct: 28%;
  --ws-panel-header-h: 38px;
  --ws-panel-header-pad-x: 0.7rem;
  --ws-panel-header-pad-y: 0.28rem;
  --ws-panel-border: #e2e8f0;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ws-duration: 0.01ms;
  }
}

/* Header expands with workspace */
body.page-chat .app-header__inner {
  transition:
    max-width var(--ws-duration) var(--ws-ease),
    padding var(--ws-duration) var(--ws-ease),
    gap var(--ws-duration) var(--ws-ease);
}

body.page-chat .app-brand,
body.page-chat .app-nav {
  transition:
    transform var(--ws-duration) var(--ws-ease),
    margin var(--ws-duration) var(--ws-ease),
    gap var(--ws-duration) var(--ws-ease),
    opacity var(--ws-duration) var(--ws-ease);
}

@media (min-width: 900px) {
  body.page-chat.workspace-capable .app-main,
  body.page-chat.workspace-open .app-main,
  html.workspace-boot-open body.page-chat .app-main {
    max-width: none !important;
    width: 100%;
    margin: 0;
    height: calc(var(--app-height, 100dvh) - var(--header-h, 56px));
  }

  body.page-chat.workspace-capable .app-header__inner {
    max-width: 960px;
    width: 100%;
  }

  /* Full desktop app header: brand left, nav right, airy center */
  body.page-chat.workspace-open .app-header__inner {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    padding-left: clamp(1rem, 2.2vw, 1.75rem);
    padding-right: clamp(1rem, 2.2vw, 1.75rem);
    gap: 1.5rem;
    justify-content: space-between;
  }

  body.page-chat.workspace-open .app-brand {
    flex: 0 0 auto;
    margin-right: 0;
    transform: translateX(0);
  }

  body.page-chat.workspace-open .app-nav {
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
    gap: 0.55rem;
  }

  body.page-chat.workspace-open #navCrmLink.is-workspace-active,
  body.page-chat.workspace-open #navCrmLink[aria-pressed="true"],
  body.page-chat.workspace-open #navChatLink.is-workspace-active,
  body.page-chat.workspace-open #navChatLink[aria-pressed="true"] {
    color: var(--color-primary-dark);
    font-weight: 600;
    background: #ede9fe;
    border-color: #ddd6fe;
  }

  body.page-chat.workspace-mode-chat-only #navChatLink.is-workspace-active,
  body.page-chat.workspace-mode-chat-only #navChatLink[aria-pressed="true"] {
    color: var(--color-primary-dark);
    font-weight: 600;
    background: #ede9fe;
    border-color: #ddd6fe;
  }

  body.page-chat.workspace-capable .tuapi-workspace {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #eef2f6;
  }

  /* Visual order: CRM | divisor | Chat (DOM unchanged; Chat instance stays mounted) */
  body.page-chat.workspace-capable .tuapi-workspace__crm {
    order: 1;
  }

  body.page-chat.workspace-capable .tuapi-workspace__divider {
    order: 2;
  }

  body.page-chat.workspace-capable .tuapi-workspace__chat {
    order: 3;
  }

  body.page-chat.workspace-capable:not(.workspace-open) .tuapi-workspace,
  body.page-chat.workspace-mode-chat-only .tuapi-workspace {
    justify-content: center;
    background: transparent;
  }

  body.page-chat.workspace-capable:not(.workspace-open) .tuapi-workspace__chat,
  body.page-chat.workspace-mode-chat-only .tuapi-workspace__chat {
    flex: 0 1 720px;
    margin: 0;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  body.page-chat .tuapi-workspace__chat {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    transition:
      flex-basis var(--ws-duration) var(--ws-ease),
      max-width var(--ws-duration) var(--ws-ease),
      margin var(--ws-duration) var(--ws-ease),
      opacity var(--ws-duration) var(--ws-ease),
      transform var(--ws-duration) var(--ws-ease);
    max-width: 720px;
    width: 100%;
    opacity: 1;
    transform: translateX(0);
    overflow: hidden;
  }

  body.page-chat.workspace-open.workspace-mode-split .tuapi-workspace__chat {
    flex: 0 0 var(--ws-chat-pct);
    max-width: none;
    margin: 0;
    border-right: none;
    background: var(--color-surface);
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  body.page-chat.workspace-open.workspace-mode-crm-only .tuapi-workspace__chat {
    flex: 0 0 0;
    max-width: 0;
    min-width: 0;
    margin: 0;
    opacity: 0;
    transform: translateX(16px);
    pointer-events: none;
  }

  body.page-chat.workspace-open .tuapi-workspace__chat .chat-shell {
    border-right: none;
    border-left: none;
    box-shadow: none;
  }

  /* Shared panel header rhythm (Chat ↔ CRM bar) */
  body.page-chat.workspace-open .chat-shell__header {
    min-height: var(--ws-panel-header-h);
    height: var(--ws-panel-header-h);
    padding: var(--ws-panel-header-pad-y) var(--ws-panel-header-pad-x);
    border-bottom: 1px solid var(--ws-panel-border);
    box-sizing: border-box;
    display: flex;
    align-items: center;
  }

  body.page-chat.workspace-open .chat-shell__header-row {
    align-items: center;
    gap: 0.4rem;
    width: 100%;
  }

  body.page-chat.workspace-open .chat-shell__header h1 {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
  }

  body.page-chat.workspace-open .chat-shell__header p {
    margin: 0.02rem 0 0;
    font-size: 0.7rem;
    line-height: 1.15;
    max-width: 9.5rem;
  }

  body.page-chat.workspace-open .chat-shell__header-actions {
    gap: 0.22rem;
    flex-shrink: 0;
  }

  body.page-chat.workspace-open .chat-shell__header .btn--sm,
  body.page-chat.workspace-open .chat-shell__icon-btn {
    min-height: 30px;
    min-width: 30px;
    padding: 0.18rem 0.4rem;
    font-size: 0.7rem;
  }

  /* Chat usable at ~30% width — keep message readability */
  body.page-chat.workspace-open .chat-messages {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  body.page-chat.workspace-open .chat-bubble {
    max-width: min(94%, 100%);
  }

  /* Compact lower chrome only (chips + composer) */
  body.page-chat.workspace-open .chat-composer {
    padding-left: 0;
    padding-right: 0;
  }

  body.page-chat.workspace-open #chatChips,
  body.page-chat.workspace-open .chat-chips {
    gap: 0.28rem;
    padding: 0.28rem 0.5rem 0.08rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  body.page-chat.workspace-open .chip,
  body.page-chat.workspace-open [data-chip] {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.26rem 0.55rem;
    font-size: 0.76rem;
    min-height: 30px;
  }

  body.page-chat.workspace-open .chat-form {
    gap: 0.35rem;
    padding: 0.28rem 0.5rem 0.4rem;
  }

  body.page-chat.workspace-open .chat-form__textarea,
  body.page-chat.workspace-open .chat-form__secure {
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
    min-height: 2.35rem;
  }

  body.page-chat.workspace-open .chat-composer__send {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  body.page-chat.workspace-open .chat-attach-btn {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  /* Divider — behavior unchanged; only keep existing affordance */
  body.page-chat .tuapi-workspace__divider {
    flex: 0 0 0;
    width: 0;
    opacity: 0;
    overflow: hidden;
    position: relative;
    z-index: 3;
    cursor: col-resize;
    touch-action: none;
    overscroll-behavior: contain;
    background: transparent;
    flex-shrink: 0;
    transition: opacity var(--ws-duration) var(--ws-ease), flex-basis var(--ws-duration) var(--ws-ease);
  }

  body.page-chat.workspace-open.workspace-mode-split .tuapi-workspace__divider {
    flex: 0 0 var(--ws-divider);
    width: var(--ws-divider);
    opacity: 1;
  }

  body.page-chat.workspace-open.workspace-mode-crm-only .tuapi-workspace__divider {
    flex: 0 0 0;
    width: 0;
    opacity: 0;
    pointer-events: none;
  }

  body.page-chat .tuapi-workspace__divider::before {
    content: "";
    position: absolute;
    inset: 0 -5px;
  }

  body.page-chat .tuapi-workspace__divider-grip {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 42px;
    margin: -21px 0 0 -1.5px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 160ms ease, height 160ms ease;
  }

  body.page-chat .tuapi-workspace__divider:hover .tuapi-workspace__divider-grip,
  body.page-chat .tuapi-workspace__divider:focus-visible .tuapi-workspace__divider-grip,
  body.page-chat.workspace-resizing .tuapi-workspace__divider-grip {
    background: var(--color-primary);
    height: 56px;
    margin-top: -28px;
  }

  body.page-chat .tuapi-workspace__crm {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    min-height: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-right: 1px solid transparent;
    transform: translateX(-12px);
    transition:
      flex-basis var(--ws-duration) var(--ws-ease),
      opacity var(--ws-duration) var(--ws-ease),
      transform var(--ws-duration) var(--ws-ease),
      border-color var(--ws-duration) var(--ws-ease);
    pointer-events: none;
  }

  body.page-chat.workspace-open .tuapi-workspace__chat .chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.page-chat.workspace-open.workspace-mode-split .tuapi-workspace__crm {
    flex: 0 0 var(--ws-crm-pct);
    width: auto;
    opacity: 1;
    transform: translateX(0);
    border-right-color: var(--ws-panel-border);
    pointer-events: auto;
  }

  body.page-chat.workspace-open.workspace-mode-crm-only .tuapi-workspace__crm {
    flex: 1 1 100%;
    width: auto;
    opacity: 1;
    transform: translateX(0);
    border-right-color: transparent;
    pointer-events: auto;
  }

  /* F5 / early boot: paint mode before JS finishes */
  html.workspace-boot-open body.page-chat .app-header__inner,
  html.workspace-boot-split body.page-chat .app-header__inner,
  html.workspace-boot-crm-only body.page-chat .app-header__inner {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    padding-left: clamp(1rem, 2.2vw, 1.75rem);
    padding-right: clamp(1rem, 2.2vw, 1.75rem);
    gap: 1.5rem;
    justify-content: space-between;
  }

  html.workspace-boot-open body.page-chat .tuapi-workspace,
  html.workspace-boot-split body.page-chat .tuapi-workspace,
  html.workspace-boot-crm-only body.page-chat .tuapi-workspace {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: #eef2f6;
    justify-content: flex-start;
  }

  html.workspace-boot-split body.page-chat .tuapi-workspace__crm,
  html.workspace-boot-open body.page-chat .tuapi-workspace__crm {
    order: 1;
    flex: 0 0 var(--ws-crm-pct);
    width: auto;
    min-width: 0;
    min-height: 0;
    opacity: 1;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    transform: translateX(0);
    border-right: 1px solid var(--ws-panel-border);
    pointer-events: auto;
    transition: none;
  }

  html.workspace-boot-crm-only body.page-chat .tuapi-workspace__crm {
    order: 1;
    flex: 1 1 100%;
    width: auto;
    min-width: 0;
    min-height: 0;
    opacity: 1;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    transform: translateX(0);
    border-right: none;
    pointer-events: auto;
    transition: none;
  }

  html.workspace-boot-split body.page-chat .tuapi-workspace__divider,
  html.workspace-boot-open body.page-chat .tuapi-workspace__divider {
    order: 2;
    flex: 0 0 var(--ws-divider);
    width: var(--ws-divider);
    opacity: 1;
    display: block !important;
    overflow: visible;
    transition: none;
  }

  html.workspace-boot-crm-only body.page-chat .tuapi-workspace__divider {
    display: none !important;
  }

  html.workspace-boot-split body.page-chat .tuapi-workspace__chat,
  html.workspace-boot-open body.page-chat .tuapi-workspace__chat {
    order: 3;
    flex: 0 0 var(--ws-chat-pct);
    max-width: none;
    margin: 0;
    opacity: 1;
    transform: translateX(0);
    transition: none;
  }

  html.workspace-boot-crm-only body.page-chat .tuapi-workspace__chat {
    order: 3;
    flex: 0 0 0;
    max-width: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    transition: none;
  }

  html.workspace-boot-open body.page-chat.workspace-capable:not(.workspace-open) .tuapi-workspace {
    justify-content: flex-start;
    background: #eef2f6;
  }

  html.workspace-boot-open body.page-chat.workspace-capable:not(.workspace-open) .tuapi-workspace__chat {
    flex: 0 0 var(--ws-chat-pct);
    max-width: none;
  }

  body.page-chat .tuapi-workspace__frame {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    border: 0;
    background: var(--color-bg);
    display: block;
  }

  /* Discrete scrollbars — Chat messages + workspace panels */
  body.page-chat.workspace-capable .chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.22) transparent;
  }

  body.page-chat.workspace-capable .chat-messages::-webkit-scrollbar {
    width: 8px;
  }

  body.page-chat.workspace-capable .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 999px;
  }

  body.page-chat.workspace-capable .chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.32);
  }

  body.page-chat.workspace-resizing,
  body.page-chat.workspace-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
  }
}

/* Below split-capable: workspace chrome never shows; chat behaves as today */
@media (max-width: 899px) {
  body.page-chat .tuapi-workspace {
    display: contents;
  }

  body.page-chat .tuapi-workspace__chat {
    display: contents;
  }

  body.page-chat .tuapi-workspace__divider,
  body.page-chat .tuapi-workspace__crm {
    display: none !important;
  }

  html.workspace-boot-open body.page-chat .tuapi-workspace__divider,
  html.workspace-boot-open body.page-chat .tuapi-workspace__crm {
    display: none !important;
  }
}

html:has(> body.page-crm-embed) {
  height: 100%;
  overflow: hidden;
}

/* ——— CRM embed (iframe): scroll propio + sidebar rail por ancho del panel ——— */
body.page-crm-embed {
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
}

body.page-crm-embed .app-main,
body.page-crm-embed.page-crm .app-main,
body.page-crm-embed.page-crm-guest .app-main {
  flex: 1 1 auto;
  max-width: none;
  width: 100%;
  margin: 0;
  margin-inline: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

body.page-crm-embed .app-footer,
body.page-crm-embed .crm-bottom-nav,
body.page-crm-embed .crm-more-sheet {
  display: none !important;
}

/* Siempre sidebar en embed (el ancho lo define el panel, no el viewport externo) */
body.page-crm-embed .crm-sidebar--desktop {
  display: block !important;
}

body.page-crm-embed .crm-layout {
  container-type: inline-size;
  container-name: crm-panel;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.45rem 0.4rem 0.5rem 0.35rem;
  overflow: hidden;
}

body.page-crm-embed .crm-sidebar--desktop {
  width: 148px;
  min-width: 0;
  align-self: stretch;
  position: sticky;
  top: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.2) transparent;
}

body.page-crm-embed .crm-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

body.page-crm-embed .crm-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.38rem 0.5rem;
  font-size: 0.8rem;
  min-height: 36px;
  line-height: 1.25;
  border-radius: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.page-crm-embed .crm-sidebar__label {
  flex: 1 1 auto;
  min-width: 0;
}

body.page-crm-embed .crm-sidebar__icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

body.page-crm-embed .crm-nav-badge {
  flex: 0 0 auto;
}

body.page-crm-embed .crm-main {
  max-width: none;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 0.15rem 0.65rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.22) transparent;
}

body.page-crm-embed .crm-main::-webkit-scrollbar {
  width: 8px;
}

body.page-crm-embed .crm-main::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.2);
  border-radius: 999px;
}

body.page-crm-embed .crm-main::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.32);
}

body.page-crm-embed .crm-main__header {
  margin-bottom: 0.55rem;
  align-items: center;
}

body.page-crm-embed .crm-main__header h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0.05rem 0 0;
}

body.page-crm-embed .crm-eyebrow {
  font-size: 0.68rem;
}

body.page-crm-embed .crm-module-desc {
  font-size: 0.78rem;
}

body.page-crm-embed .crm-reminders-banner,
body.page-crm-embed .crm-dashboard-highlight {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

body.page-crm-embed .crm-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

body.page-crm-embed .crm-metric-card {
  padding: 0.65rem 0.7rem;
  min-width: 0;
}

body.page-crm-embed .crm-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

body.page-crm-embed .crm-summary-block {
  padding: 0.7rem 0.75rem;
  min-width: 0;
}

body.page-crm-embed .crm-section {
  margin-bottom: 0.95rem;
}

body.page-crm-embed .crm-section h2 {
  font-size: 0.95rem;
  margin: 0 0 0.45rem;
}

body.page-crm-embed .crm-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

body.page-crm-embed .crm-quick-action {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  height: auto;
}

body.page-crm-embed .crm-table-wrap,
body.page-crm-embed .crm-recent,
body.page-crm-embed .crm-module-panel,
body.page-crm-embed .crm-section-block {
  max-width: none;
  width: 100%;
  min-width: 0;
}

body.page-crm-embed .crm-table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

body.page-crm-embed .crm-table--desktop {
  width: 100%;
  table-layout: fixed;
}

body.page-crm-embed .crm-table th,
body.page-crm-embed .crm-table td {
  padding: 0.5rem 0.6rem;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.page-crm-embed .crm-table th:nth-child(1),
body.page-crm-embed .crm-table td:nth-child(1) {
  width: 12%;
}

body.page-crm-embed .crm-table th:nth-child(2),
body.page-crm-embed .crm-table td:nth-child(2) {
  width: 36%;
}

body.page-crm-embed .crm-table th:nth-child(3),
body.page-crm-embed .crm-table td:nth-child(3) {
  width: 14%;
}

body.page-crm-embed .crm-table th:nth-child(4),
body.page-crm-embed .crm-table td:nth-child(4) {
  width: 18%;
}

body.page-crm-embed .crm-table th:nth-child(5),
body.page-crm-embed .crm-table td:nth-child(5) {
  width: 14%;
  min-width: 4.25rem;
}

body.page-crm-embed .crm-table td.crm-table__actions,
body.page-crm-embed .crm-table__actions {
  overflow-wrap: normal;
  word-break: normal;
}

body.page-crm-embed .crm-table__actions {
  gap: 0.25rem;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
}

body.page-crm-embed .crm-table__actions .btn {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  flex: 0 0 auto;
}

/* —— Rail compacto: ancho real del panel iframe (< 480px) —— */
@container crm-panel (max-width: 479px) {
  body.page-crm-embed .crm-sidebar--desktop {
    width: 52px;
  }

  body.page-crm-embed .crm-sidebar__link {
    justify-content: center;
    padding: 0.42rem 0.35rem;
    position: relative;
  }

  body.page-crm-embed .crm-sidebar__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  body.page-crm-embed .crm-nav-badge {
    position: absolute;
    top: 0.15rem;
    right: 0.12rem;
    min-width: 1rem;
    font-size: 0.58rem;
    padding: 0.05rem 0.22rem;
  }

  body.page-crm-embed .crm-metrics,
  body.page-crm-embed .crm-summary-grid {
    grid-template-columns: 1fr;
  }

  body.page-crm-embed .crm-table th:nth-child(4),
  body.page-crm-embed .crm-table td:nth-child(4) {
    display: none;
  }
}

@container crm-panel (min-width: 480px) and (max-width: 679px) {
  body.page-crm-embed .crm-sidebar--desktop {
    width: 148px;
  }

  body.page-crm-embed .crm-metrics,
  body.page-crm-embed .crm-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-crm-embed .crm-table th:nth-child(4),
  body.page-crm-embed .crm-table td:nth-child(4) {
    display: none;
  }
}

@container crm-panel (min-width: 680px) and (max-width: 899px) {
  body.page-crm-embed .crm-metrics,
  body.page-crm-embed .crm-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container crm-panel (min-width: 900px) {
  body.page-crm-embed .crm-sidebar--desktop {
    width: 152px;
  }

  body.page-crm-embed .crm-layout {
    padding: 0.55rem 0.55rem 0.65rem 0.4rem;
    gap: 0.5rem;
  }

  body.page-crm-embed .crm-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
