/* Mobilni prikaz (skladišče): en stolpec, veliki gumbi, brez vodoravnega drsenja. Velja samo z razredom body.m-ui. */
body.m-ui { display: flex; flex-direction: column; overflow: hidden; height: 100%; height: 100dvh; min-height: 0; }
body.m-ui #view { flex: 1 1 0; min-height: 0; overflow: hidden; }
body.m-ui #top { position: static; flex-wrap: nowrap; gap: 8px; padding: 6px 10px; min-height: 56px; height: auto; }
body.m-ui #top > * { order: 0; }
body.m-ui #top .brand img { max-height: 24px; }
body.m-ui #top .m-headtitle { flex: 1 1 auto; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.m-ui #top button { min-height: 44px; }
body.m-ui #top .more-menu { min-width: 44px; }
body.m-ui #banner button { min-height: 44px; }

.m-page { height: 100%; overflow-y: auto; overflow-x: hidden; padding: 10px 12px 0; max-width: 640px; margin: 0 auto; font-size: 16px; overscroll-behavior: contain; }
/* skladišče: etaža in prostori na tlorisu */
.m-floors { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 0 0 8px; }
.m-floors button { min-height: 48px; font-size: 16px; }
.m-floorbox { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); padding: 4px; }
.m-floorsvg { display: block; width: 100%; max-height: 52vh; }
.m-hot { cursor: pointer; }
.m-hot rect, .m-hot polygon { fill: rgba(36, 87, 214, .18); stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.m-hot:active rect, .m-hot:active polygon, .m-hot:focus rect, .m-hot:focus polygon { fill: rgba(36, 87, 214, .42); }
.m-hot circle { fill: var(--accent); stroke: #fff; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.m-hot text { fill: #fff; font-weight: 700; pointer-events: none; }
.m-no { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; margin-right: 8px; border-radius: 13px; background: var(--accent); color: #fff; font-size: 14px; }
.m-sketch { margin: 0 0 10px; }
.m-sketch img { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); }
.m-sketch figcaption { padding: 4px 2px; font-size: 14px; color: var(--muted); }
.m-plainlist { list-style: none; margin: 0 0 12px; padding: 0; }
.m-plainlist li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
/* tloris za orientacijo: gumbi imajo svoj pas ob risbi in je nikoli ne prekrivajo */
.m-orient .plan-svg { height: calc(100% - 60px); }
body.m-ui .m-orient .plan-zoom { top: auto; left: 0; right: 0; bottom: 6px; flex-direction: row; justify-content: center; gap: 10px; }
body.m-ui .m-orient .plan-zoom button { min-width: 48px; min-height: 48px; font-size: 22px; }
.m-orient .plan-svg { cursor: grab; }
/* višina sledi obliki prostora */
.m-roomplan { flex: none; height: clamp(260px, calc((100vw - 24px) * var(--room-h, 1) + 76px), 62vh); border: 1px solid var(--line); border-radius: var(--r-card); }
.m-orient .rack.sel .rack-body, .m-orient .rack.sel.hl .rack-body { fill: rgba(36, 87, 214, .82); stroke: #0a1f66; }
/* kartice stalaž in mest */
.m-objects { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.m-page a.btn.m-objcard { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 76px; padding: 10px 12px; white-space: normal; text-align: left; border-left: 4px solid var(--brand); }
.m-objcard b { font-size: 18px; overflow-wrap: anywhere; }
.m-objcard span { font-size: 14px; color: var(--muted); }
.m-page a.btn.m-objcard.last { border: 3px solid var(--accent); background: var(--accent-tint); }
.m-objcard .m-lastmark { color: var(--accent); font-weight: 650; }
.m-alllocs { margin-bottom: 10px; }
.m-alllocs summary, .m-help summary { min-height: 48px; display: flex; align-items: center; font-weight: 650; cursor: pointer; }
.m-help { margin-bottom: 8px; }
.m-alllocs summary::before, .m-help summary::before { content: '▸'; flex: 0 0 22px; font-size: 18px; color: var(--accent); }
.m-alllocs[open] summary::before, .m-help[open] summary::before { content: '▾'; }
.m-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.m-thumbs button { display: block; aspect-ratio: 1; min-height: 96px; padding: 0; overflow: hidden; background: #14171d; border: 1px solid var(--line); border-radius: var(--r); }
.m-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.m-micros { margin-bottom: 8px; }
.m-row.m-micro.on { border: 3px solid var(--accent); background: var(--accent-tint); }
/* stalaža od spredaj: stolpci so vertikale, spodaj je najnižji nivo */
.m-elev { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 6px; margin: 4px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); }
.m-col { display: flex; flex-direction: column; justify-content: flex-end; flex: 1 0 92px; max-width: 160px; gap: 4px; }
.m-cells { display: flex; flex-direction: column-reverse; gap: 4px; padding-bottom: 4px; border-bottom: 4px solid var(--line-strong); }
.m-page a.m-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; padding: 4px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-bottom: 4px solid var(--brand); border-radius: var(--r); text-align: center; text-decoration: none; }
.m-page a.m-cell.floor { background: #eef0f3; }
.m-page a.m-cell.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.m-cell b { font-size: 15px; }
.m-cell span { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.m-cell em { font-size: 12px; font-style: normal; font-weight: 700; }
.m-rotatehint[hidden] { display: none; }
.m-colhead { text-align: center; font-weight: 700; padding: 2px 0; }
.m-col.on .m-colhead { color: var(--accent); }

/* trije pasovi segajo čez notranji rob do roba zaslona, zato zanje omejitev širine ne velja */
.m-page > :not(.m-searchbar):not(.m-photo):not(.m-actions) { max-width: 100%; }
.m-page > :last-child { margin-bottom: 14px; }
.m-page h1 { font-size: 20px; margin: 2px 0 8px; overflow-wrap: anywhere; }
.m-page h2 { font-size: 18px; margin: 14px 0 4px; }
.m-page input[type=search], .m-page select { min-height: 48px; font-size: 16px; width: 100%; max-width: 100%; }
.m-btn, .m-page .btn.m-btn { display: flex; width: 100%; min-height: 52px; font-size: 17px; font-weight: 600; white-space: normal; text-align: center; }
.m-count { margin: 8px 2px 4px; }

.m-searchbar { position: sticky; top: -10px; z-index: 6; display: flex; gap: 6px; margin: -10px -12px 0; padding: 10px 12px 8px; background: var(--bg); }
.m-searchbar .m-search { flex: 1 1 auto; min-width: 0; font-size: 18px; min-height: 52px; }
.m-searchbar .m-search::-webkit-search-cancel-button { display: none; }
.m-clear { flex: 0 0 52px; min-height: 52px; font-size: 22px; }
.m-clear[hidden], .m-rooms[hidden] { display: none; }

.m-list { display: flex; flex-direction: column; gap: 6px; }
.m-row, button.m-row { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; width: 100%; min-height: 56px; padding: 8px 12px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: var(--r-card); text-align: left; white-space: normal; }
.m-row:hover { text-decoration: none; }
.m-row:active { background: var(--accent-tint); }
.m-code { font-family: var(--mono); font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.m-title { font-size: 17px; font-weight: 650; }
.m-sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.m-mono { font-family: var(--mono); overflow-wrap: anywhere; }
.m-filters { display: flex; flex-direction: column; gap: 6px; }

.m-page .m-bigcode { font-family: var(--mono); font-size: 30px; line-height: 1.15; margin: 2px 0 8px; }
.m-wanted { margin: -4px 0 8px; padding: 6px 10px; background: var(--accent-tint); border-radius: var(--r-card); }
.m-facts { display: grid; grid-template-columns: minmax(0, 118px) minmax(0, 1fr); gap: 4px 10px; margin: 0 0 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); }
.m-facts dt { color: var(--muted); font-size: 14px; }
.m-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.m-facts dd .muted { font-weight: 400; }
/* podatki lokacije so zgoščeni, da je fotografija čim višje */
.m-facts.m-locfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; padding: 8px 12px; margin-bottom: 8px; }
.m-locfacts .wide { grid-column: 1 / -1; }
.m-locfacts dt { font-size: 12.5px; line-height: 1.2; }
.m-target dd.m-wide, .m-target dt.m-wide { grid-column: 1 / -1; }

.m-photo { margin: 0 -12px 12px; }
.m-evidence { display: flex; flex-direction: column; gap: 2px; margin: 0 12px 6px; padding: 8px 10px; border-radius: var(--r-card); border: 1px solid; font-size: 15px; }
.m-evidence.exact { background: var(--ok-tint); border-color: var(--ok-line); }
.m-evidence.weak { background: var(--warn-tint); border-color: var(--warn-line); }
.m-nophoto { margin: 0 12px; }
button.m-shot { display: block; position: relative; width: 100%; min-height: 160px; padding: 0; background: #14171d; border: 0; border-radius: 0; }
button.m-shot:hover:not(:disabled), button.m-shot:active:not(:disabled) { background: #14171d; }
.m-frame { position: relative; width: 100%; margin: 0 auto; aspect-ratio: 4 / 3; overflow: hidden; }
.m-frame img { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; object-fit: contain; transform: translate(-50%, -50%); max-width: none; }
.m-mark { position: absolute; transform: translate(-50%, -50%); min-width: 30px; height: 30px; padding: 0 6px; display: flex; align-items: center; justify-content: center; border-radius: 15px; background: #d9480f; color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2px #d9480f; font-size: 13px; font-weight: 700; pointer-events: none; }
.m-zoomhint { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: var(--r); background: rgba(20, 23, 29, .75); color: #fff; font-size: 13px; }
.m-shotnav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 8px 12px 0; }
.m-shotnav .m-btn { min-height: 48px; font-size: 16px; }
.m-pos { white-space: nowrap; color: var(--muted); }
.m-toplan { margin-bottom: 12px; }

/* glavno dejanje ostane ob dnu zaslona */
.m-actions { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 6px; margin: 0 -12px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.m-page > .m-actions:last-child { margin-bottom: 0; }
.m-actions:empty { display: none; }

.m-labelimg { display: flex; justify-content: center; margin: 0 0 10px; padding: 10px; background: #cfd5dd; border-radius: var(--r-card); }
.m-labelimg img { max-width: 100%; max-height: 34vh; height: auto; background: #fff; image-rendering: pixelated; }
.m-confirm { display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 8px 0; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-card); font-weight: 600; }
.m-confirm input[type=checkbox] { flex: 0 0 auto; width: 26px; height: 26px; }
.m-error, .m-prior { margin: 8px 0; }
.m-result { font-size: 16px; }
.m-result b { font-size: 19px; }

.m-plan { display: flex; flex-direction: column; padding: 0; }
.m-page.m-plan > :last-child { margin-bottom: 0; }
.m-planhead { display: flex; flex-direction: column; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.m-planhead b { font-family: var(--mono); font-size: 18px; }
.m-planhost { flex: 1 1 0; height: auto; min-height: 0; position: relative; }

.m-viewer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #0e1116; }
.m-viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; color: #fff; }
.m-viewer-head button { min-height: 48px; min-width: 96px; font-size: 16px; }
.m-viewer-box { flex: 1 1 0; min-height: 0; }
.m-viewer .m-viewer-box.zoom-box { overflow: clip; }
.m-viewer-inner { display: flex; align-items: center; justify-content: center; }
.m-viewer .m-frame { flex: 0 0 auto; margin: 0; }
.m-viewer-box .zoom-ctl { top: auto; bottom: 16px; left: 0; right: 0; width: max-content; margin: 0 auto; gap: 10px; padding: 8px; }
.m-viewer .zoom-ctl .ico { min-width: 52px; min-height: 48px; font-size: 22px; }
/* vrnitev iz celotnega pogleda na telefonu */
#top .to-mobile { min-height: 44px; font-weight: 650; white-space: nowrap; }
body.m-ui #toasts { bottom: 80px; width: max-content; max-width: 94vw; }
/* po dotiku ostane stanje »hover«; gumb mora ostati temen z belim znakom */
body.m-ui .m-viewer .zoom-ctl .ico:hover:not(:disabled), body.m-ui .m-viewer .zoom-ctl .ico:active:not(:disabled) { background: #2b3445; color: #fff; border-color: #3a455a; }

/* ---------------------------------------------------------------- ležeči telefon: nižja glava in kontrole, širina za vsebino;
   besedilo in gumbi ostanejo enako veliki (vsaj 44 px) */
@media (orientation: landscape) and (max-height: 500px) {
  body.m-ui #top { min-height: 48px; padding: 1px 10px; }
  .m-page { padding-top: 6px; }
  .m-page.m-site, .m-page.m-room, .m-page.m-rack, .m-page.m-plan { max-width: none; }
  .m-sitehead { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
  .m-sitehead h1 { margin: 0; }
  .m-sitehead .m-floors { flex: 1 1 auto; margin: 0; }
  .m-sitehead .m-floors button { min-height: 44px; }
  .m-floorsvg { max-height: calc(100vh - 124px); max-height: calc(100dvh - 124px); }
  .m-roomplan { height: calc(100vh - 92px); height: calc(100dvh - 92px); min-height: 180px; }
  .m-orient .plan-svg { height: 100%; width: calc(100% - 62px); }
  body.m-ui .m-orient .plan-zoom { top: 0; bottom: 0; left: auto; right: 6px; width: 50px; flex-direction: column; justify-content: center; gap: 6px; }
  .m-page.m-plan { padding: 0; }
  .m-objects { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .m-rackhead { display: flex; align-items: baseline; gap: 12px; }
  .m-rackhead h1 { margin: 0; white-space: nowrap; }
  .m-rackhead p { margin: 0; }
  .m-col { flex: 1 0 124px; max-width: none; }
  .m-page a.m-cell { min-height: 48px; padding: 2px 4px; }
}
.m-sitecards { margin-top: 6px; } .m-page .m-sitecards .site-head h2 { margin: 0; }
