/* Panel Treści Fornalik — style z zatwierdzonego prototypu */
/* ================= TOKENY — ciemny domyślny ================= */
  :root {
    color-scheme: dark;
    --bg:#0A0F14; --surface:#121A21; --surface-2:#1A242D; --surface-3:#22303B;
    --border:#26333F; --border-soft:#1D2831;
    --text:#E8F0F5; --text-2:#A7B8C4; --muted:#778B99;
    --teal:#2DD4BF; --pink:#F472B6; --pink-dim:#b93f7f; --blue:#6AA6FF;
    --grad:linear-gradient(118deg,#2DD4BF 0%,#58b8d8 42%,#F472B6 100%);
    --grad-soft:linear-gradient(118deg,rgba(45,212,191,.16) 0%,rgba(244,114,182,.16) 100%);
    --ok:#34D399; --warn:#FBBF24; --danger:#F87171;
    --on-grad:#06121A;
    --shadow:0 18px 40px -22px rgba(0,0,0,.9);
    --ring:0 0 0 3px rgba(45,212,191,.28);
    --r-sm:8px; --r:12px; --r-lg:18px;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
      color-scheme: light;
      --bg:#F4F7F9; --surface:#FFFFFF; --surface-2:#F0F4F7; --surface-3:#E5ECF1;
      --border:#DCE5EB; --border-soft:#E9EFF3;
      --text:#0D1720; --text-2:#465765; --muted:#6C7E8C;
      --teal:#0E9384; --pink:#DB2777; --pink-dim:#f3a9ca; --blue:#2563EB;
      --grad:linear-gradient(118deg,#0E9384 0%,#3b91b5 42%,#DB2777 100%);
      --grad-soft:linear-gradient(118deg,rgba(14,147,132,.11) 0%,rgba(219,39,119,.11) 100%);
      --ok:#0F9D58; --warn:#B45309; --danger:#DC2626;
      --on-grad:#FFFFFF;
      --shadow:0 14px 32px -20px rgba(13,23,32,.38);
      --ring:0 0 0 3px rgba(14,147,132,.22);
    }
  }
  :root[data-theme="light"] {
    color-scheme: light;
    --bg:#F4F7F9; --surface:#FFFFFF; --surface-2:#F0F4F7; --surface-3:#E5ECF1;
    --border:#DCE5EB; --border-soft:#E9EFF3;
    --text:#0D1720; --text-2:#465765; --muted:#6C7E8C;
    --teal:#0E9384; --pink:#DB2777; --pink-dim:#f3a9ca; --blue:#2563EB;
    --grad:linear-gradient(118deg,#0E9384 0%,#3b91b5 42%,#DB2777 100%);
    --grad-soft:linear-gradient(118deg,rgba(14,147,132,.11) 0%,rgba(219,39,119,.11) 100%);
    --ok:#0F9D58; --warn:#B45309; --danger:#DC2626;
    --on-grad:#FFFFFF;
    --shadow:0 14px 32px -20px rgba(13,23,32,.38);
    --ring:0 0 0 3px rgba(14,147,132,.22);
  }

  * { box-sizing:border-box; }
  html, body { height:100%; }
  body {
    margin:0; background:var(--bg); color:var(--text);
    font-family:"Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size:15px; line-height:1.5; -webkit-font-smoothing:antialiased;
  }
  h1,h2,h3 { font-family:"Sora","Plus Jakarta Sans",ui-sans-serif,system-ui,sans-serif; margin:0; text-wrap:balance; letter-spacing:-.015em; }
  button,input,select,textarea { font:inherit; color:inherit; }
  :focus-visible { outline:none; box-shadow:var(--ring); border-radius:var(--r-sm); }
  .num { font-variant-numeric:tabular-nums; }
  .spacer { flex:1 1 auto; }

  /* ================= SZKIELET ================= */
  .app { display:grid; grid-template-columns:1fr; min-height:100%; }
  .sidebar { display:none; }
  .col { min-width:0; display:flex; flex-direction:column; }

  .topbar {
    position:sticky; top:env(safe-area-inset-top,0px); z-index:30;
    display:flex; align-items:center; gap:12px; padding:12px 16px;
    background:var(--bg);
    background:color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter:blur(14px); border-bottom:1px solid var(--border-soft);
  }
  .brand { display:flex; align-items:center; gap:10px; min-width:0; }
  .brand-mark {
    width:30px; height:30px; border-radius:9px; flex:none; background:var(--grad);
    display:grid; place-items:center; font-family:"Sora",sans-serif; font-weight:700; font-size:13px; color:var(--on-grad);
  }
  .brand-name { font-family:"Sora",sans-serif; font-weight:600; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .brand-sub { font-size:11px; color:var(--muted); letter-spacing:.04em; text-transform:uppercase; }
  .brand-ver { display:inline-block; margin-left:4px; padding:0 5px; border-radius:6px;
    background:var(--surface-3); color:var(--text-2); font-size:10px; letter-spacing:.02em; text-transform:none; }

  .icon-btn {
    width:36px; height:36px; flex:none; display:grid; place-items:center;
    background:var(--surface-2); border:1px solid var(--border); border-radius:10px;
    cursor:pointer; color:var(--text-2); transition:color .15s, border-color .15s;
  }
  .icon-btn:hover { color:var(--text); border-color:var(--teal); }
  .icon-btn svg { width:17px; height:17px; }

  main { flex:1 1 auto; padding:18px 16px 104px; }
  .wrap { max-width:1120px; margin:0 auto; }

  .view-head { margin-bottom:18px; }
  .view-head h1 { font-size:21px; font-weight:600; }
  .view-head p { margin:5px 0 0; color:var(--muted); font-size:13.5px; }

  /* ================= DOLNY PASEK ================= */
  .tabbar {
    position:fixed; left:0; right:0; bottom:0; z-index:40;
    display:grid; grid-template-columns:repeat(5,1fr); align-items:end;
    background:var(--surface);
    background:color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter:blur(16px); border-top:1px solid var(--border);
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  .tab {
    appearance:none; background:none; border:0; cursor:pointer;
    display:flex; flex-direction:column; align-items:center; gap:3px;
    padding:9px 2px 8px; color:var(--muted); font-size:10px; font-weight:600; position:relative;
  }
  .tab svg { width:21px; height:21px; }
  .tab[aria-selected="true"] { color:var(--teal); }
  .tab[aria-selected="true"]::before {
    content:""; position:absolute; top:0; left:50%; transform:translateX(-50%);
    width:26px; height:2.5px; border-radius:0 0 3px 3px; background:var(--grad);
  }
  .tab .dot {
    position:absolute; top:5px; right:50%; margin-right:-18px;
    min-width:16px; height:16px; padding:0 4px; border-radius:9px; background:var(--pink);
    color:#fff; font-size:9.5px; line-height:16px; font-weight:700; text-align:center;
  }
  .tab-fab { padding-top:0; }
  .tab-fab .fab {
    width:46px; height:46px; border-radius:15px; background:var(--grad);
    display:grid; place-items:center; color:var(--on-grad);
    box-shadow:0 8px 18px -8px rgba(45,212,191,.7); margin-bottom:2px;
  }
  .tab-fab .fab svg { width:23px; height:23px; }
  .tab-fab::before { display:none !important; }

  /* ================= WSPÓLNE ================= */
  .card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:16px; }
  .stack { display:flex; flex-direction:column; gap:12px; }
  .row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

  .chip {
    display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:700;
    letter-spacing:.03em; padding:3px 9px; border-radius:999px; border:1px solid transparent; white-space:nowrap;
  }
  .chip.fb { color:var(--blue); background:color-mix(in srgb,var(--blue) 14%, transparent); border-color:color-mix(in srgb,var(--blue) 34%, transparent); }
  .chip.ig { color:var(--pink); background:color-mix(in srgb,var(--pink) 14%, transparent); border-color:var(--pink-dim); }
  .chip.n  { color:var(--text-2); background:var(--surface-2); border-color:var(--border); font-weight:600; }

  .st { display:inline-flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; color:var(--text-2); white-space:nowrap; }
  .st::before { content:""; width:7px; height:7px; border-radius:99px; background:var(--muted); flex:none; }
  .st.plan::before { background:var(--teal); }
  .st.wait::before { background:var(--warn); }
  .st.done::before { background:var(--ok); }
  .st.err::before  { background:var(--danger); }

  .btn {
    appearance:none; cursor:pointer; border-radius:10px; padding:9px 15px;
    font-size:13.5px; font-weight:600; border:1px solid var(--border);
    background:var(--surface-2); color:var(--text);
    display:inline-flex; align-items:center; gap:7px; justify-content:center;
    transition:border-color .15s, transform .08s;
  }
  .btn:hover { border-color:var(--teal); }
  .btn:active { transform:translateY(1px); }
  .btn svg { width:15px; height:15px; }
  .btn-primary { background:var(--grad); color:var(--on-grad); border-color:transparent; font-weight:700; }
  .btn-ghost { background:transparent; }
  .btn-danger:hover { border-color:var(--danger); color:var(--danger); }
  .btn-block { width:100%; }
  .btn-sm { padding:6px 11px; font-size:12.5px; border-radius:9px; }

  label.f { display:block; font-size:12px; font-weight:700; color:var(--text-2); margin-bottom:6px; letter-spacing:.02em; }
  .inp, textarea.inp, select.inp {
    width:100%; background:var(--surface-2); border:1px solid var(--border);
    border-radius:var(--r); padding:10px 12px; font-size:14px;
  }
  textarea.inp { resize:vertical; min-height:150px; line-height:1.6; }
  .inp::placeholder { color:var(--muted); }

  .toggle { cursor:pointer; user-select:none; border:1px solid var(--border); background:var(--surface-2);
    border-radius:10px; padding:8px 13px; font-size:13px; font-weight:600; display:inline-flex; align-items:center; gap:8px; }
  .toggle input { position:absolute; opacity:0; width:0; height:0; }
  .toggle .box { width:15px; height:15px; border-radius:4px; border:1.5px solid var(--muted); display:grid; place-items:center; flex:none; }
  .toggle .box svg { width:10px; height:10px; opacity:0; color:var(--on-grad); }
  .toggle:has(input:checked) { border-color:var(--teal); background:var(--grad-soft); }
  .toggle:has(input:checked) .box { background:var(--teal); border-color:var(--teal); }
  .toggle:has(input:checked) .box svg { opacity:1; }
  .toggle:has(input:focus-visible) { box-shadow:var(--ring); }

  .seg { display:inline-flex; background:var(--surface-2); border:1px solid var(--border); border-radius:11px; padding:3px; gap:3px; flex-wrap:wrap; }
  .seg button { appearance:none; border:0; background:none; cursor:pointer; padding:7px 13px; border-radius:8px; font-size:13px; font-weight:600; color:var(--muted); }
  .seg button[aria-pressed="true"] { background:var(--surface); color:var(--text); box-shadow:0 1px 3px rgba(0,0,0,.2); }

  .sec-title { font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin:0 0 9px 2px; }
  .hint { font-size:12.5px; color:var(--muted); line-height:1.5; }

  .empty { text-align:center; padding:44px 20px; }
  .empty-mark { width:58px; height:58px; margin:0 auto 14px; border-radius:17px; background:var(--grad-soft);
    border:1px solid var(--border); display:grid; place-items:center; color:var(--teal); }
  .empty-mark svg { width:25px; height:25px; }
  .empty h3 { font-size:16px; font-weight:600; margin-bottom:5px; }
  .empty p { color:var(--muted); font-size:13.5px; margin:0 auto 16px; max-width:34ch; }

  .toast {
    position:fixed; left:50%; transform:translateX(-50%) translateY(14px);
    bottom:calc(84px + env(safe-area-inset-bottom,0px)); z-index:90;
    background:var(--surface-3); border:1px solid var(--border); color:var(--text);
    padding:11px 16px; border-radius:12px; font-size:13.5px; font-weight:600;
    box-shadow:var(--shadow); display:flex; align-items:center; gap:9px;
    opacity:0; transition:opacity .22s, transform .22s; pointer-events:none; max-width:calc(100vw - 32px);
  }
  .toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
  .toast svg { width:16px; height:16px; color:var(--ok); flex:none; }

  /* ================= STATYSTYKI ================= */
  .stats { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:18px; }
  .stat { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:12px 14px; }
  .stat .k { font-size:11px; color:var(--muted); font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
  .stat .v { font-family:"Sora",sans-serif; font-size:22px; font-weight:600; margin-top:3px; letter-spacing:-.02em; }
  .stat .v small { font-size:12px; font-weight:500; color:var(--muted); font-family:"Plus Jakarta Sans",sans-serif; }

  /* ================= KALENDARZ ================= */
  .cal-bar { display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
  .cal-month { font-family:"Sora",sans-serif; font-size:16px; font-weight:600; }
  .cal-grid { display:none; }
  .agenda { display:flex; flex-direction:column; gap:18px; }
  .ag-day { display:flex; flex-direction:column; gap:9px; }
  .ag-date { display:flex; align-items:baseline; gap:8px; }
  .ag-date .d { font-family:"Sora",sans-serif; font-size:14px; font-weight:600; }
  .ag-date .w { font-size:12px; color:var(--muted); }
  .ag-date .today { font-size:10px; font-weight:700; letter-spacing:.05em; text-transform:uppercase;
    background:var(--grad); color:var(--on-grad); padding:2px 7px; border-radius:99px; }

  .post { background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
    padding:13px 14px; display:flex; gap:12px; align-items:flex-start; border-left:3px solid var(--border); }
  .post.plan { border-left-color:var(--teal); }
  .post.wait { border-left-color:var(--warn); }
  .post.done { border-left-color:var(--ok); }
  .post .body { min-width:0; flex:1 1 auto; }
  .post .meta { display:flex; align-items:center; gap:9px; flex-wrap:wrap; margin-bottom:5px; }
  .post .time { font-size:12px; font-weight:700; color:var(--text-2); }
  .post .txt { font-size:13.5px; color:var(--text-2); line-height:1.45;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .post .thumb { width:46px; height:46px; flex:none; border-radius:9px; background:var(--grad-soft);
    border:1px solid var(--border); display:grid; place-items:center; color:var(--teal); }
  .post .thumb svg { width:19px; height:19px; }

  .dow { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; margin-bottom:8px; }
  .dow span { font-size:10.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); text-align:center; }
  .grid7 { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
  .cell { background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--r);
    min-height:104px; padding:8px; display:flex; flex-direction:column; gap:5px; }
  .cell.out { background:transparent; border-color:transparent; }
  .cell .n { font-size:12px; font-weight:700; color:var(--muted); }
  .cell.is-today { border-color:var(--teal); }
  .cell.is-today .n { background:var(--grad); color:var(--on-grad); width:21px; height:21px;
    border-radius:99px; display:grid; place-items:center; font-size:11px; }
  .ev { font-size:11px; font-weight:600; padding:4px 6px; border-radius:6px; background:var(--surface-2);
    border-left:2.5px solid var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .ev.plan { border-left-color:var(--teal); }
  .ev.wait { border-left-color:var(--warn); }
  .ev.done { border-left-color:var(--ok); color:var(--muted); }

  /* ================= AKCEPTACJA ================= */
  .draft { display:flex; flex-direction:column; gap:13px; }
  .draft .content { background:var(--surface-2); border:1px solid var(--border-soft); border-radius:var(--r);
    padding:13px; font-size:13.5px; line-height:1.65; white-space:pre-wrap; color:var(--text-2);
    max-height:210px; overflow-y:auto; }
  .draft .acts { display:grid; grid-template-columns:1fr auto auto; gap:8px; }

  /* ================= BIBLIOTEKA ================= */
  .media-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:11px; }
  .media { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); overflow:hidden; cursor:pointer; }
  .media:hover { border-color:var(--teal); }
  .media .ph { aspect-ratio:4/3; display:grid; place-items:center; position:relative; color:var(--on-grad); }
  .media .ph svg { width:26px; height:26px; opacity:.85; }
  .media .badge-tl { position:absolute; top:7px; left:7px; background:rgba(4,12,18,.72); color:#fff;
    font-size:10px; font-weight:700; padding:2px 7px; border-radius:99px; backdrop-filter:blur(4px); }
  .media .badge-tr { position:absolute; top:7px; right:7px; background:rgba(4,12,18,.72); color:#fff;
    font-size:10px; font-weight:700; padding:2px 7px; border-radius:99px; backdrop-filter:blur(4px); }
  .media .info { padding:9px 10px; }
  .media .nm { font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .media .sub { font-size:11px; color:var(--muted); margin-top:2px; }
  .media .fmts { display:flex; gap:4px; margin-top:6px; flex-wrap:wrap; }
  .media .fmt { font-size:9.5px; font-weight:700; color:var(--teal); border:1px solid var(--border);
    background:var(--surface-2); padding:1px 5px; border-radius:5px; }
  .media .used { color:var(--ok); }
  .media .free { color:var(--warn); }

  .capture {
    border:1.5px dashed var(--border); border-radius:var(--r-lg); padding:18px; text-align:center;
    background:var(--surface-2); cursor:pointer; display:flex; align-items:center; gap:14px; text-align:left;
  }
  .capture:hover { border-color:var(--teal); }
  .capture .ic { width:44px; height:44px; flex:none; border-radius:13px; background:var(--grad);
    display:grid; place-items:center; color:var(--on-grad); }
  .capture .ic svg { width:21px; height:21px; }
  .capture .t { font-size:14px; font-weight:700; }
  .capture .s { font-size:12px; color:var(--muted); margin-top:2px; }

  /* ================= LISTY (pomysły, recykling, log) ================= */
  .lrow { background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
    padding:12px 14px; display:flex; align-items:flex-start; gap:12px; }
  .lrow .body { flex:1 1 auto; min-width:0; }
  .lrow .t { font-size:14px; font-weight:600; line-height:1.35; }
  .lrow .s { font-size:12px; color:var(--muted); margin-top:3px; }
  .lrow.err { border-left:3px solid var(--danger); }
  .lrow.warnrow { border-left:3px solid var(--warn); }
  .lrow.okrow { border-left:3px solid var(--ok); }
  .errtext { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11.5px; color:var(--danger);
    background:color-mix(in srgb,var(--danger) 10%, transparent); border-radius:6px; padding:5px 8px; margin-top:7px;
    white-space:pre-wrap; word-break:break-word; overflow-wrap:anywhere; }

  /* ================= SZABLONY ================= */
  .tpl-grid { display:grid; grid-template-columns:1fr; gap:11px; }
  .tpl { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:14px; cursor:pointer; }
  .tpl:hover { border-color:var(--teal); }
  .tpl .t { font-size:14px; font-weight:700; display:flex; align-items:center; gap:8px; }
  .tpl .t .ic { width:26px; height:26px; border-radius:8px; background:var(--grad-soft); border:1px solid var(--border);
    display:grid; place-items:center; color:var(--teal); flex:none; }
  .tpl .t .ic svg { width:14px; height:14px; }
  .tpl .s { font-size:12.5px; color:var(--muted); margin-top:7px; line-height:1.5; }
  .tags { display:flex; flex-wrap:wrap; gap:5px; margin-top:9px; }
  .tag { font-size:11px; font-weight:600; color:var(--text-2); background:var(--surface-2);
    border:1px solid var(--border-soft); border-radius:6px; padding:2px 7px; }

  /* ================= PLAN TYGODNIA ================= */
  .week { display:flex; flex-direction:column; gap:9px; }
  .wday { background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
    padding:12px 14px; display:flex; align-items:center; gap:12px; }
  .wday .dn { width:42px; flex:none; font-family:"Sora",sans-serif; font-size:13px; font-weight:700; text-transform:capitalize; }
  .wday .slot { flex:1 1 auto; min-width:0; font-size:13px; }
  .wday.free { border-style:dashed; }
  .wday.free .slot { color:var(--muted); font-style:italic; }

  /* ================= WIĘCEJ ================= */
  .menu { display:flex; flex-direction:column; gap:8px; }
  .mrow { background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
    padding:14px; display:flex; align-items:center; gap:13px; cursor:pointer; text-align:left;
    appearance:none; width:100%; }
  .mrow:hover { border-color:var(--teal); }
  .mrow .ic { width:36px; height:36px; flex:none; border-radius:11px; background:var(--grad-soft);
    border:1px solid var(--border); display:grid; place-items:center; color:var(--teal); }
  .mrow .ic svg { width:17px; height:17px; }
  .mrow .t { font-size:14px; font-weight:600; }
  .mrow .s { font-size:12px; color:var(--muted); margin-top:1px; }
  .mrow .arw { color:var(--muted); }
  .mrow .arw svg { width:16px; height:16px; display:block; }

  /* ================= USTAWIENIA ================= */
  .set-row { display:flex; align-items:center; gap:12px; padding:13px 0; border-bottom:1px solid var(--border-soft); }
  .set-row:last-child { border-bottom:0; padding-bottom:0; }
  .set-row:first-child { padding-top:0; }
  .set-row .body { flex:1 1 auto; min-width:0; }
  .set-row .t { font-size:14px; font-weight:600; }
  .set-row .s { font-size:12.5px; color:var(--muted); margin-top:2px; word-break:break-word; }
  .avatar { width:38px; height:38px; border-radius:11px; flex:none; display:grid; place-items:center;
    font-family:"Sora",sans-serif; font-weight:700; font-size:12px; }
  .avatar.fb { background:color-mix(in srgb,var(--blue) 14%, transparent); color:var(--blue); border:1px solid color-mix(in srgb,var(--blue) 32%, transparent); }
  .avatar.ig { background:color-mix(in srgb,var(--pink) 14%, transparent); color:var(--pink); border:1px solid var(--pink-dim); }
  .bar { height:6px; background:var(--surface-3); border-radius:99px; overflow:hidden; margin-top:8px; }
  .bar > i { display:block; height:100%; border-radius:99px; background:var(--grad); }

  /* ================= NOWY POST ================= */
  .gen-status { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--teal); font-weight:600; margin-top:8px; }
  .pulse { width:7px; height:7px; border-radius:99px; background:var(--teal); animation:p 1.1s ease-in-out infinite; }
  @keyframes p { 0%,100% { opacity:.3; } 50% { opacity:1; } }
  .drop { border:1.5px dashed var(--border); border-radius:var(--r); padding:18px; text-align:center;
    color:var(--muted); font-size:13px; background:var(--surface-2); cursor:pointer; }
  .drop:hover { border-color:var(--teal); color:var(--text-2); }
  .drop svg { width:20px; height:20px; display:block; margin:0 auto 7px; color:var(--teal); }
  .preview { background:var(--surface-2); border:1px solid var(--border); border-radius:var(--r); overflow:hidden; }
  .preview .ph { display:flex; align-items:center; gap:9px; padding:11px 12px; border-bottom:1px solid var(--border-soft); }
  .preview .pb { padding:12px; font-size:13px; line-height:1.6; white-space:pre-wrap; color:var(--text-2); }
  .preview .pimg { aspect-ratio:4/5; max-width:100%; background:var(--grad-soft); display:grid; place-items:center;
    color:var(--muted); font-size:12px; border-top:1px solid var(--border-soft); }

  /* ================= DESKTOP ================= */
  @media (min-width: 980px) {
    .app { grid-template-columns:250px 1fr; }
    .tabbar { display:none; }
    main { padding:26px 28px 44px; }
    .toast { bottom:26px; }
    .sidebar {
      display:flex; flex-direction:column; gap:2px; background:var(--surface);
      border-right:1px solid var(--border); padding:20px 14px;
      position:sticky; top:0; height:100vh; overflow-y:auto;
    }
    .sidebar .brand { padding:0 8px 18px; }
    .topbar { padding:16px 28px; }
    .topbar .brand { display:none; }
    .nav-group { font-size:10px; font-weight:700; letter-spacing:.09em; text-transform:uppercase;
      color:var(--muted); padding:14px 11px 6px; }
    .nav-item {
      appearance:none; border:0; background:none; cursor:pointer; text-align:left;
      display:flex; align-items:center; gap:11px; padding:8px 11px; border-radius:10px;
      color:var(--text-2); font-size:13.5px; font-weight:600; position:relative;
    }
    .nav-item svg { width:17px; height:17px; flex:none; }
    .nav-item:hover { background:var(--surface-2); color:var(--text); }
    .nav-item[aria-selected="true"] { background:var(--grad-soft); color:var(--text); }
    .nav-item[aria-selected="true"]::before { content:""; position:absolute; left:0; top:8px; bottom:8px;
      width:2.5px; border-radius:99px; background:var(--grad); }
    .nav-item .badge { margin-left:auto; background:var(--pink); color:#fff; font-size:10.5px;
      font-weight:700; padding:1px 7px; border-radius:99px; }
    .hide-desk { display:none !important; }
    .stats { grid-template-columns:repeat(4,1fr); gap:12px; }
    .cal-grid { display:block; }
    .agenda { display:none; }
    .two { display:grid; grid-template-columns:1.15fr .85fr; gap:20px; align-items:start; }
    .draft .acts { grid-template-columns:auto auto auto; justify-content:start; }
    .media-grid { grid-template-columns:repeat(4,1fr); }
    .tpl-grid { grid-template-columns:repeat(2,1fr); }
  }
  @media (min-width:560px) and (max-width:979px) {
    .media-grid { grid-template-columns:repeat(3,1fr); }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:.001ms !important; transition-duration:.001ms !important; }
  }

/* ================= DODATKI PANELU (poza prototypem) ================= */
a { color: inherit; }
a.post, a.ev, a.lrow, a.mrow { text-decoration: none; }
a.post:hover, a.lrow:hover { border-color: var(--teal); }

.flash { display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:var(--r);
  margin-bottom:16px; font-size:13.5px; font-weight:600; border:1px solid var(--border); background:var(--surface); }
.flash.ok  { border-left:3px solid var(--ok); }
.flash.err { border-left:3px solid var(--danger); color:var(--danger); }

.bledy { border:1px solid var(--border); border-left:3px solid var(--danger); background:var(--surface);
  border-radius:var(--r); padding:12px 14px; margin-bottom:14px; }
.bledy li { font-size:13.5px; color:var(--danger); margin:3px 0; }
.bledy ul { margin:0; padding-left:18px; }

.test-banner { display:block; padding:9px 16px; font-size:12.5px; font-weight:600;
  background:color-mix(in srgb, var(--warn) 14%, var(--bg)); color:var(--warn);
  border-bottom:1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.test-banner b { color:var(--text); }

.plik { display:block; width:100%; font-size:13px; color:var(--text-2); }
.plik::file-selector-button { font:inherit; font-weight:600; cursor:pointer; margin-right:10px;
  padding:8px 13px; border-radius:9px; border:1px solid var(--border); background:var(--surface-2); color:var(--text); }
.miniatura { display:flex; gap:12px; align-items:center; padding:10px; border:1px solid var(--border);
  border-radius:var(--r); background:var(--surface-2); }
.miniatura img, .miniatura video { width:64px; height:64px; object-fit:cover; border-radius:8px; flex:none;
  background:#000; }
/* Film w akceptacji trzeba móc obejrzeć przed kliknięciem „Akceptuj”, więc dostaje
   normalny odtwarzacz. Poniżej ~200 px Chrome zwija pasek sterowania do jednej
   ikonki „⋮” — stąd ta szerokość, a nie miniatura jak przy zdjęciu. */
.miniatura.film { align-items:flex-start; }
.miniatura video.wideo-podglad { width:280px; height:auto; max-height:360px; object-fit:contain;
  border-radius:10px; }
@media (max-width:560px) {
  .miniatura.film { flex-direction:column; align-items:stretch; }
  .miniatura video.wideo-podglad { width:100%; max-height:62vh; }
}
.post .thumb img, .post .thumb video { width:100%; height:100%; object-fit:cover; border-radius:8px;
  display:block; background:#000; }
.licznik { font-size:11.5px; color:var(--muted); text-align:right; margin-top:4px; }
.licznik.za-duzo { color:var(--danger); font-weight:700; }

.cal-nav { display:inline-flex; gap:4px; }
.cal-nav a { width:32px; height:32px; display:grid; place-items:center; border-radius:9px;
  border:1px solid var(--border); background:var(--surface-2); color:var(--text-2); }
.cal-nav a svg { width:16px; height:16px; }
.seg a { display:inline-block; padding:7px 13px; border-radius:8px; font-size:13px; font-weight:600;
  color:var(--muted); text-decoration:none; }
.seg a[aria-pressed="true"] { background:var(--surface); color:var(--text); box-shadow:0 1px 3px rgba(0,0,0,.2); }
.ev.err { border-left-color:var(--danger); }
.post.err { border-left-color:var(--danger); }

.draft .content { max-height:none; }
.draft .acts form { display:contents; }
.draft .acts { grid-template-columns:1fr 1fr 1fr; }

/* ---------- logowanie ---------- */
.login-wrap { min-height:100%; display:grid; place-items:center; padding:24px 16px; }
.login { width:100%; max-width:380px; }
.login .brand { justify-content:center; margin-bottom:22px; }
.login .brand-mark { width:44px; height:44px; font-size:17px; border-radius:13px; }
.login .brand-name { font-size:18px; }
.check { display:flex; align-items:center; gap:9px; font-size:13.5px; color:var(--text-2); cursor:pointer; }
.check input { width:17px; height:17px; accent-color:var(--teal); }
a.nav-item, a.tab, a.btn, a.tpl { text-decoration:none; }
button.nav-item { font:inherit; }

/* ---- Claude: generowanie ---- */
.ic-ai { width:34px; height:34px; flex:none; border-radius:10px; background:var(--grad); color:var(--on-grad);
  display:grid; place-items:center; }
.ic-ai svg { width:17px; height:17px; }
select.inp { appearance:auto; }
details > summary { list-style:revert; }
button[data-generuj][disabled] { opacity:.6; cursor:wait; }
[hidden] { display:none !important; }
[data-wygenerowano] { scroll-margin-top:90px; }

/* ---- dopasowanie zdjęcia do Instagrama ---- */
.ig-dop { margin-top:14px; padding:12px; border:1px solid var(--border); border-radius:var(--r); background:var(--surface-2); }
.ig-dop-row { display:flex; gap:14px; align-items:flex-start; }
.ig-podglad { position:relative; flex:none; width:120px; aspect-ratio:4/5; overflow:hidden; border-radius:10px; background:#000; }
.ig-podglad.poziom { width:150px; aspect-ratio:1.91/1; }
.ig-podglad img { position:absolute; inset:0; width:100%; height:100%; }
.ig-podglad img.fg { object-fit:cover; }
.ig-podglad img.bg { object-fit:cover; filter:blur(10px) brightness(.65); transform:scale(1.15); display:none; }
.ig-podglad.tlo img.fg { object-fit:contain; }
.ig-podglad.tlo img.bg { display:block; }

/* logo = powrót do kalendarza */
a.brand { text-decoration:none; color:inherit; -webkit-tap-highlight-color:transparent; }
a.brand:active .brand-mark { transform:scale(.94); }
a.brand .brand-mark { transition:transform .12s; }

/* ---- zestawy hashtagów ---- */
.tag-chips { display:flex; flex-wrap:wrap; gap:8px; }
.tag-chip { font-size:13px; }

/* ---- poprawianie zaznaczonego fragmentu ---- */
.popraw { margin-top:12px; padding:12px; border:1px solid var(--border); border-radius:var(--r);
  background:var(--surface-2); display:flex; flex-direction:column; gap:10px; }
.popraw-head { display:flex; align-items:center; gap:10px; min-height:28px; }
.popraw-head .ic-ai svg { width:14px; height:14px; }
.popraw-info { flex:1 1 auto; min-width:0; font-size:13px; color:var(--text-2); overflow:hidden; text-overflow:ellipsis; }
.popraw.aktywny .popraw-info { color:var(--text); font-weight:600; }
.popraw-x { appearance:none; border:0; background:var(--surface-3); color:var(--text); width:32px; height:32px;
  border-radius:99px; font-size:20px; line-height:1; cursor:pointer; flex:none; }
.popraw-akcje { display:flex; gap:8px; overflow-x:auto; -webkit-overflow-scrolling:touch; padding-bottom:2px; scrollbar-width:none; }
.popraw-akcje::-webkit-scrollbar { display:none; }
.chip-btn { appearance:none; flex:none; min-height:38px; padding:0 14px; border-radius:99px; cursor:pointer;
  border:1px solid var(--border); background:var(--surface); color:var(--text); font:inherit; font-size:13.5px; font-weight:600; }
.chip-btn:not([disabled]):hover, .chip-btn:not([disabled]):active { border-color:var(--teal); }
.chip-btn[disabled] { opacity:.45; cursor:default; }
.popraw-wlasne { display:flex; gap:8px; }
.popraw-wlasne .inp { flex:1 1 auto; min-width:0; font-size:16px; } /* 16px — iPhone nie powiększa ekranu przy pisaniu */
.popraw-wlasne .btn { flex:none; }
.popraw-wlasne .btn[disabled] { opacity:.45; }
.popraw-stan { font-size:13px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.popraw-stan.ok { color:var(--ok); }
.popraw-stan.blad { color:var(--danger); }
.popraw-stan.pisze { color:var(--teal); }

/* Telefon: po zaznaczeniu panel wyskakuje nad dolnym paskiem, żeby nie trzeba było przewijać */
@media (max-width:979px) {
  .popraw.aktywny { position:fixed; left:10px; right:10px; z-index:45;
    bottom:calc(78px + env(safe-area-inset-bottom,0px));
    background:var(--surface); box-shadow:0 10px 34px rgba(0,0,0,.45); border-color:var(--teal); }
}

/* ---- kalendarz: klikalne dni i okno dnia ---- */
.cell.klik { cursor:pointer; transition:border-color .12s, background .12s; }
.cell.klik:hover, .cell.klik:focus-visible { border-color:var(--teal); background:var(--surface-2); outline:none; }
.ev-wiecej { font-size:11px; font-weight:700; color:var(--teal); padding:2px 6px; }
.dzien-okno { width:min(640px, calc(100vw - 32px)); max-height:min(80vh, 760px); padding:0; border:1px solid var(--border);
  border-radius:var(--r-lg); background:var(--surface); color:var(--text); box-shadow:0 24px 60px rgba(0,0,0,.5); }
.dzien-okno[open] { display:flex; flex-direction:column; }
.dzien-okno::backdrop { background:rgba(4,10,16,.62); backdrop-filter:blur(3px); }
.dzien-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:18px 20px 12px;
  border-bottom:1px solid var(--border-soft); }
.dzien-tytul { font-family:"Sora",sans-serif; font-size:19px; font-weight:700; }
.dzien-lista { padding:14px 20px; overflow-y:auto; display:flex; flex-direction:column; gap:10px; }
.dzien-lista .post .txt { white-space:normal; -webkit-line-clamp:4; }
.dzien-stopka { padding:12px 20px 18px; border-top:1px solid var(--border-soft); }
.dzien-stopka .btn[hidden] { display:none; }

/* ---- okno dnia: klikalne posty i szczegóły ---- */
.post.post-klik { width:100%; text-align:left; font:inherit; color:inherit; cursor:pointer; appearance:none; position:relative; }
.post.post-klik:hover, .post.post-klik:focus-visible { border-color:var(--teal); background:var(--surface-2); outline:none; }
.post.post-klik[hidden] { display:none; }
.post-arw { align-self:center; color:var(--muted); flex:none; }
.post-arw svg { width:16px; height:16px; display:block; }
.post.post-klik:hover .post-arw { color:var(--teal); }
.post-szczegoly { display:flex; flex-direction:column; gap:12px; }
.post-szczegoly[hidden] { display:none; }
.post-szczegoly [data-wroc] { align-self:flex-start; }
.sz-foto { width:100%; max-height:360px; object-fit:contain; border-radius:var(--r); background:#000; }
.sz-tresc { white-space:pre-wrap; font-size:14px; line-height:1.6; background:var(--surface-2);
  border:1px solid var(--border-soft); border-radius:var(--r); padding:14px; }
.sz-akcje { display:flex; flex-wrap:wrap; gap:8px; }
.sz-akcje form { display:contents; }

/* ---- bank pomysłów ---- */
.lrow.pomysl { flex-wrap:wrap; }
.pomysl-akcje { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.pomysl-akcje form { display:contents; }
@media (max-width:560px) { .pomysl-akcje { width:100%; } .pomysl-akcje .btn-primary { flex:1 1 auto; justify-content:center; } }
details > summary.sec-title { list-style:revert; }

/* ---- biblioteka ---- */
.media { appearance:none; padding:0; text-align:left; font:inherit; color:inherit; width:100%; }
.media:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
.media .ph img { display:block; }
@media (min-width:700px) { .media-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (min-width:1200px) { .media-grid { grid-template-columns:repeat(5,minmax(0,1fr)); } }

/* ---- agenda: minione dni schowane ---- */
.ag-wczesniej { margin-bottom:14px; }
.ag-wczesniej > summary { list-style:none; cursor:pointer; display:flex; align-items:center; gap:8px;
  padding:11px 14px; border:1px solid var(--border); border-radius:var(--r); background:var(--surface);
  font-size:13px; font-weight:600; color:var(--text-2); }
.ag-wczesniej > summary::-webkit-details-marker { display:none; }
.ag-wczesniej > summary::after { content:"▾"; margin-left:auto; color:var(--muted); }
.ag-wczesniej[open] > summary::after { content:"▴"; }
.ag-wczesniej[open] > summary { border-color:var(--teal); margin-bottom:10px; }
.ag-wczesniej-lista { display:flex; flex-direction:column; gap:16px; }

/* ---- podgląd posta ---- */
.podglad .pv-tab button { appearance:none; border:0; background:none; font:inherit; cursor:pointer; }
.pv-ekran { border:1px solid var(--border); border-radius:var(--r); background:var(--surface-2); overflow:hidden;
  max-width:400px; width:100%; margin:0 auto; }
.pv-head { display:flex; align-items:center; gap:10px; padding:12px 13px 10px; }
.pv-ava { width:36px; height:36px; flex:none; border-radius:99px; background:var(--grad); color:var(--on-grad);
  display:grid; place-items:center; font-family:"Sora",sans-serif; font-weight:700; font-size:13px; }
.pv-nazwa { font-size:14px; font-weight:700; }
.pv-meta { font-size:11.5px; color:var(--muted); }
.pv-tekst, .pv-podpis { padding:0 13px 11px; font-size:13.5px; line-height:1.55; white-space:pre-wrap; word-break:break-word; }
.pv-podpis { padding-top:11px; }
.pv-tekst.pusty, .pv-podpis.pusty { color:var(--muted); font-style:italic; }
.pv-wiecej { color:var(--muted); }
.pv-foto { position:relative; background:#000; aspect-ratio:4/3; overflow:hidden; }
.pv-foto.pusta { background:var(--surface-3); display:grid; place-items:center; }
.pv-foto img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.pv-foto .pv-bg { display:none; object-fit:cover; filter:blur(12px) brightness(.6); transform:scale(1.15); }
.pv-foto.kadr .pv-fg { object-fit:cover; }
.pv-foto.tlo .pv-bg { display:block; }
.pv-brak { position:relative; font-size:12.5px; color:var(--muted); }
.pv-akcje { padding:10px 13px 12px; font-size:12.5px; color:var(--muted); border-top:1px solid var(--border-soft); letter-spacing:.02em; }
.pv-ekran[data-widok="ig"] .pv-foto { order:-1; }
.pv-ekran[data-widok="ig"] { display:flex; flex-direction:column; }
.pv-ekran[data-widok="ig"] .pv-head { order:-2; }
.pv-ekran[data-widok="ig"] .pv-akcje { border-top:0; padding-bottom:4px; font-size:17px; }
.pv-ekran[data-widok="ig"] .pv-podpis { order:5; }

/* ---- suwak kadru ---- */
.suwak { -webkit-appearance:none; appearance:none; width:100%; height:34px; background:none; cursor:pointer; }
.suwak::-webkit-slider-runnable-track { height:6px; border-radius:99px; background:var(--surface-3); }
.suwak::-moz-range-track { height:6px; border-radius:99px; background:var(--surface-3); }
.suwak::-webkit-slider-thumb { -webkit-appearance:none; width:26px; height:26px; margin-top:-10px;
  border-radius:99px; background:var(--grad); border:2px solid var(--surface); box-shadow:0 2px 8px rgba(0,0,0,.4); }
.suwak::-moz-range-thumb { width:26px; height:26px; border-radius:99px; background:var(--teal); border:2px solid var(--surface); }
#ig-kadr-pole[hidden] { display:none; }

/* ---- Plan tygodnia ---- */
.pl-siatka { display:flex; flex-direction:column; gap:12px; }
.pl-dzien { border:1px solid var(--border); border-radius:var(--r); background:var(--surface);
  display:flex; flex-direction:column; min-width:0; }
.pl-dzien.dzis { border-color:var(--teal); box-shadow:0 0 0 1px color-mix(in srgb,var(--teal) 30%, transparent); }
.pl-dzien.minal { opacity:.62; }
.pl-dzien.nad { border-color:var(--teal); background:color-mix(in srgb,var(--teal) 8%, var(--surface)); }
.pl-dzien-head { display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:10px 12px; border-bottom:1px solid var(--border); }
.pl-dzien-nazwa { font-family:"Sora",sans-serif; font-weight:600; font-size:14px; text-transform:capitalize; }
.pl-dzien-tresc { padding:10px 12px; display:flex; flex-direction:column; gap:8px; flex:1 1 auto; min-height:56px; }
.pl-dzien-stopka { padding:0 12px 10px; }
.pl-pusty { margin:0; color:var(--muted); font-size:12.5px; font-style:italic; }

.pl-post { display:flex; flex-direction:column; gap:5px; padding:8px 10px; border-radius:10px;
  border:1px solid var(--border); background:var(--surface-2); text-decoration:none; color:inherit; }
a.pl-post:hover { border-color:var(--teal); }
.pl-post-t { font-size:12.5px; color:var(--text-2); line-height:1.35; }

.pl-pomysl { padding:8px 10px; border-radius:10px; border:1px dashed var(--border);
  background:var(--surface-2); display:flex; flex-direction:column; gap:6px; cursor:grab; }
.pl-pomysl:active { cursor:grabbing; }
.pl-pomysl.niesie { opacity:.45; }
.pl-pomysl-t { font-size:13px; font-weight:600; line-height:1.3; }
/* Pomysł, z którego post już powstał: ciągła ramka zamiast kreskowanej i stonowany,
   żeby na pierwszy rzut oka było widać, że to nie jest robota do zrobienia. */
.pl-pomysl-zrobiony { border-style:solid; opacity:.72; }
.pl-pomysl-zrobiony .pl-pomysl-t { font-weight:500; }
.pl-pomysl-a { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.pl-pula { display:flex; flex-wrap:wrap; gap:10px; }
.pl-pula .pl-pomysl { flex:1 1 220px; max-width:320px; }

@media (min-width: 900px) {
  .pl-siatka { display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:10px; align-items:stretch; }
  .pl-dzien-nazwa { font-size:13px; }
  .pl-dzien-head { padding:8px 10px; }
  .pl-dzien-tresc { padding:8px 10px; min-height:120px; max-height:min(52vh, 460px); overflow-y:auto; }
  .pl-dzien-stopka { padding:0 10px 8px; }
  .pl-post-t { font-size:12px; }
}

/* ---- Recykling ---- */
.card.rec { display:flex; flex-direction:column; gap:13px; }
.card.rec .content { background:var(--surface-2); border:1px solid var(--border-soft); border-radius:var(--r);
  padding:13px; font-size:13.5px; line-height:1.65; white-space:pre-wrap; color:var(--text-2);
  max-height:190px; overflow-y:auto; }
.card.rec .acts { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.card.rec .acts form { display:flex; gap:8px; align-items:center; margin:0; }
.rec-form { flex:1 1 300px; min-width:0; }
.rec-form .inp { flex:1 1 150px; min-width:0; }
@media (max-width: 720px) {
  .card.rec .acts { flex-direction:column; align-items:stretch; }
  .card.rec .acts > form, .card.rec .acts > a { width:100%; }
  .card.rec .acts form { flex-direction:column; align-items:stretch; }
  .card.rec .acts .btn, .card.rec .acts .inp { width:100%; flex:0 0 auto; }
}

/* ---- Szablony i hashtagi ---- */
.sz-karta { display:flex; flex-direction:column; gap:11px; }
.sz-karta.wylaczony { opacity:.62; }
.sz-karta summary { list-style:none; cursor:pointer; display:inline-flex; }
.sz-pasek { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.sz-pasek form { margin:0; }
.sz-pasek .sz-edycja[open] { flex:1 1 100%; }
.sz-karta summary::-webkit-details-marker { display:none; }
.tagi-podglad { background:var(--surface-2); border:1px solid var(--border-soft); border-radius:var(--r);
  padding:11px; font-size:13px; line-height:1.7; color:var(--text-2); word-break:break-word; }


/* ---- karta linku do filmu ---- */
.link-karta { display:flex; gap:12px; align-items:center; margin-top:12px; padding:10px;
  border:1px solid var(--border); border-radius:var(--r); background:var(--surface-2); }
.link-karta img { flex:none; width:110px; height:62px; object-fit:cover; border-radius:9px; background:var(--surface-3); }
.link-tresc { min-width:0; }
.link-tytul { font-size:13.5px; font-weight:600; line-height:1.35; }

/* podgląd: karta linku tak, jak pokazuje ją Facebook */
.pv-link { border-top:1px solid var(--border); background:var(--surface-3); }
.pv-link-foto { display:block; width:100%; aspect-ratio:1.91/1; object-fit:cover; background:#000; }
.pv-link-opis { padding:9px 12px; }
.pv-link-host { font-size:11px; letter-spacing:.04em; color:var(--muted); text-transform:uppercase; }
.pv-link-tytul { font-size:14px; font-weight:700; line-height:1.3; margin-top:2px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* co udało się odczytać z filmu */
.film-info { margin-top:10px; padding:10px 12px; border-radius:var(--r); border:1px solid var(--border);
  background:var(--surface-2); font-size:13px; }
.film-info.slabo { border-color:var(--warn,#c99a2e); }
.film-znaczki { display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }

/* Claude pracuje — nakładka na całym ekranie */
.praca { position:fixed; inset:0; z-index:90; display:none; place-items:center;
  background:color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter:blur(3px); }
.praca[data-widac="1"] { display:grid; }
.praca-pudlo { display:flex; flex-direction:column; align-items:center; gap:14px; padding:26px 30px;
  background:var(--surface); border:1px solid var(--border); border-radius:18px; max-width:300px; text-align:center;
  box-shadow:0 18px 50px rgba(0,0,0,.45); }
.praca-kolo { width:44px; height:44px; border-radius:99px; border:3px solid var(--surface-3);
  border-top-color:var(--teal); border-right-color:var(--pink); animation:obrot .8s linear infinite; }
.praca-tekst { font-weight:700; font-size:15px; }
.praca-pod { font-size:12.5px; color:var(--text-2); }
@keyframes obrot { to { transform:rotate(360deg); } }

/* ---- zdjęcia w poście: wybrane, kolejność, biblioteka pod ręką ---- */
.wybrane { display:grid; grid-template-columns:repeat(auto-fill, minmax(104px, 120px)); gap:8px; margin-bottom:8px; }
.wybrane[hidden] { display:none; }
.wyb { position:relative; border-radius:10px; overflow:hidden; min-width:0;
  border:1px solid var(--border); background:var(--surface-2); }
.wyb::before { content:""; display:block; padding-top:100%; }   /* kwadrat — tak samo jak w bibliotece */
.wyb img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.wyb.okladka { border:2px solid var(--teal); }
/* pierwszy kafelek nie ma ‹ ani ★, więc jego lewy dolny róg jest wolny na znaczek */
.wyb.okladka::after { content:"okładka"; position:absolute; left:4px; bottom:8px;
  padding:2px 8px; border-radius:99px; background:var(--teal); color:#06231f; font-size:10.5px; font-weight:800;
  letter-spacing:.3px; pointer-events:none; }
.wyb-nr { position:absolute; left:4px; top:4px; min-width:18px; height:18px; padding:0 5px;
  border-radius:99px; background:rgba(0,0,0,.65); color:#fff; font-size:11px; font-weight:700;
  display:grid; place-items:center; }
.wyb button { position:absolute; border:0; cursor:pointer; color:#fff; background:rgba(0,0,0,.6);
  font-size:13px; line-height:1; padding:0; }
.wyb-x { right:4px; top:4px; width:28px; height:28px; border-radius:99px; font-size:14px; }
.wyb-lewo, .wyb-prawo, .wyb-okladka { bottom:4px; width:30px; height:28px; border-radius:8px; font-size:18px; }
.wyb-lewo { left:4px; }
.wyb-prawo { right:4px; }
.wyb-okladka { left:50%; transform:translateX(-50%); font-size:15px; color:#FCD34D !important; }
.wyb button[hidden] { display:none; }
@media (max-width:560px) {
  .wybrane { grid-template-columns:repeat(3, minmax(0, 1fr)); }
}
.wgrywane { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:6px; }
.wgrywane img { width:56px; height:56px; object-fit:cover; border-radius:8px; border:1px solid var(--border); }

.picker { margin-bottom:10px; }
/* Kafelek jest kwadratem dzięki ::before z padding-top:100%, a zdjęcie leży na nim
   absolutnie. Wcześniej kwadrat robiło samo aspect-ratio — Safari na iPhonie w przewijanej
   siatce z max-height ściskał wiersze i zdjęcia nachodziły na siebie jak dachówki. */
.picker-siatka { display:grid; grid-template-columns:repeat(auto-fill, minmax(92px, 1fr)); gap:8px;
  align-content:start; margin-top:8px; max-height:min(62vh, 480px); overflow-y:auto;
  overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding:2px; }
.pick { position:relative; display:block; width:100%; min-width:0; padding:0; border:2px solid transparent;
  border-radius:10px; background:var(--surface-2); cursor:pointer; overflow:hidden; }
.pick::before { content:""; display:block; padding-top:100%; }
.pick img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; opacity:.9; }
.pick.wzieta { border-color:var(--teal); }
.pick.wzieta img { opacity:1; }
.pick.wzieta::after { content:"✓"; position:absolute; top:5px; right:5px; width:22px; height:22px;
  border-radius:50%; background:var(--teal); color:#06231f; font-size:13px; font-weight:800;
  display:grid; place-items:center; }
@media (max-width:560px) {
  .picker-siatka { grid-template-columns:repeat(3, minmax(0, 1fr)); }
}

/* ---- filmy: kafelki w poście i w bibliotece ---- */
.wyb video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; background:#000; }
.wyb-film, .pick-film { position:absolute; left:4px; bottom:4px; padding:1px 6px; border-radius:99px;
  background:rgba(0,0,0,.72); color:#fff; font-size:10.5px; font-weight:700; letter-spacing:.2px;
  pointer-events:none; }
.pick video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; opacity:.9; background:#000; }
.pick.wzieta video { opacity:1; }
.media video { width:100%; height:100%; object-fit:cover; display:block; background:#000; }
.sz-wideo { width:100%; max-height:70vh; border-radius:10px; background:#000; display:block; }

/* podgląd posta z filmem: pokazujemy miejsce odtwarzacza, nie odtwarzacz */
.pv-wideo { position:relative; background:#000; display:grid; place-items:center; gap:6px;
  aspect-ratio:9/16; max-height:420px; }
.pv-wideo-play { font-size:30px; color:rgba(255,255,255,.9); line-height:1; }
.pv-wideo-opis { font-size:12px; color:rgba(255,255,255,.65); }

/* ---- biblioteka: zaznaczanie kilku zdjęć ---- */
.zazn-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.zazn-akcje { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.zazn-akcje .hint { margin:0; }
.media-grid.tryb-zazn .media { cursor:copy; }
.media-grid.tryb-zazn .media .ph { outline:2px solid transparent; outline-offset:-2px; border-radius:10px; }
.media.zazn .ph { outline:3px solid var(--teal); outline-offset:-3px; }
[aria-disabled="true"] { opacity:.5; pointer-events:auto; }
.media.zazn { position:relative; }
.media.zazn::after { content:attr(data-nr); position:absolute; left:8px; top:8px; z-index:2;
  min-width:20px; height:20px; padding:0 6px; border-radius:99px; background:var(--teal); color:#06231f;
  font-size:11px; font-weight:800; display:grid; place-items:center; }

/* przycisk (CTA) pod kartą linku w podglądzie Facebooka */
.pv-cta { display:inline-block; align-self:center; margin:0 10px 0 4px; padding:5px 12px; flex:none;
  border-radius:6px; background:var(--surface-3); color:var(--text); font-size:12px; font-weight:700;
  white-space:nowrap; }

/* ---- korekta pisowni ---- */
.pisownia { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:10px; }
.pisownia-wynik { margin-top:10px; padding:10px 12px; border-radius:var(--r); border:1px solid var(--border);
  background:var(--surface-2); font-size:13px; }
.pis-info { font-weight:600; margin-bottom:6px; }
.pis-info.ok { color:var(--teal); }
.pis-info.blad { color:var(--err,#e06b6b); }
.pis-zmiana { padding:3px 0; border-top:1px solid var(--border); }
.pis-zmiana s { color:var(--text-2); }
.pis-zmiana b { color:var(--text); }
.pis-akcje { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }

/* przerwana publikacja — nie wiadomo, czy post wyszedł */
.niepewny-box { margin-top:10px; padding:12px; border-radius:var(--r);
  border:1px solid var(--warn,#c99a2e); background:var(--surface-2); font-size:13px; }
.niepewny-box .acts { display:flex; gap:8px; flex-wrap:wrap; }

/* ======================================================================
   USTAWIENIA — pulpit, alarmy i cztery zakładki (2.00)
   Wszystko mieści się bez przewijania: na górze stan, pod nim to, co
   wymaga decyzji, a szczegóły leżą w jednej z czterech zakładek.
   ====================================================================== */
.ust { display:flex; flex-direction:column; gap:16px; }

/* ---- kafelki stanu ---- */
.u-kafle { display:grid; gap:10px; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); }
.u-kafel { display:flex; flex-direction:column; gap:3px; text-align:left; cursor:pointer;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
  padding:11px 12px; font:inherit; color:var(--text); transition:border-color .12s ease; }
.u-kafel:hover { border-color:var(--teal); }
.u-kafel-nag { display:flex; align-items:center; gap:6px; font-size:11px; font-weight:700;
  letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.u-kafel-w { font-size:17px; font-weight:700; line-height:1.2; }
.u-kafel-o { font-size:11.5px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.u-kropka { width:7px; height:7px; border-radius:99px; background:var(--muted); flex:none; margin-left:auto; }
.u-kropka.done { background:var(--ok); }
.u-kropka.wait { background:var(--warn); }
.u-kropka.err  { background:var(--danger); }
.u-kropka.plan { background:var(--teal); }

/* ---- do zrobienia ---- */
.u-alarm { width:100%; text-align:left; cursor:pointer; font:inherit; color:var(--text); }
.u-alarm:hover { border-color:var(--teal); }
.u-alarm .body { display:block; }
.u-alarm .t, .u-alarm .s { display:block; }

/* ---- zakładki ---- */
.u-tabs { display:flex; gap:6px; overflow-x:auto; -webkit-overflow-scrolling:touch;
  border-bottom:1px solid var(--border); padding-bottom:0; margin-bottom:-6px; }
.u-tab { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; cursor:pointer;
  background:transparent; border:0; border-bottom:2px solid transparent; color:var(--text-2);
  font:inherit; font-size:14px; font-weight:600; padding:9px 12px; }
.u-tab:hover { color:var(--text); }
.u-tab[aria-selected="true"] { color:var(--text); border-bottom-color:var(--teal); }
.u-ile { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 5px;
  border-radius:99px; background:var(--danger); color:#fff; font-size:11px; font-weight:700; }
.u-panel[hidden] { display:none; }
.u-podswietl { animation:u-blysk 1.4s ease-out 1; }
@keyframes u-blysk {
  0%, 40% { border-color:var(--teal); box-shadow:0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent); }
  100%    { border-color:var(--border); box-shadow:none; }
}
@media (max-width:640px) {
  .u-kafle { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  /* na telefonie cztery zakładki nie mieszczą się w jednej linii — dajemy 2x2,
     żeby wszystkie były widoczne bez przesuwania paska w bok */
  .u-tabs { display:grid; grid-template-columns:1fr 1fr; gap:8px; border-bottom:0; margin-bottom:0; overflow:visible; }
  .u-tab { justify-content:center; padding:10px 8px; font-size:13.5px;
    border:1px solid var(--border); border-radius:var(--r); background:var(--surface); }
  .u-tab[aria-selected="true"] { border-color:var(--teal); color:var(--text); }
}

/* iPhone powiększa stronę przy każdym polu z czcionką mniejszą niż 16 px i nie oddaje
   widoku po wyjściu z pola. Na dotykowych i wąskich ekranach pola mają więc 16 px. */
@media (hover:none), (max-width:979px) {
  .inp, textarea.inp, select.inp, input[type="text"], input[type="email"],
  input[type="password"], input[type="search"], input[type="url"], input[type="number"],
  input[type="datetime-local"], input[type="date"], textarea, select { font-size:16px; }
}

/* nota o prawach autorskich: pod menu bocznym, pod logowaniem i na ekranie „Więcej” */
.prawa { font-size:11px; line-height:1.5; color:var(--muted); text-align:center; margin:14px 0 0; }
.sidebar .prawa { text-align:left; padding:0 12px; margin-top:10px; }

/* okienko „Za chwilę wylogowanie” */
.bezczynnosc { position:fixed; inset:0; z-index:90; display:grid; place-items:center; padding:16px;
  background:rgba(5,8,11,.6); backdrop-filter:blur(2px); }
.bezczynnosc[hidden] { display:none; }
.bezczynnosc-pudlo { width:100%; max-width:360px; background:var(--surface); border:1px solid var(--border);
  border-radius:16px; padding:20px; text-align:center; box-shadow:0 20px 60px rgba(0,0,0,.45); }
.bezczynnosc-pudlo b { display:block; font-size:16px; margin-bottom:6px; }
.bezczynnosc-pudlo p { margin:0 0 14px; color:var(--text-2); font-size:14px; }
