:root{
  --eb-modal-z: 2200;
  --eb-modal-backdrop: rgba(0,0,0,.55);
  --eb-modal-radius: 10px;
  --eb-modal-shadow: 0 10px 40px rgba(0,0,0,.3);
}

.eb-modal{
  position: fixed;
  inset: 0;
  z-index: var(--eb-modal-z);
  display: none;
}

.eb-modal.is-open{
  display: block;
}

.eb-modal__backdrop{
  position: absolute;
  inset: 0;
  background: var(--eb-modal-backdrop);
}

.eb-modal__dialog{
  position: relative;
  max-width: 760px;
  margin: 10vh auto;
  background: #fff;
  border-radius: var(--eb-modal-radius);
  overflow: hidden;
  box-shadow: var(--eb-modal-shadow);
}

@media (max-width: 768px){
  .eb-modal__dialog{
    max-width: calc(100% - 24px);
    margin: 6vh auto;
  }
}

.eb-modal__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.eb-modal__title{
  font-weight: 600;
}

.eb-modal__body{
  padding: 12px;
}

.eb-modal__input{
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.2;
}

.eb-modal__input:focus{
  outline: none;
  border-color: rgba(13,110,253,.75);
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

.eb-modal__footer{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.eb-modal__btn{
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.eb-modal__btn:hover{
  background: rgba(0,0,0,.03);
}

.eb-modal__btn.primary{
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.eb-modal__btn.primary:hover{
  background: #0b5ed7;
}

.eb-modal__btn.danger{
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

.eb-modal__btn.danger:hover{
  background: #bb2d3b;
}

.eb-modal__btn.close{
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

.eb-modal__dialog--help{
  width: min(92vw, 1200px);
  max-width: min(92vw, 1200px);
  margin: 4vh auto;
}

.eb-modal__body--help{
  padding: 0;
  max-height: 72vh;
  overflow: auto;
}

.eb-modal__footer--help{
  padding-top: 8px;
}

.eb-help-modal{
  background: #f7f9fc;
}

.eb-help-modal__readerbar{
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(0,0,0,.08);
  backdrop-filter: blur(8px);
}

.eb-help-modal__readerbar-main{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eb-help-modal__readerbar-actions{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.eb-help-modal__title-btn,
.eb-help-modal__menu-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--eb-primary);
  padding: 0;
  font-weight: 600;
  cursor: pointer;
}

.eb-help-modal__menu-btn{
  color: #6b7a90;
  font-weight: 500;
}

.eb-help-modal__title-btn:hover,
.eb-help-modal__menu-btn:hover{
  text-decoration: underline;
}

.eb-help-modal__pager{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.eb-help-modal__pager-btn{
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  background: #fff;
  color: #4e6179;
  cursor: pointer;
}

.eb-help-modal__pager-btn:hover{
  background: #f3f6fa;
  border-color: rgba(0,0,0,.2);
}

.eb-help-modal__open-link{
  white-space: nowrap;
}

.eb-help-modal__breadcrumb{
  padding: 10px 20px 0;
  background: #fff;
}

.eb-help-modal__breadcrumb ol{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eb-help-modal__breadcrumb li{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5f6f84;
  font-size: 13px;
}

.eb-help-modal__breadcrumb li:not(:last-child)::after{
  content: "/";
  color: #a4afbf;
}

.eb-help-modal__breadcrumb a{
  color: var(--eb-primary);
  text-decoration: none;
}

.eb-help-modal__breadcrumb a:hover{
  text-decoration: underline;
}

.eb-help-modal__content{
  padding: 24px 28px 12px;
  background: #fff;
}

.eb-help-modal__content--toc{
  padding-top: 18px;
}

.eb-help-modal__content--toc .handbook-toc{
  max-width: 880px;
}

.eb-help-modal__content--toc .handbook-toc ul{
  margin-bottom: 0;
}

.eb-help-modal__content > *:first-child{
  margin-top: 0;
}

.eb-help-modal__content > *:last-child{
  margin-bottom: 0;
}

.eb-help-modal__footer-nav{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 28px 24px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,.06);
}

.eb-help-modal__nav-btn{
  min-width: 220px;
}

.eb-help-modal__nav-spacer{
  display: block;
  min-width: 220px;
}

@media (max-width: 768px){
  .eb-modal__dialog--help{
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    margin: 2vh auto;
  }

  .eb-modal__body--help{
    max-height: 78vh;
  }

  .eb-help-modal__readerbar{
    flex-direction: column;
    align-items: stretch;
    padding: 14px 14px 12px;
  }

  .eb-help-modal__readerbar-main{
    align-items: flex-start;
  }

  .eb-help-modal__readerbar-actions{
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .eb-help-modal__readerbar-actions .eb-btn{
    width: auto;
  }

  .eb-help-modal__breadcrumb{
    padding: 10px 14px 0;
  }

  .eb-help-modal__content{
    padding: 16px 14px 10px;
  }

  .eb-help-modal__footer-nav{
    flex-direction: column;
    padding: 14px;
  }

  .eb-help-modal__nav-btn,
  .eb-help-modal__nav-spacer{
    min-width: 0;
    width: 100%;
  }
}
