/* Media Engineered Brief Generator — Design System */

/* ── Design Tokens ───────────────────────────────────────────────────── */
:root {
  /* Brand */
  --primary-dark:  #094074;
  --primary-mid:   #3C6997;
  --primary-light: #5ADBFF;
  --accent-yellow: #FFDD4A;
  --accent-orange: #FE9000;
  --purple-dark:   #5A3D8C;
  --purple-mid:    #7B5BA6;
  --purple-light:  #9B7FBF;

  /* Semantic status */
  --success:       #059669;
  --success-light: #dcfce7;
  --success-text:  #15803d;
  --warning:       #d97706;
  --warning-light: #fef9c3;
  --warning-text:  #92400e;
  --danger:        #dc2626;
  --danger-light:  #fee2e2;
  --danger-text:   #991b1b;
  --info:          #0891b2;
  --info-light:    #cffafe;
  --info-text:     #155e75;

  /* Surfaces */
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --border:        #e2e8f0;
  --border-light:  #f1f5f9;

  /* Text */
  --text:          #0f172a;
  --text-mid:      #334155;
  --text-muted:    #64748b;

  /* Elevation */
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:     0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 24px rgba(0,0,0,0.12);

  /* Radius */
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     12px;

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Type scale */
  --text-xs:  10px;
  --text-sm:  12px;
  --text-base: 14px;
  --text-md:  16px;
  --text-lg:  20px;
  --text-xl:  24px;
  --text-2xl: 32px;
}

/* ── Reset ───────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Base ────────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding: var(--space-6) var(--space-5);
  line-height: 1.6;
  font-size: var(--text-base);
}

/* ── Button System ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 14px; height: 32px;
  font-family: inherit; font-size: var(--text-sm); font-weight: 700;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.2s; white-space: nowrap; border: none;
  text-decoration: none; line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent-orange); color: white; box-shadow: 0 2px 8px rgba(254,144,0,0.25); }
.btn-primary:hover { background: #e68000; }

.btn-success { background: var(--success); color: white; box-shadow: 0 2px 8px rgba(5,150,105,0.25); }
.btn-success:hover { filter: brightness(1.1); }

.btn-secondary { background: transparent; color: var(--primary-dark); border: 1.5px solid var(--primary-dark); }
.btn-secondary:hover { background: var(--primary-dark); color: white; }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary-mid); color: var(--primary-dark); background: rgba(9,64,116,0.04); }

.btn-danger { background: transparent; color: var(--danger); border: 2px solid var(--danger); }
.btn-danger:hover { background: var(--danger-light); }

.btn-sm { height: 28px; padding: 4px 10px; font-size: var(--text-xs); }
.btn-lg { height: 36px; padding: 8px 18px; font-size: var(--text-base); }

/* Monospace for data/prompt cells */
.font-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

#concept-container,
#index-container {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--surface);
  padding: 24px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--primary-dark);
}

/* ── Page Header ─────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 32px;
  border-bottom: 3px solid var(--primary-mid);
  padding-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0;
}
.page-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
  letter-spacing: 0.2px;
  line-height: 1;
  text-align: center;
}
.btn-primary {
  background: var(--primary-dark);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn-secondary {
  background: #f5f7fa;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(90, 219, 255, 0.1);
  border-color: var(--primary-mid);
}
.btn-save {
  background: var(--accent-orange);
  color: #fff;
}
.btn-save:hover {
  background: #e68000;
}
.btn-copy {
  background: var(--purple-mid);
  color: #fff;
}
.btn-copy:hover {
  background: var(--purple-dark);
}
.btn-danger {
  background: #E74C3C;
  color: #fff;
}
.btn-danger:hover {
  background: #C0392B;
}
.btn-small { padding: 6px 10px; font-size: 11px; }
.btn-xs { padding: 3px 6px; font-size: 10px; }

/* ── Client Block ─────────────────────────────────────────────────────── */
.client-block {
  margin-bottom: 40px;
}
.client-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-mid);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── New Round Button disabled state ─────────────────────────────────── */
.btn-new-round:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Dynamic round concept buttons (R3+) ────────────────────────────── */
.btn-dyn {
  color: #fff;
}
.btn-dyn:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 14px rgba(60,105,151,0.20);
}

/* ── Concept List / Client Page ──────────────────────────────────────── */
.clients-list {
  display: grid;
  gap: 20px;
  margin-bottom: 40px;
}
.client-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.client-card:hover {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.client-card h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

/* ── Rounds Navigation ───────────────────────────────────────────────── */
.rounds-container {
  margin-bottom: 40px;
}
.round-section {
  margin-bottom: 32px;
}
.round-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: none;
  flex-wrap: wrap;
}
.round-badge {
  background: var(--primary-mid);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.round-badge.round-badge-r2 {
  background: var(--purple-mid);
}
.round-month {
  background: rgba(0,0,0,0.08);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: capitalize;
  white-space: nowrap;
}
.round-badge-group.r1 .round-month {
  background: rgba(60, 105, 151, 0.15);
  color: var(--primary-dark);
}
.round-badge-group.r2 .round-month {
  background: rgba(123, 91, 166, 0.15);
  color: var(--purple-dark);
}
.round-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
}

.btn-grid-6 {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-mid) transparent;
}
.btn-grid-6::-webkit-scrollbar { height: 6px; }
.btn-grid-6::-webkit-scrollbar-track { background: transparent; }
.btn-grid-6::-webkit-scrollbar-thumb { background: var(--primary-mid); border-radius: 3px; }
.btn-grid-6 .nav-btn {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  flex: 0 0 220px;
  height: auto;
  overflow: hidden;
}

.nav-btn {
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  transition: all 0.2s;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(9,64,116,0.2);
}

/* R1 Concept Buttons — teal gradient */
.btn-r1-1, .btn-r1-2, .btn-r1-3, .btn-r1-4, .btn-r1-5,
.r1-vc1, .r1-vc2, .r1-vc3, .r1-vc4, .r1-vc5 {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 100%);
  color: #fff;
}
.btn-r1-1:hover, .btn-r1-2:hover, .btn-r1-3:hover, .btn-r1-4:hover, .btn-r1-5:hover,
.r1-vc1:hover, .r1-vc2:hover, .r1-vc3:hover, .r1-vc4:hover, .r1-vc5:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%), linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 100%);
  box-shadow: 0 6px 18px rgba(9,64,116,0.2);
  transform: translateY(-1px);
}

/* R2 Concept Buttons — purple gradient */
.btn-r2-1, .btn-r2-2, .btn-r2-3, .btn-r2-4, .btn-r2-5,
.r2-vc1, .r2-vc2, .r2-vc3, .r2-vc4, .r2-vc5 {
  background: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple-mid) 100%);
  color: #fff;
}
.btn-r2-1:hover, .btn-r2-2:hover, .btn-r2-3:hover, .btn-r2-4:hover, .btn-r2-5:hover,
.r2-vc1:hover, .r2-vc2:hover, .r2-vc3:hover, .r2-vc4:hover, .r2-vc5:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%), linear-gradient(135deg, var(--purple-dark) 0%, var(--purple-mid) 100%);
  box-shadow: 0 6px 18px rgba(90,61,140,0.2);
  transform: translateY(-1px);
}

/* Static Catalogue Button — orange gradient */
.btn-static, .static-cat-btn {
  background: linear-gradient(135deg, #e68000 0%, #FE9000 100%);
  color: #fff;
  font-size: 14px;
}
.btn-static:hover, .static-cat-btn:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%), linear-gradient(135deg, #e68000 0%, #FE9000 100%);
  box-shadow: 0 6px 18px rgba(254,144,0,0.2);
  transform: translateY(-1px);
}

/* Nav Button Inner Labels */
.btn-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.85;
}
.btn-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}
.btn-meta {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.75;
  letter-spacing: 0.2px;
}

/* ── Concept Details Grid ────────────────────────────────────────────── */
.concept-details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(90, 219, 255, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-mid);
}
@media (max-width: 1000px) {
  .concept-details-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .concept-details-grid { grid-template-columns: 1fr; }
}

.concept-details-grid label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.concept-details-grid input,
.concept-details-grid textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  resize: none;
  transition: all 0.15s;
}
.concept-details-grid input:hover,
.concept-details-grid textarea:hover {
  border-color: var(--primary-mid);
  background: #fff;
}
.concept-details-grid input:focus,
.concept-details-grid textarea:focus {
  border-color: var(--primary-mid);
  outline: none;
  box-shadow: 0 0 0 2px rgba(60, 105, 151, 0.12);
}
.concept-details-grid input[readonly] {
  background: #f0f0f0;
  color: #999;
  cursor: not-allowed;
}

/* ── Concept Details Sections ────────────────────────────────────────── */
.concept-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #f9fafb;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-mid);
}
.concept-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-dark);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.concept-section textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  line-height: 1.5;
  min-height: 100px;
  resize: vertical;
}
.concept-section textarea:focus {
  border-color: var(--primary-mid);
  outline: none;
  box-shadow: 0 0 0 2px rgba(60, 105, 151, 0.12);
}

/* ── Shots Table ─────────────────────────────────────────────────────── */
.table-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.table-controls .btn {
  background: var(--primary-mid);
  color: #fff;
}
.table-controls .btn:hover {
  background: var(--primary-dark);
}
.table-controls .btn-secondary {
  background: #f5f7fa;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.table-controls .btn-secondary:hover {
  background: rgba(90, 219, 255, 0.1);
  border-color: var(--primary-mid);
}
.table-controls select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  font-weight: 600;
}
.shots-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 20px;
}
.shots-table {
  width: 100%;
  /* `separate` is required for `position: sticky` to work on td/th cells.
     `border-spacing: 0` keeps the visual look identical to the old collapsed mode. */
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
}
.shots-table th {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 100%);
  color: #fff;
  padding: 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid rgba(255,255,255,0.15);
  position: sticky;
  top: 0;
  z-index: 2;
  user-select: none;
  overflow: visible;
}
.shots-table th::after {
  content: '';
  position: absolute;
  right: 2px;
  top: 20%;
  height: 60%;
  width: 3px;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
  cursor: col-resize;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.shots-table th:hover::after {
  opacity: 1;
}
/* Suppress resize handle on the three frozen left columns — they can't be resized */
#shots-table th:nth-child(1)::after,
#shots-table th:nth-child(2)::after,
#shots-table th:nth-child(3)::after { display: none; }

/* Lock frozen header cells: exact widths, no internal borders */
#shots-table th:nth-child(1) {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  border-right: none !important;
}
#shots-table th:nth-child(2) {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  border-right: none !important;
}
.shots-table th:last-child { border-right: none; }
.shots-table td {
  position: relative;
  padding: 2px;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  vertical-align: top;
}
.shots-table td:last-child { border-right: none; }
.shots-table tr:last-child td { border-bottom: none; }
.shots-table tr:hover td { background: rgba(60, 105, 151, 0.04); }
.shots-table tr.hook-row td { background: #f9f9f9; }
.shots-table tr.body-row td { background: #fff; }
.shots-table tr.row-modified td { background: #fffbeb; }

.shots-table input[type="text"] {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
  font-family: inherit;
  background: transparent;
  resize: none;
  line-height: 1.4;
  box-sizing: border-box;
}
/* ── Fluid textarea fill: fills entire table cell ── */
#shots-table tr[data-shot-id] {
  height: 48px; /* uniform baseline; resize.js overrides with style.height when dragged */
}
/* TD cells that contain textareas must have no padding so inset:0 fills cleanly */
.shots-table td:has(> textarea) {
  padding: 0;
}
.shots-table td textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 4px 6px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 12px;
  font-family: inherit;
  background: transparent;
  resize: none;
  line-height: 1.4;
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: unset;
  /* Thin overlay scrollbar — no gutter, hidden until hover */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
/* Show scrollbar thumb on hover / focus */
.shots-table td textarea:hover,
.shots-table td textarea:focus {
  scrollbar-color: rgba(0,0,0,0.16) transparent;
}
/* Webkit: 4px track, thumb hidden until hover */
.shots-table td textarea::-webkit-scrollbar       { width: 4px; }
.shots-table td textarea::-webkit-scrollbar-track { background: transparent; }
.shots-table td textarea::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}
.shots-table td textarea:hover::-webkit-scrollbar-thumb,
.shots-table td textarea:focus::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.16);
}
.shots-table input[type="text"]:hover,
.shots-table td textarea:hover {
  border-color: var(--border);
  background: #fff;
}
.shots-table input[type="text"]:focus,
.shots-table td textarea:focus {
  border-color: var(--primary-mid);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(60, 105, 151, 0.12);
}
/* All table cells use the same font (Inter via inherit) */

/* ── Sticky shot serial column ───────────────────────────────────────────── */
#shots-table .sticky-serial-cell {
  position: sticky;
  left: 56px; /* 28px checkbox col + 28px drag handle col */
  z-index: 1;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  background: #1e4d7a;
  border-right: 2px solid rgba(255,255,255,0.25);
  padding: 0; /* textarea fills with absolute inset */
}
/* Subtle shadow to show scroll state */
#shots-table .sticky-serial-cell::after {
  content: '';
  position: absolute;
  top: 0; right: -5px; bottom: 0;
  width: 5px;
  background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
  pointer-events: none;
  z-index: 2;
}
/* Serial cell textarea: white text, centered, header-family feel */
#shots-table .sticky-serial-cell textarea {
  color: rgba(255,255,255,0.92) !important;
  background: transparent !important;
  font-weight: 700 !important;
  text-align: center !important;
  font-size: 11px !important;
  letter-spacing: 0.3px;
  border: none !important;
  box-shadow: none !important;
  caret-color: white;
}
#shots-table .sticky-serial-cell textarea:hover {
  background: rgba(255,255,255,0.06) !important;
  border: none !important;
  box-shadow: none !important;
}
#shots-table .sticky-serial-cell textarea:focus {
  background: rgba(255,255,255,0.1) !important;
  border: none !important;
  box-shadow: none !important;
  /* Keep outline — .cell-editing (white) overrides the default blue below */
  outline: 2px solid rgba(255,255,255,0.45) !important;
}
/* cell-selected and cell-editing: white outline on dark background */
#shots-table .sticky-serial-cell .cell-selected,
#shots-table .sticky-serial-cell .cell-editing {
  outline: 2px solid rgba(255,255,255,0.75) !important;
  background: rgba(255,255,255,0.13) !important;
}

/* ── Frozen column 1: checkbox ───────────────────────────────────────────── */
#shots-table td.row-select-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  background: white;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  border-right: none !important;
}

/* ── Frozen column 2: drag handle ────────────────────────────────────────── */
#shots-table td.drag-handle-cell {
  position: sticky;
  left: 28px;
  z-index: 1;
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  border-right: none !important;
  /* background set inline (#e0f4f8) */
}

/* Drag handle column */
.drag-handle-col {
  width: 28px;
  background: #e8eef5;
  border-right: 1px solid var(--border);
  text-align: center;
  cursor: grab;
}
.drag-handle-col:active { cursor: grabbing; }
.drag-handle {
  color: var(--primary-mid);
  font-size: 14px;
  line-height: 1;
  user-select: none;
}
tr[draggable="true"] { opacity: 0.6; background: rgba(90, 219, 255, 0.15) !important; }
tr.drag-over-above td { border-top: 3px solid var(--primary-mid); }

.serial-cell {
  font-weight: 800;
  color: var(--primary-dark);
  font-size: 10px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  padding: 8px 7px !important;
  vertical-align: middle !important;
}
.action-cell {
  text-align: center;
  white-space: nowrap;
  padding: 4px 5px !important;
  vertical-align: middle !important;
}
.action-cell-inner {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

/* ── Static Assets Table ─────────────────────────────────────────────── */
.static-page-header {
  margin-bottom: 24px;
  border-bottom: 3px solid var(--primary-mid);
  padding-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.static-page-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.static-page-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.filter-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-bar label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 2px;
}
.filter-btn {
  padding: 5px 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 0.2px;
  color: var(--text-mid);
}
.filter-btn.active {
  background: var(--primary-mid);
  color: #fff;
  border-color: var(--primary-mid);
}
.filter-btn:hover:not(.active) {
  background: rgba(90, 219, 255, 0.1);
  border-color: var(--primary-mid);
  color: var(--primary-dark);
}

.concept-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 4px 4px 0 0;
  color: #fff;
  flex-wrap: wrap;
}
.concept-section-header h2 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0;
  color: #fff;
  border: none;
  padding: 0;
}
.concept-meta-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.section-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.static-table-wrap {
  overflow-x: auto;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  background: #fff;
}
.static-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  min-width: 1500px;
}
.static-table th {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 100%);
  color: #fff;
  padding: 8px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.15);
  position: sticky;
  top: 0;
  z-index: 2;
  user-select: none;
  overflow: visible;
}
.static-table th::after {
  content: '';
  position: absolute;
  right: 2px;
  top: 20%;
  height: 60%;
  width: 3px;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
  cursor: col-resize;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.static-table th:hover::after {
  opacity: 1;
}
.static-table th:last-child { border-right: none; }
.static-table td {
  position: relative;
  padding: 2px;
  border-bottom: 1px solid #f0f0f0;
  border-right: 1px solid #f0f0f0;
  vertical-align: top;
}
.static-table td:last-child { border-right: none; }
.static-table tr:last-child td { border-bottom: none; }
.static-table tr:hover td { background: rgba(90, 219, 255, 0.1); }
.static-table tr.row-modified td { background: #fffbeb; }

.static-table input[type="text"] {
  width: 100%;
  padding: 4px 5px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 11px;
  font-family: inherit;
  background: transparent;
  resize: none;
  line-height: 1.4;
  box-sizing: border-box;
}
/* ── Fluid textarea fill: fills entire table cell ── */
.static-table tr[data-id] {
  height: 80px; /* default static row height */
}
.static-table td textarea {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  padding: 3px 4px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 11px;
  font-family: inherit;
  background: transparent;
  resize: none;
  line-height: 1.4;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: unset;
}
.static-table input[type="text"]:hover,
.static-table td textarea:hover {
  border-color: var(--border);
  background: #fff;
}
.static-table input[type="text"]:focus,
.static-table td textarea:focus {
  border-color: var(--primary-mid);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(60, 105, 151, 0.12);
}

/* ── Global Save Bar ─────────────────────────────────────────────────── */
.global-save-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--primary-dark);
  color: #fff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
  transform: translateY(100%);
  transition: transform 0.25s;
  font-size: 12px;
}
.global-save-bar.visible {
  transform: translateY(0);
}
.global-save-bar p {
  font-weight: 600;
}
.global-save-bar-actions {
  display: flex;
  gap: 8px;
}

.save-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}
.save-status.saved {
  color: #27AE60;
  font-weight: 700;
}
.save-status.error {
  color: #E74C3C;
  font-weight: 700;
}

.restored-flash {
  animation: flash-green 0.8s ease;
}
@keyframes flash-green {
  0% { background: rgba(0, 170, 85, 0.25); }
  100% { background: transparent; }
}

#assets-container {
  padding-bottom: 60px;
}

/* ── Client Page Action Buttons — unified style ──────────────────────── */
.btn-back-clients,
.btn-brand-context,
.btn-manage-playbook,
.btn-manage-products,
.btn-manage-rounds,
.btn-new-round {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 2px solid var(--primary-mid);
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  color: var(--primary-mid);
  line-height: 1;
}

.btn-back-clients:hover,
.btn-brand-context:hover,
.btn-manage-playbook:hover,
.btn-manage-products:hover,
.btn-manage-rounds:hover,
.btn-new-round:hover {
  background: var(--primary-mid);
  color: #fff;
  box-shadow: 0 4px 14px rgba(60, 105, 151, 0.22);
  transform: translateY(-1px);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .concept-details-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  body { padding: 16px 12px; }
  #concept-container,
  #index-container { padding: 16px; }
  .page-header { flex-direction: column; }
  .concept-details-grid { grid-template-columns: 1fr; }
  .shots-table { font-size: 10px; }
  .table-controls { flex-direction: column; width: 100%; }
  .table-controls select { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════
   MASTER CREATIVE PLAYBOOK
   ══════════════════════════════════════════════════════════════════════ */
#playbook-container {
  max-width: 100%;
  margin: 0 auto;
  background: var(--surface);
  padding: 24px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border-top: 3px solid #7c3aed;
}

.playbook-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.playbook-summary-card {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  background: var(--surface);
}
.playbook-summary-card .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}
.playbook-summary-card .value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
  line-height: 1.1;
}
.playbook-summary-card.status-produced  { border-color: #86efac; }
.playbook-summary-card.status-produced .value { color: var(--success-text); }
.playbook-summary-card.status-winner    { border-color: #d8b4fe; }
.playbook-summary-card.status-winner .value { color: #6d28d9; }
.playbook-summary-card.status-in-progress { border-color: #93c5fd; }
.playbook-summary-card.status-in-progress .value { color: #1d4ed8; }

.playbook-matrix-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 280px);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--surface);
  margin-bottom: 20px;
}
.playbook-matrix {
  /* width:max-content means the table is exactly as wide as its column content —
     no browser stretching or compressing. Column widths are controlled directly
     by inline min-width/max-width/width styles on th/td cells (concept-page
     approach via _applyColWidths()). The wrapper's overflow-x:auto handles scroll. */
  width: max-content;
  border-collapse: collapse;
  font-size: 11px;
}
.playbook-matrix thead th {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}
.playbook-matrix thead th.playbook-row-label-col {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
  /* width controlled by <col data-col-key="label"> in colgroup */
}
/* Placeholder cells in T1/T2/T3/T4 rows — blend into row, centred copy button */
.tier-corner-placeholder {
  /* Keep the right border so the vertical divider runs the full header height */
  border-right: 1px solid rgba(255,255,255,0.25) !important;
  padding: 0 !important;
  width: auto;
  text-align: center !important;
  vertical-align: middle !important;
}
.playbook-matrix thead th:last-child { border-right: none; }
.playbook-matrix th .col-short-code {
  display: block;
  font-size: 9px;
  font-weight: 600;
  opacity: 0.75;
  margin-top: 2px;
  letter-spacing: 0.3px;
  text-transform: none;
}

/* ── Tier column header styling (rotated layout) ── */
/* Colour logic — fluro-pastel spectrum:
   T1 vivid purple  = strategic backbone (creative authority)
   T2 electric blue = persuasive lens (analytical clarity)
   T3 vivid emerald = broad creative category (organic / systemic)
   T4 teal gradient = specific angle (product-execution level, matches product tab)
*/
.playbook-matrix .tier-col-1 {
  background: #9333ea !important;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.2);
}
.playbook-matrix .tier-col-2 {
  background: #2563eb !important;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 8px 12px;
  text-align: center;
  letter-spacing: 0.3px;
  border-right: 1px solid rgba(255,255,255,0.15);
  text-transform: none;
}
/* T3 = NEW broad angle category row — static (no sticky), sits above T4 */
.playbook-matrix .tier-col-3 {
  background: #059669 !important;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 10px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.15);
  white-space: normal;
  text-transform: none;
  letter-spacing: 0.2px;
  overflow: hidden;
  /* T3 sticks at top — T1/T2 scroll away, T3+T4 remain visible */
  position: sticky;
  top: 0;
  z-index: 3;
}
.playbook-matrix .tier-col-3-uncategorized {
  background: rgba(100,116,139,0.25) !important;
  color: rgba(255,255,255,0.55);
  font-style: italic;
  text-align: center;
}
.playbook-matrix .tier-col-3-placeholder {
  background: rgba(5,150,105,0.15) !important;
  min-width: 100px;
  text-align: center;
}
/* T4 = specific angle column headers (was T3) — STICKY row */
.playbook-matrix .tier-col-4 {
  background: linear-gradient(135deg, #0e7490 0%, #0891b2 100%) !important;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 8px 10px;
  /* width controlled by <col> in colgroup — no min/max-width here */
  text-align: left;
  vertical-align: middle;
  border-right: 1px solid rgba(255,255,255,0.5);
  white-space: normal;
  text-transform: none;
  overflow: hidden;
  /* T4 sticks below T3 — top is set dynamically by _fixStickyT4Top() after render */
  position: sticky;
  top: 0;
  z-index: 2;
}
.playbook-matrix .tier-col-4-desc {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  margin-top: 3px;
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
}
.playbook-matrix .tier-col-4-placeholder {
  background: rgba(14,116,144,0.2) !important;
  min-width: 100px;
  text-align: center;
}

/* ── Product scope pills (T3 + T4 master-view attribution) ─────── */
.product-scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(255,255,255,0.9);
  border: 1px solid currentColor;
}
.product-scope-pill::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
/* 6 cycling product colours */
.product-scope-pill.general-pill { background: #e0f2fe; color: #0369a1; }
.pcolor-0 { color: #0891b2; }
.pcolor-1 { color: #7c3aed; }
.pcolor-2 { color: #dc2626; }
.pcolor-3 { color: #d97706; }
.pcolor-4 { color: #16a34a; }
.pcolor-5 { color: #db2777; }
/* Attribution row: legacy wrapper (kept for backward compat, no longer generated in headers) */
.attr-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
/* Persona emoji attribution — compact emoji string, inline in flex header rows */
.persona-attr-emojis {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 1px;
  opacity: 0.85;
  flex-shrink: 0;
}
/* ── T3 corner cell: sticky on both left and top axes ─────────────── */
.playbook-matrix th.tier-col-3.tier-corner-placeholder {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 5;
}
/* ── Single-line flex header for T4 angle columns ─────────────────── */
.playbook-matrix .t4-header-main {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.playbook-matrix .t4-title-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 10px;
}
/* ── Single-line flex header for T3 angle category columns ─────────── */
.playbook-matrix .t3-header-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.playbook-matrix .t3-title-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  font-size: 10px;
}
/* ── T5 Angle Expression placeholder (none defined for this persona) ── */
.t5-empty-placeholder {
  font-size: 9px;
  color: rgba(255,255,255,0.35);
  font-style: italic;
  padding: 3px 0 2px 0;
  display: block;
}
.tier-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 8px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.tier-add-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
}

/* ─── Column resize handles ────────────────────────────────────── */
/* Placed at the right edge of any resizable <th>.
   The th must have position:sticky or position:relative to anchor it. */
.col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 10;
  background: transparent;
  transition: background 0.12s;
  /* Solid white column divider — visible separator between T4 columns */
  border-right: 2px solid rgba(255,255,255,0.75);
}
.col-resize-handle:hover,
.col-resize-handle.col-resize-active {
  background: rgba(255, 255, 255, 0.4);
}
/* Label column handle sits on a white/light background, use purple tint */
.playbook-row-label-col .col-resize-handle {
  background: transparent;
}
.playbook-row-label-col .col-resize-handle:hover,
.playbook-row-label-col .col-resize-handle.col-resize-active {
  background: rgba(124, 58, 237, 0.25);
}

/* Style group header rows (Video Styles / Static Styles) */
.playbook-matrix .style-group-header td {
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 14px;
  position: sticky;
  left: 0;
}

/* Style row label cell (leftmost) */
.playbook-matrix .style-label-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  /* width controlled by <col data-col-key="label"> in colgroup */
  overflow: hidden;
  background: var(--surface);
  padding: 10px 14px;
  border-right: 2px solid var(--border);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  vertical-align: middle;
}
.playbook-matrix .style-label-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0; /* allow flex item to respect parent colgroup width */
}
.playbook-matrix .style-label-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.playbook-matrix .style-short-code {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.playbook-matrix .matrix-cell-empty {
  background: rgba(0,0,0,0.02);
  cursor: default !important;
}

/* Sticky left column should keep its white background on hover */
.playbook-matrix .style-row:hover .style-label-cell {
  background: #faf5ff;
}

/* ── Matrix cells ── */
.matrix-cell {
  padding: 8px 10px;
  /* width driven by colgroup — no min/max-width needed */
  vertical-align: top;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
  background: var(--surface);
}
.matrix-cell:hover { background: rgba(124,58,237,0.05); }
.matrix-cell .cell-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.matrix-cell .cell-preview {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
  max-height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.matrix-cell .cell-link-badge {
  display: inline-block;
  font-size: 9px;
  color: #7c3aed;
  font-weight: 700;
  margin-top: 6px;
  padding: 2px 6px;
  background: rgba(124,58,237,0.1);
  border-radius: 3px;
}
.matrix-cell .cell-asset-count {
  display: inline-block;
  font-size: 9px;
  color: var(--success-text);
  font-weight: 700;
  margin-top: 4px;
  margin-left: 4px;
}
.matrix-cell .cell-result-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 4px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #fef3c7;
  color: #92400e;
}

/* ── Status pill colors (consistent everywhere) ── */
.cell-pill.pill-not-started { background: #e5e7eb; color: #6b7280; }
.cell-pill.pill-idea        { background: var(--warning-light); color: var(--warning-text); }
.cell-pill.pill-planned     { background: var(--info-light);    color: var(--info-text); }
.cell-pill.pill-in-progress { background: #dbeafe; color: #1d4ed8; }
.cell-pill.pill-produced    { background: var(--success-light); color: var(--success-text); }
.cell-pill.pill-winner      { background: #f3e8ff; color: #6d28d9; }
.cell-pill.pill-archived    { background: #f1f5f9; color: #94a3b8; }

/* ── Edit mode ── */
.playbook-matrix.edit-mode .matrix-cell { cursor: default; pointer-events: none; opacity: 0.55; }
.playbook-matrix.edit-mode .row-edit-actions,
.playbook-matrix.edit-mode .col-edit-actions { display: inline-flex; }
.row-edit-actions, .col-edit-actions { display: none; gap: 4px; margin-left: 8px; }
.row-edit-actions button, .col-edit-actions button {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  background: rgba(255,255,255,0.15);
  color: #fff;
  transition: all 0.15s;
}
.tier-row.tier-2 .row-edit-actions button,
.tier-row.tier-3 .row-edit-actions button {
  background: rgba(124,58,237,0.15);
  color: #7c3aed;
}
.row-edit-actions button:hover, .col-edit-actions button:hover {
  filter: brightness(1.2);
}

/* Structure-add buttons (tail of each tier group) */
.playbook-add-row {
  text-align: center;
  padding: 8px;
  background: rgba(124,58,237,0.04);
  border-bottom: 1px dashed rgba(124,58,237,0.25);
}
.playbook-add-row button {
  background: transparent;
  color: #7c3aed;
  border: 1.5px dashed #7c3aed;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.playbook-add-row button:hover {
  background: rgba(124,58,237,0.1);
}

/* Empty playbook state */
.playbook-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.playbook-empty h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 8px;
}
.playbook-empty p {
  font-size: 13px;
  margin-bottom: 20px;
}
.playbook-empty button {
  padding: 10px 20px;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.playbook-empty button:hover {
  background: #6d28d9;
  transform: translateY(-1px);
}

/* ── Matrix wrapper: constrained width when no data cols yet (edit mode) ── */
.playbook-matrix-wrap.state-empty {
  width: fit-content;
  max-width: 100%;
  min-width: min(700px, 100%);
}

/* ── Onboarding card — shown instead of the full-width matrix when empty ── */
.playbook-onboarding-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 32px;
  max-width: 460px;
  margin: 0 auto 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  text-align: center;
}
.poc-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 2px;
}
.poc-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.2px;
}
.poc-body {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 360px;
}
.poc-body strong { color: var(--text); font-weight: 700; }
.poc-btn {
  margin-top: 6px;
  padding: 9px 22px;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  letter-spacing: 0.2px;
}
.poc-btn:hover {
  background: #6d28d9;
  transform: translateY(-1px);
}
