/* ==========================================================================
   KOLORDACH CRM — system wizualny
   Typografia: Plus Jakarta Sans (nagłówki, nazwy, kwoty, statystyki) + Inter (interfejs).
   Grubości: 400 / 500 / 600. Cyfry tabelaryczne w kwotach i liczbach.
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("/fonts/inter-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-semibold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/plus-jakarta-sans-var.woff") format("woff"); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  /* marka */
  --red: #d93425; --red-600: #bf2c1f; --red-50: #fdf2f1; --red-100: #fbe1de;
  /* menu */
  --nav: #192633; --nav-2: #213140; --nav-ink: #c9d3dd; --nav-ink-strong: #ffffff; --nav-muted: #7f8fa0;
  /* powierzchnie */
  --bg: #f5f6f8; --surface: #ffffff; --line: #e6e9ee; --line-soft: #eef1f4;
  --ink: #111827; --ink-2: #374151; --muted: #6b7280; --faint: #9ca3af;
  --ok: #16a34a; --warn: #b45309; --danger: #c2410c;
  /* typografia */
  --f-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  /* skala */
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;
  /* układ */
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --sb: 268px; --sb-c: 68px; --top: 60px;
  --shadow-1: 0 1px 2px rgb(16 24 40 / 4%);
  --shadow-pop: 0 12px 32px rgb(16 24 40 / 14%), 0 2px 6px rgb(16 24 40 / 6%);
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* iPhone: obszar z godziną / Dynamic Island (w Safari = 0, w aplikacji z ekranu początkowego = wysokość paska systemowego) */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --top-h: calc(var(--top) + var(--safe-t)); /* faktyczna wysokość górnego paska CRM */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-base)/1.5 var(--f-ui);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; }

/* ── Typografia: wspólne style ── */
.t-display { font: 600 var(--fs-2xl)/1.2 var(--f-display); letter-spacing: -0.02em; margin: 0; }
.t-h1 { font: 600 var(--fs-xl)/1.25 var(--f-display); letter-spacing: -0.015em; margin: 0; display: flex; align-items: center; gap: 10px; }
.t-h2 { font: 600 var(--fs-lg)/1.3 var(--f-display); letter-spacing: -0.01em; margin: 0 0 6px; }
.t-h3 { font: 600 var(--fs-md)/1.35 var(--f-display); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.t-label { font: 500 var(--fs-xs)/1.3 var(--f-ui); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
.t-sub { color: var(--muted); margin: 4px 0 0; font-size: var(--fs-base); }
.t-strong { font-weight: 500; color: var(--ink); }
.t-small { font-size: var(--fs-sm); }
.t-muted { color: var(--muted); }
.t-danger { color: var(--danger); }
.t-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.t-note { color: var(--muted); font-size: var(--fs-sm); margin: 12px 2px 0; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.grow { flex: 1; min-width: 0; }
.clip { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stale { color: var(--warn); font-weight: 500; }
.count { font: 500 var(--fs-sm)/1 var(--f-ui); color: var(--muted); background: var(--line-soft); padding: 4px 8px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.i { width: 18px; height: 18px; flex: none; }
.i-sm { width: 15px; height: 15px; }
.i-xs { width: 13px; height: 13px; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--red); font-weight: 500; font-size: var(--fs-sm); }
.link:hover { color: var(--red-600); }

/* ── Menu boczne ── */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sb); z-index: 60;
  background: var(--nav); color: var(--nav-ink); display: flex; flex-direction: column;
  transition: width .18s ease, transform .22s ease;
}
.sb-head { display: flex; align-items: center; height: var(--top-h); padding: var(--safe-t) 16px 0; flex: none; }
.sb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-brand img { border-radius: 8px; flex: none; }
.sb-word { font: 600 16px/1 var(--f-display); letter-spacing: .04em; color: #fff; white-space: nowrap; }
.sb-word b { font-weight: 600; color: #ff6a5b; }
.sb-close { display: none; margin-left: auto; background: none; border: 0; color: var(--nav-ink); padding: 6px; cursor: pointer; }
.sb-nav { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: thin; scrollbar-color: #33475a transparent; }
.sb-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; border-radius: 8px; border: 0; background: none; cursor: pointer;
  color: var(--nav-ink); font: 500 13.5px/1.25 var(--f-ui); text-align: left; white-space: nowrap;
  transition: background .12s, color .12s;
}
.sb-item .i { width: 19px; height: 19px; color: var(--nav-muted); transition: color .12s; }
.sb-item:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.sb-item:hover .i { color: #fff; }
.sb-item.active { background: rgb(255 255 255 / 9%); color: #fff; }
.sb-item.active .i { color: #ff6a5b; }
.sb-item.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.sb-label { overflow: hidden; text-overflow: ellipsis; }
.sb-count { margin-left: auto; font: 500 11.5px/1 var(--f-ui); color: var(--nav-ink); background: rgb(255 255 255 / 10%); padding: 3px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.sb-item.active .sb-count { background: var(--red); color: #fff; }
.sb-foot { padding: 10px; border-top: 1px solid rgb(255 255 255 / 7%); }
.sb-collapse .i { transition: transform .18s; }
.sb-overlay { display: none; }

/* zwinięte menu: same ikony + podpowiedzi */
.nav-collapsed .sidebar { width: var(--sb-c); }
.nav-collapsed .sb-word, .nav-collapsed .sb-label, .nav-collapsed .sb-count { display: none; }
.nav-collapsed .sb-head { padding: 0; justify-content: center; }
.nav-collapsed .sb-item { justify-content: center; padding: 10px 0; }
.nav-collapsed .sb-collapse .i { transform: rotate(180deg); }
.nav-collapsed .sb-item[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  background: #0f1923; color: #fff; font: 500 12.5px/1 var(--f-ui); padding: 8px 10px; border-radius: 6px; white-space: nowrap;
  box-shadow: var(--shadow-pop); pointer-events: none; z-index: 80;
}
.nav-collapsed .sb-item.active .sb-count { display: none; }

/* ── Górny pasek ── */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top-h); padding-top: var(--safe-t) !important; margin-left: var(--sb);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: rgb(245 246 248 / 86%); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
  transition: margin-left .18s ease;
}
.nav-collapsed .topbar, .nav-collapsed .main { margin-left: var(--sb-c); }
.tb-menu { display: none; background: none; border: 0; padding: 6px; margin-left: -6px; cursor: pointer; color: var(--ink); }
.search {
  flex: 1; max-width: 520px; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; color: var(--faint);
}
.search:focus-within { border-color: #c9ced6; box-shadow: 0 0 0 3px rgb(17 24 39 / 5%); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 400 var(--fs-base) var(--f-ui); color: var(--ink); }
.env-pill { font: 500 var(--fs-xs)/1 var(--f-ui); color: #92400e; background: #fef3c7; border: 1px solid #fde68a; padding: 6px 10px; border-radius: 99px; white-space: nowrap; }
.tb-new { margin-left: auto; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--nav); color: #fff; font: 600 13px/1 var(--f-display); }
.env-strip { text-align: center; font: 500 var(--fs-xs)/1 var(--f-ui); color: #92400e; background: #fef3c7; padding: 7px; position: fixed; top: 0; left: 0; right: 0; z-index: 5; }

/* ── Menu rozwijane ── */
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; z-index: 70;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px;
}
.menu-right { left: auto; right: 0; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 7px;
  font: 400 var(--fs-base)/1.2 var(--f-ui); color: var(--ink-2); cursor: pointer; text-align: left; white-space: nowrap;
}
.menu a:hover, .menu button:hover { background: var(--bg); color: var(--ink); }
.menu .i { width: 16px; height: 16px; color: var(--muted); }
.menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; font-size: var(--fs-sm); }
.dd { position: relative; }
.dd summary { list-style: none; }
.dd summary::-webkit-details-marker { display: none; }

/* ── Główna część ── */
.main { margin-left: var(--sb); padding: 28px 32px 56px; max-width: 1680px; transition: margin-left .18s ease; }
.main-bare { padding: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ph-text { flex: 1; min-width: 240px; }
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); }
.panel + .panel { margin-top: 16px; }
.panel.narrow { max-width: 560px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.split > .panel + .panel { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head .t-h3 { margin: 0; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bar .seg-tabs { margin: 0; }
.bar .filters { margin: 0 0 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; margin-bottom: 14px; }
.back-link:hover { color: var(--ink); }
.flash { padding: 11px 14px; border-radius: var(--r); margin-bottom: 16px; font-weight: 500; font-size: var(--fs-sm); }
.flash-ok { background: #ecfdf3; color: #166534; border: 1px solid #c6f0d5; }
.flash-error { background: #fef3f2; color: #a8261b; border: 1px solid #fcd2cd; }
.notice { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--r); padding: 14px 16px; margin-bottom: 18px; }
.notice p { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: #92400e; }
.notice ul { margin: 0 0 10px; padding-left: 18px; }
.notice li { margin-bottom: 6px; }

/* ── Przyciski ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 500 var(--fs-base)/1 var(--f-ui); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: #cfd4db; background: #fafbfc; }
.btn .i { width: 17px; height: 17px; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-600); border-color: var(--red-600); }
.btn-ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgb(17 24 39 / 5%); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 11px; font-size: var(--fs-sm); border-radius: 8px; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon .dd-label { display: none; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.pill { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font: 600 10.5px/1 var(--f-ui); margin-left: 6px; font-variant-numeric: tabular-nums; }

/* przełączniki widoku */
.seg { display: inline-flex; background: #eceef2; border-radius: 9px; padding: 3px; }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; font: 500 var(--fs-sm)/1 var(--f-ui); color: var(--muted); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(16 24 40 / 10%); }
.seg .i { width: 15px; height: 15px; }
.seg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.seg-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 4px; margin-right: 18px; font: 500 var(--fs-base)/1 var(--f-ui); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.seg-tabs a:hover { color: var(--ink); }
.seg-tabs a.on { color: var(--ink); border-bottom-color: var(--red); }
.seg-tabs a span { font: 500 var(--fs-xs)/1 var(--f-ui); color: var(--muted); background: var(--line-soft); padding: 3px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.seg-tabs a.on span { background: var(--red-50); color: var(--red); }

/* status i znaczniki */
.status { display: inline-flex; align-items: center; gap: 6px; font: 500 var(--fs-sm)/1.2 var(--f-ui); color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.team { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); white-space: nowrap; }
.team i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.ral { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ral i { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%); display: inline-block; flex: none; }
.warn-dot { color: var(--warn); margin-left: 6px; display: inline-flex; vertical-align: -2px; }
.warn-dot .i { width: 14px; height: 14px; }
.type-tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--muted); }
.prep { font-size: var(--fs-sm); color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.prep.ok { color: var(--ok); }
.prep .i { width: 14px; height: 14px; }

/* ── Formularze ── */
input, select, textarea {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid #d9dde3; border-radius: 8px; background: var(--surface);
  font: 400 var(--fs-base)/1.4 var(--f-ui); color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-100); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 6px; font: 500 var(--fs-sm)/1.3 var(--f-ui); color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: 9px; font-weight: 400; font-size: var(--fs-base); color: var(--ink); }
label.check input { width: 17px; height: 17px; min-height: 0; accent-color: var(--red); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-sec + .form-sec { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.grid-form.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-form.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.checks { display: flex; flex-wrap: wrap; gap: 12px 26px; }
.mt { margin-top: 16px; }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.form-foot > span:first-child { margin-right: auto; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.radio-seg { display: inline-flex; gap: 6px; margin-bottom: 16px; }
.radio-seg label { flex-direction: row; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.radio-seg input { position: absolute; opacity: 0; width: 0; height: 0; min-height: 0; }
.radio-seg label:has(input:checked) { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.radio-seg .i { width: 16px; height: 16px; }

/* filtry list */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.f-search { flex-direction: row; align-items: center; gap: 8px; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--faint); min-width: 300px; }
.f-search input { border: 0; min-height: 0; padding: 0; box-shadow: none !important; font-weight: 400; }
.f-more { display: contents; }
.filters > select { width: auto; min-height: 36px; padding: 6px 30px 6px 10px; font-size: var(--fs-sm); }
.f-more select { width: auto; min-height: 36px; padding: 6px 30px 6px 10px; font-size: var(--fs-sm); }
.f-toggle { display: none; }

/* ── Tabele ── */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--shadow-1); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 16px; font: 500 var(--fs-xs)/1.2 var(--f-ui); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfbfc; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: var(--fs-base); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fafbfc; }
.table tr[data-href] { cursor: pointer; }
.table .num { text-align: right; }
.table .c-client { min-width: 220px; }
.table .c-note { max-width: 300px; }
.cards { display: none; }

/* ── Pulpit ── */
.kpis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-1); transition: border-color .12s; }
.kpi:hover { border-color: #cfd4db; }
.kpi-value { font: 600 26px/1.1 var(--f-display); letter-spacing: -0.02em; }
.kpi-label { font-size: var(--fs-sm); color: var(--muted); line-height: 1.3; }
.kpi-accent .kpi-value { color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .t-label { margin: 0; }
.stat-value { font: 600 22px/1.2 var(--f-display); letter-spacing: -0.015em; }
.stat-value small, .sm-value small { font: 500 var(--fs-sm) var(--f-ui); color: var(--muted); }
.goal-title { margin-top: 26px; }
.goal + .goal { margin-top: 12px; }
.goal-head { display: flex; gap: 10px; font-size: var(--fs-sm); margin-bottom: 6px; }
.goal-head span:first-child { width: 96px; color: var(--muted); }
.goal-head span:nth-child(2) { margin-right: auto; }
.goal-head b { font-weight: 600; }
.goal-bar { height: 6px; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.goal-bar span { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li + li { border-top: 1px solid var(--line-soft); }
.rows a, .rows .row-static { display: flex; align-items: center; gap: 12px; padding: 11px 2px; }
.rows a:hover .t-strong { color: var(--red); }
.rows .nr { width: 64px; flex: none; }

/* ── Karta klienta ── */
.deal { max-width: 1240px; }
.dh { display: flex; align-items: flex-start; gap: 24px; margin-bottom: 22px; }
.dh-main { flex: 1; min-width: 0; }
.dh-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 8px; color: var(--muted); font-size: var(--fs-base); }
.dh-meta > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.dh-actions { display: flex; gap: 8px; flex: none; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin-bottom: 12px; }
.summary > div { padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.summary > div + div { border-left: 1px solid var(--line-soft); }
.sm-label { font: 500 var(--fs-xs)/1.2 var(--f-ui); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sm-value { font: 600 19px/1.3 var(--f-display); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-value .ral { font: inherit; }
.strip { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; padding: 10px 4px; margin-bottom: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.strip > span { display: inline-flex; align-items: center; gap: 7px; }
.strip b { font-weight: 600; }
.strip .i { color: var(--muted); }
.strip-warn, .strip-warn .i { color: var(--warn) !important; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; padding: 12px 14px; font: 500 var(--fs-base)/1 var(--f-ui); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--red); }
.ov { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ov .panel + .panel { margin-top: 0; }
.ov-big { display: flex; align-items: center; gap: 10px; font: 600 var(--fs-lg)/1.3 var(--f-display); margin: 0 0 12px; }
.ov-big i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.ov-text { margin: 0 0 4px; font-size: var(--fs-md); color: var(--ink); }
.ov .link { margin-top: 12px; }
.progress { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0 0 10px; }
.progress li { flex: 1; height: 5px; border-radius: 99px; background: var(--line-soft); }
.progress li.done { background: #f2a49b; }
.progress li.now { background: var(--red); }
.stage-form { display: flex; gap: 8px; margin-top: 16px; }
.stage-form select { flex: 1; }
.note-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 14px; }
.note-form textarea { min-height: 40px; }
.mini-tl { list-style: none; margin: 0; padding: 0; }
.mini-tl li { display: flex; flex-direction: column; gap: 1px; padding: 7px 0; }
.mini-tl li + li { border-top: 1px solid var(--line-soft); }
.others { margin-top: 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: var(--fs-sm); padding-top: 1px; }
.kv dd { margin: 0; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; }
.totals .t-strong { font: 600 var(--fs-lg) var(--f-display); color: var(--ink); }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 30px 16px; color: var(--muted); }
.empty-state p { margin: 0; max-width: 460px; font-size: var(--fs-sm); }
.empty-ico { width: 22px; height: 22px; color: #c7ccd4; }

/* zadania */
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.tasks li:first-child { border-top: 0; }
.tasks li.done .grow > span:first-child { color: var(--muted); text-decoration: line-through; }
.tasks .prio::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); margin-right: 8px; vertical-align: 2px; }
.tick { width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid #c7ccd4; border-radius: 6px; background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--ok); }
.tick .i { width: 14px; height: 14px; }
.tick:hover { border-color: var(--ok); }
.task-form { display: grid; grid-template-columns: 1fr 150px 120px 170px auto; gap: 8px; margin-bottom: 14px; }

/* historia */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 29px; height: 29px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--muted); flex: none; }
.tl-body { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; min-width: 0; }
.tl-title { font-weight: 500; }
.tl-body p { margin: 4px 0; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 9px 12px; }

/* planowanie */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.month header { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 18px 6px; }
.month header .t-h3 { margin: 0; }
.month-muted header .t-h3 { color: var(--muted); }
.plan-list { list-style: none; margin: 0; padding: 4px 8px 8px; }
.plan-list a { display: grid; grid-template-columns: 56px 1fr auto; grid-template-areas: "date main team" "date meta team"; gap: 0 12px; align-items: center; padding: 10px; border-radius: 9px; }
.plan-list a:hover { background: var(--bg); }
.pl-date { grid-area: date; font: 600 var(--fs-base) var(--f-display); }
.pl-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.pl-meta { grid-area: meta; color: var(--muted); }
.plan-list .team, .plan-list a > .t-small:last-child { grid-area: team; }

/* kontakty */
.profile { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.pf-avatar { width: 52px; height: 52px; border-radius: 14px; background: var(--nav); color: #fff; display: grid; place-items: center; }
.pf-avatar .i { width: 24px; height: 24px; }
.pf-main { flex: 1; min-width: 220px; }
.pf-actions { display: flex; gap: 8px; }

/* moduły w przygotowaniu */
.module { text-align: center; padding: 40px 24px; }
.module-ico { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: var(--red-50); color: var(--red); display: grid; place-items: center; }
.module-ico .i { width: 24px; height: 24px; }
.module > .t-muted { max-width: 520px; margin: 0 auto; }
.module-parts { list-style: none; padding: 0; margin: 26px auto 0; max-width: 780px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: left; }
.module-parts li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r); background: #fcfcfd; }

/* kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: 60vh; }
.kcol { flex: 0 0 260px; background: #eef0f3; border-radius: var(--r-lg); padding: 10px; }
.kcol-side { flex-basis: 220px; background: #f1f2f4; }
.kcol header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font: 600 var(--fs-sm)/1.2 var(--f-display); }
.kcol header i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kcol header b { margin-left: auto; font: 500 var(--fs-xs) var(--f-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.ksum { font-size: var(--fs-xs); color: var(--muted); padding: 0 6px 8px; }
.kitems { display: flex; flex-direction: column; gap: 8px; min-height: 48px; border-radius: 10px; }
.kitems.over { outline: 2px dashed var(--red); outline-offset: 3px; background: #fff6f5; }
.kcard { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow-1); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.kcard:hover { border-color: #cfd4db; }
.kcard.dragging { opacity: .35; }
.kcard.ghost { position: fixed; z-index: 100; width: 240px; pointer-events: none; box-shadow: var(--shadow-pop); transform: rotate(1.5deg); }
.kmeta { display: flex; gap: 10px; font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }

/* okno dialogowe */
.dialog { border: 0; border-radius: var(--r-lg); padding: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
.dialog::backdrop { background: rgb(15 23 42 / 35%); }
.dialog .t-h3 { margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* logowanie */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.auth-card { width: min(400px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: 0 24px 48px rgb(16 24 40 / 8%); margin: 48px auto; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--red); color: #fff; font: 700 16px var(--f-display); }
.auth-brand .brand-name { font: 600 17px/1 var(--f-display); letter-spacing: .04em; }
.auth-brand .brand-name b { font-weight: 600; color: var(--red); }
.auth-brand small { margin-left: auto; font: 500 var(--fs-xs) var(--f-ui); letter-spacing: .1em; color: var(--muted); }
.auth-card h1 { font: 600 var(--fs-xl)/1.3 var(--f-display); margin: 22px 0 16px; }
.btn-block { width: 100%; height: 42px; }
.btn-link { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 10px 0; text-decoration: underline; }
.code-input { font: 600 22px var(--f-display); letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.secret { font: 600 16px var(--f-display); letter-spacing: .08em; background: var(--bg); border: 1px dashed #c7ccd4; border-radius: 8px; padding: 10px 12px; margin: 8px 0; word-break: break-all; user-select: all; font-variant-numeric: tabular-nums; }
.form-inline { display: flex; gap: 8px; }
.form-inline input { max-width: 180px; }
.error-card { margin: 48px auto; text-align: center; }
.error-card .t-h1 { justify-content: center; margin-bottom: 8px; }

/* ── Szerokie ekrany / tablet ── */
@media (max-width: 1360px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .split, .ov { grid-template-columns: 1fr; }
  .dh { flex-direction: column; gap: 16px; }
  .module-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-form { grid-template-columns: 1fr 1fr; }
  .task-form input[name=title] { grid-column: 1 / -1; }
  .table .c-note, .table .c-source, .table .c-owner { display: none; }
}

/* ── Telefon / mały tablet: menu wysuwane ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: min(300px, 86vw) !important; box-shadow: var(--shadow-pop); }
  .nav-open .sidebar { transform: none; }
  .nav-open .sb-overlay { display: block; position: fixed; inset: 0; background: rgb(15 23 42 / 40%); z-index: 55; }
  .sb-close { display: block; }
  .nav-collapsed .sb-word, .nav-collapsed .sb-label, .nav-collapsed .sb-count { display: initial; }
  .nav-collapsed .sb-item { justify-content: flex-start; padding: 9px 12px; }
  .nav-collapsed .sb-head { padding: 0 16px; justify-content: flex-start; }
  .sb-foot { display: none; }
  .topbar, .main, .nav-collapsed .topbar, .nav-collapsed .main { margin-left: 0; }
  .topbar { padding: 0 max(14px, var(--safe-r)) 0 max(14px, var(--safe-l)); gap: 8px; }
  .tb-menu { display: inline-flex; }
  .env-pill { display: none; }
  .main { padding: 20px 16px calc(40px + var(--safe-b)); }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .tb-new span { display: none; }
  .tb-new { width: 38px; padding: 0; }
  .search { height: 38px; }
  .t-display { font-size: 23px; }
  .t-h1 { font-size: 20px; }
  .page-head { margin-bottom: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 22px; }
  .panel { padding: 16px; border-radius: 12px; }
  .grid-form, .grid-form.grid-2, .grid-form.grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .table-card { display: none; }
  .cards { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
  .cards li { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-1); }
  .card-link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; }
  .cl-top { display: flex; align-items: center; gap: 4px; }
  .cl-nr { margin-left: auto; font-size: var(--fs-xs); }
  .cl-mid { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 2px; }
  .cl-call { display: grid; place-items: center; width: 54px; border-left: 1px solid var(--line-soft); color: var(--red); flex: none; }
  .cl-call .i { width: 21px; height: 21px; }
  .f-search { flex: 1; min-width: 0; }
  .f-toggle { display: inline-flex; height: 36px; }
  .f-more { display: none; width: 100%; gap: 8px; flex-wrap: wrap; }
  .f-more.open { display: flex; }
  .f-more select { flex: 1 1 45%; }
  .bar .filters { margin: 0; width: 100%; }
  /* karta klienta na telefonie */
  .dh-actions { width: 100%; display: grid; grid-template-columns: 1.25fr 1fr 1fr 44px; gap: 6px; }
  .dh-actions .btn { width: 100%; padding: 0 8px; }
  .dh-actions .dd { min-width: 0; }
  .dh-actions .dd > summary { width: 100%; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary > div { padding: 12px 14px; }
  .summary > div:nth-child(3) { border-left: 0; }
  .summary > div:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .sm-value { font-size: 16.5px; }
  .tabs a { padding: 12px 11px; }
  .kv { grid-template-columns: 110px 1fr; }
  .months { grid-template-columns: 1fr; }
  .module-parts { grid-template-columns: 1fr; }
  .kcol { flex-basis: 80vw; }
  .note-form { flex-direction: column; align-items: stretch; }
  .hide-sm { display: none; }
  input, select, textarea { font-size: 16px; } /* iOS bez powiększania */
  .f-more select, .f-search input { font-size: 15px; }
}

/* ── Kontakty ── */
.counters { display: grid; grid-template-columns: repeat(3, minmax(0, 180px)); gap: 12px; margin-bottom: 18px; }
.counters-4 { grid-template-columns: repeat(4, minmax(0, 180px)); }
.counter { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.counter .t-label { margin: 0; }
a.counter:hover { border-color: #cfd4db; }
.counter.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.counter-v { font: 600 22px/1.15 var(--f-display); letter-spacing: -0.015em; }
.na { font-size: var(--fs-xs); color: var(--faint); }
.table-compact td { padding: 9px 14px; }
.table-compact th { padding: 10px 14px; }
.table-card.flat { box-shadow: none; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager-links { display: flex; align-items: center; gap: 10px; }
.menu-note { display: block; padding: 9px 10px; font-size: var(--fs-sm); color: var(--muted); white-space: normal; }
.pill-muted { background: var(--line-soft); color: var(--muted); }
.cand-list { list-style: none; padding: 0; margin: 4px 0 12px; }
.cand-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #fcefc7; }
.cand-why { color: #92400e; }
.danger-zone { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.rules { margin: 0; padding-left: 18px; color: var(--ink-2); }
.rules li + li { margin-top: 8px; }
.mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.map-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; }
.map-item.missing { background: var(--bg); }
.map-item.missing .t-small:last-child { color: var(--faint); }
.import-actions { display: flex; gap: 8px; margin: 16px 0; }
.contact-pill { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.prop-choice { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.contact-addr { display: none; }
.contact-addr.open { display: grid; }
form[data-contact-form]:has(input[name=contact_type][value=private]:checked) .only-company,
form[data-contact-form]:has(input[name=contact_type][value=company]:checked) .only-private { display: none; }
.dh .pf-avatar { flex: none; }
@media (max-width: 720px) {
  .counters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .counters-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counter { padding: 10px 12px; }
  .counter .t-label { font-size: 10.5px; letter-spacing: .03em; }
  .counter-v { font-size: 19px; }
  .filters > select { width: 100%; font-size: 15px; }
  .cand-list li { flex-direction: column; align-items: flex-start; }
  .dh .pf-avatar { display: none; }
}

/* ── Notatki głosowe ── */
.voice { margin: 2px 0 4px; }
.voice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--line-soft); font-size: var(--fs-sm); font-weight: 500; }
.voice-rec { background: var(--red-50); border: 1px solid var(--red-100); }
.voice-rec [data-v-time] { font: 600 var(--fs-md)/1 var(--f-display); }
.voice-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: kd-pulse 1s ease-in-out infinite; }
@keyframes kd-pulse { 50% { opacity: .3; } }
.voice-spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: kd-spin .8s linear infinite; }
.voice-err { background: #fef3f2; border: 1px solid #fcd2cd; color: #a8261b; }
.voice-ok { background: #ecfdf3; border: 1px solid #c6f0d5; color: #166534; }
.voice-row .btn { margin-left: 0; }
.voice-rec .btn-primary { margin-left: auto; }
.voice-info { margin: 6px 2px 0; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.note-form:has(.note-input) { flex-direction: column; align-items: stretch; }
.note-form:has(.note-input) > .btn { align-self: flex-end; }
.note-input { position: relative; }
.note-input textarea { width: 100%; min-height: 64px; padding-right: 52px; resize: vertical; }
.note-input .nk-mic { position: absolute; right: 6px; bottom: 8px; }
.tag-voice { display: inline-flex; align-items: center; gap: 3px; color: var(--red-600); }
.note-revs, .note-edit { margin-top: 6px; }
.note-revs summary, .note-edit summary { cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.note-revs ol { margin: 6px 0 0; padding-left: 18px; }
.note-revs li { margin-bottom: 6px; }
.note-edit form { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; align-items: flex-start; }
.note-edit textarea { width: 100%; }

/* ── Pomiar: stan rekordu ── */
.m-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.m-banner-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.m-badge { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--fs-base)/1 var(--f-display); padding: 7px 11px; border-radius: 999px; background: var(--line-soft); }
.m-badge .i { width: 16px; height: 16px; }
.m-w_toku .m-badge { background: #fff7ed; color: #c2410c; }
.m-do_umowienia .m-badge { background: #f3f0ff; color: #6d28d9; }
.m-zaplanowany .m-badge { background: #ecfeff; color: #0e7490; }
.m-wykonany .m-badge { background: #ecfdf3; color: #15803d; }

/* Adnotacja autora notatki: „Notatkę dodał Piotr” */
.note-by { display: inline-block; margin-top: 4px; font: 400 var(--fs-xs)/1.35 var(--f-ui); color: var(--muted); }
.note-by.block { display: block; margin-top: 2px; }
p.note-by { display: block; margin: 4px 0 0; }

.voice-choice { flex-direction: column; align-items: stretch; background: #fff; border: 1px solid var(--line); }
.voice-preview { margin: 0; font-weight: 400; color: var(--ink); white-space: pre-wrap; }
.voice-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 380px) { .nk-choice { font-size: var(--fs-xs); padding: 8px; gap: 6px; } }

/* ==========================================================================
   Formularz „Nowe zapytanie” — wg zaakceptowanej wizualizacji (31.10.2026)
   jasne tło, granat, pastelowe akcenty, pola-pastylki z okrągłą ikoną, czerwony zapis
   ========================================================================== */
.nk-card {
  --nk-ink: #172036; --nk-ink-2: #3d4a63; --nk-muted: #7a869c; --nk-line: #e9edf3; --nk-soft: #f6f8fb;
  --nk-red: #e5393b; --nk-red-600: #cf2f31; --nk-red-50: #fdeeee; --nk-red-100: #fbdcdc;
  --nk-green: #1f9d5c; --nk-green-50: #eaf7f0; --nk-green-100: #cdebdb;
  --nk-blue: #2f6bd8; --nk-blue-50: #edf3fd; --nk-blue-100: #d6e4fa;
  --nk-pink: #d9434f; --nk-pink-50: #fdf0f1; --nk-pink-100: #f8d9dc;
  --nk-slate: #5e6b82; --nk-slate-50: #f1f4f8; --nk-slate-100: #e2e7ef;
  --nk-violet: #6d4ce0; --nk-violet-50: #f4f1fe;
  --nk-shadow: 0 1px 2px rgb(23 32 54 / 4%), 0 4px 14px rgb(23 32 54 / 4%);
  width: 100%; max-width: 560px; min-width: 0; margin: 0 auto; background: #fff; color: var(--nk-ink);
  border-radius: 28px; box-shadow: 0 24px 60px rgb(23 32 54 / 16%), 0 2px 8px rgb(23 32 54 / 6%);
  display: flex; flex-direction: column; overflow: clip; position: relative;
}
.nk-card * { min-width: 0; }
.nk-card [hidden] { display: none !important; }
.nk-page { display: flex; justify-content: center; padding: 4px 0 32px; }
.nk-grab { display: none; width: 44px; height: 5px; border-radius: 99px; background: #d8dde6; margin: 10px auto 0; }

.nk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 6px; }
.nk-title { margin: 0; font: 700 24px/1.15 var(--f-display); letter-spacing: -0.02em; color: var(--nk-ink); }
.nk-subtitle { margin: 4px 0 0; font: 400 15px/1.35 var(--f-ui); color: var(--nk-muted); }
.nk-close { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--nk-line);
  background: #fff; color: var(--nk-ink); cursor: pointer; box-shadow: var(--nk-shadow); }
.nk-close:hover { background: var(--nk-soft); }
.nk-close .i { width: 20px; height: 20px; stroke-width: 2; }

.nk-body { padding: 12px 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.nk-error { margin: 0; border-radius: 14px; }
.nk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nk-grid > .span-2 { grid-column: 1 / -1; }
.nk-hr { border: 0; border-top: 1px solid var(--nk-line); margin: 6px 0 2px; width: 100%; }

/* typ klienta: dwie duże pastylki */
.nk-type { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nk-type label { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 9px; height: 52px;
  border-radius: 999px; background: var(--nk-slate-50); color: var(--nk-slate); font: 500 15px/1 var(--f-ui); cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s, box-shadow .15s; }
.nk-type label .i { width: 19px; height: 19px; }
.nk-type input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nk-type label:has(input:checked) { background: var(--nk-red); color: #fff; box-shadow: 0 6px 16px rgb(229 57 59 / 26%); }
.nk-type label:has(input:focus-visible) { outline: 2px solid var(--nk-red); outline-offset: 2px; }

/* nagłówki sekcji */
.nk-sec { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; padding: 0; font: 600 18px/1.25 var(--f-display); color: var(--nk-ink); letter-spacing: -0.01em; }
.nk-sec .i { width: 22px; height: 22px; stroke-width: 1.9; }
.nk-sec label { font: inherit; color: inherit; display: inline; }
.nk-sec-red { color: var(--nk-red); display: inline-flex; }

/* pole-pastylka */
.pf { position: relative; display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 64px; padding: 8px 14px 8px 10px;
  background: #fff; border: 1px solid var(--nk-line); border-radius: 22px; box-shadow: var(--nk-shadow); cursor: text;
  transition: border-color .15s, box-shadow .15s; font: inherit; color: inherit; }
.pf:focus-within { border-color: #f1b2b3; box-shadow: 0 0 0 4px var(--nk-red-50), var(--nk-shadow); }
.pf-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.pf-ic .i { width: 21px; height: 21px; stroke-width: 1.8; }
.tone-pink .pf-ic, .pf-ic.tone-pink { background: var(--nk-pink-50); color: var(--nk-pink); }
.pf-ic.tone-blue { background: var(--nk-blue-50); color: var(--nk-blue); }
.pf-ic.tone-green { background: var(--nk-green-50); color: var(--nk-green); }
.pf-ic.tone-slate { background: var(--nk-slate-50); color: var(--nk-slate); }
.pf-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-label { font: 400 13px/1.2 var(--f-ui); color: var(--nk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf input, .pf select { display: block; width: 100%; min-width: 0; height: 26px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; outline: none; font: 400 16px/1.3 var(--f-ui); color: var(--nk-ink); }
.pf input:focus, .pf select:focus { box-shadow: none; border: 0; }
.pf input::placeholder { color: #a3adbd; }
.pf select { -webkit-appearance: none; appearance: none; padding-right: 22px; cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233d4a63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0 center; }
.pf input[type=date] { -webkit-appearance: none; appearance: none; text-align: left; }
.pf input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.pf-after { flex: none; display: grid; place-items: center; color: var(--nk-ink-2); }
.pf-after .i { width: 21px; height: 21px; }
.pf-after-soft { width: 38px; height: 38px; border-radius: 50%; background: var(--nk-soft); color: var(--nk-slate); }
.pf-after-soft .i { width: 18px; height: 18px; }
.pf-suffix { display: flex; align-items: center; gap: 6px; }
.pf-suffix span { color: var(--nk-ink-2); font-size: 15px; }
.ral-swatch { flex: none; width: 40px; height: 40px; border-radius: 50%; background: repeating-linear-gradient(45deg, #eef1f5 0 6px, #e3e7ee 6px 12px); border: 1px solid var(--nk-line); }
.ral-swatch.on { background: var(--sw); border-color: rgb(0 0 0 / 8%); }
.pf-ral { flex-direction: row; }
.nk-hint { font: 400 12px/1.3 var(--f-ui); color: var(--nk-muted); padding: 4px 0 0 18px; display: block; }
.nk-hint:empty { display: none; }

/* pastylki wyboru w polu (Tak / Nie / Nie wiem, rodzaj pokrycia) */
.pf-choice { cursor: default; align-items: center; }
.pf-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pill { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 72px; height: 38px; padding: 0 12px;
  border-radius: 999px; background: var(--nk-soft); color: var(--nk-ink-2); font: 500 14px/1 var(--f-ui); cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; transition: background .15s, color .15s; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pill:has(input:checked) { background: var(--nk-red-50); color: var(--nk-red-600); box-shadow: inset 0 0 0 1px var(--nk-red-100); }
.pill:has(input:focus-visible) { outline: 2px solid var(--nk-red); outline-offset: 1px; }
.pf-wrap .pill { flex: 1 1 auto; }

/* karta „Znaleziono kontakt” */
.nk-match { display: flex; flex-direction: column; gap: 8px; }
.nk-found { background: var(--nk-green-50); border: 1px solid var(--nk-green-100); border-radius: 22px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.nk-found-warn { background: #fff8eb; border-color: #f6e1b5; }
.nk-found-top { display: flex; align-items: center; gap: 12px; }
.nk-found-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--nk-green); }
.nk-found-warn .nk-found-ic { color: #b7791f; }
.nk-found-ic .i { width: 21px; height: 21px; }
.nk-found-main { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.nk-found-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font: 600 15px/1.2 var(--f-ui); }
.nk-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; background: #d5f0e1; color: #177a47; font: 500 12.5px/1 var(--f-ui); }
.nk-found-warn .nk-badge { background: #fbe8c3; color: #8a5a10; }
.nk-found-meta { font: 400 13.5px/1.3 var(--f-ui); color: var(--nk-ink-2); }
.nk-found-why { font: 400 12.5px/1.3 var(--f-ui); color: #8a5a10; }
.nk-found-go { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--nk-ink-2); }
.nk-found-go:hover { background: rgb(255 255 255 / 70%); }
.nk-found-act { display: flex; flex-wrap: wrap; gap: 6px; }
.nk-act { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--nk-line);
  background: #fff; color: var(--nk-ink); font: 500 13.5px/1 var(--f-ui); cursor: pointer; text-decoration: none; }
.nk-act .i { width: 16px; height: 16px; }
.nk-act-main { background: var(--nk-green); border-color: var(--nk-green); color: #fff; }
.nk-act-ghost { background: transparent; border-color: transparent; color: var(--nk-ink-2); }
.nk-other { font: 400 13.5px/1.3 var(--f-ui); color: var(--nk-ink-2); padding: 2px 4px; }
.nk-ret-note { margin: 0; padding: 9px 12px; background: #fff; border-radius: 14px; border: 1px solid rgb(23 32 54 / 6%); }
.nk-ret-note p { margin: 0; font: 400 14px/1.4 var(--f-ui); color: var(--nk-ink); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nk-ret-note cite { display: block; margin-top: 4px; font: normal 400 12px/1.3 var(--f-ui); color: var(--nk-muted); }

/* wybrany kontakt (powracający klient) */
.nk-chosen { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--nk-blue-50); border: 1px solid var(--nk-blue-100); border-radius: 22px; }
.nk-ret-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nk-ret-name { display: flex; align-items: center; gap: 8px; font: 600 16px/1.2 var(--f-ui); }
.nk-ret-name .i { width: 18px; height: 18px; color: var(--nk-blue); }
.nk-ret-meta { margin: 0; font: 400 13px/1.35 var(--f-ui); color: var(--nk-ink-2); }
.nk-sub { margin: 0 0 6px; font: 500 12.5px/1.2 var(--f-ui); color: var(--nk-muted); }
.nk-open { display: flex; flex-direction: column; gap: 6px; }
.nk-open-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; background: #fff; border: 1px solid var(--nk-blue-100); border-radius: 16px; }
.nk-open-row.on { border-color: var(--nk-red); box-shadow: inset 0 0 0 1px var(--nk-red); }
.nk-open-info { min-width: 0; font: 400 14px/1.3 var(--f-ui); }
.nk-open-row .btn { border-radius: 999px; }
.nk-props { display: flex; flex-direction: column; gap: 6px; }
.nk-props:empty { display: none; }
.nk-ret-hint { margin: 0; }
.nk-link { border: 0; background: none; padding: 4px 2px; color: var(--nk-red-600); font: 500 14px/1.2 var(--f-ui); cursor: pointer; }
.nk-continue { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: 16px; background: var(--nk-red-50); border: 1px solid var(--nk-red-100); font: 400 14px/1.3 var(--f-ui); }
.nk-continue > span { display: flex; align-items: center; gap: 8px; }
.nk-continue .i { width: 17px; height: 17px; color: var(--nk-red); flex: none; }
form[data-nk-continue-on] [data-nk-new-only], form[data-nk-continue-on] [data-nk-match-slot] { display: none !important; }
form[data-nk-form][data-nk-chosen-on] [data-nk-person] { display: none !important; }
form[data-nk-form]:has(input[name=contact_type][value=private]:checked) .only-company,
form[data-nk-form]:has(input[name=contact_type][value=company]:checked) .only-private { display: none; }

/* notatka i dyktowanie */
.nk-note { display: block; width: 100%; min-height: 104px; padding: 16px 18px; border: 1px solid var(--nk-line); border-radius: 22px; background: var(--nk-soft);
  font: 400 16px/1.45 var(--f-ui); color: var(--nk-ink); resize: vertical; box-shadow: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.nk-note::placeholder { color: #8f9ab0; }
.nk-note:focus { outline: none; background: #fff; border-color: #f1b2b3; box-shadow: 0 0 0 4px var(--nk-red-50); }
.nk-voice { display: flex; align-items: center; gap: 14px; }
.nk-micbig { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--nk-red); color: #fff;
  box-shadow: 0 10px 22px rgb(229 57 59 / 32%); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .08s, background .15s; }
.nk-micbig .i { width: 26px; height: 26px; stroke-width: 2; }
.nk-micbig:active { transform: scale(.96); }
.nk-micbig:disabled { opacity: .55; cursor: default; }
.nk-micbig.rec { background: var(--nk-red-600); animation: kd-ring 1.4s ease-out infinite; }
@keyframes kd-ring { 0% { box-shadow: 0 0 0 0 rgb(229 57 59 / 40%), 0 10px 22px rgb(229 57 59 / 30%); } 100% { box-shadow: 0 0 0 16px rgb(229 57 59 / 0%), 0 10px 22px rgb(229 57 59 / 30%); } }
.nk-wave { flex: 1; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-radius: 999px; background: var(--nk-red-50); color: var(--nk-red); overflow: hidden; }
.nk-wave.busy { color: var(--nk-ink-2); font: 500 14px/1 var(--f-ui); background: var(--nk-soft); gap: 10px; }
.vw { flex: 1; display: flex; align-items: center; gap: 3px; height: 30px; overflow: hidden; }
.vw i { flex: 1 1 0; max-width: 4px; min-width: 2px; height: var(--h, 20%); border-radius: 2px; background: currentColor; opacity: .55; }
.vw i:nth-child(n+15) { opacity: .25; }
.vw-live i { opacity: .85; transition: height .07s linear; height: var(--h, 8%); }
.vw-time { flex: none; font: 500 15px/1 var(--f-ui); color: var(--nk-ink-2); }
.vw-x { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fff; color: var(--nk-ink-2); font: 400 20px/1 var(--f-ui); cursor: pointer; }
.nk-voice-cap { margin: -4px 0 0 78px; font: 400 13px/1.35 var(--f-ui); color: var(--nk-muted); }

/* decyzja o pomiarze: cztery kafelki */
.nk-decision { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.nk-decision legend { margin-bottom: 10px; }
.nk-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nk-tile { position: relative; display: flex; flex-direction: row; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px 10px 10px;
  border-radius: 22px; border: 1.5px solid transparent; cursor: pointer; font: 500 15px/1.2 var(--f-ui); -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, background .15s, box-shadow .15s; }
.nk-tile input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nk-tile-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; }
.nk-tile-ic .i { width: 21px; height: 21px; stroke-width: 1.9; }
.nk-tile.tone-green { background: #f3faf6; color: var(--nk-ink); } .nk-tile.tone-green .nk-tile-ic { color: var(--nk-green); }
.nk-tile.tone-slate { background: var(--nk-slate-50); color: var(--nk-ink); } .nk-tile.tone-slate .nk-tile-ic { color: var(--nk-slate); }
.nk-tile.tone-pink { background: var(--nk-pink-50); color: var(--nk-pink); } .nk-tile.tone-pink .nk-tile-ic { color: var(--nk-pink); }
.nk-tile.tone-blue { background: var(--nk-blue-50); color: var(--nk-blue); } .nk-tile.tone-blue .nk-tile-ic { color: var(--nk-blue); }
.nk-tile.tone-green:has(input:checked) { background: var(--nk-green-50); border-color: var(--nk-green); box-shadow: 0 4px 14px rgb(31 157 92 / 14%); }
.nk-tile.tone-green:has(input:checked) .nk-tile-ic { background: var(--nk-green); color: #fff; }
.nk-tile.tone-slate:has(input:checked) { border-color: var(--nk-slate); background: #e9eef5; }
.nk-tile.tone-slate:has(input:checked) .nk-tile-ic { background: var(--nk-slate); color: #fff; }
.nk-tile.tone-pink:has(input:checked) { border-color: var(--nk-pink); box-shadow: 0 4px 14px rgb(217 67 79 / 14%); }
.nk-tile.tone-pink:has(input:checked) .nk-tile-ic { background: var(--nk-pink); color: #fff; }
.nk-tile.tone-blue:has(input:checked) { border-color: var(--nk-blue); box-shadow: 0 4px 14px rgb(47 107 216 / 14%); }
.nk-tile.tone-blue:has(input:checked) .nk-tile-ic { background: var(--nk-blue); color: #fff; }
.nk-tile:has(input:focus-visible) { outline: 2px solid var(--nk-ink); outline-offset: 2px; }
.only-continue { display: none !important; }
form[data-nk-continue-on] .only-continue { display: flex !important; }
.nk-path-desc { margin: 0 4px; font: 400 13px/1.35 var(--f-ui); color: var(--nk-muted); min-height: 0; }
.nk-path-desc span { display: none; }
form[data-nk-form]:has(input[name=decision][value=tak]:checked) [data-decision-desc=tak],
form[data-nk-form]:has(input[name=decision][value=niezdecydowany]:checked) [data-decision-desc=niezdecydowany],
form[data-nk-form]:has(input[name=decision][value=nie]:checked) [data-decision-desc=nie],
form[data-nk-form]:has(input[name=decision][value=teraz]:checked) [data-decision-desc=teraz],
form[data-nk-form]:has(input[name=decision][value=""]:checked) [data-decision-desc=""] { display: inline; }
.nk-reminder { display: none; flex-direction: column; gap: 8px; }
form[data-nk-form]:has(input[name=decision][value=niezdecydowany]:checked) .nk-reminder,
form[data-nk-form]:has(input[name=decision][value=nie]:checked) .nk-reminder,
form[data-nk-form]:has(input[name=decision][value=""]:checked) .nk-reminder { display: flex; }
.nk-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; }
.nk-chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--nk-line); background: #fff; font: 500 13px/1 var(--f-ui); color: var(--nk-ink-2); cursor: pointer; }
.nk-chip.on { border-color: var(--nk-blue); color: var(--nk-blue); background: var(--nk-blue-50); }

/* rozwijane karty: Informacje o dachu, Więcej danych */
.nk-box { border: 1px solid var(--nk-line); border-radius: 26px; background: #fff; box-shadow: var(--nk-shadow); }
.nk-box > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 18px; cursor: pointer;
  font: 600 17px/1.2 var(--f-display); color: var(--nk-ink); -webkit-tap-highlight-color: transparent; }
.nk-box > summary::-webkit-details-marker { display: none; }
.nk-box > summary > .i:first-child { width: 22px; height: 22px; stroke-width: 1.9; }
.nk-box > summary .nk-chev { margin-left: auto; width: 20px; height: 20px; transition: transform .2s; }
.nk-box[open] > summary .nk-chev { transform: rotate(180deg); }
.nk-box .nk-more-sum { margin-left: auto; font: 400 13px/1 var(--f-ui); color: var(--nk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nk-box .nk-more-sum + .nk-chev { margin-left: 8px; }
.nk-box-body { padding: 2px 12px 14px; }
.nk-box[open] .nk-box-body { animation: nk-open .18s ease-out; }
@keyframes nk-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.nk-box .pf { box-shadow: none; }

.nk-tip { display: flex; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--nk-violet-50); color: #4b3a8c; }
.nk-tip .i { flex: none; width: 22px; height: 22px; color: var(--nk-violet); }
.nk-tip p { margin: 0; font: 400 13.5px/1.45 var(--f-ui); }
.nk-tip strong { display: block; font-weight: 600; color: var(--nk-violet); margin-bottom: 2px; }

/* zapis */
.nk-foot { position: sticky; bottom: 0; z-index: 3; padding: 12px 22px 18px; background: linear-gradient(to top, #fff 75%, rgb(255 255 255 / 0%)); }
.nk-save { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 58px; border: 0; border-radius: 999px;
  background: var(--nk-red); color: #fff; font: 600 17px/1 var(--f-display); cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 24px rgb(229 57 59 / 28%); transition: background .15s, transform .06s; }
.nk-save:hover { background: var(--nk-red-600); }
.nk-save:active { transform: scale(.99); }
.nk-save:disabled { opacity: .75; cursor: progress; }
.nk-save .i { width: 22px; height: 22px; stroke-width: 2; }
.nk-save .nk-spin { display: none; }
form.is-saving .nk-save .nk-spin { display: block; }
form.is-saving .nk-save .nk-save-ic { display: none; }
@keyframes kd-spin { to { transform: rotate(360deg); } }
.spin { animation: kd-spin .9s linear infinite; }

/* okno */
dialog.nk-dialog { padding: 0; border: 0; background: transparent; width: min(560px, calc(100vw - 32px)); max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 40px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border-radius: 28px; }
dialog.nk-dialog::backdrop { background: rgb(23 32 54 / 45%); backdrop-filter: blur(2px); }
html.nk-lock, html.nk-lock body { overflow: hidden; }

@media (max-width: 720px) {
  .nk-page { position: fixed; inset: 0 auto auto 0; z-index: 90; width: 100%; height: var(--nk-vh, 100dvh); margin: 0; padding: 0;
    transform: translateY(var(--nk-top, 0px)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: #fff; display: block; }
  .nk-card { max-width: none; border-radius: 0; box-shadow: none; min-height: 100%; overflow: visible; }
  dialog.nk-dialog { position: fixed; inset: 0 auto auto 0; width: 100%; max-width: 100%; height: var(--nk-vh, 100dvh); max-height: var(--nk-vh, 100dvh);
    margin: 0; border-radius: 0; transform: translateY(var(--nk-top, 0px)); }
  dialog.nk-dialog .nk-card { min-height: 100%; }
  .nk-grab { display: block; margin-top: max(8px, env(safe-area-inset-top)); }
  .nk-head { padding: 10px 16px 2px 18px; }
  .nk-title { font-size: 26px; }
  .nk-body { padding: 10px 16px 14px; flex: 1; }
  .nk-foot { padding: 10px 16px calc(12px + var(--safe-b)); }
  .nk-grid { grid-template-columns: minmax(0, 1fr); }
  .nk-grid.only-private { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .nk-grid.only-private .pf { padding-right: 10px; gap: 9px; }
  .nk-grid.only-private .pf-ic { width: 38px; height: 38px; }
  .nk-box-body.nk-grid > .pf:not(.span-2) { grid-column: auto; }
}
@media (max-width: 380px) {
  .nk-type label { font-size: 14px; gap: 7px; }
  .nk-tile { font-size: 14px; gap: 9px; padding-right: 10px; }
  .nk-tile-ic { width: 36px; height: 36px; }
  .pill { min-width: 60px; padding: 0 9px; font-size: 13.5px; }
  .nk-grid.only-private .pf-ic { display: none; }
  .nk-voice-cap { margin-left: 0; }
}

/* przycisk mikrofonu przy notatce w karcie zapytania */
.nk-mic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--red-50); color: var(--red); cursor: pointer; flex: none; -webkit-tap-highlight-color: transparent; }
.nk-mic:hover { background: var(--red-100); }
.nk-mic:disabled { opacity: .45; cursor: default; }
.nk-mic .i { width: 19px; height: 19px; }

/* ── Pomiar: pokrycie (rodzaj → dokładny typ z grafiką), współczynnik pofalowania ── */
.cov-label { margin: 0 0 8px; font: 500 var(--fs-sm)/1.3 var(--f-ui); color: var(--ink-2); display: block; }
.cov-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cov-cat { position: relative; display: inline-flex; flex-direction: row; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--line-soft); color: var(--ink-2); font: 500 var(--fs-base)/1 var(--f-ui); cursor: pointer; }
.cov-cat input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cov-cat:has(input:checked) { background: var(--red-50); color: var(--red-600); box-shadow: inset 0 0 0 1px var(--red-100); }
.cov-cat:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 1px; }
.cov-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin-bottom: 16px; }
.cov-prof { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border: 1px solid var(--line);
  border-radius: 14px; background: #fff; cursor: pointer; text-align: center; transition: border-color .12s, box-shadow .12s; }
.cov-prof input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cov-prof img { width: 100%; max-width: 120px; height: 64px; object-fit: contain; }
.cov-prof-name { font: 600 var(--fs-base)/1.2 var(--f-ui); color: var(--ink); }
.cov-prof-wave { font: 400 var(--fs-xs)/1.2 var(--f-ui); color: var(--muted); }
.cov-prof:has(input:checked) { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red), 0 4px 12px rgb(217 52 37 / 10%); }
.cov-prof:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.cov-none { justify-content: center; min-height: 64px; }
.cov-prof[data-cat], .cov-empty { display: none; }
.cov:has(input[name=covering_category][value=blacha]:checked) .cov-prof[data-cat=blacha],
.cov:has(input[name=covering_category][value=dachowka_betonowa]:checked) .cov-prof[data-cat=dachowka_betonowa],
.cov:has(input[name=covering_category][value=dachowka_ceramiczna]:checked) .cov-prof[data-cat=dachowka_ceramiczna] { display: flex; }
.cov:not(:has(input[name=covering_category]:checked)) .cov-empty,
.cov:has(input[name=covering_category][value=nie_wiem]:checked) .cov-empty { display: block; }
.cov:not(:has(input[name=covering_category]:checked)) .cov-profiles,
.cov:has(input[name=covering_category][value=nie_wiem]:checked) .cov-profiles { display: none; }
.cov-wave { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; align-items: end; padding: 14px; border-radius: 12px; background: var(--line-soft); }
.cov-wave > div { display: flex; flex-direction: column; gap: 2px; }
.cov-wave strong { font: 600 var(--fs-lg)/1.2 var(--f-display); }
.cov-wave .cov-label { margin: 0; }
.cov-wave-in input { max-width: 140px; }
.cov-wave:not(:has([data-wave-manual]:checked)) .cov-wave-in { opacity: .5; }
.intake { margin-bottom: 16px; }
.intake-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 20px; margin: 0; }
.intake-list div { display: flex; flex-direction: column; gap: 2px; }
.intake-list dt { font: 500 var(--fs-xs)/1.2 var(--f-ui); color: var(--muted); }
.intake-list dd { margin: 0; font-size: var(--fs-base); }
.wf-table input { max-width: 120px; text-align: right; margin-left: auto; display: block; }
.wf-name { display: inline-flex; align-items: center; gap: 10px; }
.wf-name img { object-fit: contain; }
#pokrycia { margin-bottom: 20px; }
.pf-wrap .pf-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pf-wrap .pill { min-width: 0; white-space: normal; text-align: center; line-height: 1.15; height: auto; min-height: 38px; padding: 6px 10px; }

/* ── Poprawka 31.10 (A): mniejsze ikony, pola i odstępy w formularzu „Nowe zapytanie” ── */
.nk-body { gap: 10px; }
.nk-title { font-size: 22px; }
.nk-subtitle { font-size: 14px; margin-top: 2px; }
.nk-close { width: 38px; height: 38px; }
.nk-close .i { width: 18px; height: 18px; }
.nk-type label { height: 44px; font-size: 14.5px; gap: 8px; }
.nk-type label .i { width: 17px; height: 17px; }
.nk-sec { font-size: 16px; gap: 8px; margin-top: 4px; }
.nk-sec .i { width: 18px; height: 18px; }
.pf { min-height: 52px; padding: 6px 12px 6px 9px; gap: 10px; border-radius: 18px; }
.pf-ic { width: 32px; height: 32px; }
.pf-ic .i { width: 17px; height: 17px; }
.pf-label { font-size: 12px; }
.pf input, .pf select { height: 22px; font-size: 16px; }
.pf-after .i { width: 18px; height: 18px; }
.pf-after-soft { width: 32px; height: 32px; }
.pf-after-soft .i { width: 16px; height: 16px; }
.ral-swatch { width: 32px; height: 32px; }
.pill { height: 36px; font-size: 13.5px; }
.pf-wrap .pill { min-height: 36px; padding: 5px 10px; }
.nk-grid { gap: 10px; }
.nk-found { padding: 10px 12px; border-radius: 18px; gap: 8px; }
.nk-found-ic { width: 32px; height: 32px; }
.nk-found-ic .i { width: 17px; height: 17px; }
.nk-act { height: 34px; font-size: 13px; }
.nk-chosen { padding: 12px; border-radius: 18px; }
.nk-note { min-height: 88px; padding: 12px 14px; border-radius: 18px; font-size: 16px; }
.nk-micbig { width: 52px; height: 52px; }
.nk-micbig .i { width: 22px; height: 22px; }
.nk-wave { height: 46px; padding: 0 14px; }
.nk-voice { gap: 12px; }
.nk-voice-cap { margin-left: 64px; font-size: 12.5px; }
.nk-tiles { gap: 10px; }
.nk-tile { min-height: 50px; padding: 7px 12px 7px 8px; gap: 10px; border-radius: 18px; font-size: 14.5px; }
.nk-tile-ic { width: 32px; height: 32px; }
.nk-tile-ic .i { width: 17px; height: 17px; }
.nk-box { border-radius: 20px; }
.nk-box > summary { min-height: 50px; padding: 6px 14px; font-size: 15.5px; gap: 10px; }
.nk-box > summary > .i:first-child { width: 18px; height: 18px; }
.nk-box > summary .nk-chev { width: 18px; height: 18px; }
.nk-box-body { padding: 2px 10px 12px; }
.nk-tip { padding: 12px 14px; border-radius: 16px; }
.nk-tip .i { width: 18px; height: 18px; }
.nk-save { height: 52px; font-size: 16px; }
.nk-save .i { width: 19px; height: 19px; }
.nk-chip { height: 32px; }
@media (max-width: 720px) {
  .nk-title { font-size: 22px; }
  .nk-grid.only-private .pf-ic { width: 30px; height: 30px; }
}
.nk-qe-result { padding: 10px 14px; border-radius: 14px; background: var(--nk-soft); color: var(--nk-muted); font: 400 13.5px/1.35 var(--f-ui); }
.nk-qe-result.on { display: flex; flex-wrap: wrap; gap: 6px 18px; background: var(--nk-green-50); color: var(--nk-ink); }
.nk-qe-result b { font: 600 16px/1.2 var(--f-display); }
.nk-qe-note { margin: 0 4px; font: 400 12px/1.35 var(--f-ui); color: var(--nk-muted); }

/* ── Formularz pomiaru: 5 zwijanych sekcji + podsumowanie oferty ── */
.mf {
  --nk-ink: #172036; --nk-ink-2: #3d4a63; --nk-muted: #7a869c; --nk-line: #e9edf3; --nk-soft: #f6f8fb;
  --nk-red: #e5393b; --nk-red-600: #cf2f31; --nk-red-50: #fdeeee; --nk-red-100: #fbdcdc;
  --nk-green: #1f9d5c; --nk-green-50: #eaf7f0; --nk-blue: #2f6bd8; --nk-blue-50: #edf3fd; --nk-pink: #d9434f; --nk-pink-50: #fdf0f1;
  --nk-slate: #5e6b82; --nk-slate-50: #f1f4f8; --nk-navy: #172036; --nk-shadow: 0 1px 2px rgb(23 32 54 / 4%), 0 4px 14px rgb(23 32 54 / 4%);
  color: var(--nk-ink); max-width: 820px; margin: 0 auto; padding-bottom: 96px;
}
.mf * { min-width: 0; }
.mf [hidden] { display: none !important; }
.mf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mf-back { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--nk-line); background: #fff; flex: none; }
.mf-back .i { width: 17px; height: 17px; }
.mf-title { flex: 1; }
.mf-title h1 { margin: 0; font: 700 20px/1.2 var(--f-display); letter-spacing: -0.01em; }
.mf-title p { margin: 2px 0 0; color: var(--nk-muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-status { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; background: #fff7ed; color: #c2410c; font: 500 12.5px/1 var(--f-ui); white-space: nowrap; }
.mf-status.ok { background: var(--nk-green-50); color: var(--nk-green); }
.mf-status .i { width: 14px; height: 14px; }
.mf-restore { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 14px; background: var(--nk-blue-50); font-size: 14px; }
.mf-restore .i { width: 17px; height: 17px; color: var(--nk-blue); }
.mf-error { margin-bottom: 12px; }
.mf-main { display: flex; flex-direction: column; gap: 10px; }
.mf-sec { background: #fff; border: 1px solid var(--nk-line); border-radius: 18px; box-shadow: var(--nk-shadow); }
.mf-h { display: flex; align-items: center; gap: 9px; padding: 12px 14px; cursor: pointer; list-style: none; font: 600 15.5px/1.2 var(--f-display); }
.mf-h::-webkit-details-marker { display: none; }
.mf-h > .i { width: 17px; height: 17px; color: var(--nk-slate); flex: none; }
.mf-h-t { flex: 1; }
.mf-h-hint { color: var(--nk-muted); font: 400 12.5px/1 var(--f-ui); white-space: nowrap; }
.mf-chev { transition: transform .15s; }
.mf-sec:not([open]) .mf-chev { transform: rotate(-90deg); }
.mf-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--nk-red-50); color: var(--nk-red-600); font: 600 11.5px/1 var(--f-ui); flex: none; }
.mf-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.mf-field { display: flex; flex-direction: column; gap: 6px; }
.mf-label { margin: 2px 0 0; font: 500 13px/1.3 var(--f-ui); color: var(--nk-ink-2); }
.mf-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.mf-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.mf .pill { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--nk-soft);
  border: 1px solid transparent; color: var(--nk-ink-2); font: 500 14px/1 var(--f-ui); cursor: pointer; white-space: nowrap; margin: 0; flex: 1 0 auto; min-width: max-content; }
.mf .pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mf .pill:has(input:checked) { background: var(--nk-red-50); color: var(--nk-red-600); border-color: var(--nk-red-100); }
.mf .pill:has(input:focus-visible) { outline: 2px solid var(--nk-red); outline-offset: 1px; }
.mf .pf { box-shadow: none; min-height: 50px; padding: 6px 12px 6px 8px; gap: 10px; border-radius: 16px; }
.mf .pf-ic { width: 32px; height: 32px; }
.mf .pf-ic .i { width: 17px; height: 17px; }
.mf .pf-label { font-size: 12px; }
.mf .pf input, .mf .pf select { height: 22px; font-size: 15.5px; }
.mf-client { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--nk-soft); }
.mf-client .pf-ic { width: 32px; height: 32px; }
.mf-client .pf-ic .i { width: 17px; height: 17px; }
.mf-client div { flex: 1; display: flex; flex-direction: column; }
.mf-client strong { font: 600 14.5px/1.25 var(--f-display); }
.mf-client span { font-size: 12.5px; color: var(--nk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-client-call { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--nk-green); flex: none; }
.mf-client-call .i { width: 16px; height: 16px; }
.mf-notes summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font: 500 13px/1.3 var(--f-ui); color: var(--nk-blue); list-style: none; }
.mf-notes summary::-webkit-details-marker { display: none; }
.mf-notes summary .i { width: 16px; height: 16px; }
.mf-notes ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mf-notes li { padding: 8px 10px; border-radius: 12px; background: var(--nk-soft); }
.mf-notes li p { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mf-notes li span { font-size: 11.5px; color: var(--nk-muted); }
.mf .cov { display: flex; flex-direction: column; gap: 8px; }
.mf .cov-profiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.mf .cov-prof { padding: 6px; border-radius: 12px; }
.mf .cov-prof img { width: 56px; height: 32px; object-fit: contain; }
.mf .cov-prof-name { font-size: 12px; }
.mf .cov:not(:has(input[name=covering_category]:checked)) .cov-empty { display: block; }
.mf-wave-note { font-size: 13px; }
.mf-areas { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mf-areas div { padding: 8px 10px; border-radius: 12px; background: var(--nk-soft); }
.mf-areas dt { font-size: 11.5px; color: var(--nk-muted); line-height: 1.25; }
.mf-areas dd { margin: 2px 0 0; font: 600 14.5px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
.mf-areas .mf-areas-main { background: var(--nk-green-50); }
.mf-areas .mf-areas-main dd { color: var(--nk-green); }
.mf-areas-rule { margin: -4px 0 0; }
.mf-ease { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--nk-soft); }
.mf-ease-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mf-ease output { font: 600 14px/1.2 var(--f-display); color: var(--nk-ink); white-space: nowrap; }
.mf-ease p { margin: 0; }
.mf-ease input[type=range] { width: 100%; height: 30px; padding: 0; border: 0; background: none; accent-color: var(--nk-red); box-shadow: none; }
.mf-ease input[data-unset] { opacity: .45; }
.mf-ease-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--nk-muted); padding: 0 4px; }
.mf-extras { display: flex; flex-direction: column; gap: 8px; }
.mf-item { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px; background: var(--nk-soft); }
.mf-item-top { display: flex; gap: 6px; }
.mf-item select, .mf-item input { height: 42px; min-height: 0; padding: 0 10px; border-radius: 10px; font-size: 15px; background: #fff; border: 1px solid var(--nk-line); width: 100%; }
.mf-item-x { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--nk-line); background: #fff; color: var(--nk-muted); cursor: pointer; }
.mf-item-x .i { width: 16px; height: 16px; }
.mf-item-grid { display: grid; grid-template-columns: 1fr 90px 1.2fr auto; gap: 6px; align-items: end; }
.mf-item-grid label { display: flex; flex-direction: column; gap: 3px; font: 400 11.5px/1.2 var(--f-ui); color: var(--nk-muted); margin: 0; }
.mf-item-sum { font: 600 14px/42px var(--f-display); text-align: right; min-width: 70px; }
.mf-add { align-self: flex-start; height: 40px; border-radius: 999px; padding: 0 16px; }
.mf-vat-note { margin: 0; }
.mf-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mf .mf-doc { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 14px; border: 1px solid var(--nk-line); background: #fff;
  font: 600 14.5px/1 var(--f-ui); color: var(--nk-ink); cursor: pointer; margin: 0; }
.mf-doc .i { width: 18px; height: 18px; color: var(--nk-red); }
.mf-doc:hover { background: var(--nk-soft); }
.mf-doc:disabled { opacity: .55; }
.mf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.mf-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--nk-soft); }
.mf-photos:empty { display: none; }
.mf-thumb { position: relative; }
.mf-thumb-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgb(23 32 54 / 78%); color: #fff; font: 600 16px/1 var(--f-ui); cursor: pointer; }
.mf-ta { display: flex; flex-direction: column; gap: 4px; font: 500 13px/1.3 var(--f-ui); color: var(--nk-ink-2); margin: 0; }
.mf-ta textarea { border-radius: 14px; background: var(--nk-soft); font-size: 15px; }
.mf-summary { background: #fff; border: 1px solid var(--nk-line); border-radius: 18px; box-shadow: var(--nk-shadow); padding: 14px; }
.mf-sum-k { margin: 0 0 8px; font: 600 11.5px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--nk-red); }
.mf-sum-list { margin: 0 0 12px; display: flex; flex-direction: column; gap: 5px; }
.mf-sum-list div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.mf-sum-list dt { color: var(--nk-ink-2); }
.mf-sum-list dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.mf-sum-net { border-top: 1px solid var(--nk-line); padding-top: 7px; margin-top: 3px; }
.mf-sum-net dt, .mf-sum-net dd { font-weight: 600; color: var(--nk-ink); }
.mf-gross { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 12px; padding: 14px 16px; border-radius: 16px; background: var(--nk-navy); color: #fff; }
.mf-gross span { font: 500 13.5px/1.2 var(--f-ui); color: #c4cde0; }
.mf-gross strong { font: 700 24px/1.1 var(--f-display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.mf-gross small { grid-column: 1 / -1; font-size: 12px; color: #9fabc4; }
.mf-gross.incomplete { background: #eef1f6; color: var(--nk-ink); }
.mf-gross.incomplete span { color: var(--nk-ink-2); }
.mf-gross.incomplete small { color: #b45309; }
.mf-foot { position: fixed; left: var(--sb); right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; gap: 8px; padding: 10px 24px calc(10px + var(--safe-b));
  background: rgb(255 255 255 / 95%); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
.nav-collapsed .mf-foot { left: var(--sb-c); }
.mf-foot .btn { height: 46px; border-radius: 999px; padding: 0 22px; min-width: 170px; font-size: 14.5px; }
.mf-foot .btn-primary { background: var(--nk-red); border-color: var(--nk-red); }
@media (max-width: 900px) { .mf-foot { left: 0; } }
@media (max-width: 720px) {
  .mf-row { grid-template-columns: minmax(0, 1fr); }
  .mf-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mf-h { padding: 12px; }
  .mf-body { padding: 0 12px 12px; }
  .mf-h-hint { display: none; }
  .mf-item-grid { grid-template-columns: 1fr 84px; }
  .mf-item-grid label:nth-child(3) { grid-column: 1 / 2; }
  .mf-foot { padding: 8px 10px calc(8px + var(--safe-b)); gap: 8px; }
  .mf-foot .btn { flex: 1; min-width: 0; padding: 0 8px; font-size: 14px; }
  .mf-title h1 { font-size: 18px; }
  .mf-status { padding: 5px 9px; font-size: 12px; }
}

/* ── „+”: wybór Nowe zapytanie / Pomiar teraz ── */
.tb-plus { position: relative; margin-left: auto; }
.tb-plus > summary { list-style: none; cursor: pointer; }
.tb-plus > summary::-webkit-details-marker { display: none; }
.tb-plus-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 300px; display: flex; flex-direction: column; gap: 8px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-pop); }
.tb-plus-tile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #f6f8fb; color: #172036; }
.tb-plus-tile:hover { background: #eef2f8; }
.tb-plus-tile b { display: block; font: 600 15.5px/1.25 var(--f-display); }
.tb-plus-tile small { display: block; font-size: 12.5px; color: #7a869c; }
.tb-plus-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; flex: none; }
.tb-plus-ic .i { width: 20px; height: 20px; }
.tb-plus-ic.tone-red { background: #fdeeee; color: #e5393b; }
.tb-plus-ic.tone-blue { background: #edf3fd; color: #2f6bd8; }
@media (max-width: 900px) {
  .tb-plus-menu { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(10px + var(--safe-b)); width: auto; padding: 10px; gap: 10px; border-radius: 22px; }
  .tb-plus-tile { padding: 16px; }
  .tb-plus[open]::before { content: ""; position: fixed; inset: 0; z-index: 55; background: rgb(23 32 54 / 32%); }
  .topbar:has(.tb-plus[open]) { backdrop-filter: none; -webkit-backdrop-filter: none; } /* inaczej „fixed” liczy się od paska, a nie od ekranu */
}
.nk-search-res { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.nk-search-res:empty { display: none; }
.nk-search-none { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--nk-soft); color: var(--nk-muted); font-size: 13.5px; }
.nk-or { display: flex; align-items: center; gap: 10px; margin: 12px 0 2px; color: var(--nk-muted); font: 500 12px/1 var(--f-ui); text-transform: uppercase; letter-spacing: .06em; }
.nk-or::before, .nk-or::after { content: ""; flex: 1; border-top: 1px solid var(--nk-line); }
.nk-mode-pomiar .nk-save { background: var(--nk-blue); box-shadow: 0 10px 24px rgb(47 107 216 / 24%); }
.nk-mode-pomiar .nk-save:hover { background: #2559b8; }
.nk-mode-pomiar .nk-type label:has(input:checked) { background: var(--nk-blue); box-shadow: 0 6px 16px rgb(47 107 216 / 24%); }

/* ── „Rozpocznij pomiar” przy każdym kliencie na liście pomiarów ── */
.btn-measure { border-radius: 999px; background: #edf3fd; border-color: #d6e4fa; color: #2f6bd8; white-space: nowrap; }
.btn-measure:hover { background: #e2ecfc; }
.btn-measure .i { width: 16px; height: 16px; }
td.c-act { text-align: right; width: 1%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 720px) {
  .cards li:has(.cl-measure) { flex-wrap: wrap; }
  .cards li:has(.cl-measure) .card-link { flex-basis: calc(100% - 55px); }
  .cl-measure { flex-basis: 100%; justify-content: center; height: 44px; margin: 0 10px 10px; flex: 1 1 100%; font-size: 14.5px; }
}
.deal-measure-cta { border-radius: 999px; }

/* ── Karta zapytania (wygląd starego panelu): nagłówek, okrągłe szybkie akcje, ostatnie notatki, granatowe kafelki ── */
.deal-v2 { --navy: #172036; --navy-2: #24304a; max-width: 980px; margin: 0 auto; }
.deal-v2 .back-link { margin-bottom: 8px; }
.dh2 { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.dh2-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.dh2-name { margin: 0; font: 700 22px/1.2 var(--f-display); letter-spacing: -0.015em; color: var(--navy); overflow-wrap: anywhere; }
.dh2-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; color: var(--ink-2); font-size: 13.5px; }
.dh2-meta > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.dh2-meta .i { color: var(--muted); flex: none; }
.dh2-nr { font-weight: 600; color: var(--navy); }
.dh2-wait { padding: 2px 9px; border-radius: 999px; background: #fff7ed; color: #b45309; font-weight: 500; }
.dh2-wait .i { color: #b45309 !important; }
.dh2-wait.late { background: #fdeeee; color: #cf2f31; }
.dh2-wait.late .i { color: #cf2f31 !important; }
.dh2-contact { display: inline-flex; align-items: center; gap: 5px; width: fit-content; color: #2f6bd8; }

.qa-row { display: flex; align-items: center; justify-content: space-between; gap: 0; margin: 0 -6px 10px; padding: 0; overflow-x: auto; scrollbar-width: none; }
.qa-row::-webkit-scrollbar { display: none; }
.qa { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; text-decoration: none; margin: 0; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
.qa-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid; transition: transform .1s, box-shadow .15s; }
.qa-ic .i { width: 17px; height: 17px; stroke-width: 1.85; }
.qa:hover .qa-ic { box-shadow: 0 2px 8px rgb(23 32 54 / 10%); }
.qa:active .qa-ic { transform: scale(.94); }
.qa:focus-visible { outline: none; }
.qa:focus-visible .qa-ic { outline: 2px solid #e5393b; outline-offset: 2px; }
.qa-green { border-color: #bfe6d1; background: #eef9f3; color: #1f9d5c; }
.qa-blue { border-color: #cddcf7; background: #f0f5fd; color: #2f6bd8; }
.qa-slate { border-color: #dfe4ec; background: #f6f8fb; color: #3d4a63; }
.qa-red { border-color: #f6cdce; background: #fdf1f1; color: #e5393b; }
.qa-violet { border-color: #dfd5f6; background: #f6f2fd; color: #6d4bc4; }
.qa-amber { border-color: #f3dfb6; background: #fff9ee; color: #b7791f; }
.qa.is-off { opacity: .38; cursor: not-allowed; }
.qa-dd { position: relative; flex: 0 0 44px; }
.qa-dd > summary { list-style: none; }
.qa-dd > summary::-webkit-details-marker { display: none; }
.qa-dd .menu { left: 50%; transform: translateX(-50%); }
@media (min-width: 721px) { .qa-row { justify-content: flex-start; gap: 6px; margin: 0 -4px 12px; } }
.qa-status { margin: -4px 0 10px; padding: 8px 12px; border-radius: 12px; background: #eaf7f0; color: #1f7a4a; }
.qa-status.err { background: #fdeeee; color: #cf2f31; }

.rn { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgb(23 32 54 / 4%); }
.rn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.rn-head h2 { margin: 0; font: 600 11.5px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: #e5393b; }
.rn-add { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: #2f6bd8; font: 500 13px/1 var(--f-ui); cursor: pointer; padding: 4px; }
.rn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rn-item { padding: 9px 0; border-top: 1px solid var(--line-soft); }
.rn-item:first-child { border-top: 0; padding-top: 2px; }
.rn-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.rn-meta b { color: var(--navy); font-weight: 600; }
.rn-body { margin: 3px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rn-body.open { display: block; -webkit-line-clamp: unset; }
.rn-more { border: 0; background: none; padding: 2px 0; color: #2f6bd8; font: 500 12.5px/1 var(--f-ui); cursor: pointer; }
.rn-all { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; font: 500 13px/1 var(--f-ui); color: #2f6bd8; }
.rn-empty { margin: 4px 0; color: var(--muted); font-size: 14px; }

.rt { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.rt-tile { position: relative; display: flex; flex-direction: column; min-height: 80px; padding: 10px 12px; border-radius: 15px; background: var(--navy); color: #fff; overflow: hidden; }
.rt-tile strong { margin-top: auto; padding-top: 6px; font: 700 15.5px/1.2 var(--f-display); overflow-wrap: anywhere; }
.rt-tile span { margin-top: 2px; font: 500 11.5px/1.25 var(--f-ui); color: #9fabc4; }
.rt-ic { width: 17px; height: 17px; color: #ff6a59; }
.rt-ral { background: var(--ral); }
.rt-ral strong { width: fit-content; max-width: 100%; padding: 3px 8px; border-radius: 8px; background: rgb(0 0 0 / 35%); }
.rt-ral span { color: #fff; text-shadow: 0 1px 3px rgb(0 0 0 / 70%); }
.rt-cov img { width: 56px; height: 30px; object-fit: contain; filter: invert(1) brightness(1.6); opacity: .9; }

.na { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(23 32 54 / 4%); }
.na-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.na-k { font: 600 11px/1.2 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.na-txt strong { font: 600 16px/1.25 var(--f-display); color: var(--navy); }
.na-btn { flex: none; height: 44px; border-radius: 999px; padding: 0 18px; background: #e5393b; border-color: #e5393b; white-space: nowrap; }
.na-btn:hover { background: #cf2f31; border-color: #cf2f31; }

.note-dlg { width: min(520px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 20px; }
.note-dlg-f { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.note-dlg-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.note-dlg-h div { display: flex; flex-direction: column; }
.note-dlg-h strong { font: 700 17px/1.2 var(--f-display); }
.note-dlg-x { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.note-dlg-x .i { width: 16px; height: 16px; }
.note-dlg textarea { font-size: 16px; border-radius: 14px; }
.note-dlg p { margin: 0; }
.note-dlg-foot { display: flex; justify-content: flex-end; gap: 8px; }
.note-dlg-foot .btn { height: 44px; border-radius: 999px; padding: 0 18px; }

@media (max-width: 720px) {
  .dh2-name { font-size: 20px; }
  .rt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .na { flex-direction: column; align-items: stretch; }
  .na-btn { justify-content: center; }
  .note-dlg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .note-dlg-f { padding-bottom: calc(16px + var(--safe-b)); }
  .note-dlg-foot .btn { flex: 1; }
}
.rn-meta .note-by { margin: 0; }

.rn-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 5px; border-radius: 999px; font: 500 11px/1.5 var(--f-ui); }
.rn-tag .i { width: 11px; height: 11px; }
.rn-tag-voice { background: #fdf1f1; color: #e5393b; }
.rn-tag-m { background: #fff9ee; color: #b7791f; }
.rn-tag-o { background: #edf3fd; color: #2f6bd8; }

/* ── Zakładka „Dane klienta”: odczyt (sekcje z małymi ikonami) i edycja (pola-pastylki) ── */
.deal-v2 {
  --nk-ink: #172036; --nk-ink-2: #3d4a63; --nk-muted: #7a869c; --nk-line: #e9edf3; --nk-soft: #f6f8fb;
  --nk-red: #e5393b; --nk-red-600: #cf2f31; --nk-red-50: #fdeeee; --nk-red-100: #fbdcdc;
  --nk-green: #1f9d5c; --nk-green-50: #eaf7f0; --nk-blue: #2f6bd8; --nk-blue-50: #edf3fd; --nk-pink: #d9434f; --nk-pink-50: #fdf0f1;
  --nk-slate: #5e6b82; --nk-slate-50: #f1f4f8; --nk-shadow: 0 1px 2px rgb(23 32 54 / 4%), 0 4px 14px rgb(23 32 54 / 4%);
}
.dk { display: flex; flex-direction: column; gap: 10px; }
.dk [hidden] { display: none !important; }
.dk-sec { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 14px; box-shadow: 0 1px 2px rgb(23 32 54 / 4%); }
.dk-h { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; list-style: none; }
.dk-h::-webkit-details-marker { display: none; }
.dk-h h2 { flex: 1; margin: 0; font: 600 15px/1.2 var(--f-display); color: var(--nk-ink); }
.dk-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none; }
.dk-ic .i { width: 16px; height: 16px; stroke-width: 1.85; }
.dk-red { background: #fdf1f1; color: #e5393b; }
.dk-blue { background: #f0f5fd; color: #2f6bd8; }
.dk-green { background: #eef9f3; color: #1f9d5c; }
.dk-violet { background: #f6f2fd; color: #6d4bc4; }
.dk-amber { background: #fff9ee; color: #b7791f; }
.dk-slate { background: #f3f5f9; color: #5e6b82; }
.dk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.dk-it { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.dk-it .dk-ic { width: 28px; height: 28px; }
.dk-it .dk-ic .i { width: 15px; height: 15px; }
.dk-it > div { display: flex; flex-direction: column; min-width: 0; }
.dk-l { font: 400 12px/1.3 var(--f-ui); color: var(--nk-muted); }
.dk-v { font: 500 14.5px/1.35 var(--f-ui); color: var(--nk-ink); overflow-wrap: anywhere; }
.dk-v a { color: var(--nk-blue); }
.dk-edit { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--nk-soft); border: 1px solid var(--nk-line); color: var(--nk-ink-2); font: 500 13px/1 var(--f-ui); }
.dk-edit:hover { background: #eef1f6; }
.dk-addr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dk-addr-card { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--nk-soft); }
.dk-addr-card strong { font: 600 14.5px/1.35 var(--f-ui); color: var(--nk-ink); overflow-wrap: anywhere; }
.dk-sub { font-size: 12px; color: var(--nk-muted); }
.dk-other-h { margin: 10px 0 4px; }
.dk-other { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dk-other li { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--nk-ink-2); }
.dk-other .i { color: var(--nk-muted); flex: none; }
.dk-more:not([open]) { padding-bottom: 2px; }
.dk-more:not([open]) .dk-h { margin-bottom: 10px; }
.dk-more > summary { cursor: pointer; }
.dk-chev { width: 17px; height: 17px; color: var(--nk-muted); transition: transform .15s; }
.dk-more:not([open]) .dk-chev { transform: rotate(-90deg); }
.dk-acq { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--nk-line); }
.dk-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.dk-pill { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--nk-soft); border: 1px solid transparent; font: 500 14px/1 var(--f-ui); color: var(--nk-ink-2); cursor: pointer; margin: 0; }
.dk-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.dk-pill:has(input:checked) { background: var(--nk-red-50); color: var(--nk-red-600); border-color: var(--nk-red-100); }
.dk-pill:has(input:focus-visible) { outline: 2px solid var(--nk-red); outline-offset: 1px; }
.dk-pill-none:has(input:checked) { background: #eef1f6; color: var(--nk-ink); border-color: #dfe4ec; }
.dk-acq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dk-acq-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; }
.dk-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font: 500 11.5px/1 var(--f-ui); }
.dk-badge.ok { background: var(--nk-green-50); color: var(--nk-green); }
.dk-badge.wait { background: #fff7ed; color: #b45309; }
.dk-acq-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.dk-save { border-radius: 999px; background: var(--nk-red); border-color: var(--nk-red); }
.dk-mine { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dk-seg { display: inline-flex; gap: 4px; padding: 3px; margin-bottom: 10px; border-radius: 999px; background: var(--nk-soft); }
.dk-seg label { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; font: 500 13.5px/1 var(--f-ui); color: var(--nk-ink-2); cursor: pointer; margin: 0; }
.dk-seg label .i { width: 16px; height: 16px; }
.dk-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dk-seg label:has(input:checked) { background: #fff; color: var(--nk-ink); box-shadow: 0 1px 3px rgb(23 32 54 / 12%); }
.dk-fgrid, .dk-addr-f { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dk-span2 { grid-column: span 2; }
.dk-form .pf { min-height: 50px; padding: 6px 12px 6px 8px; gap: 10px; border-radius: 16px; box-shadow: none; }
.dk-form .pf-ic { width: 32px; height: 32px; }
.dk-form .pf-ic .i { width: 16px; height: 16px; }
.dk-form .pf input, .dk-form .pf select { height: 22px; font-size: 15.5px; }
.dk-form:has(input[name=contact_type][value=company]:checked) .only-private { display: none; }
.dk-form:has(input[name=contact_type][value=private]:checked) .only-company { display: none; }
.dk-ta { display: flex; flex-direction: column; gap: 4px; font: 400 12px/1.3 var(--f-ui); color: var(--nk-muted); margin: 0; }
.dk-ta textarea { border-radius: 14px; background: var(--nk-soft); font-size: 15px; }
.dk-note { margin: 0 0 8px; }
.dk-pna-hint { grid-column: 1 / -1; margin: 0; min-height: 0; color: var(--nk-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dk-pna-hint:empty { display: none; }
.dk-pna-hint.ok { color: var(--nk-green); }
.dk-pna-hint.warn { color: #b45309; }
.dk-pna-btn { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--nk-line); background: #fff; color: var(--nk-ink); font: 500 12.5px/1 var(--f-ui); cursor: pointer; }
.dk-foot { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 0 calc(10px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.dk-foot .btn { height: 44px; border-radius: 999px; padding: 0 20px; }
.dk-foot .btn-primary { background: var(--nk-red); border-color: var(--nk-red); }
@media (max-width: 720px) {
  .dk-grid, .dk-addr, .dk-fgrid, .dk-addr-f { grid-template-columns: minmax(0, 1fr); }
  .dk-span2 { grid-column: auto; }
  .dk-foot .btn { flex: 1; }
  .dk-acq-foot .btn { width: 100%; justify-content: center; }
}
.dk .dk-seg label { display: inline-flex; flex-direction: row; align-items: center; position: relative; }

/* ───────────── Oferty ───────────── */
.of-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.of-slate { background: #f1f3f6; color: #4a5263; } .of-amber { background: #fff6e5; color: #9a5b00; } .of-blue { background: #edf3fd; color: #2f6bd8; }
.of-violet { background: #f3f0fe; color: #6342d0; } .of-green { background: #ecfdf3; color: #166534; } .of-red { background: var(--red-50); color: #a8261b; }
.of-list-h, .of-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.of-list-h h2, .of-sec-h h2 { margin: 0; }
.of-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.of-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); color: inherit; text-decoration: none; }
.of-item:hover, .of-item.is-on { border-color: #cfd5de; background: #fafbfc; }
.of-item-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.of-item > .i { color: var(--faint); width: 16px; height: 16px; }
.of-page { max-width: 1180px; }
.of-page .crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: var(--fs-sm); margin-bottom: 10px; }
.of-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.of-head h1 { margin: 0 0 4px; }
.of-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; margin-bottom: 16px; }
.of-side { position: sticky; top: 76px; }
.of-scope { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 8px; }
.of-sc { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.of-sc-n { width: 26px; height: 26px; margin-top: 7px; border-radius: 50%; background: #f1f3f6; color: #4a5263; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; }
.of-sc textarea { width: 100%; resize: vertical; min-height: 44px; overflow: hidden; }
.of-sc-btns { display: flex; gap: 2px; margin-top: 4px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: #f1f3f6; color: var(--ink); }
.icon-btn .i { width: 16px; height: 16px; }
.of-ex { display: grid; grid-template-columns: minmax(0, 2fr) 90px 90px 130px 34px; gap: 8px 10px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
#of-extras { margin-bottom: 8px; }
.of-notes { display: grid; gap: 6px; margin: 14px 0; }
.of-warn { display: flex; gap: 6px; align-items: center; color: #9a5b00; font-size: var(--fs-sm); margin-top: 4px; }
.of-warn[hidden] { display: none; }
.of-sum .totals { margin-top: 8px; }
.of-actions { display: grid; gap: 8px; margin: 14px 0 8px; }
.of-actions form, .of-actions .btn, .of-actions button { width: 100%; }
.of-actions .btn { justify-content: center; }
.of-hist { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: var(--fs-sm); }
.of-scope-ro { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.t-h4 { font: 600 var(--fs-md) var(--f-display); margin: 18px 0 6px; }
@media (max-width: 900px) {
  .of-cols { grid-template-columns: 1fr; }
  .of-side { position: static; }
  .of-ex { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "name name del" "qty unit price"; }
  .of-ex .of-ex-name { grid-area: name; }
  .of-ex > label:nth-of-type(2) { grid-area: qty; } .of-ex > label:nth-of-type(3) { grid-area: unit; } .of-ex > label:nth-of-type(4) { grid-area: price; }
  .of-ex [data-ex-del] { grid-area: del; justify-self: end; }
  .of-sc { grid-template-columns: 22px minmax(0, 1fr); }
  .of-sc-btns { grid-column: 2; justify-content: flex-end; margin-top: 0; }
}
.rv-now { margin: 10px 0 14px; font-size: var(--fs-sm); }
.rv-old { color: #9a5b00; }

/* ───────────── Wszystkie zapytania: kompaktowa tabela ───────────── */
.iq-card { overflow-x: auto; }
.table.iq { table-layout: fixed; width: 100%; min-width: 1080px; }
.iq col.w-nr { width: 78px; } .iq col.w-client { width: 15%; } .iq col.w-date { width: 116px; }
.iq col.w-src { width: 92px; } .iq col.w-stage { width: 136px; } .iq col.w-acq { width: 96px; } .iq col.w-act { width: 106px; }
.table.iq th { padding: 0 8px 0 10px; height: 34px; font: 600 12px/1.2 var(--f-ui); text-transform: none; letter-spacing: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table.iq td { padding: 0 8px 0 10px; height: 36px; max-height: 36px; font-size: 13px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; border-bottom: 1px solid #edf0f4; }
.table.iq td * { white-space: nowrap; }
.table.iq .status { display: flex; min-width: 0; font-size: 12.5px; }
.table.iq .status .st-l { overflow: hidden; text-overflow: ellipsis; }
.table.iq tbody tr:nth-child(odd) { background: #ffffff; }
.table.iq tbody tr:nth-child(even) { background: #f5f7fa; }
.table.iq tbody tr:hover { background: #eaf0f7; }
.table.iq tbody tr:focus-within { background: #eaf0f7; box-shadow: inset 3px 0 0 var(--red); }
.iq-client a { color: var(--ink); font-weight: 400; }
.iq-client a b, .iq-name b, .kc-name b { font-weight: 650; }
.iq-client { overflow: hidden; text-overflow: ellipsis; }
.iq-client .warn-dot { margin-left: 5px; }
.iq-client .warn-dot .i { width: 13px; height: 13px; }
.iq-rel { margin-left: 6px; color: var(--faint); font-size: 12px; font-family: var(--f-ui); }
.acq-wait { color: var(--faint); font-style: italic; }
.act { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.act-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.act-warn { color: #9a5b00; } .act-warn .act-dot { background: #f2a516; }
.act-alert { color: #b42318; } .act-alert .act-dot { background: #e5484d; }
.iq-filters .f-search { min-width: 340px; }
.iq-clear { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--muted); padding: 0 6px; height: 36px; }
.iq-clear:hover { color: var(--red); }
.kc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.kc-top .act { font-size: 12px; }
.kc-name { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-addr { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-acq { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; }
.kcard .kmeta { flex-wrap: wrap; gap: 4px 10px; }
.iq-cards .card-link { padding: 10px 14px; gap: 3px; }
.iq-cards .iq-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 400; }
.iq-cards .iq-c-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iq-cards .cl-mid { gap: 4px 12px; }
@media (max-width: 760px) {
  .iq-filters .f-search { min-width: 0; flex: 1; }
}
.kcol { min-width: 0; }
.kitems, .kcard { min-width: 0; }
.kcard > span { min-width: 0; max-width: 100%; }

/* ───────────── Tablica: karty z szybkimi akcjami ───────────── */
.kcard { padding: 0; gap: 0; overflow: hidden; }
.kc-main { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 7px; color: inherit; text-decoration: none; min-width: 0; }
.kc-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.kc-name { flex: 1; min-width: 0; font: 650 13.5px/1.3 var(--f-ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-age { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.kc-addr { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.kc-addr .i { width: 12px; height: 12px; flex: none; color: var(--faint); }
.kc-addr > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kc-src { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kq { display: flex; justify-content: space-between; gap: 2px; padding: 3px 6px 4px; border-top: 1px solid var(--line-soft); cursor: default; }
.kq-b { flex: 1; display: grid; place-items: center; height: 32px; border: 0; background: none; border-radius: 7px; color: var(--muted); cursor: pointer; padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.kq-b .i { width: 16px; height: 16px; }
.kq-b:hover { background: #f1f3f6; color: var(--ink); }
.kq-b:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.kq-b.is-off { color: #c9ced6; }
.kq-b.is-off:hover { background: none; color: #b6bcc6; }
.ksum { display: flex; justify-content: space-between; gap: 8px; padding: 0 6px 8px; font-size: 12px; color: var(--muted); }
.ksum b { font-weight: 600; color: var(--ink-2); }
.ks-l { color: var(--faint); }
.ks-set { color: var(--muted); text-decoration: underline; font-weight: 500; }
.kq-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kq-err { color: #a8261b; font-size: var(--fs-sm); margin: 0; }
.kq-toast { position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%); z-index: 300; box-shadow: 0 10px 30px rgb(0 0 0 / 14%); max-width: calc(100vw - 32px); }
.pr-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pr-grid label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pr-l { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.pr-l i { width: 8px; height: 8px; border-radius: 50%; }
.pr-in { display: inline-flex; align-items: center; gap: 4px; }
.pr-in input { width: 64px; text-align: right; }
@media (max-width: 720px) {
  .kq-b { height: 40px; }
  .kq-b .i { width: 18px; height: 18px; }
  .kq-row { grid-template-columns: 1fr; }
}
@media (hover: none) { .kq-b { height: 40px; } }
.ksum { flex-wrap: wrap; row-gap: 2px; }
.ksum > span { white-space: nowrap; }
.st-flag { color: var(--muted); font-weight: 400; }
.kc-flag { color: #9a5b00; }
.ov-flag { margin-left: 8px; font: 500 12px/1 var(--f-ui); color: #9a5b00; background: #fff6e5; border-radius: 999px; padding: 4px 8px; vertical-align: middle; }
.na-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.na-acts form { margin: 0; }
@media (max-width: 720px) { .na-acts { justify-content: stretch; } .na-acts > *, .na-acts .na-btn { flex: 1 1 100%; } }

/* ───────────── Karta klienta: nagłówek → szybkie akcje → przyklejone zakładki → treść ───────────── */
.dh2-top { align-items: baseline; }
.dh2-name { min-width: 0; }
.dh2-nr { margin-left: auto; font: 500 12px/1 var(--f-ui); color: var(--faint); white-space: nowrap; }
.dh2-addr { min-width: 0; max-width: 100%; align-items: flex-start !important; }
.dh2-addr > span { overflow-wrap: anywhere; }
.dh2-addr .i { margin-top: 2px; }
.tabs-sticky { margin: 2px 0 0; }
.tabs-sticky a { padding: 11px 13px; }
.qa-row { margin-bottom: 4px; }
.rt-tile { min-height: 64px; padding: 7px 12px; }
.rt-tile strong { padding-top: 2px; font-size: 15px; line-height: 1.15; }
.rt-tile span { margin-top: 1px; font-size: 11px; line-height: 1.2; }
.rt-ic { width: 15px; height: 15px; }
.rt-cov { flex-direction: row; align-items: center; gap: 10px; }
.rt-cov img { flex: none; width: 92px; height: 48px; object-fit: contain; }
.rt-cov-t { display: flex; flex-direction: column; min-width: 0; }
.rt-cov-t strong { margin-top: 0; padding-top: 0; font-size: 14px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 720px) {
  .rt-cov img { width: 72px; height: 40px; }
  .dh2-nr { margin-left: 0; }
}
/* Następne działanie: jeden główny (czerwony) przycisk, pozostałe neutralne */
.na-acts .btn.na-btn:not(.btn-primary) { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.na-acts .btn.na-btn:not(.btn-primary):hover { background: #f6f7f9; border-color: #cfd5de; }
.na-acts .btn.na-btn:not(.btn-primary) .i { color: var(--muted); }
/* Kafel pokrycia szerszy — pełna nazwa (np. „Blacha · Blachodachówka duża fala”) bez ucinania */
.rt { grid-template-columns: 1fr 1fr 1fr 1.45fr; }
@media (max-width: 720px) {
  .rt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rt-cov { gap: 6px; padding: 7px 8px 7px 10px; }
  .rt-cov img { width: 46px; height: 28px; }
  .rt-cov-t strong { font-size: 12px; -webkit-line-clamp: 3; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
  .na-acts form, .na-acts form .btn { width: 100%; }
}

/* ───────────── Karta klienta: stały nagłówek (nazwisko, etap, adres, 6 akcji, zakładki) ─────────────
   Nagłówek ma stałą wysokość — nic się w nim nie zmienia podczas przewijania (bez skakania na iPhonie).
   Numer, „czeka na pomiar” i link do kontaktu są w wierszu nad nim i po prostu odjeżdżają w górę. */
.dh-pre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-bottom: 10px; }
.dh-pre .back-link { margin: 0; }
.dh-pre-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.dh-pre-meta .dh2-nr { margin: 0; }
.dh-pre-meta > span, .dh-pre-meta > a { display: inline-flex; align-items: center; gap: 5px; }
.dh-pre-meta .i { color: var(--muted); flex: none; }
.dh-sticky { position: sticky; top: var(--top-h); z-index: 30; background: var(--bg); margin: 0 -32px 16px; padding: 8px 32px 0; border-bottom: 1px solid var(--line); }
.dh-sticky .dh2 { margin-bottom: 8px; gap: 4px; }
.dh-sticky .dh2-addr > span { overflow-wrap: break-word; }
.dh-sticky .tabs { border-bottom: 0; margin: 0; overscroll-behavior-x: contain; }
.dh-sticky .tabs a { margin-bottom: 0; }
.dh-spacer { height: 0; scroll-margin-top: var(--top-h); }
.qa-row { justify-content: flex-start; gap: 6px; }
@media (min-width: 721px) { .dh-sticky .qa-row { margin-bottom: 2px; } }
@media (max-width: 720px) {
  .dh-pre { margin-bottom: 8px; }
  .dh-pre-meta { width: 100%; }
  .dh-pre-meta .dh2-contact { margin-left: auto; }
  .dh-sticky { margin: 0 -16px 14px; padding: 6px 16px 0; }
  .dh-sticky .dh2 { margin-bottom: 6px; }
  .dh-sticky .dh2-name { font-size: 19px; }
  .qa-row { justify-content: space-between; gap: 0; margin: 0 -4px 2px; }
}
/* etykiety-przyciski: tekst w środku (ogólna reguła dla <label> układa zawartość w kolumnie) */
.dk-pill { flex-direction: row; justify-content: center; }
#zakladki:focus, #zakladki:target, #karta:target, #tresc:target { outline: none; }

/* ───────────── Zdjęcia: Przegląd, Historia, galeria, podgląd pełnoekranowy ───────────── */
.rp { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgb(23 32 54 / 4%); }
.rp .rn-head { margin-bottom: 10px; }
.rp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 520px; }
.rp-item, .tl-ph, .gal-item { display: block; overflow: hidden; border-radius: 12px; background: var(--nk-soft, #eef1f5); }
.rp-item img, .tl-ph img, .gal-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rp-item { aspect-ratio: 4 / 3; }
.tl-photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.tl-ph { width: 120px; height: 90px; border-radius: 10px; }
.tl-ph-none { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); margin: 4px 0; }
.gal-sec + .gal-sec { margin-top: 14px; }
.gal-h { margin: 0 0 8px; font: 600 13px/1.2 var(--f-ui); color: var(--ink-2); }
.gal-item { aspect-ratio: 1; }
.ph-broken { display: grid; place-items: center; color: var(--muted); font: 500 11px/1.2 var(--f-ui); text-align: center; padding: 4px; }
.ph-broken img { display: none; }
.timeline > li { scroll-margin-top: calc(var(--top-h) + var(--dh-h, 180px) + 12px); }
.timeline > li:target { background: #fff7e6; border-radius: 12px; box-shadow: 0 0 0 6px #fff7e6; }
@media (max-width: 720px) {
  .rp { padding: 12px; }
  .rp-grid { gap: 6px; max-width: none; }
  .tl-ph { width: 104px; height: 78px; }
}
.lb { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(10 16 28 / 96%); color: #fff; overflow: hidden; }
.lb::backdrop { background: rgb(10 16 28 / 96%); }
.lb[open] { display: block; }
.lb-top { position: absolute; z-index: 2; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--safe-t)) max(10px, var(--safe-r)) 8px max(14px, var(--safe-l)); background: linear-gradient(rgb(10 16 28 / 85%), transparent); }
.lb-count { font-size: 13px; opacity: .8; flex: none; }
.lb-cap { flex: 1; min-width: 0; font-size: 13px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgb(255 255 255 / 10%); color: #fff; cursor: pointer; flex: none; }
.lb-btn:hover { background: rgb(255 255 255 / 18%); }
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: calc(64px + var(--safe-t)) 8px calc(16px + var(--safe-b)); touch-action: none; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center; transition: transform .15s ease; cursor: zoom-in; }
.lb-img.is-zoomed { cursor: grab; transition: none; }
.lb-err { max-width: 320px; text-align: center; font-size: 14px; opacity: .9; }
.lb-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 64px; border: 0; border-radius: 12px; background: rgb(255 255 255 / 10%); color: #fff; cursor: pointer; }
.lb-prev { left: max(8px, var(--safe-l)); }
.lb-next { right: max(8px, var(--safe-r)); }
.lb-nav[hidden] { display: none; }
@media (max-width: 720px) { .lb-nav { width: 40px; height: 52px; background: rgb(255 255 255 / 8%); } }
.gal-fig { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.gal-kind select { width: 100%; height: 28px; padding: 0 6px; font-size: 12px; border-radius: 8px; }
.gal .mf-photos { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }

/* ───────────── KOLORDACH AI ───────────── */
.ai-page { --navy: #172036; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100dvh - var(--top-h) - 90px); }
.ai-hero { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.ai-hero h1 { margin: 0; font: 700 22px/1.15 var(--f-display); color: var(--navy); letter-spacing: -0.01em; }
.ai-hero p { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }
.ai-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--navy); color: #fff; flex: none; }
.ai-logo .i { width: 22px; height: 22px; color: #ff6b6b; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ai-q { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 8px 13px; font: 500 13.5px/1.25 var(--f-ui); cursor: pointer; text-align: left; }
.ai-q:hover { border-color: #f1b4b5; background: #fff8f8; }
.ai-q:disabled { opacity: .55; cursor: default; }
.ai-thread { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ai-msg { max-width: 100%; }
.ai-user { align-self: flex-end; max-width: 85%; background: var(--navy); color: #fff; padding: 9px 13px; border-radius: 16px 16px 4px 16px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-bot { align-self: stretch; display: flex; flex-direction: column; gap: 10px; }
.ai-wait { color: var(--muted); font-size: 14px; padding: 4px 2px; }
.ai-wait::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #e5393b; animation: ai-pulse 1s ease-in-out infinite; vertical-align: middle; }
@keyframes ai-pulse { 50% { opacity: .25; } }
.ai-error { color: #b42318; background: #fdeeee; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.ai-answer { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.ai-answer p { margin: 0 0 6px; } .ai-answer p:last-child { margin-bottom: 0; }
.ai-answer ul { margin: 2px 0 6px; padding-left: 18px; } .ai-answer li { margin: 2px 0; }
.ai-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 12px; }
.ai-card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 6px; }
.ai-card-h h3 { margin: 0; font: 600 14.5px/1.3 var(--f-ui); color: var(--navy); display: inline-flex; align-items: center; gap: 6px; flex: 1 1 auto; }
.ai-warn { border-color: #f7c9a0; background: #fffaf3; }
.ai-warn h3 .i { color: #c2410c; }
.ai-period { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.ai-sub { font-size: 12px; color: var(--muted); }
.ai-list { list-style: none; margin: 0; padding: 0; }
.ai-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line-soft, #eef1f5); }
.ai-row:first-child { border-top: 0; padding-top: 2px; }
.ai-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ai-client { font-weight: 600; color: var(--navy); }
.ai-client:hover { color: #cf2f31; }
.ai-val { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.ai-meta { font-size: 12.5px; color: var(--muted); }
.ai-why { margin: 2px 0 0; padding-left: 16px; font-size: 13.5px; color: var(--ink); }
.ai-next { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.ai-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ai-act { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: 500 12.5px/1 var(--f-ui); }
.ai-act:hover { border-color: #f1b4b5; }
.ai-prio { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font: 600 11px/1 var(--f-ui); }
.ai-prio-pilne { background: #fdeeee; color: #cf2f31; }
.ai-prio-wazne { background: #fff4e5; color: #b45309; }
.ai-prio-obserwacja { background: #eef1f6; color: #4b5563; }
.ai-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ai-stat { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: #f6f7f9; }
.ai-stat-l { font-size: 12px; color: var(--ink-2); }
.ai-stat-v { font: 600 16px/1.2 var(--f-ui); color: var(--navy); }
.ai-stat-n { font-size: 11.5px; color: var(--muted); }
.ai-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.ai-table th, .ai-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line-soft, #eef1f5); }
.ai-table th { font-weight: 500; color: var(--muted); font-size: 12px; }
.ai-small { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); }
.ai-empty { margin: 2px 0; font-size: 13.5px; color: var(--muted); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #f6f7f9; font-size: 12.5px; color: var(--ink-2); }
.ai-chip b { color: var(--navy); }
.ai-chip.is-zero { opacity: .55; }
.ai-entry-t { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-src { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; color: #2f6bd8; width: fit-content; }
.ai-input { position: sticky; bottom: var(--kb, 0px); z-index: 20; display: flex; align-items: flex-end; gap: 8px; margin: 14px -4px 0; padding: 8px 4px calc(8px + var(--safe-b)); background: var(--bg); }
.kb-open .ai-input { padding-bottom: 8px; }
.ai-input textarea { flex: 1; min-height: 46px; max-height: 140px; resize: none; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font: 400 16px/1.35 var(--f-ui); }
.ai-input textarea:focus { outline: none; border-color: var(--navy); }
.ai-send { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; border: 0; background: #e5393b; color: #fff; cursor: pointer; flex: none; }
.ai-send:disabled { background: #c9ced6; cursor: default; }
.ai-foot { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
@media (max-width: 720px) {
  .ai-page { min-height: calc(100dvh - var(--top-h) - 60px); }
  .ai-hero h1 { font-size: 20px; }
  .ai-quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; }
  .ai-quick::-webkit-scrollbar { display: none; }
  .ai-q { flex: none; max-width: 260px; white-space: normal; }
  .ai-card { padding: 10px 12px; }
  .ai-stats { grid-template-columns: 1fr 1fr; }
  .ai-input { margin: 10px -16px 0; padding: 8px 12px calc(8px + var(--safe-b)); border-top: 1px solid var(--line); }
  .main:has(.ai-page) { padding-bottom: 0; }
}
/* „Podsumuj historię AI” na karcie */
.ai-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-sum-out { margin-bottom: 10px; }
.ai-sum-out.is-error { color: #b42318; background: #fdeeee; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
@media (max-width: 720px) {
  .ai-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .ai-act { justify-content: center; padding: 0 4px; font-size: 12px; gap: 3px; white-space: nowrap; overflow: hidden; }
  .ai-act .i { width: 14px; height: 14px; flex: none; }
  .ai-next .t-muted { display: block; width: 100%; }
}

/* ───────────── Historia: zwarta, grupowana po dniach, z filtrami ───────────── */
.hist { padding-top: 12px; }
.hist-f { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.hf { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font: 500 12.5px/1 var(--f-ui); cursor: pointer; }
.hf.on { background: #172036; border-color: #172036; color: #fff; }
.hf:disabled { opacity: .45; cursor: default; }
.hf-n { font-size: 11px; opacity: .7; }
.hist-day + .hist-day { margin-top: 6px; }
.hist-dh { position: relative; margin: 8px 0 2px; font: 600 11.5px/1.2 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hist-list { list-style: none; margin: 0; padding: 0; }
.hi { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: calc(var(--top-h) + var(--dh-h, 180px) + 12px); }
.hist-list > .hi:first-child { border-top: 0; }
.hi:target { background: #fff7e6; border-radius: 10px; box-shadow: 0 0 0 6px #fff7e6; }
.hi-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: #f2f4f7; color: var(--ink-2); flex: none; margin-top: 1px; }
.hi[data-cat="notatki"] .hi-ic { background: #fff4e5; color: #b45309; }
.hi[data-cat="zdjecia"] .hi-ic { background: #f4f1fe; color: #6d4ce0; }
.hi[data-cat="oferty"] .hi-ic { background: #edf3fd; color: #2f6bd8; }
.hi[data-cat="kontakty"] .hi-ic { background: #eaf7f0; color: #1f9d5c; }
.hi[data-cat="etapy"] .hi-ic { background: #fdeeee; color: #cf2f31; }
.hi-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hi-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.hi-t { font-size: 14px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; flex: 1 1 260px; }
.hi-m { font-size: 12px; color: var(--muted); white-space: nowrap; }
.hi-note { margin: 2px 0 0; padding: 7px 10px; border-radius: 8px; background: var(--bg); font-size: 13.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hi-note.open { display: block; -webkit-line-clamp: unset; }
.hi-rep summary { font-size: 12.5px; color: #2f6bd8; cursor: pointer; width: fit-content; }
.hi-rep ul { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); }
.hi .tl-photos { margin: 4px 0 2px; }
.hi .note-revs, .hi .note-edit { margin-top: 2px; }
@media (max-width: 720px) {
  .hist-f { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 6px; padding: 0 12px; }
  .hist-f::-webkit-scrollbar { display: none; }
  .hf { flex: none; }
  .hi-m { white-space: normal; }
}

/* Etap w nagłówku — kliknij, aby zmienić */
.stg { position: relative; display: inline-block; }
.stg-btn { list-style: none; display: inline-flex; align-items: center; gap: 2px; cursor: pointer; border-radius: 999px; padding: 2px 4px 2px 0; }
.stg-btn::-webkit-details-marker { display: none; }
.stg-btn:hover .status, .stg[open] .stg-btn .status { text-decoration: underline; text-underline-offset: 3px; }
.stg-btn > .i { color: var(--muted); }
.stg-menu { position: absolute; z-index: 45; top: calc(100% + 6px); left: 0; width: 290px; max-height: min(420px, 60vh); overflow: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; }
.stg-h { margin: 2px 6px 6px; font-size: 11.5px; color: var(--muted); }
.stg-menu ul { list-style: none; margin: 0; padding: 0; }
.stg-opt { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; font: 500 13.5px/1.2 var(--f-ui); color: var(--ink); cursor: pointer; }
.stg-opt.sub { padding-left: 26px; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.stg-opt:hover { background: #f4f5f7; }
.stg-opt.on { color: #cf2f31; }
.stg-opt .i, .stg-sp { width: 14px; flex: none; }
@media (max-width: 720px) { .stg-menu { position: fixed; left: 16px; right: 16px; top: auto; width: auto; margin-top: 6px; } }
.rn-tag-text { background: #f1f4f8; color: #5e6b82; }
a.rn-tag-m:hover { text-decoration: underline; }
.gal-f { margin-bottom: 10px; }
.hi-d { font-size: 12px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
@media (max-width: 720px) { .hi .tl-ph { width: 88px; height: 66px; } }

/* ───────────── Podsumowanie AI (4 sekcje) i fakty klienta ───────────── */
.sm { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.sm-sec { display: flex; flex-direction: column; gap: 6px; }
.sm-h { margin: 0; display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1.2 var(--f-ui); letter-spacing: .06em; text-transform: uppercase; color: #cf2f31; }
.sm-p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink); }
.sm-note { margin: 0; font-size: 11.5px; color: var(--muted); }
.sm-ok { color: var(--ink-2); }
.sm-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sm-tile { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 10px; background: #f6f7f9; min-width: 0; }
.sm-tl { font-size: 11.5px; color: var(--ink-2); }
.sm-tv { font: 600 14.5px/1.25 var(--f-ui); color: #172036; overflow-wrap: anywhere; }
.sm-tv.is-empty { color: var(--muted); font-weight: 500; }
.sm-tn { font-size: 11.5px; color: var(--muted); }
.sm-warn { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.sm-warn li { position: relative; padding: 7px 10px 7px 26px; border-radius: 10px; background: #fff7f0; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
.sm-warn li::before { content: ""; position: absolute; left: 11px; top: 13px; width: 6px; height: 6px; border-radius: 50%; background: #e5393b; }
.sm-warn a { color: inherit; text-decoration: underline; text-decoration-color: #f1b4b5; text-underline-offset: 2px; }
.sm-do { padding: 9px 11px; border-radius: 10px; background: #fdf4f4; }
.sm-srcs { display: flex; flex-direction: column; gap: 3px; }
.sm-src { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: #2f6bd8; width: fit-content; }
.sm-src.is-plain { color: var(--ink-2); }
.sm-more summary { font-size: 13px; color: #2f6bd8; cursor: pointer; width: fit-content; }
.sm-more[open] summary { margin-bottom: 6px; }
.sm-table { margin-top: 4px; }
.sm-facts { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.sm-facts li { margin: 2px 0; }
.sm-factlist { display: flex; flex-direction: column; }
.sm-fact { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.sm-fact:first-child { border-top: 0; }
.sm-fact > span { color: var(--ink-2); }
.sm-fact > b, .sm-fact > a, .sm-fact > em { text-align: right; }
.sm-fact > em { color: var(--muted); font-style: normal; }
.ai-h { font-weight: 600; margin-top: 4px !important; }
@media (max-width: 720px) {
  .sm { padding: 12px; }
  .sm-tiles { grid-template-columns: 1fr 1fr; }
  .sm-table { display: block; overflow-x: auto; white-space: nowrap; }
  .sm-fact { flex-direction: column; gap: 1px; }
  .sm-fact > b, .sm-fact > a, .sm-fact > em { text-align: left; }
}
/* Historia — dopracowanie (1.11): zwarte wpisy, 3 linie transkrypcji, szczegóły rozwijane */
.hi { gap: 8px; padding: 5px 0; }
.hi-ic { width: 22px; height: 22px; border-radius: 7px; }
.hi-t { font-size: 13.5px; line-height: 1.35; }
.hi-m { font-size: 11.5px; }
.hi-b { gap: 1px; }
.hi-note { -webkit-line-clamp: 3; padding: 6px 9px; margin-top: 3px; font-size: 13.5px; }
.hi-d { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hi-d.open { display: block; }
.hi .rn-more { width: fit-content; }
.hist-dh { margin: 6px 0 0; }
.hf { white-space: nowrap; flex: none; }
.hist-f { flex-wrap: wrap; }
@media (max-width: 720px) { .hist-f { flex-wrap: nowrap; } }

/* Nowe zapytanie — „Kto pozyskał klienta?” (kompaktowy wybór kilku osób) */
.nk-acq { margin-top: 10px; }
.nk-acq-sum { list-style: none; cursor: pointer; }
.nk-acq-sum::-webkit-details-marker { display: none; }
.nk-acq-val { font: 500 15px/1.3 var(--f-ui); color: var(--nk-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nk-acq.has-value .nk-acq-val { color: var(--nk-ink); }
.nk-acq-chev { color: var(--nk-muted); flex: none; transition: transform .15s; }
.nk-acq[open] .nk-acq-chev { transform: rotate(180deg); }
.nk-acq-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 2px 2px; }
.nk-acq-opt { position: relative; display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px !important; min-height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--nk-soft, #f1f4f8); border: 1px solid transparent; font: 500 14px/1 var(--f-ui) !important; color: var(--nk-ink-2); cursor: pointer; margin: 0; }
.nk-acq-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nk-acq-opt:has(input:checked) { background: var(--nk-red-50); color: var(--nk-red-600); border-color: var(--nk-red-100); }
.nk-acq-opt:has(input:focus-visible) { outline: 2px solid var(--nk-red); outline-offset: 1px; }
.nk-acq-opt em { font-style: normal; font-weight: 400; opacity: .75; }
.nk-acq-hint { width: 100%; margin: 2px 0 0; font-size: 12px; color: var(--nk-muted); }
.pm-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.pm-people { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pm-people legend { font: 500 var(--fs-sm)/1.3 var(--f-ui); color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.pm-people .dk-pill { background: #f1f4f8; color: #3d4a63; height: 36px; }
.pm-people .dk-pill:has(input:checked) { background: #fdeeee; color: #cf2f31; border-color: #fbdcdc; }
.pm-people .dk-pill:has(input:focus-visible) { outline: 2px solid #e5393b; outline-offset: 1px; }
.na-none strong { color: var(--ink-2); }
.na-add { flex: none; }
.na-task { display: flex; align-items: center; gap: 5px; margin: 8px 0 0; width: 100%; color: var(--ink-2); }
.hi-lines { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.hi-anchor { display: block; height: 0; }

/* ───────────── Dane klienta — 3 zwarte sekcje ───────────── */
.dk2 .dk-sec { padding: 12px 16px; }
.dk2-list { display: flex; flex-direction: column; }
.dk2-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.dk2-row:first-child { border-top: 0; }
.dk2-l { color: var(--muted); font-size: 13px; }
.dk2-v { color: var(--ink); overflow-wrap: anywhere; position: relative; }
.dk2-v a { color: #2f6bd8; }
.dk2-miss { color: var(--muted); }
.dk2-add { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; }
.dk2-pend { font-size: 12px; color: #b45309; }
.dk2-addr { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.dk2-addr strong { font-weight: 600; font-size: 15px; color: var(--ink); }
.dk2-sub { font-size: 12.5px; color: var(--muted); margin: 0; }
.dk2-oh { margin-top: 8px; }
.dk2-others { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.dk2-others a { color: #2f6bd8; }
.dk2-ed { display: inline-block; margin-left: 6px; vertical-align: middle; }
.dk2-pen { list-style: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: var(--muted); cursor: pointer; }
.dk2-pen::-webkit-details-marker { display: none; }
.dk2-pen:hover, .dk2-ed[open] .dk2-pen { background: #f2f4f7; color: var(--ink); }
.dk2-panel { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.dk2-ed[open] { display: block; margin: 6px 0 0; }
.dk2-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.dk2-opt { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px !important; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font: 500 13px/1 var(--f-ui) !important; color: var(--ink-2); cursor: pointer; }
.dk2-opt input { width: 15px; height: 15px; margin: 0; accent-color: #e5393b; }
.dk2-opt:has(input:checked) { border-color: #f1b4b5; background: #fdf4f4; color: #cf2f31; }
.dk2-acts { display: flex; justify-content: flex-end; gap: 6px; }
.dk2-claim { display: inline; margin-left: 8px; }
.dk2-link { border: 0; background: none; padding: 0; color: #2f6bd8; font: 500 12.5px/1 var(--f-ui); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
@media (max-width: 720px) {
  .dk2 .dk-sec { padding: 12px; }
  .dk2-row { grid-template-columns: 1fr; gap: 1px; padding: 6px 0; }
}
a.rt-tile.rt-link { text-decoration: none; transition: filter .12s; }
a.rt-tile.rt-link:hover { filter: brightness(1.12); }
a.rt-tile.rt-link:focus-visible { outline: 2px solid #ff6a59; outline-offset: 2px; }

/* ── Moduł Marketing (tylko właściciel) — wyłącznie zmienne motywu, bez cieni i gradientów ── */
.mk-tabs { margin-bottom: 14px; }
.mk-filters .mk-date { flex-direction: row; align-items: center; gap: 6px; font: 500 var(--fs-sm)/1 var(--f-ui); color: var(--muted); }
.mk-filters .mk-date input { width: auto; min-height: 36px; padding: 6px 8px; font-size: var(--fs-sm); }
.mk-period { display: block; margin: -4px 0 16px; font-size: var(--fs-sm); color: var(--muted); }
.mk-period .i { vertical-align: -2px; margin-right: 4px; }
.mk-period b { color: var(--ink-2); font-weight: 500; }
.mk-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.mk-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mk-tile-l { font-size: var(--fs-sm); color: var(--muted); line-height: 1.3; }
.mk-tile-v { font: 600 22px/1.15 var(--f-display); letter-spacing: -0.015em; color: var(--ink); overflow-wrap: anywhere; }
.mk-tile-n { font-size: var(--fs-xs); color: var(--muted); }
.mk-split { margin-bottom: 16px; }
.mk-panel { box-shadow: none; }
.mk-panel + .mk-panel, .mk-block + .mk-panel { margin-top: 16px; }
.mk-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mk-h .t-h3 { margin: 0; }
.mk-block { margin-bottom: 16px; }
.mk-block > .t-h3 { margin: 0 0 10px; }
.mk-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); font: 500 var(--fs-xs)/1 var(--f-ui); color: var(--muted); white-space: nowrap; }
.mk-badge-on { color: var(--ok); border-color: currentColor; }
.mk-off { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--bg); color: var(--ink-2); margin-bottom: 12px; }
.mk-off .i { width: 20px; height: 20px; flex: none; color: var(--muted); margin-top: 1px; }
.mk-off b { display: block; font-weight: 600; color: var(--ink); }
.mk-off p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.mk-inactive .t-h3 { color: var(--muted); }
.mk-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mk-bar { display: grid; grid-template-columns: minmax(110px, 36%) 1fr 92px; align-items: center; gap: 10px; font-size: var(--fs-sm); }
.mk-bar-l { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-bar-track { height: 10px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.mk-bar-track span { display: block; height: 100%; background: var(--nav); border-radius: 0 4px 4px 0; }
.mk-bar-v { color: var(--ink); font-weight: 600; white-space: nowrap; text-align: right; }
.mk-bar-v small { font-weight: 400; color: var(--muted); }
.mk-kv { list-style: none; margin: 0; padding: 0; }
.mk-kv li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); color: var(--ink-2); }
.mk-kv li:last-child { border-bottom: 0; }
.mk-note { margin: 10px 0 0; font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.mk-note .i { flex: none; margin-top: 2px; }
.mk-empty { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.mk-list { margin: 6px 0 0; padding-left: 20px; font-size: var(--fs-sm); color: var(--ink-2); display: flex; flex-direction: column; gap: 5px; }
.mk-table .table td, .mk-table .table th { padding: 10px 8px; }
.mk-table .table td { font-size: var(--fs-sm); }
.mk-table .table td:first-child, .mk-table .table th:first-child { padding-left: 14px; }
.mk-table .table th { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.mk-table .mk-name { white-space: nowrap; font-weight: 500; }
.mk-table td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mk-table .mk-total td { font-weight: 600; background: var(--bg); }
.mk-miss { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; }
.mk-defs { margin-top: 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.mk-defs summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.mk-defs ul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
@media (max-width: 1100px) { .mk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .mk-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mk-tile { padding: 12px; }
  .mk-tile-v { font-size: 19px; }
  .mk-split { grid-template-columns: minmax(0, 1fr); }
  .mk-filters > select, .mk-filters .mk-date { flex: 1 1 calc(50% - 8px); }
  .mk-filters > select { width: 100%; }
  .mk-filters .mk-date input { flex: 1; min-width: 0; }
  .mk-bar { grid-template-columns: minmax(90px, 38%) 1fr 78px; }
  .table-card.mk-table { display: block; -webkit-overflow-scrolling: touch; }
  .mk-table .table th { min-width: 76px; }
  .mk-table .table th:first-child, .mk-table .mk-name { position: sticky; left: 0; background: var(--surface); z-index: 1; }
  .mk-table .table th:first-child { background: #fbfbfc; }
  .mk-table .mk-name { white-space: normal; min-width: 108px; max-width: 120px; line-height: 1.3; border-right: 1px solid var(--line-soft); }
  .mk-table .mk-total .mk-name { background: var(--bg); }
  .mk-filters .mk-date { flex: 1 1 100%; }
}

/* ── Formularz pomiaru (1.11): dwa tryby usługi, kompaktowe pastylki, 2 kafle powierzchni, numeracja sekcji licznikiem ── */
.mf-main { counter-reset: mfsec; }
.mf-sec:not([hidden]) { counter-increment: mfsec; }
.mf-n::before { content: counter(mfsec); }
.mf-sec[hidden] { display: none; }
.mf-h-hint { flex: 0 1 auto; min-width: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.mf-h-hint:empty { display: none; }
.mf-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--nk-muted); }
.mf-svc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mf .mf-svc-btn { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px; height: 46px; margin: 0; border-radius: 14px;
  border: 1px solid var(--nk-line); background: #fff; color: var(--nk-ink-2); font: 600 15px/1 var(--f-ui); cursor: pointer; }
.mf-svc-btn input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mf-svc-btn .i { width: 18px; height: 18px; color: var(--nk-muted); }
.mf .mf-svc-btn:has(input:checked) { border-color: var(--nk-red); background: var(--nk-red-50); color: var(--nk-red-600); box-shadow: inset 0 0 0 1px var(--nk-red); }
.mf-svc-btn:has(input:checked) .i { color: var(--nk-red); }
.mf-svc-btn:has(input:focus-visible) { outline: 2px solid var(--nk-red); outline-offset: 2px; }
/* kompaktowe pastylki: szerokość wg treści (bez rozciągania „Nie wiadomo” na cały wiersz), wygodna wysokość dotykowa */
.mf .mf-pills { gap: 6px; }
.mf .pill { flex: 0 0 auto; height: 36px; padding: 0 13px; font-size: 13.5px; }
.mf .pill:has(input:checked) { box-shadow: inset 0 0 0 1px var(--nk-red-100); font-weight: 600; }
.mf-inline { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.mf-inline > .mf-field { flex: 0 1 auto; }
.mf-inline > .mf-pv { flex: 1 1 200px; }
.mf-wave { display: flex; flex-direction: column; gap: 4px; }
.mf-wave[hidden] { display: none; }
.mf-wave-note { font-size: 12px; }
.mf-warn { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 12px; background: #fff7ed; color: #9a3412; font-size: 13px; }
.mf-warn .i { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.mf-warn[hidden] { display: none; }
.mf-areas { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.mf-areas[hidden] { display: none; }
.mf-areas > div { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 12px; background: var(--nk-soft); }
.mf-areas span { font-size: 12px; color: var(--nk-muted); }
.mf-areas strong { font: 600 17px/1.2 var(--f-display); font-variant-numeric: tabular-nums; color: var(--nk-ink); }
.mf-areas .mf-areas-main { background: var(--nk-green-50); }
.mf-areas .mf-areas-main strong { color: var(--nk-green); }
.mf-areas-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; color: var(--nk-muted); }
.mf-areas-note:empty { display: none; }
.mf-ease { padding: 8px 12px; }
.mf-ease-scale { font-size: 11.5px; }
.mf-add-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.mf-kind { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--nk-line); background: #fff;
  color: var(--nk-ink-2); font: 500 13px/1 var(--f-ui); cursor: pointer; }
.mf-kind:hover { background: var(--nk-soft); }
.mf-kind .i { width: 13px; height: 13px; color: var(--nk-red); }
.mf-extras[hidden], .mf-pv[hidden] { display: none; }
.mf-summary { box-shadow: none; padding: 12px; background: var(--nk-soft); border: 0; }
.mf-sum-list div[hidden] { display: none; }
.mf-gross strong { font-size: 26px; }
.mf { padding-bottom: calc(96px + var(--safe-b)); }
@media (max-width: 720px) {
  .mf-h { flex-wrap: wrap; row-gap: 2px; }
  .mf-h-hint { display: block; order: 5; flex: 1 0 100%; max-width: none; padding-left: 57px; text-align: left; font-size: 12px; white-space: nowrap; }
  .mf .mf-row { grid-template-columns: minmax(0, 1fr); }
  .mf-areas strong { font-size: 16px; }
  .mf-inline > .mf-field { flex: 1 1 100%; }
}

/* ── Pomiar: termin wykonania (data + godzina) — jeden kompaktowy panel pod nagłówkiem „Dane pomiaru” ── */
.mf-when { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 9px; border-radius: 12px;
  background: #f1f5fa; border: 1px solid #dde5ef; }
.mf-when-t { margin: 0; font: 500 11.5px/1.2 var(--f-ui); color: #5b6b82; letter-spacing: .02em; }
.mf-when-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 8px; }
.mf-when-f { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; height: 40px; padding: 0 10px; border-radius: 9px;
  background: var(--surface); border: 1px solid #dde5ef; cursor: text; }
.mf-when-f:focus-within { border-color: var(--nk-red); box-shadow: 0 0 0 3px rgb(217 52 37 / 12%); }
.mf-when-f .i { width: 16px; height: 16px; flex: none; color: #4f6b8f; }
.mf-when-f input { flex: 1 1 auto; min-width: 0; width: 100%; height: 24px; min-height: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font: 600 15px/1.2 var(--f-ui); color: var(--nk-ink); font-variant-numeric: tabular-nums; -webkit-appearance: none; appearance: none; text-align: left; }
.mf-when-f input:focus { outline: none; box-shadow: none; border: 0; }
.mf-when-f input::-webkit-calendar-picker-indicator { display: none; }
.mf-when-f input::-webkit-date-and-time-value { text-align: left; margin: 0; }
.mf-when-plan { margin: 0; font-size: 11.5px; color: #6b7a90; }
@media (min-width: 720px) { .mf-when-row { grid-template-columns: 220px 150px; } }

/* uczestnicy: pracownicy z bazy (także sezonowo nieaktywni) + osoby bez konta */
.mf-people .pill { flex: 0 1 auto; }
.mf-people .pill.is-off:not(:has(input:checked)) { color: var(--nk-muted); }
.mf-guest { gap: 4px; padding: 0 4px 0 12px; background: var(--nk-red-50); color: var(--nk-red-600); box-shadow: inset 0 0 0 1px var(--nk-red-100); cursor: default; }
.mf-guest-x { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none;
  color: inherit; font: 500 18px/1 var(--f-ui); cursor: pointer; }
.mf-guest-x:hover { background: rgb(217 52 37 / 10%); }
.mf-guest-x:focus-visible { outline: 2px solid var(--nk-red); outline-offset: 1px; }
.mf-guest-add { gap: 4px; border: 1px dashed #c6cfdc; background: transparent; color: var(--nk-ink-2); }
.mf-guest-add .i { width: 14px; height: 14px; }
.mf-guest-add:focus-visible { outline: 2px solid var(--nk-red); outline-offset: 2px; }
.mf-guest-dlg { display: none; }
.mf-guest-dlg[open] { display: flex; flex-direction: column; gap: 10px; }
.mf-guest-dlg-t { margin: 0; font: 600 16px/1.3 var(--f-display); color: var(--nk-ink); }
.mf-guest-dlg-s { margin: 0; font-size: 12.5px; color: var(--nk-muted); }
.mf-guest-dlg input { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--nk-line); font: 400 16px/1.2 var(--f-ui); color: var(--nk-ink); }
.mf-guest-dlg-err { margin: 0; font-size: 12.5px; color: var(--danger); }
.mf-guest-dlg-b { display: flex; justify-content: flex-end; gap: 8px; }

/* „Dach i powierzchnia”: trzy grupy rozdzielone cienką linią, bez dodatkowych kafli */
.mf-body > .cov { display: flex; flex-direction: column; gap: 10px; }
.mf-grp { display: flex; flex-direction: column; gap: 10px; }
.mf-grp + .mf-grp, .cov + .mf-grp { padding-top: 12px; border-top: 1px solid var(--nk-line); }
.mf-grp-t { display: flex; align-items: center; gap: 8px; margin: 0; font: 600 11.5px/1.2 var(--f-ui); color: #5b6b82; text-transform: uppercase; letter-spacing: .06em; }
.mf-grp-t::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: #c9d4e2; }
.mf-grp .cov-profiles { margin-bottom: 0; }

/* ocena łatwości: większy suwak, widoczna wartość, skala 1–5 z opisami, „Nie oceniono” bez automatycznej trójki */
.mf-ease { gap: 8px; padding: 10px 12px 8px; }
.mf-ease .mf-ease-out { padding: 3px 10px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--nk-line); font: 600 13px/1.3 var(--f-ui); color: var(--nk-ink); }
.mf-ease[data-unset] .mf-ease-out { color: var(--nk-muted); font-weight: 500; }
.mf-ease input[type=range] { height: 36px; margin: 0; touch-action: pan-y; cursor: pointer; }
.mf-ease input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; }
.mf-ease input[data-unset] { opacity: .4; }
.mf-ease-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 0; }
.mf-ease-step { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0 2px; border: 0; border-radius: 8px; background: none;
  color: var(--nk-muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mf-ease-step b { font: 600 13px/1.2 var(--f-ui); color: var(--nk-ink-2); font-variant-numeric: tabular-nums; }
.mf-ease-step span { font: 400 10.5px/1.2 var(--f-ui); text-align: center; }
.mf-ease-step.on b { color: var(--nk-red-600); }
.mf-ease-step.on span { color: var(--nk-ink-2); }

/* oferta: ostrzeżenie o zmianie pomiaru po przygotowaniu szkicu (audyt 01.11, E3) */
.flash-warn { background: #fffbeb; color: #8a4b08; border: 1px solid #fde4b0; }
.of-drift { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.of-drift > .i { flex: none; }
.of-drift > span { flex: 1 1 260px; }
.of-drift form { margin: 0; }

/* licznik na zakładce karty (np. Zadania) — własna klasa, bez kolizji z pastylkami wyboru (audyt 01.11, G1) */
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px;
  background: var(--red); color: #fff; font: 600 10.5px/1 var(--f-ui); font-variant-numeric: tabular-nums; }

/* ── Wybór usługi: ikony urządzeń (pistolet natryskowy / lanca z dyszą rotacyjną) — tylko wygląd ── */
.mf .mf-svc-btn { height: 64px; gap: 12px; padding: 0 14px; }
.mf-svc-ic { display: block; flex: none; object-fit: contain; }
.mf-svc-ic-lg { height: 44px; width: auto; }
.mf-svc-ic-sm { display: none; }
@media (max-width: 720px) {
  .mf .mf-svc { gap: 6px; }
  .mf .mf-svc-btn { height: 44px; gap: 8px; padding: 0 10px; border-radius: 999px; font-size: 14px; }
  .mf-svc-ic-lg { display: none; }
  .mf-svc-ic-sm { display: block; height: 22px; width: auto; }
}
