/* The reader login dialog is shared by site headers, article gates and direct login URLs. */
html:has(#cs-login-dialog[open]) { overflow: hidden; }
#cs-login-dialog.reader-auth {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(440px, calc(100% - 32px));
  max-width: none;
  height: fit-content;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 16px 20px 32px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #242529;
  font: 400 14px/1.45 Pretendard, "Malgun Gothic", sans-serif;
  text-align: center;
  box-shadow: 0 16px 55px #1519222b;
}
#cs-login-dialog::backdrop { background: rgb(20 22 28 / 48%); }
#cs-login-dialog [hidden], .reader-auth-page [hidden] { display: none !important; }
#cs-login-dialog *, #cs-login-dialog *::after { box-sizing: border-box; }
#cs-login-dialog .reader-auth-handle { height: 4px; }
#cs-login-dialog .reader-auth-close {
  display: block; width: 38px; height: 44px; margin: 0 0 0 auto; padding: 0; border: 0;
  background: transparent; color: #666; font: 300 30px/1 Arial, sans-serif; cursor: pointer;
}
#cs-login-dialog .reader-auth-logo { display: block; width: 144px; height: 40px; margin: 16px auto 24px; object-fit: contain; }
#cs-login-dialog[data-step="phone"] .reader-auth-close { display: none; }
#cs-login-dialog[data-step="phone"] .reader-auth-logo { margin-top: 40px; }
#cs-login-dialog h2 { margin: 0; color: #242529; font: 700 20px/1.4 Pretendard, "Malgun Gothic", sans-serif; letter-spacing: -.04em; word-break: keep-all; }
#cs-login-dialog h2:focus { outline: none; }
#cs-login-dialog .reader-auth-sub { margin: 4px 0 0; color: #666; font-size: 14px; line-height: 20px; }
#cs-login-dialog .reader-auth-providers { display: grid; gap: 12px; margin-top: 39px; }
#cs-login-dialog .reader-auth-bubble {
  position: relative; justify-self: center; padding: 5px 14px; margin-bottom: 1px;
  border-radius: 16px; background: #191919; color: white; font-size: 13px; line-height: 20px;
}
#cs-login-dialog .reader-auth-bubble::after { content: ""; position: absolute; left: calc(50% - 6px); bottom: -5px; border: 6px solid transparent; border-bottom: 0; border-top-color: #191919; }
#cs-login-dialog .reader-auth-providers:not(:has([data-cs-login]:not([hidden]))) .reader-auth-bubble { display: none; }
#cs-login-dialog .reader-auth-button, .reader-auth-page .reader-auth-button {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px;
  margin: 0; padding: 12px 16px; border: 1px solid #d9dbdf; border-radius: 8px;
  background: white; color: #222; font: 700 16px/1.25 Pretendard, "Malgun Gothic", sans-serif;
  text-align: center; text-decoration: none; cursor: pointer;
}
#cs-login-dialog .reader-auth-button img { object-fit: contain; flex-shrink: 0; }
#cs-login-dialog [data-cs-login="kakao"] { background: #fee500; border-color: #fee500; color: #191919; }
#cs-login-dialog .reader-auth-primary { background: #f51b25; border-color: #f51b25; color: white; }
#cs-login-dialog .reader-auth-button:disabled { opacity: .55; cursor: wait; }
#cs-login-dialog .reader-auth-actions { display: flex; gap: 8px; margin-top: 24px; }
#cs-login-dialog .reader-auth-terms { width: min(340px, 100%); margin: 0 auto; text-align: left; color: #151515; line-height: 20px; }
#cs-login-dialog .reader-auth-terms h2 { font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: -.02em; }
#cs-login-dialog .reader-auth-terms label { display: flex; align-items: flex-start; gap: 5px; font-size: 14px; font-weight: 400; letter-spacing: -.02em; cursor: pointer; }
#cs-login-dialog .reader-auth-terms input {
  appearance: auto; position: static; width: 14px; height: 14px; margin: 3px 0 0; padding: 0; flex-shrink: 0; accent-color: #191919; cursor: pointer;
}
#cs-login-dialog .reader-auth-terms .reader-auth-all { align-items: center; gap: 10px; margin: 16px 0 12px; padding: 12px; border: 1px solid #d9dbdf; border-radius: 8px; }
#cs-login-dialog .reader-auth-all strong { display: block; font-size: 18px; line-height: 1.4; font-weight: 700; }
#cs-login-dialog .reader-auth-all small { display: block; margin-top: 3px; font-size: 12px; }
#cs-login-dialog .reader-auth-all input { width: 20px; height: 20px; margin: 0; }
body:has(> #cs-login-dialog[open]) { margin: 0; background: #777; }
#cs-login-dialog .reader-auth-items { display: grid; gap: 8px; padding-left: 16px; }
#cs-login-dialog .reader-auth-items a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#cs-login-dialog .reader-auth-terms p { margin: 16px 0 0; font-size: 12px; line-height: 16px; }
#cs-login-dialog .reader-auth-phone { display: block; margin: 24px 0; }
#cs-login-dialog .reader-auth-phone span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
#cs-login-dialog .reader-auth-phone input { width: 100%; min-height: 56px; padding: 0 16px; border: 1px solid #ef343b; border-radius: 8px; background: #fff; color: #222; font: inherit; font-size: 16px; }
#cs-login-dialog .reader-auth-note { margin: 12px 0; color: #a32329; font-size: 14px; line-height: 1.4; }
#cs-login-dialog .csd-test { text-align: left; }
#cs-login-dialog .csd-test button { display: block; width: 100%; padding: 10px; border: 0; border-radius: 6px; background: #27272a; color: white; font: inherit; cursor: pointer; }
#cs-login-dialog :is(button, input, a):focus-visible { outline: 2px solid #365eae; outline-offset: 2px; }
.reader-auth-page { min-height: 28vh; max-width: 440px; padding: 32px 20px; margin: 0 auto; text-align: center; }
.reader-auth-page h1 { margin: 0 0 16px; font-size: 24px; }
@media (max-width: 767px) {
  #cs-login-dialog.reader-auth {
    inset: auto 0 0; margin: 0 auto; width: min(100%, 480px); max-height: 95dvh;
    padding-bottom: calc(32px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0;
  }
  #cs-login-dialog .reader-auth-handle { width: 36px; margin: 0 auto; border-radius: 4px; background: #e5e5e5; }
}
