/* ============================================================
   FILMING ON A DESK, clean layout (Basecamp 10493044223,
   clean-filming.js). Only a desk gets .cf-desk; a phone keeps the
   full-screen viewfinder exactly as it was.

   The page is light like the rest of the clean layout. The camera
   picture is the one dark object, in its own bordered window under
   the teleprompter, and the words and the buttons live outside it.
   ============================================================ */

html[data-layout="clean"] .capture.cf-desk {
  /* Back to the page's own tokens: the viewfinder's dark ones are for
     the window below, not for the words and the buttons. */
  --surface: inherit; --surface-2: inherit; --line: inherit; --rule: inherit;
  --rule-soft: inherit; --text: inherit; --heading: inherit; --muted: inherit;
  --muted-2: inherit; --ok: inherit; --warn: inherit; --bad: inherit;
  --accent-live: inherit;
  /* The window's height; its width follows a desk camera's wide frame. */
  --cf-h: clamp(220px, calc(100vh - 446px), 560px);
  color: var(--ink);
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto;
  padding: 0 24px 28px;
}

/* ---------- the top line: the way back, and the voice switch ---------- */
html[data-layout="clean"] .capture.cf-desk .cf-top {
  align-self: stretch; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 58px;
}
html[data-layout="clean"] .capture.cf-desk .cf-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-text); font-size: 15.5px; font-weight: 600; color: var(--ink-2);
}
html[data-layout="clean"] .capture.cf-desk .cf-back:hover { color: var(--ink); }
html[data-layout="clean"] .capture.cf-desk .cf-back svg { width: 18px; height: 18px; }
html[data-layout="clean"] .capture.cf-desk .cf-voice {
  display: flex; align-items: center; gap: 10px;
  font-size: 15.5px; font-weight: 600; color: var(--ink-2);
  transition: opacity .2s ease;
}
html[data-layout="clean"] .capture.cf-desk .cf-voice[hidden] { display: none; }
html[data-layout="clean"] .capture.cf-desk .cf-voice.is-away { opacity: 0; pointer-events: none; }
html[data-layout="clean"] .capture.cf-desk .cf-voice-note {
  max-width: 440px; text-align: right;
  font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--muted);
}

/* ---------- the teleprompter, centred under the webcam ----------
   A fixed height, so a long line never pushes the window down. */
html[data-layout="clean"] .capture.cf-desk .prompter {
  position: static; flex: none;
  width: min(700px, 100%); height: 212px; min-height: 0;
  padding: 0; overflow: hidden;
  background: none; color: var(--ink);
  text-align: center;
}
html[data-layout="clean"] .capture.cf-desk .prompter .line-prev,
html[data-layout="clean"] .capture.cf-desk .prompter .line-next {
  color: var(--muted); font-size: 17px; line-height: 1.35;
}
html[data-layout="clean"] .capture.cf-desk .prompter .line-now {
  color: var(--ink); font-size: 30px; line-height: 1.25; margin: 10px 0;
}
html[data-layout="clean"] .capture.cf-desk .prompter .direction { color: var(--accent-deep); }
html[data-layout="clean"] .capture.cf-desk .prompter .shot-count { color: var(--accent-deep); }

/* The camera could not be opened: the browser's words and the one fix. */
html[data-layout="clean"] .capture.cf-desk .prompter.cf-blocked {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
html[data-layout="clean"] .capture.cf-desk .cf-blocked-title {
  margin: 0; padding: 0; border-top: 0;
  font-family: var(--font-text); font-size: 26px; font-weight: 700;
  letter-spacing: -0.01em; text-transform: none; color: var(--ink);
}
html[data-layout="clean"] .capture.cf-desk .cf-blocked-say {
  margin: 0; max-width: 520px; font-size: 17px; line-height: 1.45; color: var(--ink-2);
}

/* The page's black button, not the viewfinder's inverted one. */
html[data-layout="clean"] .capture.cf-desk .cf-blocked-go {
  background: var(--ink); border-color: var(--ink); color: var(--paper-3);
}
html[data-layout="clean"] .capture.cf-desk .cf-blocked-go:hover {
  background: var(--ink-press); border-color: var(--ink-press); color: var(--paper-3);
}

/* ---------- the camera window ---------- */
html[data-layout="clean"] .capture.cf-desk .cf-window {
  /* The viewfinder's own dark tokens (styles.css), for what sits on the
     picture: the face guide, the light coach, the three checks. */
  --surface: rgba(239, 232, 218, 0.08);
  --surface-2: rgba(239, 232, 218, 0.13);
  --line: rgba(239, 232, 218, 0.2);
  --rule: rgba(239, 232, 218, 0.2);
  --rule-soft: rgba(239, 232, 218, 0.12);
  --text: #efe8da;
  --heading: #fffdf7;
  --muted: rgba(239, 232, 218, 0.68);
  --muted-2: rgba(239, 232, 218, 0.55);
  --ok: #74d194;
  --bad: #e0674f;
  --accent-live: #e0674f;
  color: var(--text);
  position: relative; flex: none;
  height: var(--cf-h); aspect-ratio: 16 / 9; max-width: 100%;
  border-radius: 10px; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--rule), 0 10px 28px rgba(23, 20, 15, 0.12);
}
/* What every frame of the ad keeps: quiet lines, the rest dimmed. Under the
   coach line and the checks, which sit on top of it. */
html[data-layout="clean"] .capture.cf-desk .cf-keep {
  position: absolute; z-index: 1;
  border: 1px dashed rgba(255, 253, 247, .5); border-radius: 2px;
  box-shadow: 0 0 0 999px rgba(23, 20, 15, .32);
}
html[data-layout="clean"] .capture.cf-desk .cf-window .face-guide { z-index: 2; }
html[data-layout="clean"] .capture.cf-desk .cf-window .face-guide {
  --fg-w: calc(var(--cf-h) * 0.4);
}
html[data-layout="clean"] .capture.cf-desk .cf-window .coach-line {
  bottom: 14px; max-width: 80%;
}
html[data-layout="clean"] .capture.cf-desk .cf-window .film-checks {
  bottom: 14px; left: 14px; right: 14px;
}
html[data-layout="clean"] .capture.cf-desk .cf-window .shot-howto {
  bottom: 14px; left: 14px; width: min(40%, 220px);
}

/* ---------- the controls, under the window ---------- */
html[data-layout="clean"] .capture.cf-desk .controls {
  position: static; flex: none;
  width: calc(var(--cf-h) * 16 / 9); max-width: 100%;
  padding: 16px 0 0; background: none;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
html[data-layout="clean"] .capture.cf-desk .controls > div {
  display: flex; align-items: center; gap: 10px;
}
html[data-layout="clean"] .capture.cf-desk .controls > div:first-child { justify-content: flex-start; }
html[data-layout="clean"] .capture.cf-desk .controls > div:nth-child(2) { flex-direction: column; gap: 6px; }
html[data-layout="clean"] .capture.cf-desk .controls > div:last-child { justify-content: flex-end; }
html[data-layout="clean"] .capture.cf-desk .pill-btn {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--cl-line); border-radius: var(--radius-btn);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  font-family: var(--font-text); font-size: 15px; font-weight: 600;
  letter-spacing: 0; text-transform: none;
  padding: 9px 16px; min-height: 40px;
}
html[data-layout="clean"] .capture.cf-desk .pill-btn:hover { border-color: var(--ink); background: var(--paper-4); }
html[data-layout="clean"] .capture.cf-desk .practice-btn[aria-pressed="true"] { background: var(--paper-4); border-color: var(--ink); }
html[data-layout="clean"] .capture.cf-desk .rec-btn {
  width: 66px; height: 66px;
  border-color: var(--surface); background: var(--cl-rec);
  box-shadow: 0 0 0 2px var(--ink);
}
html[data-layout="clean"] .capture.cf-desk .rec-btn.armed { animation: cf-armed 1.8s ease-out infinite; }
@keyframes cf-armed {
  0% { box-shadow: 0 0 0 2px var(--ink), 0 0 0 2px rgba(224, 74, 50, .45); }
  100% { box-shadow: 0 0 0 2px var(--ink), 0 0 0 14px rgba(224, 74, 50, 0); }
}
html[data-layout="clean"] .capture.cf-desk .rec-label,
html[data-layout="clean"] .capture.cf-desk .rec-timer { color: var(--ink); }
html[data-layout="clean"] .capture.cf-desk .autoscroll-indicator {
  color: var(--ink-2); background: var(--paper-4);
}
html[data-layout="clean"] .capture.cf-desk .autoscroll-indicator[data-state="voice"] {
  color: var(--cl-lamp-ok); background: var(--paper-4);
}

/* ---------- the phone card ----------
   Beside the window on a wide desk, under the controls on a narrower one. */
html[data-layout="clean"] .capture.cf-desk .cf-phone {
  flex: none; width: min(560px, 100%); margin-top: 22px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
html[data-layout="clean"] .capture.cf-desk .cf-phone-title {
  margin: 0; padding: 0; border-top: 0;
  font-family: var(--font-text); font-size: 17px; font-weight: 700;
  letter-spacing: 0; text-transform: none; color: var(--ink);
}
html[data-layout="clean"] .capture.cf-desk .cf-phone-say {
  margin: 0; font-size: 16px; line-height: 1.45; color: var(--ink-2);
}
html[data-layout="clean"] .capture.cf-desk .cf-phone-go { gap: 9px; margin-top: 4px; }
html[data-layout="clean"] .capture.cf-desk .cf-phone-go[hidden] { display: none; }
html[data-layout="clean"] .capture.cf-desk .cf-phone-go svg { width: 18px; height: 18px; }
html[data-layout="clean"] .capture.cf-desk .cf-phone-go:disabled { opacity: 0.6; cursor: default; }
html[data-layout="clean"] .capture.cf-desk .cf-phone-done {
  margin: 0; font-size: 15.5px; line-height: 1.4; color: var(--ink-2);
}
html[data-layout="clean"] .capture.cf-desk .cf-phone-done:empty { display: none; }
html[data-layout="clean"] .capture.cf-desk .cf-phone-done.is-bad { color: var(--accent-deep); }

@media (min-width: 1320px) {
  html[data-layout="clean"] .capture.cf-desk .cf-phone {
    position: absolute; top: 72px; right: 24px; width: 270px; margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-layout="clean"] .capture.cf-desk .rec-btn.armed { animation: none; }
  html[data-layout="clean"] .capture.cf-desk .cf-voice { transition: none; }
}
