/* ==========================================================================
   English Station Â· Creator refinement 2026-11-05
   en-mode-entry-20261105
   Scope: English Station only. Display layer; no core, no CSP change.
   ========================================================================== */

/* The entry chooser is the first decision on the page. */
body.en-refined #en-path {
  position: relative;
  z-index: 26;
  width: min(920px, calc(100% - 32px));
  margin: 12px auto 10px;
  padding: 14px 16px 12px;
  box-sizing: border-box;
  border: 1px solid var(--fleet-line-soft, rgba(230, 168, 147, 0.32));
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(230, 168, 147, 0.06), transparent 55%),
    var(--fleet-surface, #140c09);
}

body.en-refined.en-fold-path #en-path {
  display: none !important;
}

body.en-refined #en-path .en-entry-lead {
  margin: 0 0 2px;
  color: var(--fleet-body, #d8c7ba);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  letter-spacing: 0.02em;
}

body.en-refined #en-path .en-path-now {
  color: var(--fleet-text, #f6edd8);
}

body.en-refined #en-path .en-path-row {
  row-gap: 10px;
}

/* Keep the three modes and two tracks legible without horizontal scroll. */
body.en-refined #training-mode-toggle,
body.en-refined #exam-track-toggle {
  box-sizing: border-box;
}

body.en-refined #training-mode-toggle .rt-btn,
body.en-refined #exam-track-toggle .rt-btn {
  box-sizing: border-box;
  touch-action: manipulation;
}

body.en-refined #mode-masterclass.is-locked {
  border-color: rgba(230, 168, 147, 0.45) !important;
}

body.en-refined .en-mode-lock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  padding: 1px 7px;
  border: 1px solid rgba(230, 168, 147, 0.45);
  border-radius: 999px;
  color: #ffe29a;
  background: rgba(230, 168, 147, 0.10);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

body.en-refined .en-mode-lock[hidden] {
  display: none !important;
}

body.en-refined .en-mode-lock .fa-lock {
  font-size: 9px;
}

/* Floating Word Sea must not sit on top of the main CTA or player. */
body.en-refined #bliss-edu-round.is-collapsed {
  width: auto;
  max-width: min(190px, calc(100vw - 16px));
  max-height: 52px;
  overflow: hidden;
  left: auto;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  padding: 4px 10px;
}

body.en-refined #bliss-edu-round.is-collapsed > :not(.edu-fold) {
  display: none !important;
}

body.en-refined #bliss-edu-round.is-collapsed .edu-fold {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #f6edd8;
  font-weight: 800;
}

/* AI Coach is a small corner control, not a full-width bottom bar. */
body.en-refined #bliss-fleet-coach-fab {
  left: auto !important;
  right: max(12px, env(safe-area-inset-right, 0px)) !important;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  height: 54px !important;
  min-height: 54px !important;
  padding: 0 !important;
  justify-content: center !important;
  border-radius: 50% !important;
  z-index: 36 !important;
}

body.en-refined #bliss-fleet-coach-fab .fab-copy {
  display: none !important;
}

body.en-refined #bliss-fleet-coach-fab .fab-ico {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

/* While the listening player is live, keep the coach and Word Sea clear. */
body.en-refined.listening-live #bliss-fleet-coach-fab {
  display: none !important;
}

body.en-refined.listening-live #bliss-edu-round.is-collapsed {
  bottom: max(8px, env(safe-area-inset-bottom)) !important;
}

/* Reserve scroll room so the last control can clear a compact floating bar. */
body.en-refined main {
  padding-bottom: max(76px, calc(56px + env(safe-area-inset-bottom)));
  overflow-x: clip;
}

body.en-refined #en-today {
  margin-top: 0;
}

body.en-refined #audio-engine-panel,
body.en-refined #real-audio-container {
  position: relative;
  z-index: 27;
}

/* On desktop, an open Word Sea gets a real gutter instead of covering the
   entry chooser / CTA. When collapsed the page returns to full width. */
@media (min-width: 1024px) {
  body.en-refined:has(#bliss-edu-round:not(.is-collapsed)) main {
    padding-right: 404px;
  }

  body.en-refined:has(#bliss-edu-round:not(.is-collapsed)) #en-path {
    width: min(700px, calc(100% - 440px));
    margin-left: 32px;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  body.en-refined #en-path {
    width: calc(100% - 24px);
    padding: 12px 10px 10px;
    margin: 10px auto 12px;
  }

  body.en-refined #bliss-edu-round.is-collapsed {
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  body.en-refined main {
    padding-left: 12px;
    padding-right: 12px;
  }

  body.en-refined #en-path {
    width: calc(100% - 24px);
    margin-top: 8px;
    border-radius: 14px;
  }

  body.en-refined #en-path .en-path-row {
    flex-direction: column;
    gap: 8px;
  }

  body.en-refined #exam-track-wrap,
  body.en-refined #training-mode-toggle,
  body.en-refined #exam-track-toggle {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
  }

  body.en-refined #training-mode-toggle,
  body.en-refined #exam-track-toggle {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 5px;
  }

  body.en-refined #training-mode-toggle .rt-btn,
  body.en-refined #exam-track-toggle .rt-btn {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
    min-height: 48px !important;
    padding: 8px 10px !important;
    font-size: 13.5px !important;
    white-space: normal !important;
    justify-content: flex-start !important;
    text-align: left;
  }

  body.en-refined #en-path .en-path-now {
    font-size: 13.5px;
  }

  body.en-refined #en-path .en-entry-lead {
    font-size: 12px;
  }

  body.en-refined .en-mode-lock {
    margin-left: 2px;
    font-size: 9px;
  }

  body.en-refined #en-today {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* Persistent mini track inside the sticky module switcher. */
#en-practice-track {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 7px;
  padding: 0 2px 7px;
  border-bottom: 1px solid rgba(230, 168, 147, 0.18);
}

#en-practice-track .en-practice-track__label {
  margin-right: 3px;
  color: #c4b4aa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

#en-practice-track .en-practice-track__btn {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(230, 168, 147, 0.32);
  border-radius: 999px;
  background: rgba(20, 12, 9, 0.72);
  color: #d8c7ba;
  font-family: var(--fleet-ui, inherit);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
}

#en-practice-track .en-practice-track__btn:hover,
#en-practice-track .en-practice-track__btn:focus-visible {
  border-color: #e6a893;
  color: #fff3d1;
  outline: none;
}

#en-practice-track .en-practice-track__btn.is-active {
  border-color: #e6a893;
  background: linear-gradient(135deg, #f3e0c8, #d4a574);
  color: #0a0507;
}

body.en-desk-home #en-practice-track,
body.en-refined:not(.en-fold-path) #en-practice-track {
  display: none !important;
}

@media (max-width: 420px) {
  #en-practice-track {
    justify-content: space-between;
    gap: 4px;
  }

  #en-practice-track .en-practice-track__label {
    margin-right: 0;
    font-size: 9px;
  }

  #en-practice-track .en-practice-track__btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
    font-size: 11.5px;
  }
}

/* HKDSE official reading card — show the reading shell only while the Reading module is active and the HKDSE card is visible (IELTS hides the card). */
body:has(#mod-reading.active) #reading-panels:has(#read-official-paper-entry:not([hidden])){display:block!important}
/* HKDSE official reading card — expose the result host only while Reading is active and the HKDSE card is visible. */
body:has(#mod-reading.active) #codexResult:has(#read-official-paper-entry:not([hidden])){display:block!important}