@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;1,500&family=Inter:wght@400;500;600&display=swap");

:root {
  --bg: #11170f;
  --panel: #171f15;
  --border: #2a3527;
  --cream: #f3efe2;
  --muted: #9aa495;
  --accent: #e8f27a;
}

:root[data-theme="light"] {
  --bg: #f6f3ea;
  --panel: #ffffff;
  --border: #ddd6c4;
  --cream: #1d2318;
  --muted: #6b7466;
  --accent: #5f6f00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: "Inter", sans-serif;
}

header.top {
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

header.top h1 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: 20px;
  margin: 0;
}

header.top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: flex;
  min-height: calc(100vh - 70px);
}

nav.sessions {
  width: 260px;
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  flex-shrink: 0;
}

nav.sessions button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--cream);
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
}

nav.sessions button:hover { background: var(--panel); }

nav.sessions button.active {
  border-color: var(--accent);
  background: var(--panel);
}

nav.sessions button.pending { opacity: 0.5; }

nav.sessions .badge-title { font-weight: 600; font-size: 14px; }
nav.sessions .badge-date { font-size: 12px; color: var(--muted); margin-top: 2px; }

.bonuses {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.bonuses-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0 12px 8px;
}

.bonus-link {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--cream);
  text-decoration: none;
  font-size: 14px;
}

.bonus-link:hover { background: var(--panel); }

main.content {
  flex: 1;
  padding: 28px;
  max-width: 900px;
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.pending-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 22px;
}

.session-meta h2 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  margin: 18px 0 2px;
}

.session-meta .date { color: var(--muted); font-size: 14px; }

.notes {
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.notes h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 10px;
}

.notes .entry {
  margin-bottom: 10px;
  line-height: 1.55;
  font-size: 14.5px;
}

.notes .ts {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
  font-size: 13px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.notes .ts:hover { text-decoration: underline; }

.notes .empty {
  color: var(--muted);
  font-style: italic;
}

.section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}

.section-toggle:hover { color: var(--cream); }
.section-toggle .chev { display: inline-block; transition: transform 0.15s; }
#chapters-section.collapsed .chev { transform: rotate(-90deg); }
#chapters-section.collapsed #chapters-body { display: none; }

.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chapters-list .chapter {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--cream);
  padding: 7px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.chapters-list .chapter:hover { background: var(--panel); }

.chapters-list .chapter .ts {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
}

.bonus-from {
  color: var(--muted);
  font-size: 12px;
}

#page-view h2 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  margin: 0 0 2px;
}

#page-view .date { color: var(--muted); font-size: 14px; }

.page-intro {
  margin: 18px 0 8px;
  line-height: 1.6;
  font-size: 15px;
  color: var(--cream);
}

.group-title {
  margin: 26px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--cream);
  text-decoration: none;
}

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

.card-n {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  color: var(--muted);
  flex-shrink: 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.card-title { font-weight: 600; font-size: 15px; }
.card-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }

.card-go {
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
}

nav.sessions { padding-bottom: 96px; }

.navfoot {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 260px;
  padding: 10px 12px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  z-index: 10;
}

.navfoot button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  padding: 7px 10px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.navfoot button:hover { background: var(--panel); color: var(--cream); }
.navfoot svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

body.nav-hidden nav.sessions { display: none; }
body.nav-hidden .navfoot { width: auto; border-right: 0; border-top-right-radius: 10px; }
body.nav-hidden .navfoot .lbl { display: none; }
body.nav-hidden .navfoot button { width: auto; }

.video-wrap .plyr,
.video-wrap .plyr__video-embed { height: 100%; }

.video-wrap .cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  border: 0;
  cursor: pointer;
  color: var(--cream);
  background: var(--panel);
  font-family: inherit;
}

.video-wrap .cover.hidden { display: none; }

.cover-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(20px, 3.4vw, 34px);
  text-align: center;
  line-height: 1.25;
}

.cover-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 24px;
  padding-left: 4px;
}

.account {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

a.upgrade,
a.primary,
button.primary {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: 600 14px "Inter", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

a.upgrade { padding: 6px 12px; font-size: 13px; }
button.primary:disabled { opacity: 0.6; cursor: default; }

button.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

button.link:hover { color: var(--cream); }

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0;
}

#auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
}

.auth-card h1 {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: 26px;
  margin: 0 0 8px;
}

.auth-lead { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }

.auth-card form { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.auth-card form[hidden] { display: none; }
.auth-card label { font-size: 13px; color: var(--muted); }

.auth-card input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--cream);
  font: 15px "Inter", sans-serif;
}

.auth-msg { min-height: 20px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.auth-msg.error { color: #e0655a; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  nav.sessions { width: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  main.content { padding: 16px; }
  .navfoot { display: none; }
}
