/* SKILL LAB · The Reading Room — immersive, full-height PDF reader. */
dialog.sl-pdf-reader {
  width:min(1640px,98vw)!important;
  max-width:none!important;
  height:97dvh!important;
  max-height:97dvh!important;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid #b9976b!important;
  border-radius:16px!important;
  background:#c9bbab!important;
  color:#3e3030;
  box-shadow:0 36px 120px rgba(17,8,11,.72),0 0 0 1px rgba(245,218,178,.21);
}
dialog.sl-pdf-reader::backdrop {
  background:rgba(17,9,13,.82);
  backdrop-filter:blur(9px);
}
.sl-reader-shell {
  height:100%;
  min-height:0;
  display:grid;
  grid-template-columns:168px minmax(0,1fr);
}
/* Desktop tools live to the LEFT, never above the document. */
.sl-reader-toolbar {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:18px;
  min-height:0;
  min-width:0;
  margin:0;
  padding:18px 11px 14px;
  overflow-y:auto;
  overscroll-behavior:contain;
  color:#f2e4d0;
  background:radial-gradient(ellipse at 10% 5%,rgba(133,72,88,.32),transparent 56%),
    linear-gradient(180deg,#492630 0%,#2d191f 77%,#25151a 100%);
  border-right:1px solid #bb8c69;
  box-shadow:5px 0 21px rgba(52,24,30,.2);
  scrollbar-color:#8c6770 #39242b;
}
.sl-reader-top {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  padding:0 3px 13px;
  border-bottom:1px solid rgba(227,188,143,.26);
}
.sl-reader-mark {
  display:block;
  padding-top:5px;
  font-family:Georgia,serif;
  font-size:12px;
  letter-spacing:.13em;
  line-height:1.4;
  font-weight:700;
  color:#f3e3c9;
}
.sl-reader-mark small {
  display:block;
  color:#d5ae81;
  font-size:8px;
  letter-spacing:.16em;
  font-weight:600;
  margin-top:3px;
}
.sl-reader-close {
  flex:0 0 auto;
  width:32px;
  height:32px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(240,205,151,.5);
  border-radius:50%;
  color:#f7ead7;
  background:rgba(255,255,255,.04);
  font:400 25px/1 sans-serif;
  cursor:pointer;
}
.sl-reader-close:hover{background:rgba(224,181,139,.20);}
.sl-reader-sr-only {
  position:absolute!important;
  width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;
  border:0!important;overflow:hidden!important;
  clip:rect(0 0 0 0)!important;
  white-space:nowrap!important;
}
.sl-reader-toolbar .sl-reader-group {
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:9px;
  margin:0;
  min-width:0;
}
.sl-sidebar-label {
  color:#d8b28e;
  font-size:11px;
  letter-spacing:.10em;
  font-weight:750;
  margin-bottom:0;
}
.sl-reader-page-number {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:9px;
}
.sl-reader-toolbar .sl-muted {
  color:#dfc4a9;
  font-size:12px;
  font-variant-numeric:tabular-nums;
}
.sl-reader-toolbar button,
.sl-reader-toolbar select,
.sl-reader-toolbar input {
  box-sizing:border-box;
  appearance:none;
  min-width:0;
  border:1px solid rgba(226,190,149,.38);
  border-radius:8px;
  background:#53313a;
  color:#fff3e3;
  font-family:inherit;
  font-size:12px;
  font-weight:650;
  line-height:1.35;
  min-height:36px;
  padding:8px 9px;
}
.sl-reader-toolbar button {
  cursor:pointer;
  text-align:center;
}
.sl-reader-toolbar button:hover:not(:disabled),
.sl-reader-toolbar select:hover:not(:disabled) {
  background:#67404b;
  border-color:#e7bd86;
}
.sl-reader-toolbar button:disabled,
.sl-reader-toolbar select:disabled,
.sl-reader-toolbar input:disabled {
  opacity:.42;
  cursor:not-allowed;
}
.sl-reader-toolbar #slPdfPage {
  width:64px;
  text-align:center;
  font-variant-numeric:tabular-nums;
  font-size:14px;
  background:#f9efe2;
  color:#4a2530;
  border-color:#b99975;
}
.sl-reader-step-buttons{display:flex;gap:7px;}
.sl-reader-step-buttons button{flex:1;}
#slPdfSpreadLabel{font-size:10px;line-height:1.5;min-height:13px;}
.sl-reader-toolbar .sl-page-mode {
  padding:4px;
  border:1px solid rgba(222,181,141,.34);
  border-radius:10px;
  background:rgba(19,8,14,.17);
  gap:5px;
}
.sl-reader-toolbar .sl-page-mode button {
  min-height:37px;
  border-color:transparent;
  background:transparent;
  color:#dcc4af;
}
.sl-reader-toolbar .sl-page-mode button[aria-pressed="true"] {
  background:#f1ddc3;
  color:#462532;
  border-color:#f1ddc3;
  box-shadow:0 2px 9px rgba(15,7,13,.32);
}
.sl-reader-toolbar .sl-page-mode button[aria-pressed="false"]:hover:not(:disabled) {
  background:#683c49;
}
.sl-reader-toolbar #slPdfZoom {
  width:100%;
  color:#f8e9d4;
  background:#50303a;
  cursor:pointer;
}
.sl-reader-toolbar #slPdfZoom option {
  background:#392128;
  color:#f8e9d4;
}
.sl-reader-bottom {
  display:flex;
  flex-direction:column;
  gap:9px;
  margin-top:auto;
  padding-top:16px;
  border-top:1px solid rgba(219,170,131,.26);
}
.sl-reader-bottom #slPdfDownload {
  background:#9e7453;
  border-color:#cfa779;
  color:#fff7e9;
}
.sl-reader-bottom #slPdfDownload:hover:not(:disabled) {
  background:#b18860;
}
.sl-reader-bottom a {
  display:block;
  padding:10px 7px;
  border:1px solid rgba(214,177,131,.4);
  border-radius:8px;
  text-decoration:none;
  text-align:center;
  font-size:11px;
  line-height:1.45;
  font-weight:750;
  color:#f5dfc4;
  background:rgba(255,255,255,.04);
}
.sl-reader-bottom a:hover{background:rgba(231,186,134,.16);}
.sl-reader-toolbar button:focus-visible,
.sl-reader-toolbar select:focus-visible,
.sl-reader-toolbar input:focus-visible,
.sl-reader-close:focus-visible,
.sl-reader-bottom a:focus-visible {
  outline:3px solid #efd3a5;
  outline-offset:2px;
}
.sl-pdf-stage {
  position:relative;
  min-width:0;
  min-height:0;
  height:100%;
  overflow:auto;
  overscroll-behavior:contain;
  text-align:center;
  padding:8px 10px 24px;
  background:
    radial-gradient(ellipse at center top,rgba(255,255,255,.44),transparent 65%),
    repeating-linear-gradient(0deg,transparent 0,transparent 4px,rgba(86,62,56,.018) 5px),
    #c9bbab;
  scrollbar-color:#9a8175 #ddd1c3;
}
.sl-pdf-surface {
  width:max-content;
  min-width:0;
  max-width:none;
  margin:0 auto;
  line-height:0;
}
.sl-pdf-surface.spread-dual {
  display:flex;
  align-items:flex-start;
  justify-content:center;
  gap:14px;
}
.sl-page-frame{flex:0 0 auto;line-height:0;min-width:0;}
.sl-page-canvas {
  display:block;
  background:#fff;
  margin:0 auto;
  box-shadow:0 10px 30px rgba(49,28,27,.23),0 0 0 1px rgba(74,57,50,.13);
}
.sl-pdf-status {
  position:sticky;
  top:10px;
  z-index:10;
  width:max-content;
  max-width:95%;
  margin:0 auto 12px;
  padding:10px 18px;
  border:1px solid #b48c67;
  border-radius:12px;
  color:#ffebd6;
  background:#422631;
  font-size:12px;
  line-height:1.6;
  box-shadow:0 5px 18px rgba(43,24,24,.24);
}
.sl-pdf-status[data-kind="error"]{background:#5a242e;color:#fff4e9;}
.sl-pdf-status[hidden]{display:none;}
/* Tablet/mobile: the sidebar becomes a short horizontal control strip.
   Single-page reading remains the only option on narrow screens. */
@media(max-width:760px) {
  dialog.sl-pdf-reader {
    position:fixed!important;
    inset:0!important;
    margin:0!important;
    width:100vw!important;
    max-width:100vw!important;
    height:100dvh!important;
    max-height:100dvh!important;
    border:0!important;
    border-radius:0!important;
  }
  .sl-reader-shell{display:flex;flex-direction:column;}
  .sl-reader-toolbar {
    flex:0 0 auto;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    gap:7px 11px;
    padding:7px 9px;
    overflow:visible;
    border-right:0;
    border-bottom:1px solid #c29a77;
  }
  .sl-reader-top {
    order:0;
    flex:0 0 100%;
    padding:0 0 5px;
    align-items:center;
  }
  .sl-reader-mark {font-size:11px;padding-top:0;}
  .sl-reader-mark small{display:inline;font-size:8px;margin:0 0 0 6px;}
  .sl-reader-close {width:30px;height:30px;font-size:22px;}
  .sl-reader-toolbar .sl-reader-pagination {
    order:1;display:flex;flex:1 1 auto;flex-direction:row;
    align-items:center;gap:6px;
  }
  .sl-reader-pagination .sl-sidebar-label,
  .sl-reader-zoom .sl-sidebar-label {display:none;}
  .sl-reader-page-number{gap:5px;}
  .sl-reader-toolbar #slPdfPage{width:41px;font-size:12px;min-height:31px;}
  .sl-reader-toolbar .sl-reader-group{gap:6px;}
  .sl-reader-toolbar .sl-reader-step-buttons{gap:4px;}
  .sl-reader-toolbar .sl-reader-step-buttons button{min-width:37px;}
  #slPdfSpreadLabel{display:none!important;}
  .sl-reader-toolbar .sl-page-mode{display:none!important;}
  .sl-reader-toolbar .sl-reader-zoom {
    order:2;flex:0 1 auto;
    display:flex;flex-direction:row;align-items:center;gap:4px;
  }
  .sl-reader-toolbar #slPdfZoom{width:96px;}
  .sl-reader-toolbar #slPdfFit{display:none;}
  .sl-reader-toolbar #slPdfRotate{min-width:36px;}
  .sl-reader-toolbar button,.sl-reader-toolbar select{
    min-height:31px;padding:5px 6px;font-size:11px;
  }
  .sl-reader-bottom {
    order:3;flex:0 0 auto;flex-direction:row;gap:4px;
    margin:0;padding:0;border:0;
  }
  .sl-reader-bottom #slPdfDownload {min-height:31px;padding:5px 7px;}
  .sl-reader-bottom a {display:none!important;}
  .sl-pdf-stage{flex:1;height:auto;padding:7px 6px 20px;}
}
@media(max-width:500px) {
  .sl-reader-toolbar{gap:5px 6px;padding:5px 7px;}
  .sl-reader-toolbar .sl-reader-zoom{order:3;}
  .sl-reader-bottom{order:4;margin-left:auto;}
  .sl-reader-step-buttons button{font-size:10px;}
  .sl-reader-toolbar #slPdfZoom{width:105px;}
}
@media(prefers-reduced-motion:reduce){
  .sl-reader-toolbar button,.sl-reader-close{transition:none!important;}
}

/* Reader v1.3 — fluid controls. Sidebar actions scale with viewport dimensions.
   Pagination/zoom scroll independently; downloads remain visible at the bottom. */
@media (min-width:761px) {
  .sl-reader-shell {
    grid-template-columns:clamp(162px, 11vw, 196px) minmax(0,1fr);
  }
  .sl-reader-toolbar {
    box-sizing:border-box;
    height:100%;
    overflow:hidden;
    gap:clamp(9px, 1.5dvh, 16px);
    padding:clamp(9px, 1.7dvh, 18px) clamp(8px, .8vw, 13px)
            clamp(9px, 1.3dvh, 14px);
  }
  .sl-reader-top {flex:0 0 auto;min-width:0;padding-bottom:clamp(5px, 1dvh, 12px);}
  .sl-reader-mark {font-size:clamp(10px, .75vw, 12px);min-width:0;}
  .sl-reader-controls {
    flex:1 1 auto;
    min-height:0;
    min-width:0;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:clamp(9px, 1.65dvh, 19px);
    overflow-x:hidden;
    overflow-y:auto;
    scrollbar-width:thin;
    scrollbar-color:#89636b transparent;
    padding:2px 2px 5px 0;
    overscroll-behavior:contain;
  }
  .sl-reader-toolbar .sl-reader-group {min-width:0;gap:clamp(5px, .9dvh, 9px);}
  .sl-reader-toolbar button,
  .sl-reader-toolbar select,
  .sl-reader-toolbar input {
    max-width:100%;
    min-width:0;
    min-height:clamp(29px, 4.2dvh, 38px);
    padding:clamp(5px, .8dvh, 8px) clamp(4px, .5vw, 9px);
    font-size:clamp(11px, .75vw, 12px);
  }
  .sl-reader-page-number {min-width:0;gap:clamp(5px,.5vw,9px);}
  .sl-reader-toolbar #slPdfPage {width:min(64px,54%);min-width:45px;}
  .sl-reader-step-buttons {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    min-width:0;
    gap:clamp(4px,.45vw,7px);
  }
  .sl-reader-step-buttons button {
    box-sizing:border-box;
    width:100%;
    min-width:0;
    padding-inline:2px;
    white-space:nowrap;
    overflow:hidden;
    font-size:clamp(10px,.74vw,12px);
  }
  .sl-reader-toolbar .sl-page-mode {gap:clamp(3px,.6dvh,5px);padding:3px;}
  .sl-reader-toolbar .sl-page-mode button {min-height:clamp(30px,4.2dvh,37px);}
  .sl-reader-bottom {
    flex:0 0 auto;
    min-width:0;
    margin-top:0;
    gap:clamp(5px,.85dvh,9px);
    padding-top:clamp(6px,1.2dvh,15px);
    background:linear-gradient(180deg,transparent,#29171c 14%);
  }
  .sl-reader-bottom a {
    min-width:0;
    overflow-wrap:anywhere;
    padding:clamp(6px,.9dvh,10px) clamp(3px,.4vw,7px);
    font-size:clamp(10px,.72vw,11px);
  }
  .sl-pdf-stage{padding-top:clamp(4px,.7dvh,8px);}
}
@media (max-width:760px) {
  .sl-reader-controls {display:contents;}
  .sl-reader-step-buttons{display:flex;flex:0 1 auto;min-width:0;width:auto;gap:4px;}
  .sl-reader-step-buttons button{flex:0 1 auto;min-width:0;white-space:nowrap;}
  .sl-reader-toolbar #slPdfPage{flex:0 0 auto;}
  .sl-reader-bottom{background:none;}
}
@media (max-height:650px) and (min-width:761px) {
  .sl-reader-toolbar {gap:7px;padding-block:8px;}
  .sl-reader-top {padding-bottom:6px;}
  .sl-reader-mark small {margin-top:0;}
  .sl-reader-controls {gap:8px;}
  .sl-reader-toolbar .sl-reader-group {gap:5px;}
  .sl-reader-toolbar button,
  .sl-reader-toolbar select,
  .sl-reader-toolbar input {min-height:30px;padding-block:5px;}
  .sl-reader-bottom {padding-top:5px;gap:5px;}
}
/* Reader v1.4: isolate this panel from the main navigation's global aside rules.
   Actual sidebar width must never exceed its grid track. */
.sl-pdf-reader .sl-reader-toolbar {
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
  position:relative;
  height:100%;
  margin:0;
}
.sl-pdf-reader .sl-reader-controls,
.sl-pdf-reader .sl-reader-pagination,
.sl-pdf-reader .sl-reader-zoom,
.sl-pdf-reader .sl-reader-bottom {
  box-sizing:border-box;
  width:100%;
  max-width:100%;
  min-width:0;
}
.sl-pdf-reader .sl-reader-step-buttons {
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
}
.sl-pdf-reader .sl-reader-step-buttons button,
.sl-pdf-reader .sl-reader-bottom button,
.sl-pdf-reader .sl-reader-bottom a {
  box-sizing:border-box;
  max-width:100%;
  min-width:0;
}
@media(max-width:760px) {
  .sl-pdf-reader .sl-reader-toolbar {
    height:auto;
    flex:0 0 auto;
  }
  .sl-pdf-reader .sl-reader-controls {
    display:contents;
  }
  .sl-pdf-reader .sl-reader-pagination,
  .sl-pdf-reader .sl-reader-zoom,
  .sl-pdf-reader .sl-reader-bottom {
    width:auto;
  }
}
