/* ==========================================================================
   WorkBuddy / macOS 3-Pane Multimodal Creation Studio (/studio)
   Apple Design Principles · CRAP · Don't Make Me Think
   ========================================================================== */

body.page-studio {
  background: #ececef;
}

.page-studio .site-main {
  padding: 14px 16px 28px;
}

.wb-app-frame {
  max-width: 1420px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.09),
    0 4px 16px rgba(0, 0, 0, 0.04);
}

/* macOS Native Window Titlebar */
.wb-studio-topbar {
  height: 50px;
  padding: 0 18px;
  background: linear-gradient(180deg, #fafafa 0%, #f2f2f5 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wb-studio-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.wb-studio-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wb-studio-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -0.015em;
  margin: 0;
  white-space: nowrap;
}

.wb-studio-sep {
  color: #c7c7cc;
  font-size: 13px;
}

.wb-studio-active-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 980px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: #0f766e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.wb-studio-topbar-center {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6e6e73;
  white-space: nowrap;
}

.wb-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 980px;
  background: rgba(15, 118, 110, 0.09);
  color: #0f766e;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
}

.wb-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
}

.wb-studio-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* 3-Pane WorkBuddy Desktop Shell */
.studio-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h) - 110px);
  background: #ffffff;
}

/* Pane 1: Compact Frosted macOS Sidebar (All 11 Experts Visible Above Fold) */
.studio-sidebar {
  background: #f5f5f7;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.studio-tool-group {
  display: grid;
  gap: 1.5px;
}

.studio-tool-group-label {
  margin: 3px 9px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #86868b;
}

.studio-tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1d1d1f;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease, color 0.14s ease;
}

.studio-tool-item:hover {
  background: rgba(0, 0, 0, 0.045);
}

.studio-tool-item.is-active {
  background: #ffffff;
  color: #0f766e;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
}

.studio-tool-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.studio-tool-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(15, 118, 110, 0.09);
  color: #0f766e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.studio-tool-item.is-active .studio-tool-ico {
  background: #0f766e;
  color: #ffffff;
}

.studio-tool-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-tool-item.is-active .studio-tool-name {
  font-weight: 680;
}

.studio-tool-cost {
  font-size: 11px;
  font-weight: 600;
  color: #86868b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}

.studio-tool-item.is-active .studio-tool-cost {
  color: #0f766e;
}

.studio-side-foot {
  margin-top: auto;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11.5px;
  color: #6e6e73;
  line-height: 1.5;
}

.studio-side-foot strong {
  display: block;
  font-size: 12px;
  color: #1d1d1f;
  margin-bottom: 2px;
}

/* Panes 2 & 3: Seamless WorkBuddy Split Canvas */
.studio-workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.studio-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  flex: 1;
  align-items: stretch;
}

.studio-stage[hidden],
[data-tool-panel][hidden],
[data-tab-panel][hidden],
.watermark-bar[hidden],
.result-toolbar[hidden],
.form-error[hidden] {
  display: none !important;
}

/* Pane 2: Center Command & Inspector */
.studio-input-pane {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.07);
  min-width: 0;
}

.wb-tool-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.wb-tool-head-main {
  min-width: 0;
}

.wb-tool-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wb-tool-title-row h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

.wb-tool-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #6e6e73;
  line-height: 1.5;
}

.wb-tool-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.studio-form-body {
  padding: 18px 22px 20px;
  flex: 1;
  display: grid;
  gap: 14px;
  align-content: start;
}

.studio-stack {
  display: grid;
  gap: 14px;
}

.studio-input-pane .form-group label {
  font-size: 12.5px;
  font-weight: 620;
  color: #424245;
}

.studio-input-pane .form-input,
.studio-input-pane .form-select,
.studio-input-pane .form-textarea {
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 12px;
  font-size: 14px;
  padding: 10px 13px;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.studio-input-pane .form-textarea {
  min-height: 118px;
}

.studio-input-pane .form-input:focus,
.studio-input-pane .form-select:focus,
.studio-input-pane .form-textarea:focus {
  background: #ffffff;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}

/* Command Action Dock */
.wb-tool-dock {
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafafa;
  display: grid;
  gap: 8px;
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.studio-actions .btn-primary {
  background: #1d1d1f;
  border-color: #1d1d1f;
  min-height: 42px;
  padding: 0 20px;
  font-size: 14px;
}

.studio-actions .btn-primary:hover {
  background: #0f766e;
  border-color: #0f766e;
}

/* Pane 3: Right Live Multimodal Canvas */
.studio-output-pane {
  display: flex;
  flex-direction: column;
  background: #fafafc;
  min-width: 0;
}

.result-box {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
}

.result-box-head {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-head-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: #1d1d1f;
}

.result-head-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f766e;
}

.result-head-meta {
  font-size: 11.5px;
  font-weight: 600;
  color: #0f766e;
  background: #eefaf8;
  padding: 3px 10px;
  border-radius: 980px;
}

.result-box-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Rich Default Live Preview inside Canvas */
.wb-preview-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.wb-preview-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #111315;
  border: 1px solid rgba(0, 0, 0, 0.08);
  aspect-ratio: 16 / 9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.wb-preview-stage img,
.wb-preview-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wb-preview-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 980px;
  background: rgba(29, 29, 31, 0.78);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.wb-preview-audio {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}

.wb-preview-audio audio {
  width: 100%;
  height: 36px;
  display: block;
}

.wb-preview-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wb-preview-spec {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  padding: 11px 13px;
}

.wb-preview-spec span {
  display: block;
  font-size: 11px;
  color: #86868b;
  margin-bottom: 2px;
}

.wb-preview-spec strong {
  font-size: 14.5px;
  font-weight: 700;
  color: #1d1d1f;
  font-variant-numeric: tabular-nums;
}

.wb-preview-flow {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
}

.wb-preview-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 650;
  color: #0f766e;
}

.wb-preview-flow ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.wb-preview-flow li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #424245;
}

.wb-preview-flow li i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.wb-preview-note {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: #86868b;
  flex-wrap: wrap;
}

/* Live Result Styles */
.studio-empty {
  display: grid;
  place-items: center;
  min-height: 200px;
  text-align: center;
  color: #6e6e73;
  font-size: 14px;
  padding: 20px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  background: #ffffff;
}

.result-media-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #111315;
}

.result-media-frame img,
.result-media-frame video {
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  display: block;
}

.result-media-frame audio,
.result-box-body > audio {
  width: 100%;
}

.watermark-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  background: #1d1d1f;
  color: #d1d5db;
  font-size: 11.5px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.watermark-bar strong {
  color: #5eead4;
  font-weight: 600;
}

.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
}

/* Upload Dropzones & Chips */
.upload-dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 22px 16px;
  border: 1.5px dashed rgba(0, 0, 0, 0.16);
  border-radius: 14px;
  background: #f5f5f7;
  color: #424245;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover,
.upload-dropzone:focus-within {
  border-color: #0f766e;
  background: #eefaf8;
}

.upload-dropzone strong { color: #1d1d1f; font-size: 13.5px; }
.upload-dropzone span, .upload-hint { color: #6e6e73; font-size: 12px; }
.upload-dropzone input[type="file"] {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);
}

.upload-preview,
.upload-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.upload-thumb {
  width: 96px; height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

.upload-file-name { font-size: 12px; color: #424245; }

.keyframe-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scroll-snap-type: x mandatory;
}

.keyframe-strip img,
.keyframe-strip .keyframe {
  flex: none; width: 112px; height: 64px;
  object-fit: cover; border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08); background: #1d1d1f;
  scroll-snap-align: start;
}

.keyframe-strip figcaption { font-size: 11px; color: #6e6e73; text-align: center; }

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-chip {
  padding: 6px 12px;
  border-radius: 980px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #f5f5f7;
  color: #424245;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover,
.preset-chip.is-active {
  background: #1d1d1f;
  border-color: #1d1d1f;
  color: #ffffff;
}

.choice-list { display: grid; gap: 8px; }
.choice-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #f5f5f7;
  cursor: pointer;
}
.choice-row:has(input:checked) {
  background: #eefaf8;
  border-color: rgba(15, 118, 110, 0.35);
}
.choice-row small { display: block; color: #6e6e73; font-size: 12px; }

.studio-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  display: inline-block;
  margin-right: 6px;
  vertical-align: -2px;
  animation: studio-spin 0.7s linear infinite;
}

@keyframes studio-spin { to { transform: rotate(360deg); } }

.prob-wrap { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 16px; align-items: center; }
.prob-gauge { width: 112px; height: 112px; border-radius: 50%; background: conic-gradient(var(--emerald-700) calc(var(--p) * 1%), #e8e8ed 0); display: grid; place-items: center; }
.prob-gauge span { width: 82px; height: 82px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; line-height: 1.15; }
.prob-gauge b { font-size: 26px; letter-spacing: -0.04em; }
.prob-gauge small { color: #86868b; font-size: 11px; }
.compare-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare-pair figure { margin: 0; }
.compare-pair figcaption { font-size: 12px; color: #6e6e73; margin-bottom: 6px; }
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.score-note { margin: 4px 0 0; color: #6e6e73; font-size: 12px; }

.video-progress-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.video-progress-steps {
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.video-step {
  flex: 1;
  text-align: center;
  padding: 6px 8px;
  border-radius: 980px;
  background: #f5f5f7;
  font-size: 12px;
  font-weight: 600;
  color: #6e6e73;
}

.video-progress-card[data-status="queued"] [data-step="queued"],
.video-progress-card[data-status="in_progress"] [data-step="in_progress"],
.video-progress-card[data-status="completed"] [data-step="completed"] {
  background: #1d1d1f;
  color: #ffffff;
}

.studio-tool-jump {
  display: none;
  padding: 14px 16px 0;
}

.wb-studio-seal-wrap {
  max-width: 1420px;
  margin: 14px auto 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.07);
}

@media (max-width: 1120px) {
  .wb-studio-topbar-center { display: none; }
  .studio-shell { grid-template-columns: 1fr; }
  .studio-sidebar { display: none; }
  .studio-tool-jump { display: grid; }
  .studio-stage { grid-template-columns: 1fr; }
  .studio-input-pane { border-right: 0; border-bottom: 1px solid rgba(0, 0, 0, 0.07); }
}

@media (max-width: 680px) {
  .page-studio .site-main { padding: 8px 10px 20px; }
  .wb-studio-topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .wb-preview-specs, .prob-wrap, .compare-pair, .score-grid { grid-template-columns: 1fr; }
}
