.card-share-button {
  position: absolute;
  z-index: 3;
  bottom: 12px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(38, 52, 86, .18);
  border-radius: 50%;
  color: var(--navy);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 20px rgba(38, 52, 86, .2);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.card-share-button:hover,
.card-share-button:focus-visible,
.card-share-button[aria-expanded="true"] {
  outline: 0;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 10px 24px rgba(38, 52, 86, .28);
  transform: translateY(-2px) scale(1.04);
}

.card-share-button:focus-visible {
  outline: 3px solid rgba(53, 104, 168, .28);
  outline-offset: 3px;
}

.share-popover {
  position: fixed;
  z-index: 1200;
  width: min(230px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid rgba(38, 52, 86, .16);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 20px 55px rgba(25, 42, 65, .26);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.share-popover[hidden] { display: none; }

.share-popover-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 2px 5px 7px 9px;
  color: var(--navy);
}

.share-popover-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-popover-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--navy);
  background: var(--sky);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.share-popover-close:hover,
.share-popover-close:focus-visible {
  outline: 2px solid rgba(53, 104, 168, .24);
  background: var(--pink-light);
}

.share-options {
  display: grid;
  gap: 5px;
}

.share-option {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 43px;
  padding: 8px 11px;
  border: 0;
  border-radius: 11px;
  color: var(--navy);
  background: #f5f8fa;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.share-option:hover,
.share-option:focus-visible {
  outline: 0;
  background: var(--sky);
}

.share-option svg { flex: 0 0 auto; }

.share-option[data-share-action="ncrc"] {
  border: 1px solid rgba(53, 104, 168, .18);
  background: #edf5f9;
}

.share-popover:lang(zh) [data-share-label="ncrc"] {
  min-width: 0;
  word-break: normal;
}

.share-option[data-share-action="ncrc"]:hover,
.share-option[data-share-action="ncrc"]:focus-visible { background: var(--sky); }

.share-option[data-share-action="kakao"] {
  color: #191919;
  background: #fee500;
}

.share-option[data-share-action="kakao"]:hover,
.share-option[data-share-action="kakao"]:focus-visible { background: #f6dc00; }

.email-share-modal {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 31, 38, .58);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.email-share-modal[hidden] { display: none; }

.email-share-panel {
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid rgba(38, 52, 86, .16);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(20, 27, 36, .36);
}

.email-share-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  background: #f7fbfd;
}

.email-share-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: var(--navy);
  background: var(--pink-light);
}

.email-share-title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
}

.email-share-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--navy);
  background: var(--sky);
  font-size: 21px;
  cursor: pointer;
}

.email-share-close:hover,
.email-share-close:focus-visible {
  outline: 2px solid rgba(53, 104, 168, .25);
  background: var(--pink-light);
}

.email-share-form { padding: 19px; }

.email-share-field { margin-bottom: 14px; }

.email-share-field label {
  display: block;
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.email-share-field input,
.email-share-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #f9fbfc;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.email-share-field input {
  min-height: 46px;
  padding: 0 13px;
}

.email-share-field textarea {
  min-height: 145px;
  padding: 11px 13px;
  resize: vertical;
}

.email-share-field input:focus,
.email-share-field textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(53, 104, 168, .11);
}

.email-share-hint {
  margin: -3px 0 15px;
  color: var(--muted);
  font-size: 11px;
}

.email-share-actions {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 9px;
  margin-top: 18px;
}

.email-share-action {
  min-height: 46px;
  padding: 9px 13px;
  border: 0;
  border-radius: 12px;
  color: var(--navy);
  background: #eef2f4;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.email-share-action.primary {
  color: #fff;
  background: var(--navy);
}

.email-share-action:hover,
.email-share-action:focus-visible {
  outline: 3px solid rgba(53, 104, 168, .18);
  outline-offset: 2px;
  filter: brightness(1.04);
}

.share-toast {
  position: fixed;
  z-index: 1300;
  right: 20px;
  bottom: 20px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 12px 17px;
  border-radius: 13px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 10px 30px rgba(25, 42, 65, .26);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}

.share-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* Retain the original PDF links when JavaScript is unavailable. */
.language-card.has-share-menu .pdf-download { display: none; }
.share-popover { max-height: calc(100dvh - 24px); overflow-y: auto; }
.share-option[data-share-action="download"] {
  margin-top: 5px;
  border-top: 1px solid var(--line);
  color: #fff;
  background: var(--blue);
}
.share-option[data-share-action="download"]:hover,
.share-option[data-share-action="download"]:focus-visible { background: var(--blue-dark); }
.share-option:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.email-share-field textarea { font: inherit; }
