


.crs-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 7px;
  background: rgba(15, 20, 27, 0.045);
  border: 1px solid rgba(15, 20, 27, 0.06);
  margin-right: 6px;
}
.crs-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: #6B7280;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .12s, color .12s;
  line-height: 1.1;
}
.crs-chip:hover { color: #0F141B; background: rgba(15, 20, 27, 0.05); }
.crs-chip.crs-active { color: #0D1117; background: #2DD4A0; }
.crs-chip.crs-active:hover { background: #29c093; }
.crs-chip[data-crs-size="fs"] {
  padding: 4px 6px;
  min-width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.crs-chip[data-crs-size="fs"] svg { width: 12px; height: 12px; display: block; }


.modal-h .crs-controls,
.drawer-h .crs-controls,
.drawer-header .crs-controls {
  position: absolute;
  top: 14px;
  right: 60px;   
  z-index: 4;
}


.ce-chrome-bar .crs-controls.crs-docked,
.modal-h .ce-chrome-bar .crs-controls.crs-docked,
.drawer-header .ce-chrome-bar .crs-controls.crs-docked {
  position: static;
  margin: 0 2px;
  background: transparent;
  border: none;
  border-left: 1px solid #E5E7EB;
  border-right: 1px solid #E5E7EB;
  border-radius: 0;
  padding: 0 4px;
}

.drawer-h .crs-controls { top: 18px; right: 56px; }

body.theme-dark .crs-controls { background: rgba(148,163,184,0.10); border-color: rgba(148,163,184,0.20); }
body.theme-dark .ce-chrome-bar .crs-controls.crs-docked { background: transparent; border-color: rgba(148,163,184,0.2); }
body.theme-dark .crs-chip { color: #94A3B8; }
body.theme-dark .crs-chip:hover { color: #F8FAFC; background: rgba(45,212,160,0.20); }
body.theme-dark .crs-chip.crs-active { color: #0D1117; background: #2DD4A0; }



.modal.crs-s  { max-width: 480px !important; }
.modal.crs-m  {  }
.modal.crs-l  { max-width: 1040px !important; width: 100%; }
.modal.crs-fs {
  max-width: none !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  animation: none !important;
}
.modal.crs-fs .modal-body { max-height: calc(100vh - 140px) !important; }

.modal-backdrop.crs-fs-backdrop:has(> .modal.crs-fs) { padding: 0 !important; align-items: stretch !important; justify-content: stretch !important; }


.drawer.crs-s  { width: 460px !important; max-width: 96vw !important; }
.drawer.crs-m  {  }
.drawer.crs-l  { width: 900px !important; max-width: 96vw !important; }
.drawer.crs-fs {
  width: 100vw !important;
  max-width: 100vw !important;
  border-radius: 0 !important;
}


.crs-freeform { transition: none !important; }



.crs-grip-modal {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 5;
  background:
    linear-gradient(135deg, transparent 0%, transparent 40%, rgba(15,20,27,0.20) 40%, rgba(15,20,27,0.20) 45%, transparent 45%, transparent 55%, rgba(15,20,27,0.20) 55%, rgba(15,20,27,0.20) 60%, transparent 60%, transparent 70%, rgba(15,20,27,0.20) 70%, rgba(15,20,27,0.20) 75%, transparent 75%);
  border-radius: 0 0 12px 0;
  opacity: 0.55;
  transition: opacity .12s;
}
.crs-grip-modal:hover { opacity: 1; }


.crs-grip-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 91;
  background: transparent;
  transition: background .12s;
}
.crs-grip-drawer:hover,
.crs-grip-drawer.crs-dragging {
  background: linear-gradient(90deg, transparent, rgba(45,212,160,0.30));
}
.crs-grip-drawer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 1px;
  width: 3px;
  height: 40px;
  border-radius: 2px;
  background: rgba(15,20,27,0.18);
  transform: translateY(-50%);
  transition: background .12s;
}
.crs-grip-drawer:hover::before { background: #2DD4A0; }


.drawer.crs-dragging { transition: none !important; }


body.crs-dragging-body {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: ew-resize !important;
}
body.crs-dragging-body.crs-dragging-body-modal { cursor: nwse-resize !important; }


@media (max-width: 640px) {
  .crs-controls { display: none; }
  .crs-grip-modal, .crs-grip-drawer { display: none; }
}




.modal.crs-l   .modal-body,
.modal.crs-fs  .modal-body,
.drawer.crs-l  .drawer-body,
.drawer.crs-fs .drawer-body {
  container-type: inline-size;
  container-name: crs-body;
}


.modal.crs-fs .modal-body {
  max-width: 1600px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
.drawer.crs-fs .drawer-body {
  max-width: 1600px;
  margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}


@container crs-body (min-width: 900px) {
  .modal-body,
  .drawer-body {
    column-count: 2;
    column-gap: 24px;
    column-fill: balance;
  }
  .modal-body > *,
  .drawer-body > * {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 16px;
  }
}


@container crs-body (min-width: 1400px) {
  .modal-body,
  .drawer-body {
    column-count: 3;
  }
}


@container crs-body (min-width: 900px) {
  .modal-body  > [data-crs-wide="true"],
  .drawer-body > [data-crs-wide="true"],
  .modal-body  > *:has(> table),
  .drawer-body > *:has(> table),
  .modal-body  > *:has(> .line-items),
  .drawer-body > *:has(> .line-items),
  .modal-body  > *:has(> .kpi-strip),
  .drawer-body > *:has(> .kpi-strip),
  .modal-body  > *:has(> .kpi-grid),
  .drawer-body > *:has(> .kpi-grid),
  .modal-body  > .crs-wide,
  .drawer-body > .crs-wide {
    column-span: all;
    -webkit-column-span: all;
  }
}




