/* Phase 117: Podcast Studio — Clean Editorial Redesign */

/* ─── Flash prevention: hide raw podcast-app until pod117 shell is inserted ── */
/* The app starts empty or with the old phase113 markup; we keep it invisible
   until renderPodcast() appends .pod117-shell (adding data-pod117-ready).
   Once ready, we fade in smoothly. */

body[data-active-view="podcast-app"] #podcast-app:not([data-pod117-ready]) {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}

body[data-active-view="podcast-app"] #podcast-app[data-pod117-ready] {
  opacity: 1;
  transition: opacity 0.18s ease !important;
}

/* ─── App background ──────────────────────────────────────────────────────── */

body[data-active-view="podcast-app"] #podcast-app {
  background: #F0EDE8 !important;
  overflow-x: hidden !important;
}

/* Legacy sibling shells hidden via JS class — no inline-style overwrite */
body[data-active-view="podcast-app"] #podcast-app > .pod117-legacy-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* ─── Force phase117 shell visible — override phase113 hide rules ─────────── */

body[data-active-view="podcast-app"] #podcast-app > .pod117-shell,
body[data-active-view="podcast-app"] #podcast-app > .pod117-wz-wrap {
  display: flex !important;
  flex-direction: column !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
  min-height: 100% !important;
}

/* ─── CSS variables ──────────────────────────────────────────────────────── */

.pod117-shell,
.pod117-wz-wrap {
  --p-bg: #F0EDE8;
  --p-surface: #FFFFFF;
  --p-border: #E0DDD9;
  --p-ink: #111827;
  --p-muted: #6B7280;
  --p-faint: #9CA3AF;
  --p-blue: #2563EB;
  --p-green: #059669;
  --p-amber: #D97706;
  --p-red: #DC2626;
  --p-purple: #7C3AED;
  --p-radius: 12px;
  --p-radius-sm: 8px;
  --p-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --p-shadow-panel: 0 0 0 1px rgba(0,0,0,.07), 4px 0 24px rgba(0,0,0,.09);
  font-family: ui-sans-serif, "Aptos", "Segoe UI", system-ui, sans-serif;
  color: var(--p-ink);
  min-height: 100%;
  box-sizing: border-box;
}

/* ─── Shell ──────────────────────────────────────────────────────────────── */

.pod117-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-bottom: 80px;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */

.pod117-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
  gap: 16px;
}

.pod117-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.pod117-header-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.pod117-show-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--p-ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.3px;
}

.pod117-show-meta {
  font-size: 12px;
  color: var(--p-muted);
  margin: 2px 0 0;
}

.pod117-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── KPI strip ──────────────────────────────────────────────────────────── */

.pod117-kpis {
  display: flex;
  align-items: stretch;
  background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pod117-kpis::-webkit-scrollbar { display: none; }

.pod117-kpi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 20px;
  border-right: 1px solid var(--p-border);
  white-space: nowrap;
  min-width: 0;
}

.pod117-kpi:first-child { padding-left: 0; }
.pod117-kpi:last-child { border-right: none; }

.pod117-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--p-ink);
  line-height: 1.1;
  letter-spacing: -.5px;
}

.pod117-kpi-label {
  font-size: 11px;
  color: var(--p-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-weight: 500;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */

.pod117-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: flex-start;
  gap: 0;
  position: relative;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */

.pod117-sidebar {
  width: 256px;
  min-width: 256px;
  flex-shrink: 0;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  position: sticky;
  top: 0;
}

.pod117-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */

.pod117-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 14px;
  box-shadow: var(--p-shadow);
}

.pod117-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* ─── Main content ───────────────────────────────────────────────────────── */

.pod117-main {
  flex: 1;
  min-width: 0;
  border-left: 1px solid var(--p-border);
  border-right: 1px solid var(--p-border);
  background: var(--p-surface);
}

.pod117-shell.panel-open .pod117-main {
  min-width: 0;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */

.pod117-tabs-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pod117-tab-nav {
  display: flex;
  border-bottom: 1px solid var(--p-border);
  padding: 0 20px;
  gap: 0;
}

.pod117-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--p-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}

.pod117-tab:hover { color: var(--p-ink); }
.pod117-tab.active { color: var(--p-ink); border-bottom-color: var(--p-ink); font-weight: 600; }

.pod117-tab-body {
  padding: 20px;
  overflow-y: auto;
}

/* ─── Episode toolbar ────────────────────────────────────────────────────── */

.pod117-ep-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pod117-view-toggle {
  display: flex;
  gap: 4px;
  background: #F3F4F6;
  padding: 3px;
  border-radius: var(--p-radius-sm);
}

.pod117-view-btn {
  background: transparent;
  border: none;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--p-muted);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all .12s;
}

.pod117-view-btn.active {
  background: var(--p-surface);
  color: var(--p-ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ─── Table view ─────────────────────────────────────────────────────────── */

.pod117-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
}

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

.pod117-table thead th {
  background: #F9FAFB;
  border-bottom: 1px solid var(--p-border);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--p-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.pod117-table tbody tr {
  border-bottom: 1px solid #F3F4F6;
  transition: background .1s;
  cursor: default;
}

.pod117-table tbody tr:last-child { border-bottom: none; }
.pod117-table tbody tr:hover { background: #FAFAFA; }
.pod117-table tbody tr.selected { background: #EFF6FF; }
.pod117-table tbody tr.selected:hover { background: #DBEAFE; }

.pod117-table td {
  padding: 11px 14px;
  vertical-align: middle;
}

.col-num { width: 44px; }
.col-status { width: 100px; }
.col-date { width: 110px; }
.col-prog { width: 120px; }
.col-act { width: 80px; }

.pod117-ep-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #F3F4F6;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--p-muted);
}

.pod117-ep-name {
  font-weight: 500;
  color: var(--p-ink);
}

.pod117-prog-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pod117-prog-pct {
  font-size: 11px;
  color: var(--p-muted);
  min-width: 28px;
}

.pod117-row-open {
  background: none;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--p-blue);
  cursor: pointer;
  font-weight: 500;
  transition: all .12s;
  white-space: nowrap;
}

.pod117-row-open:hover { background: var(--p-blue); color: #fff; border-color: var(--p-blue); }

/* ─── Board view ─────────────────────────────────────────────────────────── */

.pod117-board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.pod117-board-col {
  min-width: 180px;
  max-width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pod117-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-radius: var(--p-radius-sm) var(--p-radius-sm) 0 0;
  background: #F9FAFB;
  border: 1px solid var(--p-border);
  border-bottom: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--p-muted);
}

.pod117-board-count {
  background: var(--p-border);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
}

.pod117-board-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--p-border);
  border-radius: 0 0 var(--p-radius-sm) var(--p-radius-sm);
  padding: 8px;
  background: #FAFAF9;
  min-height: 60px;
}

.pod117-board-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow .12s, transform .1s;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.pod117-board-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  transform: translateY(-1px);
}

.pod117-board-ep-num { font-size: 10px; color: var(--p-faint); margin: 0 0 2px; font-weight: 600; text-transform: uppercase; }
.pod117-board-ep-title { font-size: 12.5px; font-weight: 600; color: var(--p-ink); margin: 0 0 4px; line-height: 1.3; }
.pod117-board-meta { font-size: 11px; color: var(--p-muted); margin: 2px 0 0; }
.pod117-board-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--p-faint); }

/* ─── Empty states ───────────────────────────────────────────────────────── */

.pod117-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 24px;
  max-width: 380px;
  margin: 0 auto;
}

.pod117-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: .7;
}

.pod117-empty h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--p-ink);
  margin: 0 0 8px;
}

.pod117-empty p {
  font-size: 14px;
  color: var(--p-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.pod117-template-row {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* ─── Guests ─────────────────────────────────────────────────────────────── */

.pod117-guests-wrap { display: flex; flex-direction: column; gap: 16px; }

.pod117-pipeline-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #F9FAFB;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 10px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pod117-pipeline-bar::-webkit-scrollbar { display: none; }

.pod117-pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  border-radius: 6px;
  min-width: 60px;
}

.pod117-pipeline-step.has-guests { background: #EFF6FF; }

.pod117-pipeline-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--p-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}

.pod117-pipeline-cnt {
  font-size: 16px;
  font-weight: 700;
  color: var(--p-ink);
}

.pod117-pipeline-arrow {
  color: var(--p-faint);
  font-size: 14px;
  flex-shrink: 0;
}

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

.pod117-guest-card {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--p-shadow);
}

.pod117-guest-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pod117-guest-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.pod117-guest-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pod117-guest-fields { display: flex; flex-direction: column; gap: 6px; }

.pod117-guest-linked {
  font-size: 11.5px;
  color: var(--p-blue);
  background: #EFF6FF;
  border-radius: 6px;
  padding: 5px 10px;
  font-weight: 500;
}

/* ─── Show Setup ─────────────────────────────────────────────────────────── */

.pod117-show-wrap { display: flex; flex-direction: column; gap: 20px; }

.pod117-show-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--p-border);
}

.pod117-show-head h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}

.pod117-show-score {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pod117-score-info { text-align: center; }
.pod117-score-info strong { display: block; font-size: 18px; font-weight: 700; }
.pod117-score-info small { font-size: 11px; color: var(--p-muted); }

.pod117-setup-section {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  padding: 18px 20px;
  box-shadow: var(--p-shadow);
}

.pod117-setup-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--p-ink);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--p-border);
}

/* ─── Episode detail panel ───────────────────────────────────────────────── */

.pod117-panel {
  width: 400px;
  min-width: 360px;
  max-width: 440px;
  border-left: 1px solid var(--p-border);
  background: var(--p-surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--p-shadow-panel);
  position: sticky;
  top: 0;
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.pod117-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--p-border);
  background: #FAFAF9;
  flex-shrink: 0;
}

.pod117-panel-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pod117-panel-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--p-muted);
  white-space: nowrap;
  background: #F3F4F6;
  padding: 3px 7px;
  border-radius: 5px;
}

.pod117-panel-title-input {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--p-ink);
  border: none;
  background: transparent;
  outline: none;
  padding: 3px 6px;
  border-radius: 5px;
}

.pod117-panel-title-input:hover { background: #F3F4F6; }
.pod117-panel-title-input:focus { background: #EFF6FF; outline: 2px solid var(--p-blue); }

.pod117-status-sel {
  font-size: 12px;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--p-surface);
  color: var(--p-ink);
  cursor: pointer;
  flex-shrink: 0;
}

.pod117-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--p-border);
  padding: 0 4px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.pod117-panel-tabs::-webkit-scrollbar { display: none; }

.pod117-ptab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--p-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
  margin-bottom: -1px;
}

.pod117-ptab:hover { color: var(--p-ink); }
.pod117-ptab.active { color: var(--p-ink); border-bottom-color: var(--p-ink); font-weight: 600; }

.pod117-ptab-pct {
  font-size: 10px;
  font-weight: 700;
  opacity: .8;
}

.pod117-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pod117-psect h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--p-muted);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F3F4F6;
}

.pod117-rec-score {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #F9FAFB;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border);
}

.pod117-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pod117-section-head h4 { margin: 0; border: none; padding: 0; }

/* ─── Deliverables ───────────────────────────────────────────────────────── */

.pod117-deliverables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pod117-deliverable {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--p-border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  transition: all .12s;
  color: var(--p-muted);
}

.pod117-deliverable:hover { border-color: var(--p-green); color: var(--p-ink); }
.pod117-deliverable.done { background: #F0FDF4; border-color: #86EFAC; color: #15803D; font-weight: 500; }
.pod117-deliverable input { accent-color: var(--p-green); }

/* ─── Segment editor ─────────────────────────────────────────────────────── */

.pod117-seg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pod117-seg-header h4 { margin: 0; border: none; padding: 0; }

.pod117-segs { display: flex; flex-direction: column; gap: 6px; }

.pod117-seg {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F9FAFB;
  border: 1px solid var(--p-border);
  border-radius: 8px;
  padding: 7px 10px;
}

.pod117-seg-drag {
  color: var(--p-faint);
  font-size: 12px;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.pod117-seg-fields {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.pod117-seg-del {
  background: none;
  border: none;
  color: var(--p-faint);
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
  line-height: 1;
  transition: color .12s;
  flex-shrink: 0;
}

.pod117-seg-del:hover { color: var(--p-red); }

/* ─── Checklist / QC ─────────────────────────────────────────────────────── */

.pod117-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pod117-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--p-border);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--p-muted);
  transition: all .12s;
}

.pod117-check-item:hover { border-color: var(--p-blue); color: var(--p-ink); }
.pod117-check-item.checked { background: #EFF6FF; border-color: #93C5FD; color: var(--p-ink); font-weight: 500; }
.pod117-check-item input { accent-color: var(--p-blue); }

/* ─── Metrics pills ──────────────────────────────────────────────────────── */

.pod117-metrics-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.pod117-metric-pill {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #15803D;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
}

/* ─── Sidebar-specific styles ────────────────────────────────────────────── */

.pod117-eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--p-muted);
  margin: 0 0 8px;
}

.pod117-next-action {
  font-size: 13px;
  color: var(--p-ink);
  margin: 0;
  line-height: 1.5;
  font-weight: 500;
}

.pod117-health-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pod117-health-info { display: flex; flex-direction: column; }
.pod117-health-info strong { font-size: 22px; font-weight: 700; }
.pod117-health-info small { font-size: 11px; color: var(--p-muted); }

.pod117-active-ep-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--p-ink);
  margin: 4px 0 6px;
  line-height: 1.4;
}

.pod117-active-ep-prog { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }

.pod117-prog-label {
  font-size: 10px;
  color: var(--p-faint);
  display: block;
  margin-top: 2px;
}

.pod117-checklist {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pod117-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--p-muted);
}

.pod117-checklist li.done { color: var(--p-ink); text-decoration: line-through; opacity: .6; }

.pod117-check-dot {
  font-size: 12px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.pod117-checklist li.done .pod117-check-dot { color: var(--p-green); }

.pod117-tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pod117-tool-btn {
  background: #F3F4F6;
  border: 1px solid var(--p-border);
  border-radius: 7px;
  padding: 7px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--p-muted);
  cursor: pointer;
  text-align: center;
  transition: all .12s;
}

.pod117-tool-btn:hover { background: var(--p-surface); color: var(--p-ink); border-color: var(--p-blue); }

/* ─── Forms ──────────────────────────────────────────────────────────────── */

.pod117-form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pod117-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 160px;
  min-width: 120px;
}

.pod117-field.wide { flex: 1 1 100%; }
.pod117-field.inline { flex: 0 1 auto; }

.pod117-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--p-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.pod117-field input,
.pod117-field select,
.pod117-field textarea {
  background: #FAFAFA;
  border: 1px solid var(--p-border);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--p-ink);
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
  box-sizing: border-box;
}

.pod117-field input:focus,
.pod117-field select:focus,
.pod117-field textarea:focus {
  outline: none;
  border-color: var(--p-blue);
  background: var(--p-surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.pod117-field textarea { resize: vertical; line-height: 1.5; }
.pod117-field select { cursor: pointer; }

.pod117-seg-fields .pod117-field { flex: 0 1 auto; min-width: 0; }
.pod117-seg-fields .pod117-field:first-child { flex: 0 0 110px; }
.pod117-seg-fields .pod117-field:nth-child(2) { flex: 1 1 80px; }
.pod117-seg-fields .pod117-field:last-child { flex: 0 0 64px; }

.pod117-guest-meta .pod117-field input,
.pod117-guest-meta .pod117-field select { padding: 5px 8px; font-size: 12.5px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.pod117-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
  line-height: 1;
}

.pod117-btn.primary {
  background: var(--p-ink);
  color: #fff;
  border-color: var(--p-ink);
}

.pod117-btn.primary:hover { background: #1F2937; }

.pod117-btn.ghost {
  background: transparent;
  color: var(--p-muted);
  border-color: var(--p-border);
}

.pod117-btn.ghost:hover { background: #F3F4F6; color: var(--p-ink); }

.pod117-btn.sm { font-size: 12px; padding: 6px 12px; border-radius: 7px; }

.pod117-btn.danger { color: var(--p-red); }
.pod117-btn.danger:hover { background: #FEF2F2; border-color: #FCA5A5; }

/* ─── Utility ────────────────────────────────────────────────────────────── */

.pod117-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pod117-muted { color: var(--p-muted); font-size: inherit; }

.pod117-bar {
  height: 5px;
  background: #F3F4F6;
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.pod117-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s ease;
}

.pod117-ring {
  flex-shrink: 0;
  display: block;
}

/* ─── Onboarding wizard ──────────────────────────────────────────────────── */

.pod117-wz-wrap {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #F0EDE8 0%, #E8E4DE 100%);
}

.pod117-wz {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.05);
  width: 100%;
  max-width: 540px;
  overflow: hidden;
  padding: 36px;
}

.pod117-wz-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.pod117-wz-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pod117-wz-step span {
  font-size: 11px;
  font-weight: 600;
  color: var(--p-faint);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.pod117-wz-step.active span { color: var(--p-ink); }
.pod117-wz-step.done span { color: var(--p-green); }

.pod117-wz-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F3F4F6;
  border: 2px solid var(--p-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all .2s;
}

.pod117-wz-step.active .pod117-wz-dot {
  background: var(--p-ink);
  border-color: var(--p-ink);
  font-size: 16px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.pod117-wz-step.done .pod117-wz-dot {
  background: var(--p-green);
  border-color: var(--p-green);
  color: #fff;
}

.pod117-wz-connector {
  width: 48px;
  height: 2px;
  background: var(--p-border);
  margin: 0 4px;
  margin-bottom: 22px;
}

.pod117-wz-body { margin-bottom: 28px; }

.pod117-wz-intro { margin-bottom: 20px; }

.pod117-wz-intro h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--p-ink);
  margin: 0 0 6px;
  letter-spacing: -.4px;
}

.pod117-wz-intro p {
  font-size: 14px;
  color: var(--p-muted);
  margin: 0;
  line-height: 1.5;
}

.pod117-wz-fields { display: flex; flex-direction: column; gap: 12px; }
.pod117-wz-fields .pod117-field { flex: 1 1 100%; }

.pod117-wz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--p-border);
  margin-bottom: 16px;
}

/* ─── Episode panel header: left / right groups ───────────────────────────── */

.pod117-panel-header-left,
.pod117-panel-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Tab badge (segment count) ───────────────────────────────────────────── */

.pod117-ptab-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  background: #EDE9FE;
  color: #6D28D9;
  line-height: 1.4;
}

/* ─── Rundown tab ─────────────────────────────────────────────────────────── */

.pod117-rundown-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pod117-rundown-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--p-border);
}

/* ─── Segment card v2 (rundown tab) ────────────────────────────────────────── */

.pod117-seg-v2 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.pod117-seg-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 4px;
}

.pod117-seg-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.pod117-seg-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pod117-seg-type-sel {
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  background: #FAFAFA;
  color: var(--p-ink);
  font-family: inherit;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 120px;
}

.pod117-seg-title-in {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  background: #FAFAFA;
  color: var(--p-ink);
  font-family: inherit;
}

.pod117-seg-est-in {
  width: 60px;
  font-size: 12px;
  padding: 5px 7px;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  background: #FAFAFA;
  color: var(--p-ink);
  font-family: inherit;
  text-align: center;
  flex-shrink: 0;
}

.pod117-seg-notes-ta {
  width: 100%;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--p-border);
  border-radius: 6px;
  background: #FAFAFA;
  color: var(--p-ink);
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  line-height: 1.4;
}

.pod117-seg-title-in:focus,
.pod117-seg-est-in:focus,
.pod117-seg-type-sel:focus,
.pod117-seg-notes-ta:focus {
  outline: none;
  border-color: var(--p-blue);
  box-shadow: 0 0 0 2px rgba(37,99,235,.1);
}

/* ─── Table delete button ─────────────────────────────────────────────────── */

.pod117-row-del {
  background: none;
  border: none;
  color: var(--p-faint);
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .15s, color .12s, background .12s;
}

.pod117-ep-row:hover .pod117-row-del { opacity: 1; }
.pod117-row-del:hover { background: #FEF2F2; color: #DC2626; }

.col-act { display: flex; align-items: center; gap: 4px; }

.pod117-wz-skip {
  display: block;
  text-align: center;
  background: none;
  border: none;
  font-size: 12.5px;
  color: var(--p-faint);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.pod117-wz-skip:hover { color: var(--p-muted); text-decoration: underline; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .pod117-sidebar { display: none; }
  .pod117-panel { width: 100%; max-width: none; position: fixed; inset: 0; z-index: 100; max-height: 100vh; }
  .pod117-kpi:nth-child(n+5) { display: none; }
}

@media (max-width: 640px) {
  .pod117-header { padding: 14px 16px; }
  .pod117-show-title { font-size: 16px; }
  .pod117-tab-body { padding: 14px; }
  .pod117-table { font-size: 12px; }
  .col-date, .col-prog, .col-guest { display: none; }
  .pod117-deliverables { grid-template-columns: 1fr; }
  .pod117-check-grid { grid-template-columns: 1fr; }
}
