:root {
  color-scheme: light;
  --ink: #080808;
  --paper: #f7f7f7;
  --muted: rgba(255, 255, 255, 0.68);
  --warm: #ffffff;
  --warm-soft: rgba(255, 255, 255, 0.4);
  --warm-glow: rgba(255, 255, 255, 0.58);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.22);
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
  --app-font: Copperplate, "Copperplate Gothic Light", "Copperplate Gothic Bold", "Avenir Next", Avenir, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.64)),
    url("assets/home-poster.jpg") center / cover no-repeat,
    linear-gradient(145deg, #f5f5f5 0%, #b8b8b8 32%, #5f5f5f 62%, #050505 100%);
  background-blend-mode: normal;
  color: var(--paper);
  font-family: var(--app-font);
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

.background-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100%;
  object-fit: cover;
  filter: none;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 34%, rgba(0, 0, 0, 0.74)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 46%, rgba(0, 0, 0, 0.56));
}

button,
a,
select,
input,
textarea {
  font: inherit;
  touch-action: manipulation;
}

button {
  color: inherit;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: 0 18px 58px var(--warm-glow), 0 20px 60px rgba(0, 0, 0, 0.34);
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

button:disabled:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.app-frame {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-columns: auto 1fr;
}

.app-frame.is-hidden {
  display: none;
}

.home-screen {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  padding: clamp(22px, 5vw, 72px);
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.home-screen.is-hidden {
  display: none;
}

.home-screen.is-entering h1,
.home-screen.is-entering .about-link,
.home-screen.is-entering .login-link {
  animation: homeFadeIn 720ms ease both;
}

.home-screen.is-entering h1 {
  animation-delay: 80ms;
}

.home-screen.is-entering .about-link {
  animation-delay: 260ms;
}

.home-screen.is-entering .login-link {
  animation-delay: 360ms;
}

.home-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-screen h1 {
  grid-row: 2;
  max-width: 10ch;
  margin: 0;
  font-family: var(--app-font);
  font-size: clamp(4.2rem, 11vw, 10.5rem);
  font-weight: 500;
  line-height: 0.86;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 30px 80px rgba(0, 0, 0, 0.54);
}

.home-actions {
  position: absolute;
  top: clamp(22px, 5vw, 64px);
  right: clamp(18px, 4vw, 54px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.about-link,
.login-link,
.about-back {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--paper);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.about-link,
.login-link {
  position: static;
  min-width: 94px;
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-screen {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 86px);
  text-align: center;
}

.about-screen.is-hidden {
  display: none;
}

.about-back {
  bottom: clamp(22px, 5vw, 64px);
  left: 50%;
  width: 48px;
  height: 48px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
  font-size: 2.35rem;
  line-height: 1;
}

.about-content {
  width: min(920px, 100%);
  display: grid;
  gap: clamp(20px, 4vw, 38px);
}

.about-content > p {
  margin: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.about-content h2 {
  margin: 0;
  color: var(--paper);
  font-size: clamp(2.7rem, 7vw, 7.2rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 30px 80px rgba(0, 0, 0, 0.54);
}

.about-content div {
  width: min(680px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.about-content div p {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(1rem, 2vw, 1.32rem);
  line-height: 1.5;
  text-wrap: balance;
}

.role-screen {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 72px);
}

.role-screen.is-hidden {
  display: none;
}

.role-choices {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 30px);
}

.role-screen {
  grid-template-rows: 1fr auto;
  gap: 24px;
}

.role-choice {
  min-height: clamp(190px, 32vh, 340px);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(20, 12, 6, 0.52));
  color: var(--paper);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34), inset 10px 10px 28px rgba(0, 0, 0, 0.22), inset -8px -8px 22px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  cursor: pointer;
}

.role-choice span {
  font-size: clamp(2.2rem, 6vw, 5.4rem);
  font-weight: 500;
  letter-spacing: 0;
  text-shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
}

.role-choice.is-active {
  border-color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(20, 12, 6, 0.58));
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(20, 12, 6, 0.56);
  box-shadow: 0 24px 74px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(20px);
}

.login-panel.is-hidden {
  display: none;
}

.login-panel p {
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-panel label {
  display: grid;
  gap: 7px;
}

.login-panel label span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-panel input {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(32, 18, 8, 0.4);
  color: var(--paper);
  outline: none;
}

.login-error {
  min-height: 1em;
  color: #ffe1c5 !important;
  font-size: 0.68rem !important;
}

.login-submit {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--paper);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.calendar-panel {
  position: relative;
  z-index: 4;
  width: 322px;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(32, 18, 8, 0.48);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  transition: width 240ms ease, background 240ms ease;
}

.calendar-panel.is-collapsed {
  width: 94px;
  background: rgba(32, 18, 8, 0.34);
}

.calendar-panel.is-collapsed .calendar-current {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.calendar-current {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
}

.calendar-toggle {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(0, 0, 0, 0.42));
  box-shadow: inset 6px 6px 16px rgba(0, 0, 0, 0.38), inset -5px -5px 13px rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.calendar-toggle span {
  font-family: var(--app-font);
  font-size: 1.22rem;
  letter-spacing: 0;
}

.calendar-current strong,
.calendar-current span,
.brand span,
.eyebrow,
.calendar-drawer label span {
  display: block;
  color: var(--muted);
  font-family: var(--app-font);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.calendar-current strong {
  color: var(--paper);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}

.calendar-panel.is-collapsed .calendar-current > div,
.calendar-panel.is-collapsed .calendar-drawer {
  display: none;
}

.calendar-drawer {
  height: calc(100vh - 96px);
  margin-top: 22px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 13px;
}

.calendar-drawer label {
  display: grid;
  gap: 7px;
}

.calendar-drawer select,
.calendar-drawer input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(32, 18, 8, 0.4);
  color: var(--paper);
  outline: none;
}

.calendar-drawer option {
  color: #111;
}

.calendar-results {
  min-height: 0;
  overflow: auto;
  padding: 8px 2px 2px;
  scrollbar-color: rgba(255, 255, 255, 0.36) transparent;
}

.month-grid-title {
  margin-bottom: 12px;
  color: var(--paper);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

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

.weekday-label {
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.68rem;
  font-weight: 900;
  text-align: center;
}

.day-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.day-cell:hover,
.day-cell.is-active {
  background: rgba(255, 255, 255, 0.34);
}

.day-cell:hover {
  transform: scale(1.04);
}

.day-cell.is-empty {
  border: 0;
  background: transparent;
  pointer-events: none;
}

.day-cell.is-fallback {
  opacity: 0.58;
}

.day-cell.is-today {
  outline: 1px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.day-cell.is-completed {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.42);
}

.day-cell.is-completed::after {
  position: absolute;
  right: 2px;
  bottom: 0;
  content: "✓";
  color: #fff;
  font-size: 0.62rem;
}

.empty-results {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.shell {
  position: relative;
  height: 100vh;
  min-width: 0;
  padding: 24px clamp(20px, 5vw, 72px);
  display: grid;
  grid-template-rows: 70px minmax(0, 1fr) 56px;
  gap: 12px;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  justify-items: center;
  width: max-content;
  max-width: min(320px, 42vw);
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--paper);
  text-align: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.brand span,
.brand strong,
.brand em {
  width: 100%;
  text-align: center;
}

.brand span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  margin-top: 4px;
  font-family: var(--app-font);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand em {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1;
}

.brand:hover {
  background: transparent;
  color: #fff;
  text-shadow: 0 0 20px var(--warm-glow), 0 18px 54px rgba(0, 0, 0, 0.48);
  transform: translate(-50%, -50%) scale(1.16);
}

.role-badge {
  display: inline-grid;
  min-height: 30px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.icon-button,
.logout-button,
.stage-advance {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  color: var(--paper);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.icon-button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
}

.logout-button {
  min-width: 86px;
  height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.experience {
  position: relative;
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  outline: none;
  padding: 82px 56px 104px;
  overflow: hidden;
}

.experience:has(.lesson-stage.is-active) {
  padding-bottom: 134px;
}

.experience.is-entering {
  animation: fadeInLesson 420ms ease both;
}

.eyebrow {
  position: absolute;
  top: 28px;
  margin: 0;
}

.stage-indicator {
  position: absolute;
  right: 0;
  top: 50%;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.stage-dot {
  width: 7px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.stage-dot.is-active {
  background: var(--warm);
}

.stage {
  display: none;
  width: min(860px, 100%);
  max-height: min(58vh, 520px);
  overflow: hidden;
  animation: stageRise 360ms ease both;
}

.stage.is-active {
  display: grid;
  align-items: center;
  justify-items: center;
}

blockquote,
.message,
.lesson-action {
  margin: 0;
  font-family: var(--app-font);
  font-size: var(--fit-size, clamp(2.7rem, 6.8vw, 6.8rem));
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
}

.message,
.lesson-action {
  max-width: 860px;
  color: rgba(255, 255, 255, 0.86);
}

.message {
  font-size: var(--fit-size, clamp(2.1rem, 5vw, 5.4rem));
}

.lesson-action {
  font-size: var(--fit-size, clamp(2.2rem, 5.3vw, 5.8rem));
}

.lesson-stage {
  width: min(900px, 100%);
  max-height: min(66vh, 600px);
  gap: 16px;
  overflow: auto;
  padding: clamp(20px, 3.4vw, 36px) clamp(22px, 4vw, 42px) clamp(28px, 4vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(0, 0, 0, 0.18));
  box-shadow: 0 28px 90px rgba(255, 255, 255, 0.2), 0 28px 80px rgba(0, 0, 0, 0.34);
}

.objective-label {
  color: #ffe1c5;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 22px var(--warm-glow);
}

.lesson-stage .lesson-action {
  color: #fff8f1;
  text-shadow: 0 0 26px rgba(255, 255, 255, 0.32), 0 26px 70px rgba(0, 0, 0, 0.5);
}

.objective-journal {
  width: min(620px, 100%);
  display: grid;
  gap: 8px;
}

.objective-journal span,
.journal-status {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.objective-journal textarea {
  width: 100%;
  min-height: 92px;
  max-height: 150px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(20, 12, 6, 0.38);
  color: #fff;
  box-shadow: inset 8px 8px 22px rgba(0, 0, 0, 0.24), inset -6px -6px 18px rgba(255, 255, 255, 0.06);
  outline: none;
  line-height: 1.35;
  text-transform: none;
}

.objective-journal textarea:focus {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16), inset 8px 8px 22px rgba(0, 0, 0, 0.24);
}

.objective-journal textarea::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

.journal-status {
  min-height: 1em;
  margin: -8px 0 0;
  color: #ffe1c5;
}

.complete-button {
  min-width: 148px;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--paper);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.complete-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.complete-button:disabled:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.24);
}

.complete-button.is-completed {
  background: rgba(255, 255, 255, 0.48);
}

.audio-stage {
  width: min(520px, 100%);
  gap: 26px;
}

#lessonAudio {
  display: none;
}

.caption-text {
  min-height: 4.4em;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1.45rem, 3vw, 2.8rem);
  line-height: 1.12;
  text-wrap: balance;
  text-shadow: 0 18px 52px rgba(0, 0, 0, 0.55);
}

.caption-text span {
  color: rgba(255, 255, 255, 0.42);
  transition: color 120ms ease, text-shadow 120ms ease;
}

.caption-text span.is-spoken {
  color: #fff4e8;
  text-shadow: 0 0 18px var(--warm-glow), 0 18px 52px rgba(0, 0, 0, 0.55);
}

.audio-controls {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.play-toggle {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: var(--paper);
  cursor: pointer;
}

#seekControl,
#volumeControl {
  width: 100%;
  accent-color: var(--warm);
}

.audio-options {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 12px;
  align-items: center;
}

.volume-control {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.volume-control span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#speedControl {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(32, 18, 8, 0.34);
  color: var(--paper);
  text-align: center;
}

#speedControl option {
  color: #111;
}

.stage-advance {
  position: absolute;
  bottom: 26px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  color: rgba(255, 255, 255, 0.72);
  font-size: 2.35rem;
  line-height: 1;
}

.experience:has(.lesson-stage.is-active) .stage-advance {
  bottom: 18px;
}

.admin-panel {
  position: absolute;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 30px);
  z-index: 5;
  width: min(420px, calc(100vw - 120px));
  max-height: min(78vh, 760px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(20, 12, 6, 0.56);
  box-shadow: 0 24px 74px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(20px);
}

.admin-panel[hidden] {
  display: none;
}

.admin-panel > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.admin-panel span,
.admin-panel dt {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-panel strong {
  color: #fff;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.admin-panel dl {
  margin: 14px 0 0;
  display: grid;
  gap: 9px;
}

.admin-panel dl > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
}

.admin-panel dd {
  min-width: 0;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.74rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-panel a {
  color: #ffe1c5;
  text-decoration: none;
}

.admin-tabs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-tabs button,
.admin-section input,
.admin-section textarea,
.admin-section select {
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(20, 12, 6, 0.42);
  color: #fff;
}

.admin-tabs button {
  min-height: 34px;
  cursor: pointer;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-tabs button.is-active {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.admin-section {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.admin-section.is-hidden {
  display: none;
}

.admin-section label {
  display: grid;
  gap: 6px;
}

.admin-section input,
.admin-section textarea,
.admin-section select {
  width: 100%;
  padding: 10px;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.35;
}

.admin-section textarea {
  resize: vertical;
}

.admin-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-status {
  min-height: 18px;
  margin: 0;
  color: #ffe1c5;
  font-size: 0.72rem;
}

.admin-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
}

.admin-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.admin-list-item strong {
  font-size: 0.78rem;
}

.admin-list-item span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.7rem;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}

@keyframes fadeInLesson {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes homeFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stageRise {
  from {
    opacity: 0;
    transform: translateY(26px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@supports (height: 100dvh) {
  .background-video,
  .app-frame,
  .home-screen,
  .about-screen,
  .role-screen,
  .shell {
    height: 100dvh;
  }

  .app-frame {
    min-height: 100dvh;
  }
}

@media (max-width: 820px) {
  body {
    overscroll-behavior: none;
  }

  .app-frame {
    display: block;
  }

  .calendar-panel,
  .calendar-panel.is-collapsed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: auto;
    min-height: 0;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .calendar-panel.is-collapsed .calendar-current {
    position: static;
    transform: none;
  }

  .calendar-panel.is-collapsed .calendar-current > div {
    display: block;
  }

  .calendar-drawer {
    height: min(58vh, 440px);
  }

  .shell {
    padding: 92px 18px 18px;
    grid-template-rows: 64px minmax(0, 1fr) auto;
  }

  .stage-indicator {
    right: 4px;
  }

  blockquote {
    font-size: clamp(2.35rem, 11vw, 4.8rem);
  }

  .message,
  .lesson-action {
    font-size: clamp(2.05rem, 9.2vw, 4.1rem);
  }

  .home-screen h1 {
    font-size: clamp(3.4rem, 16vw, 6.6rem);
  }

  .home-actions {
    top: 16px;
    right: 16px;
    gap: 8px;
  }

  .about-link,
  .login-link {
    min-width: 78px;
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.62rem;
  }

  .experience {
    padding: 78px 30px 96px;
  }

  .stage {
    max-height: min(54vh, 460px);
  }

  .role-choices {
    grid-template-columns: 1fr;
  }

  .role-choice {
    min-height: 190px;
  }

  .admin-panel {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }
}

@media (hover: none) and (pointer: coarse) {
  button:hover {
    transform: none;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  }

  .brand:hover {
    transform: translate(-50%, -50%);
    text-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
