/* Finmodel Live Academy • v3 subtitle-style coaching layer.
   Only styles #fm-coach: no changes to the original React application. */
#fm-coach, #fm-coach * { box-sizing: border-box; }
#fm-coach {
  --edu-ink: #17273d;
  --edu-muted: #43556e;
  --edu-blue: #165fcd;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--edu-ink);
  position: relative;
  z-index: 2147483000;
}
#fm-coach [hidden] { display: none !important; }

/* A small, light transport bar; it must not feel like another app chrome. */
#fm-coach .academy-header {
  position: fixed;
  top: 9px;
  right: 13px;
  left: 251px;
  z-index: 2147483004;
  min-height: 53px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 7px 12px 7px 16px;
  border: 1px solid rgba(198, 209, 223, .85);
  border-radius: 13px;
  background: rgba(253, 254, 255, .94);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
  box-shadow: 0 5px 20px rgba(34, 52, 79, .12);
}
#fm-coach .academy-brand {
  color: #243b5b;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: .025em;
  font-weight: 760;
  white-space: nowrap;
}
#fm-coach .academy-live {
  display: block;
  margin-top: 3px;
  color: #647d96;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}
#fm-coach .academy-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
#fm-coach .academy-course-label { color: #536680; font-size: 12px; font-weight: 650; }
#fm-coach button, #fm-coach select {
  background: rgba(255,255,255,.95);
  color: #28415c;
  border: 1px solid #d1dce9;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.1;
  cursor: pointer;
  min-height: 35px;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
#fm-coach select { max-width: 228px; }
#fm-coach button:hover, #fm-coach select:hover { background: #eef5ff; border-color: #a8c3ec; }
#fm-coach button:focus-visible, #fm-coach select:focus-visible { outline: 3px solid #8ac3ff; outline-offset: 2px; }
#fm-coach button:disabled { opacity: .42; cursor: default; }
#fm-coach .academy-primary {
  background: #e3efff;
  border-color: #b1cff5;
  color: #1659ae;
  font-weight: 760;
}
#fm-coach .academy-primary:hover { background: #d4e6ff; }
#fm-coach #academy-progress {
  font: 750 12px Inter, Arial, sans-serif;
  white-space: nowrap;
  min-width: 47px;
  text-align: center;
  color: #3a5f89;
}

/* Real subtitle treatment: a light fade into the application, not a black card.
   Full-width fade eliminates the rectangular 'plaque' look. */
#fm-coach .academy-caption {
  position: fixed;
  left: 242px;
  right: 0;
  bottom: 0;
  z-index: 2147483003;
  width: auto;
  min-height: 180px;
  max-height: min(42vh, 310px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 44px 50px 25px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(
    180deg,
    rgba(247, 250, 254, 0) 0%,
    rgba(247, 250, 254, .78) 27%,
    rgba(249, 251, 254, .95) 55%,
    rgba(250, 252, 255, .985) 100%
  );
  box-shadow: none;
  pointer-events: none;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}
#fm-coach .academy-counter {
  width: 100%;
  max-width: 940px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #4e72a0;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .085em;
  line-height: 1.2;
  text-transform: uppercase;
}
/* Technical state stays accessible to assistive technologies but is not a subtitle. */
#fm-coach #academy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
#fm-coach .academy-caption h2 {
  max-width: 1020px;
  margin: 3px 0 2px;
  font-size: clamp(23px, 1.8vw, 29px);
  font-weight: 790;
  letter-spacing: -.025em;
  line-height: 1.22;
  color: #10243e;
  text-wrap: balance;
}
#fm-coach .academy-caption p {
  max-width: 980px;
  margin: 0;
  font-size: clamp(15px, 1.2vw, 18px);
  font-weight: 500;
  line-height: 1.5;
  color: #334860;
  text-wrap: pretty;
}
#fm-coach .academy-caption .academy-expect {
  margin-top: 3px;
  font-size: clamp(14px, 1.04vw, 16px);
  font-weight: 620;
  color: #1a647a;
  line-height: 1.42;
}

/* Highlight the actual control without darkening or blocking the app. */
#fm-coach .academy-spot {
  position: fixed;
  z-index: 2147483001;
  pointer-events: none;
  border: 3px solid #2785e4;
  border-radius: 10px;
  box-shadow: 0 0 0 5px rgba(53, 142, 239, .20), 0 0 24px rgba(52, 141, 235, .20);
  transition: top .24s ease, left .24s ease, width .24s ease, height .24s ease;
  animation: academy-soft-pulse 2.5s ease-in-out infinite;
}
#fm-coach .academy-pointer {
  position: fixed;
  z-index: 2147483002;
  pointer-events: none;
  border-radius: 7px;
  background: rgba(245,250,255,.96);
  color: #1c66b5;
  border: 1px solid #bad9fa;
  font-size: 12px;
  font-weight: 750;
  padding: 4px 8px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(45,95,143,.13);
}
@keyframes academy-soft-pulse {
  50% {box-shadow: 0 0 0 8px rgba(53, 142, 239, .10), 0 0 30px rgba(52, 141, 235, .12);}
}
@media (prefers-reduced-motion: reduce) {
  #fm-coach .academy-spot {animation: none; transition: none;}
}

@media (max-width: 1110px) {
  #fm-coach .academy-header {left: 248px; gap: 8px;}
  #fm-coach .academy-brand {display: none;}
  #fm-coach .academy-caption {padding-left: 25px; padding-right: 25px;}
}
@media (max-width: 830px) {
  #fm-coach .academy-header {left: 8px; right: 8px; top: 7px; min-height: 48px; padding: 6px 8px; justify-content: center;}
  #fm-coach .academy-controls {justify-content: center; gap: 5px;}
  #fm-coach button, #fm-coach select {padding: 6px 8px; min-height: 32px; font-size: 11px;}
  #fm-coach select {max-width: 165px;}
  #fm-coach .academy-course-label {display: none;}
  #fm-coach .academy-caption {left: 0; right: 0; max-height: 42vh; min-height: 175px; padding: 38px 18px 18px; gap: 4px;}
  #fm-coach .academy-caption h2 {font-size: 23px;}
  #fm-coach .academy-caption p {font-size: 15px; line-height: 1.4;}
  #fm-coach .academy-caption .academy-expect {font-size: 13px;}
}
@media (max-width: 480px) {
  #fm-coach .academy-header {top: 5px; left: 4px; right: 4px; padding: 4px 6px;}
  #fm-coach button, #fm-coach select {font-size: 10px; padding: 5px;}
  #fm-coach .academy-caption {padding-left: 12px; padding-right: 12px; max-height: 47vh; padding-bottom: 12px;}
  #fm-coach .academy-caption h2 {font-size: 20px;}
  #fm-coach .academy-caption p {font-size: 14px;}
}


/* v4: clearly contrasted, compact caption bar. Readable as video subtitles, not a white blur. */
#fm-coach .academy-caption {
  left: calc(242px + (100vw - 242px) / 2);
  right: auto;
  bottom: 18px;
  width: min(940px, calc(100vw - 285px));
  min-height: 0;
  max-height: min(40vh, 300px);
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 9px;
  padding: 20px 34px 19px;
  border: 1px solid rgba(171, 197, 224, .29);
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(20, 39, 65, .965), rgba(30, 53, 76, .948));
  box-shadow: 0 16px 45px rgba(7, 19, 37, .38), 0 2px 8px rgba(0, 0, 0, .12);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  pointer-events: none;
}
#fm-coach .academy-counter { color: #a9d7ff; font-size: 11px; }
#fm-coach .academy-caption h2 {
  color: #ffffff;
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 790;
  text-shadow: 0 1px 3px rgba(5, 20, 37, .45);
}
#fm-coach .academy-caption p {
  color: #e2ecfa;
  font-size: clamp(16px, 1.18vw, 18px);
  font-weight: 520;
  line-height: 1.46;
}
#fm-coach .academy-caption .academy-expect {
  color: #adead8;
  font-size: clamp(14px, 1.02vw, 16px);
  font-weight: 660;
  line-height: 1.42;
}
#fm-coach #academy-help-toggle {color:#114a85; background:#ecf4ff; border-color:#a9c8ef;}
#fm-coach .academy-help {
 position:fixed; top:78px; right:20px; z-index:2147483010;
 display:none; width:min(465px,calc(100vw - 32px)); max-height:calc(100vh - 100px); overflow-y:auto;
 padding:21px 25px 22px; border:1px solid #bbd2eb; border-radius:17px;
 background:rgba(251,253,255,.985); box-shadow:0 22px 66px rgba(10,27,52,.34);
 font-size:15px; line-height:1.55; color:#183551;
}
#fm-coach .academy-help.is-open {display:block;}
#fm-coach .academy-help-top {display:flex;align-items:center;justify-content:space-between;}
#fm-coach .academy-help-eyebrow {font-size:11px;font-weight:800;color:#2566af;letter-spacing:.07em;}
#fm-coach .academy-help h3 {font-size:23px;line-height:1.2;margin:11px 0 11px;font-weight:800;color:#173452;}
#fm-coach .academy-help p {font-size:14.2px;line-height:1.56;margin:10px 0;}
#fm-coach .academy-help ol {margin:14px 0 14px;padding-left:23px;}
#fm-coach .academy-help li {padding:0 0 9px 4px;font-size:14.2px;line-height:1.5;}
#fm-coach .academy-help .academy-help-note {padding:11px 13px;border-radius:9px;background:#ecf3fb;color:#3c5876;font-size:12.5px;}
#fm-coach .academy-help .academy-help-x {font-size:17px;min-width:35px;min-height:35px; padding:6px 8px;}
#fm-coach .academy-help .academy-help-start {width:100%;min-height:43px;background:#146ad2;color:#fff;border:1px solid #146ad2;font-size:14px;font-weight:750;margin-top:6px;}
#fm-coach .academy-help .academy-help-start:hover {background:#095bbf;color:#fff;}
@media (max-width:830px) {
 #fm-coach .academy-caption { left:50%; width:calc(100vw - 24px);bottom:9px;max-height:48vh;padding:16px 18px 17px;gap:5px; }
 #fm-coach .academy-caption h2 {font-size:clamp(18px,4vw,23px);}
 #fm-coach .academy-caption p {font-size:14px;}
 #fm-coach .academy-caption .academy-expect {font-size:13px;}
 #fm-coach .academy-help {top:86px;right:12px;}
}
@media (max-width:480px) {
 #fm-coach .academy-caption {bottom:6px;width:calc(100vw - 12px);padding:12px 14px;max-height:53vh;border-radius:13px;}
 #fm-coach .academy-caption h2 {font-size:18px;line-height:1.21;}
 #fm-coach .academy-caption p {font-size:13.5px;line-height:1.4;}
 #fm-coach .academy-caption .academy-expect {font-size:12.5px;}
 #fm-coach .academy-help {top:100px;right:5px;width:calc(100vw - 10px);padding:15px 18px;max-height:calc(100vh - 118px);}
}

/* Stage 02 navigation fix: all lesson choices are visible at entry, not just a selector. */
#fm-coach .academy-choose-title { margin:13px 0 7px;font-weight:770;color:#153d6a; }
#fm-coach .academy-course-chooser { display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0 14px; }
#fm-coach .academy-course-chooser button { text-align:left;display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:11px 12px;min-height:62px;background:#f2f7ff;border-color:#c7ddf8;color:#153d6a;font-size:13px;font-weight:780; }
#fm-coach .academy-course-chooser button:hover {background:#e2efff;border-color:#91bbf1;}
#fm-coach .academy-course-chooser button span {font-size:11px;font-weight:580;color:#597896;}
@media(max-width:480px){#fm-coach .academy-course-chooser{grid-template-columns:1fr 1fr;gap:6px}#fm-coach .academy-course-chooser button{font-size:12px;padding:9px;min-height:54px}}

#fm-coach .academy-course-chooser .academy-case-link {text-align:left;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;padding:11px 12px;min-height:62px;background:#e5f6f4;border:1px solid #a9ddd7;color:#166b6a;font-size:13px;font-weight:800;border-radius:8px;text-decoration:none;}
#fm-coach .academy-course-chooser .academy-case-link:hover{background:#d6f1ec;border-color:#69b8b1;}
#fm-coach .academy-course-chooser .academy-case-link span{font-size:11px;font-weight:580;color:#537f7e;}

/* Brand continuity with the product and documentation */
#fm-coach .academy-brand{display:flex;align-items:center;gap:10px;white-space:normal}
#fm-coach .academy-official-logo{display:block;width:99px;height:auto;object-fit:contain;flex-shrink:0}
#fm-coach .academy-header{border-color:#d7e1f4;box-shadow:0 5px 18px rgba(25,52,118,.1)}
@media(max-width:650px){#fm-coach .academy-official-logo{width:77px}}
