/* Praca EMCLAT – wygląd aplikacji */
:root {
  --accent: #7B3FA0;
  --accent-2: #C2185B;
  --accent-soft: #F1E8F7;
  --bg: #F6F4F8;
  --panel: #FFFFFF;
  --line: #E6E1EB;
  --line-2: #D7D0DE;
  --text: #1F1A24;
  --muted: #6E6577;
  --danger: #C62828;
  --warn: #E07B00;
  --ok: #2E7D32;
  --col: #EEEAF2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 26, 36, .08), 0 1px 1px rgba(31, 26, 36, .04);
  --shadow-lg: 0 12px 40px rgba(31, 26, 36, .18);
  --sidebar: 264px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
code, pre.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; background: #F3EFF6; border-radius: 6px; padding: 2px 6px; }
pre.code { padding: 10px 12px; white-space: pre-wrap; word-break: break-all; }

/* ---------- przyciski i pola ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2);
  background: var(--panel); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #F7F4FA; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #6A3290; }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(31, 26, 36, .06); }
.btn.sm { padding: 4px 9px; font-size: .86rem; }
.btn.full { width: 100%; }
.btn.icon { padding: 6px 8px; }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=url], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 63, 160, .14); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: .86rem; color: var(--muted); margin-bottom: 10px; }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); font-size: .95rem; }
label.inline { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .93rem; }
label.inline input { width: auto; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.hstack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- logowanie / instalacja ---------- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px;
  background: linear-gradient(135deg, #F8EEF6 0%, #EFE7F6 60%, #F6F4F8 100%); }
.auth-box { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px; width: 100%; max-width: 380px; }
.auth-box.wide { max-width: 560px; }
.auth-box h1 { text-align: center; margin-bottom: 18px; }
.auth-box h3 { margin-top: 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-mark.big { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 14px; margin: 0 auto 12px; }
.error-box { background: #FDECEA; color: #8E1C1C; border-radius: 8px; padding: 9px 12px; font-size: .92rem; }
.ok-box { background: #E8F5E9; color: #1B5E20; border-radius: 8px; padding: 9px 12px; }
.checks { list-style: none; padding: 0; margin: 0 0 10px; font-size: .9rem; }
.checks .ok { color: var(--ok); } .checks .bad { color: var(--danger); }

/* ---------- układ ---------- */
#app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
#sidebar { width: var(--sidebar); flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden; }
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line);
  min-height: 56px; flex-wrap: nowrap; }
#topbar select, #topbar input { flex-shrink: 1; min-width: 0; }
#view { flex: 1; overflow: auto; position: relative; }
.loading { padding: 40px; color: var(--muted); text-align: center; }
#scrim { display: none; }

.sb-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sb-head strong { font-size: 1.02rem; }
.sb-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); cursor: pointer;
  font-size: .94rem; user-select: none; }
.sb-link:hover { background: #F4F0F7; text-decoration: none; }
.sb-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sb-link .ico { width: 20px; text-align: center; opacity: .85; }
.sb-link .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 10px; font-size: .74rem; padding: 0 7px; font-weight: 600; }
.sb-section { margin-top: 14px; }
.sb-space { display: flex; align-items: center; gap: 8px; padding: 6px 10px; font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); cursor: pointer; }
.sb-space .dot { width: 10px; height: 10px; border-radius: 3px; }
.sb-space .add { margin-left: auto; opacity: 0; font-size: 1.1rem; line-height: 1; color: var(--muted); }
.sb-space:hover .add { opacity: 1; }
.sb-board { padding-left: 28px; }
.sb-board .bdot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sb-foot { border-top: 1px solid var(--line); padding: 8px; }
.me-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }

.hamburger { display: none; }
.tb-title { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 0; max-width: 40%; }
.tb-title .crumb { color: var(--muted); font-weight: 500; font-size: .9rem; }
.tb-title .tdot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.tb-title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; background: #F1EDF4; border-radius: 9px; padding: 3px; }
.seg button { white-space: nowrap; border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; font-size: .88rem; color: var(--muted); font-weight: 500; }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.bell { position: relative; }
.bell .dotn { position: absolute; top: 1px; right: 1px; background: var(--accent-2); color: #fff; font-size: .68rem; border-radius: 8px; padding: 0 5px; font-weight: 700; }
.search-box { width: 190px; flex-shrink: 1; min-width: 120px; }
.search-box input { padding: 6px 10px; }

/* ---------- awatary, etykiety, odznaki ---------- */
.av { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0; border: 2px solid #fff; }
.av.lg { width: 32px; height: 32px; font-size: .8rem; }
.avs { display: flex; } .avs .av + .av { margin-left: -7px; }
.lbl { display: inline-block; height: 8px; min-width: 36px; border-radius: 4px; }
.lbl-full { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 6px; color: #fff; font-size: .78rem; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); padding: 1px 6px; border-radius: 5px; }
.badge.due { background: #F1EDF4; }
.badge.due.soon { background: #FFF3E0; color: #A65200; }
.badge.due.over { background: #FDECEA; color: var(--danger); font-weight: 600; }
.badge.due.done { background: #E8F5E9; color: var(--ok); }
.badge.money { color: #4A3A57; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: #F1EDF4; border-radius: 20px; padding: 2px 10px; font-size: .82rem; }
.pill .dot { width: 8px; height: 8px; border-radius: 3px; }

/* ---------- tablica ---------- */
.board { display: flex; align-items: flex-start; gap: 12px; padding: 16px; height: 100%; overflow-x: auto; }
.column { background: var(--col); border-radius: 12px; width: 286px; flex-shrink: 0; display: flex; flex-direction: column; max-height: 100%; }
.column.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px 12px; cursor: grab; }
.col-head h3 { margin: 0; font-size: .92rem; flex: 1; overflow-wrap: anywhere; }
.col-head .n { color: var(--muted); font-size: .8rem; font-weight: 600; }
.col-rule { padding: 0 12px 6px; font-size: .74rem; color: var(--muted); }
.col-rule span { background: rgba(255, 255, 255, .7); border-radius: 5px; padding: 1px 6px; margin-right: 4px; }
.col-cards { padding: 2px 8px 6px; overflow-y: auto; min-height: 12px; display: flex; flex-direction: column; gap: 7px; }
.col-foot { padding: 4px 8px 8px; }
.col-foot .btn { width: 100%; justify-content: flex-start; color: var(--muted); }
.col-new { width: 286px; flex-shrink: 0; }

.tile { background: #fff; border-radius: 9px; box-shadow: var(--shadow); padding: 9px 10px; cursor: pointer; border: 1px solid transparent;
  display: flex; flex-direction: column; gap: 6px; position: relative; }
.tile:hover { border-color: var(--line-2); }
.tile.dragging { opacity: .45; }
.tile.done .t-title { color: var(--muted); text-decoration: line-through; }
.tile .t-labels { display: flex; gap: 4px; flex-wrap: wrap; }
.tile .t-title { font-size: .93rem; overflow-wrap: anywhere; }
.tile .t-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tile .t-meta .avs { margin-left: auto; }
.tile .t-client { font-size: .8rem; color: var(--muted); }
.drop-line { height: 3px; background: var(--accent); border-radius: 2px; margin: -2px 0; }
.quick-add textarea { min-height: 60px; margin-bottom: 6px; }

/* ---------- lista / tabela ---------- */
.page { padding: 18px 22px 40px; max-width: 1200px; }
.page.narrow { max-width: 860px; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
table.grid th, table.grid td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
table.grid th { background: #FAF8FB; color: var(--muted); font-weight: 600; font-size: .8rem; cursor: pointer; user-select: none; white-space: nowrap; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:hover td { background: #FBF9FC; }
table.grid td.num, table.grid th.num { text-align: right; white-space: nowrap; }
.empty { padding: 30px; text-align: center; color: var(--muted); background: #fff; border-radius: 12px; border: 1px dashed var(--line-2); }

/* ---------- Moje zadania ---------- */
.group { margin-bottom: 22px; }
.group h2 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.group h2 .n { color: var(--muted); font-weight: 500; }
.group.over h2 { color: var(--danger); }
.task-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 10px; padding: 9px 12px; box-shadow: var(--shadow);
  margin-bottom: 6px; cursor: pointer; }
.task-row:hover { box-shadow: 0 2px 8px rgba(31, 26, 36, .12); }
.task-row .tr-main { flex: 1; min-width: 0; }
.task-row .tr-title { font-weight: 500; overflow-wrap: anywhere; }
.task-row .tr-sub { font-size: .8rem; color: var(--muted); }
.task-row .sdot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.task-row .tr-sub .sdot { width: 8px; height: 8px; margin-right: 5px; vertical-align: 0; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex-shrink: 0; cursor: pointer; display: flex;
  align-items: center; justify-content: center; background: #fff; }
.check:hover { border-color: var(--ok); }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; font-size: .7rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat .v { font-size: 1.5rem; font-weight: 700; }
.stat .k { font-size: .8rem; color: var(--muted); }
.stat.red .v { color: var(--danger); }

/* ---------- kalendarz ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h2 { margin: 0; min-width: 180px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.cal .dow { background: #FAF8FB; padding: 6px 8px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.cal .day { background: #fff; min-height: 110px; padding: 5px 6px; display: flex; flex-direction: column; gap: 3px; }
.cal .day.other { background: #FBFAFC; }
.cal .day.other .dn { color: #B9B2C0; }
.cal .day.today .dn { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; }
.cal .dn { font-size: .8rem; font-weight: 600; align-self: flex-start; }
.cal .ev { font-size: .76rem; padding: 2px 6px; border-radius: 5px; color: #fff; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.event { border: 1.5px dashed rgba(255, 255, 255, .9); }
.cal .ev.done { opacity: .5; text-decoration: line-through; }
.cal .ev.meet { background: #F1F3F4; color: #3C4043; border-left: 3px solid #5F6368; border-radius: 4px; }
.mail-row.unread .tr-title { font-weight: 700; }
.cal .more { font-size: .74rem; color: var(--muted); cursor: pointer; }

/* ---------- okna (modal) ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(31, 26, 36, .42); display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; position: relative; }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 8px; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-body { padding: 8px 18px 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 18px 18px; }
.x { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.x:hover { background: #F1EDF4; }

/* karta – szczegóły */
.card-modal .cm-top { display: flex; gap: 10px; align-items: flex-start; padding: 16px 18px 4px; }
.card-modal .cm-title { flex: 1; font-size: 1.25rem; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -8px;
  resize: none; min-height: 0; overflow: hidden; }
.card-modal .cm-title:hover { border-color: var(--line); }
.card-modal .cm-where { padding: 0 18px 10px; font-size: .86rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-modal .cm-grid { display: grid; grid-template-columns: 1fr 260px; gap: 20px; padding: 6px 18px 20px; }
.cm-section { margin-bottom: 18px; }
.cm-section > h4 .btn { text-transform: none; letter-spacing: 0; font-size: .84rem; }
.cm-section > h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.cm-side label { margin-bottom: 9px; }
.cm-side .field-title { font-size: .78rem; color: var(--muted); margin: 10px 0 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.desc-view { background: #FAF8FB; border-radius: 8px; padding: 10px 12px; min-height: 50px; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; font-size: .93rem; }
.desc-view.empty-desc { color: var(--muted); }
.member-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.member-pick .mp { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 20px; border: 1px solid var(--line-2);
  cursor: pointer; font-size: .84rem; background: #fff; }
.member-pick .mp.on { background: var(--accent-soft); border-color: var(--accent); }
.member-pick .mp .av { width: 22px; height: 22px; font-size: .64rem; border: 0; }
.label-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.label-pick .lp { padding: 3px 10px; border-radius: 6px; color: #fff; font-size: .8rem; font-weight: 600; cursor: pointer; opacity: .38; border: 0; }
.label-pick .lp.on { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(31, 26, 36, .25); }
.cl-block { margin-bottom: 14px; }
.cl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cl-head strong { flex: 1; }
.progress { height: 6px; background: #EEE9F2; border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.progress > div { height: 100%; background: var(--ok); }
.cl-item { display: flex; align-items: flex-start; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.cl-item:hover { background: #FAF8FB; }
.cl-item input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--ok); flex-shrink: 0; }
.cl-item .txt { flex: 1; overflow-wrap: anywhere; font-size: .93rem; }
.cl-item.done .txt { color: var(--muted); text-decoration: line-through; }
.cl-item .who { font-size: .72rem; }
.cl-item .acts { opacity: 0; display: flex; gap: 2px; }
.cl-item:hover .acts { opacity: 1; }
.comment { display: flex; gap: 10px; margin-bottom: 12px; }
.comment .cbody { flex: 1; background: #FAF8FB; border-radius: 10px; padding: 8px 11px; }
.comment .cmeta { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.comment .ctext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; }
.att { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.att a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-log { font-size: .8rem; color: var(--muted); }
.drive-frame { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: block; }
.att-prev { padding: 6px 0 10px; }
.act-log div { padding: 3px 0; }
.mention-box { position: absolute; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 70; max-height: 200px; overflow-y: auto; }
.mention-box div { padding: 6px 12px; cursor: pointer; font-size: .9rem; }
.mention-box div:hover, .mention-box div.sel { background: var(--accent-soft); }

/* menu rozwijane */
.menu { position: fixed; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); z-index: 80; min-width: 220px; padding: 6px; }
.menu button, .menu a { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: .92rem; color: var(--text); }
.menu button:hover, .menu a:hover { background: #F4F0F7; text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu .danger { color: var(--danger); }

/* powiadomienia */
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .9rem; border-radius: 6px; }
.notif:hover { background: #FAF8FB; }
.notif.unread { background: #F7F1FB; }
.notif .when { font-size: .76rem; color: var(--muted); }

/* zakładki ustawień */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 9px 12px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.panel { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.panel h3 { margin-bottom: 10px; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; }
.swatches button.on { border-color: var(--text); }

/* komunikaty */
#toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #2A2230; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .92rem; max-width: 90vw; }
.toast.err { background: var(--danger); }

/* ---------- telefon ---------- */
@media (max-width: 1180px) { .search-box { display: none; } }
@media (max-width: 900px) {
  #sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-105%); transition: transform .2s; }
  body.sb-open #sidebar { transform: none; box-shadow: var(--shadow-lg); }
  #topbar { flex-wrap: wrap; row-gap: 6px; }
  #topbar .seg button { padding: 4px 9px; }
  #topbar select { font-size: .85rem; padding: 5px 8px; max-width: 46%; }
  #ftext { display: none; }
  #quickadd { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; width: 56px; height: 56px; border-radius: 50%;
    font-size: 0; box-shadow: 0 6px 18px rgba(123, 63, 160, .45); }
  #quickadd::before { content: '+'; font-size: 1.9rem; font-weight: 400; line-height: 1; }
  .tb-title { flex: 1 1 calc(100% - 120px); }
  .tb-title .crumb { display: none; }
  #topbar > * { order: 3; }
  #topbar > .hamburger { order: 0; } #topbar > .tb-title { order: 1; } #topbar > #bell { order: 2; }
  #topbar > .spacer { display: none; }
  body.sb-open #scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 55; }
  .hamburger { display: inline-flex; }
  #topbar { padding: 8px 10px; gap: 6px; }
  .search-box { display: none; }
  .board { padding: 10px; scroll-snap-type: x mandatory; }
  .column, .col-new { width: 84vw; scroll-snap-align: start; }
  .card-modal .cm-grid { grid-template-columns: 1fr; }
  .modal-wrap { padding: 0; }
  .modal, .modal.wide { border-radius: 0; min-height: 100%; max-width: none; }
  .page { padding: 12px 12px 40px; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .cal .day { min-height: 70px; }
  .cal .ev { font-size: .68rem; padding: 1px 3px; }
  table.grid .hide-m { display: none; }
}

/* ---------- aplikacja na telefon i komputer (1.3) ---------- */
.app-howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.app-howto > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; background: #FBFAFC; }
.app-howto > div.on { border-color: var(--accent); background: var(--accent-soft); order: -1; }
.app-howto h4 { margin: 2px 0 6px; font-size: .95rem; }
.app-howto ol { margin: 0; padding-left: 18px; }
.app-howto li { margin: 3px 0; }
.dev-list { display: flex; flex-direction: column; gap: 6px; }
.dev { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
/* bezpieczne marginesy (iPhone z wycięciem, pasek gestów) */
#topbar { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
#sidebar { padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); }
#toast-root { bottom: calc(18px + env(safe-area-inset-bottom)); }
@media (max-width: 900px) {
  #topbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
}
/* w zainstalowanej aplikacji: bez podświetlania przy stuknięciu i bez „gumowego” przewijania całej strony */
@media (display-mode: standalone) {
  html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
}
