/* TivCo maintenance — industrial, data-dense, thumb-friendly.
   Layout: desktop = side rail (right, RTL) + content; phone = compact top bar + bottom tab bar + floating "log work" button. */
:root {
  --bg: #eef2f4; --surface: #ffffff; --surface-2: #f6f8f9; --ink: #13202a; --muted: #566876; --line: #dbe2e7; --line-2: #c5d0d7;
  --steel: #1d3646; --steel-2: #284a5e; --on-steel: #ffffff; --on-steel-muted: #b9cbd6;
  --accent: #e3a400; --accent-ink: #261a00; --accent-soft: #fff3cf;
  --ok: #1d7a49; --ok-soft: #e3f4ea; --warn: #9a5a00; --warn-soft: #fdf0dc; --bad: #b42318; --bad-soft: #fde8e6;
  --chip: #e9eef1; --water: #d6e6f3; --equip: #e8743b; --pile: #9a6a45; --pipe: #6f7f86;
  --sh-1: 0 1px 2px rgba(16, 32, 42, .06), 0 1px 3px rgba(16, 32, 42, .06);
  --sh-2: 0 4px 12px rgba(16, 32, 42, .10), 0 2px 4px rgba(16, 32, 42, .06);
  --r: 10px; --r-sm: 7px;
  --font-body: "IBM Plex Sans Hebrew", "Segoe UI", Arial, sans-serif;
  --font-code: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --side-w: 232px; --bottom-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1518; --surface: #172025; --surface-2: #1c272d; --ink: #e6edf1; --muted: #9db0bc; --line: #2a3840; --line-2: #3a4a53;
  --steel: #0b1418; --steel-2: #1b2a31; --on-steel: #e6edf1; --on-steel-muted: #8fa5b2;
  --accent: #f0b622; --accent-ink: #1f1700; --accent-soft: #3a2f10;
  --ok: #5fc58c; --ok-soft: #173326; --warn: #eda94a; --warn-soft: #3a2a12; --bad: #f2776d; --bad-soft: #3d1c1a;
  --chip: #233038; --water: #1f3646; --equip: #d9662e; --pile: #b5845c; --pipe: #8a9aa1;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --sh-2: 0 6px 16px rgba(0, 0, 0, .45);
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0f1518; --surface: #172025; --surface-2: #1c272d; --ink: #e6edf1; --muted: #9db0bc; --line: #2a3840; --line-2: #3a4a53;
  --steel: #0b1418; --steel-2: #1b2a31; --on-steel: #e6edf1; --on-steel-muted: #8fa5b2;
  --accent: #f0b622; --accent-ink: #1f1700; --accent-soft: #3a2f10;
  --ok: #5fc58c; --ok-soft: #173326; --warn: #eda94a; --warn-soft: #3a2a12; --bad: #f2776d; --bad-soft: #3d1c1a;
  --chip: #233038; --water: #1f3646; --equip: #d9662e; --pile: #b5845c; --pipe: #8a9aa1;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35); --sh-2: 0 6px 16px rgba(0, 0, 0, .45);
  color-scheme: dark }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; overflow-x: clip; -webkit-tap-highlight-color: transparent; }
.code { font-family: var(--font-code); font-weight: 500; letter-spacing: .01em; direction: ltr; unicode-bidi: isolate; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600; }
.skip:focus { top: 8px; }

/* ---------- shell ---------- */
.app { min-height: 100dvh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side { border-inline-end: 1px solid var(--line); position: sticky; top: 0; height: 100dvh; overflow-y: auto; overflow-x: hidden; background: var(--steel); color: var(--on-steel); display: flex; flex-direction: column; gap: 4px;
  padding: max(16px, env(safe-area-inset-top, 0px)) 12px 16px; }
.side .brand { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 8px 16px; }
.side .brand h1 { margin: 0; font-size: 1.35rem; font-weight: 700; line-height: 1; }
.side .brand small { display: block; font-size: .75rem; color: var(--on-steel-muted); font-weight: 500; }
.logo { height: 38px; width: auto; border-radius: 6px; }
.side .sec { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--on-steel-muted); padding: 10px 10px; border-radius: var(--r-sm); font-weight: 500; text-align: start; transition: background .15s var(--ease), color .15s var(--ease); }
.side .sec:hover { background: var(--steel-2); color: var(--on-steel); }
.side .sec[aria-current="true"] { background: var(--steel-2); color: var(--on-steel); }
.side .sec[aria-current="true"] .ic { color: var(--accent); }
.side .subs { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 8px; margin-inline-start: 30px; border-inline-start: 1px solid var(--steel-2); }
.side .subs button { border: 0; background: none; color: var(--on-steel-muted); text-align: start; padding: 7px 12px; border-radius: 6px; font-size: .92rem; }
.side .subs button:hover { color: var(--on-steel); }
.side .subs button[aria-current="page"] { color: var(--on-steel); font-weight: 600; background: rgba(255, 255, 255, .06); }
.side .foot { margin-top: auto; padding: 10px 8px 0; font-size: .78rem; color: var(--on-steel-muted); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-inline-start: auto; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 700; line-height: 1; }

.col { min-width: 0; display: flex; flex-direction: column; }
header.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-left, 0px)) 10px max(24px, env(safe-area-inset-right, 0px)); }
header.top .mob-brand { display: none; }
header.top .ttl { display: flex; flex-direction: column; min-width: 0; flex: 1; }
header.top .ttl small { color: var(--muted); font-size: .78rem; font-weight: 500; }
header.top h2 { margin: 0; font-size: 1.25rem; font-weight: 700; line-height: 1.25; }
.stamp { font-size: .8rem; color: var(--warn); background: var(--warn-soft); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.stamp:empty { display: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 12px; box-shadow: var(--sh-1); }
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.mob-subs { display: none; }
.mob-subs { gap: 6px; padding: 12px 24px 0; overflow-x: auto; scrollbar-width: none; }
.mob-subs::-webkit-scrollbar { display: none; }
.mob-subs button { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 99px; font-size: .9rem; min-height: 40px; }
.mob-subs button[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.mob-subs[hidden] { display: none !important; }
@media (max-width: 760px) { .mob-subs { padding: 10px 16px 0; } }
main { width: 100%; max-width: 1320px; margin: 0 auto; padding: 20px max(24px, env(safe-area-inset-left, 0px)) 48px max(24px, env(safe-area-inset-right, 0px)); }

nav.bottom, .fab { display: none; }

#toast { position: fixed; inset: auto 0 0; margin: 0 auto calc(20px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100vw - 32px); z-index: 60;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; box-shadow: var(--sh-2); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
#toast.show { opacity: 1; transform: none; }
#toast.has-action.show { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast-btn { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; padding: 4px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn.add-row { width: 100%; justify-content: center; border-style: dashed; margin-top: 8px; }
.trash-items { font-size: .85rem; color: var(--muted); }
/* tool photos */
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); vertical-align: middle; flex: none; }
.tool-lead { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.chk-text .thumb { margin-inline-end: 8px; }
.photos .ph { position: relative; display: inline-block; }
.photos .ph-x { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 12px; cursor: pointer; line-height: 22px; padding: 0; }
/* catalog: an item that can replace (≈) rather than the type fitted */
.chip.fit { border-style: dashed; border-color: var(--accent); }
.chip.fit .pill { margin-inline-start: 4px; }
h4.sub-h { font-size: .85rem; color: var(--muted); margin: 12px 0 6px; }
/* plant map: unit states and the editor */
.mimic .eq.off { opacity: .45; }
.mimic .eq.off .body { stroke-dasharray: 3 3; }
.mimic .eq.down .body { stroke: var(--bad) !important; stroke-width: 3; }
.mimic .sub.state { font-size: 12px; fill: var(--muted); }
.mimic.edit { outline: 2px dashed var(--accent); outline-offset: -2px; }
.mimic svg.editing .eq { cursor: grab; }
.mimic svg.editing.picking, .mimic svg.editing.picking .eq { cursor: crosshair; }
.mimic svg.editing .eq.sel .body { stroke: var(--accent); stroke-width: 3; }
.mimic .sel-box { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 6 4; }
.mimic .pipe-hit { stroke: transparent; stroke-width: 16; fill: none; cursor: pointer; pointer-events: stroke; }
.mimic .pipe.sel { stroke: var(--accent); stroke-width: 3; stroke-dasharray: none; }
.mimic .handles circle { stroke: var(--accent); stroke-width: 2; cursor: move; }
.mimic .handles .h-end { fill: var(--surface); }
.mimic .handles .h-end.attached { fill: var(--accent); }
.mimic .handles .h-via { fill: var(--accent-soft); }
.mimic .handles .h-ins { fill: var(--surface); stroke-dasharray: 2 2; opacity: .8; cursor: copy; }
.map-edit-bar { display: grid; gap: 8px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 10px; }
.map-edit-bar .row1, .map-edit-bar .row2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.map-edit-bar select { width: auto; max-width: 100%; }
/* settings */
.mob-only { display: none !important; }
@media (max-width: 760px) { .mob-only { display: inline-flex !important; } }
.set-page { display: grid; gap: 16px; }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px; box-shadow: var(--sh-1); }
.set-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-h h3 { margin: 0; font-size: 1rem; }
.set-rows { display: grid; gap: 6px; }
.set-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.set-row > input, .set-row > select { flex: 1 1 160px; min-width: 0; width: auto; }
.set-row > input.short { flex: 0 0 90px; }
.set-btns { display: flex; gap: 4px; align-items: center; margin-inline-start: auto; }
.set-n { display: inline-flex; justify-content: center; width: 34px; flex: none; }
.btn.icon-btn.set-del { color: var(--muted); }
.btn.icon-btn.set-del:hover { color: var(--bad); background: var(--bad-soft); }
.btn.icon-btn.set-del .ic { width: 17px; height: 17px; }
.set-check { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; white-space: nowrap; }
.set-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.set-line > span:first-child { min-width: 220px; font-weight: 500; }
.set-line input.short, .set-page input.short { width: 90px; flex: none; }
.wk { display: flex; gap: 12px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; display: grid; }
.stat strong { font-size: 1.3rem; }
@media (max-width: 760px) { .set-line > span:first-child { min-width: 0; width: 100%; } }
/* work report: what-happened tiles */
.work-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.work-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); min-height: 96px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.work-tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.work-tile .ico { font-size: 1.5rem; line-height: 1; }
.work-tile strong { font-size: 1rem; }
.work-tile .note { font-size: .8rem; }
.picked { display: flex; flex-direction: column; gap: 6px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }
@media (max-width: 760px) { .work-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .work-tile { min-height: 84px; padding: 12px; } }
/* inspection rounds */
.run-body { padding-bottom: 0; }
.chk-zone { margin: 18px 0 8px; font-size: .82rem; color: var(--muted); font-weight: 700; text-transform: none; }
.chk-row { border: 1px solid var(--line); border-inline-start: 4px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); padding: 10px 12px; margin-bottom: 8px; display: grid; gap: 10px; }
.chk-row[data-s="ok"] { border-inline-start-color: var(--ok); }
.chk-row[data-s="bad"] { border-inline-start-color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 45%, var(--surface)); }
.chk-row[data-s="na"] { opacity: .6; }
.chk-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.chk-text { min-width: 0; line-height: 1.4; }
.chk-btns { display: flex; gap: 6px; flex: none; }
.chk-btns button { width: 46px; height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); font-size: 1.15rem; font-weight: 800; color: var(--muted); cursor: pointer; }
.chk-btns button.ok[aria-pressed="true"] { background: var(--ok); color: #fff; border-color: transparent; }
.chk-btns button.bad[aria-pressed="true"] { background: var(--bad); color: #fff; border-color: transparent; }
.chk-btns button.na[aria-pressed="true"] { background: var(--muted); color: var(--surface); border-color: transparent; }
.chk-panel { display: grid; gap: 8px; }
.chk-panel textarea { width: 100%; }
/* category cards (core/groups.js) and the bar above a category's list */
.grp-all { gap: 6px; }
.grp-back { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; }
.grp-back strong { font-size: 1.05rem; }
.grp-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
@media (max-width: 760px) { .grp-jump { margin-inline-start: 0; width: 100%; } }
/* raw-material request lines: name · qty · unit · note · stock tick · ✕, the catalog link under a ticked line */
.mr-items { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.mr-item { display: grid; grid-template-columns: minmax(0, 1.6fr) 80px 90px minmax(0, 1.2fr) auto auto; gap: 8px; width: 100%; align-items: center; padding: 6px 8px; border-radius: 10px; }
.mr-item.track { background: var(--surface-2); }
.mr-item.mr-head { padding-block: 0; font-size: .78rem; font-weight: 600; color: var(--muted); }
.mr-stock { white-space: nowrap; }
.mr-dest { width: 150px; min-width: 0; }
.mr-link { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.mr-link select { flex: 1; }
.mr-body { display: flex; flex-direction: column; gap: 14px; }
.mr-steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.mr-steps li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .85rem; }
.mr-steps li .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line, #dde3e6); font-size: .75rem; font-weight: 700; }
.mr-steps li.cur { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.mr-steps li.cur .n { background: rgba(255, 255, 255, .3); }
.mr-steps li.done { color: var(--ok, #2b8a3e); }
.mr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .9rem; color: var(--muted); }
.mr-meta label { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.mr-meta input { width: 200px; padding: 6px 10px; }
.mr-notes { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.mr-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; padding-top: 4px; border-top: 1px solid var(--line, #dde3e6); padding-top: 12px; }
.mr-free { border: 1px dashed var(--line, #ccd5d9); border-radius: 12px; padding: 10px 12px; }
.mr-free summary { cursor: pointer; font-weight: 600; }
.mr-free textarea { width: 100%; margin-top: 8px; }
.mr-pact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.mr-preview { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mr-prow { display: grid; grid-template-columns: auto minmax(0, 1.6fr) 70px 80px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.dlg-head .mr-menu { position: relative; margin-inline-start: auto; }
.mr-menu summary { list-style: none; cursor: pointer; }
.mr-menu summary::-webkit-details-marker { display: none; }
.mr-menu-list { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 5; min-width: 240px; display: flex; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--line, #dde3e6); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 6px; }
.mr-menu-list .linkbtn { text-align: start; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.mr-menu-list .linkbtn:hover { background: var(--surface-2); }
.mr-menu-list .linkbtn.danger { color: var(--bad, #c92a2a); }
@media (max-width: 760px) {
  .mr-item { grid-template-columns: minmax(0, 1fr) 70px 100px auto; }
  .mr-item.mr-head { display: none; }
  .mr-item > input[type=text]:first-child { grid-column: 1 / -1; }
  .mr-item > input[id^=mr_t_] { grid-column: 1 / 3; }
  .mr-prow { grid-template-columns: auto minmax(0, 1fr) 60px 70px; }
  .mr-prow > .note, .mr-prow > .pill { grid-column: 2 / -1; }
}
.pdf-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 10px 12px; }
.pdf-cols-h { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-bottom: 2px; }
.pdf-cols label.check { margin: 0; }
.chk-panel.tool-shot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chk-panel.tool-shot.need { border-inline-start: 3px solid var(--warn); padding-inline-start: 8px; }
.chk-panel.tool-shot .thumb { width: 56px; height: 56px; }
.photos .ph-main img { outline: 2px solid var(--accent, var(--ok)); outline-offset: 1px; }
.photos .ph-star { position: absolute; bottom: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--surface); color: var(--warn); font-size: 13px; cursor: pointer; line-height: 22px; padding: 0; box-shadow: 0 0 0 1px var(--line, #ccc); }
.sev-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.due-row { display: flex; gap: 10px; flex-wrap: wrap; }
.due-row label { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.due-row input, .due-row select { width: auto; }
.photo-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* a record's documents (PDF / scans): a chip per file, a tap opens it */
.docs { display: flex; gap: 6px; flex-wrap: wrap; }
.docs .doc { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 4px 8px; }
.docs .doc a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; }
.docs .doc a:hover { text-decoration: underline; }
.docs .ph-x { width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 11px; cursor: pointer; line-height: 20px; padding: 0; }
body[data-role=viewer] .docs .ph-x { display: none; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photos img, .cpics img, a > img.thumb { cursor: zoom-in; }
/* core/photos.js photoViewer: a photo big inside the app */
dialog.pv { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
dialog.pv::backdrop { background: rgba(0,0,0,.6); }
.pv-img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pan-y pinch-zoom; user-select: none; }
.pv-x, .pv-nav { position: absolute; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; display: grid; place-items: center; }
.pv-x { top: 12px; inset-inline-end: 12px; width: 44px; height: 44px; font-size: 20px; }
.pv-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 30px; line-height: 1; }
.pv-prev { inset-inline-start: 10px; } .pv-next { inset-inline-end: 10px; }
.pv-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; background: rgba(0,0,0,.4); padding: 2px 10px; border-radius: 10px; }
.photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.run-foot { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); z-index: 2; }
.run-foot .spacer { flex: 1; }
.used-parts { display: grid; gap: 6px; margin-top: 4px; }
.used-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 90px auto; gap: 6px; align-items: center; }
#formDlg .f > .wide, #formDlg .f > dl.kv, #formDlg .f > .photo-row { grid-column: 1 / -1; }
#formDlg h4 { margin: 16px 0 8px; }
#formDlg .dlg-body > .actions { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: -20px; background: var(--surface); padding: 12px 0 calc(4px + env(safe-area-inset-bottom, 0px)); margin-top: 12px; border-top: 1px solid var(--line); z-index: 1; }
#formDlg .dlg-body > .actions .spacer { flex: 1; }
@media (max-width: 760px) { .chk-head { flex-direction: column; align-items: stretch; } .chk-btns button { flex: 1; width: auto; height: 48px; } .used-row { grid-template-columns: minmax(0, 1fr) 60px; } }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--sh-1); border-inline-start: 4px solid var(--line-2); transition: transform .15s var(--ease), box-shadow .15s var(--ease); min-width: 0; }
.kpi:hover { box-shadow: var(--sh-2); }
.kpi:active { transform: scale(.98); }
.kpi .v { font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .85rem; color: var(--muted); font-weight: 500; }
.kpi.bad { border-inline-start-color: var(--bad); } .kpi.bad .v { color: var(--bad); }
.kpi.warn { border-inline-start-color: var(--warn); } .kpi.warn .v { color: var(--warn); }
.kpi.ok { border-inline-start-color: var(--ok); } .kpi.ok .v { color: var(--ok); }
.kpi-ok { display: none; grid-column: 1 / -1; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- generic ---------- */
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.bar .grow { flex: 1 1 220px; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: var(--r-sm); min-height: 40px; box-shadow: var(--sh-1); transition: border-color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease); }
.btn:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.04); background: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; min-height: 32px; font-size: .86rem; white-space: nowrap; box-shadow: none; }
/* icon buttons and action menus (core/ui.js: ibtn, menuBtn, moreMenu, exportMenu) */
.btn.icon-btn { padding: 0; width: 40px; min-width: 40px; height: 40px; flex: none; }
.btn.small.icon-btn, .row-side .btn.icon-btn, .card-a .btn.icon-btn, .dlg-head .btn.icon-btn { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
.btn.icon-btn .ic { width: 19px; height: 19px; }
.btn.icon-btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.icon-btn.ghost:hover { background: var(--surface-2); }
details.menu { position: relative; display: inline-block; flex: none; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--surface-2); border-color: var(--line-2); }
details.menu.primary > summary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* the purchasing screen: the "to order now" block and the kind tag of each document */
details.buy-reco { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 10px 12px; margin-bottom: 14px; }
details.buy-reco > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; list-style: none; }
details.buy-reco > summary::-webkit-details-marker { display: none; }
details.buy-reco[open] > summary { margin-bottom: 8px; }
details.buy-reco .list { box-shadow: none; }
.doc-kind { display: inline-block; min-width: 54px; text-align: center; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.doc-kind.po { background: var(--water); color: var(--steel); }
.doc-kind.mr { background: var(--accent-soft); color: var(--warn); }
.menu-list { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; max-width: min(320px, 90vw); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-2); padding: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; text-align: start; padding: 9px 10px; border: 0; background: none; border-radius: var(--r-sm); color: var(--ink); font: inherit; cursor: pointer; white-space: nowrap; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); }
.menu-item .ic { width: 17px; height: 17px; color: var(--muted); flex: none; }
.menu-item.danger, .menu-item.danger .ic { color: var(--bad); }
details.fold { border-top: 1px solid var(--line); padding-top: 4px; }
details.fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
:root[dir=rtl] details.fold > summary::before, [dir=rtl] details.fold > summary::before { content: '◂'; }
details.fold[open] > summary::before { transform: rotate(-90deg); }
[dir=rtl] details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary h4 { margin: 8px 0; }
.save-state { margin-inline-start: auto; }
.pill-btn { border: 0; cursor: pointer; font: inherit; }
.pill-btn:hover { filter: brightness(.96); }
td.row-icons { white-space: nowrap; width: 1%; }
.del-confirm { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-list { display: flex; flex-direction: column; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row > span:first-child { flex: 1; font-weight: 500; }
.set-grip { display: inline-grid; place-items: center; width: 22px; height: 32px; cursor: grab; color: var(--muted); touch-action: none; flex: none; }
.set-grip .ic { width: 16px; height: 16px; }
.set-row.dragging { background: var(--accent-soft); border-radius: var(--r-sm); }
/* a dialog footer: the main action first, nothing else; a delete waits for a second press here */
.dlg-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.dlg-head .menu { margin-inline-start: auto; }
.dlg-head .menu + .btn, .dlg-head .menu + button { margin-inline-start: 0; }
input[type=search], input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 40px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: 8px 12px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type=search] { padding-inline-start: 38px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23748591' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.note { color: var(--muted); font-size: .88rem; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 1px solid var(--line); border-inline-start: 4px solid var(--warn); background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: 16px; box-shadow: var(--sh-1); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.summary { margin: 0 0 12px; font-weight: 500; }
.only-phone { display: none; }
.hide-sm { }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 500; white-space: nowrap; background: var(--chip); color: var(--muted); }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.bad { color: var(--bad); background: var(--bad-soft); }
.pill.mute { color: var(--muted); background: var(--chip); }
.pill.ok::before, .pill.warn::before, .pill.bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); border: 1px solid transparent; border-radius: var(--r-sm); padding: 4px 9px; font-size: .86rem; text-align: start; max-width: 100%; transition: border-color .15s var(--ease); }
.chip:hover { border-color: var(--line-2); }
.chip .nm { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14em; }
.chip.unver { border-style: dashed; border-color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); } .dot.ok { background: var(--ok); }
section.group { margin-bottom: 16px; } section.group h3 { margin: 0 0 8px; font-size: .95rem; color: var(--muted); font-weight: 600; }

/* search results */
.results { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px; box-shadow: var(--sh-2); }
.result { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 10px; border-radius: var(--r-sm); text-align: start; min-width: 0; min-height: 44px; }
.result:hover { background: var(--surface-2); }
.result .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* plant map */
.mimic { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; box-shadow: var(--sh-1); }
.mimic svg { display: block; width: 100%; height: auto; font-family: var(--font-body); }
/* the plant map always fits the screen; on small screens labels grow so codes stay readable, and "הגדלה" switches to a wide, scrollable view */
.mimic.zoom svg { width: 1400px; max-width: none; }
.map-zoom { margin-inline-start: auto; }
@media (min-width: 1101px) { .map-zoom { display: none !important; } }
@media (max-width: 1100px) { .mimic:not(.zoom) .lbl { font-size: 24px; } .mimic:not(.zoom) .sub { display: none; } }
@media (max-width: 760px) { .mimic:not(.zoom) .lbl { font-size: 34px; } .mimic:not(.zoom) .flag-bad, .mimic:not(.zoom) .flag-warn { transform-box: fill-box; transform-origin: center; transform: scale(2); } }
.mimic .eq { cursor: pointer; }
.mimic .eq .body { fill: var(--chip); stroke: var(--steel-2); stroke-width: 2; transition: stroke .15s; }
:root .mimic .eq .body { stroke: var(--muted); }
/* the plain map stays neutral: colour on the map always means data (status dots, heat), never decoration */
.mimic .eq .tank { fill: var(--chip); }
.mimic .eq .hot { fill: var(--chip); }
.mimic .eq .line { stroke: var(--muted); stroke-width: 2; fill: none; }
.mimic .eq .hatch { stroke: var(--line-2); stroke-width: 2; opacity: 1; }
.mimic .eq:hover .body, .mimic .eq:focus-visible .body { stroke: var(--accent); stroke-width: 3; }
.mimic .eq:focus { outline: none; }
.mimic .eq.unver .body { stroke-dasharray: 5 3; }
.mimic .lbl { font: 600 15px var(--font-code); fill: var(--ink); text-anchor: middle; }
.mimic .sub { font-size: 12px; fill: var(--muted); text-anchor: middle; }
.mimic .pipe { stroke: var(--pipe); stroke-width: 1.6; stroke-dasharray: 5 4; fill: none; }
.mimic .pile { fill: var(--line); }
.mimic .flag-bad { fill: var(--bad); } .mimic .flag-warn { fill: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
details.zones { margin-bottom: 16px; }
details.zones > summary { cursor: pointer; font-weight: 600; padding: 10px 0; list-style-position: inside; }
.zone-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.module { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 14px; min-width: 0; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sh-1); }
.module header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.module h3 { margin: 0; font-size: 1rem; }
.sign { font-family: var(--font-code); font-size: .7rem; background: var(--chip); color: var(--muted); padding: 2px 7px; border-radius: 4px; white-space: nowrap; direction: ltr; }

/* tables */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { position: sticky; top: 0; z-index: 2; font-size: .76rem; letter-spacing: .02em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
/* frozen header row: a register table on the screen scrolls inside its own frame (up to the bottom of the window), so
   the column titles and their filter buttons stay in sight however long the list (Vadim: "как в Excel") */
@media (min-width: 761px) { #view .tablewrap { max-height: calc(100dvh - var(--top-h, 72px) - 32px); overflow: auto; } }
th .th-f { margin-inline-start: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); border-radius: 5px; font: inherit; font-size: .72rem; line-height: 1; padding: 3px 5px; cursor: pointer; }
th .th-f.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
tfoot td { background: var(--surface-2); border-top: 1px solid var(--line); }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); }
td.num { text-align: center; }

/* attention */
.att-page { max-width: 900px; display: flex; flex-direction: column; gap: 14px; }
.att-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.att-summary .pill { font-size: .86rem; padding: 4px 12px; }
.att-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); }
.att-block h3, .att-block summary { margin: 0; padding: 12px 16px; font-size: 1rem; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.att-block summary { cursor: pointer; font-weight: 600; border-bottom: 0; }
.att-block[open] summary { border-bottom: 1px solid var(--line); }
.att-block.quiet summary { color: var(--muted); font-weight: 600; }
.att-rows { display: flex; flex-direction: column; }
.att-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 12px 16px; text-align: start; min-width: 0; min-height: 52px; }
.att-row:last-child { border-bottom: 0; }
.att-row:hover { background: var(--surface-2); }
.att-title { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.att-title .note { font-size: .84rem; font-weight: 400; }
.att-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; flex: none; max-width: 55%; }

/* log */
.loglist { display: flex; flex-direction: column; gap: 8px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--line-2); border-radius: var(--r-sm); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start; box-shadow: var(--sh-1); }
.entry.fault { border-inline-start-color: var(--bad); }
.entry.in { border-inline-start-color: var(--ok); }
.entry .when { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; white-space: nowrap; padding-top: 2px; }
.entry .body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.entry .body > div:first-child { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.entry .meta { font-size: .82rem; color: var(--muted); }

/* purchasing */
.order-items { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.order-item { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.5fr) 80px 100px auto; gap: 8px; width: 100%; align-items: center; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.order-actions input[type=text] { flex: 1 1 220px; width: auto; }
.approve-box { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 12px; border: 1px solid var(--warn); background: var(--warn-soft); border-radius: var(--r-sm); }
.approve-box .row { display: flex; gap: 8px; }
ul.hist { margin: 6px 0 0; padding-inline-start: 18px; font-size: .88rem; color: var(--muted); }

/* tools */
.tool-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 78px; height: 26px; border-radius: 4px;
  background: var(--b-bg); color: var(--b-fg); font: 800 .72rem/1 "Arial Black", "Segoe UI", Arial, sans-serif; letter-spacing: .02em; direction: ltr; overflow: hidden; white-space: nowrap; }
.brand-badge.none { background: var(--chip); color: var(--muted); border: 1px dashed var(--line-2); font-weight: 700; }

/* dialogs */
dialog:focus { outline: none; }
dialog { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); width: min(760px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-shadow: 0 24px 64px rgba(0, 0, 0, .28); }
dialog[open] { animation: dlg-in .2s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(8, 14, 18, .5); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.dlg-head h2 { margin: 0; font-size: 1.1rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dlg-head .btn.small[aria-label] { min-width: 36px; min-height: 36px; }
.dlg-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.dlg-body h4 { margin: 0 0 8px; font-size: .95rem; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .92rem; background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; }
form.f, div.f { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
form.f label, div.f label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; color: var(--muted); font-weight: 500; min-width: 0; }
form.f label > input, form.f label > select, form.f label > textarea, div.f label > input, div.f label > select, div.f label > textarea { color: var(--ink); font-weight: 400; }
form.f label.wide, div.f label.wide, div.f > .wide { grid-column: 1 / -1; }
form.f label.check, div.f label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; min-height: 40px; cursor: pointer; }
form.f label.check > input[type=checkbox], div.f label.check > input[type=checkbox] { width: 20px; height: 20px; flex: none; margin: 0; }
/* a group of fields in a form (core/forms.js { section }) and fields that follow a checkbox (showIf) */
.f-group { grid-column: 1 / -1; margin: 0; padding: 10px 14px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.f-group > legend { padding: 0 6px; font-weight: 600; font-size: .95rem; color: var(--ink); }
.f-group > .note { margin: 0 0 8px; }
.f-group input, .f-group select, .f-group textarea { background: var(--surface); }
form.f label[hidden], div.f label[hidden] { display: none; }
form.f .actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-start; position: sticky; bottom: -20px; background: var(--surface); padding: 12px 0 4px; margin-top: 4px; border-top: 1px solid var(--line); z-index: 1; }
form.f .actions .spacer { flex: 1; }
.err { color: var(--bad); grid-column: 1 / -1; font-size: .88rem; }
.err:empty { display: none; }

/* ---------- tablet: rail collapses to icons ---------- */
@media (max-width: 1100px) and (min-width: 761px) {
  :root { --side-w: 76px; }
  .side { padding-inline: 8px; align-items: stretch; }
  .side .brand { justify-content: center; gap: 0; padding: 4px 0 14px; }
  .side .brand > :not(.logo) { display: none; }
  .side .brand .logo { max-width: 52px; height: auto; }
  .side .brand h1, .side .brand small, .side .subs, .side .foot { display: none; }
  .side .sec .lbl { font-size: .7rem; text-align: center; }
  .side .sec { flex-direction: column; gap: 2px; justify-content: center; padding: 10px 4px; font-size: .7rem; position: relative; }
  .side .sec .lbl-s { display: block; }
  .side .sec .count { position: absolute; top: 4px; inset-inline-end: 6px; margin: 0; }
  .mob-subs { display: flex; }
}
.side .sec .lbl-s { display: none; }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .app { display: block; }
  .side { display: none; }
  header.top { background: var(--steel); color: var(--on-steel); border: 0; backdrop-filter: none; padding: max(8px, env(safe-area-inset-top, 0px)) 16px 8px; gap: 10px; }
  header.top .mob-brand { display: block; }
  header.top .logo { height: 30px; }
  header.top .ttl small { color: var(--on-steel-muted); }
  header.top h2 { font-size: 1.08rem; }
  header.top .icon-btn { background: var(--steel-2); border-color: transparent; color: var(--on-steel); box-shadow: none; height: 44px; min-width: 44px; }
  header.top .desk-only { display: none; }
  .stamp { position: absolute; top: calc(100% + 6px); inset-inline: 16px; text-align: center; box-shadow: var(--sh-1); }
  .mob-subs { display: flex; }
  main { padding: 14px 16px calc(var(--bottom-h) + 96px + env(safe-area-inset-bottom, 0px)); }

  nav.bottom { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; inset: auto 0 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 4px env(safe-area-inset-bottom, 0px); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); }
  nav.bottom button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border: 0; background: none; color: var(--muted); font-size: .72rem; font-weight: 600; border-radius: var(--r-sm); }
  nav.bottom button .ic { width: 22px; height: 22px; }
  nav.bottom button[aria-current="true"] { color: var(--ink); }
  nav.bottom button[aria-current="true"] .ic { color: var(--ink); }
  :root nav.bottom button[aria-current="true"]::before { content: ""; position: absolute; top: 4px; width: 44px; height: 30px; border-radius: 99px; background: var(--accent-soft); z-index: -1; }
  nav.bottom button { isolation: isolate; }
  /* "עוד": the sections that do not fit the bar, as a sheet above it (core/render.js) */
  nav.bottom .more-sheet { position: absolute; bottom: 100%; inset-inline: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md, 12px) var(--r-md, 12px) 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .12); }
  nav.bottom .more-sheet button { min-height: 64px; }
  /* catalog on a phone (AUDIT UX-3): code, name, total, min / max only; the full card opens with a tap */
  table.compact-phone td:is(:nth-child(2), :nth-child(4), :nth-child(5), :nth-child(8), :nth-child(9), :nth-child(10)) { display: none; }
  table.compact-phone tfoot { display: none; }
  nav.bottom .count { position: absolute; top: 3px; inset-inline-end: calc(50% - 22px); margin: 0; min-width: 18px; height: 18px; font-size: .68rem; }
  .fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 31; inset-inline-start: 16px; bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom, 0px));
    height: 52px; padding: 0 18px 0 20px; border-radius: 16px; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: var(--sh-2); }
  .fab:active { transform: scale(.97); }
  #toast { margin-bottom: calc(var(--bottom-h) + 80px + env(safe-area-inset-bottom, 0px)); }

  body { font-size: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpis .kpi.zero { display: none; }
  .kpi-ok { display: flex !important; }
  .kpi { padding: 10px 12px; }
  .kpi .v { font-size: 1.45rem; }
  .bar > * { flex: 1 1 auto; }
  .bar input[type=search], .bar .grow { flex-basis: 100%; }
  .bar select { flex-basis: 100%; max-width: none !important; }
  .chip, .btn, .result { min-height: 44px; }
  .btn.small { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
  input, select, textarea { font-size: 16px; min-height: 44px; } /* stops iOS zooming into fields */
  .zone-list { grid-template-columns: minmax(0, 1fr); }
  .chip .nm { max-width: 10em; }
  .att-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .att-badges { justify-content: flex-start; max-width: none; }
  .entry { grid-template-columns: 1fr auto; }
  .entry .when { grid-column: 1; grid-row: 1; }
  .entry .body { grid-column: 1 / -1; grid-row: 2; }
  .entry > .btn { grid-column: 2; grid-row: 1; }

  /* tables become compact cards: first cell is the title, the rest flow in two columns */
  .tablewrap { overflow: visible; background: none; border: 0; box-shadow: none; }
  .tablewrap table, .tablewrap tbody { display: block; width: 100%; }
  .tablewrap thead { display: none; }
  .tablewrap tfoot { display: none; }
  .tablewrap tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--sh-1); }
  .tablewrap tr.click:active { background: var(--surface-2); }
  .tablewrap td { border: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; text-align: start; }
  .tablewrap td.num { text-align: start; }
  .tablewrap td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .74rem; font-weight: 600; }
  .tablewrap td:first-child { grid-column: 1 / -1; font-size: 1.02rem; font-weight: 500; flex-direction: row; align-items: center; gap: 8px; }
  .tablewrap td:first-child::before { display: none; }
  .tablewrap td:has(.chips), .tablewrap td:has(.chip), .tablewrap td:has(.btn), .tablewrap td[data-label=""], .tablewrap td:not([data-label]) { grid-column: 1 / -1; }
  .tablewrap td[data-label=""]::before { display: none; }
  .tablewrap td.nil, .tablewrap td:empty { display: none; }
  .tablewrap td .cell { min-width: 0; }
  .tablewrap td:has(.btn) .cell { display: flex; flex-wrap: wrap; gap: 6px; }

  dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog[open] { animation: sheet-in .22s var(--ease); }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .dlg-head { padding-top: max(12px, env(safe-area-inset-top, 0px)); }
  .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 8px; }
  form.f, div.f { grid-template-columns: minmax(0, 1fr); }
  form.f .actions { padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  form.f .actions .btn { flex: 1 1 auto; }
  .order-item { grid-template-columns: minmax(0, 1fr) 64px 84px auto; }
  .order-item input[type=text] { grid-column: 1 / -1; grid-row: 2; }
  .only-phone { display: block; margin: 0 0 6px; }
  .hide-sm { display: none; }
}

/* ---------- compact lists ---------- */
.page { display: flex; flex-direction: column; gap: 12px; }
.page > .bar { margin-bottom: 0; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: clip; }
/* a group's title stays under the page header while its rows scroll by */
.list-h { position: sticky; top: var(--top-h, 0px); z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--muted); }
.list-h .n { font-variant-numeric: tabular-nums; }
/* a folding group (core/ui.js foldList): the whole title bar opens it; the chevron points in when closed, down when open */
details.list > summary.list-h { cursor: pointer; list-style: none; user-select: none; padding-block: 10px; font-size: .86rem; color: var(--ink); }
details.list > summary.list-h::-webkit-details-marker { display: none; }
details.list > summary.list-h > span:first-child::before { content: ''; display: inline-block; width: .42em; height: .42em; margin-inline-end: .7em; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(135deg); vertical-align: .12em; transition: transform .15s var(--ease); }
details.list[open] > summary.list-h > span:first-child::before { transform: rotate(45deg); }
details.list:not([open]) > summary.list-h { border-bottom: 0; }
details.list > summary.list-h:hover { background: var(--line); }
details.list > summary.list-h:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 0; border-bottom: 1px solid var(--line); min-width: 0; transition: background .12s var(--ease); }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row-hit { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 9px 14px; padding-inline-end: 4px; border: 0; background: none; text-align: start; color: inherit; }
button.row-hit { cursor: pointer; }
.row .lead { flex: none; display: flex; align-items: center; }
.row .lead .brand-badge { width: 64px; height: 22px; font-size: .64rem; }
.row .main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row .t { font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.row .s { font-size: .83rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 0; line-height: 1.45; }
.row .s .code { font-size: .8rem; color: var(--ink); }
.row .x .chip { white-space: nowrap; }
.row .x { font-size: .82rem; color: var(--warn); display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.row .x:not(:has(.chip)) { font-style: normal; }
.row .sep { color: var(--line-2); }
.row .row-side { flex: none; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; max-width: 48%; padding-inline-end: 12px; }
.light { color: var(--muted); font-weight: 500; }
.code.light { font-size: .85em; }
.row .qty { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); font-weight: 500; }
.row .qty input { width: 76px; min-height: 36px; text-align: center; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 5px 12px; border-radius: 99px; font-size: .88rem; min-height: 34px; }
.fchip .n { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.fchip.warn .n { color: var(--warn); font-weight: 700; }
.fchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
.fchip[aria-pressed="true"] .n { color: inherit; opacity: .7; }
/* one choice of view (status, period, layer): a segmented switch — filters by values stay in the ▾ / funnel menus */
.filters { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; max-width: 100%; }
.filters .fchip { border-color: transparent; background: transparent; min-height: 30px; padding: 4px 12px; }
.filters .fchip:hover { background: var(--surface); }
.filters .fchip[aria-pressed="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--sh-1); }
.filters .fchip[aria-pressed="true"] .n { opacity: 1; }
.filters .fchip.bad .n { color: var(--bad); font-weight: 700; }
.sumline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.linkbtn { border: 0; background: none; padding: 0 4px; color: var(--steel-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
:root .linkbtn { color: inherit; }
.inline-info { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; color: var(--muted); }
.inline-info strong { color: var(--ink); }

/* tighter rhythm everywhere */
main { padding-top: 16px; }
.bar { gap: 8px; }
.kpis { margin-bottom: 14px; }
@media (max-width: 760px) {
  main { padding-top: 12px; }
  .page { gap: 10px; }
  .row { flex-wrap: wrap; padding: 0; gap: 0; }
  .row-hit { flex-basis: 100%; padding: 10px 12px 4px; gap: 10px; }
  .row .row-side { max-width: none; flex-basis: 100%; justify-content: flex-start; padding: 0 12px 10px; }
  .row:not(:has(.row-side)) .row-hit { padding-bottom: 10px; }
  .row .lead .brand-badge { width: 54px; height: 20px; font-size: .58rem; }
  .row.reco .row-hit { flex-basis: auto; flex: 1 1 0; padding-bottom: 10px; }
  .row.reco .row-side { flex-basis: auto; padding: 10px 12px; }
  .row .btn.small { min-height: 36px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .fchip { flex: none; min-height: 38px; }
  .filters .fchip { min-height: 34px; }
  .page > .bar > .sumline { flex: 1 1 auto; }
  .page > .bar > .btn { flex: 0 0 auto; }
  .page > .bar > .inline-info { flex-basis: 100%; }
  .page > .bar:has(> .inline-info) > .btn { flex: 1 1 0; }
  .page > .bar > span.grow:empty { display: none; }
  .page > .bar > input[type=search] { flex: 1 1 0; min-width: 0; }
  /* a bar that also holds view switches: the search gets its own line, or it shrinks to the icon (places screen) */
  .page > .bar:has(> .filters) > input[type=search] { flex-basis: 100%; }
}

/* ---------- heat layers ---------- */
:root { --heat-0: var(--chip); --heat-1: #f2a65a; --heat-2: #e0602a; --heat-3: #a8231b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --heat-1: #8a4119; --heat-2: #c9581f; --heat-3: #f5935a; } }
:root[data-theme="dark"] { --heat-1: #8a4119; --heat-2: #c9581f; --heat-3: #f5935a; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 8px; }
.map-tools .filters { flex-wrap: nowrap; }
.mimic svg.heat .eq .body, .mimic svg.heat .eq .tank, .mimic svg.heat .eq .hot { fill: var(--heat-0); }
.mimic svg.heat .eq[data-h="1"] .body { fill: var(--heat-1); }
.mimic svg.heat .eq[data-h="2"] .body { fill: var(--heat-2); }
.mimic svg.heat .eq[data-h="3"] .body { fill: var(--heat-3); }
.mimic svg.heat .eq .hatch { display: none; }
.mimic svg.heat .pile { opacity: .25; }
.mimic svg.heat .pipe { opacity: .45; }
.mimic .hv { font: 700 13px var(--font-code); fill: var(--ink); text-anchor: middle; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; background: var(--heat-0); border: 1px solid var(--line-2); }
.swatch[data-h="1"] { background: var(--heat-1); border-color: transparent; }
.swatch[data-h="2"] { background: var(--heat-2); border-color: transparent; }
.swatch[data-h="3"] { background: var(--heat-3); border-color: transparent; }
.swatch.lg { width: 16px; height: 16px; border-radius: 4px; }
.chip .hv { font-size: .78rem; font-variant-numeric: tabular-nums; }
.heat-legend .note { font-size: .8rem; }
.top5 { margin-bottom: 12px; }
.top5-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.top5-rows .row { border-inline-end: 1px solid var(--line); }
.row.nowrap { flex-wrap: nowrap !important; }
.row.nowrap .row-hit { flex: 1 1 auto !important; padding-bottom: 9px !important; }
.row.nowrap .row-side { flex-basis: auto !important; padding: 0 12px !important; }
.top5 .hv-big { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.top5 .pad { padding: 14px; margin: 0; }
.zsum { font-weight: 700; font-variant-numeric: tabular-nums; } .zsum.zero { color: var(--muted); font-weight: 500; }
.zbar { height: 6px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.zbar span { display: block; height: 100%; background: var(--heat-2); border-radius: 99px; }
@media (max-width: 760px) {
  .map-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .map-tools::-webkit-scrollbar { display: none; }
  .map-tools .filters { overflow: visible; margin: 0; padding: 0; }
  .map-tools .map-zoom { flex: none; }
  .mimic:not(.zoom) .hv { display: none; }
  .heat-legend .note { flex-basis: 100%; }
}
html[lang="ar"] { --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
html[dir="ltr"] input[type=search] { background-position: left 12px center; }
@media (max-width: 760px) { header.top .lang-sel { min-width: 0; width: 52px; padding: 0 4px; text-align: center; appearance: none; -webkit-appearance: none; height: 44px; min-height: 44px; background: var(--steel-2); color: var(--on-steel); border-color: transparent; font-size: 16px; } }
.lang-sel { flex: none; width: auto; min-width: 76px; height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
/* BI screen: stat tiles, ranked bars, month columns (one series each, one hue, values in ink) */
.bi-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.bi-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.bi-tile strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.bi-tile span { color: var(--muted); font-size: .82rem; }
.bi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.bi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; min-width: 0; }
.bi-card h3 { margin: 0 0 10px; font-size: .95rem; }
.bi-bars { display: flex; flex-direction: column; gap: 2px; }
.bi-bar { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; align-items: center; gap: 8px; padding: 5px 4px; border: 0; background: none; font: inherit; color: inherit; text-align: start; border-radius: var(--r-sm); min-height: 32px; }
button.bi-bar { cursor: pointer; } button.bi-bar:hover { background: var(--surface-2); }
.bi-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.bi-track { height: 10px; }
.bi-track i { display: block; height: 100%; background: var(--steel-2); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.bi-v { font-variant-numeric: tabular-nums; font-size: .85rem; font-weight: 500; min-width: 3ch; text-align: end; }
.bi-cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; align-items: end; height: 150px; }
.bi-col { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.bi-cv { font-size: .72rem; font-weight: 600; min-height: 1.2em; font-variant-numeric: tabular-nums; }
.bi-ctrack { flex: 1; width: 70%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line-2); }
.bi-ctrack i { display: block; width: 100%; background: var(--steel-2); border-radius: 4px 4px 0 0; }
.bi-cm { font-size: .7rem; color: var(--muted); margin-top: 3px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-variant-numeric: tabular-nums; min-height: 2.4em; }
.bi-cm small { font-size: .62rem; }
:root[data-theme="dark"] .bi-track i, :root[data-theme="dark"] .bi-ctrack i { background: var(--on-steel-muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bi-track i, :root:not([data-theme="light"]) .bi-ctrack i { background: var(--on-steel-muted); } }
/* "לטיפול" as tiles: work (coloured by urgency) and data gaps (quiet), in separate sections */
.att-h { margin: 6px 0 10px; font-size: 1rem; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-bottom: 18px; }
.att-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 108px; padding: 12px 14px; text-align: start;
  background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--line-2); border-radius: var(--r); color: var(--ink); font: inherit; cursor: pointer; }
.att-tile:hover { background: var(--surface-2); }
.att-tile .att-n { font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.att-tile .att-t { font-weight: 500; }
.att-tile .att-p { color: var(--muted); font-size: .8rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.att-tile.work.tone-bad { border-inline-start-color: var(--bad); } .att-tile.work.tone-bad .att-n { color: var(--bad); }
.att-tile.work.tone-warn { border-inline-start-color: var(--warn); } .att-tile.work.tone-warn .att-n { color: var(--warn); }
.att-tile.data { border-inline-start-color: var(--line-2); background: var(--surface-2); }
.att-tile.data .att-n { color: var(--muted); font-size: 1.5rem; }
.att-dh { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
/* one type style: codes (catalog / unit / location codes) in the code font and never wrapped; names, designations
   and models in the text font, so Hebrew never appears in the monospace face */
td.nowrap, .nowrap { white-space: nowrap; }
.item-name { font-weight: 500; }
/* home screen top: one compact tile per topic that needs attention (attention.js homePanel) */
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; margin-bottom: 14px; }
.home-tiles .att-tile { min-height: 0; padding: 10px 12px; gap: 3px; }
.home-top { display: flex; align-items: baseline; gap: 8px; }
.home-tiles .att-n { font-size: 1.6rem; }
.home-tiles .att-p { -webkit-line-clamp: 1; }
.home-ok { margin: 0 0 14px; color: var(--muted); }
@media (max-width: 760px) { .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
/* big cards with a real photo (core/ui.js card / cardGrid) */
.card-group { margin-bottom: 18px; }
.add-cats { margin: 0 0 14px; align-items: center; }
.card-group > h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .95rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; min-width: 0; }
.card-hit { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: center; cursor: pointer; flex: 1; min-width: 0; }
.card-hit:hover .card-t { text-decoration: underline; text-underline-offset: 3px; }
.card-img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
/* the picture fills the frame exactly (a percentage height alone was not resolved: a tall photo ran past the frame
   and showed only its top, 2026-12-01) */
.card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img.none .card-ic { width: 42%; height: 42%; color: var(--line-2); }
/* vehicles and vessels: the whole photo fits (no crop), the notes cut to two lines (full text in the dialog) */
.card-img .card-bg { display: none; }
.fleet-card .card-img .card-pic { object-fit: contain; }
.fleet-card .card-img .card-bg { display: block; object-fit: cover; filter: blur(16px) brightness(.92) saturate(1.1); transform: scale(1.2); }
/* the line under a card title: parts side by side, no separator dots left hanging at a line end */
.card-s .sep { display: none; }
.card-s { gap: 2px 12px; }
.card-s .part { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; max-width: 100%; }
.card-note { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
/* text centred under the picture; long names and codes wrap inside the card, never widen it */
.card-txt { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 12px 4px; text-align: center; min-width: 0; }
.card-t { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.card-s { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; align-items: center; overflow-wrap: anywhere; }
.card-b { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px 12px 10px; text-align: center; }
.card-b .note { flex-basis: 100%; }
.card-a { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; margin-top: auto; }
.card-a .btn { flex: 1; justify-content: center; }
/* rounds have no photo: a smaller pictogram band instead of the 4:3 picture */
.round-card .card-img { aspect-ratio: auto; height: 74px; }
.round-card .card-img.none .card-ic { width: 34px; height: 34px; color: var(--muted); }
.card-grid + section.list, .card-grid + details.list { margin-top: 18px; }
.card-add { align-items: center; justify-content: center; gap: 8px; min-height: 180px; border-style: dashed; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; background: var(--surface-2); box-shadow: none; }
.card-add .card-ic { width: 34px; height: 34px; }
@media (max-width: 760px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .card-add { min-height: 140px; } }
/* filter bar and drop-down (core/filters.js) */
.fbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.fbar-l { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.fbar-l .ic { width: 15px; height: 15px; }
.fbtn { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: .82rem; cursor: pointer; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbtn.on { background: var(--accent-soft); border-color: var(--accent); }
@media (min-width: 761px) { .fbar.for-table .fbtn:not(.on) { display: none; } .fbar.for-table.idle { display: none; } }   /* desktop: the table headers carry the menus */
.fmenu { position: fixed; z-index: 1000; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 12px 32px rgba(0, 0, 0, .18); padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: min(70dvh, 460px); }
.fm-h { font-weight: 700; font-size: .9rem; }
.fm-sort { display: flex; gap: 6px; }
.fm-q { width: 100%; box-sizing: border-box; }
.fm-list { overflow: auto; display: flex; flex-direction: column; gap: 2px; min-height: 40px; }
.fm-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 5px; cursor: pointer; font-size: .86rem; }
.fm-item:hover { background: var(--surface-2); }
.fm-all { border-bottom: 1px solid var(--line); border-radius: 0; font-weight: 600; }
.fm-n { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.fm-act { display: flex; gap: 6px; }
/* the field a "השלמת נתונים" row came to fix */
.need-fix { outline: 2px solid var(--warn); outline-offset: 3px; border-radius: var(--r-sm); background: var(--warn-soft); animation: need-fix-pulse 1.2s ease-out 2; }
@keyframes need-fix-pulse { 0% { outline-color: transparent; } 40% { outline-color: var(--warn); } 100% { outline-color: var(--warn); } }
body[data-role="reporter"] #searchBtn, body[data-role="reporter"] #setBtn { display: none; }
.btn.big { width: 100%; min-height: 64px; font-size: 1.1rem; justify-content: center; margin-bottom: 14px; }
.loc-row .pill { margin-inline-end: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; animation: none !important; } }

/* modules/partsigns.js: the sign names in the catalog item dialog */
.sign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; margin: 6px 0 8px; }
.sign-f { display: flex; flex-direction: column; gap: 3px; }
.sign-f input { width: 100%; }

/* read-only viewer (AUDIT Б-1): everything shows, nothing that writes is offered; core/forms.js dbReady refuses any
   write that slips through */
body[data-role=viewer] #logBtn, body[data-role=viewer] #fab, body[data-role=viewer] .card-add, body[data-role=viewer] .add-row,
body[data-role=viewer] .btn.primary, body[data-role=viewer] .btn.danger, body[data-role=viewer] details.menu.more,
body[data-role=viewer] .menu-item.danger, body[data-role=viewer] .ph-x, body[data-role=viewer] .photo-btn { display: none !important; }
body[data-role=viewer] dialog :is(input, select, textarea):not([type=search]) { pointer-events: none; background: var(--bg-soft, #f4f6f7); }
.ro-banner { margin: 0 0 10px; }

/* storage places (modules/locations.js): a warehouse = a card, a section = one row, its levels = cells top → 0 */
.wh-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 14px; overflow: hidden; }
.wh-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft, #f4f6f7); }
.wh-t { flex: 1 1 auto; text-align: start; border: 0; background: none; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 0; }
.loose-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; background: #fff7e6; border-bottom: 1px solid var(--line); }
.rack-list { display: grid; }
.rack-row { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-top: 1px solid var(--line); }
.rack-row:first-child { border-top: 0; }
.rack-t { min-width: 84px; display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; font: inherit; cursor: pointer; padding: 0; }
.rack-sum { margin-inline-start: auto; white-space: nowrap; }
.loc-issue summary { cursor: pointer; font-weight: 500; padding: 8px 12px; }
@media (max-width: 760px) { .rack-row { flex-wrap: wrap; } .rack-sum { margin-inline-start: 0; flex-basis: 100%; } }
  border-right: 6px solid var(--rack); border-bottom: 6px solid var(--rack); cursor: pointer; background: var(--surface); }

/* ---------- phone audit 2026-11-18 (AUDIT М-…) ---------- */
/* М-5: the main button of every dialog stays in sight at the bottom, whatever the length of the dialog */
.dlg-body > .actions, .dlg-foot, form.f .actions { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 max(8px, env(safe-area-inset-bottom, 0px)); margin-bottom: -4px; border-top: 1px solid var(--line); z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* a fault in handling: the treatment right under the steps, the defect folded after it */
.dlg-body.fd-progress > .mr-steps, .dlg-body.fd-progress > dl.kv { order: -3; }
.dlg-body.fd-progress > .fd-treat { order: -2; }
.fd-defect > summary { cursor: pointer; list-style: none; }
.fd-defect > summary::-webkit-details-marker { display: none; }
.fd-defect > summary h4::before { content: '▸ '; color: var(--muted); }
.fd-defect[open] > summary h4::before { content: '▾ '; }
/* М-4: a viewer sees no button that writes */
body[data-role=viewer] :is(.write, .quick-acts, .chk-btns) { display: none !important; }
/* М-2: while a photo uploads, the main buttons of dialogs wait */
body.photo-busy dialog .btn.primary:not(.photo-row *) { opacity: .45; }
/* М-6: a scanned item — the three actions */
.quick-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-acts .btn { min-height: 56px; justify-content: center; font-size: 1rem; }
.row-in { display: flex; gap: 6px; align-items: center; }
.row-in > select, .row-in > input { flex: 1; min-width: 0; }
/* the live scanner */
.scan-dlg { width: min(520px, calc(100vw - 16px)); }
.scan-view { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 60dvh; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-aim { position: absolute; inset: 18% 14%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); pointer-events: none; }
.scan-more summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.scan-more[open] { display: flex; flex-direction: column; gap: 8px; }
/* an item picker that searches (М-7) */
.pick { position: relative; min-width: 0; }
.pick input { width: 100%; }
.pick-list { position: absolute; inset-inline: 0; top: 100%; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--sh-1); max-height: 260px; overflow: auto; margin-top: 2px; }
.pick-list button { display: flex; gap: 8px; width: 100%; text-align: start; border: 0; background: none; padding: 10px 12px; font: inherit; border-bottom: 1px solid var(--line); min-height: 44px; align-items: center; }
.pick-list button:hover, .pick-list button:focus, .pick-list button.act { background: var(--surface-2, #f2f4f6); }
.pick-list .q { margin-inline-start: auto; color: var(--muted); font-size: .85rem; }
/* М-17: the two things done from a unit card, named, on top */
.unit-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.unit-acts .btn { min-height: 48px; justify-content: center; }
/* М-9: no network */
.offline-bar { position: fixed; inset-inline: 0; top: 0; z-index: 50; background: var(--warn, #b7791f); color: #fff; text-align: center; font-size: .85rem; padding: 4px 8px; }
@media (max-width: 760px) {
  /* М-16: finger-size targets */
  .dlg-head .btn.small[aria-label], .dlg-head .btn.icon-btn, .btn.small.icon-btn, .row-side .btn.icon-btn, .card-a .btn.icon-btn { min-width: 44px; min-height: 44px; width: auto; height: auto; }
  .btn.small { min-height: 40px; }
  .fchip, .filters .fchip { min-height: 40px; }
  .chip { min-height: 36px; }
  .photos .ph-x { width: 28px; height: 28px; line-height: 28px; }
}

/* ---------- desktop audit 2026-11-18 (AUDIT ПК-…) ---------- */
tr.click:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: -2px; }
tr.click:focus-visible td { background: var(--surface-2); }
.stub { display: none !important; }
.more-row { display: flex; justify-content: center; padding: 12px 0 20px; }
/* wide screens: the big cards (unit, order, material request, round) get the room (ПК-20) */
@media (min-width: 1280px) {
  #unitDlg, #orderDlg, #matDlg, #runDlg { width: min(1100px, calc(100vw - 48px)); }
  #formDlg.wide { width: min(1000px, calc(100vw - 48px)); }
}
.dlg-nav { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.dlg-nav .btn { min-width: 32px; }
.kbd-help { white-space: pre-line; }
/* Ctrl+P prints the screen, not the app around it (ПК-27) */
@media print {
  header.top, #sideNav, #bottomNav, #mobSubs, #fab, .fbar, .bar, .filters, .th-f, .icon-btn, .menu, .more-row, .offline-bar, .toast { display: none !important; }
  body, main, #view { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .tablewrap { overflow: visible !important; max-height: none !important; }
  table { font-size: 10pt; } thead { display: table-header-group; } tr { break-inside: avoid; }
  dialog[open] { position: static; width: auto; max-height: none; box-shadow: none; border: 0; }
  body:has(dialog[open]) #view { display: none; }
}
/* the "close without saving?" question inside a dialog (core/forms.js askDiscard; confirm() is refused in the claude.ai frame) */
.discard-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 18px; background: var(--warn-soft, #fff4d6); border-bottom: 1px solid var(--line); }
.discard-bar span { flex: 1 1 200px; font-weight: 600; }
/* ---------- review 2026-11 (REVIEW-2026-11.md Р-…) ---------- */
.work-tile .ico svg { width: 26px; height: 26px; color: var(--accent); }
.work-tile.more { border-style: dashed; }
.chip-rows { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.today .bar .search-wide { justify-content: flex-start; color: var(--muted); font-weight: 400; }
.today .search-wide .ic { width: 18px; height: 18px; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.today-grid .list { margin: 0; }
.att-data > summary { cursor: pointer; list-style: none; }
.att-data > summary::-webkit-details-marker { display: none; }
.att-data > summary .att-h::before { content: '▸ '; color: var(--muted); }
.att-data[open] > summary .att-h::before { content: '▾ '; }
.order-note { background: var(--accent-soft); border-radius: var(--r-sm); padding: 6px 10px; font-size: .9rem; }
.bi-trend { display: block; font-size: .8rem; font-weight: 700; margin-top: 2px; }
.bi-trend.good { color: var(--ok, #1f8a4c); } .bi-trend.bad { color: var(--bad, #c0392b); } .bi-trend.same { color: var(--muted); }
.readiness summary h4, .wear summary h4 { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.readiness .btn { margin-top: 8px; }
.stock-value { margin: 4px 0 8px; }
.ext-block { margin-top: 8px; }
.pick-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; max-height: 50vh; overflow: auto; }
.pick-units label[hidden] { display: none; }
/* a note inside a framed list never touches the frame (2026-11-18: "אין יחידה מושבתת." sat on the border) */
.note.pad, .list > p.note, .list > .note, .list > p { padding: 12px 14px; margin: 0; }
/* ---------- the in-app assistant (modules/chat.js) ---------- */
.page.chat { height: calc(100dvh - var(--top-h, 64px) - 40px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md, 12px); }
.chat-hello { color: var(--muted); max-width: 46ch; }
.chat-hello ul { margin: 6px 0 10px; padding-inline-start: 18px; display: grid; gap: 4px; }
.cm { max-width: min(88%, 62ch); padding: 9px 12px; border-radius: 14px; line-height: 1.45; }
.cm .ct { white-space: pre-wrap; overflow-wrap: anywhere; }
.cm.me { align-self: flex-start; background: var(--accent-soft); color: var(--ink); border-end-start-radius: 4px; }
.cm.ai { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-end-end-radius: 4px; }
.cm.sys { align-self: center; max-width: 94%; font-size: .82rem; color: var(--muted); white-space: pre-wrap; text-align: start; background: transparent; padding: 2px 6px; }
.cpics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cpics img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.cpics.pending .ph { position: relative; }
.cpics.pending .ph-x { position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 12px; line-height: 22px; padding: 0; cursor: pointer; }
.cops { margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface); }
.cops ol { margin: 0 0 8px; padding-inline-start: 20px; display: grid; gap: 3px; font-size: .9rem; }
.cbtns { display: flex; gap: 8px; }
.chat-in { display: flex; gap: 8px; align-items: flex-end; }
.chat-in textarea { flex: 1; resize: none; min-height: 44px; max-height: 30vh; font: inherit; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); }
.chat-ib { min-width: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 760px) { .page.chat { height: calc(100dvh - var(--top-h, 56px) - var(--bottom-h, 64px) - 24px - env(safe-area-inset-bottom, 0px)); } .cm { max-width: 92%; } }

/* modules/tour.js — מבט 360°: the full-screen viewer (CSS 3D cube), its marks, and the plan with points */
.tour-dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; display: none; flex-direction: column; background: #000; color: #fff; }
.tour-dlg[open] { display: flex; }
.tour-dlg .dlg-head { background: var(--surface); color: var(--ink); }
.tour-dlg .dlg-head h2 { display: flex; align-items: center; gap: 6px; }
.tour-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.tour-stage:active { cursor: grabbing; }
.tour-cube { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.tour-cube img { position: absolute; width: 1026px; height: 1026px; max-width: none; left: -513px; top: -513px; backface-visibility: hidden; pointer-events: none; }
.tour-mark { position: absolute; left: 0; top: 0; translate: -50% -50%; backface-visibility: hidden; display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  padding: 6px 12px 6px 6px; border: 2px solid #fff; border-radius: 99px; background: rgba(15, 21, 24, .72); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.tour-mark .tm-ic { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); flex: none; }
.tour-mark .tm-ic .ic { width: 18px; height: 18px; }
.tour-mark .tm-t { overflow: hidden; text-overflow: ellipsis; }
.tour-mark.k-go { background: rgba(255, 255, 255, .88); color: #13202a; border-color: var(--accent); }
.tour-mark.k-go .tm-ic { background: #13202a; color: #fff; }
.tour-mark.k-note .tm-ic { background: #fff; color: #13202a; }
.tour-mark.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.tour-cross { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; translate: -50% -50%; pointer-events: none; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.tour-cross::before, .tour-cross::after { content: ''; position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.tour-cross::before { left: 50%; top: -14px; bottom: -14px; width: 2px; translate: -50% 0; }
.tour-cross::after { top: 50%; left: -14px; right: -14px; height: 2px; translate: 0 -50%; }
.tour-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); color: var(--ink); border-top: 1px solid var(--line); }
.tour-near { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; background: var(--surface); }
.tour-near .chip { flex: none; }
.tour-hint { margin: 0; padding: 8px 12px; background: var(--surface); }
.tour-plan { position: relative; line-height: 0; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.tour-plan img { width: 100%; height: auto; display: block; }
.tour-plan.placing { cursor: crosshair; outline: 3px dashed var(--accent); outline-offset: -3px; }
.tour-dot { position: absolute; translate: -50% -50%; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; background: var(--accent); box-shadow: 0 1px 6px rgba(0, 0, 0, .45); cursor: pointer; padding: 0; line-height: 1.2; }
.tour-dot span { position: absolute; top: 24px; left: 50%; translate: -50% 0; white-space: nowrap; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .9); color: #13202a; padding: 1px 6px; border-radius: 6px; }

/* tour: the small plan in the viewer, the walk fade, the live line under marks (2026-11-25) */
.tour-stage.fresh .tour-cube { animation: tour-in .35s ease-out; }
@keyframes tour-in { from { opacity: 0; } to { opacity: 1; } }
.tour-mark { max-width: 260px; padding-block: 4px; }
.tour-mark .tm-tx { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; }
.tour-mark .tm-info { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-top: 2px; background: rgba(255, 255, 255, .18); }
.tour-mark .tm-info.ok { background: #1f8a4c; color: #fff; }
.tour-mark .tm-info.warn { background: #e3a400; color: #261a00; }
.tour-mark .tm-info.bad { background: #c0392b; color: #fff; }
.tour-mark .tm-info.mute { background: rgba(255, 255, 255, .25); color: #fff; }
.tour-mini { position: absolute; left: 10px; bottom: 10px; width: auto; max-width: min(34%, 240px); line-height: 0; border: 2px solid #fff; border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .45); cursor: default; z-index: 2; }
.tour-mini img { width: auto; height: auto; max-width: 100%; max-height: min(34vh, 220px); display: block; opacity: .9; }
.tour-mini .tm-dot { position: absolute; translate: -50% -50%; width: 14px; height: 14px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: #13202a; cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); }
.tour-mini .tm-dot.cur { background: var(--accent); width: 16px; height: 16px; cursor: default; }
.tour-mini .tm-cone { position: absolute; width: 70px; height: 70px; pointer-events: none; background: conic-gradient(from -30deg, rgba(227, 164, 0, .55) 0deg 60deg, transparent 60deg); border-radius: 50%;
  -webkit-mask: radial-gradient(circle, #000 0 70%, transparent 71%); mask: radial-gradient(circle, #000 0 70%, transparent 71%); }
.tour-dlg .dlg-head .icon-btn.on { background: var(--accent-soft); border-color: var(--accent); }
.tour-hint.warn { color: var(--warn-ink, #8a5a00); background: var(--accent-soft); }
.tour-dot.unturned { background: #e67e22; }
.tour-dot.cur { outline: 3px solid #13202a; }
.tour-placing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-placing .thumb { width: 64px; height: 64px; }
.tour-howto { margin: 0 0 10px; }
.tour-howto summary { cursor: pointer; color: var(--muted); }
.tour-howto ol { margin: 6px 0; padding-inline-start: 22px; display: grid; gap: 3px; }

/* ---------- places screen (locations, 2026-12-01): control tiles, by place, by item ---------- */
/* the bar wraps instead of pushing the view switch off the screen */
.loc-page .bar { flex-wrap: wrap; }
.loc-page .bar .loc-q { min-width: 200px; flex: 1 1 280px; font-size: 1rem; }
.loc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.loc-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.loc-tile b { font-size: 1.5rem; line-height: 1.1; }
.loc-tile span { font-size: .85rem; }
.loc-tile small { color: var(--muted); font-size: .78rem; }
.loc-tile.total { cursor: default; background: var(--surface-2); }
.loc-tile.ok { color: var(--muted); cursor: default; }
.loc-tile.ok b { color: #2e8b57; }
.loc-tile.warn { border-color: #e7b65a; background: #fff8e8; }
.loc-tile.bad { border-color: #e59a9a; background: #fdeeee; }
.loc-tile.warn b { color: #b7791f; } .loc-tile.bad b { color: #c53030; }
.loc-tile.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.loc-gap { margin-bottom: 12px; }
/* tools: a register to look at (modules/tools.js) */
.tl-run { display: flex; width: fit-content; max-width: 100%; align-self: flex-start; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
.tl-run:hover { border-color: var(--accent); }
.tl-run.warn { border-color: #e7b65a; background: #fff8e8; }
.tl-run .ic { width: 16px; height: 16px; }
.tools-tbl td.tl-ph { width: 52px; padding-block: 4px; }
.tools-tbl td.tl-ph .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.tl-chk { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.loc-whs { display: flex; flex-direction: column; gap: 14px; }
.loc-whs > .grp-back { margin: 0; }
/* warehouse cards: one opens inside */
.wh-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 280px)); justify-content: center; gap: 14px; direction: ltr; }   /* A, B, C from the left */
.wh-tiles > * { direction: rtl; }
.wh-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding: 18px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; color: var(--ink); text-align: center; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.wh-tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.08); transform: translateY(-1px); }
.wh-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wh-tile-h { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wh-tile-c { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 10px; background: var(--steel-2, #34495e); color: #fff; font-family: var(--mono, monospace); font-size: 1.4rem; font-weight: 700; direction: ltr; }
.wh-tile-n { font-size: 1.1rem; font-weight: 600; }
.wh-tile-s { color: var(--muted); font-size: .9rem; }
.wh-tile-r { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; direction: ltr; }
.wh-rk { min-width: 30px; padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-2, var(--line)); background: var(--surface-2); color: var(--muted); font-family: var(--mono, monospace); font-size: .75rem; text-align: center; }
.wh-rk.on { background: #e6f4ea; border-color: #9fd0ad; color: #1f6b3a; }
.wh-rk.warn { background: #fff8e8; border-color: #e7b65a; color: #8a5a10; }
.wh-tile-b { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
/* inside a warehouse the sections run left to right, 01 first, as they stand (Vadim 2026-12-01) */
.loc-secs { direction: ltr; }
.loc-secs > * { direction: rtl; }
/* the full reset of a list (core/groups.js, core/filters.js) */
.btn.fclear { color: #c53030; border-color: #e59a9a; background: #fff5f5; }
.btn.fclear:hover { background: #fdeeee; }
.btn.fclear .ic { width: 15px; height: 15px; }
.loc-secs { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; padding: 10px 14px 14px; }
.loc-sec { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.loc-sec-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); font: inherit; font-weight: 600; cursor: pointer; text-align: start; }
.loc-sec-h .nm { font-weight: 500; }
.loc-sec-h .note { margin-inline-start: auto; font-weight: 400; }
.loc-lv { display: flex; gap: 8px; align-items: flex-start; padding: 6px 10px; border-bottom: 1px solid #f0f2f4; cursor: pointer; }
.loc-lv:hover, .loc-lv:focus-visible { background: #f2f7ff; outline: none; }
.loc-lv.warn { background: #fff8e8; cursor: default; }
.loc-k { flex: none; width: 34px; display: flex; flex-direction: column; align-items: center; font-weight: 500; color: var(--muted); padding-top: 3px; }
.loc-k small { font-size: .62rem; font-weight: 400; }
.loc-lv-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.loose-line .loc-it, .loc-empty .chip { width: auto; }
.loc-it { display: flex; align-items: baseline; gap: 6px; width: 100%; min-width: 0; padding: 3px 8px; border: 1px solid #d6e0ea; border-radius: 6px; background: #f6f9fc; font: inherit; font-size: .85rem; color: var(--ink); cursor: pointer; text-align: start; }
.loc-it .q { font-weight: 600; direction: ltr; }
.loc-it .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* each name in its own direction: an English name cut at its end, so the maker stays visible */
.loc-it .nm, .loc-row-t .nm { unicode-bidi: plaintext; text-align: match-parent; }
.loc-it .cd { flex: none; white-space: nowrap; color: var(--muted); font-size: .72rem; font-family: Consolas, monospace; direction: ltr; }
.loc-it.unc { border-color: #e7b65a; background: #fff1d6; }
.loc-it.hit, .chip.hit { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.loc-empty { padding: 6px 10px; color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.loc-empty .chip { font-size: .75rem; padding: 1px 8px; min-height: 0; }
.loc-cats { display: flex; flex-direction: column; gap: 10px; }
.loc-rows { display: flex; flex-direction: column; }
.loc-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) 70px minmax(200px, 2fr); gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.loc-row:hover, .loc-row:focus-visible { background: #f2f7ff; outline: none; }
.loc-row-t { display: flex; flex-direction: column; min-width: 0; }
.loc-row-t .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-row-t .cd { color: var(--muted); font-size: .78rem; direction: ltr; text-align: end; font-family: Consolas, monospace; }
.loc-row-q { font-weight: 600; font-size: 1.05rem; text-align: center; }
.loc-row-w { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
@media (max-width: 760px) {
  .loc-page .bar { flex-wrap: wrap; }
  .loc-page .bar .loc-q { min-width: 0; flex: 1 1 100%; order: -1; }
  .loc-page, .loc-whs, .wh-card { min-width: 0; max-width: 100%; }
  .loc-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loc-secs { grid-template-columns: minmax(0, 1fr); padding: 8px; }
  .loc-row { grid-template-columns: 1fr auto; }
  .loc-row-w { grid-column: 1 / -1; }
}
/* modules/users.js (cloud version): the one-time code card and the profile dialog's message line */
.um-code { font: 700 2rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; margin: 4px 0; text-align: center; }
.um-msg { margin: 0; min-height: 1.2em; }
.um-msg.bad { color: var(--bad, #b3261e); }
.um-msg.ok { color: var(--ok, #1b7f3b); }
#profileDlg .set-card h3 { margin: 0; font-size: 1rem; }
