/* BSK Media Cloud — jasny, spokojny interfejs z bocznym menu. */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e7e9ee;
  --line-2: #f1f3f6;
  --side: #0f1729;
  --side-2: #1a2438;
  --side-ink: #c7cfdd;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fb;
  --agency: #eb6834;
  --good: #0ca30c;
  --warning: #b77900;
  --critical: #d03b3b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 650; }
h2 { font-size: 1.02rem; font-weight: 620; }
h3 { font-size: .92rem; font-weight: 600; }
p { margin: .4rem 0; }
code { background: var(--line-2); padding: .1rem .38rem; border-radius: 6px; font-size: .86em; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: .83rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- układ aplikacji ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.02rem;
  padding: 4px 8px 18px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2a78d6, #6250d6); color: #fff; font-size: .8rem; font-weight: 800; }
.brand small { display: block; font-weight: 500; color: #8a96ab; font-size: .74rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6d7a91; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--side-ink);
  font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: #22314d; color: #fff; }
.nav a.active .icon { color: #7fb2f0; }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; border-top: 1px solid #1f2a40; padding-top: 14px; }
.side-disk { padding: 0 8px 14px; font-size: .78rem; color: #8a96ab; }
.side-disk .meter { margin: 6px 0 4px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: .76rem; color: #8a96ab; }
.me form button { background: none; border: 0; color: #8a96ab; cursor: pointer; padding: 6px; border-radius: 8px; }
.me form button:hover { background: var(--side-2); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 32px 6px; }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.burger { display: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px; cursor: pointer; }
.subtitle { color: var(--muted); margin-top: 2px; font-size: .9rem; }
.content { padding: 14px 32px 40px; max-width: 1400px; width: 100%; }
#nav-toggle { display: none; }

/* ---------- karty i siatki ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .spacer { flex: 1; }
.card-head p { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid > .card { margin-bottom: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mb { margin-bottom: 18px; }

/* ---------- kafelki statystyk ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .label { color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: 7px; }
.kpi .label .icon { width: 16px; height: 16px; color: var(--accent); }
.kpi .value { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.kpi .hint { color: var(--muted); font-size: .8rem; }
.kpi .spark { margin-top: 4px; }

/* ---------- przyciski i formularze ---------- */
button, .button { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; font-weight: 550; text-decoration: none; line-height: 1.3; white-space: nowrap; }
button:hover, .button:hover { border-color: #cfd5de; background: #fafbfc; text-decoration: none; }
.primary { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: var(--accent) !important; }
.primary:hover { filter: brightness(.95); }
.danger { color: var(--critical) !important; }
button.ghost, .button.ghost { background: transparent; border-color: transparent; padding: 6px 8px; }
button.ghost:hover, .button.ghost:hover { background: var(--line-2); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; }
button:disabled { opacity: .6; cursor: default; }
.btn-sm { padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
form.inline { display: inline; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: .86rem; color: var(--ink-2); }
input, textarea, select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); width: 100%; font-weight: 400; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox] { width: auto; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }

/* ---------- komunikaty ---------- */
.flash { padding: 11px 14px; border-radius: 12px; margin-bottom: 14px; background: #ecfdf3; color: #05603a;
  border: 1px solid #abefc6; }
.flash.error { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.flash.warn { background: #fffaeb; color: #93370d; border-color: #fedf89; }
.flash.info { background: var(--accent-soft); color: #1c5cab; border-color: #b7d3f6; }
.copyrow { display: flex; gap: 8px; margin: 8px 0 2px; }
.copyrow input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; }

/* ---------- tabele i listy ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list th { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #fafbfc; }
table.list td.actions { text-align: right; white-space: nowrap; }
table.list.compact td, table.list.compact th { padding: 5px 6px; font-size: .82rem; }
tr.inactive td { opacity: .55; }
.file { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file a { font-weight: 550; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.file .meta { color: var(--muted); font-size: .8rem; }
.ficon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: #eef2f7; color: #475569; }
.ficon.img { background: #fdf0e9; color: #c2410c; }
.ficon.video { background: #f1eefe; color: #5b4bc4; }
.ficon.audio { background: #fdeef4; color: #be185d; }
.ficon.sheet { background: #e8f6ef; color: #08784f; }
.ficon.doc { background: #e8f0fb; color: #1c5cab; }
.ficon.slides { background: #fff4e5; color: #b45309; }
.ficon.pdf { background: #fdecec; color: #b42318; }
.ficon.zip { background: #f3f4f6; color: #4b5563; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: #1c5cab; white-space: nowrap; }
.tag.agency { background: #fdeee7; color: #b5461a; }
.tag.ok { background: #e7f6e7; color: #0a7a0a; }
.tag.off { background: #f1f3f6; color: var(--muted); }
.tag.danger { background: #fdecec; color: var(--critical); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #c4cad4; }
.dot.on { background: var(--good); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700;
  font-size: .8rem; background: var(--accent-soft); color: #1c5cab; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.agency { background: #fdeee7; color: #b5461a; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person b { display: block; font-weight: 600; color: var(--ink); }
.person span { color: var(--muted); font-size: .8rem; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; color: #c4cad4; margin-bottom: 6px; }
.tabs { display: inline-flex; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; }
.tabs button { border: 0; background: transparent; padding: 5px 11px; font-size: .84rem; border-radius: 8px; font-weight: 550; color: var(--muted); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; min-width: 240px; }

/* ---------- wykresy ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-data summary { cursor: pointer; color: var(--muted); font-size: .8rem; margin-top: 6px; }
.meter { width: 100%; line-height: 0; }
.meter svg, .hbar-track svg { display: block; }
.state { font-size: .78rem; font-weight: 600; }
.state.warning { color: var(--warning); }
.state.critical { color: var(--critical); }
.disk { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.disk:last-child { border-bottom: 0; }
.disk-head { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin-bottom: 7px; }
.disk-head b { font-weight: 600; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 74px; gap: 12px; align-items: center; color: var(--ink);
  font-size: .86rem; text-decoration: none; }
.hbar:hover { text-decoration: none; }
.hbar:hover .hbar-label { color: var(--accent); }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ring { display: block; }
.ring-value { font-size: 24px; font-weight: 700; fill: var(--ink); }
.ring-label { font-size: 11px; fill: var(--muted); }
.quota-box { display: flex; align-items: center; gap: 18px; }
.quota-box .facts { display: flex; flex-direction: column; gap: 4px; }
.quota-box .facts b { font-size: 1.15rem; }

/* ---------- wysyłka plików ---------- */
.drop { border: 2px dashed #cfd6e2; border-radius: 14px; padding: 26px 16px; text-align: center; cursor: pointer;
  font-weight: 400; color: var(--muted); background: #fbfcfe; transition: .15s; align-items: center; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: #1c5cab; }
.drop .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.drop b { color: var(--ink); font-weight: 600; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload { position: relative; }
.upload progress { width: 100%; height: 8px; border-radius: 99px; overflow: hidden; appearance: none; border: 0; background: var(--accent-soft); }
.upload progress::-webkit-progress-bar { background: var(--accent-soft); }
.upload progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.upload progress::-moz-progress-bar { background: var(--accent); }

/* ---------- wiadomości ---------- */
.thread { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.msg { display: flex; gap: 9px; max-width: 92%; }
.msg .bubble { background: var(--line-2); border-radius: 14px 14px 14px 4px; padding: 9px 12px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--accent); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg .meta { font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.msg.mine .meta { color: #d6e6fa; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { resize: vertical; min-height: 44px; }

/* ---------- strona bez logowania ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, #dfe9f8 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #f3e6ff 0%, transparent 55%), var(--bg); }
.auth-box { width: 100%; max-width: 440px; }
.auth-box .brand { color: var(--ink); justify-content: center; padding-bottom: 22px; }
.auth-box .brand small { color: var(--muted); }
.auth-box .card { padding: 28px; }
.center { text-align: center; }
.big-file { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.big-file .ficon { width: 64px; height: 64px; border-radius: 18px; }
.big-file .ficon .icon { width: 30px; height: 30px; }
.button.big { font-size: 1.02rem; padding: 12px 26px; margin-top: 8px; }
.steps { padding-left: 1.2rem; } .steps li { margin-bottom: .55rem; }
footer.foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 18px; }

/* ---------- edytor dokumentów ---------- */
.editor-wrap { height: calc(100vh - 92px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #fff; }

/* ---------- telefon / tablet ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  #nav-toggle:checked ~ .shell .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(15, 23, 41, .45); }
  .burger { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .g-2, .form-grid, .checks { grid-template-columns: minmax(0, 1fr); }
  .kpis { gap: 12px; }
  .kpi .value { font-size: 1.4rem; }
  .search input { min-width: 0; }
  .hide-sm { display: none; }
}
.mt { margin-top: 14px; }
.grow { flex: 1; min-width: 180px; width: auto; }
.label-like { font-weight: 550; font-size: .86rem; color: var(--ink-2); }
.devcard { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; transition: .15s; }
.devcard:hover { text-decoration: none; border-color: #c9d6ea; transform: translateY(-1px); }
.spacer { flex: 1; }
.person .spacer { flex: 1; }
/* boczne menu na pełną wysokość także przy długich stronach */
.shell { background: linear-gradient(to right, var(--side) 252px, var(--bg) 252px); }
@media (max-width: 860px) {
  .shell { background: var(--bg); }
  .topbar { flex-wrap: wrap; padding-top: 14px; }
  .topbar h1 { font-size: 1.2rem; }
  .topbar .subtitle { font-size: .84rem; }
  .topbar > div:nth-child(2) { flex: 1; min-width: 0; }
  .topbar .actions { margin-left: 0; width: 100%; }
  .topbar .actions .button { flex: 1; }
  .kpi { padding: 12px 14px; }
  .kpi .label { font-size: .76rem; }
}
.disk-head span { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: #e34948; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; margin-left: 6px; }
.badge[hidden] { display: none; }
.nav a .badge { margin-left: auto; }
.msg.fresh .bubble { animation: pop .5s ease-out; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================= przeglądarka plików / galeria ================= */
.topsearch input { min-width: 220px; background: var(--card); }
.browser .bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; font-size: 1.02rem; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 8px; }
.crumbs a:hover { background: var(--line-2); text-decoration: none; color: var(--ink); }
.crumbs a.here { color: var(--ink); }
.crumbs .sep { color: #c4cad4; }
.tabs button .icon { width: 16px; height: 16px; }

.pop, .menu { position: relative; }
.pop > summary, .menu > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker, .menu > summary::-webkit-details-marker { display: none; }
.pop-body, .menu-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .14); padding: 12px; min-width: 260px; display: flex; flex-direction: column; gap: 8px; }
.menu-body form { display: flex; flex-direction: column; gap: 6px; }
.menu-body button { justify-content: flex-start; width: 100%; }

.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.folder-tile { position: relative; border-radius: 14px; background: #f7f8fb; border: 1px solid var(--line); transition: .18s; }
.folder-tile:hover { border-color: #c9d6ea; box-shadow: 0 8px 22px rgba(16, 24, 40, .08); transform: translateY(-2px); }
.folder-link { display: block; color: var(--ink); text-decoration: none !important; padding: 10px; }
.folder-cover { height: 118px; border-radius: 10px; overflow: hidden; display: grid; gap: 3px; background: linear-gradient(135deg, #e8f0fb, #f1eefe); }
.folder-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.covers-2 { grid-template-columns: 1fr 1fr; }
.covers-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.covers-3 img:first-child { grid-row: 1 / 3; }
.folder-ico { display: grid; place-items: center; color: #6d8fc4; }
.folder-ico .icon { width: 46px; height: 46px; stroke-width: 1.4; }
.folder-meta { padding: 9px 4px 2px; display: flex; flex-direction: column; }
.folder-meta b { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-meta span { color: var(--muted); font-size: .8rem; }
.folder-tile .menu { position: absolute; top: 16px; right: 16px; }
.folder-tile .menu > summary { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800;
  background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); color: var(--ink); opacity: 0; transition: .15s; }
.folder-tile:hover .menu > summary, .folder-tile .menu[open] > summary { opacity: 1; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.gcard { position: relative; border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: visible;
  transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column; }
.gcard:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(16, 24, 40, .10); }
.gthumb { all: unset; cursor: zoom-in; position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 13px 13px 0 0; overflow: hidden;
  background: linear-gradient(135deg, #f3f5f9, #e9edf4); }
.gthumb:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; z-index: 1; }
.gcard:hover .gthumb img { transform: scale(1.04); }
.gthumb.kind-pdf img { object-fit: contain; background: #fff; padding: 8px; }
.gicon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.gicon .icon { width: 42px; height: 42px; stroke-width: 1.4; }
.gicon em { font-style: normal; font-weight: 700; font-size: .72rem; letter-spacing: .08em; opacity: .75; }
.gthumb.img .gicon { color: #c2410c; } .gthumb.video .gicon { color: #5b4bc4; } .gthumb.audio .gicon { color: #be185d; }
.gthumb.sheet .gicon { color: #08784f; } .gthumb.doc .gicon { color: #1c5cab; } .gthumb.slides .gicon { color: #b45309; }
.gthumb.pdf .gicon { color: #b42318; } .gthumb.zip .gicon, .gthumb.file .gicon { color: #4b5563; }
.gthumb.sheet { background: linear-gradient(135deg, #eaf7f0, #d8f0e3); } .gthumb.doc { background: linear-gradient(135deg, #edf3fc, #dbe7f8); }
.gthumb.video { background: linear-gradient(135deg, #f1eefe, #e2dcfb); } .gthumb.pdf { background: linear-gradient(135deg, #fdf0f0, #f9dede); }
.gthumb.slides { background: linear-gradient(135deg, #fff6ea, #fde8c9); } .gthumb.audio { background: linear-gradient(135deg, #fdeef4, #f9dbe8); }
.play { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%;
  background: rgba(15, 23, 41, .62); color: #fff; display: grid; place-items: center; font-size: 15px; padding-left: 3px; backdrop-filter: blur(4px); }
.chip { position: absolute; z-index: 2; left: 8px; top: 8px; background: rgba(15, 23, 41, .72); color: #fff; font-size: .7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; }
.ginfo { padding: 10px 12px 12px; min-width: 0; }
.gname { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gmeta { color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.gnote { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.src { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.src.agency { background: var(--agency); }
.gactions { position: absolute; top: 8px; right: 8px; z-index: 3; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.gcard:hover .gactions, .gcard:focus-within .gactions, .gactions .menu[open] { opacity: 1; }
.iconbtn { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .94);
  color: var(--ink); box-shadow: 0 2px 8px rgba(16, 24, 40, .14); font-weight: 800; text-decoration: none !important; }
.iconbtn:hover { background: #fff; color: var(--accent); }
.iconbtn .icon { width: 16px; height: 16px; }
@media (hover: none) { .gactions { opacity: 1; } .folder-tile .menu > summary { opacity: 1; } }

/* widok listy */
.browser.as-list .gallery { grid-template-columns: 1fr; gap: 0; }
.browser.as-list .gcard { flex-direction: row; align-items: center; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; box-shadow: none; transform: none; padding: 6px 0; }
.browser.as-list .gthumb { width: 54px; height: 42px; aspect-ratio: auto; border-radius: 8px; flex: none; }
.browser.as-list .gicon .icon { width: 20px; height: 20px; }
.browser.as-list .gicon em, .browser.as-list .play, .browser.as-list .chip { display: none; }
.browser.as-list .ginfo { flex: 1; padding: 0 12px; }
.browser.as-list .gactions { position: static; opacity: 1; }
.browser.as-list .iconbtn { box-shadow: none; background: transparent; }
.browser.as-list .iconbtn:hover { background: var(--line-2); }

/* ================= podgląd pełnoekranowy ================= */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(9, 12, 22, .94); display: grid;
  grid-template-rows: auto 1fr auto; grid-template-columns: 64px 1fr 64px; color: #e5e7eb; animation: fade .18s ease-out; }
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lb-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 14px 18px; }
.lb-title { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.lb-title b { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-title span { font-size: .8rem; color: #9ca3af; }
.lb-count { color: #9ca3af; font-size: .85rem; margin-right: 6px; }
.lb-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .08);
  color: #fff; border: 1px solid rgba(255, 255, 255, .12); text-decoration: none !important; font-weight: 550; cursor: pointer; font: inherit; }
.lb-btn:hover { background: rgba(255, 255, 255, .16); }
.lb-btn[hidden] { display: none; }
.lb-stage { grid-column: 2; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; padding: 4px 0 10px; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb-stage iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #fff; }
.lb-stage audio { width: min(520px, 90%); }
.lb-empty { text-align: center; color: #cbd5e1; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-empty .icon { width: 64px; height: 64px; stroke-width: 1.2; color: #94a3b8; }
.lb-nav { align-self: center; justify-self: center; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08);
  color: #fff; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 0 4px; }
.lb-nav:hover { background: rgba(255, 255, 255, .18); }
.lb-nav.prev { grid-column: 1; grid-row: 2; } .lb-nav.next { grid-column: 3; grid-row: 2; }
.lb-strip { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; padding: 8px 18px 16px; justify-content: safe center; }
.lb-strip button { all: unset; cursor: pointer; width: 64px; height: 48px; border-radius: 7px; overflow: hidden; flex: none; opacity: .5;
  background: #1f2937; display: grid; place-items: center; font-size: .62rem; font-weight: 700; color: #9ca3af; outline: 2px solid transparent; transition: .15s; }
.lb-strip button img { width: 100%; height: 100%; object-fit: cover; }
.lb-strip button.on { opacity: 1; outline-color: #fff; }
.lb-strip button:hover { opacity: .9; }
body.lb-open { overflow: hidden; }

/* wyniki wyszukiwania */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none !important; }
.chip-link:hover { border-color: #c9d6ea; background: #fafbfc; }
.chip-link span span { display: block; color: var(--muted); font-size: .78rem; }
.folder-chip .icon { color: #6d8fc4; }
.sthumb { width: 46px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; }

@media (max-width: 860px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .folders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .folder-cover { height: 90px; }
  .topsearch { width: 100%; } .topsearch input { min-width: 0; }
  .lightbox { grid-template-columns: 0 1fr 0; }
  .lb-nav { position: absolute; top: 50%; } .lb-nav.prev { left: 8px; } .lb-nav.next { right: 8px; }
  .lb-strip { display: none; }
}
.gmeta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmeta .src { display: inline-block; }
.lightbox { background: rgba(9, 12, 22, .97); }
@media (max-width: 860px) { .gmeta { font-size: .72rem; } .browser .bar .tabs { order: 3; } }

/* ================= aplikacja mobilna (PWA) ================= */
.install-btn { width: 100%; margin-bottom: 12px; background: #22314d; border-color: #2c3d5c; color: #fff; justify-content: center; }
.install-btn:hover { background: #2a3b5c; border-color: #3a4d72; }
.install-btn[hidden], [data-install][hidden] { display: none; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem;
    font-weight: 600; color: var(--muted); text-decoration: none !important; padding: 4px 0; cursor: pointer; }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); }
  .tabbar .badge { position: absolute; top: -2px; left: 54%; margin: 0; min-width: 18px; height: 18px; font-size: .64rem; }
  .content { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
  .topbar { padding-top: max(14px, env(safe-area-inset-top)); }
  .burger { display: none; }
  .sidebar { padding-top: max(18px, env(safe-area-inset-top)); }
}
@media (display-mode: standalone) {
  .auth { padding-top: max(24px, env(safe-area-inset-top)); }
  [data-install] { display: none !important; }
}

/* logo BSK Cloud */
.brand.logo { flex-direction: column; align-items: flex-start; gap: 2px; padding: 2px 8px 16px; }
.brand.logo img { width: 132px; height: auto; display: block; }
.brand.logo small { display: block; font-weight: 500; color: #8a96ab; font-size: .74rem; padding-left: 4px; }
.logo-auth { justify-content: center; padding-bottom: 18px !important; }
.logo-auth img { width: 200px; height: auto; }

/* ================= akceptacja i komentarze ================= */
.review-pill { position: absolute; z-index: 2; left: 8px; bottom: 8px; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: #fff; box-shadow: 0 2px 8px rgba(16, 24, 40, .16); }
.review-pill.review { color: #b45309; } .review-pill.approved { color: #0a7a0a; } .review-pill.changes { color: var(--critical); }
.comment-count { position: absolute; z-index: 2; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: .72rem;
  font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #0f1729; color: #fff; }
.comment-count .icon { width: 13px; height: 13px; }
.browser.as-list .review-pill, .browser.as-list .comment-count { display: none; }

.lightbox { grid-template-columns: 64px 1fr 64px 360px; }
.lightbox.no-side { grid-template-columns: 64px 1fr 64px 0; }
.lb-top { grid-column: 1 / -1; }
.lb-side { grid-column: 4; grid-row: 2 / 4; background: #111827; border-left: 1px solid #1f2937; display: flex; flex-direction: column; min-height: 0; }
.lb-side[hidden] { display: none; }
.lb-review { padding: 14px 16px; border-bottom: 1px solid #1f2937; display: flex; flex-direction: column; gap: 10px; }
.lb-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 999px; align-self: flex-start; }
.lb-status.review { background: #3a2a06; color: #fbbf24; } .lb-status.approved { background: #0b3318; color: #4ade80; }
.lb-status.changes { background: #3b0d0d; color: #f87171; } .lb-status.none { background: #1f2937; color: #9ca3af; }
.lb-review .who { font-size: .76rem; color: #9ca3af; }
.lb-review .row { gap: 8px; }
.lb-review button { font: inherit; border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 650; cursor: pointer; flex: 1; }
.lb-approve { background: #16a34a; color: #fff; } .lb-approve:hover { background: #15803d; }
.lb-changes { background: #dc2626; color: #fff; } .lb-changes:hover { background: #b91c1c; }
.lb-neutral { background: #1f2937; color: #e5e7eb; } .lb-neutral:hover { background: #374151; }
.lb-comments { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.lb-comments .none { color: #6b7280; font-size: .85rem; text-align: center; padding: 20px 0; }
.lb-comment { display: flex; gap: 9px; }
.lb-comment .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #e34948; color: #fff; font-size: .72rem; font-weight: 800;
  display: grid; place-items: center; cursor: pointer; }
.lb-comment .n.general { background: #374151; }
.lb-comment .b { flex: 1; min-width: 0; background: #1f2937; border-radius: 10px; padding: 8px 10px; }
.lb-comment .meta { font-size: .7rem; color: #9ca3af; display: flex; gap: 6px; align-items: center; }
.lb-comment .meta button { margin-left: auto; background: none; border: 0; color: #9ca3af; cursor: pointer; font-size: .7rem; padding: 0; }
.lb-comment .meta button:hover { color: #fff; }
.lb-comment .t { white-space: pre-wrap; word-break: break-word; color: #e5e7eb; font-size: .88rem; }
.lb-comment.resolved { opacity: .45; } .lb-comment.resolved .t { text-decoration: line-through; }
.lb-comment.flash .b { outline: 2px solid #e34948; }
.lb-compose { border-top: 1px solid #1f2937; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.lb-compose textarea { background: #0b1220; border: 1px solid #263045; color: #f3f4f6; border-radius: 10px; resize: vertical; }
.lb-compose .lb-btn { padding: 7px 10px; font-size: .85rem; }
.lb-btn.primary-lb { background: var(--accent); border-color: var(--accent); }
.lb-btn.on { background: #e34948; border-color: #e34948; }
.lb-pinhint { font-size: .8rem; color: #fbbf24; }
.lb-canvas { position: relative; display: inline-block; max-width: 100%; max-height: 100%; line-height: 0; }
.lb-canvas img { max-width: 100%; max-height: calc(100vh - 190px); }
.lb-canvas.pinning { cursor: crosshair; }
.lb-pin { position: absolute; transform: translate(-50%, -100%); width: 28px; height: 28px; border-radius: 50% 50% 50% 0; rotate: -45deg;
  background: #e34948; border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); cursor: pointer; display: grid; place-items: center; }
.lb-pin span { rotate: 45deg; color: #fff; font-weight: 800; font-size: .74rem; line-height: 1; }
.lb-pin.resolved { background: #6b7280; }
.lb-pin.temp { background: #fbbf24; }
.lb-side-toggle { display: none; position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 3; }
@media (max-width: 860px) {
  .lightbox, .lightbox.no-side { grid-template-columns: 0 1fr 0 0; }
  .lb-side { position: fixed; left: 0; right: 0; bottom: 0; max-height: 70vh; z-index: 4; border-left: 0; border-top: 1px solid #1f2937;
    border-radius: 16px 16px 0 0; display: none; }
  .lightbox.side-open .lb-side:not([hidden]) { display: flex; }
  .lb-side-toggle { display: inline-flex; }
  .lightbox.no-side .lb-side-toggle { display: none; }
  .lb-canvas img { max-height: calc(100vh - 150px); }
}

/* ================= transfery: strona dla odbiorcy ================= */
body.tpage { min-height: 100vh; margin: 0; display: flex; align-items: center; padding: 32px clamp(16px, 5vw, 72px); position: relative; overflow-x: hidden; }
.t-bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.t-bg-default { background: radial-gradient(1100px 700px at 85% 15%, #2a78d6 0%, transparent 60%), radial-gradient(900px 600px at 70% 95%, #6250d6 0%, transparent 55%),
  linear-gradient(135deg, #0b1630 0%, #102a5c 55%, #0a1a3d 100%); }
.t-shade { position: fixed; inset: 0; z-index: 0; background: linear-gradient(90deg, rgba(8, 12, 24, .35) 0%, rgba(8, 12, 24, .05) 60%); }
.t-card { position: relative; z-index: 1; width: min(420px, 100%); background: rgba(255, 255, 255, .97); border-radius: 22px; padding: 26px 26px 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35); backdrop-filter: blur(6px); animation: rise .4s ease-out; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.t-logo img { width: 128px; height: auto; display: block; margin-bottom: 14px; }
.t-kicker { color: var(--accent); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 4px; }
.t-card h1 { font-size: 1.45rem; line-height: 1.25; }
.t-message { white-space: pre-wrap; color: var(--ink-2); background: #f6f8fb; border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; }
.t-summary { color: var(--muted); font-size: .84rem; margin: 14px 0 8px; }
.t-files { list-style: none; margin: 0 0 16px; padding: 0; max-height: 46vh; overflow-y: auto; border-top: 1px solid var(--line-2); }
.t-files li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.t-thumb { all: unset; cursor: zoom-in; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex: none; background: #eef2f7; }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-fname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-fname b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-fname span { color: var(--muted); font-size: .78rem; }
.t-files .iconbtn { box-shadow: none; background: var(--line-2); }
.big-btn { width: 100%; padding: 13px 18px; font-size: 1rem; border-radius: 12px; }
.t-note { color: var(--muted); font-size: .76rem; text-align: center; margin: 10px 0 0; }
.t-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: .76rem; color: var(--muted); text-align: center; }
.t-credit { position: fixed; right: 18px; bottom: 14px; z-index: 1; color: rgba(255, 255, 255, .85); font-size: .78rem; font-weight: 600;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.t-preview { position: fixed; inset: 0; z-index: 50; background: rgba(9, 12, 22, .94); display: grid; place-items: center; padding: 24px; }
.t-preview[hidden] { display: none; }
.t-preview img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.t-preview .lb-btn { position: absolute; top: 16px; right: 16px; }
@media (max-width: 600px) { body.tpage { align-items: flex-end; padding: 16px 10px calc(16px + env(safe-area-inset-bottom)); }
  .t-card { padding: 20px 18px 14px; } .t-credit { display: none; } }

/* tła w panelu */
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.bg-tile { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; }
.bg-tile img { width: 100%; height: 100%; object-fit: cover; }
.bg-tile form { position: absolute; top: 6px; right: 6px; }
/* ikona w podglądzie pliku bez miniatury nie może przykrywać przycisków */
.lb-empty .gicon { position: static; inset: auto; color: #94a3b8; }

/* ================= zaznaczanie wielu plików ================= */
.gcheck { position: absolute; z-index: 4; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 8px rgba(16, 24, 40, .16); display: grid; place-items: center; opacity: 0; transition: opacity .15s; cursor: pointer; }
.gcheck input { width: 17px; height: 17px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.gcard:hover .gcheck, .browser.selecting .gcheck { opacity: 1; }
.gcard.selected { outline: 3px solid var(--accent); outline-offset: -1px; }
.gcard.selected .gthumb img { opacity: .82; }
.browser.selecting .gthumb { cursor: pointer; }
.browser.selecting .gactions { display: none; }
.bulkbar { position: sticky; top: 8px; z-index: 15; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px;
  background: #0f1729; color: #fff; border-radius: 12px; box-shadow: 0 10px 28px rgba(16, 24, 40, .22); }
.bulkbar[hidden] { display: none; }
.bulkbar select { width: auto; max-width: 260px; padding: 6px 8px; font-size: .85rem; }
.bulkbar .btn-sm.ghost { color: #cbd5e1; }
.bulkbar .btn-sm.ghost:hover { background: #1f2a40; }
.browser.as-list .gcheck { position: static; opacity: 1; box-shadow: none; background: none; margin-right: 6px; }
.pick-row { margin-top: -4px; }
.folder-pick { position: relative; cursor: pointer; }
.folder-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
@media (hover: none) { .gcheck { opacity: 1; } }

/* ================= duże wysyłki, połączenie, import ================= */
.grow-btn { flex: 1; }
.upload-status { font-size: .84rem; color: var(--ink-2); background: #f6f8fb; border-radius: 10px; padding: 8px 11px; line-height: 1.45; }
.upload-status b { font-variant-numeric: tabular-nums; }
.upload-status .err { color: var(--critical); }
.conn { font-size: .78rem; font-weight: 650; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.conn.lan { background: #e7f6e7; color: #0a7a0a; }
.conn.net { background: #eef2f7; color: #475569; }
.import-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.import-list label { flex-direction: row; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-weight: 500; cursor: pointer; }
.import-list label:hover { background: #f6f8fb; }
.import-list label .icon { color: #6d8fc4; }
.import-list label .meta { margin-left: auto; color: var(--muted); font-size: .8rem; font-weight: 400; white-space: nowrap; }
.import-job { margin-top: 14px; padding: 12px; border-radius: 12px; background: #f6f8fb; display: flex; flex-direction: column; gap: 6px; }
.import-job[hidden] { display: none; }
.import-job progress { width: 100%; height: 10px; }
.folder-pick { flex-direction: row; font-weight: 550; color: var(--ink); }
