:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #5e6972;
  --line: #d8dee4;
  --panel: #ffffff;
  --soft: #f3f6f8;
  --accent: #1f7a68;
  --accent-dark: #12594b;
  --apple: #a02cff;
  --warn: #9a5b00;
  --shadow: 0 16px 40px rgba(23, 32, 38, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(160, 44, 255, 0.12), rgba(31, 122, 104, 0.07) 34%, rgba(243, 246, 248, 1) 70%),
    #f3f6f8;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.secondary-button:hover,
.text-button:hover {
  background: var(--soft);
}

.text-button {
  background: transparent;
  color: var(--accent-dark);
}

button:disabled {
  background: #9aa7af;
  cursor: wait;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  min-height: calc(100vh - 48px);
}

.auth-view {
  display: grid;
  min-height: calc(100vh - 48px);
  place-items: center;
}

.auth-panel {
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-panel h1 {
  font-size: 2rem;
  line-height: 1.1;
}

.auth-copy {
  color: var(--muted);
  line-height: 1.6;
}

.auth-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 20px;
}

.topbar h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

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

.account-actions span {
  color: var(--muted);
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--apple);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.searchbar {
  display: grid;
  grid-template-columns: 1fr 104px;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.status {
  min-height: 40px;
  padding: 12px 2px;
  color: var(--muted);
}

.status.warn {
  color: var(--warn);
}

.billing-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(23, 32, 38, 0.08);
}

.billing-band > div:first-child {
  flex: 0 0 auto;
}

.billing-band h2 {
  margin: 2px 0 4px;
  font-size: 1.2rem;
}

.plan-actions {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.plan-button {
  white-space: nowrap;
}

.payment-contact {
  margin: 0;
  max-width: none;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: right;
  white-space: nowrap;
}

.payment-contact strong {
  color: var(--ink);
}

.columns {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(360px, 1.25fr) minmax(360px, 1.15fr);
  gap: 16px;
  align-items: stretch;
}

.panel {
  height: 100%;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(23, 32, 38, 0.08);
  overflow: hidden;
}

.show-panel {
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.panel-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.copy-transcript {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.list {
  display: grid;
  gap: 1px;
  max-height: 660px;
  overflow: auto;
  background: var(--line);
}

.show-panel .list {
  flex: 1;
  background: white;
}

.show-panel .row {
  border-bottom: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  width: 100%;
  min-height: 86px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: white;
  color: var(--ink);
  text-align: left;
}

.row:hover,
.row.active {
  background: #eef8f5;
}

.art {
  width: 60px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(135deg, #28343b, #a02cff);
  object-fit: cover;
}

.placeholder {
  flex: 0 0 auto;
}

.row-title {
  margin: 0 0 4px;
  font-weight: 800;
  line-height: 1.25;
}

.row-meta,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.selected-show {
  display: flex;
  gap: 14px;
  min-height: 96px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.episodes .row {
  grid-template-columns: 1fr auto;
}

.episode-action {
  align-self: center;
  min-width: 88px;
}

.transcript-panel {
  display: flex;
  flex-direction: column;
}

audio {
  width: calc(100% - 32px);
  margin: 16px;
}

.transcript-tools {
  display: block;
  padding: 0 16px 16px;
}

.transcript {
  flex: 1;
  min-height: 320px;
  margin: 0 16px 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: #243038;
  line-height: 1.7;
  white-space: pre-wrap;
}

.copyright-note {
  margin: 0 16px 16px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

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

  .transcript-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 14px;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

  .account-actions {
    justify-content: start;
  }

  .billing-band {
    display: grid;
  }

  .plan-actions {
    justify-content: start;
  }

  .payment-contact {
    text-align: left;
    white-space: normal;
  }

  .searchbar,
  .columns {
    grid-template-columns: 1fr;
  }

  .panel {
    height: auto;
    min-height: auto;
  }
}
