/* A City Bot's computer (web/computer.js): its browser's screen, live, over the whole window. */
.cmp {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: #0b0f17; color: #e8edf4;
}
.cmp[hidden] { display: none; }
.cmp-top {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 16px; align-items: center;
  padding: 10px 14px; background: var(--surface); color: var(--fg); border-bottom: 1px solid var(--line);
}
.cmp-title { display: flex; flex-direction: column; min-width: 0; }
.cmp-title b { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-mode { font-size: 12px; font-weight: 600; color: var(--muted); }
.cmp-mode.is-you { color: var(--fg); }
.cmp-mode.is-you::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); }
.cmp-bar { display: flex; gap: 4px; align-items: center; min-width: 0; }
.cmp-nav {
  width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--fg);
  font-size: 18px; line-height: 1; display: grid; place-items: center; padding: 0;
}
.cmp-nav:disabled { opacity: .45; cursor: default; }
.cmp-url { flex: 1; min-width: 0; }
.cmp-url input {
  width: 100%; height: 32px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface-2); color: var(--fg); font: 13px/1 var(--font-mono, ui-monospace, monospace);
}
.cmp-url input[readonly] { color: var(--muted); }
.cmp-actions { display: flex; gap: 8px; align-items: center; }
.cmp-actions .btn { box-shadow: none; padding: 7px 16px; white-space: nowrap; }
/* In control: the bar turns the yellow of the frame round the screen, and "Give back control" (or "I'm done") is a
   big dark button on it that pulses when you take control, so it can't be missed. */
.cmp.is-you .cmp-top { background: var(--accent); color: var(--accent-ink); border-bottom-color: rgba(0, 0, 0, .14); }
.cmp.is-you .cmp-mode { color: var(--accent-ink); font-weight: 700; }
.cmp.is-you .cmp-mode::before { background: var(--accent-ink); animation: cmp-live 1.6s ease-in-out infinite; }
.cmp.is-you .cmp-x { color: var(--accent-ink); }
.cmp.is-you .cmp-x:hover { background: rgba(0, 0, 0, .1); color: var(--accent-ink); }
.cmp-actions .btn.cmp-back {
  background: var(--accent-ink); color: #fff; border-color: var(--accent-ink);
  padding: 10px 22px; font-size: 15px; font-weight: 700; border-radius: 10px;
}
.cmp-actions .btn.cmp-back:hover { background: #3a2e0c; border-color: #3a2e0c; }
.cmp-actions .btn.cmp-back:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.cmp-actions .btn.cmp-back.is-new { animation: cmp-pulse 1.3s ease-out 2; }
@keyframes cmp-pulse { 0% { box-shadow: 0 0 0 0 rgba(26, 20, 5, .55); } 100% { box-shadow: 0 0 0 14px rgba(26, 20, 5, 0); } }
@keyframes cmp-live { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .cmp.is-you .cmp-mode::before, .cmp-actions .btn.cmp-back.is-new { animation: none; }
}
.cmp-x { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
.cmp-x:hover { background: var(--surface-2); color: var(--fg); }
.cmp-handoff {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center;
  padding: 10px 14px; background: var(--accent); color: #1b1300; font-size: 14px;
}
.cmp-handoff[hidden] { display: none; }
.cmp-handoff .btn { box-shadow: none; padding: 6px 14px; background: #1b1300; color: #fff; border-color: #1b1300; }
.cmp-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 12px; }
.cmp-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45); user-select: none; -webkit-user-drag: none; outline: none; cursor: default;
}
.cmp.is-you .cmp-stage img { cursor: auto; box-shadow: 0 0 0 3px var(--accent), 0 10px 40px rgba(0, 0, 0, .45); }
.cmp-stage img[hidden] { display: none; }
.cmp-note { position: absolute; margin: 0; padding: 0 24px; font-size: 15px; color: #c9d2de; text-align: center; }
.cmp-note[hidden] { display: none; }

@media (max-width: 720px) {
  .cmp-top { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; }
  .cmp-bar { grid-column: 1 / -1; grid-row: 2; }
  .cmp-stage { padding: 6px; }
}

/* The sign-in card (web/signin.js): in the Mayor's chat (inside .mc-card) and the bot's (inside .approval). */
.si { display: grid; gap: 8px; min-width: 0; }
.si p { margin: 0; }
.si-k { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.si-lock { width: 9px; height: 7px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; margin-top: 4px; }
.si-lock::before { content: ""; position: absolute; left: 1px; top: -6px; width: 4px; height: 5px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
.si-t { font-weight: 700; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.si-for { font-weight: 500; color: var(--muted); }
.si-d { font-size: 12.5px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.si-form { display: grid; gap: 8px; }
.si-f { display: grid; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.si-f input {
  width: 100%; box-sizing: border-box; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: 14px/1 var(--font-body, inherit);
}
.si-f input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.si-b { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.si-b .btn { box-shadow: none; }
.si-note { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.si-st { font-size: 12.5px; line-height: 1.45; display: flex; gap: 6px; align-items: flex-start; overflow-wrap: anywhere; }
.si-st.is-warn { color: var(--warn, #d08a00); }
.si-st.is-done { color: var(--fg); }
.si-ok { flex: none; width: 12px; height: 12px; margin-top: 2px; border-radius: 50%; background: var(--ok); }
.si-live { position: relative; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: #0b0f17; border: 1px solid var(--line); }
.si-screen { width: 100%; height: 100%; object-fit: contain; display: block; }
.si-screen[hidden] { display: none; }
.si-spin {
  position: absolute; right: 8px; bottom: 8px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--accent); border-top-color: transparent; animation: spin .8s linear infinite;
}
.mc-signin { gap: 0; }
