.v6-login-status:empty, .v6-dialog-status:empty { display: none; }

body[data-route="login"] {
  --wx-top: 0px;
  color: #302729;
  background: #f7f3e9;
}
body[data-route="login"] :is(#topbar,#wx-status,#wx-capsule) { display: none; }
body[data-route="login"] #view { padding: 16px; }
.v6-login .login-form {
  display: grid;
  align-content: start;
  padding: clamp(20px, 5vw, 34px);
  border: 1px solid #d6c9bc;
  border-radius: 14px;
  background: #fbf7ef;
}
.v6-login h1, .v6-modal h2 {
  margin: 10px 0 18px;
  font: 600 clamp(26px, 4vw, 36px)/1.2 Baskerville, "Songti SC", STSong, Georgia, serif;
}
.v6-login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 650;
}
.v6-login-brand img { height: 48px; width: auto; }
.v6-login .login-form input { min-height: 44px; font-size: 16px; }
.v6-login .login-form .primary { background: #703b4a; }
.v6-login-status, .v6-dialog-status { margin: 8px 0 0; }

.v6-modal {
  inset: 0;
  width: min(520px, calc(100% - 24px));
  max-height: 90dvh;
  box-sizing: border-box;
  margin: auto;
  padding: 20px;
  color: #302729;
  background: #fbf7ef;
  border: 1px solid #d6c9bc;
  border-radius: 12px;
  overscroll-behavior: contain;
}
.v6-modal::backdrop { background: #30272966; }
.v6-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 16px 0 0; }
.v6-modal .modal {
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 0;
  box-shadow: none;
  background: transparent;
  border: 0;
}
.v6-modal .modal-title { font-weight: 650; margin: 0 0 12px; }
.v6-modal .modal-ops { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.v6-modal .form-error:not(:empty) { color: #883b4a; margin: 8px 0 0; }
.v6-modal .form-error:empty { display: none; }
.v6-modal .btn { min-height: 40px; }
body.v5-shell :is(dialog,.modal-body) { overscroll-behavior: contain; }

@media (max-width: 640px) {
  .v6-login { padding-top: 5vh; }
  .v6-modal {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 18px 16px max(18px, env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
  }
  .v6-modal .btn { min-height: 44px; }
}

body.v5-shell button:active:not(:disabled), body[data-route="login"] button:active:not(:disabled) {
  box-shadow: inset 0 0 0 2px #ae7e805c;
}
@media (prefers-reduced-motion: no-preference) {
  body.v5-shell button, body[data-route="login"] button {
    transition: background-color 110ms, border-color 110ms, box-shadow 110ms;
  }
  body.v5-shell :is(dialog[open],#receipt-feedback:not(dialog)) { animation: v6-panel-appear 160ms cubic-bezier(.2,.75,.25,1); }
  body.v5-shell details[open]:not(.v5-account) > :not(summary) { animation: v6-reveal 120ms ease-out; }
}
@keyframes v6-panel-appear {
  from { opacity: .5; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@keyframes v6-reveal {
  from { opacity: .55; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body.v5-shell *, body.v5-shell *::before, body.v5-shell *::after,
  body[data-route="login"] * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

#receipt-feedback.receipt-photo-preview {
  inset: auto 0 0;
  width: 100%;
  max-width: none;
  max-height: 90dvh;
  box-sizing: border-box;
  margin: 0;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: #fbf7ef;
}
#receipt-feedback.receipt-photo-preview:not([open]) { display: none; }
#receipt-feedback.receipt-photo-preview::backdrop { background: #30272966; }
#receipt-feedback.receipt-photo-preview :is(h2,[role=status],.v6-receipt-image) { flex: 1 0 100%; }
#receipt-feedback.receipt-photo-preview h2 { margin: 0 0 4px; font-size: 24px; }
.v6-receipt-image { min-width: 0; overflow: auto; overscroll-behavior: contain; }
#receipt-feedback .v6-receipt-image.is-zoomed img { width: max(790px, 100%); max-width: none; }

.v6-drawer-back {
  min-height: 40px;
  margin-inline-end: auto;
  padding: 4px 12px;
  color: #703b4a;
  background: transparent;
  border: 1px solid #d6c9bc;
  border-radius: 22px;
  cursor: pointer;
}
@media (max-width: 640px) {
  .v6-drawer-back { min-height: 44px; }
}
