/* =====================================================================
   Ayani Website — styles
   Loaded after colors_and_type.css (which provides tokens).
   ===================================================================== */

html, body { height: 100%; }
/* Site crosshair cursor — shared so text boxes can set it explicitly (browsers
   otherwise swap to the text I-beam over editable fields). */
:root { --ay-cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 28 28'><line x1='14' y1='2' x2='14' y2='10' stroke='%23ffffff' stroke-width='1'/><line x1='14' y1='18' x2='14' y2='26' stroke='%23ffffff' stroke-width='1'/><line x1='2' y1='14' x2='10' y2='14' stroke='%23ffffff' stroke-width='1'/><line x1='18' y1='14' x2='26' y2='14' stroke='%23ffffff' stroke-width='1'/><circle cx='14' cy='14' r='1' fill='%23ffffff'/></svg>") 10 10, crosshair; }
body {
  margin: 0;
  background: #000;
  color: #9F9F9F;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  cursor: var(--ay-cursor);
}
#root { height: 100%; }
.ay-app, .ay-screen { width: 100%; height: 100vh; min-height: 480px; position: relative; overflow: hidden; }
button, input, textarea, select { font-family: inherit; cursor: inherit; }

/* =====================================================================
   BUTTON — rotating glow border
   ===================================================================== */
@property --ay-btn-angle {
  syntax: '<angle>';
  inherits: true;
  initial-value: 0deg;
}
@keyframes ay-btn-spin {
  to { --ay-btn-angle: 360deg; }
}

.ay-btn {
  position: relative;
  background: var(--box-bg);
  color: #9F9F9F;
  border: 0;
  border-radius: 4px;
  padding: 14px 26px;
  font: 500 13px/1 'DM Sans', sans-serif;
  cursor: inherit;
  isolation: isolate;
  transition: color 220ms ease;
}
.ay-btn:hover { color: #fff; }
.ay-btn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--ay-btn-angle),
    rgba(255,255,255,0)  0%,
    rgba(255,255,255,0)  72%,
    rgba(255,255,255,0.95) 82%,
    rgba(255,255,255,0)  92%,
    rgba(255,255,255,0)  100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: ay-btn-spin 4.5s linear infinite;
  pointer-events: none;
  z-index: -1;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
}
.ay-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.06);
  pointer-events: none;
  z-index: -1;
}

/* ---------- Form fields ---------- */
.ay-field { display: block; margin-bottom: 25px; }
.ay-field:last-of-type { margin-bottom: 0; }
.ay-field span { display: block; font-size: 11px; color: #646464; margin-bottom: 6px; }
.ay-field input {
  width: 100%; box-sizing: border-box;
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
  color: #9F9F9F;
  padding: 8px 12px;
  border-radius: 2px;
  font: 400 11px/1 'DM Sans', sans-serif;
}
.ay-field input::placeholder { color: #646464; }
.ay-pass-input::placeholder { letter-spacing: 4px; }
.ay-field input, .ay-field input:hover, .ay-field input:focus { cursor: var(--ay-cursor); }
.ay-field input:focus { outline: none; border-color: rgba(255,255,255,0.18); color: #fff; }

/* ============================ LOGIN ============================ */
/* --ay-login-col = width of the right-hand form column (divider line → screen edge).
   The starfield is clipped at the divider so no sky or meteors show behind the form. */
.ay-login { background: #000; overflow: hidden; --ay-login-col: 400px; }
.ay-login .ay-starfield { clip-path: inset(0 var(--ay-login-col) 0 0); }
.ay-login-bg {
  position: absolute;
  left: 0; top: 0;
  height: 50%;
  width: calc(70% - 400px);
  object-fit: cover;
  object-position: left center;
  pointer-events: none;
  user-select: none;
}
.ay-login-beam {
  display: none;
}

/* Beam graphic (AyaniBeam, every student screen) — the Tide light rolls across the beam
   on a canvas over the art (drawn in utils.jsx); on Login (--reveal) the art first draws
   in along its own axis. */
.ay-login-art {
  overflow: hidden;
  isolation: isolate;
  mix-blend-mode: screen; /* the art's black lets the starfield show through */
}

/* Starfield (AyaniStarfield) — sits behind every screen's content. z-index -1 inside an
   isolated screen paints above the screen's black background but below everything else. */
.ay-screen { isolation: isolate; }
.ay-starfield {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}
.ay-login-art--reveal {
  -webkit-mask-image: linear-gradient(45deg, #000 40%, transparent 60%);
          mask-image: linear-gradient(45deg, #000 40%, transparent 60%);
  -webkit-mask-size: 300% 300%;
          mask-size: 300% 300%;
  -webkit-mask-position: 100% 0%;
          mask-position: 100% 0%;
  animation: ay-art-reveal 2.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}
.ay-login-art img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: left center;
}
.ay-beam-fx {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  mix-blend-mode: screen;
  mix-blend-mode: plus-lighter; /* true additive where supported; screen otherwise */
}
@keyframes ay-art-reveal {
  to { -webkit-mask-position: 0% 100%; mask-position: 0% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ay-login-art--reveal { animation: none; -webkit-mask-image: none; mask-image: none; }
}
.ay-login-center {
  position: absolute;
  /* Spans from the divider line to the screen's right edge so the form sits
     centred in the whole right-hand column (divider stays where it was). */
  right: 0; top: 0; bottom: 0;
  width: var(--ay-login-col);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0;
}
.ay-login-center::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}
.ay-login-logo { height: 72px; margin-bottom: 22px; }
.ay-login-form {
  width: 320px;
  margin: 0 auto;
  display: flex; flex-direction: column; align-items: stretch;
}
/* "Access" label stays bright white at all times, not just on hover. */
.ay-login-form .ay-btn { width: 100%; margin-top: 27px; padding: 13px 0; color: #fff; background: var(--box-bg-dark); box-shadow: inset 0 0 20px rgba(0,0,0,0.85); }
.ay-login-form .ay-btn[disabled] { opacity: 0.5; pointer-events: none; }
.ay-login-error { font-size: 12px; color: #d98a8a; margin: 10px 0 0; letter-spacing: 0.01em; }

/* Login access button — two chasing light arcs, offset 180° and slower than the default single-light spin */
.ay-login-form .ay-btn::before {
  background: conic-gradient(from var(--ay-btn-angle),
    rgba(255,255,255,0)  0%,
    rgba(255,255,255,0)  22%,
    rgba(255,255,255,0.95) 32%,
    rgba(255,255,255,0)  42%,
    rgba(255,255,255,0)  50%,
    rgba(255,255,255,0)  72%,
    rgba(255,255,255,0.95) 82%,
    rgba(255,255,255,0)  92%,
    rgba(255,255,255,0)  100%);
  animation-duration: 7s;
}
/* Hover: a white halo spreads around the button and its outline brightens.
   (A drop-shadow on ::before would be clipped by its ring mask, so the glow lives on the button.) */
.ay-login-form .ay-btn { transition: color 220ms ease, box-shadow 260ms ease; }
.ay-login-form .ay-btn::after { transition: border-color 260ms ease; }
.ay-login-form .ay-btn:hover {
  box-shadow: inset 0 0 20px rgba(0,0,0,0.85),
              0 0 4px rgba(255,255,255,0.35),
              0 0 26px rgba(255,255,255,0.22);
}
.ay-login-form .ay-btn:hover::after { border-color: rgba(255,255,255,0.28); }

/* ============================ MENU ============================= */
.ay-menu { background: #000; }

.ay-module-grid {
  position: absolute;
  right: 64px; top: 72px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, 1fr);
  gap: 26px;
  width: min(77vw, 1176px);
}
.ay-module-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 6 / 5;
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 29px 22px 24px;
  text-align: center;
  cursor: inherit;
  color: #9F9F9F;
  font-family: inherit;
  transition: all 220ms ease;
}
.ay-module-tile:not(.is-locked):hover {
  background: var(--box-bg-hover);
  border-color: rgba(255,255,255,0.14);
  color: #fff;
}
.ay-module-tile.is-locked { opacity: 0.45; background: var(--box-bg-locked); }
.ay-module-tile.is-locked .ay-module-lock {
  position: absolute; top: 12px; right: 14px;
  width: 16px; height: 16px;
  stroke: #646464; fill: none; stroke-width: 1.4;
}
.ay-module-logo {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.ay-module-mark { height: 35px; width: auto; opacity: 0.95; mix-blend-mode: screen; }
.ay-module-title  { font: 500 14px/1.3 'DM Sans', sans-serif; color: inherit; }
.ay-module-footer { margin-top: auto; width: 100%; }
.ay-module-pct    { font: 400 13px/1 'DM Sans', sans-serif; color: #646464; margin-bottom: 14px; }
.ay-module-progress {
  height: 5px; width: 100%; margin: 0 auto;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.ay-module-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: #9F9F9F;
  border-radius: 999px;
}
.ay-module-tile.is-locked .ay-module-progress { display: none; }

.ay-menu-status {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font: 400 12px/1.5 'DM Sans', sans-serif;
  color: #646464;
}
.ay-menu-status.is-error { color: #d98a8a; }

.ay-menu-info {
  position: absolute;
  right: 64px; bottom: 72px;
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 20px 40px;
  text-align: center;
}
.ay-menu-info-line {
  font: 500 12px/1.7 'DM Sans', sans-serif;
  color: #9F9F9F;
}
.ay-menu-info-line + .ay-menu-info-line { color: #646464; font-weight: 400; }


/* ========================== CHANNEL ============================ */
.ay-channel {
  background: #000;
  overflow: hidden;
  padding: 56px 200px 56px 80px;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}
.ay-channel-body {
  max-width: 598px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative; z-index: 2;
}
.ay-lesson-list { display: flex; flex-direction: column; gap: 18px; }
.ay-lesson-row {
  display: flex; align-items: center; justify-content: flex-start;
  text-align: left;
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px 20px;
  cursor: inherit;
  color: #9F9F9F;
  font-family: inherit;
  font-size: 12px;
  transition: all 220ms ease;
}
.ay-lesson-row:hover     { background: var(--box-bg-hover); color: #fff; }
.ay-lesson-row.is-active { background: var(--box-bg-active); border-color: rgba(255,255,255,0.18); color: #fff; }
.ay-lesson-row.is-locked { opacity: 0.45; background: var(--box-bg-locked); }
.ay-lesson-divider {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px;
  font: 500 10px/1 'DM Sans', sans-serif;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: #646464;
}
.ay-lesson-divider::before,
.ay-lesson-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
.ay-lesson-list > .ay-lesson-divider:first-child { margin-top: 0; }
.ay-lesson-mark { height: 24.2px; width: auto; margin-right: 22px; opacity: 0.95; mix-blend-mode: screen; flex-shrink: 0; }

/* ========================= EXIT PANEL ========================== */
.ay-exit-panel {
  position: absolute; top: 56px; right: 56px;
  width: 88px;
  box-sizing: border-box;
  background: var(--box-bg);
  border-radius: 10px;
  padding: 10px 12px 16px;
  z-index: 5;
  display: flex; flex-direction: column; align-items: center;
  isolation: isolate;
  /* the whole panel is the button — reset native button chrome */
  border: 0; margin: 0; font: inherit; color: inherit; text-align: left;
  cursor: inherit;
}
.ay-exit-panel::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--ay-btn-angle),
    rgba(255,255,255,0)  0%,
    rgba(255,255,255,0)  72%,
    rgba(255,255,255,0.95) 82%,
    rgba(255,255,255,0)  92%,
    rgba(255,255,255,0)  100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: ay-btn-spin 4.5s linear infinite;
  pointer-events: none;
  z-index: -1;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
}
.ay-exit-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,0.06);
  pointer-events: none;
  z-index: -1;
}
.ay-exit-panel--simple { width: auto; padding: 10px 16px; }
.ay-exit-panel--simple .ay-exit-btn { margin-bottom: 0; }
.ay-exit-btn {
  align-self: flex-start;
  color: #9F9F9F;
  font: 500 12px/1 'DM Sans', sans-serif;
  margin-bottom: 22px;
}
.ay-exit-panel:hover .ay-exit-btn { color: #fff; }
.ay-exit-pct { font: 400 11px/1 'DM Sans', sans-serif; color: #646464; margin-bottom: 8px; }
.ay-exit-bar {
  position: relative; display: block;
  width: 4px; height: 56px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.ay-exit-bar-fill {
  display: block;
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #9F9F9F;
  border-radius: 999px;
}

/* ============================ VIDEO ============================ */
.ay-video { background: #000; padding: 0; }
.ay-video-tag-pill {
  position: absolute; top: 56px; left: 56px;
  font-size: 12px;
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 12px 18px;
  border-radius: 8px;
  color: #9F9F9F;
  z-index: 4;
  min-width: 220px;
}
.ay-video-tabs {
  position: absolute; top: 110px; left: 56px;
  display: flex; gap: 6px;
  z-index: 4;
}
.ay-video-tab {
  font: 500 11px/1 'DM Sans', sans-serif;
  color: #646464;
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: inherit;
}
.ay-video-tab.is-active { color: #fff; border-color: rgba(255,255,255,0.18); }

.ay-video-void {
  position: absolute; left: 56px; right: 200px; top: 160px; bottom: 30px;
}
.ay-video-frame {
  position: absolute; inset: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
}
.ay-video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.ay-video-frame.is-hidden { visibility: hidden; pointer-events: none; }

/* Templates / Extra document tabs */
.ay-docs {
  position: absolute; inset: 0;
  border-radius: 8px;
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 28px;
  box-sizing: border-box;
  overflow-y: auto;
}
.ay-docs-list { display: flex; flex-direction: column; gap: 8px; }
.ay-doc {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label action" "file action";
  align-items: center;
  column-gap: 20px; row-gap: 3px;
  text-align: left;
  padding: 14px 18px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: #9F9F9F;
  cursor: inherit;
  transition: color 220ms ease, border-color 220ms ease;
}
.ay-doc:hover { color: #fff; border-color: rgba(255,255,255,0.18); }
.ay-doc[disabled] { opacity: 0.6; }
.ay-doc-label { grid-area: label; font: 500 13px/1.3 'DM Sans', sans-serif; }
.ay-doc-file { grid-area: file; font: 400 11px/1.3 'DM Sans', sans-serif; color: #646464; }
.ay-doc-action {
  grid-area: action;
  font: 500 10px/1 'DM Sans', sans-serif;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #646464;
}
.ay-doc:hover .ay-doc-action { color: #fff; }
/* Templates tab: inline PDF preview */
.ay-template-view { display: flex; flex-direction: column; padding: 14px; gap: 12px; }
.ay-template-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ay-template-picks { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ay-template-pick,
.ay-template-download {
  background: var(--box-bg);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 8px 12px;
  color: #9F9F9F;
  font: 500 11px/1 'DM Sans', sans-serif;
  cursor: inherit;
  transition: all 220ms ease;
}
.ay-template-pick:hover, .ay-template-download:hover { color: #fff; border-color: rgba(255,255,255,0.18); }
.ay-template-pick.is-active { color: #fff; background: var(--box-bg-active); border-color: rgba(255,255,255,0.18); }
.ay-template-download { flex-shrink: 0; letter-spacing: 0.18em; text-transform: uppercase; font-size: 10px; }
.ay-template-download[disabled] { opacity: 0.6; }
.ay-template-frame { position: relative; flex: 1; min-height: 0; border-radius: 6px; overflow: hidden; background: #111; }
.ay-template-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.ay-docs-error { margin-top: 14px; font: 400 12px/1.4 'DM Sans', sans-serif; color: #d98a8a; }
.ay-video-status {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 40px;
  box-sizing: border-box;
  font: 400 12px/1.5 'DM Sans', sans-serif;
  color: #646464;
}
.ay-video-status.is-error { color: #d98a8a; }
/* Spinner overlay: sits above the Bunny iframe until its `load` event so a slow
   connection shows "loading" rather than a blank black frame. */
.ay-video-loading {
  flex-direction: column; gap: 14px;
  background: #0f0f0f;
  z-index: 1;
}
.ay-video-loading-hint { font-size: 11px; color: #4a4a4a; max-width: 320px; }
.ay-spinner {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  border-top-color: #9F9F9F;
  animation: ay-spin var(--ayani-dur-cinematic) linear infinite;
}
@keyframes ay-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ay-spinner { animation-duration: 2400ms; }
}
.ay-icon-stroke:hover { stroke: #fff; }

/* =====================================================================
   MOBILE — phones (portrait ≤900px wide, or landscape ≤500px tall).
   Desktop positions everything with fixed offsets; here each screen becomes
   a scrollable column under a short beam "hero" band at the top.
   ===================================================================== */
.ay-app, .ay-screen { height: 100dvh; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

@media (max-width: 900px), (max-height: 500px) {
  :root { --ay-m-hero: 30vh; --ay-m-gutter: 16px; }
  .ay-app, .ay-screen { min-height: 0; }
  /* Screens scroll on phones — pin the starfield to the viewport so it stays behind. */
  .ay-starfield { position: fixed; }

  /* Beam art: full-width band across the top instead of a left-hand panel
     (desktop's calc(70% - 400px) collapses to nothing on a phone). */
  .ay-login-bg { width: 100%; height: var(--ay-m-hero); }
  /* The image renders height-led at its own aspect, so the source file's vertical
     seam (~49% across the artwork) sits at 0.866 × band height; fade out before it
     and soften the band's bottom edge. Masked on the container, not the <img>, so
     the overlay light-streaks fade with it. --ay-beam-h = the band's height. */
  .ay-login-art img { width: auto; max-width: none; }
  .ay-login-art {
    --ay-beam-h: var(--ay-m-hero);
    --ay-fade-x: linear-gradient(to right, #000 calc(var(--ay-beam-h) * 0.6), transparent calc(var(--ay-beam-h) * 0.84));
    --ay-fade-y: linear-gradient(to bottom, #000 55%, transparent);
    -webkit-mask-image: var(--ay-fade-x), var(--ay-fade-y);
            mask-image: var(--ay-fade-x), var(--ay-fade-y);
    -webkit-mask-composite: source-in;
            mask-composite: intersect;
  }
  /* Login's draw-in reveal keeps its sweeping layer on top of the two fades. */
  .ay-login-art--reveal {
    -webkit-mask-image: linear-gradient(45deg, #000 40%, transparent 60%), var(--ay-fade-x), var(--ay-fade-y);
            mask-image: linear-gradient(45deg, #000 40%, transparent 60%), var(--ay-fade-x), var(--ay-fade-y);
    -webkit-mask-size: 300% 300%, 100% 100%, 100% 100%;
            mask-size: 300% 300%, 100% 100%, 100% 100%;
    -webkit-mask-position: 100% 0%, 0 0, 0 0;
            mask-position: 100% 0%, 0 0, 0 0;
  }

  /* 16px inputs stop iOS Safari zooming the page on focus. */
  .ay-field input { font-size: 16px; padding: 12px 14px; border-radius: 4px; }

  /* ---------- Login ---------- */
  .ay-login .ay-login-bg { height: 42dvh; --ay-beam-h: 42dvh; }
  .ay-login-center {
    left: 0; right: 0; top: 42dvh; bottom: 0;
    width: auto;
    padding: 24px var(--ay-m-gutter) 32px;
    justify-content: flex-start;
  }
  .ay-login-center::before { display: none; }
  .ay-login .ay-starfield { clip-path: none; }
  .ay-login-form { width: 100%; max-width: 360px; }
  .ay-login-form .ay-btn { padding: 16px 0; font-size: 14px; }

  /* ---------- Exit (pinned, compact: "Exit 40%" on one line) ---------- */
  .ay-exit-panel {
    position: fixed; top: 12px; right: 12px;
    width: auto;
    flex-direction: row; align-items: center; gap: 10px;
    padding: 12px 16px;
  }
  .ay-exit-btn, .ay-exit-pct { margin: 0; }
  .ay-exit-bar { display: none; }
  .ay-exit-panel--simple { padding: 12px 18px; }

  /* ---------- Menu ---------- */
  .ay-menu {
    overflow-y: auto;
    padding: var(--ay-m-hero) var(--ay-m-gutter) 24px;
    box-sizing: border-box;
  }
  .ay-module-grid {
    position: relative; top: auto; right: auto;
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 12px;
  }
  .ay-module-tile { aspect-ratio: auto; min-height: 150px; padding: 20px 14px 16px; }
  .ay-module-logo { margin-bottom: 14px; }
  .ay-module-mark { height: 26px; }
  .ay-module-title { font-size: 13px; margin-bottom: 16px; }
  .ay-module-pct { margin-bottom: 10px; }
  .ay-menu-info {
    position: relative; right: auto; bottom: auto;
    margin-top: 16px;
    padding: 16px 20px;
  }

  /* ---------- Channel ---------- */
  .ay-channel {
    overflow-y: auto;
    padding: var(--ay-m-hero) var(--ay-m-gutter) 32px;
    align-items: stretch;
    justify-content: flex-start;
  }
  .ay-channel-body { max-width: none; flex-shrink: 0; }
  .ay-lesson-list { gap: 10px; }
  .ay-lesson-row { padding: 16px; font-size: 13px; }
  .ay-lesson-mark { height: 20px; margin-right: 16px; }

  /* ---------- Video ---------- */
  .ay-video {
    overflow-y: auto;
    padding: 12px var(--ay-m-gutter) 24px;
    box-sizing: border-box;
    display: flex; flex-direction: column; gap: 12px;
  }
  .ay-video-tag-pill {
    position: relative; top: auto; left: auto;
    min-width: 0;
    margin-right: 108px; /* clear the pinned Exit panel */
    padding: 14px 16px;
    line-height: 1.35;
  }
  .ay-video-tabs { position: relative; top: auto; left: auto; }
  .ay-video-tab { flex: 1; padding: 12px; font-size: 12px; }
  .ay-video-void { position: relative; inset: auto; flex-shrink: 0; }
  /* Video: 16:9, but never taller than the viewport (landscape phones). */
  .ay-video-void--video {
    aspect-ratio: 16 / 9;
    width: min(100%, calc((100dvh - 24px) * 16 / 9));
    align-self: center;
  }
  .ay-docs { position: relative; inset: auto; min-height: 180px; padding: 16px; }
  .ay-template-view { height: 70dvh; min-height: 360px; }
  .ay-template-view { padding: 10px; }
  .ay-template-bar { flex-wrap: wrap; }
  .ay-template-pick, .ay-template-download { padding: 11px 14px; }
  .ay-doc { padding: 14px; column-gap: 12px; }
  .ay-video-status { padding: 20px; }
}

/* Wider phones / small tablets: three tiles across. */
@media (min-width: 600px) and (max-width: 900px) {
  .ay-module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Landscape phones: login goes side-by-side (art left, form right) — stacking
   leaves no room for the form under the art. */
@media (max-height: 500px) and (orientation: landscape) {
  .ay-login .ay-login-bg { width: 50%; height: 100dvh; --ay-beam-h: 100dvh; }
  .ay-login-center { left: 50%; right: 0; width: auto; top: 0; justify-content: center; padding-top: 16px; padding-bottom: 16px; }
  .ay-module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Reduced motion on phones: no reveal sweep, just the two edge fades. */
@media (prefers-reduced-motion: reduce) and (max-width: 900px),
       (prefers-reduced-motion: reduce) and (max-height: 500px) {
  .ay-login-art--reveal {
    -webkit-mask-image: var(--ay-fade-x), var(--ay-fade-y);
            mask-image: var(--ay-fade-x), var(--ay-fade-y);
    -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
  }
}
