:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #1f1d1a;
  --muted: #6b6760;
  --line: #e4e0d7;
  --accent: #0e6b66;
  --accent-ink: #ffffff;
  --warn-bg: #fff4dc;
  --warn-ink: #7a5300;
  --bad: #b3261e;
  --good: #1f7a3a;
  --p-edukacja: #2f6fb3;
  --p-zaufanie: #2f8a57;
  --p-oferta: #c07a12;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --surface: #211f1d;
    --ink: #eeebe5;
    --muted: #a39e95;
    --line: #36332f;
    --accent: #3fb3aa;
    --accent-ink: #0b1514;
    --warn-bg: #3a2f14;
    --warn-ink: #f2cf7d;
    --bad: #f08a82;
    --good: #7fd19a;
    --p-edukacja: #6fa8e8;
    --p-zaufanie: #6cc591;
    --p-oferta: #e7a94a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }

/* Pasek górny */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand span { font-weight: 400; color: var(--muted); }
.tabs { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; }
.tabs button {
  border: 0; background: none; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--muted);
}
.tabs button.active { background: var(--bg); color: var(--ink); font-weight: 600; }
.tabs b { display: inline-block; min-width: 1.6em; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; text-align: center; }
.tabs b:empty { display: none; }
.who { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* Przyciski */
.primary, .ghost, .danger, .chip {
  border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost { background: transparent; border-color: var(--line); }
.ghost:hover { border-color: var(--muted); }
.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Formularze */
label { display: block; margin: 0 0 14px; font-weight: 600; font-size: 14px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; }
input:not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-weight: 400;
}
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.counter { float: right; font-weight: 400; color: var(--muted); }
.counter.over { color: var(--bad); font-weight: 600; }

/* Karty logowania */
.auth-card {
  max-width: 420px; margin: 8vh auto; padding: 32px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.auth-card h1 { margin: 0 0 16px; font-size: 22px; }
.auth-card .primary { width: 100%; margin-top: 4px; }
.auth-card .link { margin-top: 16px; display: inline-block; }
#enroll-qr { display: block; margin: 8px auto 16px; background: #fff; border-radius: 8px; padding: 8px; }

/* Pasek narzędzi */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar > input[type=search] { max-width: 320px; margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface); border-color: var(--line); font-size: 14px; padding: 6px 12px; }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip small { opacity: 0.7; margin-left: 4px; }
#refresh { margin-left: auto; }

/* Karty publikacji */
.cards { display: grid; gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: grid; grid-template-columns: 1fr 280px; gap: 24px;
}
.card-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.when { font-weight: 700; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.pillar { color: #fff; border: 0; }
.pillar.edukacja { background: var(--p-edukacja); }
.pillar.zaufanie { background: var(--p-zaufanie); }
.pillar.oferta { background: var(--p-oferta); }
@media (prefers-color-scheme: dark) { .pillar { color: #111; } }
.status { font-weight: 600; }
.status.do_akceptacji { color: var(--accent); border-color: var(--accent); }
.status.zaplanowana { color: var(--good); border-color: var(--good); }
.status.do_poprawy, .status.wstrzymana, .status.blad { color: var(--bad); border-color: var(--bad); }
.goal { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.caption { white-space: pre-wrap; margin: 0 0 12px; padding: 14px; background: var(--bg); border-radius: 8px; }
.meta { font-size: 14px; display: grid; gap: 6px; }
.meta dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.meta dd { margin: 0 0 8px; }
.kbref { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; cursor: help; }
.kbref.missing { border-color: var(--bad); color: var(--bad); }
.qa { padding: 10px 12px; border-radius: 8px; background: var(--bg); font-size: 14px; }
.qa.ok strong { color: var(--good); }
.qa.bad strong { color: var(--bad); }
.qa ul { margin: 6px 0 0; padding-left: 18px; }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px; border-radius: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* Kalendarz */
.week-nav { display: flex; align-items: center; gap: 10px; }
.mix { margin-left: auto; display: flex; gap: 14px; font-size: 14px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.mix i.dot.edukacja { background: var(--p-edukacja); }
.mix i.dot.zaufanie { background: var(--p-zaufanie); }
.mix i.dot.oferta { background: var(--p-oferta); }
.mix i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 220px; padding: 10px; }
.day.today { border-color: var(--accent); }
.day h3 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.tile { border-left: 4px solid var(--line); background: var(--bg); border-radius: 6px; padding: 8px; margin-bottom: 8px; font-size: 13px; cursor: pointer; width: 100%; text-align: left; border-top: 0; border-right: 0; border-bottom: 0; }
.tile.edukacja { border-left-color: var(--p-edukacja); }
.tile.zaufanie { border-left-color: var(--p-zaufanie); }
.tile.oferta { border-left-color: var(--p-oferta); }
.tile .t-time { font-weight: 700; }
.tile .t-goal { display: block; margin-top: 2px; }
.tile .t-status { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

/* Baza wiedzy */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.kb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kb th, table.kb td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.kb th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
table.kb tr.inactive td { opacity: 0.5; }
table.kb td:first-child { font-weight: 700; white-space: nowrap; }
table.kb td:last-child { text-align: right; }

/* Dialogi */
dialog {
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  background: var(--surface); color: var(--ink);
}
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
dialog h2 { margin: 0 0 12px; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* Komunikat */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; }
.toast.error { background: var(--bad); color: #fff; }

@media (max-width: 900px) {
  .card { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .grid2 { grid-template-columns: 1fr; }
  main { padding: 16px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .who { margin-left: 0; }
}

/* Instagram */
.ig-card { max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.ig-card h2 { margin: 0 0 12px; font-size: 20px; }
.ig-user { color: var(--accent); }
.ig-card .meta { margin-top: 16px; }

/* Wizualizacje */
dialog.wide { width: min(1240px, calc(100vw - 32px)); }
.cr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cr-form { margin: 16px 0 8px; padding: 16px; background: var(--bg); border-radius: var(--radius); }
.cr-form label { margin-bottom: 10px; }
.cr-gen { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cr-batch { margin-top: 24px; }
.cr-batch > h3 { font-size: 14px; color: var(--muted); font-weight: 600; margin: 0 0 10px; }
.cr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cr-concept { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); min-width: 0; }
.cr-concept.chosen { border: 2px solid var(--accent); padding: 13px; }
.cr-concept h4 { margin: 0; font-size: 15px; }
.cr-concept p { margin: 0; font-size: 13px; color: var(--muted); }
.cr-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.cr-strip button { flex: none; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: zoom-in; scroll-snap-align: start; overflow: hidden; }
.cr-strip img { display: block; width: 132px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.cr-strip.story img { aspect-ratio: 9 / 16; width: 110px; }
.cr-chosen-box { margin-top: 16px; padding: 16px; border: 2px solid var(--accent); border-radius: var(--radius); }
.cr-chosen-box.approved { border-color: var(--good); }
.cr-chosen-box .cr-strip img { width: 200px; }
.cr-chosen-box .cr-strip.story img { width: 160px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; }
.badge.good { color: var(--good); }
.badge.wait { color: var(--accent); }
.cr-thumbs { display: flex; gap: 4px; margin-top: 6px; }
.cr-thumbs img { width: 44px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
dialog.slide-view { width: auto; max-width: calc(100vw - 32px); padding: 16px; }
dialog.slide-view img { display: block; max-height: calc(100vh - 140px); max-width: 100%; margin: 0 auto; border-radius: 6px; }
dialog.slide-view .dialog-actions { align-items: center; }
dialog.slide-view #slide-alt { margin-right: auto; max-width: 60ch; }
@media (max-width: 900px) { .cr-grid { grid-template-columns: 1fr; } }

.cr-chosen-box.flash { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); transition: box-shadow .3s; }

.primary.armed { background: var(--bad); color: #fff; }

/* emoji w edytorze treści */
.emoji-wrap { position: relative; margin-top: -4px; }
.emoji-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.emoji-toggle { padding: 6px 12px; }
.emoji-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(380px, 100%); max-height: 300px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.emoji-pop[hidden] { display: none; }
.emoji-group + .emoji-group { margin-top: 8px; }
.emoji-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px; }
.emoji-btn { font-size: 22px; line-height: 1; padding: 6px 0; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.emoji-btn:hover, .emoji-btn:focus-visible { background: var(--bg); outline: none; }

/* wideo z Higgsfield */
.vd-job { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; }
.vd-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vd-shots { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.vd-video { display: block; width: 180px; aspect-ratio: 9 / 16; background: #000; border-radius: 8px; margin: 6px 0 2px; }

/* Studio Higgsfield */
.studio { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 24px; align-items: start; }
.studio-form { position: sticky; top: 72px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 96px); overflow: auto; }
.studio-form h2 { margin: 0; font-size: 18px; }
.studio-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.studio-form textarea, .studio-form select { width: 100%; }
.studio-form .grid2 { gap: 10px; }
.studio-form p { margin: 0; }
.st-source { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; background: var(--bg); }
.st-source.empty { border: 1px dashed var(--line); }
.st-source img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.st-source p { margin: 2px 0 4px; }
.studio-lib .toolbar { margin-bottom: 12px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.st-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.st-card.bad { border-color: var(--bad); }
.st-preview { aspect-ratio: 3 / 4; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.st-preview.tall { aspect-ratio: 9 / 16; max-height: 420px; }
.st-preview img, .st-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-zoom { padding: 0; border: 0; background: none; width: 100%; height: 100%; cursor: zoom-in; }
.st-placeholder { font-size: 28px; color: var(--muted); }
.st-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.st-body p { margin: 0; }
.st-body .actions { flex-wrap: wrap; }
.st-body details summary { cursor: pointer; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.btn-link { display: inline-block; text-decoration: none; color: inherit; border-radius: 8px; padding: 8px 14px; }
@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .studio-form { position: static; max-height: none; }
}
.studio-form label { margin: 0; }
.st-body .actions { gap: 6px; } .st-body .actions .ghost, .st-body .actions .primary, .st-body .actions .btn-link { padding: 6px 10px; font-size: 13px; }

/* Kalendarz: tydzień / miesiąc */
:root { --st-szkic: #9b968d; --st-akc: #d8a019; --st-ok: #2f8a57; --st-pub: #2f6fb3; --st-popr: #9b968d; --st-bad: #b3261e; }
@media (prefers-color-scheme: dark) { :root { --st-akc: #e7b54a; --st-ok: #6cc591; --st-pub: #6fa8e8; --st-bad: #f08a82; } }
.st-szkic, .st-do_kontroli { --st: var(--st-szkic); }
.st-do_akceptacji { --st: var(--st-akc); }
.st-zaplanowana { --st: var(--st-ok); }
.st-publikowanie, .st-opublikowana { --st: var(--st-pub); }
.st-do_poprawy, .st-wstrzymana { --st: var(--st-popr); }
.st-blad { --st: var(--st-bad); }
.toast.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--st-akc); }

.cal-toolbar { gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 7px 14px; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--ink); color: var(--bg); }
.cal-gaps { color: var(--warn-ink); background: var(--warn-bg); border-radius: 99px; padding: 2px 10px; font-size: 13px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: -4px 0 12px; align-items: center; }
.cal-legend i.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--st); }
.cal-legend i.lg.slot { background: none; border: 1.5px dashed var(--muted); }
.cal-hint { margin-left: auto; }

.cal-week, .cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 300px; display: flex; flex-direction: column; gap: 8px; transition: background .12s, border-color .12s; }
.cal-month .cal-day { min-height: 118px; padding: 6px; gap: 4px; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.past { background: color-mix(in srgb, var(--surface) 60%, var(--bg)); }
.cal-day.outside { opacity: .45; }
.cal-day.drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.cal-day-head strong { color: var(--ink); }
.cal-today { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 8px; font-size: 11px; font-weight: 600; text-transform: none; }
.cal-daynum { border: 0; background: none; padding: 0 4px; font-weight: 600; color: var(--ink); cursor: pointer; border-radius: 4px; }
.cal-daynum:hover { background: var(--bg); }
.cal-wd { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px; }
.cal-items { display: flex; flex-direction: column; gap: 8px; }
.cal-month .cal-items { flex-direction: row; flex-wrap: wrap; gap: 4px; }

.cal-tile { display: flex; flex-direction: column; gap: 5px; border-radius: 8px; padding: 4px; background: var(--bg); border: 1px solid transparent; border-top: 3px solid var(--st, var(--line)); cursor: grab; }
.cal-tile.open { border-color: var(--accent); border-top-color: var(--st); }
.cal-tile.dragging { opacity: .4; }
.cal-tile[draggable="false"], .cal-tile:not([draggable]) { cursor: default; }
.cal-thumb { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 6px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface); cursor: pointer; }
.cal-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.cal-empty-thumb { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; border: 1.5px dashed var(--line); border-radius: 6px; }
.cal-meta { position: absolute; left: 4px; bottom: 4px; background: rgb(22 18 15 / .72); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 99px; }
.cal-flag { position: absolute; right: 4px; top: 4px; background: var(--warn-bg); color: var(--warn-ink); font-size: 10px; padding: 0 6px; border-radius: 99px; }
.cal-status { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; line-height: 1.2; }
.cal-status i { width: 7px; height: 7px; border-radius: 99px; background: var(--st); flex: none; }
.cal-act { padding: 4px 8px !important; font-size: 12px; width: 100%; }
.cal-mini { width: 34px; height: 42px; padding: 0; border: 0; border-bottom: 3px solid var(--st); border-radius: 4px; overflow: hidden; background: var(--bg); cursor: pointer; font-size: 11px; color: var(--muted); }
.cal-mini img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.cal-slot { border: 1.5px dashed var(--line); background: transparent; border-radius: 8px; padding: 10px 6px; cursor: pointer; color: var(--muted); text-align: center; }
.cal-slot:hover { border-color: var(--accent); color: var(--accent); }
.cal-slot strong { display: block; font-size: 13px; }
.cal-slot small { font-size: 11px; }
.cal-slot.mini { width: 34px; height: 42px; padding: 0; font-size: 16px; }

/* Panel boczny */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgb(0 0 0 / .12); z-index: 20; display: flex; flex-direction: column; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-body { padding: 16px 18px 40px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.drawer-body .card.in-drawer { display: block; border: 0; padding: 0; background: none; box-shadow: none; }
.drawer-body .card.in-drawer .meta { margin-top: 16px; }
.drawer-body .cr-strip img { width: 150px; }
.drawer-hero { width: 100%; border-radius: 8px; }
.drawer-move { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 10px; background: var(--bg); border-radius: 8px; }
.drawer-move label { margin: 0; flex: 1; min-width: 200px; }
.drawer-move p { flex-basis: 100%; margin: 0; }
body.drawer-open main { margin-right: min(520px, 100vw); max-width: none; }
@media (max-width: 1280px) { body.drawer-open main { margin-right: 0; } }

@media (max-width: 760px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-week .cal-day { min-height: 0; }
  .cal-week .cal-items { flex-direction: row; flex-wrap: wrap; }
  .cal-week .cal-tile, .cal-week .cal-slot { width: calc(50% - 4px); }
  .cal-month { gap: 3px; }
  .cal-month .cal-day { min-height: 70px; padding: 3px; }
  .cal-mini, .cal-slot.mini { width: 22px; height: 28px; }
  .cal-hint { display: none; }
  .cal-tile { cursor: default; }
}
.drawer-head h2::first-letter { text-transform: uppercase; }
body.drawer-open .toast { left: calc((100vw - min(520px, 100vw)) / 2); max-width: calc(100vw - min(520px, 100vw) - 32px); z-index: 30; }
.cal-meta { white-space: nowrap; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; }
.drawer-slides { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.drawer-slides button { flex: none; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: none; cursor: zoom-in; scroll-snap-align: start; }
.drawer-slides img { display: block; width: 220px; aspect-ratio: 4 / 5; object-fit: cover; }
.drawer-slides.story img { width: 180px; aspect-ratio: 9 / 16; }
@media (max-width: 760px) {
  .cal-week .cal-tile { width: 100%; flex-direction: row; align-items: center; gap: 10px; }
  .cal-week .cal-thumb { width: 64px; flex: none; }
  .cal-week .cal-meta { display: none; }
  .cal-week .cal-status { flex: 1; font-size: 13px; }
  .cal-week .cal-act { width: auto; }
  .cal-week .cal-slot { width: 100%; text-align: left; }
  .cal-week .cal-slot strong, .cal-week .cal-slot small { display: inline; margin-right: 6px; }
  body.drawer-open .toast { left: 50%; max-width: calc(100vw - 32px); }
}
.cal-mobile-meta { display: none; }
@media (max-width: 760px) { .cal-mobile-meta { display: inline; color: var(--ink); font-weight: 600; } }
.drawer-body > * { flex-shrink: 0; }

/* Studio: poprawa wizualizacji */
.rv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rv-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.rv-slide { position: relative; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: var(--bg); cursor: pointer; }
.rv-slide img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.rv-slides.story .rv-slide img { aspect-ratio: 9 / 16; }
.rv-slide.sel { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.rv-num { position: absolute; left: 4px; top: 4px; background: rgb(22 18 15 / .72); color: #fff; font-size: 11px; padding: 0 6px; border-radius: 99px; }
.rv-slide.sel .rv-num { background: var(--accent); color: var(--accent-ink); }
.rv-h { margin: 0 0 8px; font-size: 16px; }
.studio-lib .cr-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Ustawienia: rytm publikacji */
.cad-card { max-width: 860px; }
.cad-card label input { width: 100%; }
.cad-preview { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 6px 0 8px; }
.cad-day { border: 1px solid var(--line); border-radius: 6px; padding: 4px; min-height: 64px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); }
.cad-day.today { border-color: var(--accent); }
.cad-day.past { opacity: .5; }
.cad-num { font-size: 12px; color: var(--muted); }
.cad-mark { font-size: 11px; border-radius: 99px; padding: 0 6px; text-align: center; border: 1px solid transparent; }
.cad-mark.ok { background: color-mix(in srgb, var(--st-ok) 18%, transparent); color: var(--ink); border-color: var(--st-ok); }
.cad-mark.gap { border: 1.5px dashed var(--muted); color: var(--muted); }
.cad-mark.off { background: var(--warn-bg); color: var(--warn-ink); }
.cad-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* story do ręcznej publikacji (naklejka z linkiem) */
.manual-box { border: 1px dashed var(--line, #d9d6cf); border-radius: 10px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 6px; }
.manual-box.on { border-style: solid; border-color: var(--accent); }
.manual-switch { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.manual-box input[type="url"]:disabled { opacity: .55; }
.cal-flag.manual { background: var(--line, #e7e3db); color: inherit; }
.cal-flag.due { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* Studio: przeznaczenie materiału w bibliotece; wolne miejsce: materiał z biblioteki */
.st-target { display: grid; gap: 6px; margin: 4px 0 8px; }
.st-target .lbl { font-weight: 600; font-size: 14px; }
.slot-asset { display: grid; gap: 6px; }
.slot-asset img, .slot-asset video { max-width: 160px; max-height: 220px; border-radius: 8px; object-fit: cover; }

/* ===== UX 14.10: panel posta w 3 krokach, okno „Grafika posta”, Studio inspiracji ===== */
.cost { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.cost.free { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.cost.paid { background: var(--warn-bg); color: var(--warn-ink); }
.cost.free::before { content: "●"; font-size: 8px; }
.cost.paid::before { content: "$"; }

/* następny krok */
.next-box { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); display: grid; gap: 6px; }
.next-box p { margin: 0; }
.next-box .actions { margin: 4px 0 0; }
.next-head { display: flex; flex-direction: column; gap: 2px; }
.next-k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.next-head strong { font-size: 17px; }
.next-box.tone-warn { border-left-color: var(--st-akc); background: var(--warn-bg); }
.next-box.tone-bad { border-left-color: var(--bad); }
.next-box.tone-ok, .next-box.tone-done { border-left-color: var(--good); }
.next-box.tone-busy, .next-box.tone-off { border-left-color: var(--muted); }
.next-box.tone-manual { border-left-color: var(--st-pub); }
.next-line { margin: 6px 0 2px; font-size: 14px; }
.next-line.tone-todo strong, .next-line.tone-warn strong { color: var(--accent); }
.next-line.tone-bad strong { color: var(--bad); }

/* etapy */
.steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; }
.steps li { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 6px 8px; border-radius: 8px; background: var(--bg); }
.steps .n { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); flex: none; }
.steps li.ok { color: var(--good); }
.steps li.ok .n { background: var(--good); border-color: var(--good); color: var(--surface); }
.steps li.on { color: var(--ink); font-weight: 600; outline: 2px solid var(--accent); outline-offset: -2px; }
.steps li.on .n { border-color: var(--accent); color: var(--accent); }

/* sekcje panelu posta */
.ws-sec { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.ws-sec > h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ws-sec > h3 .n { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--surface); display: inline-grid; place-items: center; font-size: 12px; }
.ws-sec .caption { margin: 0; }
.ws-sec p { margin: 0; }
.ws-sec .actions { margin: 0; }
.gfx-options { display: grid; gap: 8px; }
.gfx-opt { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.gfx-opt:hover { border-color: var(--accent); }
.gfx-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gfx-opt strong { grid-column: 1; }
.gfx-opt .small { grid-column: 1; }
.gfx-opt .cost { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
details.more { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
details.more > summary { cursor: pointer; font-size: 14px; font-weight: 600; }
details.more[open] > summary { margin-bottom: 8px; }
details.more .manual-box { margin: 0; border: 0; padding: 0; }

/* okno „Grafika posta” */
.gfx-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.gfx-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-size: 14px; }
.gfx-tab.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.gfx-tab.active .cost.free { background: color-mix(in srgb, var(--surface) 20%, transparent); color: var(--surface); }
.gfx-tab:disabled { opacity: .45; cursor: not-allowed; }
.studio.in-dialog { grid-template-columns: minmax(280px, 380px) 1fr; }
@media (max-width: 860px) { .studio.in-dialog { grid-template-columns: 1fr; } }
.cr-gen { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Studio inspiracji */
.studio-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 auto 16px; max-width: 1200px; }
.studio-nav-btn { display: grid; text-align: left; gap: 2px; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.studio-nav-btn.active { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }
.insp-form .chk { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; margin: 0 10px 0 0; font-weight: 400; }
.insp-prev { display: flex; align-items: center; gap: 10px; }
.insp-prev img { max-width: 140px; max-height: 140px; border-radius: 8px; object-fit: cover; }
.insp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.insp-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.insp-card.off { opacity: .6; }
.insp-card .st-zoom img { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.insp-body { padding: 10px 12px; display: grid; gap: 6px; }
.insp-body p { margin: 0; word-break: break-word; }
.danger-link { color: var(--bad); }
.insp-form .chk { display: inline-flex !important; flex-direction: row; align-items: center; gap: 6px; margin: 0 14px 0 0; font-weight: 400; }
.insp-form .chk input { width: auto; margin: 0; }
.actions .cost { align-self: center; }

/* poprawka: osobne uwagi do slajdów */
.rv-slide .rv-noted { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 11px; }
.rv-slide.noted { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.rv-slide.sel { border-color: var(--accent); }
.chip.noted { border-color: var(--accent); }
.rv-notes { margin: 0; padding: 8px 10px; list-style: none; background: var(--bg); border-radius: 8px; display: grid; gap: 4px; font-size: 13px; }
.rv-notes li.cur { font-weight: 600; }
.rv-notes .link { padding: 0; font-size: 13px; }

/* ===== 14.10 wieczór: format na kafelku, ulubione, horyzont propozycji ===== */
:root { --f-post: #2f6fb3; --f-karuzela: #7b4bb7; --f-story: #d4537a; --f-reels: #1f1d1a; }
@media (prefers-color-scheme: dark) { :root { --f-post: #6fa8e8; --f-karuzela: #b58ce8; --f-story: #ef8fb0; --f-reels: #eeebe5; } }
.fmt { display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 99px; color: #fff; background: var(--f-post); line-height: 1.5; white-space: nowrap; }
.fmt-karuzela { background: var(--f-karuzela); }
.fmt-story { background: var(--f-story); }
.fmt-reels { background: var(--f-reels); color: var(--surface); }
.cal-thumb { position: relative; }
.cal-thumb > .fmt { position: absolute; left: 4px; top: 4px; box-shadow: 0 1px 3px rgb(0 0 0 / .25); }
.cal-mini { position: relative; }
.fmt.mini { position: absolute; left: 2px; top: 2px; padding: 0 4px; font-size: 9px; }
.fav-mini { position: absolute; right: 2px; top: 0; color: #e0a800; font-size: 12px; text-shadow: 0 0 2px #000; }
.fav { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 4px; color: var(--muted); }
.fav.on { color: #e0a800; }
.fav:hover { color: #e0a800; }
.fav:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.cal-status { display: flex; align-items: center; gap: 4px; }
.cal-status .cal-fav { margin-left: auto; font-size: 16px; padding: 0 2px; }
.ws-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ws-fav { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.fmt-legend { display: inline-flex; gap: 4px; }
.cal-horizon { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 99px; padding: 2px 10px; }
.cal-day.beyond { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--line) 45%, transparent) 8px 9px); }
.cal-thumb > .cal-flag { right: auto; left: 4px; top: 26px; }
.cal-status { min-width: 0; }
.cal-status .cal-status-txt { flex: 1; min-width: 0; }
.cal-status .cal-fav { flex: none; }

/* Wytyczne dla agenta */
#view-guidelines { max-width: 1240px; margin: 0 auto; }
.g-intro { margin-bottom: 16px; }
.g-intro h2 { margin: 0 0 6px; }
.g-intro p { margin: 4px 0; max-width: 900px; }
.g-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .g-layout { grid-template-columns: 1fr; } }
.g-sections { display: grid; gap: 12px; }
.g-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.g-card h3 { margin: 0; font-size: 16px; }
.g-card p { margin: 0; }
.g-card textarea { width: 100%; font: inherit; line-height: 1.5; }
.g-card .actions { margin: 0; align-items: center; }
.g-files { display: grid; gap: 12px; position: sticky; top: 12px; }
.g-file-list { display: grid; gap: 12px; }
.g-file { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: 72px 1fr; gap: 12px; }
.g-file.off { opacity: .6; }
.g-thumb { width: 72px; height: 92px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; font-weight: 800; color: var(--muted); overflow: hidden; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-file-body { display: grid; gap: 6px; min-width: 0; }
.g-file-body p { margin: 0; }
.g-file-body textarea { width: 100%; font: inherit; font-size: 14px; }
.badge.bad { color: var(--bad); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.chk input { width: auto; margin: 0; }
.g-file-body .actions { gap: 6px; margin: 0; }
.g-file-body .actions .ghost, .g-file-body .actions .primary { padding: 6px 10px; font-size: 13px; }
.g-file-body textarea { min-height: 120px; }

/* rodzaj publikacji: foto (15.10.2026) */
.fmt.fmt-foto { box-shadow: inset 0 0 0 2px #B4E23A; }
.cal-slot.foto { border-color: #8fb82a; }
.visual-switch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.st-upload { display: grid; gap: 8px; padding: 12px; margin-bottom: 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.st-upload h2 { margin: 0; }
.st-upload input[type=file] { font: inherit; }
.mix-grid input { max-width: 120px; }
label.check, .studio-form label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; }
.tag.ok-tag { background: #eef7d6; border-color: #b4e23a; color: #3a3c1f; }
.design-pick { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.design-pick summary { cursor: pointer; }
.design-pick label { margin: 6px 0; }
.design-pick select { width: 100%; }
.danger.armed { background: var(--bad); color: #fff; }
.post-options textarea { width: 100%; }
.cal-opts { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px 6px 6px; }
.cal-opt { font-size: 11px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink, inherit); cursor: pointer; line-height: 1.3; }
.cal-opt:hover { border-color: var(--muted); }
.cal-opt.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.cal-opt.armed { background: var(--bad); color: #fff; border-color: var(--bad); }
.cal-opt:disabled { opacity: .5; cursor: default; }

/* podgląd publikacji jak na Instagramie */
.ig-preview { border: none; border-radius: 16px; padding: 0; max-width: min(460px, 96vw); width: 100%; background: var(--surface); }
.ig-preview::backdrop { background: rgba(22,18,15,.6); }
.igp-wrap { padding: 14px; display: grid; gap: 10px; max-height: 92vh; overflow: auto; }
.igp-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.igp-vers { margin: 0; }
.igp-post { background: #fff; color: #111; border: 1px solid #dbdbdb; border-radius: 8px; overflow: hidden; font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.igp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.igp-head .igp-more { margin-left: auto; color: #555; letter-spacing: 1px; }
.igp-ava { width: 30px; height: 30px; border-radius: 50%; flex: none; background: #B4E23A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ctext x='15' y='20' font-size='14' font-weight='800' text-anchor='middle' font-family='Arial' fill='%2316120F'%3Ed%3C/text%3E%3C/svg%3E") center/cover; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #d62976; }
.igp-media { position: relative; background: #efefef; aspect-ratio: 4 / 5; }
.igp-media.story { aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; }
.igp-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.igp-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #777; padding: 20px; text-align: center; }
.igp-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255,255,255,.9); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); padding: 0; }
.igp-nav.prev { left: 8px; } .igp-nav.next { right: 8px; }
.igp-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.igp-actions { display: flex; align-items: center; gap: 14px; padding: 8px 12px 4px; font-size: 22px; position: relative; }
.igp-actions .igp-save { margin-left: auto; }
.igp-dots { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.igp-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c7c7c7; }
.igp-dots i.on { background: #0095f6; }
.igp-cap { padding: 4px 12px 2px; white-space: pre-wrap; word-break: break-word; }
.igp-time { margin: 0; padding: 4px 12px 12px; font-size: 10px; color: #737373; letter-spacing: .03em; }
.igp-story { position: relative; background: #000; border-radius: 12px; padding: 8px; color: #fff; font: 13px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.igp-bars { display: flex; gap: 3px; margin-bottom: 6px; }
.igp-bars i { flex: 1; height: 2px; background: rgba(255,255,255,.45); border-radius: 2px; }
.igp-bars i.on { background: #fff; }
.igp-shead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.igp-shead .muted { color: rgba(255,255,255,.7); }
.igp-sfoot { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 16px; }
.igp-sfoot span:first-child { flex: 1; border: 1px solid rgba(255,255,255,.6); border-radius: 99px; padding: 6px 12px; font-size: 13px; }
.small-btn { font-size: 12px; padding: 3px 9px; }

/* „+ Dodaj” w kalendarzu */
.add-menu { position: relative; display: inline-block; }
.add-menu-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(22,18,15,.18); padding: 6px; display: grid; gap: 2px; }
.add-menu-list[hidden] { display: none; }
.add-menu-list button { display: grid; gap: 2px; text-align: left; background: transparent; border: none; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.add-menu-list button:hover, .add-menu-list button:focus-visible { background: var(--bg); }
.cal-add-wrap { margin-top: auto; }
.cal-add-day { width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 8px; cursor: pointer; font-weight: 600; }
.cal-add-day:hover, .cal-add-day[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.cal-add-wrap.mini .cal-add-day { padding: 2px; font-size: 12px; }
.cal-add-wrap .add-menu-list { top: auto; bottom: calc(100% + 6px); }
.cal-week .cal-day:nth-child(n+5) .add-menu-list, .cal-month .cal-day:nth-child(7n) .add-menu-list, .cal-month .cal-day:nth-child(7n+6) .add-menu-list { left: auto; right: 0; }

/* kreator stories (IGS) i warianty */
.wiz-steps { margin: 0 0 4px; }
.wiz-types { display: grid; gap: 10px; }
.wiz-type { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; color: inherit; }
.wiz-type:hover, .wiz-type:focus-visible { border-color: var(--accent); }
.wiz-type.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wiz-type-txt { display: grid; gap: 3px; }
.wiz-type-txt strong { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wiz-who { color: var(--accent); }
.wiz-mock { position: relative; display: block; width: 56px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: #c9b79c; border: 1px solid var(--line); }
.wiz-mock i { position: absolute; display: block; }
.wiz-mock.m-full, .wiz-mock.m-custom { background: linear-gradient(160deg, #d9a35b, #7f9f6b 60%, #3d5a4a); }
.wiz-mock.m-full .a, .wiz-mock.m-custom .a { left: 6px; top: 9px; width: 34px; height: 6px; background: #c6f432; box-shadow: 0 8px 0 #c6f432; }
.wiz-mock.m-full .b, .wiz-mock.m-custom .b { left: 5px; right: 5px; bottom: 7px; height: 22px; background: #f6efe3; border-radius: 4px; }
.wiz-mock.m-full .c, .wiz-mock.m-custom .c { display: none; }
.wiz-mock.m-custom::after { content: "Ty"; position: absolute; right: 3px; top: 3px; font-size: 9px; font-weight: 700; background: #16120f; color: #fff; border-radius: 4px; padding: 0 3px; }
.wiz-mock.m-ramka { background: #16120f; }
.wiz-mock.m-ramka .a { left: 5px; right: 5px; top: 8px; height: 40px; border-radius: 5px; background: linear-gradient(160deg, #d9a35b, #7f9f6b); }
.wiz-mock.m-ramka .b { left: 6px; top: 54px; width: 36px; height: 6px; background: #fff; box-shadow: 0 9px 0 #c6f432; }
.wiz-mock.m-ramka .c { left: 6px; bottom: 9px; width: 30px; height: 3px; background: #8a8178; }
.wiz-mock.m-grafika { background: #c6f432; }
.wiz-mock.m-grafika .a { left: 6px; top: 38px; width: 38px; height: 7px; background: #16120f; box-shadow: 0 10px 0 #16120f; }
.wiz-mock.m-grafika .b { left: 6px; top: 58px; width: 28px; height: 7px; background: #16120f; }
.wiz-mock.m-grafika .c { right: 6px; bottom: 10px; width: 18px; height: 4px; background: #16120f; }
.wiz-chosen { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.wiz-chosen .wiz-mock { width: 40px; }
.wiz-chosen p { margin: 2px 0 0; }
.wiz-seg { display: flex; flex-wrap: wrap; margin-top: 6px; }
.wiz-seg button { flex: 1 1 auto; border: 0; background: var(--surface); padding: 8px 12px; cursor: pointer; font: inherit; font-size: 14px; }
.wiz-seg button + button { border-left: 1px solid var(--line); }
.wiz-seg button.active { background: var(--ink); color: var(--bg); }
.wiz-seg button:disabled { opacity: .5; cursor: default; }
.wiz-photo { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: start; }
.wiz-photo img, .wiz-photo-empty { width: 110px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: var(--bg); border: 1px dashed var(--line); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.wiz-photo-side { display: grid; gap: 6px; }
.wiz-photo-side p { margin: 0; }
.igs-switch { display: grid; gap: 4px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.igs-switch p { margin: 2px 0 0; }
.mix-block { display: grid; gap: 4px; margin: 6px 0; }
.mix-row { display: grid; grid-template-columns: repeat(3, minmax(0, 140px)); gap: 12px; }
@media (max-width: 560px) { .mix-row { grid-template-columns: 1fr 1fr; } .wiz-photo { grid-template-columns: 1fr; } }

/* FTG: przestrzenie i zespół */
.ws-switch { display: inline-flex; align-items: center; margin-right: 10px; }
.ws-switch select { padding: 4px 8px; font-size: 14px; }
.team-list { display: grid; gap: 8px; margin: 8px 0 4px; }
.team-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.team-actions { display: flex; gap: 8px; align-items: center; }
.team-actions select { padding: 4px 8px; }
.invite-form { display: grid; grid-template-columns: 1fr 160px auto; gap: 12px; align-items: end; }
.invite-link { display: flex; gap: 8px; }
.invite-link input { flex: 1; font-size: 13px; }
@media (max-width: 560px) { .invite-form { grid-template-columns: 1fr; } .team-row { flex-direction: column; align-items: flex-start; } }
