/**
 * MeetAssist Desktop — desktop-specific overrides (June 2026 rewrite).
 *
 * Philosophy: overlay.css (shared with the extension) IS the look — panel
 * backgrounds, borders, fonts all come from there for 1:1 visual parity.
 * This file only adapts the FLOATING extension overlay to the desktop window:
 *   - the window is the whole work area and the overlay a box on it, placed
 *     by views/windowCanvas.js (no window move or resize, ever)
 *   - the top bar drags the box
 * Do NOT add background/border overrides here; that recreates the old
 * "transparent window" look that diverged from the extension.
 */

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  /* Transparent like the extension overlay floating over the meeting page —
     each card (top bar / transcript / answer panel) paints its own background
     from overlay.css; the gaps show the desktop through. */
  background: transparent;
}

/* The window is the work area of a display (main createWindow) and never
   moves or resizes in use: every move plus resize shows the previous frame at
   the new spot. The overlay is the UI's box on it. Its top-centre point sits
   at (--ma-box-cx, --ma-box-y), screen px within the window, set on <html> by
   views/windowCanvas.js; unset, the box is centred. Every width change below
   (setup → session, the answer's grip, minimize, the zoom) therefore keeps the
   toolbar where it is, by CSS alone, in the same frame.
   Lengths here are the overlay's own px, which its `zoom` multiplies: the
   screen px variables are divided by it. */
#meetassist-overlay {
  position: fixed !important;
  left: calc(var(--ma-box-cx, 50vw) / var(--ma-zoom, 1)) !important;
  top: calc(var(--ma-box-y, max(0px, (100vh - 720px * var(--ma-zoom, 1)) / 2)) / var(--ma-zoom, 1)) !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  translate: -50% 0 !important;
  /* The setup, login and permissions screens: what the window used to be. */
  width: 900px !important;
  min-width: 0 !important;
  max-width: calc(100vw / var(--ma-zoom, 1)) !important;
  height: 720px !important;
  max-height: calc(100vh / var(--ma-zoom, 1)) !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

/* A session: the box around the answer (the grip sets --ma-answer-w), never
   narrower than the toolbar — packages/ui/utils/answerWidth.js boxWidthFor.
   The setup screen keeps its own 900 whatever the answer's width. */
#meetassist-overlay.interview-active {
  width: max(calc(var(--ma-answer-w, 884px) + 16px), 693px) !important;
}

/* Dragged by the empty part of the top bar (renderer _initWindowDrag →
   windowCanvas.js). Not -webkit-app-region: drag, which overrides the CSS
   cursor — this way the `move` affordance actually shows. */
#meetassist-top-bar {
  cursor: move;
}
/* Interactive children read as clickable, not draggable. */
#meetassist-top-bar button,
#meetassist-top-bar a,
#meetassist-top-bar input,
#meetassist-top-bar select,
#meetassist-top-bar [role="button"] {
  cursor: pointer;
}

/* The extension's resize handle is not used here (the answer's grip sets
   the width) — hidden if a ported template ever brings it in. */
#meetassist-overlay-resize {
  display: none !important;
}

/* ─── Error toasts (ErrorReporter) ──────────────────────────────────────────
   Bottom-left stack. The container ignores pointer events so it never blocks
   clicks on the UI under it — only the toasts themselves are interactive. */
@keyframes ma-toast-in {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: translateY(0); opacity: 0.92; }
}

/* ─── AI Context section (settings panel) ─────────────────────────────────── */
.ma-ctx-save {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 7px;
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.ma-ctx-save:hover { background: rgba(99, 102, 241, 0.32); }

/* Tiny inline spinner shown in the version footer while we check for updates,
   then replaced with the version text (or the Update affordance). */
@keyframes ma-spin { to { transform: rotate(360deg); } }
/* Inline spinner used both in the version footer and in modal status rows.
   `spin` is aliased so existing inline `animation: spin …` markup animates too. */
@keyframes spin { to { transform: rotate(360deg); } }
.ma-spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  vertical-align: middle;
  animation: ma-spin 0.7s linear infinite;
}

/* Indeterminate progress bar — for uploads/condensing where the server gives no
   measurable progress. The fill sweeps across an empty track. */
@keyframes ma-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
.ma-progress-track { height: 3px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; }
.ma-progress-track > .ma-progress-fill {
  height: 100%; width: 30%; border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  animation: ma-indeterminate 1.1s ease-in-out infinite;
}

/* ─── Cursor Undetectability ─────────────────────────────────────────────────
   The window is hidden from screen-share (setContentProtection), but the OS
   cursor is still rendered into any recording. If the cursor changed shape on
   hover — a pointer over a button, an I-beam over a text field, a move cursor
   over the top bar — an observer would see the cursor morph over "empty" screen
   and infer there's an invisible overlay there. Force the plain arrow on every
   element so the cursor NEVER changes anywhere in the app. Interaction is
   unaffected (clicks focus, typing/selection still work; the top-bar drag still
   works via its JS handler — only the visual cursor is pinned). Desktop-only:
   scoped to this stylesheet so the Chrome extension's normal cursors are kept.
   !important beats the inline cursor styles in the panel templates. */
html, body, body * {
  cursor: default !important;
}

/* ─── Screen-permission guide (macOS system-audio onboarding) ─────────────── */
#ma-perm-guide {
  display: none;
  position: absolute;
  top: 96px; /* below the toolbar + status rows, floats over the transcript */
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: 420px;
  max-width: calc(100% - 32px);
  background: #17171f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 14px 16px 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}
.ma-perm-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.ma-perm-title { color: #fff; font-size: 14px; font-weight: 600; }
#ma-perm-close {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 0 2px;
}
#ma-perm-close:hover { color: #fff; }
.ma-perm-steps {
  margin: 0 0 10px; padding-left: 18px;
  color: rgba(255,255,255,0.82); font-size: 12.5px; line-height: 1.8;
}
#ma-perm-guide img {
  width: 100%; border-radius: 9px; display: block;
  border: 1px solid rgba(255,255,255,0.08);
}
.ma-perm-status {
  margin-top: 10px; min-height: 30px;
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.65); font-size: 12.5px;
}
.ma-perm-ok { color: #4ade80; font-weight: 600; }
#ma-perm-restart {
  margin-left: auto;
  background: #16a34a;
  color: #fff; border: none; border-radius: 7px;
  padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
#ma-perm-restart:hover { background: #15803d; }
/* Toolbar "Grant access" after the grant: plain solid green button */
.ma-grant-btn-ready {
  background: #16a34a !important;
  color: #fff !important;
  border: none !important;
}
.ma-grant-btn-ready:hover { background: #15803d !important; }

/* ─── Permissions onboarding (views/permissionsPanel.js) ───────────────────
   Styled in packages/ui/styles/overlay.css under the ma-onb- prefix, NOT here.
   A dark restyle lived at this spot and won by accident: it selected the panel
   by #meetassist-permissions-panel, and an id beats a class from a stylesheet
   that loads first, so the light surface was overridden while the rows and
   buttons underneath it were not — which is why the screen came out
   half-painted and unreadable. Add nothing for that panel to this file. */

/* ─── Compact mode: the desktop part ───────────────────────────────────────
   Compact mode's appearance is shared with the extension and lives in
   overlay.css. What is desktop-only is the box: content-sized, with room for
   the surfaces' shadows, at the same top-centre as the open UI, so the
   toolbar does not move (views/compactMode.js). */
#meetassist-overlay.ma-compact {
  /* FIXED width for the whole compact session — the width the answer had in
     the open view (pinned by compactMode.js). Letting it follow the content
     made the toolbar, centred in it, move whenever an answer opened. */
  /* The pin is the PANEL's width; the box adds the shadow padding below
     (14 + 10, border-box here), or the compact answer came out 24px
     narrower than the open one. */
  width: calc(var(--ma-compact-w, 844px) + 24px) !important;
  min-width: 0 !important;
  max-width: none !important;
  height: max-content !important;
  max-height: none !important;
  padding: 10px 14px 14px 10px !important;
  /* That padding moved off the box's top-centre, so the toolbar stays exactly
     where it is in the open view: 10px up, and the 4px the right side has
     over the left, halved. */
  margin: -10px 0 0 2px !important;
}

/* Browser sign-in: the UI parks as a small card in the left half while the
   login page is open in the browser (main parkWindowForBrowserLogin,
   windowCanvas.js park). */
#meetassist-overlay.ma-parked {
  width: 440px !important;
  height: 430px !important;
}

/* Held while the window moves to another display: the move shows the previous
   frame at the new spot, so it must have nothing on it. */
#meetassist-overlay.ma-resizing > * {
  visibility: hidden !important;
}

/* ─── Coding: the code window (views/codeWindow.js) ─────────────────────────
   A Coding session puts one thing on the screen: the code. The overlay's box
   becomes that window (.ma-coding), everything else in it steps aside, and
   .ma-cw-hidden takes it off the screen, the box with it, so the transparent
   work area lets every click through (click-through on mac/Windows, an empty
   shape on Linux). Dark grey, rounded, a soft shadow; plain alpha for the see-
   through, since a transparent window cannot blur what other apps draw. Only
   the hotkeys move, on hover. Later in this file than the session's width
   rule on purpose: interview-active may be set too, and this wins. */
#meetassist-overlay.ma-coding {
  /* From the grip (views/codeWindow.js), kept across launches. */
  width: var(--ma-cw-w, 520px) !important;
  height: var(--ma-cw-h, 420px) !important;
  padding: 0 !important;
}
/* A glide (windowCanvas nudge, the Coding remote's arrows): a short slide to
   the new place. Only then: the mouse drag and the move hotkeys stay instant. */
#meetassist-overlay.ma-gliding {
  transition: left 160ms cubic-bezier(0.2, 0.8, 0.2, 1), top 160ms cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}
@media (prefers-reduced-motion: reduce) {
  #meetassist-overlay.ma-gliding { transition: none !important; }
}
#meetassist-overlay.ma-coding.ma-cw-hidden {
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}
#meetassist-overlay.ma-coding > :not(#meetassist-code-window) {
  display: none !important;
}
#meetassist-code-window { display: none; }
#meetassist-overlay.ma-coding > #meetassist-code-window {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(12, 13, 16, 0.82);
  color: #f2f2f4;
  /* A hairline edge, no drop shadow: past the box the window is not ours
     (Linux cuts the shape there, a square patch of shadow). */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-align: left;
  user-select: none;
  cursor: default;
}
.ma-cw-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px 22px;
  box-sizing: border-box;
  /* More code below: the last lines fade out. */
  -webkit-mask: linear-gradient(to bottom, #000 calc(100% - 36px), transparent 100%);
  mask: linear-gradient(to bottom, #000 calc(100% - 36px), transparent 100%);
}
.ma-cw-scroll::-webkit-scrollbar { width: 0; height: 0; }
.ma-cw-code { font: 13.5px/1.62 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace; color: #f2f2f4; }
.ma-cw-line { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Xcode's dark palette, on the answer panel's highlighter classes. */
.ma-cw-code .hl-keyword { color: #fc5fa3; }
.ma-cw-code .hl-string { color: #fc6a5d; }
.ma-cw-code .hl-number { color: #d0bf69; }
.ma-cw-code .hl-comment { color: #7f8c98; }
.ma-cw-code .hl-func { color: #67b7a4; }
.ma-cw-code .hl-tag { color: #5dd8ff; }
.ma-cw-text, .ma-cw-exp { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.9); }
.ma-cw-exp { margin-top: 16px; }
.ma-cw-scroll > .ma-cw-exp:first-child { margin-top: 0; }
/* The question Answer answered, over its answer. */
.ma-cw-q { margin: 0 0 6px; font-weight: 600; color: rgba(255, 255, 255, 0.96); }
.ma-cw-text p, .ma-cw-exp p { margin: 0 0 8px; }
.ma-cw-text li, .ma-cw-exp li { font-size: 14px; line-height: 1.6; }
.ma-cw-text ul, .ma-cw-exp ul { margin: 0 0 8px; padding-left: 18px; }
.ma-cw-text pre, .ma-cw-exp pre { margin: 8px 0; white-space: pre-wrap; font: 13px/1.55 'SF Mono', Menlo, Consolas, monospace; }
.ma-cw-note { margin: 14px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }
/* A follow-up on its way, under the code, as the answer panel's spinner. */
.ma-cw-loading { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13.5px; color: rgba(255, 255, 255, 0.6); }
.ma-cw-one {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  box-sizing: border-box;
  text-align: center;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.82);
}
/* Not hearing the call: one small dot. */
.ma-cw-dot { position: absolute; top: 12px; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: #ffb547; }
/* Keycaps, shadcn Kbd style. */
.ma-cw-kg { display: inline-flex; gap: 3px; }
.ma-cw-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  border-radius: 5px; background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  font: 500 11px/1 'Inter', -apple-system, sans-serif; color: #fff;
}
/* The hotkeys: only with the mouse over the window. */
.ma-cw-keys {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px;
  padding: 26px 16px 12px;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(to top, rgba(12, 13, 16, 0.97) 55%, rgba(12, 13, 16, 0));
  font-size: 12px; color: rgba(255, 255, 255, 0.8); white-space: nowrap;
  opacity: 0; transform: translateY(4px);
  transition: opacity 200ms ease-out, transform 200ms cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}
#meetassist-code-window:hover .ma-cw-keys { opacity: 1; transform: none; }
.ma-cw-key { display: inline-flex; align-items: center; gap: 6px; }
/* Stop: the window's one button, top right, with the hotkeys on hover. */
.ma-cw-stop {
  position: absolute; top: 10px; right: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border: 1px solid rgba(248, 113, 113, 0.3); border-radius: 7px;
  background: rgba(40, 18, 20, 0.92); color: #f87171;
  font: 500 12px/1 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease-out;
}
#meetassist-code-window:hover .ma-cw-stop { opacity: 1; pointer-events: auto; }
.ma-cw-stop:hover { background: rgba(60, 22, 25, 0.96); }
#meetassist-code-window:hover .ma-cw-dot { opacity: 0; }
/* A screenshot being analyzed: the screen, scanning (violet edge, the light
   sweeping across), as Analyze shows its screenshots (overlay.css
   .answer-shots.is-scanning), until the code is in. */
.ma-cw-scan { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; box-sizing: border-box; }
.ma-cw-shot { position: relative; display: block; max-width: 100%; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.16); overflow: hidden; }
.ma-cw-shot > img { display: block; max-width: 100%; max-height: 300px; object-fit: contain; }
.ma-cw-shot.is-scanning { border-color: rgba(139, 92, 246, 0.55); box-shadow: 0 0 10px rgba(139, 92, 246, 0.25); }
.ma-cw-shimmer {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.08) 55%, transparent 60%);
  background-size: 250% 100%;
  animation: shimmerSweep 1.5s ease-in-out infinite;
}
.ma-cw-scan-text { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255, 255, 255, 0.6); }
.ma-cw-spin { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: rgba(167, 139, 250, 0.9); border-radius: 50%; animation: ma-cw-spin 0.8s linear infinite; }
@keyframes ma-cw-spin { to { transform: rotate(360deg); } }
/* The grip: bottom-right corner, with the hotkeys on hover. */
.ma-cw-grip {
  position: absolute; right: 3px; bottom: 3px; z-index: 2;
  display: grid; place-items: center; width: 24px; height: 24px;
  color: rgba(255, 255, 255, 0.72); cursor: nwse-resize;
  opacity: 0; transition: opacity 200ms ease-out;
}
#meetassist-code-window:hover .ma-cw-grip { opacity: 1; }
/* Time left: top left, opposite Stop, with it on hover. */
.ma-cw-time {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 7px;
  background: rgba(20, 22, 27, 0.92); color: rgba(255, 255, 255, 0.8);
  font: 500 12px/1 'Inter', -apple-system, sans-serif; font-variant-numeric: tabular-nums;
  opacity: 0; pointer-events: none; transition: opacity 200ms ease-out;
}
.ma-cw-time.is-low { color: #f87171; border-color: rgba(248, 113, 113, 0.3); }
#meetassist-code-window:hover .ma-cw-time { opacity: 1; }

