/* Chapterly v0.3: content-first library + study companion player.
   Overrides legacy v0.1/v0.2 styling without changing the auth perimeter. */
:root{--bg:#0b111d;--accent:#c8eb92;--stroke:#263547;--muted:#94a6b8}
[hidden]{display:none!important}
html{scroll-behavior:smooth}
button{-webkit-tap-highlight-color:transparent}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #d5f6a9;outline-offset:3px}
.app{padding-bottom:92px}
.topbar{height:68px}
.crumb{letter-spacing:1.1px}
.content{padding-top:33px;padding-bottom:90px}
.sidebar-note{display:none}
.brand{padding-bottom:29px}
.nav-label.with-action{margin-top:32px}
.sidebar{background:#0d1624}
.welcome{display:grid;gap:20px;margin-bottom:33px}
.welcome-heading .eyebrow{letter-spacing:1.7px;color:#a6c58d}
.welcome-heading h1{font-size:clamp(28px,3vw,40px);line-height:1.17;letter-spacing:-1.45px;margin:7px 0 7px;font-weight:760}
.welcome-heading h1 em{font-style:normal;color:var(--accent)}
.welcome-heading p{margin:0;color:#9db0c1;font-size:12px}
.resume-panel{display:flex;align-items:center;gap:17px;border:1px solid #334954;border-radius:15px;padding:17px 20px;background:linear-gradient(110deg,#18342e 0%,#172c31 65%,#152131 100%);max-width:930px;min-height:113px}
.resume-art{height:66px;width:66px;display:grid;place-items:center;flex:0 0 auto;border-radius:12px;background:linear-gradient(135deg,#537968,#a3bb84);color:#e1f3c9}
.resume-art .icon{width:34px;height:34px;stroke-width:1.6}
.resume-info{display:flex;flex:1;flex-direction:column;gap:7px;min-width:0}
.resume-info .eyebrow{font-size:8px;letter-spacing:1.4px;color:#b3d99e}
.resume-info strong{font-size:14px;line-height:1.45;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.resume-info>span:not(.eyebrow){font-size:11px;color:#bbcec6}
.resume-progress{height:3px;width:100%;background:#cbe8c12a;border-radius:10px;margin-top:2px;overflow:hidden}
.resume-progress>div{height:100%;width:0;background:#d4f4a4;border-radius:10px}
.resume-action{min-height:43px;flex:0 0 auto}
.resume-action .icon{height:16px;width:16px}
.text-link{display:inline-flex;align-items:center;gap:9px;justify-self:start;background:none;border:0;padding:2px 0;color:#9eb2c4;font-size:11px;font-weight:650}
.text-link:hover{color:var(--accent)}
.text-link .icon{width:15px;height:15px}
.library-section{margin-top:0}
.section-heading{margin-bottom:18px;align-items:center}
.section-heading h2,#section-title{font-size:23px;margin:0}
.player{min-height:83px;grid-template-columns:1fr 1.2fr .85fr}
.player-main{min-width:0}
.player-main .track-info:hover strong{color:#d1f7a0}
.player .tiny-cover{height:45px;width:45px;flex:none}
.player-center{min-width:0}
.sync-indicator{font-size:10px}
.details{max-width:980px;padding-top:26px;margin-top:40px}
.details-slim{max-width:680px;margin-top:18px}
.details .section-heading h2{font-size:19px}
.details-slim .info-panel{padding:20px}
.info-actions{margin-top:20px}
.info-actions .primary{padding:11px 14px}
.details .muted{max-width:700px}
/* Expanded player is a learning workspace rather than an album-only sheet. */
.now-playing-sheet{z-index:30;background:radial-gradient(ellipse at 24% 19%,#223f38 0%,#13252a 38%,#0c1623 80%);overflow:auto;overscroll-behavior:contain}
.now-playing-inner{display:flex;flex-direction:column;align-items:stretch;min-height:100dvh;max-width:1300px;padding:25px clamp(22px,4vw,58px) 40px}
.sheet-header{display:flex;justify-content:space-between;align-items:center;width:100%;flex-shrink:0;font-size:10px;letter-spacing:2.1px;color:#d1e4d7}
.sheet-header .icon-btn{width:42px;height:42px}
.sheet-header .icon{height:20px;width:20px}
.sheet-header-muted{color:#7ca495}
.sheet-layout{display:grid;grid-template-columns:minmax(0,420px) minmax(0,1fr);gap:clamp(28px,5vw,70px);align-items:start;justify-content:center;flex:1;margin-top:22px}
.sheet-listening{position:sticky;top:70px;display:flex;align-items:stretch;flex-direction:column;min-width:0;max-width:420px;justify-self:center;width:100%}
.sheet-album{width:100%;height:auto;aspect-ratio:1/0.81;max-width:none;max-height:320px;margin:0 0 26px;border-radius:19px;background:linear-gradient(130deg,#2f6355,#547f66 58%,#9eb780);box-shadow:0 26px 60px #0209158a}
.sheet-album>.icon{width:89px;height:89px}
.sheet-track{width:100%}
.sheet-track .eyebrow{font-size:9px;letter-spacing:1.8px}
.sheet-track h2{font-size:clamp(19px,2.2vw,25px);line-height:1.36;margin:8px 0 24px;font-weight:750;letter-spacing:-.5px}
.sheet-timeline{color:#b9cbbe}
#sheet-seek{height:6px;margin:9px 0 25px;accent-color:var(--accent)}
.sheet-controls{max-width:none;justify-content:space-around}
.sheet-controls .icon-btn{min-width:44px;min-height:44px}
.sheet-controls .big-play{width:60px;height:60px}
.sheet-bottom{margin-top:25px;padding-top:19px}
.sheet-bottom label,.sheet-bottom>span{white-space:nowrap}
.study-panel{min-width:0;border:1px solid #354d4d;background:#111f2aab;border-radius:17px;padding:23px 23px 20px;box-shadow:0 16px 50px #040b1644}
.study-panel-heading .eyebrow{font-size:9px;letter-spacing:1.6px;color:#99c293}
.study-panel-heading h3{font-size:19px;letter-spacing:-.5px;margin:7px 0 19px}
.study-tabs{display:flex;gap:4px;padding:4px;border-radius:11px;background:#0b1723;border:1px solid #243845}
.study-tab{flex:1;display:flex;justify-content:center;align-items:center;gap:7px;min-width:0;min-height:43px;padding:10px 9px;border:0;border-radius:8px;background:transparent;color:#9cb2be;font-weight:650;font-size:11px;transition:background .15s,color .15s}
.study-tab:hover{background:#263c3e;color:#eaf8ed}
.study-tab.active{background:#293f3a;color:#d8f4bf;box-shadow:0 1px 7px #0003}
.study-tab .icon{width:16px;height:16px}
.study-panel-body{padding-top:16px;min-height:330px}
.study-tabpanel{min-width:0}
.study-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.script-mode-label,.auto-follow-label{display:flex;gap:7px;align-items:center;color:#9bb0bb;font-size:11px}
.script-mode-label select{background:#1d3240;border:1px solid #354d57;color:#e9f2f6;padding:9px 8px;border-radius:8px;font-size:11px}
.auto-follow-label{cursor:pointer;white-space:nowrap}
.auto-follow-label input{accent-color:var(--accent);width:15px;height:15px}
.script-reader{max-height:min(59vh,540px);min-height:250px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#416254 transparent;display:grid;align-content:start;gap:8px;padding:5px 7px 12px 0}
.script-paragraph{display:flex;flex-direction:column;gap:11px;text-align:left;width:100%;border:1px solid transparent;background:transparent;color:#adbfc7;border-radius:11px;padding:14px 14px;line-height:1.9;transition:background .15s,border-color .15s}
.script-paragraph:hover{background:#263d3c55;color:#e1f2e4}
.script-paragraph.active{background:#c5eb8914;color:#eaf5e7;border-color:#c5eb893d}
.script-section-title{font-size:10px;letter-spacing:.5px;font-weight:750;color:#94bf83;line-height:1.3}
.script-section-copy{font-size:14px;line-height:1.95;white-space:normal;font-weight:450}
.script-placeholder{font-size:12px;line-height:1.8;color:#a7b7c1;padding:18px 14px;border-radius:10px;background:#152834}
.script-placeholder .outline{margin-top:12px}
.word-panel{max-height:57vh;overflow:auto;scrollbar-width:thin;scrollbar-color:#416254 transparent}
.word-search-field{display:flex;align-items:center;gap:10px;border:1px solid #3c5158;background:#0c1a25;border-radius:9px;padding:0 11px;margin-bottom:10px}
.word-search-field .icon{width:16px;height:16px}
#word-search{flex:1;margin:0;border:0;background:transparent;width:100%;padding:11px 0;outline:0;color:#eef5ed}
.word-transcript{max-height:46vh;font-size:13px;line-height:2.3;margin-top:10px}
.word-transcript button{margin:0 1px;padding:2px 3px}
.word-results{display:flex;flex-wrap:wrap;gap:4px}
.study-list-title{display:flex;align-items:center;justify-content:space-between;margin:2px 1px 14px;color:#e8f2f5;font-size:13px}
.study-list-title>span{color:#8fa8b7;font-size:11px}
.study-chapter-list{max-height:min(61vh,560px);overflow:auto;scrollbar-width:thin;scrollbar-color:#416254 transparent}
.study-chapter-list .chapter-row{padding:13px 9px;gap:12px}
.study-chapter-list .chapter-row:last-child{border-bottom:0}
.study-chapter-list .chapter-name{font-size:12px;line-height:1.5}
.study-chapter-list .chapter-row.current{background:#c5eb8919}
.study-chapter-list .chapter-index{border-radius:7px;min-width:29px;height:27px}
.queue-list{display:grid;align-content:start;gap:7px}
.queue-row{display:flex;align-items:center;gap:11px;width:100%;height:64px;border:1px solid #29404a;border-radius:10px;padding:0 11px;background:#152937;color:#e4f0ee;text-align:left}
.queue-row:hover{background:#264239;border-color:#789b76}
.queue-row>.icon{height:15px;width:15px;flex:none}
.queue-icon{height:38px;width:38px;flex:none;display:grid;place-items:center;border-radius:8px;background:#385347;color:#d1ebba}
.queue-icon .icon{height:17px;width:17px}
.queue-copy{min-width:0;flex:1;display:grid;gap:5px}
.queue-copy > *{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.queue-copy strong{font-size:12px;line-height:1.5}
.queue-copy small{font-size:10px;color:#9fb4c0}
.study-empty{font-size:12px;line-height:1.8;color:#aebec8;background:#1c2d3b;border-radius:9px;padding:18px}
body.sheet-open{overscroll-behavior:none}
@media (max-width:1080px){
 .sheet-layout{grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:28px}
 .now-playing-inner{padding-inline:22px}
 .sheet-album{max-height:255px}
 .study-panel{padding:20px 17px}
 .script-section-copy{font-size:13px}
}
@media (max-width:800px){
 .now-playing-inner{padding:13px 19px 28px}
 .sheet-layout{display:flex;flex-direction:column;gap:24px;align-items:stretch;margin-top:12px}
 .sheet-listening{position:static;max-width:none;display:grid;grid-template-columns:128px 1fr;column-gap:17px;row-gap:5px}
 .sheet-album{height:122px;width:122px;max-height:none;grid-column:1;grid-row:1 / 3;margin:0;border-radius:13px;box-shadow:0 12px 30px #0005}
 .sheet-album .icon{width:53px;height:53px}
 .sheet-track{grid-column:2;grid-row:1;align-self:end}
 .sheet-track h2{font-size:16px;margin:5px 0 8px}
 .sheet-timeline{grid-column:1 / -1;margin-top:13px}
 #sheet-seek{grid-column:1 / -1;margin:6px 0 8px}
 .sheet-controls{grid-column:1 / -1;max-width:100%;justify-content:space-evenly}
 .sheet-controls .big-play{width:54px;height:54px}
 .sheet-bottom{grid-column:1 / -1;margin-top:12px;padding-top:12px}
 .study-panel{border-radius:14px;padding:17px 14px 17px}
 .study-panel-heading h3{font-size:16px;margin-bottom:13px}
 .study-panel-body{min-height:260px}
 .script-reader{max-height:44vh;min-height:210px}
 .study-chapter-list{max-height:47vh}
 .word-transcript{max-height:40vh}
 .script-paragraph{padding:11px 11px}
 .script-section-copy{font-size:13px}
}
@media (max-width:770px){
 .content{padding:23px 15px 145px}
 .welcome{gap:14px;margin-bottom:29px}
 .welcome-heading h1{font-size:30px}
 .welcome-heading p{font-size:11px}
 .resume-panel{padding:14px;gap:12px;min-height:86px;border-radius:13px}
 .resume-art{height:50px;width:50px;border-radius:11px}
 .resume-art .icon{width:26px;height:26px}
 .resume-info .eyebrow{font-size:8px;letter-spacing:.7px}
 .resume-info strong{font-size:12px}
 .resume-info>span:not(.eyebrow){font-size:10px}
 .resume-action{border-radius:50%;height:42px;width:42px;padding:0;min-height:0}
 .resume-action span{display:none}
 .resume-action .icon{width:18px;height:18px}
 .library-section .section-heading{margin-bottom:13px}
 .section-heading h2,#section-title{font-size:21px}
 .player{bottom:8px;left:9px;right:9px;grid-template-columns:minmax(0,1fr) 44px 44px;grid-template-rows:1fr;padding:8px 11px 11px;min-height:76px}
 .player .tiny-cover{height:43px;width:43px}
 .track-info strong{font-size:11px}
 .track-info small{font-size:10px}
 .now-playing-sheet{overflow:auto}
 .sheet-header{position:sticky;top:0;z-index:2;background:#13242bbb;backdrop-filter:blur(10px)}
 .sheet-header-muted{display:none}
 .details{margin-top:26px}
}
@media (max-width:430px){
 .now-playing-inner{padding:10px 13px 24px}
 .sheet-listening{grid-template-columns:93px minmax(0,1fr);column-gap:12px}
 .sheet-album{width:90px;height:94px}
 .sheet-album .icon{width:39px;height:39px}
 .sheet-track h2{font-size:14px}
 .sheet-controls .icon-btn{min-width:40px;min-height:42px}
 .study-panel{padding:14px 11px 16px}
 .study-tab{gap:5px;font-size:10px;padding:8px 4px}
 .study-tab .icon{width:14px;height:14px}
 .script-mode-label{font-size:10px}
 .auto-follow-label{font-size:10px}
 .study-panel-heading h3{font-size:15px}
 .resume-panel{gap:9px}
 .resume-action{height:39px;width:39px}
 .resume-art{height:46px;width:46px}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

.study-panel-heading{display:flex;align-items:start;justify-content:space-between;gap:14px}
.study-panel-heading .sheet-overview{width:37px;height:37px;flex:none;color:#a5b9c6}
.study-panel-heading .sheet-overview:hover{color:#d7efab;background:#2a423d}


/* Responsive dock and collapsible navigation. */
.app{
  --sidebar-width:248px;
  --mini-player-height:94px;
  --mini-player-gap:24px;
  padding-bottom:0;
}
.sidebar{
  width:var(--sidebar-width);
  transition:width .22s ease,transform .22s ease;
  overflow-x:hidden;
}
.main-area{
  margin-left:var(--sidebar-width);
  min-width:0;
  min-height:100dvh;
  transition:margin-left .22s ease;
}
.app .content{padding-bottom:40px}
.app.player-active .content{
  padding-bottom:calc(var(--mini-player-height) + var(--mini-player-gap) + 40px + env(safe-area-inset-bottom,0px));
}
.player{
  left:0;
  right:0;
  width:auto;
  bottom:0;
  z-index:12;
  min-width:0;
  grid-template-columns:minmax(0,1fr) minmax(235px,1.45fr) minmax(max-content,.75fr) 44px;
  gap:11px;
  padding:11px 17px max(11px,env(safe-area-inset-bottom,0px));
}
.player-main,.player-side,.player-center{min-width:0}
.player-main .track-info{min-width:0;flex:1}
.player-main .track-info strong,.player-main .track-info small{
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.player-main .track-info strong{display:block}
.player .open-details{flex:none}
.player-center .timeline{width:100%;min-width:0}
.player-center .timeline input{min-width:0;flex:1}
.player-controls{gap:10px}
.player-controls>.icon-btn{width:36px;height:36px;min-width:36px;min-height:36px}
.player-side{gap:9px}
.player .expand-player{
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
}
@media(max-width:1200px){
  .player-side .sync-indicator{display:none}
}
.player-side .speed-label{gap:7px}
.sidebar-toggle{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  min-width:40px;
  min-height:40px;
  flex:none;
  color:#a8bec8;
  border:1px solid transparent;
}
.sidebar-toggle:hover{color:var(--accent);border-color:#2d4550}
.sidebar-toggle .icon{width:20px;height:20px}
.top-left{gap:13px;min-width:0}
.crumb{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app.sidebar-collapsed{--sidebar-width:76px}
.app.sidebar-collapsed .sidebar{padding-left:8px;padding-right:8px}
.app.sidebar-collapsed .sidebar .brand{
  justify-content:center;
  padding:0 0 34px;
  gap:0;
}
.app.sidebar-collapsed .sidebar .logo-mark.small{
  flex:none;
  width:49px;height:49px;
  border-radius:13px;
}
.app.sidebar-collapsed .sidebar .brand-title,
.app.sidebar-collapsed .sidebar .nav-label,
.app.sidebar-collapsed .sidebar .nav-item>span,
.app.sidebar-collapsed .sidebar .series-entry>span,
.app.sidebar-collapsed .sidebar .sidebar-bottom>span,
.app.sidebar-collapsed .sidebar .sidebar-note{
  display:none!important;
}
.app.sidebar-collapsed .sidebar .nav-item,
.app.sidebar-collapsed .sidebar .series-entry{
  display:flex;
  justify-content:center;
  width:100%;
  min-height:48px;
  padding:10px 0;
  margin:1px 0;
  gap:0;
}
.app.sidebar-collapsed .sidebar .nav-item>.icon,
.app.sidebar-collapsed .sidebar .series-entry>.icon{
  width:21px;
  height:21px;
  flex:none;
}
.app.sidebar-collapsed .sidebar nav{margin-top:10px}
.app.sidebar-collapsed .sidebar .series-nav{margin-top:12px}
.app.sidebar-collapsed .sidebar .sidebar-bottom{
  justify-content:center;
  padding:14px 0 0;
}
.app.sidebar-collapsed .sidebar .sidebar-bottom .icon-btn{margin:0}
.app.sidebar-collapsed .sidebar .sidebar-bottom .icon-btn .icon{width:21px;height:21px}
@media (max-width:1080px) and (min-width:901px){
  .app:not(.sidebar-collapsed){--sidebar-width:215px}
  .player{grid-template-columns:minmax(0,.95fr) minmax(220px,1.45fr) minmax(max-content,.7fr) 44px;gap:5px;padding-left:10px;padding-right:10px}
  .player-controls{gap:7px}
  .player .track-info strong{font-size:11px}
  .player .track-info small{font-size:10px}
}
/* Tablet and phone: sidebar becomes an off-canvas drawer. */
@media(max-width:900px){
  .app,.app.sidebar-collapsed{--sidebar-width:0px}
  .sidebar{
    position:fixed;
    z-index:45;
    inset:0 auto 0 0;
    width:min(286px,85vw)!important;
    transform:translateX(-105%);
    transition:transform .22s ease;
    box-shadow:none;
    padding:26px 16px;
    overflow-x:hidden;
    overflow-y:auto;
    padding-bottom:calc(26px + env(safe-area-inset-bottom,0px));
  }
  .sidebar.open{
    transform:translateX(0);
    box-shadow:16px 0 44px #0009;
  }
  .sidebar #close-mobile-nav{display:inline-flex!important;margin-left:auto}
  .sidebar-scrim{z-index:42}
  .main-area{margin-left:0!important;width:100%}
  .player{left:0;right:0;bottom:0;transition:none}
  .topbar{gap:10px}
  .top-actions{min-width:0}
  .sidebar-toggle{min-width:42px;min-height:42px}
  body.nav-open{overflow:hidden}
}
@media(max-width:770px){
  .player{
    left:9px;
    right:9px;
    width:auto;
    bottom:max(8px,env(safe-area-inset-bottom,0px));
    padding:8px 11px 11px;
    grid-template-columns:minmax(0,1fr) 44px 44px;
    gap:7px;
  }
  .player .play-circle{width:44px;height:44px}
  .player .expand-player{grid-column:3;grid-row:1}
  .topbar > .top-actions{flex:1;justify-content:flex-end}
  .topbar .search{width:min(100%,297px)}
  .topbar .search input{width:100%;min-width:0}
  .sheet-track h2{overflow-wrap:anywhere}
  .top-left{gap:6px}
  .crumb{font-size:9px}
  .sidebar-toggle{min-width:40px}
}
@media(max-height:600px){
  .sheet-listening{position:static}
}
@media(prefers-reduced-motion:reduce){
  .sidebar,.main-area,.player{transition:none!important}
}

/* Persistent player with a resizable library and Now Playing preview. */
.app{
  --dock-height:0px;
  --preview-width:clamp(300px,var(--preview-size,360px),calc(100vw - var(--sidebar-width) - 320px));
}
.app.player-active{--dock-height:var(--mini-player-height)}
.app:not(.sidebar-collapsed){
  --sidebar-width:clamp(180px,var(--navigation-size,248px),min(320px,calc(100vw - 620px)));
}
.app .sidebar{bottom:var(--dock-height)}
.app .player{left:0;right:0;bottom:0;border-radius:0}
.app .now-playing-sheet{
  inset:0 0 var(--dock-height) auto;
  width:var(--preview-width);
  border-left:1px solid var(--stroke);
  overscroll-behavior:contain;
}
.app.preview-open .main-area{margin-right:var(--preview-width)}
.now-playing-sheet .now-playing-inner{min-height:0;padding:10px 14px 20px}
.now-playing-sheet .sheet-header{position:sticky;top:0;z-index:2}
.now-playing-sheet .sheet-layout{display:flex;flex-direction:column;align-items:stretch;gap:12px;margin-top:8px}
.now-playing-sheet .sheet-listening{
  position:static;
  display:grid;
  grid-template-columns:44px minmax(0,1fr);
  align-items:center;
  gap:5px 10px;
  max-width:none;
}
.now-playing-sheet .sheet-album{width:44px;height:44px;margin:0;border-radius:8px;grid-row:1;grid-column:1}
.now-playing-sheet .sheet-album .icon{width:24px;height:24px}
.now-playing-sheet .sheet-track{grid-row:1;grid-column:2;min-width:0}
.now-playing-sheet .sheet-track h2{font-size:14px;margin:4px 0;overflow-wrap:anywhere}
.now-playing-sheet .sheet-timeline,.now-playing-sheet #sheet-seek,
.now-playing-sheet .sheet-controls,.now-playing-sheet .sheet-bottom{grid-column:1 / -1}
.now-playing-sheet .sheet-timeline{margin-top:8px}
.now-playing-sheet #sheet-seek{margin:3px 0 6px;width:100%;min-width:0}
.now-playing-sheet .sheet-controls{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;justify-items:center}
.now-playing-sheet .sheet-controls .icon-btn,.now-playing-sheet .sheet-controls .big-play{width:44px;height:44px;padding:0}
.now-playing-sheet .sheet-bottom{margin-top:4px;padding-top:8px}
.now-playing-sheet .study-panel{padding:10px;box-shadow:none}
.now-playing-sheet .study-panel-heading h3{margin:6px 0 10px;font-size:14px}
.now-playing-sheet .study-tab{gap:4px;font-size:10px;padding-inline:3px;white-space:nowrap}
.now-playing-sheet .study-tab .icon{flex:none;width:14px;height:14px}
.now-playing-sheet .study-panel-body{padding-top:10px;min-height:0}
.now-playing-sheet .study-toolbar{flex-wrap:wrap}
.now-playing-sheet .script-reader{min-height:128px;max-height:36vh}
.now-playing-sheet .study-chapter-list,.now-playing-sheet .word-panel{max-height:36vh}
.panel-resize{
  position:fixed;
  z-index:35;
  inset-block:0 var(--dock-height);
  width:9px;
  background:transparent;
  cursor:col-resize;
  touch-action:none;
}
.panel-resize::before{
  content:"";
  position:absolute;
  inset:0 auto 0 4px;
  width:1px;
}
.panel-resize:hover::before,.panel-resize:focus-visible::before{background:var(--accent)}
@media(min-width:901px) and (min-height:480px){
  .now-playing-sheet .now-playing-inner{height:100%}
  .now-playing-sheet .sheet-layout,.now-playing-sheet .study-panel,
  .now-playing-sheet .study-panel-body,.now-playing-sheet .study-tabpanel{
    display:flex;
    flex-direction:column;
    flex:1;
    min-height:0;
  }
  .now-playing-sheet .sheet-listening,.now-playing-sheet .study-tabs,
  .now-playing-sheet .study-toolbar{flex-shrink:0}
  .now-playing-sheet .script-reader,.now-playing-sheet .study-chapter-list,
  .now-playing-sheet .word-panel,.now-playing-sheet .queue-list{
    flex:1;
    min-height:0;
    max-height:none;
    overflow:auto;
  }
}
@media(min-width:901px){
  .now-playing-sheet .sheet-timeline,.now-playing-sheet #sheet-seek,
  .now-playing-sheet .sheet-controls,.now-playing-sheet .sheet-bottom{display:none}
}
#sidebar-resize{left:calc(var(--sidebar-width) - 4px)}
#preview-resize{right:calc(var(--preview-width) - 4px)}
.app.sidebar-collapsed #sidebar-resize,.app:not(.preview-open) #preview-resize{display:none}
@media(max-width:900px){
  .app:not(.sidebar-collapsed){--sidebar-width:0px}
  .app .sidebar{bottom:0}
  .app .panel-resize{display:none}
  .app.preview-open .main-area{margin-right:0}
  .app .now-playing-sheet{
    inset:auto 0 var(--dock-height);
    width:100%;
    max-height:56dvh;
    border:0;
    border-top:1px solid var(--stroke);
    border-radius:14px 14px 0 0;
  }
  .app.preview-open.player-active .content{padding-bottom:calc(56dvh + var(--dock-height) + 40px)}
}

.app .player{grid-template-columns:minmax(0,1fr) minmax(220px,1.45fr) max-content 44px 44px}
.dock-queue{width:44px;height:44px}
.player button[aria-expanded=true]{color:var(--accent);background:var(--graphite-lift)}
.app .player .sync-indicator{display:none}
.app .player .sync-indicator.sync-pending{display:inline-flex}
.queue-preview .sheet-listening,.queue-preview .study-panel-heading,.queue-preview .study-tabs{display:none}
.queue-preview .study-panel-body{padding-top:0}
@media(max-width:770px){
 .app .player{grid-template-columns:minmax(0,1fr) repeat(3,44px)}
 .app .player .dock-queue{grid-column:4;grid-row:1}
}

@media(min-width:771px){
 .app .player{grid-template-columns:minmax(0,1fr) minmax(220px,1.2fr) minmax(0,1fr)}
 .dock-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0}
}
@media(max-width:770px){
 .app .player{grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr)}
 .dock-actions{display:flex;align-items:center;justify-content:flex-end;gap:0}
 .player-main{gap:6px}
 .player .tiny-cover{width:32px;height:32px}
}
