/* ClientLine 0.12.0. Design system of the DHIT family (SuppChat, ClientLine, Asistent): one neutral ramp
   and one accent, tone and spacing instead of boxes, colour only where it carries meaning (state,
   the primary action, a link). Contrast pairs measured against WCAG 2.2 (tests/test_contrast.php).
   Inter variable is served from this folder (SIL OFL, INTER-LICENSE.txt): no CDN, the CSP stays 'self'. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Colour tokens. This light block must stay the first root block of the file and the dark block below
   must keep its selector: tests/test_contrast.php reads both, and every colour is written as #rrggbb. */
:root {
  color-scheme: light dark;
  --bg: #f7f7f5; --surface: #ffffff; --surface-2: #f1f1ee; --surface-3: #e7e7e3;
  --fg: #18181b; --muted: #4b4b52; --line: #e3e3df; --line-strong: #cbcbc5; --field-line: #86868a; --placeholder: #6b6b70;
  --accent: #2f5bd3; --accent-fg: #ffffff; --accent-soft: #ebf0fc;
  --accent-fill: #2f5bd3; --accent-fill-fg: #ffffff; --accent-hover: #2549b0;
  --ok: #1b7340; --warn: #8a5a00; --danger: #b3261e; --danger-fg: #ffffff; --focus: #2f5bd3;
  --ok-bg: #e6f3eb; --warn-bg: #fbf0d9; --danger-bg: #fbeae8;
  --border-float: rgba(17, 17, 18, .09); --backdrop: rgba(17, 17, 18, .32);
  --shadow-pop: 0 8px 24px -6px rgba(17, 17, 18, .14), 0 2px 6px -2px rgba(17, 17, 18, .06);
  --shadow-modal: 0 24px 64px -12px rgba(17, 17, 18, .22), 0 2px 8px rgba(17, 17, 18, .06);
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b4b52' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10; --surface: #151517; --surface-2: #1c1c1f; --surface-3: #252529;
    --fg: #ececea; --muted: #a8a8ad; --line: #2a2a2e; --line-strong: #38383b; --field-line: #707078; --placeholder: #8a8a90;
    --accent: #93b1ff; --accent-fg: #0e1530; --accent-soft: #1b2442;
    --accent-fill: #3a64e0; --accent-fill-fg: #ffffff; --accent-hover: #2f57cf;
    --ok: #5cc98a; --warn: #e3b862; --danger: #ff8f86; --danger-fg: #1a0a0a; --focus: #93b1ff;
    --ok-bg: #14281d; --warn-bg: #2b2412; --danger-bg: #2e1716;
    --border-float: rgba(255, 255, 255, .09); --backdrop: rgba(0, 0, 0, .56);
    --shadow-pop: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px -6px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .4);
    --shadow-modal: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 64px -12px rgba(0, 0, 0, .7);
    --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a8ad' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}
/* The manual theme switch (assets/theme.js) sets data-theme on <html>. Same values as the block above;
   tests/test_contrast.php checks that the two dark blocks never drift apart. */
:root[data-theme="dark"] {
  --bg: #0e0e10; --surface: #151517; --surface-2: #1c1c1f; --surface-3: #252529;
  --fg: #ececea; --muted: #a8a8ad; --line: #2a2a2e; --line-strong: #38383b; --field-line: #707078; --placeholder: #8a8a90;
  --accent: #93b1ff; --accent-fg: #0e1530; --accent-soft: #1b2442;
  --accent-fill: #3a64e0; --accent-fill-fg: #ffffff; --accent-hover: #2f57cf;
  --ok: #5cc98a; --warn: #e3b862; --danger: #ff8f86; --danger-fg: #1a0a0a; --focus: #93b1ff;
  --ok-bg: #14281d; --warn-bg: #2b2412; --danger-bg: #2e1716;
  --border-float: rgba(255, 255, 255, .09); --backdrop: rgba(0, 0, 0, .56);
  --shadow-pop: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px -6px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .4);
  --shadow-modal: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 64px -12px rgba(0, 0, 0, .7);
  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a8ad' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
/* Type, space, size and motion scale (01_DESIGN_SYSTEM sections 2 to 4). */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-1: 12px; --fs-2: 13px; --fs-3: 14px; --fs-5: 15px; --fs-6: 16px; --fs-7: 20px; --fs-8: 24px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px; --sp-9: 48px;
  --r-xs: 4px; --r-s: 6px; --r-m: 8px; --r-l: 12px; --r-pill: 999px;
  --ctl-h-sm: 28px; --ctl-h: 32px; --ctl-h-lg: 40px;
  --row-h: 44px; --topbar-h: 48px; --sidebar-w: 232px;
  --dur-1: 120ms; --dur-2: 180ms; --dur-3: 240ms;
  --ease-out: cubic-bezier(.2, 0, 0, 1); --ease-in: cubic-bezier(.4, 0, 1, 1);
  /* older names, still used below */
  --r: var(--r-s); --s1: var(--sp-1); --s2: var(--sp-2); --s3: var(--sp-4); --s4: var(--sp-6); --s5: var(--sp-8);
  font: 14px/20px var(--font);
}
@media (pointer: coarse) { :root { --ctl-h: 40px; --ctl-h-sm: 36px; --row-h: 52px; } }
* { box-sizing: border-box; }
/* The hidden attribute must win over every display rule below (header.top, button.link, ...). */
[hidden] { display: none !important; }
.narrow-only { display: none; }
@media (max-width: 860px) { .narrow-only, header.top nav .narrow-only { display: inline-flex; } }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 8px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 var(--fs-3)/20px var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
:focus:not(:focus-visible) { outline: none; }
/* 0.14.3: Tab also stops on the calendar button inside a date field; focus is then inside the field, which keeps its ring */
input[type=date]:focus-within, input[type=datetime-local]:focus-within, input[type=time]:focus-within, input[type=month]:focus-within {
  outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
h1 { font-size: var(--fs-7); line-height: 28px; letter-spacing: -0.011em; margin: 0 0 var(--sp-4); font-weight: 600; }
h2 { font-size: var(--fs-6); line-height: 24px; margin: 0 0 var(--sp-2); font-weight: 600; }
h3 { font-size: var(--fs-3); line-height: 20px; margin: var(--sp-4) 0 var(--sp-1); font-weight: 600; }
h1:focus { outline: none; }
p { margin: 0 0 var(--sp-2); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-2); line-height: 18px; }
.error, .errline { color: var(--danger); }
.warnline { color: var(--warn); }
.smtp-down { overflow-wrap: anywhere; }   /* 0.17.0 (PC-15): a server name in the last error must not widen a phone screen */
.okline { color: var(--ok); }
.error:empty { display: none; }
/* 0.14.2 (CL-06): error boxes look like the AITent flash: tinted panel, edge line, icon */
.flash { position: relative; margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4) var(--sp-3) 40px; border-radius: var(--r-m);
  background: var(--surface-2); color: var(--fg); box-shadow: inset 2px 0 0 var(--muted); }
.flash::before { content: ""; position: absolute; left: var(--sp-4); top: 13px; width: 16px; height: 16px; background: var(--muted);
  -webkit-mask: var(--flash-icon) no-repeat center / contain; mask: var(--flash-icon) no-repeat center / contain;
  --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6.6'/%3E%3Cpath d='M8 4.6v4.2M8 11.2v.1'/%3E%3C/svg%3E"); }
.flash.err { background: var(--danger-bg); color: var(--fg); box-shadow: inset 2px 0 0 var(--danger); }
.flash.err::before { background: var(--danger); }
.brand-mark { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent-fill); color: var(--accent-fill-fg); font-size: 13px; line-height: 1; font-weight: 600; letter-spacing: 0; }
.auth-title { display: flex; align-items: center; gap: var(--sp-3); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: var(--s2) var(--s3); z-index: 50; }
.skip:focus { left: var(--s2); top: var(--s2); }

/* ===== shell ===== */
/* The element stays header.top (app.js, tests and the audit find it by that name); since 0.12.0 it is a
   left sidebar on wide screens and the familiar top bar with a scrolling navigation strip below 861 px. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { width: 16px; height: 16px; flex: none; }
body:has(> header.top:not([hidden])) {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 100vh;
}
body:has(> header.top:not([hidden])) > header.top { grid-column: 1; grid-row: 1 / span 2; }
body:has(> header.top:not([hidden])) > .demo-banner { grid-column: 2; grid-row: 1; }
body:has(> header.top:not([hidden])) > main { grid-column: 2; grid-row: 2; width: 100%; }
header.top { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; gap: 2px; align-self: start;
  height: 100vh; height: 100dvh; overflow-y: auto; padding: var(--sp-3) var(--sp-2); background: var(--bg); border-right: 1px solid var(--line); }
header.top .brand { display: flex; align-items: center; height: 36px; padding: 0 var(--sp-2); margin-bottom: var(--sp-2);
  font-size: var(--fs-6); line-height: 24px; font-weight: 600; letter-spacing: -0.011em; color: var(--fg); text-decoration: none; white-space: nowrap; }
header.top .brand .brand-logo { display: block; flex: none; max-height: 28px; max-width: 120px; width: auto; height: auto; margin-right: var(--sp-2); }
.auth .narrow .auth-logo { display: block; max-height: 48px; max-width: 200px; width: auto; height: auto; margin: 0 0 var(--sp-4); }
button.searchbtn { justify-content: flex-start; gap: var(--sp-2); width: 100%; margin-bottom: var(--sp-3); padding: 0 6px 0 var(--sp-2);
  background: var(--surface); color: var(--muted); border-color: var(--line); font-weight: 400; }
button.searchbtn:hover { background: var(--surface); border-color: var(--field-line); color: var(--fg); }
button.searchbtn kbd { margin-left: auto; }
kbd { display: inline-block; min-width: 18px; padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-xs);
  background: var(--surface-2); color: var(--muted); font: 500 11px/1.2 var(--font); text-align: center; }
header.top nav { display: grid; gap: 2px; }
header.top nav a, header.top .tools a, header.top .tools button.link {
  display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 var(--sp-2); border-radius: var(--r-s);
  color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
header.top nav a:hover, header.top .tools a:hover, header.top .tools button.link:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
header.top nav a[aria-current="page"], header.top .tools a[aria-current="page"] { background: var(--surface-3); color: var(--fg); }
header.top nav a.narrow-only { display: none; }
header.top .tools { display: grid; gap: 2px; margin-top: auto; padding-top: var(--sp-2); border-top: 1px solid var(--line); }
header.top .tools button.link { width: 100%; justify-content: flex-start; font: inherit; font-weight: 500; text-align: left; }
header.top .tools .langsw { display: flex; gap: 2px; align-items: center; min-height: 32px; padding: 0 var(--sp-1); font-size: var(--fs-2); }
header.top .tools .langsw button.link, header.top .tools .langsw span { min-height: 28px; padding: 0 var(--sp-2); width: auto; line-height: 28px; font-size: inherit; font-weight: 500; }
header.top .tools .langsw [aria-current] { border-radius: var(--r-s); background: var(--surface-3); color: var(--fg); }
main { max-width: 1180px; margin: 0 auto; padding: var(--sp-6) var(--sp-6) var(--sp-9); }
.demo-banner { background: var(--warn-bg); color: var(--warn); padding: var(--sp-2) var(--sp-4); font-size: var(--fs-2); line-height: 18px; }
.demo-banner strong { font-weight: 600; }

@media (max-width: 860px) {
  /* 0.14.3: the sticky bar is the brand row plus the 41 px nav row here, so a field focused after a failed submit is not under it */
  html { scroll-padding-top: calc(var(--topbar-h) + 41px + 8px); }
  body:has(> header.top:not([hidden])) { display: block; }
  header.top { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-1); height: auto; overflow: visible;
    padding: 0 var(--sp-3); border-right: 0; border-bottom: 1px solid var(--line); }
  header.top .brand { height: var(--topbar-h); margin: 0 auto 0 0; padding: 0; }
  button.searchbtn { width: auto; min-width: var(--ctl-h); margin: 0; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  button.searchbtn:hover { background: var(--surface-2); border-color: transparent; }
  button.searchbtn .label, button.searchbtn kbd { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  header.top .tools { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; border: 0; }
  header.top .tools .wide, header.top .tools button.link.wide { display: none; }
  header.top nav a.narrow-only { display: flex; }
  header.top .tools a.account, header.top .tools button.themebtn { padding: 0; width: var(--ctl-h); min-height: var(--ctl-h); justify-content: center; }
  header.top .tools a.account .label, header.top .tools button.themebtn .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  header.top .tools .langsw { padding: 0; }
  header.top nav { order: 3; display: flex; gap: 2px; flex-basis: 100%; overflow-x: auto; scrollbar-width: none;
    margin: 0 calc(-1 * var(--sp-3)); padding: 0 var(--sp-2) var(--sp-2); }
  header.top nav::-webkit-scrollbar { display: none; }
  header.top nav a { flex: none; }
  header.top nav .ic { display: none; }
  main { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
}

/* ===== controls ===== */
input, textarea, select { width: 100%; min-height: var(--ctl-h); padding: 5px 10px; border: 1px solid var(--field-line); border-radius: var(--r-s);
  background: var(--surface); color: var(--fg); font: inherit; font-size: var(--fs-3); line-height: 20px;
  transition: border-color var(--dur-1) var(--ease-out); }
textarea { padding: 8px 10px; line-height: 1.5; }
input:hover:not(:focus), textarea:hover:not(:focus), select:hover:not(:focus) { border-color: var(--muted); }
::placeholder { color: var(--placeholder); opacity: 1; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; accent-color: var(--accent-fill); flex: none; }
input[type=color] { padding: 2px; height: var(--ctl-h); width: 64px; }
input[readonly], textarea[readonly] { background: var(--surface-2); }
select { max-width: 100%; appearance: none; -webkit-appearance: none; padding-right: 30px;
  background: var(--surface) var(--icon-chevron) no-repeat right 8px center / 16px 16px; }
select[multiple], select[size] { background-image: none; padding-right: 10px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--ctl-h); padding: 5px var(--sp-3);
  border: 1px solid transparent; border-radius: var(--r-s); background: var(--accent-fill); color: var(--accent-fill-fg);
  font: inherit; font-size: var(--fs-3); line-height: 20px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
button:hover, .btn:hover { background: var(--accent-hover); }
button:active:not(:disabled), .btn:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--fg); border-color: var(--line-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); border-color: var(--field-line); }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-fg); }
button.danger:hover { background: var(--danger); border-color: var(--danger); filter: brightness(.92); }
button.link, a.link { background: none; border: 0; color: var(--accent); padding: 8px 0; min-height: 0; font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
button.link:hover, a.link:hover { background: none; text-decoration-thickness: 2px; }
button.link:active { transform: none; }
button.link.quiet { color: var(--muted); text-decoration: none; }
button.link.quiet:hover { color: var(--fg); }
.fld { display: block; margin-bottom: var(--sp-4); min-width: 0; }
.fld > span { display: block; font-size: var(--fs-2); line-height: 18px; font-weight: 500; color: var(--fg); margin-bottom: 6px; }
.row { display: flex; gap: var(--s3); align-items: end; flex-wrap: wrap; }
.row .fld { flex: 1; min-width: 160px; }
.row > button, .row > .btn { margin-bottom: var(--s3); }
.actions { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; margin-top: var(--s2); }
.chk { display: inline-flex; gap: 6px; align-items: center; color: var(--fg); }
.checks { display: flex; gap: var(--s2) var(--s3); flex-wrap: wrap; }
fieldset { border: 0; margin: 0 0 var(--sp-4); padding: 0; min-width: 0; }
legend { color: var(--fg); padding: 0; margin-bottom: var(--sp-2); font-size: var(--fs-2); line-height: 18px; font-weight: 600; }
input.mono, code.wrap { font-family: var(--mono); word-break: break-all; }
code { font-family: var(--mono); font-size: .9em; }
@media (pointer: coarse) {
  button, .btn, select, input:not([type=checkbox]):not([type=radio]) { min-height: var(--ctl-h); }
  input, select, textarea { font-size: 16px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  /* look 27. 10. (24 px check): the label around a 22 px box is the target, so it is at least 24 px high ("jen moje", "Vybrat více obchodů") */
  .chk { min-height: 24px; }
  button.link, a.link { padding: 10px 0; }
}

/* ===== page heads, sections ===== */
.bar { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s3); flex-wrap: wrap; }
.bar h1, .bar h2 { margin: 0; }
.bar .grow { flex: 1; }
.bar input[type=search] { flex: 1 1 260px; min-width: 200px; }
.bar select { width: auto; max-width: 100%; }
.bar .filters { margin: 0; }
.pagehead { display: flex; gap: var(--sp-4); align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--sp-6); }
.pagehead h1 { margin: 0 0 var(--sp-1); }
.pagehead .facts { color: var(--muted); display: flex; gap: var(--sp-1) var(--sp-4); flex-wrap: wrap; align-items: baseline; font-size: var(--fs-2); line-height: 18px; }
.pagehead .actions { margin: 0; }
/* 0.12.0: a section is its title and space, not a box or an underline. */
section.block { margin-bottom: var(--sp-8); }
section.block > h2, .block-head h2 { font-size: var(--fs-3); line-height: 20px; font-weight: 600; }
section.block > h2, .block-head { margin-bottom: var(--sp-3); }
.block-head { display: flex; gap: var(--s3); align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.block-head h2 { margin: 0; }
@media (pointer: fine) { .block-head .link { padding: 0; } }
/* No framed boxes: a panel is a tinted area, a card (sign-in, password reset) a plain surface. The class names stay. */
.panel { background: var(--surface-2); border: 0; border-radius: var(--r-m); padding: var(--sp-4); margin-bottom: var(--sp-4); }
.card { background: var(--surface); border: 0; border-radius: var(--r-l); padding: var(--sp-6); margin-bottom: var(--sp-4); }
.card.flat { background: none; border: 0; padding: 0; }
.card.warn { background: var(--danger-bg); box-shadow: inset 2px 0 0 var(--danger); }
.narrow { max-width: 400px; margin: 12vh auto var(--s5); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.detail aside section.block { margin-bottom: var(--sp-6); }
.detail aside section.block > h2, .detail aside .block-head h2 { font-size: var(--fs-2); line-height: 18px; }
@media (max-width: 960px) { .detail { grid-template-columns: minmax(0, 1fr); gap: 0; } .detail aside { order: -1; } }
/* 0.14.3: a long label wraps at half the width instead of pushing the value off a phone screen */
dl.kv { display: grid; grid-template-columns: fit-content(50%) minmax(0, 1fr); gap: 6px var(--s3); margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* CL-ML C156, C155: dashboard tiles and bars (native <progress>, so the CSP needs no inline style) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.kpi { border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-value { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.kpi.ok .kpi-value { color: var(--ok); }
.kpi.warn .kpi-value { color: var(--warn); }
.kpi.bad .kpi-value { color: var(--danger); }
.dash-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); }
.dash-charts h3 { margin: 0 0 var(--s2); font-size: 1rem; }
.brow { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) max-content; gap: var(--s2); align-items: center; margin: 4px 0; }
.brow .blabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow progress { width: 100%; height: 12px; accent-color: var(--accent); }
.brow progress.ok { accent-color: var(--ok); }
.brow progress.warn { accent-color: var(--warn); }
.brow progress.bad { accent-color: var(--danger); }
.brow .bval { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9em; }

/* CL-ML documents from a deal: the sheet prints on A4, the editor keeps an item on one line */
.doclist { list-style: none; margin: 0; padding: 0; }
.doclist li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.doclist li:last-child { border-bottom: 0; }
.doc-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); max-width: 210mm; }
.doc-top h2 { margin: 0 0 4px; font-size: 1.4em; }
/* 0.15.0 (C102): the installation's logo on the right of the sheet; on a narrow screen it wraps under the title */
.doc-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: var(--s3) var(--s4); }
.doc-top > div { flex: 1 1 14em; min-width: 0; }
.doc-logo { display: block; flex: none; max-height: 64px; max-width: min(200px, 100%); width: auto; height: auto; }
.doc-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); margin: var(--s4) 0; }
.doc-parties h3 { margin: 0 0 4px; font-size: .85em; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.doc-text { white-space: pre-line; margin: 0 0 var(--s3); }
.doc-items { margin-bottom: var(--s3); }
.doc-items tfoot th { text-align: right; font-weight: normal; }
.doc-items tfoot .doc-gross th, .doc-items tfoot .doc-gross td { font-weight: 700; }
.doc-edit input { width: 100%; min-width: 4em; }
.doc-sum { font-weight: 600; font-variant-numeric: tabular-nums; }
/* 0.15.0 (C007, C198): the industry packs in Settings, one under another */
.preset { border-top: 1px solid var(--line); padding: var(--sp-2) 0 var(--sp-3); overflow-wrap: anywhere; }
.preset:first-child { border-top: 0; }
.preset h3 { margin-top: var(--sp-2); }
.preset p { margin: 0 0 var(--sp-1); }
/* CL-ML C059: stages of a pipeline in Settings */
ol.stages { list-style: none; margin: 0 0 var(--s3); padding: 0; }
ol.stages > li { border-bottom: 1px solid var(--line); padding: 6px 0; }
.stage-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.stage-row .fld { margin: 0; }
.stage-row input[name=name] { min-width: 12em; }
.stage-row input.num { width: 6em; }
.stage-n { padding-bottom: 8px; min-width: 6em; }
.stage-acts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding-bottom: 2px; }
/* CL-ML C076, C074: the calendar month */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-wd { padding: 6px 8px; font-size: .8em; color: var(--muted); text-transform: capitalize; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-day { min-height: 6.5em; padding: 4px 6px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); min-width: 0; }
.cal-day.out { background: var(--surface-2); }
/* 0.18.0: a day without items keeps the cell layout; the generic empty-state rule (.empty) centred its number */
.cal-day.empty { padding: 4px 6px 6px; text-align: start; color: inherit; }
.cal-day.out .cal-num { color: var(--muted); }
.cal-day.today .cal-num { background: var(--accent-fill); color: var(--accent-fill-fg); border-radius: 999px; padding: 0 7px; }
.cal-n { font-size: .85em; margin-bottom: 2px; }
.cal-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cal-items { list-style: none; margin: 0; padding: 0; }
.cal-it a { display: block; box-sizing: border-box; font-size: .82em; line-height: 16px; min-height: 24px; padding: 4px 6px; margin: 2px 0; border-radius: 4px; background: var(--accent-soft); color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-it a:hover { text-decoration: underline; }
.cal-it.k-step a { background: var(--warn-bg); }
.cal-it.k-meeting a { background: var(--ok-bg); }
.cal-it.late a { box-shadow: inset 3px 0 0 var(--danger); }
.cal-it.done a { text-decoration: line-through; color: var(--muted); background: var(--surface-2); }
.cal-time { font-variant-numeric: tabular-nums; margin-right: 4px; color: var(--muted); }
/* UX prvky 2026-10-21: toolbar (today, steps, month and year picker, views), the day number as a link, week and list */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--s3); }
.cal-bar .grow { flex: 1; }
.cal-bar nav.tabs { margin: 0; border-bottom: 0; }
.cal-steps { display: inline-flex; gap: var(--sp-1); }
.cal-step { min-width: var(--ctl-h); justify-content: center; font-size: 1.15em; line-height: 1; }
.cal-jump-wrap { position: relative; display: inline-block; }
.cal-title { background: none; border: 1px solid transparent; color: var(--fg); font: inherit; font-size: var(--fs-6); font-weight: 600; min-height: var(--ctl-h);
  padding: 4px 10px; border-radius: var(--r-s); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cal-title > span:first-child::first-letter { text-transform: uppercase; }
.cal-title:hover { background: var(--surface-2); border-color: var(--line); }
.cal-title .caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid currentColor; }
.cal-title[aria-expanded="true"] .caret { transform: rotate(180deg); }
.cal-jump { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: 18rem; max-width: calc(100vw - 32px); padding: var(--sp-3);
  background: var(--surface); border: 1px solid var(--border-float); border-radius: var(--r-m); box-shadow: var(--shadow-pop); }
.cal-jump-y { display: flex; gap: 6px; align-items: center; margin-bottom: var(--sp-2); }
.cal-jump-y select { flex: 1; width: auto; }
.cal-jump-m { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-1); }
.cal-jump-m a { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 4px; border-radius: var(--r-s); color: var(--fg); text-decoration: none; }
.cal-jump-m a::first-letter { text-transform: uppercase; }
.cal-jump-m a:hover { background: var(--surface-2); }
.cal-jump-m a.now { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-jump-m a[aria-current] { background: var(--accent-fill); color: var(--accent-fill-fg); }
a.cal-n { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; min-width: 24px; color: inherit; text-decoration: none; }
a.cal-n:hover .cal-num { text-decoration: underline; }
h2.cal-n { margin: 0 0 4px; font-size: var(--fs-3); font-weight: 600; line-height: 20px; }
.cal.week .cal-day { min-height: 14em; }
.cal.week .cal-num, .cal.agenda .cal-num { display: none; }
.cal.week .cal-full, .cal.agenda .cal-full { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
.cal.week .cal-full::first-letter, .cal.agenda .cal-full::first-letter { text-transform: uppercase; }
.cal.week .cal-day.today .cal-full, .cal.agenda .cal-day.today .cal-full { color: var(--accent); }
.cal.week .cal-it a { white-space: normal; }
.cal.agenda { display: block; border: 0; }
.cal.agenda .cal-day { min-height: 0; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; background: none; }
.cal.agenda .cal-full { font-weight: 600; }
.cal.agenda .cal-it a { white-space: normal; font-size: .95em; padding: 6px 8px; max-width: 48rem; }
@media (max-width: 700px) {
  .cal.week .cal-day { min-height: 0; }
  .cal-bar { position: relative; }
  .cal-bar .grow { display: none; }
  .cal-jump-wrap { position: static; }
  .cal-jump { left: 0; right: 0; width: auto; max-width: none; }
}
@media (max-width: 700px) {
  .cal { display: block; border: 0; }
  .cal-wd, .cal-day.empty { display: none; }
  .cal-day { min-height: 0; border: 0; border-bottom: 1px solid var(--line); padding: 8px 0; background: none; }
  .cal-day.out { background: none; }
  .cal-num { display: none; }
  .cal-full { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-weight: 600; }
  .cal-day.today .cal-full { color: var(--accent); }
  .cal-it a { white-space: normal; font-size: .95em; padding: 6px 8px; }
}
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain > li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.plain > li:last-child { border-bottom: 0; }
/* 0.14.3: a name link with the e-mail right under it kept 18 px apart failed WCAG 2.5.8 (target size) */
ul.plain > li > a:first-child { display: inline-block; min-height: 24px; line-height: 24px; }
ul.plain > li > a:first-child ~ div.small { margin-top: 4px; }
p.tools { display: flex; gap: var(--s3); flex-wrap: wrap; margin: 0 0 var(--s3); font-size: .9rem; }
/* 0.12.0: one calm sentence and at most one action, no illustration. */
.empty { padding: var(--sp-8) var(--sp-4); text-align: center; color: var(--muted); }
.empty p { margin: 0 auto var(--sp-4); max-width: 52ch; font-size: var(--fs-5); line-height: 22px; }
.empty .actions { justify-content: center; }

/* ===== tables ===== */
/* 0.12.0: no outer frame; the header row sticks while a long list scrolls, rows are 44 px. */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th { position: sticky; top: 0; z-index: 1; background: var(--bg); text-align: left; font-weight: 500; font-size: var(--fs-1); line-height: 16px;
  color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.panel table.list th { background: var(--surface-2); }
/* UX prvky 2026-10-21: report headers sort; the button looks like the header, an arrow shows the order. */
table.list th .th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 24px; font: inherit; color: inherit; }
table.list th .th-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
table.list th .th-sort::after { content: "\2195"; opacity: .35; font-size: .9em; }
table.list th[aria-sort=ascending] .th-sort::after { content: "\2191"; opacity: 1; }
table.list th[aria-sort=descending] .th-sort::after { content: "\2193"; opacity: 1; }
/* UX prvky 2026-10-21: on a phone the list is cards without a header, so the sort is a select there */
.bar .sort-pick { display: none; }
@media (max-width: 640px) { .bar .sort-pick { display: block; } }
@media print { table.list th .th-sort::after { content: none; } }
table.list td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list tbody tr.click { cursor: pointer; }
/* only with a real pointer: on a phone the row would stay tinted after a tap */
@media (hover: hover) { table.list tbody tr.click:hover { background: var(--surface-2); } }
table.list .num { text-align: right; white-space: nowrap; }
table.list td a { font-weight: 500; }
/* the name in the first column is the row's title: plain text colour, underline on hover */
table.list:not(.report) td:first-child a { color: var(--fg); text-decoration: none; }
table.list:not(.report) td:first-child a:hover { color: var(--accent); text-decoration: underline; }
tr.inactive td { opacity: .55; }
tr.here td { background: var(--accent-soft); }
td.acts { white-space: nowrap; text-align: right; }
td.acts button.link { margin-left: var(--s3); }
/* 0.12.0: the link's own 8 px padding plus 4 px puts its text on the same line as the other cells */
table.list td.acts { padding-top: 4px; padding-bottom: 4px; }
.scroll { overflow-x: auto; }
.scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.perm-row { min-height: 28px; display: flex; align-items: center; }
.more { text-align: center; margin: var(--s3) 0; }
@media (max-width: 860px) { table.list th { position: static; } }
@media (max-width: 640px) {
  table.list:not(.report) thead { display: none; }
  table.list:not(.report), table.list:not(.report) tbody, table.list:not(.report) tr { display: block; }
  table.list:not(.report) tr { border-bottom: 1px solid var(--line); padding: var(--s2) 0; }
  table.list:not(.report) td { display: block; border: 0; padding: 2px 12px; text-align: left; }
  table.list:not(.report) td:empty { display: none; }
  table.list:not(.report) td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }
  td.acts { text-align: left; white-space: normal; }
  td.acts button.link { margin: 0 var(--s3) 0 0; }
  /* 0.14.3: a long value without spaces (JSON in the audit log, a URL) wraps inside the card instead of widening the page */
  table.list:not(.report) td { overflow-wrap: anywhere; }
}

/* ===== tags, health ===== */
.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 6px; vertical-align: 1px; }
.tag { display: inline-block; border-radius: 4px; padding: 0 6px; font-size: .78rem; line-height: 1.5; font-weight: 500;
  background: #5b6b7f; color: #fff; white-space: nowrap; }
.health { font-weight: 600; white-space: nowrap; }
.health.h-ok { color: var(--ok); }
.health.h-watch { color: var(--warn); }
.health.h-risk { color: var(--danger); }
ul.factors { list-style: none; padding: 0; margin: 0 0 var(--s2); }
ul.factors li { padding: 2px 0; }
ul.factors .pts { display: inline-block; min-width: 2.6em; font-weight: 600; color: var(--danger); }

/* ===== board ===== */
/* 0.12.0: cards after Pipedrive: title, company, value, next step; moving by select stays (WCAG 2.5.7) but reads as quiet text. */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr); gap: var(--sp-4); overflow-x: auto;
  padding-bottom: var(--sp-2); scroll-snap-type: x proximity; }
.col { min-width: 0; scroll-snap-align: start; }
.col > header { display: flex; flex-direction: column; gap: 2px; padding: 0 2px var(--sp-2); margin-bottom: var(--sp-3); border-bottom: 2px solid var(--line); }
.col > header h2 { font-size: var(--fs-2); line-height: 18px; margin: 0; }
.col > header .small { font-size: var(--fs-1); line-height: 16px; font-variant-numeric: tabular-nums; }
.col.won > header { border-bottom-color: var(--ok); }
.col.won > header h2 { color: var(--ok); }
.col.lost > header { border-bottom-color: var(--danger); }
.col.lost > header h2 { color: var(--danger); }
.col .drop { min-height: 120px; border-radius: var(--r-m); padding: 2px; }
.col.over .drop { outline: 2px dashed var(--accent); background: var(--accent-soft); }
.deal { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; margin-bottom: var(--sp-2); border: 1px solid var(--line);
  border-radius: var(--r-m); background: var(--surface); color: var(--fg); font-size: var(--fs-3);
  transition: box-shadow var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.deal:hover { box-shadow: var(--shadow-pop); border-color: var(--line-strong); }
.deal > a { color: var(--fg); font-weight: 600; text-decoration: none; }
.deal > a:hover { text-decoration: underline; }
.deal[draggable="true"] { cursor: grab; }
.deal.stale { box-shadow: inset 3px 0 0 var(--warn); }
.deal.stale:hover { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-pop); }
.deal .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.deal .tags { margin: 2px 0 0; }
.deal select.move { width: 100%; margin-top: 6px; padding: 6px 22px 0 0; min-height: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0;
  background: transparent var(--icon-chevron) no-repeat right 0 top calc(50% + 3px) / 14px 14px; color: var(--muted); font-size: var(--fs-2); line-height: 18px; cursor: pointer; }
.deal select.move:hover { color: var(--fg); }
.deal select.move:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--line); }
@media (pointer: coarse) { .deal select.move { min-height: 40px; } }

/* ===== bulk editing (CL-ML C008) ===== */
/* Row checkboxes are 24 px targets (WCAG 2.5.8) on every pointer; the bar wraps down to a 320 px screen. */
input[type=checkbox].pick { width: 24px; height: 24px; }
table.list th.pick, table.list td.pick { width: 1%; padding-right: 0; }
table.list td.pick { padding-top: 10px; padding-bottom: 10px; }
/* the name moves to the second column and keeps the look of a row title */
table.list.picks:not(.report) td.pick + td a { color: var(--fg); text-decoration: none; }
table.list.picks:not(.report) td.pick + td a:hover { color: var(--accent); text-decoration: underline; }
.bulk { margin: 0 0 var(--s3); }
.bulk-all { min-height: 24px; }
.bulk-status { margin: 0; }
.bulk-status:not(:empty), .bulk-acts, .bulk-refused, .bulk .flash { margin-top: var(--s2); }
.bulk .flash { margin-bottom: 0; }
.bulk-acts { display: flex; gap: var(--s2) var(--s3); flex-wrap: wrap; align-items: center; }
.bulk-grp { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; flex: 1 1 260px; min-width: 0; }
.bulk-grp select { flex: 1 1 160px; width: auto; min-width: 0; }
/* CL-15 (0.17.0): on a phone a select and its first button share a row, so the bar stays shorter */
@media (max-width: 480px) { .bulk-grp select { flex-basis: 100px; } }
/* CL-15 (look 27. 10.): below 375 px the select takes the full width (as every other field), "Změnit vlastníka" and
   "Další akce" share the next row and the tag actions open under "Další akce": the bar is three rows, not four */
.bulk-more { display: none; }
@media (max-width: 374.98px) {
  .bulk-acts > .bulk-grp:not(.bulk-tags) { display: contents; }
  .bulk-grp select { flex: 1 1 100%; }
  .bulk-more:not([hidden]) { display: inline-flex; }
  .bulk-acts:not(.more-open) > .bulk-tags { display: none; }
  .bulk-acts > .bulk-tags { flex-basis: 100%; }
}
.bulk-refused p { margin: 0 0 4px; }
.bulk-refused ul { margin: 0; padding-left: 20px; }
.deal-head { display: flex; gap: 8px; align-items: flex-start; }
.deal-head > a { color: var(--fg); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.deal-head > a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  /* the card of a row keeps its checkbox at the left edge; the name after it gets no "Název:" prefix */
  table.list.picks:not(.report) tr { position: relative; padding-left: 36px; }
  table.list.picks:not(.report) td.pick { position: absolute; left: 0; top: var(--s2); width: auto; padding: 0 0 0 12px; }
  table.list.picks:not(.report) td.pick + td::before { content: none; }
}

/* ===== activity log ===== */
.composer { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-6); padding: var(--sp-4); background: var(--surface-2); border: 0; border-radius: var(--r-m); }
.composer .row .fld { margin-bottom: 0; }
.composer textarea { min-height: 64px; }
.composer button[type=submit] { justify-self: start; }
/* Offer of a follow-up task after a call or a meeting (sits right under the composer). */
.nextstep { margin: calc(-1 * var(--sp-4)) 0 var(--sp-6); padding: var(--sp-3) var(--sp-4); background: var(--surface-2); border-radius: var(--r-m); }
.nextstep input[type=date] { width: auto; flex: 0 1 11rem; }
/* The activity type is a segmented control: the chosen item is a raised surface inside a sunken track. */
.kinds { display: inline-flex; gap: 2px; flex-wrap: wrap; padding: 2px; background: var(--surface-3); border-radius: var(--r-s); width: fit-content; max-width: 100%; }
.kinds label { position: relative; padding: 4px 12px; border-radius: var(--r-xs); cursor: pointer; color: var(--muted); font-weight: 500;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out); }
.kinds label:hover { color: var(--fg); }
.kinds input { position: absolute; opacity: 0; pointer-events: none; }
.kinds label:has(input:checked) { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-pop); }
@media (pointer: coarse) { .kinds label { padding: 8px 14px; } }
.kinds label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
ul.tasks { list-style: none; padding: 0; margin: 0 0 var(--s3); }
li.task { display: flex; gap: var(--s2); align-items: baseline; padding: 6px 0; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
li.task:last-child { border-bottom: 0; }
/* 0.14.3: edit and delete of an activity where it is shown */
.act-tools { display: inline-flex; gap: var(--sp-3); margin-left: auto; }
.log .entry .act-tools { display: flex; margin: var(--sp-1) 0 0; }
.act-tools button.link { font-size: var(--fs-2); min-height: 24px; }
form.act-edit { flex-basis: 100%; margin: var(--sp-2) 0; }
/* 0.14.3 (C022): contact merge, the found people */
.merge-pick { list-style: none; padding: 0; margin: var(--sp-2) 0; }
.merge-pick li { padding: var(--sp-1) 0; }
.merge-pick button.link { text-align: left; min-height: 24px; white-space: normal; overflow-wrap: anywhere; }
li.task .when { color: var(--muted); }
li.task.late .when { color: var(--danger); font-weight: 600; }
li.task.done > span:first-of-type { text-decoration: line-through; color: var(--muted); }
.log h3 { font-size: .8rem; color: var(--muted); font-weight: 600; margin: var(--s4) 0 var(--s2); }
.log h3:first-child { margin-top: 0; }
.log .entry { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: var(--s3); padding: var(--s2) 0; border-top: 1px solid var(--line); }
.log h3 + .entry { border-top: 0; }
.log .entry time { color: var(--muted); font-size: .85rem; padding-top: 1px; }
.log .entry .what { color: var(--muted); font-size: .85rem; }
.log .entry .what b { color: var(--fg); font-weight: 600; }
.log .entry .what.k-deal_won b { color: var(--ok); }
.log .entry .what.k-deal_lost b { color: var(--danger); }
.log .entry .ttl { font-weight: 500; }
.log .entry .body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ===== dialogs, palette, toast ===== */
dialog { border: 1px solid var(--border-float); border-radius: var(--r-l); padding: 0; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-modal);
  max-width: min(520px, calc(100vw - 32px)); width: 100%; }
dialog[open] { animation: ds-pop-in var(--dur-2) var(--ease-out); }
dialog::backdrop { background: var(--backdrop); }
dialog form.dlg { padding: var(--sp-6); margin: 0; }
/* on a phone a dialog is a bottom sheet */
@media (max-width: 760px) {
  dialog:not(.palette) { margin: auto 0 0; max-width: 100vw; border-radius: var(--r-l) var(--r-l) 0 0; border-bottom: 0; }
  dialog:not(.palette)[open] { animation-name: ds-rise-in; }
  dialog:not(.palette) form.dlg { padding: var(--sp-6) var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom, 0px)); }
}
dialog form.dlg p.body { white-space: pre-wrap; }
dialog .actions { justify-content: flex-end; margin-top: var(--s3); }
dialog.palette { margin-top: 10vh; max-width: min(640px, calc(100vw - 24px)); }
.palette input[type=search] { border: 0; border-bottom: 1px solid var(--line); border-radius: var(--r-l) var(--r-l) 0 0; padding: 14px 16px; font-size: 17px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.palette li.grp { padding: 10px 10px 4px; font-size: var(--fs-1); line-height: 16px; color: var(--muted); font-weight: 600; }
.palette li a { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 40px; padding: 0 10px; border-radius: var(--r-s); color: var(--fg); text-decoration: none; }
.palette li a .sub { color: var(--muted); font-size: var(--fs-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li a.sel { background: var(--surface-3); }
.palette .hint { padding: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-1); display: flex; gap: var(--sp-4); flex-wrap: wrap; }
/* 0.12.0: the toast sits bottom right on a raised surface; a failure keeps the strong red. */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; background: var(--surface); color: var(--fg); border: 1px solid var(--border-float);
  padding: 10px 16px; border-radius: var(--r-m); box-shadow: var(--shadow-pop); max-width: min(420px, calc(100vw - 32px)); animation: ds-rise-in var(--dur-2) var(--ease-out); }
.toast:empty { display: none; }
.toast.bad { background: var(--danger); color: var(--danger-fg); border-color: var(--danger); }
@media (max-width: 640px) { .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; } }
/* UX prvky 2026-10-21: one action in the toast (Vrátit), quick dates beside a date-time field, field messages. */
.toast .toast-act { margin-left: var(--sp-3); font-weight: 600; min-height: 32px; padding: 4px 8px; }
.toast.bad .toast-act { color: inherit; }
.due-fld .quick-dates { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 var(--sp-3); }
.quick-dates button { min-height: 32px; padding: 4px 10px; font-size: .875rem; }
.fld-err { display: block; color: var(--danger); margin: -4px 0 var(--sp-3); font-size: .875rem; }
.fld-err[hidden] { display: none; }
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.fld-wrap { flex: 1 1 0; min-width: 160px; }
.row > .due-fld { flex: 1; min-width: 200px; }

/* ===== tabs (settings) ===== */
nav.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); overflow-x: auto; }
nav.tabs a { padding: 10px 10px 8px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
/* 0.17.1: a wide screen shows every tab (settings has 12), a narrow one scrolls the strip to the open tab */
@media (min-width: 900px) { nav.tabs { flex-wrap: wrap; overflow-x: visible; } }
/* Podpora | Asistent on the company and contact card (0.11.0) */
.subtabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s2); }
.subtabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 6px 8px; font: inherit; cursor: pointer; }
.subtabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }

/* ===== accounts, settings, import, duplicates, groups ===== */
code.secret { font-size: 1.15em; letter-spacing: .05em; word-break: break-all; }
/* 2FA setup QR code: white with a quiet zone in both themes, never wider than the column */
.qrbox svg.qr { display: block; max-width: 100%; height: auto; }
ul.codes { columns: 2; padding-left: 18px; font-family: var(--mono); }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 var(--s3); margin-bottom: var(--s3); }
table.sample td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.duppair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-bottom: var(--s3); }
.dupside { background: var(--surface-2); border-radius: var(--r-m); padding: var(--sp-3) var(--sp-4); }
.dupside > a { font-weight: 600; }
.lvl1 { padding-left: 1.2em; } .lvl2 { padding-left: 2.4em; } .lvl3 { padding-left: 3.6em; }
.lvl4 { padding-left: 4.8em; } .lvl5 { padding-left: 6em; } .lvl6 { padding-left: 7.2em; }
.lvl1, .lvl2, .lvl3, .lvl4, .lvl5, .lvl6 { display: inline-block; }
@media (max-width: 640px) { .duppair { grid-template-columns: 1fr; } }
.install fieldset { margin: 12px 0; }
.install label { display: block; margin: 8px 0; }
.install input:not([type=checkbox]), .install select { display: block; width: 100%; }
.install label.check { display: flex; gap: 8px; align-items: flex-start; }
.install.narrow { max-width: 600px; }
.langs { text-align: right; margin: 0 0 var(--s2); font-size: .9rem; }
.langs button.link { padding: 0; }
.filters { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s3); }
.filters:empty { display: none; }
.filters select, .filters input { width: auto; min-width: 150px; }
/* 0.12.0: the filter conditions open from one quiet button; the badge counts the active ones. */
details.filterbox { margin: 0; }
details.filterbox > summary { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-h); padding: 5px 30px 5px var(--sp-3); list-style: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--surface) var(--icon-chevron) no-repeat right 8px center / 16px 16px;
  color: var(--fg); font-weight: 500; cursor: pointer; user-select: none; }
details.filterbox > summary::-webkit-details-marker { display: none; }
details.filterbox > summary:hover, details.filterbox[open] > summary { background-color: var(--surface-2); }
details.filterbox[open] > summary { margin-bottom: 0; }
details.filterbox .count { min-width: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent-fill); color: var(--accent-fill-fg);
  font-size: var(--fs-1); line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
details.filterbox .filters { margin: var(--sp-2) 0 0; }
.savedbar { display: inline-flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
fieldset.custom { margin: 0 0 var(--s3); }
.picker { position: relative; }
.picker .pick-row { display: flex; gap: var(--s2); align-items: center; }
.picker button.link { padding: 2px 0; }
.picker-list { position: absolute; z-index: 5; left: 0; right: 0; margin: 2px 0 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); max-height: 260px; overflow-y: auto; box-shadow: var(--shadow-pop); }
.picker-list li { padding: 0 10px; }
.picker-list li button.link { display: block; width: 100%; text-align: left; white-space: normal; text-decoration: none; color: var(--fg); }
.picker-list li button.link:hover, .picker-list li button.link:focus-visible { color: var(--accent); }
.help h2 { margin-top: var(--s4); }
.help kbd { margin: 0 2px; }
.help p, .help li { max-width: 72ch; }
.print-only { display: none; }

/* reports as PDF: the browser prints this, "Save as PDF" keeps the fonts and diacritics */
@media print {
  @page { size: A4; margin: 14mm; }
  :root { --bg: #fff; --fg: #000; --muted: #444; --line: #bbb; --surface: #fff; --accent: #000; color-scheme: light; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  header.top, .demo-banner, .no-print, button, .error, .filters, .toast, .skip { display: none !important; }
  .print-only { display: block; }
  main { max-width: none; padding: 0; }
  /* 0.12.0: the sidebar column must not take paper width */
  body:has(> header.top:not([hidden])) { display: block; min-height: 0; }
  /* on paper the section headings keep their rule, as in 0.11 */
  section.block > h2, .block-head { padding-bottom: 4pt; border-bottom: 1px solid var(--line); }
  .card, .panel { border: 0; padding: 0; margin: 0 0 14pt; break-inside: avoid-page; background: none; box-shadow: none; }
  .report-card { break-inside: auto; }
  table.list { border: 0; font-size: 9.5pt; }
  table.list th, table.list td { padding: 3pt 5pt; }
  table.list th { position: static; background: none; }
  table.list thead { display: table-header-group; }
  table.list tr { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  h2, h3 { break-after: avoid; }
  .doc-sheet { border: 0; padding: 0; max-width: none; background: none; }
}

/* ===== login frame, small helpers ===== */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth-top { display: flex; justify-content: flex-end; padding: var(--s3) var(--s4); }
.auth-top .langs { margin: 0; }
/* 0.12.0: sign-in is a 400 px surface without a frame; 40 px fields and a full-width button. */
.auth .narrow { width: min(400px, calc(100% - 32px)); margin-top: 10vh; padding: var(--sp-7) var(--sp-6); }
.auth .narrow h1 { font-size: var(--fs-8); line-height: 32px; margin-bottom: var(--sp-6); }
.auth .narrow input:not([type=checkbox]):not([type=radio]) { min-height: var(--ctl-h-lg); }
.auth .narrow button[type=submit] { width: 100%; min-height: var(--ctl-h-lg); margin-top: var(--sp-2); }
.auth .narrow > p:last-child { margin: var(--sp-4) 0 0; text-align: center; }
@media (max-width: 480px) { .auth .narrow { margin: var(--sp-4) var(--sp-4) var(--sp-8); padding: var(--sp-6) var(--sp-4); } }
.measure { max-width: 440px; }
.pre { white-space: pre-wrap; }
.panel.once { background: var(--warn-bg); box-shadow: inset 2px 0 0 var(--warn); }
.panel.once .row input { flex: 1 1 260px; }
section.block.late > h2 { color: var(--danger); }
details { margin-top: var(--s2); }
details > summary { cursor: pointer; color: var(--accent); }
details[open] > summary { margin-bottom: var(--s2); }
li.task .when { color: var(--muted); font-size: .88rem; }
li.task.late .when { color: var(--danger); font-weight: 600; }

/* ===== motion (01_DESIGN_SYSTEM section 4) ===== */
/* A new screen fades in, dialogs and toasts rise or pop in; nothing moves when the system asks for less motion. */
@keyframes ds-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ds-rise-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ds-pop-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
#app > * { animation: ds-fade-in var(--dur-1) var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:active:not(:disabled), .btn:active { transform: none; }
}

/* ===== C017: files on a company, contact or deal ===== */
/* A long file name wraps inside the row instead of widening the page (320 px); name and delete stay 24 px targets.
   The whole box breaks long words: the status line repeats the name, and below 960 px the detail grid column is
   as wide as its widest unbreakable word. */
.files-box { overflow-wrap: anywhere; min-width: 0; }
ul.files { list-style: none; padding: 0; margin: 0; }
ul.files > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-2); padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.files > li:last-child { border-bottom: 0; }
ul.files > li > a { display: inline-block; min-height: 24px; line-height: 24px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
ul.files > li > button.link { min-height: 24px; min-width: 24px; padding: 0; margin-left: auto; }
.files-up { margin-top: var(--sp-3); }
.files-up .fld { margin-bottom: var(--sp-2); }
.files-up input[type=file] { padding: 6px 8px; min-height: 36px; }
.files-up .hint { display: block; margin-bottom: var(--sp-1); }
/* UX prvky 2026-10-21: drop files on the upload form */
.files-up.drop-zone { padding: var(--sp-3); border: 1px dashed var(--line-strong); border-radius: var(--r-m); transition: background var(--dur-1), border-color var(--dur-1); }
.files-up.drop-zone.over { background: var(--accent-soft); border-color: var(--accent); }
.files-up .drop-hint { display: block; margin-bottom: var(--sp-3); }
/* D1 (27. 10. 2026): the call log, "Zavolat" beside a number and the outcome form */
.btn.call-btn { height: var(--ctl-h-sm); min-height: 0; padding: 0 10px; margin-left: 2px; vertical-align: middle; }
dialog form.call-dlg { width: min(520px, calc(100vw - 24px)); }
.call-dlg .fld { display: block; margin-bottom: var(--sp-3); }
.call-dlg .call-next, .call-dlg .call-bill { border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--sp-3); margin: 0 0 var(--sp-3); }
.call-dlg .call-next legend, .call-dlg .call-bill legend { padding: 0 4px; font-weight: 600; }
.call-dlg .call-bill .row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-2); }
.row-acts { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); }
