/* =====================================================================
   The Office — guests in meetings (see public/js/guest.js, server/guests.js).
   1. The guest's way in: a single card on the site's cream, like the
      sign-in screens (pick a character, your name, the microphone, the door).
   2. A guest inside: the meeting room, the voice and a bar with the way out.
      Everything else of the office is hidden (and never sent: the server
      keeps it from them).
   3. The team's Guests panel.
   Logical properties throughout, so Arabic mirrors by itself.
   ===================================================================== */

/* ------------------------------------------------------------ 1. the way in */
.screen:has(.guest-door) { align-items: center; overflow-y: auto; background: #f3f0e7; }
.guest-door {
  /* the same light island as the sign-in portal */
  --surface: #faf8f2;
  --surface-2: #f3f0e7;
  --surface-3: #ddd7ca;
  --surface-input: #ffffff;
  --ink: #2f4352;
  --ink-muted: #5c5f4f;
  --ink-placeholder: #6b6e5d;
  --chrome-muted: #5c5f4f;
  --chrome-line: #a39c8e;
  --chrome-line-soft: #ddd7ca;
  --chrome-fill-hover: rgba(47, 67, 82, 0.06);
  --focus: #b9532b;
  --primary: #b9532b;
  --primary-hover: #9e4523;
  --primary-press: #8a3b1e;
  color: var(--ink);
  width: min(560px, 100%);
  margin: auto;
  padding: var(--s-5) var(--s-6) var(--s-6);
  border: 1px solid var(--chrome-line-soft);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(34, 49, 60, 0.04), 0 24px 64px -12px rgba(34, 49, 60, 0.14);
  text-align: start;
}
.guest-door a { color: #9e4523; }
.guest-door .input { background: var(--surface-input); color: var(--ink); border-color: var(--chrome-line); }
.guest-door .input:focus { border-color: var(--focus); }
.guest-door .btn.primary, .guest-door .btn.primary:hover { color: #fff; }
.guest-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-block-end: var(--s-4); }
.guest-logo { display: block; width: 120px; height: auto; image-rendering: pixelated; }
.guest-main { display: flex; flex-direction: column; gap: var(--s-3); }
.guest-kicker { margin: 0; color: var(--ink-muted); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.guest-meeting { margin: 0; font-weight: var(--fw-bold); font-size: var(--fs-body); }
.guest-title { margin: 0; font: 600 clamp(1.75rem, 4vw, 2.25rem)/1.1 'Fraunces', Georgia, serif; letter-spacing: -0.02em; }
.guest-title:dir(rtl) { font-family: inherit; font-weight: var(--fw-heavy); line-height: 1.35; letter-spacing: 0; }
.guest-sub { margin: 0; color: var(--ink-muted); line-height: var(--lh-body); }
.guest-note { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); font-weight: var(--fw-semibold); }
.guest-note .px { flex: none; width: 20px; height: 20px; }
.guest-form { display: flex; flex-direction: column; gap: var(--s-3); margin-block-start: var(--s-2); }
.guest-picks-wrap { margin: 0; padding: 0; border: 0; min-width: 0; }
.guest-label { padding: 0; margin-block-end: var(--s-2); font-weight: var(--fw-bold); font-size: var(--fs-small); }
.guest-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.guest-pick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--s-2) var(--s-1) var(--s-2);
  border: 2px solid var(--chrome-line-soft); border-radius: 18px;
  background: var(--surface-input); color: var(--ink); cursor: pointer;
  transition: border-color var(--dur-fast, 0.15s), transform var(--dur-fast, 0.15s), box-shadow var(--dur-fast, 0.15s);
}
.guest-pick canvas { display: block; width: 100%; max-width: 80px; height: auto; image-rendering: pixelated; }
.guest-pick-name { font-size: 0.75rem; font-weight: var(--fw-semibold); text-align: center; line-height: 1.2; }
@media (hover: hover) { .guest-pick:hover { border-color: var(--chrome-line); } }
.guest-pick[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(185, 83, 43, 0.18); transform: translateY(-2px); }
.guest-pick:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.guest-form .btn.block { min-height: 52px; border-radius: 999px; font-size: var(--fs-body); font-weight: var(--fw-bold); }
.guest-problem { margin: 0; color: #a2321f; font-weight: var(--fw-semibold); font-size: var(--fs-small); }
.guest-problem[hidden] { display: none; }
.guest-fine { margin: 0; color: var(--ink-muted); }
.guest-figure { display: flex; justify-content: center; }
.guest-figure canvas { image-rendering: pixelated; }
.guest-level { position: relative; height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.guest-level-fill { position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 0; border-radius: inherit; background: #777a68; transition: inline-size 80ms linear; }
.guest-door .btn.primary.block { min-height: 52px; border-radius: 999px; font-weight: var(--fw-bold); }
.guest-skip { align-self: center; min-height: var(--tap); padding: 0 var(--s-3); color: var(--ink-muted); font-weight: var(--fw-semibold); }
.guest-dots { display: flex; justify-content: center; gap: 8px; padding: var(--s-2) 0; }
.guest-dots span { width: 10px; height: 10px; border-radius: 50%; background: #777a68; animation: guest-dot 1.2s ease-in-out infinite; }
.guest-dots span:nth-child(2) { animation-delay: 0.2s; }
.guest-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes guest-dot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .guest-dots span { animation: none; opacity: 0.6; } .guest-pick { transition: none; } }
@media (max-width: 520px) {
  .guest-door { padding: var(--s-4); border-radius: 22px; }
  .guest-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guest-pick canvas { max-width: 64px; }
}

/* ------------------------------------------------------------ 2. a guest inside */
body.guest-mode .app { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "top" "stage" !important; grid-template-rows: auto minmax(0, 1fr) !important; }
body.guest-mode .app > .side,
body.guest-mode .app > .bottom-bar,
body.guest-mode #dock,
body.guest-mode #rooms,
body.guest-mode #clock-split,
body.guest-mode #btn-chat-tablet,
body.guest-mode #people-pill,
body.guest-mode #name-ear,
body.guest-mode #meeting-bar .btn,
body.guest-mode #meeting-bar .scribe-chip { display: none !important; }
body.guest-mode #btn-menu { pointer-events: none; }
body.guest-mode #btn-menu .office-ic { display: none; }
.guest-bar {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  width: min(720px, 100%);
  padding: var(--s-1) var(--s-1) var(--s-1) var(--s-3);
  border: 1px solid var(--chrome-line-soft); border-radius: 20px;
  background: var(--glass, var(--bg-raised)); box-shadow: var(--sh-3, var(--sh-2));
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
body:not(.guest-mode) .guest-bar { display: none; }
.guest-bar .spacer { flex: 1; }
.guest-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--selected, var(--surface-2)); font-weight: var(--fw-bold); font-size: var(--fs-small); }
.guest-chip .px { width: 16px; height: 16px; }
.guest-where { font-size: var(--fs-small); color: var(--chrome-muted, var(--ink-muted)); }

/* ------------------------------------------------------------ 3. the team's Guests panel */
.guests-panel { display: flex; flex-direction: column; gap: var(--s-3); }
.guests-panel h3 { margin: var(--s-2) 0 0; }
.guest-add { display: flex; flex-direction: column; gap: var(--s-3); }
.guest-add .field .hint { font-weight: var(--fw-regular, 400); }
.guest-link .px { flex: none; width: 20px; height: 20px; margin-block-start: 2px; }
.guest-add .check { display: flex; align-items: center; gap: var(--s-2); min-height: var(--tap); font-size: var(--fs-small); }
.guest-add .check input { width: 20px; height: 20px; accent-color: var(--primary); }
.guest-add .form-error { margin: 0; color: var(--danger); font-weight: var(--fw-semibold); font-size: var(--fs-small); }
.guest-add .form-error[hidden], .guest-add .hint[hidden] { display: none; }
.guest-link { display: flex; flex-direction: column; gap: var(--s-2); }
.guest-link p { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0; }
.guest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.guest-row { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
.guest-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.guest-row-main .fine { overflow-wrap: anywhere; }
.guest-row.is-waiting { box-shadow: inset 3px 0 0 var(--primary); }
.guest-row.is-in { box-shadow: inset 3px 0 0 var(--here, #777a68); }
