/* V15.1 – audio low-latency + assistant layout stabilization */
#aea5-app.ada151-reader .aea5-angel{
  width:min(760px,calc(100vw - 28px))!important;
  max-width:760px!important;
  max-height:calc(100dvh - var(--aea-adminbar,0px) - 28px)!important;
  height:auto!important;
  padding:22px!important;
  overflow:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  container-type:inline-size;
}
#aea5-app.ada151-reader .aea5-angel *,
#aea5-app.ada151-reader .aea5-angel *::before,
#aea5-app.ada151-reader .aea5-angel *::after{box-sizing:border-box!important;min-width:0!important}
#aea5-app.ada151-reader .aea5-angel-head{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 48px!important;
  gap:14px!important;
  align-items:start!important;
  position:static!important;
}
#aea5-app.ada151-reader .aea5-angel-head>div{min-width:0!important}
#aea5-app.ada151-reader .aea5-angel-head>button{
  position:sticky!important;top:0!important;right:auto!important;
  width:46px!important;height:46px!important;min-height:46px!important;
  align-self:start!important;z-index:3!important
}
#aea5-app.ada151-reader .aea5-angel-head h2{
  font-size:clamp(32px,4cqi,44px)!important;
  line-height:1.05!important;
  margin:2px 0 10px!important;
  max-width:18ch!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
#aea5-app.ada151-reader .aea5-angel-head p{
  margin:0!important;
  font-size:16.5px!important;
  line-height:1.6!important;
  max-width:62ch!important;
  white-space:normal!important;
}

/* Main choices: always one clear row per action to avoid crowded copy. */
#aea5-app.ada151-reader .ada13-start,
#aea5-app.ada151-reader .aea5-angel-grid,
#aea5-app.ada151-reader .ada7-tour-picker>div{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:10px!important;
  width:100%!important;
}
#aea5-app.ada151-reader .ada13-start{margin-top:16px!important}
#aea5-app.ada151-reader .ada13-start>button,
#aea5-app.ada151-reader .aea5-angel-grid button,
#aea5-app.ada151-reader .ada7-tour-picker button{
  display:grid!important;
  grid-template-columns:48px minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  column-gap:14px!important;
  row-gap:3px!important;
  align-items:start!important;
  align-content:center!important;
  width:100%!important;
  min-height:84px!important;
  height:auto!important;
  max-height:none!important;
  padding:15px 16px!important;
  text-align:left!important;
  white-space:normal!important;
  overflow:visible!important;
  border-radius:16px!important;
}
#aea5-app.ada151-reader .ada13-start>button>span:first-child,
#aea5-app.ada151-reader .aea5-angel-grid button>span:first-child{
  grid-column:1!important;grid-row:1 / span 2!important;
  width:42px!important;height:42px!important;
  display:grid!important;place-items:center!important;
  align-self:start!important;
  border-radius:12px!important;
  background:rgba(218,233,238,.72)!important;
  font-size:18px!important;line-height:1!important;
}
#aea5-app.ada151-reader .ada13-start>button>strong,
#aea5-app.ada151-reader .aea5-angel-grid button>strong,
#aea5-app.ada151-reader .ada7-tour-picker button>strong{
  grid-column:2!important;grid-row:1!important;
  display:block!important;
  margin:0!important;
  width:auto!important;
  max-width:none!important;
  font-size:17px!important;
  line-height:1.28!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}
#aea5-app.ada151-reader .ada13-start>button>small,
#aea5-app.ada151-reader .aea5-angel-grid button>small,
#aea5-app.ada151-reader .ada7-tour-picker button>small{
  grid-column:2!important;grid-row:2!important;
  display:block!important;
  margin:0!important;
  width:auto!important;
  max-width:none!important;
  font-size:14.5px!important;
  line-height:1.48!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}
#aea5-app.ada151-reader .ada7-tour-picker button>strong,
#aea5-app.ada151-reader .ada7-tour-picker button>small{grid-column:1 / -1!important}

#aea5-app.ada151-reader .ada13-orientation,
#aea5-app.ada151-reader .ada148-reader,
#aea5-app.ada151-reader .ada149-reader-location,
#aea5-app.ada151-reader .ada131-speech-progress,
#aea5-app.ada151-reader .ada132-voice-note,
#aea5-app.ada151-reader .ada132-voice-command-status{
  width:100%!important;
  max-width:none!important;
  height:auto!important;
  min-height:0!important;
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
}
#aea5-app.ada151-reader .ada13-orientation p,
#aea5-app.ada151-reader .ada148-reader strong,
#aea5-app.ada151-reader .ada148-reader small,
#aea5-app.ada151-reader .ada149-reader-location strong,
#aea5-app.ada151-reader .ada149-reader-location small{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}

/* Details section becomes a stable vertical flow. */
#aea5-app.ada151-reader .ada13-more{display:block!important;width:100%!important;margin-top:12px!important}
#aea5-app.ada151-reader .ada13-more>summary{
  display:flex!important;align-items:center!important;min-height:50px!important;
  font-size:16px!important;line-height:1.2!important;padding:10px 0!important;
}
#aea5-app.ada151-reader .ada8-angel-layout{
  display:block!important;width:100%!important;max-width:none!important;overflow:visible!important
}
#aea5-app.ada151-reader .ada8-angel-layout>section{
  display:block!important;position:static!important;width:100%!important;max-width:none!important;
  margin:0!important;padding:18px 0!important;overflow:visible!important
}
#aea5-app.ada151-reader .ada8-angel-layout>section h3{
  margin:0 0 12px!important;font-size:23px!important;line-height:1.15!important
}
#aea5-app.ada151-reader .ada8-line-focus-controls{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important
}
#aea5-app.ada151-reader .ada8-line-focus-controls button,
#aea5-app.ada151-reader .ada7-speech-actions button{
  min-height:48px!important;height:auto!important;padding:10px 12px!important;
  font-size:15px!important;line-height:1.25!important;white-space:normal!important
}
#aea5-app.ada151-reader .ada8-page-tone,
#aea5-app.ada151-reader .ada7-voice-controls,
#aea5-app.ada151-reader .ada7-voice-controls label{
  display:grid!important;grid-template-columns:1fr!important;gap:8px!important;width:100%!important
}
#aea5-app.ada151-reader .ada7-voice-controls{gap:12px!important}
#aea5-app.ada151-reader .ada8-page-tone select,
#aea5-app.ada151-reader .ada7-voice-controls select{
  width:100%!important;min-width:0!important;height:50px!important;min-height:50px!important;
  font-size:15px!important;padding:0 12px!important
}
#aea5-app.ada151-reader .ada8-provider-status{font-size:14px!important;line-height:1.5!important;white-space:normal!important}
#aea5-app.ada151-reader .aea5-live{font-size:14px!important;line-height:1.45!important;min-height:20px!important}

/* Hide stale tour controls unless truly active. */
#aea5-app.ada151-reader .ada7-tour-controls[hidden]{display:none!important}
#aea5-app.ada151-reader .ada7-tour-controls:not([hidden]){
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important;
  position:sticky!important;bottom:0!important;background:rgba(255,250,244,.97)!important;padding:10px 0 0!important;z-index:4!important
}
#aea5-app.ada151-reader .ada7-tour-controls button{min-height:48px!important;font-size:15px!important}
#aea5-app.ada151-reader .ada7-tour-controls [data-aea-tour-status]{grid-column:1 / -1!important}

/* Audio status: communicate warmup instead of looking frozen. */
#aea5-app.ada151-reader .ada151-audio-ready{color:#496d63!important;font-weight:700!important}

@container (max-width:560px){
  #aea5-app.ada151-reader .aea5-angel-head h2{font-size:34px!important}
  #aea5-app.ada151-reader .ada13-start>button,
  #aea5-app.ada151-reader .aea5-angel-grid button{grid-template-columns:42px minmax(0,1fr)!important;padding:14px!important}
}
@media(max-width:640px){
  #aea5-app.ada151-reader .aea5-angel{
    left:6px!important;right:6px!important;bottom:6px!important;top:auto!important;
    width:auto!important;max-width:none!important;max-height:calc(100dvh - var(--aea-adminbar,0px) - 12px)!important;
    padding:14px!important;border-radius:18px!important
  }
  #aea5-app.ada151-reader .aea5-angel-head{grid-template-columns:minmax(0,1fr) 44px!important;gap:10px!important}
  #aea5-app.ada151-reader .aea5-angel-head h2{font-size:31px!important;max-width:none!important}
  #aea5-app.ada151-reader .aea5-angel-head p{font-size:16px!important}
  #aea5-app.ada151-reader .ada13-start>button,
  #aea5-app.ada151-reader .aea5-angel-grid button{
    grid-template-columns:40px minmax(0,1fr)!important;column-gap:10px!important;padding:13px!important;min-height:78px!important
  }
  #aea5-app.ada151-reader .ada13-start>button>span:first-child,
  #aea5-app.ada151-reader .aea5-angel-grid button>span:first-child{width:38px!important;height:38px!important}
  #aea5-app.ada151-reader .ada13-start>button>strong,
  #aea5-app.ada151-reader .aea5-angel-grid button>strong{font-size:16px!important}
  #aea5-app.ada151-reader .ada13-start>button>small,
  #aea5-app.ada151-reader .aea5-angel-grid button>small{font-size:14px!important}
}
@media(max-width:380px){
  #aea5-app.ada151-reader .ada8-line-focus-controls{grid-template-columns:1fr!important}
  #aea5-app.ada151-reader .ada7-tour-controls:not([hidden]){grid-template-columns:1fr!important}
}
