/* Sacralib V2.17 — corrections only for authenticated owner V2 inner pages.
 * Keep article content, game widgets, admin, and public pages untouched. */
body.sv217-page-theme{
  /* The home V2 uses this continuous parchment. Separate the scenic murals into
     masked elements to avoid hard horizontal rectangular cuts on long pages. */
  background-color:#eee6d8!important;
  background-image:url('/assets/codex-v27-figma/parchment.webp')!important;
  background-position:center top!important;
  background-size:1024px auto!important;
  background-repeat:repeat!important;
  background-attachment:scroll!important;
}
body.sv217-page-theme :is(.page-shell,.content-stage){
  background:transparent!important;
  box-shadow:none!important;
}
body.sv217-page-theme .sv217-landscapes{pointer-events:none!important;position:relative;z-index:0;}
body.sv217-page-theme .sv217-landscapes[hidden]{display:none!important;}
body.sv217-page-theme .sv217-scenery{
  position:fixed;top:67px;bottom:auto;
  width:var(--sv217-art-width,140px);
  height:min(860px,calc(100dvh - 67px));
  z-index:0;pointer-events:none;
  background-position:center top;background-repeat:no-repeat;background-size:100% 100%;
  -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 31%,rgba(0,0,0,.91) 48%,rgba(0,0,0,.65) 66%,rgba(0,0,0,.22) 86%,transparent 100%);
  mask-image:linear-gradient(to bottom,#000 0%,#000 31%,rgba(0,0,0,.91) 48%,rgba(0,0,0,.65) 66%,rgba(0,0,0,.22) 86%,transparent 100%);
}
body.sv217-page-theme .sv217-scenery-left{
  left:var(--sv217-art-left,0px);
  background-image:url('/assets/codex-v27-figma/side-left.webp');
}
body.sv217-page-theme .sv217-scenery-right{
  right:var(--sv217-art-right,0px);
  background-image:url('/assets/codex-v27-figma/side-right.webp');
}
/* Content and floating owner control stay above scenery. */
body.sv217-page-theme :is(.page-shell,.site-footer,#siteFooter){position:relative;z-index:1;}
/* Desktop search — replace the unstable Unicode ⌕ (baseline/side-bearing shifts)
   with a centred vector symbol and keep the original input and search behavior. */
@media(min-width:1200px){
 body.sv217-page-theme .codex-navbar #mobileDrawer .nav-search{
  display:block!important;position:relative!important;overflow:visible!important;
  width:46px!important;max-width:46px!important;min-width:46px!important;
  height:43px!important;min-height:43px!important;
 }
 body.sv217-page-theme .codex-navbar #mobileDrawer .nav-search::before{
  content:''!important;display:block!important;
  position:absolute!important;z-index:2!important;
  left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  width:21px!important;height:21px!important;
  font-size:0!important;line-height:0!important;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233e3025' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.8' cy='10.8' r='6.3'/%3E%3Cpath d='m15.6 15.6 5 5'/%3E%3C/svg%3E") center/contain no-repeat!important;
  pointer-events:none!important;
 }
 body.sv217-page-theme .codex-navbar #mobileDrawer .nav-search>input{
  width:100%!important;height:100%!important;min-height:0!important;
  margin:0!important;padding:0!important;border:0!important;
  display:block!important;box-sizing:border-box!important;
  background:transparent!important;
 }
 body.sv217-page-theme .codex-navbar #mobileDrawer .nav-search:focus-within{
  width:202px!important;max-width:202px!important;
 }
 body.sv217-page-theme .codex-navbar #mobileDrawer .nav-search:focus-within::before{
  left:20px!important;transform:translate(-50%,-50%)!important;
 }
 body.sv217-page-theme .codex-navbar #mobileDrawer .nav-search:focus-within>input{
  padding-left:40px!important;padding-right:10px!important;
 }
}
/* Real saved categories (NOT just the article's current category) as collapsible
   navigation, matching the supplied desktop article reference. */
body.sv217-page-theme.codex-article-v2-active .cv2-layout .sv217-nav-panel{
  padding:0!important;overflow:hidden!important;
}
body.sv217-page-theme.codex-article-v2-active .cv2-layout .sv217-nav-heading{
  display:flex!important;align-items:center!important;gap:9px!important;
  padding:14px 12px!important;margin:0!important;
  color:#342719!important;font:600 15px/1.2 Georgia,serif!important;
  border-bottom:1px solid #d7c2a3!important;
  letter-spacing:.02em!important;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-heading .sv217-nav-icon{
  width:34px;height:37px;flex:none;object-fit:contain;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-group{
  margin:0!important;border:0!important;
  border-bottom:1px solid #dbcbb1!important;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-group:last-child{border-bottom:0!important;}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-summary{
  display:flex!important;align-items:center!important;gap:8px!important;
  min-height:46px!important;padding:7px 9px!important;
  cursor:pointer!important;list-style:none!important;
  font:600 13px/1.2 Georgia,serif!important;color:#4e3321!important;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-summary::-webkit-details-marker{display:none!important;}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-summary::after{
  content:'⌄';margin-left:auto!important;font:600 16px/1 Georgia,serif;color:#90683e;
  transition:transform .15s ease;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-group[open]>.sv217-nav-summary::after{transform:rotate(180deg);}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-group[open]>.sv217-nav-summary,
body.sv217-page-theme.codex-article-v2-active .sv217-nav-summary:hover{
  background:#eadcc5!important;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-summary .sv217-nav-icon{
  display:block;width:28px;height:30px;flex:none;object-fit:contain;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-links{
  display:grid;gap:0;padding:4px 7px 8px;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-link{
  display:block;position:relative;padding:7px 5px 7px 17px;
  color:#4b3625!important;font:400 13px/1.25 Georgia,serif!important;
  text-decoration:none!important;overflow-wrap:anywhere;
  border-bottom:1px solid #e4d5bf;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-link::before{
  content:'›';position:absolute;left:5px;color:#a27a46;font-size:17px;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-link:hover,
body.sv217-page-theme.codex-article-v2-active .sv217-nav-link.is-current{
  background:#e6d8c0!important;color:#6a3b23!important;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-link.is-current{
  border-left:2px solid #936233;padding-left:15px;font-weight:700!important;
}
body.sv217-page-theme.codex-article-v2-active .sv217-nav-empty{
  margin:12px!important;color:#766550!important;font-size:13px;
}
body.sv217-page-theme.codex-article-v2-active .cv2-layout .cv2-left{
  scrollbar-width:thin;scrollbar-color:#baa17b transparent;
}
@media(max-width:1040px){
 body.sv217-page-theme .sv217-landscapes{display:none!important;}
}
@media(max-width:840px){
 body.sv217-page-theme.codex-article-v2-active .cv2-layout .cv2-left{
  position:static!important;max-height:none!important;overflow:visible!important;
 }
 body.sv217-page-theme.codex-article-v2-active .sv217-nav-summary{min-height:50px!important;}
 body.sv217-page-theme.codex-article-v2-active .sv217-nav-link{padding-top:10px;padding-bottom:10px;}
}
@media(prefers-reduced-motion:reduce){
 body.sv217-page-theme .sv217-nav-summary::after{transition:none!important;}
}
