.account-menu { position: relative; display: inline-flex; align-items: center; }
.account-menu-trigger {
  width: 40px; height: 40px; border: 1px solid rgba(148, 163, 184, .55);
  border-radius: 999px; background: #fff; color: #1f2937; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.account-menu-trigger:hover, .account-menu-trigger[aria-expanded="true"] { border-color: #93a4d8; background: #f8fafc; }
.account-menu-icon { font-size: 18px; line-height: 1; }
.account-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 100; min-width: 168px;
  padding: 8px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, .18);
}
.account-menu-panel[hidden] { display: none; }
.account-menu-item {
  width: 100%; min-height: 38px; display: flex; align-items: center; border: 0; border-radius: 10px;
  padding: 9px 10px; background: transparent; color: #25324b; font-size: 13px; font-weight: 800;
  text-align: left; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.account-menu-item:hover { background: #f1f5ff; color: #2446a8; }
.account-menu-logout { color: #b42318; }
.account-menu-logout:hover { background: #fff1f1; color: #991b1b; }
.topbar .account-menu-trigger, .sidebar .account-menu-trigger { box-shadow: none; }
@media (max-width: 480px) { .account-menu-panel { right: 0; min-width: 154px; } }

.auth-actions { display: inline-flex; align-items: center; gap: 8px; }
.auth-actions[hidden], .account-menu[hidden], .login-modal[hidden] { display: none !important; }
.auth-action {
  min-height: 38px; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 900;
  text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.auth-action-login { border: 1px solid #c7d2fe; background: #fff; color: #233876; }
.auth-action-signup { border: 1px solid #2643c4; background: #2643c4; color: #fff; }
.auth-action:hover { transform: translateY(-1px); }
.login-modal {
  position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center;
  width: 100vw; min-height: 100dvh; padding: 24px; overflow-y: auto; background: rgba(15, 23, 42, .48);
  box-sizing: border-box;
}
.login-modal-card {
  position: relative; width: min(420px, 100%); max-height: calc(100dvh - 48px); margin: auto; padding: 28px;
  overflow-y: auto; border-radius: 24px; background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .32);
  box-sizing: border-box;
}
.login-modal-card h2 { margin: 0 0 6px; color: #111827; font-size: 24px; }
.login-modal-subtitle { margin: 0 0 20px; color: #64748b; font-size: 14px; }
.login-modal-close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; font-size: 26px; cursor: pointer; color: #64748b; }
.login-modal-card label { display: grid; gap: 7px; margin-bottom: 14px; color: #334155; font-size: 13px; font-weight: 800; }
.login-modal-card input { min-height: 44px; border: 1px solid #cbd5e1; border-radius: 12px; padding: 0 12px; font-size: 15px; }
.login-modal-card label.login-modal-remember { display: flex; align-items: center; gap: 8px; margin: -2px 0 14px; font-weight: 700; cursor: pointer; }
.login-modal-card .login-modal-remember input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: #2643c4; cursor: pointer; }
.login-modal-message { margin: 0 0 12px; font-size: 13px; color: #334155; }
.login-modal-message.is-error { color: #b42318; }
.login-modal-reset { display: inline-flex; margin: -4px 0 14px; color: #64748b; font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.login-modal-reset:hover { color: #2643c4; }
.login-modal-submit { width: 100%; min-height: 46px; border: 0; border-radius: 14px; background: #2643c4; color: #fff; font-weight: 900; cursor: pointer; }
.login-modal-submit:disabled { opacity: .6; cursor: wait; }
.login-modal-signup { margin-top: 12px; min-height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #2643c4; font-weight: 900; text-decoration: none; background: #eef2ff; }
.login-modal-social { margin: 16px 0 20px; }
.login-modal-social details { margin: 6px 0 12px; }
.login-modal-social summary { cursor: pointer; }
.login-modal-divider {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px; color: #94a3b8; font-size: 12px; font-weight: 800;
}
.login-modal-divider::before, .login-modal-divider::after {
  content: ""; flex: 1; height: 1px; background: #e2e8f0;
}
.login-modal-google {
  display: flex; justify-content: center; align-items: center; box-sizing: border-box;
  width: 100%; min-height: 46px; margin: 0 0 8px; padding: .5rem .8rem;
  border: 1px solid #747775; border-radius: 14px; background: #fff; color: #1f1f1f;
  font: inherit; font-weight: 700; text-decoration: none;
}
.login-modal-google:not(:disabled):hover { background: #f2f6fc; cursor: pointer; }
.login-modal-google:focus-visible { outline: 3px solid #21557c; outline-offset: 2px; }
.login-modal-google:disabled { color: #566373; border-color: #cbd2db; background: #f5f7fa; }
/* 네이버 로그인 버튼(네이버 브랜드 색 #03C75A, 흰색 N 로고) */
.login-modal-naver {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 46px;
  border-radius: 14px; background: #03c75a; color: #fff; font-weight: 900; font-size: 15px; text-decoration: none;
  box-sizing: border-box;
}
.login-modal-naver:hover { background: #02b351; }
.login-modal-naver:focus-visible { outline: 3px solid #0a7f3f; outline-offset: 2px; }
.login-modal-social-note { margin: 10px 0 0; color: #64748b; font-size: 12px; line-height: 1.5; text-align: center; }
@media (max-height: 640px) {
  .login-modal { align-items: flex-start; }
  .login-modal-card { max-height: none; }
}
.login-modal-social-note a { color: #2643c4; font-weight: 800; }

.login-modal-kakao {
  width: 100%; min-height: 46px; margin-top: 8px; border: 0; border-radius: 14px;
  background: #fee500; color: #191919; font: inherit; font-weight: 700; cursor: pointer;
}
.login-modal-kakao:focus-visible { outline: 3px solid #594700; outline-offset: 2px; }
.login-modal-kakao + p { margin-bottom: 12px; }

/* Keep credential entry within the visible viewport when the Android keyboard opens. */
.login-modal.codi-login {
  width: auto;
  min-height: 0;
  height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
           max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: #f4f6fa;
  overscroll-behavior: contain;
}
.codi-login .login-modal-card {
  flex: 0 1 380px;
  min-width: 0;
  max-width: 100%;
  max-height: none;
  padding: clamp(16px, 5vw, 28px);
  border-radius: 18px;
  overflow: visible;
}
.codi-login .login-modal-card h2 {
  padding-inline-end: 44px;
  margin: 0 0 18px;
  font-size: 1.375rem;
  line-height: 1.25;
}
.codi-login .login-modal-close {
  inset: 6px 8px auto auto;
  width: 44px;
  height: 44px;
}
.codi-login label:not(.login-modal-remember) { grid-template-columns: minmax(0, 1fr); }
.codi-login input:not([type="checkbox"]) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  font-size: max(16px, 1rem);
}
.codi-login .login-modal-divider { display: none; }
.codi-login-options[hidden] { display: none; }
.codi-login-options { margin: 10px 0 0; }
.codi-login-options > summary {
  padding: 12px 0;
  cursor: pointer;
  color: #334155;
  font-weight: 700;
}
