/* Mobile Tilda is intentionally flat: borders and spacing provide hierarchy. */
@media (max-width: 1023px) {
  html[data-desktop-template="tilda"] body *:not(#tilda-mobile-flat-a):not(#tilda-mobile-flat-b),
  html[data-desktop-template="tilda"] body *::before,
  html[data-desktop-template="tilda"] body *::after {
    box-shadow: none !important;
  }

  html[data-desktop-template="tilda"] body .favBtn:not(#tilda-mobile-flat-a):not(#tilda-mobile-flat-b),
  html[data-desktop-template="tilda"] body .favIcon:not(#tilda-mobile-flat-a):not(#tilda-mobile-flat-b) {
    filter: none !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard:not(.hidden) {
    display: grid !important;
    grid-template-columns: 56px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 14px 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 0 16px !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard .accountProfileAvatar {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    margin: 0 !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard .accountProfileBody {
    width: 100% !important;
    min-width: 0 !important;
    gap: 5px !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard .accountProfileNameRow {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard :is(.accountProfileName, .accountProfileMeta) {
    min-width: 0 !important;
    white-space: normal !important;
    overflow: visible !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard .accountProfileActions {
    position: static !important;
    grid-column: 1 / -1 !important;
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard .accountProfileActions > .accountProfileAction {
    position: static !important;
    width: 100% !important;
    height: 46px !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 46px !important;
    max-height: 46px !important;
    margin: 0 !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    border: 1px solid var(--border, #e5e7eb) !important;
    background: transparent !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard .accountProfileEditBtn {
    grid-column: 1 !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard .accountProfileLogout {
    position: static !important;
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border: 1px solid var(--border, #e5e7eb) !important;
    background: transparent !important;
    font-size: 14px !important;
  }

  html[data-desktop-template="tilda"] body #accountOverlay #accountProfileCard .accountProfileLogout span {
    display: inline !important;
  }
}
