.account-shell,
.account-footer {
  width: min(1040px, calc(100% - 40px));
  margin-inline: auto;
}
.account-shell {
  margin-block: clamp(28px, 5vw, 68px);
  display: grid;
  grid-template-columns: minmax(230px, 0.87fr) minmax(360px, 1fr);
  gap: clamp(30px, 7vw, 96px);
  align-items: start;
}
.account-footer {
  display: flex;
  gap: 20px;
  align-items: center;
}
.photo {
  position: relative;
  background: var(--paper);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4/5;
}
.photo img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  display: block;
}
.content {
  align-self: center;
}
.account-shell h1 {
  color: var(--ink);
  font: 750 clamp(42px, 5.4vw, 72px) / 1.03 var(--display);
  letter-spacing: -0.055em;
}
.account-shell h1 span { color: var(--mango); }
#intro {
  font-size: 18px;
  color: var(--muted);
  margin: 18px 0 24px;
  max-width: 36ch;
}
#status {
  color: var(--body);
  font-size: 0.94rem;
}
#status:empty {
  display: none;
}
.primary {
  border: 0;
  border-radius: 30px;
  background: var(--deep);
  color: white;
  font:
    600 1rem 'DM Sans',
    sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  text-decoration: none;
  cursor: pointer;
}
.primary:hover {
  background: #23554d;
}
.primary:disabled {
  opacity: 0.6;
  cursor: wait;
}
.provider {
  gap: 10px;
  min-height: 50px;
  padding: 2px 18px;
  border: 1px solid #747775;
  background: linear-gradient(175deg, #fff 28%, #f4f5f5);
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px #173b3420;
  color: #1f1f1f;
  transition: transform .15s ease, box-shadow .15s ease;
}
.provider:hover {
  background: #fafafa;
  box-shadow: inset 0 0 0 1px #72767460, 0 2px 6px #173b3425;
}
.provider:active { transform: scale(.986); }
.provider:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; }
.provider img, .provider .google-mark { display: block; flex: none; }
.provider .google-mark { width: 20px; height: 20px; }
@media (prefers-reduced-motion: reduce) { .provider { transition: none; } .provider:active { transform: none; } }
.fine {
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
label,
legend {
  font-size: 0.93rem;
  font-weight: 600;
}
.fields input {
  display: block;
  margin-top: 5px;
  width: 100%;
  min-width: 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid #a4b2b1;
  padding: 11px 12px;
  border-radius: 10px;
  font: inherit;
}
.fields input[readonly] {
  background: #f0ece4;
  color: var(--muted);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
fieldset label {
  font-weight: 400;
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 5px;
}
input[type='radio'] {
  accent-color: var(--deep);
}
.links {
  display: flex;
  align-items: center;
  gap: 0 18px;
  margin-top: 18px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.links button {
  font: 600 .93rem/1.35 'DM Sans',sans-serif;
  color: var(--deep);
  border: 0;
  background: transparent;
  cursor: pointer;
  min-height: 44px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.links #delete { margin-inline-start:auto; }
.account-footer {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.account-footer > span {
  margin-right: auto;
}
:focus-visible {
  outline: 3px solid var(--deep);
  outline-offset: 3px;
}
@media (max-width: 700px) {
  .account-shell {
    display: block;
  }
  .photo {
    display: none;
  }
  .content {
    max-width: 450px;
    margin: 40px auto 52px;
  }

}
@media (max-width: 370px) {
  .fields {
    grid-template-columns: 1fr;
  }
}
[hidden] {
  display: none !important;
}
.provider[aria-disabled='true'] {
  opacity: 0.64;
  cursor: default;
}
#guest { display: grid; gap: 10px; max-width: 355px; }
.credential-caption { color: var(--muted); margin: 7px 0 9px; font-size: .92rem; }
.credential-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.credential-button,
.guest-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid #285851;
  background: linear-gradient(175deg, #426d62, #224e44 70%);
  box-shadow: inset 0 1px 0 #ffffff40, 0 2px 4px #193c3320;
  color: white;
  font: 650 1rem/1.3 var(--sans, 'DM Sans', sans-serif);
  text-align: center;
  text-decoration: none;
  padding: 10px 20px;
  cursor: pointer;
}
.credential-button:hover { background: linear-gradient(175deg, #376558, #194438 70%); }
#username-signin,
#password-form[action$="/login"] #password-submit {
  color: #503414;
  border-color: #bb955a;
  background: linear-gradient(170deg, #fbebc9, #f0d5a6 78%);
}
#username-signin:hover,
#password-form[action$="/login"] #password-submit:hover {
  background: linear-gradient(170deg, #f8e2b6, #e9c890 78%);
}
#username-join,
#password-form[action$="/register"] #password-submit {
  color: #fff;
  border-color: #123f44;
  background: linear-gradient(170deg, #305d60, #123f44 78%);
}
#username-join:hover,
#password-form[action$="/register"] #password-submit:hover {
  background: linear-gradient(170deg, #284f53, #10383c 78%);
}
.credential-button:active, .guest-button:active { box-shadow: inset 0 1px 3px #17433842; }
.credential-button:disabled { cursor: wait; opacity: .65; }
.guest-button {
  display: flex;
  max-width: 355px;
  margin-top: 13px;
  border-color: #a6bab1;
  background: linear-gradient(165deg, #f7faf5ec, #e0eee5e0);
  color: #234d40;
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px #193c3312;
}
.guest-button:hover { background: #e2eee4; }
#forgot-password { color: #a03232; }
#password-submit { min-width: min(100%, 152px); }
#password-instructions { max-width: 44ch; }
.credential-fields label { min-width: 0; }
.apple-provider {
  border-color: #292929;
  background: linear-gradient(176deg, #252525, #000 38%, #0d0d0d);
  box-shadow: inset 0 1px 0 #ffffff45, 0 2px 4px #173b3420;
  color: #fff;
}
.apple-provider:hover { background: #151515; }
.apple-provider img { width: min(200px, 100%); height: 44px; object-fit: contain; mix-blend-mode: screen; }
.credential-fields { grid-template-columns: minmax(0, 1fr); max-width: 390px; margin-block: 16px; }
.credential-fields .fine { margin: 0; }
.key-panel { background: #fff; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.key-panel { margin-bottom: 22px; }
.secret { font-family: ui-monospace, monospace; overflow-wrap: anywhere; user-select: all; margin-block: 10px; }
.text-button {
  color: var(--deep);
  border: 0;
  background: transparent;
  padding: 2px 0;
  min-height: 44px;
  text-decoration: underline;
  font:
    600 0.95rem 'DM Sans',
    sans-serif;
  cursor: pointer;
}
.library-panel { margin:25px 0; padding:0 0 16px; border-bottom:1px solid var(--line); }
.library-panel h2, #profile h2 { color:var(--ink); font:700 1.4rem/1.2 var(--display); letter-spacing:-.025em; }
.library-list { margin:6px 0 0; padding:0; list-style:none; }
.library-list:empty,.library-panel .fine:empty { display:none; }
.library-list li { padding:10px 0; border-top:1px solid var(--line); }
.library-list li:first-child { border:0; }
.library-row { display:flex; align-items:baseline; justify-content:space-between; gap:8px 16px; }
.library-row strong { color:var(--ink); font-weight:650; overflow-wrap:anywhere; }
.library-row .amount { font:500 .9rem/1.4 'DM Mono', monospace; white-space:nowrap; }
.library-panel .fine { margin:3px 0; line-height:1.45; }
.library-panel .item-link { color:var(--deep); font-weight:600; text-underline-offset:3px; overflow-wrap:anywhere; }
.library-panel details { margin-top:3px; }
.library-panel summary { width:fit-content; color:var(--deep); font-size:.87rem; cursor:pointer; padding:4px 1px; }
.library-panel details p { margin-left:14px; }
.library-panel .remove-favorite { flex:none; font-size:.87rem; min-height:38px; }
.library-panel .text-button[disabled] { opacity:.58; cursor:wait; }
.library-panel .favorite-row { align-items:center; padding-top:2px; padding-bottom:2px; }
.profile-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px; margin-top:18px; }
.profile-actions .underlink { display:inline-flex; min-height:44px; align-items:center; }
#profile-saved { margin:0; color:var(--ink); font-weight:650; }
#profile .contact-email, #profile .contact-phone { grid-column:1 / -1; }
#profile .fields > label > input { font-size:1rem; }
#email-help { margin:6px 0 0; line-height:1.45; }
#email-verify { margin-top:8px; }
#email-verify:has(#email-verify-heading:not([hidden])) {
  display:grid; gap:9px; padding:13px 15px;
  border:1px solid #b8cbbc; border-radius:13px; background:#f0f5ed;
}
#email-verify-heading { margin:0; font:650 1rem/1.35 var(--display); color:var(--ink); }
#email-verify.first-verification:has(#email-verify-heading:focus-visible) { outline:2px solid var(--deep); outline-offset:2px; }
#email-verify-heading:focus-visible { outline:none; }
#email-actions { display:flex; align-items:center; flex-wrap:wrap; gap:0 16px; }
#email-actions .credential-button, #verify-code { min-height:44px; padding:9px 17px; }
#email-actions .text-button { font-size:.91rem; }
#code-entry { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; }
#code-entry label { display:grid; gap:4px; min-width:0; }
#code-entry input {
  width:100%; min-width:0; min-height:44px; padding:8px 12px; border:1px solid #a4b2b1; border-radius:9px;
  background:white; color:var(--ink); font:600 1rem/1.3 'DM Sans',sans-serif; letter-spacing:.13em; font-variant-numeric:tabular-nums;
}
#email-status { display:flex; align-items:center; gap:8px; width:fit-content; margin:0; color:#2a6352; font-weight:650; }
#email-status::before { content:''; width:7px; height:11px; border:solid currentColor; border-width:0 2px 2px 0; transform:rotate(42deg); margin:-3px 3px 0 2px; }
#email-feedback { margin:0; overflow-wrap:anywhere; line-height:1.45; }
#email-feedback:empty { display: none; }
@media (max-width:450px) {
  .profile-actions > .primary { flex:1 0 100%; }
}
@media (max-width:350px) {
  #profile .links { display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:12px; }
  #change-password { grid-column:1 / -1; }
  #profile .links button { justify-self:start; }
  #profile .links #delete { justify-self:end; }
}
.account-checking :is(#member-library,#profile,#password-form,#recovery-key-panel,#item-return,#checkout-return) { display:none!important; }
#account-deleted { margin-block:12px; }
#account-deleted p { color:var(--ink); font-weight:650; }
.links #delete, #delete-error { color:#85352d; }
#delete-dialog {
  width:min(28rem,calc(100% - 32px)); max-height:calc(100dvh - 32px); overflow:auto;
  margin:auto; padding:clamp(20px,4vw,30px); border:1px solid var(--line); border-radius:16px;
  color:var(--ink); background:var(--sheet);
}
#delete-dialog::backdrop { background:rgb(20 48 47 / 48%); }
#delete-title { font-size:clamp(1.65rem,5vw,2.05rem); line-height:1.15; letter-spacing:-.03em; }
#delete-description { margin-block:12px; }
#delete-error:not(:empty) { margin-block:12px; }
.delete-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px 20px; margin-top:20px; }
#delete-cancel { padding-inline:6px; }
#delete-confirm { background:#91382d; }
#delete-confirm:hover { background:#742b23; }
.birthday-field { display:block; grid-column:1 / -1; min-width:0; margin:0; }
.birthday-field legend { padding:0; margin-bottom:5px; }
.birthday-parts {
  display:grid; grid-template-columns:minmax(0,1.55fr) minmax(0,.8fr) minmax(0,.97fr) 44px;
  overflow:hidden; border:1px solid #a4b2b1; border-radius:12px; background:white;
}
.birthday-parts label {
  display:flex; flex-direction:column; align-items:stretch; min-width:0; gap:3px;
  padding:8px 10px 6px; border-inline-end:1px solid #d6dfd6; color:var(--muted); font-size:.74rem; line-height:1.15;
}
.birthday-parts input, .birthday-parts select {
  display:block; width:100%; min-width:0; min-height:24px; margin:0; padding:0;
  border:0; border-radius:4px; color:var(--ink); background:transparent; font:600 1rem 'DM Sans',sans-serif;
}
.birthday-parts label:focus-within { background:#e5f0e8; box-shadow:inset 0 0 0 2px var(--deep); }
.birthday-parts :is(input,select):focus { outline:0; }
.birthday-parts [aria-invalid="true"] { color:#85352d; }
#birthday-calendar-toggle {
  display:grid; align-self:stretch; place-items:center; min-height:44px; border:0;
  color:var(--deep); background:#edf3e9; cursor:pointer;
}
#birthday-calendar-toggle:hover, #birthday-calendar-toggle[aria-expanded="true"] { background:#dceadb; }
#birthday-calendar-toggle:focus-visible { outline-offset:-4px; }
#birthday-calendar {
  max-width:23rem; margin-top:7px; padding:10px; border:1px solid #aebfb4; border-radius:13px;
  background:#fffcf5; color:var(--ink); box-shadow:0 3px 12px #32494310;
}
.calendar-heading { display:flex; align-items:center; gap:4px; padding:0 1px 5px 5px; }
.calendar-heading>span { margin-right:auto; font:650 1rem/1.3 var(--display); }
.calendar-heading button {
  display:grid; place-items:center; width:44px; height:44px; padding:0; border-radius:50%; border:1px solid #bdcbbd;
  background:transparent; color:var(--deep); font:400 1.45rem/1 'DM Sans',sans-serif; cursor:pointer;
}
.calendar-heading button:disabled { opacity:.34; cursor:default; }
#birthday-calendar table { width:100%; table-layout:fixed; border-collapse:collapse; text-align:center; }
#birthday-calendar th { padding-block:5px; color:var(--muted); font:600 .74rem/1.3 'DM Sans',sans-serif; }
#birthday-calendar td { padding:0; }
#birthday-days button {
  display:grid; place-items:center; width:100%; height:44px; padding:0; border:0; border-radius:8px;
  background:transparent; color:var(--ink); font:550 .93rem/1 'DM Sans',sans-serif; font-variant-numeric:tabular-nums; cursor:pointer;
}
#birthday-days button:hover:not(:disabled):not([aria-pressed="true"]), .calendar-heading button:hover:not(:disabled) { background:#e8efe3; }
#birthday-days button[aria-current="date"] { box-shadow:inset 0 0 0 1px #97ada0; }
#birthday-days button[aria-pressed="true"] { background:var(--deep); color:white; }
#birthday-calendar button:focus-visible { outline-offset:-2px; }
#birthday-days button[aria-pressed="true"]:focus-visible { outline:2px solid white; outline-offset:-4px; }
#birthday-days button:disabled { color:#969f97; cursor:default; }
@media(max-width:370px) {
  .birthday-parts label { padding-inline:6px; }
  #birthday-calendar { padding:7px; }
}
#birthday-saved-value { display:block; width:fit-content; color:var(--ink); font-size:1rem; }
#birthday-error { margin:5px 0 0; color:#85352d; }
#birthday-error:empty { display:none; }
