:root{
  --bg:#eef2f7;--panel:#ffffff;--panel2:#f8fafc;--text:#111827;--muted:#64748b;--line:#dbe3ee;--accent:#2563eb;--accent2:#1d4ed8;--danger:#dc2626;--ok:#16a34a;--warn:#d97706;--shadow:0 18px 45px rgba(15,23,42,.08)
}
*{box-sizing:border-box}
body{margin:0;background:#f8fafc;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--text)}
a{color:var(--accent)}
.app{min-height:100vh;display:grid;grid-template-columns:280px 1fr}
.sidebar{position:sticky;top:0;height:100vh;background:#0f172a;color:#e5e7eb;padding:22px 16px;display:flex;flex-direction:column;gap:18px}
.brand{padding:10px 10px 14px;border-bottom:1px solid rgba(255,255,255,.09)}
.brand-title{font-size:22px;font-weight:950;letter-spacing:-.04em;line-height:1.05}.brand-sub{font-size:12px;color:#94a3b8;margin-top:8px;line-height:1.45}
.nav{display:grid;gap:7px}.nav a{display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:14px;color:#cbd5e1;text-decoration:none;font-weight:850}.nav a:hover{background:rgba(255,255,255,.08);color:#fff}.nav a.active{background:#2563eb;color:#fff;box-shadow:0 10px 25px rgba(37,99,235,.28)}
.sidefoot{margin-top:auto;color:#94a3b8;font-size:12px;line-height:1.5;padding:12px 10px;border-top:1px solid rgba(255,255,255,.09)}
.main{padding:28px 30px 70px;max-width:1440px;width:100%}.topbar{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:22px}.page-title h1{font-size:32px;margin:0;letter-spacing:-.045em}.page-title p{margin:8px 0 0;color:var(--muted);line-height:1.5}.userbox{display:flex;align-items:center;gap:10px;white-space:nowrap}.avatar{width:38px;height:38px;border-radius:50%;background:#dbeafe;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-weight:950}.card{background:var(--panel);border:1px solid var(--line);border-radius:22px;padding:22px;box-shadow:none;margin:0 0 18px}.soft{background:var(--panel2);box-shadow:none}.card h2{margin:0 0 14px;font-size:20px;letter-spacing:-.02em}.card h3{margin:18px 0 10px;font-size:16px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.split{display:grid;grid-template-columns:1.25fr .75fr;gap:18px}.stack{display:grid;gap:14px}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.between{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap}.muted{color:var(--muted)}.small{font-size:13px;color:var(--muted);line-height:1.45}.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
label{font-size:13px;font-weight:850;display:block;margin:0 0 6px}input,textarea,select{width:100%;border:1px solid var(--line);border-radius:13px;padding:11px 12px;font:inherit;background:#fff;color:var(--text)}textarea{min-height:120px;line-height:1.55}.hint{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.45}.checkline{display:flex;gap:10px;align-items:flex-start}.checkline input{width:auto;margin-top:3px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);background:#fff;border-radius:13px;padding:10px 14px;font-weight:900;color:var(--text);text-decoration:none;cursor:pointer}.btn:hover{border-color:#bfdbfe;background:#eff6ff}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.primary:hover{background:var(--accent2)}.btn.danger{background:#fff1f2;border-color:#fecdd3;color:#9f1239}.btn.ok{background:#ecfdf5;border-color:#bbf7d0;color:#14532d}.btn.smallbtn{font-size:13px;padding:8px 10px}.notice{padding:12px 14px;border-radius:16px;border:1px solid;margin:14px 0}.notice.ok{background:#ecfdf5;border-color:#bbf7d0;color:#14532d}.notice.err{background:#fff1f2;border-color:#fecdd3;color:#9f1239}.stat{background:#fff;border:1px solid var(--line);border-radius:19px;padding:17px;box-shadow:0 1px 2px rgba(15,23,42,.04)}.stat strong{display:block;font-size:30px;letter-spacing:-.04em;margin-top:5px}.pill{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:999px;padding:4px 9px;font-size:12px;font-weight:900}.pill.done,.pill.ok{background:#ecfdf5;color:#14532d;border-color:#bbf7d0}.pill.running,.pill.queued{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}.pill.failed,.pill.error{background:#fff1f2;color:#9f1239;border-color:#fecdd3}.pill.empty,.pill.warn{background:#fffbeb;color:#92400e;border-color:#fde68a}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;border-bottom:1px solid var(--line);padding:12px 9px;vertical-align:top}th{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);white-space:nowrap}.progress{height:10px;background:#eef2f7;border-radius:999px;overflow:hidden;margin-top:8px}.bar{height:100%;background:var(--accent);width:0%;transition:width .2s}.login{max-width:460px;margin:9vh auto}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:20px}.wizard{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.wizard button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 12px;font-weight:900;cursor:pointer}.wizard button.active{background:#0f172a;color:#fff;border-color:#0f172a}.step{display:none}.step.active{display:block}.editor{min-height:300px;border:1px solid var(--line);border-radius:16px;padding:18px;background:#fff;line-height:1.65;outline:none}.editor:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(37,99,235,.12)}.toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 10px}.tool{border:1px solid var(--line);background:#fff;border-radius:10px;padding:8px 10px;font-weight:900;cursor:pointer}.toolselect{width:auto;min-width:150px;padding:8px 10px;border-radius:10px}.htmlbox{display:none;margin-top:10px}.filterbar{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:12px;align-items:end}.selector-head{position:sticky;top:0;background:rgba(248,250,252,.96);backdrop-filter:blur(6px);padding:12px;border:1px solid var(--line);border-radius:16px;z-index:5;margin:12px 0}.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}.photo-box,.portfolio-box{position:relative;border:2px solid var(--line);border-radius:17px;padding:10px;background:#fff;transition:.15s;cursor:pointer}.photo-box:hover,.portfolio-box:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(15,23,42,.08)}.photo-box.selected,.portfolio-box.selected{background:#ecfdf5!important;border-color:#16a34a!important;box-shadow:0 0 0 2px #bbf7d0 inset}.photo-box.photo-censure,.portfolio-box.portfolio-censure{border-color:#ef4444}.photo-box.photo-logged,.portfolio-box.portfolio-logged{border-color:#f59e0b}.photo-box.ghost-user,.portfolio-box.ghost-user{background:#eff6ff;border-color:#60a5fa}.warn-user-selected{background:#fff7ed}.photo-check,.portfolio-check{position:absolute;top:12px;right:12px;transform:scale(1.2);z-index:2;width:auto}.photo-img{width:100%;display:block;border-radius:13px;border:1px solid var(--line);aspect-ratio:1/1;object-fit:cover}.portfolio-img{width:100%;display:block;border-radius:13px;border:1px solid var(--line);aspect-ratio:16/9;object-fit:cover;margin-bottom:10px}.photo-info,.portfolio-meta{font-size:12px;color:#475569;line-height:1.45;margin-top:8px}.portfolio-title{font-weight:950;margin-right:28px}.portfolio-desc{font-size:13px;color:#334155;margin-top:6px;line-height:1.45}.portfolio-belongs{display:inline-flex;margin-top:8px;padding:3px 8px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:12px;font-weight:900}.legend span{display:inline-flex;margin:4px 5px 0 0;padding:3px 8px;border-radius:999px;font-size:12px;font-weight:900}.legend .censure{background:#fee2e2;color:#991b1b}.legend .logged{background:#fef3c7;color:#92400e}.legend .ghost{background:#dbeafe;color:#1e40af}.legend .both{background:#ffedd5;color:#9a3412;border:1px dashed #dc2626}.settings-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.settings-tabs button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 12px;font-weight:900;cursor:pointer}.settings-tabs button.active{background:#0f172a;color:#fff;border-color:#0f172a}.settings-section{display:none}.settings-section.active{display:block}.diag{display:grid;gap:8px}.diag-row{display:grid;grid-template-columns:160px 1fr 110px 1.3fr;gap:10px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:10px;background:#fff}.empty{padding:18px;border:1px dashed var(--line);border-radius:16px;background:#fff;color:var(--muted)}
@media(max-width:1080px){.app{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.main{padding:20px}.split,.grid,.grid3,.grid4,.filterbar,.diag-row{grid-template-columns:1fr}.topbar{flex-direction:column}.userbox{white-space:normal}}
.builder-shell{display:grid;grid-template-columns:260px 1fr;gap:16px;margin-top:18px;align-items:start}.block-palette{position:sticky;top:14px;border:1px solid var(--line);border-radius:18px;background:#f8fafc;padding:14px;display:grid;gap:9px}.block-palette h3{margin:0 0 6px}.block-add{width:100%;border:1px solid var(--line);background:#fff;border-radius:13px;padding:11px 12px;text-align:left;font-weight:950;cursor:pointer}.block-add:hover{border-color:#93c5fd;background:#eff6ff}.builder-workspace{min-width:0}.builder-toolbar{position:sticky;top:0;z-index:8;background:rgba(248,250,252,.94);backdrop-filter:blur(6px);padding:10px;border:1px solid var(--line);border-radius:16px}.newsletter-builder{display:grid;gap:14px;margin-top:12px}.builder-empty{padding:20px;border:1px dashed var(--line);border-radius:18px;background:#fff;color:var(--muted);margin-top:12px}.newsletter-block{border:1px solid #cbd5e1;border-radius:18px;background:#fff;box-shadow:none;overflow:hidden}.newsletter-block.dragging{opacity:.55;transform:scale(.995)}.block-head{display:flex;align-items:center;gap:10px;justify-content:space-between;background:#f8fafc;border-bottom:1px solid var(--line);padding:10px 12px}.drag-handle{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:10px;background:#e2e8f0;color:#334155;font-weight:950;cursor:grab}.block-head strong{flex:1}.block-actions{display:flex;gap:6px;flex-wrap:wrap}.block-actions button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:6px 8px;font-size:12px;font-weight:900;cursor:pointer}.block-actions button:hover{background:#eff6ff;border-color:#93c5fd}.block-body{padding:14px}.block-rich{min-height:150px;border:1px solid var(--line);border-radius:14px;padding:14px;background:#fff;line-height:1.65;outline:none}.block-rich:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(37,99,235,.12)}.block-title-input{margin-bottom:10px}.block-media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;margin-top:12px}.block-media-card{border:1px solid var(--line);border-radius:14px;padding:8px;background:#f8fafc;display:grid;gap:5px}.block-media-card img,.media-fallback{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:11px;border:1px solid var(--line);background:#e2e8f0;display:grid;place-items:center;color:#475569;font-weight:950}.block-media-card strong{font-size:13px;line-height:1.25}.block-media-card span,.block-media-card small{font-size:12px;color:var(--muted);line-height:1.35}.block-warning{border:1px dashed #f59e0b;background:#fffbeb;color:#92400e;border-radius:14px;padding:12px}.block-divider-preview{height:1px;background:#cbd5e1;margin:10px 0}.summary-box{border:1px solid #bfdbfe;background:#eff6ff;color:#1e3a8a;border-radius:16px;padding:12px 14px;margin:0 0 14px;line-height:1.45}
@media(max-width:1080px){.builder-shell{grid-template-columns:1fr}.block-palette,.builder-toolbar{position:relative;top:auto}}

/* v2 cleanup: pełne zdjęcia i czytelna historia wysyłek */
.photo-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px;align-items:start}.profile-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.photo-box{padding:12px;border-radius:20px}.photo-img{width:100%;height:auto;max-height:none;aspect-ratio:auto;object-fit:contain;background:#f8fafc;border-radius:15px}.photo-title-line{display:flex;gap:8px;align-items:flex-start;flex-wrap:wrap;margin-bottom:4px}.photo-title-line span{font-weight:850;color:#334155}.photo-history{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.photo-history div{border:1px solid var(--line);background:#f8fafc;border-radius:13px;padding:8px}.photo-history span{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:900;margin-bottom:3px}.photo-history strong{font-size:12px;line-height:1.3}.photo-history strong.ok{color:#166534}.photo-history strong.warn{color:#92400e}.block-media-grid{grid-template-columns:repeat(auto-fill,minmax(180px,1fr))}.block-media-card img{aspect-ratio:auto;height:auto;object-fit:contain;background:#fff}.media-fallback{aspect-ratio:16/10}
@media(max-width:760px){.photo-gallery{grid-template-columns:1fr}.photo-history{grid-template-columns:1fr}}


/* FIX: pełne zdjęcia w selektorze, bez kwadratowego cropa */
.photo-gallery{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));align-items:start}
.photo-img{width:100%!important;height:auto!important;max-height:none!important;aspect-ratio:auto!important;object-fit:contain!important;background:#f8fafc}
.photo-box{align-self:start}
.photo-title-line{display:grid;grid-template-columns:auto 1fr;gap:6px;align-items:start}
.photo-history{display:grid;gap:5px;margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}
.photo-history div{display:flex;justify-content:space-between;gap:8px}
.photo-history span{color:var(--muted)}
.photo-history strong.ok{color:#166534}.photo-history strong.warn{color:#92400e}

/* Canonical create screen cleanup */
.create-intro{margin-bottom:18px}.composer-card{border:2px solid #dbeafe}.send-panel{margin-top:22px;border-top:1px solid var(--line);padding-top:18px}.media-card{margin-top:18px}.media-filter-form{margin-top:12px;border:1px solid var(--line);border-radius:16px;background:#f8fafc;padding:12px}.filterbar.compact{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.full-photo-gallery{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));align-items:start}.photo-box{padding:12px}.photo-img{width:100%;height:auto;max-height:none;aspect-ratio:auto!important;object-fit:contain!important;background:#f8fafc}.photo-info{font-size:13px}.photo-title-line{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}.photo-history{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.photo-history div{border:1px solid var(--line);border-radius:12px;padding:8px;background:#f8fafc}.photo-history span{display:block;font-size:11px;color:var(--muted);margin-bottom:3px}.photo-history strong{font-size:12px}.photo-history strong.ok{color:#166534}.photo-history strong.warn{color:#92400e}.block-media-card img{aspect-ratio:auto!important;object-fit:contain!important;height:auto;max-height:220px;background:#fff}.media-fallback{aspect-ratio:16/9}.portfolio-box{min-height:100%}.muted{color:var(--muted)}
@media(max-width:760px){.full-photo-gallery{grid-template-columns:1fr}.photo-history{grid-template-columns:1fr}}

/* Modular block library layout */
.module-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}.module-tabs a{display:inline-flex;align-items:center;text-decoration:none;border:1px solid var(--line);background:#fff;border-radius:999px;padding:9px 13px;font-weight:950;color:#0f172a}.module-tabs a.active{background:#0f172a;color:#fff;border-color:#0f172a}.blocks-layout{grid-template-columns:minmax(0,1.55fr) minmax(300px,.75fr);align-items:start}.blocks-library-card{position:sticky;top:18px}.saved-blocks-list{display:grid;gap:10px}.saved-block{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;border:1px solid var(--line);border-radius:15px;padding:11px;background:#fff}.saved-block-text{border-left:5px solid #2563eb}.saved-block-photos{border-left:5px solid #16a34a}.saved-block-profiles{border-left:5px solid #9333ea}.saved-block-cta{border-left:5px solid #f59e0b}.saved-block-divider,.saved-block-spacer{border-left:5px solid #64748b}.library-blocks{display:grid;gap:8px;max-height:52vh;overflow:auto;padding-right:4px}.library-block{width:100%;border:1px solid var(--line);border-radius:13px;background:#fff;padding:10px;text-align:left;cursor:pointer;display:grid;gap:4px}.library-block:hover{border-color:#93c5fd;background:#eff6ff}.library-block strong{font-size:14px}.library-block span{font-size:12px;color:var(--muted);line-height:1.35}.standalone-rich{min-height:260px}.selectable-form{margin-top:14px}.profile-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px;align-items:stretch}.profile-box{position:relative;border:2px solid var(--line);border-radius:20px;padding:12px;background:#fff;transition:.15s;cursor:pointer;display:block;min-height:100%}.profile-box:hover{transform:translateY(-1px);box-shadow:0 8px 22px rgba(15,23,42,.08)}.profile-box.selected{background:#f5f3ff!important;border-color:#9333ea!important;box-shadow:0 0 0 2px #ddd6fe inset}.profile-check{position:absolute;top:12px;right:12px;transform:scale(1.2);z-index:2;width:auto}.profile-img{width:100%;height:auto;display:block;border-radius:16px;border:1px solid var(--line);background:#f8fafc;margin-bottom:10px}.profile-avatar-placeholder{width:100%;aspect-ratio:16/10;border-radius:16px;border:1px solid var(--line);background:#f8fafc;display:grid;place-items:center;font-size:42px;font-weight:950;color:#4338ca;margin-bottom:10px}.profile-title{font-weight:950;font-size:16px;line-height:1.25;padding-right:28px}.profile-desc{font-size:13px;color:#334155;line-height:1.45;margin-top:8px}.profile-pill{display:inline-flex;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:999px;padding:2px 8px;margin:0 4px 4px 0;font-size:12px;font-weight:900}.profile-meta{font-size:12px;color:var(--muted);line-height:1.4;margin-top:8px}.modular-builder .block-palette{max-height:calc(100vh - 40px);overflow:auto}.composer-card{border:2px solid #dbeafe}.send-panel{margin-top:22px;border-top:1px solid var(--line);padding-top:18px}.muted{color:var(--muted)}
@media(max-width:1080px){.blocks-layout{grid-template-columns:1fr}.blocks-library-card{position:relative;top:auto}.library-blocks{max-height:none}}

/* Profile rescue/debug */
.subtle-card{box-shadow:none;background:#f8fafc}.mini-diag .diag-row{grid-template-columns:minmax(180px,1fr) 88px 1.5fr}.sql-preview{white-space:pre-wrap;word-break:break-word;background:#0f172a;color:#e5e7eb;border-radius:14px;padding:12px;font-size:12px;line-height:1.45;overflow:auto}.profile-debug details summary{cursor:pointer;font-weight:900;color:#334155}.profile-debug .stat strong{font-size:24px}

/* Preview + sticky save dock */
.photo-save-dock{
  position:sticky;
  top:18px;
  float:right;
  z-index:30;
  margin:0 0 12px 16px;
  min-width:230px;
  background:#0f172a;
  color:#fff;
  border:1px solid rgba(255,255,255,.15);
  border-radius:18px;
  padding:12px 14px;
  box-shadow:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.photo-save-dock .small{color:#cbd5e1}
.photo-save-dock strong{font-size:14px;line-height:1.2}
.photo-save-dock .btn{white-space:nowrap}
.selector-head{clear:both}
.form-bottom-actions{display:flex;justify-content:flex-end;margin-top:16px}
.preview-card{max-width:1120px}
.preview-tools{margin:6px 0 12px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}
.mail-preview-frame{
  width:100%;
  min-height:720px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:none;
}
.raw-html-details{margin-top:14px}
.preview-modal[hidden]{display:none!important}
.preview-modal{position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:24px}
.preview-modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.62);backdrop-filter:blur(4px)}
.preview-modal-panel{position:relative;z-index:1;width:min(1100px,96vw);max-height:94vh;overflow:auto;background:#fff;border-radius:24px;border:1px solid var(--line);padding:20px;box-shadow:0 30px 90px rgba(15,23,42,.35)}
.preview-modal-panel h2{margin:0 0 6px}.preview-modal-panel p{margin:0}.modal-frame{margin-top:14px;min-height:72vh}
@media(max-width:1080px){.photo-save-dock{position:sticky;top:10px;float:none;right:auto;margin:12px 0;min-width:0}.preview-modal{padding:10px}.preview-modal-panel{width:100%;padding:14px;border-radius:18px}.mail-preview-frame{min-height:600px}}

/* Profile avatars + block work names */
.block-head-title{display:grid;gap:2px;min-width:0}
.block-head-title small{font-size:11px;color:var(--muted);font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:420px}
.profile-avatar-frame{position:relative;width:100%;margin-bottom:10px;border-radius:16px;overflow:hidden;background:#f8fafc;border:1px solid var(--line)}
.profile-avatar-frame .profile-img{margin-bottom:0;border:0;border-radius:0;width:100%;display:block}
.profile-avatar-frame .avatar-fallback-placeholder{display:none;margin:0;border:0;border-radius:0;min-height:190px}
.profile-avatar-frame.avatar-failed .profile-img{display:none}
.profile-avatar-frame.avatar-failed .avatar-fallback-placeholder{display:grid}
.block-media-card{position:relative}
.block-media-card .avatar-media-fallback{display:none}
.block-media-card.avatar-failed img{display:none}
.block-media-card.avatar-failed .avatar-media-fallback{display:grid}
.warn{color:#b45309;font-weight:900}
@media (max-width:720px){.block-head-title small{max-width:220px}}


/* Fix 1.5.6: profile selector visibility + no empty title gaps */
.profile-gallery{display:grid!important;visibility:visible!important;opacity:1!important;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px;align-items:stretch}
.profile-box{display:block!important;visibility:visible!important;opacity:1!important}
.profile-avatar-frame{position:relative;width:100%;min-height:160px;margin-bottom:10px}
.profile-avatar-frame .profile-img{width:100%;height:auto;display:block}
.profile-avatar-frame.avatar-failed .profile-img{display:none!important}
.profile-avatar-frame:not(.avatar-failed) .avatar-fallback-placeholder{display:none!important}
.photo-title-line:empty{display:none!important}

/* 1.5.8 — realny selektor profili jak przy zdjęciach */
.profile-selector-intro{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:4px 0 14px;padding:14px 16px;border:1px solid #ddd6fe;background:#faf5ff;border-radius:18px}
.profile-selector-intro h3{margin:0 0 4px;font-size:18px;letter-spacing:-.02em}.profile-choice-gallery{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px;align-items:stretch;visibility:visible!important;opacity:1!important}.profile-select-form{position:relative}.profile-save-dock{position:sticky;top:18px;float:right;z-index:20;margin:0 0 12px 16px;min-width:230px;background:#0f172a;color:#fff;border:1px solid rgba(255,255,255,.15);border-radius:18px;padding:12px 14px;box-shadow:none;display:flex;align-items:center;justify-content:space-between;gap:12px}.profile-save-dock .small{color:#cbd5e1}.profile-save-dock .btn{white-space:nowrap}.profile-selector-head{clear:both}.profile-avatar-frame{position:relative;border-radius:16px;overflow:hidden;margin-bottom:10px;background:#f8fafc;border:1px solid var(--line)}.profile-avatar-frame .profile-img{margin:0;border:0;border-radius:0;width:100%;height:auto;display:block}.profile-avatar-frame .avatar-fallback-placeholder{display:none;margin:0;border:0;border-radius:0}.profile-avatar-frame.avatar-failed img,.profile-avatar-frame.avatar-failed .profile-img{display:none}.profile-avatar-frame.avatar-failed .avatar-fallback-placeholder{display:grid}.profile-bio{font-size:12px;color:#475569;line-height:1.45;margin-top:8px;border-top:1px solid var(--line);padding-top:8px}.profile-debug summary{cursor:pointer;list-style:none}.profile-debug summary::-webkit-details-marker{display:none}
@media(max-width:1080px){.profile-save-dock{position:sticky;top:10px;float:none;margin:12px 0;min-width:0}.profile-choice-gallery{grid-template-columns:1fr}}


/* 1.5.9 — profile selector rendered above filters */
.profile-selector-v2{border-color:#c4b5fd;background:#f5f3ff}
.profile-choice-gallery-v2{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(260px,1fr))!important;gap:16px!important;margin-top:12px!important;min-height:120px!important}
.profile-choice-box{min-height:260px!important;background:#fff!important}
.profile-choice-box input.profile-check{display:block!important;visibility:visible!important;opacity:1!important}
.profile-filters summary,.profile-debug summary{cursor:pointer}
.profile-save-dock-v2{position:sticky;top:18px;float:right;z-index:30;margin:0 0 12px 16px}
@media(max-width:900px){.profile-save-dock-v2{float:none;margin:12px 0}.profile-choice-gallery-v2{grid-template-columns:1fr!important}}

/* 1.5.10 — profil = avatar + username + profesja + lokalizacja + link */
.profile-choice-box .profile-title{font-size:17px;font-weight:950;letter-spacing:-.01em}
.profile-choice-box .profile-desc{margin-top:8px}
.profile-choice-box .profile-meta a{font-weight:950;color:#2563eb;text-decoration:none}
.profile-choice-box .profile-meta a:hover{text-decoration:underline}
.profile-choice-box .profile-avatar-frame{background:#f8fafc}
.profile-choice-box .profile-img{width:100%;height:auto;display:block}

/* Profile hero cards */
.profile-choice-gallery-v2{grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px}
.profile-hero-card{padding:0;overflow:hidden;border-radius:22px;background:#0f172a;color:#fff;border-color:#cbd5e1}
.profile-hero-card.selected{background:#0f172a!important;border-color:#8b5cf6!important;box-shadow:0 0 0 3px rgba(139,92,246,.22),0 14px 28px rgba(15,23,42,.18)!important}
.profile-hero-card .profile-check{top:14px;right:14px;accent-color:#8b5cf6}
.profile-hero-media{position:relative;min-height:360px;background:#0f172a}
.profile-hero-frame,.profile-hero-fallback{margin:0!important;border:0!important;border-radius:0!important;min-height:360px;height:100%;width:100%}
.profile-hero-frame .profile-img{width:100%;height:360px;object-fit:cover;display:block}
.profile-hero-fallback{display:grid;place-items:center;background:#f8fafc;font-size:84px;font-weight:950;color:#fff}
.profile-overlay{position:absolute;left:0;right:0;bottom:0;padding:22px 18px 16px;background:#f8fafc;color:#fff}
.profile-overlay .profile-title{font-size:22px;line-height:1.15;font-weight:950;color:#fff;padding-right:40px;text-shadow:0 2px 14px rgba(0,0,0,.4)}
.profile-overlay .profile-desc{margin-top:10px;color:#e2e8f0}
.profile-overlay .profile-pill{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.18);color:#fff;backdrop-filter:blur(4px)}
.profile-overlay-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:12px;color:#cbd5e1;font-size:12px}
.profile-overlay-meta a{display:inline-flex;align-items:center;justify-content:center;background:#fff;color:#0f172a;text-decoration:none;font-weight:900;border-radius:999px;padding:8px 12px}
.profile-overlay-meta span{display:inline-block}
@media (max-width:768px){.profile-hero-media,.profile-hero-frame .profile-img,.profile-hero-fallback{min-height:300px;height:300px}.profile-overlay .profile-title{font-size:19px}}

/* Photo square-corner override */
.photo-img,.photo-box img,.block-media-card img,.nl-photo-card img{border-radius:0!important;}
.photo-box{border-radius:17px;}

/* Final profile/text tweaks */
.profile-box,.profile-hero-card,.profile-avatar-frame,.profile-img,.profile-avatar-placeholder,.profile-hero-frame,.profile-hero-fallback,.profile-overlay,.profile-pill,.profile-overlay-meta a{border-radius:0!important}
.profile-hero-card{overflow:hidden}
.profile-hero-frame .profile-img{border-radius:0!important}
.block-rich.text-theme-dark{background:#111827!important;color:#f8fafc!important;padding:18px 20px!important;border-color:#334155!important}
.block-rich.text-theme-dark h1,.block-rich.text-theme-dark h2,.block-rich.text-theme-dark h3,.block-rich.text-theme-dark p,.block-rich.text-theme-dark li,.block-rich.text-theme-dark strong{color:#f8fafc!important}
.block-rich.text-theme-dark a{color:#93c5fd!important}
.block-rich.text-theme-light{background:#fff!important;color:#111827!important}

/* Profile split cards — cleaner layout, no rounding */
.profile-choice-gallery-v2{grid-template-columns:repeat(auto-fill,minmax(420px,1fr));gap:18px;align-items:stretch}
.profile-split-card{display:grid!important;grid-template-columns:168px minmax(0,1fr);min-height:210px;padding:0!important;border:1px solid #cbd5e1!important;background:#111827!important;color:#fff!important;border-radius:0!important;overflow:hidden;box-shadow:0 10px 28px rgba(15,23,42,.12)}
.profile-split-card:hover{transform:translateY(-1px);box-shadow:0 16px 32px rgba(15,23,42,.16)}
.profile-split-card.selected{border-color:#22c55e!important;background:#111827!important;box-shadow:0 0 0 3px rgba(34,197,94,.18),0 16px 32px rgba(15,23,42,.18)!important}
.profile-split-card .profile-check{top:12px;right:12px;accent-color:#22c55e;z-index:5}
.profile-split-media{background:#e5e7eb;min-height:210px}
.profile-split-frame,.profile-split-fallback{width:100%;height:100%;min-height:210px;margin:0!important;border:0!important;border-radius:0!important;background:#e5e7eb!important}
.profile-split-frame .profile-img{width:100%;height:100%;min-height:210px;object-fit:cover;display:block;border-radius:0!important;border:0!important;margin:0!important}
.profile-split-fallback{display:grid;place-items:center;font-size:64px;font-weight:950;color:#111827;background:#e5e7eb!important}
.profile-split-frame.avatar-failed .profile-img{display:none!important}
.profile-split-frame.avatar-failed .avatar-fallback-placeholder{display:grid!important;width:100%;height:100%;min-height:210px;margin:0!important;border:0!important;border-radius:0!important;background:#e5e7eb!important;color:#111827!important}
.profile-split-info{padding:22px 22px 18px;display:flex;flex-direction:column;justify-content:center;min-width:0}
.profile-split-info .profile-title{font-size:23px;line-height:1.12;color:#fff;font-weight:950;padding-right:34px;letter-spacing:-.025em}
.profile-split-info .profile-desc{display:grid;gap:4px;margin-top:12px;color:#e5e7eb;font-size:14px;line-height:1.35}
.profile-split-info .profile-desc span:first-child{color:#93c5fd;font-weight:900}
.profile-split-info .profile-desc span:not(:first-child){color:#e5e7eb;font-weight:700}
.profile-split-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:18px;color:#9ca3af;font-size:12px}
.profile-split-meta a{display:inline-flex;background:#ffffff;color:#111827!important;text-decoration:none;font-weight:950;padding:10px 13px;border-radius:0!important;border:1px solid #e5e7eb}
.profile-split-meta span{color:#9ca3af}
@media (max-width:760px){.profile-choice-gallery-v2{grid-template-columns:1fr}.profile-split-card{grid-template-columns:132px minmax(0,1fr);min-height:170px}.profile-split-media,.profile-split-frame,.profile-split-fallback,.profile-split-frame .profile-img{min-height:170px}.profile-split-info{padding:16px}.profile-split-info .profile-title{font-size:19px}.profile-split-meta{margin-top:12px}}
@media (max-width:520px){.profile-split-card{grid-template-columns:1fr}.profile-split-media,.profile-split-frame,.profile-split-fallback,.profile-split-frame .profile-img{height:auto;min-height:260px}.profile-split-frame .profile-img{height:auto;object-fit:contain}.profile-split-info{padding:18px}}


/* Final text preview fixes */
.block-rich.text-theme-dark{background:#111827!important;color:#f8fafc!important;padding:18px 20px!important;border-color:#334155!important}
.block-rich.text-theme-dark h1,.block-rich.text-theme-dark h2,.block-rich.text-theme-dark h3,.block-rich.text-theme-dark h4,.block-rich.text-theme-dark h5,.block-rich.text-theme-dark h6,.block-rich.text-theme-dark p,.block-rich.text-theme-dark li,.block-rich.text-theme-dark div,.block-rich.text-theme-dark span,.block-rich.text-theme-dark strong,.block-rich.text-theme-dark em{color:#f8fafc!important}
.block-rich.text-theme-dark a{color:#93c5fd!important;text-decoration:underline!important}
.block-rich.text-theme-light{background:#fff!important;color:#111827!important;padding:18px 20px!important}
.block-rich.text-theme-light h1,.block-rich.text-theme-light h2,.block-rich.text-theme-light h3,.block-rich.text-theme-light p,.block-rich.text-theme-light li,.block-rich.text-theme-light strong{color:#111827!important}
.block-rich.text-theme-light a{color:#2563eb!important}
.cta-preview,.block-body .cta-text + *{border-radius:0!important}

/* Blocks page: full-width sections */
.blocks-layout-full{display:block;width:100%;}
.blocks-layout-full>.card{width:100%;box-sizing:border-box;}
.block-create-card,.blocks-library-page{max-width:none;}
.blocks-library-page{position:relative;top:auto;}
.saved-blocks-list-wide{grid-template-columns:1fr;}
.pill.draft{background:#f8fafc;color:#334155;border-color:#cbd5e1}
.campaigns-card .stats{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}


/* Flat admin UI override — no shadows, no gradients */
*,
*::before,
*::after{
  box-shadow:none!important;
  text-shadow:none!important;
}
body{
  background:#f3f4f6!important;
}
.app,
.main{
  background:#f3f4f6!important;
  background-image:none!important;
}
.sidebar,
.topbar,
.card,
.subtle-card,
.block-create-card,
.blocks-layout-full,
.userbox,
.saved-block,
.library-block,
.photo-box,
.profile-box,
.profile-hero-card,
.profile-split-card,
.modal-card,
.preview-frame,
.nl-preview,
details,
input,
select,
textarea{
  background-image:none!important;
  box-shadow:none!important;
}
.sidebar{
  background:#ffffff!important;
  border-right:1px solid #e5e7eb!important;
}
.card,
.subtle-card,
.block-create-card,
.saved-block,
.library-block,
.photo-box,
.profile-box,
.profile-hero-card,
.profile-split-card{
  background:#ffffff!important;
  border:1px solid #e5e7eb!important;
}
.topbar{
  background:#ffffff!important;
  border:1px solid #e5e7eb!important;
}
.nav a,
.module-tabs a{
  background:#ffffff!important;
  background-image:none!important;
  border:1px solid #e5e7eb!important;
  color:#0f172a!important;
}
.nav a.active,
.module-tabs a.active{
  background:#111827!important;
  border-color:#111827!important;
  color:#ffffff!important;
}
.btn{
  background:#ffffff!important;
  background-image:none!important;
  border:1px solid #cbd5e1!important;
  color:#0f172a!important;
}
.btn.primary{
  background:#111827!important;
  border-color:#111827!important;
  color:#ffffff!important;
}
.btn.danger{
  background:#ffffff!important;
  border-color:#dc2626!important;
  color:#b91c1c!important;
}
.pill{
  background:#f8fafc!important;
  border:1px solid #e5e7eb!important;
  color:#334155!important;
}
.pill.ok{
  background:#ecfdf5!important;
  border-color:#bbf7d0!important;
  color:#166534!important;
}
.profile-overlay,
.profile-hero-fallback,
.profile-save-dock,
.photo-save-dock,
.media-save-dock{
  background:#111827!important;
  background-image:none!important;
  color:#ffffff!important;
}
.profile-box:hover,
.photo-box:hover,
.library-block:hover{
  transform:none!important;
}
.profile-overlay .profile-pill{
  background:#ffffff!important;
  color:#111827!important;
  border:1px solid #e5e7eb!important;
}
