/* r190: a final, isolated iPad/tablet layer. Phone styles remain unchanged. */
body.student-page .tablet-knowledge-header {
  display: none;
}

@media (min-width: 700px) and (min-height: 700px) and (max-width: 1366px) {
  html body.student-page {
    --tablet-gutter: clamp(24px, 4vw, 56px);
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  html body.student-page .app-shell {
    width: 100% !important;
    max-width: none !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding:
      calc(env(safe-area-inset-top, 0px) + 20px)
      var(--tablet-gutter)
      calc(92px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html body.student-page[data-mobile-target] .topbar {
    display: none !important;
  }

  html body.student-page .student-workspace:not(.hidden),
  html body.student-page .student-main,
  html body.student-page .main-column {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
  }

  html body.student-page #learningPanel.active-mobile-panel,
  html body.student-page #coursePanel.active-mobile-panel,
  html body.student-page #lessonPanel.active-mobile-panel,
  html body.student-page #knowledgeStudyPanel.active-mobile-panel,
  html body.student-page #playerPanel.active-mobile-panel,
  html body.student-page #materialsPanel.active-mobile-panel,
  html body.student-page #reviewPanel.active-mobile-panel,
  html body.student-page #progressPanel.active-mobile-panel,
  html body.student-page #podcastPanel.active-mobile-panel,
  html body.student-page #accountPanel.active-mobile-panel,
  html body.student-page #eventPanel.active-mobile-panel {
    width: 100% !important;
    min-height: 0 !important;
    align-content: start !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] {
    padding: 0 !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-knowledge-layout,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-chapter-list,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-list,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-children {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-list,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-children,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-group.level-1 > .student-topic-children,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-group.level-1.flat-children > .student-topic-children,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-group.level-2 > .student-topic-children {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 16px !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-group {
    grid-column: 1 / -1 !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-node,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-node:nth-child(n) {
    grid-column: auto !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 4px 12px !important;
    min-height: 90px !important;
    margin: 0 !important;
    padding: 12px 14px !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-thumb {
    grid-column: 1 !important;
    grid-row: 1 / 3 !important;
    width: 56px !important;
    height: 56px !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-title {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    font-size: clamp(17px, 2.1vw, 21px) !important;
    line-height: 1.25 !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-node > em {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: start !important;
    align-self: start !important;
  }

  html body.student-page .mobile-study-nav:not(.knowledge-module-dock),
  html body.student-page[data-mobile-target="knowledgeStudyPanel"][data-knowledge-view="detail"] .mobile-study-nav.knowledge-module-dock {
    position: fixed !important;
    z-index: 120 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
  }

  html body.student-page .mobile-study-nav:not(.knowledge-module-dock) {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    min-height: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 7px 18px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body.student-page[data-mobile-target="knowledgeStudyPanel"][data-knowledge-view="detail"] .mobile-study-nav.knowledge-module-dock {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-template-columns: repeat(var(--student-module-tab-count, 1), minmax(0, 1fr)) !important;
    align-items: center !important;
    height: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  html body.student-page[data-mobile-target="knowledgeStudyPanel"][data-knowledge-view="detail"] .mobile-study-nav.knowledge-module-dock button {
    display: grid !important;
    grid-template-rows: 28px 16px !important;
    place-items: center !important;
    gap: 2px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    padding: 4px 2px 5px !important;
  }

  html body.student-page[data-mobile-target="knowledgeStudyPanel"][data-knowledge-view="detail"] .mobile-study-nav.knowledge-module-dock button > .student-module-dock-icon {
    display: block !important;
    width: 27px !important;
    height: 27px !important;
  }

  html body.student-page[data-mobile-target="knowledgeStudyPanel"][data-knowledge-view="detail"] .mobile-study-nav.knowledge-module-dock button > strong {
    display: block !important;
    font-size: 12px !important;
    line-height: 16px !important;
    white-space: nowrap !important;
  }

  html body.student-page #studentAssistantFab.student-planner-fab {
    right: var(--tablet-gutter) !important;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body.student-page[data-mobile-target="knowledgeStudyPanel"][data-knowledge-view="detail"] #studentAssistantFab.student-planner-fab {
    display: none !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .student-knowledge-detail {
    display: grid !important;
    width: 100% !important;
    max-width: none !important;
    gap: 18px !important;
    overflow: visible !important;
    padding: 0 0 calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .tablet-knowledge-header {
    position: sticky;
    z-index: 45;
    top: 0;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 64px;
    border: 1px solid rgba(208, 178, 129, 0.24);
    border-radius: 20px;
    padding: 9px 16px 9px 10px;
    background: rgba(255, 250, 240, 0.96);
    box-shadow: 0 7px 22px rgba(90, 60, 30, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  html body.student-page .tablet-knowledge-back {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    min-width: 92px;
    min-height: 44px;
    border: 0 !important;
    border-radius: 14px !important;
    padding: 0 12px !important;
    background: #fff3d7 !important;
    color: #704819 !important;
    box-shadow: none !important;
    font-size: 14px;
    font-weight: 700;
  }

  html body.student-page .tablet-knowledge-back img {
    width: 18px;
    height: 18px;
  }

  html body.student-page .tablet-knowledge-title {
    min-width: 0;
  }

  html body.student-page .tablet-knowledge-title > span {
    display: block;
    color: #a66d22;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
  }

  html body.student-page .tablet-knowledge-title > h2 {
    overflow: hidden;
    margin: 3px 0 0;
    color: #3b2012;
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-split-learning {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
    width: 100% !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .student-module-group-section:not(.active) {
    display: none !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .student-module-group-section.active {
    display: grid !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-text-pane {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane {
    position: relative !important;
    border: 1px solid rgba(208, 178, 129, 0.24) !important;
    border-radius: 26px !important;
    background: #f4ebdc !important;
    box-shadow: 0 8px 24px rgba(90, 60, 30, 0.08) !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-image-actions {
    justify-content: flex-end !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-image-back {
    display: none !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-list,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-module-group-section.active,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-module-card {
    width: 100% !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-gallery-stage,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-gallery-image,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .memory-palace-stage,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-module-image {
    min-height: min(46dvh, 460px) !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-gallery-image img,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .memory-palace-stage img,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-module-image img {
    width: 100% !important;
    max-height: min(52dvh, 560px) !important;
    object-fit: contain !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-text-pane {
    padding: 0 !important;
  }

  html body.student-page #reviewPanel .review-list,
  html body.student-page #progressPanel,
  html body.student-page #accountPanel {
    width: 100% !important;
    max-width: 1100px !important;
    margin-inline: auto !important;
  }

  html body.student-page #reviewPanel .output-mode-choice-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 14px !important;
  }

  html body.student-page #accountPanel.active-mobile-panel {
    padding-top: 0 !important;
  }

  html body.student-page #accountPanel .account-action-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html body.student-page #accountPanel .account-action-list > button:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  html body.student-page #podcastPanel .memory-feed-shell {
    width: min(720px, 100%) !important;
    min-height: calc(100dvh - 132px) !important;
    margin-inline: auto !important;
  }

  html body.student-page #podcastPanel .memory-feed-list,
  html body.student-page #podcastPanel .memory-feed-card {
    width: 100% !important;
    height: calc(100dvh - 132px) !important;
    min-height: 0 !important;
  }
}

@media (min-width: 900px) and (min-height: 600px) and (max-width: 1366px) and (orientation: landscape) {
  html body.student-page .app-shell {
    padding:
      calc(env(safe-area-inset-top, 0px) + 22px)
      30px
      36px
      calc(108px + env(safe-area-inset-left, 0px)) !important;
  }

  html body.student-page .mobile-study-nav:not(.knowledge-module-dock) {
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    left: calc(16px + env(safe-area-inset-left, 0px)) !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: repeat(5, minmax(52px, auto)) !important;
    width: 76px !important;
    max-width: 76px !important;
    min-height: 0 !important;
    padding: 10px 8px !important;
    gap: 6px !important;
    transform: translateY(-50%) !important;
    border: 1px solid rgba(208, 178, 129, 0.24) !important;
    border-radius: 24px !important;
    background: rgba(255, 253, 248, 0.96) !important;
    box-shadow: 0 12px 30px rgba(90, 60, 30, 0.1) !important;
  }

  html body.student-page .mobile-study-nav:not(.knowledge-module-dock) button,
  html body.student-page .mobile-study-nav:not(.knowledge-module-dock) button:not(.mobile-nav-refresh),
  html body.student-page .mobile-study-nav:not(.knowledge-module-dock) .mobile-nav-refresh {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 52px !important;
    margin: 0 !important;
  }

  html body.student-page #studentAssistantFab.student-planner-fab {
    right: 24px !important;
    bottom: 22px !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-list,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-children,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-group.level-1 > .student-topic-children,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-group.level-1.flat-children > .student-topic-children,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="list"] .student-topic-group.level-2 > .student-topic-children {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-split-learning {
    grid-template-columns: minmax(330px, 0.92fr) minmax(0, 1.35fr) !important;
    align-items: start !important;
    gap: 22px !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane {
    position: sticky !important;
    top: 82px !important;
    min-height: 420px !important;
    max-height: calc(100dvh - 112px) !important;
    overflow: hidden !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-gallery-stage,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-gallery-image,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .memory-palace-stage,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-module-image {
    min-height: 400px !important;
  }

  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-gallery-image img,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .memory-palace-stage img,
  html body.student-page #knowledgeStudyPanel[data-knowledge-view="detail"] .knowledge-visual-pane .student-module-image img {
    max-height: calc(100dvh - 150px) !important;
  }
}
