.article-share-is-open { overflow: hidden; }

.article-share-layer {
  position: fixed;
  z-index: 10010;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .18s ease;
}

.article-share-layer[hidden] { display: none !important; }
.article-share-layer.is-visible { opacity: 1; }

.article-share-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(18, 22, 29, .28);
  cursor: default;
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  backdrop-filter: blur(14px) saturate(115%);
}

.article-share-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(820px, calc(100svh - 48px));
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(25, 31, 41, .09);
  border-radius: 30px;
  background: rgba(249, 250, 252, .94);
  box-shadow: 0 32px 100px rgba(16, 23, 35, .2);
  color: #17191d;
  transform: translateY(14px) scale(.985);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1);
  -webkit-backdrop-filter: blur(32px) saturate(135%);
  backdrop-filter: blur(32px) saturate(135%);
}

.article-share-layer.is-visible .article-share-dialog { transform: none; }
.article-share-handle { display: none; }

.article-share-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.article-share-dialog > header p {
  margin: 2px 0 8px;
  color: #1769e0;
  font-size: 10px;
  font-weight: 820;
  letter-spacing: .16em;
}

.article-share-dialog > header h2 { margin: 0; font-size: 30px; line-height: 1.05; letter-spacing: -.045em; }

.article-share-close {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  flex: 0 0 42px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e9ebef;
  color: #343842;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.article-share-preview {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  min-height: 154px;
  overflow: hidden;
  border: 1px solid rgba(23, 29, 38, .08);
  border-radius: 23px;
  background: #fff;
}

.article-share-preview-art {
  display: grid;
  align-content: space-between;
  min-height: 154px;
  padding: 18px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.78), transparent 30%),
    linear-gradient(145deg, #9ed7ff, #eaf2fb 60%, #c4e6de);
  background-position: center;
  background-size: cover;
  color: rgba(23, 31, 45, .72);
}

.article-share-preview-art.has-cover { color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.28); }
.article-share-preview-art span { font-size: 9px; font-weight: 820; letter-spacing: .15em; }
.article-share-preview-art strong { font-size: 54px; line-height: .8; }

.article-share-preview > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 22px 24px;
}

.article-share-preview small { color: #747b86; font-size: 9px; font-weight: 760; letter-spacing: .1em; }
.article-share-preview h3 { display: -webkit-box; overflow: hidden; margin: 10px 0 13px; font-size: 22px; line-height: 1.18; letter-spacing: -.035em; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.article-share-preview p { overflow: hidden; margin: 0; color: #858b95; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.article-share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.article-share-actions > button {
  display: grid;
  min-height: 86px;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(24, 30, 39, .075);
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
  color: #1e2229;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.article-share-actions > button:hover { border-color: rgba(23,105,224,.18); background: #fff; transform: translateY(-1px); }
.article-share-actions > button:disabled { cursor: wait; opacity: .55; }
.article-share-actions > button > [data-icon],
.article-share-action-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 14px;
  background: #e9f2ff;
  color: #1769e0;
}

.article-share-actions > button > [data-icon] svg { width: 19px; height: 19px; }
.article-share-action-symbol { font-size: 23px; font-weight: 500; }
.article-share-actions strong { align-self: end; font-size: 13px; }
.article-share-actions small { align-self: start; overflow: hidden; margin-top: 3px; color: #7a818c; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.article-share-qr-panel {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  margin-top: 14px;
  padding: 18px;
  border-radius: 20px;
  background: #e9ebef;
}

.article-share-qr-panel[hidden] { display: none !important; }
.article-share-qr-panel [data-share-qr-canvas] { display: grid; min-height: 180px; place-items: center; overflow: hidden; border-radius: 16px; background: #fff; }
.article-share-qr-panel canvas { display: block; width: 180px; height: 180px; }
.article-share-qr-panel strong { display: block; font-size: 16px; }
.article-share-qr-panel p { max-width: 340px; margin: 8px 0 15px; color: #6d747f; font-size: 11px; line-height: 1.55; }
.article-share-qr-panel button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; background: #17191d; color: #fff; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; }
.article-share-qr-loading { color: #747b86; font-size: 11px; }
.article-share-status { min-height: 17px; margin: 11px 2px 0; color: #a03c3c; font-size: 11px; text-align: center; }

.article-share-toast {
  position: fixed;
  z-index: 10020;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  max-width: min(88vw, 420px);
  padding: 11px 17px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(20, 24, 31, .84);
  box-shadow: 0 14px 40px rgba(15, 23, 42, .2);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s ease, transform .2s ease;
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

.article-share-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.article-share-toast[data-tone="error"] { background: rgba(143, 35, 35, .9); }

:root[data-theme="dark"] .article-share-dialog { border-color: rgba(255,255,255,.09); background: rgba(24, 26, 31, .96); color: #f2f4f7; box-shadow: 0 34px 110px rgba(0,0,0,.55); }
:root[data-theme="dark"] .article-share-close,
:root[data-theme="dark"] .article-share-qr-panel { background: #2b2e34; color: #edf0f4; }
:root[data-theme="dark"] .article-share-preview { border-color: rgba(255,255,255,.08); background: #1e2025; }
:root[data-theme="dark"] .article-share-preview small,
:root[data-theme="dark"] .article-share-preview p,
:root[data-theme="dark"] .article-share-actions small,
:root[data-theme="dark"] .article-share-qr-panel p { color: #9da3ad; }
:root[data-theme="dark"] .article-share-actions > button { border-color: rgba(255,255,255,.075); background: rgba(255,255,255,.045); color: #f2f4f7; }
:root[data-theme="dark"] .article-share-actions > button:hover { border-color: rgba(93,166,255,.2); background: rgba(255,255,255,.075); }
:root[data-theme="dark"] .article-share-actions > button > [data-icon],
:root[data-theme="dark"] .article-share-action-symbol { background: rgba(62, 135, 229, .16); color: #78b3ff; }
:root[data-theme="dark"] .article-share-qr-panel button { background: #f3f4f6; color: #17191d; }

@media (max-width: 640px) {
  .article-share-layer { align-items: end; padding: 0; }
  .article-share-dialog { width: 100%; max-height: min(88svh, 820px); padding: 12px 16px max(18px, env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; transform: translateY(24px); }
  .article-share-handle { display: block; width: 38px; height: 4px; margin: 0 auto 15px; border-radius: 999px; background: rgba(95,101,112,.32); }
  .article-share-dialog > header { margin-bottom: 16px; }
  .article-share-dialog > header h2 { font-size: 26px; }
  .article-share-preview { grid-template-columns: 108px minmax(0, 1fr); min-height: 122px; }
  .article-share-preview-art { min-height: 122px; padding: 14px; }
  .article-share-preview-art strong { font-size: 42px; }
  .article-share-preview > div:last-child { padding: 17px; }
  .article-share-preview h3 { margin-block: 7px 9px; font-size: 18px; }
  .article-share-actions > button { min-height: 78px; grid-template-columns: 38px minmax(0, 1fr); padding: 11px 12px; }
  .article-share-actions > button > [data-icon], .article-share-action-symbol { width: 38px; height: 38px; border-radius: 12px; }
  .article-share-qr-panel { grid-template-columns: 136px minmax(0, 1fr); gap: 14px; padding: 13px; }
  .article-share-qr-panel [data-share-qr-canvas] { min-height: 136px; }
  .article-share-qr-panel canvas { width: 136px; height: 136px; }
}

@media (max-width: 420px) {
  .article-share-actions { grid-template-columns: 1fr; }
  .article-share-actions > button { min-height: 68px; }
  .article-share-qr-panel { grid-template-columns: 1fr; text-align: center; }
  .article-share-qr-panel [data-share-qr-canvas] { width: 160px; min-height: 160px; margin: auto; }
  .article-share-qr-panel canvas { width: 160px; height: 160px; }
  .article-share-qr-panel p { margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .article-share-layer,
  .article-share-dialog,
  .article-share-actions > button,
  .article-share-toast { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .article-share-backdrop { background: rgba(18,22,29,.62); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .article-share-dialog { background: #f7f8fa; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .article-share-toast { background: #1c2028; -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root[data-theme="dark"] .article-share-dialog { background: #191b20; }
}
