.h5-access, .h5-startup {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 12% 10%, #fff 0, transparent 52%), #efeaf7;
}
.h5-startup-content { display: grid; justify-items: center; gap: 14px; color: #53456c; text-align: center; }
.h5-startup-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #ded4f6;
  border-top-color: #6042d2;
  border-radius: 50%;
  animation: h5-loading-spin .8s linear infinite;
}
@keyframes h5-loading-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .h5-startup-spinner { animation: none; } }
.h5-login-card {
  width: min(100%, 410px);
  padding: clamp(22px, 5vw, 37px);
  border: 1px solid #fff;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 54px #47325b22;
}
.h5-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; font-size: 15px; font-weight: 650; }
.h5-login-brand img { border-radius: 11px; }
.h5-login-card h1 { font-size: clamp(24px, 4vw, 30px); }
.h5-login-status { margin: 9px 0 17px; color: var(--muted); }
.h5-login-status[data-error] { color: #952a47; }
#h5-login-form { display: grid; gap: 8px; }
#h5-login-form label { margin-top: 4px; font-weight: 630; }
#h5-login-form input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid #d7d1e3;
  border-radius: 8px;
  font: inherit;
}
.h5-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.h5-captcha-fields { display: grid; gap: 8px; }
.h5-captcha-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.h5-captcha-change { padding: 4px 0; border: 0; color: #5137a0; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.h5-captcha-refresh { display: grid; place-items: center; overflow: hidden; padding: 0; border: 1px solid #d7d1e3; border-radius: 8px; background: #f3f8f0; }
.h5-captcha-refresh img { display: block; max-width: min(150px, 37vw); height: auto; }
.h5-code-button, .h5-login-submit, .h5-text-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #e2d8f0;
  border-radius: 8px;
  color: #5137a0;
  background: #f6f0ff;
  font: inherit;
  white-space: nowrap;
}
.h5-login-submit { margin-top: 10px; border-color: transparent; color: #fff; background: #6042d2; font-weight: 650; }
.h5-text-button { border-color: transparent; background: transparent; }
.h5-code-button:disabled, .h5-login-submit:disabled { opacity: .6; cursor: default; }
.h5-account { display: grid; gap: 4px; margin-top: auto; color: var(--muted); font-size: 12px; }
.h5-account button {
  min-height: 34px;
  padding: 3px;
  border: 1px solid #ded4ed;
  border-radius: 7px;
  background: #ffffff80;
  color: #513a91;
  font: inherit;
}
.h5-account .h5-profile-card {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-align: start;
}
.h5-account .h5-profile-card:hover { background: #fff9; }
.h5-profile-summary { min-width: 0; }
.h5-profile-summary strong, .h5-profile-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h5-profile-summary small { color: var(--muted); font-variant-numeric: tabular-nums; }
.h5-profile-avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #e6dcfa;
  color: #5b4198;
  font-weight: 700;
}
.h5-profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.h5-profile-avatar--large {
  width: 64px;
  height: 64px;
  border: 3px solid #fff;
  background: linear-gradient(140deg, #efe8ff, #ddcff9);
  box-shadow: 0 2px 9px #4f318a24;
  font-size: 22px;
}
.h5-profile-dialog {
  --profile-inset: clamp(16px, 5vw, 24px);
  width: min(456px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid #e8e2ef;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 20px 65px #22163933;
  color: var(--ink);
}
.h5-profile-dialog::backdrop { background: #2c203e66; }
.h5-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px var(--profile-inset) 13px;
}
.h5-profile-header h2 { font-size: 21px; }
.h5-profile-header .icon-button { border-radius: 50%; background: #f5f2fa; }
.h5-profile-header .icon-button:hover { background: #ebe4f6; }
.h5-profile-form { display: grid; gap: 16px; padding: 0 var(--profile-inset) var(--profile-inset); }
.h5-profile-photo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid #eee6fa;
  border-radius: 16px;
  background: linear-gradient(110deg, #f1eafb, #f9f6fd);
}
.h5-profile-photo-actions { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.h5-profile-photo-actions p { color: var(--muted); font-size: 12px; line-height: 1.45; }
.h5-profile-choose {
  padding: 7px 12px;
  border: 1px solid #d9caef;
  border-radius: 9px;
  background: #fff;
  color: #5635a6;
  font-weight: 650;
}
.h5-profile-choose:hover { border-color: #a488dc; background: #fcfaff; }
.h5-profile-choose:disabled { opacity: .6; cursor: default; }
.h5-profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.h5-profile-stats div { padding: 10px 13px; border: 1px solid #ebe5f4; border-radius: 12px; background: #faf8fd; }
.h5-profile-stats dt, .h5-profile-phone { color: var(--muted); font-size: 13px; }
.h5-profile-stats dd {
  margin: 3px 0 0;
  color: #5030a2;
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.h5-profile-fields { display: grid; gap: 7px; }
.h5-profile-fields label { font-size: 13px; font-weight: 650; }
#h5-profile-nickname {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #ddd6e8;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
#h5-profile-nickname:focus { border-color: #8161cb; outline: 2px solid #e5daf9; outline-offset: 1px; }
.h5-profile-phone { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 0 1px; }
.h5-profile-phone strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.h5-profile-save { margin-top: 0; border-radius: 10px; }
.h5-profile-save:hover:not(:disabled) { background: #5032bb; }
.h5-crop-dialog::backdrop { background: #2c203e45; }
.h5-crop-body { display: grid; justify-items: center; gap: 12px; padding: 0 var(--profile-inset) var(--profile-inset); }
.h5-crop-frame {
  position: relative;
  width: min(100%, 300px, max(168px, calc(100dvh - 220px)));
  overflow: hidden;
  border: 1px solid #ded4ed;
  border-radius: 14px;
  background: #f0ebf7;
}
.h5-crop-frame canvas { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; }
.h5-crop-frame canvas:active { cursor: grabbing; }
.h5-crop-frame:has(canvas:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.h5-crop-frame::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #fff8 1px, transparent 1px) left top / calc(100% / 3) 100%,
    linear-gradient(#fff8 1px, transparent 1px) left top / 100% calc(100% / 3);
  pointer-events: none;
  content: "";
}
#h5-crop-hint { color: var(--muted); font-size: 12px; }
.h5-crop-zoom {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 300px);
  color: var(--label);
  font-size: 13px;
}
.h5-crop-zoom input { flex: 1; min-width: 0; margin: 0; accent-color: #6042d2; }
.h5-crop-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; width: 100%; }
#h5-profile-message, #h5-account-notice { color: #952a47; font-size: 12px; }
#h5-profile-message:empty, #h5-account-notice:empty, .h5-profile-summary small:empty { display: none; }
@media (max-width: 790px) {
  .h5-account { text-align: center; line-height: 1.25; }
  .h5-account button { white-space: normal; }
  .h5-account .h5-profile-card { justify-content: center; padding: 4px 0; }
  .h5-profile-summary { display: none; }
}
