/* FJN System — E2-15 „Mapa magazynu” (D162, ModMapaMagazynu). K ≥ 1280, T 768–1279, M < 768. */

.fjn-map { display: flex; flex-direction: column; gap: 12px; max-width: 1400px; padding: 24px 32px; height: calc(100vh - var(--fjn-topbar-h)); min-height: 640px; box-sizing: border-box; }
.fjn-map > * { flex: none; }
.fjn-map__title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fjn-map__title > span { font-size: 15px; color: var(--fjn-text-2); white-space: nowrap; }

/* search, scan, filters */
.fjn-map__bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.fjn-map__qwrap { flex: 1 1 300px; min-width: 0; display: flex; gap: 8px; }
.fjn-map__q { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #fff; border: 1px solid var(--fjn-border-strong); border-radius: 6px; box-sizing: border-box; color: var(--fjn-text-2); }
.fjn-map__q.is-on { border: 2px solid var(--fjn-brand-600); }
.fjn-map__q input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--fjn-text); }
.fjn-map__q input::-webkit-search-cancel-button { display: none; }
.fjn-map__qx { display: flex; color: var(--fjn-text-2); }
.fjn-map__scan { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--fjn-border-strong); border-radius: 6px; box-sizing: border-box; color: var(--fjn-text); cursor: pointer; }
.fjn-map__filters { display: flex; gap: 10px; flex-wrap: wrap; }
.fjn-map__filters .fjn-filter__button { height: 44px; }
.fjn-map__fbtn { height: 48px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--fjn-border-strong); border-radius: 6px; font: inherit; font-weight: 700; font-size: 15px; color: var(--fjn-text); }
.fjn-map__fbtn.is-on { border: 2px solid var(--fjn-brand-600); }
.fjn-map.is-state .fjn-map__bar { opacity: .5; pointer-events: none; }

/* notes: result, no result, filter */
.fjn-map__note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: 8px; font-size: 14px; line-height: 20px; }
.fjn-map__note > span { flex: 1 1 220px; color: var(--fjn-text); }
.fjn-map__note.is-info { background: #DFF1F5; color: #0B6477; }
.fjn-map__note.is-hit { background: #FFF6D6; border: 1px solid #E0C36A; color: var(--fjn-text); }
.fjn-map__open { height: 40px; }

/* counters */
.fjn-map__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fjn-map__tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 14px; background: #fff; border: 1px solid var(--fjn-border); border-radius: 10px; }
.fjn-map__tile > span { font-size: 13px; color: var(--fjn-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fjn-map__tile p { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--fjn-text-2); }
.fjn-map__tile b { font: 700 20px var(--fjn-font-mono); color: var(--fjn-text); white-space: nowrap; }
.fjn-map__tile b.is-used { color: var(--fjn-brand-600); }
.fjn-map__tile b.is-free { color: var(--fjn-success-700); }
.fjn-map__tile b.is-off { color: var(--fjn-text-2); }

/* map and panel */
.fjn-map > .fjn-map__main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.fjn-map__box, .fjn-map__panel { background: #fff; border: 1px solid var(--fjn-border); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; min-height: 0; box-sizing: border-box; }
.fjn-map__boxhead { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--fjn-surface-2); font-size: 13px; color: var(--fjn-text-2); }
.fjn-map__legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--fjn-text-2); }
.fjn-map__legend li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fjn-map__key { width: 14px; height: 14px; border-radius: 3px; flex: none; box-sizing: border-box; }
.fjn-map__scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 14px; position: relative; scroll-behavior: smooth; }
.fjn-map__row { display: flex; flex-direction: column; gap: 6px; }
.fjn-map__rowhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fjn-map__rowhead > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fjn-map__rowhead > div > b { font-size: 15px; white-space: nowrap; }
.fjn-map__rowhead > div > span { font-size: 13px; color: var(--fjn-text-2); white-space: nowrap; }
.fjn-map__narrow { height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; background: #FCEFD6; color: #8A5300; }
.fjn-map__occ { font-size: 13px; color: var(--fjn-text-2); white-space: nowrap; }
.fjn-map__occ b { color: var(--fjn-text); }
.fjn-map__racks { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
.fjn-map__rack { display: flex; flex-direction: column; gap: 2px; padding: 2px; border-radius: 6px; min-width: 0; }
.fjn-map__rack.is-on { background: var(--fjn-brand-100); box-shadow: inset 0 0 0 2px var(--fjn-brand-600); }
.fjn-map__letter { font-size: 12px; line-height: 15px; font-weight: 700; text-align: center; color: var(--fjn-text-2); text-decoration: none; }
.fjn-map__rack.is-on .fjn-map__letter { color: var(--fjn-brand-600); }
.fjn-map__rack.is-hit .fjn-map__letter { color: var(--fjn-text); }
.fjn-map__cell { height: 19px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font: 700 11px var(--fjn-font-mono); box-sizing: border-box; white-space: nowrap; overflow: hidden; text-decoration: none; }
a.fjn-map__cell:hover { text-decoration: none; filter: brightness(.95); }
.fjn-map__key.is-free, .fjn-map__cell.is-free { background: #fff; border: 1.5px solid #1B6B41; color: #1B6B41; }
.fjn-map__key.is-part, .fjn-map__cell.is-part { background: #E3ECF7; border: 1.5px solid #1E4F8A; color: #173F6F; }
.fjn-map__key.is-full, .fjn-map__cell.is-full { background: #1E4F8A; border: 1.5px solid #1E4F8A; color: #fff; }
.fjn-map__key.is-off, .fjn-map__cell.is-off { background: repeating-linear-gradient(135deg, #AEB5BE 0 3px, #EEF0F2 3px 6px); border: 1.5px solid #AEB5BE; color: #454D57; }
.fjn-map__cell.is-none { visibility: hidden; }
.fjn-map__cell.is-dim { opacity: .22; }
.fjn-map__cell.is-hit { box-shadow: 0 0 0 2px #fff, 0 0 0 5px #15181C; position: relative; z-index: 2; }
.fjn-map__cell.is-picked { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #15181C; position: relative; z-index: 1; }

/* panel of a rack */
.fjn-map__panel.is-empty { align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.fjn-map__panel.is-empty b { font-size: 16px; }
.fjn-map__panel.is-empty span { max-width: 260px; font-size: 14px; line-height: 20px; color: var(--fjn-text-2); }
.fjn-map .is-muted { color: var(--fjn-text); }
.fjn-map .is-error { color: #B3261E; }
.fjn-map__phead2 { flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--fjn-surface-2); }
.fjn-map__phead2 > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fjn-map__phead2 span, .fjn-map__phead2 small { font-size: 13px; color: var(--fjn-text-2); }
.fjn-map__phead2 b { font-size: 28px; line-height: 34px; }
.fjn-map__close { flex: none; width: 44px; height: 44px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--fjn-text); }
.fjn-map__plevels { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 12px; position: relative; scroll-behavior: smooth; }
.fjn-map__lvl { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; margin: 0 -8px; border-radius: 8px; border-bottom: 1px solid var(--fjn-surface-2); }
.fjn-map__lvl.is-picked { background: #F4F7FB; }
.fjn-map__lvlhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fjn-map__lvlhead b { font-size: 17px; white-space: nowrap; }
.fjn-map__chip { height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fjn-map__chip i { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.fjn-map__chip.is-free { background: #E2F2E8; color: #1B6B41; }
.fjn-map__chip.is-part { background: #E3ECF7; color: #173F6F; }
.fjn-map__chip.is-full { background: #1E4F8A; color: #fff; }
.fjn-map__chip.is-off { background: #EEF0F2; color: #454D57; }
.fjn-map__set { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0; border-radius: 6px; color: var(--fjn-text); text-decoration: none; }
.fjn-map__set:hover { text-decoration: none; background: var(--fjn-brand-50); }
.fjn-map__set > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-weight: 400; line-height: 1.35; }
.fjn-map__set > span > span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fjn-map__set small { font-size: 12px; color: var(--fjn-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fjn-map__set > svg { flex: none; color: var(--fjn-text-2); }
.fjn-map__set.is-hit { background: #FFF6D6; box-shadow: inset 0 0 0 2px #15181C; padding: 6px 10px; }
.fjn-map__setno { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fjn-map__setno b { font-size: 14px; }
.fjn-map__setno b:first-child { color: var(--fjn-brand-600); }
.fjn-map__free, .fjn-map__off { min-height: 36px; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; font-size: 13px; color: var(--fjn-text-2); }
.fjn-map__free { border: 1.5px dashed #AEB5BE; white-space: nowrap; }
.fjn-map__off { background: repeating-linear-gradient(135deg, #EEF0F2 0 6px, #F7F8F9 6px 12px); }
.fjn-map__scrim { display: none; }
.fjn-map__handle { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: #AEB5BE; }

/* empty warehouse, error */
.fjn-map > .fjn-map__card { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 32px 20px; background: #fff; border: 1px solid var(--fjn-border); border-radius: 10px; text-align: center; }
.fjn-map__card > b { font-size: 20px; }
.fjn-map__card > span { max-width: 440px; font-size: 15px; line-height: 22px; color: var(--fjn-text-2); }
.fjn-map__card > .fjn-map__code { font-size: 13px; }
.fjn-map__cardbtn { height: 56px; padding: 0 18px; }

/* tablet: the panel slides in from the right over a dimmed map */
@media (max-width: 1279px) {
  .fjn-map { padding: 16px 24px; }
  .fjn-map__qwrap, .fjn-map__q, .fjn-map__scan, .fjn-map__filters .fjn-filter__button { height: 56px; }
  .fjn-map__qwrap { height: auto; }
  .fjn-map__scan { width: 56px; }
  .fjn-map > .fjn-map__main { grid-template-columns: minmax(0, 1fr); }
  .fjn-map__panel.is-empty, .fjn-map__panel.is-auto { display: none; }
  .fjn-map__panel.is-open { position: fixed; top: var(--fjn-topbar-h); right: 0; bottom: 0; width: 400px; height: auto; min-height: 0; border-radius: 0; border-width: 0 0 0 1px; z-index: 30; box-shadow: -8px 0 30px rgba(21, 24, 28, .15); }
  .fjn-map__scrim { display: block; position: fixed; inset: var(--fjn-topbar-h) 0 0 0; background: rgba(21, 24, 28, .25); z-index: 29; }
  .fjn-map__racks { gap: 3px; }
  .fjn-map__cell { height: 22px; }
  .fjn-map__set { min-height: 56px; }
}

/* phone: one row at a time, the rack as a sheet from the bottom */
@media (max-width: 767px) {
  .fjn-map { gap: 10px; padding: 12px 16px; height: calc(100vh - var(--fjn-topbar-h-m) - var(--fjn-bottomnav-h)); min-height: 560px; }
  .fjn-map > .fjn-map__main { display: flex; flex-direction: column; }
  .fjn-map__phone { flex: 1; min-height: 0; }
  .fjn-map__pbox { flex: 1; min-height: 0; }
  .fjn-map__qwrap, .fjn-map__q, .fjn-map__scan { height: 48px; }
  .fjn-map__qwrap { flex-basis: 100%; height: auto; }
  .fjn-map__scan { width: 48px; }
  .fjn-map__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fjn-map__tile { padding: 8px 12px; }
  .fjn-map__tile b { font-size: 17px; }
  .fjn-map__main { display: block; }
  .fjn-map__phone { display: flex; flex-direction: column; gap: 10px; }
  .fjn-map__rowpick { display: flex; gap: 8px; }
  .fjn-map__arrow { flex: none; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--fjn-border-strong); border-radius: 8px; box-sizing: border-box; color: var(--fjn-text); }
  .fjn-map__arrow.is-off { opacity: .4; }
  .fjn-map__rowsel { position: relative; flex: 1; min-width: 0; height: 56px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border: 1px solid var(--fjn-border-strong); border-radius: 8px; box-sizing: border-box; }
  .fjn-map__rowsel > span { display: flex; flex-direction: column; min-width: 0; }
  .fjn-map__rowsel b { font-size: 18px; white-space: nowrap; }
  .fjn-map__rowsel small { font-size: 12px; color: var(--fjn-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fjn-map__rowsel select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
  .fjn-map__pbox { background: #fff; border: 1px solid var(--fjn-border); border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; }
  .fjn-map__pline { display: grid; grid-template-columns: 40px repeat(4, minmax(0, 1fr)) 20px; gap: 6px; align-items: center; min-height: 56px; padding: 4px 0; border-bottom: 1px solid var(--fjn-surface-2); box-sizing: border-box; color: var(--fjn-text); text-decoration: none; }
  .fjn-map__pline:hover { text-decoration: none; }
  .fjn-map__pline > b { font-size: 18px; color: var(--fjn-text-2); }
  .fjn-map__pline > svg { color: var(--fjn-text-2); }
  .fjn-map__pline.is-on { background: #F4F7FB; box-shadow: inset 3px 0 0 #15181C; padding-left: 8px; margin-left: -10px; padding-right: 10px; margin-right: -10px; }
  .fjn-map__pline.is-on > b { color: var(--fjn-text); }
  .fjn-map__phead { flex: none; min-height: 0; padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--fjn-text-2); }
  .fjn-map__phead span:not(:first-child) { text-align: center; }
  .fjn-map__pscroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 10px 8px; position: relative; scroll-behavior: smooth; }
  .fjn-map__pline .fjn-map__cell { height: 40px; border-radius: 6px; font-size: 13px; }
  .fjn-map__pfoot { flex: none; padding: 8px 10px; border-top: 1px solid var(--fjn-surface-2); }
  .fjn-map__pfoot .fjn-map__legend { gap: 10px; font-size: 12px; }
  .fjn-map__pfoot .fjn-map__key { width: 12px; height: 12px; }
  .fjn-map__panel.is-open { top: auto; left: 0; right: 0; bottom: var(--fjn-bottomnav-h); width: auto; max-height: 82vh; border-radius: 16px 16px 0 0; border-width: 0; box-shadow: 0 -8px 30px rgba(21, 24, 28, .2); }
  .fjn-map__panel .fjn-map__phead2 { padding: 8px 16px 10px; }
  .fjn-map__panel .fjn-map__phead2 b { font-size: 26px; }
  .fjn-map__close { width: 48px; height: 48px; }
  .fjn-map__plevels { padding: 0 16px 16px; }
  .fjn-map__free, .fjn-map__off { min-height: 40px; }
  .fjn-map__scrim { background: rgba(21, 24, 28, .45); }
  .fjn-map__card > b { font-size: 20px; }
}

/* phone filter sheet */
.fjn-map__sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; padding: 0; border: 0; border-radius: 16px 16px 0 0; }
.fjn-map__sheet h2 { margin: 0; padding: 8px 16px 4px; font-size: 19px; }
.fjn-map__sheetf { padding: 8px 16px; display: flex; flex-direction: column; gap: 12px; }
.fjn-map__sheetf > div { display: flex; flex-direction: column; gap: 6px; }
.fjn-map__flabel { font-size: 14px; font-weight: 700; }
.fjn-map__sheetf .fjn-filter__button { width: 100%; height: 48px; justify-content: space-between; box-sizing: border-box; }
.fjn-map__sheetf .fjn-filter__name { display: none; }
.fjn-map__sheetf .fjn-filter__value { font-weight: 400; font-size: 15px; max-width: none; }
.fjn-map__sheetf small { font-size: 13px; color: var(--fjn-text-2); }
.fjn-map__sheetfoot { display: flex; gap: 10px; padding: 12px 16px 16px; margin-top: 6px; border-top: 1px solid var(--fjn-surface-2); }
.fjn-map__sheetfoot > * { flex: 1; height: 56px; }
.fjn-map__sheetfoot > button { flex: 2; }

/* several results (D163 pt 3) */
.fjn-map__results { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #E0C36A; border-radius: 10px; overflow: hidden; }
.fjn-map > .fjn-map__results { flex: none; max-height: 172px; overflow-y: auto; } /* about 3 results, so the map stays in view */
.fjn-map__result { display: flex; align-items: center; gap: 14px; padding: 7px 14px; }
.fjn-map__result + .fjn-map__result, .fjn-map__rmore { border-top: 1px solid var(--fjn-surface-2); }
.fjn-map__raddr { flex: none; min-width: 64px; font-size: 20px; }
.fjn-map__rtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fjn-map__rtext a { font-weight: 700; font-size: 14px; color: var(--fjn-brand-600); }
.fjn-map__rtext small { font-size: 13px; color: var(--fjn-text-2); }
.fjn-map__racts { flex: none; display: flex; gap: 8px; }
.fjn-map__racts .fjn-btn { height: 40px; }
.fjn-map__rmore { padding: 10px 14px; font-size: 14px; }
@media (max-width: 767px) {
  .fjn-map__result { flex-wrap: wrap; gap: 4px 12px; }
  .fjn-map__raddr { font-size: 18px; }
  .fjn-map > .fjn-map__results { max-height: 236px; }
  .fjn-map.has-results { height: auto; } /* the list pushes the row down: the page scrolls */
  .fjn-map.has-results .fjn-map__pbox { flex: none; height: 60vh; min-height: 360px; }
  .fjn-map__racts { flex-basis: 100%; }
  .fjn-map__racts .fjn-btn { height: 44px; }
}
