/* IQ Tasks styles. How this file is organised:
   1. Tokens (:root) – the only place for raw colours, sizes, radii, shadows and layers; dark theme below it.
   2. Base and app layout (rail, top bar, tab bar).
   3. Shared components: page head, buttons, inputs and chips, list rows, badges, sheets, forms, toast.
   4. Feature modules further down (workspace, editor, calendar, service, client card, photos, plans, documents, CRM).
   Rules: components and modules use tokens (var(--…)), never hex, px font sizes or bare z-index numbers;
   a module arranges shared components and does not restyle them; new components go to section 3
   and to the style guide page (#/styleguide). */
:root {
  --bg: #f5f6f8; --card: #fff; --text: #1a1f2b; --muted: #6b7385; --border: #e2e5ec; --accent: #1d4ed8; --on-accent: #fff;
  --mono: ui-monospace, Menlo, Consolas, monospace; --qr-bg: #fff; /* kod QR: zawsze białe tło, także w ciemnym motywie */
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--card));
  --red: #c92a2a; --green: #2b8a3e; --amber: #e8890c; --blue: #5c7cfa; --shadow: 0 1px 2px rgba(20,30,50,.06), 0 4px 14px rgba(20,30,50,.06);
  /* semantic colours: use these in components, never raw hex */
  --danger: var(--red); --warn: var(--amber); --ok: var(--green); --info: var(--blue);
  --pr-1: var(--info); --pr-2: var(--warn); --pr-3: var(--danger);
  --st-new: var(--danger); --st-progress: var(--warn); --st-done: var(--ok); --st-billed: var(--muted);
  /* type scale (× --fz, the user's text size) */
  --fs-2xs: calc(10px * var(--fz)); --fs-xs: calc(11px * var(--fz)); --fs-sm: calc(12px * var(--fz)); --fs-md: calc(13px * var(--fz)); --fs-base: calc(14px * var(--fz));
  --fs-body: calc(15px * var(--fz)); --fs-lg: calc(17px * var(--fz)); --fs-xl: calc(18px * var(--fz)); --fs-2xl: calc(20px * var(--fz)); --fs-3xl: calc(24px * var(--fz)); --fs-icon: calc(26px * var(--fz));
  /* corner radius (× --rd, the user's roundness) */
  --r-xs: calc(4px * var(--rd)); --r-sm: calc(6px * var(--rd)); --r-md: calc(8px * var(--rd)); --r-lg: calc(10px * var(--rd)); --r-xl: calc(12px * var(--rd)); --r-2xl: calc(14px * var(--rd)); --r-3xl: calc(16px * var(--rd)); --r-pill: 999px;
  /* spacing: padding, margin, gap in new code */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  /* elevation: --shadow = cards (none in dark), then menus, floating panels, windows; --scrim = backdrop under a window */
  --shadow-pop: 0 6px 22px rgba(0,0,0,.18); --shadow-float: 0 14px 40px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.15); --shadow-modal: 0 24px 60px rgba(0,0,0,.35);
  --scrim: rgba(10,14,24,.5);
  /* layers, bottom to top (sheets opened from an overlay go to --z-overlay + 10) */
  --z-nav: 20; --z-selbar: 90; --z-sheet: 100; --z-overlay: 250; --z-toast: 300; --z-progress: 310; --z-dialog: 400; --z-drag: 500; --z-dropline: 600; --z-menu: 1000; --z-search: 1100; --z-top: 1200;
  /* breakpoints (CSS has no variables in @media): phone < 600px, tablet 600–899px, desktop ≥ 900px */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --font-head: var(--font);
  --fz: 1; --rd: 1; --dn: 1; --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.4,.5,1);
  --tab-h: 58px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --bg: #11141a; --card: #1a1f29; --text: #e8ebf2; --muted: #98a1b3; --border: #2b3240; --accent: #6b93ff; --on-accent: #fff; --red: #ff7a7a; --green: #5fd07a; --amber: #ffb24d; --blue: #8c9eff; --shadow: none; color-scheme: dark; }
}
:root[data-theme=dark] { --bg: #11141a; --card: #1a1f29; --text: #e8ebf2; --muted: #98a1b3; --border: #2b3240; --accent: #6b93ff; --red: #ff7a7a; --green: #5fd07a; --amber: #ffb24d; --blue: #8c9eff; --shadow: none; color-scheme: dark; }
/* ===== base and app layout ===== */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-body); line-height: 1.45; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.app { display: flex; height: 100dvh; }
.side { display: none; width: 210px; background: var(--card); border-right: 1px solid var(--border); padding: 18px 12px; flex-direction: column; gap: 14px; }
.brand, .brand-m { font-weight: 700; font-size: var(--fs-xl); display: flex; align-items: center; gap: 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-lg); color: var(--text); text-decoration: none; }
.side nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-t)) 16px 8px; background: var(--card); border-bottom: 1px solid var(--border); }
#view { flex: 1; overflow-y: auto; padding: 14px 16px calc(var(--tab-h) + var(--safe-b) + 24px); max-width: 980px; width: 100%; margin: 0 auto; -webkit-overflow-scrolling: touch; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--card); border-top: 1px solid var(--border); display: flex; z-index: var(--z-nav); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: var(--fs-xs); color: var(--muted); text-decoration: none; }
.tabbar a .ni { font-size: var(--fs-xl); line-height: 1; }
.tabbar a.active { color: var(--accent); font-weight: 600; }
@media (min-width: 900px) {
  .side { display: flex; } .top { display: none; } .tabbar { display: none; }
  #view { padding: 24px 28px 40px; }
}
.sync { width: 9px; height: 9px; border-radius: 50%; background: #9aa3b5; display: inline-block; }
.sync.ok { background: var(--green); } .sync.syncing { background: var(--amber); } .sync.error { background: var(--red); } .sync.offline { background: var(--muted); }

/* ===== shared components ===== */
/* page head */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.page-head h1 { font-size: var(--fs-3xl); margin: 0; line-height: 1.15; }
.page-head h1 small { display: block; font-size: var(--fs-md); font-weight: 400; color: var(--muted); }
.page-head.sub { margin-top: 18px; } .page-head h2 { font-size: var(--fs-lg); margin: 0; }
.daynav { display: flex; align-items: center; gap: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* buttons: .btn (+ .small .primary .danger .danger-solid), .icon-btn (+ .tiny) */
.btn { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 9px 14px; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.btn.small { padding: 5px 11px; min-height: 34px; font-size: var(--fs-base); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn.primary { box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent), 0 4px 12px -4px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn.primary:active { box-shadow: none; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.danger-solid:hover { filter: brightness(1.08); }
.btn .ic { width: 16px; height: 16px; margin-right: 2px; vertical-align: -3px; }
.btn.small .ic { width: 15px; height: 15px; }
.icon-btn { background: transparent; border: none; font-size: var(--fs-icon); line-height: 1; padding: 4px 10px; color: var(--muted); border-radius: var(--r-md); min-width: 40px; min-height: 40px; }
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn.tiny { min-width: 30px; min-height: 30px; font-size: var(--fs-xl); padding: 0 6px; display: inline-grid; place-items: center; }
.icon-btn .ic { width: 18px; height: 18px; } .icon-btn.tiny .ic { width: 15px; height: 15px; }
.check .ic { width: 16px; height: 16px; vertical-align: 0; } .check.small .ic { width: 13px; height: 13px; }

/* search field, filter chips */
.search { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--card); margin: 4px 0 8px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .gap { flex: 1; }
.pill { white-space: nowrap; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 5px 13px; font-size: var(--fs-base); }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill[style].on { background: var(--c); border-color: var(--c); }

/* list rows: .row (+ .small .done .p1–.p3 .visit), round .check, tinted .chip, .badge */
.sec { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 2px 6px; }
.sec.red { color: var(--red); }
.row { display: flex; align-items: flex-start; gap: 12px; padding: calc(11px * var(--dn)) 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); margin-bottom: 6px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .18s, box-shadow .22s var(--ease), background-color .18s, opacity .2s; content-visibility: auto; contain-intrinsic-size: auto 52px; /* long lists stay fast: rows off screen are not laid out */ }
.row.small { box-shadow: none; padding: calc(8px * var(--dn)) 10px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; overflow-wrap: anywhere; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.row-meta:empty { display: none; }
.row.done .row-title { text-decoration: line-through; color: var(--muted); }
.row.p3 { border-left: 4px solid var(--pr-3); } .row.p2 { border-left: 4px solid var(--pr-2); } .row.p1 { border-left: 4px solid var(--pr-1); }
.check { width: 26px; height: 26px; min-width: 26px; border-radius: 50%; border: 2px solid var(--muted); background: transparent; color: #fff; font-size: var(--fs-base); display: flex; align-items: center; justify-content: center; padding: 0; margin-top: 1px; transition: background .18s, border-color .18s, transform .22s var(--spring); }
.row.done .check { background: var(--green); border-color: var(--green); }
.chip { background: color-mix(in srgb, var(--c, var(--muted)) 16%, transparent); color: var(--c, var(--muted)); padding: 0 8px; border-radius: var(--r-pill); }
.late { color: var(--red); font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; }
.vtime { width: 46px; font-weight: 700; font-variant-numeric: tabular-nums; } .vtime small { display: block; font-weight: 400; color: var(--muted); }
.row.visit { border-left: 4px solid var(--accent); }
.row.visit.v-done { opacity: .65; }
.badge { font-size: var(--fs-xs); font-weight: 600; padding: 1px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.b-new { --c: var(--st-new); } .b-inprogress { --c: var(--st-progress); } .b-done { --c: var(--st-done); } .b-billed, .b-cancelled { --c: var(--st-billed); } .b-urgent { --c: var(--danger); }
/* status badges: one tinted recipe for every colour, readable in light, dark and auto */
.badge.b-new, .badge.b-inprogress, .badge.b-done, .badge.b-billed, .badge.b-cancelled, .badge.b-urgent { background: color-mix(in srgb, var(--c) 16%, var(--card)); color: color-mix(in srgb, var(--c) 72%, var(--text)); }
.print-only, .print-show { display: none; }

/* month calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: var(--fs-sm); color: var(--muted); padding: 4px 0; }
.cal .day { min-height: 58px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 5px; display: flex; flex-direction: column; align-items: flex-start; position: relative; }
.cal .day.out { opacity: .4; } .cal .day.today .n { background: var(--accent); color: var(--on-accent); border-radius: var(--r-pill); padding: 0 6px; }
.cal .day.sel { outline: 2px solid var(--accent); }
.cal .n { font-size: var(--fs-md); font-weight: 600; } .cal .dots { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 3px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); } .dot.v { background: var(--accent); }
.cal .cnt { position: absolute; right: 6px; bottom: 3px; font-size: var(--fs-xs); color: var(--muted); }

/* sheets */
.sheet-back { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-sheet); display: flex; align-items: flex-end; justify-content: center; animation: fadein .2s ease-out both; }
.sheet { background: var(--card); width: 100%; max-height: 96dvh; border-radius: var(--r-3xl) var(--r-3xl) 0 0; display: flex; flex-direction: column; box-shadow: 0 -8px 40px rgba(0,0,0,.25); animation: sheetup .32s var(--ease) both; }
.sheet-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--border); }
.sheet-head h2 { flex: 1; font-size: var(--fs-lg); margin: 0; }
.sheet-body { overflow-y: auto; padding: 14px 16px 24px; -webkit-overflow-scrolling: touch; }
.sheet-foot { border-top: 1px solid var(--border); padding: 10px 16px calc(10px + var(--safe-b)); }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { width: 760px; max-height: 90vh; border-radius: var(--r-3xl); } }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, .field { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.form label > *:not(span), .form .field > *:not(.lbl) { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: var(--fs-body); color: var(--text); }
.form input[type=text], .form input[type=date], .form input[type=time], .form input[type=tel], .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=url], .form select, .form textarea, .settings input[readonly], .dlg-input {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.form input:focus, .form select:focus, .form textarea:focus, .dlg-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* own list / date / time field (IQ.enhanceFields in pickers.js): the native control stays underneath, transparent */
.fx { position: relative; display: block; min-width: 0; }
.fx > select, .fx > input { position: absolute !important; inset: 0; width: 100%; height: 100%; min-height: 0 !important; opacity: 0; pointer-events: none; }
.fx-btn { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 42px; padding: 9px 10px 9px 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); font-size: var(--fs-body); font-weight: 400; text-transform: none; letter-spacing: 0; text-align: left; cursor: pointer; }
.fx-btn .fx-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-btn.empty .fx-val { color: var(--muted); }
.fx-btn .ic { flex: none; width: 20px; height: 20px; color: var(--muted); }
.fx-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.fx-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.fx-btn:disabled { opacity: .55; cursor: default; }
.fx-pop { display: flex; flex-direction: column; gap: var(--sp-2); }
.fx-list { display: flex; flex-direction: column; max-height: min(320px, 50dvh); overflow-y: auto; margin: 0 calc(-1 * var(--sp-1)); }
.fx-opt { display: flex; align-items: center; gap: var(--sp-2); min-height: 38px; padding: 6px 10px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.fx-opt span { flex: 1; min-width: 0; }
.fx-opt:hover, .fx-opt:focus-visible { background: var(--accent-soft); outline: none; }
.fx-opt.on { color: var(--accent); font-weight: 600; }
.fx-opt .ic { width: 18px; height: 18px; color: var(--accent); }
.fx-opt:disabled { opacity: .45; cursor: default; }
.fx-times { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-1); max-height: 210px; overflow-y: auto; }
.fx-times .fx-opt { justify-content: center; padding: 6px 4px; font-variant-numeric: tabular-nums; }
.fx-times .fx-opt.on { background: var(--accent); color: var(--on-accent); }
.fx-acts { justify-content: flex-end; }
.fx-none { padding: 6px 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.chk-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .chk-row input[type=checkbox] { width: 22px; height: 22px; } .chk-row input[type=text] { flex: 1; }
.hint { font-size: var(--fs-md); color: var(--muted); } .hint.center { text-align: center; } .muted { color: var(--muted); } .err { color: var(--red); }
.infocard { background: var(--accent-soft); border-radius: var(--r-xl); padding: 10px 14px; line-height: 1.6; }
.infocard details { margin-top: 6px; } .infocard summary { cursor: pointer; font-weight: 600; }
.timerbox { background: var(--bg); border-radius: var(--r-xl); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; } .photos figure { position: relative; margin: 0; } .photos img { width: 92px; height: 92px; object-fit: cover; border-radius: var(--r-lg); display: block; }
.photos figure .icon-btn { position: absolute; top: 0; right: 0; background: rgba(0,0,0,.55); color: #fff; min-width: 28px; min-height: 28px; font-size: var(--fs-xl); padding: 0 6px; border-radius: 0 var(--r-lg) 0 var(--r-lg); }
.sig { width: 100%; height: 130px; background: #fff; border: 1px dashed var(--muted); border-radius: var(--r-lg); touch-action: none; }
.settings .card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: 14px 16px; margin-bottom: 12px; }
.settings h3 { margin: 0 0 8px; font-size: var(--fs-lg); }
.code { background: var(--bg); padding: 10px; border-radius: var(--r-md); font-size: var(--fs-sm); overflow-x: auto; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translateX(-50%); background: #222; color: #fff; padding: 10px 10px 10px 16px; border-radius: var(--r-xl); z-index: var(--z-toast);
  display: flex; align-items: center; gap: 14px; animation: toastin .2s ease-out; box-shadow: var(--shadow-float); max-width: min(92vw, 520px); }

/* rich text */
.rte { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; padding: 5px; border-bottom: 1px solid var(--border); position: sticky; top: -14px; background: var(--card); border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 2; }
.rte-toolbar button, .rte-toolbar select { min-width: 34px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: var(--r-md); padding: 0 7px; font-size: var(--fs-base); color: var(--text); }
.rte-toolbar select { border-color: var(--border); background: var(--bg); }
.rte-toolbar button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.rte-toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 3px; }
.rte-toolbar .tabletools { display: none; gap: 3px; } .rte-toolbar .tabletools.show { display: inline-flex; flex-wrap: wrap; } .tabletools button { font-size: var(--fs-sm); }
.rte-area { min-height: 130px; max-height: 45vh; overflow: auto; padding: 10px 12px; outline: none; line-height: 1.5; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte-area h1, .rt h1 { font-size: 1.45em; margin: .5em 0 .3em; } .rte-area h2, .rt h2 { font-size: 1.22em; margin: .5em 0 .3em; } .rte-area h3, .rt h3 { font-size: 1.08em; margin: .5em 0 .3em; }
.rte-area p, .rt p { margin: 0 0 .4em; } .rte-area ul, .rte-area ol, .rt ul, .rt ol { margin: 0 0 .4em; padding-left: 1.5em; }
.rte-area blockquote, .rt blockquote { margin: 0 0 .4em; padding: 2px 10px; border-left: 3px solid var(--border); color: var(--muted); }
.rte-area table, .rt table { border-collapse: collapse; margin: 4px 0 8px; max-width: 100%; } .rte-area th, .rte-area td, .rt th, .rt td { border: 1px solid var(--border); padding: 4px 8px; min-width: 56px; text-align: left; vertical-align: top; } .rte-area th, .rt th { background: var(--accent-soft); }
.rte-area hr, .rt hr { border: none; border-top: 1px solid var(--border); }

/* print */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .side, .top, .tabbar, .head-actions, .daynav button, .chips, .sheet-back, .toast, .check { display: none !important; }
  .app, .main, #view { display: block !important; height: auto !important; overflow: visible !important; padding: 0 !important; max-width: none !important; }
  .row { box-shadow: none; border: 0; border-bottom: 1px solid #ccc; border-radius: 0; break-inside: avoid; padding: 6px 0; }
  .row.task::before { content: "☐"; font-size: var(--fs-lg); margin-right: 4px; }
  .print-only { display: block !important; margin-bottom: 10px; } .print-show { display: inline !important; }
  .page-head { margin-bottom: 4px; } .page-head h1 small { display: none; }
  .sec { color: #333; border-bottom: 2px solid #333; }
}

/* progress meter (.meter > i, width = percent) */
.meter { flex: 1; height: 8px; min-width: 60px; border-radius: var(--r-xs); background: color-mix(in srgb, var(--text) 10%, var(--card)); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .3s var(--ease); }

/* ===== rail nav, workspace (lists | tasks | details | week), drag & drop, sections, protocol signing ===== */
.brand-short { display: none; }
@media (min-width: 900px) {
  .side { width: 76px; padding: 14px 6px; align-items: stretch; }
  .brand { justify-content: center; font-size: var(--fs-body); } .brand-full { display: none; } .brand-short { display: inline; }
  .side nav a { flex-direction: column; gap: 2px; padding: 8px 2px; font-size: var(--fs-xs); text-align: center; }
  .side nav a .ni { font-size: var(--fs-2xl); }
}
.grow { flex: 1; }
.dnd { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.dnd.dragging { opacity: .35; }
.drag-ghost { position: fixed !important; left: 0; top: 0; z-index: var(--z-drag); pointer-events: none; opacity: .92; box-shadow: 0 10px 30px rgba(0,0,0,.3); transform-origin: top left; margin: 0 !important; overflow: hidden; }
body.is-dragging { cursor: grabbing; }
body.is-dragging * { cursor: grabbing !important; }
.sec-wrap.drop-hover { background: var(--accent-soft); border-radius: var(--r-xl); }
.nav-item.drop-hover, .wk-ad.drop-hover { background: var(--accent-soft); outline: 2px dashed var(--accent); }

#view.ws-main { padding: 0; max-width: none; overflow: hidden; display: flex; flex-direction: column; }
.ws { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ws-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--border); align-items: center; scrollbar-width: none; flex-shrink: 0; }
.ws-nav::-webkit-scrollbar { display: none; }
.nav-group { display: flex; gap: 6px; } .nav-title { display: none; }
.nav-item { white-space: nowrap; display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 6px 12px; font-size: var(--fs-base); }
.nav-item.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } .nav-item.on .ni { color: var(--on-accent) !important; }
.nav-item .nc { font-size: var(--fs-sm); opacity: .7; }
.nav-add input { width: 130px; padding: 7px 12px; border: 1px dashed var(--border); border-radius: var(--r-pill); background: transparent; }
.ws-list { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 12px; }
.ws-detail, .ws-cal { display: none; }
.ws-list-head { padding-top: 10px; flex-shrink: 0; }
.list-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.list-title { font-size: var(--fs-3xl); margin: 0; } .rename-input { font-size: var(--fs-2xl); font-weight: 700; padding: 2px 8px; border: 2px solid var(--accent); border-radius: var(--r-md); background: var(--card); width: 220px; }
.count { color: var(--muted); font-size: var(--fs-md); }
.ws-list-body { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 20px; -webkit-overflow-scrolling: touch; }
.list-pad { height: calc(var(--tab-h) + var(--safe-b) + 30px); }
@media (min-width: 900px) { .list-pad { height: 30px; } }
.row.sel { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.sec-wrap { margin-bottom: 8px; }
.sec-head { display: flex; align-items: center; gap: 4px; padding: 6px 2px 4px; font-weight: 600; color: var(--muted); font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .04em; cursor: grab; }
.sec-name { cursor: text; }
.sec-empty { color: var(--muted); font-size: var(--fs-md); text-align: center; padding: 10px; border: 1px dashed var(--border); border-radius: var(--r-lg); }
.inline-add input { width: 100%; padding: 10px 12px; border: 2px solid var(--accent); border-radius: var(--r-lg); background: var(--card); margin: 4px 0 8px; }
.pad { padding: 14px; }
.pane-switch { display: none; gap: 0; margin: 8px 0; } .pane-switch button { flex: 1; padding: 6px; border: 1px solid var(--border); background: var(--card); } .pane-switch button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pane-switch button:first-child { border-radius: var(--r-md) 0 0 var(--r-md); } .pane-switch button:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }

@media (min-width: 900px) {
  .ws { display: grid; grid-template-columns: 200px minmax(280px, 340px) 1fr; grid-template-rows: 100%; }
  .ws-nav { flex-direction: column; align-items: stretch; overflow-y: auto; border-bottom: none; border-right: 1px solid var(--border); padding: 14px 8px; gap: 2px; background: var(--card); }
  .nav-group { flex-direction: column; gap: 1px; }
  .nav-title { display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
  .nav-item { border: none; background: transparent; border-radius: var(--r-lg); padding: calc(8px * var(--dn)) 10px; }
  .nav-item:hover { background: var(--bg); } .nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .nav-item .ni { width: 20px; text-align: center; } .nav-item .nl { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
  .nav-add input { width: 100%; border-radius: var(--r-lg); margin-top: 6px; }
  .ws-list { border-right: 1px solid var(--border); padding: 0 10px; }
  .ws-detail, .ws-cal { padding: 0 14px; min-height: 0; min-width: 0; overflow: hidden; flex-direction: column; }
  .ws-detail, .ws-cal { display: flex; }
  .pane-switch { display: none; }
  .ws { grid-template-columns: 170px 290px minmax(220px, 1fr) minmax(340px, 1.25fr); }
  .ws-detail { border-right: 1px solid var(--border); }
  .ws.no-cal { grid-template-columns: 170px 290px minmax(300px, 1fr); }
  .ws.no-cal .ws-cal { display: none; } .ws.no-cal .ws-detail { border-right: none; }
  .ws.no-detail { grid-template-columns: 170px 290px minmax(380px, 1fr); }
  .ws.no-detail .ws-detail { display: none; }
  .ws.no-cal.no-detail { grid-template-columns: 170px minmax(320px, 1fr); }
  .ws.no-cal.no-detail .ws-list { border-right: none; }
  .ws-list-head .list-head { flex-wrap: wrap; }
  .pane-toggles { display: inline-flex; gap: 2px; margin-left: 4px; }
  .pane-toggles .icon-btn.on { background: var(--accent-soft); color: var(--accent); }
}
@media (min-width: 1280px) {
  .ws { grid-template-columns: 190px 310px minmax(300px, 1fr) minmax(440px, 1.35fr); }
  .ws.no-cal { grid-template-columns: 190px 310px minmax(300px, 1fr); }
  .ws.no-detail { grid-template-columns: 190px 310px minmax(440px, 1fr); }
  .ws.no-cal.no-detail { grid-template-columns: 190px minmax(380px, 1fr); }
}
.detail-bar { display: flex; align-items: center; gap: 4px; padding: 6px 0; flex-shrink: 0; }
.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 40px; }
.check.big { width: 30px; height: 30px; min-width: 30px; } .check.big.on { background: var(--green); border-color: var(--green); }
.inline-form .title-field input { font-size: var(--fs-2xl); font-weight: 600; border: none; background: transparent; padding: 6px 0; min-height: 44px; }
.inline-form .title-field input:focus { outline: none; border-bottom: 2px solid var(--accent); border-radius: 0; }
.empty.big { margin-top: 18vh; font-size: var(--fs-body); }

/* week calendar */
.cal-head { display: flex; align-items: center; gap: 4px; padding: 6px 0; flex-shrink: 0; } .cal-head h2 { margin: 0; font-size: var(--fs-xl); text-transform: capitalize; }
.wk { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--card); overflow: hidden; margin-bottom: 14px; }
.wk-head, .wk-allday, .wk-body { display: grid; grid-template-columns: 44px repeat(var(--n, 7), minmax(0, 1fr)); }
.wk-head { border-bottom: 1px solid var(--border); flex-shrink: 0; }
.wk-dh { text-align: center; padding: 4px 0; font-size: var(--fs-sm); color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; } .wk-dh .dnum { font-size: var(--fs-body); color: var(--text); width: 26px; height: 26px; line-height: 26px; border-radius: 50%; font-weight: 600; }
.wk-dh.today .dnum { background: var(--red); color: #fff; }
.wk-allday { border-bottom: 1px solid var(--border); flex-shrink: 0; max-height: 110px; overflow-y: auto; }
.gut { font-size: var(--fs-2xs); color: var(--muted); } .gut.small { padding: 4px 2px; font-size: var(--fs-2xs); text-align: center; }
.wk-ad { border-left: 1px solid var(--border); padding: 2px; min-height: 26px; display: flex; flex-direction: column; gap: 2px; }
.wk-chip { font-size: var(--fs-xs); padding: 1px 5px; border-radius: var(--r-xs); background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--text); border-left: 3px solid var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.hours .hr { position: relative; } .hours .hr span { position: absolute; top: -7px; right: 4px; }
.wk-col { position: relative; border-left: 1px solid var(--border); } .wk-col.today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.wk-col .line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); opacity: .7; }
.wk-ev { position: absolute; border-radius: var(--r-sm); padding: 2px 5px; font-size: var(--fs-xs); line-height: 1.25; overflow: hidden; cursor: pointer; background: color-mix(in srgb, var(--c) 24%, var(--card)); border-left: 3px solid var(--c); color: var(--text); }
.wk-ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .wk-ev small { display: block; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ev.visit { background: color-mix(in srgb, var(--c) 18%, var(--card)); }
.wk-ghost { position: absolute; left: 2px; right: 2px; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); border-radius: var(--r-sm); font-size: var(--fs-xs); padding: 1px 4px; pointer-events: none; z-index: 4; }
.wk-col .now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 3; pointer-events: none; }

/* protocol signing */
.sheet.sheet-wide { max-width: 980px; }
@media (min-width: 700px) { .sheet.sheet-wide { width: 94vw; } }
.sign-sheet .proto-wrap { margin-bottom: 14px; } .sign-form { border-top: 2px solid var(--border); padding-top: 14px; }
.sig.big { height: 190px; }
.signed { color: var(--green); font-weight: 600; margin-bottom: 6px; }
.signbox .btnrow { margin-top: 8px; }

.pane-toggles { display: none; }
@media (min-width: 900px) { .pane-toggles { display: inline-flex; } }
@media print {
  .app, #view.ws-main { height: auto !important; overflow: visible !important; display: block !important; }
  .ws { display: block !important; } .ws-detail, .ws-cal, .qa, .search, .sort-toggle, .pane-toggles, .side, .tabbar, .top { display: none !important; }
  .ws-list, .ws-list-body { overflow: visible !important; height: auto !important; border: none !important; }
  .ws-nav, .pane-switch, .sec-head .icon-btn { display: none !important; }
  .proto { border: none; padding: 0; }
}

/* ===== scrollbars + application context menu ===== */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: var(--r-lg); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 70%, transparent); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
.chips::-webkit-scrollbar, .ws-nav::-webkit-scrollbar { display: none; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: var(--r-sm); background: var(--border); accent-color: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); }
.ctx { position: fixed; z-index: var(--z-menu); min-width: 220px; max-width: 300px; overflow-y: auto; padding: 6px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: 0 12px 36px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.15); font-size: var(--fs-base); animation: ctxin .09s ease-out; }
@keyframes ctxin { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.ctx-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--r-md); background: none; text-align: left; color: inherit; }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--accent-soft); outline: none; }
.ctx-item.on { font-weight: 600; color: var(--accent); }
.ctx-item.danger { color: var(--red); }
.ctx-ic { width: 20px; text-align: center; flex: none; opacity: .85; }
.ctx-lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-sep { height: 1px; margin: 5px 4px; background: var(--border); }
.ctx-head { padding: 6px 10px 2px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ===== TickTick-style add box ===== */
.qa { margin: 6px 0 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: 4px 6px 6px; position: relative; transition: border-color .12s, box-shadow .12s; }
.qa:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.qa-title { width: 100%; border: 0; background: transparent; padding: 9px 8px; outline: none; font-size: var(--fs-body); }
.qa-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 0 2px 2px; }
.qa-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: var(--r-md); border: 1px solid transparent; background: none; color: var(--muted); font-size: var(--fs-md); max-width: 100%; }
.qa-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-chip:hover { background: var(--accent-soft); color: var(--text); }
.qa-chip.set { color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 12%, transparent); }
.qa-chip.set[data-k=date] { color: var(--accent); }
.qa-chip.late { color: var(--red) !important; background: color-mix(in srgb, var(--red) 12%, transparent) !important; }
.qa-chip .ph { opacity: .85; }
@media (max-width: 520px) { .qa-chip .ph { display: none; } }
.qa-go { width: 32px; height: 28px; padding: 0; font-size: var(--fs-xl); line-height: 1; border-radius: var(--r-md); }
.sort-toggle { margin-left: 8px; font-size: var(--fs-sm); padding: 2px 9px; text-transform: none; letter-spacing: 0; font-weight: 500; }

.pane-toggles .icon-btn { width: 30px; height: 30px; font-size: var(--fs-body); padding: 0; }
.ws-list-head .list-head { gap: 4px 6px; }

/* ===== resizable panes ===== */
.ws { position: relative; }
.rz { display: none; position: absolute; top: 0; bottom: 0; width: 8px; z-index: 5; cursor: col-resize; touch-action: none; }
.rz::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .12s; }
.rz:hover::after, .rz.on::after { background: var(--accent); }
.ws.resizing { user-select: none; cursor: col-resize; } .ws.resizing * { pointer-events: none; } .ws.resizing .rz { pointer-events: auto; }
@media (max-width: 899px) { .rz { display: none !important; } }

/* ===== animations (complete / undo toast / drag & drop) ===== */
.check:hover { border-color: var(--green); }
.row.completing { overflow: hidden; animation: rowout .3s cubic-bezier(.4,0,.2,1) .26s forwards; pointer-events: none; }
.row.completing .check { background: var(--green); border-color: var(--green); animation: checkpop .3s ease; }
.row.completing .check::after { content: '✓'; }
.row.completing .row-title { color: var(--muted); text-decoration: line-through; transition: color .2s; }
@keyframes checkpop { 0% { transform: scale(.8); } 55% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes rowout { 0% { opacity: 1; max-height: var(--h, 60px); } 100% { opacity: 0; max-height: 0; margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; transform: translateX(28px); border-width: 0; } }
.row.flash { animation: rowflash 1s ease-out; }
@keyframes rowflash { 0% { background: color-mix(in srgb, var(--accent) 28%, var(--card)); box-shadow: 0 0 0 2px var(--accent); } 100% { background: var(--card); box-shadow: 0 0 0 0 transparent; } }

.toast.out { opacity: 0; transform: translateX(-50%) translateY(8px); transition: opacity .18s, transform .18s; }
.toast-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-act { border: 0; background: rgba(255,255,255,.14); color: #9db8ff; font-weight: 700; padding: 6px 12px; border-radius: var(--r-md); }
.toast-act:hover { background: rgba(255,255,255,.24); }
@keyframes toastin { from { opacity: 0; transform: translateX(-50%) translateY(14px); } to { opacity: 1; transform: translateX(-50%); } }

.dnd.dragging { opacity: .4; outline: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; background: var(--accent-soft); }
.drag-ghost { opacity: .9; box-shadow: 0 16px 40px rgba(0,0,0,.4), 0 0 0 2px var(--accent); border-radius: var(--r-xl); background: var(--card); }
.row.drop-target { background: color-mix(in srgb, var(--accent) 9%, var(--card)); }
.drop-line { position: fixed; z-index: var(--z-dropline); height: 4px; border-radius: var(--r-xs); background: var(--accent); pointer-events: none; opacity: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); transition: top .09s ease-out, left .09s ease-out, width .09s ease-out, opacity .08s; }
.drop-line.show { opacity: 1; }
.drop-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.sec-wrap.drop-hover { outline: 2px dashed var(--accent); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .row.completing { animation-duration: .01s; animation-delay: .15s; } .row.flash, .toast { animation: none; } }

/* ===== subtasks ===== */
.row.task.sub { margin-left: 28px; padding-top: 7px; padding-bottom: 7px; border-left: 2px solid var(--border); }
.row.task.sub .row-title { font-size: var(--fs-base); }
.row.task.sub .check { width: 22px; height: 22px; min-width: 22px; }
.twist { border: 0; background: none; color: var(--muted); width: 18px; min-width: 18px; padding: 0; margin-right: -4px; font-size: var(--fs-md); align-self: center; }
.twist:hover { color: var(--text); }
.subcount, .parent-chip { color: var(--muted); font-size: var(--fs-sm); }
.parent-chip { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parent-chip .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.twist .ic { width: 16px; height: 16px; } .nav-item .twist .ic { width: 14px; height: 14px; }
.row.nest-target { background: color-mix(in srgb, var(--accent) 16%, var(--card)); outline: 2px solid var(--accent); outline-offset: -2px; }
.detail-subs { padding: 4px 2px 24px; }
.sub-title { margin: 14px 0 6px; font-size: var(--fs-md); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sub-item { display: flex; align-items: center; gap: 8px; padding: calc(5px * var(--dn)) 4px; border-radius: var(--r-md); }
.sub-item:hover { background: var(--accent-soft); }
.sub-item .sub-t { flex: 1; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sub-item.done .sub-t { text-decoration: line-through; color: var(--muted); }
.sub-item .sub-d { color: var(--muted); font-size: var(--fs-sm); }
.check.small { width: 20px; height: 20px; min-width: 20px; font-size: var(--fs-sm); }
.sub-item .icon-btn { opacity: 0; } .sub-item:hover .icon-btn { opacity: 1; }
.sub-add input { width: 100%; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--r-lg); background: transparent; }
.sub-add input:focus { border-style: solid; border-color: var(--accent); outline: none; }
.sub-parent { margin-top: 12px; padding: 8px 10px; border-radius: var(--r-lg); background: var(--accent-soft); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== icons, popover pickers, compact task form ===== */
.ic { flex: none; display: block; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.tf-bar, .qa-bar { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.tf-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--muted); font-size: var(--fs-md); max-width: 100%; text-transform: none; letter-spacing: 0; font-weight: 500; }
.tf-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-chip:hover { color: var(--text); border-color: var(--accent); }
.tf-chip.set { color: var(--c, var(--accent)); border-color: color-mix(in srgb, var(--c, var(--accent)) 45%, var(--border)); background: color-mix(in srgb, var(--c, var(--accent)) 10%, var(--bg)); }
.tf-chip.late { color: var(--red) !important; border-color: color-mix(in srgb, var(--red) 45%, var(--border)) !important; background: color-mix(in srgb, var(--red) 10%, var(--bg)) !important; }
.tf-chip .sub, .qa-chip .sub { display: inline-flex; align-items: center; gap: 3px; opacity: .8; font-size: var(--fs-sm); padding-left: 6px; border-left: 1px solid currentColor; }
.tf-chip .sub .ic, .qa-chip .sub .ic { width: 13px; height: 13px; }
.form.tf { gap: 10px; }
.qa-chip .ic { width: 16px; height: 16px; }
.qa-chip.set[data-k=list] { color: var(--accent); }

.pop { position: fixed; z-index: var(--z-menu); width: 300px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 10px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-2xl); box-shadow: var(--shadow-float); font-size: var(--fs-base); animation: ctxin .09s ease-out; }
.dp { display: flex; flex-direction: column; gap: 10px; }
.dp button { font: inherit; color: inherit; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 4px; }
.dp-quick button { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); font-size: var(--fs-md); }
.dp-quick button .ic { width: 14px; height: 14px; }
.dp-quick button:hover { border-color: var(--accent); color: var(--accent); }
.dp-quick .danger { color: var(--red); margin-left: auto; }
.dp-month { display: flex; align-items: center; justify-content: space-between; }
.dp-month b { text-transform: capitalize; font-size: var(--fs-base); }
.dp-month button { width: 32px; height: 32px; border: 0; border-radius: var(--r-md); background: none; font-size: var(--fs-2xl); line-height: 1; }
.dp-month button:hover { background: var(--accent-soft); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid .dow { font-style: normal; text-align: center; font-size: var(--fs-xs); color: var(--muted); padding: 2px 0; }
.dp-grid button { aspect-ratio: 1; min-height: 34px; border: 0; border-radius: 50%; background: none; font-size: var(--fs-md); }
.dp-grid button:hover { background: var(--accent-soft); }
.dp-grid button.out { color: var(--muted); opacity: .55; }
.dp-grid button.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-grid button.sel { background: var(--accent); color: var(--on-accent); opacity: 1; }
.dp-sec { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.dp-lbl { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dp-lbl .ic { width: 15px; height: 15px; }
.dp-trow { display: flex; gap: 6px; }
.dp input[type=text] { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); font-size: var(--fs-base); }
.dp input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.dp-clear { width: 36px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); display: grid; place-items: center; }
.dp-clear:disabled { opacity: .35; }
.dp-times, .de-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dp-times button, .de-chip { padding: 4px 9px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); font-size: var(--fs-sm); }
.dp-times button:hover, .de-chip:hover { border-color: var(--accent); }
.dp-times button.on, .de-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.de { display: flex; flex-direction: column; gap: 6px; }
.de-row { display: flex; gap: 6px; align-items: stretch; }
.de-step { width: 38px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); font-size: var(--fs-xl); line-height: 1; color: var(--text); }
.de-step:hover { border-color: var(--accent); }
.de-in { text-align: center; flex: 1; }
.dp-done { align-self: stretch; padding: 8px; border: 0; border-radius: var(--r-lg); background: var(--accent); color: var(--on-accent) !important; font-weight: 600; }

/* project tree in the nav */
.nav-item { cursor: pointer; user-select: none; -webkit-user-select: none; }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-item .twist { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: -4px; font-size: var(--fs-xs); color: var(--muted); border-radius: var(--r-xs); transition: transform .12s; flex: none; }
.nav-item .twist.open { transform: rotate(90deg); } .nav-item .twist:hover { background: var(--accent-soft); }
.nav-item.nest-hover { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
@media (min-width: 900px) { .nav-item.nav-sub { padding-left: 28px; } .nav-item.nav-sub .ni { font-size: var(--fs-xs); } }
.nav-item.dragging { opacity: .45; }

/* ===== editor ===== */
.rte-toolbar button { display: inline-grid; place-items: center; min-width: 34px; padding: 0 6px; color: var(--muted); }
.rte-toolbar button:hover { background: var(--accent-soft); color: var(--text); }
.rte-toolbar button.on { color: var(--accent); }
.rte-toolbar button svg { display: block; }
.rte-toolbar .tabletools button { color: var(--text); }
.rte-area mark, .rt mark { background: var(--hl, #fde68a); color: #1a1f2b; border-radius: var(--r-xs); padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rte-area ul[data-type=todo], .rt ul[data-type=todo] { list-style: none; padding-left: 0; }
.rte-area ul[data-type=todo] > li, .rt ul[data-type=todo] > li { position: relative; padding-left: 28px; min-height: 1.5em; }
.rte-area ul[data-type=todo] > li::before, .rt ul[data-type=todo] > li::before { content: ""; position: absolute; left: 2px; top: .22em; width: 15px; height: 15px; border: 1.8px solid var(--muted); border-radius: var(--r-xs); background: var(--card); box-sizing: border-box; }
.rte-area ul[data-type=todo] > li { cursor: text; } .rte-area ul[data-type=todo] > li::before { cursor: pointer; }
.rte-area ul[data-type=todo] > li[data-checked=true]::before, .rt ul[data-type=todo] > li[data-checked=true]::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/11px no-repeat; border-color: var(--accent); }
.rte-area ul[data-type=todo] > li[data-checked=true], .rt ul[data-type=todo] > li[data-checked=true] { color: var(--muted); text-decoration: line-through; }
.rte-area ul[data-type=todo] ul, .rt ul[data-type=todo] ul { list-style: none; padding-left: 0; }

.slash-menu { position: fixed; z-index: var(--z-search); width: 270px; max-height: 320px; overflow-y: auto; padding: 6px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-float); animation: ctxin .09s ease-out; }
.sm-head { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 8px 6px; }
.sm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r-md); background: none; color: inherit; text-align: left; font: inherit; }
.sm-item.on { background: var(--accent-soft); }
.sm-ic { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.sm-ic svg { width: 17px; height: 17px; }
.sm-t { display: flex; flex-direction: column; line-height: 1.25; } .sm-t small { color: var(--muted); font-size: var(--fs-sm); }
.rte-toolbar { gap: 1px; padding: 4px; } .rte-toolbar button { min-width: 30px; height: 32px; padding: 0 4px; } .rte-toolbar .sep { margin: 0 4px; }
[hidden] { display: none !important; }

/* ===== repeat panel, mini calendar, reminders ===== */
.mc { display: flex; flex-direction: column; gap: 4px; }
.dp-grid button.mark { box-shadow: inset 0 0 0 1.5px var(--accent); }
.rp { gap: 8px; } .rp-body { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.rp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-base); }
.rp-row label { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-md); }
.rp-n { width: 64px; min-height: 36px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); font-size: var(--fs-base); text-align: center; }
.rp-u { min-height: 36px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); font-size: var(--fs-base); }
.rp-days { display: flex; gap: 4px; }
.rp-days button { flex: 1; min-height: 34px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); font-size: var(--fs-sm); }
.rp-days button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rp-date { flex: 1; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--muted); font-size: var(--fs-md); text-align: left; }
.rp-date.set { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.rp-cal { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 6px; background: var(--bg); }
.rp-prev { font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; background: var(--accent-soft); border-radius: var(--r-lg); padding: 8px 10px; } .rp-prev b { color: var(--text); }
.pop .hint { font-size: var(--fs-sm); }
.tpl-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); } .tpl-row:last-child { border-bottom: 0; }

/* ===== attachments + comments ===== */
.rc { display: inline-flex; align-items: center; gap: 2px; } .rc .ic { width: 13px; height: 13px; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-item { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.att-th { width: 44px; height: 44px; flex: none; border: 0; border-radius: var(--r-md); background: var(--accent-soft) center/cover no-repeat; display: grid; place-items: center; cursor: pointer; }
.att-ext { font-size: var(--fs-xs); font-weight: 700; color: var(--accent); }
.att-meta { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; text-transform: none; letter-spacing: 0; }
.att-meta b { font-size: var(--fs-base); font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .att-meta small { font-size: var(--fs-sm); color: var(--muted); font-weight: 400; }
.att-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; } .att-add .ic { width: 15px; height: 15px; }
.att.over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: var(--r-lg); }
.lightbox { position: fixed; inset: 0; z-index: var(--z-top); background: rgba(0,0,0,.82); display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: calc(100% - 50px); border-radius: var(--r-md); object-fit: contain; }
.cmts { margin-top: 18px; }
.cmt-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.cmt { display: flex; gap: 10px; align-items: flex-start; }
.cmt-av { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: var(--fs-md); font-weight: 700; color: #fff; background: hsl(var(--h) 55% 45%); }
.cmt-body { flex: 1; min-width: 0; background: var(--bg); border-radius: var(--r-xs) var(--r-xl) var(--r-xl) var(--r-xl); padding: 7px 10px; }
.cmt-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); } .cmt-head small { color: var(--muted); } .cmt-head .icon-btn { margin-left: auto; }
.cmt-text { font-size: var(--fs-base); line-height: 1.45; overflow-wrap: anywhere; } .cmt-text a { color: var(--accent); }
.mention { color: var(--accent); background: var(--accent-soft); border-radius: var(--r-xs); padding: 0 3px; font-weight: 600; }
.cmt-form { display: flex; gap: 8px; align-items: flex-end; }
.cmt-form textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); color: var(--text); font: inherit; font-size: var(--fs-base); }
.cmt-form textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ===== global search ===== */
.side-search { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 0; border-radius: var(--r-lg); background: var(--bg); color: var(--muted); font-size: var(--fs-xs); }
.side-search:hover { color: var(--accent); background: var(--accent-soft); }
.top-right { display: flex; align-items: center; }
.sr-back { position: fixed; inset: 0; z-index: var(--z-search); background: var(--scrim); display: flex; justify-content: center; align-items: flex-start; padding: 9vh 12px 12px; }
.sr { width: 640px; max-width: 100%; max-height: 78vh; display: flex; flex-direction: column; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-3xl); box-shadow: var(--shadow-modal); overflow: hidden; animation: ctxin .1s ease-out; }
.sr-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.sr-bar input { flex: 1; border: 0; background: transparent; outline: none; font-size: var(--fs-lg); color: var(--text); min-width: 0; }
.sr-bar kbd, .sr-bar svg { flex: none; } .sr-bar kbd { font: 11px/1 inherit; padding: 3px 6px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.sr-res { overflow-y: auto; padding: 6px 8px 10px; }
.sr-head { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 8px 4px; }
.sr-empty { padding: 28px; text-align: center; color: var(--muted); }
.sr-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: var(--r-lg); background: none; color: inherit; text-align: left; font: inherit; }
.sr-item.on { background: var(--accent-soft); }
.sr-item.done .sr-t b { text-decoration: line-through; color: var(--muted); }
.sr-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--r-md); background: var(--bg); font-size: var(--fs-md); }
.sr-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; } .sr-t b { font-weight: 600; font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-t small { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sr-snip { font-style: italic; }
.form label.att-add { flex-direction: row; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--fs-md); color: var(--text); }

/* ===== motion, polish, @mentions, appearance ===== */
h1, h2, h3, .brand, .brand-m, .list-title, .sheet-head h2 { font-family: var(--font-head); }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 38%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); background-clip: padding-box; border: 3px solid transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row:focus-visible, .ctx-item:focus-visible { outline-offset: -2px; }
.side, .tabbar, .top { transition: background-color .2s; }
.tabbar, .top { background: color-mix(in srgb, var(--card) 90%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); }
.btn, .icon-btn, .pill, .tf-chip, .qa-chip, .nav-item, .side nav a, .tabbar a, .ctx-item, .sm-item, .sub-item, .mp-item, .sr-item, .dp-quick button, .dp-grid button {
  transition: background-color .16s, border-color .16s, color .16s, box-shadow .22s var(--ease), transform .16s var(--ease), opacity .16s; }
.btn:active, .icon-btn:active, .pill:active, .tf-chip:active, .qa-chip:active, .nav-item:active, .dp-quick button:active { transform: scale(.95); }
@media (hover: hover) {
  .row:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--text) 35%, transparent); }
  .btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
  .btn.primary:hover { filter: brightness(1.07); }
  .side nav a:hover:not(.active) { background: color-mix(in srgb, var(--text) 6%, transparent); }
  .check:hover { border-color: var(--green); transform: scale(1.08); }
}
.drag-ghost, .drag-ghost * { transition: none !important; animation: none !important; }
.side nav a.active, .tabbar a.active { position: relative; }
.tabbar a::before { content: ''; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); transform: translateX(-50%) scaleX(0); transition: transform .28s var(--spring); }
.tabbar a { position: relative; } .tabbar a.active::before { transform: translateX(-50%) scaleX(1); }
.tabbar a .ni { transition: transform .28s var(--spring); } .tabbar a.active .ni { transform: translateY(-1px) scale(1.14); }
.side nav a.active::before { content: ''; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--accent); animation: barin .3s var(--spring); }
.sync.syncing { animation: pulse 1s ease-in-out infinite; }

/* view / list entrance (only on navigation, see IQ.render) */
.route-in > * { animation: viewin .3s var(--ease) both; }
.route-in .row { animation: rowin .34s var(--ease) both; }
.route-in .row:nth-child(1) { animation-delay: 0ms; }
.route-in .row:nth-child(2) { animation-delay: 28ms; }
.route-in .row:nth-child(3) { animation-delay: 56ms; }
.route-in .row:nth-child(4) { animation-delay: 84ms; }
.route-in .row:nth-child(5) { animation-delay: 112ms; }
.route-in .row:nth-child(6) { animation-delay: 140ms; }
.route-in .row:nth-child(7) { animation-delay: 168ms; }
.route-in .row:nth-child(8) { animation-delay: 196ms; }
.route-in .row:nth-child(9) { animation-delay: 224ms; }

/* no backdrop blur behind sheets: on iPad a blurred full-screen layer (twice, with a visit on top of an order) made typing laggy */
.sheet-back ~ .sheet-back { background: rgba(10,14,24,.28); }
@media (min-width: 700px) { .sheet { animation-name: sheetpop; } }
.sheet-back.closing { animation: fadeout .17s ease-in forwards; pointer-events: none; }
.sheet-back.closing .sheet { animation: sheetdown .17s ease-in forwards; }
@media (min-width: 700px) { .sheet-back.closing .sheet { animation-name: sheetpopout; } }
.toast, .ctx, .pop, .slash-menu, .sr { transform-origin: top left; }
.ctx, .pop, .slash-menu, .mention-pop { animation: ctxin .16s var(--ease) both; }
@keyframes ctxin { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } } @keyframes fadeout { to { opacity: 0; } }
@keyframes sheetup { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes sheetdown { to { transform: translateY(32px); opacity: 0; } }
@keyframes sheetpop { from { transform: translateY(14px) scale(.975); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetpopout { to { transform: translateY(8px) scale(.98); opacity: 0; } }
@keyframes viewin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rowin { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes barin { from { transform: scaleY(0); } to { transform: none; } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.75); } }
@keyframes cmtin { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* comments + @mentions */
.cmt.fresh { animation: cmtin .34s var(--ease) both; }
.cmt.tome .cmt-body { box-shadow: inset 3px 0 0 var(--accent); }
.mention.me { background: var(--accent); color: var(--on-accent); }
.cmt-av.sm { width: 24px; height: 24px; font-size: var(--fs-xs); }
.mention-pop { position: fixed; z-index: var(--z-top); max-height: 240px; overflow-y: auto; padding: 6px; background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-float); }
.mention-pop.below { transform-origin: top left; }
.mp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r-md); background: none; color: inherit; text-align: left; font: inherit; }
.mp-item.on { background: var(--accent-soft); } .mp-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mp-item small { color: var(--muted); font-size: var(--fs-sm); }
.mp-empty { padding: 8px 10px; color: var(--muted); font-size: var(--fs-md); max-width: 260px; }

/* appearance card */
.ap { display: flex; flex-direction: column; gap: 16px; }
.ap h4 { margin: 0 0 8px; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.ap-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.ap-preset { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); text-align: left; }
.ap-preset:hover { border-color: var(--accent); } .ap-preset.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.ap-strip { display: flex; height: 22px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); } .ap-strip i { flex: 1; }
.ap-preset span { font-size: var(--fs-md); font-weight: 600; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-xl); max-width: 100%; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: var(--r-md); color: var(--muted); font-weight: 500; transition: background-color .16s, color .16s, box-shadow .16s; }
.seg button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.ap-sws { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ap-sw { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--card); background: var(--c); box-shadow: 0 0 0 1px var(--border); padding: 0; transition: transform .18s var(--spring), box-shadow .18s; }
.ap-sw:hover { transform: scale(1.12); } .ap-sw.on { box-shadow: 0 0 0 2.5px var(--c); transform: scale(1.06); }
.ap-pick { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: var(--fs-md); }
.ap-pick input[type=color] { width: 28px; height: 28px; padding: 0; border: 0; background: none; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.ap-prev .btnrow { align-items: center; } .ap-prev .badge { padding: 2px 10px; }
.ap-pick input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } .ap-pick input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.ap-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ap-font { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); text-align: left; display: flex; flex-direction: column; gap: 2px; }
.ap-font b { font-size: var(--fs-3xl); line-height: 1.1; } .ap-font small { color: var(--muted); font-size: var(--fs-sm); }
.ap-font.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.ap-range { display: grid; grid-template-columns: 110px 1fr 64px; align-items: center; gap: 10px; }
.ap-range output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: var(--fs-md); }
.ap-range input[type=range] { width: 100%; }
.ap-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ap-row input[type=text] { flex: 1; min-width: 160px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.ap-prev { padding: 12px; border: 1px dashed var(--border); border-radius: var(--r-2xl); background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.ap-prev .row { margin: 0; cursor: default; } .ap-prev .row:hover { box-shadow: var(--shadow); }
.ap-note { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 520px) { .ap-range { grid-template-columns: 1fr 64px; } .ap-range > span { grid-column: 1 / -1; } }

/* appearance: motion + theme switch */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after { transition: background-color .3s, color .3s, border-color .3s, fill .3s, stroke .3s, box-shadow .3s !important; }
:root[data-motion=off] *, :root[data-motion=off] *::before, :root[data-motion=off] *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  :root[data-motion=auto] *, :root[data-motion=auto] *::before, :root[data-motion=auto] *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}

/* editor highlight colours */
.rte-toolbar [data-cmd=mark] { position: relative; } .rte-toolbar [data-cmd=mark]::after { content: ''; position: absolute; left: 7px; right: 7px; bottom: 3px; height: 3px; border-radius: 3px; background: var(--hl, #fde68a); }
.rte-toolbar [data-cmd=markMenu] { min-width: 18px !important; padding: 0 !important; margin-left: -4px; } .rte-toolbar [data-cmd=markMenu] svg { width: 13px; height: 13px; }
.hl-pop { display: flex; flex-direction: column; gap: 10px; min-width: 232px; }
.hl-t { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.hl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.hl-sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card); background: var(--hl); box-shadow: 0 0 0 1px var(--border); padding: 0; transition: transform .16s var(--spring), box-shadow .16s; }
.hl-sw:hover { transform: scale(1.12); } .hl-sw.on { box-shadow: 0 0 0 2.5px var(--accent); }
.hl-own { position: relative; overflow: hidden; background: conic-gradient(#f87171, #fbbf24, #a3e635, #22d3ee, #818cf8, #e879f9, #f87171); display: block; }
.hl-own input { position: absolute; inset: -6px; width: 44px; height: 44px; opacity: 0; cursor: pointer; }

/* calendar views, month grid, resizable events */
.cal-views { align-self: flex-start; margin: 0 0 8px; flex-shrink: 0; } .cal-views button { padding: 5px 11px; font-size: var(--fs-md); }
.wk-dh[title] { cursor: pointer; } .wk-dh .dow { text-transform: capitalize; }
.wk-ev { touch-action: none; user-select: none; -webkit-user-select: none; } .wk-ev.resizing { z-index: 6; box-shadow: 0 6px 22px rgba(0,0,0,.35), 0 0 0 2px var(--accent); transition: none; }
.ev-rz { position: absolute; left: 0; right: 0; height: 9px; cursor: ns-resize; z-index: 2; touch-action: none; } .ev-rz.t { top: 0; } .ev-rz.b { bottom: 0; }
.ev-rz.b::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px; border-radius: 3px; background: var(--c); opacity: 0; transition: opacity .15s; }
.wk-ev:hover .ev-rz.b::after, .wk-ev.resizing .ev-rz.b::after { opacity: .85; }
@media (pointer: coarse) { .ev-rz { height: 16px; } .ev-rz.b::after { opacity: .6; } }
body.is-resizing, body.is-resizing * { cursor: ns-resize !important; user-select: none !important; }
.mo-wrap { flex: 1; min-height: 0; padding-bottom: 14px; }
.mo { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.mo-dow { background: var(--card); text-align: center; padding: 5px 0; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.mo-day { background: var(--card); min-height: 92px; padding: 3px 4px 4px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; transition: background-color .15s; }
.mo-day:hover { background: color-mix(in srgb, var(--accent) 5%, var(--card)); } .mo-day.out { background: color-mix(in srgb, var(--bg) 70%, var(--card)); } .mo-day.out .mo-n { opacity: .45; }
.mo-day.today { background: color-mix(in srgb, var(--accent) 8%, var(--card)); } .mo-day.drop-hover { outline: 2px dashed var(--accent); outline-offset: -2px; }
.mo-n { align-self: flex-start; border: 0; background: none; font-weight: 600; font-size: var(--fs-md); min-width: 24px; height: 24px; border-radius: 50%; padding: 0 4px; color: var(--text); }
.mo-day.today .mo-n { background: var(--accent); color: var(--on-accent); } .mo-n:hover { background: var(--accent-soft); }
.mo-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mo-chip { font-size: var(--fs-xs); padding: 1px 5px; border-radius: var(--r-xs); background: color-mix(in srgb, var(--c) 22%, transparent); border-left: 3px solid var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mo-chip small { opacity: .7; margin-right: 4px; font-size: inherit; }
.mo-more { border: 0; background: none; color: var(--accent); font-size: var(--fs-xs); text-align: left; padding: 0 3px; }
.mo.compact .mo-day { min-height: 54px; align-items: center; } .mo-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; align-items: center; } .mo-dots i { width: 7px; height: 7px; border-radius: 50%; } .mo-dots small { font-size: 10px; color: var(--muted); }

/* list views tools row, group headers, chips, compact mode, board */
.list-tools { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; flex-wrap: wrap; }
.seg-s { padding: 2px; } .seg-s button { padding: 4px 9px; display: inline-grid; place-items: center; }
.field > .seg { align-self: flex-start; } .seg-s button:has(.ic) { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.list-tools .btn.small { min-height: 32px; padding: 3px 11px; font-size: var(--fs-md); } .list-tools .btn b { font-weight: 600; }
.list-tools .sort-toggle { margin-left: 0; }
.grp-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0 8px; position: sticky; top: 0; z-index: 4; background: linear-gradient(var(--bg) 80%, transparent); }
.grp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 5px 3px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: var(--fs-md); }
.grp-chip b { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; text-align: center; font-size: var(--fs-sm); line-height: 20px; }
.grp-chip.red b { background: color-mix(in srgb, var(--red) 16%, var(--card)); color: var(--red); } .grp-chip.zero { opacity: .55; } .grp-chip:hover { border-color: var(--accent); }
.grp-wrap { margin-bottom: 8px; }
.grp-head { display: flex; align-items: center; gap: 6px; padding: 8px 2px 4px; font-size: var(--fs-sm); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.grp-head .grp-name { cursor: pointer; } .grp-head .count { font-weight: 500; letter-spacing: 0; } .grp-head.red, .grp-head.red .count { color: var(--red); }
.grp-head .btn.small { text-transform: none; letter-spacing: 0; font-weight: 500; min-height: 28px; padding: 2px 10px; font-size: var(--fs-sm); }
.grp-head .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.grp-empty { color: var(--muted); font-size: var(--fs-md); padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--r-lg); text-align: center; margin-bottom: 6px; }
.grp-wrap.drop-hover, .bd-col.drop-hover { outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: var(--r-xl); }
.sec-add, .sec-new { display: block; width: 100%; text-align: left; padding: 8px 12px; margin: 2px 0 6px; border: 1px dashed var(--border); border-radius: var(--r-lg); background: transparent; color: var(--muted); transition: color .15s, border-color .15s, background-color .15s; }
.sec-new { margin-top: 10px; text-align: center; } .sec-add:hover, .sec-new:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.sec-empty + .sec-add { margin-top: 6px; }
/* compact */
.ws-list-body.compact .row { padding-top: calc(4px * var(--dn)); padding-bottom: calc(4px * var(--dn)); border-radius: var(--r-md); margin-bottom: 3px; box-shadow: none; align-items: center; }
.ws-list-body.compact .check { width: 20px; height: 20px; min-width: 20px; font-size: var(--fs-xs); margin-top: 0; }
.ws-list-body.compact .check .ic { width: 13px; height: 13px; }
.ws-list-body.compact .row-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; } .ws-list-body.compact .row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; font-size: var(--fs-base); }
.ws-list-body.compact .row-meta { margin: 0; flex: none; flex-wrap: nowrap; } .ws-list-body.compact .row-meta .chip, .ws-list-body.compact .row-meta .rc { display: none; }
/* board */
.ws-list-body.board-body { overflow: auto; padding-bottom: 14px; }
.board { display: flex; gap: 12px; align-items: flex-start; min-height: 100%; padding: 2px 2px 14px; }
.bd-col { flex: 0 0 292px; width: 292px; max-width: 86vw; background: color-mix(in srgb, var(--text) 4%, var(--bg)); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 100%; }
.bd-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 4px; font-weight: 700; } .bd-head .bd-name { cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bd-head .count { font-weight: 500; color: var(--muted); }
.bd-col.red .bd-head, .bd-col.red .bd-head .count { color: var(--red); } .bd-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.bd-body { display: flex; flex-direction: column; min-height: 36px; overflow-y: auto; max-height: calc(100dvh - 260px); padding: 2px; }
.bd-body .row { background: var(--card); } .bd-body .row.sub { margin-left: 14px; }
.bd-add { border: 1px dashed var(--border); background: transparent; color: var(--muted); border-radius: var(--r-lg); padding: 8px; text-align: left; transition: color .15s, border-color .15s, background-color .15s; } .bd-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.bd-add.big { text-align: center; padding: 14px 10px; }
.bd-col.bd-new { background: transparent; border-style: dashed; flex-basis: 220px; width: 220px; }
.ws.board-on .ws-list { flex: 1; }
@media (max-width: 899px) { .bd-col { flex-basis: 82vw; width: 82vw; } .bd-body { max-height: none; } }
@media print { .list-tools, .grp-nav, .sec-add, .sec-new { display: none !important; } }

/* ===== spaces (company / private), accounts, regions ===== */
.space-sw { flex-shrink: 0; flex-wrap: nowrap; }
.space-sw button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; white-space: nowrap; }
.space-sw .ic { width: 15px; height: 15px; }
@media (min-width: 900px) { .ws-nav .space-sw { display: grid; grid-template-columns: 1fr 1fr; width: 100%; box-sizing: border-box; margin-bottom: 8px; } .ws-nav .space-sw button { min-width: 0; justify-content: center; padding: 5px 4px; gap: 4px; font-size: var(--fs-md); overflow: hidden; } .ws-nav .space-sw button span { overflow: hidden; text-overflow: ellipsis; } .ws-nav .space-sw .ic { display: none; } }
.space-note { display: none; font-size: var(--fs-sm); color: var(--muted); padding: 6px 10px; line-height: 1.4; }
@media (min-width: 900px) { .space-note { display: block; } }
:root[data-space=private] { --priv: color-mix(in srgb, #7c3aed 14%, var(--card)); --priv-line: color-mix(in srgb, #7c3aed 55%, var(--card)); }
:root[data-space=private] .space-sw button.on { background: var(--priv); color: var(--text); box-shadow: inset 0 0 0 1px var(--priv-line); }
:root[data-space=private] .ws-list-head { border-top: 3px solid var(--priv-line); }
:root[data-space=private] .ws-nav { background: color-mix(in srgb, #7c3aed 4%, transparent); }
.priv-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 6px; border-radius: 50%; background: var(--priv, var(--bg)); color: var(--text); vertical-align: -3px; }
.priv-badge .ic { width: 15px; height: 15px; }
.acct-actions .btnrow { flex-wrap: wrap; }
.users .u-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.users .mfa-pol { margin-bottom: var(--sp-3); }
.u-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); }
.u-row.off { opacity: .6; }
.u-row .u-main { flex: 1; min-width: 160px; line-height: 1.3; }
.u-row select { width: auto; min-width: 130px; }
.key-row { display: flex; gap: 8px; align-items: center; } .key-row input { flex: 1; min-width: 0; }
.au-list { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-lg); }
.au-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: var(--fs-md); }
.au-row:last-child { border-bottom: 0; } .au-row.link { cursor: pointer; } .au-row.link:hover { background: var(--accent-soft); }
@media (max-width: 600px) { .au-row { grid-template-columns: 1fr; gap: 2px; } }
.region-chips { align-items: center; } .region-chips > .ic { color: var(--muted); margin-right: 2px; }
.sr-opts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 14px; border-bottom: 1px solid var(--border); }
.sr-opts .chips { margin: 0; } .sr-opts .pill { padding: 3px 10px; font-size: var(--fs-sm); }
.sr-scope { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--muted); }
.sr-scope .ic { width: 14px; height: 14px; }

/* login screen (server requires logging in before anything of the app is shown) */
.login-gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-4); box-sizing: border-box; background: var(--bg); }
.login-card { width: 100%; max-width: 340px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-3xl); padding: var(--sp-5); box-shadow: var(--shadow-pop); display: grid; gap: var(--sp-3); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); font-size: var(--fs-2xl); margin-bottom: var(--sp-2); }
.login-brand img { width: 36px; height: 36px; border-radius: var(--r-lg); }
.login-card .btn { justify-content: center; }
.login-card .err:empty { display: none; }
/* weryfikacja dwuetapowa (mfa.js): kod QR zawsze na białym tle (telefony nie czytają odwróconych kodów), kody zapasowe, pole na 6 cyfr */
.mfa-title { font-size: var(--fs-lg); }
.mfa-qr { justify-self: center; align-self: center; width: max-content; margin: 0 auto; padding: var(--sp-2); background: var(--qr-bg); border-radius: var(--r-lg); border: 1px solid var(--border); }
.mfa-qr img { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.mfa-key { font-family: var(--mono); font-size: var(--fs-sm); word-break: break-all; user-select: all; color: var(--text); }
.mfa-codes { columns: 2; gap: var(--sp-4); margin: var(--sp-2) 0; padding-left: var(--sp-5); }
.mfa-codes code { font-family: var(--mono); font-size: var(--fs-base); color: var(--text); }
.mfa-codes-box { display: grid; gap: var(--sp-2); }
.form input.otp { font-family: var(--mono); font-size: var(--fs-xl); letter-spacing: .2em; text-align: center; }
.mfa-acct { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ===== document templates (protocols, reports, documents) ===== */
.doc { --dc: #3f6fc4; font-family: Roboto, "Segoe UI", Arial, sans-serif; color: #111; background: #fff; font-size: 10.5pt; line-height: 1.45; }
.doc-page { width: 100%; border-collapse: collapse; } .doc-page > thead > tr > td, .doc-page > tbody > tr > td { padding: 0; vertical-align: top; }
.doc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 14px; }
.doc-top-l { font-size: 10pt; line-height: 1.7; }
.doc-logo { max-height: 56px; max-width: 240px; object-fit: contain; display: block; }
.doc-logo-txt { font-size: 20pt; font-weight: 800; color: var(--dc); letter-spacing: -.02em; }
.doc-b { margin-bottom: 12px; break-inside: avoid; }
.doc-b.doc-report, .doc-b.doc-visits, .doc-b.doc-photos, .doc-b.doc-text { break-inside: auto; }
.doc-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; background: var(--dc); color: #fff; font-weight: 700; padding: 3px 8px; margin: 6px 0 8px; font-size: 11pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-after: avoid; }
.doc-bar small { font-size: 7.5pt; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.doc-bar-main small { font-size: 9.5pt; text-transform: none; letter-spacing: 0; }
.doc-head-cols { display: flex; justify-content: space-between; gap: 24px; padding: 2px 14px 4px; }
.doc-company { text-align: right; font-size: 10pt; line-height: 1.5; }
.doc-kv { border-collapse: collapse; margin: 0 14px; } .doc-kv th { text-align: left; font-weight: 400; padding: 2px 10px 2px 0; white-space: nowrap; vertical-align: top; } .doc-kv td { padding: 2px 0; vertical-align: top; }
.doc-kv-head { margin: 0; }
.doc-text { padding: 0 14px; } .doc-text p { margin: 0 0 6px; }
.doc-lines { padding: 4px 14px 0; } .doc-lines div { height: 24px; border-bottom: 1px dotted #555; }
.doc-check { list-style: none; padding: 0 14px; margin: 0; columns: 2; } .doc-check li { break-inside: avoid; }
.doc-sub { font-weight: 700; font-size: 9.5pt; color: var(--dc); padding: 2px 14px 1px; } .doc-muted { opacity: .7; }
.doc-grid { width: calc(100% - 28px); margin: 0 14px; border-collapse: collapse; font-size: 9.5pt; } .doc-grid th, .doc-grid td { border: 1px solid #bbb; padding: 4px 6px; text-align: left; vertical-align: top; } .doc-grid th { background: color-mix(in srgb, var(--dc) 12%, #fff); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 14px; } .doc-photos img { width: 100%; border-radius: 3px; break-inside: avoid; }
.doc-sigs { display: flex; justify-content: space-between; gap: 40px; padding: 26px 14px 0; }
.doc-sig { flex: 0 1 240px; text-align: center; font-size: 10pt; margin-left: auto; } .doc-sig:first-child { margin-left: 0; } .doc-sigs .doc-sig:only-child { margin-left: auto; }
.doc-sig-line { height: 64px; border-bottom: 1px dotted #333; display: flex; align-items: flex-end; justify-content: center; } .doc-sig-line img { max-height: 60px; max-width: 100%; }
.doc-sig small { display: block; color: #555; font-size: 8pt; }
.doc-pb { break-after: page; height: 0; }
.doc-preview { background: color-mix(in srgb, var(--text) 6%, var(--bg)); border-radius: var(--r-xl); padding: 18px; overflow: auto; }
.doc-preview .doc { width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 36px; box-shadow: var(--shadow-pop); border-radius: 2px; }
.doc-preview .doc-pb { border-top: 2px dashed #bbb; margin: 18px -36px; height: 0; }
@media (max-width: 700px) { .doc-preview { padding: 8px; } .doc-preview .doc { padding: 16px 14px; font-size: 9pt; } .doc-head-cols { flex-direction: column; gap: 8px; } .doc-company { text-align: left; } }
@media print {
  @page { size: A4; margin: 12mm 12mm 14mm; }
  #protocol .doc { font-size: 10pt; }
}
/* generator sheets (report / document) */
.gen { display: grid; gap: 14px; } @media (min-width: 1000px) { .gen { grid-template-columns: 320px 1fr; align-items: start; } }
.gen-form { position: sticky; top: 0; } .gen-quick { flex-wrap: wrap; }
.tpl-fields { display: flex; flex-direction: column; gap: 10px; } .tpl-fields label { display: flex; flex-direction: column; gap: 4px; } .tpl-fields .tf-check { flex-direction: row; align-items: center; gap: 8px; }
/* template editor */
.te { display: grid; gap: 16px; } @media (min-width: 1100px) { .te { grid-template-columns: minmax(360px, 440px) 1fr; align-items: start; } .te-prev { position: sticky; top: 0; max-height: calc(100vh - 140px); } }
.te-meta { display: grid; gap: 10px; margin-bottom: 12px; }
.te-blocks { display: flex; flex-direction: column; gap: 6px; }
.te-b { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); }
.te-b.off { opacity: .55; } .te-b.drag { outline: 2px dashed var(--accent); }
.te-bh { display: flex; align-items: center; gap: 6px; padding: 6px 8px; cursor: pointer; }
.te-bh .te-type { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.te-bh .te-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.te-bb { padding: 4px 10px 10px; display: none; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); }
.te-b.open .te-bb { display: flex; }
.te-bb label { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-md); }
.te-rows { display: flex; flex-direction: column; gap: 4px; } .te-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 4px; }
.te-ph { display: flex; flex-wrap: wrap; gap: 4px; max-height: 120px; overflow-y: auto; padding: 6px; border: 1px dashed var(--border); border-radius: var(--r-md); }
.te-ph button { font-size: var(--fs-xs); padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.te-ph button:hover { border-color: var(--accent); color: var(--accent); }
.tpl-list .tpl-row { align-items: center; }
.co-logo { max-height: 60px; max-width: 220px; display: block; margin: 6px 0; background: #fff; padding: 4px; border-radius: 6px; border: 1px solid var(--border); }
@media (min-width: 700px) { .sheet.sheet-xwide { max-width: 1400px; width: 96vw; } }
.doc-b.doc-clientNotes { break-after: avoid; }

.wk-chip.more { --c: var(--muted); font-weight: 600; text-align: center; border-left-width: 0; }

/* rows that must stay laid out even off screen */
.row.sel, .row.flash { content-visibility: visible; }
.list-more { display: block; margin: 8px auto 14px; }

/* ===== in-app dialogs, toast variants, inline validation ===== */
.dlg-back { position: fixed; inset: 0; z-index: var(--z-dialog); background: var(--scrim); display: grid; place-items: center; padding: 16px; animation: fadein .15s ease-out both; }
.dlg-back.closing { animation: fadeout .14s ease-in forwards; pointer-events: none; }
.dlg { width: min(440px, 100%); background: var(--card); color: var(--text); border-radius: var(--r-3xl); box-shadow: var(--shadow-modal); padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 12px; animation: sheetpop .18s cubic-bezier(.2,.9,.3,1.2) both; }
.dlg-head { display: flex; align-items: center; gap: 12px; }
.dlg-head h3 { margin: 0; font-size: var(--fs-lg); line-height: 1.3; font-family: var(--font-head); }
.dlg-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.dlg-ic .ic { width: 20px; height: 20px; }
.dlg.danger .dlg-ic { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.dlg-msg { color: var(--muted); font-size: var(--fs-base); line-height: 1.5; padding-left: 50px; }
.dlg-field { display: flex; flex-direction: column; gap: 4px; }
.dlg-field textarea { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-sm); }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dlg-btns .btn { min-width: 96px; }
@media (max-width: 520px) { .dlg-msg { padding-left: 0; } .dlg-btns .btn { flex: 1; } }
.toast-msg { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; line-height: 1.4; }
.toast-ic { flex: none; display: grid; place-items: center; } .toast-ic .ic { width: 18px; height: 18px; }
.toast-error { background: #7f1d1d; } .toast-error .toast-act { color: #fecaca; }
.toast-ok { background: #14532d; }
.field-err { display: block; color: var(--red); font-size: var(--fs-sm); font-weight: 500; margin-top: 3px; text-transform: none; letter-spacing: 0; }
.field-err[hidden] { display: none; }
input.invalid, select.invalid, textarea.invalid, canvas.invalid, .invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent) !important; }

/* ===== one visual language for all modules ===== */
/* icons: every SVG icon inherits colour and sits on the text baseline */
.ic { flex: none; vertical-align: -3px; }
.ni .ic { width: 20px; height: 20px; }
.tabbar a .ni .ic { width: 22px; height: 22px; }
@media (min-width: 900px) { .side nav a .ni .ic { width: 22px; height: 22px; } }
.nav-item .ni .ic { width: 16px; height: 16px; vertical-align: -2px; }
.nav-item .ni { display: inline-grid; place-items: center; }
.ctx-ic { display: inline-grid; place-items: center; } .ctx-ic .ic { width: 16px; height: 16px; }
.sr-ic .ic { width: 16px; height: 16px; color: var(--muted); } .sr-item.on .sr-ic .ic { color: var(--accent); }
/* meta items with an icon (address, phone, person, counts) */
.mi { display: inline-flex; align-items: center; gap: 4px; min-width: 0; } .mi .ic { width: 14px; height: 14px; color: var(--muted); vertical-align: 0; }
a.mi { color: inherit; text-decoration: none; } a.mi:hover { color: var(--accent); } a.mi:hover .ic { color: var(--accent); }
/* service: tabs = segmented control like the other view switches */
.svc-tabs { margin-bottom: 10px; } .svc-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; }
.svc-tabs .ic { width: 16px; height: 16px; }
/* visit info card: same card language as the rest (no underlined links, icons instead of emoji) */
.infocard { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); line-height: 1.5; padding: 12px 14px; }
.infocard .ic-head { display: flex; gap: 10px; align-items: flex-start; }
.infocard .ic-ico { width: 34px; height: 34px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.infocard .ic-ico .ic { width: 18px; height: 18px; }
.infocard .ic-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0 44px; font-size: var(--fs-base); }
.infocard details { margin-left: 44px; }
.signed { color: var(--green); font-weight: 500; } .signed .ic { color: var(--green); width: 18px; height: 18px; }
.timerbox .mi .ic { width: 16px; height: 16px; }
/* calendar page on wide screens = the workspace calendar, full width */
#view.cal-main { padding: 0 20px 12px; max-width: none; display: flex; flex-direction: column; overflow: hidden; }
.cal-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cal-page > .pane-switch { display: none; }
.cap { text-transform: capitalize; }
.space-note .ic { width: 13px; height: 13px; vertical-align: -2px; }
.att-th .ic { width: 22px; height: 22px; color: var(--muted); }

.dlg-field .lbl { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dlg-input { color: var(--text); font-size: var(--fs-body); font-family: inherit; }

/* icon buttons in pane toolbars – consistent sizes */
.pane-toggles { align-items: center; }
.pane-toggles .icon-btn, .list-head .icon-btn { min-width: 34px; min-height: 34px; width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: var(--r-md); }
.pane-toggles .icon-btn .ic, .list-head .icon-btn .ic { width: 18px; height: 18px; }
.pane-toggles .icon-btn.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.detail-bar .icon-btn { min-width: 36px; min-height: 36px; padding: 0; display: inline-grid; place-items: center; }
.qa-chip .ic { width: 16px; height: 16px; }
.qa-go { display: inline-grid; place-items: center; } .qa-go .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.seg-s button .ic { width: 17px; height: 17px; }
.rte-toolbar button .ic { width: 17px; height: 17px; }

/* Material Symbols are filled shapes (no strokes) */
.ic { fill: currentColor; stroke: none; }
.qa-go .ic { stroke-width: 0; }
.doc-bar .doc-ic { width: 1.25em; height: 1.25em; margin-right: 6px; vertical-align: -0.25em; color: #fff; }
.te-icon { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .te-icon .lbl { flex-basis: 100%; }
.te-icon-prev { width: 34px; height: 34px; border-radius: var(--r-md); display: inline-grid; place-items: center; background: var(--bg); border: 1px solid var(--border); }
.te-icon-prev .ic { width: 22px; height: 22px; }
/* icon picker */
.ipk { display: flex; flex-direction: column; gap: 10px; }
.ipk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .ipk-q { flex: 1; min-width: 200px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); font: inherit; }
.ipk-cats { flex-wrap: wrap; }
.ipk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 58vh; overflow-y: auto; padding: 2px; }
.ipk-i { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 6px; border: 1px solid transparent; border-radius: var(--r-lg); background: var(--bg); color: var(--text); cursor: pointer; }
.ipk-i:hover, .ipk-i:focus-visible { border-color: var(--accent); color: var(--accent); }
.ipk-i.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ipk-i small { font-size: var(--fs-2xs); color: var(--muted); text-align: center; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.ipk-foot { text-align: center; }
.doc-bar > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.doc-bar .doc-ic { margin-right: 0; vertical-align: 0; flex: none; }

/* ===== client card, recurring reviews & licences, devices ===== */
.cc-head { align-items: flex-start; }
.cc-title { display: flex; align-items: center; gap: 8px; min-width: 0; } .cc-title h1 { margin: 0; } .cc-title small { display: block; margin-top: 2px; }
.cc-title .icon-btn { display: inline-grid; place-items: center; text-decoration: none; }
.cc-tabs { flex-wrap: wrap; } .cc-tabs button span { white-space: nowrap; }
@media (max-width: 700px) { .cc-tabs button:not(.on) span { display: none; } .cc-tabs button { padding: 7px 12px; } .cc-head .head-actions .btn:not(.primary) { padding: 6px 8px; } }
.cc-grid { display: grid; gap: 14px; } @media (min-width: 1000px) { .cc-grid { grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.4fr); align-items: start; } }
.cc-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cc-card { margin: 0; } .cc-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; } .cc-card h3 .ic { width: 18px; height: 18px; color: var(--accent); }
.cc-kv { display: flex; flex-direction: column; gap: 6px; }
.cc-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cc-item { display: flex; align-items: flex-start; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.cc-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; font-size: var(--fs-md); }
.cc-none { font-size: var(--fs-md); }
.cc-sys .rte { min-height: 220px; }
.row.sched { align-items: center; } .sch-ic { width: 34px; height: 34px; flex: none; border-radius: var(--r-lg); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-right: 10px; }
.sch-ic .ic { width: 18px; height: 18px; }
.row.sched.late { border-left: 3px solid var(--red); } .row.sched.late .sch-ic { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.row.sched.soon .sch-ic { background: color-mix(in srgb, var(--amber) 18%, transparent); color: #b45309; }
.row.sched.off { opacity: .55; }
.row.sched .row-meta b { font-weight: 600; } .row.sched.late .row-meta b { color: var(--red); }
.sch-every { display: flex; gap: 6px; } .sch-every select { flex: 1; }
.mi.late { color: var(--red); } .mi.late .ic { color: var(--red); }
.dev-bar { display: flex; gap: 10px; align-items: center; margin: 4px 0 8px; } .dev-bar input { flex: 1; min-height: 38px; padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); color: var(--text); font: inherit; }
.row.dev { align-items: center; } .dev-act { display: flex; gap: 6px; flex: none; } .dev-act .btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.tl .row { margin-bottom: 6px; } .tl .row.order, .tl .row:not(.visit) { align-items: center; }
.glpi .hint.ok { color: var(--green); font-weight: 600; }

/* ===== photos (gallery, viewer, annotations, compare) and site plans ===== */
.iq-ov { position: fixed; inset: 0; z-index: var(--z-overlay); display: flex; flex-direction: column; animation: fadein .14s ease-out both; }
.iq-ov .icon-btn { display: inline-grid; place-items: center; min-width: 38px; min-height: 38px; padding: 0; }
.iq-ov .icon-btn .ic { width: 21px; height: 21px; }
.iq-ov .icon-btn:disabled { opacity: .35; }
.pz-anim { transition: transform .26s var(--ease); }
/* gallery */
.ph-gal { position: relative; border-radius: var(--r-2xl); }
.ph-gal.over { outline: 2px dashed var(--accent); outline-offset: 4px; background: var(--accent-soft); }
.ph-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.ph-q, .pl-q { flex: 1; min-width: 180px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); color: var(--text); font: inherit; }
.ph-sort { min-height: 34px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); color: var(--text); padding: 4px 8px; }
.ph-bar .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ph-cam { display: none !important; } @media (pointer: coarse) { .ph-cam { display: inline-flex !important; } }
.ph-tags { flex-wrap: wrap; margin-bottom: 4px; }
.ph-day { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.ph-day h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; margin-bottom: 10px; }
@media (max-width: 600px) { .ph-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; } }
.ph-t { position: relative; aspect-ratio: 1; border: 0; padding: 0; margin: 0; border-radius: var(--r-lg); overflow: hidden; display: block; width: 100%;
  background: color-mix(in srgb, var(--muted) 14%, var(--card)); cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ph-t img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .2s, transform .18s var(--ease); }
.ph-t.ld img { opacity: 1; }
.ph-t.noimg::after { content: 'brak podglądu'; position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-xs); color: var(--muted); }
.ph-t:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .ph-t:hover img { transform: scale(1.035); } }
.ph-badges { position: absolute; top: 5px; left: 5px; display: flex; gap: 3px; }
.ph-badges i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; }
.ph-badges .ic { width: 14px; height: 14px; }
.ph-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 7px 5px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; font-size: var(--fs-xs); line-height: 1.25; text-align: left;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph-chk { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); display: none; place-items: center; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.ph-chk .ic { width: 16px; height: 16px; opacity: 0; }
.ph-gal.selecting .ph-chk { display: grid; }
.ph-t.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.ph-t.sel img { transform: scale(.9); border-radius: var(--r-sm); }
.ph-t.sel .ph-chk { background: var(--accent); border-color: var(--accent); } .ph-t.sel .ph-chk .ic { opacity: 1; }
.ph-more { display: flex; margin: 10px auto 4px; }
.ph-empty { display: flex; gap: 16px; align-items: center; justify-content: center; text-align: left; padding: 34px 16px; }
.ph-empty > .ic { width: 44px; height: 44px; color: var(--accent); flex: none; opacity: .8; }
.ph-selbar { position: fixed; left: 50%; transform: translateX(-50%); width: max-content; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); z-index: var(--z-selbar); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; max-width: calc(100vw - 16px); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-2xl); box-shadow: 0 10px 34px rgba(0,0,0,.25); animation: ctxin .12s ease-out; }
.ph-selbar b { padding: 0 6px; font-size: var(--fs-base); }
@media (min-width: 900px) { .ph-selbar { bottom: 20px; left: calc(50% + 105px); } }
.ph-pick { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.ph-prog { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 74px); z-index: var(--z-progress); min-width: 240px; padding: 10px 14px; border-radius: var(--r-xl); background: #222; color: #fff; font-size: var(--fs-md); box-shadow: var(--shadow-float); }
@media (min-width: 900px) { .ph-prog { bottom: 84px; } }
.ph-prog.out { opacity: 0; transition: opacity .2s; }
.ph-prog-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); margin-top: 7px; overflow: hidden; } .ph-prog-bar div { height: 100%; width: 0; background: #6b93ff; transition: width .2s; }
/* viewer (dark in both themes, like every photo app) */
.pv { background: #0b0d12; color: #e8ebf2; --muted: #98a1b3; }
.pv .icon-btn { color: #e8ebf2; } @media (hover: hover) { .pv .icon-btn:hover { background: rgba(255,255,255,.1); } }
.pv .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #e8ebf2; } .pv .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pv-top { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--safe-t)) 8px 6px; background: rgba(11,13,18,.94); position: relative; z-index: 3; transition: opacity .2s; }
.pv-ttl { flex: 1; min-width: 0; line-height: 1.25; } .pv-ttl b { display: block; } .pv-ttl small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-acts { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
@media (max-width: 640px) { .pv-acts .btn span, .pv-acts [data-a=zi], .pv-acts [data-a=zo] { display: none; } .pv-acts .btn { padding: 5px 9px; } }
.pv-mid { flex: 1; display: flex; min-height: 0; position: relative; }
.pv-stage { flex: 1; position: relative; min-width: 0; overflow: hidden; }
.pv-vp { position: absolute; inset: 0; touch-action: none; overflow: hidden; cursor: grab; }
.pv-vp:active { cursor: grabbing; }
.pv-ct { position: absolute; left: 0; top: 0; will-change: transform; }
.pv-img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.pv-an, .pv-an > svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; z-index: 2; transition: opacity .2s; }
.pv-nav .ic { width: 26px; height: 26px; } .pv-nav.l { left: 12px; } .pv-nav.r { right: 12px; } .pv-nav[hidden] { display: none; }
@media (pointer: coarse) { .pv-nav { display: none; } }
.pv-load { position: absolute; left: 0; right: 0; top: 0; height: 3px; z-index: 3; pointer-events: none; }
.loading .pv-load { background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: pvload 1s linear infinite; }
@keyframes pvload { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.pv-info { display: none; width: 340px; flex: none; overflow-y: auto; padding: 14px; background: #151922; border-left: 1px solid #232a36; }
.pv.info .pv-info { display: block; }
@media (max-width: 800px) { .pv-info { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 56%; border-left: 0; border-top: 1px solid #232a36; border-radius: var(--r-3xl) var(--r-3xl) 0 0; z-index: 3; box-shadow: 0 -10px 30px rgba(0,0,0,.4); } }
.pv-info textarea, .pv-info input { width: 100%; border: 1px solid #2b3240; background: #0f131a; color: #e8ebf2; border-radius: var(--r-lg); padding: 8px 10px; font: inherit; }
.pv-sec { margin-bottom: 14px; } .pv-sec .lbl { display: block; color: var(--muted); font-size: var(--fs-sm); margin-bottom: 4px; }
.pv-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; } .pv-tags:empty { display: none; }
.chip.tag { --c: #8fb0ff; display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 9px; font-size: var(--fs-md); }
.chip.tag button { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; padding: 0 4px; display: inline-grid; place-items: center; } .chip.tag button .ic { width: 13px; height: 13px; }
.pv-sugg { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; } .pv-sugg .pill { font-size: var(--fs-sm); padding: 2px 9px; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #cfd6e4; }
.pv-meta > div { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-md); padding: 3px 0; } .pv-meta .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.pv-meta a, .pv-info a { color: #8fb0ff; }
.pv-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-strip { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px calc(8px + var(--safe-b)); background: rgba(11,13,18,.94); scrollbar-width: thin; transition: opacity .2s; }
.pv-strip[hidden] { display: none; }
.ph-t.mini { width: 58px; height: 58px; flex: none; border-radius: var(--r-md); opacity: .62; background: #1a1f29; }
.ph-t.mini.on { opacity: 1; outline: 2px solid #fff; outline-offset: -2px; }
.pv.bare .pv-top, .pv.bare .pv-strip, .pv.bare .pv-nav { opacity: 0; pointer-events: none; }
/* compare */
.cmp-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px; }
.cmp-box { position: relative; height: 100%; max-width: 100%; aspect-ratio: 4 / 3; touch-action: none; user-select: none; cursor: ew-resize; }
.cmp-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.cmp-a { position: absolute; inset: 0; }
.cmp-h { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #fff; box-shadow: 0 0 6px rgba(0,0,0,.6); }
.cmp-h span { position: absolute; top: 50%; left: -21px; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.cmp-l { position: absolute; top: 10px; padding: 3px 9px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .04em; } .cmp-l small { display: block; font-weight: 500; letter-spacing: 0; opacity: .85; }
.cmp-l.l { left: 10px; } .cmp-l.r { right: 10px; text-align: right; }
.cmpv .seg { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); } .cmpv .seg button { color: #cfd6e4; } .cmpv .seg button.on { background: rgba(255,255,255,.16); color: #fff; }
.cmpv.sbs .cmp-box { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; aspect-ratio: auto; cursor: default; }
.cmpv.sbs .cmp-box img, .cmpv.sbs .cmp-a { position: relative; inset: auto; } .cmpv.sbs .cmp-a { order: -1; clip-path: none !important; } .cmpv.sbs .cmp-h { display: none; }
.cmpv.sbs .cmp-l.r { right: 10px; }
/* annotation editor */
.an-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 8px; background: #11141b; border-bottom: 1px solid #232a36; position: relative; z-index: 3; }
.an-grp { display: flex; gap: 3px; padding: 3px; border-radius: var(--r-xl); background: rgba(255,255,255,.05); align-items: center; }
.an-tool { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 52px; padding: 5px 6px; border: 0; border-radius: var(--r-md); background: none; color: #cfd6e4; font-size: var(--fs-xs); }
.an-tool .ic { width: 20px; height: 20px; } .an-tool.on { background: var(--accent); color: #fff; }
.an-col { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: var(--c); margin: 0 2px; }
.an-col.on { box-shadow: 0 0 0 2px #11141b, 0 0 0 4px #fff; }
.an-sz { width: 36px; height: 34px; border: 0; border-radius: var(--r-md); background: none; color: #cfd6e4; display: grid; place-items: center; }
.an-sz i { display: block; width: 18px; height: var(--w); border-radius: 9px; background: currentColor; } .an-sz.on { background: rgba(255,255,255,.16); color: #fff; }
.an .pv-vp { cursor: crosshair; }
@media (max-width: 700px) { .an-tools { order: 3; border-bottom: 0; border-top: 1px solid #232a36; padding-bottom: calc(6px + var(--safe-b)); } .an-tool span { display: none; } .an-tool { min-width: 40px; } .pv.an .pv-ttl small { display: none; } }
/* site plans */
.pl { background: var(--bg); color: var(--text); }
/* printed area of a plan (print sheet → Wybierz obszar) */
.pa .pv-acts { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pa-wrap { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.pa-box { position: relative; touch-action: none; user-select: none; cursor: crosshair; background: var(--card); }
.pa-box img { width: 100%; height: 100%; display: block; pointer-events: none; }
.pa-box svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; fill: var(--accent); }
.pa-sel { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px var(--scrim); cursor: move; }
.pa-sel i { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); }
.pa-sel i[data-c=nw] { left: -10px; top: -10px; cursor: nwse-resize; } .pa-sel i[data-c=ne] { right: -10px; top: -10px; cursor: nesw-resize; }
.pa-sel i[data-c=sw] { left: -10px; bottom: -10px; cursor: nesw-resize; } .pa-sel i[data-c=se] { right: -10px; bottom: -10px; cursor: nwse-resize; }
@media (max-width: 700px) { .pa .pv-ttl small { display: none; } }
.pl-top { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--safe-t)) 8px 6px; background: var(--card); border-bottom: 1px solid var(--border); position: relative; z-index: 4; }
.pl-ttl { flex: 1; min-width: 0; line-height: 1.25; } .pl-ttl b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .pl-ttl small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-acts { display: flex; align-items: center; gap: 2px; }
.pl-mode button { display: inline-flex !important; align-items: center; gap: 5px; }
@media (max-width: 760px) { .pl-mode button span { display: none; } .pl-mode button.on span { display: inline; } }
@media (max-width: 480px) { .pl-mode button.on span { display: none; } }
.pl-body { flex: 1; display: flex; min-height: 0; position: relative; }
.pl-stage { flex: 1; position: relative; overflow: hidden; min-width: 0; background-color: var(--bg); background-image: radial-gradient(color-mix(in srgb, var(--muted) 22%, transparent) 1px, transparent 1.2px); background-size: 18px 18px; }
.pl-vp { position: absolute; inset: 0; touch-action: none; overflow: hidden; cursor: grab; } .pl-vp:active { cursor: grabbing; }
.pl.editing .pl-vp { cursor: crosshair; }
.pl-ct { position: absolute; left: 0; top: 0; will-change: transform; background: #fff; outline: 1px solid color-mix(in srgb, var(--muted) 35%, transparent); }
.pl-img { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.pl-fov { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pl-pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; contain: strict; will-change: transform; }
.pin, .pl-hd { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border: 0; background: none; pointer-events: auto; touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pin-b { position: absolute; inset: 0; border-radius: 50%; background: var(--c); color: #fff; border: 2px solid #fff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .12s var(--ease); }
.pin-b .ic { width: 16px; height: 16px; }
.pin.on .pin-b { transform: scale(1.22); box-shadow: 0 0 0 3px var(--c), 0 4px 14px rgba(0,0,0,.4); }
.pin-st { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--s); border: 2px solid #fff; }
.pin-n { position: absolute; bottom: -5px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #111827; color: #fff; font: 700 10px/17px var(--font); font-style: normal; text-align: center; border: 1.5px solid #fff; }
.pin-l { display: none; position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.94); color: #111; font: 700 12px/1.5 var(--font); white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pl-pins.labels .pin-l { display: block; } .pl-pins.far.labels .pin:not(.on) .pin-l { display: none; }
.pin.bad .pin-b::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--s, #dc2626); border-color: #dc2626; animation: pinpulse 1.6s ease-out infinite; }
@keyframes pinpulse { from { opacity: .9; transform: scale(.8); } to { opacity: 0; transform: scale(1.5); } }
.pin.dragging { opacity: .85; cursor: grabbing; } .pin.dragging .pin-b { transform: scale(1.3); }
/* order plan (3.17): tasks coloured by status, the other layer as ghosts, client's points with open work, picking */
.pin.ghost .pin-b { opacity: .5; transform: scale(.78); box-shadow: none; }
.pin.ghost.on .pin-b { opacity: 1; transform: scale(1); box-shadow: 0 0 0 3px var(--c); }
.pin.ghost.wt .pin-b { opacity: .8; border-style: dashed; }
.pl-pins.labels .pin.ghost:not(.on) .pin-l { opacity: .7; }
.pin.task.done .pin-b { box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.pin.wo .pin-b::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px dashed var(--warn); }
.pin.picked .pin-b { transform: scale(1.18); box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(0,0,0,.4); }
.pl-wp { padding-bottom: 0; } .pl-opf { padding: 0 12px 14px; } .pl-opf:empty { display: none; } .pl-opf .hint { margin-bottom: var(--sp-2); }
.pl-one .wp-row { border-bottom: 0; padding-top: 0; }
.pl-banner { flex-wrap: wrap; justify-content: center; }
@media (max-width: 600px) { .pl-banner > span { flex-basis: 100%; text-align: center; } }
.pl-hd { width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: #fff; color: #2563eb; border: 2px solid #2563eb; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: grab; }
.pl-hd .ic { width: 16px; height: 16px; }
.pl-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; z-index: 2; }
.pl-zoom .icon-btn { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
.pl.editing .pl-zoom { bottom: 78px; }
.pl-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; max-width: calc(100% - 24px);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); font-size: var(--fs-md); }
.pl-banner > .ic { color: var(--accent); flex: none; } .pl-banner[hidden] { display: none; }
.pl-cats { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; gap: 5px; overflow-x: auto; padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-2xl); box-shadow: var(--shadow-pop); scrollbar-width: none; }
.pl-cats[hidden] { display: none; }
.pl-cat { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); color: var(--text); font-size: var(--fs-md); white-space: nowrap; }
.pl-cat .ic { color: var(--c); width: 18px; height: 18px; } .pl-cat.on { background: var(--c); border-color: var(--c); color: #fff; } .pl-cat.on .ic { color: #fff; }
@media (max-width: 700px) { .pl-cat:not(.on) span { display: none; } }
.pl-side { display: none; width: 360px; flex: none; overflow-y: auto; background: var(--card); border-left: 1px solid var(--border); }
.pl.has-side .pl-side { display: block; }
@media (max-width: 800px) {
  .pl-side { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 58%; border-left: 0; border-top: 1px solid var(--border); border-radius: var(--r-3xl) var(--r-3xl) 0 0; z-index: 5; box-shadow: 0 -10px 30px rgba(0,0,0,.25); padding-bottom: var(--safe-b); }
}
.pl-sh { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; background: var(--card); border-bottom: 1px solid var(--border); }
.pl-sh > b { flex: 1; }
.pl-lab { flex: 1; min-width: 0; font: inherit; font-weight: 700; font-size: var(--fs-lg); border: 1px solid transparent; background: transparent; color: var(--text); padding: 5px 7px; border-radius: var(--r-md); }
.pl-lab:hover, .pl-lab:focus { border-color: var(--border); background: var(--bg); outline: none; }
.pl-form { padding: 10px 12px 14px; }
.pl-dot { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; font: 700 10px/1 var(--font); }
.pl-dot .ic { width: 16px; height: 16px; } .pl-dot.big { width: 34px; height: 34px; } .pl-dot.big .ic { width: 19px; height: 19px; } .pl-dot.sm { width: 20px; height: 20px; } .pl-dot.sm .ic { width: 12px; height: 12px; }
.pl-side > .pl-q { display: block; width: calc(100% - 24px); margin: 10px 12px 6px; }
.pl-stf { padding: 0 12px; flex-wrap: wrap; }
.pl-stf .pill { display: inline-flex; align-items: center; gap: 5px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--s); flex: none; }
.pl-list { padding: 4px 6px 16px; }
.pl-gh { display: flex; align-items: center; gap: 6px; margin: 12px 8px 4px; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pl-gh .ic { width: 16px; height: 16px; color: var(--c); }
.pl-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 8px; border: 0; background: none; border-radius: var(--r-lg); color: inherit; font: inherit; }
.pl-row .grow { min-width: 0; } .pl-row small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-sm); }
.pl-row > small.muted { display: inline-flex; align-items: center; gap: 2px; } .pl-row > small .ic { width: 13px; height: 13px; }
@media (hover: hover) { .pl-row:hover { background: var(--bg); } }
.pl-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 5px; margin: 4px 0 8px; } .pl-photos:empty { display: none; }
.pl-glpi { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 8px 10px; background: var(--bg); } .pl-glpi small { display: block; color: var(--muted); } .pl-glpi .btnrow { margin-top: 6px; }
.pl-gl { display: flex; flex-direction: column; margin-top: 8px; max-height: 60vh; overflow-y: auto; }
.pl-fovbox { border-radius: var(--r-lg); background: var(--bg); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.pl-fovbox output { float: right; color: var(--muted); font-variant-numeric: tabular-nums; } .pl-fovbox input[type=range] { width: 100%; accent-color: var(--accent); }
.pl-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; }
.pl-layers { width: auto; min-width: 250px; display: flex; flex-direction: column; gap: 6px; }
.pl-layers .tf-check { display: flex; align-items: center; gap: 8px; } .pl-layers hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }
.pl-layers select { width: 100%; margin-top: 4px; }
.pl-menu { padding: 6px; gap: 2px; } .pl-menu button { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-md); text-align: left; color: var(--text); font: inherit; }
.pl-menu button.danger { color: var(--red); } @media (hover: hover) { .pl-menu button:hover { background: var(--bg); } }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.pl-card { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: var(--r-2xl); overflow: hidden; background: var(--card); color: var(--text); text-align: left; font: inherit; box-shadow: var(--shadow); transition: border-color .15s, transform .15s var(--ease); }
@media (hover: hover) { .pl-card:hover { border-color: var(--accent); transform: translateY(-1px); } }
.pl-th { aspect-ratio: 4 / 3; border-radius: 0; background: #fff; pointer-events: none; } .pl-th img { object-fit: contain; }
.pl-cb { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; min-width: 0; } .pl-cb b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; font-size: var(--fs-sm); color: var(--muted); } .pl-stats span { display: inline-flex; align-items: center; gap: 3px; } .pl-stats .ic { width: 14px; height: 14px; }
.pl-stats .st-issue { color: var(--red); } .pl-stats .st-todo { color: var(--amber); }
.pl-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; border: 2px dashed var(--border); border-radius: var(--r-2xl); text-align: center; cursor: pointer; background: var(--bg); }
.pl-drop > .ic { width: 30px; height: 30px; color: var(--accent); } .pl-drop small { color: var(--muted); } .pl-drop.over, .pl-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.pl-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pl-page { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); color: var(--text); }
.pl-page-i { min-height: 100px; display: grid; place-items: center; } .pl-page-c { max-width: 100%; height: auto; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
@media (hover: hover) { .pl-page:hover { border-color: var(--accent); } }
/* documents: photos, plan */
.doc-photos { grid-template-columns: repeat(3, 1fr); }
.doc-photos .doc-ph { margin: 0; }
.doc-phs { display: grid; gap: 10px; padding: 0 14px; grid-template-columns: repeat(2, 1fr); }
.doc-phs.c1 { grid-template-columns: 1fr; } .doc-phs.c3 { grid-template-columns: repeat(3, 1fr); } .doc-phs.c4 { grid-template-columns: repeat(4, 1fr); }
.doc-ph { margin: 0; break-inside: avoid; page-break-inside: avoid; }
.doc-ph-i { position: relative; } .doc-ph-i img { width: 100%; display: block; border-radius: 3px; } .doc-ph-i svg.annot { position: absolute; inset: 0; width: 100%; height: 100%; }
.doc-ph-n { position: absolute; top: 5px; left: 5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--dc); color: #fff; font: 700 8.5pt/20px Arial, sans-serif; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-ph figcaption { font-size: 8.5pt; line-height: 1.3; margin-top: 3px; } .doc-ph figcaption b, .doc-ph figcaption span, .doc-ph figcaption small { display: block; } .doc-ph figcaption small { color: #666; }
.doc-ph-day { margin: 10px 14px 5px; font-weight: 700; font-size: 9.5pt; color: var(--dc); border-bottom: 1px solid #ddd; padding-bottom: 2px; break-after: avoid; }
.doc-plan { position: relative; margin: 0 14px; border: 1px solid #ccc; break-inside: avoid; } .doc-plan img { width: 100%; display: block; } .doc-plan svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.doc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 14px 10px; font-size: 8.5pt; } .doc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.doc-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .doc-legend i.st { width: 8px; height: 8px; }
.doc-b.doc-photoset { break-inside: auto; }
@media print { body.print-protocol .iq-ov, body.print-protocol .ph-selbar, body.print-protocol .ph-prog, .iq-ov { display: none !important; } }
.form label.tf-check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--fs-base); color: var(--text); }
.form label.btn, .form .field label.btn { flex-direction: row; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--fs-base); color: var(--text); }
.pl-fovbox label:not(.tf-check) { display: grid; grid-template-columns: 1fr auto; align-items: center; } .pl-fovbox label input[type=range] { grid-column: 1 / -1; }
.pl-fovbox output { float: none; text-transform: none; }
.ph-gal.selecting { padding-bottom: 130px; }
@media (max-width: 700px) { .cc-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; } .cc-tabs::-webkit-scrollbar { display: none; } .cc-tabs button { flex: none; } }
@media (max-width: 600px) { .ph-selbar .btn:not(.primary) { font-size: 0; gap: 0; padding: 5px 9px; } .ph-selbar .btn .ic { width: 18px; height: 18px; } .ph-selbar { flex-wrap: nowrap; } }
.photos.v-ph { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-bottom: 6px; } .photos.v-ph:empty { display: none; }
.photos.v-ph figure img { width: 100%; height: auto; aspect-ratio: 1; }
/* annotation editor (select / move / resize, inline text) */
.an-grp[hidden] { display: none; }
.an-tools { gap: 6px; }
.an-sz .ic { width: 18px; height: 18px; }
.an-mini { position: absolute; z-index: 4; display: flex; gap: 2px; padding: 4px; background: #1a1f29; border: 1px solid #2b3240; border-radius: var(--r-xl); box-shadow: var(--shadow-float); }
.an-mini[hidden] { display: none; }
.an-mini button { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; min-width: 34px; justify-content: center; padding: 0 8px; border: 0; border-radius: var(--r-md); background: none; color: #e8ebf2; font-size: var(--fs-md); }
.an-mini button .ic { width: 18px; height: 18px; } .an-mini button.danger { color: #ff7a7a; }
@media (hover: hover) { .an-mini button:hover { background: rgba(255,255,255,.1); } }
.an-input { position: absolute; z-index: 5; min-width: 120px; margin: 0; padding: 2px 6px; border: 2px dashed #3b82f6; border-radius: 6px; font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 700; line-height: 1.2; resize: none; overflow: hidden; outline: none; white-space: pre; }
.an[data-tool=select] .pv-vp { cursor: default; } .an[data-tool=erase] .pv-vp { cursor: cell; }
@media (max-width: 700px) { .an-tools { gap: 4px; padding: 4px; } .an-grp { gap: 1px; padding: 2px; } .an-tool { min-width: 36px; padding: 5px 3px; } .an-col { width: 24px; height: 24px; margin: 0 1px; } .an-sz { width: 30px; } .pv-acts [data-a=save] span { display: none; } }
.wd-how { margin: 4px 0 6px; font-size: var(--fs-base); } .wd-how summary { cursor: pointer; color: var(--accent); font-weight: 600; } .wd-how ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.wd-how code { word-break: break-all; background: var(--bg); padding: 1px 4px; border-radius: 4px; font-size: .9em; user-select: all; }
.wd-stat { display: flex; gap: 6px; align-items: flex-start; } .wd-stat .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.gcal .btn:disabled { opacity: .45; cursor: default; }
.wd-cl .ic { width: 15px; height: 15px; vertical-align: -3px; color: var(--green); }
.pv-wd a { word-break: break-all; }
/* style guide (#/styleguide) */
.sg .card h3 { margin-bottom: var(--sp-3); } .sg .sec { margin: var(--sp-4) 0 var(--sp-2); }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-2); }
.sg-sw { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); } .sg-sw i { height: 44px; border-radius: var(--r-lg); border: 1px solid var(--border); }
.sg-sw code, .sg code { color: var(--muted); font-size: var(--fs-xs); }
.sg-line { padding: var(--sp-1) 0; border-bottom: 1px solid var(--border); } .sg-line code { display: inline-block; width: 90px; }
.sg-box { height: 64px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--border); }
.sg-sp { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-1); } .sg-sp code { width: 60px; } .sg-sp i { height: 12px; background: var(--accent); border-radius: var(--r-xs); }

/* Zoho CRM */
.crm-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; margin-bottom: 10px; border-radius: var(--r-lg); background: var(--accent-soft); color: var(--text); font-size: var(--fs-md); text-transform: none; letter-spacing: 0; font-weight: 400; }
.crm-note .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--accent); }
.crm-note.warn { background: color-mix(in srgb, var(--amber) 16%, var(--card)); } .crm-note.warn .ic { color: #b45309; }
.form input.ro { background: color-mix(in srgb, var(--muted) 8%, var(--card)); color: var(--muted); cursor: default; }
.crm-stat { display: flex; gap: 6px; align-items: flex-start; } .crm-stat .ic { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.crm-filter { display: flex; gap: 6px; } .crm-filter select { flex: 1; min-width: 0; } .crm-filter input { flex: 1; min-width: 0; }
.crm-sum { padding: 10px 12px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--border); font-size: var(--fs-md); margin-top: 8px; } .crm-sum ul { margin: 6px 0 0; padding-left: 18px; max-height: 220px; overflow-y: auto; }
.crm-tplprev { font-size: var(--fs-md); line-height: 1.6; }
.crm .sub-title { margin: 10px 0 0; }
.cc-item .badge { align-self: center; }
a.btn { text-decoration: none; color: var(--text); } a.btn.primary { color: var(--on-accent); }
/* client of a task (pickers.js) and CRM tasks card (admin.js) */
.cli-pick input { width: 100%; margin-bottom: 6px; }
.cli-pick .cli-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.cli-pick .ctx-item { width: 100%; }
.crmt-proj { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.crmt-users { display: flex; flex-direction: column; gap: 6px; }
.form label.crmt-user { flex-direction: row; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--fs-base); color: var(--text); } .crmt-user span { flex: 0 0 120px; overflow: hidden; text-overflow: ellipsis; } .crmt-user select { flex: 1; min-width: 0; }

/* ===== work plan of an order (points = tasks; order and visit sheets) ===== */
.wp-head { display: flex; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-2); }
.wp-list .sec { margin: var(--sp-3) 2px var(--sp-1); }
.wp-list > summary.sec { cursor: pointer; }
.wp-row { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) var(--sp-1); border-bottom: 1px solid var(--border); }
.wp-row:last-child { border-bottom: 0; }
.wp-row .check { margin-top: 2px; }
.wp-row.done .check { background: var(--ok); border-color: var(--ok); }
.wp-row.done .wp-title { color: var(--muted); text-decoration: line-through; }
.wp-row.na .wp-title { color: var(--muted); }
.wp-pin { color: var(--muted); } .wp-pin.on { color: var(--accent); }
.wp-kind { width: 26px; min-width: 26px; height: 26px; display: grid; place-items: center; color: var(--muted); }
.wp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.wp-title { font-weight: 500; overflow-wrap: anywhere; }
.wp-ctl .wp-val { max-width: 320px; }
.wp-need, .wp-cam.need { color: var(--danger); }
.wp-ph { display: grid; grid-template-columns: repeat(auto-fill, 64px); gap: var(--sp-1); margin: 0; }
.wp-add { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.wp-add input { flex: 1 1 200px; } .wp-add select { flex: 0 1 180px; }
.wp-tools { margin-top: var(--sp-2); }
.wp-ver { color: var(--ok); }
.pill.wp-dov { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 2px 10px; color: var(--warn); }

/* ===== work plan templates (Więcej → Serwis) ===== */
.wpt-items { display: flex; flex-direction: column; gap: var(--sp-2); }
.wpt-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--card); }
.wpt-row .wpt-title { flex: 3 1 220px; } .wpt-row .wpt-group { flex: 1 1 120px; } .wpt-row .wpt-kind { flex: 0 1 190px; } .wpt-row .wpt-opt { flex: 2 1 200px; }
.form label.wpt-ph { flex-direction: row; align-items: center; gap: var(--sp-1); text-transform: none; letter-spacing: 0; font-size: var(--fs-sm); color: var(--muted); }
.wpt-btns { display: flex; margin-left: auto; }

/* ===== progress report of an order (printed document) ===== */
.doc-wp-sum { display: flex; align-items: center; gap: 18px; padding: 0 14px 6px; }
.doc-wp-pct { display: flex; flex-direction: column; gap: 4px; min-width: 140px; } .doc-wp-pct b { font-size: 22pt; line-height: 1; color: var(--dc); }
.doc-wp-meter { display: block; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--dc) 15%, white); overflow: hidden; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .doc-wp-meter i { display: block; height: 100%; background: var(--dc); }
.doc-wp td:first-child { width: 18px; text-align: center; }
.doc-wp-item { padding: 4px 14px 8px; break-inside: avoid; } .doc-wp-line { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; } .doc-wp-line small { margin-left: auto; }
.doc-wp-item .doc-phs { padding: 6px 0 0; }
.doc-wp-plan { display: block; width: 100%; aspect-ratio: 1; }
