/* Independent profile draft; no shared customer or checkout selectors. */
#desktopProfileDialog:not([open]),
#desktopProfileDialog [hidden],
#desktopProfileNotice[hidden],
body:not([data-layout="desktop"]) #desktopProfileDialog,
body:not([data-layout="desktop"]) #desktopProfileNotice {
  display: none !important;
}

@media (max-width: 1366px) {
  #desktopProfileDialog,
  #desktopProfileNotice {
    display: none !important;
  }
}

@media (min-width: 1367px) {
  body[data-layout="desktop"] #desktopProfileDialog {
    box-sizing: border-box;
    width: min(600px, calc(100vw - 64px));
    max-width: none;
    max-height: calc(100dvh - 64px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--site-line, #e4e5dd);
    border-radius: 22px;
    background: var(--site-surface, #fff);
    color: var(--site-ink, #242a26);
    box-shadow: 0 24px 80px rgb(16 20 15 / 24%);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
  }

  body[data-layout="desktop"] #desktopProfileDialog::backdrop {
    background: rgb(16 20 15 / 48%);
  }

  body[data-layout="desktop"] #desktopProfileDialog *,
  body[data-layout="desktop"] #desktopProfileNotice {
    box-sizing: border-box;
  }

  body[data-layout="desktop"] #desktopProfileForm {
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 66px);
    min-height: 0;
    margin: 0;
    padding: 0;
  }

  body[data-layout="desktop"] #desktopProfileDialog .desktop-profile-header {
    display: flex;
    flex: none;
    align-items: flex-start;
    gap: 20px;
    padding: 26px 28px 22px;
    border-bottom: 1px solid var(--site-line, #e4e5dd);
  }

  body[data-layout="desktop"] #desktopProfileDialog .desktop-profile-heading {
    flex: 1;
    min-width: 0;
  }

  body[data-layout="desktop"] #desktopProfileTitle {
    margin: 0;
    color: var(--site-ink, #242a26) !important;
    font-size: 26px !important;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.5px;
    text-align: left;
  }

  body[data-layout="desktop"] #desktopProfileIntro {
    margin: 10px 0 0;
    color: var(--site-muted, #62695f);
    font-size: 14px !important;
    line-height: 1.55;
    text-align: left;
  }

  body[data-layout="desktop"] #desktopProfileDialog .desktop-profile-body {
    flex: 0 1 auto;
    min-height: 0;
    padding: 24px 28px 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scroll-padding-block: 16px;
  }

  body[data-layout="desktop"] #desktopProfileDialog .desktop-profile-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
  }

  body[data-layout="desktop"] #desktopProfileAddressFields {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--site-line, #e4e5dd);
  }

  body[data-layout="desktop"] #desktopProfileDialog .desktop-profile-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    margin: 0;
    color: var(--site-ink, #242a26);
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
  }

  body[data-layout="desktop"] #desktopProfileDialog .desktop-profile-wide {
    grid-column: 1 / -1;
  }

  body[data-layout="desktop"] #desktopProfileDialog input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 11px 13px;
    border: 1px solid var(--site-line, #e4e5dd);
    border-radius: 10px;
    background: var(--site-canvas, #f7f6f2) !important;
    color: var(--site-ink, #242a26) !important;
    font-family: inherit;
    font-size: 15px !important;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: none;
    text-align: left;
  }

  body[data-layout="desktop"] #desktopProfileDialog input:hover {
    border-color: var(--site-muted, #62695f);
  }

  body[data-layout="desktop"] #desktopProfileDialog input:focus {
    border-color: var(--site-focus, #b93830);
    outline: 2px solid var(--site-focus, #b93830);
    outline-offset: 2px;
    box-shadow: none;
  }

  body[data-layout="desktop"] #desktopProfileDialog input[aria-invalid="true"] {
    border-color: var(--site-accent-text, #b93830);
  }

  body[data-layout="desktop"] #desktopProfileDialog .desktop-profile-footer {
    display: flex;
    flex: none;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 28px;
    border-top: 1px solid var(--site-line, #e4e5dd);
    background: var(--site-surface, #fff);
  }

  body[data-layout="desktop"] #desktopProfileDialog button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    min-height: 44px;
    margin: 0;
    padding: 10px 20px;
    border: 1px solid var(--site-line, #e4e5dd);
    border-radius: 10px;
    background: var(--site-surface, #fff);
    color: var(--site-ink, #242a26);
    font-family: inherit;
    font-size: 14px !important;
    font-weight: 600;
    line-height: 1.4;
    box-shadow: none;
    cursor: pointer;
  }

  body[data-layout="desktop"] #desktopProfileDialog button:hover:not(:disabled) {
    background: var(--site-raised, #f0f1eb);
  }

  body[data-layout="desktop"] #desktopProfileDialog #desktopProfileClose {
    width: 40px;
    min-height: 40px;
    padding: 9px;
    border-color: transparent;
    background: var(--site-raised, #f0f1eb);
    color: var(--site-muted, #62695f);
  }

  body[data-layout="desktop"] #desktopProfileClose svg {
    display: block;
    width: 20px;
    height: 20px;
  }

  body[data-layout="desktop"] #desktopProfileDialog #desktopProfileSave {
    min-width: 112px;
    border-color: transparent;
    background: var(--site-accent-soft, #fcede9);
    color: var(--site-accent-text, #b93830);
  }

  body[data-layout="desktop"] #desktopProfileDialog #desktopProfileSave:hover:not(:disabled) {
    border-color: var(--site-accent-text, #b93830);
  }

  body[data-layout="desktop"] #desktopProfileDialog button:focus-visible {
    outline: 2px solid var(--site-focus, #b93830);
    outline-offset: 3px;
  }

  body[data-layout="desktop"] #desktopProfileDialog button:disabled {
    opacity: .55;
    cursor: not-allowed;
  }

  body[data-layout="desktop"] #desktopProfileError {
    margin: 20px 0 0;
    padding: 12px 14px;
    border-left: 3px solid var(--site-accent-text, #b93830);
    border-radius: 0 8px 8px 0;
    background: var(--site-accent-soft, #fcede9);
    color: var(--site-accent-text, #b93830);
    font-size: 14px !important;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
  }

  body[data-layout="desktop"] #desktopProfileNotice {
    position: fixed;
    z-index: 2300;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(480px, calc(100vw - 64px));
    margin: 0;
    padding: 12px 18px;
    border: 1px solid var(--site-line, #e4e5dd);
    border-radius: 12px;
    background: var(--site-surface, #fff);
    color: var(--site-ink, #242a26);
    box-shadow: 0 8px 28px rgb(16 20 15 / 14%);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px !important;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
  }
}
