.ui-right-drawer,
.ui-bottom-drawer {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(7, 8, 10, 0.96);
  min-height: 0;
}

.right-drawer-backdrop {
  display: none !important;
}

.right-drawer-launcher {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 46px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(111, 231, 255, 0.24);
  border-radius: var(--radius-pill);
  background: rgba(9, 13, 19, 0.94);
  color: var(--accent-cyan);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.right-drawer-launcher::before {
  content: "";
  width: 18px;
  height: 4px;
  display: block;
  border-radius: var(--radius-pill);
  background:
    linear-gradient(90deg, rgba(111, 231, 255, 0.9), rgba(111, 231, 255, 0.58));
  opacity: 0.96;
  box-shadow:
    0 -6px 0 rgba(111, 231, 255, 0.28),
    0 6px 0 rgba(111, 231, 255, 0.42);
}

.right-drawer-launcher:hover,
.right-drawer-launcher:focus-visible {
  border-color: rgba(111, 231, 255, 0.66);
  background: rgba(10, 15, 22, 0.98);
  box-shadow: 0 0 0 1px rgba(111, 231, 255, 0.18), 0 8px 18px rgba(0, 0, 0, 0.2);
  outline: none;
}

.ui-right-drawer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  contain: layout paint;
  opacity: 0;
  transform: translateX(22px);
  pointer-events: none;
  transition: transform 220ms ease, opacity 180ms ease;
}

.ui-right-drawer.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.ui-bottom-drawer {
  display: none;
  max-height: none;
  height: var(--bottom-panel-height, var(--drawer-bottom-height));
  overflow: hidden;
  transition: height 300ms ease, max-height 300ms ease;
  contain: layout paint;
}

.ui-bottom-drawer.is-open {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.ui-bottom-drawer.is-resizing {
  transition: none !important;
}

.bottom-resize-handle {
  height: 12px;
  cursor: ns-resize;
  touch-action: none;
  border-bottom: 1px solid rgba(145, 160, 178, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  position: relative;
}

.bottom-resize-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 54px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: var(--radius-pill);
  background: rgba(145, 160, 178, 0.42);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(145, 160, 178, 0.12);
}

.drawer-body {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  content-visibility: auto;
  contain-intrinsic-size: 280px;
}

.drawer-body .card-lite + .card-lite {
  margin-top: 10px;
}

.drawer-toggle {
  border-radius: var(--radius-md);
  padding: 6px 10px;
  cursor: pointer;
}

.drawer-panel {
  display: none;
  content-visibility: hidden;
}

.drawer-panel.is-active {
  display: block;
  content-visibility: auto;
  contain-intrinsic-size: 240px;
}

.review-drawer {
  position: fixed;
  right: 0;
  top: 0;
  width: min(640px, 96vw);
  height: 100vh;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: rgba(7, 8, 18, 0.97);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  z-index: 3000;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  opacity: 0;
  transform: translateX(30px);
  transition: transform 190ms ease, opacity 190ms ease;
  pointer-events: none;
}

.review-drawer.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

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

.review-drawer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(8, 8, 18, 0.86);
  color: var(--text);
  padding: 8px;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 12, 0.54);
  z-index: 2590;
}

.mobile-workspace-host {
  display: grid;
  gap: 8px;
}

.mobile-workspace-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mobile-workspace-tabs .tab-btn {
  flex: 0 0 auto;
}

@media (max-width: 1023px) {
  .review-drawer {
    width: min(92vw, 560px);
    border-radius: 12px 0 0 12px;
  }
}

@media (max-width: 639px) {
  .right-drawer-launcher,
  .right-drawer-backdrop {
    display: none !important;
  }

  .ui-right-drawer {
    display: none !important;
  }

  .app-shell .ui-bottom-drawer,
  .ui-bottom-drawer {
    display: grid !important;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 2600;
    height: 26px;
    max-height: 90vh !important;
    border-radius: 14px;
    transition: height 180ms ease, transform 180ms ease;
  }

  .ui-bottom-drawer[data-sheet-state="half"] {
    height: 50vh;
  }

  .ui-bottom-drawer[data-sheet-state="full"] {
    height: 90vh;
  }

  .ui-bottom-drawer[data-sheet-state="collapsed"] .drawer-header,
  .ui-bottom-drawer[data-sheet-state="collapsed"] .drawer-body {
    opacity: 0;
    pointer-events: none;
    content-visibility: hidden;
  }

  .ui-bottom-drawer .drawer-header,
  .ui-bottom-drawer .drawer-body {
    transition: opacity 120ms ease;
  }

  .ui-bottom-drawer .drawer-header .tabs {
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 2px;
  }

  .ui-bottom-drawer .drawer-header .tab-btn {
    flex: 0 0 auto;
  }

  .ui-bottom-drawer .drawer-toggle {
    display: none;
  }
}

