/* "Moje biuro" — desk/room booking + account, on the shared admin tokens.
 *
 * This file and editor.css are both loaded on every signed-in page: the two
 * views are one SPA, so either can be mounted without fetching a stylesheet
 * first. The handful of selectors the two views style differently are therefore
 * scoped to `#app.v-panel` / `#app.v-admin` — everything else is named
 * distinctly enough (hp-* here, hd-* editor bits there) to stand on its own. */
.hd-head { margin-bottom:20px; }
.hd-head h1 { font-size:28px; margin:0 0 6px; letter-spacing:-.035em; }
.hd-head .lead { color:var(--muted); font-size:14.5px; margin:0 0 16px; max-width:66ch; line-height:1.55; }
.hd-head-top { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.hd-head-main { min-width:0; }
#hd-share { flex-shrink:0; }
@media (max-width:560px){ #hd-share .lbl { display:none; } #hd-share { padding:7px 9px; } }
#app h2 { font-size:15.5px; margin:0 0 12px; }
#app h3 { font-size:14px; margin:0 0 10px; }
.hd-note { color:var(--muted); font-size:13px; margin:6px 0 10px; line-height:1.5; }
.hd-count { color:var(--faint); font-weight:600; font-size:13px; margin-left:6px; }

/* Space switcher — shown only when the user belongs to more than one */
.hd-spacebar { display:inline-flex; align-items:center; gap:10px; margin:0 0 18px;
  background:var(--surface); border:1px solid var(--border); border-radius:999px; padding:5px 6px 5px 14px; box-shadow:var(--shadow-sm); }
.hd-spacebar label { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700; color:var(--faint);
  text-transform:uppercase; letter-spacing:.06em; }
.hd-spacebar select { border-radius:999px; padding:7px 12px; font-size:14px; border-color:transparent; background:var(--surface-2); }
.hd-spacebar .ic-svg { width:15px; height:15px; }
.hd-spacebar select { width:auto; min-width:200px; }

/* Shared form bits reused from the admin panel */
#app.v-panel .hd-grid2 { display:grid; grid-template-columns:150px 1fr; gap:9px 12px; align-items:center; max-width:520px; }
#app.v-panel .hd-grid2 label { color:var(--muted); font-size:13px; font-weight:600; }
.btn-row { margin-top:14px; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.btn.sm { padding:6px 11px; font-size:13px; }
.input.sm { padding:6px 9px; font-size:13px; }
.hd-color { width:46px; height:40px; padding:3px; border:1px solid var(--border-2); border-radius:var(--radius-sm); background:var(--surface); }
.field.grow { flex:1 1 180px; }
.badge.warn { background:#fdecc8; color:#8a5a00; }
.badge.muted { background:var(--surface-2); color:var(--muted); }

/* Avatar (image or coloured initials) */
.hp-av { width:34px; height:34px; border-radius:50%; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center;
  font-size:12.5px; font-weight:800; color:#fff; background:var(--c,#c2c8d2); overflow:hidden;
  box-shadow:inset 0 1.5px 0 rgba(255,255,255,.35), 0 1px 3px rgba(16,24,40,.18); }
.hp-av img { width:100%; height:100%; object-fit:cover; }
.hp-av.lg { width:64px; height:64px; font-size:22px; }
.hp-av.sm { width:26px; height:26px; font-size:10.5px; }
.hp-av.xs { width:20px; height:20px; font-size:9px; }

/* Calendar: day rail + day detail
   The rail is a plain list of days — one row each, read top to bottom. A row
   says only what a member needs to decide: the day, and either the desk they
   already have or how many are still free. */
.hp-cal { display:grid; grid-template-columns:minmax(0,272px) minmax(0,1fr); gap:24px; align-items:start; }
@media (max-width:860px){ .hp-cal { grid-template-columns:1fr; } }
.hp-cal-rail { display:flex; flex-direction:column; gap:16px; min-width:0; }
.hp-weeklbl { margin:0 0 8px; font-size:11px; font-weight:750; text-transform:uppercase; letter-spacing:.06em; color:var(--faint); }
.hp-week { display:flex; flex-direction:column; gap:2px; }
.hp-daycell { display:flex; align-items:baseline; gap:9px; width:100%; text-align:left; cursor:pointer;
  padding:7px 12px; border:1px solid transparent; border-radius:10px; background:none;
  transition:background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.hp-daycell:hover { background:var(--surface-2); }
.hp-daycell:active { transform:scale(.99); }
.hp-daycell .wd { flex:0 0 38px; font-size:12px; color:var(--muted); font-weight:650; text-transform:capitalize; }
.hp-daycell .dn { font-size:14.5px; font-weight:750; letter-spacing:-.01em; }
.hp-daycell .meta { margin-left:auto; font-size:12px; }
.hp-free { color:var(--faint); font-weight:600; }
.hp-free.none { color:var(--muted); }
.hp-mydesk { font-family:var(--mono); font-weight:750; font-size:11.5px; letter-spacing:-.02em; color:var(--accent-ink);
  background:var(--accent-soft); border-radius:6px; padding:2px 7px; }
.hp-daycell.today .wd { color:var(--accent); font-weight:750; }
.hp-daycell.mine:not(.sel) { background:var(--accent-soft); }
.hp-daycell.sel { background:var(--accent-grad); border-color:transparent;
  box-shadow:0 8px 18px -10px rgba(79,70,229,.7); }
.hp-daycell.sel .wd, .hp-daycell.sel .dn, .hp-daycell.sel .hp-free { color:#fff; }
.hp-daycell.sel .hp-mydesk { background:rgba(255,255,255,.9); }

.hp-day-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.hp-day-head h2 { font-size:18px; }
/* One number instead of a colour key: how much of the office is still open. */
.hp-freecount { font-size:12.5px; color:var(--muted); white-space:nowrap; }
.hp-freecount b { font-size:14px; color:var(--text); }

/* The floor plan — the same SVG the editor renders, read-only. */
.hp-plan { position:relative; background:radial-gradient(130% 130% at 50% -10%, var(--surface) 0%, var(--surface-2) 70%);
  border:1px solid var(--border); border-radius:16px; padding:12px; overflow:hidden;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6), inset 0 0 40px rgba(51,42,20,.03); }
.hp-plan .fp { max-height:60vh; transition:filter var(--dur-2) var(--ease); }
.hp-plan .fp-desk { cursor:pointer; }
/* Picking a desk on the plan blooms an accent glow — panel-only, and it touches
   only the drop-shadow filter, never the SVG's own positioning transform. */
.hp-plan .fp-desk.sel { animation:hp-deskpick var(--dur-3) var(--ease-out); }
@keyframes hp-deskpick {
  0% { filter:drop-shadow(0 0 0 rgba(79,70,229,0)); }
  45% { filter:drop-shadow(0 3px 14px rgba(79,70,229,.75)); }
  100% { filter:drop-shadow(0 4px 10px rgba(79,70,229,.5)); }
}

/* Inline the plan is a preview: one tap opens the fullscreen scene, so the whole
   tile is the target and the SVG itself takes no pointer events. */
.hp-plan { cursor:zoom-in; }
.hp-plan::after { content:"⤢"; position:absolute; top:16px; right:16px; z-index:2;
  width:34px; height:34px; display:grid; place-items:center; border-radius:11px;
  background:var(--surface); border:1px solid var(--border); color:var(--accent);
  font-size:17px; box-shadow:var(--shadow-sm); pointer-events:none;
  transition:transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.hp-plan:hover::after { transform:scale(1.08); box-shadow:var(--shadow); }
.hp-bar-preview { justify-content:center; }
.hp-openscene { display:inline-flex; align-items:center; justify-content:center; gap:9px; width:100%;
  margin:0; padding:2px; border:0; background:none; font:inherit; font-size:13.5px; font-weight:650;
  color:var(--muted); cursor:pointer; }
.hp-openscene .ic-svg { width:17px; height:17px; color:var(--accent); flex:0 0 auto; }
.hp-openscene b { color:var(--text); }

/* Fullscreen scene: the office fills the screen, the plan zooms/pans, the bar
   books, and the X (or Escape) returns to the calendar. */
html.hp-fs-lock, html.hp-fs-lock body { overflow:hidden; }
.hp-fs { position:fixed; inset:0; z-index:1000; display:flex; flex-direction:column; gap:10px;
  background:var(--bg); opacity:0; transition:opacity var(--dur-2) var(--ease);
  padding:max(10px,env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); }
.hp-fs.on { opacity:1; }
.hp-fs-head { flex:0 0 auto; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:2px 4px; }
.hp-fs-title { display:inline-flex; align-items:center; gap:9px; font-weight:750; font-size:15px; letter-spacing:-.01em; }
.hp-fs-title .ic-svg { width:18px; height:18px; color:var(--accent); }
.hp-fs-close { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; padding:0;
  border:1px solid var(--border-2); background:var(--surface); color:var(--text); cursor:pointer;
  transition:background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform .06s; }
.hp-fs-close .ic-svg { width:20px; height:20px; }
.hp-fs-close:hover { border-color:var(--accent); background:var(--accent-soft); }
.hp-fs-close:active { transform:scale(.94); }
.hp-fs-plan { flex:1 1 auto; min-height:0; position:relative; overflow:hidden; border-radius:16px;
  border:1px solid var(--border); background:radial-gradient(130% 130% at 50% -10%, var(--surface) 0%, var(--surface-2) 70%);
  box-shadow:inset 0 0 40px rgba(51,42,20,.04); touch-action:none; }
.hp-fs-plan .fp { width:100%; height:100%; max-height:none; display:block; touch-action:none; }
.hp-fs-plan .fp-desk { cursor:pointer; }
.hp-fs-bar { flex:0 0 auto; margin-top:0; }

/* One action bar under the plan: what is picked, and what can be done with it. */
.hp-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:12px; padding:11px 14px;
  border:1px solid var(--border); border-radius:13px; background:var(--surface); min-height:58px; }
.hp-bar-hint { display:inline-flex; align-items:center; gap:8px; color:var(--muted); font-size:13.5px; }
.hp-bar-hint .ic-svg { width:16px; height:16px; }
.hp-bar.mine { border-color:var(--accent); background:var(--accent-soft); }
.hp-bar.blocked { background:var(--surface-2); }
.hp-bar-code { font-family:var(--mono); font-weight:750; font-size:13px; color:var(--accent-ink);
  background:var(--accent-soft); border-radius:8px; padding:4px 10px; letter-spacing:-.02em; }
.hp-bar.mine .hp-bar-code { background:#fff; }
.hp-bar-label { color:var(--muted); font-size:13.5px; }
.hp-bar-who { display:inline-flex; align-items:center; gap:7px; font-size:13.5px; font-weight:650; }
.hp-bar-who .nm { display:inline-flex; align-items:center; gap:5px; }
.hp-bar-who .nm.free { color:var(--muted); font-weight:600; }
.hp-bar-acts { margin-left:auto; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.hp-bar-acts .input { min-width:160px; }
.hp-bar-acts .badge .ic-svg { width:13px; height:13px; margin-right:5px; }

/* Account tab */
.hp-acc-head { display:flex; gap:16px; align-items:center; flex-wrap:wrap; margin-bottom:18px; }
.hp-acc-head h2 { margin:0; } .hp-acc-head .hd-note { margin:2px 0 0; }
.hp-acc-avactions { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; }
.hp-acc-avactions .btn { cursor:pointer; }
.hp-acc-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:22px; }
.hp-acc-grid section { border-top:1px solid var(--border); padding-top:14px; }

/* Rooms (salki) */
.hp-rooms { display:flex; flex-direction:column; gap:6px; margin-bottom:6px; }
.hp-roomrow { display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--border); border-radius:9px; background:var(--surface); }
.hp-roomrow.off { opacity:.55; }
.hp-roomrow .hd-note { margin:0; }
.hp-roomdot { width:12px; height:12px; border-radius:50%; flex-shrink:0; }
.hp-roomacts { margin-left:auto; display:flex; gap:4px; }
.hp-reslist { display:flex; flex-direction:column; gap:8px; }
.hp-res { display:flex; gap:12px; align-items:flex-start; padding:10px 12px; border:1px solid var(--border);
  border-left:4px solid var(--rc,#6366f1); border-radius:10px; background:var(--surface); }
.hp-res-time { font-weight:800; font-size:14px; display:flex; flex-direction:column; line-height:1.15; min-width:44px; }
.hp-res-time small { font-weight:600; color:var(--muted); font-size:11.5px; }
.hp-res-body { flex:1; min-width:0; }
.hp-res-title { font-size:14.5px; margin-bottom:5px; }
.hp-res-room { color:var(--accent-2); font-weight:600; font-size:12.5px; background:var(--accent-soft); border-radius:6px; padding:1px 7px; }
.hp-res-people { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:3px; }
.hp-chipav { display:inline-flex; align-items:center; gap:5px; font-size:12px; background:var(--surface-2);
  border:1px solid var(--border); border-radius:999px; padding:2px 8px 2px 2px; }
.hp-res-acts { display:flex; gap:4px; }
.hp-resform { border:1px solid var(--border); border-radius:12px; padding:14px; margin-bottom:12px; background:var(--surface-2); }
.hp-resform-grid { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.hp-resform-grid .field { margin:0; } .hp-resform-grid .grow { flex:1 1 200px; }
.hp-pick-label { display:block; font-size:13px; font-weight:600; color:var(--muted); margin:14px 0 7px; }
.hp-picks { display:flex; flex-wrap:wrap; gap:6px; }
.hp-pick { display:inline-flex; align-items:center; gap:6px; font-size:13px; background:var(--surface); border:1px solid var(--border);
  border-radius:8px; padding:5px 10px; cursor:pointer; }
.hp-pick input { width:15px; height:15px; }

/* ---------- Mobile ----------
   A vertical list of days would push the plan off a phone screen, so the same
   rows become one horizontal strip of chips you swipe through: the day picker
   costs one row and the desks start above the fold. Everything tappable is
   sized for a thumb. */
@media (max-width:700px){
  .hp-cal { gap:14px; }
  .hp-cal-rail { flex-direction:row; overflow-x:auto; gap:14px; padding:2px 0 8px;
    scroll-snap-type:x proximity; scrollbar-width:none;
    /* Bleed to the screen edges so the strip reads as scrollable. */
    margin:0 -14px; padding-left:14px; padding-right:14px; }
  .hp-cal-rail::-webkit-scrollbar { display:none; }
  .hp-weeklbl { display:none; }
  .hp-weekgrp { flex:0 0 auto; }
  .hp-week { flex-direction:row; gap:8px; }
  .hp-daycell { flex-direction:column; align-items:center; justify-content:center; gap:2px; scroll-snap-align:start;
    width:auto; min-width:76px; min-height:70px; flex:0 0 auto; padding:9px 8px 10px; border-radius:13px;
    border-color:var(--border); background:var(--surface); box-shadow:var(--shadow-sm); }
  .hp-daycell .wd { flex:none; font-size:10.5px; }
  .hp-daycell .dn { font-size:16px; }
  .hp-daycell .meta { margin-left:0; font-size:10.5px; white-space:nowrap; }

  .hp-day-head { margin-bottom:12px; }
  /* The plan gets the screen; the action bar sticks to the bottom so the
     buttons for whatever was just tapped are always within thumb reach. */
  .hp-plan { padding:6px; }
  .hp-plan .fp { max-height:52vh; }
  .hp-bar { position:sticky; bottom:8px; z-index:2; box-shadow:var(--shadow); }
  .hp-bar-acts { flex:1 1 100%; margin-left:0; }
  .hp-bar-acts .btn { flex:1; min-height:44px; justify-content:center; }
  .hp-bar-acts .input { flex:1 1 100%; min-height:44px; }

  .hp-resform-grid .field { flex:1 1 100%; }
  .hp-res { flex-wrap:wrap; }
  .hp-res-acts { width:100%; justify-content:flex-end; }
  .icon-btn { width:42px; height:42px; }
}

@media (max-width:560px){
  #app.v-panel .hd-grid2 { grid-template-columns:1fr; gap:4px 0; }
  #app.v-panel .hd-grid2 label { margin-top:7px; }
  .hp-acc-avactions { margin-left:0; }
  .hd-head h1 { font-size:23px; }
  .hd-spacebar { display:flex; width:100%; }
  .hd-spacebar select { flex:1; }
}

/* ---------- Motion (member panel) ----------
   Honours the reduced-motion guard in admin.css. Page-load pieces settle in;
   day-to-day changes cross-fade; picking or booking gets a small confirmation. */
.hd-head { animation:hd-fade-up var(--dur-3) var(--ease-out) both; }
.hd-spacebar { animation:hd-fade-up var(--dur-3) var(--ease-out) both; animation-delay:.03s; }

/* The day rail settles in one week group at a time the first time it mounts. */
.hp-cal-rail .hp-weekgrp { animation:hd-fade-up var(--dur-2) var(--ease-out) both; }
.hp-weekgrp:nth-child(1){animation-delay:.02s}
.hp-weekgrp:nth-child(2){animation-delay:.08s}
.hp-weekgrp:nth-child(3){animation-delay:.14s}

/* Switching the selected day cross-fades the detail pane (rail stays put). */
.hp-day-enter { animation:hp-dayswap var(--dur-2) var(--ease-out); }
@keyframes hp-dayswap { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* Action bar: react smoothly to the picked desk, and slide its content in. */
.hp-bar { transition:border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.hp-bar-code, .hp-bar-label, .hp-bar-who, .hp-bar-acts { animation:hd-fade-up var(--dur-2) var(--ease-out) both; }
.hp-bar-who { animation-delay:.04s; } .hp-bar-acts { animation-delay:.07s; }
.hp-bar .btn, .hp-bar .badge { transition:transform var(--dur-1) var(--ease); }

/* Rooms: reservation cards rise in and lift under the pointer. */
.hp-res { animation:hd-fade-up var(--dur-3) var(--ease-out) both;
  transition:transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-1) var(--ease); }
.hp-res:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.hp-reslist .hp-res:nth-child(2){animation-delay:.05s}
.hp-reslist .hp-res:nth-child(3){animation-delay:.1s}
.hp-reslist .hp-res:nth-child(4){animation-delay:.15s}
.hp-roomrow { transition:transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-1) var(--ease); }
.hp-roomrow:hover { transform:translateY(-1px); box-shadow:var(--shadow-sm); border-color:var(--border-2); }
.hp-chipav { transition:transform var(--dur-1) var(--ease); }
.hp-chipav:hover { transform:translateY(-1px); }

/* Account avatar reacts to hover. */
.hp-av.lg { transition:transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.hp-acc-head .hp-av.lg:hover { transform:scale(1.05); box-shadow:0 8px 20px -6px rgba(51,42,20,.35); }
