/* DailyEnglishMaster · Full-Height No-Scroll Sidebar, Wide Workspace & Edge-to-Edge Fullscreen Reading / Cinema */

/* 1. Full-Viewport Sidebar with ZERO internal scrollbar */
.app-shell {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  align-items: stretch !important;
}

.sidebar {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 256px !important;
  z-index: 40 !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  padding: 0.22rem 0.38rem !important;
  gap: 0.06rem !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: none !important;
}

@media (min-width: 921px) {
  .main-wrap {
    margin-left: 256px !important;
    width: calc(100% - 256px) !important;
    max-width: calc(100% - 256px) !important;
  }
}
@media (max-width: 920px) {
  .sidebar {
    display: none !important;
  }
  .main-wrap {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
.sidebar::-webkit-scrollbar {
  display: none !important;
}

.sidebar .brand-box {
  padding: 0.22rem 0.4rem !important;
  margin-bottom: 0.02rem !important;
  gap: 0.35rem !important;
}

.sidebar .brand-avatar {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.68rem !important;
}

.sidebar .brand-title {
  font-size: 0.82rem !important;
  line-height: 1.08 !important;
}

.sidebar .brand-author-pill {
  font-size: 0.6rem !important;
  padding: 0 5px !important;
}

.sidebar .brand-sub {
  display: none !important;
}

.sidebar .nav-section-label {
  font-size: 0.56rem !important;
  margin: 0.04rem 0 0.01rem !important;
  padding: 0 0.3rem !important;
  line-height: 1.02 !important;
}

.sidebar .nav-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5px !important;
  margin: 0 !important;
}

.sidebar #sidebar-nav-main {
  flex: 1 1 auto !important;
  justify-content: space-between !important;
}

.sidebar .nav-item {
  padding: 0.13rem 0.4rem !important;
  min-height: 0 !important;
  font-size: 0.7rem !important;
  line-height: 1.08 !important;
  gap: 0.32rem !important;
  border-radius: 8px !important;
}

.sidebar .nav-item .sh {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  font-size: 0.6rem !important;
  border-radius: 5px !important;
}

.sidebar .nav-badge {
  font-size: 0.61rem !important;
  padding: 0 4px !important;
}

.sidebar .sidebar-footer {
  padding-top: 0.1rem !important;
  margin-top: auto !important;
  gap: 0.12rem !important;
}

.sidebar .swatch-label {
  display: none !important;
}

.sidebar .swatch {
  width: 15px !important;
  height: 15px !important;
}

.sidebar .sidebar-mini-row {
  gap: 0.18rem !important;
}

.sidebar .btn-mini {
  padding: 0.11rem 0.28rem !important;
  font-size: 0.66rem !important;
}

@media (max-height: 620px) {
  .sidebar {
    overflow-y: auto !important;
  }
}

/* 2. Remove wasted horizontal pink margins across Reading, Exams, Cinema & YouTube */
.main-wrap {
  min-width: 0 !important;
}

@media (min-width: 921px) {
  body:not(.theater-fs):not(.candy-fs):not(.reader-fs) .main-wrap {
    margin-left: 256px !important;
    width: calc(100% - 256px) !important;
    max-width: calc(100% - 256px) !important;
  }
}

.main-wrap:has(.yt-studio-grid) .content-inner,
.main-wrap:has(.fr-reading-split) .content-inner,
.main-wrap:has(.fc-pro-layout) .content-inner,
body.media-wide .content-inner,
body.theater-fs .content-inner {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding-left: clamp(0.55rem, 1.2vw, 1.15rem) !important;
  padding-right: clamp(0.55rem, 1.2vw, 1.15rem) !important;
}

.yt-studio-grid {
  grid-template-columns: minmax(0, 1.42fr) minmax(350px, 0.92fr) !important;
  gap: 0.95rem !important;
  width: 100% !important;
}

@media (max-width: 980px) {
  .yt-studio-grid {
    grid-template-columns: 1fr !important;
  }
}

.yt-player-frame {
  width: 100% !important;
  aspect-ratio: 16 / 9;
}

.yt-player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Prevent vertical jitter / shake when synced subtitles & spotlight vocab update */
.yt-sub-stream {
  height: 365px !important;
  max-height: 365px !important;
  overflow-y: auto !important;
  position: relative;
  overflow-anchor: none;
}

#cm-vocab-spotlight, #yt-vocab-list {
  height: 215px !important;
  max-height: 215px !important;
  overflow-y: auto !important;
}

#cm-sub-overlay, #yt-active-sent-card {
  min-height: 215px;
}

/* 3. Theater & Reading Fullscreen Mode: Hide Sidebar & Fill 100vw Edge-to-Edge */
body.theater-fs .sidebar,
body.theater-fs .mobile-bar {
  display: none !important;
}

body.theater-fs .app-shell {
  display: block !important;
  grid-template-columns: 1fr !important;
}

body.theater-fs .main-wrap,
body.candy-fs .main-wrap,
body.reader-fs .main-wrap {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
}

body.theater-fs .content-inner {
  padding: 0.65rem 1.1rem 2.5rem !important;
}

body.theater-fs .yt-studio-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(380px, 0.9fr) !important;
}

body.theater-fs .fr-reading-pane,
body.theater-fs .fr-questions-pane {
  max-height: 82vh !important;
}

/* 4. Flashcard Pro Studio Workspace */
.fc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.58rem;
}

.fc-kpi-card {
  background: var(--sf);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 0.55rem 0.78rem;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.fc-kpi-val {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.15;
}

.fc-kpi-lbl {
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fc-pro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(305px, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.fc-pro-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.fc-pro-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: sticky;
  top: 0.85rem;
}

.fc-studio-deckbar {
  background: var(--sf);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 0.62rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.44rem;
  box-shadow: var(--shadow);
}

.fc-studio-deckbar .chip {
  padding: 0.26rem 0.68rem;
  font-size: 0.76rem;
}

.fc-hero-card {
  background: var(--sf);
  border: 2.5px solid var(--ink);
  border-radius: 26px;
  padding: 1.35rem 1.6rem;
  min-height: 390px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.95rem;
  position: relative;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.fc-hero-card.is-flipped {
  background: linear-gradient(180deg, var(--sf) 0%, #fffdf6 100%);
}

.fc-hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 0.6rem;
  border-bottom: 1.5px dashed var(--line);
}

.fc-cloze-blank {
  display: inline-block;
  min-width: 90px;
  padding: 0 0.55rem;
  border-bottom: 3px solid var(--acc-dark);
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  border-radius: 6px 6px 0 0;
}

.fc-type-box {
  width: 100%;
  max-width: 520px;
  margin: 0.4rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fc-type-input {
  width: 100%;
  padding: 0.72rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 16px;
  font-size: 1.12rem;
  font-family: var(--font-en);
  font-weight: 700;
  text-align: center;
  background: var(--sf2);
  color: var(--ink);
  outline: none;
}

.fc-type-input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--acc);
}

.fc-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  max-height: 330px;
  overflow-y: auto;
}

.fc-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.48rem 0.68rem;
  border: 1.5px solid var(--ink);
  border-radius: 13px;
  background: var(--sf2);
  cursor: pointer;
  transition: background 0.12s, transform 0.12s;
  text-align: left;
  width: 100%;
}

.fc-queue-item:hover {
  background: var(--sf3);
  transform: translateX(2px);
}

.fc-queue-item.is-current {
  background: var(--acc);
  font-weight: 800;
}

.fc-kbd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.6rem;
  font-size: 0.76rem;
  color: var(--ink2);
}

.fc-kbd {
  display: inline-block;
  background: var(--sf);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 0 5px;
  font-weight: 800;
  font-size: 0.7rem;
  color: var(--ink);
  margin-right: 4px;
}

@media (max-width: 1020px) {
  .fc-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fc-pro-layout {
    grid-template-columns: 1fr;
  }
  .fc-pro-side {
    position: static;
  }
}
