/* ============================================================
   Maya's Method — Studio  |  Design System & Layout
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0f;
  color: #e8e8ed;
  line-height: 1.5;
  overflow-x: hidden;
}

/* --- Tokens --- */
:root {
  --bg:          #0a0a0f;
  --surface:     #111118;
  --surface-el:  #16161f;
  --border:      #1e1e2a;
  --border-light:#2a2a3a;
  --text-1:      #e8e8ed;
  --text-2:      #8b8b9e;
  --text-3:      #55556a;
  --accent:      #6366f1;
  --accent-h:    #818cf8;
  --accent-bg:   rgba(99,102,241,0.10);
  --success:     #22c55e;
  --success-bg:  rgba(34,197,94,0.10);
  --warning:     #f59e0b;
  --warning-bg:  rgba(245,158,11,0.10);
  --error:       #ef4444;
  --error-bg:    rgba(239,68,68,0.10);
  --mono:        'JetBrains Mono', 'SF Mono', monospace;
  --radius:      8px;
  --radius-sm:   6px;
  --radius-xs:   4px;
  --transition:  150ms ease;
  --sidebar-w:   220px;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a4a; }

/* --- Sidebar --- */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.logo-text {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.4px;
}
.logo-sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  margin-top: 2px;
}

nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  user-select: none;
}
.nav-item:hover {
  background: var(--surface-el);
  color: var(--text-1);
}
.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent-h);
}
.nav-item.active .nav-icon {
  color: var(--accent);
}
.nav-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.nav-label {
  font-size: 13px;
  font-weight: 500;
}
.coming-soon-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--surface-el);
  color: var(--text-3);
  letter-spacing: 0.3px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-version {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}

/* --- Main & Topbar --- */
#main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
#page-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* --- Health Bar --- */
.health-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}
.health-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-dot.ok      { background: var(--success); box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.health-dot.degraded { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.4); }
.health-dot.down    { background: var(--error); box-shadow: 0 0 6px rgba(239,68,68,0.4); animation: pulse-error 1.5s ease-in-out infinite; }
.health-dot.unknown { background: var(--text-3); }
.health-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

@keyframes pulse-error {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* --- Tab Content --- */
.tab-content {
  display: none;
  padding: 24px 32px 48px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 200ms ease;
}
.tab-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: border-color var(--transition);
}
.card:hover {
  border-color: var(--border-light);
}
.card + .card { margin-top: 16px; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.2px;
}
.card-meta {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--mono);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  outline: none;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); }

.btn-secondary {
  background: var(--surface-el);
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-light); background: #1c1c28; }

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover { color: var(--text-1); background: var(--surface-el); }

.btn-success {
  background: var(--success-bg);
  color: var(--success);
}
.btn-success:hover { background: rgba(34,197,94,0.18); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Status Badges --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.status-badge.pending   { background: var(--surface-el); color: var(--text-3); }
.status-badge.running   { background: var(--accent-bg); color: var(--accent-h); animation: pulse-badge 2s ease-in-out infinite; }
.status-badge.completed { background: var(--success-bg); color: var(--success); }
.status-badge.failed    { background: var(--error-bg); color: var(--error); }
.status-badge.awaiting  { background: var(--warning-bg); color: var(--warning); }

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* --- Directives Panel --- */
.directives-panel {
  margin-bottom: 24px;
}
.directives-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: all var(--transition);
}
.directives-toggle:hover { border-color: var(--border-light); color: var(--text-1); }
.directives-toggle .chevron {
  margin-left: auto;
  transition: transform var(--transition);
  font-size: 10px;
}
.directives-toggle.open .chevron { transform: rotate(90deg); }

.directives-body {
  display: none;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.directives-body.open { display: block; animation: fadeIn 200ms ease; }

.directives-section {
  margin-bottom: 16px;
}
.directives-section:last-child { margin-bottom: 0; }
.directives-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.directives-section-title.never   { color: var(--error); }
.directives-section-title.always  { color: var(--success); }
.directives-section-title.standard { color: var(--warning); }

.directive-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
}
.directive-icon {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  font-size: 12px;
  margin-top: 1px;
}
.directive-icon.never   { color: var(--error); }
.directive-icon.always  { color: var(--success); }
.directive-icon.standard { color: var(--warning); }

/* --- Selector Form --- */
.selector-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.selector-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-1);
}
.selector-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .selector-row { grid-template-columns: repeat(2, 1fr); }
}
.selector-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.selector-field select,
.selector-field input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-1);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.selector-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b8b9e'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.selector-field select:focus,
.selector-field input:focus {
  border-color: var(--accent);
}
.selector-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* --- Production Card --- */
.production-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}
.production-card:hover { border-color: var(--border-light); }

.production-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.production-id {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent-h);
}
.production-meta {
  font-size: 12px;
  color: var(--text-3);
}

/* --- Step Timeline --- */
.step-timeline {
  padding: 16px 20px;
}
.step {
  position: relative;
  padding-left: 36px;
  padding-bottom: 20px;
  border-left: 2px solid var(--border);
  margin-left: 11px;
}
.step:last-child { padding-bottom: 0; border-left-color: transparent; }
.step.completed { border-left-color: var(--success); }
.step.running   { border-left-color: var(--accent); }
.step.failed    { border-left-color: var(--error); }
.step.awaiting  { border-left-color: var(--warning); }

.step-number {
  position: absolute;
  left: -12px;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-3);
  transition: all var(--transition);
}
.step.completed .step-number { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.step.running .step-number   { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-h); animation: pulse-badge 2s ease-in-out infinite; }
.step.failed .step-number    { border-color: var(--error); background: var(--error-bg); color: var(--error); }
.step.awaiting .step-number  { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); }

.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.step-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
}
.step.pending .step-name { color: var(--text-3); }

.step-content {
  display: none;
  margin-top: 12px;
  animation: fadeIn 200ms ease;
}
.step-content.open { display: block; }

.step-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* --- Image & Video Previews --- */
.image-preview {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 400px;
  background: var(--bg);
  position: relative;
}
.image-preview img {
  display: block;
  width: 100%;
  height: auto;
}
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.image-grid .image-preview {
  cursor: pointer;
  transition: all var(--transition);
}
.image-grid .image-preview:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}
.image-grid .image-preview.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.3);
}

.video-preview {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 560px;
  background: #000;
}
.video-preview video {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
}

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 400ms ease;
}

/* --- Distribution Grid --- */
.distribution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1000px) {
  .distribution-grid { grid-template-columns: repeat(2, 1fr); }
}

.dist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.dist-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }

.dist-thumb {
  aspect-ratio: 9/16;
  background: #000;
  overflow: hidden;
  position: relative;
}
.dist-thumb video,
.dist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dist-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 28px;
  opacity: 0;
  transition: opacity var(--transition);
  cursor: pointer;
}
.dist-card:hover .dist-play-btn { opacity: 1; }

.dist-info {
  padding: 12px;
}
.dist-id {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--accent-h);
  margin-bottom: 4px;
}
.dist-desc {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dist-date {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}
.dist-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

/* --- Coming Soon --- */
.coming-soon-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--text-3);
  text-align: center;
}
.coming-soon-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.coming-soon-page h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}
.coming-soon-page p {
  font-size: 14px;
  color: var(--text-3);
  max-width: 300px;
}

/* --- Toast --- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  pointer-events: auto;
  animation: toastIn 250ms ease, toastOut 250ms ease forwards;
  animation-delay: 0ms, var(--toast-duration, 2750ms);
}
.toast.info    { background: var(--surface-el); color: var(--text-1); border: 1px solid var(--border); }
.toast.success { background: #0d2818; color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.toast.error   { background: #2a0f0f; color: var(--error); border: 1px solid rgba(239,68,68,0.25); }
.toast.warning { background: #2a1f0a; color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-8px) scale(0.95); }
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
  animation: fadeIn 150ms ease;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  overflow: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 15px;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-1); }
.modal-body {
  padding: 20px;
}
.modal-body video {
  width: 100%;
  border-radius: var(--radius-sm);
}

/* --- Options Form (Step 8) --- */
.options-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.options-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.options-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.options-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.options-field label {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.options-field select,
.options-field input,
.options-field textarea {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-1);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.options-field select:focus,
.options-field input:focus,
.options-field textarea:focus {
  border-color: var(--accent);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}
.empty-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 13px;
}

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Media Previews in Step Cards --- */
.image-preview { max-width: 300px; border-radius: 8px; overflow: hidden; margin: 8px 0; }
.image-preview img { width: 100%; height: auto; display: block; border-radius: 8px; }
.video-preview { max-width: 400px; margin: 8px 0; }
.video-preview video { width: 100%; border-radius: 8px; background: #000; }
.step-output-json {
  font-size: 12px; color: #8b8fa3; font-family: var(--mono);
  white-space: pre-wrap; max-height: 150px; overflow-y: auto;
  background: rgba(0,0,0,0.3); padding: 8px; border-radius: 6px; margin: 4px 0;
}
.btn-sm { padding: 4px 12px; font-size: 12px; border-radius: 4px; text-decoration: none; }
.btn-success { background: #22c55e; color: #fff; border: none; cursor: pointer; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: #ef4444; color: #fff; border: none; cursor: pointer; }
.btn-danger:hover { background: #dc2626; }

/* --- Pinterest Reference Grid --- */
.pinterest-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 8px 0; max-width: 800px;
}
.pinterest-card {
  border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; transition: border-color 0.2s, transform 0.15s;
  background: var(--surface-2, #1a1a2e);
}
.pinterest-card:hover { border-color: var(--accent, #6366f1); transform: scale(1.03); }
.pinterest-card.selected { border-color: #22c55e; box-shadow: 0 0 12px rgba(34,197,94,0.3); }
.pinterest-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.pinterest-caption {
  font-size: 11px; color: var(--text-3, #666); padding: 4px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Constraint Engine Selector ──────────────────────────────────── */
.selector-title-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.selector-title { font-size: 18px; font-weight: 700; color: var(--text-1); }
.selector-tier-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  background: #7c3aed; color: #fff; padding: 3px 10px;
  border-radius: 4px; text-transform: uppercase;
}
.selector-section {
  margin-bottom: 8px; border: 1px solid var(--border-1);
  border-radius: 8px; overflow: hidden;
}
.selector-section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--bg-2);
  cursor: pointer; user-select: none;
}
.selector-section-header:hover { background: var(--bg-3); }
.selector-section-icon { font-size: 16px; }
.selector-section-title {
  flex: 1; font-size: 13px; font-weight: 600;
  color: var(--text-1); text-transform: uppercase;
  letter-spacing: 0.5px;
}
.selector-section-chevron {
  font-size: 10px; color: var(--text-3); transition: transform 0.15s;
}
.selector-section-body {
  display: none; padding: 12px 14px;
  background: var(--bg-1);
}
.selector-section-body.open { display: block; }
.selector-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 768px) {
  .selector-grid { grid-template-columns: repeat(2, 1fr); }
}
.selector-tier2-note {
  font-size: 12px; color: var(--text-3); padding: 10px 14px;
  border: 1px dashed var(--border-1); border-radius: 6px;
  margin-top: 8px; margin-bottom: 12px;
}
.selector-tier2-note strong { color: var(--text-2); }
