.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;
}

.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;
  }
}

.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;
  }
}

@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);
}
