.account-main { padding-bottom: clamp(36px, 6vw, 80px); }
.account-main [hidden] { display: none !important; }
.account-link[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
#load-panel { margin: 32px 0; color: var(--soft); }
#retry-session { margin-top: 14px; }
.auth-layout, .dashboard-grid { display: grid; gap: clamp(18px, 3vw, 40px); align-items: start; }
.auth-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr); max-width: 1060px; margin: clamp(30px, 5vw, 72px) auto; }
.account-intro { max-width: 510px; padding: clamp(22px, 4vw, 68px) 0; }
.account-intro h1, .account-heading h1 { font-size: clamp(44px, 5.8vw, 78px); line-height: .99; letter-spacing: -.07em; }
.account-main h1 em { color: #5c5731; font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; }
.account-intro > p { max-width: 355px; margin: 20px 0 26px; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.5; color: #525748; }
.shop-link, .link-button { display: inline-block; color: var(--green); padding: 0; background: transparent; border: 0; font: inherit; font-size: 14px; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; }
.shop-link span, .secondary-button span { margin-left: 7px; }
.account-panel { border: 1px solid var(--border); border-radius: 16px; background: #fffefa; overflow: hidden; }
.auth-card { padding: clamp(22px, 3vw, 38px); }
.auth-switch { display: flex; width: 100%; background: #f0efe6; padding: 4px; border-radius: 9px; gap: 4px; }
.auth-switch button { flex: 1; padding: 9px 7px; border-radius: 6px; border: 1px solid transparent; background: transparent; font-weight: 650; font-size: 14px; }
.auth-switch button[aria-pressed="true"] { background: #fffefa; border-color: #d9d8c9; }
.auth-card h2 { font-size: clamp(24px, 2.5vw, 34px); margin: 24px 0 18px; }
.account-main fieldset { margin: 0; border: 0; padding: 0; min-width: 0; }
.account-main label { display: block; font-size: 14px; font-weight: 650; margin: 13px 0 0; }
.account-main input { display: block; width: 100%; border: 1px solid #c5c8b9; background: white; height: 44px; padding: 9px 12px; border-radius: 7px; margin: 5px 0 0; }
#auth-submit { width: 100%; margin-top: 20px; }
.field-note, .return-note, .feedback, #order-status { color: #525748; font-size: 13px; line-height: 1.5; }
.field-note { margin-top: 4px; }
.feedback:not(:empty) { margin-top: 13px; }
.error { color: #8e372c; }
.account-heading { margin: 28px 0 25px; border-radius: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: clamp(22px, 4vw, 46px); background: #f7e6ab; }
.account-heading h1 { font-size: clamp(38px, 4.8vw, 61px); }
.account-heading p { margin-top: 9px; overflow-wrap: anywhere; color: #4a4939; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; background: #fffefa; border: 1px solid #d1d3c5; border-radius: 7px; padding: 9px 13px; font: inherit; font-size: 13px; font-weight: 650; }
.secondary-button:hover { background: #f5f3e9; border-color: #a8ad9b; }
.dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(245px, .41fr); }
.panel-head { padding: 20px 23px 16px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: clamp(23px, 2.4vw, 32px); }
.profile-body, .profile-foot { padding: 18px 23px; }
.profile-foot { border-top: 1px solid var(--border); }
.identity { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; overflow-wrap: anywhere; }
.identity strong { display: block; font-size: 17px; }
.identity p { margin-top: 2px; font-size: 13px; color: var(--soft); }
.avatar { display: grid; place-items: center; flex: none; width: 46px; height: 46px; background: #e4ebdb; color: #344b34; font-weight: 650; font-size: 21px; border-radius: 50%; }
.profile-actions { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.avatar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.profile .avatar { overflow: hidden; }
.avatar-editor {
  position: fixed;
  inset: 0;
  width: min(406px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 60px #20251d30;
}
.avatar-editor::backdrop { background: #20251da8; }
.avatar-editor-body { padding: clamp(16px, 4vw, 26px); }
.avatar-editor h2 { font-size: clamp(24px, 5vw, 30px); }
.avatar-editor h2 + p { margin-top: 7px; color: var(--soft); font-size: 14px; line-height: 1.45; }
.avatar-crop-stage {
  display: block;
  width: min(100%, 256px);
  width: min(100%, 256px, max(150px, 37dvh));
  height: auto;
  aspect-ratio: 1;
  margin: 18px auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e4ebdb;
  box-shadow: 0 0 0 1px #666b5b;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.avatar-crop-stage:active, .avatar-crop-stage.is-dragging { cursor: grabbing; }
.avatar-crop-stage:focus-visible { outline: 3px solid #7965a5; outline-offset: 4px; }
.avatar-preview-row {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffefb;
  color: var(--ink);
  font-size: 14px;
  font-weight: 550;
}
.avatar-crop-preview {
  display: block;
  flex: none;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  border: 1px solid #c1d0b9;
  border-radius: 50%;
  background: #e4ebdb;
}
.avatar-editor .avatar-crop-zoom {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  margin-top: 14px;
  font-weight: 650;
  font-size: 14px;
}
.avatar-crop-zoom output { grid-column: 2; grid-row: 1; color: var(--soft); font-variant-numeric: tabular-nums; font-weight: 500; }
.avatar-crop-zoom input[type="range"] {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--green);
  cursor: pointer;
}
.avatar-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 9px; }
.avatar-editor-actions > button { min-height: 44px; min-width: 88px; }
#avatar-editor-status:not(:empty) { margin-block: 10px; font-size: 13px; line-height: 1.45; }
#edit-profile { margin-top: 16px; }
.order-feedback { padding-inline: 23px; }
.order-histories { display: grid; gap: 18px; min-width: 0; }
.order-feedback p:not(:empty), .order-feedback button:not([hidden]) { margin: 15px 0; }
.order-context { font-size: 13px; line-height: 1.5; margin: 0 23px 17px; overflow-wrap: anywhere; }
.order-context code { display: block; margin-top: 5px; }
.order-context .btn { margin-block: 10px 6px; }
.order-empty { margin: 27px 23px 31px; }
.order-empty h3 { font-size: 21px; }
.order-empty p { font-size: 14px; line-height: 1.5; color: var(--soft); margin: 7px 0 15px; }
.order { border-bottom: 1px solid var(--border); }
.order:last-child { border-bottom: 0; }
.order > summary { list-style: none; display: grid; align-items: center; grid-template-columns: minmax(0,1fr) auto auto 17px; gap: 12px; cursor: pointer; padding: 17px 23px; }
.order > summary:focus-visible { outline: 2px solid #7965a5; outline-offset: -4px; }
.order > summary::-webkit-details-marker { display: none; }
.order > summary::after { content: ''; width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); margin-top: -4px; justify-self: end; }
.order[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.order > summary:hover { background: #f8f7f0; }
.order-id, .order-total { font-size: 14px; font-weight: 680; overflow-wrap: anywhere; }
.order-sub { display: block; color: var(--soft); margin-top: 4px; font-size: 12px; }
.order-status { justify-self: start; background: #edf1e6; padding: 4px 8px; border-radius: 5px; font-size: 11px; font-weight: 650; }
.order .items { list-style: none; padding: 0 23px; margin: 0 0 12px; }
.order .items li { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--border); padding: 12px 0; min-width: 0; }
.order .item-info { flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.item-info a { text-decoration: underline; text-underline-offset: 3px; }
.item-info small, .item-price { display: block; font-size: 12px; color: var(--soft); }
.item-info small { margin-top: 3px; }
.order .item-qty { font-size: 13px; white-space: nowrap; }
.order .items img { width: 42px; height: 42px; object-fit: cover; border-radius: 5px; }
@media (max-width: 740px) {
  .auth-layout { gap: 20px; grid-template-columns: minmax(0, .82fr) minmax(270px, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.2fr) minmax(210px,.8fr); gap: 12px; }
  .order > summary { gap: 8px; padding: 14px; grid-template-columns: minmax(0,1fr) auto 9px; }
  .order-status { grid-column: 1; grid-row: 2; }
  .order-total { grid-column: 2; grid-row: 1; }
  .order > summary::after { grid-column: 3; grid-row: 1; }
  .order .items { padding-inline: 14px; }
}
@media (max-width: 580px) {
  .auth-layout, .dashboard-grid { grid-template-columns: 1fr; }
  .account-intro { padding: 0; }
  .account-intro > p { margin: 11px 0; }
  .account-heading { align-items: start; flex-direction: column; margin: 17px 0; }
  .account-main .auth-layout { margin: 20px auto; }
}
@media(max-width: 360px) {
  .account-main h1 { font-size: 39px; }
  .order .items li { flex-wrap: wrap; }
}

.payment-panel { margin: 0 0 24px; }
.payment-heading, .payment-actions, .payment-pages { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.payment-heading { justify-content: space-between; }
.payment-body { border-top: 1px solid var(--border); padding: 17px clamp(14px, 3vw, 23px) 19px; }
.payment-note { max-width: 66ch; color: #54584c; font-size: 14px; line-height: 1.5; }
.payment-clock { display: flex; gap: 9px; align-items: baseline; margin-bottom: 7px; font-size: 14px; }
.payment-clock strong { color: #384b32; font-size: 20px; font-variant-numeric: tabular-nums; }
.payment-transfer {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: start;
  gap: 16px; margin-top: 18px; max-width: 800px;
}
.payment-instructions { min-width: 0; }
.payment-meta, .payment-manual-note, .payment-copy-status {
  font-size: 13px; line-height: 1.5; color: var(--soft);
}
.payment-meta { margin-top: 8px; }
.payment-body > .payment-actions { margin-top: 12px; }
.payment-actions [data-action="wallet"] { width: 100%; min-height: 48px; padding: 11px 18px; font-size: 16px; }
.payment-manual-note { margin: 17px 0 7px; }
.payment-manual {
  margin: 0; border: 1px solid var(--border); border-radius: 9px;
  background: #f8f7ee; overflow: hidden;
}
.payment-field { padding: 8px 12px; }
.payment-field + .payment-field { border-top: 1px solid var(--border); }
.payment-field dt { color: var(--soft); font-weight: 600; font-size: 12px; }
.payment-field dd { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 0; min-width: 0; }
.payment-field code {
  min-width: 0; overflow-wrap: anywhere; -webkit-user-select: all; user-select: all;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.payment-copy { min-height: 44px; flex: 0 0 auto; }
.payment-copy-status:not(:empty) { margin-top: 6px; color: var(--green); }
.payment-qr-disclosure { min-width: 0; border: 1px solid var(--border); border-radius: 9px; }
.payment-qr-disclosure > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  list-style: none; min-height: 46px; padding: 10px 14px; cursor: pointer;
  color: var(--green); font-size: 13px; font-weight: 650;
}
.payment-qr-disclosure > summary::-webkit-details-marker { display: none; }
.payment-qr-disclosure > summary::after {
  content: ''; width: 7px; height: 7px; flex: none; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg);
}
.payment-qr-disclosure[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.payment-qr-disclosure > summary:focus-visible { outline: 2px solid #7965a5; outline-offset: -4px; border-radius: 9px; }
.payment-qr { display: block; width: min(168px, 100%); height: auto; aspect-ratio: 1; margin: 0 auto 12px; background: white; image-rendering: pixelated; }
.payment-qr:not(.ready) { visibility: hidden; }
.payment-body .shop-link { margin-top: 12px; }
@media (min-width: 701px) {
  .payment-transfer { grid-template-columns: minmax(0, 1fr) 204px; gap: 28px; }
  .payment-actions [data-action="wallet"] { width: auto; min-width: 185px; }
}
@media (max-width: 700px) {
  .payment-heading { gap: 6px 12px; padding: 14px; }
  .payment-heading h2 { flex-basis: 100%; }
  .payment-heading > a { display: inline-flex; align-items: center; min-height: 44px; }
  .payment-heading .secondary-button { min-height: 44px; }
  .payment > summary { grid-template-columns: minmax(0, 1fr) auto 9px; }
  .payment > summary > span:first-child { grid-column: 1 / 3; grid-row: 1; }
  .payment > summary .order-total { grid-column: 2; grid-row: 2; }
  .payment-body { padding: 14px; }
}
#payments-message:not(:empty), .payment-pages:not([hidden]) { margin: 14px 23px; }
