	:root {
      --amfn-black: #1a1a1a;
      --amfn-gold: #fbc02d;
      --bg-gray: #f0f2f5;
      --path-normal: #1976d2;
      --path-stairs: #43a047;
      --bg: #050608;
      --text: #f5f5f5;
      --muted: #aaaaaa;
	  --wrap:  clamp(160px, 48vw, 205px);
	  --inner: clamp(128px, 38vw, 158px);
      --icon: clamp(110px, 33vw, 143px);
      --radius-wrap: clamp(26px, 7vw, 38px);
      --radius-inner: clamp(20px, 5.5vw, 30px);
    }

    * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

    body {
      font-family: 'Montserrat', sans-serif;
      background: var(--bg-gray);
      margin: 0;
      display: flex;
      flex-direction: column;
      height: 100vh;
      height: 100dvh;
      overflow: hidden;
    }

html{
  height: 100%;
  overflow: hidden;
}
body{
  height: 100%;
}

    a, button { color: inherit; text-decoration: none; }

    .splash-overlay {
      position: fixed;
      inset: 0;
      background: radial-gradient(circle at top, #202124, var(--bg) 70%);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2000;
      transition: opacity 0.6s ease;
    }
    .splash-overlay.hidden {
      opacity: 0;
      pointer-events: none;
      visibility: hidden;
    }
    .splash {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 20px;
      text-align: center;
      padding: 24px;
      transform: translateY(-20px);
    }
    .logo-wrapper {
      width: var(--wrap);
      height: var(--wrap);
      border-radius: var(--radius-wrap);
      background: linear-gradient(145deg, #000000, #161616);
      box-shadow: 0 22px 50px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.03);
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      overflow: hidden;
    }
    .logo-inner {
      width: var(--inner);
      height: var(--inner);
      border-radius: var(--radius-inner);
      background: radial-gradient(circle at 30% 20%, #2a2a2a, #050608 80%);
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
    }
	

    .pin-glow {
      position: absolute;
      width: calc(var(--icon) + 30px);
      height: calc(var(--icon) + 30px);
      border-radius: 50%;
      background: radial-gradient(circle, rgba(251,192,45,0.45), transparent 70%);
      filter: blur(8px);
      opacity: 0;
      animation: pinGlow 3.2s ease-out infinite;
    }
    .pin-icon {
      width: var(--icon);
      height: var(--icon);
      animation: pinPulse 3.2s ease-out infinite;
    }
    @keyframes pinPulse {
      0% { transform: scale(0.9) translateY(6px); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
      15% { transform: scale(1.08) translateY(0); filter: drop-shadow(0 14px 16px rgba(0,0,0,0.9)); }
      35% { transform: scale(1.0) translateY(3px); filter: drop-shadow(0 9px 12px rgba(0,0,0,0.8)); }
      100% { transform: scale(0.9) translateY(6px); filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
    }
    @keyframes pinGlow {
      0% { opacity: 0; transform: scale(0.7); }
      15% { opacity: 0.9; transform: scale(1.05); }
      35% { opacity: 0.5; transform: scale(1.0); }
      100% { opacity: 0; transform: scale(0.7); }
    }

    .splash-title {
      margin: 0;
      display: inline-flex;
      gap: 2px;
      font-size: clamp(24px, 6vw, 30px);
      font-weight: 700;
      letter-spacing: 0.08em;
      text-shadow: 0 2px 8px rgba(0,0,0,0.8);
      color: var(--text);
    }
    .title-letter {
      opacity: 0;
      transform: translateY(10px);
      animation: letterIn 0.4s ease-out forwards;
      animation-delay: calc(var(--i) * 0.12s);
    }
    @keyframes letterIn {
      to { opacity: 1; transform: translateY(0); }
    }

    .splash-subtitle {
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 14px;
      font-weight: 600;
      color: var(--muted);
      text-shadow: 0 1px 4px rgba(0,0,0,0.8);
      opacity: 0;
      animation: subtitleFade 0.7s ease-out forwards;
      animation-delay: 1s;
    }
    .splash-line:last-child { color: var(--amfn-gold); }
    @keyframes subtitleFade { to { opacity: 1; } }

    @media (prefers-reduced-motion: reduce) {
      .pin-glow, .pin-icon, .title-letter, .splash-subtitle { animation: none !important; }
      .title-letter, .splash-subtitle { opacity: 1; transform: none; }
    }

.header {
  background: var(--amfn-black);
  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 64px;            /* było min-height:56px */
  padding: 0 16px;         /* pion robimy z height */
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);

  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;           /* centrowanie pionowe */
  gap: 10px;
}

.header-logo-img{
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

.header-right {
  display: flex;
  align-items: center;           /* centrowanie pionowe */
  gap: 12px;
}

/* ===== PILL HEIGHT NORMALIZATION ===== */
/* wszystko w headerze ma tę samą "wysokość optyczną" */
.install-btn,
.lang-btn,
.menu-icon{
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===== LANG SWITCHER ===== */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: #333;
  border-radius: 999px;
  padding: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: #888;
  font-size: 11px;
  padding: 0 10px;               /* pion jest z height:32px */
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--amfn-gold);
  color: #000;
}

/* ===== INSTALL BUTTON ===== */
.install-btn{
  border: 1px solid rgba(0,0,0,0.08);
  background: var(--amfn-gold);
  color: #000;
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  padding: 0 12px;               /* pion jest z height:32px */
  border-radius: 999px;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}

.install-btn:hover{
  filter: brightness(0.98);
}

.install-btn:active{
  transform: translateY(1px);
}

/* ===== MENU ICON ===== */
.menu-icon{
  color: var(--amfn-gold);
  font-size: 28px;
  cursor: pointer;
  padding: 0 8px;                /* pion jest z height:32px */
}

    .floor-bar {
      background: white;
      padding: 10px 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
      z-index: 100;
      flex-shrink: 0;
    }
    .floor-bar-inner {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .floor-bar-inner::-webkit-scrollbar { display: none; }
    .floor-btn {
      min-width: 38px;
      height: 38px;
      border-radius: 50%;
      border: 2px solid #ddd;
      background: white;
      font-size: 14px;
      font-weight: 700;
      cursor: pointer;
      font-family: inherit;
      color: var(--amfn-black);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s ease;
      flex-shrink: 0;
    }
    .floor-btn:hover { border-color: var(--amfn-gold); }
    .floor-btn.active {
      background: var(--amfn-black);
      color: var(--amfn-gold);
      border-color: var(--amfn-gold);
      box-shadow: 0 0 0 3px rgba(251,192,45,0.25);
    }

    .map-viewport {
      flex: 1;
      background-color: #eef2f3;
      position: relative;
      overflow: hidden;
      z-index: 1;
      touch-action: none;
      background-image: radial-gradient(#ccc 1px, transparent 1px);
      background-size: 25px 25px;
    }
    .map-content {
      position: absolute;
      top: 50%;
      left: 50%;
      width: 1000px;
      height: 800px;
      transform: translate(-50%, -50%);
      transform-origin: center center;
    }
    .map-floor { position: absolute; inset: 0; display: none; }
    .map-floor.active { display: block; }
    .building-structure { position: absolute; inset: 0; pointer-events: none; }

    .path-layer { position: absolute; inset: 0; pointer-events: none; }

    .room-highlight {
      background: #fff8e1 !important;
      border-color: var(--amfn-gold) !important;
      box-shadow: 0 0 0 4px rgba(251,192,45,0.4);
      animation: roomPulse 1.5s ease-in-out infinite;
    }
    @keyframes roomPulse {
      0%, 100% { box-shadow: 0 0 0 4px rgba(251,192,45,0.4); }
      50% { box-shadow: 0 0 20px 8px rgba(251,192,45,0.6); }
    }

    .pin {
      position: absolute;
      width: 36px;
      height: 36px;
      transform: translate(-50%, -100%);
      display: none;
      z-index: 50;
      filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
      pointer-events: none;
    }
    .pin.visible { display: block; }
    .pin svg { width: 100%; height: 100%; }

    .zoom-controls {
      position: absolute;
      bottom: 90px;
      right: 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      z-index: 400;
    }
    .zoom-btn {
      width: 42px;
      height: 42px;
      background: white;
      border: none;
      border-radius: 10px;
      font-size: 20px;
      cursor: pointer;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
      color: var(--amfn-black);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .zoom-btn:hover { background: var(--amfn-gold); }
    .zoom-btn.dark { background: var(--amfn-black); color: var(--amfn-gold); }
#btnCenter .center-icon{
  width: 22px;
  height: 22px;
  display: block;
}
    .floor-transition {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: var(--amfn-black);
      color: white;
      padding: 24px 40px;
      border-radius: 20px;
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      z-index: 450;
      box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    }
    .floor-transition.active { display: flex; }
    .transition-icon { color: var(--amfn-gold); }
    .transition-icon svg { width: 48px; height: 48px; }
    .transition-icon .icon-elevator.moving { animation: elevatorMove 0.6s ease-in-out; }
    .transition-icon .icon-stairs.moving { animation: stairsMove 0.6s ease-in-out; }
    @keyframes elevatorMove {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-8px); }
    }
    @keyframes stairsMove {
      0% { transform: translateX(0) translateY(0); }
      50% { transform: translateX(4px) translateY(-4px); }
      100% { transform: translateX(0) translateY(0); }
    }
    .transition-text { font-size: 16px; font-weight: 700; }

.fab-search {
  position: absolute;
  left: 16px;
  bottom: 90px;   /* taka sama wysokość jak zoom */
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: var(--amfn-black);
  color: var(--amfn-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 400;
}
    .fab-search svg {
      width: 24px;
      height: 24px;
      stroke: var(--amfn-gold);
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
    }
    .fab-search:hover {
      transform: scale(1.05);
      box-shadow: 0 6px 25px rgba(0,0,0,0.4);
    }
    .fab-search:active { transform: scale(0.98); }
    .fab-search.pulse { animation: fabPulse 2s ease-in-out infinite; }
    @keyframes fabPulse {
      0%, 100% { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
      50% { box-shadow: 0 4px 20px rgba(251,192,45,0.4); }
    }

    .main-panel {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      background: white;
      border-radius: 24px 24px 0 0;
      box-shadow: 0 -5px 30px rgba(0,0,0,0.15);
      z-index: 500;
      display: flex;
      flex-direction: column;
      transition: transform 0.3s ease;
    }
    .main-panel.collapsed { transform: translateY(calc(100% - 60px)); }

    .panel-header {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 10px 20px 8px;
      cursor: pointer;
      user-select: none;
      min-height: 60px;
      position: relative;
    }
    .panel-handle {
      width: 40px;
      height: 5px;
      background: #ddd;
      border-radius: 999px;
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
    }
    .panel-summary { text-align: center; padding-top: 6px; }
    .panel-summary-title { font-size: 14px; font-weight: 700; color: var(--amfn-black); }
    .panel-summary-sub { font-size: 11px; color: #888; margin-top: 2px; }

    .panel-body {
      flex: 1;
      overflow-y: auto;
      max-height: calc(50vh - 60px);
    }
    .panel-view {
      display: none;
      flex-direction: column;
      padding: 0 20px 20px;
    }
    .panel-view.active { display: flex; }

    .search-box {
      display: flex;
      align-items: center;
      background: var(--bg-gray);
      border: 2px solid transparent;
      border-radius: 14px;
      padding: 12px 16px;
      gap: 12px;
      transition: all 0.2s ease;
    }
    .search-box:focus-within { border-color: var(--amfn-gold); background: white; }
    .search-box .search-icon {
      width: 20px; height: 20px;
      stroke: #999; fill: none; stroke-width: 2;
      flex-shrink: 0;
    }
    .search-box:focus-within .search-icon { stroke: var(--amfn-gold); }
    .search-box input {
      flex: 1; border: none; background: transparent;
      font-size: 15px; font-family: inherit; font-weight: 600;
      outline: none; color: var(--amfn-black);
    }
    .search-box input::placeholder { color: #aaa; font-weight: 400; }
    .clear-btn {
      background: #ddd; border: none; border-radius: 50%;
      width: 22px; height: 22px; font-size: 12px;
      cursor: pointer; display: none; align-items: center;
      justify-content: center; color: #666;
    }
    .clear-btn.visible { display: flex; }

    .categories { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
    .cat-btn {
      padding: 8px 14px; border: 1px solid #ddd; border-radius: 999px;
      background: white; font-size: 12px; font-weight: 600;
      color: #555; cursor: pointer; font-family: inherit;
    }
    .cat-btn:hover { border-color: var(--amfn-gold); }
    .cat-btn.active { background: var(--amfn-black); color: var(--amfn-gold); border-color: var(--amfn-black); }

    .search-results { list-style: none; padding: 0; margin: 0; }
    .result-item {
      display: flex; align-items: center; padding: 12px 0;
      border-bottom: 1px solid #eee; cursor: pointer; gap: 12px;
    }
    .result-item:hover { background: #fafafa; margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
    .result-item:last-child { border-bottom: none; }

    .result-icon {
      width: 36px; height: 36px; background: var(--amfn-black);
      border-radius: 8px; display: flex; align-items: center;
      justify-content: center; flex-shrink: 0;
    }
    .result-icon svg { width: 18px; height: 18px; stroke: var(--amfn-gold); fill: none; stroke-width: 2; }
    .result-info { flex: 1; min-width: 0; }
    .result-name { font-weight: 700; font-size: 14px; color: var(--amfn-black); }
    .result-meta { font-size: 11px; color: #888; }
    .result-floor {
      background: var(--amfn-black); color: var(--amfn-gold);
      padding: 4px 10px; border-radius: 999px;
      font-size: 11px; font-weight: 700; flex-shrink: 0;
    }

    .empty-state { text-align: center; padding: 15px 10px; color: #888; font-size: 14px; }

    .back-btn {
      display: inline-flex; align-items: center; gap: 6px;
      background: none; border: none; font-size: 13px;
      font-weight: 600; color: #666; cursor: pointer;
      padding: 8px 0; font-family: inherit;
    }
    .back-btn svg {
      width: 18px; height: 18px; stroke: currentColor;
      fill: none; stroke-width: 2;
    }

    .room-card {
      background: var(--amfn-black); border-radius: 14px;
      padding: 20px; color: white; margin-bottom: 12px;
      display: flex; align-items: center;
      justify-content: space-between; gap: 16px;
    }
    .room-card-info h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
    .room-card-info p { margin: 0; font-size: 12px; color: #aaa; }
    .room-floor-badge {
      background: var(--amfn-gold); color: var(--amfn-black);
      padding: 6px 14px; border-radius: 999px;
      font-size: 11px; font-weight: 700; white-space: nowrap;
    }

    .room-number-row {
      display: flex; justify-content: space-between; align-items: center;
      padding: 12px 16px; background: var(--bg-gray);
      border-radius: 10px; margin-bottom: 16px;
    }
    .room-number-label { font-size: 13px; color: #666; }
    .room-number-value { font-size: 15px; font-weight: 700; color: var(--amfn-black); }

    .action-buttons { display: flex; flex-direction: column; gap: 10px; }
    .btn-primary {
      background: var(--amfn-gold); color: var(--amfn-black);
      border: none; border-radius: 12px; padding: 14px 20px;
      font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer;
    }
    .btn-secondary {
      background: transparent; color: var(--amfn-black);
      border: 2px solid #ddd; border-radius: 12px; padding: 12px 20px;
      font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
    }

    .start-header { text-align: center; margin-bottom: 16px; }
    .start-header h3 { margin: 0 0 10px; font-size: 16px; color: var(--amfn-black); }
    .destination-badge {
      display: inline-flex; align-items: center; gap: 8px;
      background: var(--bg-gray); padding: 8px 14px;
      border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--amfn-black);
    }
    .destination-badge .arrow { color: var(--amfn-gold); }

    .route-preference {
      background: var(--bg-gray); border-radius: 12px;
      padding: 12px 16px; margin-bottom: 16px;
    }
    .pref-label { font-size: 12px; color: #666; display: block; margin-bottom: 10px; }
    .pref-options { display: flex; gap: 12px; }
    .pref-option {
      flex: 1; display: flex; align-items: center; gap: 10px;
      background: white; padding: 12px 14px; border-radius: 10px;
      cursor: pointer; border: 2px solid transparent; transition: all 0.2s;
    }
    .pref-option:has(input:checked) { border-color: var(--amfn-gold); background: #fffde7; }
    .pref-option input { display: none; }
    .pref-icon-wrap {
      width: 28px; height: 28px;
      background: var(--amfn-black); border-radius: 6px;
      display: flex; align-items: center; justify-content: center;
    }
    .pref-icon-wrap svg {
      width: 16px; height: 16px;
      stroke: var(--amfn-gold); fill: none; stroke-width: 2;
    }
    .pref-option span:last-child { font-size: 13px; font-weight: 600; color: var(--amfn-black); }

    .start-options { display: flex; flex-direction: column; gap: 8px; }
    .start-option {
      display: flex; align-items: center; gap: 12px;
      padding: 12px 14px; background: white; border: 2px solid #eee;
      border-radius: 10px; cursor: pointer; font-family: inherit; text-align: left;
    }
    .start-option:hover { border-color: var(--amfn-gold); background: #fffde7; }
    .start-option-icon {
      width: 32px; height: 32px; background: var(--bg-gray);
      border-radius: 8px; display: flex; align-items: center; justify-content: center;
    }
    .start-option-icon svg {
      width: 16px; height: 16px;
      stroke: var(--amfn-black); fill: none; stroke-width: 2;
    }
    .start-option-text { font-weight: 600; font-size: 13px; color: var(--amfn-black); }

    .other-input { margin-top: 12px; display: none; }
    .other-input.visible { display: block; }

    .nav-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
    .nav-close {
      background: var(--bg-gray); border: none; border-radius: 50%;
      width: 32px; height: 32px; font-size: 14px; cursor: pointer;
      display: flex; align-items: center; justify-content: center; color: var(--amfn-black);
    }
    .nav-route { flex: 1; font-size: 13px; font-weight: 600; color: var(--amfn-black); }
    .nav-route .arrow { color: var(--amfn-gold); margin: 0 6px; }

    .nav-new-search {
      background: var(--amfn-black); border: none; border-radius: 8px;
      width: 36px; height: 36px; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
    }
    .nav-new-search svg {
      width: 18px; height: 18px;
      stroke: var(--amfn-gold); fill: none; stroke-width: 2;
    }
    .nav-new-search:hover { background: #333; }

    .nav-info { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12px; color: #666; }
    .nav-info strong { color: var(--amfn-black); }
    .nav-method { display: flex; align-items: center; gap: 6px; }
    .nav-method svg { width: 16px; height: 16px; stroke: var(--amfn-gold); fill: none; stroke-width: 2; }

    .nav-steps { display: flex; flex-direction: column; }
    .nav-step {
      display: flex; gap: 12px; padding: 10px 0;
      border-bottom: 1px solid #eee; cursor: pointer;
    }
    .nav-step:last-child { border-bottom: none; }
    .step-num {
      width: 26px; height: 26px; background: var(--bg-gray);
      border-radius: 50%; display: flex; align-items: center;
      justify-content: center; font-size: 11px; font-weight: 700;
      flex-shrink: 0; color: var(--amfn-black);
    }
    .nav-step.current .step-num { background: var(--amfn-gold); color: var(--amfn-black); }
    .step-content { flex: 1; }
    .step-text { font-size: 13px; font-weight: 600; color: var(--amfn-black); display: flex; align-items: center; gap: 6px; }
    .step-meta { font-size: 11px; color: #888; }
    .step-icon { width: 16px; height: 16px; stroke: var(--amfn-gold); fill: none; stroke-width: 2; }

    .nav-floors {
      display: flex; align-items: center; justify-content: center;
      gap: 8px; padding: 12px 0; border-top: 1px solid #eee; margin-top: 8px;
      font-size: 11px; color: #888;
    }
    .floor-dot {
      width: 28px; height: 28px; border-radius: 50%;
      border: 2px solid #ddd; background: white;
      font-size: 11px; font-weight: 700; cursor: pointer;
      font-family: inherit; color: var(--amfn-black);
    }
    .floor-dot.active { background: var(--amfn-black); color: var(--amfn-gold); border-color: var(--amfn-gold); }
    .floor-dot.on-route { border-color: var(--amfn-gold); }

    .menu-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.5);
      display: none; align-items: center; justify-content: center; z-index: 1200;
    }
    .menu-overlay.active { display: flex; }
    .menu-panel {
      background: white; border-radius: 16px; padding: 20px;
      max-width: 340px; width: 90%; max-height: 80vh; overflow-y: auto;
    }
   
.install-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1400;
}

.install-overlay.active{ display:flex; }

.install-modal{
  width: min(380px, 92vw);
  background: var(--amfn-black);
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
}

.install-modal-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.install-modal-title{
  font-size: 16px;
  font-weight: 800;
  color: var(--amfn-gold);
}

.install-modal-close{
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.install-modal-text{
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #d5d5d5;
}

.install-modal-steps{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
}

.install-modal-steps-label{
  font-size: 12px;
  font-weight: 700;
  color: #e5e5e5;
  margin-bottom: 8px;
}

.install-modal-steps-list{
  margin: 0;
  padding-left: 18px;
  color: #f0f0f0;
  font-size: 12px;
  line-height: 1.6;
}

.install-modal-actions{
  margin-top: 14px;
  display:flex;
  justify-content: flex-end;
}

.install-modal-ok{
  border: none;
  background: var(--amfn-gold);
  color: #000;
  font-weight: 800;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.install-modal-ok:active{ transform: translateY(1px); }

   .menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
    .menu-title { font-size: 18px; font-weight: 700; color: var(--amfn-black); }
    .menu-close {
      background: var(--bg-gray); border: none; border-radius: 50%;
      width: 32px; height: 32px; cursor: pointer; font-size: 14px; color: var(--amfn-black);
    }
    .menu-subtitle { font-size: 12px; color: #888; margin: 0 0 16px; }

    .menu-section { margin-bottom: 20px; }
    .menu-section h4 { margin: 0 0 12px; font-size: 13px; color: var(--amfn-black); }

    .menu-list { list-style: none; padding: 0; margin: 0; }
    .menu-list li {
      display: flex; align-items: flex-start; gap: 12px;
      padding: 10px 0; border-bottom: 1px solid #eee;
      font-size: 12px; color: #555; line-height: 1.4;
    }
    .menu-list li:last-child { border-bottom: none; }
    .menu-tip-icon {
      width: 28px; height: 28px; background: var(--amfn-black);
      border-radius: 6px; display: flex; align-items: center;
      justify-content: center; flex-shrink: 0;
    }
    .menu-tip-icon svg {
      width: 14px; height: 14px;
      stroke: var(--amfn-gold); fill: none; stroke-width: 2;
    }

    .menu-text { font-size: 12px; color: #666; line-height: 1.5; margin: 0; }

    .menu-actions { margin-top: 16px; }
    .menu-action-btn {
      width: 100%; background: var(--amfn-black); color: var(--amfn-gold);
      border: none; border-radius: 10px; padding: 12px;
      font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .menu-action-btn svg {
      width: 18px; height: 18px;
      stroke: var(--amfn-gold); fill: none; stroke-width: 2;
    }

    .menu-footer {
      display: flex; justify-content: space-between;
      margin-top: 20px; padding-top: 16px; border-top: 1px solid #eee;
      font-size: 11px; color: #aaa;
    }

    @media (min-width: 768px) {
      .main-panel { left: 50%; transform: translateX(-50%); max-width: 420px; }
      .main-panel.collapsed { transform: translateX(-50%) translateY(calc(100% - 60px)); }
    }
	
@media (max-width: 767px) {
  :root{
    --topOffset: 104px; /* fallback */
    --appH: 100dvh;     /* fallback */
    --panelCollapsedH: 64px; /* wysokość belki po zwinięciu */
  }

  .main-panel{
    position: fixed; /* ważne: trzyma się pod paskiem pięter */
    top: var(--topOffset);
    left: 0;
    right: 0;
    bottom: auto;

    border-radius: 0 0 24px 24px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.16);

    /* zamiast przesuwać – ograniczamy wysokość */
    max-height: calc(var(--appH) - var(--topOffset) - env(safe-area-inset-bottom));
    overflow: hidden;

    /* wyłącz “bottom-sheet” transform z wersji desktop */
    transform: none !important;

    transition: max-height 0.28s ease, box-shadow 0.28s ease;
  }

  .main-panel.collapsed{
    max-height: var(--panelCollapsedH);
    box-shadow: 0 4px 18px rgba(0,0,0,0.14);
  }

  .panel-header{
    min-height: var(--panelCollapsedH);
    padding: 10px 16px 8px;
  }

  .panel-body{
    max-height: calc(var(--appH) - var(--topOffset) - var(--panelCollapsedH) - env(safe-area-inset-bottom));
    overflow-y: auto;

    transition: opacity 0.18s ease;
    opacity: 1;
  }

  /* po zwinięciu chowamy zawartość, ale belka zostaje w 100% widoczna pod piętrami */
  .main-panel.collapsed .panel-body{
    max-height: 0;
    opacity: 0;
    pointer-events: none;
  }
}

/* wektor */
.floor-svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:auto; /* ważne, żeby pokoje były klikalne */
}
.floor-wall{ stroke:#1f1f1f; stroke-width:8; stroke-linecap:round; fill:none; }
.floor-room{ fill:#fff; stroke:#555; stroke-width:2; }
.floor-label{ fill:#333; font-weight:700; font-size:12px; user-select:none; }



/* płynne pojawianie się aplikacji po splash */
.app-root{
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;

  opacity: 1;
  transform: translateY(0);
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.app-root.is-hidden{
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* ADMIN MODAL (metadane) */
.admin-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1600;
}
.admin-overlay.active{ display:flex; }

.admin-modal{
  width: min(980px, 96vw);
  height: min(720px, 88vh);
  background: var(--amfn-black);
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 70px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.admin-title{
  font-weight: 900;
  color: var(--amfn-gold);
  font-size: 14px;
  letter-spacing: .02em;
}
.admin-close{
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}

.admin-body{
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  /* ZMIANA: flex:1 i overflow:hidden naprawia scroll całego okna */
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.admin-left{
  /* ZMIANA: 20px na dole robi odstęp listy od ramki */
  padding: 12px 12px 20px 12px;
  border-right: 1px solid rgba(255,255,255,0.08);
  display:flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.admin-search input{
  width: 100%;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  font: 13px/1.2 system-ui;
}
.admin-search input:focus{
  border-color: rgba(251,192,45,0.7);
}

.admin-filters{
  margin-top: 10px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-filters select{
  flex: 1;
  min-width: 160px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 12px;
  padding: 10px 10px;
  outline: none;
  font: 12px/1 system-ui;
}

.admin-list{
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  /* ZMIANA: flex:1 sprawia, że lista zajmuje dostępne miejsce, ale nie więcej */
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  background: rgba(255,255,255,0.03);
}
.admin-item{
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  display:flex;
  gap: 10px;
  align-items:flex-start;
}
.admin-item:last-child{ border-bottom: none; }
.admin-item:hover{ background: rgba(251,192,45,0.08); }

.admin-badge{
  flex-shrink: 0;
  background: rgba(251,192,45,0.14);
  color: var(--amfn-gold);
  border: 1px solid rgba(251,192,45,0.25);
  font: 11px/1 system-ui;
  padding: 4px 8px;
  border-radius: 999px;
  margin-top: 2px;
}
.admin-item-title{
  font-weight: 800;
  font-size: 13px;
}
.admin-item-sub{
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}
.admin-list-hint{
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}

.admin-right{
  /* ZMIANA: 30px na dole robi odstęp pod przyciskami/lampkami */
  padding: 12px 14px 30px 14px;
  min-height: 0;
  overflow-y: auto;
}
.admin-form-title{
  font-weight: 900;
  color: var(--amfn-gold);
  margin-bottom: 10px;
}
.admin-form label{
  display:block;
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  margin-bottom: 10px;
}
.admin-form input, .admin-form select{
  width: 100%;
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  font: 13px/1.2 system-ui;
}
.admin-form input:disabled{ opacity: .65; }

.admin-row2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-actions{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.admin-btn{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: 12px/1 system-ui;
}
.admin-btn.primary{
  background: var(--amfn-gold);
  color: #000;
  font-weight: 900;
  border-color: rgba(0,0,0,0.08);
}
.admin-btn.danger{
  border-color: rgba(255,90,90,0.45);
  background: rgba(255,90,90,0.14);
}
.admin-status{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}
.admin-btn:disabled{
  opacity: .5;
  cursor: not-allowed;
}

/* Header fine-tune (override) */
.install-btn,
.lang-btn,
.menu-icon{
  height: 22px !important;
}

.install-btn{
  padding: 0 10px !important;
  font-size: 11px !important;
}

.lang-btn{
  padding: 0 8px !important;
  font-size: 11px !important;
}

.menu-icon{
  padding: 0 6px !important;
}


/* ===================== TRACE + ADMIN (CLEAN) ===================== */

/* --- ADMIN modal header (zostawiamy jedną wersję) --- */
.admin-head{
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.admin-title{
  color: var(--amfn-gold);
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
}
.admin-close{
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.10);
}
.admin-close:hover{
  background: rgba(255,255,255,0.16);
}

/* --- TRACE: warstwowanie w trybie edycji --- */
.trace-edit .trace-svg{
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 9999 !important;
  pointer-events: auto !important;
}

/* produkcyjne SVG potrafi dublować ściany — w trace je chowamy */
.trace-edit .floor-svg{ display: none !important; }

/* route layer nie powinna łapać klików w trace */
.trace-edit .path-layer{ pointer-events: none !important; }

/* --- TRACE: elementy rysowania (kolory/wygląd) --- */
.trace-edit .trace-ghost{
  stroke: #00e5ff;
  stroke-width: 1.2;
  fill: none;
  stroke-dasharray: 4 3;
}
.trace-edit .trace-rubber{
  stroke: #00e5ff;
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 3 3;
}
.trace-edit .trace-point{
  fill: rgba(255,0,200,0.28);
  stroke: #ff00c8;
  stroke-width: 1.2;
}
.trace-edit .trace-point-cross{
  stroke: #ff00c8;
  stroke-width: 1.2;
  stroke-linecap: round;
}
.trace-edit .trace-cursor-point{
  fill: rgba(255,0,200,0.12);
  stroke: rgba(255,0,200,0.7);
  stroke-width: 1;
}
.trace-edit .trace-cursor-cross{
  stroke: rgba(255,0,200,0.7);
  stroke-width: 1;
  stroke-linecap: round;
}

/* ściany w edytorze */
.trace-edit .trace-svg .floor-wall{
  stroke: #fbc02d;
  opacity: 0.95;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* gruby “hitbox” do klikania ścian */
.trace-edit .trace-svg .trace-hit{
  stroke: rgba(0,0,0,0.001);
  stroke-width: 22;
  fill: none;
  pointer-events: stroke;
}

/* wierzchołki edycji */
.trace-edit .trace-vertex{
  fill: rgba(255,255,255,0.08);
  stroke: rgba(251,192,45,0.9);
  stroke-width: 1.2;
}
.trace-edit .trace-vertex:hover{
  fill: rgba(251,192,45,0.18);
}

/* zaznaczenie ściany (cienka cyan overlay) */
.trace-edit .trace-svg .trace-selected-overlay{
  stroke: #00e5ff;
  stroke-width: 1.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  filter:
    drop-shadow(0 0 2px rgba(0,229,255,0.45))
    drop-shadow(0 0 6px rgba(0,229,255,0.22));
}

/* zaznaczenie pomieszczenia (overlay) */
.trace-edit .trace-svg .trace-selected-room-overlay{
  stroke: #00e5ff;
  stroke-width: 2;
  fill: rgba(0,229,255,0.10);
  stroke-linejoin: round;
  pointer-events: none;
  filter:
    drop-shadow(0 0 2px rgba(0,229,255,0.35))
    drop-shadow(0 0 8px rgba(0,229,255,0.18));
}

/* pokoje w trace (żeby było je widać) */
.trace-edit .trace-svg .floor-room{
  fill: rgba(0,0,0,0.10);
  stroke: rgba(0,0,0,0.35);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.trace-edit .trace-svg .floor-room:hover{
  fill: rgba(0,229,255,0.08);
  stroke: rgba(0,229,255,0.55);
}

/* etykiety ID w trace (małe + purpurowe) */
.trace-edit .trace-svg .floor-label{
  display: block !important;
  font-size: 4px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
  fill: #b00020 !important;
  paint-order: stroke fill;
  stroke: rgba(255,255,255,0.95);
  stroke-width: 1.6px;
  pointer-events: none;
  user-select: none !important;
}

/* --- UNDERLAY (narzędzie dopasowania podkładu) --- */
.map-floor{ position:absolute; inset:0; }

.floor-underlay{
  position:absolute;
  inset:0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform-origin: 50% 50%;
  pointer-events: none;
}
.trace-edit .floor-underlay.is-editing{
  pointer-events: auto;
  cursor: grab;
}
.trace-edit .floor-underlay.is-editing:active{
  cursor: grabbing;
}

/* --- TRACE PANEL (jedna wersja, bez duplikatów) --- */
.trace-panel{
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 2200;
  width: min(680px, 94vw);
  max-height: min(72vh, 560px);

  background: rgba(17,17,17,0.96);
  color: #fff;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 70px rgba(0,0,0,0.55);

  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.trace-panel.is-hidden{ display: none !important; }

.trace-panel #traceTitle{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 12px;

  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border-bottom: 1px solid rgba(255,255,255,0.12);

  cursor: grab;
  user-select:none;
  margin: 0;
}

.trace-panel .trace-title-left{
  font-weight: 900;
  color: var(--amfn-gold);
  font-size: 13px;
}

.trace-panel .trace-x{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.08);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.trace-panel .trace-x:hover{ background: rgba(255,255,255,0.14); }

.trace-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
  scrollbar-width: auto;
}
.trace-body::-webkit-scrollbar{ width: 10px; height: 10px; }
.trace-body::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}
.trace-body::-webkit-scrollbar-track{
  background: rgba(255,255,255,0.06);
}

.trace-panel button{
  background: rgba(255,255,255,0.06);
  color:#fff;
  border: 1px solid rgba(255,255,255,0.10);
  padding: 6px 8px;
  border-radius: 10px;
  cursor:pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.trace-panel button.on{
  border-color: rgba(251,192,45,0.90);
  background: rgba(251,192,45,0.12);
  box-shadow: 0 0 0 2px rgba(251,192,45,0.22) inset;
}

.trace-section-label{
  margin: 10px 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--amfn-gold);
  letter-spacing: .01em;
  opacity: .95;
}
.trace-divider{
  height: 1px;
  background: rgba(251,192,45,0.22);
  margin: 10px 0;
}
.trace-row{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 6px;
}
.trace-floors label{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  font-size: 11px;
}
.trace-floors input{ accent-color: var(--amfn-gold); }

.trace-tip{
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.35;
  opacity: .85;
}

/* --- Menu: numerki zamiast ikon (zostawiamy, bo to nie trace, ale było w tym “zdublowanym” obszarze) --- */
.menu-tip-icon.num{
  background: var(--amfn-black);
  color: var(--amfn-gold);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-tip-icon.num svg{ display:none !important; }

/* =========================================================
   MAP (USER) – Twoje DEMO wariant 1 + INSET (kolor mapy)
   + Dark mode tylko dla mapy/pinów
   ========================================================= */

/* warstwy */
.map-floor{ position:absolute; inset:0; display:none; z-index:10; }
.map-floor.active{ display:block; }

#pathLayer{ position:absolute; inset:0; z-index:30; pointer-events:none; }
.pin{ z-index:40; }

/* tło mapy jak w demie (bez siatki) */
.map-viewport{
  background: #eef2f3 !important;
  background-image: none !important;
}

/* SVG floor */
.floor-svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:auto;
}

/* ŚCIANY (cieńsze, żeby inset było widać) */
.floor-wall-outer{
  stroke:#1f1f1f;
  stroke-width:5.5;
  stroke-linecap:round;
  stroke-linejoin:round;
  fill:none;
}
.floor-wall-inner{
  stroke:#1f1f1f;
  stroke-width:2.6;
  stroke-linecap:round;
  stroke-linejoin:round;
  fill:none;
  opacity:.92;
}

/* POMIESZCZENIA – DEMO V1 */
.floor-room{
  fill: rgba(255,255,255,0.92);
  stroke:#555;
  stroke-width:2;
  cursor:pointer;
  transition:.15s ease;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.floor-room:hover{
  fill: rgba(251,192,45,0.18);
  stroke: #fbc02d;
}

/* Etykiety (włączone) */
.floor-label{
  display:block;
  fill:#333;
  font-weight:800;
  font-size:16px;
  pointer-events:none;
  user-select:none;
}

/* TRASA – wariant 1 */
#routeHalo{
  stroke: rgba(255,255,255,0.92);
  stroke-width: 12;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
#routeLine{
  stroke: #fbc02d;
  stroke-width: 7;
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.18));
}

/* START PIN (dot) – jak masz */
.pin.dot{
  position: absolute;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 60;
}
.pin.dot .core{
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #1976d2;
  border: 3px solid #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
}
.pin.dot .ring{
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(25,118,210,.45);
  animation: ring 1.6s ease-out infinite;
}
@keyframes ring{
  0%{ transform: scale(.55); opacity:.9; }
  100%{ transform: scale(1.35); opacity:0; }
}

/* INSET – “margines” w kolorze mapy (działa dzięki .room-inset z JS) */
:root{
  --inset-light: #eef2f3;
  --inset-dark:  #0f1116;
}
.room-inset{
  fill: none;
  stroke: var(--inset-light);
  stroke-width: 11;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
}
/* inset dostaje też room-highlight (bo ma data-room-id) – chowamy go przy zaznaczeniu */
.room-inset.room-highlight{
  stroke: transparent;
}

/* Highlight pokoju – BEZ stroke (żeby nie było żółtych “przebitek” na skosach) */
.floor-room.room-highlight{
  stroke: none !important;
  fill: rgba(251,192,45,0.22) !important;
  filter:
    drop-shadow(0 0 6px rgba(251,192,45,0.35))
    drop-shadow(0 0 18px rgba(251,192,45,0.18));
}

/* ===== Dark mode (tylko mapa/piny) ===== */
@media (prefers-color-scheme: dark){
  .map-viewport{
    background: #0f1116 !important;
  }

  .room-inset{ stroke: var(--inset-dark); }

  .floor-room{
    fill: rgba(255,255,255,0.06);
    stroke: rgba(255,255,255,0.14);
  }
  .floor-wall-outer,
  .floor-wall-inner{
    stroke: rgba(255,255,255,0.76);
  }
  .floor-label{
    fill: rgba(255,255,255,0.92);
    paint-order: stroke fill;
    stroke: rgba(0,0,0,0.70);
    stroke-width: 2px;
  }

  .floor-room.room-highlight{
    fill: rgba(251,192,45,0.26) !important;
    filter:
      drop-shadow(0 0 7px rgba(251,192,45,0.55))
      drop-shadow(0 0 22px rgba(251,192,45,0.25));
  }

  /* pin celu: jasny */
  #pinTarget path{
    fill: rgba(255,255,255,0.92) !important;
    stroke: rgba(0,0,0,0.55) !important;
    stroke-width: 1.2px !important;
    paint-order: stroke fill !important;
  }
  #pinStart .core{
    border-color: rgba(255,255,255,0.92) !important;
  }
}

/* ===== Start pick overlay (zostawiamy) ===== */
.pick-overlay{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1500;
  pointer-events: none;
}
.pick-overlay.active{ display:block; }

.pick-hud{
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font: 12px/1.2 system-ui;
}
.pick-cancel{
  border: none;
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

/* ===== TRACE (minimal) ===== */
.trace-edit .trace-svg{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  z-index:9999 !important;
  pointer-events:auto !important;
}
/* produkcyjny SVG chowamy w trace (żeby się nie dublowało) */
.trace-edit .floor-svg{ display:none !important; }
.trace-edit .path-layer{ pointer-events:none !important; }

/* ===== TRACE PANEL (jedna, finalna wersja) ===== */
.trace-panel{
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 22000;

  width: min(760px, 94vw);
  max-height: min(72vh, 560px);

  display:flex;
  flex-direction:column;

  background: rgba(17,17,17,0.96);
  color:#fff;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 70px rgba(0,0,0,0.55);

  overflow:hidden;
}
.trace-panel.is-hidden{ display:none !important; }

.trace-panel #traceTitle{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;

  padding: 10px 12px;
  margin: 0;

  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border-bottom: 1px solid rgba(255,255,255,0.12);

  cursor: grab;
  user-select:none;
}
.trace-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px 12px;
}
.trace-panel button{
  background: rgba(255,255,255,0.06);
  color:#fff;
  border: 1px solid rgba(255,255,255,0.10);
  padding: 6px 8px;
  border-radius: 10px;
  cursor:pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.trace-panel button.on{
  border-color: rgba(251,192,45,0.90);
  background: rgba(251,192,45,0.12);
  box-shadow: 0 0 0 2px rgba(251,192,45,0.22) inset;
}
.trace-panel .trace-x{
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.10);
  color: #fff;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 14px;
  line-height: 1;
}
.trace-panel .trace-x:hover{ background: rgba(255,255,255,0.16); }
.trace-section-label{
  margin: 10px 2px 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--amfn-gold);
  letter-spacing: .01em;
  opacity: .95;
}
.trace-divider{
  height: 1px;
  background: rgba(251,192,45,0.22);
  margin: 10px 0;
}
.trace-row{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 6px;
}
.trace-floors label{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  font-size: 11px;
}
.trace-tip{
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.35;
  opacity: .85;
}

/* =========================================================
   MAP – DEMO V1 (Twoje kolory) + DARK MODE
   (inset wyłączony, brak Museum, brak duplikatów)
   ========================================================= */

/* warstwy: trasa NAD mapą */
.map-floor{ z-index: 10; }
#pathLayer{ z-index: 30; pointer-events: none; }
.pin{ z-index: 40; }

/* tło mapy jak w demie (bez siatki) */
.map-viewport{
  background: #eef2f3 !important;
  background-image: none !important;
}

/* ŚCIANY */
.map-floor .floor-svg .floor-wall-outer{
  stroke: #4a4a4a !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
}
.map-floor .floor-svg .floor-wall-inner{
  stroke: #4a4a4a !important;
  stroke-width: 1.5 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
  opacity: .95 !important;
}

/* POMIESZCZENIA – bez obrysu (czysto, nic nie wychodzi spod ścian) */
.map-floor .floor-svg .floor-room{
  fill: #faf7ea !important;   /* jasne złoto */
  stroke: none !important;
  stroke-width: 0 !important;
  filter: none !important;
  transition: .15s ease;
}

/* hover – tylko lekki kolor (bez stroke i bez glow) */
.map-floor .floor-svg .floor-room:hover{
  stroke: none !important;
  fill: rgba(255,248,225,0.95) !important;
  filter: none !important;
}

/* highlight – też bez stroke i bez glow (czyste wypełnienie) */
.map-floor .floor-svg .floor-room.room-highlight{
  fill: #f4da95 !important;   /* mocniejsze złoto */
  stroke: none !important;
  filter: none !important;
}

/* etykiety domyślnie ukryte (mapa czysta) */
.map-floor .floor-svg .floor-label{
  display: none;
  pointer-events: none;
  user-select: none;
}

/* INSET wyłączony (na życzenie) */
.room-inset{ display: none !important; }

/* TRASA – wariant 1 */
#routeHalo{
  stroke: rgba(255,255,255,0.92) !important;
  stroke-width: 12 !important;
  fill: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
#routeLine{
  stroke: #fbc02d !important;
  stroke-width: 7 !important;
  fill: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.18)) !important;
}

/* DARK MODE (mapa zostaje DEMO V1 jasna; tylko panel/pin czytelne w dark) */
@media (prefers-color-scheme: dark){
  .map-viewport{
    background: #eef2f3 !important;
    background-image: none !important;
  }

  /* pinezka celu – ciemna, bo tło mapy jest jasne */
  #pinTarget path{
    fill: #1a1a1a !important;
    stroke: none !important;
  }
}

/* ===== TRACE: grubości linii (dopasuj do produkcji) ===== */

/* zapisane ściany w trace */
.trace-edit .trace-svg .floor-wall{
  stroke-width: 2px !important;   /* <-- tu ustawiasz "grubość ściany w trace" */
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  opacity: 1 !important;
}

/* hitbox – tylko do klikania, nigdy nie zmieniaj wizualnej grubości */
.trace-edit .trace-svg .trace-hit{
  stroke-width: 22 !important;    /* zostaw, to ułatwia klikanie */
}

/* aktualnie rysowana linia (przed Enterem) */
.trace-edit .trace-ghost{
  stroke-width: 1.2px !important;
}

/* "gumka" od ostatniego punktu do kursora */
.trace-edit .trace-rubber{
  stroke-width: 1px !important;
}

/* ===== TRACE: mniejszy i cieńszy wskaźnik kursora ===== */

/* KÓŁKO wskaźnika */
.trace-edit .trace-svg .trace-cursor-point{
  r: 1.6 !important;            /* mniejszy promień (było 3) */
  stroke-width: 0.5 !important; /* cieńsza obwódka */
  fill: rgba(255,0,200,0.10) !important;
}

/* KRZYŻYK wskaźnika */
.trace-edit .trace-svg .trace-cursor-cross{
  stroke-width: 0.5 !important; /* cieńsze kreski */
}

/* opcjonalnie: krótsze ramiona krzyżyka */
.trace-edit .trace-svg line.trace-cursor-cross{
  /* tę regułę nadpisuje JS, więc dla pewności sterujemy wizualnie:
     skróćmy efektywną widoczność krzyżyka przez maskowanie końców */
  stroke-linecap: butt !important;
}

/* punkty kliknięte podczas rysowania */
.trace-edit .trace-svg .trace-point{
  r: 1.6 !important;
  stroke-width: 0.5 !important;
}
.trace-edit .trace-svg .trace-point-cross{
  stroke-width: 0.5 !important;
}

/* ===== MAP POPUP (klik w pomieszczenie) ===== */
.map-popup{
  position: fixed;
  z-index: 3000;
  display: none;
  width: min(360px, 88vw);
  background: #fff;
  color: #111;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 18px 60px rgba(0,0,0,0.30);
  overflow: hidden;
}

.map-popup .meta-line{
  font-size: 12px;
  color: #333;
  line-height: 1.25;
  font-weight: 500;
}

.map-popup .meta-line + .meta-line{
  margin-top: 4px;
}

#mapPopupNav{
  margin-top: 6px;   /* ustaw ile chcesz: np. 6–14px */
}

.map-popup .head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--amfn-black);
  color: #fff;
}
.map-popup .title{
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .02em;
}
.map-popup .close{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color:#fff;
  cursor:pointer;
  font-weight: 900;
  line-height: 1;
}
.map-popup .body{ padding: 12px; }
.map-popup .row{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: #333;
}
.map-popup .badge{
  background: var(--amfn-gold);
  color: #000;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 11px;
  white-space: nowrap;
}
.map-popup .actions{
  display:flex;
  gap: 10px;
  margin-top: 10px;
}
.map-popup .btn{
  flex: 0 0 auto;
  width: min(160px, 100%);
  margin: 0 auto;
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight: 900;
  font-size: 12px;
}
.map-popup .btn.primary{
  background: var(--amfn-gold);
  color: #000;
}
.map-popup .btn.secondary{
  background: #f1f2f3;
  color: #111;
}
@media (prefers-color-scheme: dark){
  .map-popup{ background:#fff; color:#111; }
}

/* ===== FIX: panel zawsze nad mapą i klikalny ===== */

/* główny panel z wyszukiwarką / nawigacją na wierzchu mapy */
.main-panel{
  z-index: 1000 !important;
  position: relative; /* gwarancja, że z-index działa */
}

/* warstwa mapy (SVG) nie może łapać klików tam, gdzie i tak nic nie robi */
.map-floor .floor-svg{
  pointer-events: none !important; /* mapa generalnie nieaktywna na klik */
}

/* z powrotem WŁĄCZ klikanie tylko na pokojach (żeby działały popupy z pomieszczeń) */
.map-floor .floor-svg .floor-room{
  pointer-events: auto !important;
}

/* warstwa trasy nigdy nie ma łapać klików */
#pathLayer,
#pathLayer * {
  pointer-events: none !important;
}

/* input szukania zawsze interaktywny */
#searchInput{
  position: relative;
  z-index: 2;
  pointer-events: auto !important;
}

/* =========================================================
   FORCE FIX: MAIN PANEL = bottom sheet (mobile + desktop)
   ten blok ma BYĆ OSTATNI dla .main-panel
   nadpisuje wszystkie starsze reguły (top/max-height itd.)
   ========================================================= */

/* MAPA na całym ekranie */
.app-root{ position: relative !important; }
.map-viewport{
  position: absolute !important;
  top: var(--topOffset) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

/* PANEL: zawsze fixed na dole, schowany dołem przez transform */
.main-panel{
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  top: auto !important;            /* <- wyłączamy 'top' ze starych reguł mobilnych */
  bottom: 0 !important;

  display: flex !important;
  flex-direction: column !important;

  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -5px 30px rgba(0,0,0,0.15);
  z-index: 1000 !important;

  /* domyślna wysokość rozwiniętego panelu */
  max-height: 60vh !important;
  height: auto !important;

  /* WAŻNE: zwijanie/rozwijanie przez transform, NIE przez max-height */
  transform: translateY(0) !important;
  transition: transform 0.3s ease !important;

  /* upewniamy się, że treść scrolluje się wewnątrz */
  overflow: hidden !important;
}

.main-panel.collapsed{
  /* zwinięty: prawie cały panel poza ekranem, widać tylko 60px paska */
  transform: translateY(calc(100% - 60px)) !important;
}

/* nagłówek = uchwyt do klikania */
.panel-header{
  min-height: 60px !important;
  cursor: pointer;
}

/* treść (lista wyników itd.) – tu sobie scrolluje */
.panel-body{
  flex: 1 1 auto !important;
  overflow-y: auto !important;

  /* wyłącz stare reguły mobilne, które zwijały przez max-height/opacity */
  max-height: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* desktop – wąsko i wyśrodkowane */
@media (min-width: 768px){
  .main-panel{
    left: 50% !important;
    right: auto !important;
    max-width: 420px !important;
    transform: translateX(-50%) translateY(0) !important;
  }
  .main-panel.collapsed{
    transform: translateX(-50%) translateY(calc(100% - 60px)) !important;
  }
}

/* mobile – pełna szerokość (zachowanie standard) */
@media (max-width: 767px){
  .main-panel{
    left: 0 !important;
    right: 0 !important;
    transform: translateY(0) !important;
  }
  .main-panel.collapsed{
    transform: translateY(calc(100% - 60px)) !important;
  }
}

.area-corridor{
  fill: #d9d9d9;
}

.area-void{
  fill: #f4f4f4;
}

/* ===== PARKING ===== */

/* nieaktywne miejsce parkingowe */
.map-floor .floor-svg .floor-room.parking-spot {
  fill: #e3e3e3 !important;
  stroke: #b5b5b5 !important;
  stroke-width: 0.4px !important;
}

/* aktywne miejsce parkingowe */
.map-floor .floor-svg .floor-room.parking-spot.room-highlight {
  fill: #f4da95 !important;
  stroke: #b5b5b5 !important;
  stroke-width: 0.4px !important;
}

/* ===== ADMIN MODAL RESTORE ===== */

.admin-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30000;
}

.admin-overlay.active{
  display: flex;
}

.admin-modal{
  width: min(980px, 96vw);
  height: min(720px, 88vh);
  background: #1a1a1a;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 70px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ===== FIX SELECT DROPDOWN READABILITY ===== */

select {
  background: #1f1f1f;
  color: #fff;
}

select option {
  background: #ffffff;
  color: #000000;
}

.trace-panel button[data-tip]{
  position: relative;
}

.trace-panel button[data-tip]::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  background: rgba(15,15,15,0.95);
  color: #fff;
  font-size: 10px;
  font-weight: 200;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: normal;
  max-width: 220px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 999999;
}

.trace-panel button[data-tip]:hover::after{
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ===== STYLE 4 – konturowa etykieta ===== */

.floor-label{
  font-size: 4.5px;
  font-weight: 550;
  fill: #000;
  paint-order: stroke fill;
  stroke: #ffffff;
  stroke-width: 1.2px;
    stroke-linejoin: round;   /* ✅ to usuwa kolce */
  stroke-linecap: round;    /* ✅ wygładza końcówki */
  vector-effect: non-scaling-stroke;
  pointer-events: none;
  user-select: none;
  text-rendering: geometricPrecision;
}

.floor-label.label-hidden{
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.trace-edit.edit-labels .floor-label{
  pointer-events: auto;
  cursor: move;
}

.labels-on .floor-label{
  display: block !important;
}

.staff-base{
  stroke:#D4AF37;
  stroke-width:0.6;
  opacity:0.07;
}

.staff-glow{
  stroke:#D4AF37;
  stroke-width:1.5;
  opacity:0;
}

.wave{
  stroke:#D4AF37;
  stroke-width:8;
  fill:none;
  stroke-linecap:round;
}

.dot{
  fill:#D4AF37;
}

.admin-section{
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px;
  margin-top: 14px;
}

.admin-section-title{
  font-weight: 900;
  color: var(--amfn-gold);
  font-size: 13px;
  margin-bottom: 4px;
}

.admin-section-desc{
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 10px;
}

/* TOOLTIPY */
.admin-btn[data-tip]{
  position: relative;
}

.admin-btn[data-tip]::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  background: rgba(15,15,15,0.95);
  color: #fff;
  font-size: 11px;
  font-weight: 400;   /* <<< TO DODAJ */
  padding: 6px 8px;
  border-radius: 8px;
  max-width: 240px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.admin-btn[data-tip]:hover::after{
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.admin-indicators{
  display:flex;
  justify-content:flex-end;
  gap:15px;
  margin-top:14px;
  font-size:11px;
  color:#aaa;
  font-weight:600;
}

.admin-indicator{
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  position:relative;
}

.admin-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  border:1px solid #fbc02d;
  transition: background .2s, box-shadow .2s;
}

.admin-indicator[data-tip]::after{
  content: attr(data-tip);
  position:absolute;
  left:50%;
  bottom:120%;
  transform:translateX(-50%);
  background:rgba(15,15,15,0.95);
  color:#fff;
  font-size:11px;
  padding:6px 8px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  white-space:nowrap;
}

.admin-indicator:hover::after{
  opacity:1;
  transform:translateX(-50%) translateY(-4px);
}

.admin-indicators{
  display:flex;
  justify-content:flex-end;
  gap:15px;
  margin-top:14px;
  font-size:11px;
  color:#aaa;
  font-weight:600;
}

.admin-indicator{
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  position:relative;
}

.admin-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  border:1px solid #fbc02d;
  transition: background .2s, box-shadow .2s;
}

.admin-indicator[data-tip]::after{
  content: attr(data-tip);
  position:absolute;
  left:50%;
  bottom:120%;
  transform:translateX(-50%);
  background:rgba(15,15,15,0.95);
  color:#fff;
  font-size:11px;
  padding:6px 8px;
  border-radius:8px;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  white-space:nowrap;
}

.admin-indicator:hover::after{
  opacity:1;
  transform:translateX(-50%) translateY(-4px);
}

.admin-check-row{
  display:flex;
  gap:30px;
  margin-top:12px;
}

.admin-check-item{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:#ddd;
  cursor:pointer;
}

.admin-check-item input{
  width:16px;
  height:16px;
  accent-color:#fbc02d;
}

.admin-btn.is-active{
  background: rgba(251,192,45,0.15);
  border: 1px solid rgba(251,192,45,0.6);
  color: #fbc02d;
  transition: all .2s ease;
}

.start-search-box input{
  font-size:14px;
}

.start-title{
  margin: 0 0 14px 0;
  font-size: 16px;
  font-weight: 700;
}

.start-card{
  display:flex;
  align-items:center;
  gap:12px;
padding:10px;
  border-radius:12px;
  background:#f5f6f7;
  border:1px solid #e2e2e2;
  cursor:pointer;
  transition: all .2s ease;
  margin-bottom:10px;
}

.start-card:hover{
  border-color:#fbc02d;
  background:#fffdf6;
}

.start-card-icon{
  font-size:18px;
}

.start-card-text{
  font-weight:600;
  font-size:13px;
}

.more-options-toggle{
  text-align:center;
  font-size:13px;
  color:#444;        /* ciemnoszary zamiast złotego */
  cursor:pointer;
  font-weight:500;   /* trochę lżej */
  transition:color .2s ease;
}

.more-options-toggle:hover{
  color:#1a1a1a;     /* ciemniejszy przy hover */
}

.start-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  border-radius:14px;
  background:#fff;
  border:1px solid #e6e6e6;
  cursor:pointer;
  transition: all .2s ease;
  margin-bottom:10px;
}

.start-card:hover{
  border-color:#fbc02d;
  background:#fffdf6;
}

.start-card-icon{
  font-size:18px;
  color:#1a1a1a;   /* ciemny jak mapa */
}

.route-label{
  margin-top:18px;
  text-align:center;
  font-size:12px;
  color:#555;   /* ciemniejszy, nie złoty */
  letter-spacing:0.3px;
}

.route-switch{
display:flex;
  justify-content:center;  /* TO WYŚRODKOWUJE */
  align-items:center;
  gap:28px;
  margin-top:6px;
}

.route-pill input{
  display:none;
}

.start-card-icon svg{
  width:20px;
  height:20px;
}

.route-switch input[type="radio"]{
  appearance:none;
  -webkit-appearance:none;
  width:18px;
  height:18px;
  border-radius:50%;
  border:1.5px solid #1a1a1a;  /* ciemna cienka ramka */
  background:white;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  position:relative;
  transition:all .2s ease;
}

.route-switch input[type="radio"]::after{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:#fbc02d;
  transform:scale(0);
  transition:transform .2s ease;
}

.route-switch input[type="radio"]:checked{
  border:1.5px solid #fbc02d; /* złota ramka */
}

.route-switch input[type="radio"]:checked::after{
  transform:scale(1);  /* pokazuje złote kółko */
}

.route-radio{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  cursor:pointer;
}

/* =========================================================
   MAP READABILITY – OVERRIDES (wklejone na końcu <style>)
   ========================================================= */

/* Korytarze i pustki (systemowe) */
.map-floor .floor-svg .area-corridor{
  fill: #e2e5e8 !important;   /* chłodny jasny szary */
}

.map-floor .floor-svg .area-void{
  fill: #f6f7f8 !important;   /* jeszcze jaśniej */
}

/* Ściany: cieńsze i trochę lżejsze */
.map-floor .floor-svg .floor-wall-outer{
  stroke: #3f3f3f !important;
  stroke-width: 1.6 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

.map-floor .floor-svg .floor-wall-inner{
  stroke: #3f3f3f !important;
  stroke-width: 1.1 !important;
  opacity: .92 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Pomieszczenia użytkowe – zostają jak masz (złotawe).
   Zostawiam stroke:none, bo u Ciebie to daje najczystszy efekt. */
.map-floor .floor-svg .floor-room{
  fill: #faf7ea !important;
  stroke: none !important;
}


/* ===== ADMIN: ICON BAR (na początku sekcji) ===== */
.admin-iconbar{
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
}

.admin-iconbar-title{
  font-size: 12px;
  font-weight: 900;
  color: var(--amfn-gold);
  margin-bottom: 8px;
}

.admin-iconbar-row{
  gap: 18px;
  margin-top: 0;
}

.admin-iconbar-variant{
  margin-top: 10px;
}

.admin-iconbar-variant select{
  margin-top: 6px;
}

.admin-iconbar-hint{
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.60);
  line-height: 1.35;
}

/* POI: tabliczka + rysunek */
.poi-icon{
  color: #1a1a1a;
  opacity: .92;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18));
}

.icons-on .poi-icon{ display:block; }
.poi-icon{ display:none; }

.poi-icon .poi-plate{
  fill: rgba(255,255,255,0.72);
  stroke: currentColor;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.poi-icon .poi-stroke{
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.poi-icon .poi-fill{ fill: currentColor; }

.poi-icon text{
  fill: currentColor;
  font-weight: 900;
  font-size: 9px;
  font-family: Montserrat, system-ui, sans-serif;
  text-anchor: middle;
  dominant-baseline: middle;
}

.poi-icon{
  display:none;
  pointer-events:none;
  opacity:.88;
  color:#1a1a1a;
  filter:none;
}
.icons-on .poi-icon{ display:block; }

.poi-icon .poi-plate{
  fill: rgba(255,255,255,0.84);
  stroke: currentColor;
  stroke-width: 0.9 !important;
  vector-effect: non-scaling-stroke;
}

/* obrazek (symbol) */
.poi-icon .poi-img{
  opacity: .92;
}

/* mały dopisek K/M/U */
.poi-icon .poi-wc-variant{
  fill: currentColor;
  font-weight: 900;
  font-size: 7px;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* ===== POI ICONS as external SVG images ===== */
.poi-icon{
  display:none;
  pointer-events:none;
  opacity: .90;
  filter: none;
}
.icons-on .poi-icon{ display:block; }

/* =========================================================
   THEME MIXER (DEV TOOL) – zmienne + nadpisy mapy
   ========================================================= */

/* A) Zmienne “motywu mapy” (domyślne = Twoje aktualne) */
:root{
  --tm-map-bg: #eef2f3;

  --tm-room-fill: #faf7ea;
  --tm-corr-fill: #e2e5e8;
  --tm-void-fill: #f6f7f8;
  --tm-room-hi:   #f4da95;

  --tm-wall: #3f3f3f;
  --tm-wall-outer-w: 1.6;
  --tm-wall-inner-w: 1.1;
  --tm-wall-op: 0.95;

  --tm-route-walk: #fbc02d;
  --tm-route-stairs: #43a047;
  --tm-route-halo: rgba(255,255,255,0.92);
  --tm-route-w: 7;
  --tm-halo-w: 12;

  --tm-label-fill: #111111;
  --tm-label-stroke: rgba(255,255,255,0.88);
--tm-label-stroke-w: 1.2;
--tm-label-font: 4.5px;

  /* POI (tylko opacity/cień – bo SVG jest w <image>) */
  --tm-poi-opacity: 0.98;
  --tm-poi-shadow: drop-shadow(0 2px 5px rgba(0,0,0,0.18));
}

/* B) Nadpisanie wyglądu mapy zmiennymi (bez grzebania w reszcie CSS) */
.map-viewport{
  background: var(--tm-map-bg) !important;
}

/* powierzchnie */
.map-floor .floor-svg .floor-room{
  fill: var(--tm-room-fill) !important;
  stroke: none !important;
}
.map-floor .floor-svg .area-corridor{
  fill: var(--tm-corr-fill) !important;
}
.map-floor .floor-svg .area-void{
  fill: var(--tm-void-fill) !important;
}

/* highlight celu */
.map-floor .floor-svg .floor-room.room-highlight{
  fill: var(--tm-room-hi) !important;
}

/* ściany */
.map-floor .floor-svg .floor-wall-outer{
  stroke: var(--tm-wall) !important;
  stroke-width: var(--tm-wall-outer-w) !important;
  opacity: var(--tm-wall-op) !important;
}
.map-floor .floor-svg .floor-wall-inner{
  stroke: var(--tm-wall) !important;
  stroke-width: var(--tm-wall-inner-w) !important;
  opacity: var(--tm-wall-op) !important;
}

/* trasa – mapujemy Twoje var używane przez JS (bez zmiany JS) */
#viewport{
  --amfn-gold: var(--tm-route-walk);
  --path-stairs: var(--tm-route-stairs);
}
#routeHalo{
  stroke: var(--tm-route-halo) !important;
  stroke-width: var(--tm-halo-w) !important;
}
#routeLine{
  stroke-width: var(--tm-route-w) !important;
}

/* etykiety (gdy są włączone) */
.map-floor .floor-svg .floor-label{
  fill: var(--tm-label-fill) !important;
  paint-order: stroke fill;
  stroke: var(--tm-label-stroke) !important;
  stroke-width: var(--tm-label-stroke-w) !important;
  font-size: var(--tm-label-font) !important;
}

/* POI (<image>): tylko opacity + cień */
.poi-icon{
  opacity: var(--tm-poi-opacity) !important;
  filter: var(--tm-poi-shadow) !important;
}

/* =========================================================
   THEME MIXER UI – panel w stylu Twoich okien
   ========================================================= */

.theme-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 45000;
}
.theme-overlay.active{ display:flex; }

.theme-modal{
  width: min(980px, 96vw);
  height: min(720px, 90vh);
  background: rgba(17,17,17,0.97);
  color: #fff;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 70px rgba(0,0,0,0.60);
  overflow: hidden;
  display:flex;
  flex-direction: column;
}

.theme-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.theme-title{
  font-weight: 900;
  color: var(--amfn-gold);
  font-size: 13px;
  letter-spacing: .02em;
}
.theme-close{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.10);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 900;
  line-height: 1;
}
.theme-close:hover{ background: rgba(255,255,255,0.16); }

.theme-body{
  flex: 1;
  min-height: 0;
  display:grid;
  grid-template-columns: 420px 1fr;
}
@media (max-width: 880px){
  .theme-body{ grid-template-columns: 1fr; }
}

.theme-left{
  padding: 12px;
  border-right: 1px solid rgba(255,255,255,0.10);
  overflow: auto;
  min-height: 0;
}
.theme-right{
  padding: 12px;
  overflow: auto;
  min-height: 0;
}

.theme-section{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}
.theme-section-title{
  font-weight: 900;
  color: var(--amfn-gold);
  font-size: 12px;
  margin-bottom: 8px;
}
.theme-row{
  display:grid;
  grid-template-columns: 1fr auto;
  align-items:center;
  gap: 10px;
  margin: 8px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.82);
}
.theme-row input[type="color"]{
  width: 44px; height: 30px; padding:0; border:0; background:transparent;
}
.theme-row input[type="range"]{ width: 180px; }

.theme-actions{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.theme-btn{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  font: 12px/1 system-ui;
  font-weight: 800;
}
.theme-btn.primary{
  background: var(--amfn-gold);
  color:#000;
  border-color: rgba(0,0,0,0.10);
}

/* Preview wycinka */
.theme-preview{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 12px;
}
.theme-preview h3{
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
}
.theme-preview .stage{
  background: var(--tm-map-bg);
  border-radius: 12px;
  padding: 10px;
}
.theme-preview svg{
  width: 100%;
  height: auto;
  display:block;
  border-radius: 12px;
  background: var(--tm-map-bg);
}

/* style preview */
.theme-preview .floor-room{ fill: var(--tm-room-fill); stroke:none; cursor:pointer; }
.theme-preview .area-corridor{ fill: var(--tm-corr-fill); }
.theme-preview .area-void{ fill: var(--tm-void-fill); }
.theme-preview .hi{ fill: var(--tm-room-hi) !important; }

.theme-preview .wall-outer{
  stroke: var(--tm-wall); stroke-width: var(--tm-wall-outer-w);
  opacity: var(--tm-wall-op);
  fill:none; stroke-linecap:round; stroke-linejoin:round;
}
.theme-preview .wall-inner{
  stroke: var(--tm-wall); stroke-width: var(--tm-wall-inner-w);
  opacity: var(--tm-wall-op);
  fill:none; stroke-linecap:round; stroke-linejoin:round;
}
.theme-preview .routeHalo{
  stroke: var(--tm-route-halo);
  stroke-width: var(--tm-halo-w);
  fill:none; stroke-linecap:round; stroke-linejoin:round;
}
.theme-preview .routeLine{
  stroke: var(--tm-route-walk);
  stroke-width: var(--tm-route-w);
  fill:none; stroke-linecap:round; stroke-linejoin:round;
}
.theme-preview .label{
  fill: var(--tm-label-fill);
  font-weight: 900;
  font-size: var(--tm-label-font);
  paint-order: stroke fill;
  stroke: var(--tm-label-stroke);
  stroke-width: var(--tm-label-stroke-w);
  text-rendering: geometricPrecision;
  pointer-events:none;
  user-select:none;
}

/* TRACE preview: pokaż korytarze/pustki po prefiksach */
.trace-edit .trace-svg .floor-room[data-room-id^="__corr__"]{
  fill: rgba(226,229,232,0.90) !important; /* jak korytarz */
}
.trace-edit .trace-svg .floor-room[data-room-id^="__void__"]{
  fill: rgba(246,247,248,0.92) !important; /* jak pustka */
}


/* =========================================================
   EDIT UI – SOFT THEME (Trace + Admin + Kolory + Debug + Header buttons)
   działa tylko w trybie edycji: .trace-edit na <html>
   ========================================================= */

.trace-edit{
  --ed-bg:        #fbf6ed;
  --ed-panel:     rgba(255,255,255,0.92);
  --ed-panel-2:   rgba(255,255,255,0.78);
  --ed-border:    rgba(78,53,4,0.18);      /* #4e3504 */
  --ed-text:      #443c44;                 /* #443c44 */
  --ed-muted:     rgba(68,60,68,0.70);
  --ed-accent:    #e9ae2f;                 /* #e9ae2f */
  --ed-accent-2:  #fad46b;                 /* #fad46b */
  --ed-shadow:    0 18px 70px rgba(0,0,0,0.20);
}

/* ====== HEADER BUTTONS (Kolory / Instrukcja / Meta / Map / Wyłącz) ======
   Masz inline style, więc lecimy z !important. */
.trace-edit #adminHeaderSlot button,
.trace-edit #btnThemeMixer,
.trace-edit #btnDocs,
.trace-edit #btnMeta,
.trace-edit #btnTracePanel,
.trace-edit #btnTraceOff{
  background: var(--ed-panel) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
  box-shadow: 0 8px 22px rgba(0,0,0,0.10) !important;
  font-weight: 900 !important;
}

.trace-edit #adminHeaderSlot button:hover,
.trace-edit #btnThemeMixer:hover,
.trace-edit #btnDocs:hover,
.trace-edit #btnMeta:hover,
.trace-edit #btnTracePanel:hover,
.trace-edit #btnTraceOff:hover{
  background: rgba(233,174,47,0.14) !important;
}

/* ===== Trace panel ===== */
.trace-edit .trace-panel{
  background: var(--ed-panel) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
  box-shadow: var(--ed-shadow) !important;
  backdrop-filter: blur(10px) !important;
}

.trace-edit .trace-panel #traceTitle{
  background: linear-gradient(180deg, rgba(233,174,47,0.16), rgba(233,174,47,0.06)) !important;
  border-bottom: 1px solid var(--ed-border) !important;
  color: var(--ed-text) !important;
}

.trace-edit .trace-panel .trace-title-left{
  color: var(--ed-text) !important;
}

.trace-edit .trace-panel .trace-x{
  background: rgba(255,255,255,0.85) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
}

.trace-edit .trace-panel button{
  background: rgba(255,255,255,0.86) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
  font-weight: 800 !important;
}

.trace-edit .trace-panel button.on{
  border-color: rgba(233,174,47,0.55) !important;
  background: rgba(233,174,47,0.18) !important;
  box-shadow: 0 0 0 2px rgba(233,174,47,0.12) inset !important;
}

.trace-edit .trace-section-label{
  color: var(--ed-text) !important;
  opacity: .85 !important;
}
.trace-edit .trace-divider{
  background: rgba(78,53,4,0.14) !important;
}

/* ===== Admin modal ===== */
.trace-edit #adminOverlay .admin-modal{
  background: var(--ed-panel) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
  box-shadow: var(--ed-shadow) !important;
  backdrop-filter: blur(10px) !important;
}

.trace-edit #adminOverlay .admin-head{
  background: linear-gradient(180deg, rgba(233,174,47,0.16), rgba(233,174,47,0.06)) !important;
  border-bottom: 1px solid var(--ed-border) !important;
}

.trace-edit #adminOverlay .admin-title{
  color: var(--ed-text) !important;
  text-shadow: none !important;
}

.trace-edit #adminOverlay .admin-close{
  background: rgba(255,255,255,0.85) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
}

.trace-edit #adminOverlay .admin-left{
  border-right: 1px solid var(--ed-border) !important;
}

.trace-edit #adminOverlay .admin-search input,
.trace-edit #adminOverlay .admin-filters select,
.trace-edit #adminOverlay .admin-form input,
.trace-edit #adminOverlay .admin-form select{
  background: rgba(255,255,255,0.88) !important;
  color: var(--ed-text) !important;
  border: 1px solid rgba(78,53,4,0.16) !important;
}

.trace-edit #adminOverlay .admin-list{
  background: rgba(255,255,255,0.58) !important;
  border: 1px solid rgba(78,53,4,0.16) !important;
}

.trace-edit #adminOverlay .admin-item:hover{
  background: rgba(233,174,47,0.14) !important;
}

.trace-edit #adminOverlay .admin-badge{
  background: rgba(233,174,47,0.18) !important;
  border: 1px solid rgba(233,174,47,0.35) !important;
  color: rgba(78,53,4,0.90) !important;
}

.trace-edit #adminOverlay .admin-btn{
  background: rgba(255,255,255,0.86) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
  font-weight: 800 !important;
}

.trace-edit #adminOverlay .admin-btn.primary{
  background: var(--ed-accent) !important;
  color: rgba(78,53,4,0.95) !important;
  border-color: rgba(78,53,4,0.18) !important;
}

/* ===== Kolory (mikser) ===== */
.trace-edit .theme-modal{
  background: var(--ed-panel) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
  box-shadow: var(--ed-shadow) !important;
}

.trace-edit .theme-head{
  background: linear-gradient(180deg, rgba(233,174,47,0.16), rgba(233,174,47,0.06)) !important;
  border-bottom: 1px solid var(--ed-border) !important;
}

.trace-edit .theme-title{
  color: var(--ed-text) !important;
}

.trace-edit .theme-section{
  background: rgba(255,255,255,0.70) !important;
  border: 1px solid rgba(78,53,4,0.16) !important;
  color: var(--ed-text) !important;
}

.trace-edit .theme-section-title{
  color: var(--ed-text) !important;
}

.trace-edit .theme-btn{
  background: rgba(255,255,255,0.86) !important;
  color: var(--ed-text) !important;
  border: 1px solid rgba(78,53,4,0.16) !important;
}

.trace-edit .theme-btn.primary{
  background: var(--ed-accent) !important;
  color: rgba(78,53,4,0.95) !important;
}

/* ===== Debug overlay (3-klik w wersję) =====
   Masz inline style, więc znów !important. */
.trace-edit #debugOverlay{
  background: var(--ed-panel) !important;
  color: var(--ed-text) !important;
  border: 1px solid var(--ed-border) !important;
  box-shadow: var(--ed-shadow) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
}

/* ===== FIX: czytelność tekstów w jasnym Adminie (trace-edit) ===== */
.trace-edit #adminOverlay{
  color: var(--ed-text) !important;
}

/* wszystkie “labelki” i opisy w Adminie */
.trace-edit #adminOverlay .admin-form label,
.trace-edit #adminOverlay .admin-section-desc,
.trace-edit #adminOverlay .admin-item-sub,
.trace-edit #adminOverlay .admin-list-hint,
.trace-edit #adminOverlay .admin-status{
  color: rgba(68,60,68,0.78) !important; /* ~ var(--ed-muted) */
}

/* checkboxy (u Ciebie miały #ddd = znika na jasnym tle) */
.trace-edit #adminOverlay .admin-check-item,
.trace-edit #adminOverlay .admin-check-item span{
  color: var(--ed-text) !important;
}

/* placeholdery w inputach */
.trace-edit #adminOverlay input::placeholder{
  color: rgba(68,60,68,0.45) !important;
}

/* ważne: nadpisz inline style typu color: rgba(255,255,255,...) w adminie */
.trace-edit #adminOverlay [style*="color:rgba(255,255,255"]{
  color: var(--ed-text) !important;
}

/* ===== FIX 2: linki/zaznaczenie/hint w Adminie ===== */

/* linki (jeśli hint jest linkiem albo ma styl linka) */
.trace-edit #adminOverlay a{
  color: var(--ed-text) !important;
  text-decoration-color: rgba(78,53,4,0.35) !important;
}

/* jeśli to jest tekst zaznaczony (na niebiesko) – ustaw kolor czytelny */
.trace-edit #adminOverlay ::selection{
  background: rgba(233,174,47,0.35) !important;
  color: #4e3504 !important;
}

/* hint z paska ikon (u Ciebie jest jako .admin-iconbar-hint) */
.trace-edit #adminOverlay .admin-iconbar-hint{
  color: rgba(68,60,68,0.72) !important;
}

/* awaryjnie: wszystko w tym overlayu ma mieć ciemny kolor bazowy */
.trace-edit #adminOverlay *{
  color: inherit;
}

/* ===== FIX: czytelność tekstów w panelu "Kolory" (theme mixer) ===== */

.trace-edit #themeOverlay,
.trace-edit #themeOverlay *{
  color: var(--ed-text) !important;
}

/* nagłówki/sekcje */
.trace-edit #themeOverlay .theme-title,
.trace-edit #themeOverlay .theme-section-title,
.trace-edit #themeOverlay .theme-preview h3{
  color: var(--ed-text) !important;
}

/* opisy/wiersze */
.trace-edit #themeOverlay .theme-row{
  color: rgba(68,60,68,0.82) !important;
}

/* inputy/selecty (żeby nie były “ciemne” w środku) */
.trace-edit #themeOverlay input,
.trace-edit #themeOverlay select{
  background: rgba(255,255,255,0.88) !important;
  border: 1px solid rgba(78,53,4,0.16) !important;
  color: var(--ed-text) !important;
}

.trace-edit #themeOverlay input::placeholder{
  color: rgba(68,60,68,0.45) !important;
}

/* przyciski */
.trace-edit #themeOverlay .theme-btn{
  background: rgba(255,255,255,0.86) !important;
  border: 1px solid rgba(78,53,4,0.16) !important;
  color: var(--ed-text) !important;
}
.trace-edit #themeOverlay .theme-btn.primary{
  background: var(--ed-accent) !important;
  color: rgba(78,53,4,0.95) !important;
}

/* zaznaczenie tekstu */
.trace-edit #themeOverlay ::selection{
  background: rgba(233,174,47,0.35) !important;
  color: #4e3504 !important;
}