@layer ar-explorer-drawer {
html[data-ar-explorer-handheld] body .app-shell {
  display:grid!important; grid-template-columns:minmax(0,1fr)!important;
  width:100%!important; min-width:0!important; max-width:100%!important;
  box-sizing:border-box!important; margin-inline:auto!important;
}
html[data-ar-explorer-handheld] body .app-shell>#workspace {
  width:100%!important; max-width:100%!important; min-width:0!important;
  margin-inline:0!important; padding-inline:clamp(10px,3vw,18px)!important;
  box-sizing:border-box!important;
}
html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #workspace :is(#global-query,#reader-passage-input) {font-size:16px!important}
html[data-ar-explorer-handheld] body .app-shell>#sidebar#sidebar {
  display:block!important; position:fixed!important; inset:var(--ar-drawer-top,10dvh) auto auto var(--ar-drawer-left,0px)!important;
  width:var(--ar-drawer-panel-width,min(calc(100vw - 32px),440px))!important; zoom:var(--ar-drawer-fit,1); height:var(--ar-drawer-height,80dvh)!important;
  min-height:0!important; max-height:var(--ar-drawer-height,80dvh)!important;
  overflow:auto!important; overflow-anchor:none!important; overscroll-behavior:contain; box-sizing:border-box!important;
  z-index:902!important; margin:0!important; padding:8px 16px 20px!important;
  border:1px solid var(--line,#8c7252)!important; border-radius:0 14px 14px 0!important;
  background:var(--surface,#17191e)!important; box-shadow:14px 12px 38px #0009!important;
  visibility:hidden!important; transform:translateX(-108%)!important; pointer-events:none!important;
  transition:transform 260ms cubic-bezier(.24,.75,.28,1), visibility 0s linear 260ms!important;
  scrollbar-width:thin;
}
html[data-ar-explorer-handheld][data-ar-drawer-open] body .app-shell>#sidebar#sidebar {
  visibility:visible!important; transform:translateX(0)!important; pointer-events:auto!important;
  transition-delay:0s!important;
}
html[data-ar-explorer-handheld] body #sidebar#sidebar .sidebar-heading {
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:7px!important;
  margin:0 0 14px!important;
}
html[data-ar-explorer-handheld] body #sidebar#sidebar .sidebar-heading>:is(h1,.eyebrow,.visit-navigation){
  grid-column:1/-1!important; text-align:left!important; display:block!important;
}
html[data-ar-explorer-handheld] body #sidebar#sidebar .sidebar-heading>.visit-navigation {
  display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:7px!important;
}
html[data-ar-explorer-handheld] body #sidebar#sidebar .sidebar-heading>:is(#explorer-dashboard,#close-all67){grid-column:auto!important}
html[data-ar-explorer-handheld] body #sidebar#sidebar #ar-study-menu-r24[open]>#study-tree{
  max-height:none!important;overflow:visible!important;
}
}
.ar-explorer-drawer-trigger,.ar-explorer-drawer-scrim,.ar-explorer-drawer-bar{display:none}
html[data-ar-explorer-handheld] .ar-explorer-drawer-trigger {
  display:grid; place-items:center; position:fixed; z-index:900; isolation:isolate;
  left:var(--ar-trigger-left,max(2px,env(safe-area-inset-left))); top:var(--ar-trigger-top,50%); translate:0 -50%; zoom:var(--ar-drawer-fit,1);
  width:44px; min-height:48px; color:#f8e4b7; background:none; border:none; padding:0;
  opacity:1; transition:opacity 220ms ease; touch-action:manipulation;
}
html[data-ar-explorer-handheld] .ar-explorer-drawer-trigger svg {
  width:27px; height:36px; overflow:visible; pointer-events:none;
  filter:drop-shadow(0 1px 2px #100905) drop-shadow(0 0 5px #deb17166);
}
@keyframes ar-explorer-arrow-drift {
  0%,100% { transform:translate3d(0,1px,0); }
  50% { transform:translate3d(1px,-2px,0); }
}
@media(prefers-reduced-motion:no-preference){
  html[data-ar-explorer-handheld]:not([data-ar-drawer-idle]):not([data-ar-drawer-open]) .ar-explorer-drawer-trigger:not(:focus-visible) svg {
    animation:ar-explorer-arrow-drift 2.9s ease-in-out infinite;
  }
}
html[data-ar-explorer-handheld] .ar-explorer-drawer-trigger:active svg { filter:drop-shadow(0 0 7px #f2ce87ad); }
html[data-ar-explorer-handheld][data-ar-drawer-idle] .ar-explorer-drawer-trigger:not(:focus-visible){opacity:0;pointer-events:none}
html[data-ar-explorer-handheld][data-ar-drawer-open] .ar-explorer-drawer-trigger{opacity:0;pointer-events:none}
html[data-ar-explorer-handheld][data-ar-drawer-open] .ar-explorer-drawer-scrim{
  display:block;position:fixed;z-index:901;inset:var(--ar-scrim-top) auto auto var(--ar-scrim-left);
  height:var(--ar-scrim-height);width:var(--ar-scrim-width);background:#09090d6b;
  border-radius:10px;touch-action:none;
}
html[data-ar-explorer-handheld] .ar-explorer-drawer-bar {
  display:flex;align-items:center;justify-content:flex-end;gap:7px;
  position:sticky;top:-8px;z-index:15;padding-block:4px;
  background:var(--surface,#17191e);
}
html[data-ar-explorer-handheld] .ar-explorer-drawer-close {
  min-width:44px;min-height:44px;padding:5px 10px;border-radius:6px;
  color:var(--text,#fbebd2);background:transparent;border:1px solid var(--line,#8c7252);
  font:600 13px system-ui,sans-serif;
}
html[data-ar-explorer-handheld] :is(.ar-explorer-drawer-close,.ar-explorer-drawer-trigger):focus-visible{outline:2px solid #f2cf80;outline-offset:2px}
@media(prefers-reduced-motion:reduce){
  html[data-ar-explorer-handheld] body .app-shell>#sidebar#sidebar,
  html[data-ar-explorer-handheld] .ar-explorer-drawer-trigger {transition:none!important}
}

@layer ar-explorer-drawer {
html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #workspace #reader-passage-input {
  height:46px!important;max-height:46px!important;min-height:46px!important;
}
html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #workspace #reader-passage-form .passage-open-row{
  grid-template-columns:minmax(0,1fr) auto!important;gap:7px!important;align-items:center!important;
}
html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #workspace #reader-passage-form .passage-open-row button {
  min-height:46px!important; width:auto!important; max-width:100%!important; white-space:normal!important;
  padding-inline:10px!important;
}
}
@layer ar-explorer-drawer {
html[data-ar-explorer-handheld] body #sidebar#sidebar .sidebar-heading {
  padding-top:9px!important;
}
html[data-ar-explorer-handheld] body #sidebar#sidebar .sidebar-heading > #explorer-dashboard {
  grid-column:1/-1!important; min-height:44px!important; margin:0!important; text-align:center;
  border-color:color-mix(in srgb,currentColor 55%,transparent)!important;
}
html[data-ar-explorer-handheld] body #sidebar#sidebar .sidebar-heading > .visit-navigation:has(> #close-all67) {
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}
html[data-ar-explorer-handheld] body #sidebar#sidebar .visit-navigation > #close-all67 {
  min-height:44px!important; min-width:0; margin:0!important;
}
html[data-ar-explorer-handheld] body #sidebar#sidebar .sidebar-heading:has(> #explorer-dashboard) {
  margin-bottom:20px!important; padding-bottom:16px!important;
  border-bottom:1px solid rgba(207,170,103,.32)!important;
}
html[data-ar-explorer-handheld] body #workspace .passage-open-row {
  display:grid!important;
}
}
html[data-ar-explorer-handheld] .ar-explorer-drawer-bar {
  float:none; top:-8px; margin:-8px -16px 8px; padding:5px 12px;
  background:var(--surface,#17191e); border-bottom:1px solid var(--line,#8c7252);
  isolation:isolate; justify-content:space-between; min-height:54px; box-sizing:border-box;
}
html[data-ar-explorer-handheld] .ar-explorer-drawer-bar::before {
  content:"Explorer toolbox"; color:var(--text,#f9edd5); font:600 12px/1.3 system-ui,sans-serif;
  letter-spacing:.055em;
}

/* The Explorer uses a real device viewport, not the site's 980px scaled phone canvas. */
@layer ar-mobile-polish {
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] { --phone-menu-target:44px; --phone-menu-inset:12px; }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] .ar-site-header-inner {
    grid-template-columns:minmax(0,1fr) max-content!important; gap:8px!important; padding-block:7px!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] .ar-site-brand {
    min-height:52px!important; gap:8px!important; flex-wrap:nowrap!important; justify-content:flex-start!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] .ar-site-brand-icon {
    width:44px!important; min-width:44px!important; height:44px!important; flex:0 0 44px!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] .ar-site-brand-copy {
    min-width:0!important; overflow-wrap:normal!important; word-break:normal!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] .ar-site-brand-home:not(.ar-site-brand-title) {
    font-size:clamp(10px,3vw,13px)!important; line-height:1.2!important;
    white-space:normal!important; overflow-wrap:normal!important; word-break:normal!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] .ar-site-brand-title {
    font-size:clamp(15px,4.25vw,22px)!important; line-height:1.16!important;
    white-space:normal!important; overflow-wrap:normal!important; word-break:normal!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] .ar-site-brand-subtitle {
    font-size:10px!important; line-height:1.15!important;
    white-space:normal!important; overflow-wrap:normal!important; word-break:normal!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] #ar-phone-menu > summary {
    min-width:69px!important; width:auto!important; min-height:44px!important; padding-inline:8px!important;
    gap:6px!important; border-radius:8px!important; font-size:14px!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] #ar-phone-menu[open]>.ar-site-nav {
    max-height:calc(100dvh - 90px)!important; width:min(320px,calc(100vw - 24px))!important; padding:6px!important;
  }
  html[data-ar-explorer-handheld]:not([data-ar-explorer-wide-fit]) body #ar-site-header[data-ar-nav-page="explorer"] #ar-phone-menu .ar-site-nav>.ar-site-nav-item {
    min-height:44px!important; font-size:15px!important; padding:7px 10px!important;
  }
}

html[data-ar-explorer-handheld] #sidebar .ar-explorer-drawer-bar {
  --drawer-trim:var(--gold-light,#ddb979);
  background:radial-gradient(ellipse at 17% 4%,#b583492b,transparent 65%),linear-gradient(105deg,#34271a,#17120f 72%,#211911);
  border-bottom:1px solid #aa8051;
  box-shadow:inset 0 1px #e9c18450,0 4px 14px #0a0805a8;
}
html[data-ar-explorer-handheld] #sidebar .ar-explorer-drawer-bar::before {
  display:flex; align-items:center; align-self:stretch; padding-inline-start:17px;
  color:#f4dba8; letter-spacing:.065em;
  font:600 clamp(11px,3vw,14px)/1.18 var(--ar-cinzel,Cinzel,Georgia,serif);
  background:linear-gradient(135deg,#f4d899,#a77a46) left 4px center/6px 6px no-repeat;
  text-shadow:0 0 10px #f1b85c38;
}
html[data-ar-explorer-handheld] #sidebar .ar-explorer-drawer-close {
  display:inline-flex!important; align-items:center; gap:7px; padding:6px 10px!important;
  border:1px solid #f3d7a1!important; border-radius:7px!important;
  background:linear-gradient(175deg,#f0d59d,#c69a59)!important;
  color:#24170d!important; box-shadow:inset 0 1px #fff7d59c,0 2px 8px #0007;
  flex:none;
}
html[data-ar-explorer-handheld] #sidebar .ar-explorer-drawer-close::after {
  content:""; display:block; flex:0 0 10px; height:10px;
  background:linear-gradient(45deg,transparent 43%,currentColor 44% 55%,transparent 56%),
             linear-gradient(-45deg,transparent 43%,currentColor 44% 55%,transparent 56%);
}
html[data-ar-explorer-handheld] #sidebar .ar-explorer-drawer-close:is(:hover,:focus-visible) {
  background:linear-gradient(175deg,#fff0c8,#d5a969)!important;
}
html[data-ar-explorer-handheld] body:is(.ar-cyber,.ar-monochrome,.ar-simple) #sidebar .ar-explorer-drawer-bar {
  background:linear-gradient(110deg,var(--surface,#292929),#151515);
  border-bottom-color:var(--cyber-line,var(--line,#888));
}
html[data-ar-explorer-handheld] body:is(.ar-cyber,.ar-monochrome,.ar-simple) #sidebar .ar-explorer-drawer-bar::before {
  color:var(--cyber-bright,var(--text,#eee)); background:linear-gradient(currentColor,currentColor) left 4px center/6px 6px no-repeat;
  text-shadow:none;
}
html[data-ar-explorer-handheld] body:is(.ar-cyber,.ar-monochrome,.ar-simple) #sidebar .ar-explorer-drawer-close {
  background:linear-gradient(175deg,#f1f0ec,#bab7ae)!important; border-color:#e0e0db!important; color:#171717!important;
}

/* Keep only the drawer at thumb-friendly device size over the fitted reading canvas. */
html[data-ar-explorer-wide-fit] body #sidebar#sidebar .sidebar-heading h1 {font-size:clamp(19px,5vw,24px)!important}
html[data-ar-explorer-wide-fit] body #sidebar#sidebar .sidebar-heading :is(button,.outline-button) {min-height:44px!important; font-size:14px!important; padding:7px 9px!important}
html[data-ar-explorer-wide-fit] body #sidebar#sidebar #study-tree summary {min-height:46px!important; font-size:15px!important}
