/* Novera Reader v0.1.7 — folga inferior mobile sem criar vão antes das reações */
@media (max-width:720px){
  body.novera-chapter{padding-bottom:calc(156px + env(safe-area-inset-bottom,0px))!important;scroll-padding-bottom:calc(156px + env(safe-area-inset-bottom,0px))!important}
  body.novera-chapter #chapter-content{padding-bottom:0!important;scroll-padding-bottom:136px!important}
  body.novera-chapter .chapter-content,
  body.novera-chapter .chapter__content,
  body.novera-chapter .chapter-formatting{scroll-padding-bottom:136px!important}

  /* Os módulos continuam ativos, mas suas barras flutuantes próprias somem no mobile. */
  #novera-read-aloud.nra-shell,
  #nvpwa-tools.nvpwa-tools,
  .nvc-reader-bar{display:none!important}

  .nvr-mobile-reader{
    display:block!important;
    position:fixed;
    z-index:10040;
    left:8px;
    right:8px;
    bottom:max(8px,env(safe-area-inset-bottom,0px));
    max-width:560px;
    margin-inline:auto;
    font-family:inherit;
  }
  .nvr-mobile-reader[hidden]{display:none!important}

  .nvr-mobile-dock{
    min-height:54px;
    display:flex;
    align-items:stretch;
    overflow:hidden;
    border:1px solid color-mix(in srgb,currentColor 18%,transparent);
    border-radius:12px;
    background:color-mix(in srgb,#182334 96%,transparent);
    color:#dce5f3;
    box-shadow:0 10px 26px rgba(0,0,0,.20);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }
  .nvr-dock-idle,.nvr-dock-playing{
    flex:1;
    min-width:0;
    display:flex;
    align-items:stretch;
  }
  .nvr-dock-idle[hidden],.nvr-dock-playing[hidden]{display:none!important}

  .nvr-dock-item,.nvr-dock-iconbtn,.nvr-dock-speed{
    appearance:none;
    -webkit-appearance:none;
    border:0;
    border-left:1px solid rgba(135,155,185,.18);
    background:transparent;
    color:inherit;
    font:inherit;
    cursor:pointer;
    min-width:0;
    min-height:54px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    padding:6px 8px;
    line-height:1;
  }
  .nvr-mobile-dock>button:first-child{border-left:0}
  .nvr-dock-offline{width:68px;flex:0 0 68px}
  .nvr-dock-idle .nvr-dock-item{flex:1}
  .nvr-dock-icon{font-size:16px;line-height:1}
  .nvr-dock-label{font-size:9px;font-weight:750;letter-spacing:.01em;white-space:nowrap}
  .nvr-aa{font-size:14px;font-weight:800}

  .nvr-dock-listen{
    background:#347cff!important;
    color:#fff!important;
  }
  .nvr-dock-playing .nvr-dock-listen{flex:1.25}
  .nvr-dock-iconbtn,.nvr-dock-speed{
    flex:0 0 44px;
    width:44px;
    font-size:15px;
    font-weight:750;
    flex-direction:row;
    padding:0;
  }
  .nvr-dock-speed{font-size:11px}

  .nvr-mobile-settings{
    position:absolute;
    left:0;
    right:0;
    bottom:calc(100% + 8px);
    padding:10px;
    max-height:calc(100dvh - 94px);
    overflow:auto;
    border:1px solid rgba(135,155,185,.25);
    border-radius:12px;
    background:#182334;
    color:#dce5f3;
    box-shadow:0 12px 30px rgba(0,0,0,.24);
  }
  .nvr-mobile-settings[hidden]{display:none!important}
  .nvr-mobile-settings__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
  .nvr-mobile-settings__head strong{font-size:11px;letter-spacing:.02em}
  .nvr-mobile-settings__close{
    width:28px;height:28px;border:1px solid rgba(135,155,185,.25);border-radius:8px;background:#1d2a3c;color:#dce5f3;font-size:18px;line-height:1;cursor:pointer
  }
  .nvr-mobile-field{display:grid;gap:4px;margin-bottom:7px}
  .nvr-mobile-field>span{font-size:9px;font-weight:750;color:#aebbd0}
  .nvr-mobile-field select{
    width:100%;height:36px;border:1px solid rgba(135,155,185,.28);border-radius:8px;background:#1b293b;color:#eef4ff;padding:0 10px;font:inherit;font-size:10px;font-weight:650
  }
  .nvr-mobile-auto{
    min-height:38px;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;padding:0 10px;margin-bottom:7px;border:1px solid rgba(135,155,185,.24);border-radius:8px;background:#1b293b
  }
  .nvr-mobile-auto>span:first-child{font-size:9px;font-weight:700;color:#c0cada}
  .nvr-mobile-auto input{position:absolute;opacity:0;pointer-events:none}
  .nvr-switch{width:32px;height:18px;border-radius:999px;background:#718096;position:relative;transition:.18s ease}
  .nvr-switch:after{content:"";position:absolute;width:14px;height:14px;border-radius:50%;background:#fff;left:2px;top:2px;transition:.18s ease}
  .nvr-mobile-auto input:checked + .nvr-switch{background:#347cff}
  .nvr-mobile-auto input:checked + .nvr-switch:after{transform:translateX(14px)}
  .nvr-mobile-wide{
    width:100%;min-height:36px;border:1px solid rgba(135,155,185,.28);border-radius:8px;background:#1b293b;color:#eef4ff;font:inherit;font-size:9px;font-weight:750;cursor:pointer
  }
  .nvr-mobile-wide--reader{
    margin-top:7px;border-color:rgba(52,124,255,.48);background:rgba(52,124,255,.10);color:#f4f8ff
  }
  .nvr-mobile-wide--reader:active{background:rgba(52,124,255,.18)}

  /* Mantém o botão de download do capítulo no cabeçalho; só o launcher da biblioteca entra no dock. */
  .nvpwa-chapter-action{display:flex!important}

  :root[data-mode="light"] .nvr-mobile-dock,
  html[data-theme="light"] .nvr-mobile-dock,
  body.light .nvr-mobile-dock,
  :root[data-mode="light"] .nvr-mobile-settings,
  html[data-theme="light"] .nvr-mobile-settings,
  body.light .nvr-mobile-settings{
    background:rgba(255,255,255,.97);color:#1f2b3d;border-color:#d5deea;box-shadow:0 12px 32px rgba(24,39,75,.14)
  }
  :root[data-mode="light"] .nvr-mobile-field select,
  :root[data-mode="light"] .nvr-mobile-auto,
  :root[data-mode="light"] .nvr-mobile-wide,
  :root[data-mode="light"] .nvr-mobile-settings__close{
    background:#f5f8fc;color:#1f2b3d;border-color:#d5deea
  }
}

@media (max-width:380px){
  .nvr-mobile-reader{left:5px;right:5px}
  .nvr-dock-offline{width:58px;flex-basis:58px}
  .nvr-dock-label{font-size:8px}
  .nvr-dock-iconbtn,.nvr-dock-speed{width:39px;flex-basis:39px}
}

@media (min-width:721px){.nvr-mobile-reader{display:none!important}}
