.ebook-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem 1rem;
  padding: .5rem 1rem;
  background: #d9fc74;
  color: #101110;
  font-size: .875rem;
  text-align: center;
}

.ebook-open {
  min-height: 44px;
  padding: 0 .85rem;
  border: 0;
  border-radius: 4px;
  background: #101110;
  color: #f3f4eb;
  font-weight: 700;
}

.ebook-open:hover { background: #30332d; }

.ebook-open:focus-visible {
  outline-color: #101110;
  outline-offset: 2px;
}

.ebook-dialog {
  width: min(420px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: clamp(18px, 5vw, 28px);
  border: 1px solid #464c3d;
  border-radius: 12px;
  background: #171917;
  color: #f3f4eb;
}

.ebook-dialog::backdrop { background: rgb(0 0 0 / 72%); }
.ebook-dialog h2 { font-size: clamp(1.65rem, 6vw, 2.2rem); margin-block: .35rem; }
.ebook-kicker { color: #d9fc74; font-size: .75rem; font-weight: 700; }
.ebook-description { color: #c2c6b9; font-size: .9rem; }
.ebook-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
}

#ebook-form { display: grid; gap: .65rem; margin-top: 1rem; }
#ebook-form label { display: grid; gap: .2rem; font-size: .875rem; }
#ebook-form input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: .4rem .6rem;
  border: 1px solid #646a5b;
  border-radius: 4px;
  background: #101110;
  color: inherit;
  font-size: 1rem;
}

.ebook-note { color: #c2c6b9; font-size: .78rem; }
.ebook-note a { text-decoration: underline; }
.ebook-status { font-size: .875rem; }
.ebook-status:not(:empty) { margin-top: .65rem; }
.ebook-action {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: .4rem .8rem;
  border: 0;
  border-radius: 4px;
  background: #d9fc74;
  color: #101110;
  font-size: .9rem;
  font-weight: 700;
}

.ebook-action:hover { background: #e6ffa3; color: #101110; }
.ebook-action:disabled { cursor: wait; opacity: .7; }
#ebook-download { margin-top: .75rem; }

@media (max-width: 380px) {
  .ebook-bar { column-gap: .35rem; font-size: .75rem; }
}
