*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f0f;
  --sidebar-bg: #111;
  --surface: #1a1a1a;
  --surface-hover: #222;
  --border: #2a2a2a;
  --red: #FF0000;
  --red-dim: #cc0000;
  --text: #f1f1f1;
  --text-muted: #aaa;
  --text-dim: #666;
  --radius: 10px;
  --sidebar-width: 228px;
}

html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* ── Layout ── */
.app-layout {
  display: flex;
  height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 20px 16px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 10px 8px 4px;
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--surface-hover); color: var(--text); }

.sidebar-section-label {
  padding: 14px 16px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.sidebar-brands {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}
.sidebar-brands::-webkit-scrollbar { width: 4px; }
.sidebar-brands::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-brand-item {
  display: flex;
  align-items: center;
  border-radius: 7px;
  transition: background 0.15s;
}
.sidebar-brand-item:hover { background: var(--surface-hover); }
.sidebar-brand-item.active { background: var(--surface-hover); }

.brand-item-link {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  padding: 7px 4px 7px 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 0;
  transition: color 0.15s;
}
.brand-item-link:hover { color: var(--text); }
.sidebar-brand-item.active .brand-item-link { color: var(--text); }

.brand-delete-sidebar-btn {
  opacity: 0;
  background: none;
  border: none;
  padding: 7px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-dim);
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}
.sidebar-brand-item:hover .brand-delete-sidebar-btn { opacity: 1; }
.brand-delete-sidebar-btn:hover { color: #ff4444; }

.brand-chevron-btn {
  background: none;
  border: none;
  padding: 7px 10px 7px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text-dim);
  transition: color 0.15s;
  flex-shrink: 0;
}
.brand-chevron-btn:hover { color: var(--text-muted); }

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-brand-group { display: flex; flex-direction: column; }

.brand-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.brand-chevron {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.2s;
}
.brand-chevron.expanded { transform: rotate(90deg); }

.sidebar-sections {
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px 16px;
}
.sidebar-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 16px 10px 7px;
  border-top: 1px solid var(--border);
}
.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.sidebar-group-toggle:hover { color: var(--text-muted); }
.group-chevron {
  opacity: 0.5;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.group-chevron.expanded {
  transform: rotate(0deg);
}
.group-chevron:not(.expanded) {
  transform: rotate(-90deg);
}
.sidebar-section-item {
  padding: 6px 10px 6px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-top: 2px;
}
.sidebar-section-item:hover { background: var(--surface-hover); color: var(--text-muted); }
.sidebar-section-item.active { background: var(--surface-hover); color: var(--text); }

.sidebar-add-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px 6px 18px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-top: 2px;
}
.sidebar-add-item:hover { background: var(--surface-hover); color: var(--text-muted); }

.sidebar-footer {
  flex-shrink: 0;
  padding: 10px 8px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-new-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-new-brand:hover { border-color: var(--text-dim); color: var(--text-muted); }

/* ── Main content ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

#view-container {
  min-height: 100vh;
}

/* ── All Brands view ── */
.view-header {
  padding: 36px 40px 0;
  margin-bottom: 28px;
}
.view-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.view-header p { color: var(--text-muted); font-size: 0.9rem; }

.view-body { padding: 0 40px 60px; }

.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.brand-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-color, #444);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
  display: block;
}
.brand-card:hover { background: var(--surface-hover); box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

.brand-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-card-name .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.platform-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.platform-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
}
.platform-badge.connected { border-color: #2a3a2a; background: #1a2a1a; color: #6fcf6f; }
.platform-badge.disconnected { color: var(--text-dim); }

.brand-card-stats {
  display: flex;
  gap: 20px;
}
.brand-stat { font-size: 0.82rem; color: var(--text-muted); }
.brand-stat strong { color: var(--text); font-weight: 600; display: block; font-size: 1rem; }

/* ── Brand view ── */
.brand-view-header {
  padding: 36px 40px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.brand-view-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-color-square {
  width: 20px; height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
}
.brand-header-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.brand-header-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.brand-view-breadcrumb {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.brand-view-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.btn-edit-brand {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-edit-brand:hover { border-color: var(--text-dim); color: var(--text); }

.tab-content { padding: 8px 40px 60px; }

/* ── Overview tab ── */
.platform-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.platform-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.platform-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.platform-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.platform-status-dot.online { background: #6fcf6f; }
.platform-status-dot.offline { background: var(--text-dim); }

.platform-card-stats { display: flex; flex-direction: column; gap: 10px; }
.pstat { display: flex; flex-direction: column; }
.pstat-value { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; }
.pstat-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }

.pstat-row { display: flex; gap: 20px; }
.pstat-row .pstat-value { font-size: 1rem; }

.platform-card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 0 8px;
  text-align: center;
}
.platform-card-empty p { font-size: 0.82rem; color: var(--text-dim); }

.platform-view-link {
  margin-top: 14px;
  display: inline-block;
  font-size: 0.78rem;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.platform-view-link:hover { color: var(--text-muted); }

/* Recent activity */
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.activity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.activity-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #252525;
  display: block;
}
.activity-info { padding: 10px; }
.activity-title {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
}
.activity-meta { font-size: 0.72rem; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; }

/* ── YouTube tab ── */
.yt-channel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.yt-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
  flex-shrink: 0;
}
.yt-avatar-placeholder {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF0000, #cc0000);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.yt-channel-info h2 { font-size: 1.1rem; font-weight: 700; }
.yt-channel-info .handle { font-size: 0.82rem; color: var(--text-dim); margin-top: 2px; }

.yt-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 28px;
}
.yt-stat {
  background: var(--surface);
  padding: 14px 12px;
  text-align: center;
}
.yt-stat-value { font-size: 1.2rem; font-weight: 700; }
.yt-stat-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.video-list { display: flex; flex-direction: column; gap: 8px; }
.video-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.15s;
}
.video-item:hover { background: var(--surface-hover); }
.video-thumb {
  width: 88px; height: 50px;
  border-radius: 5px;
  object-fit: cover;
  background: #252525;
  flex-shrink: 0;
}
.video-info { flex: 1; min-width: 0; }
.video-title {
  font-size: 0.85rem; font-weight: 500; line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 5px;
}
.video-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.video-meta span { font-size: 0.74rem; color: var(--text-dim); display: flex; align-items: center; gap: 3px; }

/* ── Placeholder tabs (Instagram / Facebook) ── */
.platform-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 24px;
  text-align: center;
  color: var(--text-dim);
}
.platform-placeholder-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  opacity: 0.5;
}
.platform-placeholder h3 { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.platform-placeholder p { font-size: 0.85rem; max-width: 280px; line-height: 1.5; }
.coming-soon-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Connect placeholder (YouTube not connected) ── */
.connect-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
}
.connect-placeholder h3 { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.connect-placeholder p { font-size: 0.85rem; color: var(--text-dim); max-width: 260px; line-height: 1.5; }

/* ── Buttons ── */
.btn-connect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}
.btn-connect:hover { background: var(--red-dim); }

.btn-disconnect {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-disconnect:hover { border-color: var(--red); color: var(--red); }

.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--red-dim); }

.btn-secondary {
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--text-dim); color: var(--text); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 380px;
  max-width: calc(100vw - 32px);
}
.modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.modal-field { margin-bottom: 18px; }
.modal-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.modal-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.modal-field input:focus { border-color: var(--text-dim); }

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
  border: 2px solid transparent;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { outline: 2px solid #fff; outline-offset: 2px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 2000;
  transition: opacity 0.3s;
  white-space: nowrap;
}
.toast.success { background: #1a3a1a; color: #6fcf6f; border: 1px solid #2a5a2a; }
.toast.error   { background: #3a1a1a; color: #ff6b6b; border: 1px solid #5a2a2a; }
.toast.hidden  { opacity: 0; pointer-events: none; }

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #222 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-height: 180px; }
.skeleton-row  { height: 13px; }
.skeleton-circle { border-radius: 50% !important; }

/* ── Kanban board ── */
.kanban-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.kanban-count {
  font-size: 0.82rem;
  color: var(--text-dim);
}
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 24px;
  align-items: flex-start;
}
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.kanban-column {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
  transition: border-color 0.15s;
}
.kanban-column.drag-over {
  border-color: #555;
  background: #1e1e1e;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.kanban-stage-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-col-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg);
  border-radius: 10px;
  padding: 2px 7px;
  font-weight: 600;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 60px;
}
.kanban-cards::-webkit-scrollbar { width: 3px; }
.kanban-cards::-webkit-scrollbar-thumb { background: var(--border); }

.kanban-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.kanban-card:hover {
  border-color: #3a3a3a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.kcard-title {
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kcard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kcard-platforms { display: flex; gap: 5px; }
.kcard-platform-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}
.kcard-date {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── Content modal ── */
.modal-lg { width: 520px; }

.modal-row {
  display: flex;
  gap: 14px;
}

.modal-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  padding: 9px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.modal-select:focus { border-color: var(--text-dim); }

.modal-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s;
}
.modal-textarea:focus { border-color: var(--text-dim); }

.platform-status-rows { display: flex; flex-direction: column; gap: 8px; }
.pstatus-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pstatus-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  width: 72px;
  flex-shrink: 0;
}
.pstatus-select { flex: 1; width: auto; min-width: 0; }
.modal-date {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.82rem;
  padding: 9px 10px;
  outline: none;
  width: 130px;
  flex-shrink: 0;
  transition: border-color 0.15s;
  color-scheme: dark;
}
.modal-date:focus { border-color: var(--text-dim); }

/* ── Platform picker ── */
.platform-picker { display: flex; flex-direction: column; gap: 8px; }

.platform-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left;
  width: 100%;
}
.platform-option:hover { border-color: #3a3a3a; background: #141414; }
.platform-option.available:hover { border-color: var(--red); }

.platform-option-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.platform-option-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.platform-option-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.platform-option-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.platform-option-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  flex-shrink: 0;
}
.platform-option-badge.available {
  background: #1a0000;
  border-color: var(--red);
  color: var(--red);
}
.platform-option-badge.disconnect {
  background: #1a1200;
  border-color: #a07800;
  color: #f0b800;
}

.btn-danger {
  background: none;
  border: 1px solid #5a2a2a;
  color: #ff6b6b;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover { background: #3a1a1a; }

/* ── Content Type Picker ── */
.content-type-picker {
  display: flex;
  gap: 8px;
}
.content-type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.15s;
  font-size: 0.83rem;
  font-weight: 500;
}
.content-type-btn small {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 400;
}
.content-type-btn .content-type-icon { font-size: 1.1rem; }
.content-type-btn:hover { border-color: var(--text-dim); color: var(--text-muted); }
.content-type-btn.active {
  border-color: var(--red);
  background: #1a0000;
  color: var(--text);
}
.content-type-btn.active small { color: var(--text-muted); }

/* ── Kanban card type + agent bar ── */
.kcard-type-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.kcard-agent-bar {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  margin: 6px 0 4px;
  overflow: hidden;
}
.kcard-agent-progress {
  height: 100%;
  background: #4CAF50;
  border-radius: 2px;
  transition: width 0.3s;
}
.kcard-score-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--border);
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.kcard-score-badge.score-win   { background: rgba(76,175,80,0.18); color: #4CAF50; }
.kcard-score-badge.score-avg   { background: rgba(255,152,0,0.18);  color: #FF9800; }
.kcard-score-badge.score-miss  { background: rgba(239,83,80,0.18);  color: #EF5350; }

/* ── Agent status in content modal ── */
.agent-status-label-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.agent-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.agent-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.agent-status-name {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.agent-status-label {
  font-size: 0.75rem;
  font-weight: 600;
}
.agent-report-summary {
  font-size: 0.78rem;
  color: var(--text-dim);
  padding: 4px 0 6px 15px;
  border-left: 2px solid var(--border);
  margin-left: 3px;
  margin-bottom: 2px;
}

/* ── Content Calendar ── */
.cal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.cal-month-label {
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 172px;
  text-align: center;
  letter-spacing: -0.2px;
}
.cal-nav-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.cal-nav-btn:hover { border-color: var(--text-dim); color: var(--text); }

.cal-today-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-today-btn:hover { border-color: var(--text-dim); color: var(--text); }

.cal-month-summary {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-left: 4px;
}

.cal-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-dow {
  background: var(--surface);
  padding: 8px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  text-align: center;
}

.cal-day {
  background: var(--surface);
  min-height: 96px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-day-faded { background: #131313; }
.cal-day-today { background: rgba(108, 99, 255, 0.06); }

.cal-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  margin-bottom: 2px;
  flex-shrink: 0;
}
.cal-day-num.is-today {
  background: var(--red);
  color: #fff;
}

.cal-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px 2px 6px;
  border-radius: 4px;
  background: var(--surface-hover);
  border-left: 3px solid transparent;
  font-size: 0.7rem;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.15s;
}
.cal-chip:hover { opacity: 0.75; }
.cal-chip-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.cal-chip-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.cal-overflow {
  font-size: 0.68rem;
  color: var(--text-dim);
  padding: 1px 5px;
}

/* ── Agents tab ── */
.agents-loading {
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.agents-view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Stat row */
.agents-stat-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.agents-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 120px;
  flex: 1;
}
.agents-stat-value {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1.1;
}
.agents-stat-value.agents-stat-active { color: #FF9800; }
.agents-stat-value.agents-stat-error  { color: #f44336; }
.agents-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Section */
.agents-section { display: flex; flex-direction: column; gap: 10px; }
.agents-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}
.agents-section-count {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Throughput strip */
.agent-throughput-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.agent-throughput-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 64px;
  flex: 1;
}
.agent-tp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.agent-tp-pulse {
  animation: pulse-ring 1.2s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,152,0,0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(255,152,0,0); }
}
.agent-tp-name {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.agent-tp-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

/* Pipeline table */
.pipeline-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.pipeline-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: #161616;
}
.pipeline-header-title {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pipeline-header-agents {
  display: flex;
  gap: 4px;
  margin: 0 12px;
}
.pipeline-header-agent {
  width: 36px;
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipeline-header-pct {
  font-size: 0.7rem;
  color: var(--text-dim);
  width: 56px;
  text-align: right;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Pipeline rows */
.pipeline-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  gap: 12px;
}
.pipeline-row:last-child { border-bottom: none; }
.pipeline-row:hover { background: var(--surface-hover); }

.pipeline-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pipeline-row-title {
  font-size: 0.83rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.pipeline-stage-chip {
  font-size: 0.65rem;
  border: 1px solid;
  border-radius: 20px;
  padding: 1px 7px;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: capitalize;
}

.pipeline-cells {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.pipeline-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: transform 0.1s;
}
.pipeline-cell-running {
  animation: cell-pulse 1s ease-in-out infinite;
}
@keyframes cell-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

.pipeline-row-tail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 76px;
}
.pipeline-mini-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.pipeline-mini-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.pipeline-mini-active {
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}
.pipeline-pct {
  font-size: 0.72rem;
  color: var(--text-dim);
  width: 30px;
  text-align: right;
}

/* Empty state */
.agents-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

@media (max-width: 900px) {
  .platform-cards { grid-template-columns: 1fr; }
}

/* ── Content detail view ──────────────────────────────────────────────────── */
.detail-loading {
  padding: 40px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.content-detail-view {
  max-width: 900px;
  padding: 0 0 60px;
}

.detail-back {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-decoration: none;
}
.detail-back-link:hover { color: var(--text-muted); }

.detail-header { margin-bottom: 24px; }

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.detail-stage-chip,
.detail-type-chip,
.detail-score-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.detail-type-chip {
  background: var(--surface-2);
  color: var(--text-dim);
}
.detail-score-chip.score-win  { background: rgba(76,175,80,0.15);  color: #4CAF50; }
.detail-score-chip.score-avg  { background: rgba(255,152,0,0.15);  color: #FF9800; }
.detail-score-chip.score-miss { background: rgba(239,83,80,0.15);  color: #EF5350; }

.detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px;
}

.detail-angle {
  font-size: 0.88rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Tabs */
.detail-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.detail-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--text-dim);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.detail-tab-btn:hover { color: var(--text-muted); }
.detail-tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── Tab: Brief ── */
.detail-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.detail-section-full { grid-column: 1 / -1; }

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.detail-field-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.detail-field-value {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.detail-prow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
}
.detail-prow-date { color: var(--text-dim); font-size: 0.78rem; margin-left: auto; }

.detail-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ── Tab: Script ── */
.detail-script-header {
  display: flex;
  gap: 20px;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.detail-script {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
}

/* ── Tab: Creative — hooks ── */
.detail-hooks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.detail-hook-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.detail-hook-card.hook-selected {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
}
.hook-selected-label {
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}
.detail-hook-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.detail-hook-spoken {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.4;
}
.detail-hook-overlay {
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--surface);
  border-radius: 4px;
  padding: 4px 8px;
}
.detail-hook-rationale {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Titles */
.detail-title-variants {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 16px;
}
.detail-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 6px;
}
.detail-title-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 14px;
}

.detail-caption-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 6px;
  margin: 6px 0;
}
.detail-caption-text {
  width: 100%;
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
  margin-top: 2px;
}

/* Thumbnail */
.detail-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 12px 0;
}
.detail-thumb-concept,
.detail-thumb-text-overlay {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.detail-thumb-text-overlay {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.detail-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-palette-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: default;
}
.detail-ai-prompt {
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border-radius: 6px;
  padding: 12px;
  line-height: 1.6;
  font-style: italic;
}

/* ── Tab: Distribution ── */
.detail-distrib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.detail-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detail-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(from var(--tag-color) r g b / 0.12);
  color: var(--tag-color);
  border: 1px solid rgba(from var(--tag-color) r g b / 0.25);
}
/* Fallback for browsers without relative color syntax */
.detail-tag { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }

.detail-schedule-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.detail-schedule-time { margin-left: auto; color: var(--text-dim); font-size: 0.8rem; }

/* ── Tab: Performance ── */
.detail-score-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.detail-score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 3px solid currentColor;
}
.detail-score-circle.score-win  { color: #4CAF50; background: rgba(76,175,80,0.1); }
.detail-score-circle.score-avg  { color: #FF9800; background: rgba(255,152,0,0.1); }
.detail-score-circle.score-miss { color: #EF5350; background: rgba(239,83,80,0.1); }

.detail-score-meta { display: flex; flex-direction: column; gap: 6px; }
.detail-score-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.detail-score-context { font-size: 0.85rem; color: var(--text-dim); max-width: 400px; }

.detail-verdict-chip {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 3px;
}
.detail-verdict-chip.verdict-win   { background: rgba(76,175,80,0.15);  color: #4CAF50; }
.detail-verdict-chip.verdict-average { background: rgba(255,152,0,0.15); color: #FF9800; }
.detail-verdict-chip.verdict-miss  { background: rgba(239,83,80,0.15);  color: #EF5350; }

.detail-breakdown { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.detail-bd-row {
  display: grid;
  grid-template-columns: 160px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
}
.detail-bd-label { color: var(--text-muted); }
.detail-bd-bar-wrap { background: var(--border); border-radius: 3px; height: 6px; overflow: hidden; }
.detail-bd-bar { height: 100%; border-radius: 3px; transition: width 0.4s; }
.detail-bd-score { color: var(--text-dim); text-align: right; }
.detail-bd-note { grid-column: 1 / -1; font-size: 0.75rem; color: var(--text-dim); padding-left: 172px; margin-top: -6px; }

.detail-pm-summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.detail-pm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 16px 0;
}

.detail-verdicts { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.detail-verdict-row {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.detail-verdict-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  min-width: 52px;
}

.detail-next-rec {
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(99,102,241,0.07);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-next-rec-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

/* ── Tab: Repurpose ── */
.detail-clip-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-clip-num {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.detail-clip-title { font-size: 1rem; font-weight: 700; }
.detail-clip-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.detail-clip-meta span::before { content: '·'; margin-right: 12px; }
.detail-clip-meta span:first-child::before { content: ''; margin: 0; }
.detail-clip-hook {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.detail-clip-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }
.detail-clip-why  { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; }

/* View outputs button in content modal */
.btn-view-outputs {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 0;
  transition: opacity 0.15s;
}
.btn-view-outputs:hover { opacity: 0.75; }

/* Empty state */
.detail-empty {
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 32px 0;
  text-align: center;
}
@media (max-width: 700px) {
  .sidebar { display: none; }
  .view-header, .brand-view-header, .brand-tabs, .tab-content, .view-body { padding-left: 20px; padding-right: 20px; }
}
