:root {
  --night: #151024;
  --night-soft: #24183d;
  --violet: #4b2f73;
  --violet-soft: #7557a5;
  --gold: #d4a961;
  --gold-light: #f2d39f;
  --petrol: #134d5d;
  --petrol-deep: #0d3945;
  --ink: #17252b;
  --muted: #657279;
  --paper: #fffdf8;
  --sand: #f3eee5;
  --rose: #a95460;
  --success: #31765d;
  --line: rgba(23, 37, 43, 0.12);
  --line-light: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 12px 32px rgba(17, 13, 31, 0.09);
  --shadow-lg: 0 30px 80px rgba(17, 13, 31, 0.2);
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(212, 169, 97, 0.5);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3 {
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.member-body {
  position: relative;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(117, 87, 165, 0.12), transparent 32rem),
    radial-gradient(circle at 92% 18%, rgba(212, 169, 97, 0.13), transparent 28rem),
    linear-gradient(180deg, #f8f5ef, #eee8dd);
}

.member-body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(75, 47, 115, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 47, 115, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--night);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.member-topbar {
  width: min(1180px, calc(100% - 24px));
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line-light);
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(212, 169, 97, 0.17), transparent 32%),
    linear-gradient(135deg, rgba(21, 16, 36, 0.98), rgba(75, 47, 115, 0.94));
  box-shadow: var(--shadow-sm);
}

.member-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.member-brand img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  box-shadow: 0 10px 22px rgba(7, 5, 15, 0.24);
}

.member-brand span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.member-brand strong {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
}

.member-brand small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.71rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-topbar nav {
  display: none;
  align-items: center;
  gap: 14px;
}

.member-topbar nav a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  text-decoration: none;
}

.member-topbar nav a:hover {
  color: #fff;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--violet-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.button {
  appearance: none;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  color: #1b1327;
  background: linear-gradient(180deg, #e5bd7b, var(--gold));
  box-shadow: 0 12px 26px rgba(118, 76, 21, 0.17);
}

.button-primary:hover:not(:disabled) {
  box-shadow: 0 15px 30px rgba(118, 76, 21, 0.24);
}

.button-quiet {
  min-height: 40px;
  padding: 9px 13px;
  color: inherit;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.course-topbar .button-quiet {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.button-wide {
  width: 100%;
}

.text-button {
  width: fit-content;
  padding: 4px 0;
  border: 0;
  color: var(--violet);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.notice {
  margin: 16px 0;
  padding: 13px 15px;
  border: 1px solid rgba(49, 118, 93, 0.22);
  border-radius: var(--radius-sm);
  color: #245942;
  background: rgba(49, 118, 93, 0.08);
  line-height: 1.5;
}

.notice[data-tone="error"] {
  color: #7d3540;
  border-color: rgba(169, 84, 96, 0.25);
  background: rgba(169, 84, 96, 0.09);
}

.notice-caution {
  color: #654719;
  border-color: rgba(212, 169, 97, 0.36);
  background: rgba(212, 169, 97, 0.13);
}

.member-form {
  display: grid;
  gap: 12px;
}

.member-form label,
.chat-form label {
  color: #33444a;
  font-size: 0.91rem;
  font-weight: 700;
}

.member-form input:not([type="range"]),
.member-form textarea,
.chat-form textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(23, 37, 43, 0.16);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  resize: vertical;
}

.member-form input:not([type="range"]):focus,
.member-form textarea:focus,
.chat-form textarea:focus {
  border-color: rgba(75, 47, 115, 0.42);
  box-shadow: 0 0 0 4px rgba(75, 47, 115, 0.08);
  outline: 0;
}

/* Login */

.login-page {
  min-height: 100vh;
  padding-bottom: 28px;
  background:
    radial-gradient(circle at 80% 0%, rgba(212, 169, 97, 0.18), transparent 35rem),
    radial-gradient(circle at 2% 42%, rgba(117, 87, 165, 0.18), transparent 33rem),
    linear-gradient(155deg, #120e20 0%, #2b1c47 45%, #573b73 100%);
}

.login-page::before {
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

.login-page > * {
  position: relative;
  z-index: 1;
}

.login-topbar {
  background: rgba(21, 16, 36, 0.66);
  backdrop-filter: blur(20px);
}

.login-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 14px auto 0;
  display: grid;
  gap: 14px;
}

.login-intro,
.login-card {
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.login-intro {
  position: relative;
  overflow: hidden;
  padding: 28px 20px 20px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(212, 169, 97, 0.22), transparent 34%),
    linear-gradient(150deg, rgba(18, 14, 32, 0.95), rgba(66, 42, 102, 0.9));
}

.login-intro::after {
  position: absolute;
  right: -55px;
  bottom: -55px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(242, 211, 159, 0.15);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 36px rgba(242, 211, 159, 0.035), 0 0 0 72px rgba(242, 211, 159, 0.025);
}

.login-intro .eyebrow {
  color: var(--gold-light);
}

.login-intro h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 10vw, 4.8rem);
  line-height: 0.98;
}

.login-lead {
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.login-path {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.login-path article {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.login-path article > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(242, 211, 159, 0.3);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 800;
}

.login-path strong {
  display: block;
  margin-bottom: 3px;
}

.login-path p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
  line-height: 1.45;
}

.login-portrait {
  position: relative;
  overflow: hidden;
  margin: 22px 0 0;
  min-height: 220px;
  border-radius: 22px;
}

.login-portrait img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center 28%;
}

.login-portrait::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 40%, rgba(16, 11, 27, 0.9));
}

.login-portrait figcaption {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 15px;
  left: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.login-card {
  align-self: center;
  padding: 28px 20px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(24px);
}

.login-card-mark {
  width: 68px;
  height: 68px;
  margin-bottom: 20px;
}

.login-card h2 {
  margin-bottom: 10px;
  font-size: 2.2rem;
}

.login-card .member-form {
  margin-top: 22px;
}

.code-recipient {
  margin-bottom: 2px;
  padding: 10px 12px;
  border-radius: 13px;
  color: var(--muted);
  background: rgba(75, 47, 115, 0.06);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.code-input {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.login-help {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* Course shell */

.member-account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-name {
  display: none;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
}

.course-loading {
  min-height: calc(100vh - 100px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}

.loading-orb {
  width: 70px;
  height: 70px;
  border: 1px solid rgba(75, 47, 115, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #f9e1b8, #7557a5 62%, #24183d);
  box-shadow: 0 0 0 16px rgba(117, 87, 165, 0.07);
  animation: loading-breath 2.2s ease-in-out infinite;
}

.course-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 14px auto 40px;
}

.course-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  color: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 10% 15%, rgba(212, 169, 97, 0.16), transparent 32%),
    linear-gradient(145deg, #151024, #3a245c 58%, #66477f);
  box-shadow: var(--shadow-lg);
}

.course-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background: url("../assets/archetypes/archetype-scene.svg") center / cover;
  opacity: 0.17;
  pointer-events: none;
}

.course-hero-copy,
.course-archetype-visual {
  position: relative;
  z-index: 1;
}

.course-hero-copy {
  padding: 28px 20px;
}

.course-hero .eyebrow {
  color: var(--gold-light);
}

.course-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(2.7rem, 12vw, 5.5rem);
  line-height: 0.94;
}

.course-lead {
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.77);
  line-height: 1.65;
}

.course-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-hero-chips span {
  display: inline-flex;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.77rem;
}

.course-archetype-visual {
  min-height: 280px;
  margin: 0;
}

.course-archetype-visual img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  object-position: center 18%;
}

.course-archetype-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 40%, rgba(17, 11, 30, 0.88));
}

.course-archetype-visual figcaption {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 17px;
  left: 18px;
  color: rgba(255, 255, 255, 0.88);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.45;
}

.coach-disclaimer {
  margin: 12px 0;
  padding: 10px 13px;
  border: 1px solid rgba(75, 47, 115, 0.12);
  border-radius: 14px;
  color: #544a60;
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  line-height: 1.45;
}

.course-tabs {
  position: sticky;
  z-index: 20;
  top: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.course-tab {
  min-height: 44px;
  padding: 9px 10px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  font-weight: 760;
  cursor: pointer;
}

.course-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--night-soft), var(--violet));
  box-shadow: 0 9px 20px rgba(41, 25, 66, 0.18);
}

.course-view {
  display: none;
  gap: 14px;
}

.course-view.is-active {
  display: grid;
}

.day-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.day-toolbar > div {
  min-width: 0;
  display: grid;
  justify-items: center;
  text-align: center;
}

.day-toolbar-label {
  color: var(--muted);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-toolbar strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-toolbar .button {
  min-width: 44px;
  padding-inline: 10px;
  font-size: 0.78rem;
}

.lesson-card {
  display: grid;
  gap: 14px;
  padding: 19px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.87);
  box-shadow: var(--shadow-sm);
}

.lesson-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--violet);
  background: rgba(117, 87, 165, 0.09);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.lesson-card h2,
.section-heading h2 {
  margin-bottom: 13px;
  font-size: clamp(1.65rem, 7vw, 2.45rem);
  line-height: 1.08;
}

.lesson-card-main {
  min-width: 0;
}

.markdown-copy {
  color: #34454c;
  line-height: 1.72;
}

.markdown-copy > :last-child {
  margin-bottom: 0;
}

.markdown-copy h3,
.markdown-copy h4 {
  margin: 1.4em 0 0.55em;
  font-family: inherit;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.markdown-copy ul,
.markdown-copy ol {
  display: grid;
  gap: 7px;
  padding-left: 1.25rem;
}

.markdown-copy blockquote {
  margin: 1.2rem 0;
  padding: 12px 15px;
  border-left: 3px solid var(--gold);
  color: #53445d;
  background: rgba(212, 169, 97, 0.09);
}

.media-grid {
  display: grid;
  gap: 10px;
}

.media-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 13px;
  padding: 16px;
  border: 1px dashed rgba(75, 47, 115, 0.22);
  border-radius: 18px;
  color: #50495a;
  background: rgba(255, 255, 255, 0.48);
}

.media-card.has-media {
  display: block;
  border-style: solid;
  background: #171125;
}

.media-card video,
.media-card audio,
.media-card iframe {
  width: 100%;
  border: 0;
  border-radius: 12px;
}

.media-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--violet);
  background: rgba(117, 87, 165, 0.1);
}

.media-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

/* Atem player */

.atem-player-mount {
  margin-top: 18px;
}

.atem-player {
  overflow: hidden;
  border: 1px solid rgba(75, 47, 115, 0.14);
  border-radius: 24px;
  background: linear-gradient(180deg, #201634, #3b2859);
  box-shadow: 0 20px 42px rgba(23, 14, 39, 0.18);
}

.atem-player.is-locked {
  color: var(--ink);
  background: rgba(245, 239, 229, 0.95);
  box-shadow: none;
}

.atem-player-lock {
  padding: 22px;
}

.atem-player-lock h3 {
  margin-bottom: 9px;
}

.atem-player-lock p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.atem-player-stage {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 26px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 48%, rgba(212, 169, 97, 0.2), transparent 28%),
    url("../assets/archetypes/archetype-scene.svg") center / cover;
}

.atem-player-stage::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(17, 11, 30, 0.26), rgba(17, 11, 30, 0.68));
  pointer-events: none;
}

.atem-orb-wrap {
  --orb-progress: 0;
  position: relative;
  z-index: 1;
  width: min(280px, 76vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--gold-light) calc(var(--orb-progress) * 1%), rgba(255, 255, 255, 0.1) 0);
}

.atem-orb-wrap::before {
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  content: "";
  background: #24183d;
}

.atem-orb {
  --breath-scale: 0.72;
  position: relative;
  width: 68%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #24182e;
  text-align: center;
  transform: scale(var(--breath-scale));
  transition: transform 160ms linear, background 220ms ease;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), transparent 22%),
    linear-gradient(145deg, #f5dbad, #b98a4d 50%, #785c9f);
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.055), 0 28px 60px rgba(9, 5, 18, 0.35);
}

.atem-orb[data-phase="hold"],
.atem-orb[data-phase="hold-empty"] {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92), transparent 22%),
    linear-gradient(145deg, #e7d9f7, #9473ba 52%, #d4a961);
}

.atem-orb-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  padding: 18px;
}

.atem-orb-copy span {
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.atem-orb-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 14vw, 4.4rem);
  line-height: 0.92;
}

.atem-orb-copy small {
  max-width: 17ch;
  color: rgba(36, 24, 46, 0.75);
  line-height: 1.3;
}

.atem-player-controls {
  display: grid;
  gap: 15px;
  padding: 20px;
  color: #fff;
}

.atem-technique-head {
  display: grid;
  gap: 5px;
}

.atem-technique-head strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.atem-technique-head span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.84rem;
}

.atem-timeline {
  display: flex;
  gap: 6px;
}

.atem-phase {
  min-width: 0;
  flex: 1 1 var(--phase-width);
  padding: 9px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.055);
  text-align: center;
  font-size: 0.7rem;
}

.atem-phase.is-active {
  color: #24182e;
  border-color: rgba(242, 211, 159, 0.8);
  background: var(--gold-light);
}

.atem-phase strong,
.atem-phase span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atem-phase span {
  margin-top: 2px;
  opacity: 0.72;
}

.atem-session-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.atem-session-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.atem-session-actions .button-quiet {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
}

.exercise-card.is-complete .atem-player {
  box-shadow: 0 0 0 3px rgba(49, 118, 93, 0.13), 0 20px 42px rgba(23, 14, 39, 0.13);
}

/* Check-in */

.range-grid {
  display: grid;
  gap: 12px;
  margin: 6px 0 4px;
}

.range-field {
  display: grid;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(117, 87, 165, 0.045);
}

.range-field > span,
.range-field small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-field output {
  min-width: 38px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--violet);
  text-align: center;
  font-weight: 800;
}

.range-field input[type="range"] {
  width: 100%;
  accent-color: var(--violet);
}

.range-field small {
  color: var(--muted);
  font-size: 0.7rem;
}

.optional {
  color: var(--muted);
  font-weight: 500;
}

.completion-row {
  display: grid;
  gap: 14px;
  align-items: center;
  margin-top: 6px;
  padding: 15px;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(75, 47, 115, 0.07), rgba(212, 169, 97, 0.11));
}

.completion-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Path */

.section-heading {
  padding: 23px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.82);
}

.section-heading > p:last-child {
  max-width: 62ch;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.overall-progress {
  display: grid;
  gap: 14px;
  padding: 19px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-md);
  color: #fff;
  background: linear-gradient(135deg, var(--night), var(--violet));
}

.overall-progress > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.overall-progress strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
}

.overall-progress span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 360ms ease;
}

.phase-grid {
  display: grid;
  gap: 10px;
}

.phase-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.64);
}

.phase-card.is-current {
  border-color: rgba(117, 87, 165, 0.32);
  background: linear-gradient(135deg, rgba(117, 87, 165, 0.11), rgba(212, 169, 97, 0.1));
}

.phase-index {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--violet);
  background: rgba(117, 87, 165, 0.1);
  font-weight: 850;
}

.phase-card strong,
.phase-card small {
  display: block;
}

.phase-card small,
.phase-progress {
  color: var(--muted);
  font-size: 0.76rem;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.day-button {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 800;
  cursor: pointer;
}

.day-button.is-complete {
  color: #fff;
  border-color: var(--success);
  background: var(--success);
}

.day-button.is-current {
  box-shadow: 0 0 0 3px rgba(212, 169, 97, 0.22);
  border-color: var(--gold);
}

.day-button.is-locked {
  color: #98a1a5;
  background: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
}

.day-button.is-locked::after {
  position: absolute;
  right: 5px;
  bottom: 4px;
  content: "·";
}

/* Coach */

.coach-heading {
  display: grid;
  gap: 12px;
}

.coach-limit {
  width: fit-content;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--violet);
  background: rgba(117, 87, 165, 0.09);
  font-size: 0.76rem;
  font-weight: 750;
}

.coach-disclaimer-large {
  margin: 0;
  padding: 13px 15px;
  border-color: rgba(169, 84, 96, 0.16);
  background: rgba(169, 84, 96, 0.055);
}

.coach-layout {
  display: grid;
  gap: 12px;
}

/* Einladung, wenn der digitale Begleiter nicht gebucht ist. Ruhig gehalten:
   kein Pop-up, kein Zähler, keine Verknappung — ein Kurs ist keine
   Verkaufsfläche. Die eigentliche Sperre sitzt serverseitig (HTTP 402). */

.coach-offer {
  display: grid;
  gap: 16px;
  padding: 19px 17px;
  border: 1px solid rgba(212, 169, 97, 0.32);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(212, 169, 97, 0.1), rgba(117, 87, 165, 0.06));
}

.coach-offer h3 {
  margin-bottom: 9px;
  font-size: 1.28rem;
}

.coach-offer p {
  color: var(--muted);
  line-height: 1.62;
}

.coach-offer ul {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.55;
}

.coach-offer-limits {
  margin-bottom: 0;
  font-size: 0.84rem;
}

.coach-offer-side {
  display: grid;
  align-content: start;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.82);
}

.coach-offer-price {
  margin: 0;
  color: var(--ink);
}

.coach-offer-price strong {
  color: var(--violet);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  line-height: 1;
}

.coach-offer-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.chat-card,
.coach-prompts {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-sm);
}

.chat-history {
  min-height: 340px;
  max-height: 560px;
  display: grid;
  align-content: start;
  gap: 13px;
  overflow-y: auto;
  padding: 16px;
}

.chat-message {
  max-width: 92%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
}

.chat-message.user-message {
  grid-template-columns: 1fr;
  justify-self: end;
  padding: 12px 14px;
  border-radius: 17px 17px 4px 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--night-soft), var(--violet));
}

.chat-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #24182e;
  background: var(--gold-light);
  font-size: 0.68rem;
  font-weight: 850;
}

.chat-message > div {
  padding: 11px 13px;
  border-radius: 4px 17px 17px 17px;
  background: rgba(117, 87, 165, 0.075);
}

.chat-message p {
  margin: 4px 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-feedback {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.chat-feedback button {
  min-width: 34px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.chat-feedback button.is-selected {
  border-color: var(--gold);
  background: rgba(212, 169, 97, 0.18);
}

.chat-form {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  min-height: 70px;
}

.coach-prompts {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 17px;
}

.coach-prompts h3 {
  margin-bottom: 5px;
  font-size: 1.22rem;
}

.coach-prompts button {
  padding: 12px 13px;
  border: 1px solid rgba(75, 47, 115, 0.13);
  border-radius: 14px;
  color: #4a3b59;
  background: rgba(117, 87, 165, 0.055);
  text-align: left;
  cursor: pointer;
}

.coach-prompts p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* Gate */

.gate-dialog {
  width: min(720px, calc(100% - 20px));
  max-height: calc(100dvh - 20px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 36px 100px rgba(10, 6, 18, 0.46);
}

.gate-dialog::backdrop {
  background: rgba(15, 9, 27, 0.72);
  backdrop-filter: blur(8px);
}

.gate-card {
  padding: 21px 17px;
}

.gate-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 13px;
}

.gate-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 7vw, 2.3rem);
  line-height: 1.05;
}

.gate-card > p {
  color: var(--muted);
  line-height: 1.55;
}

.gate-questions {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.gate-question {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(117, 87, 165, 0.035);
}

.gate-question p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.42;
}

.gate-choice {
  display: flex;
  gap: 5px;
}

.gate-choice label {
  position: relative;
}

.gate-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gate-choice span {
  min-width: 42px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
}

.gate-choice input:checked + span {
  color: #fff;
  border-color: var(--violet);
  background: var(--violet);
}

.gate-choice input:focus-visible + span {
  outline: 3px solid rgba(212, 169, 97, 0.5);
  outline-offset: 2px;
}

.gate-footnote {
  margin: 13px 0 0;
  font-size: 0.76rem;
}

@keyframes loading-breath {
  0%,
  100% {
    transform: scale(0.78);
  }
  50% {
    transform: scale(1);
  }
}

@media (min-width: 620px) {
  .member-topbar nav,
  .account-name {
    display: flex;
  }

  .member-brand img {
    width: 46px;
    height: 46px;
  }

  .login-card,
  .login-intro {
    padding: 34px;
  }

  .lesson-card {
    grid-template-columns: 48px 1fr;
    gap: 18px;
    padding: 25px;
  }

  .media-grid,
  .range-grid,
  .phase-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .day-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .atem-session-actions,
  .chat-form {
    grid-template-columns: 1fr auto;
  }

  .atem-session-actions .button {
    min-width: 145px;
  }

  .gate-card {
    padding: 30px;
  }
}

@media (min-width: 900px) {
  .member-topbar,
  .course-shell,
  .login-shell {
    width: min(1180px, calc(100% - 48px));
  }

  .member-topbar {
    margin-top: 20px;
    padding: 14px 18px;
  }

  .login-shell {
    min-height: calc(100vh - 122px);
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    align-items: stretch;
    gap: 18px;
    margin-top: 18px;
  }

  .login-intro {
    min-height: 680px;
    display: grid;
    align-content: center;
    padding: 58px 54px;
  }

  .login-card {
    padding: 48px 42px;
  }

  .login-path {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .login-path article {
    grid-template-columns: 1fr;
  }

  .login-portrait {
    position: absolute;
    right: 26px;
    bottom: 26px;
    width: min(340px, 38%);
    opacity: 0.75;
  }

  .login-portrait img {
    height: 220px;
  }

  .course-shell {
    margin-top: 18px;
  }

  .course-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  }

  .course-hero-copy {
    display: grid;
    align-content: center;
    min-height: 390px;
    padding: 52px 50px;
  }

  .course-archetype-visual,
  .course-archetype-visual img {
    min-height: 390px;
  }

  .course-archetype-visual::after {
    background: linear-gradient(90deg, rgba(30, 19, 50, 0.72), transparent 30%), linear-gradient(180deg, transparent 55%, rgba(17, 11, 30, 0.88));
  }

  .course-tabs {
    width: fit-content;
    min-width: 410px;
    margin: 16px auto 20px;
  }

  .course-view {
    gap: 18px;
  }

  .day-toolbar {
    padding: 14px 18px;
  }

  .media-grid {
    gap: 14px;
  }

  .atem-player {
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 1.05fr);
  }

  .atem-player.is-locked {
    display: block;
  }

  .atem-player-stage {
    min-height: 470px;
  }

  .atem-player-controls {
    align-content: center;
    padding: 30px;
  }

  .coach-heading {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .coach-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .coach-offer {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 24px;
    padding: 26px 28px;
  }

  .chat-history {
    padding: 24px;
  }

  .chat-form {
    padding: 16px;
  }

  .phase-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .phase-card {
    grid-template-columns: auto 1fr;
  }

  .phase-progress {
    grid-column: 1 / -1;
  }

  .day-grid {
    grid-template-columns: repeat(15, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
