/* BK Facility Management – servisný asistent. BK brand: ink black #0a0a0a on white and light grey, one violet accent
   (#A26CFE, the underline on bk.sk), Funnel Display for headings and numbers, Funnel Sans for text, black pill buttons,
   near-square cards with hairline borders. */
:root {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --text: #0a0a0a;
  --text-2: #595959;        /* 6.1:1 on --bg */
  --line: #e7e7e7;          /* hairlines inside cards */
  --line-2: #cfcfcf;        /* outlines of secondary controls */
  --fill: #f0f0f0;          /* number circles, code tags, empty ticks */
  --accent: #0a0a0a;        /* BK pill buttons: black, white text */
  --accent-text: #6a32d9;   /* violet text/links, 6.2:1 on white */
  --accent-soft: #f1eaff;
  --violet: #a26cfe;        /* BK brand violet – decoration only (underlines, dots, bars) */
  --ok: #03875a;            /* success / "ako overíš" */
  --ok-soft: #e3f6ee;
  --ink: #0a0a0a;           /* floating tab bar, user bubbles, dark buttons */
  --on-ink: #ffffff;
  --on-ink-2: #c8c8c8;
  --hero: #0a0a0a;          /* solid base under the dark hero cards */
  --hero-grad: radial-gradient(120% 140% at 100% 0%, #3b2670 0%, rgba(59, 38, 112, 0) 55%), linear-gradient(160deg, #0a0a0a 0%, #151321 100%);
  --on-hero-2: #dcd0f7;
  --alert: #d0281b;
  --amber: #7a4f00;
  --amber-bg: #fff4d6;
  --shadow: 0 18px 40px -20px rgba(10, 10, 10, 0.35);
  --r: 6px;                 /* BK cards are nearly square */
  --r-lg: 10px;
  --nav-h: 64px;
  --tab-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Funnel Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Funnel Display', 'Funnel Sans', system-ui, sans-serif;
  --dots: 'Funnel Display', 'Funnel Sans', system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --surface: #161616;
    --text: #f2f2f2;
    --text-2: #a8a8a8;
    --line: #262626;
    --line-2: #3a3a3a;
    --fill: #222222;
    --accent: #7c4ae8;      /* white text 5.0:1 */
    --accent-text: #bf9bff;
    --accent-soft: #24183d;
    --ok: #3fcf95;
    --ok-soft: #0f2a1f;
    --ink: #262626;
    --on-ink-2: #c8c8c8;
    --hero: #121212;
    --hero-grad: radial-gradient(120% 140% at 100% 0%, #3b2670 0%, rgba(59, 38, 112, 0) 55%), linear-gradient(160deg, #141414 0%, #1a1726 100%);
    --alert: #ff6b5b;
    --amber: #f3c26b;
    --amber-bg: #2e2410;
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
svg { width: 24px; height: 24px; flex: none; fill: currentColor; }
svg.ln { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dt { font-family: var(--dots); font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 20px 0;
  background: var(--bg);
}
.nav .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.who .n { font-weight: 700; font-size: 15px; line-height: 1.2; white-space: nowrap; }
.who .s { font-size: 12px; color: var(--text-2); }
.back {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); color: var(--text); text-decoration: none; border: 0;
  box-shadow: 0 1px 0 rgba(14, 35, 38, 0.06);
}
.back svg { width: 20px; height: 20px; }
.nav-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sap-status {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px;
  border-radius: var(--r-lg); border: 0; background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.sap-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.sap-status.syncing .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- floating tab bar (left rail on desktop) ---------- */
.tabbar {
  position: fixed; z-index: 20;
  left: max(20px, calc(50% - 240px)); right: max(20px, calc(50% - 240px));
  bottom: calc(20px + var(--safe-b));
  display: flex; gap: 6px; height: var(--tab-h); padding: 7px;
  border-radius: 33px; background: var(--ink); box-shadow: var(--shadow);
}
.tabbar a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-lg); color: var(--on-ink-2); text-decoration: none; font-size: 15px; font-weight: 600;
}
.tabbar a.active { background: var(--accent); color: #fff; }
.tabbar svg { width: 20px; height: 20px; }

main {
  max-width: 760px; margin: 0 auto;
  padding: 0 20px calc(var(--tab-h) + var(--safe-b) + 48px);
  outline: none;
}
body.has-cta main { padding-bottom: calc(var(--safe-b) + 130px); }

/* ---------- type ---------- */
.large-title { font-family: var(--display); font-size: 40px; line-height: 1.05; font-weight: 400; letter-spacing: -0.02em; margin: 14px 0 6px; }
.count { font-weight: 300; font-size: 0.6em; letter-spacing: 0; color: var(--text-2); }
.title { font-family: var(--display); font-size: clamp(30px, 8vw, 40px); line-height: 1.08; font-weight: 400; letter-spacing: -0.02em; overflow-wrap: anywhere; text-wrap: balance; }
.secondary { color: var(--text-2); font-size: 15px; }
.caption { color: var(--text-2); font-size: 13px; font-weight: 500; }
.sec-h { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 24px 4px 10px; }
.sec-title { display: flex; align-items: baseline; gap: 10px; font-size: 28px; line-height: 1.15; font-weight: 300; letter-spacing: -0.02em; margin: 28px 2px 12px; }
.sec-title .aside { margin-left: auto; }
.lbl { font-size: 13px; font-weight: 600; color: var(--text-2); }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px;
  border-radius: var(--r); border: 0; background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.chip.o { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.chip.l { background: var(--accent-soft); color: var(--accent-text); }
button.chip, a.chip { min-height: 36px; border-radius: var(--r); }
.red { width: 8px; height: 8px; border-radius: 50%; background: var(--alert); flex: none; }
.red.p2 { background: #e0a000; }
.code { display: inline-block; font: 600 11px/1.6 ui-monospace, Menlo, monospace; color: var(--text-2); background: var(--fill); padding: 1px 7px; border-radius: 7px; white-space: nowrap; vertical-align: 1px; }

/* ---------- cards & lists ---------- */
.group { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; }
.stack { display: grid; gap: 8px; }
.stack > .row { background: var(--surface); border-radius: var(--r-lg); }
.row {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 14px 16px;
  color: inherit; text-decoration: none; background: none; border: 0; width: 100%; text-align: left;
  position: relative;
}
.group .row + .row::before { content: ''; position: absolute; top: 0; left: 16px; right: 16px; border-top: 1px solid var(--line); }
.row .main { flex: 1; min-width: 0; }
.row .r1 { font-weight: 600; overflow-wrap: anywhere; }
.row .r2 { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.row .trail { color: var(--text-2); font-size: 13px; white-space: nowrap; text-align: right; }
.row .chev { color: var(--text-2); width: 18px; height: 18px; }
.row .ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--fill); }
.row .ico svg { width: 20px; height: 20px; }
a.row:active, button.row:active { background: var(--fill); }
@media (hover: hover) { a.row:hover, button.row:hover { background: color-mix(in srgb, var(--surface) 94%, var(--text)); } }
.stack > .row.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.dot-prio { display: inline-block; width: 8px; height: 8px; margin: 0 8px 2px 0; border-radius: 50%; background: var(--alert); vertical-align: middle; }
.dot-prio.p2 { background: #e0a000; }

/* the job assigned to me: big green card */
.row.job.hero {
  display: block; padding: 20px; border-radius: var(--r-lg);
  background-color: var(--hero); background-image: var(--hero-grad); color: #fff;
}
.row.job.hero:hover, .row.job.hero:active { background-color: var(--hero); filter: brightness(1.05); }
.hero-top { display: flex; align-items: center; gap: 8px; }
.hero-top .lbl { color: var(--on-hero-2); }
.hero-top .chip { margin-left: auto; background: rgba(255, 255, 255, 0.14); color: #fff; min-height: 26px; }
.hero-title { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; margin-top: 14px; overflow-wrap: anywhere; }
.hero-sub { color: var(--on-hero-2); margin-top: 2px; font-size: 15px; }
.hero-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.hero-foot .dt { font-size: 22px; }
.hero-foot .date { margin-left: auto; color: var(--on-hero-2); font-size: 13px; }
.hero-foot .go { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--accent-text); }
.hero-foot .go svg { width: 20px; height: 20px; }
.row.job.selected.hero { box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 0 22px;
  font-size: 17px; font-weight: 700; text-decoration: none; text-align: center;
  color: #fff; background: var(--accent); border: 0; border-radius: 28px;
}
.btn:active { filter: brightness(0.92); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.secondary { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.dark { color: var(--on-ink); background: var(--ink); }
.btn svg { width: 22px; height: 22px; }
.linkbtn { min-height: 48px; padding: 0 6px; background: none; border: 0; color: var(--text-2); font-weight: 600; }
.btn-col { display: grid; gap: 10px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row .btn { padding: 0 12px; font-size: 16px; white-space: nowrap; }

.iconbtn {
  width: 48px; height: 48px; flex: none; display: grid; place-items: center;
  border-radius: 50%; border: 0; color: var(--text); background: var(--surface);
}
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.fill { color: #fff; background: var(--accent); }
.iconbtn.rec { color: #fff; background: var(--alert); }
.iconbtn:disabled { opacity: 0.55; }

.spinner {
  display: inline-block; width: 18px; height: 18px; flex: none;
  border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; border-radius: 50%;
  animation: spin 0.8s linear infinite; vertical-align: -3px;
}
.spinner.big { width: 60px; height: 60px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- job ---------- */
.job-head { padding: 6px 0 2px; }
.job-head .meta { margin-top: 6px; }
.job-head .chips { margin-top: 12px; }
.job-head .orig { margin-top: 8px; }
.block { background: var(--surface); border-radius: var(--r-lg); padding: 18px; margin-top: 12px; }
.block > h2 { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.brief-in { animation: fade 0.25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.block.cause { background-color: var(--hero); background-image: var(--hero-grad); color: #fff; padding: 20px; }
.block.cause > h2 { color: var(--on-hero-2); }
.cause-short { font-size: 22px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.cause-why { color: var(--on-hero-2); font-size: 14px; margin-top: 6px; }
.cause-text.solo .cause-why { color: #fff; font-size: 19px; font-weight: 500; margin: 0; }

/* evidence: one tick per past report, filled where the cause matched */
.evidence { display: block; width: 100%; margin-top: 16px; padding: 0; background: none; border: 0; color: inherit; text-align: left; min-height: 48px; }
.ev-top { display: flex; align-items: flex-end; gap: 8px; }
.ev-num { font-size: 42px; line-height: 0.9; }
.ev-num .of { font-size: 24px; color: var(--on-hero-2); }
.ev-top .chip { margin-left: auto; background: rgba(255, 255, 255, 0.14); color: #fff; }
.ev-top .chip svg { width: 14px; height: 14px; }
.ticks { display: flex; gap: 3px; height: 22px; margin-top: 12px; }
.ticks i { flex: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
.ticks i.hit { background: #fff; }
.ticks.lt { height: 26px; }
.ticks.lt i { background: var(--fill); }
.ticks.lt i.hit { background: var(--accent); }
.ev-cap { display: block; margin-top: 8px; font-size: 13px; color: var(--on-hero-2); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { border-top: 1px solid var(--line); }
.checklist label { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; cursor: pointer; }
.checklist input {
  appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; flex: none;
  border-radius: 50%; border: 1.8px solid var(--line-2); background: var(--surface); display: grid; place-content: center;
}
.checklist input:checked { background: var(--accent); border-color: var(--accent); }
.checklist input:checked::after { content: ''; width: 11px; height: 6px; border: 2.6px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1.5px) rotate(-45deg); }
.checklist .p { flex: 1; min-width: 0; }
.checklist .p .n { display: block; font-weight: 600; }
.checklist .p .m { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; font-size: 13px; color: var(--text-2); }
.checklist input:checked ~ .p .n { color: var(--text-2); text-decoration: line-through; }
.checklist .q { font-weight: 700; white-space: nowrap; }
.tools { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }

.safety { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 4px; font-size: 14px; color: var(--text-2); }
.safety svg { width: 20px; height: 20px; color: var(--accent-text); margin-top: 1px; }

.block.steps-card { padding: 6px 16px; }
.block.steps-card .safety { padding: 12px 0; border-bottom: 1px solid var(--line); margin: 0; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 42px; }
.steps li + li { border-top: 1px solid var(--line); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 13px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; background: var(--fill);
}
.steps details summary { list-style: none; min-height: 56px; padding: 16px 30px 14px 0; position: relative; cursor: pointer; }
.steps details summary::-webkit-details-marker { display: none; }
.steps details summary::after {
  content: ''; position: absolute; right: 6px; top: 24px; width: 8px; height: 8px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(-45deg);
}
.steps details[open] summary::after { transform: rotate(45deg); top: 21px; }
.steps details p { font-size: 14px; color: var(--text-2); padding: 0 0 14px; }
.steps .plain { min-height: 56px; padding: 16px 0 14px; }

.block.tip { background: var(--accent-soft); }
.block.tip > h2 { color: var(--accent-text); }
.block.tip p { font-weight: 500; }

.sources { display: inline; white-space: normal; }
.sources .cite { margin-left: 4px; }
.block.cause .cite { background: rgba(255, 255, 255, 0.16); color: #fff; }
.checklist .sources .cite { margin-left: 0; }
.steps summary .sources, .steps .plain .sources { white-space: nowrap; }

/* ---------- drawings from the manual ---------- */
.fig { position: relative; width: 100%; overflow: hidden; background: #fff; border-radius: var(--r); }
.fig img { position: absolute; max-width: none; display: block; }
.fig[data-state="loading"] { background: linear-gradient(100deg, #f1f3ef 30%, #fafbf8 50%, #f1f3ef 70%) 0 0 / 200% 100%; animation: figload 1.2s linear infinite; }
.fig[data-state="loading"] img { opacity: 0; }
.fig[data-state="loading"] .mark, .fig[data-state="error"] .mark, .fig[data-state="error"] img { visibility: hidden; }
@keyframes figload { to { background-position: -200% 0; } }
.fig .fig-err { display: none; }
.fig[data-state="error"] .fig-err { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 16px; text-align: center; color: #3c4a40; font-weight: 600; }
.fig .mark { position: absolute; border-radius: 8px; border: 3px solid #f0a500; background: rgba(255, 196, 0, 0.18); box-shadow: 0 0 0 4px rgba(255, 196, 0, 0.25); }
.fig .mark i { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #f0a500; color: #13221a; font: 800 14px/1 var(--font); font-style: normal; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.fig .callout { position: absolute; border-radius: 6px; }
.fig .ping { animation: ping 1.6s ease-out 1; }
.fig .callout.ping { border: 3px solid var(--accent); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(162, 108, 254, 0.7); transform: scale(1.12); } 60% { box-shadow: 0 0 0 18px rgba(162, 108, 254, 0); transform: scale(1); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: no-preference) { .fig .mark { animation: breatheMark 2.2s ease-in-out infinite; } }
@keyframes breatheMark { 50% { box-shadow: 0 0 0 9px rgba(255, 196, 0, 0.12); } }

/* step rows on the job screen */
.steps li.rich { padding-left: 42px; }
.steps li.rich::before { top: 17px; }
.step-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 0; border: 0; background: none; text-align: left; color: inherit; }
.st-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.st-title { font-weight: 600; }
.st-meta { font-size: 13px; color: var(--text-2); }
.st-thumb { flex: none; width: 76px; height: 58px; overflow: hidden; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); display: flex; align-items: center; background: #fff; }
.st-thumb .fig { border-radius: 0; }
.st-src { margin: -6px 0 10px; }
.st-src .sources .cite:first-child { margin-left: 0; }

/* step mode */
.step-view { padding-bottom: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .step-view.in-right { animation: stepIn 0.24s ease-out; }
  .step-view.in-left { animation: stepInL 0.24s ease-out; }
}
@keyframes stepIn { from { opacity: 0; transform: translateX(28px); } }
@keyframes stepInL { from { opacity: 0; transform: translateX(-28px); } }
.fig-card { margin: 16px 0 0; background: var(--surface); border-radius: var(--r-lg); padding: 10px; }
.fig-card .fig { box-shadow: 0 0 0 1px var(--line); }
.marks { list-style: none; counter-reset: mk; margin: 12px 4px 4px; padding: 0; display: grid; gap: 8px; }
.marks li { counter-increment: mk; display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; min-height: 32px; }
.marks li::before { content: counter(mk); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #f0a500; color: #13221a; font-weight: 800; font-size: 14px; }
.fig-src { margin: 8px 4px 2px; }
.no-fig { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); color: var(--text-2); font-size: 14px; }
.no-fig svg { width: 22px; height: 22px; }
.st-h { margin-top: 20px; font-size: clamp(28px, 7.5vw, 36px); }
.st-why { margin-top: 8px; color: var(--text-2); }
.st-warn { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--amber-bg); font-weight: 600; font-size: 15px; }
.st-warn svg { width: 22px; height: 22px; color: var(--amber); flex: none; }
.substeps { list-style: none; margin: 16px 0 0; padding: 4px 16px; background: var(--surface); border-radius: var(--r-lg); }
.substeps li + li { border-top: 1px solid var(--line); }
.substeps label { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; cursor: pointer; min-height: 56px; }
.substeps input { appearance: none; -webkit-appearance: none; flex: none; width: 28px; height: 28px; margin: 0; border-radius: 50%; border: 1.8px solid var(--line-2); display: grid; place-content: center; background: var(--surface); }
.substeps input:checked { background: var(--accent); border-color: var(--accent); }
.substeps input:checked::after { content: ''; width: 12px; height: 7px; border: 2.6px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1.5px) rotate(-45deg); }
.substeps .sn { flex: none; width: 22px; font-weight: 800; color: var(--text-2); padding-top: 3px; }
.substeps input:checked ~ .stx { color: var(--text-2); text-decoration: line-through; }
.substeps .stx { flex: 1; font-size: 17px; line-height: 1.45; padding-top: 1px; }
.ref { display: inline-block; padding: 1px 8px; margin: 0 1px; border: 0; border-radius: 9px; background: #fff1c7; color: #6b4a00; font: 800 13px/1.6 ui-monospace, Menlo, monospace; vertical-align: 1px; position: relative; }
.ref::after { content: ''; position: absolute; inset: -10px -3px; }
.ref.off { background: var(--line); color: var(--text-2); font-weight: 700; }
.ref.off::after { content: none; }
.vals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.val { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; }
.val .vv { display: flex; align-items: baseline; gap: 6px; }
.val .dt { font-size: 40px; line-height: 1; color: var(--accent-text); }
.val .u { font-size: 18px; font-weight: 300; }
.val .vl { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.st-tools { margin-top: 14px; }
.st-tools .chips { margin-top: 6px; }
.st-check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--accent-soft); font-size: 15px; }
.st-check svg { width: 22px; height: 22px; color: var(--accent-text); flex: none; }
.st-srcs { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-srcs .sources .cite:first-child { margin-left: 0; }
body.modal-open .backdrop { z-index: 60; }
body.modal-open .sheet { z-index: 61; }
body.modal-open .toast { z-index: 70; }

/* cited manual page: the quote, then the real page with the sentence marked */
.cite-quote { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: inset 4px 0 0 #f2c94c; margin-bottom: 12px; }
.cite-quote p { margin-top: 6px; font-size: 15px; line-height: 1.45; }
.pdf-wrap { overflow-x: auto; border-radius: var(--r); background: #fff; box-shadow: 0 0 0 1px var(--line); -webkit-overflow-scrolling: touch; }
.pdf-page { position: relative; min-height: 200px; }
.pdf-page canvas { display: block; }
.pdf-page .hl.figbox { background: none; mix-blend-mode: normal; box-shadow: 0 0 0 3px #f0a500, 0 0 0 9px rgba(240, 165, 0, 0.2); border-radius: 6px; }
.pdf-page .hl { position: absolute; border-radius: 3px; background: rgba(255, 205, 40, 0.42); mix-blend-mode: multiply; box-shadow: 0 0 0 1.5px rgba(214, 160, 0, 0.55); pointer-events: none; }

.ask-field {
  display: flex; align-items: center; gap: 6px; margin-top: 14px; padding: 0 6px 0 4px;
  min-height: 58px; border-radius: 29px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2);
}
.ask-field .fake { flex: 1; min-width: 0; min-height: 52px; padding: 0 14px; border: 0; background: none; color: var(--text-2); text-align: left; border-radius: var(--r-lg); }
.ask-field .iconbtn { width: 46px; height: 46px; }

.cta {
  position: fixed; z-index: 15; left: 20px; right: 20px; bottom: calc(24px + var(--safe-b));
}
.cta .btn { max-width: 720px; margin: 0 auto; min-height: 62px; border-radius: 31px; box-shadow: 0 12px 26px -12px rgba(10, 10, 10, 0.55); }
body.has-cta::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: calc(120px + var(--safe-b)); z-index: 14; pointer-events: none;
  background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 60%);
}

/* skeleton while a brief is being built */
.think { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 15px; }
.lines { margin-top: 14px; display: grid; gap: 10px; }
.lines i { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--fill), var(--bg), var(--fill)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.lines i:nth-child(2) { width: 82%; }
.lines i:nth-child(3) { width: 64%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.notice { display: flex; gap: 12px; padding: 16px; margin-top: 12px; background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 4px 0 0 var(--alert); }
.notice svg { color: var(--alert); }
.notice .t { font-weight: 700; }
.notice .m { color: var(--text-2); font-size: 15px; }
.empty { padding: 28px 4px; color: var(--text-2); }
.empty .title { color: var(--text); margin-bottom: 8px; font-size: 26px; }

/* ---------- sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(14, 35, 38, 0.45); animation: fadein 0.2s; }
@keyframes fadein { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  display: flex; flex-direction: column;
  max-height: 92vh; max-height: 92dvh;
  background: var(--bg); border-radius: 32px 32px 0 0; box-shadow: var(--shadow);
  animation: up 0.22s ease-out;
}
.sheet.tall { height: 92vh; height: 92dvh; }
@keyframes up { from { transform: translateY(24px); opacity: 0.4; } }
.sheet-bar { position: relative; display: flex; align-items: center; gap: 10px; padding: 22px 16px 8px 20px; }
.grabber { position: absolute; top: 10px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line-2); }
.sheet-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-close { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); }
.sheet-close svg { width: 20px; height: 20px; }
.sheet-body { flex: 1; overflow: auto; padding: 8px 20px calc(24px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sheet.chatsheet .sheet-body { display: flex; flex-direction: column; padding-bottom: 0; }
.sheet.chatsheet .composer { margin-top: auto; }
.sheet-big { font-size: 72px; line-height: 1; color: var(--accent-text); }
.sheet-big .of { font-size: 40px; color: var(--text-2); }
.ev-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--line-2); }
.ev-dot.hit { background: var(--accent); }

/* segmented control */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-lg); background: var(--surface); margin-bottom: 14px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: var(--r-lg); background: none; font-size: 14px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--ink); color: var(--on-ink); }

.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 10px 16px; margin: 0; font-size: 15px; background: var(--surface); border-radius: var(--r-lg); padding: 16px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- chat ---------- */
.chat { flex: 1; display: grid; align-content: start; gap: 18px; padding: 6px 0 14px; }
.pump-chip { align-self: flex-start; margin-bottom: 4px; }
.msg { max-width: 100%; overflow-wrap: anywhere; }
.msg.user { justify-self: end; max-width: 86%; padding: 12px 16px; color: var(--on-ink); background: var(--ink); border-radius: 22px 22px 6px 22px; font-weight: 500; }
.msg.ai p + p, .msg.ai ul, .msg.ai ol, .msg.ai p + .ans-safe { margin-top: 10px; }
.msg.ai ul, .msg.ai ol { padding-left: 22px; margin-bottom: 0; }
.msg.ai li + li { margin-top: 4px; }
.ans-warn { background: var(--amber-bg); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; font-weight: 700; }
.ans-fig { margin-bottom: 12px; }
.ans-fig .v { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px; }
.ans-fig .dt { font-size: 64px; line-height: 1; color: var(--accent-text); }
.ans-fig .u { font-size: 22px; font-weight: 300; }
.ans-safe { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); font-size: 14px; margin-top: 14px; }
.ans-safe svg { width: 20px; height: 20px; color: var(--accent-text); }
.cite {
  display: inline-block; margin-left: 3px; padding: 2px 8px; border: 0; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; vertical-align: 1px; line-height: 1.6;
  position: relative;
}
.cite::after { content: ''; position: absolute; inset: -10px -2px; } /* bigger touch area, same look */
.suggest { flex: 1; display: flex; flex-direction: column; padding-bottom: 14px; }
.suggest .hello { margin-top: 8vh; }
.suggest .hello .title { font-size: 34px; }
.suggest .hello p { margin-top: 10px; color: var(--text-2); }
.suggest .pills { margin-top: auto; padding-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { min-height: 44px; padding: 10px 16px; text-align: left; border: 0; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font-size: 14px; font-weight: 600; }
.composer {
  position: sticky; bottom: 0; display: flex; gap: 8px;
  margin: 0 -20px; padding: 10px 16px calc(14px + var(--safe-b));
  background: var(--bg);
}
.composer input:focus, .pin-input:focus, textarea.big:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.composer input { flex: 1; min-width: 0; min-height: 54px; padding: 0 20px; background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line-2); border-radius: 27px; font-size: 16px; }
.composer .iconbtn { width: 54px; height: 54px; }
.composer:not(.typing) .send-when-typing { display: none; }
.composer.typing .mic-when-empty { display: none; }
.notes .note { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; }
.notes { display: grid; gap: 8px; padding-bottom: 12px; }
.notes .who { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.notes .note.new { animation: fade 0.3s; }

/* ---------- full-screen modal (Zápis) ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--bg); animation: up 0.22s ease-out; overflow: hidden; }
.modal[data-stage="record"]::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 48%; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--accent) 6%, var(--bg)) 35%, color-mix(in srgb, var(--accent) 22%, var(--bg)) 75%, color-mix(in srgb, var(--accent) 34%, var(--bg)) 100%);
}
.modal > * { position: relative; }
.modal-bar { display: flex; align-items: center; gap: 8px; min-height: calc(var(--nav-h) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 20px 0; }
.modal-bar .spacer { flex: 1; }
.modal-bar .step { font-family: var(--dots); font-weight: 700; font-size: 26px; line-height: 1; }
.prog { display: flex; gap: 6px; padding: 6px 20px 0; }
.prog i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); }
.prog i.on { background: var(--accent); }
.modal-body { flex: 1; overflow: auto; padding: 0 20px 24px; }
.modal-inner { max-width: 640px; margin: 0 auto; }
.modal-foot { padding: 10px 20px calc(24px + var(--safe-b)); }
.modal-foot .btn-col, .modal-foot .btn-row { max-width: 640px; margin: 0 auto; }
.modal-lead { margin: 24px 0 0; }
.modal-lead .title { font-size: clamp(30px, 9vw, 40px); }
.modal-lead p { margin-top: 10px; color: var(--text-2); }
.modal-backdrop { display: none; }
@media (min-width: 1024px) {
  .modal { inset: 5vh auto auto 50%; width: 680px; height: 90vh; transform: translateX(-50%); border-radius: 32px; box-shadow: var(--shadow); animation: fadein 0.2s; }
  .modal-backdrop { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(14, 35, 38, 0.45); }
}

.mic-wrap { display: grid; justify-items: center; gap: 10px; padding: 48px 0 12px; text-align: center; }
.mic {
  width: 168px; height: 168px; border-radius: 50%; border: 0; display: grid; place-items: center;
  color: #fff; background: var(--accent);
  box-shadow: 0 0 0 16px color-mix(in srgb, var(--accent) 12%, transparent), 0 0 0 34px color-mix(in srgb, var(--accent) 6%, transparent);
}
.mic svg { width: 56px; height: 56px; }
.mic.rec { background: var(--alert); box-shadow: 0 0 0 16px color-mix(in srgb, var(--alert) 18%, transparent); animation: breathe 1.4s infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 30px color-mix(in srgb, var(--alert) 8%, transparent); } }
.mic:disabled { opacity: 0.6; }
.mic-label { font-size: 18px; font-weight: 700; margin-top: 30px; }
.mic-label .think { justify-content: center; font-size: 17px; color: var(--text); }
.mic-sub { color: var(--text-2); max-width: 32ch; font-size: 14px; }
.timer { font-family: var(--dots); font-weight: 700; font-size: 26px; color: var(--alert); }
.said-live { margin-top: 26px; font-size: 20px; font-weight: 300; line-height: 1.4; }
.working { display: grid; justify-items: center; gap: 4px; margin-top: 56px; text-align: center; }
.working .spinner { margin-bottom: 18px; color: var(--text); }
.working b { font-size: 17px; }
.working span { color: var(--text-2); font-size: 14px; }

.form-block { background: var(--surface); margin-top: 16px; border-radius: var(--r-lg); padding: 4px 18px; }
.field { display: block; padding: 12px 0; }
.field + .field { border-top: 1px solid var(--line); }
.field .k { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.field .v { font-weight: 500; }
.field .v + .v { margin-top: 2px; }
.field .code { margin-left: 6px; }
.field input, .field textarea { width: 100%; padding: 4px 0; border: 0; background: none; outline: none; resize: vertical; font-size: 16px; }
.field input { font-weight: 700; }
.field textarea { min-height: 120px; line-height: 1.45; }
.field:focus-within .k { color: var(--accent-text); }
textarea.big { width: 100%; min-height: 200px; margin-top: 18px; padding: 16px 18px; background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line-2); border-radius: var(--r-lg); line-height: 1.45; resize: vertical; font-size: 16px; }
details.said { margin-top: 12px; }
details.said summary { min-height: 48px; display: flex; align-items: center; color: var(--accent-text); font-weight: 600; cursor: pointer; }
details.said p { color: var(--text-2); font-size: 15px; padding-bottom: 8px; }
.valid { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; color: var(--text-2); }
.valid svg { width: 20px; height: 20px; color: var(--accent-text); }
.valid.bad { color: var(--alert); }
.valid.bad svg { color: var(--alert); }

/* SAP result: the sandbox's read-only answer is a designed outcome, not an error */
.result { margin-top: 28px; }
.res-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--accent); }
.res-icon svg { width: 34px; height: 34px; stroke-width: 2.4; }
.result.err .res-icon { background: var(--alert); }
.result .title { margin-top: 22px; }
.result .sub { margin-top: 10px; color: var(--text-2); }
.checks { background: var(--surface); border-radius: var(--r-lg); padding: 4px 18px; margin-top: 20px; }
.checks .ck { display: flex; align-items: center; gap: 12px; padding: 13px 0; font-size: 15px; }
.checks .ck + .ck { border-top: 1px solid var(--line); }
.ck .dot-ok { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; }
.ck .dot-ok svg { width: 14px; height: 14px; stroke-width: 2.6; }
.ck .dot-ok.bad { background: var(--alert); }
.ck .status { flex: none; min-width: 56px; font-family: var(--dots); font-weight: 700; font-size: 26px; color: var(--amber); }
.ck .status.ok { color: var(--accent-text); }
.ck small { display: block; color: var(--text-2); font-size: 13px; }
details.tech { margin-top: 10px; }
details.tech > summary { list-style: none; min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px; font-weight: 600; cursor: pointer; }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(-45deg); }
details.tech[open] > summary::after { transform: rotate(45deg); }
details.tech .kv { margin-bottom: 10px; }
details.raw summary { min-height: 44px; display: flex; align-items: center; color: var(--accent-text); font-weight: 600; font-size: 15px; cursor: pointer; }
pre.json { max-height: 320px; overflow: auto; margin: 0; padding: 12px; font-size: 13px; background: var(--surface); border-radius: var(--r); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- manuals ---------- */
.title-row { display: flex; align-items: center; gap: 12px; }
.title-row .large-title { flex: 1; min-width: 0; }
.title-row .iconbtn { width: 52px; height: 52px; cursor: pointer; }
.docs { display: grid; gap: 12px; margin-top: 18px; }
.doc { background: var(--surface); border-radius: var(--r-lg); padding: 20px; }
.doc-open { display: block; width: 100%; margin: 12px 0 0; padding: 0; border: 0; background: none; text-align: left; color: inherit; min-height: 48px; }
.doc-open .t { font-size: 22px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; overflow-wrap: anywhere; }
.doc-open .s { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.doc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.doc-actions .btn { min-height: 50px; font-size: 15px; padding: 0 12px; cursor: pointer; }
.ingest { border-radius: var(--r-lg); padding: 20px; color: #fff; background-color: var(--hero); background-image: var(--hero-grad); }
.ingest .top { display: flex; align-items: center; gap: 8px; }
.ingest .top .lbl { color: var(--on-hero-2); flex: 1; }
.ingest .name { font-weight: 600; font-size: 14px; margin-top: 8px; overflow-wrap: anywhere; }
.ing-num { display: flex; align-items: baseline; gap: 6px; margin-top: 14px; min-height: 52px; }
.ing-num .dt { font-size: 52px; line-height: 1; }
.ing-num .of { font-size: 26px; color: var(--on-hero-2); }
.bar-outer { height: 8px; margin: 12px 0 0; border-radius: 4px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.bar-outer span { display: block; height: 100%; width: 3%; border-radius: 4px; background: #fff; transition: width 0.4s; }
.ing-step { font-size: 13px; color: var(--on-hero-2); margin-top: 6px; }
.ing-step.err { color: #fff; font-weight: 700; }
.ing-step.ok { color: #fff; font-weight: 700; }
.ingest[data-stage="error"] { background-image: none; background-color: #9b2a1e; }
.whatsnew { margin-top: 18px; }
.whatsnew h3 { font-size: 30px; font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; }
.whatsnew .sum { margin-top: 8px; color: var(--text-2); font-size: 14px; }
.whatsnew ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.whatsnew li { background: var(--bg); border-radius: var(--r-lg); padding: 16px; }
.whatsnew li .a { display: flex; align-items: flex-start; gap: 8px; font-weight: 700; font-size: 17px; }
.whatsnew li .a a { margin-left: auto; flex: none; }
.whatsnew li .w { margin-top: 6px; }
.whatsnew li .i { font-size: 13px; color: var(--text-2); margin-top: 6px; }
.foot { margin-top: 28px; text-align: center; }
.foot .linkbtn { font-size: 14px; }
.pin-input { width: 100%; min-height: 56px; padding: 0 16px; font-size: 22px; letter-spacing: 0.3em; text-align: center; background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line-2); border-radius: 28px; }

/* ---------- login: full green screen ---------- */
body.login-screen { background: var(--hero); }
body.login-screen main { max-width: none; padding: 0; }
.login {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(88px + env(safe-area-inset-top, 0px)) 24px calc(30px + var(--safe-b));
  color: #fff; background-color: var(--hero); background-image: var(--hero-grad);
}
.login::before { content: ''; position: absolute; right: -140px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%); pointer-events: none; }
.login > * { position: relative; max-width: 420px; width: 100%; margin-left: auto; margin-right: auto; }
.login .wordmark { font: 800 24px/1 'Roboto Slab', Rockwell, Georgia, serif; letter-spacing: 0.04em; }
.login h1 { font-family: var(--display); font-size: 46px; line-height: 1.05; font-weight: 400; letter-spacing: -0.02em; margin-top: 26px; }
.login .hint { margin-top: 34px; color: var(--on-hero-2); }
.pin-dots { position: relative; display: flex; gap: 14px; margin-top: 14px; }
.pin-dots span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); }
.pin-dots span.on::after { content: ''; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.pin-dots span.cur { box-shadow: inset 0 0 0 2px #fff; }
.pin-dots input { position: absolute; inset: 0; width: 100%; opacity: 0; border: 0; font-size: 16px; caret-color: transparent; }
.pin-dots:focus-within span.cur { box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px rgba(255, 255, 255, 0.35); }
.login .err { min-height: 24px; margin-top: 14px; font-weight: 700; }
.login .btn { margin-top: auto; background: #fff; color: var(--accent-text); min-height: 62px; border-radius: 31px; }
.login .btn svg { width: 22px; height: 22px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 20px; right: 20px; z-index: 60;
  bottom: calc(var(--tab-h) + var(--safe-b) + 32px);
  display: flex; align-items: center; gap: 10px;
  max-width: 520px; margin: 0 auto; padding: 14px 20px; border-radius: 28px;
  color: var(--on-ink); background: var(--ink); box-shadow: var(--shadow); font-size: 15px; font-weight: 600;
  animation: up 0.2s ease-out;
}
body.has-cta .toast { bottom: calc(var(--safe-b) + 100px); }
body.modal-open .toast { bottom: calc(var(--safe-b) + 100px); }

#modalTitle:focus, #sheetTitle:focus { outline: none; }

/* landscape phones: keep the mic and the actions on one screen */
@media (max-height: 500px) {
  .modal-lead { margin-top: 8px; }
  .modal-lead .title { font-size: 24px; }
  .modal-lead p { display: none; }
  .mic-wrap { padding: 12px 0 4px; gap: 6px; }
  .mic { width: 96px; height: 96px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 12%, transparent); }
  .mic svg { width: 40px; height: 40px; }
  .mic-label { font-size: 16px; margin-top: 8px; }
  .mic-sub { display: none; }
  .modal-foot { padding-bottom: calc(10px + var(--safe-b)); }
  .login { padding-top: 32px; }
  .login h1 { font-size: 32px; margin-top: 12px; }
  .login .hint { margin-top: 14px; }
  .login .btn { margin-top: 16px; }
}

/* ---------- small phones ---------- */
@media (max-width: 360px) {
  .large-title { font-size: 34px; }
  .sap-status .age { display: none; }
  .who .s { display: none; }
  .doc-actions, .btn-row { grid-template-columns: 1fr; }
  .pin-dots { gap: 10px; }
  .pin-dots span { width: 50px; height: 50px; }
  .ev-num { font-size: 36px; }
}

/* ---------- desktop: rail + list | detail ---------- */
@media (min-width: 1024px) {
  :root { --side-w: 236px; }
  .tabbar {
    top: 20px; bottom: 20px; left: 20px; right: auto; width: calc(var(--side-w) - 36px); height: auto;
    flex-direction: column; justify-content: flex-start; gap: 6px; padding: 92px 10px 10px; border-radius: 30px;
  }
  .tabbar::before { content: ''; position: absolute; top: 26px; left: 22px; width: 76px; height: 34px; background: url('/icons/bk-logo.svg') no-repeat left center / contain; }
  .tabbar::after { content: 'Facility Management'; position: absolute; top: 68px; left: 22px; font: 600 11px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: #c8c8c8; }
  .tabbar a { flex: none; justify-content: flex-start; gap: 12px; min-height: 52px; padding: 0 16px; font-size: 16px; }
  .tabbar a:hover:not(.active) { background: rgba(255, 255, 255, 0.08); }
  .nav { z-index: 25; margin-left: var(--side-w); padding-left: 24px; padding-right: 32px; }
  main { max-width: none; margin: 0 0 0 var(--side-w); padding: 0 32px 48px 24px; }
  main.single > * { max-width: 760px; }
  body.has-cta main { padding-bottom: 0; }
  body.has-cta::after { display: none; }
  .split { display: grid; grid-template-columns: 380px minmax(0, 760px); gap: 32px; align-items: start; }
  .split .list-col { position: sticky; top: var(--nav-h); max-height: calc(100vh - var(--nav-h)); overflow: auto; padding: 4px 4px 24px; }
  .cta { position: sticky; left: auto; right: auto; bottom: 0; margin: 20px 0 0; padding: 12px 0 20px; background: linear-gradient(transparent, var(--bg) 35%); }
  .cta .btn { max-width: none; }
  .toast { bottom: 24px; }
  body.has-cta .toast { bottom: 110px; }
  .sheet { left: auto; top: 0; width: 460px; max-height: none; height: 100vh; border-radius: 32px 0 0 32px; animation: side 0.22s ease-out; }
  .sheet.tall { height: 100vh; }
  @keyframes side { from { transform: translateX(24px); opacity: 0.4; } }
  .grabber { display: none; }
  .sheet-bar { padding-top: 18px; }
  .btn:hover { filter: brightness(1.06); }
  .btn.secondary:hover { filter: brightness(0.97); }
  body.login-screen .tabbar, body.login-screen .nav { display: none; }
  body.login-screen main { margin: 0; }
}
@media (max-width: 1023px) {
  .split .list-col { display: none; }
  body.job-screen .tabbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- BK additions: status, prediction, building, object ---------- */
.u-violet { position: relative; display: inline-block; }
.u-violet::after { content: ''; position: absolute; left: -2px; right: -4px; bottom: -6px; height: 5px; border-radius: 4px; background: var(--violet); transform: rotate(-1.2deg); }
.login .wordmark { display: flex; align-items: center; gap: 12px; font: 600 13px/1.2 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-hero-2); }
.login .wordmark img { display: block; width: 90px; height: auto; }
.login .btn { color: #0a0a0a; }
.code-chip { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.chip.bad { background: #c4261a; color: #fff; }
.st-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ok); display: inline-block; }
.st-dot.soon { background: #d99a00; }
.st-dot.due { background: #e0631b; }
.st-dot.overdue { background: var(--alert); }

/* while you are there */
.block.while { border-left: 4px solid var(--violet); }
.block.while h2 { display: flex; align-items: center; gap: 8px; }
.while-list { list-style: none; margin: 8px 0 6px; padding: 0; }
.while-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border: 0; background: none; text-align: left; border-top: 1px solid var(--line); }
.while-list li:first-child .while-row { border-top: 0; }
.while-row .wt { flex: 1; display: flex; flex-direction: column; }
.while-row .wt span { color: var(--text-2); font-size: 14px; }

/* prediction sheet */
.health { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.health .h-t { font: 500 20px/1.2 var(--display); }
.ring { width: 64px; height: 64px; flex: none; }
.ring .rt { fill: none; stroke: var(--fill); stroke-width: 7; }
.ring .rv { fill: none; stroke: var(--ok); stroke-width: 7; stroke-linecap: round; }
.ring.mid .rv { stroke: #d99a00; }
.ring.bad .rv { stroke: var(--alert); }
.ring text { font: 700 18px var(--display); fill: var(--text); }
.pitem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 12px; }
.pitem.overdue { border-color: var(--alert); box-shadow: inset 4px 0 0 var(--alert); }
.pitem.due { box-shadow: inset 4px 0 0 #e0631b; }
.pi-top { display: flex; align-items: center; gap: 10px; }
.pi-top h3 { flex: 1; font: 600 16px/1.3 var(--font); }
.pi-top .chip { flex: none; }
.pi-vals { display: flex; align-items: flex-end; gap: 14px; margin: 12px 0 6px; flex-wrap: wrap; }
.pi-vals > div { display: flex; flex-direction: column; }
.pi-vals .dt { font-size: 28px; line-height: 1; }
.pi-vals .u { font-size: 13px; color: var(--text-2); margin-left: 2px; }
.pi-vals small { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.pi-vals .arrow { color: var(--text-2); font-size: 22px; padding-bottom: 14px; }
.pi-vals > div:first-child { flex-direction: column; }
.pi-basis { margin: 8px 0 4px; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.pi-cons { margin-top: 8px; padding: 8px 10px; border-radius: var(--r); background: var(--amber-bg); color: var(--amber); font-size: 14px; font-weight: 600; }
.kv.tight { margin-top: 8px; }
.pchart { display: block; width: 100%; height: auto; margin: 6px 0; }
.pchart .pc-limit { stroke: var(--alert); stroke-width: 1.4; stroke-dasharray: 5 4; }
.pchart .pc-lt { fill: var(--alert); font: 700 10px var(--font); }
.pchart .pc-today { stroke: var(--line-2); stroke-width: 1; }
.pchart .pc-lbl { fill: var(--text-2); font: 500 10px var(--font); }
.pchart .pc-line { fill: none; stroke: var(--text); stroke-width: 2; }
.pchart .pc-proj { fill: none; stroke: var(--violet); stroke-width: 2.2; stroke-dasharray: 6 5; }
.pchart .pc-pt { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.pchart .pc-now { fill: var(--violet); }
.pchart .pc-due { fill: var(--alert); }
details.method { margin-top: 8px; color: var(--text-2); font-size: 14px; }
details.method summary { cursor: pointer; font-weight: 600; color: var(--text); min-height: 44px; display: flex; align-items: center; }
details.method p { margin-top: 6px; }

/* object screen */
.obj-card .obj-name { font: 500 22px/1.2 var(--display); }
.bld-card { padding: 12px; }
svg.bld { display: block; width: 100%; height: auto; overflow: visible; }
.bld .ground { stroke: var(--text); stroke-width: 1.6; }
.bld .upper { stroke: var(--line-2); stroke-width: 1; }
.bld .hatch { stroke: var(--line); stroke-width: 1.5; }
.bld .floor { fill: var(--surface); stroke: var(--text); stroke-width: 1.6; }
.bld .wall { stroke: var(--line-2); stroke-width: 1; }
.bld .ceiling { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
.bld .lbl { fill: var(--text-2); font: 600 11px var(--font); }
.bld .lbl.dim { fill: var(--text-2); font-weight: 500; }
.bld .ulbl { fill: var(--text); font: 700 10px var(--font); }
.bld .tiny { fill: var(--text-2); font: 600 8px var(--font); }
.bld .unit { fill: var(--fill); stroke: var(--text); stroke-width: 1.4; }
.bld .coil { fill: none; stroke: var(--accent-text); stroke-width: 1.4; }
.bld .louvre line { stroke: var(--text); stroke-width: 1.4; }
.bld .duct { fill: none; stroke: var(--line-2); stroke-width: 7; stroke-linejoin: round; }
.bld .duct.thin { stroke-width: 3; }
.bld .flow { fill: none; stroke-width: 2.4; stroke-dasharray: 4 8; stroke-linejoin: round; animation: flow 1.4s linear infinite; }
.bld .flow.supply { stroke: var(--violet); }
.bld .flow.exhaust { stroke: #c98a2b; }
.bld .flow.refr { stroke: var(--accent-text); stroke-width: 1.4; stroke-dasharray: 2 5; animation-duration: 2.6s; }
.bld .refr:not(.flow) { fill: none; stroke: var(--accent-soft); stroke-width: 4; }
.bld .outlet, .bld .hood { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
.bld .head { fill: var(--fill); stroke: var(--text); stroke-width: 1.2; }
.bld .bracket { stroke: var(--text); stroke-width: 1.4; }
.bld .ofan { fill: none; stroke: var(--text-2); stroke-width: 1.2; }
.bld .panel { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
@keyframes flow { to { stroke-dashoffset: -24; } }
.bld .spot { cursor: pointer; outline: none; }
.bld .spot .hit { fill: transparent; }
.bld .spot .pin { fill: var(--ok); stroke: var(--surface); stroke-width: 2.5; }
.bld .spot.soon .pin { fill: #d99a00; }
.bld .spot.due .pin { fill: #e0631b; }
.bld .spot.overdue .pin { fill: var(--alert); }
.bld .spot text { fill: #fff; font: 800 10px var(--font); pointer-events: none; }
.bld .spot .halo { fill: none; stroke: var(--alert); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: halo 1.6s ease-out infinite; }
.bld .spot:focus-visible .pin { stroke: var(--accent-text); stroke-width: 3; }
@keyframes halo { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(2.1); } }
.bld-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 4px 0; font-size: 13px; color: var(--text-2); }
.bld-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 18px; height: 0; border-top: 3px dashed; display: inline-block; }
.lg.supply { border-color: var(--violet); }
.lg.exhaust { border-color: #c98a2b; }
.lg.refr { border-color: var(--accent-text); border-top-width: 2px; }
.visits { display: grid; gap: 12px; }
.visit .v-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.visit .v-when { flex: 1; font: 600 17px/1.2 var(--display); }
.visit.now { border-left: 4px solid var(--alert); }
.visit ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.visit li { display: flex; gap: 10px; align-items: flex-start; }
.visit li .st-dot { margin-top: 6px; }
.visit li span:last-child { display: flex; flex-direction: column; }
.visit small { color: var(--text-2); font-size: 13px; }
.num-pin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok); color: #fff; font: 800 13px var(--font); }
.num-pin.soon { background: #b27e00; }
.num-pin.due { background: #c8530f; }
.num-pin.overdue { background: var(--alert); }
.trail.hv { font: 700 17px var(--display); color: var(--ok); }
.trail.hv.mid { color: var(--amber); }
.trail.hv.bad { color: var(--alert); }
.form-block .mv { font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .bld .flow, .bld .spot .halo { animation: none; }
}
@media (min-width: 1024px) {
  .visits { grid-template-columns: 1fr 1fr; }
}
.asset-row.child { padding-left: 36px; }
.bld .spot.soon .halo { stroke: #d99a00; }
.bld .spot.due .halo { stroke: #e0631b; }
.notice .m { overflow-wrap: anywhere; }
.msg.ai { overflow-wrap: anywhere; }

/* ---------- Objekt: 3D model of the building ---------- */
.obj-card .seg { margin: 14px 0 0; background: var(--fill); flex-wrap: wrap; }
.obj-card .seg { flex-wrap: nowrap; }
.seg a { flex: 1 1 0; min-width: 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 8px; border-radius: var(--r-lg); font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.seg a.on { background: var(--ink); color: var(--on-ink); }
.seg a i, .group-h i, .zone-tag::before { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.z-ta i, .zone-tag.z-ta::before { background: var(--violet); }
.z-sf i, .zone-tag.z-sf::before { background: #f0a500; }
.b3-card { padding: 0; overflow: hidden; }
.b3-host { position: relative; height: clamp(320px, 62vw, 520px); background: linear-gradient(180deg, #f7f6fb 0%, #ecebf2 100%); touch-action: none; }
.b3-host.flat { height: auto; padding: 12px; background: var(--surface); touch-action: auto; }
.b3-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.b3-canvas:active { cursor: grabbing; }
.b3-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.b3-pin { position: absolute; left: 0; top: 0; pointer-events: auto; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 2.5px solid #fff; background: var(--ok); color: #fff; font: 800 13px var(--font); display: grid; place-items: center; box-shadow: 0 4px 12px -4px rgba(10, 10, 10, 0.55); cursor: pointer; transition: opacity 0.2s; }
.b3-pin::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; } /* 48 px touch target */
.b3-pin.soon { background: #b27e00; }
.b3-pin.due { background: #c8530f; }
.b3-pin.overdue { background: var(--alert); }
.b3-pin.has-job::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid currentColor; color: var(--alert); animation: halo 1.6s ease-out infinite; }
.b3-pin.soon.has-job::before { color: #d99a00; }
.b3-pin.dim, .b3-zone.dim { opacity: 0.3; }
.b3-pin:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
.b3-zone { position: absolute; left: 0; top: 0; padding: 4px 9px; border-radius: 4px; font: 700 12px/1.2 var(--font); color: #fff; white-space: nowrap; letter-spacing: 0.01em; box-shadow: 0 4px 10px -6px rgba(10, 10, 10, 0.6); transition: opacity 0.2s; }
.b3-zone.z-ta { background: #6a32d9; }
.b3-zone.z-sf { background: #8a5a00; }
.b3-tools { display: flex; gap: 8px; margin: -56px 12px 0; position: relative; z-index: 2; justify-content: flex-end; pointer-events: none; }
.chip-btn { pointer-events: auto; min-height: 44px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.92); color: #0a0a0a; font: 600 13px var(--font); cursor: pointer; backdrop-filter: blur(6px); }
.chip-btn[aria-pressed='true'] { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
.b3-card .bld-legend { margin: 14px 16px 0; }
.b3-src { margin: 6px 16px 14px; }
.b3-card .lg.supply { border-color: #2f7df6; }
.b3-card .lg.exhaust { border-color: #f08a24; }
.b3-card .lg.refr { border-color: #a26cfe; }
.zone-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.group-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px; font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.group-h ~ .group-h { border-top: 1px solid var(--line); margin-top: 6px; }
.plan2d { width: 100%; height: auto; display: block; }
.plan2d .pw rect { fill: #3a3a42; }
.plan2d .pz { stroke: none; }
.plan2d .pz.ta { fill: rgba(162, 108, 254, 0.35); }
.plan2d .pz.sf { fill: rgba(240, 165, 0, 0.35); }
.plan2d .spot { cursor: pointer; outline: none; }
.plan2d .spot .hit { fill: transparent; }
.plan2d .spot .pin { fill: var(--ok); stroke: #fff; stroke-width: 0.3; }
.plan2d .spot.soon .pin { fill: #b27e00; }
.plan2d .spot.due .pin { fill: #c8530f; }
.plan2d .spot.overdue .pin { fill: var(--alert); }
.plan2d .spot text { fill: #fff; font: 800 1.3px var(--font); pointer-events: none; }
.plan2d .spot:focus-visible .pin { stroke: var(--accent-text); stroke-width: 0.5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .b3-host:not(.flat) { background: linear-gradient(180deg, #1b1a22 0%, #121117 100%); }
  :root:not([data-theme='light']) .plan2d .pw rect { fill: #d8d8de; }
}

.b3-leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.b3-leaders line { stroke: #0a0a0a; stroke-width: 1.4; opacity: 0.55; }
.b3-leaders circle { fill: #0a0a0a; opacity: 0.7; }
.b3-leaders .dim { opacity: 0.15; }
.b3-pin.has-job::before { inset: -5px; }

/* ---------- Objekt: 3D / Rez / Pôdorys ---------- */
.b3-card .view-seg { margin: 12px 12px 0; background: var(--fill); }
.view-seg button { min-height: 44px; }
.floor-seg { display: flex; gap: 6px; padding: 10px 12px 0; overflow-x: auto; }
.floor-seg button { flex: none; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 13px var(--font); cursor: pointer; }
.floor-seg button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.b3-host.drawing { height: auto; background: #fbfbfd; touch-action: auto; position: relative; margin-top: 12px; }
.dr-scroll { overflow: auto; -webkit-overflow-scrolling: touch; max-height: 72vh; padding: 30px 14px 70px; }
.dr-canvas { position: relative; width: 100%; min-width: 100%; }
.dr-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dr-wall { fill: none; stroke: #0a0a0a; stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.dr-thin { fill: none; stroke: #8a8698; stroke-width: 0.6px; vector-effect: non-scaling-stroke; }
.dr-svg .pz { stroke: none; }
.dr-svg .pz.ta { fill: rgba(162, 108, 254, 0.28); }
.dr-svg .pz.sf { fill: rgba(240, 165, 0, 0.3); }
.dr-canvas .b3-leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dr-canvas .b3-pin { position: absolute; left: 0; top: 0; }
.dr-lbl { position: absolute; font: 700 12px var(--font); color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; pointer-events: none; }
.dr-zone { position: absolute; transform: translate(-50%, -50%); padding: 3px 8px; border-radius: 4px; font: 700 12px var(--font); color: #fff; white-space: nowrap; pointer-events: none; }
.dr-zone.z-ta { background: #6a32d9; }
.dr-zone.z-sf { background: #8a5a00; }
.dr-zoom { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.dr-zoom .chip-btn { width: 44px; padding: 0; font-size: 20px; }

/* ---------- Mapa ---------- */
.map-card { padding: 0; overflow: hidden; }
.map { height: clamp(300px, 52vh, 520px); background: #e9e8ee; z-index: 0; }
.map-pin { display: grid; place-items: center; }
.map-pin span { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; font: 800 14px var(--font); border: 3px solid #fff; box-shadow: 0 6px 14px -6px rgba(10, 10, 10, 0.6); }
.map-pin.problem span { background: #b27e00; }
.map-pin.emergency span { background: var(--alert); animation: halo-pin 1.6s ease-out infinite; }
@keyframes halo-pin { 0% { box-shadow: 0 0 0 0 rgba(208, 40, 27, 0.55); } 100% { box-shadow: 0 0 0 16px rgba(208, 40, 27, 0); } }
.map-pop { display: grid; gap: 4px; min-width: 200px; font: 14px var(--font); }
.map-pop span { color: #595959; }
.map-pop .btn { margin-top: 8px; min-height: 44px; color: #fff; text-decoration: none; }
.leaflet-container { font-family: var(--font); }
.leaflet-control-attribution { font-size: 10px; }
.obj-row { align-items: flex-start; }
.obj-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--ok); }
.obj-dot.problem { background: #b27e00; }
.obj-dot.emergency { background: var(--alert); }
.chip.st-em { background: #fde3e0; color: #a1170c; }
.chip.st-od { background: var(--amber-bg); color: var(--amber); }
.trail.km { font-weight: 700; color: var(--text); }
@media (prefers-reduced-motion: reduce) { .map-pin.emergency span { animation: none; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .b3-host.drawing { background: #f4f4f6; }
  :root:not([data-theme='light']) .chip.st-em { background: #3a1410; color: #ff9d92; }
}

/* four tabs on a phone: icon above a small label */
@media (max-width: 1023px) {
  .tabbar { left: max(12px, calc(50% - 240px)); right: max(12px, calc(50% - 240px)); gap: 4px; padding: 6px; }
  .tabbar a { flex-direction: column; gap: 3px; font-size: 11.5px; font-weight: 600; min-width: 0; padding: 0 4px; border-radius: 27px; }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
.map .leaflet-tile-pane { filter: grayscale(0.9) contrast(0.92) brightness(1.04); }
.nav .who { min-width: 0; }
.nav .who > span:last-child { min-width: 0; overflow: hidden; }
.nav .who .n, .nav .who .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; }

/* ---------- side section diagram + animated floor plan ---------- */
.bld.dia { overflow: visible; }
.bld.dia .pp { fill: #f1f0f4; stroke: var(--line-2); stroke-width: 1; }
.bld.dia .upper { stroke: #9a95ad; stroke-width: 1.2; fill-opacity: 1; }
.bld.dia .slabr { fill: #3a3a42; }
.bld.dia .wallr { fill: #3a3a42; }
.bld.dia .roofl { fill: none; stroke: #0a0a0a; stroke-width: 5; stroke-linejoin: round; }
.bld.dia .glass { fill: #cfe3ff; }
.bld.dia .flow.supply { stroke: #2f7df6; }
.bld.dia .flow.intake { stroke: #8fb8f5; }
.bld.dia .flow.exhaust { stroke: #f08a24; }
.bld.dia .flow.refr { stroke: #a26cfe; }
.bld.dia .refrbg { fill: none; stroke: #ebe0ff; stroke-width: 4; stroke-linejoin: round; }
.bld.dia .lbl { font-size: 12px; }
.bld.dia .tiny { font-size: 9.5px; }
.dia-plan .pduct { fill: none; stroke: #d9d6e3; stroke-width: 7px; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.dia-plan .pflow { fill: none; stroke-width: 2.6px; vector-effect: non-scaling-stroke; stroke-dasharray: 4 8; stroke-linejoin: round; animation: flow 1.4s linear infinite; }
.dia-plan .pflow.supply { stroke: #2f7df6; }
.dia-plan .pflow.intake { stroke: #8fb8f5; }
.dia-plan .pflow.exhaust { stroke: #f08a24; }
.dia-plan .pflow.refr { stroke: #a26cfe; stroke-width: 1.8px; stroke-dasharray: 2 5; animation-duration: 2.6s; }
.dia-plan .punit { fill: #26262b; stroke: #fff; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.dia-plan .punit.outdoor { fill: #f4f4f4; stroke: #0a0a0a; }
.dia-plan .punit.panel { fill: #d8d8dc; stroke: #0a0a0a; }
.dia-plan .pout { fill: #fff; stroke: #2f7df6; stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
.dia-plan .phood { fill: #fff; stroke: #f08a24; stroke-width: 1.4px; vector-effect: non-scaling-stroke; }
@media (prefers-reduced-motion: reduce) { .dia-plan .pflow, .bld.dia .flow { animation: none; } }
/* status pins carry white numbers: fixed dark-enough fills in both themes (≥ 4.5:1) */
.b3-pin, .num-pin { background: #03754e; }
.b3-pin.soon, .num-pin.soon { background: #8a5a00; }
.b3-pin.due, .num-pin.due { background: #b0440c; }
.b3-pin.overdue, .num-pin.overdue { background: #c4261a; }
.plan2d .spot .pin { fill: #03754e; }
.plan2d .spot.soon .pin { fill: #8a5a00; }
.plan2d .spot.due .pin { fill: #b0440c; }
.plan2d .spot.overdue .pin { fill: #c4261a; }
.map-pin span { background: #03754e; }
.map-pin.problem span { background: #8a5a00; }
.map-pin.emergency span { background: #c4261a; }
.obj-dot.benu { background: #0b8a4d; }
.obj-search { margin-top: 14px; }
.obj-search input { width: 100%; min-height: 48px; padding: 0 16px; border-radius: 24px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 500 16px var(--font); }
.obj-search input:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 1px; }
button.row.obj-row { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 0; cursor: pointer; }
.map .leaflet-bar a.leaflet-disabled { color: #6b6b6b; background: #f4f4f4; }
