/* ORI24 step 1: isolated Instruction sidebar module. Add later, without editing current archive files. */
:root{
  --ori-guide-accent:#f97316;
  --ori-guide-accent-dark:#9a3412;
  --ori-guide-soft:#fff7ed;
  --ori-guide-line:var(--border,#e5e7eb);
  --ori-guide-ink:var(--ink,#111827);
  --ori-guide-muted:var(--muted,#64748b);
  --ori-guide-card:var(--card,#ffffff);
}
#oriInstructionSidebarBtn[aria-expanded="true"],
#oriInstructionSidebarBtn[data-active="1"],
#siteGuideBtn[data-active="1"],
#oriStaticGuideBtn[data-active="1"]{
  border-color:#fdba74 !important;
  background:var(--ori-guide-soft) !important;
  color:var(--ori-guide-accent-dark) !important;
}
#oriInstructionSidebarBtn .navico{ color:currentColor; }
.ori-instruction-sidebar-wrap{
  display:none;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
  border:1px solid var(--ori-guide-line);
  border-radius:16px;
  background:var(--ori-guide-card);
}
body.ori-instruction-sidebar-open #desktopSidebar .ori-instruction-sidebar-wrap{
  display:flex !important;
  flex:1 1 auto !important;
}
body.ori-instruction-sidebar-open #desktopSidebar .sidebar-history-wrap{
  display:none !important;
}
#desktopSidebar .sidebar-history-list,
#desktopSidebar #sidebarHistoryList{
  overflow:auto;
  overscroll-behavior:contain;
}
.ori-instruction-sidebar-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  padding:12px 12px 8px;
  flex:0 0 auto;
}
.ori-instruction-sidebar-title{
  margin:0;
  color:rgba(100,116,139,.92);
  font-size:14px;
  line-height:1.2;
  font-weight:700;
}
.ori-instruction-sidebar-meta{
  margin-top:4px;
  color:var(--ori-guide-muted);
  font-size:11px;
  line-height:1.35;
}
.ori-instruction-sidebar-actions{
  display:flex;
  align-items:center;
  gap:4px;
  flex:0 0 auto;
}
.ori-instruction-sidebar-actions .btn.small,
.ori-instruction-sidebar-actions a.btn.small{
  display:inline-flex !important;
  width:24px !important;
  min-width:24px !important;
  height:24px !important;
  min-height:24px !important;
  padding:0 !important;
  border-radius:999px !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  text-decoration:none !important;
  font-size:12px !important;
  line-height:1 !important;
}
.ori-instruction-sidebar-list{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:0 8px 8px !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.ori-instruction-sidebar-group{
  position:sticky;
  top:0;
  z-index:1;
  margin:0;
  padding:8px 2px 5px;
  color:var(--ori-guide-accent-dark);
  background:linear-gradient(180deg,var(--ori-guide-card) 72%,rgba(255,255,255,0));
  font-size:10px;
  line-height:1.1;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:800;
}
.ori-instruction-sidebar-item{
  display:grid;
  gap:2px;
  padding:8px 2px 9px;
  text-decoration:none !important;
  color:var(--ori-guide-ink);
  border-bottom:1px solid var(--ori-guide-line);
}
.ori-instruction-sidebar-item:hover,
.ori-instruction-sidebar-item:focus-visible{
  color:var(--ori-guide-accent-dark);
  outline:none;
}
.ori-instruction-sidebar-item[aria-current="page"]{
  background:var(--ori-guide-soft);
  margin-inline:-6px;
  padding-inline:8px;
  border-radius:12px;
  border-bottom-color:transparent;
}
.ori-instruction-sidebar-item strong{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
  line-height:1.25;
}
.ori-instruction-sidebar-item span{
  display:block;
  color:var(--ori-guide-muted);
  font-size:11px;
  line-height:1.28;
}
.ori-instruction-sidebar-empty{
  padding:12px;
  color:var(--ori-guide-muted);
  font-size:13px;
}
#siteDesktopNavHost #siteGuideBtn,
#siteDesktopNavHost .ori-site-guide-btn{
  margin-left:0;
}
@media (max-width:640px){
  body.ori-instruction-sidebar-open #desktopSidebar .ori-instruction-sidebar-wrap{
    flex:1 1 auto !important;
    min-height:0 !important;
  }
  .ori-instruction-sidebar-wrap{
    border-radius:14px;
  }
  .ori-instruction-sidebar-head{
    padding:9px 10px 6px;
  }
  .ori-instruction-sidebar-list{
    padding:0 6px 8px !important;
  }
}

body.ori-static-shell-applied.ori-instruction-sidebar-open #desktopSidebar .ori-instruction-sidebar-wrap{display:flex !important;flex:1 1 auto !important;min-height:0 !important;}


/* ORI24 instruction correction 2026-04-19: site-only compact scroll list under Documents. */
body.ori-static-shell-applied #desktopSidebar .sidebar-nav{
  min-height:0;
}
body.ori-static-shell-applied #desktopSidebar #oriInstructionSidebarBtn{
  margin-top:0;
}
body.ori-static-shell-applied.ori-instruction-sidebar-open #desktopSidebar .ori-instruction-sidebar-wrap{
  display:flex !important;
  flex:0 0 auto !important;
  width:100%;
  max-height:clamp(150px, 34vh, 300px);
  margin:2px 0 4px;
  border-radius:14px;
  background:#fff;
}
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-head{
  align-items:center;
  padding:8px 8px 5px;
  gap:6px;
}
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-title{
  font-size:12px;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--ori-guide-muted);
}
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-meta,
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-group,
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-item span{
  display:none !important;
}
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-list{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:0 6px 7px !important;
  overscroll-behavior:contain;
}
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-item{
  display:block;
  padding:7px 8px;
  border:0;
  border-radius:10px;
  color:var(--ori-guide-ink);
  font-size:13px;
  line-height:1.22;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-item + .ori-instruction-sidebar-item{
  margin-top:1px;
}
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-item:hover,
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-item:focus-visible,
body.ori-static-shell-applied #desktopSidebar .ori-instruction-sidebar-item[aria-current="page"]{
  background:var(--ori-guide-soft);
  color:var(--ori-guide-accent-dark);
  outline:none;
}
@media (max-width:640px){
  body.ori-static-shell-applied.ori-instruction-sidebar-open #desktopSidebar .ori-instruction-sidebar-wrap{
    max-height:clamp(150px, 38vh, 260px);
  }
}
