dialog.workspace-drawer:is(#modal, #post-composer-dialog, #news-reader, #news-manage-drawer, #competitor-channels-dialog, #trend-keyword-dialog) {
  --drawer-gutter: 20px;
  position: fixed;
  inset: 0 0 auto auto;
  margin: 0;
  width: min(100%, var(--drawer-width, 520px));
  max-width: 100%;
  height: var(--mobile-height, 100dvh);
  max-height: none;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  overflow: hidden;
  border: 0;
  border-inline-start: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: -4px 0 24px #211b1914;
}

#post-composer-dialog.workspace-drawer { --drawer-width: min(1160px, 76vw); }
#news-reader.workspace-drawer { --drawer-width: 720px; }
#modal.workspace-drawer:has(.published-analysis, #shop-detail) { --drawer-width: 660px; }
#modal.workspace-drawer:has(.trend-detail-layout) { --drawer-width: min(940px, 86vw); }
#modal.workspace-drawer:is(.design-dialog, .image-dialog) { --drawer-width: min(1120px, 96vw); }

dialog.workspace-drawer::backdrop {
  background: #231e1a39;
  backdrop-filter: none;
}

.workspace-drawer[open]:not(#post-composer-dialog),
.workspace-drawer > #modal-content {
  display: flex;
  flex-direction: column;
}

.workspace-drawer > #modal-content { flex: 1; min-height: 0; }

.workspace-drawer:is(#modal, #post-composer-dialog, #news-reader, #news-manage-drawer, #competitor-channels-dialog, #trend-keyword-dialog) .drawer-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  margin: 0;
  padding: 8px var(--drawer-gutter);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.workspace-drawer .drawer-header h2 { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.workspace-drawer .drawer-header .icon-button { flex: none; width: 40px; height: 40px; }

.workspace-drawer .drawer-content {
  flex: 1;
  min-height: 0;
  padding: 16px var(--drawer-gutter) 24px;
  overflow: auto;
  overscroll-behavior: contain;
}

.workspace-drawer .modal-body > p:empty { display: none; }
#modal.workspace-drawer:not(.design-dialog) .modal-body > p:not(:empty) { margin-bottom: 14px; color: #68615c; }
#modal.workspace-drawer.design-dialog .drawer-content { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
#modal.workspace-drawer.design-dialog .design-workspace { flex: 1; height: auto; min-height: 0; }
.workspace-drawer .image-lightbox { max-width: 100%; }

@keyframes workspace-drawer-in {
  from { transform: translateX(100%); }
}

@media (min-width: 741px) and (prefers-reduced-motion: no-preference) {
  dialog.workspace-drawer[open] { animation: workspace-drawer-in .22s ease-out; }
}

@media (max-width: 900px) {
  #post-composer-dialog.workspace-drawer { --drawer-width: 100%; }
}

@media (max-width: 740px) {
  dialog.workspace-drawer:is(#modal, #post-composer-dialog, #news-reader, #news-manage-drawer, #competitor-channels-dialog, #trend-keyword-dialog) {
    --drawer-gutter: var(--mobile-gutter, 14px);
    width: 100%;
    border-inline-start: 0;
  }

  .workspace-drawer .drawer-header .icon-button { width: 44px; height: 44px; }
}
