.cgs-action-drawer,
.cgs-action-drawer * {
  box-sizing: border-box;
}

.cgs-action-drawer[hidden] {
  display: none !important;
}

.cgs-action-drawer {
  position: fixed;
  inset: 0;
  z-index: 100500;
  display: flex;
  justify-content: flex-end;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

.cgs-action-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, .48);
}

.cgs-action-drawer__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(720px, 94vw);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  background: #fff;
  color: #1f1f1f;
  box-shadow: -16px 0 32px rgba(0, 0, 0, .24);
  transform: translateX(100%);
  transition: transform .2s ease;
}

.cgs-action-drawer.is-open .cgs-action-drawer__panel {
  transform: translateX(0);
}

.cgs-action-drawer__header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  min-height: 56px;
  padding: .75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
  background: #fff;
}

.cgs-action-drawer__title {
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cgs-action-drawer__back,
.cgs-action-drawer__close {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: .45rem .75rem;
  border: 1px solid rgba(0, 0, 0, .16);
  border-radius: 6px;
  background: #f7f7f7;
  color: #1f1f1f;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.cgs-action-drawer__back[hidden] {
  visibility: hidden;
}

.cgs-action-drawer__back:hover,
.cgs-action-drawer__close:hover,
.cgs-action-drawer__back:focus,
.cgs-action-drawer__close:focus {
  background: #eeeeee;
  outline: 2px solid rgba(111, 96, 91, .35);
  outline-offset: 2px;
}

.cgs-action-drawer__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

.cgs-action-drawer__layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  transform: translateX(100%);
  transition: transform .2s ease;
}

.cgs-action-drawer__layer.is-active {
  transform: translateX(0);
}

.cgs-action-drawer__layer[data-cgs-action-drawer-layer="0"] {
  transform: translateX(0);
}

.cgs-action-drawer__loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .94);
  color: #6f605b;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}

.cgs-action-drawer__loading[hidden] {
  display: none !important;
}

.cgs-action-drawer__status {
  align-self: center;
  width: min(100% - 40px, 520px);
  margin: auto;
  padding: 22px 24px;
  border: 1px solid rgba(77, 70, 62, .18);
  border-radius: 8px;
  background: #fffdf9;
  color: #554843;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
}

.cgs-action-drawer__status.is-loading::before {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto 12px;
  border: 3px solid rgba(243, 101, 39, .22);
  border-top-color: #f36527;
  border-radius: 50%;
  animation: cgs-action-drawer-spin .8s linear infinite;
}

.cgs-action-drawer__status.is-error {
  border-color: rgba(163, 58, 42, .34);
  background: #fff1ee;
  color: #8f2f23;
}

@keyframes cgs-action-drawer-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .cgs-action-drawer__status.is-loading::before {
    animation-duration: 1.8s;
  }
}

.cgs-action-drawer__iframe {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

html.cgs-action-drawer-open,
body.cgs-action-drawer-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .cgs-action-drawer__panel {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    box-shadow: none;
  }

  .cgs-action-drawer__header {
    min-height: 52px;
    padding: .6rem .75rem;
    gap: .5rem;
  }
}
