/* Phase 6: compact, consistent BrounStack reading/workspace surfaces */

/* Tutorial workspace */
.tutorial-workspace-page .tw-shell{padding-top:18px}
.tutorial-workspace-page .tw-topbar{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px;padding:8px 10px 8px 14px;border:1px solid var(--tw-line);border-radius:16px;background:rgba(255,255,255,.9);box-shadow:0 10px 28px rgba(28,70,120,.06);backdrop-filter:blur(14px)}
.tutorial-workspace-page .tw-brand{display:inline-flex;align-items:center;min-width:0}
.tutorial-workspace-page .tw-brand img{display:block;width:190px;max-width:48vw;height:42px;object-fit:contain;object-position:left center}
.tutorial-workspace-page .tw-topbar .tw-btn{min-height:38px}
.tutorial-workspace-page .tw-hero-copy{padding:30px 32px}
.tutorial-workspace-page .tw-section{padding:22px}
.tutorial-workspace-page .tw-card{min-height:0}
.tutorial-workspace-page .tw-practice{padding:22px 24px}

/* Book details */
body[data-page="book-details"].student-portal-page .student-sidebar{overflow-y:auto;overscroll-behavior:contain}
body[data-page="book-details"].student-portal-page .student-content{padding-top:20px}
body[data-page="book-details"].student-portal-page .book-detail-shell{gap:16px}
body[data-page="book-details"].student-portal-page .book-detail-hero{padding:24px;gap:26px}
body[data-page="book-details"].student-portal-page .book-detail-cover{min-height:320px}
body[data-page="book-details"].student-portal-page .book-chapter-section{padding:20px}

/* Book reader */
body.book-reader-page{background:#f4f7fb}
body.book-reader-page .app{grid-template-columns:232px minmax(0,1fr)}
body.book-reader-page .sidebar{width:auto;padding:18px 14px;background:linear-gradient(180deg,#071426,#0b213c);border-right:1px solid rgba(255,255,255,.06);overflow-y:auto;overscroll-behavior:contain}
body.book-reader-page .sidebar>.brand{margin:0 4px 18px!important;width:190px!important;height:44px!important}
body.book-reader-page .nav{gap:5px}
body.book-reader-page .nav a{min-height:40px;display:flex;align-items:center;padding:0 11px;border:1px solid transparent;border-radius:10px;color:#aebfd2;font-size:12px;font-weight:700}
body.book-reader-page .nav a:hover,body.book-reader-page .nav a.active{background:rgba(36,133,255,.12);border-color:rgba(91,170,255,.12);color:#fff}
body.book-reader-page .reader-topbar{min-height:68px;height:auto;padding:10px 18px;gap:10px}
body.book-reader-page .reader-tools{gap:6px;flex-wrap:wrap;justify-content:flex-end}
body.book-reader-page .content:has(.reader){padding:22px 24px 42px}
body.book-reader-page .reader{gap:20px}
body.book-reader-page .toc{top:86px;height:calc(100vh - 106px)}
body.book-reader-page .page{min-height:0;padding-top:34px;padding-bottom:40px}
body.book-reader-page .reader-pagination{margin-top:24px}

/* Secure tutorial reader */
.secure-tutorial-reader-page .secure-reader-toolbar{gap:8px}
.secure-tutorial-reader-page .secure-reader-jump{display:flex;align-items:center;gap:6px;color:#5f768e;font-size:9px;font-weight:800;white-space:nowrap}
.secure-tutorial-reader-page .secure-reader-jump select{height:34px;max-width:210px;border:1px solid #d5e2ef;border-radius:9px;background:#fff;color:#31516f;padding:0 9px;font:700 10px/1 Inter,Segoe UI,Arial,sans-serif}
.secure-tutorial-reader-page .secure-reader-reading-tools{display:flex;align-items:center;gap:5px}
.secure-tutorial-reader-page .secure-reader-reading-tools button{min-width:34px;height:34px;border:1px solid #d5e2ef;border-radius:9px;background:#fff;color:#31516f;font-size:10px;font-weight:850;cursor:pointer}
.secure-tutorial-reader-page .secure-reader-reading-tools button:hover{border-color:#a9cae8;background:#f7fbff;color:#0b6dcc}
.secure-tutorial-reader-page .secure-reader-reading-tools span{min-width:34px;text-align:center;color:#71869b;font-size:9px;font-weight:800}
.secure-tutorial-reader-page .secure-reader-course-meta{margin-top:16px}
.secure-tutorial-reader-page:not(.student-tutorial-reader-page) .secure-reader-course-meta{display:grid;grid-template-columns:70px minmax(0,1fr);gap:12px;align-items:center}
.secure-tutorial-reader-page .secure-reader-progress-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:14px 5px 6px;padding:0 4px;color:#88a0b8}
.secure-tutorial-reader-page .secure-reader-progress-meta span{font-size:7px;font-weight:900;letter-spacing:.15em}
.secure-tutorial-reader-page .secure-reader-progress-meta strong{color:#d9e7f5;font-size:9px}
.secure-tutorial-reader-page .secure-reader-course-cover{width:70px;aspect-ratio:3/4;display:grid;place-items:center;overflow:hidden;border:1px solid rgba(255,255,255,.1);border-radius:10px;background:#071a2f;padding:3px}
.secure-tutorial-reader-page .secure-reader-course-cover img{display:block;width:100%;height:100%;object-fit:contain}
.secure-tutorial-reader-page .secure-reader-course-copy{min-width:0}
.secure-tutorial-reader-page .secure-reader-course-copy>span{display:block;color:#61d5ff;font-size:7px;font-weight:900;letter-spacing:.15em}
.secure-tutorial-reader-page .secure-reader-course-copy h2{margin:6px 0 4px}
.secure-tutorial-reader-page .secure-reader-course-copy p{margin:0}
.secure-tutorial-reader-page .secure-reader-article{padding-top:28px;padding-bottom:54px}
.secure-tutorial-reader-page #tutorialLanguageNotice{margin-top:10px}
.secure-tutorial-reader-page :is(button,select,a):focus-visible,.tutorial-workspace-page :is(a,button):focus-visible,body.book-reader-page :is(a,button,select):focus-visible{outline:3px solid rgba(11,124,255,.24);outline-offset:2px}

@media(max-width:1050px){
  body.book-reader-page .app{grid-template-columns:1fr}
  body.book-reader-page .sidebar{position:relative;top:auto;height:auto;display:flex;align-items:center;gap:12px;padding:10px 12px;overflow-x:auto;overflow-y:hidden;white-space:nowrap}
  body.book-reader-page .sidebar>.brand{flex:0 0 170px;margin:0!important;width:170px!important;height:40px!important}
  body.book-reader-page .nav{display:flex;grid-template-columns:none;gap:6px;min-width:max-content}
  body.book-reader-page .nav a{flex:0 0 auto;min-height:36px;padding:0 10px}
  body.book-reader-page .reader-topbar{top:0}
  body.book-reader-page .toc{max-height:290px}
}

@media(max-width:760px){
  .tutorial-workspace-page .tw-shell{padding-top:10px}
  .tutorial-workspace-page .tw-topbar{min-height:52px;margin-bottom:10px;padding:6px 8px 6px 10px;border-radius:14px}
  .tutorial-workspace-page .tw-brand img{width:158px;height:38px}
  .tutorial-workspace-page .tw-topbar .tw-btn{min-height:34px;width:auto;padding:0 11px;font-size:10px}
  .tutorial-workspace-page .tw-hero-copy{padding:22px 18px}
  .tutorial-workspace-page .tw-section{padding:16px}
  .tutorial-workspace-page .tw-practice{padding:18px}
  body[data-page="book-details"].student-portal-page .book-detail-hero{padding:16px}
  body[data-page="book-details"].student-portal-page .book-detail-cover{min-height:230px}
  body[data-page="book-details"].student-portal-page .book-chapter-section{padding:14px}
  body.book-reader-page .sidebar>.brand{flex-basis:150px;width:150px!important;height:36px!important}
  body.book-reader-page .sidebar{padding:8px 10px}
  body.book-reader-page .nav a{font-size:11px}
  body.book-reader-page .reader-topbar{padding:8px 10px}
  body.book-reader-page .content:has(.reader){padding:10px 10px 28px}
  body.book-reader-page .toc{margin-bottom:10px;max-height:230px}
  body.book-reader-page .page{padding:22px 16px 78px}
  .secure-tutorial-reader-page .secure-reader-toolbar{padding:8px 10px}
  .secure-tutorial-reader-page .secure-reader-jump{order:2;width:calc(100% - 112px)}
  .secure-tutorial-reader-page .secure-reader-jump select{width:100%;max-width:none}
  .secure-tutorial-reader-page .secure-reader-save-actions{order:3;width:100%}
  .secure-tutorial-reader-page .secure-reader-language{order:4}
  .secure-tutorial-reader-page .secure-reader-reading-tools{order:5;margin-left:auto}
  .secure-tutorial-reader-page .secure-reader-article{width:min(100% - 24px,980px);padding-top:22px;padding-bottom:42px}
}

@media(max-height:760px) and (min-width:901px){
  .secure-tutorial-reader-page .secure-reader-sidebar{padding-top:14px;padding-bottom:12px}
  .secure-tutorial-reader-page .secure-reader-course-meta{margin-top:12px;padding:12px}
  .secure-tutorial-reader-page .secure-reader-nav a{padding-top:8px;padding-bottom:8px}
  body[data-page="book-details"].student-portal-page .student-sidebar-focus{display:none}
}
