/* Page reader detail card: matches the approved centered mockup. */
#story-dialog {
  width: min(420px, calc(100% - 20px));
  max-height: 94dvh;
  padding: 35px 20px 20px;
  border: 1px solid #583067;
  border-radius: 22px;
  background: radial-gradient(ellipse at 50% 20%, #2e153e55, transparent 58%), #140d1d;
}
#story-dialog > .close {
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #30213e;
  color: #f4e9fc;
}
#story-detail { display: block; padding-top: 0; }
#story-dialog .detail-cover {
  display: block;
  width: 140px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  margin: 0 auto 24px;
  border-radius: 14px;
  box-shadow: 0 12px 35px #0005, 0 0 0 1px #ffffff12;
}
#story-dialog .detail-cover[hidden] { display: none; }
#story-dialog .detail-body { padding: 0; }
#story-dialog .detail-body h2 {
  margin: 0 0 10px;
  padding: 0;
  text-align: center;
  font-size: 21px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -.4px;
  overflow-wrap: anywhere;
}
#story-dialog .detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 25px;
  color: #ac9cb9;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}
#story-dialog .detail-chapter {
  padding: 4px 9px;
  border-radius: 7px;
  background: #30203e;
  color: #e5c8f9;
  font-size: 10px;
  font-weight: 600;
}
#story-dialog .detail-meta-dot { color: #685771; }
#story-dialog .story-note {
  text-align: center;
  font-size: 13px;
  overflow-wrap: anywhere;
}
#story-dialog .read-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
}
#story-dialog .read-links .detail-read-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 47px;
  padding: 12px 17px;
  border: 1px solid #a83bd266;
  border-radius: 13px;
  background: linear-gradient(110deg, #8619b2, #6c168e);
  box-shadow: 0 4px 12px #0002;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
  text-align: left;
  text-decoration: none;
}
#story-dialog .detail-read-link::after { content: '↗'; color: #ead5f6; font-size: 16px; }
#story-dialog .detail-read-link .provider-icon { flex: none; width: 26px; height: 26px; border-radius: 7px; font-size: 16px; }
#story-dialog .detail-read-label { flex: 1 1 auto; min-width: 0; text-align: center; }
#story-dialog .detail-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 21px;
  padding-top: 17px;
  border-top: 1px solid #382443;
}
#story-dialog .detail-tools > .secondary {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 10px 6px;
  border: 1px solid #482651;
  border-radius: 10px;
  background: #1d1326;
  color: #ddc9eb;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
  text-decoration: none;
}
#story-dialog .detail-tools > [hidden] { display: none; }
#story-dialog .detail-tools input { flex-basis: 100%; min-width: 0; }
#story-dialog a:focus-visible,
#story-dialog button:focus-visible { outline: 2px solid #e5b4ff; outline-offset: 3px; }

@media (min-width: 768px) {
  #story-dialog {
    width: min(560px, calc(100% - 48px));
    padding: 36px 30px 26px;
  }
  #story-dialog .detail-cover { width: 180px; }
  #story-dialog .detail-body h2 { font-size: 26px; }
  #story-dialog .detail-meta { font-size: 13px; }
  #story-dialog .detail-chapter { font-size: 12px; }
  #story-dialog .story-note { font-size: 14px; }
  #story-dialog .read-links .detail-read-link {
    min-height: 52px;
    padding: 14px 20px;
    font-size: 14px;
  }
  #story-dialog .detail-tools > .secondary { min-height: 44px; font-size: 12px; }
}
