/* =========================================================
   CloseBy — layout & components
   (works on top of style.css: reuses its tokens, restyles chrome)
   ========================================================= */

/* ---------- base bits ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 300;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px;
  font-family: var(--font-mono); font-size: 0.75rem; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  gap: 18px;
  padding: 12px 24px;
  background: rgba(253, 251, 247, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(28, 27, 24, 0.06);
}

.brand { gap: 12px; min-width: 0; }

.brand-mark {
  width: 46px;
  height: 42px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: block;
  overflow: visible;
  object-fit: contain;
}

.brand-title {
  font-size: 1.5rem;
  letter-spacing: -0.035em;
}

.brand-tagline { letter-spacing: 0.2em; }

.topbar-controls { gap: 12px; }

.segmented {
  border-width: 2px;
  border-radius: 999px;
  background: var(--bg-linen);
  padding: 3px;
  box-shadow: 2px 2px 0 var(--ink);
}

.seg-btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.seg-btn.active { background: var(--ink); color: var(--bg-panel); }

.seg-note {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  opacity: 0.7;
}

.segmented-sm .seg-btn { padding: 5px 9px; font-size: 0.78rem; }
.segmented-sm { box-shadow: none; border-width: 1.5px; }

.btn { border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- workspace ---------- */
.workspace {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 24px;
  max-width: 1320px;
  padding: 0 24px;
  margin: 22px auto 0;
}

.studio-left,
.studio-right { min-width: 0; }

.card { border-radius: 18px; padding: 16px 18px; box-shadow: 5px 5px 0 var(--ink); }

/* ---------- viewfinder ---------- */
.viewfinder-card { padding: 0; overflow: hidden; }

.viewfinder-toolbar {
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--bg-panel);
  padding: 10px 14px;
  gap: 10px;
}

.viewfinder-toolbar .mono-label { color: rgba(253, 251, 247, 0.72); margin-bottom: 4px; }

.viewfinder-toolbar .mini-seg {
  background: rgba(253, 251, 247, 0.12);
  border-color: rgba(253, 251, 247, 0.45);
}

.viewfinder-toolbar .mini-seg-btn { color: var(--bg-panel); }
.viewfinder-toolbar .mini-seg-btn.active { background: var(--bg-panel); color: var(--ink); }

.viewfinder-toolbar .btn-mini {
  background: transparent;
  color: var(--bg-panel);
  border-color: rgba(253, 251, 247, 0.55);
  box-shadow: none;
}

.viewfinder-toolbar .btn-mini.active {
  background: var(--bg-panel);
  color: var(--ink);
  border-color: var(--bg-panel);
}

.toolbar-right { margin-left: auto; }

.viewfinder-stage {
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  margin: 0;
  box-shadow: none;
}

.capture-bar { padding: 14px 16px 16px; margin: 0; gap: 10px; }
.capture-bar .btn { flex: 1 1 120px; min-height: 52px; }
.capture-bar .btn-coral { flex: 1.4 1 160px; }

/* ---------- dock ---------- */
.custom-dock { padding: 0; overflow: hidden; background: var(--bg-panel); }

.dock-tabs {
  border-bottom: 2px solid var(--ink);
  background: #F1ECE3;
  gap: 0;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.dock-tabs::-webkit-scrollbar { display: none; }

.dock-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-right: 1.5px solid rgba(28, 27, 24, 0.18);
  border-radius: 0;
  background: transparent;
  color: var(--ink-muted);
  padding: 12px 6px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.dock-tab:last-child { border-right: 0; }
.dock-tab .ic { width: 16px; height: 16px; }
.dock-tab.active { background: var(--ink); color: var(--bg-panel); }
.tab-mini { display: none; }

.dock-panel { padding: 16px 18px; }

/* ---------- duo bar ---------- */
.duo-bar { background: var(--bg-panel); }
.peer-status { border-radius: 999px; }

/* ---------- right column ---------- */
.preview-header { margin-bottom: 10px; gap: 8px; align-items: flex-start; }
.section-heading { font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; }
.preview-actions { gap: 8px; }

.live-preview-box {
  padding: 26px 16px 20px;
  border-radius: 20px;
  background-color: #EFEAE1;
  scroll-margin-top: 70px;
}

.stage-zoom {
  display: none;
  position: absolute; right: 10px; top: 8px; z-index: 6;
  align-items: center; gap: 4px;
  padding: 5px 9px;
  border: 1.5px solid var(--ink); border-radius: 8px;
  background: var(--coral); color: #fff;
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--ink);
}
.stage-zoom .ic { width: 13px; height: 13px; }

.backing-stage { padding: 14px; }

/* the strip is the star of the right column */
.photo-strip { width: 296px; }

.strips-wrapper { gap: 14px; }

/* 8-shot double strip: widen the preview column and keep both parts side by side */
.workspace.eight { grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr); }
.strips-wrapper.double { flex-wrap: nowrap; align-items: flex-start; }
.strips-wrapper.double .photo-strip { width: 100%; min-width: 0; }
.strips-wrapper.double .row-lyric-caption { font-size: 1.02rem; }

.strip-slots { gap: 6px; }

.row-lyric-caption {
  font-family: var(--font-script);
  font-weight: 700;
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.05;
  text-align: center;
  margin: 4px 0 2px;
  opacity: 0.92;
}

.photo-slot { border-radius: 9px; }

.slot-upload-pill,
.slot-retake-badge { font-size: 0.6rem; }

.row-lyric-caption {
  font-family: var(--font-script);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  margin-top: 6px;
  opacity: 0.9;
}

/* ---------- metadata ---------- */
.metadata-card { margin-top: 16px; }
.meta-grid { gap: 12px; }
.meta-note-row { margin-top: 12px; }

.input-mono {
  border-width: 2px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.86rem;
}

.input-script {
  border-width: 2px;
  border-radius: 10px;
  font-size: 1.4rem;
  padding: 6px 12px;
}

/* ---------- export ---------- */
.export-bar { display: flex; gap: 10px; margin-top: 14px; }
.export-bar .btn { min-height: 52px; }
.export-bar .btn-dark { flex: 0 0 38%; }

/* ---------- handoff ---------- */
.handoff-card { border-radius: 16px; background: #FBE9E3; border-width: 2px; box-shadow: 4px 4px 0 var(--ink); }

/* ---------- dispenser ---------- */
.dispenser-box { text-align: left; }
.dispenser-head h3 { font-size: 0.78rem; letter-spacing: 0.06em; }
.dispenser-head { gap: 10px; }
.dispenser-head .btn-mini { flex: none; }
.dispenser-chute { border-radius: 10px; }
.dispenser-actions { flex-wrap: wrap; }
.dispenser-actions .btn { flex: 1 1 140px; }

/* ---------- footer ---------- */
.site-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 26px auto 0;
  padding: 0 20px 44px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9A9286;
  text-align: center;
}

/* ---------- phone chrome (hidden on desktop) ---------- */
.mbar,
.thumbbar { display: none; }

/* ---------- viewfinder overrides (on top of style.css) ---------- */
.viewfinder-stage {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  background: #17150F;
}

.vf-cue-banner {
  left: 12px;
  right: 12px;
  bottom: 10px;
  max-width: none;
  transform: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 12px;
  border-width: 2px;
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  background: rgba(253, 251, 247, 0.97);
}

.cue-script {
  font-size: 1.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cue-slot-tag { font-size: 0.58rem; }

.camera-fallback {
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.08), transparent 60%),
    #262420;
  gap: 6px;
  padding: 18px;
}

.camera-fallback span { max-width: 30ch; font-size: 0.8rem; }

/* a camera-off stage shouldn't dominate the page */
.viewfinder-stage.camera-off { aspect-ratio: 16 / 10; min-height: 0; }
.viewfinder-stage.camera-off.split-layout { aspect-ratio: 16 / 10; }

.pane-badge {
  background: rgba(253, 251, 247, 0.94);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  font-weight: 800;
}

/* both halves must fill their pane exactly (local video, demo canvas, live canvas) */
.vf-feeds { display: flex; gap: 0; }
.vf-pane { position: relative; flex: 1 1 50%; display: block; min-width: 0; }
.vf-pane > video,
.vf-pane > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vf-pane > canvas.hidden,
.vf-pane > video.hidden { display: none; }

/* the real room must reach the glass, so the panes stay transparent */
.vf-pane,
.vf-feeds,
.vf-pane > video,
.vf-pane > canvas { background: transparent; }

.row-lyric-caption {
  font-family: var(--font-script);
  font-style: italic;
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.05;
  text-align: center;
  margin: 5px 0 3px;
  opacity: 0.92;
}
.vf-feeds.split-active .vf-pane:first-child { border-right: 2px solid rgba(253, 251, 247, 0.55); }

/* keep the cursor honest on the strip slots */
.photo-slot { cursor: pointer; }

/* camera state chip in the dark toolbar */
.cam-status {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 800;
  letter-spacing: 0.1em; padding: 4px 8px;
  border: 1.5px solid rgba(253, 251, 247, 0.4); border-radius: 999px;
  color: rgba(253, 251, 247, 0.75); white-space: nowrap;
}
.cam-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #A8A29A; flex: none; }
.cam-status.ok { color: #B9F3CD; border-color: rgba(185, 243, 205, 0.5); }
.cam-status.ok::before { background: #45C46B; box-shadow: 0 0 0 3px rgba(69, 196, 107, 0.22); }
.cam-status.warn { color: #FFD9A0; border-color: rgba(255, 217, 160, 0.45); }
.cam-status.warn::before { background: #F0A33B; }
