/* The dock and a building's window, taken from the old TCY (map/app/dock.css and window.css). Everything lies over the
   city in a fixed place: the city never moves or shrinks for a window. The computer: the dock at the top right, a window
   over the whole screen left of it. The phone: the dock at the bottom, a window is a sheet that ends above it. */
:root { --dock-b: max(18px, calc(env(safe-area-inset-bottom) + 4px)); --dock-space: calc(var(--dock-b) + 72px); }

/* ---------- the dock ---------- */
#dock { position: fixed; z-index: 19; display: flex; background: rgba(14,16,21,.86); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
#dock .dk { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; padding: 0 2px;
  background: none; border: 0; color: var(--faint); font: inherit; font-size: 11px; font-weight: 500; letter-spacing: .02em; cursor: pointer; }
#dock .dk svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#dock .dk > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#dock .dk:hover, #dock .dk.on { color: var(--text); }
#dock .dk[data-go="kai"].on { color: var(--kai); }   /* Kai's button, lit while his window is open (violet) */
.dk-new { position: absolute; top: 8px; left: 50%; margin-left: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }   /* news: white */
.dk-sep { flex: none; background: rgba(174,183,198,.22); }
@media (max-width: 760px) {
  #dock { left: 10px; right: 10px; bottom: var(--dock-b); height: 64px; padding: 0 4px; align-items: stretch; }
  #dock .dk { flex: 1 1 0; border-top: 2px solid transparent; }
  #dock .dk.on { border-top-color: var(--silver); }
  .dk-sep { width: 1px; margin: 14px 2px; }
  body.kb-open #dock { display: none; }   /* the keyboard is up: the message box sits on it */
}
@media (min-width: 761px) {
  #dock { right: 16px; top: 16px; width: 72px; flex-direction: column; padding: 4px 0; }
  #dock .dk { height: 62px; }
  #dock .dk.on { color: #fff; font-weight: 700; }
  #dock .dk.on svg { stroke-width: 2.2; }
  .dk-sep { height: 1px; margin: 4px 14px; }
}
@media (min-width: 761px) and (max-height: 520px) { #dock .dk { height: 48px; gap: 2px; } }

/* ---------- a building's window ---------- */
.pane { display: none; flex-direction: column; overflow: hidden; background: var(--panel); }
.pane.on { display: flex; }
@media (min-width: 761px) {
  .pane { position: fixed; top: 16px; bottom: 16px; left: 16px; right: 104px; z-index: 10; border: 1px solid var(--edge-hi); border-radius: 8px; box-shadow: var(--shadow); }
  .grab { display: none; }
}
@media (max-width: 760px) {
  .pane { position: fixed; left: 0; right: 0; bottom: 0; top: calc(26px + env(safe-area-inset-top)); z-index: 12; padding-bottom: var(--dock-space);
    border-top: 1px solid var(--edge-hi); border-radius: 10px 10px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.5); }
  .pane::before { content: ''; display: block; flex: none; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--faint); }
  body.kb-open .pane { padding-bottom: var(--kb, 0px); }   /* (--kb: how much of the screen the keyboard covers, main.js) */
  .pane .bw-x { display: none; }   /* the phone closes a sheet with its grey bar (a tap) or by pulling it down */
  .grab { position: absolute; top: 0; left: 50%; z-index: 3; width: 56px; height: 44px; margin-left: -28px; padding: 0; background: none; border: 0; cursor: pointer; }
  .grab:focus-visible { outline: 2px solid var(--silver); outline-offset: -6px; }
  .pane.pulling { transition: none !important; will-change: transform; }
  /* the city is drawn only while nothing covers it */
  body:not(.city) #scene canvas { visibility: hidden; }
}
body:not(.city) #scene > div { visibility: hidden; }   /* the city's names never show over or round an open window */
/* the head: the building's tile, its name and one short line, Close */
.bw-head { display: flex; align-items: center; gap: 10px; flex: none; min-height: 58px; padding: 0 4px 0 14px; }
.bw-tile { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid rgba(174,183,198,.45); border-radius: 4px; background: var(--card); color: var(--sub); }
.bw-tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bw-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bw-who h1 { margin: 0; font-family: var(--head); font-size: 20px; font-weight: 600; line-height: 24px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bw-state { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; line-height: 16px; color: var(--sub); }
.bw-x { width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 0; background: none; border: 0; border-radius: 4px; color: var(--faint); cursor: pointer; }
.bw-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bw-x:hover { color: var(--text); background: rgba(226,232,242,.06); }
/* the body: the page; on the phone it is what scrolls, nothing inside it does */
.bw-body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 14px 14px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* a row of tabs or days: always one row; when it does not fit it swipes sideways, snapping, no scrollbar (the owner, 27 Nov 2026) */
.rp-tabs { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.rp-tabs::-webkit-scrollbar { display: none; }
.rp-tabs button { flex: none; font: inherit; font-size: 14px; font-weight: 500; padding: 5px 14px; border-radius: 4px; border: 1px solid var(--line); background: none; color: var(--sub);
  cursor: pointer; white-space: nowrap; scroll-snap-align: start; }
.rp-tabs button.on { background: var(--white); color: var(--on-white); font-weight: 600; border-color: var(--white); }
@media (max-width: 760px) { .rp-tabs button { min-height: 44px; } }

/* a carousel of same-shaped cards: one at a time on the phone, the next peeking in, no dots (the owner, 27 Nov 2026) */
.carousel { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; align-items: flex-start; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; }
.carousel.many > * { flex-basis: 88%; }
