:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e8ebef;
  --sidebar: #15191f;
  --sidebar-2: #20262e;
  --line: #d9dee5;
  --line-strong: #c5ccd6;
  --text: #15191f;
  --muted: #667085;
  --muted-2: #98a2b3;
  --accent: #b45309;
  --accent-dark: #92400e;
  --accent-soft: #fff7ed;
  --danger: #b42318;
  --success: #067647;
  --warning: #b54708;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --focus: 0 0 0 3px rgba(180, 83, 9, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.hidden {
  display: none !important;
}

.public-shell {
  min-height: 100vh;
}

.public-sidebar .account-card {
  justify-items: start;
}

.public-brand {
  width: 100%;
}

.public-main {
  max-width: 1320px;
}

.public-screen {
  display: none;
}

.public-screen.active {
  display: block;
}

.public-hero {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.public-hero h1 {
  max-width: 760px;
}

.public-hero p {
  max-width: 680px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.public-search-block {
  display: grid;
  gap: 8px;
}

.public-search-block p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.public-search {
  width: min(380px, 100%);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
}

.public-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.public-section {
  display: grid;
  gap: 12px;
}

.public-orientation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.public-orientation article {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.public-orientation svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.public-orientation h2 {
  margin-bottom: 4px;
  font-size: 15px;
}

.public-orientation p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.public-unlock-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.public-unlock-panel h2 {
  font-size: 18px;
}

.public-unlock-panel ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-unlock-panel li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.public-unlock-panel svg {
  color: var(--accent);
}

.public-insights-panel {
  max-width: 840px;
}

.preview-gate {
  display: grid;
  gap: 12px;
  max-width: 620px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-gate p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.25;
}

h3 {
  line-height: 1.3;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-shell {
  min-height: 100vh;
}

.auth-main {
  display: grid;
  align-content: center;
}

.auth-panel {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.auth-panel h1 {
  margin: 0 0 8px;
}

.auth-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.waitlist-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.waitlist-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.waitlist-form input,
.waitlist-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  font-weight: 400;
}

.waitlist-form textarea {
  resize: vertical;
  min-height: 120px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  font-size: 22px;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.primary-button,
.ghost-button,
.icon-button,
.app-brand,
.nav-item,
.content-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  min-height: 40px;
  border: 1px solid transparent;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
  padding: 0 16px;
}

.primary-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.primary-button.inline {
  width: auto;
  margin-top: 4px;
}

.primary-button.compact {
  width: auto;
  min-height: 34px;
  margin-top: 0;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  padding: 0 12px;
}

.ghost-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ghost-button.compact {
  min-height: 34px;
}

.icon-button {
  width: 42px;
  height: 42px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  flex: 0 0 auto;
}

.icon-button:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
  background: var(--sidebar);
  color: #f8fafc;
}

.sidebar-top {
  display: grid;
  gap: 28px;
}

.app-brand {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: #ffffff;
  padding: 0;
  border: 0;
  text-align: left;
}

.app-brand strong,
.app-brand span {
  display: block;
}

.app-brand strong {
  line-height: 1.15;
}

.app-brand span {
  color: #b8c0cc;
  font-size: 12px;
  margin-top: 3px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  color: #d4dae4;
  padding: 0 12px;
}

.nav-item:hover:not(:disabled),
.nav-item.active {
  background: var(--sidebar-2);
  color: #ffffff;
}

.nav-item.active {
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item:disabled {
  color: #697386;
}

.account-card {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.account-card span {
  min-width: 0;
  color: #d4dae4;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card .ghost-button {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.18);
}

.account-card .ghost-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.32);
}

.account-card .admin-mode-toggle {
  justify-content: flex-start;
}

.account-card .admin-mode-toggle.active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.46);
  color: #fde68a;
}

.main {
  min-width: 0;
  width: 100%;
  max-width: 1320px;
  padding: 34px;
}

.admin-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 22px;
  padding: 10px 14px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: #fffbeb;
  color: #78350f;
  font-size: 14px;
  font-weight: 700;
}

.admin-banner svg {
  color: #b45309;
}

.admin-job-status {
  display: grid;
  gap: 8px;
  margin: 14px 0 22px;
}

.admin-job-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.admin-job-card.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.admin-job-card.complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.admin-job-card.stopped {
  border-color: #fde68a;
  background: #fffbeb;
}

.admin-job-card.error {
  border-color: #fecaca;
  background: #fef2f2;
}

.admin-job-card svg {
  margin-top: 1px;
  color: var(--accent);
}

.admin-job-card.active svg {
  color: #2563eb;
}

.admin-job-card.complete svg {
  color: var(--success);
}

.admin-job-card.stopped svg {
  color: #d97706;
}

.admin-job-card.error svg {
  color: var(--danger);
}

.admin-job-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.admin-job-card-header strong,
.admin-job-card-header span {
  font-size: 13px;
}

.admin-job-card-header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 700;
}

.admin-job-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-job-toggle {
  width: 26px;
  height: 26px;
}

.admin-job-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.admin-job-card .admin-job-error {
  color: var(--danger);
  font-weight: 700;
}

.admin-job-episodes {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.admin-job-episode {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(180px, 1.2fr) minmax(120px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.admin-job-episode strong,
.admin-job-episode span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-job-episode-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.admin-job-episode-status svg {
  width: 14px;
  height: 14px;
}

.admin-job-episode p {
  grid-column: 1 / -1;
  color: var(--danger);
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.page-header,
.detail-header,
.episode-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.episode-detail-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.episode-detail-metadata:empty {
  display: none;
}

.episode-detail-metadata span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.episode-detail-metadata svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.page-header {
  justify-content: space-between;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-library-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-admin-actions {
  display: grid;
  gap: 6px;
  margin: 2px 0 8px;
}

.nav-admin-actions .ghost-button {
  width: 100%;
  justify-content: flex-start;
  color: #d4dae4;
  border-color: rgba(255, 255, 255, 0.08);
  padding: 0 12px;
}

.nav-admin-actions .ghost-button:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.14);
  background: var(--sidebar-2);
}

.search-box {
  width: min(380px, 100%);
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted);
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.library-search-block {
  margin: 0 0 30px;
  margin-inline: -22px;
}

.library-search-box {
  width: 100%;
  height: 54px;
}

#library-view.active {
  display: flex;
  flex-direction: column;
}

#library-view .library-hero {
  order: 1;
}

#library-view .library-search-block {
  order: 2;
}

#library-view .recent-section {
  order: 3;
}

#library-view .page-header {
  order: 4;
}

#library-view .podcast-grid {
  order: 5;
}

#library-view.searching .page-header {
  order: 3;
}

#library-view.searching .podcast-grid {
  order: 4;
}

#library-view.searching .recent-section {
  order: 5;
}

.recent-section {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.recent-section .section-title {
  margin-bottom: 0;
}

.recent-section .section-title > div {
  min-width: 0;
}

.recent-episode-list {
  display: grid;
  gap: 10px;
}

.recent-episode-list > .empty-action {
  min-height: 150px;
}

.recent-episode-row {
  min-height: 70px;
}

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

.podcast-card,
.episode-row,
.insight-card,
.waitlist-card,
.transcript-panel,
.insights-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}

.podcast-card {
  min-height: 248px;
  padding: 12px;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.podcast-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.additional-podcast-card {
  display: flex;
  flex-direction: column;
}

.additional-podcast-card strong {
  min-height: calc(2 * 1.3em);
}

.additional-podcast-card .podcast-meta {
  display: -webkit-box;
  min-height: calc(2 * 1.35em);
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.podcast-subscribe-button {
  width: 100%;
  margin-top: auto;
  justify-content: center;
}

.podcast-search-loading {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.podcast-section-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.podcast-section-divider::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: var(--line-strong);
}

.podcast-card img,
.podcast-placeholder,
.skeleton-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  margin-bottom: 12px;
}

.podcast-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 34px;
  font-weight: 800;
}

.podcast-card strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
}

.podcast-meta {
  color: var(--muted);
  font-size: 13px;
}

.detail-cover {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.episode-list {
  display: grid;
  gap: 10px;
}

.episode-row {
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.episode-row:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.episode-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.episode-row strong {
  display: block;
  color: var(--text);
  line-height: 1.3;
}

.episode-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.episode-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.episode-meta svg {
  width: 14px;
  height: 14px;
}

.file-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 0 0 250px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.warning {
  background: #fff7ed;
  color: var(--warning);
}

.pill.error-pill {
  background: #fef3f2;
  color: var(--danger);
}

.danger-button {
  border-color: #fecaca;
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
  background: #fef2f2;
}

.admin-episode-reset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff7f7;
}

.admin-episode-reset div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-episode-reset strong {
  color: var(--text);
  font-size: 13px;
}

.admin-episode-reset span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.content-tabs {
  display: none;
}

.episode-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(420px, 1.12fr);
  gap: 18px;
  align-items: start;
}

.episode-layout.single-panel {
  grid-template-columns: minmax(0, 860px);
}

.episode-player-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(260px, 0.68fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.episode-player-panel strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.episode-player-panel audio {
  width: 100%;
}

.insights-panel,
.transcript-panel {
  padding: 16px;
  min-width: 0;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 12px;
}

.insight-list {
  display: grid;
  gap: 10px;
}

.insight-card {
  padding: 14px;
}

.key-facts {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.key-facts h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.key-facts ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.key-facts li + li {
  margin-top: 6px;
}

.key-facts strong {
  color: var(--text);
}

.timestamp-badge {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timestamp-badge {
  padding: 5px 10px;
}

.insight-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.insight-actions {
  display: grid;
  gap: 8px;
}

.audio-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #fed7aa;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.audio-button:hover {
  border-color: var(--accent);
}

.audio-button[disabled] {
  opacity: 0.58;
  cursor: wait;
}

.star-button,
.veo-button,
.social-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
}

.details-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
}

.star-button:hover,
.star-button.active,
.details-button:hover,
.details-button.active,
.veo-button:hover,
.veo-button.active,
.social-button:hover,
.social-button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.star-button.active svg {
  fill: currentColor;
}

.insight-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text);
}

.insight-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.insight-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.elevenlabs-insight-button.active,
.elevenlabs-download-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.veo-prompt,
.social-post {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.veo-prompt .ghost-button,
.social-post .ghost-button {
  margin-top: 10px;
}

.insight-card audio {
  width: 100%;
  margin-top: 12px;
}

.insight-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.detail-section h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
}

.detail-section p,
.detail-loading,
.detail-error {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.38);
}

.modal-panel {
  width: min(760px, 100%);
  max-height: min(86vh, 920px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.elevenlabs-modal-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

#elevenlabs-modal-transcript {
  min-height: 190px;
}

#elevenlabs-modal-prompt {
  min-height: 0;
  height: 38px;
  resize: none;
}

#elevenlabs-modal-technical-specs {
  min-height: 88px;
  resize: vertical;
}

.elevenlabs-transcript-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: -8px;
}

.elevenlabs-audio-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.elevenlabs-audio-panel audio {
  width: 100%;
}

.elevenlabs-audio-list {
  display: grid;
  gap: 12px;
}

.elevenlabs-audio-item {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.elevenlabs-audio-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.elevenlabs-audio-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.lucide-loader,
.lucide-loader-2 {
  animation: icon-spin 0.9s linear infinite;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.modal-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-status.error {
  color: var(--danger);
}

.saved-list {
  max-width: 860px;
}

.admin-main-panel {
  max-width: 980px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 10px;
  margin-top: 14px;
}

.admin-actions-grid .ghost-button {
  justify-content: flex-start;
}

.admin-users-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-users-list {
  display: grid;
  gap: 10px;
}

.admin-user-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-user-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
}

.admin-user-main {
  min-width: 0;
}

.admin-user-main strong,
.admin-user-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-main span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.admin-user-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.admin-user-toggle {
  justify-self: end;
}

.admin-user-details-toggle {
  justify-self: end;
}

.admin-user-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.9fr);
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-user-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.admin-user-details dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-user-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-user-limit-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.admin-user-limit-form .field {
  flex: 1;
}

.admin-user-podcasts h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.admin-user-podcasts ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-user-podcasts li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.admin-user-podcasts strong,
.admin-user-podcasts span {
  display: block;
  overflow-wrap: anywhere;
}

.admin-user-podcasts span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.ghost-button.danger {
  color: var(--danger);
}

.waitlist-section-title {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.waitlist-list {
  display: grid;
  gap: 12px;
  max-width: 900px;
}

.waitlist-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.waitlist-card-header,
.waitlist-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.waitlist-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.waitlist-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.waitlist-email {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.saved-item .insight-header {
  grid-template-columns: 36px minmax(0, 1fr);
}

.saved-context {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tag-popover {
  position: fixed;
  z-index: 30;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}

.tag-picker {
  display: grid;
  gap: 10px;
}

.tag-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag-picker-header strong {
  font-size: 14px;
}

.tag-picker-close {
  width: 30px;
  height: 30px;
}

.tag-picker-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.tag-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}

.tag-option span {
  overflow-wrap: anywhere;
}

.tag-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.tag-create-input {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
}

.tag-picker-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tag-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-panel {
  width: min(780px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.settings-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.settings-group-header h2 {
  margin-bottom: 6px;
}

.settings-group-header p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.toggle-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.toggle-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.toggle-control span {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.toggle-control span::after {
  content: "";
  width: 22px;
  height: 22px;
  position: absolute;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  transition: transform 0.16s ease;
}

.toggle-control input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-control input:checked + span::after {
  transform: translateX(20px);
}

.toggle-control input:focus-visible + span {
  box-shadow: var(--focus);
}

.settings-fields {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--text);
  padding: 10px 12px;
}

.field input,
.field select {
  min-height: 42px;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  min-width: 176px;
}

.segmented button {
  min-height: 32px;
  border: 0;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
}

.segmented button.active {
  background: var(--accent);
  color: #ffffff;
}

.transcript-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.transcript-content {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fbfcfd;
  color: #344054;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  min-height: 460px;
  max-height: calc(100vh - 250px);
  overflow: auto;
  line-height: 1.58;
  font-size: 13px;
}

.status-text,
.empty-state {
  color: var(--muted);
}

.empty-action {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  color: var(--text);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.56);
}

.podcast-grid > .empty-action,
.episode-list > .empty-action {
  grid-column: 1 / -1;
}

.empty-action svg {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.empty-action h3 {
  margin: 0;
  font-size: 18px;
}

.empty-action p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.empty-action.error-state svg,
.error {
  color: var(--danger);
}

.empty-action .countdown {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  margin-top: 2px;
}

.empty-action .phase-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  background: #15191f;
  color: #ffffff;
  border-radius: 6px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.skeleton-card,
.skeleton-row {
  pointer-events: none;
}

.skeleton-cover,
.skeleton-line,
.skeleton-chip,
.skeleton-button {
  display: block;
  background: linear-gradient(90deg, #edf0f3 0%, #f7f8fa 45%, #edf0f3 100%);
  background-size: 240% 100%;
  animation: skeleton-pulse 1.35s ease-in-out infinite;
}

.skeleton-line {
  width: 68%;
  height: 12px;
  border-radius: 999px;
}

.skeleton-line.wide {
  width: 92%;
}

.skeleton-line.short {
  width: 44%;
}

.skeleton-chip {
  width: 86px;
  height: 24px;
  border-radius: 999px;
}

.skeleton-button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

@keyframes skeleton-pulse {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@keyframes icon-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    z-index: 20;
    height: auto;
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 14px 18px;
  }

  .sidebar-top {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-item {
    width: auto;
  }

  .nav-admin-actions {
    display: flex;
    width: 100%;
    margin: -2px 0 0;
  }

  .nav-admin-actions .ghost-button {
    width: auto;
  }

  .account-card {
    padding-top: 0;
    border-top: 0;
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .account-card span {
    max-width: 220px;
  }

  .main {
    padding: 28px;
  }
}

@media (max-width: 900px) {
  .public-orientation,
  .public-unlock-panel,
  .public-unlock-panel ul {
    grid-template-columns: 1fr;
  }

  .episode-layout {
    grid-template-columns: 1fr;
  }

  .episode-player-panel {
    grid-template-columns: 1fr;
  }

  .content-tabs {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 14px;
    background: var(--surface-3);
    border-radius: 8px;
  }

  .content-tabs button {
    min-height: 36px;
    padding: 0 12px;
    background: transparent;
    color: var(--muted);
  }

  .content-tabs button.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  }

  .mobile-hidden {
    display: none;
  }

  .transcript-content {
    max-height: none;
  }
}

@media (max-width: 700px) {
  .main {
    padding: 20px;
  }

  .sidebar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .sidebar-top,
  .account-card {
    width: 100%;
  }

  .sidebar-top {
    justify-content: space-between;
  }

  .app-brand {
    width: auto;
  }

  .app-brand span {
    display: none;
  }

  .nav-item span {
    display: none;
  }

  .account-card {
    justify-content: space-between;
  }

  .settings-group-header {
    align-items: flex-start;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .page-header,
  .detail-header,
  .episode-header {
    align-items: flex-start;
  }

  .page-header {
    flex-direction: column;
  }

  .page-header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-library-actions {
    width: 100%;
  }

  .admin-job-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .page-header-actions .ghost-button,
  .search-box {
    width: 100%;
  }

  h1 {
    font-size: 27px;
  }

  .detail-cover {
    width: 72px;
    height: 72px;
  }

  .episode-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-badges {
    flex: 0 0 auto;
    justify-content: flex-start;
  }

  .public-orientation article {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .public-orientation svg {
    width: 32px;
    height: 32px;
    padding: 7px;
  }
}

/* Premium editorial revamp */
:root {
  --bg: #f7f4ef;
  --surface: #fffdf9;
  --surface-2: #f1ede6;
  --surface-3: #e8e0d6;
  --sidebar: rgba(255, 253, 249, 0.92);
  --sidebar-2: #f0e9df;
  --line: #e2d8cb;
  --line-strong: #cdbdab;
  --text: #181512;
  --muted: #706960;
  --muted-2: #a59a8f;
  --accent: #d9472b;
  --accent-dark: #af321c;
  --accent-soft: #fff0eb;
  --danger: #b42318;
  --success: #087443;
  --warning: #a65012;
  --shadow: 0 18px 48px rgba(52, 37, 24, 0.11);
  --shadow-soft: 0 10px 28px rgba(52, 37, 24, 0.08);
  --focus: 0 0 0 4px rgba(217, 71, 43, 0.18);
  --serif: "Instrument Serif", Georgia, serif;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.86), rgba(247, 244, 239, 0.98) 360px),
    radial-gradient(circle at 12% 0%, rgba(217, 71, 43, 0.10), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

h1 {
  max-width: 880px;
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 400;
  line-height: 0.98;
}

h2 {
  font-size: 24px;
  line-height: 1.12;
}

h3 {
  font-size: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.app-shell {
  grid-template-columns: 246px minmax(0, 1fr);
}

.sidebar {
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  width: 246px;
  min-width: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid rgba(205, 189, 171, 0.72);
  background: var(--sidebar);
  color: var(--text);
  backdrop-filter: blur(18px);
}

.sidebar-top {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.app-brand {
  color: var(--text);
}

.app-brand strong {
  font-size: 15px;
}

.app-brand span,
.account-card span {
  color: var(--muted);
}

.brand-mark {
  border-radius: 7px;
  background: linear-gradient(135deg, var(--text), #6b2c20 58%, var(--accent));
  box-shadow: 0 10px 24px rgba(52, 37, 24, 0.18);
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  min-height: 44px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 750;
  padding: 0 12px;
  text-align: left;
}

.nav-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover:not(:disabled),
.nav-item.active {
  background: var(--sidebar-2);
  color: var(--text);
}

.nav-item.active {
  border-color: rgba(217, 71, 43, 0.18);
}

.account-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding-top: 16px;
  border-top-color: var(--line);
}

.account-card .ghost-button {
  width: 100%;
  justify-content: flex-start;
}

.account-card .ghost-button,
.nav-admin-actions .ghost-button {
  color: var(--text);
  border-color: var(--line);
}

.account-card .ghost-button:hover,
.nav-admin-actions .ghost-button:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: rgba(217, 71, 43, 0.32);
}

.main {
  max-width: 1440px;
  padding: 42px clamp(24px, 4vw, 64px) 72px;
}

.public-main {
  max-width: 1440px;
}

.public-hero,
.library-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 820px) minmax(320px, 430px);
  gap: 56px;
  align-items: end;
  min-height: min(560px, calc(100vh - 84px));
  margin: -10px 0 42px;
  padding: 72px 0 52px;
  border-bottom: 1px solid var(--line);
}

.library-hero {
  grid-template-columns: minmax(0, 760px) minmax(260px, 0.48fr);
  min-height: 330px;
  margin-bottom: 30px;
}

.public-hero-copy,
.library-hero > div {
  position: relative;
  z-index: 1;
}

.public-hero p,
.library-hero p {
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.62;
}

.public-search-block {
  position: relative;
  z-index: 2;
  align-self: end;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.public-search,
.search-box {
  height: 48px;
  border-radius: 7px;
  border-color: var(--line);
  background: rgba(255, 253, 249, 0.88);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.public-search:focus-within,
.search-box:focus-within {
  border-color: rgba(217, 71, 43, 0.55);
  box-shadow: var(--focus);
}

.public-orientation {
  gap: 1px;
  margin: 0 0 38px;
  border-block: 1px solid var(--line);
}

.public-orientation article {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 22px 18px;
}

.public-orientation article + article {
  border-left: 1px solid var(--line);
}

.public-orientation svg {
  background: var(--text);
  color: #fffdf9;
}

.editorial-band {
  margin-inline: -22px;
  padding: 24px 28px 30px;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.54);
  border: 1px solid rgba(226, 216, 203, 0.72);
}

.page-header,
.detail-header,
.episode-header {
  align-items: flex-start;
  margin-bottom: 28px;
}

.page-header h1,
.detail-header h1,
.episode-header h1 {
  margin-bottom: 8px;
  font-size: 52px;
}

.page-header h2 {
  margin: 0 0 4px;
}

.detail-header {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 253, 249, 0.94), rgba(255, 240, 235, 0.58));
  box-shadow: var(--shadow-soft);
}

.detail-cover {
  width: clamp(92px, 12vw, 156px);
  height: clamp(92px, 12vw, 156px);
  border-radius: 8px;
  border-color: rgba(24, 21, 18, 0.08);
  box-shadow: 0 16px 34px rgba(52, 37, 24, 0.18);
}

.podcast-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px;
}

.podcast-card {
  position: relative;
  min-height: 312px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(24, 21, 18, 0.06), var(--shadow-soft);
}

.podcast-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 60px rgba(52, 37, 24, 0.16);
}

.podcast-card img,
.podcast-placeholder,
.skeleton-cover {
  border-radius: 0;
  margin-bottom: 0;
}

.podcast-card strong,
.podcast-card .podcast-meta,
.podcast-card .pill,
.additional-podcast-card .podcast-subscribe-button {
  margin-left: 14px;
  margin-right: 14px;
}

.podcast-card strong {
  margin-top: 14px;
  font-size: 16px;
  letter-spacing: 0;
}

.podcast-card .podcast-meta {
  display: block;
  margin-bottom: 10px;
}

.public-preview-pill {
  margin-top: 2px;
  margin-bottom: 14px;
  width: fit-content;
}

.additional-podcast-card .podcast-subscribe-button {
  width: calc(100% - 28px);
  margin-bottom: 14px;
}

.podcast-placeholder {
  background:
    linear-gradient(135deg, rgba(24, 21, 18, 0.78), rgba(217, 71, 43, 0.68)),
    var(--surface-2);
  color: #fffdf9;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 400;
}

.podcast-section-divider {
  margin-top: 8px;
  color: var(--text);
  font-size: 12px;
}

.recent-episode-list {
  gap: 12px;
}

.episode-row {
  min-height: 86px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.82);
  box-shadow: 0 1px 0 rgba(24, 21, 18, 0.06);
}

.episode-row:hover {
  border-color: transparent;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.recent-episode-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

.episode-artwork {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface-2);
  box-shadow: 0 10px 22px rgba(52, 37, 24, 0.12);
}

.episode-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.episode-row strong {
  font-size: 15px;
}

.episode-meta {
  color: var(--muted);
}

.pill {
  border-radius: 999px;
  background: #f0e8dc;
  color: #655a50;
}

.primary-button,
.ghost-button,
.icon-button,
.app-brand,
.nav-item,
.content-tabs button {
  border-radius: 7px;
}

.primary-button {
  background: var(--text);
  border-color: var(--text);
}

.primary-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.ghost-button {
  background: rgba(255, 253, 249, 0.64);
}

.icon-button {
  background: rgba(255, 253, 249, 0.78);
}

.episode-player-panel,
.insights-panel,
.transcript-panel,
.settings-panel,
.auth-panel,
.preview-gate,
.public-unlock-panel,
.admin-job-card,
.waitlist-card,
.insight-card,
.key-facts {
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.episode-player-panel {
  position: sticky;
  top: 18px;
  z-index: 6;
}

.episode-layout {
  grid-template-columns: minmax(340px, 0.84fr) minmax(420px, 1.16fr);
  gap: 22px;
}

.episode-layout.single-panel {
  grid-template-columns: minmax(0, 900px);
}

.insights-panel,
.transcript-panel {
  padding: 22px;
}

.insight-list {
  gap: 14px;
}

.insight-card {
  padding: 18px;
}

.insight-header {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
}

.insight-actions {
  gap: 9px;
}

.audio-button,
.star-button,
.veo-button,
.social-button,
.details-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
}

.audio-button {
  border-color: rgba(217, 71, 43, 0.25);
  background: var(--accent-soft);
}

.insight-card h3 {
  font-size: 19px;
  line-height: 1.22;
}

.insight-card p,
.detail-section p,
.transcript-content {
  line-height: 1.7;
}

.key-facts {
  background: #221d19;
  color: #fffdf9;
}

.key-facts h3,
.key-facts strong {
  color: #fffdf9;
}

.key-facts ul {
  color: rgba(255, 253, 249, 0.78);
}

.transcript-content {
  border: 0;
  border-radius: 8px;
  background: #f4efe8;
  color: #342f2a;
  font-size: 14px;
}

.content-tabs {
  border-radius: 8px;
}

.segmented {
  border-radius: 7px;
  background: var(--surface-2);
}

.segmented button.active {
  background: var(--text);
}

.auth-shell,
.public-shell {
  min-height: 100vh;
}

.auth-main {
  align-content: center;
  justify-items: center;
}

.auth-panel {
  width: min(520px, 100%);
  padding: 34px;
}

.auth-panel h1 {
  font-size: 52px;
}

.waitlist-form input,
.waitlist-form textarea,
.field input,
.field textarea,
.field select,
.tag-create-input {
  border-color: var(--line);
  border-radius: 7px;
  background: #fffaf4;
}

.saved-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -12px 0 20px;
}

.saved-list,
.waitlist-list {
  max-width: 980px;
}

.modal-panel,
.tag-popover {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(24, 21, 18, 0.24);
}

.empty-action {
  border-color: rgba(205, 189, 171, 0.84);
  background: rgba(255, 253, 249, 0.58);
}

.toast {
  border-radius: 999px;
  background: var(--text);
}

.skeleton-cover,
.skeleton-line,
.skeleton-chip,
.skeleton-button {
  background: linear-gradient(90deg, #e9ded2 0%, #fff8ef 45%, #e9ded2 100%);
  background-size: 240% 100%;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1060px) {
  .sidebar {
    width: 100%;
    height: auto;
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-top {
    display: flex;
    align-items: center;
    gap: 18px;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-item {
    width: auto;
  }

  .account-card {
    display: flex;
    align-items: center;
    min-width: 0;
    padding-top: 0;
    border-top: 0;
  }

  .account-card .ghost-button {
    width: auto;
  }

  .account-card span {
    max-width: 170px;
  }

  .public-hero,
  .library-hero {
    min-height: auto;
  }
}

@media (orientation: portrait) and (max-width: 1280px) {
  body {
    padding-bottom: 82px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-top {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .sidebar-nav {
    position: fixed;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 7px;
    border: 1px solid rgba(205, 189, 171, 0.84);
    border-radius: 8px;
    background: rgba(255, 253, 249, 0.96);
    box-shadow: 0 16px 44px rgba(52, 37, 24, 0.18);
    backdrop-filter: blur(16px);
  }

  .nav-item {
    width: 100%;
    min-height: 54px;
    justify-content: center;
    padding: 0 6px;
    text-align: center;
  }

  .nav-item span {
    display: block;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.1;
  }

  .nav-admin-actions {
    display: none;
  }

  .account-card {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
    padding-top: 0;
    border-top: 0;
  }

  .account-card #user-email {
    display: none;
  }

  .account-card .ghost-button {
    width: auto;
  }

  .account-card .ghost-button span {
    display: none;
  }

  .main {
    max-width: none;
  }
}

@media (max-width: 900px) {
  h1 {
    font-size: 44px;
  }

  .public-hero,
  .library-hero {
    grid-template-columns: 1fr;
    padding-bottom: 34px;
  }

  .public-search-block {
    max-width: 560px;
  }

  .public-orientation article + article {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .episode-layout,
  .episode-layout.single-panel {
    grid-template-columns: 1fr;
  }

  .episode-player-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: 74px;
  }

  .main {
    padding: 24px 16px 34px;
  }

  h1,
  .page-header h1,
  .detail-header h1,
  .episode-header h1,
  .auth-panel h1 {
    font-size: 38px;
  }

  .admin-actions-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-summary,
  .admin-user-details,
  .admin-user-details dl {
    grid-template-columns: 1fr;
  }

  .admin-user-flags {
    justify-content: flex-start;
  }

  .admin-user-details-toggle,
  .admin-user-toggle {
    justify-self: start;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 14px;
  }

  .sidebar-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px;
    border: 1px solid rgba(205, 189, 171, 0.84);
    border-radius: 8px;
    background: rgba(255, 253, 249, 0.94);
    box-shadow: 0 14px 42px rgba(52, 37, 24, 0.18);
    backdrop-filter: blur(16px);
  }

  .nav-item {
    min-height: 50px;
    padding: 0;
  }

  .nav-item span {
    display: none;
  }

  .nav-admin-actions {
    display: none;
  }

  .account-card {
    justify-content: end;
  }

  .account-card #user-email {
    display: none;
  }

  .account-card .ghost-button span {
    display: none;
  }

  .public-hero,
  .library-hero {
    margin-top: 0;
  }

  .editorial-band {
    margin-inline: 0;
    padding: 18px 14px 22px;
  }

  .library-search-block {
    margin-inline: 0;
  }

  .podcast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .podcast-card {
    min-height: 260px;
  }

  .podcast-card strong {
    font-size: 14px;
  }

  .recent-episode-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .episode-artwork {
    width: 52px;
    height: 52px;
  }

  .recent-episode-row .file-badges {
    grid-column: 2;
  }

  .detail-header {
    padding: 18px;
  }

  .detail-cover {
    width: 76px;
    height: 76px;
  }

  .insights-panel,
  .transcript-panel,
  .auth-panel {
    padding: 18px;
  }
}

@media (orientation: portrait) {
  body {
    padding-bottom: 82px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-top {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .sidebar-nav {
    position: fixed;
    top: auto;
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 80;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-columns: none;
    gap: 4px;
    width: auto;
    padding: 7px;
    border: 1px solid rgba(205, 189, 171, 0.84);
    border-radius: 8px;
    background: rgba(255, 253, 249, 0.96);
    box-shadow: 0 16px 44px rgba(52, 37, 24, 0.18);
    backdrop-filter: blur(16px);
  }

  .nav-item {
    width: 100%;
    min-height: 54px;
    justify-content: center;
    padding: 0 6px;
    text-align: center;
  }

  .nav-item span {
    display: block;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.1;
  }

  .nav-admin-actions {
    display: none;
  }
}

/* Final app navigation overrides. Keep these scoped because public/auth shells share the same classes. */
@media (min-width: 801px) and (max-width: 1060px) and (orientation: landscape) {
  #app-view.app-shell {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  #app-view .sidebar {
    position: sticky;
    top: 0;
    width: 224px;
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 14px;
    border-right: 1px solid rgba(205, 189, 171, 0.72);
    border-bottom: 0;
  }

  #app-view .sidebar-top,
  #app-view .sidebar-nav,
  #app-view .account-card {
    display: grid;
    align-items: initial;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  #app-view .app-brand {
    justify-content: flex-start;
  }

  #app-view .app-brand > div:last-child,
  #app-view .nav-item span,
  #app-view .account-card span,
  #app-view .account-card .ghost-button span {
    display: block;
  }

  #app-view .sidebar-nav {
    position: static;
    grid-auto-flow: row;
    grid-auto-columns: initial;
    grid-template-columns: 1fr;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  #app-view .nav-item,
  #app-view .account-card .ghost-button,
  #app-view .nav-admin-actions .ghost-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    justify-content: flex-start;
    padding: 0 10px;
    text-align: left;
  }

  #app-view .nav-admin-actions {
    display: grid;
    gap: 6px;
    width: 100%;
    margin: 2px 0 8px;
  }

  #app-view .account-card {
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
}

@media (orientation: portrait), (max-width: 800px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  #app-view.app-shell {
    grid-template-columns: 1fr;
  }

  #app-view .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #app-view .sidebar-top {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  #app-view .app-brand {
    width: auto;
    min-width: 0;
    justify-content: flex-start;
  }

  #app-view .app-brand > div:last-child,
  #app-view .account-card #user-email,
  #app-view .account-card .ghost-button span {
    display: none;
  }

  #app-view .sidebar-nav {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-columns: none;
    gap: 2px;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid rgba(205, 189, 171, 0.84);
    border-radius: 0;
    background: rgba(255, 253, 249, 0.97);
    box-shadow: 0 -8px 28px rgba(52, 37, 24, 0.12);
    backdrop-filter: blur(16px);
  }

  #app-view .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    justify-content: center;
    padding: 0 4px;
    text-align: center;
  }

  #app-view .nav-item span {
    display: none;
  }

  #app-view .nav-admin-actions {
    display: none;
  }

  #app-view .account-card {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-top: 0;
    border-top: 0;
  }

  #app-view .account-card .ghost-button {
    width: auto;
    min-height: 40px;
    justify-content: center;
    padding: 0 10px;
  }

  #app-view .main {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }
}
