/* Drawer - style. Dodaj w <head>: <link rel="stylesheet" href="drawer.css"> */

.mhd-overlay,
.mhd-drawer {
  /* Zmieniaj tu: */
  --mhd-width: 560px;
  --mhd-bg: #ffffff;
  --mhd-text: #14262b;
  --mhd-line: #d5dee0;
  --mhd-accent: #0b6b73;
  --mhd-accent-text: #ffffff;
  --mhd-overlay: rgba(10, 30, 35, .45);
}

/* Ściemnione tło */
.mhd-overlay {
  position: fixed; inset: 0; z-index: 2147483000;
  background: var(--mhd-overlay);
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility 0s linear .25s;
}

/* Panel */
.mhd-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2147483001;
  width: min(var(--mhd-width), 100%);
  display: flex; flex-direction: column;
  background: var(--mhd-bg); color: var(--mhd-text);
  border-left: 1px solid var(--mhd-line);
  font-size: 16px; line-height: 1.55; font-family: inherit;
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateX(100%); visibility: hidden;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
}
.mhd-drawer, .mhd-drawer * { box-sizing: border-box; }

/* Stan otwarty */
.mhd-open .mhd-overlay { opacity: 1; visibility: visible; transition-delay: 0s; }
.mhd-open .mhd-drawer  { transform: none; visibility: visible; transition-delay: 0s; }

/* Nagłówek */
.mhd-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--mhd-line);
}
.mhd-title { margin: 0; font-size: 1.3rem; line-height: 1.25; color: var(--mhd-text); }
.mhd-x {
  flex: none; width: 36px; height: 36px;
  border: 1px solid var(--mhd-line); border-radius: 8px;
  background: transparent; color: var(--mhd-text);
  font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.mhd-x:hover { border-color: var(--mhd-text); }

/* Treść */
.mhd-body { flex: 1; overflow-y: auto; padding: 20px 24px; transition: opacity .15s ease; }
.mhd-body.mhd-swap { opacity: 0; }
.mhd-body p  { margin: 0 0 14px; max-width: 62ch; }
.mhd-body ul { margin: 0 0 14px; padding-left: 20px; }
.mhd-body li { margin-bottom: 6px; }

/* Stopka i przyciski */
.mhd-foot {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--mhd-line);
}
.mhd-cta {
  border: 0; border-radius: 8px; padding: 10px 16px;
  background: var(--mhd-accent); color: var(--mhd-accent-text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.mhd-cta[hidden] { display: none; }
.mhd-ghost {
  border: 1px solid var(--mhd-line); border-radius: 8px; padding: 10px 16px;
  background: transparent; color: var(--mhd-text); font: inherit; cursor: pointer;
}
.mhd-drawer :focus-visible { outline: 3px solid var(--mhd-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .mhd-overlay, .mhd-drawer, .mhd-body { transition-duration: 0s !important; transition-delay: 0s !important; }
}

/* ------------------------------------------------------------------
   Przyciski otwierające drawer (secondary, małe)
   Dotyczy każdego elementu z atrybutem data-drawer, bez dodatkowych klas.
   Kolor dziedziczy ze strony, więc pasuje do jasnego i ciemnego tła.
   ------------------------------------------------------------------ */
[data-drawer] {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .4em .9em;
  border: 1px solid rgba(128, 128, 128, .55);
  border-radius: 8px;
  background: transparent; color: inherit;
  font: inherit; font-size: .875rem; font-weight: 500; line-height: 1.4;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  [data-drawer] { border-color: color-mix(in srgb, currentColor 35%, transparent); }
  [data-drawer]:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
}
[data-drawer]:hover { border-color: currentColor; }
[data-drawer][aria-expanded="true"] { border-color: currentColor; }
[data-drawer]:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

@media (pointer: coarse) {
  [data-drawer] { min-height: 40px; }   /* wygodniejszy cel dotyku na telefonie */
}
