/* v61: preserve accepted nav/canvas states and keep the secondary question selector geometrically symmetric. */

/* --------------------------------------------------------------------------
   Top navigation land
   The rail itself owns the glass. The area behind it must stay transparent.
   Reading progress remains inside .nav-scroll via --v32-progress.
   -------------------------------------------------------------------------- */
.nav-shell,
html[data-theme="light"] .nav-shell,
html[data-theme="dark"] .nav-shell{
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  border:0!important;
  box-shadow:none!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}

.nav-progress-liquid,
.read-progress{
  pointer-events:none!important;
}

/* --------------------------------------------------------------------------
   Safari bottom chrome / page canvas
   Only the browser-facing root stays transparent. The actual app canvas keeps
   the established theme surface so gaps never expose Safari's pure-black base.
   -------------------------------------------------------------------------- */
html,
body,
html[data-theme="light"] body,
html[data-theme="dark"] body{
  background-color:transparent!important;
  background-image:none!important;
}

html[data-theme="dark"] #app,
html[data-theme="dark"] .app{
  background:var(--v36-dark-canvas,#0d0f13)!important;
}
html[data-theme="light"] #app,
html[data-theme="light"] .app{
  background:var(--canvas,#fff)!important;
}

html::before,
html::after,
body::before,
body::after{
  background:transparent!important;
  background-color:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
}

/* --------------------------------------------------------------------------
   Question write/saved selector — secondary hierarchy.

   The rail shares the search field's exact left/right edges. Each destination
   owns one exact 1/2 interaction slot. JS v61 owns the visible pill geometry
   from one coordinate system (the rail padding box) so the two outside gutters
   are exact mirrors. Do not reintroduce margin-left based centering here.
   -------------------------------------------------------------------------- */
#v40QuestionControls{
  display:block!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:9px 0 0!important;
  padding:0!important;
  box-sizing:border-box!important;
}
#v40QuestionControls[hidden]{display:none!important}

#collectionTools>#v40QuestionControls,
#v40QuestionControls .v40-question-segment{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  box-sizing:border-box!important;
}

#v40QuestionControls .v40-question-segment{
  position:relative!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  height:50px!important;
  min-height:50px!important;
  margin:0!important;
  padding:5px!important;
  gap:5px!important;
  border-radius:999px!important;
  overflow:visible!important;
}

#v40QuestionControls .v40-question-segment>button{
  position:relative!important;
  z-index:3!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  justify-self:stretch!important;
  gap:0!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  height:40px!important;
  min-height:40px!important;
  margin:0!important;
  padding:0 10px!important;
  border-radius:999px!important;
  font-size:12.5px!important;
  font-weight:710!important;
  line-height:1!important;
  white-space:nowrap!important;
  text-align:center!important;
}

/* Saved-question count is tertiary metadata. It is removed from flex flow so
   the label stays on the exact center of the 1/2 destination slot. */
#v40QuestionControls .v40-question-segment>button>span{
  position:absolute!important;
  left:calc(50% + 3.75em)!important;
  top:50%!important;
  transform:translate(-50%,-50%)!important;
  display:inline-grid!important;
  place-items:center!important;
  flex:0 0 auto!important;
  min-width:18px!important;
  height:18px!important;
  margin:0!important;
  padding:0 5px!important;
  border:1px solid rgba(79,101,137,.07)!important;
  border-radius:999px!important;
  background:rgba(77,101,143,.07)!important;
  color:#71809a!important;
  box-shadow:none!important;
  font-size:10.5px!important;
  font-weight:780!important;
  line-height:1!important;
  pointer-events:none!important;
}
#v40QuestionControls .v40-question-segment>button.is-active>span{
  border-color:rgba(255,255,255,.12)!important;
  background:rgba(255,255,255,.14)!important;
  color:rgba(255,255,255,.94)!important;
}
html[data-theme="dark"] #v40QuestionControls .v40-question-segment>button:not(.is-active)>span{
  border-color:rgba(137,164,208,.07)!important;
  background:rgba(107,135,181,.08)!important;
  color:#94a7c9!important;
}

/* Fallback dimensions are used only before script-29 v61 measures the rail.
   v61 replaces width and X with inline !important values and mirrors the two
   outside gutters exactly. */
#v40QuestionControls .v36-question-indicator{
  position:absolute!important;
  z-index:2!important;
  top:0!important;
  left:0!important;
  bottom:auto!important;
  width:min(calc((100% - 15px)/2 - 18px),154px)!important;
  min-width:0!important;
  max-width:154px!important;
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  margin-left:0!important;
  border-radius:999px!important;
  overflow:visible!important;
  pointer-events:none!important;
}
#v40QuestionControls .v36-question-indicator>.v37-liquid-skin{
  inset:0!important;
  width:100%!important;
  height:100%!important;
  min-height:100%!important;
  border-radius:inherit!important;
}

/* --------------------------------------------------------------------------
   Question quote / selected sentence
   A one-line placeholder must sit on the visual Y center of the quote field.
   Multiline selected text can grow naturally without changing this alignment.
   -------------------------------------------------------------------------- */
#askQuote,
#askWritePanel .ask-sheet__quote{
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  min-height:56px!important;
  margin:0 0 12px!important;
  padding:11px 15px!important;
  box-sizing:border-box!important;
  font-size:14px!important;
  line-height:1.5!important;
}

@media(max-width:360px){
  #v40QuestionControls .v40-question-segment>button{
    padding-inline:8px!important;
    font-size:12px!important;
  }
  #v40QuestionControls .v40-question-segment>button>span{
    left:calc(50% + 3.7em)!important;
    min-width:17px!important;
    height:17px!important;
    padding-inline:4px!important;
    font-size:10px!important;
  }
  #v40QuestionControls .v36-question-indicator{
    width:min(calc((100% - 15px)/2 - 14px),146px)!important;
    max-width:146px!important;
  }
}
