/* Drawer (right-edge push) — bez overlay backdropu. Underlying content
   widoczny po lewej, zwęża się o szerokość drawera via body class. */

:root {
  --drawer-right-width: 480px;
}

.drawer {
  position: fixed;
  /* Drawer kotwiczony PONIŻEJ brandbara (56px) — wzorzec proxy_sembot.
     Brandbar (top) i sidebar (left) zostają widoczne i klikalne. */
  top: 56px;
  right: 0;
  bottom: 0;
  width: var(--drawer-right-width);
  max-width: 100vw;
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 22px rgba(0, 0, 0, .06);
  z-index: 60;
  display: flex; flex-direction: column;
  animation: drawer-slide .2s cubic-bezier(.2, .8, .2, 1);
  overflow: hidden;
}

@keyframes drawer-slide {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* Inner content wrapper — swapped on every inline-edit save. Kept
   outside the .drawer-side animation envelope so re-renders don't
   replay the slide-in. */
.task-drawer-content {
  display: flex; flex-direction: column;
  flex: 1 1 auto; min-height: 0;
  overflow: hidden;
}

/* Push-content: gdy drawer otwarty, main view zwęża się żeby zrobić
   miejsce. Animacja smooth żeby jedno z drugim się zsynchronizowało. */
body.has-drawer-right .app .view {
  margin-right: var(--drawer-right-width);
  transition: margin-right .2s cubic-bezier(.2, .8, .2, 1);
}

.app .view {
  transition: margin-right .2s cubic-bezier(.2, .8, .2, 1);
}

.drawer-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head-text { flex: 1; min-width: 0; }
.drawer-title {
  margin: 0;
  font-size: 15px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
}
.drawer-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}
.drawer-action {
  flex: 0 0 auto;
  text-decoration: none;
  white-space: nowrap;
}
.drawer-close {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink-3);
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.drawer-close:hover {
  background: var(--bg-sunk);
  border-color: var(--line-3);
  color: var(--ink);
}

.drawer-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1; min-height: 0;
}

/* Wąskie ekrany: drawer zajmuje pełną szerokość, push znika
   (overlay-mode jako fallback). */
@media (max-width: 720px) {
  .drawer { width: 100%; }
  body.has-drawer-right .app .view { margin-right: 0; }
}

/* Inputy w drawerze używają teraz unified .form-control z DS (przez
   molecules.FormInput/Select/Textarea). Nie potrzebujemy lokalnych
   override'ów — focus state z accent border jest spójny w całym
   systemie. */
