.login-platform-auth {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
  z-index: 20;
}

.login-platform-auth a,
.login-platform-auth button {
  color: #172b4d;
  font-weight: 500;
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.16s ease;
}

.login-platform-auth a:hover,
.login-platform-auth button:hover {
  color: #2563ff;
}

.site-header .login-platform-auth .ydm-user-pill,
.site-header .login-platform-auth .ydm-user-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.site-header .login-platform-auth .ydm-user-pill:hover,
.site-header .login-platform-auth .ydm-user-login:hover {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #c7d8ff;
}

.site-header .ydm-user-login::before { content:""; width:18px; height:18px; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 21v-2a7 7 0 0 1 14 0v2'/%3E%3C/svg%3E") center/contain no-repeat; }
:is(.site-header,.uc-topbar) .login-platform-auth .ydm-account-trigger { display:grid; place-items:center; width:40px; height:40px; padding:0; border:0; border-radius:50%; background:transparent; }
.ydm-account-avatar { display:grid; place-items:center; position:relative; flex:none; width:32px; height:32px; border-radius:50%; background:linear-gradient(135deg,#edf2ff,#d7e4ff); color:#4866a8; font-size:14px; font-weight:600; }
:is(.site-header,.uc-topbar) .ydm-account-trigger .ydm-account-avatar { width:40px; height:40px; font-size:16px; box-shadow:inset 0 0 0 1px #dce6f5; }
.ydm-account-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; border-radius:50%; }
:is(.site-header,.uc-topbar) .ydm-account-trigger:hover,:is(.site-header,.uc-topbar) .ydm-account-trigger[aria-expanded="true"] { border-color:#bbceff; box-shadow:0 0 0 3px var(--blue-soft); }
.ydm-account-menu { position:absolute; right:0; top:calc(100% + 12px); width:252px; max-width:calc(100vw - 32px); padding:6px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 12px 40px rgba(27,49,95,.14); max-height:calc(100dvh - 100px); overflow-y:auto; }
.ydm-account-menu[hidden] { display:none; }
.ydm-account-identity { display:flex; align-items:center; gap:12px; padding:12px 10px 16px; margin-bottom:6px; border-bottom:1px solid var(--line); }
.ydm-account-identity .ydm-account-avatar { width:40px; height:40px; font-size:18px; }
.ydm-account-identity>div { min-width:0; }
.ydm-account-identity strong,.ydm-account-identity small { display:block; overflow-wrap:anywhere; white-space:normal; }
.ydm-account-identity strong { color:var(--text); font-size:14px; font-weight:600; }
.ydm-account-identity small { margin-top:3px; color:var(--muted); font-size:12px; }
:is(.site-header,.uc-topbar) .login-platform-auth .ydm-account-item { display:flex; align-items:center; gap:12px; width:100%; padding:11px 12px; border-radius:6px; color:var(--text); font-size:14px; text-align:left; line-height:20px; }
.ydm-account-item svg { width:18px; height:18px; flex:none; }
:is(.site-header,.uc-topbar) .login-platform-auth .ydm-account-item:hover { background:var(--blue-soft); color:var(--blue); }
:is(.site-header,.uc-topbar) .login-platform-auth .ydm-account-logout { margin-top:6px; border-top:1px solid var(--line); border-radius:0 0 6px 6px; color:var(--text-sub); }

.site-auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.site-auth-backdrop.is-open {
  display: flex;
}

.site-auth-dialog {
  width: 100%;
  max-width: 760px;
  max-height: calc(100dvh - 48px);
  min-height: min(460px, calc(100dvh - 48px));
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 35, 65, 0.24);
  padding: 0;
  position: relative;
  color: #172b4d;
}

.site-auth-visual {
  min-width: 0;
  border-radius: 15px 0 0 15px;
  background: #eaf2fa url('/assets/img/site-auth-store-original-v3.jpg') center / cover no-repeat;
  border-right: 1px solid var(--line, #e2e8f0);
}

.site-auth-content {
  min-width: 0;
  min-height: 0;
  padding: 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.site-auth-dialog button, .site-auth-dialog input { font-family: inherit; }
.site-auth-dialog button:focus-visible { outline: 2px solid var(--blue, #2563ff); outline-offset: 3px; }

.site-auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.site-auth-close:hover {
  border-color: #2563ff;
  color: #2563ff;
  background: var(--blue-soft, #edf3ff);
}

.site-auth-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 4px;
  background: #eef4ff;
  color: #2563ff;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.site-auth-head h2 {
  margin: 0 24px 24px 0;
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  color: #172b4d;
}

.site-auth-head p {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
}

.site-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #f1f5fb;
  margin-bottom: 24px;
}

.site-auth-tab {
  height: 36px;
  border-radius: 5px;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.site-auth-tab.is-active {
  background: #ffffff;
  color: #2563ff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.site-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site-auth-phone-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.site-auth-phone-panel[hidden],
.site-auth-form[hidden] { display: none; }

.site-auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 108px; gap: 8px; }
.site-auth-code-btn { height: 36px; border: 1px solid #c7d8ff; border-radius: 6px; background: #fff; color: var(--blue, #2563ff); font-size: 13px; font-weight: 500; cursor: pointer; transition: .16s ease; }
.site-auth-code-btn:hover { background: #e0ebff; }
.site-auth-code-btn:disabled { background: #f5f7fa; border-color: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
.site-auth-hint { margin: 0; color: #64748b; font-size: 12px; line-height: 20px; text-align: left; }
.site-auth-register-link { border: 0; background: transparent; color: #2563ff; cursor: pointer; font-size: 13px; padding: 2px 0; align-self: center; }
.site-auth-register-link:hover { text-decoration: underline; }

.site-auth-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.site-auth-field label {
  display: block;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 6px;
}

.site-auth-field input {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #172b4d;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.site-auth-field input:focus {
  border-color: #2563ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 255, 0.14);
}

.site-auth-status {
  min-height: 20px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.45;
  display: none;
}

.site-auth-status.is-error {
  display: block;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.site-auth-status.is-success {
  display: block;
  background: #eef4ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.site-auth-submit {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  border: 0;
  background: #2563ff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37,99,255,.12);
  transition: background 0.16s ease;
}

.site-auth-submit:hover {
  background: #1d4ed8;
}

.site-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.site-auth-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.site-auth-footer a {
  color: #2563ff;
  text-decoration: none;
  font-weight: 500;
}

.site-auth-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 680px) {
  .site-auth-dialog {
    grid-template-columns: 1fr;
    max-width: 480px;
    min-height: 0;
  }
  .site-auth-visual { display: none; }
  .site-auth-content { padding: 32px; }
  .site-auth-row2 {
    grid-template-columns: 1fr;
  }
}
.ydm-account-avatar img:is([src$="logo-mark-blue.png"],[src$="avatar-cat-blue.svg"]){inset:7px;width:26px;height:26px;object-fit:contain;border-radius:0}
