.library-invite {
  position: fixed;
  z-index: 130;
  left: calc(16px + env(safe-area-inset-left, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid;
  justify-items: end;
  max-width: 23rem;
  margin-left: auto;
  color: #152d3a;
  font: 1rem/1.5 system-ui, sans-serif;
  pointer-events: none;
}

.library-invite [hidden],
.library-invite[hidden],
body.catalog-search-open > .library-invite,
body:has(
  #landing[hidden],
  #public-isbn-panel:not([hidden]),
  .cookie-policy-panel:not([hidden]),
  .institution-login.open,
  dialog[open]
) > .library-invite {
  display: none !important;
}

.library-invite button,
.library-invite a,
.library-invite-panel {
  pointer-events: auto;
}

.library-invite-panel {
  box-sizing: border-box;
  width: 100%;
  max-height: min(85dvh, 37rem);
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 19px;
  border: 1px solid #c9ded8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 40px rgb(21 45 58 / 18%);
}

.library-invite-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.library-invite-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #d5e9e3;
  border-radius: 12px;
  background: #eff8f5;
  color: #176d68;
}

.library-invite svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.library-invite h2 {
  margin: 0;
  color: #152d3a;
  font: 750 clamp(1.25rem, 3vw, 1.4rem)/1.2 system-ui, sans-serif;
  letter-spacing: -.02em;
}

.library-invite p {
  margin: 9px 0 0;
  color: #445965;
  font-size: 1rem;
  line-height: 1.48;
}

.library-invite-actions {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}

.library-invite-button,
.library-invite-close,
.library-invite-launcher {
  box-sizing: border-box;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #c9ded8;
  border-radius: 9px;
  background: #fff;
  color: #135b53;
  font: 700 .875rem/1.25 system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.library-invite-button:hover,
.library-invite-close:hover,
.library-invite-launcher:hover {
  background: #edf7f3;
}

.library-invite-button.primary-invite {
  background: #176d68;
  border-color: #176d68;
  color: #fff;
}

.library-invite-button.primary-invite:hover {
  background: #125a55;
}

.library-invite-close {
  width: 44px;
  padding: 0;
  border-color: transparent;
  color: #445965;
}

.library-invite-close svg,
.library-invite-launcher svg {
  width: 18px;
  height: 18px;
}

.library-invite-launcher {
  border-radius: 999px;
  padding-inline: 13px;
  box-shadow: 0 5px 20px rgb(21 45 58 / 12%);
}

.library-invite :is(a, button, textarea):focus-visible {
  outline: 2px solid #176d68;
  outline-offset: 3px;
}

.library-invite-draft label {
  display: block;
  margin: 12px 0 5px;
  font-size: .875rem;
  font-weight: 650;
}

.library-invite-draft textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 9rem;
  max-height: 15rem;
  padding: 9px;
  border: 1px solid #c9ded8;
  border-radius: 9px;
  background: #f7fbfa;
  color: #152d3a;
  font: .875rem/1.45 system-ui, sans-serif;
  resize: vertical;
}

.library-invite-status:empty {
  display: none;
}

.library-invite .library-invite-status {
  font-size: .875rem;
}

@media (max-width: 400px) {
  .library-invite {
    left: calc(10px + env(safe-area-inset-left, 0px));
    right: calc(10px + env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .library-invite-panel {
    padding: 14px;
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .library-invite:has(.library-invite-panel:not([hidden])) {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .library-invite-panel {
    max-height: min(85dvh, calc(100dvh - 86px - env(safe-area-inset-bottom, 0px)));
  }
}
