/* Drukulator 0.26.28v — generator wizytówek (okno edytora: format / orientacja / zadruk, podgląd awersu i rewersu, 12 gotowych wizytówek branżowych, 12 układów awersu, palety i kolory własne, dane, logo, 7 układów rewersu z kodem QR i listą usług).
 * Korzysta z klas generatora banerów: banner-generator.css (.d24bg-btn, .d24bg-chip, .d24bg-row, .d24bg-seg, .d24bg-entry, .d24bg-pals, .d24bg input…)
 * i banner-generator-simple.css (.d24bgs-top, .d24bgs-main, .d24bgs-left, .d24bgs-side, .d24bgs-swatches, .d24bgs-field, .d24bgs-sliders, .d24bgs-actions…)
 * oraz zmiennych motywu: --panel --panel-2 --border --text --muted --accent --nav-hover. Tryb ciemny przez zmienne. */

.d24cg-entry { margin: 14px 0 6px; }
.d24cg-entry .d24bg-entry__status:empty { display: none; }
.d24cg-entry[hidden] { display: none !important; }

/* ===== okno ===== */
dialog.d24cg-dialog { padding: 0; border: 1px solid var(--border); border-radius: 16px; width: min(1240px, 97vw); height: min(840px, 96vh); max-width: none; max-height: none; background: var(--panel); color: var(--text); overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
dialog.d24cg-dialog:not([open]) { display: none; }
dialog.d24cg-dialog::backdrop { background: rgba(8, 12, 22, .66); }
.d24cg [hidden] { display: none !important; }

/* góra: tytuł · format · układ strony · zadruk · Wyczyść projekt · ✕ */
.d24cg-top { gap: 8px 14px; }
.d24cg-top > strong { margin-right: 4px; }
.d24cg-ctl { display: inline-flex; align-items: center; gap: 8px; font-size: .76rem; font-weight: 700; }
.d24cg-seg { margin: 0; }
.d24cg-seg button:disabled { opacity: .4; cursor: not-allowed; }

/* lewa strona: awers i rewers w skali, pod nimi ocena */
.d24cg-stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px; overflow: auto; }
.d24cg-figs { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 100%; }
.d24cg[data-cg-orient=portrait] .d24cg-figs { flex-direction: row; align-items: flex-start; justify-content: center; }
.d24cg-figs figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.d24cg-figs figcaption { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.d24cg-figs canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: min(31vh, 270px); box-shadow: 0 6px 26px rgba(0, 0, 0, .28); background: #fff; }
.d24cg[data-cg-two="0"] .d24cg-figs canvas { max-height: min(50vh, 400px); }
.d24cg[data-cg-orient=portrait] .d24cg-figs canvas { max-height: min(52vh, 440px); }
.d24cg-guides { margin-top: 2px; }

/* prawa strona: sekcje */
.d24cg .d24bgs-side { gap: 14px; }
.d24cg-sec { display: grid; gap: 9px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.d24cg-sec h4 { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.d24cg-row { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: center; font-size: .76rem; font-weight: 750; }
.d24cg-row .d24bg-seg { margin: 0; }
.d24cg-hint { margin: 0; font-size: .72rem; line-height: 1.4; color: var(--muted); }

/* układy i gotowe wizytówki: te same kafelki, trzy w rzędzie */
.d24cg-layouts, .d24cg-tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.d24cg-layouts button, .d24cg-tpls button { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 5px; min-height: 0; border: 2px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--text); font: inherit; font-size: .7rem; font-weight: 700; line-height: 1.2; cursor: pointer; }
.d24cg-layouts button:hover, .d24cg-tpls button:hover { border-color: var(--accent); }
.d24cg-layouts button[aria-pressed=true], .d24cg-tpls button[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.d24cg-layouts button:focus-visible, .d24cg-tpls button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.d24cg-layouts canvas, .d24cg-tpls canvas { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); background: #fff; }

/* palety (klasa .d24bg-pals z generatora banerów) i kolory własne: jedna linia, wygląd jak „Kolor:” w generatorze banerów */
.d24cg-pals { margin: 0; }
.d24cg-colors { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.d24cg-colors > span { margin-right: 2px; font-size: .78rem; font-weight: 750; }
.d24cg-clr { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 5px 13px; border: 1px solid var(--border); border-radius: 99px; background: var(--panel); font-size: .8rem; font-weight: 650; white-space: nowrap; cursor: pointer; }
.d24cg-clr:hover, .d24cg-clr.is-custom { border-color: var(--accent); }
.d24cg-clr.is-custom { box-shadow: 0 0 0 1px var(--accent); }
.d24cg-clr:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.d24cg-clr i { width: 15px; height: 15px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .4); box-shadow: 0 0 0 1px rgba(255, 255, 255, .55); flex: none; }
/* natywny wybór koloru leży niewidocznie na całym przycisku */
.d24cg .d24cg-clr input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.d24cg-colors__reset { flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.d24cg-colors__reset:disabled { opacity: .35; cursor: default; }
.d24cg-sliders__title { margin-bottom: 2px; font-size: .78rem; font-weight: 750; }
.d24cg-backremove { justify-self: start; }
.d24cg .d24bg-pals button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.d24cg-backbody { display: grid; gap: 9px; }
.d24cg-svc { display: grid; gap: 8px; }
.d24cg-svc .d24bgs-field { align-items: start; }
.d24cg-svc textarea { min-height: 96px; }
.d24cg-backoff { display: grid; gap: 8px; justify-items: start; }

/* zespół: lista osób + przełączanie podglądu między osobami */
.d24cg-team { display: grid; gap: 8px; margin-top: 10px; }
.d24cg-team textarea { min-height: 104px; font-size: .78rem; line-height: 1.4; white-space: pre; overflow: auto; }
.d24cg-person { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 100%; }
.d24cg-person span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; font-weight: 750; }
.d24cg-person button { min-width: 36px; padding-inline: 10px; }
.d24bgs-field input:disabled { opacity: .55; cursor: not-allowed; }

.d24cg-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.d24cg-logo span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; color: var(--muted); }

.d24cg-btns { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.d24cg .d24bgs-actions .d24bg-btn--primary { width: 100%; }
.d24cg .d24bgs-actions .d24bg-btn--ghost { min-height: 48px; }

.d24cg button:focus-visible, .d24cg input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

@media (max-height: 780px) {
  .d24cg .d24bgs-side { gap: 10px; }
  .d24cg-sec { gap: 7px; padding-bottom: 10px; }
  .d24cg-figs canvas { max-height: 28vh; }
  .d24cg[data-cg-orient=portrait] .d24cg-figs canvas { max-height: 48vh; }
}
@media (max-width: 1100px) {
  .d24cg-top { gap: 8px 14px; }
}

/* ===== telefon / wąskie okno: cały ekran, podgląd przyklejony u góry ===== */
@media (max-width: 900px) {
  dialog.d24cg-dialog { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
  .d24cg-top { padding: 8px 10px; gap: 8px 10px; }
  .d24cg-top strong { order: 1; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d24cg-top > [data-act=reset] { order: 2; min-height: 34px; padding: 5px 10px; font-size: .76rem; }
  .d24cg-top .d24bgs-close { order: 3; margin-left: 0; }
  .d24cg-ctl { order: 4; }
  .d24cg-ctl > span { display: none; }
  .d24cg-seg button { padding: 5px 8px; font-size: .72rem; min-height: 32px; }
  .d24cg .d24bgs-left { flex: none; position: sticky; top: 0; z-index: 3; border-bottom: 1px solid var(--border); }
  .d24cg-stage { padding: 8px 10px; gap: 6px; overflow: hidden; }
  .d24cg-figs { gap: 8px; }
  .d24cg-figs canvas { max-height: 17vh; }
  .d24cg[data-cg-orient=portrait] .d24cg-figs canvas { max-height: 30vh; }
  .d24cg-figs figcaption { font-size: .62rem; }
  .d24cg .d24bgs-chips { gap: 5px; }
  .d24cg .d24bgs-chips .d24bg-chip { font-size: .64rem; padding: 3px 7px; }
  .d24cg-guides { display: none; }
  .d24cg .d24bgs-main { display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
  .d24cg .d24bgs-side { border-left: 0; overflow: visible; flex: none; padding: 14px 14px 0; }
  .d24cg .d24bgs-swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
  .d24cg .d24bgs-swatches button { height: 40px; }
  .d24cg .d24bgs-actions { margin: 4px -14px 0; padding: 10px 14px 14px; }
}
@media (max-width: 520px) {
  .d24cg-colors { gap: 5px; }
  .d24cg-colors > span { font-size: .72rem; margin-right: 0; }
  .d24cg-clr { gap: 6px; padding: 5px 9px; font-size: .76rem; }
  .d24cg-clr i { width: 13px; height: 13px; }
  .d24cg-colors__reset { width: 32px; height: 32px; }
  .d24cg-layouts, .d24cg-tpls { gap: 6px; }
  .d24cg-row { grid-template-columns: 58px minmax(0, 1fr); }
  .d24cg .d24bgs-field { grid-template-columns: 104px minmax(0, 1fr); }
  .d24cg .d24bgs-sliders .d24bg-row { grid-template-columns: 104px minmax(0, 1fr) 38px; }
}
