/* Reveal sidebar (web/sidebar.js): right-hand card while a bouwnummer is
   revealed, a bottom sheet below 700 px. Same card look as the focus pill
   (index.html): light, translucent, soft shadow - it stays light at night. */
#unit-panel { position: absolute; z-index: 3; top: 64px; right: 12px; width: 300px; box-sizing: border-box;
              max-height: calc(100% - 64px - 40px); overflow-y: auto; overscroll-behavior: contain;
              padding: 14px 16px 16px; border-radius: 12px; color: #1f1f1f;
              background: rgba(255, 255, 255, 0.96); box-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
              font-size: 13px; line-height: 1.35;
              opacity: 0; visibility: hidden; transform: translateX(calc(100% + 24px));
              transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 260ms ease,
                          visibility 0s linear 420ms; }
#unit-panel.is-open { opacity: 1; visibility: visible; transform: none;
                      transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 260ms ease,
                                  visibility 0s; }
#unit-panel .unit-head { display: flex; align-items: flex-start; gap: 8px; }
#unit-panel .unit-head > div { flex: 1; min-width: 0; }
#unit-panel .unit-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: 0.01em; outline: none; }
#unit-panel .unit-meta { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
                         color: #4a4a4a; }
#unit-panel .unit-type { padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600;
                         color: #1f4f8f; background: #e6effc; font-variant-numeric: tabular-nums; }
#unit-panel .unit-close { flex: none; width: 30px; height: 30px; margin: -4px -6px 0 0; border: none;
                          border-radius: 999px; background: transparent; color: #444; font-size: 20px;
                          line-height: 1; cursor: pointer; transition: background 150ms ease; }
#unit-panel .unit-close:hover { background: rgba(0, 0, 0, 0.07); }
#unit-panel button:focus-visible { outline: 2px solid #2b7fff; outline-offset: 2px; }

#unit-panel .unit-rooms { width: 100%; margin-top: 12px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#unit-panel .unit-rooms th { text-align: left; font-weight: 500; color: #2b2b2b; }
#unit-panel .unit-rooms td { text-align: right; white-space: nowrap; color: #2b2b2b; }
#unit-panel .unit-rooms tbody th, #unit-panel .unit-rooms tbody td { padding: 3px 0;
                                                                      border-bottom: 1px solid #eeebe6; }
#unit-panel .unit-rooms tfoot th, #unit-panel .unit-rooms tfoot td { padding-top: 7px; font-weight: 700;
                                                                      color: #1f1f1f; }
#unit-panel .unit-note { margin: 6px 0 0; font-size: 11px; color: #6b6b6b; }

#unit-panel .unit-others { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e4e0da; }
#unit-panel .unit-others h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: #4a4a4a; }
#unit-panel .unit-others ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
#unit-panel .unit-other { font: inherit; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
                          padding: 6px 10px; border-radius: 999px; border: 1px solid #d8d3cc;
                          background: #fff; color: #2b2b2b; cursor: pointer;
                          transition: background 150ms ease, border-color 150ms ease, color 150ms ease; }
/* same amber as the hovered apartment's floor on the map (reveal.js REVEAL_HOVER_COLOR) */
#unit-panel .unit-other:hover, #unit-panel .unit-other:focus-visible, #unit-panel .unit-other.is-hover {
  background: #fff3df; border-color: #ffae3d; color: #1f1f1f; }

/* furnished / unfurnished switch (sofa icon): fades the movable furniture */
#unit-panel .unit-furnish { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px;
                            padding: 7px 10px; border: 1px solid #e3ded7; border-radius: 10px;
                            background: #faf8f5; color: #2b2b2b; font: inherit; font-weight: 600;
                            cursor: pointer; transition: background 150ms ease, border-color 150ms ease; }
#unit-panel .unit-furnish:hover { background: #f3efe9; border-color: #d8d3cc; }
#unit-panel .unit-furnish-icon { flex: none; color: #2f7bff; transition: color 150ms ease, opacity 150ms ease; }
#unit-panel .unit-furnish-label { flex: 1; text-align: left; }
#unit-panel .unit-switch { position: relative; flex: none; width: 32px; height: 18px; border-radius: 999px;
                           background: #2f7bff; transition: background 180ms ease; }
#unit-panel .unit-switch::after { content: ''; position: absolute; top: 2px; left: 16px; width: 14px; height: 14px;
                                  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
                                  transition: left 180ms cubic-bezier(0.2, 0.8, 0.2, 1); }
#unit-panel .unit-furnish[aria-checked="false"] .unit-switch { background: #c9c4bd; }
#unit-panel .unit-furnish[aria-checked="false"] .unit-switch::after { left: 2px; }
#unit-panel .unit-furnish[aria-checked="false"] .unit-furnish-icon { color: #8a857e; opacity: 0.7; }

@keyframes unit-panel-swap { from { opacity: 0.25; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#unit-panel.is-swapping .unit-head, #unit-panel.is-swapping .unit-body { animation: unit-panel-swap 220ms ease-out both; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
           clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* the sheet's drag handle: phones only (below) */
#unit-panel .unit-handle { display: none; }

/* narrow portrait screens (SHEET_QUERY, web/mobile.js): a bottom sheet with a
   drag handle. Peek: bouwnummer, type and the furnished switch; full: the
   rooms (two columns to keep it low) and the other bouwnummers, scrolling
   inside while the header stays put. */
@media (max-width: 699px) and (orientation: portrait) {
  #unit-panel { top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: 60%;
                display: flex; flex-direction: column; overflow: hidden;
                padding: 22px calc(16px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom))
                         calc(16px + env(safe-area-inset-left));
                border-radius: 16px 16px 0 0; transform: translateY(100%); }
  #unit-panel .unit-handle { display: block; position: absolute; top: 0; left: 50%; width: 120px; height: 26px;
                             margin-left: -60px; padding: 0; border: none; background: transparent;
                             cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; }
  #unit-panel .unit-handle span { position: absolute; top: 8px; left: 50%; width: 40px; height: 5px;
                                  margin-left: -20px; border-radius: 3px; background: #cfc9c1;
                                  transition: background 150ms ease; }
  #unit-panel .unit-handle:hover span, #unit-panel .unit-handle:focus-visible span { background: #a8a197; }
  #unit-panel .unit-handle:focus-visible { outline: none; }
  #unit-panel .unit-head { touch-action: none; }
  #unit-panel .unit-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
                           margin: 0 -4px; padding: 0 4px; }
  #unit-panel[data-sheet="peek"] .unit-body { display: none; }
  #unit-panel .unit-rooms tbody { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  #unit-panel .unit-rooms tbody tr { display: flex; justify-content: space-between; gap: 8px; }
  #unit-panel .unit-rooms tfoot tr { display: flex; justify-content: space-between; }
  #unit-panel .unit-others { margin-top: 10px; padding-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #unit-panel, #unit-panel.is-open { transform: none; transition: opacity 150ms ease, visibility 0s linear 150ms; }
  #unit-panel.is-open { transition: opacity 150ms ease, visibility 0s; }
  #unit-panel.is-swapping .unit-head, #unit-panel.is-swapping .unit-body { animation: none; }
  #unit-panel .unit-switch, #unit-panel .unit-switch::after { transition: none; }
}
