/* The desk: her face large, controls beside it in landscape and under it in
   portrait (a phone on a tripod, for recording). Built on the booth's
   styles.css for the face renderers and buttons. */
/* `hidden` must win over every display rule below (.desk-main is a grid, the
   settings a flex column), or a signed-out visitor sees the desk's controls. */
[hidden] { display: none !important; }

:root { --screen-bg: #1f3a5f; --screen-fg: #ffffff; --screen-accent: #bcd6ff; }
body.desk { margin: 0; min-height: 100vh; background: #0f1320; color: #e8ecf4; }

/* THE WHITE ROOM. With the Simli face the whole page takes her backdrop's
   shade (styles.css sets --room-tint white; live.js replaces it with the
   colour read off her first frames), so there is no edge anywhere round her:
   not the frame, not the page, not the panel of controls. */
body.desk.room-light { background: var(--room-tint); color: #1c2336; }
body.desk.room-light .desk-face .face-wrap { background: var(--room-tint); box-shadow: none; }
body.desk.room-light .caption { color: #1c2336; text-shadow: none; background: rgba(255, 255, 255, 0.72); border-radius: 10px; padding: 10px 16px; }
body.desk.room-light .settings, body.desk.room-light .draft { border-color: rgba(28, 35, 54, 0.15); background: rgba(255, 255, 255, 0.5); }
body.desk.room-light .pick select, body.desk.room-light .input { background: #fff; color: #1c2336; border-color: rgba(28, 35, 54, 0.25); }
body.desk.room-light .transcript { background: rgba(255, 255, 255, 0.55); color: #1c2336; border: 1px solid rgba(28, 35, 54, 0.12); border-radius: 12px; padding: 8px 12px; }
body.desk.room-light .transcript .who { color: #4a5570; opacity: 1; }
/* The booth's buttons are white-on-dark; on white their ghost variant vanished
   (Hush, End my day, Desk settings, Sign out were near-invisible in the first
   screenshot). Dark ink and a visible edge for every button in the light. */
body.desk.room-light .btn { color: #1c2336; background: rgba(255, 255, 255, 0.9); border-color: rgba(28, 35, 54, 0.3); }
body.desk.room-light .btn:hover:not(:disabled) { background: #eef1f7; }
body.desk.room-light .btn--go, body.desk.room-light .btn--rec.is-on { color: #fff; background: #1e2a4d; border-color: #1e2a4d; }
body.desk.room-light .btn--rec.is-on { background: #b3261e; border-color: #b3261e; }
/* Hover (and a tap on iOS, where :hover sticks) must not turn the filled
   buttons' white labels onto the pale hover background above. */
body.desk.room-light .btn--go:hover:not(:disabled) { background: #2c3d6b; }
body.desk.room-light .btn--rec.is-on:hover:not(:disabled) { background: #9a1f18; }
body.desk.room-light .btn--ghost { background: transparent; }
body.desk.room-light .status { color: #1c2336; background: rgba(255, 255, 255, 0.8); border-color: rgba(28, 35, 54, 0.3); }
body.desk.room-light .links { opacity: 0.9; }
body.desk.room-light .gate-line { opacity: 0.9; }
body.desk.room-light .gate-error { color: #b3261e; }

.gate { max-width: 420px; margin: 18vh auto 0; padding: 0 16px; text-align: center; }
.gate h1 { font-size: 2.4rem; margin: 0 0 8px; }
.gate-line { opacity: 0.8; margin: 0 0 24px; }
.gate-error { color: #ff9a8a; min-height: 1.4em; margin-top: 16px; }

.desk-main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 16px; padding: 16px; min-height: calc(100vh - 32px); box-sizing: border-box; }
@media (orientation: portrait), (max-width: 820px) {
  .desk-main { grid-template-columns: 1fr; }
}
.desk-face .face-wrap { position: relative; height: min(78vh, 100%); min-height: 360px; border-radius: 16px; overflow: hidden; background: #1a2033; }
.desk-face .face-3d, .desk-face .face-live { position: absolute; inset: 0; width: 100%; height: 100%; }
.desk-face .caption { position: absolute; left: 5%; right: 5%; bottom: 4%; text-align: center; font-size: clamp(1rem, 2.4vw, 1.5rem); line-height: 1.35; text-shadow: 0 2px 8px rgba(0,0,0,0.8); }

/* Her screen, picture-in-picture over the top-right of her frame, so it is in
   any recording of the face panel. Narrower in portrait, where she is tall. */
/* Her screen is a coloured card, any colour he likes (`?screen=<hex>`), so it
   reads as a screen on the white room and on the dark one. */
.screen { position: absolute; top: 4%; right: 3%; z-index: 4; width: min(44%, 420px); max-height: 62%; overflow: hidden; padding: 12px 14px; border-radius: 14px; background: var(--screen-bg); color: var(--screen-fg); border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 10px 30px rgba(0,0,0,0.28); animation: screen-in 0.28s ease-out; font-size: clamp(0.78rem, 1.5vw, 0.95rem); }
@keyframes screen-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
.screen-title { font-weight: 700; letter-spacing: 0.02em; margin-bottom: 8px; color: var(--screen-accent); }
.screen-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.screen-rows li { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,0.12); }
.screen-rows li.is-unread .screen-main { font-weight: 700; }
.screen-side { opacity: 0.8; min-width: 5.5em; }
.screen-main { flex: 1; min-width: 0; }
.screen-sub { flex-basis: 100%; opacity: 0.75; font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screen-body { flex-basis: 100%; margin: 0; white-space: pre-wrap; max-height: 12em; overflow: hidden; }
@media (orientation: portrait), (max-width: 820px) { .screen { width: 58%; top: 3%; } }

.rec { position: absolute; top: 48px; left: 12px; z-index: 5; padding: 4px 10px; border-radius: 999px; background: rgba(200, 30, 30, 0.85); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }

.desk-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.desk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* The booth pins .status to the page's top-left corner; at the desk it lives
   in the header beside the links, where it was drawn over her face before. */
.desk-head .status { position: static; }
.links { font-size: 0.8rem; opacity: 0.75; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row--sub { font-size: 0.9rem; }
.pick { display: inline-flex; gap: 6px; align-items: center; }
.pick select { background: #1a2033; color: inherit; border: 1px solid #334; border-radius: 8px; padding: 4px 6px; }
.btn--rec.is-on { background: #b3261e; color: #fff; }
.settings { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #2a3350; border-radius: 12px; }
.settings .file { cursor: pointer; text-align: center; }
.draft { padding: 12px; border: 1px solid #3d6; border-radius: 12px; background: #13201a; }
.draft h2 { margin: 0 0 6px; font-size: 1rem; }
.draft-body { white-space: pre-wrap; font: inherit; margin: 8px 0; max-height: 30vh; overflow: auto; }
.draft-to, .draft-subject { margin: 2px 0; opacity: 0.85; }
.transcript { flex: 1; overflow: auto; max-height: 40vh; font-size: 0.92rem; }
.transcript p { margin: 6px 0; }
.transcript .who { opacity: 0.6; margin-right: 6px; }

/* Recording: the controls stay usable for him but the transcript, which can
   carry what he said out loud, is hidden from the frame. */
body.recording .transcript, body.recording .settings, body.recording .links { display: none; }
