/* Design system: wyłącznie #0d0d0d (tło) i #fff (wszystko inne). Poświata = biały box-shadow. */
:root {
  --bg: #0d0d0d;
  --fg: #ffffff;
  --r: 14px;
  --r-lg: 16px;
  --glow: 0 0 12px rgba(255, 255, 255, 0.12);
  --glow-hi: 0 0 18px rgba(255, 255, 255, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); }
body {
  font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
b { font-weight: 700; }
[hidden] { display: none !important; }
::selection { background: #fff; color: #0d0d0d; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

* { scrollbar-width: thin; scrollbar-color: #fff #0d0d0d; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb { background: #fff; border-radius: 10px; border: 2px solid #0d0d0d; }

/* ---------- Ikony ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: square; stroke-linejoin: round;
}

/* ---------- Przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--fg); border-radius: var(--r);
  padding: 10px 16px; font: inherit; letter-spacing: inherit; cursor: pointer;
  box-shadow: var(--glow);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.btn:hover, .btn:focus-visible, .btn.on { background: #fff; color: #0d0d0d; box-shadow: var(--glow-hi); }
.btn[disabled] { border-style: dashed; cursor: not-allowed; text-decoration: line-through; box-shadow: none; background: var(--bg); color: var(--fg); }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--fg); border-radius: 10px;
  cursor: pointer; box-shadow: var(--glow); transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.icon-btn:hover, .icon-btn:focus-visible, .icon-btn.on { background: #fff; color: #0d0d0d; box-shadow: var(--glow-hi); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8), var(--glow-hi); }
  70%  { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0), var(--glow-hi); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), var(--glow-hi); }
}
.btn.pulse { animation: pulse 0.8s ease-out 3; background: #fff; color: #0d0d0d; }

/* ---------- Pola formularzy ---------- */
input[type=text], input[type=password], select {
  width: 100%; padding: 10px 14px; font: inherit; letter-spacing: inherit;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--fg); border-radius: var(--r); box-shadow: var(--glow);
  transition: box-shadow 0.18s;
}
input::placeholder { color: #fff; font-style: italic; }
input:focus, select:focus { outline: none; box-shadow: var(--glow-hi), 0 0 0 2px #0d0d0d, 0 0 0 3px #fff; }
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
option { background: #0d0d0d; color: #fff; }

label { display: block; margin-bottom: 6px; }
.fld { margin-bottom: 16px; }
.add-row .fld { margin: 0; }

input[type=checkbox] {
  appearance: none; margin: 0; width: 20px; height: 20px; flex: none;
  display: inline-grid; place-items: center; cursor: pointer;
  background: var(--bg); border: 1px solid var(--fg); border-radius: 6px; box-shadow: var(--glow);
}
input[type=checkbox]::after {
  content: ""; display: none; width: 5px; height: 10px;
  border: solid #0d0d0d; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px);
}
input[type=checkbox]:checked { background: #fff; }
input[type=checkbox]:checked::after { display: block; }
.check { display: flex; align-items: center; gap: 10px; margin: 4px 0 20px; cursor: pointer; }

/* ---------- Logowanie i brak uprawnień ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; padding: 32px;
  border: 1px solid var(--fg); border-radius: var(--r-lg);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.12);
}
.auth-card h1 { font-size: 22px; margin: 18px 0 22px; }
.auth-brand { margin-bottom: 4px; }
.with-icon { position: relative; }
.with-icon .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
.with-icon input { padding-left: 44px; }
.alert {
  display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 12px 14px;
  border: 1px dashed var(--fg); border-radius: var(--r); box-shadow: var(--glow);
}
.denied { text-align: center; }
.denied .ic { width: 56px; height: 56px; stroke-width: 1.2; }
.denied h1 { margin: 16px 0 12px; }
.denied p { margin-bottom: 24px; }

/* ---------- Układ panelu ---------- */
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; padding: 6px 4px 18px; }
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar {
  width: 264px; flex: none; display: flex; flex-direction: column; padding: 16px;
  border-right: 1px solid var(--fg); box-shadow: var(--glow);
  transition: width 0.3s ease; overflow: hidden;
}
.app.collapsed .sidebar { width: 84px; }
.nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }

.nav-item {
  display: flex; align-items: center; width: 100%; padding: 12px 14px;
  background: var(--bg); color: var(--fg); font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--r);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.nav-item:hover, .nav-item:focus-visible { border-color: var(--fg); box-shadow: var(--glow-hi); }
.nav-item.active { background: #fff; color: #0d0d0d; box-shadow: var(--glow-hi); }

.label {
  margin-left: 12px; max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transition: max-width 0.3s ease, margin 0.3s ease, opacity 0.2s ease;
}
.brand .label { margin-left: 0; }
.brand-logo { width: 32px; height: 32px; flex: none; object-fit: contain; }
.app.collapsed .brand { gap: 0; justify-content: center; }
.app.collapsed .label { max-width: 0; margin-left: 0; opacity: 0; }
.app.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.app.collapsed .js-collapse .ic { transform: rotate(180deg); }
.js-collapse .ic { transition: transform 0.3s ease; }

.side-bottom { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.user-box { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--fg); }
.user-line { display: flex; align-items: center; padding: 0 4px; }
.avatar {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--fg); border-radius: 50%; font-weight: 700; box-shadow: var(--glow);
}
.app.collapsed .user-line { justify-content: center; padding: 0; }
.uname { font-weight: 700; }

.main { flex: 1; min-width: 0; overflow: auto; padding: 32px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.panel-head h1 { font-size: 22px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.edit-bar { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Tabele ---------- */
.tbl-wrap { overflow: auto; border: 1px solid var(--fg); border-radius: var(--r-lg); box-shadow: var(--glow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; vertical-align: middle; }
th { font-weight: 700; border-bottom: 1px solid var(--fg); white-space: normal; min-width: 90px; }
td { border-bottom: 1px dashed var(--fg); }
tbody tr:last-child td { border-bottom: 0; }
th.c, td.c { text-align: center; }
th.c { min-width: 120px; }
td input, td select { min-width: 150px; padding: 8px 12px; }
.row-del td { text-decoration: line-through; }
.empty { padding: 28px; text-align: center; }
td.empty { text-decoration: none; }

.state {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border: 1px solid var(--fg); border-radius: 10px; box-shadow: var(--glow);
}
.state.yes { background: #fff; color: #0d0d0d; }
.state.no { background: var(--bg); color: #fff; }
.perm-btn {
  padding: 4px; background: none; color: inherit; border: 0; border-radius: 12px; cursor: pointer;
  transition: box-shadow 0.18s;
}
.perm-btn:hover, .perm-btn:focus-visible { box-shadow: var(--glow-hi); }

/* ---------- Formularze dodawania ---------- */
.add-box { margin-top: 24px; padding: 18px; border: 1px solid var(--fg); border-radius: var(--r-lg); box-shadow: var(--glow); }
.add-box h2 { font-size: 16px; margin-bottom: 14px; }
.add-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin: 16px 0; }
.perm-toggle {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--bg); color: var(--fg); font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer;
  border: 1px solid var(--fg); border-radius: 12px; box-shadow: var(--glow); transition: box-shadow 0.18s;
}
.perm-toggle:hover, .perm-toggle:focus-visible { box-shadow: var(--glow-hi); }
.perm-name { display: flex; flex-direction: column; min-width: 0; }
.perm-name small { overflow-wrap: anywhere; font-size: 12px; }

.blank-box { display: grid; place-items: center; gap: 14px; padding: 64px 24px; text-align: center; border: 1px dashed var(--fg); border-radius: var(--r-lg); }
.blank-box .ic { width: 44px; height: 44px; stroke-width: 1.2; }

/* ---------- Modal i powiadomienia ---------- */
.overlay { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 20px; background: rgba(13, 13, 13, 0.92); }
.modal { width: 100%; max-width: 440px; padding: 26px; background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r-lg); box-shadow: 0 0 28px rgba(255, 255, 255, 0.25); }
.modal h2 { font-size: 18px; margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 40px); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; width: 360px; max-width: 100%; padding: 12px 16px;
  background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r); box-shadow: var(--glow-hi);
  animation: toast-in 0.25s ease-out; transition: opacity 0.3s;
}
.toast.out { opacity: 0; }
@keyframes toast-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 760px) {
  .main { padding: 20px 16px; }
  .toasts { left: 16px; right: 16px; }
  .toast { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ====== Panel główny, kreator stron, historia, admin stron ====== */
a { color: #fff; }
a.nav-item { text-decoration: none; }
.link { color: #fff; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 6px; }
.denied-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.denied-actions .btn { text-decoration: none; }
.add-box p { margin-bottom: 14px; }

textarea {
  width: 100%; min-height: 84px; padding: 10px 14px; font: inherit; letter-spacing: inherit; resize: vertical;
  background: var(--bg); color: var(--fg); border: 1px solid var(--fg); border-radius: var(--r); box-shadow: var(--glow);
}
textarea:focus { outline: none; box-shadow: var(--glow-hi), 0 0 0 2px #0d0d0d, 0 0 0 3px #fff; }
input[type=color] { width: 52px; height: 40px; padding: 2px; background: var(--bg); border: 1px solid var(--fg); border-radius: 10px; cursor: pointer; }
input[type=url], input[type=email], input[type=tel] { width: 100%; padding: 10px 14px; font: inherit; background: var(--bg); color: var(--fg); border: 1px solid var(--fg); border-radius: var(--r); box-shadow: var(--glow); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 12px; }
a.btn { text-decoration: none; }

/* status klienta: pomarańczowe światełko = czekamy na odpowiedź */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff; vertical-align: middle; margin-right: 8px; flex: none; }
.dot.zaakceptowany { background: #2ecc71; border-color: #2ecc71; box-shadow: 0 0 10px rgba(46, 204, 113, 0.9); animation: blink-green 1.6s ease-in-out infinite; }
.dot.zastanawia_sie { border-style: dashed; }
.dot.czeka { background: #ff9f1a; border-color: #ff9f1a; box-shadow: 0 0 10px rgba(255, 159, 26, 0.9); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { box-shadow: 0 0 2px rgba(255, 159, 26, 0.4); } }
@keyframes blink-green { 50% { box-shadow: 0 0 2px rgba(46, 204, 113, 0.4); } }

.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; font: inherit; letter-spacing: inherit; cursor: pointer;
  background: var(--bg); color: var(--fg); border: 1px solid var(--fg); border-radius: 999px; box-shadow: var(--glow);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.chip:hover, .chip.on { background: #fff; color: #0d0d0d; box-shadow: var(--glow-hi); }
.chip .count { border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--fg); border-radius: var(--r-lg); box-shadow: var(--glow); }
.card h3 { margin: 0; font-size: 16px; display: flex; align-items: center; }
.card .state-label { font-size: 12px; }
.kv { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.kv .ic { width: 16px; height: 16px; margin-top: 3px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
td.desc { max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
td.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 8px; justify-content: center; }
.row-actions .icon-btn { text-decoration: none; }

.opt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.opt { display: flex; justify-content: flex-start; width: 100%; text-align: left; }
.modal-sub { margin-top: 6px; }

/* kreator stron */
.wiz { width: 100%; max-width: 1040px; max-height: calc(100dvh - 40px); overflow: auto; padding: 28px; background: var(--bg); border: 1px solid var(--fg); border-radius: var(--r-lg); box-shadow: 0 0 28px rgba(255, 255, 255, 0.25); }
.wiz h2 { font-size: 18px; margin-bottom: 20px; }
.stepper { display: flex; align-items: center; margin-bottom: 26px; }
.step { display: flex; align-items: center; gap: 10px; }
.step .num { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--fg); border-radius: 50%; transition: background 0.35s, color 0.35s, transform 0.35s, box-shadow 0.35s; }
.step.active .num { background: #fff; color: #0d0d0d; transform: scale(1.12); box-shadow: var(--glow-hi); }
.step.done .num { background: #fff; color: #0d0d0d; }
.step-line { flex: 1; min-width: 20px; margin: 0 12px; border-top: 1px dashed var(--fg); transition: border-color 0.35s, box-shadow 0.35s; }
.step-line.done { border-top-style: solid; box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }
.wiz-body { animation: slide-in 0.35s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.wiz-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vcard { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; font: inherit; letter-spacing: inherit; cursor: pointer; background: var(--bg); color: var(--fg); border: 1px solid var(--fg); border-radius: var(--r-lg); box-shadow: var(--glow); transition: box-shadow 0.18s, transform 0.18s; }
div.vcard { cursor: default; }
.vcard:hover, .vcard.sel { box-shadow: var(--glow-hi); transform: translateY(-2px); }
.vcard.sel { outline: 2px solid #fff; outline-offset: 2px; }
.vframe { position: relative; aspect-ratio: 1280 / 800; overflow: hidden; border-bottom: 1px solid var(--fg); }
.vframe iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.vmeta { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.vmeta small { font-size: 12px; }
.slug-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.slug-row .pre { white-space: nowrap; }
.slug-row input { flex: 1; min-width: 160px; }
.done-box { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* filtr stron */
.filter-host:not(:empty) { margin-bottom: 14px; }

/* historia */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { padding: 14px 16px; border: 1px solid var(--fg); border-radius: var(--r); box-shadow: var(--glow); }
.tile b { display: block; font-size: 26px; line-height: 1.2; }
.tile span { font-size: 12px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 20px; }
.chart-card { padding: 16px; border: 1px solid var(--fg); border-radius: var(--r-lg); box-shadow: var(--glow); }
.chart-card h2 { font-size: 15px; margin-bottom: 12px; }
svg.chart { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; }
svg.chart text { fill: #fff; font: 11px ui-monospace, Menlo, Consolas, monospace; }
svg.chart .big { font-size: 20px; font-weight: 700; }
.legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .v { margin-left: auto; white-space: nowrap; }
.sw { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.section-title { font-size: 16px; margin: 26px 0 12px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.filters select { width: auto; min-width: 200px; }
.table-scroll { max-height: 520px; overflow: auto; }

/* admin strony klienta */
.sticky-head { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0; margin-top: -12px; }
.fgroup { padding: 18px; margin-bottom: 16px; border: 1px solid var(--fg); border-radius: var(--r-lg); box-shadow: var(--glow); }
.fgroup h2 { font-size: 16px; margin-bottom: 14px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.fgrid .fld { margin: 0; }
.fld.wide { grid-column: 1 / -1; }
.fhelp { font-size: 12px; margin-top: 4px; }
.colorfield { display: flex; align-items: center; gap: 10px; }
.imgfield { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.imgfield img, .imgph { width: 96px; height: 72px; object-fit: cover; border: 1px solid var(--fg); border-radius: 10px; }
.imgph { display: grid; place-items: center; border-style: dashed; }
.litem { padding: 14px; margin-bottom: 12px; border: 1px dashed var(--fg); border-radius: var(--r); }
.litem-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.litem-head .row-actions { justify-content: flex-end; }
.checkline { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; }

/* ostrzeżenie o duplikacie w formularzu klienta */
.inline-warn { margin-top: 14px; padding: 12px 16px; border: 1px dashed #ff9f1a; border-radius: var(--r); box-shadow: 0 0 12px rgba(255, 159, 26, 0.25); }
.inline-warn.stop { border: 1px solid #ff3b3b; box-shadow: 0 0 14px rgba(255, 59, 59, 0.35); }
.inline-warn p { margin: 0; }
.inline-warn p + p { margin-top: 6px; }
.btn[disabled] .ic { opacity: 1; }

/* strefa niebezpieczna: czyszczenie systemu */
.danger-box { max-width: 760px; padding: 24px; border: 1px solid #ff3b3b; border-radius: var(--r-lg); box-shadow: 0 0 22px rgba(255, 59, 59, 0.25); display: flex; flex-direction: column; gap: 14px; }
.danger-head { display: flex; align-items: center; gap: 10px; color: #ff3b3b; }
.danger-head h2 { margin: 0; font-size: 18px; }
.danger-box h2 { font-size: 15px; margin: 6px 0 0; }
.wipe-step { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; padding-top: 18px; border-top: 1px dashed #ff3b3b; animation: slide-in 0.35s ease-out; }
.wipe-step .fld { margin: 0; max-width: 260px; }
.wipe-step input[type=text] { font-size: 22px; letter-spacing: 0.4em; text-align: center; }

.hold-btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 14px 28px; font: inherit; font-weight: 700; letter-spacing: inherit; cursor: pointer; user-select: none; touch-action: none;
  color: #fff; background: #0d0d0d; border: 2px solid #ff3b3b; border-radius: var(--r);
  box-shadow: 0 0 16px rgba(255, 59, 59, 0.35); transition: box-shadow 0.2s;
}
.hold-btn:hover:not([disabled]) { box-shadow: 0 0 26px rgba(255, 59, 59, 0.65); }
.hold-btn[disabled] { cursor: not-allowed; border-style: dashed; box-shadow: none; }
.hold-btn .hold-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: #ff3b3b; transition: width 0.25s ease; z-index: 0; }
.hold-btn > .ic, .hold-btn .hold-label { position: relative; z-index: 1; }
.hold-btn.holding { animation: hold-shake 0.14s linear infinite; box-shadow: 0 0 34px rgba(255, 59, 59, 0.85); }
.hold-btn.holding .hold-fill { width: 100%; transition: width 3s linear; }
@keyframes hold-shake { 0% { transform: translate(0, 0); } 25% { transform: translate(1px, -1px); } 50% { transform: translate(-1px, 1px); } 75% { transform: translate(1px, 1px); } 100% { transform: translate(0, 0); } }

/* szablony: lista kategorii, edycja, podgląd całej strony */
.tpl-list { display: flex; flex-direction: column; gap: 24px; }
.tpl-cat { margin-top: 0; }
.tpl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.tpl-info { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tpl-info h2 { font-size: 20px; margin: 0; }
.tpl-info p { margin: 0; }
.tpl-info small { font-size: 12px; }
.vedit { display: flex; flex-direction: column; gap: 10px; }
.vinputs { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.vinputs .icon-btn { align-self: flex-end; }
.row-del .vmeta, .row-del .tpl-info h2, .row-del .tpl-info p { text-decoration: line-through; }
.tpl-cat.row-del, .vedit.row-del { outline: 1px dashed #fff; outline-offset: 4px; border-radius: var(--r-lg); }

.overlay.pv { padding: 0; }
.pv-box { display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--bg); }
.pv-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--fg); }
.pv-bar b { margin-right: auto; }
.pv-dev { display: flex; gap: 8px; }
.pv-stage { flex: 1; min-height: 0; display: flex; justify-content: center; padding: 14px; background: #262626; overflow: auto; }
.pv-frame { height: 100%; width: 100%; max-width: 100%; transition: width 0.3s ease; }
.pv-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; }

/* Usunięte strony: wiersz zaznaczony do przywrócenia */
.row-restore td { background: rgba(255,255,255,.07); }
.cell-note { display:block; opacity:.65; font-size:12px; margin-top:2px; }

/* Generator wiadomości */
.wiz.gen { max-width: 1100px; }
.gen-set { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; margin: 14px 0; }
.gen-style { margin: 10px 0 16px; padding: 14px 16px; border: 1px solid #fff; border-radius: var(--r); }
.gen-style-head { margin-bottom: 8px; }
.gen-style input[type="range"] { width: 100%; accent-color: #fff; height: 28px; background: transparent; cursor: pointer; }
.gen-style-ends { display: flex; justify-content: space-between; font-size: 12px; opacity: .7; }
.gen-note { margin: 4px 0 10px; }
.gen-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 12px; }
.gen-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid #fff; border-radius: var(--r); box-shadow: var(--glow); }
.gen-card h3 { margin: 0; font-size: 14px; }
.gen-subj { font-size: 13px; }
.gen-prev { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.5; max-height: 260px; overflow: hidden; position: relative; opacity: .9;
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.gen-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.gen-count { font-size: 12px; opacity: .7; }
.gen-count.over { opacity: 1; color: #ff3b3b; font-weight: 700; }
.gen-detail { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.gen-detail h3 { margin: 0; font-size: 15px; }
.gen-text { width: 100%; min-height: 280px; resize: vertical; line-height: 1.55; font-size: 14px; }
.gen-subj-in { width: 100%; }
.gen-copy { display: flex; gap: 10px; flex-wrap: wrap; }
.gen-text { overflow-wrap: anywhere; }

/* Pasek wyszukiwania i filtrów */
.fbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 0 0 16px; padding: 12px 14px; border: 1px solid #fff; border-radius: var(--r); box-shadow: var(--glow); }
.fbar .fsearch { flex: 1 1 280px; min-width: 200px; }
.fbar .fitem { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.fbar .fitem span { opacity: .75; }
.fbar select, .fbar input[type=date] { width: auto; min-width: 150px; padding: 8px 12px; }
.fbar input[type=date] { font: inherit; background: var(--bg); color: var(--fg); border: 1px solid var(--fg); border-radius: 12px; color-scheme: dark; }
.fbar .fcount { margin-left: auto; font-size: 12px; opacity: .75; align-self: center; }

/* ===== Zdjęcia profilowe (zawsze w kółku), profil, wybór osoby ===== */
.user-line { width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 14px; padding: 4px; }
.user-line:hover, .user-line:focus-visible { box-shadow: var(--glow); outline: none; }
.avatar { overflow: hidden; }
.avatar img, .av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar .uname, .app:not(.collapsed) .avatar + .uname { margin-left: 10px; }
.user-line .uname { margin-left: 10px; }
.av { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 700; overflow: hidden; line-height: 1; vertical-align: middle; background: var(--bg); color: var(--fg); }
.av.lg { width: 30px; height: 30px; font-size: 13px; }
.av.xl { width: 96px; height: 96px; font-size: 38px; box-shadow: var(--glow); }
.uchip { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.prof { max-width: 760px; }
.prof-top { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; }
.prof-who { display: flex; flex-direction: column; gap: 8px; }
.prof-who b { font-size: 20px; }
.prof-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; align-items: end; }
.section-title { margin: 22px 0 12px; }

/* własna lista wyboru osoby (ze zdjęciem w kółku) */
.upick { position: relative; }
.upick-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 170px; padding: 8px 12px; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--fg); border-radius: 12px; cursor: pointer; text-align: left; }
.upick-btn:focus-visible, .upick-btn:hover { box-shadow: var(--glow); outline: none; }
.upick-btn .caret { opacity: .7; font-size: 11px; }
.upick-list { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 300px; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--bg); border: 1px solid var(--fg); border-radius: 12px; box-shadow: var(--glow-hi); }
.upick-list li { padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.upick-list li:hover, .upick-list li.on { background: var(--fg); color: var(--bg); }
.upick-list li:hover .av, .upick-list li.on .av { border-color: var(--bg); }

/* pasek wyboru widoku (Strony / Klienci, Aktywność / Usunięte zawartości) */
.seg { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.hist-bar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 0 0 16px; padding: 12px 14px; border: 1px solid #fff; border-radius: var(--r); box-shadow: var(--glow); }
.hist-bar .fitem { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.hist-bar .fitem > span { opacity: .75; }
.hist-bar select { width: auto; min-width: 150px; padding: 8px 12px; }
.chart-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chart-toggles .chip { padding: 6px 12px; font-size: 12px; }
.prof-who .row-actions { justify-content: flex-start; flex-wrap: wrap; }

/* ---------- Trwałe usuwanie z kosza (okno z danymi klientów i kodem z e-maila) ---------- */
.modal.modal-wide { max-width: 720px; max-height: calc(100vh - 40px); overflow-y: auto; }
.pg-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.pg-item { padding: 14px 16px; border: 1px solid #ff3b3b; border-radius: var(--r); display: flex; flex-direction: column; gap: 10px; }
.pg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.pg-head .cell-note { display: inline; margin: 0; }
.pg-head .link { margin-left: auto; }
.pg-where { margin: 0; font-weight: 600; }
.pg-grid { display: grid; gap: 4px; margin-top: 6px; }
.pg-row { display: grid; grid-template-columns: 90px 1fr; gap: 10px; font-size: 13px; overflow-wrap: anywhere; }
.pg-k { opacity: 0.7; }
.pg-item .checkline { align-items: flex-start; }
.pg-steps { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px dashed #ff3b3b; }
.pg-steps .wipe-step { width: 100%; margin-top: 0; }
.pg-tools { margin-bottom: 12px; }
.btn.btn-danger { border-color: #ff3b3b; box-shadow: 0 0 14px rgba(255, 59, 59, 0.35); }
.btn.btn-danger:not([disabled]):hover { background: #ff3b3b; color: #fff; }
@media (max-width: 560px) { .pg-row { grid-template-columns: 1fr; gap: 0; } .pg-head .link { margin-left: 0; } }
#panel-usuniete .row-del td:nth-last-child(-n+2) { text-decoration: none; }
