:root {
  --ground: #f7f7f5; --surface: #fff; --raised: #f0efec; --active: #e8e6e2;
  --border: #e6e5e1; --rule: #efeee9; --control: #cfcdc7;
  --text: #121212; --muted: #5d5c58; --faint: #6b6a66;
  --fill: #1f2a24; --fill-text: #7d8a83;
  --red: #e3170a; --red-50: #fdeeed; --red-100: #fbd9d6; --red-ink: #8f1108;
  --orange: #ef7d00; --orange-50: #fff1e2; --orange-ink: #8a4400;
  --ok-50: #e6f5ec; --ok-ink: #10391f;
  --radius: 12px; --radius-s: 8px;
  --font: "Manrope", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--text); font: 14px/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #121212; outline-offset: 2px; }

/* ——— pasek ——— */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 0 32px; height: 60px; background: var(--ground); border-bottom: 1px solid var(--border); }
.mark { font-weight: 800; letter-spacing: -0.02em; font-size: 16px; display: flex; gap: 8px; align-items: center; text-decoration: none; }
.mark i { width: 12px; height: 12px; background: var(--red); display: inline-block; }
.bar nav { display: flex; gap: 4px; }
.bar nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 6px 10px; border-radius: var(--radius-s); }
.bar nav a:hover { color: var(--text); }
.bar nav a.on { color: var(--text); background: var(--active); }
.bar nav .count { font-size: 12px; color: var(--red-ink); background: var(--red-50); border-radius: 999px; padding: 0 7px; margin-left: 4px; }
.bar nav .count:empty { display: none; }
.me { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); }
.demo-banner { background: var(--orange-50); color: var(--orange-ink); padding: 8px 32px; font-size: 13px; }

main { max-width: 1600px; margin: 0 auto; padding: 24px 24px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; padding: 4px 0 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.page-head .sub b { color: var(--red-ink); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ——— kontrolki ——— */
.btn { height: 36px; padding: 0 14px; border-radius: var(--radius-s); border: 1px solid var(--control); background: var(--surface); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.btn:hover { background: #fafaf8; border-color: #b9b6af; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn.primary:hover { background: #2b2b2b; }
.btn.danger { color: var(--red-ink); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--raised); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
input[type=text], input[type=search], input[type=date], select, textarea { height: 34px; border: 1px solid var(--control); border-radius: var(--radius-s); background: var(--surface); padding: 0 10px; }
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 20px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--control); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--active); color: var(--text); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ——— strona główna: mapa miesiąca ——— */
.overview { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.matrix { padding: 8px 8px 12px; overflow-x: auto; }
.matrix table { border-collapse: separate; border-spacing: 0; width: 100%; }
.matrix th { font-weight: 600; font-size: 12px; color: var(--muted); padding: 8px 2px; text-align: center; }
.matrix th.park { text-align: left; padding-left: 12px; }
.matrix th .wd { display: block; font-weight: 500; color: var(--faint); }
.matrix th.hol { color: var(--red-ink); }
.matrix th.today { color: var(--text); }
.matrix th.today .num { background: var(--text); color: #fff; border-radius: 4px; padding: 0 4px; }
.matrix td { padding: 3px 3px; }
.matrix .cell i.empty, .matrix .cell i.future { background: #fff; }
/* Rzędy kanałów: FB niebieskie, IG różowe; między parkami większy odstęp. */
.matrix { --fb-bg: #d3e2f8; --fb-ink: #1d4f9c; --ig-bg: #f8d5e5; --ig-ink: #a3245f; }
.matrix tr.ch-fb td:not(.park) { background: var(--fb-bg); }
.matrix tr.ch-ig td:not(.park) { background: var(--ig-bg); }
.matrix tr.ch-fb td { border-top: 8px solid var(--surface); }
.matrix tr td:last-child { padding-right: 5px; }
.matrix td.ch { width: 28px; padding: 2px 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.matrix td.ch a { text-decoration: none; }
.matrix tr.ch-fb td.ch a { color: var(--fb-ink); }
.matrix tr.ch-ig td.ch a { color: var(--ig-ink); }
.matrix tr.ch-fb td.park { vertical-align: middle; }
.matrix td.park { font-weight: 600; padding: 0 12px; white-space: nowrap; }
.matrix td.park a { text-decoration: none; }
.matrix td.park small { color: var(--red-ink); font-weight: 600; margin-left: 6px; }
.matrix tr.ch-fb:hover td:not(.park) { background: #c2d6f4; }
.matrix tr.ch-ig:hover td:not(.park) { background: #f3c3d9; }
.cell { display: grid; gap: 2px; text-decoration: none; min-width: 22px; }
.cell i { display: block; height: 12px; border-radius: 3px; background: var(--fill); }
.cell i.text { background: var(--fill-text); }
.cell i.skip { background: var(--raised); }
.cell i.empty { background: var(--red-50); box-shadow: inset 0 0 0 1.5px var(--red); }
.cell i.future { background: var(--raised); box-shadow: inset 0 0 0 1.5px #d9d7d2; }
.cell:hover i { outline: 2px solid #12121233; outline-offset: 1px; }
.key { display: flex; gap: 18px; padding: 10px 12px 2px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.key span { display: inline-flex; gap: 6px; align-items: center; }
.key i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.rail { display: flex; flex-direction: column; gap: 16px; }
.rail .panel { padding: 16px; }
.rail h2 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.big { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.02em; }
.rail p { color: var(--muted); }
.rail .btn { margin-top: 12px; width: 100%; justify-content: center; }
.pin-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.pin-row:first-of-type { border-top: 0; }
.pin-row b { font-size: 15px; }
.pin-row span { color: var(--muted); font-size: 13px; }

/* ——— kalendarz ——— */
.cal-head { display: flex; gap: 10px; align-items: center; padding-bottom: 16px; flex-wrap: wrap; }
.cal-head select { height: 40px; font-size: 16px; font-weight: 700; padding: 0 12px; }
.cal-head .month { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 0 8px; min-width: 190px; text-align: center; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; }
.calendar .dow { background: var(--surface); text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 0; }
.day { background: var(--surface); min-height: 148px; padding: 8px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.day.out { background: #fbfbfa; }
.day.out > * { opacity: .45; }
.day.pub { background: #fff; }
.day.pub::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--text); }
.day.pub.missing::before { background: var(--red); }
.day.pub.skipped::before { background: #c9c6c0; }
.day.over { background: #f3f7f4; }
.day-top { display: flex; align-items: center; gap: 6px; }
.day-top .d { font-weight: 700; font-size: 13px; }
.day.today .d { background: var(--text); color: #fff; border-radius: 4px; padding: 0 5px; }
.day-top .pubtag { font-size: 11px; color: var(--faint); font-weight: 600; }
.day.missing .pubtag { color: var(--red-ink); }
.day-top .menu { margin-left: auto; }
.hol { font-size: 11px; font-weight: 700; line-height: 14px; border-radius: 999px; padding: 2px 8px; background: var(--raised); color: var(--muted); align-self: flex-start; }
.hol.public { background: var(--red-50); color: var(--red-ink); }
.entries { display: flex; flex-wrap: wrap; gap: 6px; }
.tile { width: 84px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; cursor: grab; position: relative; font-size: 11px; line-height: 14px; }
.tile:hover { border-color: var(--control); }
.tile.dragging { opacity: .4; }
.tile img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: var(--raised); }
.tile .meta { padding: 3px 5px 4px; }
.tile .meta b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta span { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .badges { position: absolute; top: 4px; left: 4px; display: flex; gap: 3px; }
.tile .badges i { font-style: normal; background: #121212d9; color: #fff; border-radius: 4px; padding: 0 4px; font-size: 10px; font-weight: 700; }
.tile .badges i.warn { background: var(--orange); }
.tile .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: #121212; color: #fff; cursor: pointer; font-size: 14px; font-weight: 700; line-height: 18px; padding: 0; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.tile .x:hover { background: var(--red); }
.tile.text { cursor: grab; padding: 6px; min-height: 52px; background: var(--raised); border-color: transparent; }
.tile.text b { font-size: 12px; }
.tile.note { width: 100%; cursor: grab; background: #fff8e5; border-color: #f3e2b3; padding: 6px 8px; font-size: 12px; line-height: 16px; color: #5a4300; }
.tile .slides { display: flex; gap: 2px; padding: 0 5px 5px; }
.tile .slides img { width: 22px; aspect-ratio: 4/5; border-radius: 2px; }
.add-slot { border: 1.5px dashed var(--control); background: none; border-radius: 6px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 20px; }
.add-slot:hover { border-color: var(--text); color: var(--text); }
.day.missing .add-slot { border-color: var(--red); color: var(--red-ink); }
.skipnote { font-size: 12px; color: var(--muted); background: var(--raised); border-radius: 6px; padding: 4px 8px; }
.export-bar { margin-top: 20px; padding: 16px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.export-bar h2 { font-size: 16px; font-weight: 700; width: 100%; }
.issues { width: 100%; color: var(--red-ink); background: var(--red-50); border-radius: var(--radius-s); padding: 10px 12px; font-size: 13px; }

/* ——— menu kontekstowe ——— */
.pop { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.12); padding: 6px; min-width: 200px; }
.pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-weight: 500; }
.pop button:hover { background: var(--raised); }

/* ——— modal ——— */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20,20,20,.28); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; padding: 32px; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); width: min(560px, 100%); max-height: calc(100vh - 64px); overflow: auto; padding: 22px; animation: rise .16s ease-out; }
.modal.wide { width: min(1040px, 100%); }
.modal h2 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.confirm p { margin-bottom: 18px; font-size: 15px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .backdrop, .modal { animation: none; } }
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 12px; }
.lib-item { display: flex; flex-direction: column; gap: 6px; }
.lib-item img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; background: var(--raised); }
.lib-item b { font-size: 13px; }
.lib-item span { font-size: 12px; color: var(--muted); }
.lib-item .btn { justify-content: center; }
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(10,10,10,.88); display: grid; place-items: center; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 96vh; object-fit: contain; }

/* ——— dodawanie zdjęć ——— */
.drop { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 340px; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.drop .zone { background: var(--fill); color: #fff; display: grid; place-items: center; padding: 32px; transition: background .15s; }
.drop .zone.over { background: #2e4136; }
.drop .zone div { border: 2px dashed #ffffff66; border-radius: 14px; padding: 48px 56px; text-align: center; font-size: 18px; font-weight: 600; }
.drop .zone small { display: block; font-size: 13px; font-weight: 500; opacity: .8; margin-top: 6px; }
.drop .side { padding: 32px; display: flex; flex-direction: column; gap: 14px; justify-content: center; align-items: flex-start; }
.drop .side p { color: var(--muted); }
.queue { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.queue figure { margin: 0; font-size: 12px; color: var(--muted); }
.queue img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; background: var(--raised); }

/* ——— lista zdjęć ——— */
.filters { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); align-items: center; flex-wrap: wrap; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ptable td { padding: 12px 5px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable .thumb { width: 72px; aspect-ratio: 4/5; object-fit: cover; border-radius: 6px; cursor: zoom-in; display: block; background: var(--raised); }
.ptable td.date { width: 84px; color: var(--muted); font-size: 13px; }
.ptable textarea { width: 150px; min-height: 92px; font-size: 13px; }
.status-ok { color: var(--ok-ink); background: var(--ok-50); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-no { color: var(--muted); background: var(--raised); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 12px; }

/* combobox najemcy */
.combo { position: relative; width: 150px; }
.ptable .combo { width: 132px; }
.combo input { width: 100%; }
.combo .list { position: absolute; z-index: 30; top: 38px; left: 0; right: 0; max-height: 260px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.12); padding: 4px; }
.combo .list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 9px; border-radius: 6px; cursor: pointer; }
.combo .list button small { color: var(--faint); margin-left: 6px; }
.combo .list button:hover, .combo .list button.hi { background: var(--raised); }
.combo .list button.general { color: var(--orange-ink); font-weight: 700; }

/* chipy parków */
.chips { display: flex; flex-wrap: wrap; gap: 4px; width: 165px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--red); color: #fff; }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; width: 18px; height: 18px; border-radius: 50%; line-height: 18px; padding: 0; font-size: 13px; }
.chip button:hover { background: #ffffff33; }
.chip.removed { background: var(--raised); color: var(--faint); text-decoration: line-through; }
.chip.removed button { text-decoration: none; }
.chip.general { background: var(--orange); }
.chip.manual { background: #fff; color: var(--red-ink); box-shadow: inset 0 0 0 1.5px var(--red); }
.chip .info, .sched .info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #121212; color: #fff; font: 700 10px/1 Georgia, serif; font-style: italic; cursor: help; }
.chip-add { height: 24px; border-radius: 999px; border: 1px dashed var(--control); background: none; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 9px; cursor: pointer; }
.tip { white-space: pre-line; position: fixed; z-index: 80; background: #121212; color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; max-width: 260px; pointer-events: none; }

/* edytor podpisu (pole z pogrubieniem) */
.rich { min-height: 64px; width: 150px; border: 1px solid var(--control); border-radius: var(--radius-s); padding: 8px 10px; background: var(--surface); font-family: "futura-100", "Jost", sans-serif; font-weight: 500; font-size: 15px; line-height: 19px; white-space: pre-wrap; outline: none; }
.rich:focus { border-color: var(--text); }
.rich:empty::before { content: attr(data-ph); color: var(--faint); }
.rich b, .rich strong { font-weight: 700; }

/* wybór koloru */
.color { position: relative; }
.color > button { white-space: nowrap; height: 34px; border: 1px solid var(--control); border-radius: var(--radius-s); background: var(--surface); display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
.swatch { width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); display: inline-block; flex: none; }
.color .grid { position: absolute; z-index: 30; top: 38px; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.12); padding: 6px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; width: 470px; }
.color .grid button { border: 0; background: none; display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 12px; font-variant-numeric: tabular-nums; }
.color .grid button:hover, .color .grid button.on { background: var(--raised); }

/* ——— edytor kadru ——— */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.stage-wrap { background: #1b1b1b; border-radius: var(--radius); padding: 18px; display: grid; place-items: center; position: relative; }
.stage { position: relative; width: min(100%, calc((100vh - 230px) * 0.8)); aspect-ratio: 4 / 5; user-select: none; touch-action: none; }
.stage canvas { width: 100%; height: 100%; display: block; }
.stage .apla-box { position: absolute; outline: 2px solid #ffffffcc; outline-offset: 0; cursor: move; }
.stage .apla-box.bad { outline-color: var(--red); }
.stage .zone { position: absolute; background: repeating-linear-gradient(135deg, rgba(0,0,0,.45) 0 5px, rgba(255,255,255,.35) 5px 10px); outline: 2px dashed #fff; pointer-events: none; }
.stage.pan { cursor: grab; }
.stage-tools { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.side-panel { display: flex; flex-direction: column; gap: 14px; }
.side-panel .panel { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.side-panel h2 { font-size: 15px; font-weight: 700; }
.side-panel .rich { width: 100%; min-height: 90px; font-size: 18px; line-height: 23px; }
.range { display: grid; grid-template-columns: 80px 1fr 44px; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.strip-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px 4px; margin-top: 14px; }
.strip-thumbs button { flex: none; width: 54px; border: 2px solid transparent; border-radius: 6px; padding: 0; background: none; cursor: pointer; position: relative; }
.strip-thumbs button.on { border-color: var(--text); }
.strip-thumbs button img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 4px; display: block; }
.strip-thumbs button.done::after { content: "✓"; position: absolute; right: 2px; bottom: 2px; background: var(--ok-ink); color: #fff; border-radius: 50%; width: 15px; height: 15px; font-size: 10px; line-height: 15px; text-align: center; }

/* ——— historia, toasty ——— */
.hist td { font-size: 13px; }
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #121212; color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .3s, transform .3s; }
.toast.err { background: var(--red-ink); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ——— logowanie ——— */
.login { min-height: 80vh; display: grid; place-items: center; }
.login .panel { padding: 36px; width: 380px; display: grid; gap: 16px; text-align: center; }
.login .mark { justify-content: center; font-size: 22px; }
.loading { padding: 80px; text-align: center; color: var(--muted); }

/* ——— dodawanie do harmonogramów ——— */
.park-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; max-height: 260px; overflow: auto; padding: 4px 2px; }
.park-grid label[hidden] { display: none; }
.ptable td.sel, .ptable th.sel { width: 28px; padding-right: 0; }
.sched { display: block; margin-top: 6px; font-size: 12px; line-height: 15px; color: var(--muted); max-width: 90px; }
.bulkbar { display: grid; gap: 8px; padding: 10px 12px; margin: 0 0 10px; border-radius: var(--radius-s); background: var(--raised); }
.bulk-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.bulk-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; overflow-x: auto; }
.bulk-actions .btn { white-space: nowrap; flex: none; }
.tile.text.catalog { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.zoom-seg .zoom-val { display: inline-grid; place-items: center; min-width: 52px; font-size: 13px; font-weight: 700; color: var(--text); }
.zoom-seg button { font-size: 16px; min-width: 36px; }
.zoom-seg button:last-child { font-size: 13px; }
.zoom-warn { width: 100%; text-align: center; color: #ffb27a; font-size: 13px; }
.zoom-warn[hidden] { display: none; }

/* ——— podgląd kreacji w kalendarzu ——— */
.creative-modal { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 24px; align-items: start; }
.creative-big { aspect-ratio: 4 / 5; background: var(--raised); border-radius: 10px; overflow: hidden; }
.creative-big canvas { width: 100%; height: 100%; display: block; }
.creative-side { display: grid; gap: 14px; }
.creative-side h2 { margin: 0; }
.creative-copy { background: var(--raised); border-radius: 10px; padding: 12px 14px; max-height: 260px; overflow: auto; }
.creative-copy p { white-space: pre-wrap; margin-top: 6px; font-size: 14px; line-height: 20px; }
.creative-slides { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.creative-slides:empty { display: none; }
.creative-slides b { width: 100%; font-size: 13px; }
.creative-slides img { width: 64px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }
.creative-actions { display: grid; gap: 8px; justify-items: stretch; }
.creative-actions .btn small { margin-left: 8px; font-weight: 400; color: var(--muted); font-size: 12px; }
.warn-box { background: var(--orange-50); color: var(--orange-ink); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; }
.warn-box .muted { color: var(--orange-ink); opacity: .8; }
.chip-clear:hover { color: var(--red-ink); border-color: var(--red); }
.pad-field { flex: 1; min-width: 0; }
.pad-field input { width: 100%; }

/* ——— Lista zdjęć: wiersze + panel edycji ——— */
.ptabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.ptabs button { border: 0; background: none; padding: 8px 12px 10px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.ptabs button:hover { color: var(--text); }
.ptabs button.on { color: var(--text); border-bottom-color: var(--text); }
.ptabs .count { font-size: 12px; color: var(--faint); margin-left: 6px; }
.pwrap { display: grid; grid-template-columns: minmax(0, 1fr); }
.pwrap.open { grid-template-columns: minmax(0, 1fr) 420px; }
.plist { min-width: 0; }
.phead, .prow { display: grid; grid-template-columns: 24px 64px minmax(0, 1.4fr) minmax(0, 1fr) 64px 170px; gap: 16px; align-items: center; padding: 10px 16px; }
.phead { font-size: 12px; font-weight: 600; color: var(--faint); border-bottom: 1px solid var(--rule); padding-top: 8px; padding-bottom: 8px; }
.prow { border-bottom: 1px solid var(--rule); cursor: pointer; }
.prow:hover { background: #fafaf8; }
.prow.on { background: #f3f2ee; box-shadow: inset 3px 0 0 var(--text); }
.prow input[type=checkbox], .phead input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--text); margin: 0; }
.pthumb { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; background: var(--raised); display: block; }
.pmain { min-width: 0; display: grid; gap: 2px; }
.ptenant { font-weight: 700; font-size: 15px; }
.pcap { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcap.empty { color: #a6a49e; font-style: italic; }
.pdate { color: var(--faint); font-size: 12px; }
.pparks { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pparks b { color: var(--text); font-weight: 700; }
.warn-text { color: var(--orange-ink); font-weight: 600; }
.ch-badges { display: inline-flex; gap: 3px; }
.ch-badges b { font-size: 10px; font-weight: 800; letter-spacing: .03em; padding: 1px 5px; border-radius: 4px; }
.ch-badges .fb { background: #e6effc; color: #1d4f9c; }
.ch-badges .ig { background: #fce8f1; color: #a3245f; }
.ch-badges .off { background: var(--raised); color: #b4b2ac; text-decoration: line-through; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.todo { background: var(--orange-50); color: var(--orange-ink); }
.pill.ok { background: var(--ok-50); color: var(--ok-ink); }
.pill.cal { background: var(--raised); color: var(--text); }
.pill.muted-pill { background: var(--raised); color: var(--muted); }
.pill .info { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #121212; color: #fff; font: italic 700 10px/1 Georgia, serif; cursor: help; }
.pdrawer { border-left: 1px solid var(--border); min-width: 0; }
.pwrap:not(.open) .pdrawer { display: none; }
.pdrawer-in { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 18px 20px 24px; display: grid; gap: 20px; align-content: start; }
.dhead { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.dthumb { width: 104px; height: 130px; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: var(--raised); }
.dtitle { font-size: 18px; font-weight: 700; line-height: 24px; }
.small { font-size: 12px; }
.dsec { display: grid; gap: 10px; }
.dsec h3 { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.dsec .field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.dsec .combo, .dsec .combo input, .dsec textarea, .dsec select, .dsec input[type=date] { width: 100%; }
.dsec .rich { width: 100%; }
.dsub { font-size: 13px; font-weight: 700; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dchecks { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.dchecks label { display: inline-flex; gap: 8px; align-items: center; }
.dactions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--rule); padding-top: 16px; }
.park-box .chips { width: auto; }
.park-links { font-size: 12px; color: var(--faint); margin-top: 8px; }
.link { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link:hover { color: var(--text); }
.park-box .chips + .chips { margin-top: 8px; }
@media (max-width: 1180px) {
  .pwrap.open { grid-template-columns: minmax(0, 1fr); }
  .pdrawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); z-index: 40; box-shadow: -12px 0 32px #0000001f; }
  .pdrawer-in { max-height: none; height: 100%; }
}
@media (max-width: 760px) {
  .phead, .prow { grid-template-columns: 24px 64px minmax(0, 1fr) auto; }
  .phead > :nth-child(4), .phead > :nth-child(5), .prow > :nth-child(4), .prow > :nth-child(5) { display: none; }
}

/* Wersja logo na FB (edytor, panel zdjęcia, menu „Pobierz”, podgląd kreacji w kalendarzu) */
.logo-picker { display: grid; gap: 10px; }
.logo-picker .field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.logo-picker .seg { width: max-content; max-width: 100%; }
.download-pop { min-width: 250px; }
.download-pop .logo-picker { padding: 6px 6px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.download-pop .logo-picker .seg button { display: inline-block; width: auto; border-radius: 0; height: 30px; padding: 0 10px; font-weight: 600; }
.btn.icon-btn { width: 34px; padding: 0; justify-content: center; }
.btn.icon-btn.on { background: var(--active); border-color: var(--text); }
