.ws-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-width: 0;
  max-width: 100%;
}

.ws-tabs {
  display: flex;
  gap: 2px;
  padding: 0 4px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary, #f8f9fa);
  flex-shrink: 0;
}

.ws-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text-secondary, #6b7280);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.ws-tab:hover {
  color: var(--text-primary, #111);
}

.ws-tab.active {
  color: var(--accent, #6366f1);
  border-bottom-color: var(--accent, #6366f1);
}

.ws-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ws-tab-badge {
  font-size: 11px;
  background: var(--bg-tertiary, #e5e7eb);
  color: var(--text-secondary, #6b7280);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.ws-tab.active .ws-tab-badge {
  background: var(--accent, #6366f1);
  color: #fff;
}

.ws-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.ws-pane {
  display: none;
}

.ws-pane.active {
  display: block;
}

.ws-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Studio is also rendered inside the Portal app shell. Keep its flexible
   children shrinkable on phone widths instead of letting long labels establish
   a desktop-sized intrinsic width. */
.studio-panel,
.studio-panel .ws-container,
.studio-panel #studioBody,
.studio-panel #studioArchiveSearchResults {
  min-width: 0;
  max-width: 100%;
}
.studio-panel .studio-heading {
  flex: 1 1 220px;
  min-width: 0;
}
.studio-panel .ws-search,
.studio-panel .ws-search-wrap {
  min-width: 0;
  max-width: 100%;
}
.studio-panel .ws-search-wrap { flex: 1 1 220px; }

.ws-search {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
  outline: none;
  transition: border-color 0.15s;
}

.ws-search:focus {
  border-color: var(--accent, #6366f1);
}

.ws-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.ws-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-tertiary, #9ca3af);
  pointer-events: none;
}

.ws-filter-btn {
  padding: 7px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  color: var(--text-secondary, #6b7280);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.ws-filter-btn:hover,
.ws-filter-btn.active {
  border-color: var(--accent, #6366f1);
  color: var(--accent, #6366f1);
  background: rgba(99, 102, 241, 0.06);
}

.ws-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent, #6366f1);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.ws-action-btn:hover {
  opacity: 0.9;
}

.ws-action-btn svg {
  width: 14px;
  height: 14px;
}

.ws-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary, #9ca3af);
}

.ws-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-tertiary, #9ca3af);
  opacity: 0.5;
}

.ws-empty h3 {
  font-size: 16px;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 6px;
  font-weight: 600;
}

.ws-empty p {
  font-size: 13px;
  margin: 0;
}

.ws-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--bg-primary, #fff);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.ws-card:hover {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.ws-card.pinned {
  border-left: 3px solid var(--accent, #6366f1);
}

.ws-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-tertiary, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.ws-card-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary, #f3f4f6);
  position: relative;
}
.ws-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.ws-card-cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 0;
}
.ws-card-cover[style*="background:linear-gradient"] .ws-card-cover-fallback {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.ws-fav-card .ws-card-cover {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}
@media (max-width: 480px) {
  .ws-card-cover { width: 48px; height: 48px; }
  .ws-fav-card .ws-card-cover { width: 40px; height: 40px; }
}

.ws-card-body {
  flex: 1;
  min-width: 0;
}

.ws-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #111);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary, #9ca3af);
}

.ws-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.ws-card-preview {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
  align-self: center;
}

.ws-card:hover .ws-card-actions {
  opacity: 1;
}

.ws-card-action {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}

.ws-card-action:hover {
  background: var(--bg-tertiary, #f3f4f6);
  color: var(--accent, #6366f1);
}

.ws-card-action.danger:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.ws-card-action svg {
  width: 14px;
  height: 14px;
}

.ws-card-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
  text-transform: capitalize;
  flex-shrink: 0;
  align-self: center;
}

.ws-card-status.active { background: #dcfce7; color: #16a34a; }
.ws-card-status.completed { background: #dbeafe; color: #2563eb; }
.ws-card-status.draft { background: #fef3c7; color: #d97706; }
.ws-card-status.archived { background: #f3f4f6; color: #6b7280; }

.ws-project-color {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  position: absolute;
  left: 0;
  top: 0;
}

.ws-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary, #9ca3af);
  margin: 16px 0 8px;
  padding: 0 2px;
}

.ws-fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.ws-fav-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--bg-primary, #fff);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ws-fav-card:hover {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.ws-fav-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-tertiary, #f3f4f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ws-fav-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.ws-fav-remove {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-tertiary, #9ca3af);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.ws-fav-card:hover .ws-fav-remove {
  opacity: 1;
}

.ws-fav-remove:hover {
  color: #ef4444;
}

.ws-fav-remove svg {
  width: 14px;
  height: 14px;
}

.ws-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ws-history-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border, #e5e7eb);
  color: var(--text-secondary, #6b7280);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ws-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  color: var(--text-primary, #111);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.ws-history-table tr:hover td {
  background: var(--bg-secondary, #f8f9fa);
}

.ws-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}

.ws-status-dot.success { background: #16a34a; }
.ws-status-dot.error { background: #ef4444; }
.ws-status-dot.pending { background: #d97706; }

.ws-load-more {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  border: 1px dashed var(--border, #e5e7eb);
  border-radius: 8px;
  background: none;
  color: var(--text-secondary, #6b7280);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.ws-load-more:hover {
  border-color: var(--accent, #6366f1);
  color: var(--accent, #6366f1);
}

.ws-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: wsModalFadeIn 0.15s ease forwards;
}

@keyframes wsModalFadeIn {
  to { opacity: 1; }
}

.ws-modal {
  background: var(--bg-primary, #fff);
  border-radius: 12px;
  padding: 24px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.ws-modal h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text-primary, #111);
}

.ws-modal-field {
  margin-bottom: 12px;
}

.ws-modal-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 4px;
}

.ws-modal-field input,
.ws-modal-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #111);
  outline: none;
  box-sizing: border-box;
}

.ws-modal-field input:focus,
.ws-modal-field textarea:focus {
  border-color: var(--accent, #6366f1);
}

.ws-modal-colors {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.ws-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
}

.ws-color-swatch:hover,
.ws-color-swatch.active {
  border-color: var(--text-primary, #111);
  transform: scale(1.1);
}

.ws-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.ws-modal-actions button {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.ws-modal-cancel {
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-primary, #fff);
  color: var(--text-secondary, #6b7280);
}

.ws-modal-submit {
  border: none;
  background: var(--accent, #6366f1);
  color: #fff;
}

[data-theme="dark"] .ws-tabs {
  background: var(--pub-card-bg, #1e1e2e);
}

[data-theme="dark"] .ws-card,
[data-theme="dark"] .ws-fav-card {
  background: var(--pub-card-bg, #1e1e2e);
  border-color: var(--pub-border, #2e2e3e);
}

[data-theme="dark"] .ws-card:hover,
[data-theme="dark"] .ws-fav-card:hover {
  border-color: var(--accent, #818cf8);
}

[data-theme="dark"] .ws-card-icon,
[data-theme="dark"] .ws-fav-icon {
  background: rgba(255,255,255,0.06);
}

[data-theme="dark"] .ws-search {
  background: var(--pub-card-bg, #1e1e2e);
  border-color: var(--pub-border, #2e2e3e);
  color: var(--pub-text, #e0e0e0);
}

[data-theme="dark"] .ws-filter-btn {
  background: var(--pub-card-bg, #1e1e2e);
  border-color: var(--pub-border, #2e2e3e);
  color: var(--pub-text, #e0e0e0);
}

/* Keep Studio's primary actions clear of the fixed profile/credits controls. */
.studio-panel .studio-primary-toolbar {
  padding-inline-end: 190px;
}

.studio-panel #studioBody,
.studio-panel #studioBody * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.studio-panel #studioBody img,
.studio-panel #studioBody video,
.studio-panel #studioBody audio,
.studio-panel #studioBody canvas {
  max-width: 100%;
}

.studio-content-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 10px 0;
}
.studio-content-toolbar select { flex: 0 1 170px; min-width: 0; }
.studio-calendar { min-width: 0; }
.studio-calendar-title { font-weight: 700; font-size: 16px; margin: 10px 0 8px; }
.studio-calendar-weekdays,
.studio-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.studio-calendar-weekdays > div { color: var(--text-secondary, #6b7280); font-size: 11px; font-weight: 600; text-align: center; }
.studio-calendar-day {
  min-height: 112px; padding: 5px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 7px; background: var(--bg-primary, #fff); overflow: hidden;
}
.studio-calendar-day.is-empty { background: transparent; border-color: transparent; }
.studio-calendar-number { font-size: 11px; color: var(--text-secondary, #6b7280); margin-bottom: 3px; }
.studio-calendar-card { padding: 5px; margin: 3px 0; border-radius: 5px; background: rgba(99,102,241,.08); font-size: 11px; overflow-wrap: anywhere; }
.studio-calendar-card strong { display: block; font-size: 12px; }
.studio-calendar-rubric { margin-top: 2px; color: #cbd5e1; font-size: 10px; }
.studio-calendar-status { display: inline-block; margin-top: 3px; padding: 1px 5px; border-radius: 5px; font-size: 10px; }
.studio-calendar-status.status-published { background: rgba(22,163,74,.18); color: #16a34a; }
.studio-calendar-status:not(.status-published) { background: rgba(99,102,241,.16); color: var(--accent, #6366f1); }
.studio-calendar-meta { color: var(--text-secondary, #6b7280); margin-top: 3px; }
.studio-content-link { border: 0; padding: 0; background: none; color: var(--accent, #6366f1); cursor: pointer; font: inherit; text-align: start; }
.studio-content-scenario-open { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.studio-calendar-actions { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.studio-calendar-actions .ws-filter-btn { padding: 3px 5px; font-size: 10px; }
.studio-calendar-undated { margin-top: 10px; padding: 8px; border: 1px dashed var(--border, #e5e7eb); border-radius: 7px; }
.studio-calendar-undated > .studio-calendar-card { display: inline-block; vertical-align: top; width: min(260px, 100%); margin: 6px 6px 0 0; }
[data-theme="dark"] .studio-calendar-day { background: var(--pub-card-bg, #1e1e2e); border-color: var(--pub-border, #2e2e3e); }
[data-theme="dark"] .studio-calendar-card { background: rgba(129,140,248,.14); }
[data-theme="dark"] .studio-calendar-status.status-published { color: #4ade80; }

.studio-start-here {
  border: 1px solid rgba(127,127,127,.3);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 18px;
  color: #f3f4f6;
}

.studio-start-here-description {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 10px;
}

.studio-project-surface {
  background: rgba(3, 12, 30, .86);
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 12px;
  color: #e5e7eb;
  padding: 14px;
}

/* Neo Studio S03–S09 working area */
.neo-studio-workspace {
  margin: 12px 0 18px;
  padding: 22px;
  border: 1px solid rgba(125, 155, 215, .28);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(13, 28, 57, .96), rgba(18, 35, 68, .92));
  color: #e7eefb;
}
.neo-studio-workspace h2, .neo-studio-workspace h3 { margin: 0; color: #f6f8fd; }
.neo-studio-workspace p { color: #aebed8; line-height: 1.55; }
.neo-studio-workspace-head { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; }
.neo-eyebrow, .neo-card-kicker { color:#7fa9e6; font-size:10px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
.neo-save-state { border-radius:99px; padding:7px 10px; font-size:11px; white-space:nowrap; }
.neo-save-state.saved { color:#9dd7bd; background:rgba(74, 174, 125, .14); }
.neo-save-state.saving { color:#f2ca8c; background:rgba(222, 160, 70, .14); }
.neo-save-state.conflict { color:#ffb1a8; background:rgba(219, 83, 75, .16); }
.neo-studio-flow { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:22px 0 18px; padding-bottom:14px; border-bottom:1px solid rgba(162, 185, 222, .18); }
.neo-studio-flow button { border:0; border-bottom:2px solid transparent; padding:7px 3px; background:none; color:#91a5c5; cursor:pointer; font:inherit; font-size:12px; }
.neo-studio-flow button:hover, .neo-studio-flow button.active { color:#f1f5ff; border-bottom-color:#7fa9e6; }
.neo-studio-flow-arrow { color:#526986; font-size:11px; }
.neo-studio-workspace-body { min-width:0; }
.neo-overview-grid { display:grid; grid-template-columns:1.25fr 1fr 1fr; gap:10px; }
.neo-overview-grid article { min-height:150px; padding:17px; border:1px solid rgba(149, 176, 219, .2); border-radius:12px; background:rgba(255,255,255,.035); }
.neo-overview-grid h3 { margin-top:8px; }
.neo-editor-head, .neo-editor-footer, .neo-scene-picker { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.neo-revision, .neo-muted { color:#91a5c5; font-size:12px; }
.neo-script-editor { display:block; width:100%; min-height:360px; box-sizing:border-box; margin:16px 0; padding:18px; resize:vertical; border:1px solid rgba(149,176,219,.28); border-radius:12px; background:#101f3d; color:#eaf0fb; font:16px/1.7 Georgia, serif; outline:none; }
.neo-script-editor:focus, .neo-shot-form input:focus, .neo-shot-form textarea:focus { border-color:#7fa9e6; }
.neo-editor-footer label, .neo-shot-form label, .neo-scene-picker label { display:flex; flex-direction:column; gap:5px; color:#aebed8; font-size:11px; }
.neo-editor-footer input, .neo-scene-picker select, .neo-shot-form input, .neo-shot-form textarea, .neo-scene-picker select { padding:9px 10px; border:1px solid rgba(149,176,219,.28); border-radius:8px; background:#101f3d; color:#eaf0fb; }
.neo-shot-layout { display:grid; grid-template-columns:230px minmax(0,1fr); gap:14px; margin-top:15px; }
.neo-shot-list { display:flex; flex-direction:column; gap:5px; }
.neo-shot-row { display:flex; gap:4px; align-items:stretch; }
.neo-shot-row > button:first-child { flex:1; }
.neo-shot-move { display:flex; flex-direction:column; }
.neo-shot-move button { border:1px solid rgba(149,176,219,.18); background:rgba(255,255,255,.035); color:#9eb4d4; cursor:pointer; }
.neo-edit-fields h4 { margin:18px 0 8px; color:#dce8fa; }
.neo-edit-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:6px 0; padding:9px; border:1px solid rgba(149,176,219,.18); border-radius:8px; background:rgba(255,255,255,.025); color:#b9c9e3; }
.neo-edit-row input { min-width:70px; padding:7px; border:1px solid rgba(149,176,219,.25); border-radius:6px; background:#101f3d; color:#eef4ff; }
.neo-shot-list button { display:flex; gap:10px; align-items:center; padding:11px; text-align:left; border:1px solid rgba(149,176,219,.18); border-radius:9px; background:rgba(255,255,255,.035); color:#b9c9e3; cursor:pointer; }
.neo-shot-list button.active { border-color:#7fa9e6; background:rgba(127,169,230,.14); color:#fff; }
.neo-shot-list b { color:#7fa9e6; font:12px monospace; }
.neo-shot-form { padding:17px; border:1px solid rgba(149,176,219,.22); border-radius:12px; background:rgba(255,255,255,.025); }
.neo-shot-form > label { margin-top:12px; }
.neo-shot-form textarea { min-height:90px; resize:vertical; }
.neo-form-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin-top:12px; }
.neo-frame-strip { display:flex; gap:10px; overflow:auto; margin-top:16px; padding-top:15px; border-top:1px solid rgba(162,185,222,.18); }
.neo-frame-strip article { width:150px; flex:0 0 auto; color:#aebed8; font-size:11px; }
.neo-frame-preview { display:flex; align-items:center; justify-content:center; height:90px; padding:8px; overflow:hidden; border:1px dashed rgba(149,176,219,.3); border-radius:8px; color:#7186a5; text-align:center; }
.neo-assembly-status { margin:16px 0; padding:16px; border-radius:11px; border:1px solid rgba(149,176,219,.24); }
.neo-assembly-status.ready { border-color:rgba(93,190,139,.55); background:rgba(93,190,139,.08); }
.neo-assembly-status.incomplete { border-color:rgba(219,167,79,.45); background:rgba(219,167,79,.07); }
.neo-conflict { margin-top:10px; padding:10px; border-left:3px solid #e78b80; color:#ffc0b8; background:rgba(219,83,75,.1); }
.neo-workspace-empty, .neo-empty-inline { padding:30px 8px; color:#aebed8; }
.neo-handoff-note { margin-top:16px; padding:14px; border-left:3px solid #7fa9e6; background:rgba(127,169,230,.08); color:#c2d2e9; }
.neo-legacy-details { margin-top:12px; padding:10px 14px; border:1px solid rgba(127,127,127,.25); border-radius:10px; }
.neo-legacy-details summary { cursor:pointer; color:var(--text-secondary, #8892a4); font-size:12px; }
.neo-skeleton-line { height:42px; margin:16px 0; border-radius:9px; background:linear-gradient(90deg, rgba(149,176,219,.12), rgba(149,176,219,.25), rgba(149,176,219,.12)); }
@media (max-width:768px) {
  .neo-studio-workspace { padding:15px; padding-bottom:72px; overflow:hidden; }
  .neo-studio-workspace-head { flex-direction:column; }
  .neo-overview-grid, .neo-shot-layout, .neo-form-grid { grid-template-columns:1fr; }
  .neo-studio-flow { overflow:visible; flex-wrap:wrap; padding-bottom:11px; }
  .neo-studio-flow button { flex:1 1 calc(33.333% - 8px); min-width:86px; text-align:left; }
  .neo-studio-flow-arrow { display:none; }
  .neo-editor-footer label, .neo-scene-picker label { min-width:0; width:100%; }
  .neo-editor-footer input, .neo-scene-picker select,
  .neo-shot-form input, .neo-shot-form textarea,
  .neo-edit-row input, .neo-edit-row select { min-width:0; max-width:100%; box-sizing:border-box; }
  .neo-edit-row input, .neo-edit-row select { flex:1 1 130px; }
  .neo-frame-strip { flex-wrap:wrap; overflow:visible; }
}

.studio-project-surface h1,
.studio-project-surface h2,
.studio-project-surface h3,
.studio-project-surface h4,
.studio-project-surface strong {
  color: #f3f4f6;
}

.studio-project-surface .studio-calendar-day {
  background: rgba(15, 23, 42, .88);
  border-color: rgba(148, 163, 184, .25);
  color: #e5e7eb;
}

.studio-project-surface .studio-calendar-number,
.studio-project-surface .studio-calendar-meta,
.studio-project-surface .studio-calendar-weekdays > div {
  color: #cbd5e1;
}

.studio-pro-canvas-edges {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(127,127,127,.3);
  border-radius: 8px;
}

.studio-pro-canvas-limit {
  margin: 8px 0 12px;
  padding: 8px 10px;
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, .1);
  color: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.studio-pro-canvas-source-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid rgba(245, 158, 11, .45);
  border-radius: 8px;
  background: rgba(245, 158, 11, .08);
}

.studio-chain-draft-approval {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(99, 102, 241, .45);
  border-radius: 9px;
  background: rgba(99, 102, 241, .1);
}

.studio-chain-draft-ids,
.studio-chain-draft-safety {
  margin: 6px 0;
  font-size: 12px;
  opacity: .72;
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .studio-pro-canvas-source-warning {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Connected Studio: compact controls remain legible during long sessions. */
.neo-workspace-links {
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  margin:0 0 14px;
  padding:8px 10px;
  border:1px solid rgba(149,176,219,.18);
  border-radius:9px;
  background:rgba(255,255,255,.025);
}
.neo-workspace-links span { color:#91a5c5; font-size:11px; text-transform:uppercase; letter-spacing:.08em; margin-right:4px; }
.neo-workspace-links button {
  border:1px solid rgba(149,176,219,.28);
  border-radius:7px;
  padding:6px 9px;
  background:#101f3d;
  color:#dce8fa;
  cursor:pointer;
  font:12px inherit;
}
.neo-workspace-links button:hover { border-color:#7fa9e6; color:#fff; }
.neo-world-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.neo-world-actions { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.neo-world-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.neo-world-grid article { padding:14px; border:1px solid rgba(149,176,219,.2); border-radius:11px; background:rgba(255,255,255,.035); }
.neo-world-list { display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.neo-world-item { display:flex; gap:10px; align-items:center; padding:9px; border-radius:8px; background:rgba(16,31,61,.72); }
.neo-world-item img,.neo-world-item-fallback { width:48px; height:48px; flex:0 0 48px; border-radius:8px; object-fit:cover; background:rgba(127,169,230,.16); }
.neo-world-item-fallback { display:grid; place-items:center; color:#dce8fa; font-weight:700; }
.neo-world-item > div { min-width:0; display:flex; flex-direction:column; gap:3px; }
.neo-world-item strong { color:#f1f5ff; flex:0 0 auto; }
.neo-world-item span { color:#b9c9e3; font-size:12px; overflow-wrap:anywhere; }
.neo-final-video { display:block; width:100%; max-height:360px; margin-top:12px; border-radius:9px; background:#091326; }
.neo-export-links { display:flex; gap:8px; flex-wrap:wrap; margin-top:9px; }
.neo-package-card { margin-top:14px; padding:13px; border:1px dashed rgba(149,176,219,.35); border-radius:10px; background:rgba(127,169,230,.06); }
.neo-package-card p { margin:5px 0 10px; font-size:12px; }
.neo-frame-preview img, .neo-frame-preview video { width:100%; height:100%; object-fit:cover; border-radius:6px; }
.neo-frame-preview audio { width:100%; }
@media (max-width:768px) {
  .neo-world-head { flex-direction:column; }
  .neo-world-actions { justify-content:flex-start; }
  .neo-world-grid { grid-template-columns:1fr; }
  .neo-workspace-links { overflow:visible; flex-wrap:wrap; }
  .neo-workspace-links span { flex:1 0 100%; }
  .neo-workspace-links button { flex:1 1 116px; min-height:34px; }
}

.studio-pro-canvas-edge {
  display: grid;
  grid-template-columns: minmax(100px,1fr) auto minmax(100px,1fr) minmax(140px,1fr) auto auto;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.studio-scenario-detail {
  border: 1px solid rgba(127,127,127,.3);
  border-radius: 8px;
  padding: 12px;
}

.studio-scene-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.studio-scene-table tr {
  border-top: 1px solid rgba(127,127,127,.2);
}

.studio-scene-table td {
  padding: 6px 4px;
}

.studio-scene-index {
  width: 32px;
}

.studio-scene-status {
  white-space: nowrap;
}

[data-theme="dark"] .ws-modal {
  background: var(--pub-card-bg, #1e1e2e);
  border: 1px solid var(--pub-border, #2e2e3e);
}

[data-theme="dark"] .ws-modal-field input,
[data-theme="dark"] .ws-modal-field textarea {
  background: rgba(255,255,255,0.04);
  border-color: var(--pub-border, #2e2e3e);
  color: var(--pub-text, #e0e0e0);
}

[data-theme="dark"] .ws-history-table td {
  border-color: var(--pub-border, #2e2e3e);
}

[data-theme="dark"] .ws-history-table th {
  border-color: var(--pub-border, #2e2e3e);
}

[data-theme="dark"] .ws-card-status.active { background: rgba(22,163,74,0.15); color: #4ade80; }
[data-theme="dark"] .ws-card-status.completed { background: rgba(37,99,235,0.15); color: #60a5fa; }
[data-theme="dark"] .ws-card-status.draft { background: rgba(217,119,6,0.15); color: #fbbf24; }
[data-theme="dark"] .ws-card-status.archived { background: rgba(255,255,255,0.06); color: #9ca3af; }

@media (max-width: 768px) {
  .ws-container {
    /* push tabs below the fixed profile-credits badge (top:8px + ~36px height + gap) */
    padding-top: 52px;
  }

  .ws-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ws-tabs::-webkit-scrollbar {
    display: none;
  }

  .ws-tab {
    padding: 8px 12px;
    font-size: 12px;
  }

  .ws-fav-grid {
    grid-template-columns: 1fr;
  }

  .ws-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  /* Studio shares the Portal top bar on phones. Keep the fixed menu/profile
     controls in their own strip and let every Studio control wrap below it. */
  .studio-panel {
    overflow-x: hidden;
  }
  .studio-panel .ws-content {
    padding: 12px 12px 24px;
  }
  .studio-panel .studio-primary-toolbar {
    padding-inline-end: 0;
    margin-top: 0;
  }
  .studio-panel .studio-heading,
  .studio-panel .ws-toolbar > *,
  .studio-panel .ws-toolbar .ws-search-wrap {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .studio-panel .ws-toolbar .ws-search,
  .studio-panel .ws-toolbar select,
  .studio-panel .ws-toolbar button {
    min-width: 0;
    max-width: 100%;
  }
  .studio-panel .studio-new-project-btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }
  .studio-panel #studioBody textarea,
  .studio-panel #studioBody input,
  .studio-panel #studioBody select,
  .studio-panel #studioBody button {
    max-width: 100%;
    box-sizing: border-box;
  }
  .studio-calendar-weekdays,
  .studio-calendar-day:not(.has-items) { display: none; }
  .studio-calendar-grid { grid-template-columns: 1fr; gap: 8px; }
  .studio-calendar-day { min-height: 0; padding: 8px; }
  .studio-calendar-card { padding: 8px; font-size: 12px; }
  .studio-calendar-card strong { font-size: 13px; }
  .studio-calendar-actions .ws-filter-btn { max-width: 100%; white-space: normal; }
  .studio-pro-canvas-edge {
    grid-template-columns: 1fr;
  }
  .studio-pro-canvas-edge > span {
    text-align: center;
  }
  .studio-scene-table,
  .studio-scene-table tbody,
  .studio-scene-table tr,
  .studio-scene-table td {
    display: block;
    width: 100%;
  }
  .studio-scene-table tr {
    position: relative;
    padding: 10px 0 10px 28px;
  }
  .studio-scene-table td {
    padding: 3px 0;
  }
  .studio-scene-table .studio-scene-index {
    position: absolute;
    inset-inline-start: 0;
    top: 10px;
    width: 22px;
  }
  .studio-scene-table .studio-scene-status {
    white-space: normal;
    color: var(--text-secondary, #6b7280);
  }
  [data-theme="dark"] .studio-scene-table .studio-scene-status {
    color: #c4cad4;
  }
  .studio-scene-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
  }
  .studio-scene-actions .ws-filter-btn {
    width: auto !important;
    max-width: 100%;
    white-space: normal;
  }

  .ws-card-actions {
    opacity: 1;
  }

  .ws-fav-remove {
    opacity: 1;
  }
}

@media (max-width: 430px) {
  .studio-panel .ws-tabs {
    gap: 0;
    padding-inline: 0;
  }
  .studio-panel .ws-tab {
    padding-inline: 9px;
    font-size: 11px;
  }
  .studio-panel .ws-content {
    padding-inline: 10px;
  }
}

/* Studio demo safeguards: evidence and media controls remain readable without
   widening the room on a 390px viewport. */
.neo-media-picker select,
.neo-media-picker button,
.neo-media-reason,
.neo-media-unavailable,
.neo-media-warning,
.neo-scene-context,
.neo-saved-audio article {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.neo-media-all-tools > div {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.neo-media-all-tools button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}
.neo-media-all-tools button small,
.neo-scene-context small,
.neo-saved-audio small {
  color: var(--studio-muted, #687786);
  font-size: 11px;
  line-height: 1.35;
}
.neo-scene-context {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--studio-accent, #5368c7);
  border-radius: 8px;
  background: color-mix(in srgb, var(--studio-accent, #5368c7) 8%, transparent);
}
.neo-scene-context span { font-weight: 650; }
.neo-saved-audio {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}
.neo-saved-audio h4 { margin: 0; }
.neo-saved-audio article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--studio-line, #d6dee5);
  border-radius: 9px;
}
.neo-saved-audio article > div { display: grid; gap: 3px; }
.neo-saved-audio audio { width: 100%; }
[data-theme="dark"] .neo-media-all-tools button small,
[data-theme="dark"] .neo-scene-context small,
[data-theme="dark"] .neo-saved-audio small { color: #aebed8; }
@media (max-width: 390px) {
  .studio-panel #studioBody { padding-inline: 10px; }
  .neo-studio-workspace { padding: 9px; }
  .neo-media-card { padding: 11px; }
  .neo-media-actions,
  .neo-media-head,
  .neo-edit-row { align-items: stretch; }
  .neo-media-actions > *,
  .neo-media-picker select { width: 100%; }
  .neo-saved-audio article { padding: 9px; }
}

/* Neo Studio production-room finish. */
.studio-project-surface {
  background: var(--studio-paper, #f3f6f8);
  border-color: var(--studio-line, #d6dee5);
  color: var(--studio-ink, #172331);
  box-shadow: 0 18px 48px rgba(24,42,61,.08);
}
.studio-project-surface h1,.studio-project-surface h2,.studio-project-surface h3,
.studio-project-surface h4,.studio-project-surface strong { color: var(--studio-ink, #172331); }
.studio-season-heading { margin: 18px 0 8px; color: var(--studio-muted, #687786); font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.neo-studio-workspace {
  margin: 0; padding: clamp(15px, 2.2vw, 26px);
  border-color: var(--studio-line, #d6dee5);
  background: radial-gradient(700px 260px at 88% 0%, rgba(83,104,232,.14), transparent 68%), var(--studio-panel, #fff);
  color: var(--studio-ink, #172331); box-shadow: 0 18px 50px rgba(24,42,61,.09);
}
.neo-studio-workspace h2,.neo-studio-workspace h3 { color: var(--studio-ink, #172331); }
.neo-studio-workspace p,.neo-revision,.neo-muted { color: var(--studio-muted, #687786); }
.neo-studio-flow { position: sticky; top: 0; z-index: 3; margin-inline: calc(clamp(15px, 2.2vw, 26px) * -1); padding: 9px clamp(15px, 2.2vw, 26px); background: color-mix(in srgb, var(--studio-panel, #fff) 92%, transparent); backdrop-filter: blur(12px); border-bottom-color: var(--studio-line, #d6dee5); }
.neo-studio-flow button { color: var(--studio-muted, #687786); }
.neo-studio-flow button:hover,.neo-studio-flow button.active { color: var(--studio-accent-deep, #3346a6); border-bottom-color: var(--studio-accent, #5368e8); }
.neo-workspace-links { background: color-mix(in srgb, var(--studio-paper, #f3f6f8) 70%, transparent); border-color: var(--studio-line, #d6dee5); }
.neo-workspace-links span { color: var(--studio-muted, #687786); }
.neo-workspace-links button,.neo-editor-footer input,.neo-scene-picker select,.neo-shot-form input,.neo-shot-form textarea { background: var(--studio-panel, #fff); border-color: var(--studio-line, #d6dee5); color: var(--studio-ink, #172331); }
.neo-overview-grid article,.neo-shot-form,.neo-world-grid article,.neo-frame-preview,.neo-assembly-status { background: color-mix(in srgb, var(--studio-panel, #fff) 88%, var(--studio-paper, #f3f6f8)); border-color: var(--studio-line, #d6dee5); }
.neo-script-editor { background: var(--studio-paper, #f3f6f8); color: var(--studio-ink, #172331); border-color: var(--studio-line, #d6dee5); }
.neo-world-item { background: color-mix(in srgb, var(--studio-paper, #f3f6f8) 82%, transparent); }
.neo-world-item strong,.neo-world-item span { color: var(--studio-ink, #172331); }
.neo-project-advanced { margin-top: 18px; border-top: 1px solid var(--studio-line, #d6dee5); padding-top: 12px; }
.neo-project-advanced summary { cursor: pointer; color: var(--studio-muted, #687786); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.neo-workspace-episode { color: var(--studio-accent-deep, #3346a6); font-size: 12px; font-weight: 700; letter-spacing: .04em; margin-top: 4px; }
.neo-overview-feature { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(220px, .8fr); gap: 14px; align-items: stretch; }
.neo-overview-preview { min-height: 250px; overflow: hidden; border: 1px solid var(--studio-line, #d6dee5); border-radius: 12px; background: #0b1729; }
.neo-overview-preview video,
.neo-overview-preview img { width: 100%; height: 100%; min-height: 250px; display: block; object-fit: cover; }
.neo-overview-preview audio { width: calc(100% - 28px); margin: 108px 14px 0; }
.neo-overview-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: #aebed8; padding: 20px; text-align: center; }
.neo-overview-feature-copy { padding: 18px; border: 1px solid var(--studio-line, #d6dee5); border-radius: 12px; background: color-mix(in srgb, var(--studio-panel, #fff) 88%, var(--studio-paper, #f3f6f8)); }
.neo-overview-feature-copy h3 { margin: 9px 0 8px; }
.neo-overview-support { display: grid; grid-template-columns: .8fr 1.2fr; gap: 14px; margin-top: 14px; }
.neo-overview-support article { padding: 15px; border: 1px solid var(--studio-line, #d6dee5); border-radius: 12px; background: color-mix(in srgb, var(--studio-panel, #fff) 88%, var(--studio-paper, #f3f6f8)); }
.neo-overview-list { display: grid; gap: 7px; margin: 13px 0; }
.neo-overview-list div { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--studio-line, #d6dee5); }
.neo-overview-list span { color: var(--studio-muted, #687786); font-size: 12px; }
.neo-overview-strip { display: flex; gap: 8px; overflow-x: auto; margin: 13px 0; }
.neo-overview-frame { width: 112px; flex: 0 0 112px; }
.neo-overview-frame img,.neo-overview-frame > span { width: 112px; height: 72px; display: flex; align-items: center; justify-content: center; object-fit: cover; border-radius: 7px; background: var(--studio-paper, #f3f6f8); color: var(--studio-muted, #687786); }
.neo-overview-frame small { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--studio-muted, #687786); }
[data-theme="dark"] .studio-project-surface,[data-theme="dark"] .neo-studio-workspace { background: radial-gradient(700px 260px at 88% 0%, rgba(127,169,230,.13), transparent 68%), #0d1a2c; color: #e7eefb; border-color: rgba(149,176,219,.25); }
[data-theme="dark"] .studio-project-surface h1,[data-theme="dark"] .studio-project-surface h2,[data-theme="dark"] .studio-project-surface h3,[data-theme="dark"] .studio-project-surface h4,[data-theme="dark"] .studio-project-surface strong,[data-theme="dark"] .neo-studio-workspace h2,[data-theme="dark"] .neo-studio-workspace h3 { color: #f6f8fd; }
[data-theme="dark"] .neo-studio-flow { background: rgba(13,26,44,.92); border-bottom-color: rgba(149,176,219,.22); }
[data-theme="dark"] .neo-workspace-links button,[data-theme="dark"] .neo-editor-footer input,[data-theme="dark"] .neo-scene-picker select,[data-theme="dark"] .neo-shot-form input,[data-theme="dark"] .neo-shot-form textarea,[data-theme="dark"] .neo-script-editor { background: #101f3d; color: #eaf0fb; border-color: rgba(149,176,219,.28); }
@media (max-width: 768px) {
  .studio-project-surface { padding: 10px; }
  .neo-studio-workspace { padding-bottom: 86px; }
  .neo-studio-flow { top: 0; margin-inline: -15px; padding-inline: 15px; }
  .neo-workspace-links { align-items: stretch; }
  .neo-workspace-links button { flex: 1 1 42%; }
  .neo-overview-feature,.neo-overview-support { grid-template-columns: 1fr; }
  .neo-overview-preview,.neo-overview-preview video,.neo-overview-preview img { min-height: 190px; }
}

@media (max-width: 390px) {
  .studio-panel .ws-tab {
    padding-inline: 7px;
    font-size: 10px;
  }
}

@media (max-width: 375px) {
  .studio-panel .ws-tab {
    padding-inline: 6px;
  }
  .studio-panel .ws-card {
    gap: 8px;
    padding-inline: 10px;
  }
}

/* ── Activity Sessions (real visitor_sessions data) ─────────────────────── */
.ws-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.ws-activity-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--pub-card-bg, #fff);
  border: 1px solid var(--pub-border, #e5e7eb);
  border-radius: 12px;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.ws-activity-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-color: var(--pub-border-hover, #d1d5db);
}

.ws-activity-card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 44px;
}

.ws-activity-device {
  font-size: 22px;
  line-height: 1;
}

.ws-orphan-card {
  cursor: pointer;
  border-style: dashed;
}

/* Dark mode */
[data-theme="dark"] .ws-activity-card {
  background: rgba(255,255,255,0.03);
  border-color: var(--pub-border, #2e2e3e);
}

[data-theme="dark"] .ws-activity-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.12);
}

/* Neo Studio visual system: a quiet edit suite rather than a generic form. */
.studio-panel {
  --neo-ink:#172235; --neo-muted:#667286; --neo-line:#d7dde5; --neo-paper:#f6f8fb; --neo-blue:#315bc7;
  background:radial-gradient(circle at 92% 0%,rgba(217,226,249,.72),transparent 29rem),var(--neo-paper);
}
.studio-panel .ws-container{color:var(--neo-ink)}
.studio-panel .studio-primary-toolbar{align-items:flex-end;padding:26px 28px 18px;margin:0;border-bottom:1px solid var(--neo-line)}
.studio-panel .studio-heading h2{font:700 28px/1.05 Georgia,'Times New Roman',serif!important;letter-spacing:-.035em;color:var(--neo-ink)}
.studio-panel .studio-heading>div{color:var(--neo-muted)}
.studio-panel>.ws-container>.ws-toolbar:nth-of-type(2){padding:12px 28px 2px;margin:0}
.studio-panel #studioBody{padding:0 28px 48px}
.studio-panel #studioProjectSelect,.studio-panel .ws-search{border-color:var(--neo-line);background:rgba(255,255,255,.72);color:var(--neo-ink);border-radius:7px}
.studio-project-surface{margin-top:16px;padding:0 0 30px;background:transparent;border:0;color:var(--neo-ink)}
.studio-project-surface h3{color:var(--neo-ink)!important;font:700 18px/1.2 Georgia,'Times New Roman',serif;letter-spacing:-.02em}
.studio-start-here{position:relative;overflow:hidden;margin:14px 0 28px;padding:30px;border:1px solid #cbd5e3;border-radius:18px;background:radial-gradient(circle at 88% 12%,rgba(255,232,205,.95),transparent 15rem),linear-gradient(135deg,#eef3fa 0%,#f9fafb 55%,#f5eee6 100%);color:var(--neo-ink);box-shadow:0 15px 42px rgba(41,63,100,.08)}
.studio-start-here:before{content:'NEO / STUDIO';position:absolute;top:20px;right:28px;color:#8290a7;font:700 10px/1 monospace;letter-spacing:.16em}
.studio-start-here h3{max-width:520px;margin:0 0 8px!important;font-size:clamp(25px,3vw,38px)!important}
.studio-start-here-description{max-width:610px;margin-bottom:24px;color:var(--neo-muted);font-size:14px;line-height:1.55}
.neo-direction-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
.neo-direction-card{position:relative;display:flex;min-width:0;min-height:154px;flex-direction:column;justify-content:flex-end;overflow:hidden;padding:0;border:1px solid rgba(26,44,72,.14);border-radius:12px;background:#1d2b43;color:#fff;text-align:left;cursor:pointer;isolation:isolate;transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease}
.neo-direction-card:hover,.neo-direction-card:focus-visible{transform:translateY(-3px);border-color:#8ea4d7;box-shadow:0 12px 24px rgba(37,54,87,.18);outline:none}
.neo-direction-card:disabled{cursor:not-allowed;opacity:.48;filter:grayscale(.6)}
.neo-direction-art{position:absolute;inset:0;z-index:-2;background:center/cover no-repeat var(--neo-direction-art);transition:transform .25s ease}
.neo-direction-card:hover .neo-direction-art{transform:scale(1.04)}
.neo-direction-card:after{content:'';position:absolute;inset:35% 0 0;z-index:-1;background:linear-gradient(transparent,rgba(9,18,35,.96))}
.neo-direction-copy{position:relative;display:flex;flex-direction:column;gap:4px;padding:16px 38px 15px 16px}
.neo-direction-copy strong{font-size:14px;letter-spacing:.01em}.neo-direction-copy small{color:rgba(255,255,255,.74);font-size:11px;line-height:1.35}
.neo-direction-arrow{position:absolute;right:14px;bottom:16px;color:#dce8ff;font-size:18px}
.neo-idea-field{display:block;max-width:620px;margin-top:18px}.neo-idea-field span{display:block;margin-bottom:6px;color:var(--neo-muted);font:700 10px/1 monospace;letter-spacing:.12em;text-transform:uppercase}.neo-idea-field input{width:100%;box-sizing:border-box;padding:12px 14px;border:1px solid var(--neo-line);border-radius:8px;background:rgba(255,255,255,.82);color:var(--neo-ink);font:inherit}
.neo-idea-field input:focus{border-color:var(--neo-blue);outline:2px solid rgba(49,91,199,.15)}
.neo-studio-workspace{margin-top:14px;border:1px solid #cbd5e3;border-radius:18px;background:linear-gradient(145deg,#f7f9fc,#edf2f8);color:var(--neo-ink);box-shadow:0 16px 45px rgba(41,63,100,.08)}
.neo-studio-workspace h2,.neo-studio-workspace h3{color:var(--neo-ink)}.neo-studio-workspace p,.neo-studio-workspace .neo-muted{color:var(--neo-muted)}
.neo-eyebrow,.neo-card-kicker{color:var(--neo-blue)}.neo-studio-flow{border-color:#d6dee9}.neo-studio-flow button{color:#718096}.neo-studio-flow button:hover,.neo-studio-flow button.active{color:var(--neo-ink);border-color:var(--neo-blue)}
.neo-workspace-links,.neo-overview-grid article,.neo-world-grid article,.neo-shot-form{border-color:#d6dee9;background:rgba(255,255,255,.64)}
.neo-workspace-links span,.neo-revision{color:var(--neo-muted)}.neo-workspace-links button{background:#f3f6fa;border-color:#d1dbe8;color:#33445d}
.neo-script-editor,.neo-editor-footer input,.neo-scene-picker select,.neo-shot-form input,.neo-shot-form textarea,.neo-edit-row input{border-color:#cbd6e4;background:#fff;color:var(--neo-ink)}
.neo-world-item,.neo-shot-list button{background:#eef3f8;color:#516078}.neo-world-item strong,.neo-shot-list b{color:var(--neo-ink)}.neo-frame-preview{border-color:#c5d1e0;color:#78879a}.neo-workspace-empty,.neo-empty-inline{color:var(--neo-muted)}
[data-theme="dark"] .studio-panel{--neo-ink:#edf2fb;--neo-muted:#aab9cf;--neo-line:#2c3d58;--neo-paper:#0c1628;--neo-blue:#8daeff;background:radial-gradient(circle at 92% 0%,rgba(50,79,135,.25),transparent 30rem),#0c1628}
[data-theme="dark"] .studio-panel .studio-heading h2,[data-theme="dark"] .studio-project-surface h3{color:var(--neo-ink)!important}
[data-theme="dark"] .studio-start-here{background:radial-gradient(circle at 88% 12%,rgba(121,78,60,.28),transparent 16rem),linear-gradient(135deg,#122039,#101a2d);border-color:#304666;color:var(--neo-ink)}
[data-theme="dark"] .studio-start-here-description{color:var(--neo-muted)}
[data-theme="dark"] .studio-panel #studioProjectSelect,[data-theme="dark"] .studio-panel .ws-search,[data-theme="dark"] .neo-idea-field input{background:#13223a;border-color:#304666;color:var(--neo-ink)}
[data-theme="dark"] .neo-studio-workspace{background:linear-gradient(145deg,#142640,#0f1d32);border-color:#304666;color:var(--neo-ink)}
[data-theme="dark"] .neo-studio-workspace h2,[data-theme="dark"] .neo-studio-workspace h3{color:var(--neo-ink)}
[data-theme="dark"] .neo-workspace-links,[data-theme="dark"] .neo-overview-grid article,[data-theme="dark"] .neo-world-grid article,[data-theme="dark"] .neo-shot-form{background:rgba(255,255,255,.045);border-color:#304666}
[data-theme="dark"] .neo-script-editor,[data-theme="dark"] .neo-editor-footer input,[data-theme="dark"] .neo-scene-picker select,[data-theme="dark"] .neo-shot-form input,[data-theme="dark"] .neo-shot-form textarea{background:#0d1a2f;color:var(--neo-ink);border-color:#304666}
@media (max-width:768px){.studio-panel .studio-primary-toolbar,.studio-panel>.ws-container>.ws-toolbar:nth-of-type(2){padding-inline:16px}.studio-panel #studioBody{padding-inline:16px}.studio-start-here{padding:22px 16px}.studio-start-here:before{display:none}.neo-direction-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.neo-direction-card{min-height:136px}}
@media (max-width:430px){.studio-panel .studio-primary-toolbar{align-items:stretch}.studio-panel .studio-heading h2{font-size:25px!important}.neo-direction-grid{grid-template-columns:1fr}.neo-direction-card{min-height:118px}}

/* Final production polish: consistent focus, selected states and theme-safe
   contrast across the connected film/series surface. */
.studio-panel #studioBody { min-width:0; overflow-x:hidden; }
/* The Agent is intentionally global and fixed. Give Studio a protected
   landing zone so its last card/controls never sit underneath that widget. */
.studio-panel #studioBody { padding-bottom: 180px; }
.studio-panel .studio-calendar-rubric,
.studio-panel .studio-calendar-meta,
.studio-panel .studio-calendar-number,
.studio-panel .studio-calendar-weekdays > div {
  color: #526678;
}
.studio-panel .studio-calendar-card { line-height: 1.4; }
.studio-panel .studio-calendar-card strong { line-height: 1.25; }
[data-theme="dark"] .studio-panel .studio-calendar-rubric,
[data-theme="dark"] .studio-panel .studio-calendar-meta,
[data-theme="dark"] .studio-panel .studio-calendar-number,
[data-theme="dark"] .studio-panel .studio-calendar-weekdays > div {
  color: #b8c7d8;
}
.neo-studio-workspace button:focus-visible,.neo-studio-workspace input:focus-visible,
.neo-studio-workspace textarea:focus-visible,.neo-studio-workspace select:focus-visible,
.neo-direction-card:focus-visible { outline:3px solid rgba(83,104,232,.35); outline-offset:2px; }
.neo-studio-workspace { overflow:hidden; }
.neo-studio-workspace-head { padding-bottom:4px; }
.neo-overview-grid article,.neo-world-grid article,.neo-shot-form,.neo-workspace-links {
  box-shadow:0 5px 16px rgba(40,60,80,.045);
}
[data-theme="dark"] .neo-overview-grid article,[data-theme="dark"] .neo-world-grid article,
[data-theme="dark"] .neo-shot-form,[data-theme="dark"] .neo-workspace-links { box-shadow:none; }
.neo-direction-card { transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease; }
@media (max-width:768px) {
  .neo-studio-workspace { margin-inline:0; }
  .neo-studio-flow { gap:4px; }
  .neo-studio-flow button { min-width:82px; }
  .studio-panel #studioBody { padding-bottom: 210px; }
  .studio-panel .studio-calendar-day { overflow: visible; }
}
@media (max-width:390px) {
  .studio-panel #studioBody { padding-bottom: 220px; }
  .studio-panel .studio-calendar-card,
  .studio-panel .studio-calendar-meta,
  .studio-panel .studio-calendar-rubric { font-size: 12px; line-height: 1.45; }
  .studio-panel .studio-calendar-card { padding: 10px; }
  .studio-panel .studio-calendar-actions { gap: 6px; }
  .studio-panel .studio-calendar-actions .ws-filter-btn { min-height: 36px; padding: 7px 9px; }
}
@media (prefers-reduced-motion:reduce) {
  .neo-studio-workspace *, .neo-direction-card, .neo-direction-art { transition:none!important; animation:none!important; }
}

/* Studio-only agent rail. The global assistant remains available, but its
   wide pill is reduced to a compact handle at the shell edge while production
   cards and controls are being edited. This avoids relying on scroll padding:
   the fixed element itself no longer occupies the lower-right work area. */
body:has(.studio-panel) .neo-agent-float {
  top: 82px;
  right: 14px;
  bottom: auto;
  width: 42px;
  height: 42px;
  box-sizing: border-box;
  padding: 3px;
  gap: 0;
  justify-content: center;
  border-radius: 50%;
}
body:has(.studio-panel) .neo-agent-float__label {
  display: none;
}
body:has(.studio-panel) .neo-agent-float__avatar {
  width: 34px;
  height: 34px;
  transform: scale(1);
  animation: none;
}
body:has(.studio-panel) .neo-agent-float__tooltip {
  top: calc(100% + 10px);
  bottom: auto;
  right: 0;
}
body:has(.studio-panel) .neo-agent-float__tooltip::after {
  top: -6px;
  bottom: auto;
  transform: rotate(225deg);
}
@media (max-width: 768px) {
  body:has(.studio-panel) .neo-agent-float {
    top: 68px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
  body:has(.studio-panel) .neo-agent-float__avatar {
    width: 32px;
    height: 32px;
  }
  body:has(.studio-panel) .neo-agent-float__tooltip {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  body:has(.studio-panel) .neo-agent-float { animation: none!important; }
}

/* A27: keep the shared shell controls and the Studio canvas in separate
   lanes on narrow screens.  The fixed profile/balance controls and Agent
   handle must never cover a project selector, error action, or last card. */
.studio-panel .neo-action-error {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(190, 75, 75, .42);
  border-radius: 10px;
  background: rgba(190, 75, 75, .09);
  color: #7f2525;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.studio-panel .neo-action-error strong { display: block; color: inherit; }
.studio-panel .neo-error-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.studio-panel .neo-error-actions .ws-filter-btn,
.studio-panel .neo-action-error .ws-action-btn { min-height: 40px; }
[data-theme="dark"] .studio-panel .neo-action-error {
  border-color: rgba(245, 137, 137, .46);
  background: rgba(117, 35, 48, .28);
  color: #ffd1d1;
}
.studio-panel .neo-overview-grid article { min-width: 0; }
.studio-panel .neo-editor-footer,
.studio-panel .neo-scene-picker,
.studio-panel .neo-shot-move,
.studio-panel .neo-frame-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.studio-panel .neo-editor-footer button,
.studio-panel .neo-scene-picker button,
.studio-panel .neo-shot-move button,
.studio-panel .neo-frame-actions button {
  min-height: 40px;
}
.studio-panel .neo-shot-move button {
  min-width: 40px;
  padding: 8px 10px;
}
@media (max-width: 768px) {
  .studio-panel .studio-primary-toolbar,
  .studio-panel>.ws-container>.ws-toolbar:nth-of-type(2) {
    padding-inline: 16px;
  }
  .studio-panel .studio-primary-toolbar { padding-top: 18px; }
  .studio-panel .studio-heading h2 { font-size: 24px !important; }
  .studio-panel .neo-studio-workspace-head { gap: 10px; }
  .studio-panel .neo-save-state { align-self: flex-start; }
  .studio-panel .neo-overview-grid,
  .studio-panel .neo-world-grid { grid-template-columns: 1fr; }
  .studio-panel .neo-editor-footer > label {
    flex: 1 1 100%;
    min-width: 0;
  }
  .studio-panel .neo-editor-footer > label input { width: 100%; min-width: 0; }
}
@media (max-width: 430px) {
  .studio-panel .ws-container { padding-top: 62px; }
  .studio-panel .studio-primary-toolbar { padding-inline: 10px; }
  .studio-panel>.ws-container>.ws-toolbar:nth-of-type(2) { padding-inline: 10px; }
  .studio-panel .ws-tabs { padding-inline: 4px; }
  .studio-panel .ws-tab { min-height: 42px; }
  .studio-panel .neo-studio-workspace { padding: 12px; border-radius: 14px; }
  .studio-panel .neo-studio-flow { overflow-x: auto; max-width: 100%; padding-bottom: 2px; }
  .studio-panel .neo-studio-flow button { flex: 0 0 auto; min-height: 42px; }
  .studio-panel .neo-action-error { padding: 11px; }
}
@media (max-width: 375px) {
  .studio-panel .ws-content { padding-inline: 8px; }
  .studio-panel .neo-studio-workspace { padding: 10px; }
  .studio-panel .neo-editor-footer button,
  .studio-panel .neo-error-actions > *,
  .studio-panel .neo-scene-picker button { width: 100%; }
}

/* A27 regression guard: dynamic Studio copy must remain legible and wrap
   inside the narrow content column, including long translated labels. */
.studio-panel #studioBody,
.studio-panel #studioBody p,
.studio-panel #studioBody h2,
.studio-panel #studioBody h3,
.studio-panel #studioBody button,
.studio-panel #studioBody label,
.studio-panel #studioBody .neo-muted {
  overflow-wrap: anywhere;
}
.studio-panel .ws-search::placeholder,
.studio-panel input::placeholder,
.studio-panel textarea::placeholder {
  color: var(--text-secondary, #526678);
  opacity: .9;
}
[data-theme="dark"] .studio-panel .ws-search::placeholder,
[data-theme="dark"] .studio-panel input::placeholder,
[data-theme="dark"] .studio-panel textarea::placeholder {
  color: #c2cede;
  opacity: .92;
}
.studio-panel .ws-search,
.studio-panel #studioProjectSelect,
.studio-panel .studio-content-toolbar select {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-panel .studio-calendar-card,
.studio-panel .studio-calendar-meta,
.studio-panel .studio-calendar-rubric {
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 430px) {
  .studio-panel .ws-search-wrap { width: 100%; }
  .studio-panel .ws-search { white-space: normal; }
  .studio-panel .studio-content-toolbar select,
  .studio-panel .studio-content-toolbar button { min-height: 40px; }
  .studio-panel .neo-workspace-links button,
  .studio-panel .neo-workspace-links span { min-width: 0; overflow-wrap: anywhere; }
}

/* Series room: dense, cinematic and immediately legible. The DOM remains
   server-backed; these rules only establish the approved visual hierarchy. */
.studio-panel {
  --neo-ink: #edf3ff;
  --neo-muted: #91a5c5;
  --neo-line: rgba(130, 165, 226, .24);
  --neo-paper: #07111f;
  --neo-blue: #7892ff;
  background:
    radial-gradient(900px 380px at 82% -8%, rgba(64, 91, 190, .24), transparent 65%),
    #07111f;
}
.studio-panel .studio-primary-toolbar {
  padding: 18px 28px 14px;
  border-bottom-color: rgba(130,165,226,.18);
}
body:has(.neo-studio-workspace) .studio-panel .studio-primary-toolbar {
  display: none;
}
.studio-panel .studio-heading h2 { color: #f3f6ff; font-size: 30px!important; }
.studio-panel .studio-heading>div { color: #91a5c5; }
.studio-panel>.ws-container>.ws-toolbar:nth-of-type(2) { padding: 10px 28px 0; }
.studio-panel #studioBody { padding: 0 28px 56px; }
.studio-project-surface { margin-top: 12px; color: #edf3ff; }
.studio-panel .studio-start-here {
  margin-top: 0;
  border-color: rgba(130,165,226,.25);
  background:
    radial-gradient(620px 220px at 88% 0%, rgba(80,105,215,.22), transparent 68%),
    linear-gradient(145deg, #0d1c32, #0a1729);
  color: #edf3ff;
  box-shadow: 0 18px 40px rgba(0,0,0,.24);
}
.studio-panel .studio-start-here:before { color: #7f9be9; }
.studio-panel .studio-start-here-description { color: #9eafd0; }
.studio-panel .studio-start-here h3 { color: #f3f6ff!important; }
.studio-panel .neo-direction-card { border-color: rgba(130,165,226,.25); }
.neo-studio-workspace {
  margin: 0;
  padding: 18px;
  border-color: rgba(130,165,226,.25);
  border-radius: 14px;
  background:
    radial-gradient(700px 260px at 88% 0%, rgba(78,104,214,.19), transparent 68%),
    linear-gradient(145deg, #0d1c32, #0b1729);
}
.neo-studio-workspace-head { gap: 16px; padding-bottom: 10px; }
.neo-studio-workspace-head h2 { font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.neo-studio-workspace-head p { max-width: 720px; margin: 7px 0 0; color: #a8b8d1; font-size: 13px; }
.neo-eyebrow,.neo-card-kicker { color: #86a3ff; }
html:not([data-theme="dark"]) [data-neo-visual="v4"] .neo-card-kicker,
[data-theme="light"] [data-neo-visual="v4"] .neo-card-kicker {
  color: var(--nv-accent);
}
html:not([data-theme="dark"]) [data-neo-visual="v4"] .studio-project-surface h3,
[data-theme="light"] [data-neo-visual="v4"] .studio-project-surface h3 {
  color: var(--nv-text) !important;
}
.neo-studio-flow {
  margin: 8px -18px 12px;
  padding: 8px 18px;
  gap: 16px;
  background: rgba(7,17,31,.84);
  border-bottom-color: rgba(130,165,226,.22);
}
.neo-studio-flow button { min-height: 34px; color: #9db0d0; }
.neo-studio-flow button.active { color: #fff; border-bottom-color: #7892ff; }
.neo-workspace-links {
  margin-bottom: 12px;
  padding: 7px 8px;
  background: rgba(255,255,255,.035);
  border-color: rgba(130,165,226,.2);
}
.neo-workspace-links button { background: #122442; color: #cfdbf2; border-color: rgba(130,165,226,.28); }
.neo-overview-feature { grid-template-columns: minmax(0, 1.65fr) minmax(230px, .75fr); gap: 10px; }
.neo-overview-preview { min-height: 238px; border-color: rgba(130,165,226,.3); }
.neo-overview-preview video, .neo-overview-preview img { min-height: 238px; }
.neo-overview-preview {
  height: clamp(286px, 34vh, 340px);
}
.neo-overview-preview video,
.neo-overview-preview img {
  height: 100%;
  min-height: 0;
}
.neo-overview-feature-copy { padding: 15px; background: rgba(255,255,255,.045); border-color: rgba(130,165,226,.2); }
.neo-overview-feature-copy h3 { font-size: 18px; line-height: 1.18; }
.neo-overview-support { grid-template-columns: .88fr 1.12fr; gap: 10px; margin-top: 10px; }
.neo-overview-support article { padding: 13px; background: rgba(255,255,255,.04); border-color: rgba(130,165,226,.2); }
.neo-overview-frame { width: 104px; flex-basis: 104px; }
.neo-overview-frame img,.neo-overview-frame > span { width: 104px; height: 66px; }
.neo-studio-workspace button:hover { border-color: #7892ff; color: #fff; }
.neo-studio-workspace button:focus-visible,
.studio-panel input:focus-visible,.studio-panel textarea:focus-visible,.studio-panel select:focus-visible {
  outline: 2px solid rgba(120,146,255,.75); outline-offset: 2px;
}
@media (max-width: 768px) {
  .studio-panel .studio-primary-toolbar { padding-inline: 16px; }
  .studio-panel>.ws-container>.ws-toolbar:nth-of-type(2) { padding-inline: 16px; }
  body:has(.neo-studio-workspace) .studio-panel>.ws-container>.ws-toolbar:nth-of-type(2) {
    display: none;
  }
  .studio-panel #studioBody { padding-inline: 12px; }
  .neo-studio-workspace { padding: 13px; }
  .neo-studio-flow { margin-inline: -13px; padding-inline: 13px; }
  .neo-overview-feature,.neo-overview-support { grid-template-columns: 1fr; }
  .neo-overview-preview { height: 220px; min-height: 220px; }
  .neo-overview-preview video,.neo-overview-preview img { height: 100%; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-entry-task,.studio-entry-task-art,.neo-direction-card,.neo-studio-workspace button { transition: none; }
}
